{"$type":"com.atproto.lexicon.schema","defs":{"auditEntryView":{"description":"AppView projection of a moderation_audit row. The audit log is append-only and never purged; entries survive hard-deletion of the actor account.","properties":{"actionType":{"ref":"#staffActionType","type":"ref"},"actorDid":{"description":"DID of the moderator who performed the action, or of the reporter for `reportCreated` entries.","format":"did","type":"string"},"afterStatus":{"description":"moderation_status value after the action, when applicable. 0 = live, 1 = reported, 2 = tagged, 3 = legalHold.","minimum":0,"type":"integer"},"beforeStatus":{"description":"moderation_status value before the action, when applicable. 0 = live, 1 = reported, 2 = tagged, 3 = legalHold.","minimum":0,"type":"integer"},"createdAt":{"format":"datetime","type":"string"},"id":{"minimum":1,"type":"integer"},"reason":{"description":"Free-text reason provided by the actor.","maxGraphemes":500,"maxLength":5000,"type":"string"},"reportId":{"description":"Linked report row when relevant (report-lifecycle entries, takedowns with closeAttachedReports).","minimum":1,"type":"integer"},"subject":{"refs":["app.tempomusic.moderation.defs#postSubject","app.tempomusic.moderation.defs#replySubject","app.tempomusic.moderation.defs#accountSubject"],"type":"union"},"takedownClass":{"description":"For subjectTakedown actions, the class chosen by the moderator. Equivalent to afterStatus but in symbolic form; populated to spare clients from translating the integer code.","ref":"#takedownClass","type":"ref"}},"required":["id","actorDid","actionType","createdAt"],"type":"object"},"inviteCodeUse":{"properties":{"usedAt":{"format":"datetime","type":"string"},"usedBy":{"format":"did","type":"string"}},"required":["usedBy","usedAt"],"type":"object"},"inviteCodeView":{"description":"AppView projection of a single PDS invite code, sourced on-demand from `com.atproto.admin.getInviteCodes`. No local mirror.","properties":{"available":{"description":"Number of remaining uses. `1 - uses.length` for the single-use codes emitted by this feature.","minimum":0,"type":"integer"},"code":{"description":"Suffix only — the env prefix has been stripped by the server before surfacing.","maxLength":128,"type":"string"},"createdAt":{"format":"datetime","type":"string"},"createdBy":{"description":"DID of the staff account that generated this code.","format":"did","type":"string"},"disabled":{"description":"True when the code has been disabled by a super-admin via disableInviteCodes.","type":"boolean"},"forAccount":{"description":"When the code was minted for a specific DID (unused by this feature — the staff panel only generates unbound codes).","format":"did","type":"string"},"uses":{"items":{"ref":"#inviteCodeUse","type":"ref"},"type":"array"}},"required":["code","available","disabled","createdBy","createdAt"],"type":"object"},"reportStatus":{"description":"Lifecycle state of a report. `open` → `underReview` → terminal `actioned` | `dismissed`. Current implementations MUST NOT emit any value outside this set; future audit-clarity states (e.g. resolvedDuplicate) require an additive lexicon update plus an implementation that writes them.","knownValues":["open","underReview","actioned","dismissed"],"maxLength":100,"type":"string"},"reportView":{"description":"AppView projection of a single report row.","properties":{"createdAt":{"format":"datetime","type":"string"},"details":{"description":"Free-text context provided by the reporter. Absent when not provided.","maxGraphemes":500,"maxLength":500,"type":"string"},"id":{"minimum":1,"type":"integer"},"reasonType":{"ref":"app.tempomusic.moderation.defs#reasonType","type":"ref"},"reporterDid":{"format":"did","type":"string"},"resolutionNote":{"maxGraphemes":500,"maxLength":5000,"type":"string"},"resolvedAt":{"format":"datetime","type":"string"},"resolvedByDid":{"format":"did","type":"string"},"status":{"ref":"#reportStatus","type":"ref"},"subject":{"refs":["app.tempomusic.moderation.defs#postSubject","app.tempomusic.moderation.defs#replySubject","app.tempomusic.moderation.defs#accountSubject"],"type":"union"},"subjectKnownAtIntake":{"description":"True when the subject was already projected into the AppView at the moment of intake. False when the resolver job had to catch up; combined with subjectResolvedAt to distinguish the two known-at-intake variants. State combinations: (a) `true` + subjectResolvedAt absent = known at intake; (b) `true` + subjectResolvedAt present = resolver flipped after the fact; (c) `false` = still unresolved.","type":"boolean"},"subjectResolvedAt":{"description":"Timestamp at which the daily resolver job flipped subjectKnownAtIntake from false to true. Absent when intake was already known.","format":"datetime","type":"string"},"triagedAt":{"format":"datetime","type":"string"},"triagedByDid":{"format":"did","type":"string"}},"required":["id","subject","reporterDid","reasonType","status","subjectKnownAtIntake","createdAt"],"type":"object"},"staffActionType":{"description":"Categorical action recorded in the moderation audit log. Covers report-lifecycle transitions, subject status changes, moderator-role mutations, and invite-code lifecycle (TEM-502).","knownValues":["reportCreated","reportTriaged","reportDismissed","reportClosedByCascade","subjectTakedown","subjectRestore","moderatorGranted","moderatorRevoked","accountSuspended","accountUnsuspended","accountBanned","reportReopened","inviteCodeCreated","inviteCodeDisabled"],"maxLength":100,"type":"string"},"staffRole":{"description":"Privilege level on the admin surface. `superAdmin` is the only role permitted to grant or revoke other moderators.","knownValues":["moderator","superAdmin"],"maxLength":100,"type":"string"},"staffView":{"description":"AppView projection of a row in the moderators table.","properties":{"did":{"format":"did","type":"string"},"grantedAt":{"format":"datetime","type":"string"},"grantedByDid":{"description":"DID of the super-admin who granted this row. Absent for bootstrap rows seeded from the TEMPO_STAFF_BOOTSTRAP_DIDS env var.","format":"did","type":"string"},"revokeReason":{"maxGraphemes":500,"maxLength":5000,"type":"string"},"revokedAt":{"description":"When set, the row is no longer active; the gate denies the DID. Listed in listStaff only when explicitly requested via the includeRevoked parameter.","format":"datetime","type":"string"},"role":{"ref":"#staffRole","type":"ref"}},"required":["did","role","grantedAt"],"type":"object"},"takedownClass":{"description":"Classification of a takedown action. All three classes make the subject invisible to read paths identically; the distinction is downstream retention/purge policy. `reported` is the standard moderation hold. `tagged` is reserved for future classifier-driven holds with auto-purge after a sweep. `legalHold` is exempt from any future purge endpoint and is audit-mandatory.","knownValues":["reported","tagged","legalHold"],"maxLength":100,"type":"string"}},"id":"app.tempomusic.staff.defs","lexicon":1}