From 8476b20e5ff97e1b739c62a0fc46d46045293ba0 Mon Sep 17 00:00:00 2001 From: DS Boyce <260543580+ds-boyce@users.noreply.github.com> Date: Thu, 8 Oct 2026 11:15:06 -0700 Subject: [PATCH] Add Ozone inbox lexicons to social app (#11839) --- lexicons.json | 87 +- lexicons/app/bsky/embed/record.json | 8 + .../com/atproto/server/describeServer.json | 4 + .../com/atproto/server/getServiceAuth.json | 4 +- .../ozone/inbox/appealActionedSubject.json | 87 +- lexicons/tools/ozone/inbox/defs.json | 431 ++++- .../tools/ozone/inbox/getAccountStatus.json | 57 + .../tools/ozone/inbox/getActionedSubject.json | 53 + .../inbox/getNotificationPreferences.json | 35 + lexicons/tools/ozone/inbox/getReport.json | 147 ++ .../tools/ozone/inbox/getUnreadCount.json | 68 + .../ozone/inbox/listActionedSubjects.json | 79 + .../tools/ozone/inbox/listNotifications.json | 76 + lexicons/tools/ozone/inbox/listReports.json | 151 ++ .../inbox/putNotificationPreferences.json | 39 + lexicons/tools/ozone/inbox/updateSeen.json | 54 + lexicons/tools/ozone/moderation/defs.json | 1608 +++++++++++++++++ lexicons/tools/ozone/queue/defs.json | 169 ++ lexicons/tools/ozone/report/defs.json | 529 ++++++ .../tools/ozone/server/getCapabilities.json | 41 + lexicons/tools/ozone/team/defs.json | 63 + src/lib/media/video/upload.shared.ts | 4 +- 22 files changed, 3668 insertions(+), 126 deletions(-) create mode 100644 lexicons/tools/ozone/inbox/getAccountStatus.json create mode 100644 lexicons/tools/ozone/inbox/getActionedSubject.json create mode 100644 lexicons/tools/ozone/inbox/getNotificationPreferences.json create mode 100644 lexicons/tools/ozone/inbox/getReport.json create mode 100644 lexicons/tools/ozone/inbox/getUnreadCount.json create mode 100644 lexicons/tools/ozone/inbox/listActionedSubjects.json create mode 100644 lexicons/tools/ozone/inbox/listNotifications.json create mode 100644 lexicons/tools/ozone/inbox/listReports.json create mode 100644 lexicons/tools/ozone/inbox/putNotificationPreferences.json create mode 100644 lexicons/tools/ozone/inbox/updateSeen.json create mode 100644 lexicons/tools/ozone/moderation/defs.json create mode 100644 lexicons/tools/ozone/queue/defs.json create mode 100644 lexicons/tools/ozone/server/getCapabilities.json create mode 100644 lexicons/tools/ozone/team/defs.json diff --git a/lexicons.json b/lexicons.json index 664ea29a2..33e145bf5 100644 --- a/lexicons.json +++ b/lexicons.json @@ -266,7 +266,20 @@ "com.atproto.sync.requestCrawl", "com.atproto.sync.subscribeRepos", "com.germnetwork.declaration", - "tools.ozone.report.defs" + "tools.ozone.inbox.appealActionedSubject", + "tools.ozone.inbox.defs", + "tools.ozone.inbox.getAccountStatus", + "tools.ozone.inbox.getActionedSubject", + "tools.ozone.inbox.getNotificationPreferences", + "tools.ozone.inbox.getReport", + "tools.ozone.inbox.getUnreadCount", + "tools.ozone.inbox.listActionedSubjects", + "tools.ozone.inbox.listNotifications", + "tools.ozone.inbox.listReports", + "tools.ozone.inbox.putNotificationPreferences", + "tools.ozone.inbox.updateSeen", + "tools.ozone.report.defs", + "tools.ozone.server.getCapabilities" ], "resolutions": { "app.bsky.actor.defs": { @@ -419,7 +432,7 @@ }, "app.bsky.embed.record": { "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.record", - "cid": "bafyreia7yq4c6rqkz32fjf6gj5rcvxsirguducn545s3dvls7qutnn2ali" + "cid": "bafyreiapx2wu6p4ydvx5l2krhy6lgyh25m5btcnqou47dbw4adearedkem" }, "app.bsky.embed.recordWithMedia": { "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.embed.recordWithMedia", @@ -1203,7 +1216,7 @@ }, "com.atproto.server.describeServer": { "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.server.describeServer", - "cid": "bafyreidjve4qbhebxzppq23ogsto6luddd63mmn7a57rmml6qi3yf7n3ee" + "cid": "bafyreihitbc3tjrcozuarkbvbzlq2d2ryjx65mtft3zqqdtj7lrpzc3kpq" }, "com.atproto.server.getAccountInviteCodes": { "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.server.getAccountInviteCodes", @@ -1211,7 +1224,7 @@ }, "com.atproto.server.getServiceAuth": { "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.server.getServiceAuth", - "cid": "bafyreigjuxsvldkifmwzdrzvziq2ldomzoqizsv5umwgumjv77ld56wxyi" + "cid": "bafyreiaw2itjl4tfvckxjkkmaeo4dvjzgh3iajov5ilxxsqfigqhqv3uei" }, "com.atproto.server.getSession": { "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.server.getSession", @@ -1329,9 +1342,73 @@ "uri": "at://did:plc:qyqmmncrm6qx33kpy7vqndik/com.atproto.lexicon.schema/com.germnetwork.declaration", "cid": "bafyreickqsspgkujwucg3low5or64ywjryf44eua6xtszd6zsl2yteumoi" }, + "tools.ozone.inbox.appealActionedSubject": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.inbox.appealActionedSubject", + "cid": "bafyreihyc3tqs3mqacjp2vp645ood7qrsx3xz7hxup7p6zkz3dskns3u3a" + }, + "tools.ozone.inbox.defs": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.inbox.defs", + "cid": "bafyreidt5cwylevqwmjsuq7s6zqi33vttejv63zgufxrizdgqyugl2zwxm" + }, + "tools.ozone.inbox.getAccountStatus": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.inbox.getAccountStatus", + "cid": "bafyreifbah7zgoh3bqtcwvdrmvw3ap6ga2q7smqqgx7ssrcjxljqvgbpyi" + }, + "tools.ozone.inbox.getActionedSubject": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.inbox.getActionedSubject", + "cid": "bafyreibyq5rkklms45tljzckd2ylzaqk2eoojxmoockma7ggqmxz4chbca" + }, + "tools.ozone.inbox.getNotificationPreferences": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.inbox.getNotificationPreferences", + "cid": "bafyreiff6smhk4bhqjpvwmxmwotygtdalxonvfjtjavdlzuo6lapphyv7q" + }, + "tools.ozone.inbox.getReport": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.inbox.getReport", + "cid": "bafyreibtitryqubnwyxbebb6w6l3i2giykls6cder6vysg6g6e2gwz7obi" + }, + "tools.ozone.inbox.getUnreadCount": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.inbox.getUnreadCount", + "cid": "bafyreieoh6dnfrzb4xnrdcwxqy5hnrtngouewibncderjx6b7f6ku35soy" + }, + "tools.ozone.inbox.listActionedSubjects": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.inbox.listActionedSubjects", + "cid": "bafyreid2kg64gv7rhappxvbzgt4ayig7ln5u2alwt5z3qtiogynpmc56dq" + }, + "tools.ozone.inbox.listNotifications": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.inbox.listNotifications", + "cid": "bafyreickiqjya3a7s6gzrlxbluimjaydd7ww7g6yboyuh2nv43h2pvp74q" + }, + "tools.ozone.inbox.listReports": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.inbox.listReports", + "cid": "bafyreig75q4c6lp3rpuq7uv6bs52niunk4fn6syjakd2fefiqlig5dcste" + }, + "tools.ozone.inbox.putNotificationPreferences": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.inbox.putNotificationPreferences", + "cid": "bafyreiaejh7rdbmc4pukpwtnva5wberlwmi3zeltntkhzslhmwf2xlv6tu" + }, + "tools.ozone.inbox.updateSeen": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.inbox.updateSeen", + "cid": "bafyreicohwyf6yec6g2qqmg32ur2cq6f64z2o7njjmydtsrua6ek5vyvlm" + }, + "tools.ozone.moderation.defs": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.moderation.defs", + "cid": "bafyreidon7bz3r3ouvshtbukdbyvjnwksvrgdtz265ze5ywmqz4jj6ya2a" + }, + "tools.ozone.queue.defs": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.queue.defs", + "cid": "bafyreify2cxcs5fziz6pqeufotqh632tp7oxedraayjstw6tglwjpuoalm" + }, "tools.ozone.report.defs": { "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.report.defs", - "cid": "bafyreic3l2rmh2ugirt3jz372wcvy333m7t2ynlyzj2k54oshijs6lxdfu" + "cid": "bafyreierydps5vinv5ods32xe6vcgfdvncpaeoxyyuysidr7moedajpoou" + }, + "tools.ozone.server.getCapabilities": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.server.getCapabilities", + "cid": "bafyreia2meb3zz3hp2v2kzjyskuk3lvvht2rvqzepfluc47o2ulbw3rxzy" + }, + "tools.ozone.team.defs": { + "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.team.defs", + "cid": "bafyreihqaijzof4hbey6u5lzfyhahuxjj5d7c3irremztfkavrqekvtvj4" } } } diff --git a/lexicons/app/bsky/embed/record.json b/lexicons/app/bsky/embed/record.json index 3aef65420..d8badb8f1 100644 --- a/lexicons/app/bsky/embed/record.json +++ b/lexicons/app/bsky/embed/record.json @@ -96,6 +96,14 @@ }, "repostCount": { "type": "integer" + }, + "opThreadPostCount": { + "type": "integer", + "description": "The total number of posts in the contiguous OP thread that this post belongs to. Only present when this post is part of the OP thread." + }, + "opThreadPostIndex": { + "type": "integer", + "description": "The 1-indexed position of this post within the contiguous OP thread. Only present when this post is part of the OP thread." } } }, diff --git a/lexicons/com/atproto/server/describeServer.json b/lexicons/com/atproto/server/describeServer.json index 25dc2d291..433248f7e 100644 --- a/lexicons/com/atproto/server/describeServer.json +++ b/lexicons/com/atproto/server/describeServer.json @@ -25,6 +25,10 @@ "type": "ref", "description": "Contact information" }, + "blobUploadLimit": { + "type": "integer", + "description": "Maximum size of a blob that can be uploaded via com.atproto.repo.uploadBlob, in bytes." + }, "inviteCodeRequired": { "type": "boolean", "description": "If true, an invite code must be supplied to create an account on this instance." diff --git a/lexicons/com/atproto/server/getServiceAuth.json b/lexicons/com/atproto/server/getServiceAuth.json index 80f5a1148..4b2bfa157 100644 --- a/lexicons/com/atproto/server/getServiceAuth.json +++ b/lexicons/com/atproto/server/getServiceAuth.json @@ -31,8 +31,8 @@ "properties": { "aud": { "type": "string", - "format": "did", - "description": "The DID of the service that the token will be used to authenticate with" + "maxLength": 2048, + "description": "The DID or `did#serviceId` reference of the service that the token will be used to authenticate with." }, "exp": { "type": "integer", diff --git a/lexicons/tools/ozone/inbox/appealActionedSubject.json b/lexicons/tools/ozone/inbox/appealActionedSubject.json index a76dbcd83..c3cb96c00 100644 --- a/lexicons/tools/ozone/inbox/appealActionedSubject.json +++ b/lexicons/tools/ozone/inbox/appealActionedSubject.json @@ -1,49 +1,46 @@ { - "lexicon": 1, "id": "tools.ozone.inbox.appealActionedSubject", "defs": { "main": { "type": "procedure", - "description": "Appeal a moderation action affecting the user's account or content.", "input": { - "encoding": "application/json", "schema": { "type": "object", - "required": ["subject"], + "required": [ + "subject" + ], "properties": { "action": { + "refs": [ + "#actionRef", + "#labelRef", + "#takedownRef" + ], "type": "union", - "refs": ["#actionRef", "#labelRef", "#takedownRef"], "closed": true, "description": "Moderation action being appealed." }, + "reason": { + "type": "string", + "maxLength": 20000, + "description": "Optional explanation supplied by the user.", + "maxGraphemes": 2000 + }, + "modTool": { + "ref": "com.atproto.moderation.createReport#modTool", + "type": "ref" + }, "subject": { - "type": "union", "refs": [ "com.atproto.admin.defs#repoRef", "com.atproto.repo.strongRef" ], + "type": "union", "description": "Subject being appealed." - }, - "reason": { - "type": "string", - "maxGraphemes": 2000, - "maxLength": 20000, - "description": "Optional explanation supplied by the user." - }, - "modTool": { - "type": "ref", - "ref": "com.atproto.moderation.createReport#modTool" } } - } - }, - "output": { - "encoding": "application/json", - "schema": { - "type": "ref", - "ref": "tools.ozone.inbox.defs#subjectView" - } + }, + "encoding": "application/json" }, "errors": [ { @@ -62,22 +59,21 @@ "name": "AppealWindowExpired", "description": "The appeal window for this action has closed." } - ] - }, - "actionRef": { - "type": "object", - "required": ["id"], - "properties": { - "id": { - "type": "integer", - "minimum": 1, - "description": "ID of the moderation action being appealed, available via actions in mod inbox." - } - } + ], + "output": { + "schema": { + "ref": "tools.ozone.inbox.defs#subjectView", + "type": "ref" + }, + "encoding": "application/json" + }, + "description": "Appeal a moderation action affecting the user's account or content." }, "labelRef": { "type": "object", - "required": ["val"], + "required": [ + "val" + ], "properties": { "val": { "type": "string", @@ -86,9 +82,24 @@ } } }, + "actionRef": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer", + "minimum": 1, + "description": "ID of the moderation action being appealed, available via actions in mod inbox." + } + } + }, "takedownRef": { "type": "object", "properties": {} } - } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 } diff --git a/lexicons/tools/ozone/inbox/defs.json b/lexicons/tools/ozone/inbox/defs.json index f8d9f9ea6..b37f14ae2 100644 --- a/lexicons/tools/ozone/inbox/defs.json +++ b/lexicons/tools/ozone/inbox/defs.json @@ -1,92 +1,91 @@ { - "lexicon": 1, "id": "tools.ozone.inbox.defs", "defs": { - "subjectView": { + "reportRef": { "type": "object", - "description": "A subject belonging to the viewer that has moderation actions against it.", - "required": ["src", "subject", "enforcement", "createdAt", "updatedAt"], + "required": [ + "reportId" + ], "properties": { - "src": { + "status": { "type": "string", - "format": "did", - "description": "DID of the moderation service that took the actions." + "knownValues": [ + "pending", + "resolved" + ] }, "subject": { - "type": "union", "refs": [ "com.atproto.admin.defs#repoRef", "com.atproto.repo.strongRef" - ] - }, - "enforcement": { - "type": "ref", - "ref": "#enforcementView" - }, - "appeal": { - "type": "ref", - "ref": "#appealView" - }, - "availableActions": { - "type": "array", - "items": { - "type": "string", - "knownValues": ["appeal"] - } - }, - "latestAction": { - "type": "ref", - "ref": "#actionView" + ], + "type": "union" }, - "actionCount": { + "reportId": { "type": "integer" - }, - "createdAt": { - "type": "string", - "format": "datetime" - }, - "updatedAt": { - "type": "string", - "format": "datetime" } - } + }, + "description": "Reference to a report by its report table ID, as used by getReport and Ozone's report detail page." }, - "enforcementView": { + "actionView": { "type": "object", - "description": "The current enforcement state of a subject.", - "required": ["state"], + "required": [ + "id", + "type", + "createdAt" + ], "properties": { - "state": { - "type": "string", - "knownValues": [ - "none", - "labeled", - "removed", - "suspended", - "takendown" - ] + "id": { + "type": "integer", + "description": "Action ID (moderation event ID)." }, - "scope": { + "type": { "type": "string", - "knownValues": ["network", "app", "labelOnly"] + "description": "Public action type." }, - "expiresAt": { + "scope": { "type": "string", - "format": "datetime" + "knownValues": [ + "network", + "app", + "labelOnly" + ] }, "labels": { "type": "array", "items": { "type": "string" }, - "description": "Active label values on the subject, excluding negated and expired labels." + "description": "Label values, for labelApplied/labelRemoved." + }, + "policies": { + "type": "array", + "items": { + "ref": "#policyView", + "type": "ref" + }, + "description": "Policies applied by a takedown action." + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "expiresAt": { + "type": "string", + "format": "datetime" + }, + "reversedAt": { + "type": "string", + "format": "datetime" } - } + }, + "description": "A single moderation action taken against a subject." }, "appealView": { "type": "object", - "description": "The state of the viewer's appeal against the actions on a subject.", - "required": ["state"], + "required": [ + "state" + ], "properties": { "state": { "type": "string", @@ -107,60 +106,334 @@ "format": "datetime", "description": "When the appeal's report was closed." }, - "note": { - "type": "string", - "description": "Moderator explanation, from the publicNote on the closing activity. Absent if none was written." - }, "appealableUntil": { "type": "string", "format": "datetime" } + }, + "description": "The state of the viewer's appeal against the actions on a subject." + }, + "policyView": { + "type": "object", + "required": [ + "key", + "displayName", + "link" + ], + "properties": { + "key": { + "type": "string" + }, + "link": { + "type": "string", + "format": "uri" + }, + "displayName": { + "type": "string" + } } }, - "actionView": { + "subjectRef": { "type": "object", - "description": "A single moderation action taken against a subject.", - "required": ["id", "type", "createdAt"], + "required": [ + "subject" + ], "properties": { - "id": { - "type": "integer", - "description": "Action ID (moderation event ID)." + "subject": { + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef" + ], + "type": "union" }, - "type": { + "actionId": { + "type": "integer" + }, + "actionType": { + "type": "string" + } + } + }, + "standingRef": { + "type": "object", + "required": [ + "standing" + ], + "properties": { + "standing": { "type": "string", - "description": "Public action type." + "knownValues": [ + "good", + "warning", + "atRisk" + ] }, - "scope": { + "previousStanding": { "type": "string", - "knownValues": ["network", "app", "labelOnly"] + "knownValues": [ + "good", + "warning", + "atRisk" + ] + } + } + }, + "subjectView": { + "type": "object", + "required": [ + "src", + "subject", + "enforcement", + "isRead", + "createdAt", + "updatedAt" + ], + "properties": { + "src": { + "type": "string", + "format": "did", + "description": "DID of the moderation service that took the actions." + }, + "appeal": { + "ref": "#appealView", + "type": "ref" + }, + "isRead": { + "type": "boolean" + }, + "subject": { + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef" + ], + "type": "union" }, "createdAt": { "type": "string", "format": "datetime" }, - "reversedAt": { + "updatedAt": { "type": "string", "format": "datetime" }, - "expiresAt": { + "actionCount": { + "type": "integer" + }, + "enforcement": { + "ref": "#enforcementView", + "type": "ref" + }, + "latestAction": { + "ref": "#actionView", + "type": "ref" + }, + "availableActions": { + "type": "array", + "items": { + "type": "string", + "knownValues": [ + "appeal" + ] + } + } + }, + "description": "A subject belonging to the viewer that has moderation actions against it." + }, + "notification": { + "type": "object", + "required": [ + "id", + "reason", + "target", + "isRead", + "createdAt" + ], + "properties": { + "id": { + "type": "integer" + }, + "isRead": { + "type": "boolean" + }, + "reason": { + "type": "string", + "knownValues": [ + "reportResolved", + "reportReopened", + "actionTaken", + "actionReversed", + "appealResolved", + "standingChanged" + ] + }, + "target": { + "refs": [ + "#reportRef", + "#subjectRef", + "#standingRef" + ], + "type": "union" + }, + "createdAt": { "type": "string", "format": "datetime" + } + } + }, + "reportsSummary": { + "type": "object", + "required": [ + "reasonTypes", + "firstReportedOn", + "lastReportedOn" + ], + "properties": { + "reasonTypes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Distinct reason types reported, deduplicated and unordered. Excludes reasonAppeal." + }, + "lastReportedOn": { + "type": "string", + "format": "datetime", + "description": "Day of the most recent report, truncated to midnight UTC. Render as a date; the time component is not meaningful." + }, + "firstReportedOn": { + "type": "string", + "format": "datetime", + "description": "Day of the earliest report, truncated to midnight UTC. Render as a date; the time component is not meaningful." + } + }, + "description": "Aggregate view of reports filed against this subject. Deliberately carries no report IDs, no count, and no reporter identities." + }, + "enforcementView": { + "type": "object", + "required": [ + "state" + ], + "properties": { + "scope": { + "type": "string", + "knownValues": [ + "network", + "app", + "labelOnly" + ] + }, + "state": { + "type": "string", + "knownValues": [ + "none", + "labeled", + "removed", + "suspended", + "takendown" + ] }, "labels": { "type": "array", "items": { "type": "string" }, - "description": "Label values, for labelApplied/labelRemoved." + "description": "Active label values on the subject, excluding negated and expired labels." }, - "policies": { + "expiresAt": { + "type": "string", + "format": "datetime" + } + }, + "description": "The current enforcement state of a subject." + }, + "subjectViewDetail": { + "type": "object", + "required": [ + "src", + "subject", + "enforcement", + "isRead", + "actions", + "createdAt", + "updatedAt" + ], + "properties": { + "src": { + "type": "string", + "format": "did" + }, + "appeal": { + "ref": "#appealView", + "type": "ref" + }, + "cursor": { + "type": "string", + "description": "Cursor for the next page of action history. Omitted when no older actions remain." + }, + "isRead": { + "type": "boolean" + }, + "record": { + "type": "unknown", + "description": "Raw record JSON for the subject, when the subject is a record and the record is available." + }, + "actions": { "type": "array", "items": { - "type": "string" + "ref": "#actionView", + "type": "ref" }, - "description": "Policies that were applied in this action." + "maxLength": 100, + "description": "A page of action history, most recent first. Reversal timestamps include changes outside this page." + }, + "reports": { + "ref": "#reportsSummary", + "type": "ref", + "description": "Omitted when the subject has never been reported, e.g. proactive enforcement." + }, + "subject": { + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef" + ], + "type": "union" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "updatedAt": { + "type": "string", + "format": "datetime" + }, + "enforcement": { + "ref": "#enforcementView", + "type": "ref" + }, + "availableActions": { + "type": "array", + "items": { + "type": "string", + "knownValues": [ + "appeal" + ] + } + } + }, + "description": "A subject with a page of its action history and an aggregate report summary. Follow cursor to retrieve older actions; enforcement and appeal describe the current subject state on every page." + }, + "notificationPreferences": { + "type": "object", + "required": [ + "push" + ], + "properties": { + "push": { + "type": "boolean" } } } - } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 } diff --git a/lexicons/tools/ozone/inbox/getAccountStatus.json b/lexicons/tools/ozone/inbox/getAccountStatus.json new file mode 100644 index 000000000..0e07cadf5 --- /dev/null +++ b/lexicons/tools/ozone/inbox/getAccountStatus.json @@ -0,0 +1,57 @@ +{ + "id": "tools.ozone.inbox.getAccountStatus", + "defs": { + "main": { + "type": "query", + "output": { + "schema": { + "type": "object", + "required": [ + "src", + "standing", + "updatedAt" + ], + "properties": { + "src": { + "type": "string", + "format": "did", + "description": "DID of the moderation service returning this status." + }, + "standing": { + "type": "string", + "knownValues": [ + "good", + "warning", + "atRisk" + ] + }, + "expiresAt": { + "type": "string", + "format": "datetime", + "description": "Time at which the current suspension expires. Present only for a temporary suspension." + }, + "updatedAt": { + "type": "string", + "format": "datetime", + "description": "Newest account-status update or strike timestamp used to derive this standing, or the Unix epoch when neither exists. This is not a standing-transition timestamp; expiry can change standing without changing this value." + } + } + }, + "encoding": "application/json" + }, + "parameters": { + "type": "params", + "properties": { + "did": { + "type": "string", + "format": "did", + "description": "Account to preview. Only Ozone staff can read another account; this does not change its read state." + } + } + }, + "description": "Get the authenticated account's current standing with this moderation service." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/tools/ozone/inbox/getActionedSubject.json b/lexicons/tools/ozone/inbox/getActionedSubject.json new file mode 100644 index 000000000..7d817a209 --- /dev/null +++ b/lexicons/tools/ozone/inbox/getActionedSubject.json @@ -0,0 +1,53 @@ +{ + "id": "tools.ozone.inbox.getActionedSubject", + "defs": { + "main": { + "type": "query", + "errors": [ + { + "name": "NotFound", + "description": "No subject was found, or the authenticated account does not own the subject." + } + ], + "output": { + "schema": { + "ref": "tools.ozone.inbox.defs#subjectViewDetail", + "type": "ref" + }, + "encoding": "application/json" + }, + "parameters": { + "type": "params", + "required": [ + "subject" + ], + "properties": { + "did": { + "type": "string", + "format": "did", + "description": "Account to preview. Defaults to the authenticated account; another account requires an active moderator, triage, or admin credential." + }, + "limit": { + "type": "integer", + "default": 50, + "maximum": 100, + "minimum": 1, + "description": "Maximum number of actions to return." + }, + "cursor": { + "type": "string", + "description": "Opaque cursor for the next page of this subject's action history." + }, + "subject": { + "type": "string", + "format": "uri", + "description": "DID or AT-URI of the subject to retrieve." + } + } + }, + "description": "Get a subject belonging to the authenticated account, including its moderation action history from this moderation service." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/tools/ozone/inbox/getNotificationPreferences.json b/lexicons/tools/ozone/inbox/getNotificationPreferences.json new file mode 100644 index 000000000..960ed2b4c --- /dev/null +++ b/lexicons/tools/ozone/inbox/getNotificationPreferences.json @@ -0,0 +1,35 @@ +{ + "id": "tools.ozone.inbox.getNotificationPreferences", + "defs": { + "main": { + "type": "query", + "output": { + "schema": { + "type": "object", + "required": [ + "preferences" + ], + "properties": { + "preferences": { + "ref": "tools.ozone.inbox.defs#notificationPreferences", + "type": "ref" + } + } + }, + "encoding": "application/json" + }, + "parameters": { + "type": "params", + "properties": { + "did": { + "type": "string", + "format": "did", + "description": "Account to preview. Only Ozone staff can read another account; this does not change its read state." + } + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/tools/ozone/inbox/getReport.json b/lexicons/tools/ozone/inbox/getReport.json new file mode 100644 index 000000000..02e308422 --- /dev/null +++ b/lexicons/tools/ozone/inbox/getReport.json @@ -0,0 +1,147 @@ +{ + "id": "tools.ozone.inbox.getReport", + "defs": { + "main": { + "type": "query", + "errors": [ + { + "name": "NotFound", + "description": "No report was found, or the authenticated account did not submit it." + } + ], + "output": { + "schema": { + "type": "object", + "required": [ + "report" + ], + "properties": { + "report": { + "ref": "#reportView", + "type": "ref" + }, + "resolution": { + "ref": "#resolutionView", + "type": "ref", + "description": "Present only when the report is resolved." + } + } + }, + "encoding": "application/json" + }, + "parameters": { + "type": "params", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer", + "description": "Report ID (report table ID), as returned by listReports." + }, + "did": { + "type": "string", + "format": "did", + "description": "Reporter to preview. Defaults to the authenticated account; another account requires an active moderator, triage, or admin credential." + } + } + }, + "description": "Get a moderation report submitted by the authenticated account to this moderation service." + }, + "reportView": { + "type": "object", + "required": [ + "src", + "id", + "reasonType", + "subject", + "status", + "createdAt", + "updatedAt" + ], + "properties": { + "id": { + "type": "integer", + "description": "Report ID (report table ID), used by Ozone's report detail page." + }, + "src": { + "type": "string", + "format": "did", + "description": "DID of the moderation service that received the report." + }, + "reason": { + "type": "string", + "maxLength": 20000, + "maxGraphemes": 2000 + }, + "record": { + "type": "unknown", + "description": "Raw record JSON for the subject, when the subject is a record and the record is available." + }, + "status": { + "type": "string", + "knownValues": [ + "pending", + "resolved" + ] + }, + "subject": { + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef", + "chat.bsky.convo.defs#messageRef", + "chat.bsky.convo.defs#convoRef" + ], + "type": "union" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "updatedAt": { + "type": "string", + "format": "datetime" + }, + "reasonType": { + "type": "string", + "description": "The exact fully-qualified reason NSID submitted with and stored on the report." + } + } + }, + "resolutionView": { + "type": "object", + "required": [ + "outcome", + "resolvedAt" + ], + "properties": { + "scope": { + "type": "string", + "knownValues": [ + "network", + "app", + "labelOnly" + ] + }, + "outcome": { + "type": "string", + "knownValues": [ + "actionTaken", + "noAction", + "other" + ] + }, + "resolvedAt": { + "type": "string", + "format": "datetime" + }, + "actionTaken": { + "type": "string", + "description": "Public action associated with this report's resolution. See the public action vocabulary table." + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/tools/ozone/inbox/getUnreadCount.json b/lexicons/tools/ozone/inbox/getUnreadCount.json new file mode 100644 index 000000000..6ab975f80 --- /dev/null +++ b/lexicons/tools/ozone/inbox/getUnreadCount.json @@ -0,0 +1,68 @@ +{ + "id": "tools.ozone.inbox.getUnreadCount", + "defs": { + "main": { + "type": "query", + "output": { + "schema": { + "type": "object", + "required": [ + "unreadCounts" + ], + "properties": { + "unreadCounts": { + "ref": "#unreadCounts", + "type": "ref" + } + } + }, + "encoding": "application/json" + }, + "parameters": { + "type": "params", + "properties": { + "did": { + "type": "string", + "format": "did", + "description": "Account to preview. Only Ozone staff can read another account; this does not change its read state." + }, + "section": { + "type": "string", + "knownValues": [ + "reports", + "subjects", + "accountStatus" + ] + } + } + } + }, + "unreadCounts": { + "type": "object", + "required": [ + "total" + ], + "properties": { + "total": { + "type": "integer", + "minimum": 0 + }, + "reports": { + "type": "integer", + "minimum": 0 + }, + "subjects": { + "type": "integer", + "minimum": 0 + }, + "accountStatus": { + "type": "integer", + "maximum": 1, + "minimum": 0 + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/tools/ozone/inbox/listActionedSubjects.json b/lexicons/tools/ozone/inbox/listActionedSubjects.json new file mode 100644 index 000000000..5c412f79b --- /dev/null +++ b/lexicons/tools/ozone/inbox/listActionedSubjects.json @@ -0,0 +1,79 @@ +{ + "id": "tools.ozone.inbox.listActionedSubjects", + "defs": { + "main": { + "type": "query", + "output": { + "schema": { + "type": "object", + "required": [ + "subjects" + ], + "properties": { + "cursor": { + "type": "string" + }, + "subjects": { + "type": "array", + "items": { + "ref": "tools.ozone.inbox.defs#subjectView", + "type": "ref" + } + } + } + }, + "encoding": "application/json" + }, + "parameters": { + "type": "params", + "properties": { + "did": { + "type": "string", + "format": "did", + "description": "Account to preview. Defaults to the authenticated account; another account requires an active moderator, triage, or admin credential." + }, + "limit": { + "type": "integer", + "default": 50, + "maximum": 100, + "minimum": 1 + }, + "cursor": { + "type": "string", + "description": "An opaque cursor for pagination." + }, + "filter": { + "enum": [ + "all", + "pending", + "resolved", + "unread" + ], + "type": "string", + "default": "all", + "description": "Filter subject activity. pending includes subjects whose latest appeal report is not closed; resolved includes subjects whose latest appeal report is closed. unread includes subjects whose public updatedAt is after the subjects section's seenAt watermark." + }, + "sortField": { + "enum": [ + "createdAt", + "updatedAt" + ], + "type": "string", + "default": "updatedAt" + }, + "sortDirection": { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "default": "desc" + } + } + }, + "description": "List subjects belonging to the authenticated account that have moderation actions from this moderation service." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/tools/ozone/inbox/listNotifications.json b/lexicons/tools/ozone/inbox/listNotifications.json new file mode 100644 index 000000000..e8fecc7ef --- /dev/null +++ b/lexicons/tools/ozone/inbox/listNotifications.json @@ -0,0 +1,76 @@ +{ + "id": "tools.ozone.inbox.listNotifications", + "defs": { + "main": { + "type": "query", + "output": { + "schema": { + "type": "object", + "required": [ + "notifications" + ], + "properties": { + "cursor": { + "type": "string" + }, + "notifications": { + "type": "array", + "items": { + "ref": "tools.ozone.inbox.defs#notification", + "type": "ref" + } + } + } + }, + "encoding": "application/json" + }, + "parameters": { + "type": "params", + "properties": { + "did": { + "type": "string", + "format": "did", + "description": "Account to preview. Only Ozone staff can read another account; this does not change its read state." + }, + "limit": { + "type": "integer", + "default": 50, + "maximum": 100, + "minimum": 1 + }, + "cursor": { + "type": "string" + }, + "reasons": { + "type": "array", + "items": { + "type": "string", + "knownValues": [ + "reportResolved", + "reportReopened", + "actionTaken", + "actionReversed", + "appealResolved", + "standingChanged" + ] + } + }, + "section": { + "type": "string", + "knownValues": [ + "reports", + "subjects", + "accountStatus" + ] + }, + "unreadOnly": { + "type": "boolean", + "default": false + } + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/tools/ozone/inbox/listReports.json b/lexicons/tools/ozone/inbox/listReports.json new file mode 100644 index 000000000..a5d90013d --- /dev/null +++ b/lexicons/tools/ozone/inbox/listReports.json @@ -0,0 +1,151 @@ +{ + "id": "tools.ozone.inbox.listReports", + "defs": { + "main": { + "type": "query", + "output": { + "schema": { + "type": "object", + "required": [ + "reports" + ], + "properties": { + "cursor": { + "type": "string" + }, + "reports": { + "type": "array", + "items": { + "ref": "#reportView", + "type": "ref" + } + } + } + }, + "encoding": "application/json" + }, + "parameters": { + "type": "params", + "properties": { + "did": { + "type": "string", + "format": "did", + "description": "Account to preview. Defaults to the authenticated account; another account requires an active moderator, triage, or admin credential." + }, + "limit": { + "type": "integer", + "default": 50, + "maximum": 100, + "minimum": 1 + }, + "cursor": { + "type": "string", + "description": "An opaque cursor for pagination." + }, + "filter": { + "enum": [ + "all", + "pending", + "resolved", + "unread" + ], + "type": "string", + "default": "all", + "description": "Filter report activity. unread includes reports whose updatedAt is after the reports section's seenAt watermark." + }, + "sortField": { + "enum": [ + "createdAt", + "updatedAt" + ], + "type": "string", + "default": "updatedAt" + }, + "sortDirection": { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "default": "desc" + } + } + }, + "description": "List moderation reports submitted by the authenticated account to this moderation service." + }, + "reportView": { + "type": "object", + "required": [ + "src", + "id", + "isRead", + "reasonType", + "subject", + "status", + "createdAt", + "updatedAt" + ], + "properties": { + "id": { + "type": "integer", + "description": "Report ID (report table ID), used by getReport and Ozone's report detail page." + }, + "src": { + "type": "string", + "format": "did", + "description": "DID of the moderation service that received the report." + }, + "scope": { + "type": "string", + "knownValues": [ + "network", + "app", + "labelOnly" + ] + }, + "isRead": { + "type": "boolean" + }, + "reason": { + "type": "string", + "maxLength": 20000, + "maxGraphemes": 2000 + }, + "status": { + "type": "string", + "knownValues": [ + "pending", + "resolved" + ] + }, + "subject": { + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef", + "chat.bsky.convo.defs#messageRef", + "chat.bsky.convo.defs#convoRef" + ], + "type": "union" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "updatedAt": { + "type": "string", + "format": "datetime" + }, + "reasonType": { + "type": "string", + "description": "The exact fully-qualified reason NSID submitted with and stored on the report." + }, + "lastActionTaken": { + "type": "string", + "description": "Public action associated with this report's transition to resolved. See the public action vocabulary table." + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/tools/ozone/inbox/putNotificationPreferences.json b/lexicons/tools/ozone/inbox/putNotificationPreferences.json new file mode 100644 index 000000000..ebfd6e7f5 --- /dev/null +++ b/lexicons/tools/ozone/inbox/putNotificationPreferences.json @@ -0,0 +1,39 @@ +{ + "id": "tools.ozone.inbox.putNotificationPreferences", + "defs": { + "main": { + "type": "procedure", + "input": { + "schema": { + "type": "object", + "required": [ + "push" + ], + "properties": { + "push": { + "type": "boolean" + } + } + }, + "encoding": "application/json" + }, + "output": { + "schema": { + "type": "object", + "required": [ + "preferences" + ], + "properties": { + "preferences": { + "ref": "tools.ozone.inbox.defs#notificationPreferences", + "type": "ref" + } + } + }, + "encoding": "application/json" + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/tools/ozone/inbox/updateSeen.json b/lexicons/tools/ozone/inbox/updateSeen.json new file mode 100644 index 000000000..a353ae333 --- /dev/null +++ b/lexicons/tools/ozone/inbox/updateSeen.json @@ -0,0 +1,54 @@ +{ + "id": "tools.ozone.inbox.updateSeen", + "defs": { + "main": { + "type": "procedure", + "input": { + "schema": { + "type": "object", + "required": [ + "sections" + ], + "properties": { + "seenAt": { + "type": "string", + "format": "datetime", + "description": "Mark each requested section read up to this instant. Defaults to server time and is clamped to server time when in the future. Newer existing watermarks are preserved independently for each section." + }, + "sections": { + "type": "array", + "items": { + "type": "string", + "knownValues": [ + "reports", + "subjects", + "accountStatus" + ] + }, + "minLength": 1 + } + } + }, + "encoding": "application/json" + }, + "output": { + "schema": { + "type": "object", + "required": [ + "seenAt" + ], + "properties": { + "seenAt": { + "type": "string", + "format": "datetime", + "description": "The earliest resulting watermark across the requested sections, in UTC. Every requested section is read through this instant; individual sections may already have newer watermarks." + } + } + }, + "encoding": "application/json" + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/tools/ozone/moderation/defs.json b/lexicons/tools/ozone/moderation/defs.json new file mode 100644 index 000000000..f1bcd922e --- /dev/null +++ b/lexicons/tools/ozone/moderation/defs.json @@ -0,0 +1,1608 @@ +{ + "id": "tools.ozone.moderation.defs", + "defs": { + "modTool": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "meta": { + "type": "unknown", + "description": "Additional arbitrary metadata about the source" + }, + "name": { + "type": "string", + "description": "Name/identifier of the source (e.g., 'automod', 'ozone/workspace')" + } + }, + "description": "Moderation tool information for tracing the source of the action" + }, + "blobView": { + "type": "object", + "required": [ + "cid", + "mimeType", + "size", + "createdAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "size": { + "type": "integer" + }, + "details": { + "refs": [ + "#imageDetails", + "#videoDetails" + ], + "type": "union" + }, + "mimeType": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "moderation": { + "ref": "#moderation", + "type": "ref" + } + } + }, + "repoView": { + "type": "object", + "required": [ + "did", + "handle", + "relatedRecords", + "indexedAt", + "moderation" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "email": { + "type": "string" + }, + "handle": { + "type": "string", + "format": "handle" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "invitedBy": { + "ref": "com.atproto.server.defs#inviteCode", + "type": "ref" + }, + "inviteNote": { + "type": "string" + }, + "moderation": { + "ref": "#moderation", + "type": "ref" + }, + "deactivatedAt": { + "type": "string", + "format": "datetime" + }, + "relatedRecords": { + "type": "array", + "items": { + "type": "unknown" + } + }, + "invitesDisabled": { + "type": "boolean" + }, + "threatSignatures": { + "type": "array", + "items": { + "ref": "com.atproto.admin.defs#threatSignature", + "type": "ref" + } + } + } + }, + "convoView": { + "type": "object", + "required": [ + "did", + "convoId" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "convoId": { + "type": "string" + } + } + }, + "moderation": { + "type": "object", + "properties": { + "subjectStatus": { + "ref": "#subjectStatusView", + "type": "ref" + } + } + }, + "recordView": { + "type": "object", + "required": [ + "uri", + "cid", + "value", + "blobCids", + "indexedAt", + "moderation", + "repo" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "repo": { + "ref": "#repoView", + "type": "ref" + }, + "value": { + "type": "unknown" + }, + "blobCids": { + "type": "array", + "items": { + "type": "string", + "format": "cid" + } + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "moderation": { + "ref": "#moderation", + "type": "ref" + } + } + }, + "reviewNone": { + "type": "token", + "description": "Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it" + }, + "reviewOpen": { + "type": "token", + "description": "Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator" + }, + "modEventTag": { + "type": "object", + "required": [ + "add", + "remove" + ], + "properties": { + "add": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags to be added to the subject. If already exists, won't be duplicated." + }, + "remove": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated." + }, + "comment": { + "type": "string", + "description": "Additional comment about added/removed tags." + }, + "durationInHours": { + "type": "integer", + "description": "Indicates how long the tags being added should remain before automatically being removed. Only applies to tags being added." + } + }, + "description": "Add/Remove a tag on a subject" + }, + "recordEvent": { + "type": "object", + "required": [ + "timestamp", + "op" + ], + "properties": { + "op": { + "type": "string", + "knownValues": [ + "create", + "update", + "delete" + ] + }, + "cid": { + "type": "string", + "format": "cid" + }, + "comment": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "datetime" + } + }, + "description": "Logs lifecycle event on a record subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking." + }, + "subjectView": { + "type": "object", + "required": [ + "type", + "subject" + ], + "properties": { + "repo": { + "ref": "#repoViewDetail", + "type": "ref" + }, + "type": { + "ref": "com.atproto.moderation.defs#subjectType", + "type": "ref" + }, + "record": { + "ref": "#recordViewDetail", + "type": "ref" + }, + "status": { + "ref": "#subjectStatusView", + "type": "ref" + }, + "profile": { + "refs": [], + "type": "union" + }, + "subject": { + "type": "string" + } + }, + "description": "Detailed view of a subject. For record subjects, the author's repo and profile will be returned." + }, + "accountEvent": { + "type": "object", + "required": [ + "timestamp", + "active" + ], + "properties": { + "active": { + "type": "boolean", + "description": "Indicates that the account has a repository which can be fetched from the host that emitted this event." + }, + "status": { + "type": "string", + "knownValues": [ + "unknown", + "deactivated", + "deleted", + "takendown", + "suspended", + "tombstoned" + ] + }, + "comment": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "datetime" + } + }, + "description": "Logs account status related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking." + }, + "accountStats": { + "type": "object", + "properties": { + "appealCount": { + "type": "integer", + "description": "Total number of appeals against a moderation action on the account" + }, + "reportCount": { + "type": "integer", + "description": "Total number of reports on the account" + }, + "suspendCount": { + "type": "integer", + "description": "Number of times the account was suspended" + }, + "escalateCount": { + "type": "integer", + "description": "Number of times the account was escalated" + }, + "takedownCount": { + "type": "integer", + "description": "Number of times the account was taken down" + } + }, + "description": "Statistics about a particular account subject" + }, + "imageDetails": { + "type": "object", + "required": [ + "width", + "height" + ], + "properties": { + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + } + } + }, + "modEventMute": { + "type": "object", + "required": [ + "durationInHours" + ], + "properties": { + "comment": { + "type": "string" + }, + "durationInHours": { + "type": "integer", + "description": "Indicates how long the subject should remain muted." + } + }, + "description": "Mute incoming reports on a subject" + }, + "modEventView": { + "type": "object", + "required": [ + "id", + "event", + "subject", + "subjectBlobCids", + "createdBy", + "createdAt" + ], + "properties": { + "id": { + "type": "integer" + }, + "event": { + "refs": [ + "#modEventTakedown", + "#modEventReverseTakedown", + "#modEventComment", + "#modEventReport", + "#modEventLabel", + "#modEventAcknowledge", + "#modEventEscalate", + "#modEventMute", + "#modEventUnmute", + "#modEventMuteReporter", + "#modEventUnmuteReporter", + "#modEventEmail", + "#modEventResolveAppeal", + "#modEventDivert", + "#modEventTag", + "#accountEvent", + "#identityEvent", + "#recordEvent", + "#modEventPriorityScore", + "#ageAssuranceEvent", + "#ageAssuranceOverrideEvent", + "#ageAssurancePurgeEvent", + "#revokeAccountCredentialsEvent", + "#scheduleTakedownEvent", + "#cancelScheduledTakedownEvent" + ], + "type": "union" + }, + "modTool": { + "ref": "#modTool", + "type": "ref" + }, + "subject": { + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef", + "chat.bsky.convo.defs#messageRef", + "chat.bsky.convo.defs#convoRef" + ], + "type": "union" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "createdBy": { + "type": "string", + "format": "did" + }, + "creatorHandle": { + "type": "string" + }, + "subjectHandle": { + "type": "string" + }, + "subjectBlobCids": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "recordsStats": { + "type": "object", + "properties": { + "pendingCount": { + "type": "integer", + "description": "Number of item currently in \"reviewOpen\" or \"reviewEscalated\" state" + }, + "subjectCount": { + "type": "integer", + "description": "Total number of item in the set" + }, + "totalReports": { + "type": "integer", + "description": "Cumulative sum of the number of reports on the items in the set" + }, + "appealedCount": { + "type": "integer", + "description": "Number of items that were appealed at least once" + }, + "reportedCount": { + "type": "integer", + "description": "Number of items that were reported at least once" + }, + "escalatedCount": { + "type": "integer", + "description": "Number of items that were escalated at least once" + }, + "processedCount": { + "type": "integer", + "description": "Number of item currently in \"reviewNone\" or \"reviewClosed\" state" + }, + "takendownCount": { + "type": "integer", + "description": "Number of item currently taken down" + } + }, + "description": "Statistics about a set of record subject items" + }, + "reviewClosed": { + "type": "token", + "description": "Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator" + }, + "videoDetails": { + "type": "object", + "required": [ + "width", + "height", + "length" + ], + "properties": { + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "length": { + "type": "integer" + } + } + }, + "accountStrike": { + "type": "object", + "properties": { + "lastStrikeAt": { + "type": "string", + "format": "datetime", + "description": "Timestamp of the most recent strike received" + }, + "firstStrikeAt": { + "type": "string", + "format": "datetime", + "description": "Timestamp of the first strike received" + }, + "totalStrikeCount": { + "type": "integer", + "description": "Total number of strikes ever received (including expired strikes)" + }, + "activeStrikeCount": { + "type": "integer", + "description": "Current number of active strikes (excluding expired strikes)" + } + }, + "description": "Strike information for an account" + }, + "identityEvent": { + "type": "object", + "required": [ + "timestamp" + ], + "properties": { + "handle": { + "type": "string", + "format": "handle" + }, + "comment": { + "type": "string" + }, + "pdsHost": { + "type": "string", + "format": "uri" + }, + "timestamp": { + "type": "string", + "format": "datetime" + }, + "tombstone": { + "type": "boolean" + } + }, + "description": "Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking." + }, + "modEventEmail": { + "type": "object", + "required": [ + "subjectLine" + ], + "properties": { + "comment": { + "type": "string", + "description": "Additional comment about the outgoing comm." + }, + "content": { + "type": "string", + "description": "The content of the email sent to the user." + }, + "policies": { + "type": "array", + "items": { + "type": "string" + }, + "maxLength": 5, + "description": "Names/Keywords of the policies that necessitated the email." + }, + "isDelivered": { + "type": "boolean", + "description": "Indicates whether the email was successfully delivered to the user's inbox." + }, + "strikeCount": { + "type": "integer", + "description": "Number of strikes to assign to the user for this violation. Normally 0 as an indicator of a warning and only added as a strike on a repeat offense." + }, + "subjectLine": { + "type": "string", + "description": "The subject line of the email sent to the user." + }, + "severityLevel": { + "type": "string", + "description": "Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense" + }, + "strikeExpiresAt": { + "type": "string", + "format": "datetime", + "description": "When the strike should expire. If not provided, the strike never expires." + } + }, + "description": "Keep a log of outgoing email to a user" + }, + "modEventLabel": { + "type": "object", + "required": [ + "createLabelVals", + "negateLabelVals" + ], + "properties": { + "comment": { + "type": "string" + }, + "createLabelVals": { + "type": "array", + "items": { + "type": "string" + } + }, + "durationInHours": { + "type": "integer", + "description": "Indicates how long the label will remain on the subject. Only applies on labels that are being added." + }, + "negateLabelVals": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "description": "Apply/Negate labels on a subject" + }, + "recordHosting": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string", + "knownValues": [ + "deleted", + "unknown" + ] + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "deletedAt": { + "type": "string", + "format": "datetime" + }, + "updatedAt": { + "type": "string", + "format": "datetime" + } + } + }, + "reporterStats": { + "type": "object", + "required": [ + "did", + "accountReportCount", + "recordReportCount", + "reportedAccountCount", + "reportedRecordCount", + "takendownAccountCount", + "takendownRecordCount", + "labeledAccountCount", + "labeledRecordCount" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "recordReportCount": { + "type": "integer", + "description": "The total number of reports made by the user on records." + }, + "accountReportCount": { + "type": "integer", + "description": "The total number of reports made by the user on accounts." + }, + "labeledRecordCount": { + "type": "integer", + "description": "The total number of records labeled as a result of the user's reports." + }, + "labeledAccountCount": { + "type": "integer", + "description": "The total number of accounts labeled as a result of the user's reports." + }, + "reportedRecordCount": { + "type": "integer", + "description": "The total number of records reported by the user." + }, + "reportedAccountCount": { + "type": "integer", + "description": "The total number of accounts reported by the user." + }, + "takendownRecordCount": { + "type": "integer", + "description": "The total number of records taken down as a result of the user's reports." + }, + "takendownAccountCount": { + "type": "integer", + "description": "The total number of accounts taken down as a result of the user's reports." + } + } + }, + "accountHosting": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string", + "knownValues": [ + "takendown", + "suspended", + "deleted", + "deactivated", + "unknown" + ] + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "deletedAt": { + "type": "string", + "format": "datetime" + }, + "updatedAt": { + "type": "string", + "format": "datetime" + }, + "deactivatedAt": { + "type": "string", + "format": "datetime" + }, + "reactivatedAt": { + "type": "string", + "format": "datetime" + } + } + }, + "modEventDivert": { + "type": "object", + "properties": { + "comment": { + "type": "string" + } + }, + "description": "Divert a record's blobs to a 3rd party service for further scanning/tagging" + }, + "modEventReport": { + "type": "object", + "required": [ + "reportType" + ], + "properties": { + "comment": { + "type": "string" + }, + "reportType": { + "ref": "com.atproto.moderation.defs#reasonType", + "type": "ref" + }, + "appealLabel": { + "type": "string" + }, + "appealActionId": { + "type": "integer" + }, + "isReporterMuted": { + "type": "boolean", + "description": "Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject." + }, + "appealActionType": { + "type": "string", + "description": "Action reference type recorded when this appeal was submitted." + }, + "appealSubmittedBy": { + "type": "string", + "format": "did", + "description": "Moderator who submitted this appeal on behalf of the affected account. Returned by moderator event APIs." + } + }, + "description": "Report a subject" + }, + "modEventUnmute": { + "type": "object", + "properties": { + "comment": { + "type": "string", + "description": "Describe reasoning behind the reversal." + } + }, + "description": "Unmute action on a subject" + }, + "repoViewDetail": { + "type": "object", + "required": [ + "did", + "handle", + "relatedRecords", + "indexedAt", + "moderation" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "email": { + "type": "string" + }, + "handle": { + "type": "string", + "format": "handle" + }, + "labels": { + "type": "array", + "items": { + "ref": "com.atproto.label.defs#label", + "type": "ref" + } + }, + "invites": { + "type": "array", + "items": { + "ref": "com.atproto.server.defs#inviteCode", + "type": "ref" + } + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "invitedBy": { + "ref": "com.atproto.server.defs#inviteCode", + "type": "ref" + }, + "inviteNote": { + "type": "string" + }, + "moderation": { + "ref": "#moderationDetail", + "type": "ref" + }, + "deactivatedAt": { + "type": "string", + "format": "datetime" + }, + "relatedRecords": { + "type": "array", + "items": { + "type": "unknown" + } + }, + "invitesDisabled": { + "type": "boolean" + }, + "emailConfirmedAt": { + "type": "string", + "format": "datetime" + }, + "threatSignatures": { + "type": "array", + "items": { + "ref": "com.atproto.admin.defs#threatSignature", + "type": "ref" + } + } + } + }, + "modEventComment": { + "type": "object", + "properties": { + "sticky": { + "type": "boolean", + "description": "Make the comment persistent on the subject" + }, + "comment": { + "type": "string" + } + }, + "description": "Add a comment to a subject. An empty comment will clear any previously set sticky comment." + }, + "reviewEscalated": { + "type": "token", + "description": "Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator" + }, + "modEventEscalate": { + "type": "object", + "properties": { + "comment": { + "type": "string" + } + } + }, + "modEventTakedown": { + "type": "object", + "properties": { + "comment": { + "type": "string" + }, + "policies": { + "type": "array", + "items": { + "type": "string" + }, + "maxLength": 5, + "description": "Names/Keywords of the policies that drove the decision." + }, + "strikeCount": { + "type": "integer", + "description": "Number of strikes to assign to the user for this violation." + }, + "severityLevel": { + "type": "string", + "description": "Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.)." + }, + "targetServices": { + "type": "array", + "items": { + "type": "string", + "knownValues": [ + "appview", + "pds" + ] + }, + "description": "List of services where the takedown should be applied. If empty or not provided, takedown is applied on all configured services." + }, + "durationInHours": { + "type": "integer", + "description": "Indicates how long the takedown should be in effect before automatically expiring." + }, + "strikeExpiresAt": { + "type": "string", + "format": "datetime", + "description": "When the strike should expire. If not provided, the strike never expires." + }, + "acknowledgeAccountSubjects": { + "type": "boolean", + "description": "If true, all other reports on content authored by this account will be resolved (acknowledged)." + } + }, + "description": "Take down a subject permanently or temporarily" + }, + "moderationDetail": { + "type": "object", + "properties": { + "subjectStatus": { + "ref": "#subjectStatusView", + "type": "ref" + } + } + }, + "recordViewDetail": { + "type": "object", + "required": [ + "uri", + "cid", + "value", + "blobs", + "indexedAt", + "moderation", + "repo" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "repo": { + "ref": "#repoView", + "type": "ref" + }, + "blobs": { + "type": "array", + "items": { + "ref": "#blobView", + "type": "ref" + } + }, + "value": { + "type": "unknown" + }, + "labels": { + "type": "array", + "items": { + "ref": "com.atproto.label.defs#label", + "type": "ref" + } + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "moderation": { + "ref": "#moderationDetail", + "type": "ref" + } + } + }, + "repoViewNotFound": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + }, + "ageAssuranceEvent": { + "type": "object", + "required": [ + "createdAt", + "status", + "attemptId" + ], + "properties": { + "access": { + "ref": "app.bsky.ageassurance.defs#access", + "type": "ref" + }, + "initIp": { + "type": "string", + "description": "The IP address used when initiating the AA flow." + }, + "initUa": { + "type": "string", + "description": "The user agent used when initiating the AA flow." + }, + "status": { + "type": "string", + "description": "The status of the Age Assurance process.", + "knownValues": [ + "unknown", + "pending", + "assured" + ] + }, + "attemptId": { + "type": "string", + "description": "The unique identifier for this instance of the age assurance flow, in UUID format." + }, + "createdAt": { + "type": "string", + "format": "datetime", + "description": "The date and time of this write operation." + }, + "completeIp": { + "type": "string", + "description": "The IP address used when completing the AA flow." + }, + "completeUa": { + "type": "string", + "description": "The user agent used when completing the AA flow." + }, + "regionCode": { + "type": "string", + "description": "The ISO 3166-2 region code provided when beginning the Age Assurance flow." + }, + "countryCode": { + "type": "string", + "description": "The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow." + } + }, + "description": "Age assurance info coming directly from users. Only works on DID subjects." + }, + "subjectStatusView": { + "type": "object", + "required": [ + "id", + "subject", + "createdAt", + "updatedAt", + "reviewState" + ], + "properties": { + "id": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "comment": { + "type": "string", + "description": "Sticky comment on the subject." + }, + "hosting": { + "refs": [ + "#accountHosting", + "#recordHosting" + ], + "type": "union" + }, + "subject": { + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef", + "chat.bsky.convo.defs#messageRef", + "chat.bsky.convo.defs#convoRef" + ], + "type": "union" + }, + "appealed": { + "type": "boolean", + "description": "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." + }, + "createdAt": { + "type": "string", + "format": "datetime", + "description": "Timestamp referencing the first moderation status impacting event was emitted on the subject" + }, + "muteUntil": { + "type": "string", + "format": "datetime" + }, + "takendown": { + "type": "boolean" + }, + "updatedAt": { + "type": "string", + "format": "datetime", + "description": "Timestamp referencing when the last update was made to the moderation status of the subject" + }, + "reviewState": { + "ref": "#subjectReviewState", + "type": "ref" + }, + "accountStats": { + "ref": "#accountStats", + "type": "ref", + "description": "Statistics related to the account subject" + }, + "recordsStats": { + "ref": "#recordsStats", + "type": "ref", + "description": "Statistics related to the record subjects authored by the subject's account" + }, + "suspendUntil": { + "type": "string", + "format": "datetime" + }, + "accountStrike": { + "ref": "#accountStrike", + "type": "ref", + "description": "Strike information for the account (account-level only)" + }, + "priorityScore": { + "type": "integer", + "maximum": 100, + "minimum": 0, + "description": "Numeric value representing the level of priority. Higher score means higher priority." + }, + "lastAppealedAt": { + "type": "string", + "format": "datetime", + "description": "Timestamp referencing when the author of the subject appealed a moderation action" + }, + "lastReportedAt": { + "type": "string", + "format": "datetime" + }, + "lastReviewedAt": { + "type": "string", + "format": "datetime" + }, + "lastReviewedBy": { + "type": "string", + "format": "did" + }, + "subjectBlobCids": { + "type": "array", + "items": { + "type": "string", + "format": "cid" + } + }, + "ageAssuranceState": { + "type": "string", + "description": "Current age assurance state of the subject.", + "knownValues": [ + "pending", + "assured", + "unknown", + "reset", + "blocked" + ] + }, + "subjectRepoHandle": { + "type": "string" + }, + "muteReportingUntil": { + "type": "string", + "format": "datetime" + }, + "ageAssuranceUpdatedBy": { + "type": "string", + "description": "Whether or not the last successful update to age assurance was made by the user or admin.", + "knownValues": [ + "admin", + "user" + ] + } + } + }, + "modEventViewDetail": { + "type": "object", + "required": [ + "id", + "event", + "subject", + "subjectBlobs", + "createdBy", + "createdAt" + ], + "properties": { + "id": { + "type": "integer" + }, + "event": { + "refs": [ + "#modEventTakedown", + "#modEventReverseTakedown", + "#modEventComment", + "#modEventReport", + "#modEventLabel", + "#modEventAcknowledge", + "#modEventEscalate", + "#modEventMute", + "#modEventUnmute", + "#modEventMuteReporter", + "#modEventUnmuteReporter", + "#modEventEmail", + "#modEventResolveAppeal", + "#modEventDivert", + "#modEventTag", + "#accountEvent", + "#identityEvent", + "#recordEvent", + "#modEventPriorityScore", + "#ageAssuranceEvent", + "#ageAssuranceOverrideEvent", + "#ageAssurancePurgeEvent", + "#revokeAccountCredentialsEvent", + "#scheduleTakedownEvent", + "#cancelScheduledTakedownEvent" + ], + "type": "union" + }, + "modTool": { + "ref": "#modTool", + "type": "ref" + }, + "subject": { + "refs": [ + "#repoView", + "#repoViewNotFound", + "#recordView", + "#recordViewNotFound", + "#convoView" + ], + "type": "union" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "createdBy": { + "type": "string", + "format": "did" + }, + "subjectBlobs": { + "type": "array", + "items": { + "ref": "#blobView", + "type": "ref" + } + } + } + }, + "recordViewNotFound": { + "type": "object", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "subjectReviewState": { + "type": "string", + "knownValues": [ + "tools.ozone.moderation.defs#reviewOpen", + "tools.ozone.moderation.defs#reviewEscalated", + "tools.ozone.moderation.defs#reviewClosed", + "tools.ozone.moderation.defs#reviewNone" + ] + }, + "modEventAcknowledge": { + "type": "object", + "properties": { + "comment": { + "type": "string" + }, + "acknowledgeAccountSubjects": { + "type": "boolean", + "description": "If true, all other reports on content authored by this account will be resolved (acknowledged)." + } + } + }, + "scheduledActionView": { + "type": "object", + "required": [ + "id", + "action", + "did", + "createdBy", + "createdAt", + "status" + ], + "properties": { + "id": { + "type": "integer", + "description": "Auto-incrementing row ID" + }, + "did": { + "type": "string", + "format": "did", + "description": "Subject DID for the action" + }, + "action": { + "type": "string", + "description": "Type of action to be executed", + "knownValues": [ + "takedown" + ] + }, + "status": { + "type": "string", + "description": "Current status of the scheduled action", + "knownValues": [ + "pending", + "executed", + "cancelled", + "failed" + ] + }, + "createdAt": { + "type": "string", + "format": "datetime", + "description": "When the scheduled action was created" + }, + "createdBy": { + "type": "string", + "format": "did", + "description": "DID of the user who created this scheduled action" + }, + "eventData": { + "type": "unknown", + "description": "Serialized event object that will be propagated to the event when performed" + }, + "executeAt": { + "type": "string", + "format": "datetime", + "description": "Exact time to execute the action" + }, + "updatedAt": { + "type": "string", + "format": "datetime", + "description": "When the scheduled action was last updated" + }, + "executeAfter": { + "type": "string", + "format": "datetime", + "description": "Earliest time to execute the action (for randomized scheduling)" + }, + "executeUntil": { + "type": "string", + "format": "datetime", + "description": "Latest time to execute the action (for randomized scheduling)" + }, + "lastExecutedAt": { + "type": "string", + "format": "datetime", + "description": "When the action was last attempted to be executed" + }, + "executionEventId": { + "type": "integer", + "description": "ID of the moderation event created when action was successfully executed" + }, + "lastFailureReason": { + "type": "string", + "description": "Reason for the last execution failure" + }, + "randomizeExecution": { + "type": "boolean", + "description": "Whether execution time should be randomized within the specified range" + } + }, + "description": "View of a scheduled moderation action" + }, + "modEventMuteReporter": { + "type": "object", + "properties": { + "comment": { + "type": "string" + }, + "durationInHours": { + "type": "integer", + "description": "Indicates how long the account should remain muted. Falsy value here means a permanent mute." + } + }, + "description": "Mute incoming reports from an account" + }, + "modEventPriorityScore": { + "type": "object", + "required": [ + "score" + ], + "properties": { + "score": { + "type": "integer", + "maximum": 100, + "minimum": 0 + }, + "comment": { + "type": "string" + } + }, + "description": "Set priority score of the subject. Higher score means higher priority." + }, + "modEventResolveAppeal": { + "type": "object", + "properties": { + "comment": { + "type": "string", + "description": "Describe resolution." + } + }, + "description": "Resolve appeal on a subject" + }, + "scheduleTakedownEvent": { + "type": "object", + "properties": { + "comment": { + "type": "string" + }, + "executeAt": { + "type": "string", + "format": "datetime" + }, + "executeAfter": { + "type": "string", + "format": "datetime" + }, + "executeUntil": { + "type": "string", + "format": "datetime" + } + }, + "description": "Logs a scheduled takedown action for an account." + }, + "ageAssurancePurgeEvent": { + "type": "object", + "required": [ + "comment" + ], + "properties": { + "comment": { + "type": "string", + "minLength": 1, + "description": "Comment describing the reason for the purge." + } + }, + "description": "Purges all age assurance events for the subject. Only works on DID subjects. Moderator-only." + }, + "modEventUnmuteReporter": { + "type": "object", + "properties": { + "comment": { + "type": "string", + "description": "Describe reasoning behind the reversal." + } + }, + "description": "Unmute incoming reports from an account" + }, + "timelineEventPlcCreate": { + "type": "token", + "description": "Moderation event timeline event for a PLC create operation" + }, + "modEventReverseTakedown": { + "type": "object", + "properties": { + "comment": { + "type": "string", + "description": "Describe reasoning behind the reversal." + }, + "policies": { + "type": "array", + "items": { + "type": "string" + }, + "maxLength": 5, + "description": "Names/Keywords of the policy infraction for which takedown is being reversed." + }, + "strikeCount": { + "type": "integer", + "description": "Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity." + }, + "severityLevel": { + "type": "string", + "description": "Severity level of the violation. Usually set from the last policy infraction's severity." + } + }, + "description": "Revert take down action on a subject" + }, + "ageAssuranceOverrideEvent": { + "type": "object", + "required": [ + "comment", + "status" + ], + "properties": { + "access": { + "ref": "app.bsky.ageassurance.defs#access", + "type": "ref" + }, + "status": { + "type": "string", + "description": "The status to be set for the user decided by a moderator, overriding whatever value the user had previously. Use reset to default to original state.", + "knownValues": [ + "assured", + "reset", + "blocked" + ] + }, + "comment": { + "type": "string", + "minLength": 1, + "description": "Comment describing the reason for the override." + } + }, + "description": "Age assurance status override by moderators. Only works on DID subjects." + }, + "timelineEventPlcOperation": { + "type": "token", + "description": "Moderation event timeline event for generic PLC operation" + }, + "timelineEventPlcTombstone": { + "type": "token", + "description": "Moderation event timeline event for a PLC tombstone operation" + }, + "cancelScheduledTakedownEvent": { + "type": "object", + "properties": { + "comment": { + "type": "string" + } + }, + "description": "Logs cancellation of a scheduled takedown action for an account." + }, + "revokeAccountCredentialsEvent": { + "type": "object", + "required": [ + "comment" + ], + "properties": { + "comment": { + "type": "string", + "minLength": 1, + "description": "Comment describing the reason for the revocation." + } + }, + "description": "Account credentials revocation by moderators. Only works on DID subjects." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/tools/ozone/queue/defs.json b/lexicons/tools/ozone/queue/defs.json new file mode 100644 index 000000000..c6930d927 --- /dev/null +++ b/lexicons/tools/ozone/queue/defs.json @@ -0,0 +1,169 @@ +{ + "id": "tools.ozone.queue.defs", + "defs": { + "queueView": { + "type": "object", + "required": [ + "id", + "name", + "createdBy", + "createdAt", + "updatedAt", + "enabled", + "stats" + ], + "properties": { + "id": { + "type": "integer", + "description": "Queue ID" + }, + "name": { + "type": "string", + "description": "Display name of the queue" + }, + "stats": { + "ref": "#queueStats", + "type": "ref", + "description": "Statistics about this queue" + }, + "enabled": { + "type": "boolean", + "description": "Whether this queue is currently active" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "createdBy": { + "type": "string", + "format": "did", + "description": "DID of moderator who created this queue" + }, + "deletedAt": { + "type": "string", + "format": "datetime", + "description": "When the queue was deleted, if applicable" + }, + "updatedAt": { + "type": "string", + "format": "datetime" + }, + "collection": { + "type": "string", + "format": "nsid", + "description": "Collection name for record subjects (e.g., 'app.bsky.feed.post')" + }, + "description": { + "type": "string", + "description": "Optional description of the queue" + }, + "reportTypes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Report reason types this queue accepts (fully qualified NSIDs)" + }, + "subjectTypes": { + "type": "array", + "items": { + "type": "string", + "knownValues": [ + "account", + "record", + "message", + "conversation" + ] + }, + "description": "Subject types this queue accepts." + }, + "recommendedLabels": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Labels recommended for this queue and used as a fallback when routing label appeals" + }, + "recommendedPolicies": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Policy keys recommended when actioning reports in this queue" + } + } + }, + "queueStats": { + "type": "object", + "required": [], + "properties": { + "actionRate": { + "type": "integer", + "description": "Percentage of reports actioned (actionedCount / inboundCount * 100), rounded to nearest integer. Absent when inboundCount is 0." + }, + "lastUpdated": { + "type": "string", + "format": "datetime", + "description": "When these statistics were last computed" + }, + "inboundCount": { + "type": "integer", + "description": "Reports received in this queue in the last 24 hours." + }, + "pendingCount": { + "type": "integer", + "description": "Number of reports in 'open' status" + }, + "actionedCount": { + "type": "integer", + "description": "Number of reports in 'closed' status" + }, + "escalatedCount": { + "type": "integer", + "description": "Number of reports in 'escalated' status" + }, + "avgHandlingTimeSec": { + "type": "integer", + "description": "Average time in seconds from report creation to close, for reports closed in this period." + } + } + }, + "assignmentView": { + "type": "object", + "required": [ + "id", + "did", + "queue", + "startAt" + ], + "properties": { + "id": { + "type": "integer" + }, + "did": { + "type": "string", + "format": "did" + }, + "endAt": { + "type": "string", + "format": "datetime" + }, + "queue": { + "ref": "#queueView", + "type": "ref" + }, + "startAt": { + "type": "string", + "format": "datetime" + }, + "moderator": { + "ref": "tools.ozone.team.defs#member", + "type": "ref", + "description": "The moderator assigned to this queue" + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/tools/ozone/report/defs.json b/lexicons/tools/ozone/report/defs.json index 2742fbd1f..318a9a754 100644 --- a/lexicons/tools/ozone/report/defs.json +++ b/lexicons/tools/ozone/report/defs.json @@ -1,6 +1,81 @@ { "id": "tools.ozone.report.defs", "defs": { + "liveStats": { + "type": "object", + "properties": { + "actionRate": { + "type": "integer", + "description": "Percentage of closures actioned (actionedCount / closedCount * 100), rounded to nearest integer." + }, + "closedCount": { + "type": "integer", + "description": "Number of close transitions." + }, + "lastUpdated": { + "type": "string", + "format": "datetime", + "description": "When these statistics were last computed." + }, + "inboundCount": { + "type": "integer", + "description": "Reports received." + }, + "pendingCount": { + "type": "integer", + "description": "Number of reports currently not closed." + }, + "actionedCount": { + "type": "integer", + "description": "Number of closures whose last report action is label, tag, or takedown." + }, + "ahtDurationSec": { + "type": "integer", + "description": "Sum of report assignment-to-close seconds." + }, + "ahtSampleCount": { + "type": "integer", + "description": "Number of assigned closed-report samples in ahtDurationSec." + }, + "escalatedCount": { + "type": "integer", + "description": "Number of reports escalated." + }, + "tagActionCount": { + "type": "integer", + "description": "Closures whose last report action is a tag event." + }, + "labelActionCount": { + "type": "integer", + "description": "Closures whose last report action is a label event." + }, + "acknowledgedCount": { + "type": "integer", + "description": "Number of closures whose last report action is not label, tag, or takedown." + }, + "avgHandlingTimeSec": { + "type": "integer", + "description": "Average handling time in seconds from report assignment to close." + }, + "takedownActionCount": { + "type": "integer", + "description": "Closures whose last report action is a takedown event." + }, + "avgResolutionTimeSec": { + "type": "integer", + "description": "Average resolution time in seconds from report creation to close." + }, + "resolutionDurationSec": { + "type": "integer", + "description": "Sum of report creation-to-close seconds." + }, + "resolutionSampleCount": { + "type": "integer", + "description": "Number of closed-report samples in resolutionDurationSec." + } + }, + "description": "Live statistics for reports for the current calendar day, filterable by queue, moderator, or report type." + }, "reasonType": { "type": "string", "knownValues": [ @@ -46,14 +121,310 @@ "tools.ozone.report.defs#reasonSelfHarmOther" ] }, + "reportView": { + "type": "object", + "required": [ + "id", + "eventId", + "status", + "subject", + "reportType", + "reportedBy", + "reporter", + "createdAt" + ], + "properties": { + "id": { + "type": "integer", + "description": "Report ID" + }, + "queue": { + "ref": "tools.ozone.queue.defs#queueView", + "type": "ref", + "description": "The queue this report is assigned to (if any)" + }, + "status": { + "type": "string", + "description": "Current status of the report", + "knownValues": [ + "open", + "closed", + "escalated", + "queued", + "assigned" + ] + }, + "actions": { + "type": "array", + "items": { + "ref": "tools.ozone.moderation.defs#modEventView", + "type": "ref" + }, + "description": "Optional: expanded action events" + }, + "comment": { + "type": "string", + "description": "Comment provided by the reporter" + }, + "eventId": { + "type": "integer", + "description": "ID of the moderation event that created this report" + }, + "isMuted": { + "type": "boolean", + "description": "Whether this report is muted. A report is muted if the reporter was muted or the subject was muted at the time the report was created." + }, + "subject": { + "ref": "tools.ozone.moderation.defs#subjectView", + "type": "ref", + "description": "The subject that was reported with full details" + }, + "queuedAt": { + "type": "string", + "format": "datetime", + "description": "When the report was assigned to its current queue" + }, + "reporter": { + "ref": "tools.ozone.moderation.defs#subjectView", + "type": "ref", + "description": "Full subject view of the reporter account" + }, + "createdAt": { + "type": "string", + "format": "datetime", + "description": "When the report was created" + }, + "updatedAt": { + "type": "string", + "format": "datetime", + "description": "When the report was last updated" + }, + "actionNote": { + "type": "string", + "description": "Note sent to reporter when report was actioned" + }, + "assignment": { + "ref": "#reportAssignment", + "type": "ref", + "description": "Information about moderator currently assigned to this report (if any)" + }, + "reportType": { + "ref": "com.atproto.moderation.defs#reasonType", + "type": "ref", + "description": "Type of report" + }, + "reportedBy": { + "type": "string", + "format": "did", + "description": "DID of the user who made the report" + }, + "isAutomated": { + "type": "boolean", + "default": false, + "description": "Whether this report was emitted by automated tooling." + }, + "subjectStatus": { + "ref": "tools.ozone.moderation.defs#subjectStatusView", + "type": "ref", + "description": "Current status of the reported subject" + }, + "actionEventIds": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "Array of moderation event IDs representing actions taken on this report, in append order (most recently linked event last)" + }, + "relatedReportCount": { + "type": "integer", + "description": "Number of other pending reports on the same subject" + } + } + }, "reasonOther": { "type": "token", "description": "An issue not included in these options" }, + "noteActivity": { + "type": "object", + "properties": {}, + "description": "Activity recording a note on a report. Use internalNote for moderator-only notes or publicNote for reporter-visible notes (or both)." + }, "reasonAppeal": { "type": "token", "description": "Appeal a previously taken moderation action" }, + "closeActivity": { + "type": "object", + "properties": { + "previousStatus": { + "type": "string", + "description": "The report's status before this activity. Populated automatically from the report row; not required in input.", + "knownValues": [ + "open", + "closed", + "escalated", + "queued", + "assigned" + ] + } + }, + "description": "Activity recording a report being closed." + }, + "queueActivity": { + "type": "object", + "properties": { + "previousStatus": { + "type": "string", + "description": "The report's status before this activity. Populated automatically from the report row; not required in input.", + "knownValues": [ + "open", + "closed", + "escalated", + "queued", + "assigned" + ] + } + }, + "description": "Activity recording a report being routed to a queue." + }, + "assignmentView": { + "type": "object", + "required": [ + "id", + "did", + "reportId", + "startAt" + ], + "properties": { + "id": { + "type": "integer" + }, + "did": { + "type": "string", + "format": "did" + }, + "endAt": { + "type": "string", + "format": "datetime" + }, + "queue": { + "ref": "tools.ozone.queue.defs#queueView", + "type": "ref" + }, + "startAt": { + "type": "string", + "format": "datetime" + }, + "reportId": { + "type": "integer" + }, + "moderator": { + "ref": "tools.ozone.team.defs#member", + "type": "ref", + "description": "The moderator assigned to this report" + } + } + }, + "reopenActivity": { + "type": "object", + "properties": { + "previousStatus": { + "type": "string", + "description": "The report's status before this activity. Populated automatically from the report row; not required in input.", + "knownValues": [ + "open", + "closed", + "escalated", + "queued", + "assigned" + ] + } + }, + "description": "Activity recording a closed report being reopened. Only valid when the report is in 'closed' status." + }, + "historicalStats": { + "type": "object", + "required": [ + "date" + ], + "properties": { + "date": { + "type": "string", + "description": "The calendar date this snapshot covers (YYYY-MM-DD)." + }, + "actionRate": { + "type": "integer", + "description": "Percentage of closures actioned (actionedCount / closedCount * 100), rounded to nearest integer." + }, + "computedAt": { + "type": "string", + "format": "datetime", + "description": "When this snapshot was last computed." + }, + "closedCount": { + "type": "integer", + "description": "Number of close transitions during this day." + }, + "inboundCount": { + "type": "integer", + "description": "Reports received during this day." + }, + "pendingCount": { + "type": "integer", + "description": "Number of reports not closed at time of computation." + }, + "actionedCount": { + "type": "integer", + "description": "Number of closures whose last report action is label, tag, or takedown during this day." + }, + "ahtDurationSec": { + "type": "integer", + "description": "Sum of report assignment-to-close seconds for this day's samples." + }, + "ahtSampleCount": { + "type": "integer", + "description": "Number of assigned closed-report samples in ahtDurationSec." + }, + "escalatedCount": { + "type": "integer", + "description": "Number of reports escalated during this day." + }, + "tagActionCount": { + "type": "integer", + "description": "Closures whose last report action is a tag event during this day." + }, + "labelActionCount": { + "type": "integer", + "description": "Closures whose last report action is a label event during this day." + }, + "acknowledgedCount": { + "type": "integer", + "description": "Number of closures whose last report action is not label, tag, or takedown during this day." + }, + "avgHandlingTimeSec": { + "type": "integer", + "description": "Average handling time in seconds from report assignment to close." + }, + "takedownActionCount": { + "type": "integer", + "description": "Closures whose last report action is a takedown event during this day." + }, + "avgResolutionTimeSec": { + "type": "integer", + "description": "Average resolution time in seconds from report creation to close." + }, + "resolutionDurationSec": { + "type": "integer", + "description": "Sum of report creation-to-close seconds for this day's samples." + }, + "resolutionSampleCount": { + "type": "integer", + "description": "Number of closed-report samples in resolutionDurationSec." + } + }, + "description": "A single daily snapshot of report statistics for a calendar date." + }, "reasonRuleOther": { "type": "token", "description": "Other" @@ -66,14 +437,144 @@ "type": "token", "description": "Non-consensual intimate imagery" }, + "reportAssignment": { + "type": "object", + "required": [ + "did", + "assignedAt" + ], + "properties": { + "did": { + "type": "string", + "format": "did", + "description": "DID of the assigned moderator" + }, + "moderator": { + "ref": "tools.ozone.team.defs#member", + "type": "ref", + "description": "Full member record of the assigned moderator" + }, + "assignedAt": { + "type": "string", + "format": "datetime", + "description": "When the report was assigned" + } + }, + "description": "Information about the moderator currently assigned to a report." + }, "reasonSexualOther": { "type": "token", "description": "Other sexual violence content" }, + "assignmentActivity": { + "type": "object", + "properties": { + "previousStatus": { + "type": "string", + "description": "The report's status before this activity. Populated automatically from the report row; not required in input.", + "knownValues": [ + "open", + "closed", + "escalated", + "queued", + "assigned" + ] + } + }, + "description": "Activity recording a moderator being assigned to a report." + }, + "escalationActivity": { + "type": "object", + "properties": { + "previousStatus": { + "type": "string", + "description": "The report's status before this activity. Populated automatically from the report row; not required in input.", + "knownValues": [ + "open", + "closed", + "escalated", + "queued", + "assigned" + ] + } + }, + "description": "Activity recording a report being escalated." + }, "reasonSexualAnimal": { "type": "token", "description": "Animal sexual abuse" }, + "reportActivityView": { + "type": "object", + "required": [ + "id", + "reportId", + "activity", + "isAutomated", + "createdBy", + "createdAt" + ], + "properties": { + "id": { + "type": "integer", + "description": "Activity ID" + }, + "meta": { + "type": "unknown", + "description": "Extensible JSON payload for loose activity-specific metadata (e.g. assignmentId)." + }, + "report": { + "ref": "#reportView", + "type": "ref", + "description": "Full view of the report this activity belongs to." + }, + "activity": { + "refs": [ + "#queueActivity", + "#assignmentActivity", + "#unassignmentActivity", + "#escalationActivity", + "#closeActivity", + "#reopenActivity", + "#noteActivity" + ], + "type": "union", + "description": "The typed activity object describing what occurred." + }, + "reportId": { + "type": "integer", + "description": "ID of the report this activity belongs to" + }, + "createdAt": { + "type": "string", + "format": "datetime", + "description": "When this activity was created" + }, + "createdBy": { + "type": "string", + "format": "did", + "description": "DID of the actor who created this activity, or the service DID for automated activities." + }, + "moderator": { + "ref": "tools.ozone.team.defs#member", + "type": "ref", + "description": "Full member record of the moderator who created this activity" + }, + "publicNote": { + "type": "string", + "description": "Optional public note, potentially visible to the reporter." + }, + "isAutomated": { + "type": "boolean", + "description": "True if this activity was created by an automated process (e.g. queue router) rather than a direct human action." + }, + "internalNote": { + "type": "string", + "description": "Optional moderator-only note. Not visible to reporters." + } + }, + "description": "A single activity entry on a report." + }, "reasonMisleadingBot": { "type": "token", "description": "Fake account or bot" @@ -110,6 +611,34 @@ "type": "token", "description": "Animal welfare violations" }, + "unassignmentActivity": { + "type": "object", + "properties": { + "nextStatus": { + "type": "string", + "description": "The report's status immediately after the moderator was unassigned. May equal previousStatus if unassignment did not change the report's status, or be absent on older activities.", + "knownValues": [ + "open", + "closed", + "escalated", + "queued", + "assigned" + ] + }, + "previousStatus": { + "type": "string", + "description": "The report's status immediately before the moderator was unassigned. May be absent on older activities.", + "knownValues": [ + "open", + "closed", + "escalated", + "queued", + "assigned" + ] + } + }, + "description": "Activity recording a moderator being unassigned from a report." + }, "reasonChildSafetyCSAM": { "type": "token", "description": "Child sexual abuse material (CSAM). These reports will be sent only be sent to the application's Moderation Authority." diff --git a/lexicons/tools/ozone/server/getCapabilities.json b/lexicons/tools/ozone/server/getCapabilities.json new file mode 100644 index 000000000..8065580d7 --- /dev/null +++ b/lexicons/tools/ozone/server/getCapabilities.json @@ -0,0 +1,41 @@ +{ + "id": "tools.ozone.server.getCapabilities", + "defs": { + "main": { + "type": "query", + "output": { + "schema": { + "type": "object", + "properties": { + "notifications": { + "ref": "#notificationConfig", + "type": "ref" + } + } + }, + "encoding": "application/json" + } + }, + "notificationConfig": { + "type": "object", + "required": [ + "channels" + ], + "properties": { + "channels": { + "type": "array", + "items": { + "type": "string", + "knownValues": [ + "inApp", + "push" + ] + }, + "minLength": 1 + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/tools/ozone/team/defs.json b/lexicons/tools/ozone/team/defs.json new file mode 100644 index 000000000..bdf0bd12f --- /dev/null +++ b/lexicons/tools/ozone/team/defs.json @@ -0,0 +1,63 @@ +{ + "id": "tools.ozone.team.defs", + "defs": { + "member": { + "type": "object", + "required": [ + "did", + "role" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "role": { + "type": "string", + "knownValues": [ + "tools.ozone.team.defs#roleAdmin", + "tools.ozone.team.defs#roleModerator", + "tools.ozone.team.defs#roleTriage", + "tools.ozone.team.defs#roleVerifier" + ] + }, + "profile": { + "ref": "app.bsky.actor.defs#profileViewDetailed", + "type": "ref" + }, + "disabled": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "updatedAt": { + "type": "string", + "format": "datetime" + }, + "lastUpdatedBy": { + "type": "string" + } + } + }, + "roleAdmin": { + "type": "token", + "description": "Admin role. Highest level of access, can perform all actions." + }, + "roleTriage": { + "type": "token", + "description": "Triage role. Mostly intended for monitoring and escalating issues." + }, + "roleVerifier": { + "type": "token", + "description": "Verifier role. Only allowed to issue verifications." + }, + "roleModerator": { + "type": "token", + "description": "Moderator role. Can perform most actions." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/src/lib/media/video/upload.shared.ts b/src/lib/media/video/upload.shared.ts index 1ea0c62a9..d7f22243b 100644 --- a/src/lib/media/video/upload.shared.ts +++ b/src/lib/media/video/upload.shared.ts @@ -1,5 +1,5 @@ import {type Client} from '@atproto/lex' -import {type DidString, type NsidString} from '@atproto/syntax' +import {type NsidString} from '@atproto/syntax' import {type I18n} from '@lingui/core' import {msg} from '@lingui/core/macro' @@ -46,7 +46,7 @@ export async function getServiceAuthToken({ resolvedAud = pdsAud } const {token} = await client.call(com.atproto.server.getServiceAuth, { - aud: resolvedAud as DidString, + aud: resolvedAud, lxm, exp: exp === undefined ? undefined : toIntegerExp(exp), }) -- knotmirror 0.0.1