@atproto/ozone 0.1.173 → 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.
Files changed (411) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/api/index.d.ts.map +1 -1
  3. package/dist/api/index.js +40 -0
  4. package/dist/api/index.js.map +1 -1
  5. package/dist/api/moderation/emitEvent.d.ts.map +1 -1
  6. package/dist/api/moderation/emitEvent.js +31 -0
  7. package/dist/api/moderation/emitEvent.js.map +1 -1
  8. package/dist/api/queue/assignModerator.d.ts +4 -0
  9. package/dist/api/queue/assignModerator.d.ts.map +1 -0
  10. package/dist/api/queue/assignModerator.js +28 -0
  11. package/dist/api/queue/assignModerator.js.map +1 -0
  12. package/dist/api/queue/createQueue.d.ts +4 -0
  13. package/dist/api/queue/createQueue.d.ts.map +1 -0
  14. package/dist/api/queue/createQueue.js +44 -0
  15. package/dist/api/queue/createQueue.js.map +1 -0
  16. package/dist/api/queue/deleteQueue.d.ts +4 -0
  17. package/dist/api/queue/deleteQueue.d.ts.map +1 -0
  18. package/dist/api/queue/deleteQueue.js +40 -0
  19. package/dist/api/queue/deleteQueue.js.map +1 -0
  20. package/dist/api/queue/getAssignments.d.ts +4 -0
  21. package/dist/api/queue/getAssignments.d.ts.map +1 -0
  22. package/dist/api/queue/getAssignments.js +19 -0
  23. package/dist/api/queue/getAssignments.js.map +1 -0
  24. package/dist/api/queue/listQueues.d.ts +4 -0
  25. package/dist/api/queue/listQueues.d.ts.map +1 -0
  26. package/dist/api/queue/listQueues.js +29 -0
  27. package/dist/api/queue/listQueues.js.map +1 -0
  28. package/dist/api/queue/routeReports.d.ts +4 -0
  29. package/dist/api/queue/routeReports.d.ts.map +1 -0
  30. package/dist/api/queue/routeReports.js +33 -0
  31. package/dist/api/queue/routeReports.js.map +1 -0
  32. package/dist/api/queue/unassignModerator.d.ts +4 -0
  33. package/dist/api/queue/unassignModerator.d.ts.map +1 -0
  34. package/dist/api/queue/unassignModerator.js +24 -0
  35. package/dist/api/queue/unassignModerator.js.map +1 -0
  36. package/dist/api/queue/updateQueue.d.ts +4 -0
  37. package/dist/api/queue/updateQueue.d.ts.map +1 -0
  38. package/dist/api/queue/updateQueue.js +39 -0
  39. package/dist/api/queue/updateQueue.js.map +1 -0
  40. package/dist/api/report/assignModerator.d.ts +4 -0
  41. package/dist/api/report/assignModerator.d.ts.map +1 -0
  42. package/dist/api/report/assignModerator.js +33 -0
  43. package/dist/api/report/assignModerator.js.map +1 -0
  44. package/dist/api/report/createActivity.d.ts +4 -0
  45. package/dist/api/report/createActivity.d.ts.map +1 -0
  46. package/dist/api/report/createActivity.js +44 -0
  47. package/dist/api/report/createActivity.js.map +1 -0
  48. package/dist/api/report/getAssignments.d.ts +4 -0
  49. package/dist/api/report/getAssignments.d.ts.map +1 -0
  50. package/dist/api/report/getAssignments.js +19 -0
  51. package/dist/api/report/getAssignments.js.map +1 -0
  52. package/dist/api/report/getHistoricalStats.d.ts +4 -0
  53. package/dist/api/report/getHistoricalStats.d.ts.map +1 -0
  54. package/dist/api/report/getHistoricalStats.js +32 -0
  55. package/dist/api/report/getHistoricalStats.js.map +1 -0
  56. package/dist/api/report/getLatestReport.d.ts +4 -0
  57. package/dist/api/report/getLatestReport.d.ts.map +1 -0
  58. package/dist/api/report/getLatestReport.js +31 -0
  59. package/dist/api/report/getLatestReport.js.map +1 -0
  60. package/dist/api/report/getLiveStats.d.ts +4 -0
  61. package/dist/api/report/getLiveStats.d.ts.map +1 -0
  62. package/dist/api/report/getLiveStats.js +25 -0
  63. package/dist/api/report/getLiveStats.js.map +1 -0
  64. package/dist/api/report/getReport.d.ts +4 -0
  65. package/dist/api/report/getReport.d.ts.map +1 -0
  66. package/dist/api/report/getReport.js +35 -0
  67. package/dist/api/report/getReport.js.map +1 -0
  68. package/dist/api/report/listActivities.d.ts +4 -0
  69. package/dist/api/report/listActivities.d.ts.map +1 -0
  70. package/dist/api/report/listActivities.js +25 -0
  71. package/dist/api/report/listActivities.js.map +1 -0
  72. package/dist/api/report/queryReports.d.ts +4 -0
  73. package/dist/api/report/queryReports.d.ts.map +1 -0
  74. package/dist/api/report/queryReports.js +29 -0
  75. package/dist/api/report/queryReports.js.map +1 -0
  76. package/dist/api/report/reassignQueue.d.ts +4 -0
  77. package/dist/api/report/reassignQueue.d.ts.map +1 -0
  78. package/dist/api/report/reassignQueue.js +45 -0
  79. package/dist/api/report/reassignQueue.js.map +1 -0
  80. package/dist/api/report/refreshStats.d.ts +4 -0
  81. package/dist/api/report/refreshStats.d.ts.map +1 -0
  82. package/dist/api/report/refreshStats.js +26 -0
  83. package/dist/api/report/refreshStats.js.map +1 -0
  84. package/dist/api/report/unassignModerator.d.ts +4 -0
  85. package/dist/api/report/unassignModerator.d.ts.map +1 -0
  86. package/dist/api/report/unassignModerator.js +21 -0
  87. package/dist/api/report/unassignModerator.js.map +1 -0
  88. package/dist/api/util.d.ts +2 -0
  89. package/dist/api/util.d.ts.map +1 -1
  90. package/dist/api/util.js +9 -1
  91. package/dist/api/util.js.map +1 -1
  92. package/dist/assignment/index.d.ts +89 -0
  93. package/dist/assignment/index.d.ts.map +1 -0
  94. package/dist/assignment/index.js +537 -0
  95. package/dist/assignment/index.js.map +1 -0
  96. package/dist/config/config.d.ts +14 -0
  97. package/dist/config/config.d.ts.map +1 -1
  98. package/dist/config/config.js +9 -0
  99. package/dist/config/config.js.map +1 -1
  100. package/dist/config/env.d.ts +3 -0
  101. package/dist/config/env.d.ts.map +1 -1
  102. package/dist/config/env.js +3 -0
  103. package/dist/config/env.js.map +1 -1
  104. package/dist/context.d.ts +9 -0
  105. package/dist/context.d.ts.map +1 -1
  106. package/dist/context.js +31 -10
  107. package/dist/context.js.map +1 -1
  108. package/dist/daemon/context.d.ts +6 -0
  109. package/dist/daemon/context.d.ts.map +1 -1
  110. package/dist/daemon/context.js +28 -4
  111. package/dist/daemon/context.js.map +1 -1
  112. package/dist/daemon/job-cursor.d.ts +5 -0
  113. package/dist/daemon/job-cursor.d.ts.map +1 -0
  114. package/dist/daemon/job-cursor.js +28 -0
  115. package/dist/daemon/job-cursor.js.map +1 -0
  116. package/dist/daemon/queue-router.d.ts +17 -0
  117. package/dist/daemon/queue-router.d.ts.map +1 -0
  118. package/dist/daemon/queue-router.js +114 -0
  119. package/dist/daemon/queue-router.js.map +1 -0
  120. package/dist/daemon/stats-computer.d.ts +51 -0
  121. package/dist/daemon/stats-computer.d.ts.map +1 -0
  122. package/dist/daemon/stats-computer.js +117 -0
  123. package/dist/daemon/stats-computer.js.map +1 -0
  124. package/dist/daemon/strike-expiry-processor.d.ts.map +1 -1
  125. package/dist/daemon/strike-expiry-processor.js +4 -19
  126. package/dist/daemon/strike-expiry-processor.js.map +1 -1
  127. package/dist/db/migrations/20260219T164523000Z-create-report-table.d.ts +4 -0
  128. package/dist/db/migrations/20260219T164523000Z-create-report-table.d.ts.map +1 -0
  129. package/dist/db/migrations/20260219T164523000Z-create-report-table.js +126 -0
  130. package/dist/db/migrations/20260219T164523000Z-create-report-table.js.map +1 -0
  131. package/dist/db/migrations/20260219T165302248Z-moderator-assignment.d.ts +4 -0
  132. package/dist/db/migrations/20260219T165302248Z-moderator-assignment.d.ts.map +1 -0
  133. package/dist/db/migrations/20260219T165302248Z-moderator-assignment.js +35 -0
  134. package/dist/db/migrations/20260219T165302248Z-moderator-assignment.js.map +1 -0
  135. package/dist/db/migrations/20260225T000000000Z-add-report-queue-table.d.ts +4 -0
  136. package/dist/db/migrations/20260225T000000000Z-add-report-queue-table.d.ts.map +1 -0
  137. package/dist/db/migrations/20260225T000000000Z-add-report-queue-table.js +36 -0
  138. package/dist/db/migrations/20260225T000000000Z-add-report-queue-table.js.map +1 -0
  139. package/dist/db/migrations/20260313T000000000Z-add-report-activity-table.d.ts +4 -0
  140. package/dist/db/migrations/20260313T000000000Z-add-report-activity-table.d.ts.map +1 -0
  141. package/dist/db/migrations/20260313T000000000Z-add-report-activity-table.js +39 -0
  142. package/dist/db/migrations/20260313T000000000Z-add-report-activity-table.js.map +1 -0
  143. package/dist/db/migrations/20260318T152058935Z-add-report-stat.d.ts +4 -0
  144. package/dist/db/migrations/20260318T152058935Z-add-report-stat.d.ts.map +1 -0
  145. package/dist/db/migrations/20260318T152058935Z-add-report-stat.js +34 -0
  146. package/dist/db/migrations/20260318T152058935Z-add-report-stat.js.map +1 -0
  147. package/dist/db/migrations/index.d.ts +5 -0
  148. package/dist/db/migrations/index.d.ts.map +1 -1
  149. package/dist/db/migrations/index.js +6 -1
  150. package/dist/db/migrations/index.js.map +1 -1
  151. package/dist/db/pagination.d.ts +31 -0
  152. package/dist/db/pagination.d.ts.map +1 -1
  153. package/dist/db/pagination.js +74 -1
  154. package/dist/db/pagination.js.map +1 -1
  155. package/dist/db/schema/index.d.ts +6 -1
  156. package/dist/db/schema/index.d.ts.map +1 -1
  157. package/dist/db/schema/index.js.map +1 -1
  158. package/dist/db/schema/moderator_assignment.d.ts +14 -0
  159. package/dist/db/schema/moderator_assignment.d.ts.map +1 -0
  160. package/dist/db/schema/moderator_assignment.js +5 -0
  161. package/dist/db/schema/moderator_assignment.js.map +1 -0
  162. package/dist/db/schema/report.d.ts +25 -0
  163. package/dist/db/schema/report.d.ts.map +1 -0
  164. package/dist/db/schema/report.js +5 -0
  165. package/dist/db/schema/report.js.map +1 -0
  166. package/dist/db/schema/report_activity.d.ts +18 -0
  167. package/dist/db/schema/report_activity.d.ts.map +1 -0
  168. package/dist/db/schema/report_activity.js +5 -0
  169. package/dist/db/schema/report_activity.js.map +1 -0
  170. package/dist/db/schema/report_queue.d.ts +19 -0
  171. package/dist/db/schema/report_queue.d.ts.map +1 -0
  172. package/dist/db/schema/report_queue.js +5 -0
  173. package/dist/db/schema/report_queue.js.map +1 -0
  174. package/dist/db/schema/report_stat.d.ts +20 -0
  175. package/dist/db/schema/report_stat.d.ts.map +1 -0
  176. package/dist/db/schema/report_stat.js +5 -0
  177. package/dist/db/schema/report_stat.js.map +1 -0
  178. package/dist/lexicon/index.d.ts +50 -0
  179. package/dist/lexicon/index.d.ts.map +1 -1
  180. package/dist/lexicon/index.js +120 -2
  181. package/dist/lexicon/index.js.map +1 -1
  182. package/dist/lexicon/lexicons.d.ts +10535 -7389
  183. package/dist/lexicon/lexicons.d.ts.map +1 -1
  184. package/dist/lexicon/lexicons.js +1789 -122
  185. package/dist/lexicon/lexicons.js.map +1 -1
  186. package/dist/lexicon/types/app/bsky/embed/external.d.ts +2 -0
  187. package/dist/lexicon/types/app/bsky/embed/external.d.ts.map +1 -1
  188. package/dist/lexicon/types/app/bsky/embed/external.js.map +1 -1
  189. package/dist/lexicon/types/tools/ozone/moderation/emitEvent.d.ts +19 -0
  190. package/dist/lexicon/types/tools/ozone/moderation/emitEvent.d.ts.map +1 -1
  191. package/dist/lexicon/types/tools/ozone/moderation/emitEvent.js +9 -0
  192. package/dist/lexicon/types/tools/ozone/moderation/emitEvent.js.map +1 -1
  193. package/dist/lexicon/types/tools/ozone/queue/assignModerator.d.ts +27 -0
  194. package/dist/lexicon/types/tools/ozone/queue/assignModerator.d.ts.map +1 -0
  195. package/dist/lexicon/types/tools/ozone/queue/assignModerator.js +7 -0
  196. package/dist/lexicon/types/tools/ozone/queue/assignModerator.js.map +1 -0
  197. package/dist/lexicon/types/tools/ozone/queue/createQueue.d.ts +35 -0
  198. package/dist/lexicon/types/tools/ozone/queue/createQueue.d.ts.map +1 -0
  199. package/dist/lexicon/types/tools/ozone/queue/createQueue.js +7 -0
  200. package/dist/lexicon/types/tools/ozone/queue/createQueue.js.map +1 -0
  201. package/dist/lexicon/types/tools/ozone/queue/defs.d.ts +62 -0
  202. package/dist/lexicon/types/tools/ozone/queue/defs.d.ts.map +1 -0
  203. package/dist/lexicon/types/tools/ozone/queue/defs.js +34 -0
  204. package/dist/lexicon/types/tools/ozone/queue/defs.js.map +1 -0
  205. package/dist/lexicon/types/tools/ozone/queue/deleteQueue.d.ts +29 -0
  206. package/dist/lexicon/types/tools/ozone/queue/deleteQueue.d.ts.map +1 -0
  207. package/dist/lexicon/types/tools/ozone/queue/deleteQueue.js +7 -0
  208. package/dist/lexicon/types/tools/ozone/queue/deleteQueue.js.map +1 -0
  209. package/dist/lexicon/types/tools/ozone/queue/getAssignments.d.ts +30 -0
  210. package/dist/lexicon/types/tools/ozone/queue/getAssignments.d.ts.map +1 -0
  211. package/dist/lexicon/types/tools/ozone/queue/getAssignments.js +7 -0
  212. package/dist/lexicon/types/tools/ozone/queue/getAssignments.js.map +1 -0
  213. package/dist/lexicon/types/tools/ozone/queue/listQueues.d.ts +32 -0
  214. package/dist/lexicon/types/tools/ozone/queue/listQueues.d.ts.map +1 -0
  215. package/dist/lexicon/types/tools/ozone/queue/listQueues.js +7 -0
  216. package/dist/lexicon/types/tools/ozone/queue/listQueues.js.map +1 -0
  217. package/dist/lexicon/types/tools/ozone/queue/routeReports.d.ts +31 -0
  218. package/dist/lexicon/types/tools/ozone/queue/routeReports.d.ts.map +1 -0
  219. package/dist/lexicon/types/tools/ozone/queue/routeReports.js +7 -0
  220. package/dist/lexicon/types/tools/ozone/queue/routeReports.js.map +1 -0
  221. package/dist/lexicon/types/tools/ozone/queue/unassignModerator.d.ts +18 -0
  222. package/dist/lexicon/types/tools/ozone/queue/unassignModerator.d.ts.map +1 -0
  223. package/dist/lexicon/types/tools/ozone/queue/unassignModerator.js +7 -0
  224. package/dist/lexicon/types/tools/ozone/queue/unassignModerator.js.map +1 -0
  225. package/dist/lexicon/types/tools/ozone/queue/updateQueue.d.ts +32 -0
  226. package/dist/lexicon/types/tools/ozone/queue/updateQueue.d.ts.map +1 -0
  227. package/dist/lexicon/types/tools/ozone/queue/updateQueue.js +7 -0
  228. package/dist/lexicon/types/tools/ozone/queue/updateQueue.js.map +1 -0
  229. package/dist/lexicon/types/tools/ozone/report/assignModerator.d.ts +31 -0
  230. package/dist/lexicon/types/tools/ozone/report/assignModerator.d.ts.map +1 -0
  231. package/dist/lexicon/types/tools/ozone/report/assignModerator.js +7 -0
  232. package/dist/lexicon/types/tools/ozone/report/assignModerator.js.map +1 -0
  233. package/dist/lexicon/types/tools/ozone/report/createActivity.d.ts +37 -0
  234. package/dist/lexicon/types/tools/ozone/report/createActivity.d.ts.map +1 -0
  235. package/dist/lexicon/types/tools/ozone/report/createActivity.js +7 -0
  236. package/dist/lexicon/types/tools/ozone/report/createActivity.js.map +1 -0
  237. package/dist/lexicon/types/tools/ozone/report/defs.d.ts +185 -0
  238. package/dist/lexicon/types/tools/ozone/report/defs.d.ts.map +1 -1
  239. package/dist/lexicon/types/tools/ozone/report/defs.js +108 -0
  240. package/dist/lexicon/types/tools/ozone/report/defs.js.map +1 -1
  241. package/dist/lexicon/types/tools/ozone/report/getAssignments.d.ts +30 -0
  242. package/dist/lexicon/types/tools/ozone/report/getAssignments.d.ts.map +1 -0
  243. package/dist/lexicon/types/tools/ozone/report/getAssignments.js +7 -0
  244. package/dist/lexicon/types/tools/ozone/report/getAssignments.js.map +1 -0
  245. package/dist/lexicon/types/tools/ozone/report/getHistoricalStats.d.ts +36 -0
  246. package/dist/lexicon/types/tools/ozone/report/getHistoricalStats.d.ts.map +1 -0
  247. package/dist/lexicon/types/tools/ozone/report/getHistoricalStats.js +7 -0
  248. package/dist/lexicon/types/tools/ozone/report/getHistoricalStats.js.map +1 -0
  249. package/dist/lexicon/types/tools/ozone/report/getLatestReport.d.ts +21 -0
  250. package/dist/lexicon/types/tools/ozone/report/getLatestReport.d.ts.map +1 -0
  251. package/dist/lexicon/types/tools/ozone/report/getLatestReport.js +7 -0
  252. package/dist/lexicon/types/tools/ozone/report/getLatestReport.js.map +1 -0
  253. package/dist/lexicon/types/tools/ozone/report/getLiveStats.d.ts +27 -0
  254. package/dist/lexicon/types/tools/ozone/report/getLiveStats.d.ts.map +1 -0
  255. package/dist/lexicon/types/tools/ozone/report/getLiveStats.js +7 -0
  256. package/dist/lexicon/types/tools/ozone/report/getLiveStats.js.map +1 -0
  257. package/dist/lexicon/types/tools/ozone/report/getReport.d.ts +22 -0
  258. package/dist/lexicon/types/tools/ozone/report/getReport.d.ts.map +1 -0
  259. package/dist/lexicon/types/tools/ozone/report/getReport.js +7 -0
  260. package/dist/lexicon/types/tools/ozone/report/getReport.js.map +1 -0
  261. package/dist/lexicon/types/tools/ozone/report/listActivities.d.ts +26 -0
  262. package/dist/lexicon/types/tools/ozone/report/listActivities.d.ts.map +1 -0
  263. package/dist/lexicon/types/tools/ozone/report/listActivities.js +7 -0
  264. package/dist/lexicon/types/tools/ozone/report/listActivities.js.map +1 -0
  265. package/dist/lexicon/types/tools/ozone/report/queryReports.d.ts +48 -0
  266. package/dist/lexicon/types/tools/ozone/report/queryReports.d.ts.map +1 -0
  267. package/dist/lexicon/types/tools/ozone/report/queryReports.js +7 -0
  268. package/dist/lexicon/types/tools/ozone/report/queryReports.js.map +1 -0
  269. package/dist/lexicon/types/tools/ozone/report/reassignQueue.d.ts +31 -0
  270. package/dist/lexicon/types/tools/ozone/report/reassignQueue.d.ts.map +1 -0
  271. package/dist/lexicon/types/tools/ozone/report/reassignQueue.js +7 -0
  272. package/dist/lexicon/types/tools/ozone/report/reassignQueue.js.map +1 -0
  273. package/dist/lexicon/types/tools/ozone/report/refreshStats.d.ts +28 -0
  274. package/dist/lexicon/types/tools/ozone/report/refreshStats.d.ts.map +1 -0
  275. package/dist/lexicon/types/tools/ozone/report/refreshStats.js +7 -0
  276. package/dist/lexicon/types/tools/ozone/report/refreshStats.js.map +1 -0
  277. package/dist/lexicon/types/tools/ozone/report/unassignModerator.d.ts +25 -0
  278. package/dist/lexicon/types/tools/ozone/report/unassignModerator.d.ts.map +1 -0
  279. package/dist/lexicon/types/tools/ozone/report/unassignModerator.js +7 -0
  280. package/dist/lexicon/types/tools/ozone/report/unassignModerator.js.map +1 -0
  281. package/dist/mod-service/index.d.ts +3 -1
  282. package/dist/mod-service/index.d.ts.map +1 -1
  283. package/dist/mod-service/index.js +39 -2
  284. package/dist/mod-service/index.js.map +1 -1
  285. package/dist/mod-service/report.d.ts +64 -0
  286. package/dist/mod-service/report.d.ts.map +1 -0
  287. package/dist/mod-service/report.js +282 -0
  288. package/dist/mod-service/report.js.map +1 -0
  289. package/dist/mod-service/status.d.ts +20 -0
  290. package/dist/mod-service/status.d.ts.map +1 -1
  291. package/dist/queue/service.d.ts +86 -0
  292. package/dist/queue/service.d.ts.map +1 -0
  293. package/dist/queue/service.js +430 -0
  294. package/dist/queue/service.js.map +1 -0
  295. package/dist/report/activity.d.ts +77 -0
  296. package/dist/report/activity.d.ts.map +1 -0
  297. package/dist/report/activity.js +141 -0
  298. package/dist/report/activity.js.map +1 -0
  299. package/dist/report/handle-report-update.d.ts +47 -0
  300. package/dist/report/handle-report-update.d.ts.map +1 -0
  301. package/dist/report/handle-report-update.js +178 -0
  302. package/dist/report/handle-report-update.js.map +1 -0
  303. package/dist/report/reassign.d.ts +10 -0
  304. package/dist/report/reassign.d.ts.map +1 -0
  305. package/dist/report/reassign.js +75 -0
  306. package/dist/report/reassign.js.map +1 -0
  307. package/dist/report/stats.d.ts +105 -0
  308. package/dist/report/stats.d.ts.map +1 -0
  309. package/dist/report/stats.js +619 -0
  310. package/dist/report/stats.js.map +1 -0
  311. package/dist/report/views.d.ts +111 -0
  312. package/dist/report/views.d.ts.map +1 -0
  313. package/dist/report/views.js +156 -0
  314. package/dist/report/views.js.map +1 -0
  315. package/dist/team/index.d.ts +1 -0
  316. package/dist/team/index.d.ts.map +1 -1
  317. package/dist/team/index.js +11 -0
  318. package/dist/team/index.js.map +1 -1
  319. package/package.json +3 -3
  320. package/src/api/index.ts +40 -0
  321. package/src/api/moderation/emitEvent.ts +38 -0
  322. package/src/api/queue/assignModerator.ts +31 -0
  323. package/src/api/queue/createQueue.ts +62 -0
  324. package/src/api/queue/deleteQueue.ts +56 -0
  325. package/src/api/queue/getAssignments.ts +19 -0
  326. package/src/api/queue/listQueues.ts +39 -0
  327. package/src/api/queue/routeReports.ts +44 -0
  328. package/src/api/queue/unassignModerator.ts +26 -0
  329. package/src/api/queue/updateQueue.ts +54 -0
  330. package/src/api/report/assignModerator.ts +36 -0
  331. package/src/api/report/createActivity.ts +57 -0
  332. package/src/api/report/getAssignments.ts +20 -0
  333. package/src/api/report/getHistoricalStats.ts +41 -0
  334. package/src/api/report/getLatestReport.ts +44 -0
  335. package/src/api/report/getLiveStats.ts +26 -0
  336. package/src/api/report/getReport.ts +55 -0
  337. package/src/api/report/listActivities.ts +34 -0
  338. package/src/api/report/queryReports.ts +44 -0
  339. package/src/api/report/reassignQueue.ts +68 -0
  340. package/src/api/report/refreshStats.ts +27 -0
  341. package/src/api/report/unassignModerator.ts +21 -0
  342. package/src/api/util.ts +12 -0
  343. package/src/assignment/index.ts +731 -0
  344. package/src/config/config.ts +27 -0
  345. package/src/config/env.ts +8 -0
  346. package/src/context.ts +31 -0
  347. package/src/daemon/context.ts +34 -0
  348. package/src/daemon/job-cursor.ts +33 -0
  349. package/src/daemon/queue-router.ts +101 -0
  350. package/src/daemon/stats-computer.ts +101 -0
  351. package/src/daemon/strike-expiry-processor.ts +4 -20
  352. package/src/db/migrations/20260219T164523000Z-create-report-table.ts +155 -0
  353. package/src/db/migrations/20260219T165302248Z-moderator-assignment.ts +42 -0
  354. package/src/db/migrations/20260225T000000000Z-add-report-queue-table.ts +41 -0
  355. package/src/db/migrations/20260313T000000000Z-add-report-activity-table.ts +48 -0
  356. package/src/db/migrations/20260318T152058935Z-add-report-stat.ts +35 -0
  357. package/src/db/migrations/index.ts +5 -0
  358. package/src/db/pagination.ts +85 -0
  359. package/src/db/schema/index.ts +10 -0
  360. package/src/db/schema/moderator_assignment.ts +16 -0
  361. package/src/db/schema/report.ts +27 -0
  362. package/src/db/schema/report_activity.ts +22 -0
  363. package/src/db/schema/report_queue.ts +21 -0
  364. package/src/db/schema/report_stat.ts +27 -0
  365. package/src/lexicon/index.ts +280 -0
  366. package/src/lexicon/lexicons.ts +1910 -160
  367. package/src/lexicon/types/app/bsky/embed/external.ts +2 -0
  368. package/src/lexicon/types/tools/ozone/moderation/emitEvent.ts +24 -0
  369. package/src/lexicon/types/tools/ozone/queue/assignModerator.ts +46 -0
  370. package/src/lexicon/types/tools/ozone/queue/createQueue.ts +54 -0
  371. package/src/lexicon/types/tools/ozone/queue/defs.ts +99 -0
  372. package/src/lexicon/types/tools/ozone/queue/deleteQueue.ts +48 -0
  373. package/src/lexicon/types/tools/ozone/queue/getAssignments.ts +48 -0
  374. package/src/lexicon/types/tools/ozone/queue/listQueues.ts +50 -0
  375. package/src/lexicon/types/tools/ozone/queue/routeReports.ts +50 -0
  376. package/src/lexicon/types/tools/ozone/queue/unassignModerator.ts +37 -0
  377. package/src/lexicon/types/tools/ozone/queue/updateQueue.ts +51 -0
  378. package/src/lexicon/types/tools/ozone/report/assignModerator.ts +50 -0
  379. package/src/lexicon/types/tools/ozone/report/createActivity.ts +60 -0
  380. package/src/lexicon/types/tools/ozone/report/defs.ts +327 -0
  381. package/src/lexicon/types/tools/ozone/report/getAssignments.ts +48 -0
  382. package/src/lexicon/types/tools/ozone/report/getHistoricalStats.ts +54 -0
  383. package/src/lexicon/types/tools/ozone/report/getLatestReport.ts +39 -0
  384. package/src/lexicon/types/tools/ozone/report/getLiveStats.ts +45 -0
  385. package/src/lexicon/types/tools/ozone/report/getReport.ts +38 -0
  386. package/src/lexicon/types/tools/ozone/report/listActivities.ts +44 -0
  387. package/src/lexicon/types/tools/ozone/report/queryReports.ts +72 -0
  388. package/src/lexicon/types/tools/ozone/report/reassignQueue.ts +55 -0
  389. package/src/lexicon/types/tools/ozone/report/refreshStats.ts +46 -0
  390. package/src/lexicon/types/tools/ozone/report/unassignModerator.ts +44 -0
  391. package/src/mod-service/index.ts +45 -3
  392. package/src/mod-service/report.ts +408 -0
  393. package/src/queue/service.ts +599 -0
  394. package/src/report/activity.ts +234 -0
  395. package/src/report/handle-report-update.ts +209 -0
  396. package/src/report/reassign.ts +109 -0
  397. package/src/report/stats.ts +850 -0
  398. package/src/report/views.ts +241 -0
  399. package/src/team/index.ts +11 -0
  400. package/tests/get-report.test.ts +136 -0
  401. package/tests/query-reports.test.ts +608 -0
  402. package/tests/queue-assignment.test.ts +428 -0
  403. package/tests/queue-router.test.ts +306 -0
  404. package/tests/queues.test.ts +690 -0
  405. package/tests/report-action.test.ts +308 -0
  406. package/tests/report-activity.test.ts +567 -0
  407. package/tests/report-assignment.test.ts +517 -0
  408. package/tests/report-reassign-queue.test.ts +340 -0
  409. package/tests/report-routing.test.ts +245 -0
  410. package/tests/report-stats.test.ts +545 -0
  411. package/tsconfig.build.tsbuildinfo +1 -1
@@ -9,6 +9,10 @@ import {
9
9
  is$typed as _is$typed,
10
10
  type OmitKey,
11
11
  } from '../../../../util'
12
+ import type * as ToolsOzoneTeamDefs from '../team/defs.js'
13
+ import type * as ToolsOzoneModerationDefs from '../moderation/defs.js'
14
+ import type * as ComAtprotoModerationDefs from '../../../com/atproto/moderation/defs.js'
15
+ import type * as ToolsOzoneQueueDefs from '../queue/defs.js'
12
16
 
13
17
  const is$typed = _is$typed,
14
18
  validate = _validate
@@ -137,3 +141,326 @@ export const REASONSELFHARMSTUNTS = `${id}#reasonSelfHarmStunts`
137
141
  export const REASONSELFHARMSUBSTANCES = `${id}#reasonSelfHarmSubstances`
138
142
  /** Other dangerous content */
139
143
  export const REASONSELFHARMOTHER = `${id}#reasonSelfHarmOther`
144
+
145
+ /** Information about the moderator currently assigned to a report. */
146
+ export interface ReportAssignment {
147
+ $type?: 'tools.ozone.report.defs#reportAssignment'
148
+ /** DID of the assigned moderator */
149
+ did: string
150
+ moderator?: ToolsOzoneTeamDefs.Member
151
+ /** When the report was assigned */
152
+ assignedAt: string
153
+ }
154
+
155
+ const hashReportAssignment = 'reportAssignment'
156
+
157
+ export function isReportAssignment<V>(v: V) {
158
+ return is$typed(v, id, hashReportAssignment)
159
+ }
160
+
161
+ export function validateReportAssignment<V>(v: V) {
162
+ return validate<ReportAssignment & V>(v, id, hashReportAssignment)
163
+ }
164
+
165
+ export interface ReportView {
166
+ $type?: 'tools.ozone.report.defs#reportView'
167
+ /** Report ID */
168
+ id: number
169
+ /** ID of the moderation event that created this report */
170
+ eventId: number
171
+ /** Current status of the report */
172
+ status:
173
+ | 'open'
174
+ | 'closed'
175
+ | 'escalated'
176
+ | 'queued'
177
+ | 'assigned'
178
+ | (string & {})
179
+ subject: ToolsOzoneModerationDefs.SubjectView
180
+ reportType: ComAtprotoModerationDefs.ReasonType
181
+ /** DID of the user who made the report */
182
+ reportedBy: string
183
+ reporter: ToolsOzoneModerationDefs.SubjectView
184
+ /** Comment provided by the reporter */
185
+ comment?: string
186
+ /** When the report was created */
187
+ createdAt: string
188
+ /** When the report was last updated */
189
+ updatedAt?: string
190
+ /** When the report was assigned to its current queue */
191
+ queuedAt?: string
192
+ /** Array of moderation event IDs representing actions taken on this report (sorted DESC, most recent first) */
193
+ actionEventIds?: number[]
194
+ /** Optional: expanded action events */
195
+ actions?: ToolsOzoneModerationDefs.ModEventView[]
196
+ /** Note sent to reporter when report was actioned */
197
+ actionNote?: string
198
+ subjectStatus?: ToolsOzoneModerationDefs.SubjectStatusView
199
+ /** Number of other pending reports on the same subject */
200
+ relatedReportCount?: number
201
+ assignment?: ReportAssignment
202
+ queue?: ToolsOzoneQueueDefs.QueueView
203
+ /** 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. */
204
+ isMuted?: boolean
205
+ }
206
+
207
+ const hashReportView = 'reportView'
208
+
209
+ export function isReportView<V>(v: V) {
210
+ return is$typed(v, id, hashReportView)
211
+ }
212
+
213
+ export function validateReportView<V>(v: V) {
214
+ return validate<ReportView & V>(v, id, hashReportView)
215
+ }
216
+
217
+ /** Activity recording a report being routed to a queue. */
218
+ export interface QueueActivity {
219
+ $type?: 'tools.ozone.report.defs#queueActivity'
220
+ /** The report's status before this activity. Populated automatically from the report row; not required in input. */
221
+ previousStatus?:
222
+ | 'open'
223
+ | 'closed'
224
+ | 'escalated'
225
+ | 'queued'
226
+ | 'assigned'
227
+ | (string & {})
228
+ }
229
+
230
+ const hashQueueActivity = 'queueActivity'
231
+
232
+ export function isQueueActivity<V>(v: V) {
233
+ return is$typed(v, id, hashQueueActivity)
234
+ }
235
+
236
+ export function validateQueueActivity<V>(v: V) {
237
+ return validate<QueueActivity & V>(v, id, hashQueueActivity)
238
+ }
239
+
240
+ /** Activity recording a moderator being assigned to a report. */
241
+ export interface AssignmentActivity {
242
+ $type?: 'tools.ozone.report.defs#assignmentActivity'
243
+ /** The report's status before this activity. Populated automatically from the report row; not required in input. */
244
+ previousStatus?:
245
+ | 'open'
246
+ | 'closed'
247
+ | 'escalated'
248
+ | 'queued'
249
+ | 'assigned'
250
+ | (string & {})
251
+ }
252
+
253
+ const hashAssignmentActivity = 'assignmentActivity'
254
+
255
+ export function isAssignmentActivity<V>(v: V) {
256
+ return is$typed(v, id, hashAssignmentActivity)
257
+ }
258
+
259
+ export function validateAssignmentActivity<V>(v: V) {
260
+ return validate<AssignmentActivity & V>(v, id, hashAssignmentActivity)
261
+ }
262
+
263
+ /** Activity recording a report being escalated. */
264
+ export interface EscalationActivity {
265
+ $type?: 'tools.ozone.report.defs#escalationActivity'
266
+ /** The report's status before this activity. Populated automatically from the report row; not required in input. */
267
+ previousStatus?:
268
+ | 'open'
269
+ | 'closed'
270
+ | 'escalated'
271
+ | 'queued'
272
+ | 'assigned'
273
+ | (string & {})
274
+ }
275
+
276
+ const hashEscalationActivity = 'escalationActivity'
277
+
278
+ export function isEscalationActivity<V>(v: V) {
279
+ return is$typed(v, id, hashEscalationActivity)
280
+ }
281
+
282
+ export function validateEscalationActivity<V>(v: V) {
283
+ return validate<EscalationActivity & V>(v, id, hashEscalationActivity)
284
+ }
285
+
286
+ /** Activity recording a report being closed. */
287
+ export interface CloseActivity {
288
+ $type?: 'tools.ozone.report.defs#closeActivity'
289
+ /** The report's status before this activity. Populated automatically from the report row; not required in input. */
290
+ previousStatus?:
291
+ | 'open'
292
+ | 'closed'
293
+ | 'escalated'
294
+ | 'queued'
295
+ | 'assigned'
296
+ | (string & {})
297
+ }
298
+
299
+ const hashCloseActivity = 'closeActivity'
300
+
301
+ export function isCloseActivity<V>(v: V) {
302
+ return is$typed(v, id, hashCloseActivity)
303
+ }
304
+
305
+ export function validateCloseActivity<V>(v: V) {
306
+ return validate<CloseActivity & V>(v, id, hashCloseActivity)
307
+ }
308
+
309
+ /** Activity recording a closed report being reopened. Only valid when the report is in 'closed' status. */
310
+ export interface ReopenActivity {
311
+ $type?: 'tools.ozone.report.defs#reopenActivity'
312
+ /** The report's status before this activity. Populated automatically from the report row; not required in input. */
313
+ previousStatus?:
314
+ | 'open'
315
+ | 'closed'
316
+ | 'escalated'
317
+ | 'queued'
318
+ | 'assigned'
319
+ | (string & {})
320
+ }
321
+
322
+ const hashReopenActivity = 'reopenActivity'
323
+
324
+ export function isReopenActivity<V>(v: V) {
325
+ return is$typed(v, id, hashReopenActivity)
326
+ }
327
+
328
+ export function validateReopenActivity<V>(v: V) {
329
+ return validate<ReopenActivity & V>(v, id, hashReopenActivity)
330
+ }
331
+
332
+ /** Activity recording a note on a report. Use internalNote for moderator-only notes or publicNote for reporter-visible notes (or both). */
333
+ export interface NoteActivity {
334
+ $type?: 'tools.ozone.report.defs#noteActivity'
335
+ }
336
+
337
+ const hashNoteActivity = 'noteActivity'
338
+
339
+ export function isNoteActivity<V>(v: V) {
340
+ return is$typed(v, id, hashNoteActivity)
341
+ }
342
+
343
+ export function validateNoteActivity<V>(v: V) {
344
+ return validate<NoteActivity & V>(v, id, hashNoteActivity)
345
+ }
346
+
347
+ /** A single activity entry on a report. */
348
+ export interface ReportActivityView {
349
+ $type?: 'tools.ozone.report.defs#reportActivityView'
350
+ /** Activity ID */
351
+ id: number
352
+ /** ID of the report this activity belongs to */
353
+ reportId: number
354
+ activity:
355
+ | $Typed<QueueActivity>
356
+ | $Typed<AssignmentActivity>
357
+ | $Typed<EscalationActivity>
358
+ | $Typed<CloseActivity>
359
+ | $Typed<ReopenActivity>
360
+ | $Typed<NoteActivity>
361
+ | { $type: string }
362
+ /** Optional moderator-only note. Not visible to reporters. */
363
+ internalNote?: string
364
+ /** Optional public note, potentially visible to the reporter. */
365
+ publicNote?: string
366
+ /** Extensible JSON payload for loose activity-specific metadata (e.g. assignmentId). */
367
+ meta?: { [_ in string]: unknown }
368
+ /** True if this activity was created by an automated process (e.g. queue router) rather than a direct human action. */
369
+ isAutomated: boolean
370
+ /** DID of the actor who created this activity, or the service DID for automated activities. */
371
+ createdBy: string
372
+ moderator?: ToolsOzoneTeamDefs.Member
373
+ /** When this activity was created */
374
+ createdAt: string
375
+ }
376
+
377
+ const hashReportActivityView = 'reportActivityView'
378
+
379
+ export function isReportActivityView<V>(v: V) {
380
+ return is$typed(v, id, hashReportActivityView)
381
+ }
382
+
383
+ export function validateReportActivityView<V>(v: V) {
384
+ return validate<ReportActivityView & V>(v, id, hashReportActivityView)
385
+ }
386
+
387
+ /** Live statistics for reports for the current calendar day, filterable by queue, moderator, or report type. */
388
+ export interface LiveStats {
389
+ $type?: 'tools.ozone.report.defs#liveStats'
390
+ /** Number of reports currently not closed. */
391
+ pendingCount?: number
392
+ /** Number of reports closed today. */
393
+ actionedCount?: number
394
+ /** Number of reports escalated today. */
395
+ escalatedCount?: number
396
+ /** Reports received today. */
397
+ inboundCount?: number
398
+ /** Percentage of reports actioned (actionedCount / inboundCount * 100), rounded to nearest integer. */
399
+ actionRate?: number
400
+ /** Average time in seconds from report creation (or moderator assignment) to close. */
401
+ avgHandlingTimeSec?: number
402
+ /** When these statistics were last computed. */
403
+ lastUpdated?: string
404
+ }
405
+
406
+ const hashLiveStats = 'liveStats'
407
+
408
+ export function isLiveStats<V>(v: V) {
409
+ return is$typed(v, id, hashLiveStats)
410
+ }
411
+
412
+ export function validateLiveStats<V>(v: V) {
413
+ return validate<LiveStats & V>(v, id, hashLiveStats)
414
+ }
415
+
416
+ /** A single daily snapshot of report statistics for a calendar date. */
417
+ export interface HistoricalStats {
418
+ $type?: 'tools.ozone.report.defs#historicalStats'
419
+ /** The calendar date this snapshot covers (YYYY-MM-DD). */
420
+ date: string
421
+ /** When this snapshot was last computed. */
422
+ computedAt?: string
423
+ /** Number of reports not closed at time of computation. */
424
+ pendingCount?: number
425
+ /** Number of reports closed during this day. */
426
+ actionedCount?: number
427
+ /** Number of reports escalated during this day. */
428
+ escalatedCount?: number
429
+ /** Reports received during this day. */
430
+ inboundCount?: number
431
+ /** Percentage of reports actioned (actionedCount / inboundCount * 100), rounded to nearest integer. */
432
+ actionRate?: number
433
+ /** Average time in seconds from report creation (or moderator assignment) to close. */
434
+ avgHandlingTimeSec?: number
435
+ }
436
+
437
+ const hashHistoricalStats = 'historicalStats'
438
+
439
+ export function isHistoricalStats<V>(v: V) {
440
+ return is$typed(v, id, hashHistoricalStats)
441
+ }
442
+
443
+ export function validateHistoricalStats<V>(v: V) {
444
+ return validate<HistoricalStats & V>(v, id, hashHistoricalStats)
445
+ }
446
+
447
+ export interface AssignmentView {
448
+ $type?: 'tools.ozone.report.defs#assignmentView'
449
+ id: number
450
+ did: string
451
+ moderator?: ToolsOzoneTeamDefs.Member
452
+ queue?: ToolsOzoneQueueDefs.QueueView
453
+ reportId: number
454
+ startAt: string
455
+ endAt?: string
456
+ }
457
+
458
+ const hashAssignmentView = 'assignmentView'
459
+
460
+ export function isAssignmentView<V>(v: V) {
461
+ return is$typed(v, id, hashAssignmentView)
462
+ }
463
+
464
+ export function validateAssignmentView<V>(v: V) {
465
+ return validate<AssignmentView & V>(v, id, hashAssignmentView)
466
+ }
@@ -0,0 +1,48 @@
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.getAssignments'
17
+
18
+ export type QueryParams = {
19
+ /** When true, only returns active assignments. */
20
+ onlyActive: boolean
21
+ /** If specified, returns assignments for these reports only. */
22
+ reportIds?: number[]
23
+ /** If specified, returns assignments for these moderators only. */
24
+ dids?: string[]
25
+ limit: number
26
+ cursor?: string
27
+ }
28
+ export type InputSchema = undefined
29
+
30
+ export interface OutputSchema {
31
+ cursor?: string
32
+ assignments: ToolsOzoneReportDefs.AssignmentView[]
33
+ }
34
+
35
+ export type HandlerInput = void
36
+
37
+ export interface HandlerSuccess {
38
+ encoding: 'application/json'
39
+ body: OutputSchema
40
+ headers?: { [key: string]: string }
41
+ }
42
+
43
+ export interface HandlerError {
44
+ status: number
45
+ message?: string
46
+ }
47
+
48
+ export type HandlerOutput = HandlerError | HandlerSuccess
@@ -0,0 +1,54 @@
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.getHistoricalStats'
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
+ /** Earliest date to include (inclusive). */
26
+ startDate?: string
27
+ /** Latest date to include (inclusive). */
28
+ endDate?: string
29
+ /** Maximum number of entries to return. */
30
+ limit: number
31
+ /** Pagination cursor. */
32
+ cursor?: string
33
+ }
34
+ export type InputSchema = undefined
35
+
36
+ export interface OutputSchema {
37
+ stats: ToolsOzoneReportDefs.HistoricalStats[]
38
+ cursor?: string
39
+ }
40
+
41
+ export type HandlerInput = void
42
+
43
+ export interface HandlerSuccess {
44
+ encoding: 'application/json'
45
+ body: OutputSchema
46
+ headers?: { [key: string]: string }
47
+ }
48
+
49
+ export interface HandlerError {
50
+ status: number
51
+ message?: string
52
+ }
53
+
54
+ export type HandlerOutput = HandlerError | HandlerSuccess
@@ -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