this repo has no description
0
fork

Configure Feed

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

lexgen 20241030 (#785)

@brianolson: there was a lexgen issue in here that I manually worked
around. we have a new lexicon which uses a ref directly for the API
endpoint "input" schema, which maybe hasn't be exercised before.

authored by

bnewbold and committed by
GitHub
6ac14ce9 1a73c3fb

+390 -141
+18 -11
api/atproto/admindefs.go
··· 10 10 11 11 // AdminDefs_AccountView is a "accountView" in the com.atproto.admin.defs schema. 12 12 type AdminDefs_AccountView struct { 13 - DeactivatedAt *string `json:"deactivatedAt,omitempty" cborgen:"deactivatedAt,omitempty"` 14 - Did string `json:"did" cborgen:"did"` 15 - Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 16 - EmailConfirmedAt *string `json:"emailConfirmedAt,omitempty" cborgen:"emailConfirmedAt,omitempty"` 17 - Handle string `json:"handle" cborgen:"handle"` 18 - IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 19 - InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"` 20 - InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 21 - Invites []*ServerDefs_InviteCode `json:"invites,omitempty" cborgen:"invites,omitempty"` 22 - InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"` 23 - RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords,omitempty" cborgen:"relatedRecords,omitempty"` 13 + DeactivatedAt *string `json:"deactivatedAt,omitempty" cborgen:"deactivatedAt,omitempty"` 14 + Did string `json:"did" cborgen:"did"` 15 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 16 + EmailConfirmedAt *string `json:"emailConfirmedAt,omitempty" cborgen:"emailConfirmedAt,omitempty"` 17 + Handle string `json:"handle" cborgen:"handle"` 18 + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 19 + InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"` 20 + InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 21 + Invites []*ServerDefs_InviteCode `json:"invites,omitempty" cborgen:"invites,omitempty"` 22 + InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"` 23 + RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords,omitempty" cborgen:"relatedRecords,omitempty"` 24 + ThreatSignatures []*AdminDefs_ThreatSignature `json:"threatSignatures,omitempty" cborgen:"threatSignatures,omitempty"` 24 25 } 25 26 26 27 // AdminDefs_RepoBlobRef is a "repoBlobRef" in the com.atproto.admin.defs schema. ··· 46 47 Applied bool `json:"applied" cborgen:"applied"` 47 48 Ref *string `json:"ref,omitempty" cborgen:"ref,omitempty"` 48 49 } 50 + 51 + // AdminDefs_ThreatSignature is a "threatSignature" in the com.atproto.admin.defs schema. 52 + type AdminDefs_ThreatSignature struct { 53 + Property string `json:"property" cborgen:"property"` 54 + Value string `json:"value" cborgen:"value"` 55 + }
+26
api/bsky/unspeccedgetConfig.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package bsky 4 + 5 + // schema: app.bsky.unspecced.getConfig 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // UnspeccedGetConfig_Output is the output of a app.bsky.unspecced.getConfig call. 14 + type UnspeccedGetConfig_Output struct { 15 + CheckEmailConfirmed *bool `json:"checkEmailConfirmed,omitempty" cborgen:"checkEmailConfirmed,omitempty"` 16 + } 17 + 18 + // UnspeccedGetConfig calls the XRPC method "app.bsky.unspecced.getConfig". 19 + func UnspeccedGetConfig(ctx context.Context, c *xrpc.Client) (*UnspeccedGetConfig_Output, error) { 20 + var out UnspeccedGetConfig_Output 21 + if err := c.Do(ctx, xrpc.Query, "", "app.bsky.unspecced.getConfig", nil, nil, &out); err != nil { 22 + return nil, err 23 + } 24 + 25 + return &out, nil 26 + }
+27 -25
api/ozone/moderationdefs.go
··· 687 687 // 688 688 // RECORDTYPE: ModerationDefs_RepoView 689 689 type ModerationDefs_RepoView struct { 690 - LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#repoView" cborgen:"$type,const=tools.ozone.moderation.defs#repoView"` 691 - DeactivatedAt *string `json:"deactivatedAt,omitempty" cborgen:"deactivatedAt,omitempty"` 692 - Did string `json:"did" cborgen:"did"` 693 - Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 694 - Handle string `json:"handle" cborgen:"handle"` 695 - IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 696 - InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"` 697 - InvitedBy *comatprototypes.ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 698 - InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"` 699 - Moderation *ModerationDefs_Moderation `json:"moderation" cborgen:"moderation"` 700 - RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"` 690 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#repoView" cborgen:"$type,const=tools.ozone.moderation.defs#repoView"` 691 + DeactivatedAt *string `json:"deactivatedAt,omitempty" cborgen:"deactivatedAt,omitempty"` 692 + Did string `json:"did" cborgen:"did"` 693 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 694 + Handle string `json:"handle" cborgen:"handle"` 695 + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 696 + InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"` 697 + InvitedBy *comatprototypes.ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 698 + InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"` 699 + Moderation *ModerationDefs_Moderation `json:"moderation" cborgen:"moderation"` 700 + RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"` 701 + ThreatSignatures []*comatprototypes.AdminDefs_ThreatSignature `json:"threatSignatures,omitempty" cborgen:"threatSignatures,omitempty"` 701 702 } 702 703 703 704 // ModerationDefs_RepoViewDetail is a "repoViewDetail" in the tools.ozone.moderation.defs schema. 704 705 // 705 706 // RECORDTYPE: ModerationDefs_RepoViewDetail 706 707 type ModerationDefs_RepoViewDetail struct { 707 - LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#repoViewDetail" cborgen:"$type,const=tools.ozone.moderation.defs#repoViewDetail"` 708 - DeactivatedAt *string `json:"deactivatedAt,omitempty" cborgen:"deactivatedAt,omitempty"` 709 - Did string `json:"did" cborgen:"did"` 710 - Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 711 - EmailConfirmedAt *string `json:"emailConfirmedAt,omitempty" cborgen:"emailConfirmedAt,omitempty"` 712 - Handle string `json:"handle" cborgen:"handle"` 713 - IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 714 - InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"` 715 - InvitedBy *comatprototypes.ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 716 - Invites []*comatprototypes.ServerDefs_InviteCode `json:"invites,omitempty" cborgen:"invites,omitempty"` 717 - InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"` 718 - Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 719 - Moderation *ModerationDefs_ModerationDetail `json:"moderation" cborgen:"moderation"` 720 - RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"` 708 + LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#repoViewDetail" cborgen:"$type,const=tools.ozone.moderation.defs#repoViewDetail"` 709 + DeactivatedAt *string `json:"deactivatedAt,omitempty" cborgen:"deactivatedAt,omitempty"` 710 + Did string `json:"did" cborgen:"did"` 711 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 712 + EmailConfirmedAt *string `json:"emailConfirmedAt,omitempty" cborgen:"emailConfirmedAt,omitempty"` 713 + Handle string `json:"handle" cborgen:"handle"` 714 + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 715 + InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"` 716 + InvitedBy *comatprototypes.ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 717 + Invites []*comatprototypes.ServerDefs_InviteCode `json:"invites,omitempty" cborgen:"invites,omitempty"` 718 + InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"` 719 + Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 720 + Moderation *ModerationDefs_ModerationDetail `json:"moderation" cborgen:"moderation"` 721 + RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"` 722 + ThreatSignatures []*comatprototypes.AdminDefs_ThreatSignature `json:"threatSignatures,omitempty" cborgen:"threatSignatures,omitempty"` 721 723 } 722 724 723 725 // ModerationDefs_RepoViewNotFound is a "repoViewNotFound" in the tools.ozone.moderation.defs schema.
+6 -2
api/ozone/moderationqueryEvents.go
··· 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 23 + // collections: If specified, only events where the subject belongs to the given collections will be returned. When subjectType is set to 'account', this will be ignored. 23 24 // comment: If specified, only events with comments containing the keyword are returned 24 25 // createdAfter: Retrieve events created after a given timestamp 25 26 // createdBefore: Retrieve events created before a given timestamp 26 27 // hasComment: If true, only events with comments are returned 27 - // includeAllUserRecords: If true, events on all record types (posts, lists, profile etc.) owned by the did are returned 28 + // includeAllUserRecords: If true, events on all record types (posts, lists, profile etc.) or records from given 'collections' param, owned by the did are returned. 28 29 // removedLabels: If specified, only events where all of these labels were removed are returned 29 30 // removedTags: If specified, only events where all of these tags were removed are returned 30 31 // sortDirection: Sort direction for the events. Defaults to descending order of created at timestamp. 32 + // subjectType: If specified, only events where the subject is of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored. 31 33 // 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) { 34 + func ModerationQueryEvents(ctx context.Context, c *xrpc.Client, addedLabels []string, addedTags []string, collections []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, subjectType string, types []string) (*ModerationQueryEvents_Output, error) { 33 35 var out ModerationQueryEvents_Output 34 36 35 37 params := map[string]interface{}{ 36 38 "addedLabels": addedLabels, 37 39 "addedTags": addedTags, 40 + "collections": collections, 38 41 "comment": comment, 39 42 "createdAfter": createdAfter, 40 43 "createdBefore": createdBefore, ··· 48 51 "reportTypes": reportTypes, 49 52 "sortDirection": sortDirection, 50 53 "subject": subject, 54 + "subjectType": subjectType, 51 55 "types": types, 52 56 } 53 57 if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.moderation.queryEvents", params, nil, &out); err != nil {
+6 -2
api/ozone/moderationqueryStatuses.go
··· 19 19 // ModerationQueryStatuses calls the XRPC method "tools.ozone.moderation.queryStatuses". 20 20 // 21 21 // appealed: Get subjects in unresolved appealed status 22 + // collections: If specified, subjects belonging to the given collections will be returned. When subjectType is set to 'account', this will be ignored. 22 23 // comment: Search subjects by keyword from comments 23 - // includeAllUserRecords: All subjects belonging to the account specified in the 'subject' param will be returned. 24 + // includeAllUserRecords: All subjects, or subjects from given 'collections' param, belonging to the account specified in the 'subject' param will be returned. 24 25 // includeMuted: By default, we don't include muted subjects in the results. Set this to true to include them. 25 26 // lastReviewedBy: Get all subject statuses that were reviewed by a specific moderator 26 27 // onlyMuted: When set to true, only muted subjects and reporters will be returned. ··· 30 31 // reviewedAfter: Search subjects reviewed after a given timestamp 31 32 // reviewedBefore: Search subjects reviewed before a given timestamp 32 33 // subject: The subject to get the status for. 34 + // subjectType: If specified, subjects of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored. 33 35 // takendown: Get subjects that were taken down 34 - func ModerationQueryStatuses(ctx context.Context, c *xrpc.Client, appealed bool, comment string, cursor string, excludeTags []string, ignoreSubjects []string, includeAllUserRecords bool, includeMuted bool, lastReviewedBy string, limit int64, onlyMuted bool, reportedAfter string, reportedBefore string, reviewState string, reviewedAfter string, reviewedBefore string, sortDirection string, sortField string, subject string, tags []string, takendown bool) (*ModerationQueryStatuses_Output, error) { 36 + func ModerationQueryStatuses(ctx context.Context, c *xrpc.Client, appealed bool, collections []string, comment string, cursor string, excludeTags []string, ignoreSubjects []string, includeAllUserRecords bool, includeMuted bool, lastReviewedBy string, limit int64, onlyMuted bool, reportedAfter string, reportedBefore string, reviewState string, reviewedAfter string, reviewedBefore string, sortDirection string, sortField string, subject string, subjectType string, tags []string, takendown bool) (*ModerationQueryStatuses_Output, error) { 35 37 var out ModerationQueryStatuses_Output 36 38 37 39 params := map[string]interface{}{ 38 40 "appealed": appealed, 41 + "collections": collections, 39 42 "comment": comment, 40 43 "cursor": cursor, 41 44 "excludeTags": excludeTags, ··· 53 56 "sortDirection": sortDirection, 54 57 "sortField": sortField, 55 58 "subject": subject, 59 + "subjectType": subjectType, 56 60 "tags": tags, 57 61 "takendown": takendown, 58 62 }
+28
api/ozone/setaddValues.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.set.addValues 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // SetAddValues_Input is the input argument to a tools.ozone.set.addValues call. 14 + type SetAddValues_Input struct { 15 + // name: Name of the set to add values to 16 + Name string `json:"name" cborgen:"name"` 17 + // values: Array of string values to add to the set 18 + Values []string `json:"values" cborgen:"values"` 19 + } 20 + 21 + // SetAddValues calls the XRPC method "tools.ozone.set.addValues". 22 + func SetAddValues(ctx context.Context, c *xrpc.Client, input *SetAddValues_Input) error { 23 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "tools.ozone.set.addValues", nil, input, nil); err != nil { 24 + return err 25 + } 26 + 27 + return nil 28 + }
+20
api/ozone/setdefs.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.set.defs 6 + 7 + // SetDefs_Set is a "set" in the tools.ozone.set.defs schema. 8 + type SetDefs_Set struct { 9 + Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 10 + Name string `json:"name" cborgen:"name"` 11 + } 12 + 13 + // SetDefs_SetView is a "setView" in the tools.ozone.set.defs schema. 14 + type SetDefs_SetView struct { 15 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 16 + Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 17 + Name string `json:"name" cborgen:"name"` 18 + SetSize int64 `json:"setSize" cborgen:"setSize"` 19 + UpdatedAt string `json:"updatedAt" cborgen:"updatedAt"` 20 + }
+31
api/ozone/setdeleteSet.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.set.deleteSet 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // SetDeleteSet_Input is the input argument to a tools.ozone.set.deleteSet call. 14 + type SetDeleteSet_Input struct { 15 + // name: Name of the set to delete 16 + Name string `json:"name" cborgen:"name"` 17 + } 18 + 19 + // SetDeleteSet_Output is the output of a tools.ozone.set.deleteSet call. 20 + type SetDeleteSet_Output struct { 21 + } 22 + 23 + // SetDeleteSet calls the XRPC method "tools.ozone.set.deleteSet". 24 + func SetDeleteSet(ctx context.Context, c *xrpc.Client, input *SetDeleteSet_Input) (*SetDeleteSet_Output, error) { 25 + var out SetDeleteSet_Output 26 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "tools.ozone.set.deleteSet", nil, input, &out); err != nil { 27 + return nil, err 28 + } 29 + 30 + return &out, nil 31 + }
+28
api/ozone/setdeleteValues.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.set.deleteValues 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // SetDeleteValues_Input is the input argument to a tools.ozone.set.deleteValues call. 14 + type SetDeleteValues_Input struct { 15 + // name: Name of the set to delete values from 16 + Name string `json:"name" cborgen:"name"` 17 + // values: Array of string values to delete from the set 18 + Values []string `json:"values" cborgen:"values"` 19 + } 20 + 21 + // SetDeleteValues calls the XRPC method "tools.ozone.set.deleteValues". 22 + func SetDeleteValues(ctx context.Context, c *xrpc.Client, input *SetDeleteValues_Input) error { 23 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "tools.ozone.set.deleteValues", nil, input, nil); err != nil { 24 + return err 25 + } 26 + 27 + return nil 28 + }
+34
api/ozone/setgetValues.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.set.getValues 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // SetGetValues_Output is the output of a tools.ozone.set.getValues call. 14 + type SetGetValues_Output struct { 15 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 + Set *SetDefs_SetView `json:"set" cborgen:"set"` 17 + Values []string `json:"values" cborgen:"values"` 18 + } 19 + 20 + // SetGetValues calls the XRPC method "tools.ozone.set.getValues". 21 + func SetGetValues(ctx context.Context, c *xrpc.Client, cursor string, limit int64, name string) (*SetGetValues_Output, error) { 22 + var out SetGetValues_Output 23 + 24 + params := map[string]interface{}{ 25 + "cursor": cursor, 26 + "limit": limit, 27 + "name": name, 28 + } 29 + if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.set.getValues", params, nil, &out); err != nil { 30 + return nil, err 31 + } 32 + 33 + return &out, nil 34 + }
+37
api/ozone/setquerySets.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.set.querySets 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // SetQuerySets_Output is the output of a tools.ozone.set.querySets call. 14 + type SetQuerySets_Output struct { 15 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 + Sets []*SetDefs_SetView `json:"sets" cborgen:"sets"` 17 + } 18 + 19 + // SetQuerySets calls the XRPC method "tools.ozone.set.querySets". 20 + // 21 + // sortDirection: Defaults to ascending order of name field. 22 + func SetQuerySets(ctx context.Context, c *xrpc.Client, cursor string, limit int64, namePrefix string, sortBy string, sortDirection string) (*SetQuerySets_Output, error) { 23 + var out SetQuerySets_Output 24 + 25 + params := map[string]interface{}{ 26 + "cursor": cursor, 27 + "limit": limit, 28 + "namePrefix": namePrefix, 29 + "sortBy": sortBy, 30 + "sortDirection": sortDirection, 31 + } 32 + if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.set.querySets", params, nil, &out); err != nil { 33 + return nil, err 34 + } 35 + 36 + return &out, nil 37 + }
+21
api/ozone/setupsertSet.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package ozone 4 + 5 + // schema: tools.ozone.set.upsertSet 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // SetUpsertSet calls the XRPC method "tools.ozone.set.upsertSet". 14 + func SetUpsertSet(ctx context.Context, c *xrpc.Client, input *SetDefs_Set) (*SetDefs_SetView, error) { 15 + var out SetDefs_SetView 16 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "tools.ozone.set.upsertSet", nil, input, &out); err != nil { 17 + return nil, err 18 + } 19 + 20 + return &out, nil 21 + }
+18 -17
automod/consumer/ozone.go
··· 55 55 period := time.Second * 5 56 56 57 57 for { 58 - //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) { 59 58 me, err := toolsozone.ModerationQueryEvents( 60 59 ctx, 61 60 oc.OzoneClient, 62 - nil, // addedLabels: If specified, only events where all of these labels were added are returned 63 - nil, // addedTags: If specified, only events where all of these tags were added are returned 64 - "", // comment: If specified, only events with comments containing the keyword are returned 65 - since.String(), // createdAfter: Retrieve events created after a given timestamp 66 - "", // createdBefore: Retrieve events created before a given timestamp 67 - "", // createdBy 68 - "", // cursor 69 - false, // hasComment: If true, only events with comments are returned 70 - true, // includeAllUserRecords: If true, events on all record types (posts, lists, profile etc.) owned by the did are returned 71 - limit, 72 - nil, // removedLabels: If specified, only events where all of these labels were removed are returned 73 - nil, // removedTags 74 - nil, // reportTypes 75 - "asc", // sortDirection: Sort direction for the events. Defaults to descending order of created at timestamp. 76 - "", // subject 77 - nil, // 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. 61 + nil, // addedLabels []string 62 + nil, // addedTags []string 63 + nil, // collections []string 64 + "", // comment string 65 + since.String(), // createdAfter string 66 + "", // createdBefore string 67 + "", // createdBy string 68 + "", // cursor string 69 + false, // hasComment bool 70 + true, // includeAllUserRecords bool 71 + limit, // limit int64 72 + nil, // removedLabels []string 73 + nil, // removedTags []string 74 + nil, // reportTypes []string 75 + "asc", // sortDirection string 76 + "", // subject string 77 + "", // subjectType string 78 + nil, // types []string 78 79 ) 79 80 if err != nil { 80 81 oc.Logger.Warn("ozone query events failed; sleeping then will retrying", "err", err, "period", period.String())
+36 -34
automod/engine/persisthelpers.go
··· 155 155 // before creating a report, query to see if automod has already reported this account in the past week for the same reason 156 156 // NOTE: this is running in an inner loop (if there are multiple reports), which is a bit inefficient, but seems acceptable 157 157 158 - // ModerationQueryEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, inc ludeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) 159 158 resp, err := toolsozone.ModerationQueryEvents( 160 159 ctx, 161 160 xrpcc, 162 - nil, 163 - nil, 164 - "", 165 - "", 166 - "", 167 - xrpcc.Auth.Did, 168 - "", 169 - false, 170 - false, 171 - 5, 172 - nil, 173 - nil, 174 - nil, 175 - "", 176 - did.String(), 177 - []string{"tools.ozone.moderation.defs#modEventReport"}, 161 + nil, // addedLabels []string 162 + nil, // addedTags []string 163 + nil, // collections []string 164 + "", // comment string 165 + "", // createdAfter string 166 + "", // createdBefore string 167 + xrpcc.Auth.Did, // createdBy string 168 + "", // cursor string 169 + false, // hasComment bool 170 + false, // includeAllUserRecords bool 171 + 5, // limit int64 172 + nil, // removedLabels []string 173 + nil, // removedTags []string 174 + nil, // reportTypes []string 175 + "", // sortDirection string 176 + did.String(), // subject string 177 + "", // subjectType string 178 + []string{"tools.ozone.moderation.defs#modEventReport"}, // types []string 178 179 ) 179 180 180 181 if err != nil { ··· 231 232 // before creating a report, query to see if automod has already reported this account in the past week for the same reason 232 233 // NOTE: this is running in an inner loop (if there are multiple reports), which is a bit inefficient, but seems acceptable 233 234 234 - // ModerationQueryEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, inc ludeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) 235 235 resp, err := toolsozone.ModerationQueryEvents( 236 236 ctx, 237 237 xrpcc, 238 - nil, 239 - nil, 240 - "", 241 - "", 242 - "", 243 - xrpcc.Auth.Did, 244 - "", 245 - false, 246 - false, 247 - 5, 248 - nil, 249 - nil, 250 - nil, 251 - "", 252 - uri.String(), 253 - []string{"tools.ozone.moderation.defs#modEventReport"}, 238 + nil, // addedLabels []string 239 + nil, // addedTags []string 240 + nil, // collections []string 241 + "", // comment string 242 + "", // createdAfter string 243 + "", // createdBefore string 244 + xrpcc.Auth.Did, // createdBy string 245 + "", // cursor string 246 + false, // hasComment bool 247 + false, // includeAllUserRecords bool 248 + 5, // limit int64 249 + nil, // removedLabels []string 250 + nil, // removedTags []string 251 + nil, // reportTypes []string 252 + "", // sortDirection string 253 + uri.String(), // subject string 254 + "", // subjectType string 255 + []string{"tools.ozone.moderation.defs#modEventReport"}, // types []string 254 256 ) 255 257 if err != nil { 256 258 return false, err
+18 -17
cmd/beemo/notify_reports.go
··· 68 68 xrpcc.Auth.RefreshJwt = refresh.RefreshJwt 69 69 70 70 // query just new reports (regardless of resolution state) 71 - // ModerationQueryEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, includeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) (*ModerationQueryEvents_Output, error) 72 71 var limit int64 = 50 73 72 me, err := toolsozone.ModerationQueryEvents( 74 73 cctx.Context, 75 74 xrpcc, 76 - nil, 77 - nil, 78 - "", 79 - "", 80 - "", 81 - "", 82 - "", 83 - false, 84 - true, 85 - limit, 86 - nil, 87 - nil, 88 - nil, 89 - "", 90 - "", 91 - []string{"tools.ozone.moderation.defs#modEventReport"}, 75 + nil, // addedLabels []string 76 + nil, // addedTags []string 77 + nil, // collections []string 78 + "", // comment string 79 + "", // createdAfter string 80 + "", // createdBefore string 81 + "", // createdBy string 82 + "", // cursor string 83 + false, // hasComment bool 84 + true, // includeAllUserRecords bool 85 + limit, // limit int64 86 + nil, // removedLabels []string 87 + nil, // removedTags []string 88 + nil, // reportTypes []string 89 + "", // sortDirection string 90 + "", // subject string 91 + "", // subjectType string 92 + []string{"tools.ozone.moderation.defs#modEventReport"}, // types []string 92 93 ) 93 94 if err != nil { 94 95 return err
+36 -33
cmd/gosky/admin.go
··· 389 389 xrpcc.AdminToken = &adminKey 390 390 391 391 // fetch recent moderation reports 392 - // AdminQueryModerationEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, includeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) (*AdminQueryModerationEvents_Output, error) 393 392 resp, err := toolsozone.ModerationQueryEvents( 394 393 ctx, 395 394 xrpcc, 396 - nil, 397 - nil, 398 - "", 399 - "", 400 - "", 401 - "", 402 - "", 403 - false, 404 - false, 405 - 100, 406 - nil, 407 - nil, 408 - nil, 409 - "", 410 - "", 411 - []string{"tools.ozone.moderation.defs#modEventReport"}, 395 + nil, // addedLabels []string 396 + nil, // addedTags []string 397 + nil, // collections []string 398 + "", // comment string 399 + "", // createdAfter string 400 + "", // createdBefore string 401 + "", // createdBy string 402 + "", // cursor string 403 + false, // hasComment bool 404 + false, // includeAllUserRecords bool 405 + 100, // limit int64 406 + nil, // removedLabels []string 407 + nil, // removedTags []string 408 + nil, // reportTypes []string 409 + "", // sortDirection string 410 + "", // subject string 411 + "", // subjectType string 412 + []string{"tools.ozone.moderation.defs#modEventReport"}, // types []string 412 413 ) 413 414 if err != nil { 414 415 return err ··· 705 706 resp, err := toolsozone.ModerationQueryEvents( 706 707 ctx, 707 708 xrpcc, 708 - nil, 709 - nil, 710 - "", 711 - "", 712 - "", 713 - "", 714 - "", 715 - false, 716 - false, 717 - 100, 718 - nil, 719 - nil, 720 - nil, 721 - "", 722 - "", 723 - []string{"tools.ozone.moderation.defs#modEventReport"}, 709 + nil, // addedLabels []string 710 + nil, // addedTags []string 711 + nil, // collections []string 712 + "", // comment string 713 + "", // createdAfter string 714 + "", // createdBefore string 715 + "", // createdBy string 716 + "", // cursor string 717 + false, // hasComment bool 718 + false, // includeAllUserRecords bool 719 + 100, // limit int64 720 + nil, // removedLabels []string 721 + nil, // removedTags []string 722 + nil, // reportTypes []string 723 + "", // sortDirection string 724 + "", // subject string 725 + "", // subjectType string 726 + []string{"tools.ozone.moderation.defs#modEventReport"}, // types []string 724 727 ) 725 728 if err != nil { 726 729 return err