···11+import "@tlex/emitter";
22+33+namespace tools.ozone.moderation.queryEvents {
44+ @closed
55+ @inline
66+ union SortDirection {
77+ "asc",
88+ "desc",
99+ }
1010+1111+ @doc("List moderation events related to a subject.")
1212+ @query
1313+ op main(
1414+ @doc("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.")
1515+ types?: string[],
1616+1717+ createdBy?: did,
1818+1919+ @doc("Sort direction for the events. Defaults to descending order of created at timestamp.")
2020+ sortDirection?: SortDirection = "desc",
2121+2222+ @doc("Retrieve events created after a given timestamp")
2323+ createdAfter?: datetime,
2424+2525+ @doc("Retrieve events created before a given timestamp")
2626+ createdBefore?: datetime,
2727+2828+ subject?: uri,
2929+3030+ @maxItems(20)
3131+ @doc("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.")
3232+ collections?: nsid[],
3333+3434+ @doc("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.")
3535+ subjectType?: "account" | "record" | string,
3636+3737+ @doc("If true, events on all record types (posts, lists, profile etc.) or records from given 'collections' param, owned by the did are returned.")
3838+ includeAllUserRecords?: boolean = false,
3939+4040+ @minValue(1)
4141+ @maxValue(100)
4242+ limit?: int32 = 50,
4343+4444+ @doc("If true, only events with comments are returned")
4545+ hasComment?: boolean,
4646+4747+ @doc("If specified, only events with comments containing the keyword are returned. Apply || separator to use multiple keywords and match using OR condition.")
4848+ comment?: string,
4949+5050+ @doc("If specified, only events where all of these labels were added are returned")
5151+ addedLabels?: string[],
5252+5353+ @doc("If specified, only events where all of these labels were removed are returned")
5454+ removedLabels?: string[],
5555+5656+ @doc("If specified, only events where all of these tags were added are returned")
5757+ addedTags?: string[],
5858+5959+ @doc("If specified, only events where all of these tags were removed are returned")
6060+ removedTags?: string[],
6161+6262+ reportTypes?: string[],
6363+6464+ @doc("If specified, only events where the action policies match any of the given policies are returned")
6565+ policies?: string[],
6666+6767+ @doc("If specified, only events where the modTool name matches any of the given values are returned")
6868+ modTool?: string[],
6969+7070+ @doc("If specified, only events where the batchId matches the given value are returned")
7171+ batchId?: string,
7272+7373+ @doc("If specified, only events where the age assurance state matches the given value are returned")
7474+ ageAssuranceState?: "pending" | "assured" | "unknown" | "reset" | "blocked" | string,
7575+7676+ cursor?: string
7777+ ): {
7878+ cursor?: string;
7979+8080+ @required events: tools.ozone.moderation.defs.ModEventView[];
8181+ };
8282+}
···11+import "@tlex/emitter";
22+33+namespace tools.ozone.moderation.queryStatuses {
44+ @closed
55+ @inline
66+ union SortField {
77+ "lastReviewedAt",
88+ "lastReportedAt",
99+ "reportedRecordsCount",
1010+ "takendownRecordsCount",
1111+ "priorityScore",
1212+ }
1313+1414+ @closed
1515+ @inline
1616+ union SortDirection {
1717+ "asc",
1818+ "desc",
1919+ }
2020+2121+ @doc("View moderation statuses of subjects (record or repo).")
2222+ @query
2323+ op main(
2424+ @doc("Number of queues being used by moderators. Subjects will be split among all queues.")
2525+ queueCount?: integer,
2626+2727+ @doc("Index of the queue to fetch subjects from. Works only when queueCount value is specified.")
2828+ queueIndex?: integer,
2929+3030+ @doc("A seeder to shuffle/balance the queue items.")
3131+ queueSeed?: string,
3232+3333+ @doc("All subjects, or subjects from given 'collections' param, belonging to the account specified in the 'subject' param will be returned.")
3434+ includeAllUserRecords?: boolean,
3535+3636+ @doc("The subject to get the status for.")
3737+ subject?: uri,
3838+3939+ @doc("Search subjects by keyword from comments")
4040+ comment?: string,
4141+4242+ @doc("Search subjects reported after a given timestamp")
4343+ reportedAfter?: datetime,
4444+4545+ @doc("Search subjects reported before a given timestamp")
4646+ reportedBefore?: datetime,
4747+4848+ @doc("Search subjects reviewed after a given timestamp")
4949+ reviewedAfter?: datetime,
5050+5151+ @doc("Search subjects where the associated record/account was deleted after a given timestamp")
5252+ hostingDeletedAfter?: datetime,
5353+5454+ @doc("Search subjects where the associated record/account was deleted before a given timestamp")
5555+ hostingDeletedBefore?: datetime,
5656+5757+ @doc("Search subjects where the associated record/account was updated after a given timestamp")
5858+ hostingUpdatedAfter?: datetime,
5959+6060+ @doc("Search subjects where the associated record/account was updated before a given timestamp")
6161+ hostingUpdatedBefore?: datetime,
6262+6363+ @doc("Search subjects by the status of the associated record/account")
6464+ hostingStatuses?: string[],
6565+6666+ @doc("Search subjects reviewed before a given timestamp")
6767+ reviewedBefore?: datetime,
6868+6969+ @doc("By default, we don't include muted subjects in the results. Set this to true to include them.")
7070+ includeMuted?: boolean,
7171+7272+ @doc("When set to true, only muted subjects and reporters will be returned.")
7373+ onlyMuted?: boolean,
7474+7575+ @doc("Specify when fetching subjects in a certain state")
7676+ reviewState?: string,
7777+7878+ ignoreSubjects?: uri[],
7979+8080+ @doc("Get all subject statuses that were reviewed by a specific moderator")
8181+ lastReviewedBy?: did,
8282+8383+ sortField?: SortField = "lastReportedAt",
8484+8585+ sortDirection?: SortDirection = "desc",
8686+8787+ @doc("Get subjects that were taken down")
8888+ takendown?: boolean,
8989+9090+ @doc("Get subjects in unresolved appealed status")
9191+ appealed?: boolean,
9292+9393+ @minValue(1)
9494+ @maxValue(100)
9595+ limit?: int32 = 50,
9696+9797+ @doc("Items in this array are applied with OR filters. To apply AND filter, put all tags in the same string and separate using && characters")
9898+ @maxItems(25)
9999+ tags?: string[],
100100+101101+ excludeTags?: string[],
102102+103103+ cursor?: string,
104104+105105+ @maxItems(20)
106106+ @doc("If specified, subjects belonging to the given collections will be returned. When subjectType is set to 'account', this will be ignored.")
107107+ collections?: nsid[],
108108+109109+ @doc("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.")
110110+ subjectType?: "account" | "record" | string,
111111+112112+ @doc("If specified, only subjects that belong to an account that has at least this many suspensions will be returned.")
113113+ minAccountSuspendCount?: integer,
114114+115115+ @doc("If specified, only subjects that belong to an account that has at least this many reported records will be returned.")
116116+ minReportedRecordsCount?: integer,
117117+118118+ @doc("If specified, only subjects that belong to an account that has at least this many taken down records will be returned.")
119119+ minTakendownRecordsCount?: integer,
120120+121121+ @minValue(0)
122122+ @maxValue(100)
123123+ @doc("If specified, only subjects that have priority score value above the given value will be returned.")
124124+ minPriorityScore?: integer,
125125+126126+ @doc("If specified, only subjects with the given age assurance state will be returned.")
127127+ ageAssuranceState?: "pending" | "assured" | "unknown" | "reset" | "blocked" | string
128128+ ): {
129129+ cursor?: string;
130130+131131+ @required subjectStatuses: tools.ozone.moderation.defs.SubjectStatusView[];
132132+ };
133133+}
···11+import "@tlex/emitter";
22+33+namespace tools.ozone.safelink.removeRule {
44+ @doc("No active rule found for this URL/domain")
55+ model RuleNotFound {}
66+77+ @doc("Remove an existing URL safety rule")
88+ @procedure
99+ @errors(RuleNotFound)
1010+ op main(input: {
1111+ @doc("The URL or domain to remove the rule for")
1212+ @required
1313+ url: string;
1414+1515+ @required pattern: tools.ozone.safelink.defs.PatternType;
1616+1717+ @doc("Optional comment about why the rule is being removed")
1818+ comment?: string;
1919+2020+ @doc("Optional DID of the user. Only respected when using admin auth.")
2121+ createdBy?: did;
2222+ }): tools.ozone.safelink.defs.Event;
2323+}
···11+import "@tlex/emitter";
22+33+namespace tools.ozone.safelink.updateRule {
44+ @doc("No active rule found for this URL/domain")
55+ model RuleNotFound {}
66+77+ @doc("Update an existing URL safety rule")
88+ @procedure
99+ @errors(RuleNotFound)
1010+ op main(input: {
1111+ @doc("The URL or domain to update the rule for")
1212+ @required
1313+ url: string;
1414+1515+ @required pattern: tools.ozone.safelink.defs.PatternType;
1616+1717+ @required action: tools.ozone.safelink.defs.ActionType;
1818+1919+ @required reason: tools.ozone.safelink.defs.ReasonType;
2020+2121+ @doc("Optional comment about the update")
2222+ comment?: string;
2323+2424+ @doc("Optional DID to credit as the creator. Only respected for admin_token authentication.")
2525+ createdBy?: did;
2626+ }): tools.ozone.safelink.defs.Event;
2727+}
···11+import "@tlex/emitter";
22+33+namespace tools.ozone.set.addValues {
44+ @doc("Add values to a specific set. Attempting to add values to a set that does not exist will result in an error.")
55+ @procedure
66+ op main(input: {
77+ @doc("Name of the set to add values to")
88+ @required
99+ name: string;
1010+1111+ @minItems(1)
1212+ @maxItems(1000)
1313+ @doc("Array of string values to add to the set")
1414+ @required
1515+ values: string[];
1616+ }): void;
1717+}
···11+import "@tlex/emitter";
22+33+namespace tools.ozone.set.deleteSet {
44+ @doc("set with the given name does not exist")
55+ model SetNotFound {}
66+77+ @doc("Delete an entire set. Attempting to delete a set that does not exist will result in an error.")
88+ @procedure
99+ @errors(SetNotFound)
1010+ op main(input: {
1111+ @doc("Name of the set to delete")
1212+ @required
1313+ name: string;
1414+ }): {};
1515+}
···11+import "@tlex/emitter";
22+33+namespace tools.ozone.set.deleteValues {
44+ @doc("set with the given name does not exist")
55+ model SetNotFound {}
66+77+ @doc("Delete values from a specific set. Attempting to delete values that are not in the set will not result in an error")
88+ @procedure
99+ @errors(SetNotFound)
1010+ op main(input: {
1111+ @doc("Name of the set to delete values from")
1212+ @required
1313+ name: string;
1414+1515+ @minItems(1)
1616+ @doc("Array of string values to delete from the set")
1717+ @required
1818+ values: string[];
1919+ }): void;
2020+}