this repo has no description
0
fork

Configure Feed

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

lexgen: incorporate new tools.ozone namespace; bunch of old lexicons deprecated (#617)

DO NOT MERGE YET

This is based off the atproto PR:
https://github.com/bluesky-social/atproto/pull/2288

Does mostly expected things, adding `api/ozone` for tools.ozone.*
namespace. Easier than expected because no records in that namespace, so
no cborgen needed.

There are some cborgen changes rolled up in this PR. I think I didn't
commit changes to at least the bsky codegen, something about string and
pointer-to-string. I assume those are unrelated to the namespace stuff
and should be resolved in a separate clean PR.

~I haven't self-reviewed or tested this at all, should do that before
merging or deploying. I *think* I caught all the string constants with
`com.atproto.admin.defs#whatever` in code, but there might be more
lurking (these don't result in compile-time errors).~

authored by

bnewbold and committed by
GitHub
4b304fb1 8ecf685c

+1318 -1623
+1
Makefile
··· 65 65 lexgen: ## Run codegen tool for lexicons (lexicon JSON to Go packages) 66 66 go run ./cmd/lexgen/ --package bsky --prefix app.bsky --outdir api/bsky $(LEXDIR) 67 67 go run ./cmd/lexgen/ --package atproto --prefix com.atproto --outdir api/atproto $(LEXDIR) 68 + go run ./cmd/lexgen/ --package ozone --prefix tools.ozone --outdir api/ozone $(LEXDIR) 68 69 69 70 .PHONY: cborgen 70 71 cborgen: ## Run codegen tool for CBOR serialization
-33
api/atproto/admincreateCommunicationTemplate.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.admin.createCommunicationTemplate 6 - 7 - import ( 8 - "context" 9 - 10 - "github.com/bluesky-social/indigo/xrpc" 11 - ) 12 - 13 - // AdminCreateCommunicationTemplate_Input is the input argument to a com.atproto.admin.createCommunicationTemplate call. 14 - type AdminCreateCommunicationTemplate_Input struct { 15 - // contentMarkdown: Content of the template, markdown supported, can contain variable placeholders. 16 - ContentMarkdown string `json:"contentMarkdown" cborgen:"contentMarkdown"` 17 - // createdBy: DID of the user who is creating the template. 18 - CreatedBy *string `json:"createdBy,omitempty" cborgen:"createdBy,omitempty"` 19 - // name: Name of the template. 20 - Name string `json:"name" cborgen:"name"` 21 - // subject: Subject of the message, used in emails. 22 - Subject string `json:"subject" cborgen:"subject"` 23 - } 24 - 25 - // AdminCreateCommunicationTemplate calls the XRPC method "com.atproto.admin.createCommunicationTemplate". 26 - func AdminCreateCommunicationTemplate(ctx context.Context, c *xrpc.Client, input *AdminCreateCommunicationTemplate_Input) (*AdminDefs_CommunicationTemplateView, error) { 27 - var out AdminDefs_CommunicationTemplateView 28 - if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.admin.createCommunicationTemplate", nil, input, &out); err != nil { 29 - return nil, err 30 - } 31 - 32 - return &out, nil 33 - }
-782
api/atproto/admindefs.go
··· 5 5 // schema: com.atproto.admin.defs 6 6 7 7 import ( 8 - "encoding/json" 9 - "fmt" 10 - 11 8 "github.com/bluesky-social/indigo/lex/util" 12 9 ) 13 10 ··· 25 22 RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords,omitempty" cborgen:"relatedRecords,omitempty"` 26 23 } 27 24 28 - // AdminDefs_BlobView is a "blobView" in the com.atproto.admin.defs schema. 29 - type AdminDefs_BlobView struct { 30 - Cid string `json:"cid" cborgen:"cid"` 31 - CreatedAt string `json:"createdAt" cborgen:"createdAt"` 32 - Details *AdminDefs_BlobView_Details `json:"details,omitempty" cborgen:"details,omitempty"` 33 - MimeType string `json:"mimeType" cborgen:"mimeType"` 34 - Moderation *AdminDefs_Moderation `json:"moderation,omitempty" cborgen:"moderation,omitempty"` 35 - Size int64 `json:"size" cborgen:"size"` 36 - } 37 - 38 - type AdminDefs_BlobView_Details struct { 39 - AdminDefs_ImageDetails *AdminDefs_ImageDetails 40 - AdminDefs_VideoDetails *AdminDefs_VideoDetails 41 - } 42 - 43 - func (t *AdminDefs_BlobView_Details) MarshalJSON() ([]byte, error) { 44 - if t.AdminDefs_ImageDetails != nil { 45 - t.AdminDefs_ImageDetails.LexiconTypeID = "com.atproto.admin.defs#imageDetails" 46 - return json.Marshal(t.AdminDefs_ImageDetails) 47 - } 48 - if t.AdminDefs_VideoDetails != nil { 49 - t.AdminDefs_VideoDetails.LexiconTypeID = "com.atproto.admin.defs#videoDetails" 50 - return json.Marshal(t.AdminDefs_VideoDetails) 51 - } 52 - return nil, fmt.Errorf("cannot marshal empty enum") 53 - } 54 - func (t *AdminDefs_BlobView_Details) UnmarshalJSON(b []byte) error { 55 - typ, err := util.TypeExtract(b) 56 - if err != nil { 57 - return err 58 - } 59 - 60 - switch typ { 61 - case "com.atproto.admin.defs#imageDetails": 62 - t.AdminDefs_ImageDetails = new(AdminDefs_ImageDetails) 63 - return json.Unmarshal(b, t.AdminDefs_ImageDetails) 64 - case "com.atproto.admin.defs#videoDetails": 65 - t.AdminDefs_VideoDetails = new(AdminDefs_VideoDetails) 66 - return json.Unmarshal(b, t.AdminDefs_VideoDetails) 67 - 68 - default: 69 - return nil 70 - } 71 - } 72 - 73 - // AdminDefs_CommunicationTemplateView is a "communicationTemplateView" in the com.atproto.admin.defs schema. 74 - type AdminDefs_CommunicationTemplateView struct { 75 - // contentMarkdown: Subject of the message, used in emails. 76 - ContentMarkdown string `json:"contentMarkdown" cborgen:"contentMarkdown"` 77 - CreatedAt string `json:"createdAt" cborgen:"createdAt"` 78 - Disabled bool `json:"disabled" cborgen:"disabled"` 79 - Id string `json:"id" cborgen:"id"` 80 - // lastUpdatedBy: DID of the user who last updated the template. 81 - LastUpdatedBy string `json:"lastUpdatedBy" cborgen:"lastUpdatedBy"` 82 - // name: Name of the template. 83 - Name string `json:"name" cborgen:"name"` 84 - // subject: Content of the template, can contain markdown and variable placeholders. 85 - Subject *string `json:"subject,omitempty" cborgen:"subject,omitempty"` 86 - UpdatedAt string `json:"updatedAt" cborgen:"updatedAt"` 87 - } 88 - 89 - // AdminDefs_ImageDetails is a "imageDetails" in the com.atproto.admin.defs schema. 90 - // 91 - // RECORDTYPE: AdminDefs_ImageDetails 92 - type AdminDefs_ImageDetails struct { 93 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#imageDetails" cborgen:"$type,const=com.atproto.admin.defs#imageDetails"` 94 - Height int64 `json:"height" cborgen:"height"` 95 - Width int64 `json:"width" cborgen:"width"` 96 - } 97 - 98 - // AdminDefs_ModEventAcknowledge is a "modEventAcknowledge" in the com.atproto.admin.defs schema. 99 - // 100 - // RECORDTYPE: AdminDefs_ModEventAcknowledge 101 - type AdminDefs_ModEventAcknowledge struct { 102 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#modEventAcknowledge" cborgen:"$type,const=com.atproto.admin.defs#modEventAcknowledge"` 103 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 104 - } 105 - 106 - // AdminDefs_ModEventComment is a "modEventComment" in the com.atproto.admin.defs schema. 107 - // 108 - // # Add a comment to a subject 109 - // 110 - // RECORDTYPE: AdminDefs_ModEventComment 111 - type AdminDefs_ModEventComment struct { 112 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#modEventComment" cborgen:"$type,const=com.atproto.admin.defs#modEventComment"` 113 - Comment string `json:"comment" cborgen:"comment"` 114 - // sticky: Make the comment persistent on the subject 115 - Sticky *bool `json:"sticky,omitempty" cborgen:"sticky,omitempty"` 116 - } 117 - 118 - // AdminDefs_ModEventEmail is a "modEventEmail" in the com.atproto.admin.defs schema. 119 - // 120 - // # Keep a log of outgoing email to a user 121 - // 122 - // RECORDTYPE: AdminDefs_ModEventEmail 123 - type AdminDefs_ModEventEmail struct { 124 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#modEventEmail" cborgen:"$type,const=com.atproto.admin.defs#modEventEmail"` 125 - // comment: Additional comment about the outgoing comm. 126 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 127 - // content: The content of the email sent to the user. 128 - Content *string `json:"content,omitempty" cborgen:"content,omitempty"` 129 - // subjectLine: The subject line of the email sent to the user. 130 - SubjectLine string `json:"subjectLine" cborgen:"subjectLine"` 131 - } 132 - 133 - // AdminDefs_ModEventEscalate is a "modEventEscalate" in the com.atproto.admin.defs schema. 134 - // 135 - // RECORDTYPE: AdminDefs_ModEventEscalate 136 - type AdminDefs_ModEventEscalate struct { 137 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#modEventEscalate" cborgen:"$type,const=com.atproto.admin.defs#modEventEscalate"` 138 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 139 - } 140 - 141 - // AdminDefs_ModEventLabel is a "modEventLabel" in the com.atproto.admin.defs schema. 142 - // 143 - // Apply/Negate labels on a subject 144 - // 145 - // RECORDTYPE: AdminDefs_ModEventLabel 146 - type AdminDefs_ModEventLabel struct { 147 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#modEventLabel" cborgen:"$type,const=com.atproto.admin.defs#modEventLabel"` 148 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 149 - CreateLabelVals []string `json:"createLabelVals" cborgen:"createLabelVals"` 150 - NegateLabelVals []string `json:"negateLabelVals" cborgen:"negateLabelVals"` 151 - } 152 - 153 - // AdminDefs_ModEventMute is a "modEventMute" in the com.atproto.admin.defs schema. 154 - // 155 - // # Mute incoming reports on a subject 156 - // 157 - // RECORDTYPE: AdminDefs_ModEventMute 158 - type AdminDefs_ModEventMute struct { 159 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#modEventMute" cborgen:"$type,const=com.atproto.admin.defs#modEventMute"` 160 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 161 - // durationInHours: Indicates how long the subject should remain muted. 162 - DurationInHours int64 `json:"durationInHours" cborgen:"durationInHours"` 163 - } 164 - 165 - // AdminDefs_ModEventReport is a "modEventReport" in the com.atproto.admin.defs schema. 166 - // 167 - // # Report a subject 168 - // 169 - // RECORDTYPE: AdminDefs_ModEventReport 170 - type AdminDefs_ModEventReport struct { 171 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#modEventReport" cborgen:"$type,const=com.atproto.admin.defs#modEventReport"` 172 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 173 - ReportType *string `json:"reportType" cborgen:"reportType"` 174 - } 175 - 176 - // AdminDefs_ModEventResolveAppeal is a "modEventResolveAppeal" in the com.atproto.admin.defs schema. 177 - // 178 - // # Resolve appeal on a subject 179 - // 180 - // RECORDTYPE: AdminDefs_ModEventResolveAppeal 181 - type AdminDefs_ModEventResolveAppeal struct { 182 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#modEventResolveAppeal" cborgen:"$type,const=com.atproto.admin.defs#modEventResolveAppeal"` 183 - // comment: Describe resolution. 184 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 185 - } 186 - 187 - // AdminDefs_ModEventReverseTakedown is a "modEventReverseTakedown" in the com.atproto.admin.defs schema. 188 - // 189 - // # Revert take down action on a subject 190 - // 191 - // RECORDTYPE: AdminDefs_ModEventReverseTakedown 192 - type AdminDefs_ModEventReverseTakedown struct { 193 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#modEventReverseTakedown" cborgen:"$type,const=com.atproto.admin.defs#modEventReverseTakedown"` 194 - // comment: Describe reasoning behind the reversal. 195 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 196 - } 197 - 198 - // AdminDefs_ModEventTag is a "modEventTag" in the com.atproto.admin.defs schema. 199 - // 200 - // Add/Remove a tag on a subject 201 - // 202 - // RECORDTYPE: AdminDefs_ModEventTag 203 - type AdminDefs_ModEventTag struct { 204 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#modEventTag" cborgen:"$type,const=com.atproto.admin.defs#modEventTag"` 205 - // add: Tags to be added to the subject. If already exists, won't be duplicated. 206 - Add []string `json:"add" cborgen:"add"` 207 - // comment: Additional comment about added/removed tags. 208 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 209 - // remove: Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. 210 - Remove []string `json:"remove" cborgen:"remove"` 211 - } 212 - 213 - // AdminDefs_ModEventTakedown is a "modEventTakedown" in the com.atproto.admin.defs schema. 214 - // 215 - // # Take down a subject permanently or temporarily 216 - // 217 - // RECORDTYPE: AdminDefs_ModEventTakedown 218 - type AdminDefs_ModEventTakedown struct { 219 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#modEventTakedown" cborgen:"$type,const=com.atproto.admin.defs#modEventTakedown"` 220 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 221 - // durationInHours: Indicates how long the takedown should be in effect before automatically expiring. 222 - DurationInHours *int64 `json:"durationInHours,omitempty" cborgen:"durationInHours,omitempty"` 223 - } 224 - 225 - // AdminDefs_ModEventUnmute is a "modEventUnmute" in the com.atproto.admin.defs schema. 226 - // 227 - // # Unmute action on a subject 228 - // 229 - // RECORDTYPE: AdminDefs_ModEventUnmute 230 - type AdminDefs_ModEventUnmute struct { 231 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#modEventUnmute" cborgen:"$type,const=com.atproto.admin.defs#modEventUnmute"` 232 - // comment: Describe reasoning behind the reversal. 233 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 234 - } 235 - 236 - // AdminDefs_ModEventView is a "modEventView" in the com.atproto.admin.defs schema. 237 - type AdminDefs_ModEventView struct { 238 - CreatedAt string `json:"createdAt" cborgen:"createdAt"` 239 - CreatedBy string `json:"createdBy" cborgen:"createdBy"` 240 - CreatorHandle *string `json:"creatorHandle,omitempty" cborgen:"creatorHandle,omitempty"` 241 - Event *AdminDefs_ModEventView_Event `json:"event" cborgen:"event"` 242 - Id int64 `json:"id" cborgen:"id"` 243 - Subject *AdminDefs_ModEventView_Subject `json:"subject" cborgen:"subject"` 244 - SubjectBlobCids []string `json:"subjectBlobCids" cborgen:"subjectBlobCids"` 245 - SubjectHandle *string `json:"subjectHandle,omitempty" cborgen:"subjectHandle,omitempty"` 246 - } 247 - 248 - // AdminDefs_ModEventViewDetail is a "modEventViewDetail" in the com.atproto.admin.defs schema. 249 - type AdminDefs_ModEventViewDetail struct { 250 - CreatedAt string `json:"createdAt" cborgen:"createdAt"` 251 - CreatedBy string `json:"createdBy" cborgen:"createdBy"` 252 - Event *AdminDefs_ModEventViewDetail_Event `json:"event" cborgen:"event"` 253 - Id int64 `json:"id" cborgen:"id"` 254 - Subject *AdminDefs_ModEventViewDetail_Subject `json:"subject" cborgen:"subject"` 255 - SubjectBlobs []*AdminDefs_BlobView `json:"subjectBlobs" cborgen:"subjectBlobs"` 256 - } 257 - 258 - type AdminDefs_ModEventViewDetail_Event struct { 259 - AdminDefs_ModEventTakedown *AdminDefs_ModEventTakedown 260 - AdminDefs_ModEventReverseTakedown *AdminDefs_ModEventReverseTakedown 261 - AdminDefs_ModEventComment *AdminDefs_ModEventComment 262 - AdminDefs_ModEventReport *AdminDefs_ModEventReport 263 - AdminDefs_ModEventLabel *AdminDefs_ModEventLabel 264 - AdminDefs_ModEventAcknowledge *AdminDefs_ModEventAcknowledge 265 - AdminDefs_ModEventEscalate *AdminDefs_ModEventEscalate 266 - AdminDefs_ModEventMute *AdminDefs_ModEventMute 267 - AdminDefs_ModEventEmail *AdminDefs_ModEventEmail 268 - AdminDefs_ModEventResolveAppeal *AdminDefs_ModEventResolveAppeal 269 - } 270 - 271 - func (t *AdminDefs_ModEventViewDetail_Event) MarshalJSON() ([]byte, error) { 272 - if t.AdminDefs_ModEventTakedown != nil { 273 - t.AdminDefs_ModEventTakedown.LexiconTypeID = "com.atproto.admin.defs#modEventTakedown" 274 - return json.Marshal(t.AdminDefs_ModEventTakedown) 275 - } 276 - if t.AdminDefs_ModEventReverseTakedown != nil { 277 - t.AdminDefs_ModEventReverseTakedown.LexiconTypeID = "com.atproto.admin.defs#modEventReverseTakedown" 278 - return json.Marshal(t.AdminDefs_ModEventReverseTakedown) 279 - } 280 - if t.AdminDefs_ModEventComment != nil { 281 - t.AdminDefs_ModEventComment.LexiconTypeID = "com.atproto.admin.defs#modEventComment" 282 - return json.Marshal(t.AdminDefs_ModEventComment) 283 - } 284 - if t.AdminDefs_ModEventReport != nil { 285 - t.AdminDefs_ModEventReport.LexiconTypeID = "com.atproto.admin.defs#modEventReport" 286 - return json.Marshal(t.AdminDefs_ModEventReport) 287 - } 288 - if t.AdminDefs_ModEventLabel != nil { 289 - t.AdminDefs_ModEventLabel.LexiconTypeID = "com.atproto.admin.defs#modEventLabel" 290 - return json.Marshal(t.AdminDefs_ModEventLabel) 291 - } 292 - if t.AdminDefs_ModEventAcknowledge != nil { 293 - t.AdminDefs_ModEventAcknowledge.LexiconTypeID = "com.atproto.admin.defs#modEventAcknowledge" 294 - return json.Marshal(t.AdminDefs_ModEventAcknowledge) 295 - } 296 - if t.AdminDefs_ModEventEscalate != nil { 297 - t.AdminDefs_ModEventEscalate.LexiconTypeID = "com.atproto.admin.defs#modEventEscalate" 298 - return json.Marshal(t.AdminDefs_ModEventEscalate) 299 - } 300 - if t.AdminDefs_ModEventMute != nil { 301 - t.AdminDefs_ModEventMute.LexiconTypeID = "com.atproto.admin.defs#modEventMute" 302 - return json.Marshal(t.AdminDefs_ModEventMute) 303 - } 304 - if t.AdminDefs_ModEventEmail != nil { 305 - t.AdminDefs_ModEventEmail.LexiconTypeID = "com.atproto.admin.defs#modEventEmail" 306 - return json.Marshal(t.AdminDefs_ModEventEmail) 307 - } 308 - if t.AdminDefs_ModEventResolveAppeal != nil { 309 - t.AdminDefs_ModEventResolveAppeal.LexiconTypeID = "com.atproto.admin.defs#modEventResolveAppeal" 310 - return json.Marshal(t.AdminDefs_ModEventResolveAppeal) 311 - } 312 - return nil, fmt.Errorf("cannot marshal empty enum") 313 - } 314 - func (t *AdminDefs_ModEventViewDetail_Event) UnmarshalJSON(b []byte) error { 315 - typ, err := util.TypeExtract(b) 316 - if err != nil { 317 - return err 318 - } 319 - 320 - switch typ { 321 - case "com.atproto.admin.defs#modEventTakedown": 322 - t.AdminDefs_ModEventTakedown = new(AdminDefs_ModEventTakedown) 323 - return json.Unmarshal(b, t.AdminDefs_ModEventTakedown) 324 - case "com.atproto.admin.defs#modEventReverseTakedown": 325 - t.AdminDefs_ModEventReverseTakedown = new(AdminDefs_ModEventReverseTakedown) 326 - return json.Unmarshal(b, t.AdminDefs_ModEventReverseTakedown) 327 - case "com.atproto.admin.defs#modEventComment": 328 - t.AdminDefs_ModEventComment = new(AdminDefs_ModEventComment) 329 - return json.Unmarshal(b, t.AdminDefs_ModEventComment) 330 - case "com.atproto.admin.defs#modEventReport": 331 - t.AdminDefs_ModEventReport = new(AdminDefs_ModEventReport) 332 - return json.Unmarshal(b, t.AdminDefs_ModEventReport) 333 - case "com.atproto.admin.defs#modEventLabel": 334 - t.AdminDefs_ModEventLabel = new(AdminDefs_ModEventLabel) 335 - return json.Unmarshal(b, t.AdminDefs_ModEventLabel) 336 - case "com.atproto.admin.defs#modEventAcknowledge": 337 - t.AdminDefs_ModEventAcknowledge = new(AdminDefs_ModEventAcknowledge) 338 - return json.Unmarshal(b, t.AdminDefs_ModEventAcknowledge) 339 - case "com.atproto.admin.defs#modEventEscalate": 340 - t.AdminDefs_ModEventEscalate = new(AdminDefs_ModEventEscalate) 341 - return json.Unmarshal(b, t.AdminDefs_ModEventEscalate) 342 - case "com.atproto.admin.defs#modEventMute": 343 - t.AdminDefs_ModEventMute = new(AdminDefs_ModEventMute) 344 - return json.Unmarshal(b, t.AdminDefs_ModEventMute) 345 - case "com.atproto.admin.defs#modEventEmail": 346 - t.AdminDefs_ModEventEmail = new(AdminDefs_ModEventEmail) 347 - return json.Unmarshal(b, t.AdminDefs_ModEventEmail) 348 - case "com.atproto.admin.defs#modEventResolveAppeal": 349 - t.AdminDefs_ModEventResolveAppeal = new(AdminDefs_ModEventResolveAppeal) 350 - return json.Unmarshal(b, t.AdminDefs_ModEventResolveAppeal) 351 - 352 - default: 353 - return nil 354 - } 355 - } 356 - 357 - type AdminDefs_ModEventViewDetail_Subject struct { 358 - AdminDefs_RepoView *AdminDefs_RepoView 359 - AdminDefs_RepoViewNotFound *AdminDefs_RepoViewNotFound 360 - AdminDefs_RecordView *AdminDefs_RecordView 361 - AdminDefs_RecordViewNotFound *AdminDefs_RecordViewNotFound 362 - } 363 - 364 - func (t *AdminDefs_ModEventViewDetail_Subject) MarshalJSON() ([]byte, error) { 365 - if t.AdminDefs_RepoView != nil { 366 - t.AdminDefs_RepoView.LexiconTypeID = "com.atproto.admin.defs#repoView" 367 - return json.Marshal(t.AdminDefs_RepoView) 368 - } 369 - if t.AdminDefs_RepoViewNotFound != nil { 370 - t.AdminDefs_RepoViewNotFound.LexiconTypeID = "com.atproto.admin.defs#repoViewNotFound" 371 - return json.Marshal(t.AdminDefs_RepoViewNotFound) 372 - } 373 - if t.AdminDefs_RecordView != nil { 374 - t.AdminDefs_RecordView.LexiconTypeID = "com.atproto.admin.defs#recordView" 375 - return json.Marshal(t.AdminDefs_RecordView) 376 - } 377 - if t.AdminDefs_RecordViewNotFound != nil { 378 - t.AdminDefs_RecordViewNotFound.LexiconTypeID = "com.atproto.admin.defs#recordViewNotFound" 379 - return json.Marshal(t.AdminDefs_RecordViewNotFound) 380 - } 381 - return nil, fmt.Errorf("cannot marshal empty enum") 382 - } 383 - func (t *AdminDefs_ModEventViewDetail_Subject) UnmarshalJSON(b []byte) error { 384 - typ, err := util.TypeExtract(b) 385 - if err != nil { 386 - return err 387 - } 388 - 389 - switch typ { 390 - case "com.atproto.admin.defs#repoView": 391 - t.AdminDefs_RepoView = new(AdminDefs_RepoView) 392 - return json.Unmarshal(b, t.AdminDefs_RepoView) 393 - case "com.atproto.admin.defs#repoViewNotFound": 394 - t.AdminDefs_RepoViewNotFound = new(AdminDefs_RepoViewNotFound) 395 - return json.Unmarshal(b, t.AdminDefs_RepoViewNotFound) 396 - case "com.atproto.admin.defs#recordView": 397 - t.AdminDefs_RecordView = new(AdminDefs_RecordView) 398 - return json.Unmarshal(b, t.AdminDefs_RecordView) 399 - case "com.atproto.admin.defs#recordViewNotFound": 400 - t.AdminDefs_RecordViewNotFound = new(AdminDefs_RecordViewNotFound) 401 - return json.Unmarshal(b, t.AdminDefs_RecordViewNotFound) 402 - 403 - default: 404 - return nil 405 - } 406 - } 407 - 408 - type AdminDefs_ModEventView_Event struct { 409 - AdminDefs_ModEventTakedown *AdminDefs_ModEventTakedown 410 - AdminDefs_ModEventReverseTakedown *AdminDefs_ModEventReverseTakedown 411 - AdminDefs_ModEventComment *AdminDefs_ModEventComment 412 - AdminDefs_ModEventReport *AdminDefs_ModEventReport 413 - AdminDefs_ModEventLabel *AdminDefs_ModEventLabel 414 - AdminDefs_ModEventAcknowledge *AdminDefs_ModEventAcknowledge 415 - AdminDefs_ModEventEscalate *AdminDefs_ModEventEscalate 416 - AdminDefs_ModEventMute *AdminDefs_ModEventMute 417 - AdminDefs_ModEventEmail *AdminDefs_ModEventEmail 418 - AdminDefs_ModEventResolveAppeal *AdminDefs_ModEventResolveAppeal 419 - } 420 - 421 - func (t *AdminDefs_ModEventView_Event) MarshalJSON() ([]byte, error) { 422 - if t.AdminDefs_ModEventTakedown != nil { 423 - t.AdminDefs_ModEventTakedown.LexiconTypeID = "com.atproto.admin.defs#modEventTakedown" 424 - return json.Marshal(t.AdminDefs_ModEventTakedown) 425 - } 426 - if t.AdminDefs_ModEventReverseTakedown != nil { 427 - t.AdminDefs_ModEventReverseTakedown.LexiconTypeID = "com.atproto.admin.defs#modEventReverseTakedown" 428 - return json.Marshal(t.AdminDefs_ModEventReverseTakedown) 429 - } 430 - if t.AdminDefs_ModEventComment != nil { 431 - t.AdminDefs_ModEventComment.LexiconTypeID = "com.atproto.admin.defs#modEventComment" 432 - return json.Marshal(t.AdminDefs_ModEventComment) 433 - } 434 - if t.AdminDefs_ModEventReport != nil { 435 - t.AdminDefs_ModEventReport.LexiconTypeID = "com.atproto.admin.defs#modEventReport" 436 - return json.Marshal(t.AdminDefs_ModEventReport) 437 - } 438 - if t.AdminDefs_ModEventLabel != nil { 439 - t.AdminDefs_ModEventLabel.LexiconTypeID = "com.atproto.admin.defs#modEventLabel" 440 - return json.Marshal(t.AdminDefs_ModEventLabel) 441 - } 442 - if t.AdminDefs_ModEventAcknowledge != nil { 443 - t.AdminDefs_ModEventAcknowledge.LexiconTypeID = "com.atproto.admin.defs#modEventAcknowledge" 444 - return json.Marshal(t.AdminDefs_ModEventAcknowledge) 445 - } 446 - if t.AdminDefs_ModEventEscalate != nil { 447 - t.AdminDefs_ModEventEscalate.LexiconTypeID = "com.atproto.admin.defs#modEventEscalate" 448 - return json.Marshal(t.AdminDefs_ModEventEscalate) 449 - } 450 - if t.AdminDefs_ModEventMute != nil { 451 - t.AdminDefs_ModEventMute.LexiconTypeID = "com.atproto.admin.defs#modEventMute" 452 - return json.Marshal(t.AdminDefs_ModEventMute) 453 - } 454 - if t.AdminDefs_ModEventEmail != nil { 455 - t.AdminDefs_ModEventEmail.LexiconTypeID = "com.atproto.admin.defs#modEventEmail" 456 - return json.Marshal(t.AdminDefs_ModEventEmail) 457 - } 458 - if t.AdminDefs_ModEventResolveAppeal != nil { 459 - t.AdminDefs_ModEventResolveAppeal.LexiconTypeID = "com.atproto.admin.defs#modEventResolveAppeal" 460 - return json.Marshal(t.AdminDefs_ModEventResolveAppeal) 461 - } 462 - return nil, fmt.Errorf("cannot marshal empty enum") 463 - } 464 - func (t *AdminDefs_ModEventView_Event) UnmarshalJSON(b []byte) error { 465 - typ, err := util.TypeExtract(b) 466 - if err != nil { 467 - return err 468 - } 469 - 470 - switch typ { 471 - case "com.atproto.admin.defs#modEventTakedown": 472 - t.AdminDefs_ModEventTakedown = new(AdminDefs_ModEventTakedown) 473 - return json.Unmarshal(b, t.AdminDefs_ModEventTakedown) 474 - case "com.atproto.admin.defs#modEventReverseTakedown": 475 - t.AdminDefs_ModEventReverseTakedown = new(AdminDefs_ModEventReverseTakedown) 476 - return json.Unmarshal(b, t.AdminDefs_ModEventReverseTakedown) 477 - case "com.atproto.admin.defs#modEventComment": 478 - t.AdminDefs_ModEventComment = new(AdminDefs_ModEventComment) 479 - return json.Unmarshal(b, t.AdminDefs_ModEventComment) 480 - case "com.atproto.admin.defs#modEventReport": 481 - t.AdminDefs_ModEventReport = new(AdminDefs_ModEventReport) 482 - return json.Unmarshal(b, t.AdminDefs_ModEventReport) 483 - case "com.atproto.admin.defs#modEventLabel": 484 - t.AdminDefs_ModEventLabel = new(AdminDefs_ModEventLabel) 485 - return json.Unmarshal(b, t.AdminDefs_ModEventLabel) 486 - case "com.atproto.admin.defs#modEventAcknowledge": 487 - t.AdminDefs_ModEventAcknowledge = new(AdminDefs_ModEventAcknowledge) 488 - return json.Unmarshal(b, t.AdminDefs_ModEventAcknowledge) 489 - case "com.atproto.admin.defs#modEventEscalate": 490 - t.AdminDefs_ModEventEscalate = new(AdminDefs_ModEventEscalate) 491 - return json.Unmarshal(b, t.AdminDefs_ModEventEscalate) 492 - case "com.atproto.admin.defs#modEventMute": 493 - t.AdminDefs_ModEventMute = new(AdminDefs_ModEventMute) 494 - return json.Unmarshal(b, t.AdminDefs_ModEventMute) 495 - case "com.atproto.admin.defs#modEventEmail": 496 - t.AdminDefs_ModEventEmail = new(AdminDefs_ModEventEmail) 497 - return json.Unmarshal(b, t.AdminDefs_ModEventEmail) 498 - case "com.atproto.admin.defs#modEventResolveAppeal": 499 - t.AdminDefs_ModEventResolveAppeal = new(AdminDefs_ModEventResolveAppeal) 500 - return json.Unmarshal(b, t.AdminDefs_ModEventResolveAppeal) 501 - 502 - default: 503 - return nil 504 - } 505 - } 506 - 507 - type AdminDefs_ModEventView_Subject struct { 508 - AdminDefs_RepoRef *AdminDefs_RepoRef 509 - RepoStrongRef *RepoStrongRef 510 - } 511 - 512 - func (t *AdminDefs_ModEventView_Subject) MarshalJSON() ([]byte, error) { 513 - if t.AdminDefs_RepoRef != nil { 514 - t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" 515 - return json.Marshal(t.AdminDefs_RepoRef) 516 - } 517 - if t.RepoStrongRef != nil { 518 - t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" 519 - return json.Marshal(t.RepoStrongRef) 520 - } 521 - return nil, fmt.Errorf("cannot marshal empty enum") 522 - } 523 - func (t *AdminDefs_ModEventView_Subject) UnmarshalJSON(b []byte) error { 524 - typ, err := util.TypeExtract(b) 525 - if err != nil { 526 - return err 527 - } 528 - 529 - switch typ { 530 - case "com.atproto.admin.defs#repoRef": 531 - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) 532 - return json.Unmarshal(b, t.AdminDefs_RepoRef) 533 - case "com.atproto.repo.strongRef": 534 - t.RepoStrongRef = new(RepoStrongRef) 535 - return json.Unmarshal(b, t.RepoStrongRef) 536 - 537 - default: 538 - return nil 539 - } 540 - } 541 - 542 - // AdminDefs_Moderation is a "moderation" in the com.atproto.admin.defs schema. 543 - type AdminDefs_Moderation struct { 544 - SubjectStatus *AdminDefs_SubjectStatusView `json:"subjectStatus,omitempty" cborgen:"subjectStatus,omitempty"` 545 - } 546 - 547 - // AdminDefs_ModerationDetail is a "moderationDetail" in the com.atproto.admin.defs schema. 548 - type AdminDefs_ModerationDetail struct { 549 - SubjectStatus *AdminDefs_SubjectStatusView `json:"subjectStatus,omitempty" cborgen:"subjectStatus,omitempty"` 550 - } 551 - 552 - // AdminDefs_RecordView is a "recordView" in the com.atproto.admin.defs schema. 553 - // 554 - // RECORDTYPE: AdminDefs_RecordView 555 - type AdminDefs_RecordView struct { 556 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#recordView" cborgen:"$type,const=com.atproto.admin.defs#recordView"` 557 - BlobCids []string `json:"blobCids" cborgen:"blobCids"` 558 - Cid string `json:"cid" cborgen:"cid"` 559 - IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 560 - Moderation *AdminDefs_Moderation `json:"moderation" cborgen:"moderation"` 561 - Repo *AdminDefs_RepoView `json:"repo" cborgen:"repo"` 562 - Uri string `json:"uri" cborgen:"uri"` 563 - Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` 564 - } 565 - 566 - // AdminDefs_RecordViewDetail is a "recordViewDetail" in the com.atproto.admin.defs schema. 567 - type AdminDefs_RecordViewDetail struct { 568 - Blobs []*AdminDefs_BlobView `json:"blobs" cborgen:"blobs"` 569 - Cid string `json:"cid" cborgen:"cid"` 570 - IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 571 - Labels []*LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 572 - Moderation *AdminDefs_ModerationDetail `json:"moderation" cborgen:"moderation"` 573 - Repo *AdminDefs_RepoView `json:"repo" cborgen:"repo"` 574 - Uri string `json:"uri" cborgen:"uri"` 575 - Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` 576 - } 577 - 578 - // AdminDefs_RecordViewNotFound is a "recordViewNotFound" in the com.atproto.admin.defs schema. 579 - // 580 - // RECORDTYPE: AdminDefs_RecordViewNotFound 581 - type AdminDefs_RecordViewNotFound struct { 582 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#recordViewNotFound" cborgen:"$type,const=com.atproto.admin.defs#recordViewNotFound"` 583 - Uri string `json:"uri" cborgen:"uri"` 584 - } 585 - 586 25 // AdminDefs_RepoBlobRef is a "repoBlobRef" in the com.atproto.admin.defs schema. 587 26 // 588 27 // RECORDTYPE: AdminDefs_RepoBlobRef ··· 601 40 Did string `json:"did" cborgen:"did"` 602 41 } 603 42 604 - // AdminDefs_RepoView is a "repoView" in the com.atproto.admin.defs schema. 605 - // 606 - // RECORDTYPE: AdminDefs_RepoView 607 - type AdminDefs_RepoView struct { 608 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#repoView" cborgen:"$type,const=com.atproto.admin.defs#repoView"` 609 - Did string `json:"did" cborgen:"did"` 610 - Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 611 - Handle string `json:"handle" cborgen:"handle"` 612 - IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 613 - InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"` 614 - InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 615 - InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"` 616 - Moderation *AdminDefs_Moderation `json:"moderation" cborgen:"moderation"` 617 - RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"` 618 - } 619 - 620 - // AdminDefs_RepoViewDetail is a "repoViewDetail" in the com.atproto.admin.defs schema. 621 - type AdminDefs_RepoViewDetail struct { 622 - Did string `json:"did" cborgen:"did"` 623 - Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 624 - EmailConfirmedAt *string `json:"emailConfirmedAt,omitempty" cborgen:"emailConfirmedAt,omitempty"` 625 - Handle string `json:"handle" cborgen:"handle"` 626 - IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 627 - InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"` 628 - InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 629 - Invites []*ServerDefs_InviteCode `json:"invites,omitempty" cborgen:"invites,omitempty"` 630 - InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"` 631 - Labels []*LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 632 - Moderation *AdminDefs_ModerationDetail `json:"moderation" cborgen:"moderation"` 633 - RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"` 634 - } 635 - 636 - // AdminDefs_RepoViewNotFound is a "repoViewNotFound" in the com.atproto.admin.defs schema. 637 - // 638 - // RECORDTYPE: AdminDefs_RepoViewNotFound 639 - type AdminDefs_RepoViewNotFound struct { 640 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#repoViewNotFound" cborgen:"$type,const=com.atproto.admin.defs#repoViewNotFound"` 641 - Did string `json:"did" cborgen:"did"` 642 - } 643 - 644 - // AdminDefs_ReportView is a "reportView" in the com.atproto.admin.defs schema. 645 - type AdminDefs_ReportView struct { 646 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 647 - CreatedAt string `json:"createdAt" cborgen:"createdAt"` 648 - Id int64 `json:"id" cborgen:"id"` 649 - ReasonType *string `json:"reasonType" cborgen:"reasonType"` 650 - ReportedBy string `json:"reportedBy" cborgen:"reportedBy"` 651 - ResolvedByActionIds []int64 `json:"resolvedByActionIds" cborgen:"resolvedByActionIds"` 652 - Subject *AdminDefs_ReportView_Subject `json:"subject" cborgen:"subject"` 653 - SubjectRepoHandle *string `json:"subjectRepoHandle,omitempty" cborgen:"subjectRepoHandle,omitempty"` 654 - } 655 - 656 - // AdminDefs_ReportViewDetail is a "reportViewDetail" in the com.atproto.admin.defs schema. 657 - type AdminDefs_ReportViewDetail struct { 658 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 659 - CreatedAt string `json:"createdAt" cborgen:"createdAt"` 660 - Id int64 `json:"id" cborgen:"id"` 661 - ReasonType *string `json:"reasonType" cborgen:"reasonType"` 662 - ReportedBy string `json:"reportedBy" cborgen:"reportedBy"` 663 - ResolvedByActions []*AdminDefs_ModEventView `json:"resolvedByActions" cborgen:"resolvedByActions"` 664 - Subject *AdminDefs_ReportViewDetail_Subject `json:"subject" cborgen:"subject"` 665 - SubjectStatus *AdminDefs_SubjectStatusView `json:"subjectStatus,omitempty" cborgen:"subjectStatus,omitempty"` 666 - } 667 - 668 - type AdminDefs_ReportViewDetail_Subject struct { 669 - AdminDefs_RepoView *AdminDefs_RepoView 670 - AdminDefs_RepoViewNotFound *AdminDefs_RepoViewNotFound 671 - AdminDefs_RecordView *AdminDefs_RecordView 672 - AdminDefs_RecordViewNotFound *AdminDefs_RecordViewNotFound 673 - } 674 - 675 - func (t *AdminDefs_ReportViewDetail_Subject) MarshalJSON() ([]byte, error) { 676 - if t.AdminDefs_RepoView != nil { 677 - t.AdminDefs_RepoView.LexiconTypeID = "com.atproto.admin.defs#repoView" 678 - return json.Marshal(t.AdminDefs_RepoView) 679 - } 680 - if t.AdminDefs_RepoViewNotFound != nil { 681 - t.AdminDefs_RepoViewNotFound.LexiconTypeID = "com.atproto.admin.defs#repoViewNotFound" 682 - return json.Marshal(t.AdminDefs_RepoViewNotFound) 683 - } 684 - if t.AdminDefs_RecordView != nil { 685 - t.AdminDefs_RecordView.LexiconTypeID = "com.atproto.admin.defs#recordView" 686 - return json.Marshal(t.AdminDefs_RecordView) 687 - } 688 - if t.AdminDefs_RecordViewNotFound != nil { 689 - t.AdminDefs_RecordViewNotFound.LexiconTypeID = "com.atproto.admin.defs#recordViewNotFound" 690 - return json.Marshal(t.AdminDefs_RecordViewNotFound) 691 - } 692 - return nil, fmt.Errorf("cannot marshal empty enum") 693 - } 694 - func (t *AdminDefs_ReportViewDetail_Subject) UnmarshalJSON(b []byte) error { 695 - typ, err := util.TypeExtract(b) 696 - if err != nil { 697 - return err 698 - } 699 - 700 - switch typ { 701 - case "com.atproto.admin.defs#repoView": 702 - t.AdminDefs_RepoView = new(AdminDefs_RepoView) 703 - return json.Unmarshal(b, t.AdminDefs_RepoView) 704 - case "com.atproto.admin.defs#repoViewNotFound": 705 - t.AdminDefs_RepoViewNotFound = new(AdminDefs_RepoViewNotFound) 706 - return json.Unmarshal(b, t.AdminDefs_RepoViewNotFound) 707 - case "com.atproto.admin.defs#recordView": 708 - t.AdminDefs_RecordView = new(AdminDefs_RecordView) 709 - return json.Unmarshal(b, t.AdminDefs_RecordView) 710 - case "com.atproto.admin.defs#recordViewNotFound": 711 - t.AdminDefs_RecordViewNotFound = new(AdminDefs_RecordViewNotFound) 712 - return json.Unmarshal(b, t.AdminDefs_RecordViewNotFound) 713 - 714 - default: 715 - return nil 716 - } 717 - } 718 - 719 - type AdminDefs_ReportView_Subject struct { 720 - AdminDefs_RepoRef *AdminDefs_RepoRef 721 - RepoStrongRef *RepoStrongRef 722 - } 723 - 724 - func (t *AdminDefs_ReportView_Subject) MarshalJSON() ([]byte, error) { 725 - if t.AdminDefs_RepoRef != nil { 726 - t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" 727 - return json.Marshal(t.AdminDefs_RepoRef) 728 - } 729 - if t.RepoStrongRef != nil { 730 - t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" 731 - return json.Marshal(t.RepoStrongRef) 732 - } 733 - return nil, fmt.Errorf("cannot marshal empty enum") 734 - } 735 - func (t *AdminDefs_ReportView_Subject) UnmarshalJSON(b []byte) error { 736 - typ, err := util.TypeExtract(b) 737 - if err != nil { 738 - return err 739 - } 740 - 741 - switch typ { 742 - case "com.atproto.admin.defs#repoRef": 743 - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) 744 - return json.Unmarshal(b, t.AdminDefs_RepoRef) 745 - case "com.atproto.repo.strongRef": 746 - t.RepoStrongRef = new(RepoStrongRef) 747 - return json.Unmarshal(b, t.RepoStrongRef) 748 - 749 - default: 750 - return nil 751 - } 752 - } 753 - 754 43 // AdminDefs_StatusAttr is a "statusAttr" in the com.atproto.admin.defs schema. 755 44 type AdminDefs_StatusAttr struct { 756 45 Applied bool `json:"applied" cborgen:"applied"` 757 46 Ref *string `json:"ref,omitempty" cborgen:"ref,omitempty"` 758 47 } 759 - 760 - // AdminDefs_SubjectStatusView is a "subjectStatusView" in the com.atproto.admin.defs schema. 761 - type AdminDefs_SubjectStatusView struct { 762 - // 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. 763 - Appealed *bool `json:"appealed,omitempty" cborgen:"appealed,omitempty"` 764 - // comment: Sticky comment on the subject. 765 - Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 766 - // createdAt: Timestamp referencing the first moderation status impacting event was emitted on the subject 767 - CreatedAt string `json:"createdAt" cborgen:"createdAt"` 768 - Id int64 `json:"id" cborgen:"id"` 769 - // lastAppealedAt: Timestamp referencing when the author of the subject appealed a moderation action 770 - LastAppealedAt *string `json:"lastAppealedAt,omitempty" cborgen:"lastAppealedAt,omitempty"` 771 - LastReportedAt *string `json:"lastReportedAt,omitempty" cborgen:"lastReportedAt,omitempty"` 772 - LastReviewedAt *string `json:"lastReviewedAt,omitempty" cborgen:"lastReviewedAt,omitempty"` 773 - LastReviewedBy *string `json:"lastReviewedBy,omitempty" cborgen:"lastReviewedBy,omitempty"` 774 - MuteUntil *string `json:"muteUntil,omitempty" cborgen:"muteUntil,omitempty"` 775 - ReviewState *string `json:"reviewState" cborgen:"reviewState"` 776 - Subject *AdminDefs_SubjectStatusView_Subject `json:"subject" cborgen:"subject"` 777 - SubjectBlobCids []string `json:"subjectBlobCids,omitempty" cborgen:"subjectBlobCids,omitempty"` 778 - SubjectRepoHandle *string `json:"subjectRepoHandle,omitempty" cborgen:"subjectRepoHandle,omitempty"` 779 - SuspendUntil *string `json:"suspendUntil,omitempty" cborgen:"suspendUntil,omitempty"` 780 - Tags []string `json:"tags,omitempty" cborgen:"tags,omitempty"` 781 - Takendown *bool `json:"takendown,omitempty" cborgen:"takendown,omitempty"` 782 - // updatedAt: Timestamp referencing when the last update was made to the moderation status of the subject 783 - UpdatedAt string `json:"updatedAt" cborgen:"updatedAt"` 784 - } 785 - 786 - type AdminDefs_SubjectStatusView_Subject struct { 787 - AdminDefs_RepoRef *AdminDefs_RepoRef 788 - RepoStrongRef *RepoStrongRef 789 - } 790 - 791 - func (t *AdminDefs_SubjectStatusView_Subject) MarshalJSON() ([]byte, error) { 792 - if t.AdminDefs_RepoRef != nil { 793 - t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" 794 - return json.Marshal(t.AdminDefs_RepoRef) 795 - } 796 - if t.RepoStrongRef != nil { 797 - t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" 798 - return json.Marshal(t.RepoStrongRef) 799 - } 800 - return nil, fmt.Errorf("cannot marshal empty enum") 801 - } 802 - func (t *AdminDefs_SubjectStatusView_Subject) UnmarshalJSON(b []byte) error { 803 - typ, err := util.TypeExtract(b) 804 - if err != nil { 805 - return err 806 - } 807 - 808 - switch typ { 809 - case "com.atproto.admin.defs#repoRef": 810 - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) 811 - return json.Unmarshal(b, t.AdminDefs_RepoRef) 812 - case "com.atproto.repo.strongRef": 813 - t.RepoStrongRef = new(RepoStrongRef) 814 - return json.Unmarshal(b, t.RepoStrongRef) 815 - 816 - default: 817 - return nil 818 - } 819 - } 820 - 821 - // AdminDefs_VideoDetails is a "videoDetails" in the com.atproto.admin.defs schema. 822 - // 823 - // RECORDTYPE: AdminDefs_VideoDetails 824 - type AdminDefs_VideoDetails struct { 825 - LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#videoDetails" cborgen:"$type,const=com.atproto.admin.defs#videoDetails"` 826 - Height int64 `json:"height" cborgen:"height"` 827 - Length int64 `json:"length" cborgen:"length"` 828 - Width int64 `json:"width" cborgen:"width"` 829 - }
-25
api/atproto/admindeleteCommunicationTemplate.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.admin.deleteCommunicationTemplate 6 - 7 - import ( 8 - "context" 9 - 10 - "github.com/bluesky-social/indigo/xrpc" 11 - ) 12 - 13 - // AdminDeleteCommunicationTemplate_Input is the input argument to a com.atproto.admin.deleteCommunicationTemplate call. 14 - type AdminDeleteCommunicationTemplate_Input struct { 15 - Id string `json:"id" cborgen:"id"` 16 - } 17 - 18 - // AdminDeleteCommunicationTemplate calls the XRPC method "com.atproto.admin.deleteCommunicationTemplate". 19 - func AdminDeleteCommunicationTemplate(ctx context.Context, c *xrpc.Client, input *AdminDeleteCommunicationTemplate_Input) error { 20 - if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.admin.deleteCommunicationTemplate", nil, input, nil); err != nil { 21 - return err 22 - } 23 - 24 - return nil 25 - }
-174
api/atproto/adminemitModerationEvent.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.admin.emitModerationEvent 6 - 7 - import ( 8 - "context" 9 - "encoding/json" 10 - "fmt" 11 - 12 - "github.com/bluesky-social/indigo/lex/util" 13 - "github.com/bluesky-social/indigo/xrpc" 14 - ) 15 - 16 - // AdminEmitModerationEvent_Input is the input argument to a com.atproto.admin.emitModerationEvent call. 17 - type AdminEmitModerationEvent_Input struct { 18 - CreatedBy string `json:"createdBy" cborgen:"createdBy"` 19 - Event *AdminEmitModerationEvent_Input_Event `json:"event" cborgen:"event"` 20 - Subject *AdminEmitModerationEvent_Input_Subject `json:"subject" cborgen:"subject"` 21 - SubjectBlobCids []string `json:"subjectBlobCids,omitempty" cborgen:"subjectBlobCids,omitempty"` 22 - } 23 - 24 - type AdminEmitModerationEvent_Input_Event struct { 25 - AdminDefs_ModEventTakedown *AdminDefs_ModEventTakedown 26 - AdminDefs_ModEventAcknowledge *AdminDefs_ModEventAcknowledge 27 - AdminDefs_ModEventEscalate *AdminDefs_ModEventEscalate 28 - AdminDefs_ModEventComment *AdminDefs_ModEventComment 29 - AdminDefs_ModEventLabel *AdminDefs_ModEventLabel 30 - AdminDefs_ModEventReport *AdminDefs_ModEventReport 31 - AdminDefs_ModEventMute *AdminDefs_ModEventMute 32 - AdminDefs_ModEventReverseTakedown *AdminDefs_ModEventReverseTakedown 33 - AdminDefs_ModEventUnmute *AdminDefs_ModEventUnmute 34 - AdminDefs_ModEventEmail *AdminDefs_ModEventEmail 35 - AdminDefs_ModEventTag *AdminDefs_ModEventTag 36 - } 37 - 38 - func (t *AdminEmitModerationEvent_Input_Event) MarshalJSON() ([]byte, error) { 39 - if t.AdminDefs_ModEventTakedown != nil { 40 - t.AdminDefs_ModEventTakedown.LexiconTypeID = "com.atproto.admin.defs#modEventTakedown" 41 - return json.Marshal(t.AdminDefs_ModEventTakedown) 42 - } 43 - if t.AdminDefs_ModEventAcknowledge != nil { 44 - t.AdminDefs_ModEventAcknowledge.LexiconTypeID = "com.atproto.admin.defs#modEventAcknowledge" 45 - return json.Marshal(t.AdminDefs_ModEventAcknowledge) 46 - } 47 - if t.AdminDefs_ModEventEscalate != nil { 48 - t.AdminDefs_ModEventEscalate.LexiconTypeID = "com.atproto.admin.defs#modEventEscalate" 49 - return json.Marshal(t.AdminDefs_ModEventEscalate) 50 - } 51 - if t.AdminDefs_ModEventComment != nil { 52 - t.AdminDefs_ModEventComment.LexiconTypeID = "com.atproto.admin.defs#modEventComment" 53 - return json.Marshal(t.AdminDefs_ModEventComment) 54 - } 55 - if t.AdminDefs_ModEventLabel != nil { 56 - t.AdminDefs_ModEventLabel.LexiconTypeID = "com.atproto.admin.defs#modEventLabel" 57 - return json.Marshal(t.AdminDefs_ModEventLabel) 58 - } 59 - if t.AdminDefs_ModEventReport != nil { 60 - t.AdminDefs_ModEventReport.LexiconTypeID = "com.atproto.admin.defs#modEventReport" 61 - return json.Marshal(t.AdminDefs_ModEventReport) 62 - } 63 - if t.AdminDefs_ModEventMute != nil { 64 - t.AdminDefs_ModEventMute.LexiconTypeID = "com.atproto.admin.defs#modEventMute" 65 - return json.Marshal(t.AdminDefs_ModEventMute) 66 - } 67 - if t.AdminDefs_ModEventReverseTakedown != nil { 68 - t.AdminDefs_ModEventReverseTakedown.LexiconTypeID = "com.atproto.admin.defs#modEventReverseTakedown" 69 - return json.Marshal(t.AdminDefs_ModEventReverseTakedown) 70 - } 71 - if t.AdminDefs_ModEventUnmute != nil { 72 - t.AdminDefs_ModEventUnmute.LexiconTypeID = "com.atproto.admin.defs#modEventUnmute" 73 - return json.Marshal(t.AdminDefs_ModEventUnmute) 74 - } 75 - if t.AdminDefs_ModEventEmail != nil { 76 - t.AdminDefs_ModEventEmail.LexiconTypeID = "com.atproto.admin.defs#modEventEmail" 77 - return json.Marshal(t.AdminDefs_ModEventEmail) 78 - } 79 - if t.AdminDefs_ModEventTag != nil { 80 - t.AdminDefs_ModEventTag.LexiconTypeID = "com.atproto.admin.defs#modEventTag" 81 - return json.Marshal(t.AdminDefs_ModEventTag) 82 - } 83 - return nil, fmt.Errorf("cannot marshal empty enum") 84 - } 85 - func (t *AdminEmitModerationEvent_Input_Event) UnmarshalJSON(b []byte) error { 86 - typ, err := util.TypeExtract(b) 87 - if err != nil { 88 - return err 89 - } 90 - 91 - switch typ { 92 - case "com.atproto.admin.defs#modEventTakedown": 93 - t.AdminDefs_ModEventTakedown = new(AdminDefs_ModEventTakedown) 94 - return json.Unmarshal(b, t.AdminDefs_ModEventTakedown) 95 - case "com.atproto.admin.defs#modEventAcknowledge": 96 - t.AdminDefs_ModEventAcknowledge = new(AdminDefs_ModEventAcknowledge) 97 - return json.Unmarshal(b, t.AdminDefs_ModEventAcknowledge) 98 - case "com.atproto.admin.defs#modEventEscalate": 99 - t.AdminDefs_ModEventEscalate = new(AdminDefs_ModEventEscalate) 100 - return json.Unmarshal(b, t.AdminDefs_ModEventEscalate) 101 - case "com.atproto.admin.defs#modEventComment": 102 - t.AdminDefs_ModEventComment = new(AdminDefs_ModEventComment) 103 - return json.Unmarshal(b, t.AdminDefs_ModEventComment) 104 - case "com.atproto.admin.defs#modEventLabel": 105 - t.AdminDefs_ModEventLabel = new(AdminDefs_ModEventLabel) 106 - return json.Unmarshal(b, t.AdminDefs_ModEventLabel) 107 - case "com.atproto.admin.defs#modEventReport": 108 - t.AdminDefs_ModEventReport = new(AdminDefs_ModEventReport) 109 - return json.Unmarshal(b, t.AdminDefs_ModEventReport) 110 - case "com.atproto.admin.defs#modEventMute": 111 - t.AdminDefs_ModEventMute = new(AdminDefs_ModEventMute) 112 - return json.Unmarshal(b, t.AdminDefs_ModEventMute) 113 - case "com.atproto.admin.defs#modEventReverseTakedown": 114 - t.AdminDefs_ModEventReverseTakedown = new(AdminDefs_ModEventReverseTakedown) 115 - return json.Unmarshal(b, t.AdminDefs_ModEventReverseTakedown) 116 - case "com.atproto.admin.defs#modEventUnmute": 117 - t.AdminDefs_ModEventUnmute = new(AdminDefs_ModEventUnmute) 118 - return json.Unmarshal(b, t.AdminDefs_ModEventUnmute) 119 - case "com.atproto.admin.defs#modEventEmail": 120 - t.AdminDefs_ModEventEmail = new(AdminDefs_ModEventEmail) 121 - return json.Unmarshal(b, t.AdminDefs_ModEventEmail) 122 - case "com.atproto.admin.defs#modEventTag": 123 - t.AdminDefs_ModEventTag = new(AdminDefs_ModEventTag) 124 - return json.Unmarshal(b, t.AdminDefs_ModEventTag) 125 - 126 - default: 127 - return nil 128 - } 129 - } 130 - 131 - type AdminEmitModerationEvent_Input_Subject struct { 132 - AdminDefs_RepoRef *AdminDefs_RepoRef 133 - RepoStrongRef *RepoStrongRef 134 - } 135 - 136 - func (t *AdminEmitModerationEvent_Input_Subject) MarshalJSON() ([]byte, error) { 137 - if t.AdminDefs_RepoRef != nil { 138 - t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" 139 - return json.Marshal(t.AdminDefs_RepoRef) 140 - } 141 - if t.RepoStrongRef != nil { 142 - t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" 143 - return json.Marshal(t.RepoStrongRef) 144 - } 145 - return nil, fmt.Errorf("cannot marshal empty enum") 146 - } 147 - func (t *AdminEmitModerationEvent_Input_Subject) UnmarshalJSON(b []byte) error { 148 - typ, err := util.TypeExtract(b) 149 - if err != nil { 150 - return err 151 - } 152 - 153 - switch typ { 154 - case "com.atproto.admin.defs#repoRef": 155 - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) 156 - return json.Unmarshal(b, t.AdminDefs_RepoRef) 157 - case "com.atproto.repo.strongRef": 158 - t.RepoStrongRef = new(RepoStrongRef) 159 - return json.Unmarshal(b, t.RepoStrongRef) 160 - 161 - default: 162 - return nil 163 - } 164 - } 165 - 166 - // AdminEmitModerationEvent calls the XRPC method "com.atproto.admin.emitModerationEvent". 167 - func AdminEmitModerationEvent(ctx context.Context, c *xrpc.Client, input *AdminEmitModerationEvent_Input) (*AdminDefs_ModEventView, error) { 168 - var out AdminDefs_ModEventView 169 - if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.admin.emitModerationEvent", nil, input, &out); err != nil { 170 - return nil, err 171 - } 172 - 173 - return &out, nil 174 - }
-25
api/atproto/admingetModerationEvent.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.admin.getModerationEvent 6 - 7 - import ( 8 - "context" 9 - 10 - "github.com/bluesky-social/indigo/xrpc" 11 - ) 12 - 13 - // AdminGetModerationEvent calls the XRPC method "com.atproto.admin.getModerationEvent". 14 - func AdminGetModerationEvent(ctx context.Context, c *xrpc.Client, id int64) (*AdminDefs_ModEventViewDetail, error) { 15 - var out AdminDefs_ModEventViewDetail 16 - 17 - params := map[string]interface{}{ 18 - "id": id, 19 - } 20 - if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.getModerationEvent", params, nil, &out); err != nil { 21 - return nil, err 22 - } 23 - 24 - return &out, nil 25 - }
-26
api/atproto/admingetRecord.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.admin.getRecord 6 - 7 - import ( 8 - "context" 9 - 10 - "github.com/bluesky-social/indigo/xrpc" 11 - ) 12 - 13 - // AdminGetRecord calls the XRPC method "com.atproto.admin.getRecord". 14 - func AdminGetRecord(ctx context.Context, c *xrpc.Client, cid string, uri string) (*AdminDefs_RecordViewDetail, error) { 15 - var out AdminDefs_RecordViewDetail 16 - 17 - params := map[string]interface{}{ 18 - "cid": cid, 19 - "uri": uri, 20 - } 21 - if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.getRecord", params, nil, &out); err != nil { 22 - return nil, err 23 - } 24 - 25 - return &out, nil 26 - }
-25
api/atproto/admingetRepo.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.admin.getRepo 6 - 7 - import ( 8 - "context" 9 - 10 - "github.com/bluesky-social/indigo/xrpc" 11 - ) 12 - 13 - // AdminGetRepo calls the XRPC method "com.atproto.admin.getRepo". 14 - func AdminGetRepo(ctx context.Context, c *xrpc.Client, did string) (*AdminDefs_RepoViewDetail, error) { 15 - var out AdminDefs_RepoViewDetail 16 - 17 - params := map[string]interface{}{ 18 - "did": did, 19 - } 20 - if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.getRepo", params, nil, &out); err != nil { 21 - return nil, err 22 - } 23 - 24 - return &out, nil 25 - }
-26
api/atproto/adminlistCommunicationTemplates.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.admin.listCommunicationTemplates 6 - 7 - import ( 8 - "context" 9 - 10 - "github.com/bluesky-social/indigo/xrpc" 11 - ) 12 - 13 - // AdminListCommunicationTemplates_Output is the output of a com.atproto.admin.listCommunicationTemplates call. 14 - type AdminListCommunicationTemplates_Output struct { 15 - CommunicationTemplates []*AdminDefs_CommunicationTemplateView `json:"communicationTemplates" cborgen:"communicationTemplates"` 16 - } 17 - 18 - // AdminListCommunicationTemplates calls the XRPC method "com.atproto.admin.listCommunicationTemplates". 19 - func AdminListCommunicationTemplates(ctx context.Context, c *xrpc.Client) (*AdminListCommunicationTemplates_Output, error) { 20 - var out AdminListCommunicationTemplates_Output 21 - if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.listCommunicationTemplates", nil, nil, &out); err != nil { 22 - return nil, err 23 - } 24 - 25 - return &out, nil 26 - }
+11 -11
api/atproto/adminqueryModerationEvents.go api/ozone/moderationqueryEvents.go
··· 1 1 // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 2 3 - package atproto 3 + package ozone 4 4 5 - // schema: com.atproto.admin.queryModerationEvents 5 + // schema: tools.ozone.moderation.queryEvents 6 6 7 7 import ( 8 8 "context" ··· 10 10 "github.com/bluesky-social/indigo/xrpc" 11 11 ) 12 12 13 - // AdminQueryModerationEvents_Output is the output of a com.atproto.admin.queryModerationEvents call. 14 - type AdminQueryModerationEvents_Output struct { 15 - Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 - Events []*AdminDefs_ModEventView `json:"events" cborgen:"events"` 13 + // ModerationQueryEvents_Output is the output of a tools.ozone.moderation.queryEvents call. 14 + type ModerationQueryEvents_Output struct { 15 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 + Events []*ModerationDefs_ModEventView `json:"events" cborgen:"events"` 17 17 } 18 18 19 - // AdminQueryModerationEvents calls the XRPC method "com.atproto.admin.queryModerationEvents". 19 + // ModerationQueryEvents calls the XRPC method "tools.ozone.moderation.queryEvents". 20 20 // 21 21 // addedLabels: If specified, only events where all of these labels were added are returned 22 22 // addedTags: If specified, only events where all of these tags were added are returned ··· 28 28 // removedLabels: If specified, only events where all of these labels were removed are returned 29 29 // removedTags: If specified, only events where all of these tags were removed are returned 30 30 // sortDirection: Sort direction for the events. Defaults to descending order of created at timestamp. 31 - // types: The types of events (fully qualified string in the format of com.atproto.admin#modEvent<name>) to filter by. If not specified, all events are returned. 32 - func AdminQueryModerationEvents(ctx context.Context, c *xrpc.Client, addedLabels []string, addedTags []string, comment string, createdAfter string, createdBefore string, createdBy string, cursor string, hasComment bool, includeAllUserRecords bool, limit int64, removedLabels []string, removedTags []string, reportTypes []string, sortDirection string, subject string, types []string) (*AdminQueryModerationEvents_Output, error) { 33 - var out AdminQueryModerationEvents_Output 31 + // types: The types of events (fully qualified string in the format of tools.ozone.moderation.defs#modEvent<name>) to filter by. If not specified, all events are returned. 32 + func ModerationQueryEvents(ctx context.Context, c *xrpc.Client, addedLabels []string, addedTags []string, comment string, createdAfter string, createdBefore string, createdBy string, cursor string, hasComment bool, includeAllUserRecords bool, limit int64, removedLabels []string, removedTags []string, reportTypes []string, sortDirection string, subject string, types []string) (*ModerationQueryEvents_Output, error) { 33 + var out ModerationQueryEvents_Output 34 34 35 35 params := map[string]interface{}{ 36 36 "addedLabels": addedLabels, ··· 50 50 "subject": subject, 51 51 "types": types, 52 52 } 53 - if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.queryModerationEvents", params, nil, &out); err != nil { 53 + if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.moderation.queryEvents", params, nil, &out); err != nil { 54 54 return nil, err 55 55 } 56 56
-59
api/atproto/adminqueryModerationStatuses.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.admin.queryModerationStatuses 6 - 7 - import ( 8 - "context" 9 - 10 - "github.com/bluesky-social/indigo/xrpc" 11 - ) 12 - 13 - // AdminQueryModerationStatuses_Output is the output of a com.atproto.admin.queryModerationStatuses call. 14 - type AdminQueryModerationStatuses_Output struct { 15 - Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 - SubjectStatuses []*AdminDefs_SubjectStatusView `json:"subjectStatuses" cborgen:"subjectStatuses"` 17 - } 18 - 19 - // AdminQueryModerationStatuses calls the XRPC method "com.atproto.admin.queryModerationStatuses". 20 - // 21 - // appealed: Get subjects in unresolved appealed status 22 - // comment: Search subjects by keyword from comments 23 - // includeMuted: By default, we don't include muted subjects in the results. Set this to true to include them. 24 - // lastReviewedBy: Get all subject statuses that were reviewed by a specific moderator 25 - // reportedAfter: Search subjects reported after a given timestamp 26 - // reportedBefore: Search subjects reported before a given timestamp 27 - // reviewState: Specify when fetching subjects in a certain state 28 - // reviewedAfter: Search subjects reviewed after a given timestamp 29 - // reviewedBefore: Search subjects reviewed before a given timestamp 30 - // takendown: Get subjects that were taken down 31 - func AdminQueryModerationStatuses(ctx context.Context, c *xrpc.Client, appealed bool, comment string, cursor string, excludeTags []string, ignoreSubjects []string, includeMuted bool, lastReviewedBy string, limit int64, reportedAfter string, reportedBefore string, reviewState string, reviewedAfter string, reviewedBefore string, sortDirection string, sortField string, subject string, tags []string, takendown bool) (*AdminQueryModerationStatuses_Output, error) { 32 - var out AdminQueryModerationStatuses_Output 33 - 34 - params := map[string]interface{}{ 35 - "appealed": appealed, 36 - "comment": comment, 37 - "cursor": cursor, 38 - "excludeTags": excludeTags, 39 - "ignoreSubjects": ignoreSubjects, 40 - "includeMuted": includeMuted, 41 - "lastReviewedBy": lastReviewedBy, 42 - "limit": limit, 43 - "reportedAfter": reportedAfter, 44 - "reportedBefore": reportedBefore, 45 - "reviewState": reviewState, 46 - "reviewedAfter": reviewedAfter, 47 - "reviewedBefore": reviewedBefore, 48 - "sortDirection": sortDirection, 49 - "sortField": sortField, 50 - "subject": subject, 51 - "tags": tags, 52 - "takendown": takendown, 53 - } 54 - if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.queryModerationStatuses", params, nil, &out); err != nil { 55 - return nil, err 56 - } 57 - 58 - return &out, nil 59 - }
-36
api/atproto/adminsearchRepos.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.admin.searchRepos 6 - 7 - import ( 8 - "context" 9 - 10 - "github.com/bluesky-social/indigo/xrpc" 11 - ) 12 - 13 - // AdminSearchRepos_Output is the output of a com.atproto.admin.searchRepos call. 14 - type AdminSearchRepos_Output struct { 15 - Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 - Repos []*AdminDefs_RepoView `json:"repos" cborgen:"repos"` 17 - } 18 - 19 - // AdminSearchRepos calls the XRPC method "com.atproto.admin.searchRepos". 20 - // 21 - // term: DEPRECATED: use 'q' instead 22 - func AdminSearchRepos(ctx context.Context, c *xrpc.Client, cursor string, limit int64, q string, term string) (*AdminSearchRepos_Output, error) { 23 - var out AdminSearchRepos_Output 24 - 25 - params := map[string]interface{}{ 26 - "cursor": cursor, 27 - "limit": limit, 28 - "q": q, 29 - "term": term, 30 - } 31 - if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.searchRepos", params, nil, &out); err != nil { 32 - return nil, err 33 - } 34 - 35 - return &out, nil 36 - }
-36
api/atproto/adminupdateCommunicationTemplate.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.admin.updateCommunicationTemplate 6 - 7 - import ( 8 - "context" 9 - 10 - "github.com/bluesky-social/indigo/xrpc" 11 - ) 12 - 13 - // AdminUpdateCommunicationTemplate_Input is the input argument to a com.atproto.admin.updateCommunicationTemplate call. 14 - type AdminUpdateCommunicationTemplate_Input struct { 15 - // contentMarkdown: Content of the template, markdown supported, can contain variable placeholders. 16 - ContentMarkdown *string `json:"contentMarkdown,omitempty" cborgen:"contentMarkdown,omitempty"` 17 - Disabled *bool `json:"disabled,omitempty" cborgen:"disabled,omitempty"` 18 - // id: ID of the template to be updated. 19 - Id string `json:"id" cborgen:"id"` 20 - // name: Name of the template. 21 - Name *string `json:"name,omitempty" cborgen:"name,omitempty"` 22 - // subject: Subject of the message, used in emails. 23 - Subject *string `json:"subject,omitempty" cborgen:"subject,omitempty"` 24 - // updatedBy: DID of the user who is updating the template. 25 - UpdatedBy *string `json:"updatedBy,omitempty" cborgen:"updatedBy,omitempty"` 26 - } 27 - 28 - // AdminUpdateCommunicationTemplate calls the XRPC method "com.atproto.admin.updateCommunicationTemplate". 29 - func AdminUpdateCommunicationTemplate(ctx context.Context, c *xrpc.Client, input *AdminUpdateCommunicationTemplate_Input) (*AdminDefs_CommunicationTemplateView, error) { 30 - var out AdminDefs_CommunicationTemplateView 31 - if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.admin.updateCommunicationTemplate", nil, input, &out); err != nil { 32 - return nil, err 33 - } 34 - 35 - return &out, nil 36 - }
-28
api/atproto/reporebaseRepo.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.repo.rebaseRepo 6 - 7 - import ( 8 - "context" 9 - 10 - "github.com/bluesky-social/indigo/xrpc" 11 - ) 12 - 13 - // RepoRebaseRepo_Input is the input argument to a com.atproto.repo.rebaseRepo call. 14 - type RepoRebaseRepo_Input struct { 15 - // repo: The handle or DID of the repo. 16 - Repo string `json:"repo" cborgen:"repo"` 17 - // swapCommit: Compare and swap with the previous commit by cid. 18 - SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"` 19 - } 20 - 21 - // RepoRebaseRepo calls the XRPC method "com.atproto.repo.rebaseRepo". 22 - func RepoRebaseRepo(ctx context.Context, c *xrpc.Client, input *RepoRebaseRepo_Input) error { 23 - if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.repo.rebaseRepo", nil, input, nil); err != nil { 24 - return err 25 - } 26 - 27 - return nil 28 - }
-36
api/atproto/syncgetCommitPath.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.sync.getCommitPath 6 - 7 - import ( 8 - "context" 9 - 10 - "github.com/bluesky-social/indigo/xrpc" 11 - ) 12 - 13 - // SyncGetCommitPath_Output is the output of a com.atproto.sync.getCommitPath call. 14 - type SyncGetCommitPath_Output struct { 15 - Commits []string `json:"commits" cborgen:"commits"` 16 - } 17 - 18 - // SyncGetCommitPath calls the XRPC method "com.atproto.sync.getCommitPath". 19 - // 20 - // did: The DID of the repo. 21 - // earliest: The earliest commit to start from 22 - // latest: The most recent commit 23 - func SyncGetCommitPath(ctx context.Context, c *xrpc.Client, did string, earliest string, latest string) (*SyncGetCommitPath_Output, error) { 24 - var out SyncGetCommitPath_Output 25 - 26 - params := map[string]interface{}{ 27 - "did": did, 28 - "earliest": earliest, 29 - "latest": latest, 30 - } 31 - if err := c.Do(ctx, xrpc.Query, "", "com.atproto.sync.getCommitPath", params, nil, &out); err != nil { 32 - return nil, err 33 - } 34 - 35 - return &out, nil 36 - }
-27
api/atproto/temppushBlob.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.temp.pushBlob 6 - 7 - import ( 8 - "context" 9 - "io" 10 - 11 - "github.com/bluesky-social/indigo/xrpc" 12 - ) 13 - 14 - // TempPushBlob calls the XRPC method "com.atproto.temp.pushBlob". 15 - // 16 - // did: The DID of the repo. 17 - func TempPushBlob(ctx context.Context, c *xrpc.Client, input io.Reader, did string) error { 18 - 19 - params := map[string]interface{}{ 20 - "did": did, 21 - } 22 - if err := c.Do(ctx, xrpc.Procedure, "*/*", "com.atproto.temp.pushBlob", params, input, nil); err != nil { 23 - return err 24 - } 25 - 26 - return nil 27 - }
-36
api/atproto/temptransferAccount.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.temp.transferAccount 6 - 7 - import ( 8 - "context" 9 - 10 - "github.com/bluesky-social/indigo/xrpc" 11 - ) 12 - 13 - // TempTransferAccount_Input is the input argument to a com.atproto.temp.transferAccount call. 14 - type TempTransferAccount_Input struct { 15 - Did string `json:"did" cborgen:"did"` 16 - Handle string `json:"handle" cborgen:"handle"` 17 - PlcOp interface{} `json:"plcOp" cborgen:"plcOp"` 18 - } 19 - 20 - // TempTransferAccount_Output is the output of a com.atproto.temp.transferAccount call. 21 - type TempTransferAccount_Output struct { 22 - AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 23 - Did string `json:"did" cborgen:"did"` 24 - Handle string `json:"handle" cborgen:"handle"` 25 - RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 26 - } 27 - 28 - // TempTransferAccount calls the XRPC method "com.atproto.temp.transferAccount". 29 - func TempTransferAccount(ctx context.Context, c *xrpc.Client, input *TempTransferAccount_Input) (*TempTransferAccount_Output, error) { 30 - var out TempTransferAccount_Output 31 - if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.temp.transferAccount", nil, input, &out); err != nil { 32 - return nil, err 33 - } 34 - 35 - return &out, nil 36 - }
-25
api/atproto/tempupgradeRepoVersion.go
··· 1 - // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 - 3 - package atproto 4 - 5 - // schema: com.atproto.temp.upgradeRepoVersion 6 - 7 - import ( 8 - "context" 9 - 10 - "github.com/bluesky-social/indigo/xrpc" 11 - ) 12 - 13 - // TempUpgradeRepoVersion_Input is the input argument to a com.atproto.temp.upgradeRepoVersion call. 14 - type TempUpgradeRepoVersion_Input struct { 15 - Did string `json:"did" cborgen:"did"` 16 - } 17 - 18 - // TempUpgradeRepoVersion calls the XRPC method "com.atproto.temp.upgradeRepoVersion". 19 - func TempUpgradeRepoVersion(ctx context.Context, c *xrpc.Client, input *TempUpgradeRepoVersion_Input) error { 20 - if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.temp.upgradeRepoVersion", nil, input, nil); err != nil { 21 - return err 22 - } 23 - 24 - return nil 25 - }
+33
api/ozone/communicationcreateTemplate.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.communication.createTemplate 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // CommunicationCreateTemplate_Input is the input argument to a tools.ozone.communication.createTemplate call. 14 + type CommunicationCreateTemplate_Input struct { 15 + // contentMarkdown: Content of the template, markdown supported, can contain variable placeholders. 16 + ContentMarkdown string `json:"contentMarkdown" cborgen:"contentMarkdown"` 17 + // createdBy: DID of the user who is creating the template. 18 + CreatedBy *string `json:"createdBy,omitempty" cborgen:"createdBy,omitempty"` 19 + // name: Name of the template. 20 + Name string `json:"name" cborgen:"name"` 21 + // subject: Subject of the message, used in emails. 22 + Subject string `json:"subject" cborgen:"subject"` 23 + } 24 + 25 + // CommunicationCreateTemplate calls the XRPC method "tools.ozone.communication.createTemplate". 26 + func CommunicationCreateTemplate(ctx context.Context, c *xrpc.Client, input *CommunicationCreateTemplate_Input) (*CommunicationDefs_TemplateView, error) { 27 + var out CommunicationDefs_TemplateView 28 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "tools.ozone.communication.createTemplate", nil, input, &out); err != nil { 29 + return nil, err 30 + } 31 + 32 + return &out, nil 33 + }
+21
api/ozone/communicationdefs.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.communication.defs 6 + 7 + // CommunicationDefs_TemplateView is a "templateView" in the tools.ozone.communication.defs schema. 8 + type CommunicationDefs_TemplateView struct { 9 + // contentMarkdown: Subject of the message, used in emails. 10 + ContentMarkdown string `json:"contentMarkdown" cborgen:"contentMarkdown"` 11 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 12 + Disabled bool `json:"disabled" cborgen:"disabled"` 13 + Id string `json:"id" cborgen:"id"` 14 + // lastUpdatedBy: DID of the user who last updated the template. 15 + LastUpdatedBy string `json:"lastUpdatedBy" cborgen:"lastUpdatedBy"` 16 + // name: Name of the template. 17 + Name string `json:"name" cborgen:"name"` 18 + // subject: Content of the template, can contain markdown and variable placeholders. 19 + Subject *string `json:"subject,omitempty" cborgen:"subject,omitempty"` 20 + UpdatedAt string `json:"updatedAt" cborgen:"updatedAt"` 21 + }
+25
api/ozone/communicationdeleteTemplate.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.communication.deleteTemplate 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // CommunicationDeleteTemplate_Input is the input argument to a tools.ozone.communication.deleteTemplate call. 14 + type CommunicationDeleteTemplate_Input struct { 15 + Id string `json:"id" cborgen:"id"` 16 + } 17 + 18 + // CommunicationDeleteTemplate calls the XRPC method "tools.ozone.communication.deleteTemplate". 19 + func CommunicationDeleteTemplate(ctx context.Context, c *xrpc.Client, input *CommunicationDeleteTemplate_Input) error { 20 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "tools.ozone.communication.deleteTemplate", nil, input, nil); err != nil { 21 + return err 22 + } 23 + 24 + return nil 25 + }
+26
api/ozone/communicationlistTemplates.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.communication.listTemplates 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // CommunicationListTemplates_Output is the output of a tools.ozone.communication.listTemplates call. 14 + type CommunicationListTemplates_Output struct { 15 + CommunicationTemplates []*CommunicationDefs_TemplateView `json:"communicationTemplates" cborgen:"communicationTemplates"` 16 + } 17 + 18 + // CommunicationListTemplates calls the XRPC method "tools.ozone.communication.listTemplates". 19 + func CommunicationListTemplates(ctx context.Context, c *xrpc.Client) (*CommunicationListTemplates_Output, error) { 20 + var out CommunicationListTemplates_Output 21 + if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.communication.listTemplates", nil, nil, &out); err != nil { 22 + return nil, err 23 + } 24 + 25 + return &out, nil 26 + }
+36
api/ozone/communicationupdateTemplate.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.communication.updateTemplate 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // CommunicationUpdateTemplate_Input is the input argument to a tools.ozone.communication.updateTemplate call. 14 + type CommunicationUpdateTemplate_Input struct { 15 + // contentMarkdown: Content of the template, markdown supported, can contain variable placeholders. 16 + ContentMarkdown *string `json:"contentMarkdown,omitempty" cborgen:"contentMarkdown,omitempty"` 17 + Disabled *bool `json:"disabled,omitempty" cborgen:"disabled,omitempty"` 18 + // id: ID of the template to be updated. 19 + Id string `json:"id" cborgen:"id"` 20 + // name: Name of the template. 21 + Name *string `json:"name,omitempty" cborgen:"name,omitempty"` 22 + // subject: Subject of the message, used in emails. 23 + Subject *string `json:"subject,omitempty" cborgen:"subject,omitempty"` 24 + // updatedBy: DID of the user who is updating the template. 25 + UpdatedBy *string `json:"updatedBy,omitempty" cborgen:"updatedBy,omitempty"` 26 + } 27 + 28 + // CommunicationUpdateTemplate calls the XRPC method "tools.ozone.communication.updateTemplate". 29 + func CommunicationUpdateTemplate(ctx context.Context, c *xrpc.Client, input *CommunicationUpdateTemplate_Input) (*CommunicationDefs_TemplateView, error) { 30 + var out CommunicationDefs_TemplateView 31 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "tools.ozone.communication.updateTemplate", nil, input, &out); err != nil { 32 + return nil, err 33 + } 34 + 35 + return &out, nil 36 + }
+692
api/ozone/moderationdefs.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.moderation.defs 6 + 7 + import ( 8 + "encoding/json" 9 + "fmt" 10 + 11 + comatprototypes "github.com/bluesky-social/indigo/api/atproto" 12 + "github.com/bluesky-social/indigo/lex/util" 13 + ) 14 + 15 + // ModerationDefs_BlobView is a "blobView" in the tools.ozone.moderation.defs schema. 16 + type ModerationDefs_BlobView struct { 17 + Cid string `json:"cid" cborgen:"cid"` 18 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 19 + Details *ModerationDefs_BlobView_Details `json:"details,omitempty" cborgen:"details,omitempty"` 20 + MimeType string `json:"mimeType" cborgen:"mimeType"` 21 + Moderation *ModerationDefs_Moderation `json:"moderation,omitempty" cborgen:"moderation,omitempty"` 22 + Size int64 `json:"size" cborgen:"size"` 23 + } 24 + 25 + type ModerationDefs_BlobView_Details struct { 26 + ModerationDefs_ImageDetails *ModerationDefs_ImageDetails 27 + ModerationDefs_VideoDetails *ModerationDefs_VideoDetails 28 + } 29 + 30 + func (t *ModerationDefs_BlobView_Details) MarshalJSON() ([]byte, error) { 31 + if t.ModerationDefs_ImageDetails != nil { 32 + t.ModerationDefs_ImageDetails.LexiconTypeID = "tools.ozone.moderation.defs#imageDetails" 33 + return json.Marshal(t.ModerationDefs_ImageDetails) 34 + } 35 + if t.ModerationDefs_VideoDetails != nil { 36 + t.ModerationDefs_VideoDetails.LexiconTypeID = "tools.ozone.moderation.defs#videoDetails" 37 + return json.Marshal(t.ModerationDefs_VideoDetails) 38 + } 39 + return nil, fmt.Errorf("cannot marshal empty enum") 40 + } 41 + func (t *ModerationDefs_BlobView_Details) UnmarshalJSON(b []byte) error { 42 + typ, err := util.TypeExtract(b) 43 + if err != nil { 44 + return err 45 + } 46 + 47 + switch typ { 48 + case "tools.ozone.moderation.defs#imageDetails": 49 + t.ModerationDefs_ImageDetails = new(ModerationDefs_ImageDetails) 50 + return json.Unmarshal(b, t.ModerationDefs_ImageDetails) 51 + case "tools.ozone.moderation.defs#videoDetails": 52 + t.ModerationDefs_VideoDetails = new(ModerationDefs_VideoDetails) 53 + return json.Unmarshal(b, t.ModerationDefs_VideoDetails) 54 + 55 + default: 56 + return nil 57 + } 58 + } 59 + 60 + // ModerationDefs_ImageDetails is a "imageDetails" in the tools.ozone.moderation.defs schema. 61 + // 62 + // RECORDTYPE: ModerationDefs_ImageDetails 63 + type ModerationDefs_ImageDetails struct { 64 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#imageDetails" cborgen:"$type,const=tools.ozone.moderation.defs#imageDetails"` 65 + Height int64 `json:"height" cborgen:"height"` 66 + Width int64 `json:"width" cborgen:"width"` 67 + } 68 + 69 + // ModerationDefs_ModEventAcknowledge is a "modEventAcknowledge" in the tools.ozone.moderation.defs schema. 70 + // 71 + // RECORDTYPE: ModerationDefs_ModEventAcknowledge 72 + type ModerationDefs_ModEventAcknowledge struct { 73 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventAcknowledge" cborgen:"$type,const=tools.ozone.moderation.defs#modEventAcknowledge"` 74 + Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 75 + } 76 + 77 + // ModerationDefs_ModEventComment is a "modEventComment" in the tools.ozone.moderation.defs schema. 78 + // 79 + // # Add a comment to a subject 80 + // 81 + // RECORDTYPE: ModerationDefs_ModEventComment 82 + type ModerationDefs_ModEventComment struct { 83 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventComment" cborgen:"$type,const=tools.ozone.moderation.defs#modEventComment"` 84 + Comment string `json:"comment" cborgen:"comment"` 85 + // sticky: Make the comment persistent on the subject 86 + Sticky *bool `json:"sticky,omitempty" cborgen:"sticky,omitempty"` 87 + } 88 + 89 + // ModerationDefs_ModEventDivert is a "modEventDivert" in the tools.ozone.moderation.defs schema. 90 + // 91 + // Divert a record's blobs to a 3rd party service for further scanning/tagging 92 + // 93 + // RECORDTYPE: ModerationDefs_ModEventDivert 94 + type ModerationDefs_ModEventDivert struct { 95 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventDivert" cborgen:"$type,const=tools.ozone.moderation.defs#modEventDivert"` 96 + Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 97 + } 98 + 99 + // ModerationDefs_ModEventEmail is a "modEventEmail" in the tools.ozone.moderation.defs schema. 100 + // 101 + // # Keep a log of outgoing email to a user 102 + // 103 + // RECORDTYPE: ModerationDefs_ModEventEmail 104 + type ModerationDefs_ModEventEmail struct { 105 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventEmail" cborgen:"$type,const=tools.ozone.moderation.defs#modEventEmail"` 106 + // comment: Additional comment about the outgoing comm. 107 + Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 108 + // content: The content of the email sent to the user. 109 + Content *string `json:"content,omitempty" cborgen:"content,omitempty"` 110 + // subjectLine: The subject line of the email sent to the user. 111 + SubjectLine string `json:"subjectLine" cborgen:"subjectLine"` 112 + } 113 + 114 + // ModerationDefs_ModEventEscalate is a "modEventEscalate" in the tools.ozone.moderation.defs schema. 115 + // 116 + // RECORDTYPE: ModerationDefs_ModEventEscalate 117 + type ModerationDefs_ModEventEscalate struct { 118 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventEscalate" cborgen:"$type,const=tools.ozone.moderation.defs#modEventEscalate"` 119 + Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 120 + } 121 + 122 + // ModerationDefs_ModEventLabel is a "modEventLabel" in the tools.ozone.moderation.defs schema. 123 + // 124 + // Apply/Negate labels on a subject 125 + // 126 + // RECORDTYPE: ModerationDefs_ModEventLabel 127 + type ModerationDefs_ModEventLabel struct { 128 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventLabel" cborgen:"$type,const=tools.ozone.moderation.defs#modEventLabel"` 129 + Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 130 + CreateLabelVals []string `json:"createLabelVals" cborgen:"createLabelVals"` 131 + NegateLabelVals []string `json:"negateLabelVals" cborgen:"negateLabelVals"` 132 + } 133 + 134 + // ModerationDefs_ModEventMute is a "modEventMute" in the tools.ozone.moderation.defs schema. 135 + // 136 + // # Mute incoming reports on a subject 137 + // 138 + // RECORDTYPE: ModerationDefs_ModEventMute 139 + type ModerationDefs_ModEventMute struct { 140 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventMute" cborgen:"$type,const=tools.ozone.moderation.defs#modEventMute"` 141 + Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 142 + // durationInHours: Indicates how long the subject should remain muted. 143 + DurationInHours int64 `json:"durationInHours" cborgen:"durationInHours"` 144 + } 145 + 146 + // ModerationDefs_ModEventReport is a "modEventReport" in the tools.ozone.moderation.defs schema. 147 + // 148 + // # Report a subject 149 + // 150 + // RECORDTYPE: ModerationDefs_ModEventReport 151 + type ModerationDefs_ModEventReport struct { 152 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventReport" cborgen:"$type,const=tools.ozone.moderation.defs#modEventReport"` 153 + Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 154 + ReportType *string `json:"reportType" cborgen:"reportType"` 155 + } 156 + 157 + // ModerationDefs_ModEventResolveAppeal is a "modEventResolveAppeal" in the tools.ozone.moderation.defs schema. 158 + // 159 + // # Resolve appeal on a subject 160 + // 161 + // RECORDTYPE: ModerationDefs_ModEventResolveAppeal 162 + type ModerationDefs_ModEventResolveAppeal struct { 163 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventResolveAppeal" cborgen:"$type,const=tools.ozone.moderation.defs#modEventResolveAppeal"` 164 + // comment: Describe resolution. 165 + Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 166 + } 167 + 168 + // ModerationDefs_ModEventReverseTakedown is a "modEventReverseTakedown" in the tools.ozone.moderation.defs schema. 169 + // 170 + // # Revert take down action on a subject 171 + // 172 + // RECORDTYPE: ModerationDefs_ModEventReverseTakedown 173 + type ModerationDefs_ModEventReverseTakedown struct { 174 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventReverseTakedown" cborgen:"$type,const=tools.ozone.moderation.defs#modEventReverseTakedown"` 175 + // comment: Describe reasoning behind the reversal. 176 + Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 177 + } 178 + 179 + // ModerationDefs_ModEventTag is a "modEventTag" in the tools.ozone.moderation.defs schema. 180 + // 181 + // Add/Remove a tag on a subject 182 + // 183 + // RECORDTYPE: ModerationDefs_ModEventTag 184 + type ModerationDefs_ModEventTag struct { 185 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventTag" cborgen:"$type,const=tools.ozone.moderation.defs#modEventTag"` 186 + // add: Tags to be added to the subject. If already exists, won't be duplicated. 187 + Add []string `json:"add" cborgen:"add"` 188 + // comment: Additional comment about added/removed tags. 189 + Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 190 + // remove: Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. 191 + Remove []string `json:"remove" cborgen:"remove"` 192 + } 193 + 194 + // ModerationDefs_ModEventTakedown is a "modEventTakedown" in the tools.ozone.moderation.defs schema. 195 + // 196 + // # Take down a subject permanently or temporarily 197 + // 198 + // RECORDTYPE: ModerationDefs_ModEventTakedown 199 + type ModerationDefs_ModEventTakedown struct { 200 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventTakedown" cborgen:"$type,const=tools.ozone.moderation.defs#modEventTakedown"` 201 + Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 202 + // durationInHours: Indicates how long the takedown should be in effect before automatically expiring. 203 + DurationInHours *int64 `json:"durationInHours,omitempty" cborgen:"durationInHours,omitempty"` 204 + } 205 + 206 + // ModerationDefs_ModEventUnmute is a "modEventUnmute" in the tools.ozone.moderation.defs schema. 207 + // 208 + // # Unmute action on a subject 209 + // 210 + // RECORDTYPE: ModerationDefs_ModEventUnmute 211 + type ModerationDefs_ModEventUnmute struct { 212 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventUnmute" cborgen:"$type,const=tools.ozone.moderation.defs#modEventUnmute"` 213 + // comment: Describe reasoning behind the reversal. 214 + Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 215 + } 216 + 217 + // ModerationDefs_ModEventView is a "modEventView" in the tools.ozone.moderation.defs schema. 218 + type ModerationDefs_ModEventView struct { 219 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 220 + CreatedBy string `json:"createdBy" cborgen:"createdBy"` 221 + CreatorHandle *string `json:"creatorHandle,omitempty" cborgen:"creatorHandle,omitempty"` 222 + Event *ModerationDefs_ModEventView_Event `json:"event" cborgen:"event"` 223 + Id int64 `json:"id" cborgen:"id"` 224 + Subject *ModerationDefs_ModEventView_Subject `json:"subject" cborgen:"subject"` 225 + SubjectBlobCids []string `json:"subjectBlobCids" cborgen:"subjectBlobCids"` 226 + SubjectHandle *string `json:"subjectHandle,omitempty" cborgen:"subjectHandle,omitempty"` 227 + } 228 + 229 + // ModerationDefs_ModEventViewDetail is a "modEventViewDetail" in the tools.ozone.moderation.defs schema. 230 + type ModerationDefs_ModEventViewDetail struct { 231 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 232 + CreatedBy string `json:"createdBy" cborgen:"createdBy"` 233 + Event *ModerationDefs_ModEventViewDetail_Event `json:"event" cborgen:"event"` 234 + Id int64 `json:"id" cborgen:"id"` 235 + Subject *ModerationDefs_ModEventViewDetail_Subject `json:"subject" cborgen:"subject"` 236 + SubjectBlobs []*ModerationDefs_BlobView `json:"subjectBlobs" cborgen:"subjectBlobs"` 237 + } 238 + 239 + type ModerationDefs_ModEventViewDetail_Event struct { 240 + ModerationDefs_ModEventTakedown *ModerationDefs_ModEventTakedown 241 + ModerationDefs_ModEventReverseTakedown *ModerationDefs_ModEventReverseTakedown 242 + ModerationDefs_ModEventComment *ModerationDefs_ModEventComment 243 + ModerationDefs_ModEventReport *ModerationDefs_ModEventReport 244 + ModerationDefs_ModEventLabel *ModerationDefs_ModEventLabel 245 + ModerationDefs_ModEventAcknowledge *ModerationDefs_ModEventAcknowledge 246 + ModerationDefs_ModEventEscalate *ModerationDefs_ModEventEscalate 247 + ModerationDefs_ModEventMute *ModerationDefs_ModEventMute 248 + ModerationDefs_ModEventEmail *ModerationDefs_ModEventEmail 249 + ModerationDefs_ModEventResolveAppeal *ModerationDefs_ModEventResolveAppeal 250 + ModerationDefs_ModEventDivert *ModerationDefs_ModEventDivert 251 + } 252 + 253 + func (t *ModerationDefs_ModEventViewDetail_Event) MarshalJSON() ([]byte, error) { 254 + if t.ModerationDefs_ModEventTakedown != nil { 255 + t.ModerationDefs_ModEventTakedown.LexiconTypeID = "tools.ozone.moderation.defs#modEventTakedown" 256 + return json.Marshal(t.ModerationDefs_ModEventTakedown) 257 + } 258 + if t.ModerationDefs_ModEventReverseTakedown != nil { 259 + t.ModerationDefs_ModEventReverseTakedown.LexiconTypeID = "tools.ozone.moderation.defs#modEventReverseTakedown" 260 + return json.Marshal(t.ModerationDefs_ModEventReverseTakedown) 261 + } 262 + if t.ModerationDefs_ModEventComment != nil { 263 + t.ModerationDefs_ModEventComment.LexiconTypeID = "tools.ozone.moderation.defs#modEventComment" 264 + return json.Marshal(t.ModerationDefs_ModEventComment) 265 + } 266 + if t.ModerationDefs_ModEventReport != nil { 267 + t.ModerationDefs_ModEventReport.LexiconTypeID = "tools.ozone.moderation.defs#modEventReport" 268 + return json.Marshal(t.ModerationDefs_ModEventReport) 269 + } 270 + if t.ModerationDefs_ModEventLabel != nil { 271 + t.ModerationDefs_ModEventLabel.LexiconTypeID = "tools.ozone.moderation.defs#modEventLabel" 272 + return json.Marshal(t.ModerationDefs_ModEventLabel) 273 + } 274 + if t.ModerationDefs_ModEventAcknowledge != nil { 275 + t.ModerationDefs_ModEventAcknowledge.LexiconTypeID = "tools.ozone.moderation.defs#modEventAcknowledge" 276 + return json.Marshal(t.ModerationDefs_ModEventAcknowledge) 277 + } 278 + if t.ModerationDefs_ModEventEscalate != nil { 279 + t.ModerationDefs_ModEventEscalate.LexiconTypeID = "tools.ozone.moderation.defs#modEventEscalate" 280 + return json.Marshal(t.ModerationDefs_ModEventEscalate) 281 + } 282 + if t.ModerationDefs_ModEventMute != nil { 283 + t.ModerationDefs_ModEventMute.LexiconTypeID = "tools.ozone.moderation.defs#modEventMute" 284 + return json.Marshal(t.ModerationDefs_ModEventMute) 285 + } 286 + if t.ModerationDefs_ModEventEmail != nil { 287 + t.ModerationDefs_ModEventEmail.LexiconTypeID = "tools.ozone.moderation.defs#modEventEmail" 288 + return json.Marshal(t.ModerationDefs_ModEventEmail) 289 + } 290 + if t.ModerationDefs_ModEventResolveAppeal != nil { 291 + t.ModerationDefs_ModEventResolveAppeal.LexiconTypeID = "tools.ozone.moderation.defs#modEventResolveAppeal" 292 + return json.Marshal(t.ModerationDefs_ModEventResolveAppeal) 293 + } 294 + if t.ModerationDefs_ModEventDivert != nil { 295 + t.ModerationDefs_ModEventDivert.LexiconTypeID = "tools.ozone.moderation.defs#modEventDivert" 296 + return json.Marshal(t.ModerationDefs_ModEventDivert) 297 + } 298 + return nil, fmt.Errorf("cannot marshal empty enum") 299 + } 300 + func (t *ModerationDefs_ModEventViewDetail_Event) UnmarshalJSON(b []byte) error { 301 + typ, err := util.TypeExtract(b) 302 + if err != nil { 303 + return err 304 + } 305 + 306 + switch typ { 307 + case "tools.ozone.moderation.defs#modEventTakedown": 308 + t.ModerationDefs_ModEventTakedown = new(ModerationDefs_ModEventTakedown) 309 + return json.Unmarshal(b, t.ModerationDefs_ModEventTakedown) 310 + case "tools.ozone.moderation.defs#modEventReverseTakedown": 311 + t.ModerationDefs_ModEventReverseTakedown = new(ModerationDefs_ModEventReverseTakedown) 312 + return json.Unmarshal(b, t.ModerationDefs_ModEventReverseTakedown) 313 + case "tools.ozone.moderation.defs#modEventComment": 314 + t.ModerationDefs_ModEventComment = new(ModerationDefs_ModEventComment) 315 + return json.Unmarshal(b, t.ModerationDefs_ModEventComment) 316 + case "tools.ozone.moderation.defs#modEventReport": 317 + t.ModerationDefs_ModEventReport = new(ModerationDefs_ModEventReport) 318 + return json.Unmarshal(b, t.ModerationDefs_ModEventReport) 319 + case "tools.ozone.moderation.defs#modEventLabel": 320 + t.ModerationDefs_ModEventLabel = new(ModerationDefs_ModEventLabel) 321 + return json.Unmarshal(b, t.ModerationDefs_ModEventLabel) 322 + case "tools.ozone.moderation.defs#modEventAcknowledge": 323 + t.ModerationDefs_ModEventAcknowledge = new(ModerationDefs_ModEventAcknowledge) 324 + return json.Unmarshal(b, t.ModerationDefs_ModEventAcknowledge) 325 + case "tools.ozone.moderation.defs#modEventEscalate": 326 + t.ModerationDefs_ModEventEscalate = new(ModerationDefs_ModEventEscalate) 327 + return json.Unmarshal(b, t.ModerationDefs_ModEventEscalate) 328 + case "tools.ozone.moderation.defs#modEventMute": 329 + t.ModerationDefs_ModEventMute = new(ModerationDefs_ModEventMute) 330 + return json.Unmarshal(b, t.ModerationDefs_ModEventMute) 331 + case "tools.ozone.moderation.defs#modEventEmail": 332 + t.ModerationDefs_ModEventEmail = new(ModerationDefs_ModEventEmail) 333 + return json.Unmarshal(b, t.ModerationDefs_ModEventEmail) 334 + case "tools.ozone.moderation.defs#modEventResolveAppeal": 335 + t.ModerationDefs_ModEventResolveAppeal = new(ModerationDefs_ModEventResolveAppeal) 336 + return json.Unmarshal(b, t.ModerationDefs_ModEventResolveAppeal) 337 + case "tools.ozone.moderation.defs#modEventDivert": 338 + t.ModerationDefs_ModEventDivert = new(ModerationDefs_ModEventDivert) 339 + return json.Unmarshal(b, t.ModerationDefs_ModEventDivert) 340 + 341 + default: 342 + return nil 343 + } 344 + } 345 + 346 + type ModerationDefs_ModEventViewDetail_Subject struct { 347 + ModerationDefs_RepoView *ModerationDefs_RepoView 348 + ModerationDefs_RepoViewNotFound *ModerationDefs_RepoViewNotFound 349 + ModerationDefs_RecordView *ModerationDefs_RecordView 350 + ModerationDefs_RecordViewNotFound *ModerationDefs_RecordViewNotFound 351 + } 352 + 353 + func (t *ModerationDefs_ModEventViewDetail_Subject) MarshalJSON() ([]byte, error) { 354 + if t.ModerationDefs_RepoView != nil { 355 + t.ModerationDefs_RepoView.LexiconTypeID = "tools.ozone.moderation.defs#repoView" 356 + return json.Marshal(t.ModerationDefs_RepoView) 357 + } 358 + if t.ModerationDefs_RepoViewNotFound != nil { 359 + t.ModerationDefs_RepoViewNotFound.LexiconTypeID = "tools.ozone.moderation.defs#repoViewNotFound" 360 + return json.Marshal(t.ModerationDefs_RepoViewNotFound) 361 + } 362 + if t.ModerationDefs_RecordView != nil { 363 + t.ModerationDefs_RecordView.LexiconTypeID = "tools.ozone.moderation.defs#recordView" 364 + return json.Marshal(t.ModerationDefs_RecordView) 365 + } 366 + if t.ModerationDefs_RecordViewNotFound != nil { 367 + t.ModerationDefs_RecordViewNotFound.LexiconTypeID = "tools.ozone.moderation.defs#recordViewNotFound" 368 + return json.Marshal(t.ModerationDefs_RecordViewNotFound) 369 + } 370 + return nil, fmt.Errorf("cannot marshal empty enum") 371 + } 372 + func (t *ModerationDefs_ModEventViewDetail_Subject) UnmarshalJSON(b []byte) error { 373 + typ, err := util.TypeExtract(b) 374 + if err != nil { 375 + return err 376 + } 377 + 378 + switch typ { 379 + case "tools.ozone.moderation.defs#repoView": 380 + t.ModerationDefs_RepoView = new(ModerationDefs_RepoView) 381 + return json.Unmarshal(b, t.ModerationDefs_RepoView) 382 + case "tools.ozone.moderation.defs#repoViewNotFound": 383 + t.ModerationDefs_RepoViewNotFound = new(ModerationDefs_RepoViewNotFound) 384 + return json.Unmarshal(b, t.ModerationDefs_RepoViewNotFound) 385 + case "tools.ozone.moderation.defs#recordView": 386 + t.ModerationDefs_RecordView = new(ModerationDefs_RecordView) 387 + return json.Unmarshal(b, t.ModerationDefs_RecordView) 388 + case "tools.ozone.moderation.defs#recordViewNotFound": 389 + t.ModerationDefs_RecordViewNotFound = new(ModerationDefs_RecordViewNotFound) 390 + return json.Unmarshal(b, t.ModerationDefs_RecordViewNotFound) 391 + 392 + default: 393 + return nil 394 + } 395 + } 396 + 397 + type ModerationDefs_ModEventView_Event struct { 398 + ModerationDefs_ModEventTakedown *ModerationDefs_ModEventTakedown 399 + ModerationDefs_ModEventReverseTakedown *ModerationDefs_ModEventReverseTakedown 400 + ModerationDefs_ModEventComment *ModerationDefs_ModEventComment 401 + ModerationDefs_ModEventReport *ModerationDefs_ModEventReport 402 + ModerationDefs_ModEventLabel *ModerationDefs_ModEventLabel 403 + ModerationDefs_ModEventAcknowledge *ModerationDefs_ModEventAcknowledge 404 + ModerationDefs_ModEventEscalate *ModerationDefs_ModEventEscalate 405 + ModerationDefs_ModEventMute *ModerationDefs_ModEventMute 406 + ModerationDefs_ModEventEmail *ModerationDefs_ModEventEmail 407 + ModerationDefs_ModEventResolveAppeal *ModerationDefs_ModEventResolveAppeal 408 + ModerationDefs_ModEventDivert *ModerationDefs_ModEventDivert 409 + } 410 + 411 + func (t *ModerationDefs_ModEventView_Event) MarshalJSON() ([]byte, error) { 412 + if t.ModerationDefs_ModEventTakedown != nil { 413 + t.ModerationDefs_ModEventTakedown.LexiconTypeID = "tools.ozone.moderation.defs#modEventTakedown" 414 + return json.Marshal(t.ModerationDefs_ModEventTakedown) 415 + } 416 + if t.ModerationDefs_ModEventReverseTakedown != nil { 417 + t.ModerationDefs_ModEventReverseTakedown.LexiconTypeID = "tools.ozone.moderation.defs#modEventReverseTakedown" 418 + return json.Marshal(t.ModerationDefs_ModEventReverseTakedown) 419 + } 420 + if t.ModerationDefs_ModEventComment != nil { 421 + t.ModerationDefs_ModEventComment.LexiconTypeID = "tools.ozone.moderation.defs#modEventComment" 422 + return json.Marshal(t.ModerationDefs_ModEventComment) 423 + } 424 + if t.ModerationDefs_ModEventReport != nil { 425 + t.ModerationDefs_ModEventReport.LexiconTypeID = "tools.ozone.moderation.defs#modEventReport" 426 + return json.Marshal(t.ModerationDefs_ModEventReport) 427 + } 428 + if t.ModerationDefs_ModEventLabel != nil { 429 + t.ModerationDefs_ModEventLabel.LexiconTypeID = "tools.ozone.moderation.defs#modEventLabel" 430 + return json.Marshal(t.ModerationDefs_ModEventLabel) 431 + } 432 + if t.ModerationDefs_ModEventAcknowledge != nil { 433 + t.ModerationDefs_ModEventAcknowledge.LexiconTypeID = "tools.ozone.moderation.defs#modEventAcknowledge" 434 + return json.Marshal(t.ModerationDefs_ModEventAcknowledge) 435 + } 436 + if t.ModerationDefs_ModEventEscalate != nil { 437 + t.ModerationDefs_ModEventEscalate.LexiconTypeID = "tools.ozone.moderation.defs#modEventEscalate" 438 + return json.Marshal(t.ModerationDefs_ModEventEscalate) 439 + } 440 + if t.ModerationDefs_ModEventMute != nil { 441 + t.ModerationDefs_ModEventMute.LexiconTypeID = "tools.ozone.moderation.defs#modEventMute" 442 + return json.Marshal(t.ModerationDefs_ModEventMute) 443 + } 444 + if t.ModerationDefs_ModEventEmail != nil { 445 + t.ModerationDefs_ModEventEmail.LexiconTypeID = "tools.ozone.moderation.defs#modEventEmail" 446 + return json.Marshal(t.ModerationDefs_ModEventEmail) 447 + } 448 + if t.ModerationDefs_ModEventResolveAppeal != nil { 449 + t.ModerationDefs_ModEventResolveAppeal.LexiconTypeID = "tools.ozone.moderation.defs#modEventResolveAppeal" 450 + return json.Marshal(t.ModerationDefs_ModEventResolveAppeal) 451 + } 452 + if t.ModerationDefs_ModEventDivert != nil { 453 + t.ModerationDefs_ModEventDivert.LexiconTypeID = "tools.ozone.moderation.defs#modEventDivert" 454 + return json.Marshal(t.ModerationDefs_ModEventDivert) 455 + } 456 + return nil, fmt.Errorf("cannot marshal empty enum") 457 + } 458 + func (t *ModerationDefs_ModEventView_Event) UnmarshalJSON(b []byte) error { 459 + typ, err := util.TypeExtract(b) 460 + if err != nil { 461 + return err 462 + } 463 + 464 + switch typ { 465 + case "tools.ozone.moderation.defs#modEventTakedown": 466 + t.ModerationDefs_ModEventTakedown = new(ModerationDefs_ModEventTakedown) 467 + return json.Unmarshal(b, t.ModerationDefs_ModEventTakedown) 468 + case "tools.ozone.moderation.defs#modEventReverseTakedown": 469 + t.ModerationDefs_ModEventReverseTakedown = new(ModerationDefs_ModEventReverseTakedown) 470 + return json.Unmarshal(b, t.ModerationDefs_ModEventReverseTakedown) 471 + case "tools.ozone.moderation.defs#modEventComment": 472 + t.ModerationDefs_ModEventComment = new(ModerationDefs_ModEventComment) 473 + return json.Unmarshal(b, t.ModerationDefs_ModEventComment) 474 + case "tools.ozone.moderation.defs#modEventReport": 475 + t.ModerationDefs_ModEventReport = new(ModerationDefs_ModEventReport) 476 + return json.Unmarshal(b, t.ModerationDefs_ModEventReport) 477 + case "tools.ozone.moderation.defs#modEventLabel": 478 + t.ModerationDefs_ModEventLabel = new(ModerationDefs_ModEventLabel) 479 + return json.Unmarshal(b, t.ModerationDefs_ModEventLabel) 480 + case "tools.ozone.moderation.defs#modEventAcknowledge": 481 + t.ModerationDefs_ModEventAcknowledge = new(ModerationDefs_ModEventAcknowledge) 482 + return json.Unmarshal(b, t.ModerationDefs_ModEventAcknowledge) 483 + case "tools.ozone.moderation.defs#modEventEscalate": 484 + t.ModerationDefs_ModEventEscalate = new(ModerationDefs_ModEventEscalate) 485 + return json.Unmarshal(b, t.ModerationDefs_ModEventEscalate) 486 + case "tools.ozone.moderation.defs#modEventMute": 487 + t.ModerationDefs_ModEventMute = new(ModerationDefs_ModEventMute) 488 + return json.Unmarshal(b, t.ModerationDefs_ModEventMute) 489 + case "tools.ozone.moderation.defs#modEventEmail": 490 + t.ModerationDefs_ModEventEmail = new(ModerationDefs_ModEventEmail) 491 + return json.Unmarshal(b, t.ModerationDefs_ModEventEmail) 492 + case "tools.ozone.moderation.defs#modEventResolveAppeal": 493 + t.ModerationDefs_ModEventResolveAppeal = new(ModerationDefs_ModEventResolveAppeal) 494 + return json.Unmarshal(b, t.ModerationDefs_ModEventResolveAppeal) 495 + case "tools.ozone.moderation.defs#modEventDivert": 496 + t.ModerationDefs_ModEventDivert = new(ModerationDefs_ModEventDivert) 497 + return json.Unmarshal(b, t.ModerationDefs_ModEventDivert) 498 + 499 + default: 500 + return nil 501 + } 502 + } 503 + 504 + type ModerationDefs_ModEventView_Subject struct { 505 + AdminDefs_RepoRef *comatprototypes.AdminDefs_RepoRef 506 + RepoStrongRef *comatprototypes.RepoStrongRef 507 + } 508 + 509 + func (t *ModerationDefs_ModEventView_Subject) MarshalJSON() ([]byte, error) { 510 + if t.AdminDefs_RepoRef != nil { 511 + t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" 512 + return json.Marshal(t.AdminDefs_RepoRef) 513 + } 514 + if t.RepoStrongRef != nil { 515 + t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" 516 + return json.Marshal(t.RepoStrongRef) 517 + } 518 + return nil, fmt.Errorf("cannot marshal empty enum") 519 + } 520 + func (t *ModerationDefs_ModEventView_Subject) UnmarshalJSON(b []byte) error { 521 + typ, err := util.TypeExtract(b) 522 + if err != nil { 523 + return err 524 + } 525 + 526 + switch typ { 527 + case "com.atproto.admin.defs#repoRef": 528 + t.AdminDefs_RepoRef = new(comatprototypes.AdminDefs_RepoRef) 529 + return json.Unmarshal(b, t.AdminDefs_RepoRef) 530 + case "com.atproto.repo.strongRef": 531 + t.RepoStrongRef = new(comatprototypes.RepoStrongRef) 532 + return json.Unmarshal(b, t.RepoStrongRef) 533 + 534 + default: 535 + return nil 536 + } 537 + } 538 + 539 + // ModerationDefs_Moderation is a "moderation" in the tools.ozone.moderation.defs schema. 540 + type ModerationDefs_Moderation struct { 541 + SubjectStatus *ModerationDefs_SubjectStatusView `json:"subjectStatus,omitempty" cborgen:"subjectStatus,omitempty"` 542 + } 543 + 544 + // ModerationDefs_ModerationDetail is a "moderationDetail" in the tools.ozone.moderation.defs schema. 545 + type ModerationDefs_ModerationDetail struct { 546 + SubjectStatus *ModerationDefs_SubjectStatusView `json:"subjectStatus,omitempty" cborgen:"subjectStatus,omitempty"` 547 + } 548 + 549 + // ModerationDefs_RecordView is a "recordView" in the tools.ozone.moderation.defs schema. 550 + // 551 + // RECORDTYPE: ModerationDefs_RecordView 552 + type ModerationDefs_RecordView struct { 553 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#recordView" cborgen:"$type,const=tools.ozone.moderation.defs#recordView"` 554 + BlobCids []string `json:"blobCids" cborgen:"blobCids"` 555 + Cid string `json:"cid" cborgen:"cid"` 556 + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 557 + Moderation *ModerationDefs_Moderation `json:"moderation" cborgen:"moderation"` 558 + Repo *ModerationDefs_RepoView `json:"repo" cborgen:"repo"` 559 + Uri string `json:"uri" cborgen:"uri"` 560 + Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` 561 + } 562 + 563 + // ModerationDefs_RecordViewDetail is a "recordViewDetail" in the tools.ozone.moderation.defs schema. 564 + type ModerationDefs_RecordViewDetail struct { 565 + Blobs []*ModerationDefs_BlobView `json:"blobs" cborgen:"blobs"` 566 + Cid string `json:"cid" cborgen:"cid"` 567 + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 568 + Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 569 + Moderation *ModerationDefs_ModerationDetail `json:"moderation" cborgen:"moderation"` 570 + Repo *ModerationDefs_RepoView `json:"repo" cborgen:"repo"` 571 + Uri string `json:"uri" cborgen:"uri"` 572 + Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` 573 + } 574 + 575 + // ModerationDefs_RecordViewNotFound is a "recordViewNotFound" in the tools.ozone.moderation.defs schema. 576 + // 577 + // RECORDTYPE: ModerationDefs_RecordViewNotFound 578 + type ModerationDefs_RecordViewNotFound struct { 579 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#recordViewNotFound" cborgen:"$type,const=tools.ozone.moderation.defs#recordViewNotFound"` 580 + Uri string `json:"uri" cborgen:"uri"` 581 + } 582 + 583 + // ModerationDefs_RepoView is a "repoView" in the tools.ozone.moderation.defs schema. 584 + // 585 + // RECORDTYPE: ModerationDefs_RepoView 586 + type ModerationDefs_RepoView struct { 587 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#repoView" cborgen:"$type,const=tools.ozone.moderation.defs#repoView"` 588 + Did string `json:"did" cborgen:"did"` 589 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 590 + Handle string `json:"handle" cborgen:"handle"` 591 + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 592 + InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"` 593 + InvitedBy *comatprototypes.ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 594 + InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"` 595 + Moderation *ModerationDefs_Moderation `json:"moderation" cborgen:"moderation"` 596 + RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"` 597 + } 598 + 599 + // ModerationDefs_RepoViewDetail is a "repoViewDetail" in the tools.ozone.moderation.defs schema. 600 + type ModerationDefs_RepoViewDetail struct { 601 + Did string `json:"did" cborgen:"did"` 602 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 603 + EmailConfirmedAt *string `json:"emailConfirmedAt,omitempty" cborgen:"emailConfirmedAt,omitempty"` 604 + Handle string `json:"handle" cborgen:"handle"` 605 + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 606 + InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"` 607 + InvitedBy *comatprototypes.ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 608 + Invites []*comatprototypes.ServerDefs_InviteCode `json:"invites,omitempty" cborgen:"invites,omitempty"` 609 + InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"` 610 + Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 611 + Moderation *ModerationDefs_ModerationDetail `json:"moderation" cborgen:"moderation"` 612 + RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"` 613 + } 614 + 615 + // ModerationDefs_RepoViewNotFound is a "repoViewNotFound" in the tools.ozone.moderation.defs schema. 616 + // 617 + // RECORDTYPE: ModerationDefs_RepoViewNotFound 618 + type ModerationDefs_RepoViewNotFound struct { 619 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#repoViewNotFound" cborgen:"$type,const=tools.ozone.moderation.defs#repoViewNotFound"` 620 + Did string `json:"did" cborgen:"did"` 621 + } 622 + 623 + // ModerationDefs_SubjectStatusView is a "subjectStatusView" in the tools.ozone.moderation.defs schema. 624 + type ModerationDefs_SubjectStatusView struct { 625 + // 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. 626 + Appealed *bool `json:"appealed,omitempty" cborgen:"appealed,omitempty"` 627 + // comment: Sticky comment on the subject. 628 + Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 629 + // createdAt: Timestamp referencing the first moderation status impacting event was emitted on the subject 630 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 631 + Id int64 `json:"id" cborgen:"id"` 632 + // lastAppealedAt: Timestamp referencing when the author of the subject appealed a moderation action 633 + LastAppealedAt *string `json:"lastAppealedAt,omitempty" cborgen:"lastAppealedAt,omitempty"` 634 + LastReportedAt *string `json:"lastReportedAt,omitempty" cborgen:"lastReportedAt,omitempty"` 635 + LastReviewedAt *string `json:"lastReviewedAt,omitempty" cborgen:"lastReviewedAt,omitempty"` 636 + LastReviewedBy *string `json:"lastReviewedBy,omitempty" cborgen:"lastReviewedBy,omitempty"` 637 + MuteUntil *string `json:"muteUntil,omitempty" cborgen:"muteUntil,omitempty"` 638 + ReviewState *string `json:"reviewState" cborgen:"reviewState"` 639 + Subject *ModerationDefs_SubjectStatusView_Subject `json:"subject" cborgen:"subject"` 640 + SubjectBlobCids []string `json:"subjectBlobCids,omitempty" cborgen:"subjectBlobCids,omitempty"` 641 + SubjectRepoHandle *string `json:"subjectRepoHandle,omitempty" cborgen:"subjectRepoHandle,omitempty"` 642 + SuspendUntil *string `json:"suspendUntil,omitempty" cborgen:"suspendUntil,omitempty"` 643 + Tags []string `json:"tags,omitempty" cborgen:"tags,omitempty"` 644 + Takendown *bool `json:"takendown,omitempty" cborgen:"takendown,omitempty"` 645 + // updatedAt: Timestamp referencing when the last update was made to the moderation status of the subject 646 + UpdatedAt string `json:"updatedAt" cborgen:"updatedAt"` 647 + } 648 + 649 + type ModerationDefs_SubjectStatusView_Subject struct { 650 + AdminDefs_RepoRef *comatprototypes.AdminDefs_RepoRef 651 + RepoStrongRef *comatprototypes.RepoStrongRef 652 + } 653 + 654 + func (t *ModerationDefs_SubjectStatusView_Subject) MarshalJSON() ([]byte, error) { 655 + if t.AdminDefs_RepoRef != nil { 656 + t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" 657 + return json.Marshal(t.AdminDefs_RepoRef) 658 + } 659 + if t.RepoStrongRef != nil { 660 + t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" 661 + return json.Marshal(t.RepoStrongRef) 662 + } 663 + return nil, fmt.Errorf("cannot marshal empty enum") 664 + } 665 + func (t *ModerationDefs_SubjectStatusView_Subject) UnmarshalJSON(b []byte) error { 666 + typ, err := util.TypeExtract(b) 667 + if err != nil { 668 + return err 669 + } 670 + 671 + switch typ { 672 + case "com.atproto.admin.defs#repoRef": 673 + t.AdminDefs_RepoRef = new(comatprototypes.AdminDefs_RepoRef) 674 + return json.Unmarshal(b, t.AdminDefs_RepoRef) 675 + case "com.atproto.repo.strongRef": 676 + t.RepoStrongRef = new(comatprototypes.RepoStrongRef) 677 + return json.Unmarshal(b, t.RepoStrongRef) 678 + 679 + default: 680 + return nil 681 + } 682 + } 683 + 684 + // ModerationDefs_VideoDetails is a "videoDetails" in the tools.ozone.moderation.defs schema. 685 + // 686 + // RECORDTYPE: ModerationDefs_VideoDetails 687 + type ModerationDefs_VideoDetails struct { 688 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#videoDetails" cborgen:"$type,const=tools.ozone.moderation.defs#videoDetails"` 689 + Height int64 `json:"height" cborgen:"height"` 690 + Length int64 `json:"length" cborgen:"length"` 691 + Width int64 `json:"width" cborgen:"width"` 692 + }
+175
api/ozone/moderationemitEvent.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.moderation.emitEvent 6 + 7 + import ( 8 + "context" 9 + "encoding/json" 10 + "fmt" 11 + 12 + comatprototypes "github.com/bluesky-social/indigo/api/atproto" 13 + "github.com/bluesky-social/indigo/lex/util" 14 + "github.com/bluesky-social/indigo/xrpc" 15 + ) 16 + 17 + // ModerationEmitEvent_Input is the input argument to a tools.ozone.moderation.emitEvent call. 18 + type ModerationEmitEvent_Input struct { 19 + CreatedBy string `json:"createdBy" cborgen:"createdBy"` 20 + Event *ModerationEmitEvent_Input_Event `json:"event" cborgen:"event"` 21 + Subject *ModerationEmitEvent_Input_Subject `json:"subject" cborgen:"subject"` 22 + SubjectBlobCids []string `json:"subjectBlobCids,omitempty" cborgen:"subjectBlobCids,omitempty"` 23 + } 24 + 25 + type ModerationEmitEvent_Input_Event struct { 26 + ModerationDefs_ModEventTakedown *ModerationDefs_ModEventTakedown 27 + ModerationDefs_ModEventAcknowledge *ModerationDefs_ModEventAcknowledge 28 + ModerationDefs_ModEventEscalate *ModerationDefs_ModEventEscalate 29 + ModerationDefs_ModEventComment *ModerationDefs_ModEventComment 30 + ModerationDefs_ModEventLabel *ModerationDefs_ModEventLabel 31 + ModerationDefs_ModEventReport *ModerationDefs_ModEventReport 32 + ModerationDefs_ModEventMute *ModerationDefs_ModEventMute 33 + ModerationDefs_ModEventReverseTakedown *ModerationDefs_ModEventReverseTakedown 34 + ModerationDefs_ModEventUnmute *ModerationDefs_ModEventUnmute 35 + ModerationDefs_ModEventEmail *ModerationDefs_ModEventEmail 36 + ModerationDefs_ModEventTag *ModerationDefs_ModEventTag 37 + } 38 + 39 + func (t *ModerationEmitEvent_Input_Event) MarshalJSON() ([]byte, error) { 40 + if t.ModerationDefs_ModEventTakedown != nil { 41 + t.ModerationDefs_ModEventTakedown.LexiconTypeID = "tools.ozone.moderation.defs#modEventTakedown" 42 + return json.Marshal(t.ModerationDefs_ModEventTakedown) 43 + } 44 + if t.ModerationDefs_ModEventAcknowledge != nil { 45 + t.ModerationDefs_ModEventAcknowledge.LexiconTypeID = "tools.ozone.moderation.defs#modEventAcknowledge" 46 + return json.Marshal(t.ModerationDefs_ModEventAcknowledge) 47 + } 48 + if t.ModerationDefs_ModEventEscalate != nil { 49 + t.ModerationDefs_ModEventEscalate.LexiconTypeID = "tools.ozone.moderation.defs#modEventEscalate" 50 + return json.Marshal(t.ModerationDefs_ModEventEscalate) 51 + } 52 + if t.ModerationDefs_ModEventComment != nil { 53 + t.ModerationDefs_ModEventComment.LexiconTypeID = "tools.ozone.moderation.defs#modEventComment" 54 + return json.Marshal(t.ModerationDefs_ModEventComment) 55 + } 56 + if t.ModerationDefs_ModEventLabel != nil { 57 + t.ModerationDefs_ModEventLabel.LexiconTypeID = "tools.ozone.moderation.defs#modEventLabel" 58 + return json.Marshal(t.ModerationDefs_ModEventLabel) 59 + } 60 + if t.ModerationDefs_ModEventReport != nil { 61 + t.ModerationDefs_ModEventReport.LexiconTypeID = "tools.ozone.moderation.defs#modEventReport" 62 + return json.Marshal(t.ModerationDefs_ModEventReport) 63 + } 64 + if t.ModerationDefs_ModEventMute != nil { 65 + t.ModerationDefs_ModEventMute.LexiconTypeID = "tools.ozone.moderation.defs#modEventMute" 66 + return json.Marshal(t.ModerationDefs_ModEventMute) 67 + } 68 + if t.ModerationDefs_ModEventReverseTakedown != nil { 69 + t.ModerationDefs_ModEventReverseTakedown.LexiconTypeID = "tools.ozone.moderation.defs#modEventReverseTakedown" 70 + return json.Marshal(t.ModerationDefs_ModEventReverseTakedown) 71 + } 72 + if t.ModerationDefs_ModEventUnmute != nil { 73 + t.ModerationDefs_ModEventUnmute.LexiconTypeID = "tools.ozone.moderation.defs#modEventUnmute" 74 + return json.Marshal(t.ModerationDefs_ModEventUnmute) 75 + } 76 + if t.ModerationDefs_ModEventEmail != nil { 77 + t.ModerationDefs_ModEventEmail.LexiconTypeID = "tools.ozone.moderation.defs#modEventEmail" 78 + return json.Marshal(t.ModerationDefs_ModEventEmail) 79 + } 80 + if t.ModerationDefs_ModEventTag != nil { 81 + t.ModerationDefs_ModEventTag.LexiconTypeID = "tools.ozone.moderation.defs#modEventTag" 82 + return json.Marshal(t.ModerationDefs_ModEventTag) 83 + } 84 + return nil, fmt.Errorf("cannot marshal empty enum") 85 + } 86 + func (t *ModerationEmitEvent_Input_Event) UnmarshalJSON(b []byte) error { 87 + typ, err := util.TypeExtract(b) 88 + if err != nil { 89 + return err 90 + } 91 + 92 + switch typ { 93 + case "tools.ozone.moderation.defs#modEventTakedown": 94 + t.ModerationDefs_ModEventTakedown = new(ModerationDefs_ModEventTakedown) 95 + return json.Unmarshal(b, t.ModerationDefs_ModEventTakedown) 96 + case "tools.ozone.moderation.defs#modEventAcknowledge": 97 + t.ModerationDefs_ModEventAcknowledge = new(ModerationDefs_ModEventAcknowledge) 98 + return json.Unmarshal(b, t.ModerationDefs_ModEventAcknowledge) 99 + case "tools.ozone.moderation.defs#modEventEscalate": 100 + t.ModerationDefs_ModEventEscalate = new(ModerationDefs_ModEventEscalate) 101 + return json.Unmarshal(b, t.ModerationDefs_ModEventEscalate) 102 + case "tools.ozone.moderation.defs#modEventComment": 103 + t.ModerationDefs_ModEventComment = new(ModerationDefs_ModEventComment) 104 + return json.Unmarshal(b, t.ModerationDefs_ModEventComment) 105 + case "tools.ozone.moderation.defs#modEventLabel": 106 + t.ModerationDefs_ModEventLabel = new(ModerationDefs_ModEventLabel) 107 + return json.Unmarshal(b, t.ModerationDefs_ModEventLabel) 108 + case "tools.ozone.moderation.defs#modEventReport": 109 + t.ModerationDefs_ModEventReport = new(ModerationDefs_ModEventReport) 110 + return json.Unmarshal(b, t.ModerationDefs_ModEventReport) 111 + case "tools.ozone.moderation.defs#modEventMute": 112 + t.ModerationDefs_ModEventMute = new(ModerationDefs_ModEventMute) 113 + return json.Unmarshal(b, t.ModerationDefs_ModEventMute) 114 + case "tools.ozone.moderation.defs#modEventReverseTakedown": 115 + t.ModerationDefs_ModEventReverseTakedown = new(ModerationDefs_ModEventReverseTakedown) 116 + return json.Unmarshal(b, t.ModerationDefs_ModEventReverseTakedown) 117 + case "tools.ozone.moderation.defs#modEventUnmute": 118 + t.ModerationDefs_ModEventUnmute = new(ModerationDefs_ModEventUnmute) 119 + return json.Unmarshal(b, t.ModerationDefs_ModEventUnmute) 120 + case "tools.ozone.moderation.defs#modEventEmail": 121 + t.ModerationDefs_ModEventEmail = new(ModerationDefs_ModEventEmail) 122 + return json.Unmarshal(b, t.ModerationDefs_ModEventEmail) 123 + case "tools.ozone.moderation.defs#modEventTag": 124 + t.ModerationDefs_ModEventTag = new(ModerationDefs_ModEventTag) 125 + return json.Unmarshal(b, t.ModerationDefs_ModEventTag) 126 + 127 + default: 128 + return nil 129 + } 130 + } 131 + 132 + type ModerationEmitEvent_Input_Subject struct { 133 + AdminDefs_RepoRef *comatprototypes.AdminDefs_RepoRef 134 + RepoStrongRef *comatprototypes.RepoStrongRef 135 + } 136 + 137 + func (t *ModerationEmitEvent_Input_Subject) MarshalJSON() ([]byte, error) { 138 + if t.AdminDefs_RepoRef != nil { 139 + t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" 140 + return json.Marshal(t.AdminDefs_RepoRef) 141 + } 142 + if t.RepoStrongRef != nil { 143 + t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" 144 + return json.Marshal(t.RepoStrongRef) 145 + } 146 + return nil, fmt.Errorf("cannot marshal empty enum") 147 + } 148 + func (t *ModerationEmitEvent_Input_Subject) UnmarshalJSON(b []byte) error { 149 + typ, err := util.TypeExtract(b) 150 + if err != nil { 151 + return err 152 + } 153 + 154 + switch typ { 155 + case "com.atproto.admin.defs#repoRef": 156 + t.AdminDefs_RepoRef = new(comatprototypes.AdminDefs_RepoRef) 157 + return json.Unmarshal(b, t.AdminDefs_RepoRef) 158 + case "com.atproto.repo.strongRef": 159 + t.RepoStrongRef = new(comatprototypes.RepoStrongRef) 160 + return json.Unmarshal(b, t.RepoStrongRef) 161 + 162 + default: 163 + return nil 164 + } 165 + } 166 + 167 + // ModerationEmitEvent calls the XRPC method "tools.ozone.moderation.emitEvent". 168 + func ModerationEmitEvent(ctx context.Context, c *xrpc.Client, input *ModerationEmitEvent_Input) (*ModerationDefs_ModEventView, error) { 169 + var out ModerationDefs_ModEventView 170 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "tools.ozone.moderation.emitEvent", nil, input, &out); err != nil { 171 + return nil, err 172 + } 173 + 174 + return &out, nil 175 + }
+25
api/ozone/moderationgetEvent.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.moderation.getEvent 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ModerationGetEvent calls the XRPC method "tools.ozone.moderation.getEvent". 14 + func ModerationGetEvent(ctx context.Context, c *xrpc.Client, id int64) (*ModerationDefs_ModEventViewDetail, error) { 15 + var out ModerationDefs_ModEventViewDetail 16 + 17 + params := map[string]interface{}{ 18 + "id": id, 19 + } 20 + if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.moderation.getEvent", params, nil, &out); err != nil { 21 + return nil, err 22 + } 23 + 24 + return &out, nil 25 + }
+26
api/ozone/moderationgetRecord.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.moderation.getRecord 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ModerationGetRecord calls the XRPC method "tools.ozone.moderation.getRecord". 14 + func ModerationGetRecord(ctx context.Context, c *xrpc.Client, cid string, uri string) (*ModerationDefs_RecordViewDetail, error) { 15 + var out ModerationDefs_RecordViewDetail 16 + 17 + params := map[string]interface{}{ 18 + "cid": cid, 19 + "uri": uri, 20 + } 21 + if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.moderation.getRecord", params, nil, &out); err != nil { 22 + return nil, err 23 + } 24 + 25 + return &out, nil 26 + }
+25
api/ozone/moderationgetRepo.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.moderation.getRepo 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ModerationGetRepo calls the XRPC method "tools.ozone.moderation.getRepo". 14 + func ModerationGetRepo(ctx context.Context, c *xrpc.Client, did string) (*ModerationDefs_RepoViewDetail, error) { 15 + var out ModerationDefs_RepoViewDetail 16 + 17 + params := map[string]interface{}{ 18 + "did": did, 19 + } 20 + if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.moderation.getRepo", params, nil, &out); err != nil { 21 + return nil, err 22 + } 23 + 24 + return &out, nil 25 + }
+59
api/ozone/moderationqueryStatuses.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.moderation.queryStatuses 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ModerationQueryStatuses_Output is the output of a tools.ozone.moderation.queryStatuses call. 14 + type ModerationQueryStatuses_Output struct { 15 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 + SubjectStatuses []*ModerationDefs_SubjectStatusView `json:"subjectStatuses" cborgen:"subjectStatuses"` 17 + } 18 + 19 + // ModerationQueryStatuses calls the XRPC method "tools.ozone.moderation.queryStatuses". 20 + // 21 + // appealed: Get subjects in unresolved appealed status 22 + // comment: Search subjects by keyword from comments 23 + // includeMuted: By default, we don't include muted subjects in the results. Set this to true to include them. 24 + // lastReviewedBy: Get all subject statuses that were reviewed by a specific moderator 25 + // reportedAfter: Search subjects reported after a given timestamp 26 + // reportedBefore: Search subjects reported before a given timestamp 27 + // reviewState: Specify when fetching subjects in a certain state 28 + // reviewedAfter: Search subjects reviewed after a given timestamp 29 + // reviewedBefore: Search subjects reviewed before a given timestamp 30 + // takendown: Get subjects that were taken down 31 + func ModerationQueryStatuses(ctx context.Context, c *xrpc.Client, appealed bool, comment string, cursor string, excludeTags []string, ignoreSubjects []string, includeMuted bool, lastReviewedBy string, limit int64, reportedAfter string, reportedBefore string, reviewState string, reviewedAfter string, reviewedBefore string, sortDirection string, sortField string, subject string, tags []string, takendown bool) (*ModerationQueryStatuses_Output, error) { 32 + var out ModerationQueryStatuses_Output 33 + 34 + params := map[string]interface{}{ 35 + "appealed": appealed, 36 + "comment": comment, 37 + "cursor": cursor, 38 + "excludeTags": excludeTags, 39 + "ignoreSubjects": ignoreSubjects, 40 + "includeMuted": includeMuted, 41 + "lastReviewedBy": lastReviewedBy, 42 + "limit": limit, 43 + "reportedAfter": reportedAfter, 44 + "reportedBefore": reportedBefore, 45 + "reviewState": reviewState, 46 + "reviewedAfter": reviewedAfter, 47 + "reviewedBefore": reviewedBefore, 48 + "sortDirection": sortDirection, 49 + "sortField": sortField, 50 + "subject": subject, 51 + "tags": tags, 52 + "takendown": takendown, 53 + } 54 + if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.moderation.queryStatuses", params, nil, &out); err != nil { 55 + return nil, err 56 + } 57 + 58 + return &out, nil 59 + }
+36
api/ozone/moderationsearchRepos.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.moderation.searchRepos 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ModerationSearchRepos_Output is the output of a tools.ozone.moderation.searchRepos call. 14 + type ModerationSearchRepos_Output struct { 15 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 + Repos []*ModerationDefs_RepoView `json:"repos" cborgen:"repos"` 17 + } 18 + 19 + // ModerationSearchRepos calls the XRPC method "tools.ozone.moderation.searchRepos". 20 + // 21 + // term: DEPRECATED: use 'q' instead 22 + func ModerationSearchRepos(ctx context.Context, c *xrpc.Client, cursor string, limit int64, q string, term string) (*ModerationSearchRepos_Output, error) { 23 + var out ModerationSearchRepos_Output 24 + 25 + params := map[string]interface{}{ 26 + "cursor": cursor, 27 + "limit": limit, 28 + "q": q, 29 + "term": term, 30 + } 31 + if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.moderation.searchRepos", params, nil, &out); err != nil { 32 + return nil, err 33 + } 34 + 35 + return &out, nil 36 + }
+18 -17
automod/engine/persist.go
··· 5 5 "fmt" 6 6 7 7 comatproto "github.com/bluesky-social/indigo/api/atproto" 8 + toolsozone "github.com/bluesky-social/indigo/api/ozone" 8 9 ) 9 10 10 11 func (eng *Engine) persistCounters(ctx context.Context, eff *Effects) error { ··· 92 93 actionNewLabelCount.WithLabelValues("account", val).Inc() 93 94 } 94 95 comment := "[automod]: auto-labeling account" 95 - _, err := comatproto.AdminEmitModerationEvent(ctx, xrpcc, &comatproto.AdminEmitModerationEvent_Input{ 96 + _, err := toolsozone.ModerationEmitEvent(ctx, xrpcc, &toolsozone.ModerationEmitEvent_Input{ 96 97 CreatedBy: xrpcc.Auth.Did, 97 - Event: &comatproto.AdminEmitModerationEvent_Input_Event{ 98 - AdminDefs_ModEventLabel: &comatproto.AdminDefs_ModEventLabel{ 98 + Event: &toolsozone.ModerationEmitEvent_Input_Event{ 99 + ModerationDefs_ModEventLabel: &toolsozone.ModerationDefs_ModEventLabel{ 99 100 CreateLabelVals: newLabels, 100 101 NegateLabelVals: []string{}, 101 102 Comment: &comment, 102 103 }, 103 104 }, 104 - Subject: &comatproto.AdminEmitModerationEvent_Input_Subject{ 105 + Subject: &toolsozone.ModerationEmitEvent_Input_Subject{ 105 106 AdminDefs_RepoRef: &comatproto.AdminDefs_RepoRef{ 106 107 Did: c.Account.Identity.DID.String(), 107 108 }, ··· 128 129 c.Logger.Warn("account-takedown") 129 130 actionNewTakedownCount.WithLabelValues("account").Inc() 130 131 comment := "[automod]: auto account-takedown" 131 - _, err := comatproto.AdminEmitModerationEvent(ctx, xrpcc, &comatproto.AdminEmitModerationEvent_Input{ 132 + _, err := toolsozone.ModerationEmitEvent(ctx, xrpcc, &toolsozone.ModerationEmitEvent_Input{ 132 133 CreatedBy: xrpcc.Auth.Did, 133 - Event: &comatproto.AdminEmitModerationEvent_Input_Event{ 134 - AdminDefs_ModEventTakedown: &comatproto.AdminDefs_ModEventTakedown{ 134 + Event: &toolsozone.ModerationEmitEvent_Input_Event{ 135 + ModerationDefs_ModEventTakedown: &toolsozone.ModerationDefs_ModEventTakedown{ 135 136 Comment: &comment, 136 137 }, 137 138 }, 138 - Subject: &comatproto.AdminEmitModerationEvent_Input_Subject{ 139 + Subject: &toolsozone.ModerationEmitEvent_Input_Subject{ 139 140 AdminDefs_RepoRef: &comatproto.AdminDefs_RepoRef{ 140 141 Did: c.Account.Identity.DID.String(), 141 142 }, ··· 166 167 atURI := c.RecordOp.ATURI().String() 167 168 newLabels := dedupeStrings(c.effects.RecordLabels) 168 169 if len(newLabels) > 0 && eng.AdminClient != nil { 169 - rv, err := comatproto.AdminGetRecord(ctx, eng.AdminClient, c.RecordOp.CID.String(), c.RecordOp.ATURI().String()) 170 + rv, err := toolsozone.ModerationGetRecord(ctx, eng.AdminClient, c.RecordOp.CID.String(), c.RecordOp.ATURI().String()) 170 171 if err != nil { 171 172 c.Logger.Warn("failed to fetch private record metadata", "err", err) 172 173 } else { ··· 256 257 actionNewLabelCount.WithLabelValues("record", val).Inc() 257 258 } 258 259 comment := "[automod]: auto-labeling record" 259 - _, err := comatproto.AdminEmitModerationEvent(ctx, xrpcc, &comatproto.AdminEmitModerationEvent_Input{ 260 + _, err := toolsozone.ModerationEmitEvent(ctx, xrpcc, &toolsozone.ModerationEmitEvent_Input{ 260 261 CreatedBy: xrpcc.Auth.Did, 261 - Event: &comatproto.AdminEmitModerationEvent_Input_Event{ 262 - AdminDefs_ModEventLabel: &comatproto.AdminDefs_ModEventLabel{ 262 + Event: &toolsozone.ModerationEmitEvent_Input_Event{ 263 + ModerationDefs_ModEventLabel: &toolsozone.ModerationDefs_ModEventLabel{ 263 264 CreateLabelVals: newLabels, 264 265 NegateLabelVals: []string{}, 265 266 Comment: &comment, 266 267 }, 267 268 }, 268 - Subject: &comatproto.AdminEmitModerationEvent_Input_Subject{ 269 + Subject: &toolsozone.ModerationEmitEvent_Input_Subject{ 269 270 RepoStrongRef: &strongRef, 270 271 }, 271 272 }) ··· 285 286 c.Logger.Warn("record-takedown") 286 287 actionNewTakedownCount.WithLabelValues("record").Inc() 287 288 comment := "[automod]: automated record-takedown" 288 - _, err := comatproto.AdminEmitModerationEvent(ctx, xrpcc, &comatproto.AdminEmitModerationEvent_Input{ 289 + _, err := toolsozone.ModerationEmitEvent(ctx, xrpcc, &toolsozone.ModerationEmitEvent_Input{ 289 290 CreatedBy: xrpcc.Auth.Did, 290 - Event: &comatproto.AdminEmitModerationEvent_Input_Event{ 291 - AdminDefs_ModEventTakedown: &comatproto.AdminDefs_ModEventTakedown{ 291 + Event: &toolsozone.ModerationEmitEvent_Input_Event{ 292 + ModerationDefs_ModEventTakedown: &toolsozone.ModerationDefs_ModEventTakedown{ 292 293 Comment: &comment, 293 294 }, 294 295 }, 295 - Subject: &comatproto.AdminEmitModerationEvent_Input_Subject{ 296 + Subject: &toolsozone.ModerationEmitEvent_Input_Subject{ 296 297 RepoStrongRef: &strongRef, 297 298 }, 298 299 SubjectBlobCids: dedupeStrings(c.effects.BlobTakedowns),
+9 -8
automod/engine/persisthelpers.go
··· 6 6 "time" 7 7 8 8 comatproto "github.com/bluesky-social/indigo/api/atproto" 9 + toolsozone "github.com/bluesky-social/indigo/api/ozone" 9 10 "github.com/bluesky-social/indigo/atproto/syntax" 10 11 "github.com/bluesky-social/indigo/automod/countstore" 11 12 "github.com/bluesky-social/indigo/xrpc" ··· 117 118 // before creating a report, query to see if automod has already reported this account in the past week for the same reason 118 119 // NOTE: this is running in an inner loop (if there are multiple reports), which is a bit inefficient, but seems acceptable 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( 121 + // ModerationQueryEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, inc ludeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) 122 + resp, err := toolsozone.ModerationQueryEvents( 122 123 ctx, 123 124 xrpcc, 124 125 nil, ··· 136 137 nil, 137 138 "", 138 139 did.String(), 139 - []string{"com.atproto.admin.defs#modEventReport"}, 140 + []string{"tools.ozone.moderation.defs#modEventReport"}, 140 141 ) 141 142 142 143 if err != nil { ··· 144 145 } 145 146 for _, modEvt := range resp.Events { 146 147 // defensively ensure that our query params worked correctly 147 - if modEvt.Event.AdminDefs_ModEventReport == nil || modEvt.CreatedBy != xrpcc.Auth.Did || modEvt.Subject.AdminDefs_RepoRef == nil || modEvt.Subject.AdminDefs_RepoRef.Did != did.String() || (modEvt.Event.AdminDefs_ModEventReport.ReportType != nil && *modEvt.Event.AdminDefs_ModEventReport.ReportType != mr.ReasonType) { 148 + if modEvt.Event.ModerationDefs_ModEventReport == nil || modEvt.CreatedBy != xrpcc.Auth.Did || modEvt.Subject.AdminDefs_RepoRef == nil || modEvt.Subject.AdminDefs_RepoRef.Did != did.String() || (modEvt.Event.ModerationDefs_ModEventReport.ReportType != nil && *modEvt.Event.ModerationDefs_ModEventReport.ReportType != mr.ReasonType) { 148 149 continue 149 150 } 150 151 // igonre if older ··· 188 189 // before creating a report, query to see if automod has already reported this account in the past week for the same reason 189 190 // NOTE: this is running in an inner loop (if there are multiple reports), which is a bit inefficient, but seems acceptable 190 191 191 - // AdminQueryModerationEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, inc ludeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) 192 - resp, err := comatproto.AdminQueryModerationEvents( 192 + // ModerationQueryEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, inc ludeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) 193 + resp, err := toolsozone.ModerationQueryEvents( 193 194 ctx, 194 195 xrpcc, 195 196 nil, ··· 207 208 nil, 208 209 "", 209 210 uri.String(), 210 - []string{"com.atproto.admin.defs#modEventReport"}, 211 + []string{"tools.ozone.moderation.defs#modEventReport"}, 211 212 ) 212 213 if err != nil { 213 214 return false, err 214 215 } 215 216 for _, modEvt := range resp.Events { 216 217 // defensively ensure that our query params worked correctly 217 - if modEvt.Event.AdminDefs_ModEventReport == nil || modEvt.CreatedBy != xrpcc.Auth.Did || modEvt.Subject.RepoStrongRef == nil || modEvt.Subject.RepoStrongRef.Uri != uri.String() || (modEvt.Event.AdminDefs_ModEventReport.ReportType != nil && *modEvt.Event.AdminDefs_ModEventReport.ReportType != mr.ReasonType) { 218 + if modEvt.Event.ModerationDefs_ModEventReport == nil || modEvt.CreatedBy != xrpcc.Auth.Did || modEvt.Subject.RepoStrongRef == nil || modEvt.Subject.RepoStrongRef.Uri != uri.String() || (modEvt.Event.ModerationDefs_ModEventReport.ReportType != nil && *modEvt.Event.ModerationDefs_ModEventReport.ReportType != mr.ReasonType) { 218 219 continue 219 220 } 220 221 // igonre if older
+5 -4
cmd/beemo/main.go
··· 14 14 "time" 15 15 16 16 comatproto "github.com/bluesky-social/indigo/api/atproto" 17 + toolsozone "github.com/bluesky-social/indigo/api/ozone" 17 18 "github.com/bluesky-social/indigo/util" 18 19 "github.com/bluesky-social/indigo/xrpc" 19 20 ··· 145 146 xrpcc.Auth.RefreshJwt = refresh.RefreshJwt 146 147 147 148 // query just new reports (regardless of resolution state) 148 - // AdminQueryModerationEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, includeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) (*AdminQueryModerationEvents_Output, error) 149 + // ModerationQueryEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, includeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) (*ModerationQueryEvents_Output, error) 149 150 var limit int64 = 50 150 - me, err := comatproto.AdminQueryModerationEvents( 151 + me, err := toolsozone.ModerationQueryEvents( 151 152 cctx.Context, 152 153 xrpcc, 153 154 nil, ··· 165 166 nil, 166 167 "", 167 168 "", 168 - []string{"com.atproto.admin.defs#modEventReport"}, 169 + []string{"tools.ozone.moderation.defs#modEventReport"}, 169 170 ) 170 171 if err != nil { 171 172 return err 172 173 } 173 174 // this works out to iterate from newest to oldest, which is the behavior we want (report only newest, then break) 174 175 for _, evt := range me.Events { 175 - report := evt.Event.AdminDefs_ModEventReport 176 + report := evt.Event.ModerationDefs_ModEventReport 176 177 // TODO: filter out based on subject state? similar to old "report.ResolvedByActionIds" 177 178 createdAt, err := time.Parse(time.RFC3339, evt.CreatedAt) 178 179 if err != nil {
+15 -14
cmd/gosky/admin.go
··· 13 13 "github.com/bluesky-social/indigo/api" 14 14 "github.com/bluesky-social/indigo/api/atproto" 15 15 comatproto "github.com/bluesky-social/indigo/api/atproto" 16 + toolsozone "github.com/bluesky-social/indigo/api/ozone" 16 17 "github.com/bluesky-social/indigo/atproto/identity" 17 18 "github.com/bluesky-social/indigo/atproto/syntax" 18 19 "github.com/bluesky-social/indigo/util/cliutil" ··· 79 80 xrpcc.AdminToken = &adminKey 80 81 xrpcc.Host = id.PDSEndpoint() 81 82 82 - rep, err := atproto.AdminGetRepo(ctx, xrpcc, did) 83 + rep, err := toolsozone.ModerationGetRepo(ctx, xrpcc, did) 83 84 if err != nil { 84 85 return fmt.Errorf("getRepo %s: %w", did, err) 85 86 } ··· 125 126 fmt.Println("INVITES DISABLED") 126 127 } 127 128 128 - var invited []*atproto.AdminDefs_RepoViewDetail 129 + var invited []*toolsozone.ModerationDefs_RepoViewDetail 129 130 var lk sync.Mutex 130 131 var wg sync.WaitGroup 131 132 var used int ··· 140 141 wg.Add(1) 141 142 go func(did string) { 142 143 defer wg.Done() 143 - repo, err := atproto.AdminGetRepo(ctx, xrpcc, did) 144 + repo, err := toolsozone.ModerationGetRepo(ctx, xrpcc, did) 144 145 if err != nil { 145 146 fmt.Println("ERROR: ", err) 146 147 return ··· 246 247 return u, nil 247 248 } 248 249 249 - repo, err := atproto.AdminGetRepo(ctx, xrpcc, did) 250 + repo, err := toolsozone.ModerationGetRepo(ctx, xrpcc, did) 250 251 if err != nil { 251 252 return nil, err 252 253 } ··· 260 261 if ok { 261 262 invby = invu.Handle 262 263 } else { 263 - invrepo, err := atproto.AdminGetRepo(ctx, xrpcc, fa) 264 + invrepo, err := toolsozone.ModerationGetRepo(ctx, xrpcc, fa) 264 265 if err != nil { 265 266 return nil, fmt.Errorf("resolving inviter (%q): %w", fa, err) 266 267 } ··· 385 386 386 387 // fetch recent moderation reports 387 388 // AdminQueryModerationEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, includeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) (*AdminQueryModerationEvents_Output, error) 388 - resp, err := atproto.AdminQueryModerationEvents( 389 + resp, err := toolsozone.ModerationQueryEvents( 389 390 ctx, 390 391 xrpcc, 391 392 nil, ··· 403 404 nil, 404 405 "", 405 406 "", 406 - []string{"com.atproto.admin.defs#modEventReport"}, 407 + []string{"tools.ozone.moderation.defs#modEventReport"}, 407 408 ) 408 409 if err != nil { 409 410 return err ··· 560 561 } 561 562 } 562 563 563 - rep, err := atproto.AdminGetRepo(ctx, xrpcc, next) 564 + rep, err := toolsozone.ModerationGetRepo(ctx, xrpcc, next) 564 565 if err != nil { 565 566 fmt.Printf("Failed to getRepo for DID %s: %s\n", next, err.Error()) 566 567 continue ··· 643 644 adminUser = resp 644 645 } 645 646 646 - resp, err := atproto.AdminEmitModerationEvent(ctx, xrpcc, &atproto.AdminEmitModerationEvent_Input{ 647 + resp, err := toolsozone.ModerationEmitEvent(ctx, xrpcc, &toolsozone.ModerationEmitEvent_Input{ 647 648 CreatedBy: adminUser, 648 - Event: &atproto.AdminEmitModerationEvent_Input_Event{ 649 - AdminDefs_ModEventTakedown: &atproto.AdminDefs_ModEventTakedown{ 649 + Event: &toolsozone.ModerationEmitEvent_Input_Event{ 650 + ModerationDefs_ModEventTakedown: &toolsozone.ModerationDefs_ModEventTakedown{ 650 651 Comment: &reason, 651 652 }, 652 653 }, 653 - Subject: &atproto.AdminEmitModerationEvent_Input_Subject{ 654 + Subject: &toolsozone.ModerationEmitEvent_Input_Subject{ 654 655 AdminDefs_RepoRef: &atproto.AdminDefs_RepoRef{ 655 656 Did: did, 656 657 }, ··· 697 698 did = resp 698 699 } 699 700 700 - resp, err := atproto.AdminQueryModerationEvents( 701 + resp, err := toolsozone.ModerationQueryEvents( 701 702 ctx, 702 703 xrpcc, 703 704 nil, ··· 715 716 nil, 716 717 "", 717 718 "", 718 - []string{"com.atproto.admin.defs#modEventReport"}, 719 + []string{"tools.ozone.moderation.defs#modEventReport"}, 719 720 ) 720 721 if err != nil { 721 722 return err
+1 -1
go.mod
··· 52 52 github.com/scylladb/gocqlx/v2 v2.8.1-0.20230309105046-dec046bd85e6 53 53 github.com/stretchr/testify v1.8.4 54 54 github.com/urfave/cli/v2 v2.25.7 55 - github.com/whyrusleeping/cbor-gen v0.1.0 55 + github.com/whyrusleeping/cbor-gen v0.1.1-0.20240311221002-68b9f235c302 56 56 github.com/whyrusleeping/go-did v0.0.0-20230824162731-404d1707d5d6 57 57 gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b 58 58 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1
+2 -2
go.sum
··· 626 626 github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= 627 627 github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 h1:5HZfQkwe0mIfyDmc1Em5GqlNRzcdtlv4HTNmdpt7XH0= 628 628 github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11/go.mod h1:Wlo/SzPmxVp6vXpGt/zaXhHH0fn4IxgqZc82aKg6bpQ= 629 - github.com/whyrusleeping/cbor-gen v0.1.0 h1:Jneeq3V5enErVcuL0NKEbD1Gi+iOvEeFhXOV1S1Fc6g= 630 - github.com/whyrusleeping/cbor-gen v0.1.0/go.mod h1:pM99HXyEbSQHcosHc0iW7YFmwnscr+t9Te4ibko05so= 629 + github.com/whyrusleeping/cbor-gen v0.1.1-0.20240311221002-68b9f235c302 h1:MhInbXe4SzcImAKktUvWBCWZgcw6MYf5NfumTj1BhAw= 630 + github.com/whyrusleeping/cbor-gen v0.1.1-0.20240311221002-68b9f235c302/go.mod h1:pM99HXyEbSQHcosHc0iW7YFmwnscr+t9Te4ibko05so= 631 631 github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= 632 632 github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= 633 633 github.com/whyrusleeping/go-did v0.0.0-20230824162731-404d1707d5d6 h1:yJ9/LwIGIk/c0CdoavpC9RNSGSruIspSZtxG3Nnldic=
+76 -76
lex/util/cbor_gen_test.go
··· 36 36 } 37 37 38 38 // t.Bool (bool) (bool) 39 - if uint64(len("bool")) > cbg.MaxLength { 39 + if len("bool") > 8192 { 40 40 return xerrors.Errorf("Value in field \"bool\" was too long") 41 41 } 42 42 ··· 52 52 } 53 53 54 54 // t.Null (string) (string) 55 - if uint64(len("null")) > cbg.MaxLength { 55 + if len("null") > 8192 { 56 56 return xerrors.Errorf("Value in field \"null\" was too long") 57 57 } 58 58 ··· 68 68 return err 69 69 } 70 70 } else { 71 - if uint64(len(*t.Null)) > cbg.MaxLength { 71 + if len(*t.Null) > 8192 { 72 72 return xerrors.Errorf("Value in field t.Null was too long") 73 73 } 74 74 ··· 81 81 } 82 82 83 83 // t.Array ([]string) (slice) 84 - if uint64(len("array")) > cbg.MaxLength { 84 + if len("array") > 8192 { 85 85 return xerrors.Errorf("Value in field \"array\" was too long") 86 86 } 87 87 ··· 92 92 return err 93 93 } 94 94 95 - if uint64(len(t.Array)) > cbg.MaxLength { 95 + if len(t.Array) > 8192 { 96 96 return xerrors.Errorf("Slice value in field t.Array was too long") 97 97 } 98 98 ··· 100 100 return err 101 101 } 102 102 for _, v := range t.Array { 103 - if uint64(len(v)) > cbg.MaxLength { 103 + if len(v) > 8192 { 104 104 return xerrors.Errorf("Value in field v was too long") 105 105 } 106 106 ··· 116 116 // t.Absent (string) (string) 117 117 if t.Absent != nil { 118 118 119 - if uint64(len("absent")) > cbg.MaxLength { 119 + if len("absent") > 8192 { 120 120 return xerrors.Errorf("Value in field \"absent\" was too long") 121 121 } 122 122 ··· 132 132 return err 133 133 } 134 134 } else { 135 - if uint64(len(*t.Absent)) > cbg.MaxLength { 135 + if len(*t.Absent) > 8192 { 136 136 return xerrors.Errorf("Value in field t.Absent was too long") 137 137 } 138 138 ··· 146 146 } 147 147 148 148 // t.Object (util.basicSchemaInner) (struct) 149 - if uint64(len("object")) > cbg.MaxLength { 149 + if len("object") > 8192 { 150 150 return xerrors.Errorf("Value in field \"object\" was too long") 151 151 } 152 152 ··· 162 162 } 163 163 164 164 // t.String (string) (string) 165 - if uint64(len("string")) > cbg.MaxLength { 165 + if len("string") > 8192 { 166 166 return xerrors.Errorf("Value in field \"string\" was too long") 167 167 } 168 168 ··· 173 173 return err 174 174 } 175 175 176 - if uint64(len(t.String)) > cbg.MaxLength { 176 + if len(t.String) > 8192 { 177 177 return xerrors.Errorf("Value in field t.String was too long") 178 178 } 179 179 ··· 185 185 } 186 186 187 187 // t.Integer (int64) (int64) 188 - if uint64(len("integer")) > cbg.MaxLength { 188 + if len("integer") > 8192 { 189 189 return xerrors.Errorf("Value in field \"integer\" was too long") 190 190 } 191 191 ··· 207 207 } 208 208 209 209 // t.Unicode (string) (string) 210 - if uint64(len("unicode")) > cbg.MaxLength { 210 + if len("unicode") > 8192 { 211 211 return xerrors.Errorf("Value in field \"unicode\" was too long") 212 212 } 213 213 ··· 218 218 return err 219 219 } 220 220 221 - if uint64(len(t.Unicode)) > cbg.MaxLength { 221 + if len(t.Unicode) > 8192 { 222 222 return xerrors.Errorf("Value in field t.Unicode was too long") 223 223 } 224 224 ··· 260 260 for i := uint64(0); i < n; i++ { 261 261 262 262 { 263 - sval, err := cbg.ReadString(cr) 263 + sval, err := cbg.ReadStringWithMax(cr, 8192) 264 264 if err != nil { 265 265 return err 266 266 } ··· 300 300 return err 301 301 } 302 302 303 - sval, err := cbg.ReadString(cr) 303 + sval, err := cbg.ReadStringWithMax(cr, 8192) 304 304 if err != nil { 305 305 return err 306 306 } ··· 316 316 return err 317 317 } 318 318 319 - if extra > cbg.MaxLength { 319 + if extra > 8192 { 320 320 return fmt.Errorf("t.Array: array too large (%d)", extra) 321 321 } 322 322 ··· 338 338 _ = err 339 339 340 340 { 341 - sval, err := cbg.ReadString(cr) 341 + sval, err := cbg.ReadStringWithMax(cr, 8192) 342 342 if err != nil { 343 343 return err 344 344 } ··· 361 361 return err 362 362 } 363 363 364 - sval, err := cbg.ReadString(cr) 364 + sval, err := cbg.ReadStringWithMax(cr, 8192) 365 365 if err != nil { 366 366 return err 367 367 } ··· 383 383 case "string": 384 384 385 385 { 386 - sval, err := cbg.ReadString(cr) 386 + sval, err := cbg.ReadStringWithMax(cr, 8192) 387 387 if err != nil { 388 388 return err 389 389 } ··· 394 394 case "integer": 395 395 { 396 396 maj, extra, err := cr.ReadHeader() 397 - var extraI int64 398 397 if err != nil { 399 398 return err 400 399 } 400 + var extraI int64 401 401 switch maj { 402 402 case cbg.MajUnsignedInt: 403 403 extraI = int64(extra) ··· 420 420 case "unicode": 421 421 422 422 { 423 - sval, err := cbg.ReadString(cr) 423 + sval, err := cbg.ReadStringWithMax(cr, 8192) 424 424 if err != nil { 425 425 return err 426 426 } ··· 449 449 } 450 450 451 451 // t.Arr ([]string) (slice) 452 - if uint64(len("arr")) > cbg.MaxLength { 452 + if len("arr") > 8192 { 453 453 return xerrors.Errorf("Value in field \"arr\" was too long") 454 454 } 455 455 ··· 460 460 return err 461 461 } 462 462 463 - if uint64(len(t.Arr)) > cbg.MaxLength { 463 + if len(t.Arr) > 8192 { 464 464 return xerrors.Errorf("Slice value in field t.Arr was too long") 465 465 } 466 466 ··· 468 468 return err 469 469 } 470 470 for _, v := range t.Arr { 471 - if uint64(len(v)) > cbg.MaxLength { 471 + if len(v) > 8192 { 472 472 return xerrors.Errorf("Value in field v was too long") 473 473 } 474 474 ··· 482 482 } 483 483 484 484 // t.Bool (bool) (bool) 485 - if uint64(len("bool")) > cbg.MaxLength { 485 + if len("bool") > 8192 { 486 486 return xerrors.Errorf("Value in field \"bool\" was too long") 487 487 } 488 488 ··· 498 498 } 499 499 500 500 // t.Number (int64) (int64) 501 - if uint64(len("number")) > cbg.MaxLength { 501 + if len("number") > 8192 { 502 502 return xerrors.Errorf("Value in field \"number\" was too long") 503 503 } 504 504 ··· 520 520 } 521 521 522 522 // t.String (string) (string) 523 - if uint64(len("string")) > cbg.MaxLength { 523 + if len("string") > 8192 { 524 524 return xerrors.Errorf("Value in field \"string\" was too long") 525 525 } 526 526 ··· 531 531 return err 532 532 } 533 533 534 - if uint64(len(t.String)) > cbg.MaxLength { 534 + if len(t.String) > 8192 { 535 535 return xerrors.Errorf("Value in field t.String was too long") 536 536 } 537 537 ··· 573 573 for i := uint64(0); i < n; i++ { 574 574 575 575 { 576 - sval, err := cbg.ReadString(cr) 576 + sval, err := cbg.ReadStringWithMax(cr, 8192) 577 577 if err != nil { 578 578 return err 579 579 } ··· 590 590 return err 591 591 } 592 592 593 - if extra > cbg.MaxLength { 593 + if extra > 8192 { 594 594 return fmt.Errorf("t.Arr: array too large (%d)", extra) 595 595 } 596 596 ··· 612 612 _ = err 613 613 614 614 { 615 - sval, err := cbg.ReadString(cr) 615 + sval, err := cbg.ReadStringWithMax(cr, 8192) 616 616 if err != nil { 617 617 return err 618 618 } ··· 644 644 case "number": 645 645 { 646 646 maj, extra, err := cr.ReadHeader() 647 - var extraI int64 648 647 if err != nil { 649 648 return err 650 649 } 650 + var extraI int64 651 651 switch maj { 652 652 case cbg.MajUnsignedInt: 653 653 extraI = int64(extra) ··· 670 670 case "string": 671 671 672 672 { 673 - sval, err := cbg.ReadString(cr) 673 + sval, err := cbg.ReadStringWithMax(cr, 8192) 674 674 if err != nil { 675 675 return err 676 676 } ··· 699 699 } 700 700 701 701 // t.A (util.LexLink) (struct) 702 - if uint64(len("a")) > cbg.MaxLength { 702 + if len("a") > 8192 { 703 703 return xerrors.Errorf("Value in field \"a\" was too long") 704 704 } 705 705 ··· 715 715 } 716 716 717 717 // t.B (util.LexBytes) (slice) 718 - if uint64(len("b")) > cbg.MaxLength { 718 + if len("b") > 8192 { 719 719 return xerrors.Errorf("Value in field \"b\" was too long") 720 720 } 721 721 ··· 726 726 return err 727 727 } 728 728 729 - if uint64(len(t.B)) > cbg.ByteArrayMaxLen { 729 + if len(t.B) > 2097152 { 730 730 return xerrors.Errorf("Byte array in field t.B was too long") 731 731 } 732 732 ··· 739 739 } 740 740 741 741 // t.C (util.LexBlob) (struct) 742 - if uint64(len("c")) > cbg.MaxLength { 742 + if len("c") > 8192 { 743 743 return xerrors.Errorf("Value in field \"c\" was too long") 744 744 } 745 745 ··· 785 785 for i := uint64(0); i < n; i++ { 786 786 787 787 { 788 - sval, err := cbg.ReadString(cr) 788 + sval, err := cbg.ReadStringWithMax(cr, 8192) 789 789 if err != nil { 790 790 return err 791 791 } ··· 812 812 return err 813 813 } 814 814 815 - if extra > cbg.ByteArrayMaxLen { 815 + if extra > 2097152 { 816 816 return fmt.Errorf("t.B: byte array too large (%d)", extra) 817 817 } 818 818 if maj != cbg.MajByteString { ··· 864 864 } 865 865 866 866 // t.A (string) (string) 867 - if uint64(len("a")) > cbg.MaxLength { 867 + if len("a") > 8192 { 868 868 return xerrors.Errorf("Value in field \"a\" was too long") 869 869 } 870 870 ··· 875 875 return err 876 876 } 877 877 878 - if uint64(len(t.A)) > cbg.MaxLength { 878 + if len(t.A) > 8192 { 879 879 return xerrors.Errorf("Value in field t.A was too long") 880 880 } 881 881 ··· 887 887 } 888 888 889 889 // t.B (int64) (int64) 890 - if uint64(len("b")) > cbg.MaxLength { 890 + if len("b") > 8192 { 891 891 return xerrors.Errorf("Value in field \"b\" was too long") 892 892 } 893 893 ··· 909 909 } 910 910 911 911 // t.C (bool) (bool) 912 - if uint64(len("c")) > cbg.MaxLength { 912 + if len("c") > 8192 { 913 913 return xerrors.Errorf("Value in field \"c\" was too long") 914 914 } 915 915 ··· 927 927 // t.D (string) (string) 928 928 if t.D != nil { 929 929 930 - if uint64(len("d")) > cbg.MaxLength { 930 + if len("d") > 8192 { 931 931 return xerrors.Errorf("Value in field \"d\" was too long") 932 932 } 933 933 ··· 943 943 return err 944 944 } 945 945 } else { 946 - if uint64(len(*t.D)) > cbg.MaxLength { 946 + if len(*t.D) > 8192 { 947 947 return xerrors.Errorf("Value in field t.D was too long") 948 948 } 949 949 ··· 957 957 } 958 958 959 959 // t.E (string) (string) 960 - if uint64(len("e")) > cbg.MaxLength { 960 + if len("e") > 8192 { 961 961 return xerrors.Errorf("Value in field \"e\" was too long") 962 962 } 963 963 ··· 973 973 return err 974 974 } 975 975 } else { 976 - if uint64(len(*t.E)) > cbg.MaxLength { 976 + if len(*t.E) > 8192 { 977 977 return xerrors.Errorf("Value in field t.E was too long") 978 978 } 979 979 ··· 986 986 } 987 987 988 988 // t.F ([]string) (slice) 989 - if uint64(len("f")) > cbg.MaxLength { 989 + if len("f") > 8192 { 990 990 return xerrors.Errorf("Value in field \"f\" was too long") 991 991 } 992 992 ··· 997 997 return err 998 998 } 999 999 1000 - if uint64(len(t.F)) > cbg.MaxLength { 1000 + if len(t.F) > 8192 { 1001 1001 return xerrors.Errorf("Slice value in field t.F was too long") 1002 1002 } 1003 1003 ··· 1005 1005 return err 1006 1006 } 1007 1007 for _, v := range t.F { 1008 - if uint64(len(v)) > cbg.MaxLength { 1008 + if len(v) > 8192 { 1009 1009 return xerrors.Errorf("Value in field v was too long") 1010 1010 } 1011 1011 ··· 1019 1019 } 1020 1020 1021 1021 // t.G (util.basicOldSchemaInner) (struct) 1022 - if uint64(len("g")) > cbg.MaxLength { 1022 + if len("g") > 8192 { 1023 1023 return xerrors.Errorf("Value in field \"g\" was too long") 1024 1024 } 1025 1025 ··· 1065 1065 for i := uint64(0); i < n; i++ { 1066 1066 1067 1067 { 1068 - sval, err := cbg.ReadString(cr) 1068 + sval, err := cbg.ReadStringWithMax(cr, 8192) 1069 1069 if err != nil { 1070 1070 return err 1071 1071 } ··· 1078 1078 case "a": 1079 1079 1080 1080 { 1081 - sval, err := cbg.ReadString(cr) 1081 + sval, err := cbg.ReadStringWithMax(cr, 8192) 1082 1082 if err != nil { 1083 1083 return err 1084 1084 } ··· 1089 1089 case "b": 1090 1090 { 1091 1091 maj, extra, err := cr.ReadHeader() 1092 - var extraI int64 1093 1092 if err != nil { 1094 1093 return err 1095 1094 } 1095 + var extraI int64 1096 1096 switch maj { 1097 1097 case cbg.MajUnsignedInt: 1098 1098 extraI = int64(extra) ··· 1142 1142 return err 1143 1143 } 1144 1144 1145 - sval, err := cbg.ReadString(cr) 1145 + sval, err := cbg.ReadStringWithMax(cr, 8192) 1146 1146 if err != nil { 1147 1147 return err 1148 1148 } ··· 1163 1163 return err 1164 1164 } 1165 1165 1166 - sval, err := cbg.ReadString(cr) 1166 + sval, err := cbg.ReadStringWithMax(cr, 8192) 1167 1167 if err != nil { 1168 1168 return err 1169 1169 } ··· 1179 1179 return err 1180 1180 } 1181 1181 1182 - if extra > cbg.MaxLength { 1182 + if extra > 8192 { 1183 1183 return fmt.Errorf("t.F: array too large (%d)", extra) 1184 1184 } 1185 1185 ··· 1201 1201 _ = err 1202 1202 1203 1203 { 1204 - sval, err := cbg.ReadString(cr) 1204 + sval, err := cbg.ReadStringWithMax(cr, 8192) 1205 1205 if err != nil { 1206 1206 return err 1207 1207 } ··· 1243 1243 } 1244 1244 1245 1245 // t.H (string) (string) 1246 - if uint64(len("h")) > cbg.MaxLength { 1246 + if len("h") > 8192 { 1247 1247 return xerrors.Errorf("Value in field \"h\" was too long") 1248 1248 } 1249 1249 ··· 1254 1254 return err 1255 1255 } 1256 1256 1257 - if uint64(len(t.H)) > cbg.MaxLength { 1257 + if len(t.H) > 8192 { 1258 1258 return xerrors.Errorf("Value in field t.H was too long") 1259 1259 } 1260 1260 ··· 1266 1266 } 1267 1267 1268 1268 // t.I (int64) (int64) 1269 - if uint64(len("i")) > cbg.MaxLength { 1269 + if len("i") > 8192 { 1270 1270 return xerrors.Errorf("Value in field \"i\" was too long") 1271 1271 } 1272 1272 ··· 1288 1288 } 1289 1289 1290 1290 // t.J (bool) (bool) 1291 - if uint64(len("j")) > cbg.MaxLength { 1291 + if len("j") > 8192 { 1292 1292 return xerrors.Errorf("Value in field \"j\" was too long") 1293 1293 } 1294 1294 ··· 1304 1304 } 1305 1305 1306 1306 // t.K ([]string) (slice) 1307 - if uint64(len("k")) > cbg.MaxLength { 1307 + if len("k") > 8192 { 1308 1308 return xerrors.Errorf("Value in field \"k\" was too long") 1309 1309 } 1310 1310 ··· 1315 1315 return err 1316 1316 } 1317 1317 1318 - if uint64(len(t.K)) > cbg.MaxLength { 1318 + if len(t.K) > 8192 { 1319 1319 return xerrors.Errorf("Slice value in field t.K was too long") 1320 1320 } 1321 1321 ··· 1323 1323 return err 1324 1324 } 1325 1325 for _, v := range t.K { 1326 - if uint64(len(v)) > cbg.MaxLength { 1326 + if len(v) > 8192 { 1327 1327 return xerrors.Errorf("Value in field v was too long") 1328 1328 } 1329 1329 ··· 1367 1367 for i := uint64(0); i < n; i++ { 1368 1368 1369 1369 { 1370 - sval, err := cbg.ReadString(cr) 1370 + sval, err := cbg.ReadStringWithMax(cr, 8192) 1371 1371 if err != nil { 1372 1372 return err 1373 1373 } ··· 1380 1380 case "h": 1381 1381 1382 1382 { 1383 - sval, err := cbg.ReadString(cr) 1383 + sval, err := cbg.ReadStringWithMax(cr, 8192) 1384 1384 if err != nil { 1385 1385 return err 1386 1386 } ··· 1391 1391 case "i": 1392 1392 { 1393 1393 maj, extra, err := cr.ReadHeader() 1394 - var extraI int64 1395 1394 if err != nil { 1396 1395 return err 1397 1396 } 1397 + var extraI int64 1398 1398 switch maj { 1399 1399 case cbg.MajUnsignedInt: 1400 1400 extraI = int64(extra) ··· 1439 1439 return err 1440 1440 } 1441 1441 1442 - if extra > cbg.MaxLength { 1442 + if extra > 8192 { 1443 1443 return fmt.Errorf("t.K: array too large (%d)", extra) 1444 1444 } 1445 1445 ··· 1461 1461 _ = err 1462 1462 1463 1463 { 1464 - sval, err := cbg.ReadString(cr) 1464 + sval, err := cbg.ReadStringWithMax(cr, 8192) 1465 1465 if err != nil { 1466 1466 return err 1467 1467 } ··· 1493 1493 } 1494 1494 1495 1495 // t.A (util.LexLink) (struct) 1496 - if uint64(len("a")) > cbg.MaxLength { 1496 + if len("a") > 8192 { 1497 1497 return xerrors.Errorf("Value in field \"a\" was too long") 1498 1498 } 1499 1499 ··· 1509 1509 } 1510 1510 1511 1511 // t.B (util.LexBytes) (slice) 1512 - if uint64(len("b")) > cbg.MaxLength { 1512 + if len("b") > 8192 { 1513 1513 return xerrors.Errorf("Value in field \"b\" was too long") 1514 1514 } 1515 1515 ··· 1520 1520 return err 1521 1521 } 1522 1522 1523 - if uint64(len(t.B)) > cbg.ByteArrayMaxLen { 1523 + if len(t.B) > 2097152 { 1524 1524 return xerrors.Errorf("Byte array in field t.B was too long") 1525 1525 } 1526 1526 ··· 1564 1564 for i := uint64(0); i < n; i++ { 1565 1565 1566 1566 { 1567 - sval, err := cbg.ReadString(cr) 1567 + sval, err := cbg.ReadStringWithMax(cr, 8192) 1568 1568 if err != nil { 1569 1569 return err 1570 1570 } ··· 1591 1591 return err 1592 1592 } 1593 1593 1594 - if extra > cbg.ByteArrayMaxLen { 1594 + if extra > 2097152 { 1595 1595 return fmt.Errorf("t.B: byte array too large (%d)", extra) 1596 1596 } 1597 1597 if maj != cbg.MajByteString {
-19
pds/handlers.go
··· 316 316 panic("not yet implemented") 317 317 } 318 318 319 - func (s *Server) handleComAtprotoSyncGetCommitPath(ctx context.Context, did string, earliest string, latest string) (*comatprototypes.SyncGetCommitPath_Output, error) { 320 - panic("not yet implemented") 321 - } 322 - 323 319 func (s *Server) handleComAtprotoSyncGetHead(ctx context.Context, did string) (*comatprototypes.SyncGetHead_Output, error) { 324 320 user, err := s.lookupUserByDid(ctx, did) 325 321 if err != nil { ··· 352 348 } 353 349 354 350 return buf, nil 355 - } 356 - 357 - func (s *Server) handleComAtprotoAdminGetRecord(ctx context.Context, cid string, uri string) (*comatprototypes.AdminDefs_RecordViewDetail, error) { 358 - panic("nyi") 359 - } 360 - 361 - func (s *Server) handleComAtprotoAdminGetRepo(ctx context.Context, did string) (*comatprototypes.AdminDefs_RepoViewDetail, error) { 362 - panic("nyi") 363 - } 364 - func (s *Server) handleComAtprotoAdminSearchRepos(ctx context.Context, cursor string, limit int, q string, term string) (*comatprototypes.AdminSearchRepos_Output, error) { 365 - panic("nyi") 366 351 } 367 352 368 353 func (s *Server) handleComAtprotoSyncGetBlocks(ctx context.Context, cids []string, did string) (io.Reader, error) { ··· 463 448 } 464 449 465 450 func (s *Server) handleComAtprotoSyncGetLatestCommit(ctx context.Context, did string) (*comatprototypes.SyncGetLatestCommit_Output, error) { 466 - panic("nyi") 467 - } 468 - 469 - func (s *Server) handleComAtprotoTempUpgradeRepoVersion(ctx context.Context, body *comatprototypes.TempUpgradeRepoVersion_Input) error { 470 451 panic("nyi") 471 452 } 472 453
-59
pds/stubs.go
··· 15 15 e.POST("/xrpc/com.atproto.admin.enableAccountInvites", s.HandleComAtprotoAdminEnableAccountInvites) 16 16 e.GET("/xrpc/com.atproto.admin.getAccountInfo", s.HandleComAtprotoAdminGetAccountInfo) 17 17 e.GET("/xrpc/com.atproto.admin.getInviteCodes", s.HandleComAtprotoAdminGetInviteCodes) 18 - e.GET("/xrpc/com.atproto.admin.getRecord", s.HandleComAtprotoAdminGetRecord) 19 - e.GET("/xrpc/com.atproto.admin.getRepo", s.HandleComAtprotoAdminGetRepo) 20 18 e.GET("/xrpc/com.atproto.admin.getSubjectStatus", s.HandleComAtprotoAdminGetSubjectStatus) 21 - e.GET("/xrpc/com.atproto.admin.searchRepos", s.HandleComAtprotoAdminSearchRepos) 22 19 e.POST("/xrpc/com.atproto.admin.sendEmail", s.HandleComAtprotoAdminSendEmail) 23 20 e.POST("/xrpc/com.atproto.admin.updateAccountEmail", s.HandleComAtprotoAdminUpdateAccountEmail) 24 21 e.POST("/xrpc/com.atproto.admin.updateAccountHandle", s.HandleComAtprotoAdminUpdateAccountHandle) ··· 162 159 return c.JSON(200, out) 163 160 } 164 161 165 - func (s *Server) HandleComAtprotoAdminGetRecord(c echo.Context) error { 166 - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminGetRecord") 167 - defer span.End() 168 - cid := c.QueryParam("cid") 169 - uri := c.QueryParam("uri") 170 - var out *comatprototypes.AdminDefs_RecordViewDetail 171 - var handleErr error 172 - // func (s *Server) handleComAtprotoAdminGetRecord(ctx context.Context,cid string,uri string) (*comatprototypes.AdminDefs_RecordViewDetail, error) 173 - out, handleErr = s.handleComAtprotoAdminGetRecord(ctx, cid, uri) 174 - if handleErr != nil { 175 - return handleErr 176 - } 177 - return c.JSON(200, out) 178 - } 179 - 180 - func (s *Server) HandleComAtprotoAdminGetRepo(c echo.Context) error { 181 - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminGetRepo") 182 - defer span.End() 183 - did := c.QueryParam("did") 184 - var out *comatprototypes.AdminDefs_RepoViewDetail 185 - var handleErr error 186 - // func (s *Server) handleComAtprotoAdminGetRepo(ctx context.Context,did string) (*comatprototypes.AdminDefs_RepoViewDetail, error) 187 - out, handleErr = s.handleComAtprotoAdminGetRepo(ctx, did) 188 - if handleErr != nil { 189 - return handleErr 190 - } 191 - return c.JSON(200, out) 192 - } 193 - 194 162 func (s *Server) HandleComAtprotoAdminGetSubjectStatus(c echo.Context) error { 195 163 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminGetSubjectStatus") 196 164 defer span.End() ··· 201 169 var handleErr error 202 170 // func (s *Server) handleComAtprotoAdminGetSubjectStatus(ctx context.Context,blob string,did string,uri string) (*comatprototypes.AdminGetSubjectStatus_Output, error) 203 171 out, handleErr = s.handleComAtprotoAdminGetSubjectStatus(ctx, blob, did, uri) 204 - if handleErr != nil { 205 - return handleErr 206 - } 207 - return c.JSON(200, out) 208 - } 209 - 210 - func (s *Server) HandleComAtprotoAdminSearchRepos(c echo.Context) error { 211 - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminSearchRepos") 212 - defer span.End() 213 - cursor := c.QueryParam("cursor") 214 - 215 - var limit int 216 - if p := c.QueryParam("limit"); p != "" { 217 - var err error 218 - limit, err = strconv.Atoi(p) 219 - if err != nil { 220 - return err 221 - } 222 - } else { 223 - limit = 50 224 - } 225 - q := c.QueryParam("q") 226 - term := c.QueryParam("term") 227 - var out *comatprototypes.AdminSearchRepos_Output 228 - var handleErr error 229 - // func (s *Server) handleComAtprotoAdminSearchRepos(ctx context.Context,cursor string,limit int,q string,term string) (*comatprototypes.AdminSearchRepos_Output, error) 230 - out, handleErr = s.handleComAtprotoAdminSearchRepos(ctx, cursor, limit, q, term) 231 172 if handleErr != nil { 232 173 return handleErr 233 174 }
-12
testing/utils.go
··· 399 399 } 400 400 } 401 401 402 - func (u *TestUser) DoRebase(t *testing.T) { 403 - t.Helper() 404 - 405 - ctx := context.TODO() 406 - err := atproto.RepoRebaseRepo(ctx, u.client, &atproto.RepoRebaseRepo_Input{ 407 - Repo: u.did, 408 - }) 409 - if err != nil { 410 - t.Fatal(err) 411 - } 412 - } 413 - 414 402 func TestPLC(t *testing.T) *plc.FakeDid { 415 403 // TODO: just do in memory... 416 404 tdir, err := os.MkdirTemp("", "plcserv")
+1 -1
xrpc/xrpc.go
··· 184 184 } 185 185 186 186 // use admin auth if we have it configured and are doing a request that requires it 187 - if c.AdminToken != nil && (strings.HasPrefix(method, "com.atproto.admin.") || method == "com.atproto.account.createInviteCode" || method == "com.atproto.server.createInviteCodes") { 187 + if c.AdminToken != nil && (strings.HasPrefix(method, "com.atproto.admin.") || strings.HasPrefix(method, "tools.ozone.") || method == "com.atproto.account.createInviteCode" || method == "com.atproto.server.createInviteCodes") { 188 188 req.Header.Set("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte("admin:"+*c.AdminToken))) 189 189 } else if c.Auth != nil { 190 190 req.Header.Set("Authorization", "Bearer "+c.Auth.AccessJwt)