@atproto/ozone 0.1.172 → 0.1.174
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +40 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/moderation/emitEvent.d.ts.map +1 -1
- package/dist/api/moderation/emitEvent.js +31 -0
- package/dist/api/moderation/emitEvent.js.map +1 -1
- package/dist/api/queue/assignModerator.d.ts +4 -0
- package/dist/api/queue/assignModerator.d.ts.map +1 -0
- package/dist/api/queue/assignModerator.js +28 -0
- package/dist/api/queue/assignModerator.js.map +1 -0
- package/dist/api/queue/createQueue.d.ts +4 -0
- package/dist/api/queue/createQueue.d.ts.map +1 -0
- package/dist/api/queue/createQueue.js +44 -0
- package/dist/api/queue/createQueue.js.map +1 -0
- package/dist/api/queue/deleteQueue.d.ts +4 -0
- package/dist/api/queue/deleteQueue.d.ts.map +1 -0
- package/dist/api/queue/deleteQueue.js +40 -0
- package/dist/api/queue/deleteQueue.js.map +1 -0
- package/dist/api/queue/getAssignments.d.ts +4 -0
- package/dist/api/queue/getAssignments.d.ts.map +1 -0
- package/dist/api/queue/getAssignments.js +19 -0
- package/dist/api/queue/getAssignments.js.map +1 -0
- package/dist/api/queue/listQueues.d.ts +4 -0
- package/dist/api/queue/listQueues.d.ts.map +1 -0
- package/dist/api/queue/listQueues.js +29 -0
- package/dist/api/queue/listQueues.js.map +1 -0
- package/dist/api/queue/routeReports.d.ts +4 -0
- package/dist/api/queue/routeReports.d.ts.map +1 -0
- package/dist/api/queue/routeReports.js +33 -0
- package/dist/api/queue/routeReports.js.map +1 -0
- package/dist/api/queue/unassignModerator.d.ts +4 -0
- package/dist/api/queue/unassignModerator.d.ts.map +1 -0
- package/dist/api/queue/unassignModerator.js +24 -0
- package/dist/api/queue/unassignModerator.js.map +1 -0
- package/dist/api/queue/updateQueue.d.ts +4 -0
- package/dist/api/queue/updateQueue.d.ts.map +1 -0
- package/dist/api/queue/updateQueue.js +39 -0
- package/dist/api/queue/updateQueue.js.map +1 -0
- package/dist/api/report/assignModerator.d.ts +4 -0
- package/dist/api/report/assignModerator.d.ts.map +1 -0
- package/dist/api/report/assignModerator.js +33 -0
- package/dist/api/report/assignModerator.js.map +1 -0
- package/dist/api/report/createActivity.d.ts +4 -0
- package/dist/api/report/createActivity.d.ts.map +1 -0
- package/dist/api/report/createActivity.js +44 -0
- package/dist/api/report/createActivity.js.map +1 -0
- package/dist/api/report/getAssignments.d.ts +4 -0
- package/dist/api/report/getAssignments.d.ts.map +1 -0
- package/dist/api/report/getAssignments.js +19 -0
- package/dist/api/report/getAssignments.js.map +1 -0
- package/dist/api/report/getHistoricalStats.d.ts +4 -0
- package/dist/api/report/getHistoricalStats.d.ts.map +1 -0
- package/dist/api/report/getHistoricalStats.js +32 -0
- package/dist/api/report/getHistoricalStats.js.map +1 -0
- package/dist/api/report/getLatestReport.d.ts +4 -0
- package/dist/api/report/getLatestReport.d.ts.map +1 -0
- package/dist/api/report/getLatestReport.js +31 -0
- package/dist/api/report/getLatestReport.js.map +1 -0
- package/dist/api/report/getLiveStats.d.ts +4 -0
- package/dist/api/report/getLiveStats.d.ts.map +1 -0
- package/dist/api/report/getLiveStats.js +25 -0
- package/dist/api/report/getLiveStats.js.map +1 -0
- package/dist/api/report/getReport.d.ts +4 -0
- package/dist/api/report/getReport.d.ts.map +1 -0
- package/dist/api/report/getReport.js +35 -0
- package/dist/api/report/getReport.js.map +1 -0
- package/dist/api/report/listActivities.d.ts +4 -0
- package/dist/api/report/listActivities.d.ts.map +1 -0
- package/dist/api/report/listActivities.js +25 -0
- package/dist/api/report/listActivities.js.map +1 -0
- package/dist/api/report/queryReports.d.ts +4 -0
- package/dist/api/report/queryReports.d.ts.map +1 -0
- package/dist/api/report/queryReports.js +29 -0
- package/dist/api/report/queryReports.js.map +1 -0
- package/dist/api/report/reassignQueue.d.ts +4 -0
- package/dist/api/report/reassignQueue.d.ts.map +1 -0
- package/dist/api/report/reassignQueue.js +45 -0
- package/dist/api/report/reassignQueue.js.map +1 -0
- package/dist/api/report/refreshStats.d.ts +4 -0
- package/dist/api/report/refreshStats.d.ts.map +1 -0
- package/dist/api/report/refreshStats.js +26 -0
- package/dist/api/report/refreshStats.js.map +1 -0
- package/dist/api/report/unassignModerator.d.ts +4 -0
- package/dist/api/report/unassignModerator.d.ts.map +1 -0
- package/dist/api/report/unassignModerator.js +21 -0
- package/dist/api/report/unassignModerator.js.map +1 -0
- package/dist/api/util.d.ts +2 -0
- package/dist/api/util.d.ts.map +1 -1
- package/dist/api/util.js +9 -1
- package/dist/api/util.js.map +1 -1
- package/dist/assignment/index.d.ts +89 -0
- package/dist/assignment/index.d.ts.map +1 -0
- package/dist/assignment/index.js +537 -0
- package/dist/assignment/index.js.map +1 -0
- package/dist/config/config.d.ts +14 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +9 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/env.d.ts +3 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +3 -0
- package/dist/config/env.js.map +1 -1
- package/dist/context.d.ts +9 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +31 -10
- package/dist/context.js.map +1 -1
- package/dist/daemon/context.d.ts +6 -0
- package/dist/daemon/context.d.ts.map +1 -1
- package/dist/daemon/context.js +28 -4
- package/dist/daemon/context.js.map +1 -1
- package/dist/daemon/event-reverser.d.ts +1 -0
- package/dist/daemon/event-reverser.d.ts.map +1 -1
- package/dist/daemon/event-reverser.js +42 -1
- package/dist/daemon/event-reverser.js.map +1 -1
- package/dist/daemon/job-cursor.d.ts +5 -0
- package/dist/daemon/job-cursor.d.ts.map +1 -0
- package/dist/daemon/job-cursor.js +28 -0
- package/dist/daemon/job-cursor.js.map +1 -0
- package/dist/daemon/queue-router.d.ts +17 -0
- package/dist/daemon/queue-router.d.ts.map +1 -0
- package/dist/daemon/queue-router.js +114 -0
- package/dist/daemon/queue-router.js.map +1 -0
- package/dist/daemon/stats-computer.d.ts +51 -0
- package/dist/daemon/stats-computer.d.ts.map +1 -0
- package/dist/daemon/stats-computer.js +117 -0
- package/dist/daemon/stats-computer.js.map +1 -0
- package/dist/daemon/strike-expiry-processor.d.ts.map +1 -1
- package/dist/daemon/strike-expiry-processor.js +4 -19
- package/dist/daemon/strike-expiry-processor.js.map +1 -1
- package/dist/db/migrations/20260219T164523000Z-create-report-table.d.ts +4 -0
- package/dist/db/migrations/20260219T164523000Z-create-report-table.d.ts.map +1 -0
- package/dist/db/migrations/20260219T164523000Z-create-report-table.js +126 -0
- package/dist/db/migrations/20260219T164523000Z-create-report-table.js.map +1 -0
- package/dist/db/migrations/20260219T165302248Z-moderator-assignment.d.ts +4 -0
- package/dist/db/migrations/20260219T165302248Z-moderator-assignment.d.ts.map +1 -0
- package/dist/db/migrations/20260219T165302248Z-moderator-assignment.js +35 -0
- package/dist/db/migrations/20260219T165302248Z-moderator-assignment.js.map +1 -0
- package/dist/db/migrations/20260225T000000000Z-add-report-queue-table.d.ts +4 -0
- package/dist/db/migrations/20260225T000000000Z-add-report-queue-table.d.ts.map +1 -0
- package/dist/db/migrations/20260225T000000000Z-add-report-queue-table.js +36 -0
- package/dist/db/migrations/20260225T000000000Z-add-report-queue-table.js.map +1 -0
- package/dist/db/migrations/20260313T000000000Z-add-report-activity-table.d.ts +4 -0
- package/dist/db/migrations/20260313T000000000Z-add-report-activity-table.d.ts.map +1 -0
- package/dist/db/migrations/20260313T000000000Z-add-report-activity-table.js +39 -0
- package/dist/db/migrations/20260313T000000000Z-add-report-activity-table.js.map +1 -0
- package/dist/db/migrations/20260318T152058935Z-add-report-stat.d.ts +4 -0
- package/dist/db/migrations/20260318T152058935Z-add-report-stat.d.ts.map +1 -0
- package/dist/db/migrations/20260318T152058935Z-add-report-stat.js +34 -0
- package/dist/db/migrations/20260318T152058935Z-add-report-stat.js.map +1 -0
- package/dist/db/migrations/20260428T000000000Z-add-expiring-tag-table.d.ts +4 -0
- package/dist/db/migrations/20260428T000000000Z-add-expiring-tag-table.d.ts.map +1 -0
- package/dist/db/migrations/20260428T000000000Z-add-expiring-tag-table.js +32 -0
- package/dist/db/migrations/20260428T000000000Z-add-expiring-tag-table.js.map +1 -0
- package/dist/db/migrations/index.d.ts +6 -0
- package/dist/db/migrations/index.d.ts.map +1 -1
- package/dist/db/migrations/index.js +7 -1
- package/dist/db/migrations/index.js.map +1 -1
- package/dist/db/pagination.d.ts +31 -0
- package/dist/db/pagination.d.ts.map +1 -1
- package/dist/db/pagination.js +74 -1
- package/dist/db/pagination.js.map +1 -1
- package/dist/db/schema/expiring_tag.d.ts +15 -0
- package/dist/db/schema/expiring_tag.d.ts.map +1 -0
- package/dist/db/schema/expiring_tag.js +5 -0
- package/dist/db/schema/expiring_tag.js.map +1 -0
- package/dist/db/schema/index.d.ts +7 -1
- package/dist/db/schema/index.d.ts.map +1 -1
- package/dist/db/schema/index.js.map +1 -1
- package/dist/db/schema/moderator_assignment.d.ts +14 -0
- package/dist/db/schema/moderator_assignment.d.ts.map +1 -0
- package/dist/db/schema/moderator_assignment.js +5 -0
- package/dist/db/schema/moderator_assignment.js.map +1 -0
- package/dist/db/schema/report.d.ts +25 -0
- package/dist/db/schema/report.d.ts.map +1 -0
- package/dist/db/schema/report.js +5 -0
- package/dist/db/schema/report.js.map +1 -0
- package/dist/db/schema/report_activity.d.ts +18 -0
- package/dist/db/schema/report_activity.d.ts.map +1 -0
- package/dist/db/schema/report_activity.js +5 -0
- package/dist/db/schema/report_activity.js.map +1 -0
- package/dist/db/schema/report_queue.d.ts +19 -0
- package/dist/db/schema/report_queue.d.ts.map +1 -0
- package/dist/db/schema/report_queue.js +5 -0
- package/dist/db/schema/report_queue.js.map +1 -0
- package/dist/db/schema/report_stat.d.ts +20 -0
- package/dist/db/schema/report_stat.d.ts.map +1 -0
- package/dist/db/schema/report_stat.js +5 -0
- package/dist/db/schema/report_stat.js.map +1 -0
- package/dist/lexicon/index.d.ts +50 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +120 -2
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +11255 -7885
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +1900 -120
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/external.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/embed/external.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/external.js.map +1 -1
- package/dist/lexicon/types/chat/bsky/actor/defs.d.ts +8 -2
- package/dist/lexicon/types/chat/bsky/actor/defs.d.ts.map +1 -1
- package/dist/lexicon/types/chat/bsky/actor/defs.js +9 -0
- package/dist/lexicon/types/chat/bsky/actor/defs.js.map +1 -1
- package/dist/lexicon/types/chat/bsky/convo/defs.d.ts +37 -10
- package/dist/lexicon/types/chat/bsky/convo/defs.d.ts.map +1 -1
- package/dist/lexicon/types/chat/bsky/convo/defs.js +9 -0
- package/dist/lexicon/types/chat/bsky/convo/defs.js.map +1 -1
- package/dist/lexicon/types/chat/bsky/convo/getMessages.d.ts +3 -0
- package/dist/lexicon/types/chat/bsky/convo/getMessages.d.ts.map +1 -1
- package/dist/lexicon/types/chat/bsky/convo/getMessages.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts +2 -0
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/emitEvent.d.ts +19 -0
- package/dist/lexicon/types/tools/ozone/moderation/emitEvent.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/emitEvent.js +9 -0
- package/dist/lexicon/types/tools/ozone/moderation/emitEvent.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/queue/assignModerator.d.ts +27 -0
- package/dist/lexicon/types/tools/ozone/queue/assignModerator.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/assignModerator.js +7 -0
- package/dist/lexicon/types/tools/ozone/queue/assignModerator.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/createQueue.d.ts +35 -0
- package/dist/lexicon/types/tools/ozone/queue/createQueue.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/createQueue.js +7 -0
- package/dist/lexicon/types/tools/ozone/queue/createQueue.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/defs.d.ts +62 -0
- package/dist/lexicon/types/tools/ozone/queue/defs.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/defs.js +34 -0
- package/dist/lexicon/types/tools/ozone/queue/defs.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/deleteQueue.d.ts +29 -0
- package/dist/lexicon/types/tools/ozone/queue/deleteQueue.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/deleteQueue.js +7 -0
- package/dist/lexicon/types/tools/ozone/queue/deleteQueue.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/getAssignments.d.ts +30 -0
- package/dist/lexicon/types/tools/ozone/queue/getAssignments.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/getAssignments.js +7 -0
- package/dist/lexicon/types/tools/ozone/queue/getAssignments.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/listQueues.d.ts +32 -0
- package/dist/lexicon/types/tools/ozone/queue/listQueues.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/listQueues.js +7 -0
- package/dist/lexicon/types/tools/ozone/queue/listQueues.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/routeReports.d.ts +31 -0
- package/dist/lexicon/types/tools/ozone/queue/routeReports.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/routeReports.js +7 -0
- package/dist/lexicon/types/tools/ozone/queue/routeReports.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/unassignModerator.d.ts +18 -0
- package/dist/lexicon/types/tools/ozone/queue/unassignModerator.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/unassignModerator.js +7 -0
- package/dist/lexicon/types/tools/ozone/queue/unassignModerator.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/updateQueue.d.ts +32 -0
- package/dist/lexicon/types/tools/ozone/queue/updateQueue.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/queue/updateQueue.js +7 -0
- package/dist/lexicon/types/tools/ozone/queue/updateQueue.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/assignModerator.d.ts +31 -0
- package/dist/lexicon/types/tools/ozone/report/assignModerator.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/assignModerator.js +7 -0
- package/dist/lexicon/types/tools/ozone/report/assignModerator.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/createActivity.d.ts +37 -0
- package/dist/lexicon/types/tools/ozone/report/createActivity.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/createActivity.js +7 -0
- package/dist/lexicon/types/tools/ozone/report/createActivity.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/defs.d.ts +185 -0
- package/dist/lexicon/types/tools/ozone/report/defs.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/report/defs.js +108 -0
- package/dist/lexicon/types/tools/ozone/report/defs.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/report/getAssignments.d.ts +30 -0
- package/dist/lexicon/types/tools/ozone/report/getAssignments.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/getAssignments.js +7 -0
- package/dist/lexicon/types/tools/ozone/report/getAssignments.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/getHistoricalStats.d.ts +36 -0
- package/dist/lexicon/types/tools/ozone/report/getHistoricalStats.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/getHistoricalStats.js +7 -0
- package/dist/lexicon/types/tools/ozone/report/getHistoricalStats.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/getLatestReport.d.ts +21 -0
- package/dist/lexicon/types/tools/ozone/report/getLatestReport.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/getLatestReport.js +7 -0
- package/dist/lexicon/types/tools/ozone/report/getLatestReport.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/getLiveStats.d.ts +27 -0
- package/dist/lexicon/types/tools/ozone/report/getLiveStats.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/getLiveStats.js +7 -0
- package/dist/lexicon/types/tools/ozone/report/getLiveStats.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/getReport.d.ts +22 -0
- package/dist/lexicon/types/tools/ozone/report/getReport.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/getReport.js +7 -0
- package/dist/lexicon/types/tools/ozone/report/getReport.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/listActivities.d.ts +26 -0
- package/dist/lexicon/types/tools/ozone/report/listActivities.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/listActivities.js +7 -0
- package/dist/lexicon/types/tools/ozone/report/listActivities.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/queryReports.d.ts +48 -0
- package/dist/lexicon/types/tools/ozone/report/queryReports.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/queryReports.js +7 -0
- package/dist/lexicon/types/tools/ozone/report/queryReports.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/reassignQueue.d.ts +31 -0
- package/dist/lexicon/types/tools/ozone/report/reassignQueue.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/reassignQueue.js +7 -0
- package/dist/lexicon/types/tools/ozone/report/reassignQueue.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/refreshStats.d.ts +28 -0
- package/dist/lexicon/types/tools/ozone/report/refreshStats.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/refreshStats.js +7 -0
- package/dist/lexicon/types/tools/ozone/report/refreshStats.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/unassignModerator.d.ts +25 -0
- package/dist/lexicon/types/tools/ozone/report/unassignModerator.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/unassignModerator.js +7 -0
- package/dist/lexicon/types/tools/ozone/report/unassignModerator.js.map +1 -0
- package/dist/mod-service/expiring-tags.d.ts +27 -0
- package/dist/mod-service/expiring-tags.d.ts.map +1 -0
- package/dist/mod-service/expiring-tags.js +62 -0
- package/dist/mod-service/expiring-tags.js.map +1 -0
- package/dist/mod-service/index.d.ts +3 -1
- package/dist/mod-service/index.d.ts.map +1 -1
- package/dist/mod-service/index.js +61 -2
- package/dist/mod-service/index.js.map +1 -1
- package/dist/mod-service/report.d.ts +64 -0
- package/dist/mod-service/report.d.ts.map +1 -0
- package/dist/mod-service/report.js +282 -0
- package/dist/mod-service/report.js.map +1 -0
- package/dist/mod-service/status.d.ts +24 -0
- package/dist/mod-service/status.d.ts.map +1 -1
- package/dist/queue/service.d.ts +86 -0
- package/dist/queue/service.d.ts.map +1 -0
- package/dist/queue/service.js +430 -0
- package/dist/queue/service.js.map +1 -0
- package/dist/report/activity.d.ts +77 -0
- package/dist/report/activity.d.ts.map +1 -0
- package/dist/report/activity.js +141 -0
- package/dist/report/activity.js.map +1 -0
- package/dist/report/handle-report-update.d.ts +47 -0
- package/dist/report/handle-report-update.d.ts.map +1 -0
- package/dist/report/handle-report-update.js +178 -0
- package/dist/report/handle-report-update.js.map +1 -0
- package/dist/report/reassign.d.ts +10 -0
- package/dist/report/reassign.d.ts.map +1 -0
- package/dist/report/reassign.js +75 -0
- package/dist/report/reassign.js.map +1 -0
- package/dist/report/stats.d.ts +105 -0
- package/dist/report/stats.d.ts.map +1 -0
- package/dist/report/stats.js +619 -0
- package/dist/report/stats.js.map +1 -0
- package/dist/report/views.d.ts +111 -0
- package/dist/report/views.d.ts.map +1 -0
- package/dist/report/views.js +156 -0
- package/dist/report/views.js.map +1 -0
- package/dist/team/index.d.ts +1 -0
- package/dist/team/index.d.ts.map +1 -1
- package/dist/team/index.js +11 -0
- package/dist/team/index.js.map +1 -1
- package/package.json +3 -3
- package/src/api/index.ts +40 -0
- package/src/api/moderation/emitEvent.ts +38 -0
- package/src/api/queue/assignModerator.ts +31 -0
- package/src/api/queue/createQueue.ts +62 -0
- package/src/api/queue/deleteQueue.ts +56 -0
- package/src/api/queue/getAssignments.ts +19 -0
- package/src/api/queue/listQueues.ts +39 -0
- package/src/api/queue/routeReports.ts +44 -0
- package/src/api/queue/unassignModerator.ts +26 -0
- package/src/api/queue/updateQueue.ts +54 -0
- package/src/api/report/assignModerator.ts +36 -0
- package/src/api/report/createActivity.ts +57 -0
- package/src/api/report/getAssignments.ts +20 -0
- package/src/api/report/getHistoricalStats.ts +41 -0
- package/src/api/report/getLatestReport.ts +44 -0
- package/src/api/report/getLiveStats.ts +26 -0
- package/src/api/report/getReport.ts +55 -0
- package/src/api/report/listActivities.ts +34 -0
- package/src/api/report/queryReports.ts +44 -0
- package/src/api/report/reassignQueue.ts +68 -0
- package/src/api/report/refreshStats.ts +27 -0
- package/src/api/report/unassignModerator.ts +21 -0
- package/src/api/util.ts +12 -0
- package/src/assignment/index.ts +731 -0
- package/src/config/config.ts +27 -0
- package/src/config/env.ts +8 -0
- package/src/context.ts +31 -0
- package/src/daemon/context.ts +34 -0
- package/src/daemon/event-reverser.ts +50 -1
- package/src/daemon/job-cursor.ts +33 -0
- package/src/daemon/queue-router.ts +101 -0
- package/src/daemon/stats-computer.ts +101 -0
- package/src/daemon/strike-expiry-processor.ts +4 -20
- package/src/db/migrations/20260219T164523000Z-create-report-table.ts +155 -0
- package/src/db/migrations/20260219T165302248Z-moderator-assignment.ts +42 -0
- package/src/db/migrations/20260225T000000000Z-add-report-queue-table.ts +41 -0
- package/src/db/migrations/20260313T000000000Z-add-report-activity-table.ts +48 -0
- package/src/db/migrations/20260318T152058935Z-add-report-stat.ts +35 -0
- package/src/db/migrations/20260428T000000000Z-add-expiring-tag-table.ts +32 -0
- package/src/db/migrations/index.ts +6 -0
- package/src/db/pagination.ts +85 -0
- package/src/db/schema/expiring_tag.ts +17 -0
- package/src/db/schema/index.ts +13 -1
- package/src/db/schema/moderator_assignment.ts +16 -0
- package/src/db/schema/report.ts +27 -0
- package/src/db/schema/report_activity.ts +22 -0
- package/src/db/schema/report_queue.ts +21 -0
- package/src/db/schema/report_stat.ts +27 -0
- package/src/lexicon/index.ts +280 -0
- package/src/lexicon/lexicons.ts +2083 -214
- package/src/lexicon/types/app/bsky/embed/external.ts +2 -0
- package/src/lexicon/types/chat/bsky/actor/defs.ts +17 -1
- package/src/lexicon/types/chat/bsky/convo/defs.ts +50 -10
- package/src/lexicon/types/chat/bsky/convo/getMessages.ts +3 -0
- package/src/lexicon/types/tools/ozone/moderation/defs.ts +2 -0
- package/src/lexicon/types/tools/ozone/moderation/emitEvent.ts +24 -0
- package/src/lexicon/types/tools/ozone/queue/assignModerator.ts +46 -0
- package/src/lexicon/types/tools/ozone/queue/createQueue.ts +54 -0
- package/src/lexicon/types/tools/ozone/queue/defs.ts +99 -0
- package/src/lexicon/types/tools/ozone/queue/deleteQueue.ts +48 -0
- package/src/lexicon/types/tools/ozone/queue/getAssignments.ts +48 -0
- package/src/lexicon/types/tools/ozone/queue/listQueues.ts +50 -0
- package/src/lexicon/types/tools/ozone/queue/routeReports.ts +50 -0
- package/src/lexicon/types/tools/ozone/queue/unassignModerator.ts +37 -0
- package/src/lexicon/types/tools/ozone/queue/updateQueue.ts +51 -0
- package/src/lexicon/types/tools/ozone/report/assignModerator.ts +50 -0
- package/src/lexicon/types/tools/ozone/report/createActivity.ts +60 -0
- package/src/lexicon/types/tools/ozone/report/defs.ts +327 -0
- package/src/lexicon/types/tools/ozone/report/getAssignments.ts +48 -0
- package/src/lexicon/types/tools/ozone/report/getHistoricalStats.ts +54 -0
- package/src/lexicon/types/tools/ozone/report/getLatestReport.ts +39 -0
- package/src/lexicon/types/tools/ozone/report/getLiveStats.ts +45 -0
- package/src/lexicon/types/tools/ozone/report/getReport.ts +38 -0
- package/src/lexicon/types/tools/ozone/report/listActivities.ts +44 -0
- package/src/lexicon/types/tools/ozone/report/queryReports.ts +72 -0
- package/src/lexicon/types/tools/ozone/report/reassignQueue.ts +55 -0
- package/src/lexicon/types/tools/ozone/report/refreshStats.ts +46 -0
- package/src/lexicon/types/tools/ozone/report/unassignModerator.ts +44 -0
- package/src/mod-service/expiring-tags.ts +98 -0
- package/src/mod-service/index.ts +71 -3
- package/src/mod-service/report.ts +408 -0
- package/src/queue/service.ts +599 -0
- package/src/report/activity.ts +234 -0
- package/src/report/handle-report-update.ts +209 -0
- package/src/report/reassign.ts +109 -0
- package/src/report/stats.ts +850 -0
- package/src/report/views.ts +241 -0
- package/src/team/index.ts +11 -0
- package/tests/expiring-tags.test.ts +231 -0
- package/tests/get-report.test.ts +136 -0
- package/tests/query-reports.test.ts +608 -0
- package/tests/queue-assignment.test.ts +428 -0
- package/tests/queue-router.test.ts +306 -0
- package/tests/queues.test.ts +690 -0
- package/tests/report-action.test.ts +308 -0
- package/tests/report-activity.test.ts +567 -0
- package/tests/report-assignment.test.ts +517 -0
- package/tests/report-reassign-queue.test.ts +340 -0
- package/tests/report-routing.test.ts +245 -0
- package/tests/report-stats.test.ts +545 -0
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
import type * as ToolsOzoneReportDefs from './defs.js'
|
|
13
|
+
|
|
14
|
+
const is$typed = _is$typed,
|
|
15
|
+
validate = _validate
|
|
16
|
+
const id = 'tools.ozone.report.getLatestReport'
|
|
17
|
+
|
|
18
|
+
export type QueryParams = {}
|
|
19
|
+
export type InputSchema = undefined
|
|
20
|
+
|
|
21
|
+
export interface OutputSchema {
|
|
22
|
+
report: ToolsOzoneReportDefs.ReportView
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type HandlerInput = void
|
|
26
|
+
|
|
27
|
+
export interface HandlerSuccess {
|
|
28
|
+
encoding: 'application/json'
|
|
29
|
+
body: OutputSchema
|
|
30
|
+
headers?: { [key: string]: string }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface HandlerError {
|
|
34
|
+
status: number
|
|
35
|
+
message?: string
|
|
36
|
+
error?: 'NotFound'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
import type * as ToolsOzoneReportDefs from './defs.js'
|
|
13
|
+
|
|
14
|
+
const is$typed = _is$typed,
|
|
15
|
+
validate = _validate
|
|
16
|
+
const id = 'tools.ozone.report.getLiveStats'
|
|
17
|
+
|
|
18
|
+
export type QueryParams = {
|
|
19
|
+
/** Filter stats by queue. Use -1 for unqueued reports. */
|
|
20
|
+
queueId?: number
|
|
21
|
+
/** Filter stats by moderator DID. */
|
|
22
|
+
moderatorDid?: string
|
|
23
|
+
/** Filter stats by report types. */
|
|
24
|
+
reportTypes?: string[]
|
|
25
|
+
}
|
|
26
|
+
export type InputSchema = undefined
|
|
27
|
+
|
|
28
|
+
export interface OutputSchema {
|
|
29
|
+
stats: ToolsOzoneReportDefs.LiveStats
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type HandlerInput = void
|
|
33
|
+
|
|
34
|
+
export interface HandlerSuccess {
|
|
35
|
+
encoding: 'application/json'
|
|
36
|
+
body: OutputSchema
|
|
37
|
+
headers?: { [key: string]: string }
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface HandlerError {
|
|
41
|
+
status: number
|
|
42
|
+
message?: string
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
import type * as ToolsOzoneReportDefs from './defs.js'
|
|
13
|
+
|
|
14
|
+
const is$typed = _is$typed,
|
|
15
|
+
validate = _validate
|
|
16
|
+
const id = 'tools.ozone.report.getReport'
|
|
17
|
+
|
|
18
|
+
export type QueryParams = {
|
|
19
|
+
/** The ID of the report to retrieve. */
|
|
20
|
+
id: number
|
|
21
|
+
}
|
|
22
|
+
export type InputSchema = undefined
|
|
23
|
+
export type OutputSchema = ToolsOzoneReportDefs.ReportView
|
|
24
|
+
export type HandlerInput = void
|
|
25
|
+
|
|
26
|
+
export interface HandlerSuccess {
|
|
27
|
+
encoding: 'application/json'
|
|
28
|
+
body: OutputSchema
|
|
29
|
+
headers?: { [key: string]: string }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface HandlerError {
|
|
33
|
+
status: number
|
|
34
|
+
message?: string
|
|
35
|
+
error?: 'NotFound'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
import type * as ToolsOzoneReportDefs from './defs.js'
|
|
13
|
+
|
|
14
|
+
const is$typed = _is$typed,
|
|
15
|
+
validate = _validate
|
|
16
|
+
const id = 'tools.ozone.report.listActivities'
|
|
17
|
+
|
|
18
|
+
export type QueryParams = {
|
|
19
|
+
/** ID of the report whose activities to list */
|
|
20
|
+
reportId: number
|
|
21
|
+
limit: number
|
|
22
|
+
cursor?: string
|
|
23
|
+
}
|
|
24
|
+
export type InputSchema = undefined
|
|
25
|
+
|
|
26
|
+
export interface OutputSchema {
|
|
27
|
+
activities: ToolsOzoneReportDefs.ReportActivityView[]
|
|
28
|
+
cursor?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type HandlerInput = void
|
|
32
|
+
|
|
33
|
+
export interface HandlerSuccess {
|
|
34
|
+
encoding: 'application/json'
|
|
35
|
+
body: OutputSchema
|
|
36
|
+
headers?: { [key: string]: string }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface HandlerError {
|
|
40
|
+
status: number
|
|
41
|
+
message?: string
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
import type * as ToolsOzoneReportDefs from './defs.js'
|
|
13
|
+
|
|
14
|
+
const is$typed = _is$typed,
|
|
15
|
+
validate = _validate
|
|
16
|
+
const id = 'tools.ozone.report.queryReports'
|
|
17
|
+
|
|
18
|
+
export type QueryParams = {
|
|
19
|
+
/** Filter by queue ID. Use -1 for unassigned reports. */
|
|
20
|
+
queueId?: number
|
|
21
|
+
/** Filter by report types (fully qualified string in the format of com.atproto.moderation.defs#reason<name>). */
|
|
22
|
+
reportTypes?: string[]
|
|
23
|
+
/** Filter by report status. */
|
|
24
|
+
status:
|
|
25
|
+
| 'open'
|
|
26
|
+
| 'closed'
|
|
27
|
+
| 'escalated'
|
|
28
|
+
| 'queued'
|
|
29
|
+
| 'assigned'
|
|
30
|
+
| (string & {})
|
|
31
|
+
/** Filter by subject DID or AT-URI. */
|
|
32
|
+
subject?: string
|
|
33
|
+
/** Filter to reports where the subject is this DID or any record owned by this DID. Unlike `subject` (which scopes to a specific account or record), this returns all reports tied to the DID across both account-level and record-level subjects. */
|
|
34
|
+
did?: string
|
|
35
|
+
/** If specified, reports of the given type (account or record) will be returned. */
|
|
36
|
+
subjectType?: 'account' | 'record' | (string & {})
|
|
37
|
+
/** If specified, reports where the subject belongs to the given collections will be returned. When subjectType is set to 'account', this will be ignored. */
|
|
38
|
+
collections?: string[]
|
|
39
|
+
/** Retrieve reports created after a given timestamp */
|
|
40
|
+
reportedAfter?: string
|
|
41
|
+
/** Retrieve reports created before a given timestamp */
|
|
42
|
+
reportedBefore?: string
|
|
43
|
+
/** Filter by muted status. true returns only muted reports, false returns only unmuted reports. Defaults to false. */
|
|
44
|
+
isMuted: boolean
|
|
45
|
+
/** Filter by the DID of the moderator permanently assigned to the report. */
|
|
46
|
+
assignedTo?: string
|
|
47
|
+
sortField: 'createdAt' | 'updatedAt'
|
|
48
|
+
sortDirection: 'asc' | 'desc'
|
|
49
|
+
limit: number
|
|
50
|
+
cursor?: string
|
|
51
|
+
}
|
|
52
|
+
export type InputSchema = undefined
|
|
53
|
+
|
|
54
|
+
export interface OutputSchema {
|
|
55
|
+
cursor?: string
|
|
56
|
+
reports: ToolsOzoneReportDefs.ReportView[]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type HandlerInput = void
|
|
60
|
+
|
|
61
|
+
export interface HandlerSuccess {
|
|
62
|
+
encoding: 'application/json'
|
|
63
|
+
body: OutputSchema
|
|
64
|
+
headers?: { [key: string]: string }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface HandlerError {
|
|
68
|
+
status: number
|
|
69
|
+
message?: string
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
import type * as ToolsOzoneReportDefs from './defs.js'
|
|
13
|
+
|
|
14
|
+
const is$typed = _is$typed,
|
|
15
|
+
validate = _validate
|
|
16
|
+
const id = 'tools.ozone.report.reassignQueue'
|
|
17
|
+
|
|
18
|
+
export type QueryParams = {}
|
|
19
|
+
|
|
20
|
+
export interface InputSchema {
|
|
21
|
+
/** ID of the report to reassign */
|
|
22
|
+
reportId: number
|
|
23
|
+
/** Target queue ID. Use -1 to unassign from any queue. */
|
|
24
|
+
queueId: number
|
|
25
|
+
/** Optional moderator-only note recorded on the resulting queueActivity as internalNote. */
|
|
26
|
+
comment?: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface OutputSchema {
|
|
30
|
+
report: ToolsOzoneReportDefs.ReportView
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface HandlerInput {
|
|
34
|
+
encoding: 'application/json'
|
|
35
|
+
body: InputSchema
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface HandlerSuccess {
|
|
39
|
+
encoding: 'application/json'
|
|
40
|
+
body: OutputSchema
|
|
41
|
+
headers?: { [key: string]: string }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface HandlerError {
|
|
45
|
+
status: number
|
|
46
|
+
message?: string
|
|
47
|
+
error?:
|
|
48
|
+
| 'ReportNotFound'
|
|
49
|
+
| 'ReportClosed'
|
|
50
|
+
| 'AlreadyInTargetQueue'
|
|
51
|
+
| 'QueueNotFound'
|
|
52
|
+
| 'QueueDisabled'
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
|
|
13
|
+
const is$typed = _is$typed,
|
|
14
|
+
validate = _validate
|
|
15
|
+
const id = 'tools.ozone.report.refreshStats'
|
|
16
|
+
|
|
17
|
+
export type QueryParams = {}
|
|
18
|
+
|
|
19
|
+
export interface InputSchema {
|
|
20
|
+
/** Start date for recomputation, inclusive (YYYY-MM-DD). */
|
|
21
|
+
startDate: string
|
|
22
|
+
/** End date for recomputation, inclusive (YYYY-MM-DD). */
|
|
23
|
+
endDate: string
|
|
24
|
+
/** Optional list of queue IDs to recompute. Omit to recompute all groups. */
|
|
25
|
+
queueIds?: number[]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface OutputSchema {}
|
|
29
|
+
|
|
30
|
+
export interface HandlerInput {
|
|
31
|
+
encoding: 'application/json'
|
|
32
|
+
body: InputSchema
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface HandlerSuccess {
|
|
36
|
+
encoding: 'application/json'
|
|
37
|
+
body: OutputSchema
|
|
38
|
+
headers?: { [key: string]: string }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface HandlerError {
|
|
42
|
+
status: number
|
|
43
|
+
message?: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
import type * as ToolsOzoneReportDefs from './defs.js'
|
|
13
|
+
|
|
14
|
+
const is$typed = _is$typed,
|
|
15
|
+
validate = _validate
|
|
16
|
+
const id = 'tools.ozone.report.unassignModerator'
|
|
17
|
+
|
|
18
|
+
export type QueryParams = {}
|
|
19
|
+
|
|
20
|
+
export interface InputSchema {
|
|
21
|
+
/** The ID of the report to unassign. */
|
|
22
|
+
reportId: number
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type OutputSchema = ToolsOzoneReportDefs.AssignmentView
|
|
26
|
+
|
|
27
|
+
export interface HandlerInput {
|
|
28
|
+
encoding: 'application/json'
|
|
29
|
+
body: InputSchema
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface HandlerSuccess {
|
|
33
|
+
encoding: 'application/json'
|
|
34
|
+
body: OutputSchema
|
|
35
|
+
headers?: { [key: string]: string }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface HandlerError {
|
|
39
|
+
status: number
|
|
40
|
+
message?: string
|
|
41
|
+
error?: 'InvalidAssignment'
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Selectable } from 'kysely'
|
|
2
|
+
import { Database } from '../db'
|
|
3
|
+
import { ExpiringTag } from '../db/schema/expiring_tag'
|
|
4
|
+
|
|
5
|
+
export type ExpiringTagRow = Selectable<ExpiringTag>
|
|
6
|
+
|
|
7
|
+
export type ExpiringTagGroup = {
|
|
8
|
+
did: string
|
|
9
|
+
recordPath: string
|
|
10
|
+
createdBy: string
|
|
11
|
+
tags: string[]
|
|
12
|
+
ids: number[]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function insertExpiringTags(
|
|
16
|
+
db: Database,
|
|
17
|
+
params: {
|
|
18
|
+
eventId: number
|
|
19
|
+
did: string
|
|
20
|
+
recordPath: string
|
|
21
|
+
tags: string[]
|
|
22
|
+
expiresAt: string
|
|
23
|
+
createdBy: string
|
|
24
|
+
},
|
|
25
|
+
): Promise<void> {
|
|
26
|
+
await db.db
|
|
27
|
+
.insertInto('expiring_tag')
|
|
28
|
+
.values(
|
|
29
|
+
params.tags.map((tag) => ({
|
|
30
|
+
eventId: params.eventId,
|
|
31
|
+
did: params.did,
|
|
32
|
+
recordPath: params.recordPath,
|
|
33
|
+
tag,
|
|
34
|
+
expiresAt: params.expiresAt,
|
|
35
|
+
createdBy: params.createdBy,
|
|
36
|
+
})),
|
|
37
|
+
)
|
|
38
|
+
.execute()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function removeExpiringTags(
|
|
42
|
+
db: Database,
|
|
43
|
+
params: {
|
|
44
|
+
did: string
|
|
45
|
+
recordPath: string
|
|
46
|
+
tags: string[]
|
|
47
|
+
},
|
|
48
|
+
): Promise<void> {
|
|
49
|
+
await db.db
|
|
50
|
+
.deleteFrom('expiring_tag')
|
|
51
|
+
.where('did', '=', params.did)
|
|
52
|
+
.where('recordPath', '=', params.recordPath)
|
|
53
|
+
.where('tag', 'in', params.tags)
|
|
54
|
+
.execute()
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export async function deleteExpiringTagsByIds(
|
|
58
|
+
db: Database,
|
|
59
|
+
ids: number[],
|
|
60
|
+
): Promise<void> {
|
|
61
|
+
await db.db.deleteFrom('expiring_tag').where('id', 'in', ids).execute()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export async function getExpiredTags(
|
|
65
|
+
db: Database,
|
|
66
|
+
): Promise<ExpiringTagGroup[]> {
|
|
67
|
+
const now = new Date().toISOString()
|
|
68
|
+
const rows = await db.db
|
|
69
|
+
.selectFrom('expiring_tag')
|
|
70
|
+
.where('expiresAt', '<', now)
|
|
71
|
+
.selectAll()
|
|
72
|
+
.execute()
|
|
73
|
+
|
|
74
|
+
if (!rows.length) return []
|
|
75
|
+
|
|
76
|
+
// Group by (did, recordPath, createdBy) so each reversal event has the correct author
|
|
77
|
+
const grouped = new Map<string, ExpiringTagGroup>()
|
|
78
|
+
for (const row of rows) {
|
|
79
|
+
const key = `${row.did}|${row.recordPath}|${row.createdBy}`
|
|
80
|
+
let group = grouped.get(key)
|
|
81
|
+
if (!group) {
|
|
82
|
+
group = {
|
|
83
|
+
did: row.did,
|
|
84
|
+
recordPath: row.recordPath,
|
|
85
|
+
createdBy: row.createdBy,
|
|
86
|
+
tags: [],
|
|
87
|
+
ids: [],
|
|
88
|
+
}
|
|
89
|
+
grouped.set(key, group)
|
|
90
|
+
}
|
|
91
|
+
if (!group.tags.includes(row.tag)) {
|
|
92
|
+
group.tags.push(row.tag)
|
|
93
|
+
}
|
|
94
|
+
group.ids.push(row.id)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return [...grouped.values()]
|
|
98
|
+
}
|
package/src/mod-service/index.ts
CHANGED
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
import { QueryParams as QueryStatusParams } from '../lexicon/types/tools/ozone/moderation/queryStatuses'
|
|
47
47
|
import { httpLogger as log } from '../logger'
|
|
48
48
|
import { LABELER_HEADER_NAME, ParsedLabelers } from '../util'
|
|
49
|
+
import { insertExpiringTags, removeExpiringTags } from './expiring-tags'
|
|
49
50
|
import {
|
|
50
51
|
adjustModerationSubjectStatus,
|
|
51
52
|
getStatusIdentifierFromSubject,
|
|
@@ -61,6 +62,7 @@ import {
|
|
|
61
62
|
import {
|
|
62
63
|
ModEventType,
|
|
63
64
|
ModerationEventRow,
|
|
65
|
+
ModerationEventRowWithHandle,
|
|
64
66
|
ModerationSubjectStatusRow,
|
|
65
67
|
ModerationSubjectStatusRowWithHandle,
|
|
66
68
|
ReporterStats,
|
|
@@ -375,6 +377,29 @@ export class ModerationService {
|
|
|
375
377
|
return { cursor: keyset.packFromResult(result), events: resultWithHandles }
|
|
376
378
|
}
|
|
377
379
|
|
|
380
|
+
async getEventsByIds(ids: number[]): Promise<ModerationEventRowWithHandle[]> {
|
|
381
|
+
if (!ids.length) return []
|
|
382
|
+
|
|
383
|
+
const result = await this.db.db
|
|
384
|
+
.selectFrom('moderation_event')
|
|
385
|
+
.selectAll()
|
|
386
|
+
.where('id', 'in', ids)
|
|
387
|
+
.execute()
|
|
388
|
+
|
|
389
|
+
if (!result.length) return []
|
|
390
|
+
|
|
391
|
+
const infos = await this.views.getAccoutInfosByDid([
|
|
392
|
+
...result.map((row) => row.subjectDid),
|
|
393
|
+
...result.map((row) => row.createdBy),
|
|
394
|
+
])
|
|
395
|
+
|
|
396
|
+
return result.map((r) => ({
|
|
397
|
+
...r,
|
|
398
|
+
creatorHandle: infos.get(r.createdBy)?.handle,
|
|
399
|
+
subjectHandle: infos.get(r.subjectDid)?.handle,
|
|
400
|
+
}))
|
|
401
|
+
}
|
|
402
|
+
|
|
378
403
|
async getReport(id: number): Promise<ModerationEventRow | undefined> {
|
|
379
404
|
return await this.db.db
|
|
380
405
|
.selectFrom('moderation_event')
|
|
@@ -590,6 +615,13 @@ export class ModerationService {
|
|
|
590
615
|
if (isReportingMuted) {
|
|
591
616
|
meta.isReporterMuted = true
|
|
592
617
|
}
|
|
618
|
+
// Also capture whether the subject was muted at event-creation time, so
|
|
619
|
+
// the queue-router daemon can populate report.isMuted later without
|
|
620
|
+
// racing against subsequent mute/unmute changes.
|
|
621
|
+
const isSubjectMuted = await this.isSubjectMuted(subject.did)
|
|
622
|
+
if (isSubjectMuted) {
|
|
623
|
+
meta.isSubjectMuted = true
|
|
624
|
+
}
|
|
593
625
|
}
|
|
594
626
|
|
|
595
627
|
const subjectInfo = subject.info()
|
|
@@ -666,6 +698,31 @@ export class ModerationService {
|
|
|
666
698
|
subject.blobCids,
|
|
667
699
|
)
|
|
668
700
|
|
|
701
|
+
// Manage expiring tag rows for temporary tags
|
|
702
|
+
if (isModEventTag(event)) {
|
|
703
|
+
if (event.durationInHours && event.add.length > 0) {
|
|
704
|
+
const expiresAt = addHoursToDate(
|
|
705
|
+
event.durationInHours,
|
|
706
|
+
createdAt,
|
|
707
|
+
).toISOString()
|
|
708
|
+
await insertExpiringTags(this.db, {
|
|
709
|
+
eventId: modEvent.id,
|
|
710
|
+
did: subjectInfo.subjectDid,
|
|
711
|
+
recordPath: subjectInfo.subjectUri ?? '',
|
|
712
|
+
tags: event.add,
|
|
713
|
+
expiresAt,
|
|
714
|
+
createdBy,
|
|
715
|
+
})
|
|
716
|
+
}
|
|
717
|
+
if (event.remove.length > 0) {
|
|
718
|
+
await removeExpiringTags(this.db, {
|
|
719
|
+
did: subjectInfo.subjectDid,
|
|
720
|
+
recordPath: subjectInfo.subjectUri ?? '',
|
|
721
|
+
tags: event.remove,
|
|
722
|
+
})
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
669
726
|
if (isAgeAssurancePurgeEvent(event)) {
|
|
670
727
|
await this.purgeAgeAssuranceEvents(subjectInfo.subjectDid)
|
|
671
728
|
}
|
|
@@ -1009,7 +1066,7 @@ export class ModerationService {
|
|
|
1009
1066
|
modTool,
|
|
1010
1067
|
} = info
|
|
1011
1068
|
|
|
1012
|
-
|
|
1069
|
+
return await this.logEvent({
|
|
1013
1070
|
event: {
|
|
1014
1071
|
$type: 'tools.ozone.moderation.defs#modEventReport',
|
|
1015
1072
|
reportType: reasonType,
|
|
@@ -1020,8 +1077,6 @@ export class ModerationService {
|
|
|
1020
1077
|
createdAt,
|
|
1021
1078
|
modTool,
|
|
1022
1079
|
})
|
|
1023
|
-
|
|
1024
|
-
return result
|
|
1025
1080
|
}
|
|
1026
1081
|
|
|
1027
1082
|
async getSubjectStatuses({
|
|
@@ -1399,6 +1454,19 @@ export class ModerationService {
|
|
|
1399
1454
|
return !!result
|
|
1400
1455
|
}
|
|
1401
1456
|
|
|
1457
|
+
// Check if a subject (the account being reported) has an active mute
|
|
1458
|
+
async isSubjectMuted(did: string) {
|
|
1459
|
+
const result = await this.db.db
|
|
1460
|
+
.selectFrom('moderation_subject_status')
|
|
1461
|
+
.where('did', '=', did)
|
|
1462
|
+
.where('recordPath', '=', '')
|
|
1463
|
+
.where('muteUntil', '>', new Date().toISOString())
|
|
1464
|
+
.select(sql`true`.as('status'))
|
|
1465
|
+
.executeTakeFirst()
|
|
1466
|
+
|
|
1467
|
+
return !!result
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1402
1470
|
async formatAndCreateLabels(
|
|
1403
1471
|
uri: string,
|
|
1404
1472
|
cid: string | null,
|