@atproto/api 0.19.15 → 0.19.16

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 (128) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/client/index.d.ts +71 -0
  3. package/dist/client/index.d.ts.map +1 -1
  4. package/dist/client/index.js +172 -3
  5. package/dist/client/index.js.map +1 -1
  6. package/dist/client/lexicons.d.ts +17860 -14724
  7. package/dist/client/lexicons.d.ts.map +1 -1
  8. package/dist/client/lexicons.js +1753 -91
  9. package/dist/client/lexicons.js.map +1 -1
  10. package/dist/client/types/tools/ozone/moderation/emitEvent.d.ts +16 -0
  11. package/dist/client/types/tools/ozone/moderation/emitEvent.d.ts.map +1 -1
  12. package/dist/client/types/tools/ozone/moderation/emitEvent.js +9 -0
  13. package/dist/client/types/tools/ozone/moderation/emitEvent.js.map +1 -1
  14. package/dist/client/types/tools/ozone/queue/assignModerator.d.ts +29 -0
  15. package/dist/client/types/tools/ozone/queue/assignModerator.d.ts.map +1 -0
  16. package/dist/client/types/tools/ozone/queue/assignModerator.js +26 -0
  17. package/dist/client/types/tools/ozone/queue/assignModerator.js.map +1 -0
  18. package/dist/client/types/tools/ozone/queue/createQueue.d.ts +37 -0
  19. package/dist/client/types/tools/ozone/queue/createQueue.d.ts.map +1 -0
  20. package/dist/client/types/tools/ozone/queue/createQueue.js +26 -0
  21. package/dist/client/types/tools/ozone/queue/createQueue.js.map +1 -0
  22. package/dist/client/types/tools/ozone/queue/defs.d.ts +62 -0
  23. package/dist/client/types/tools/ozone/queue/defs.d.ts.map +1 -0
  24. package/dist/client/types/tools/ozone/queue/defs.js +34 -0
  25. package/dist/client/types/tools/ozone/queue/defs.js.map +1 -0
  26. package/dist/client/types/tools/ozone/queue/deleteQueue.d.ts +29 -0
  27. package/dist/client/types/tools/ozone/queue/deleteQueue.d.ts.map +1 -0
  28. package/dist/client/types/tools/ozone/queue/deleteQueue.js +11 -0
  29. package/dist/client/types/tools/ozone/queue/deleteQueue.js.map +1 -0
  30. package/dist/client/types/tools/ozone/queue/getAssignments.d.ts +31 -0
  31. package/dist/client/types/tools/ozone/queue/getAssignments.d.ts.map +1 -0
  32. package/dist/client/types/tools/ozone/queue/getAssignments.js +11 -0
  33. package/dist/client/types/tools/ozone/queue/getAssignments.js.map +1 -0
  34. package/dist/client/types/tools/ozone/queue/listQueues.d.ts +33 -0
  35. package/dist/client/types/tools/ozone/queue/listQueues.d.ts.map +1 -0
  36. package/dist/client/types/tools/ozone/queue/listQueues.js +11 -0
  37. package/dist/client/types/tools/ozone/queue/listQueues.js.map +1 -0
  38. package/dist/client/types/tools/ozone/queue/routeReports.d.ts +33 -0
  39. package/dist/client/types/tools/ozone/queue/routeReports.d.ts.map +1 -0
  40. package/dist/client/types/tools/ozone/queue/routeReports.js +26 -0
  41. package/dist/client/types/tools/ozone/queue/routeReports.js.map +1 -0
  42. package/dist/client/types/tools/ozone/queue/unassignModerator.d.ts +26 -0
  43. package/dist/client/types/tools/ozone/queue/unassignModerator.d.ts.map +1 -0
  44. package/dist/client/types/tools/ozone/queue/unassignModerator.js +26 -0
  45. package/dist/client/types/tools/ozone/queue/unassignModerator.js.map +1 -0
  46. package/dist/client/types/tools/ozone/queue/updateQueue.d.ts +32 -0
  47. package/dist/client/types/tools/ozone/queue/updateQueue.d.ts.map +1 -0
  48. package/dist/client/types/tools/ozone/queue/updateQueue.js +11 -0
  49. package/dist/client/types/tools/ozone/queue/updateQueue.js.map +1 -0
  50. package/dist/client/types/tools/ozone/report/assignModerator.d.ts +36 -0
  51. package/dist/client/types/tools/ozone/report/assignModerator.d.ts.map +1 -0
  52. package/dist/client/types/tools/ozone/report/assignModerator.js +34 -0
  53. package/dist/client/types/tools/ozone/report/assignModerator.js.map +1 -0
  54. package/dist/client/types/tools/ozone/report/createActivity.d.ts +45 -0
  55. package/dist/client/types/tools/ozone/report/createActivity.d.ts.map +1 -0
  56. package/dist/client/types/tools/ozone/report/createActivity.js +42 -0
  57. package/dist/client/types/tools/ozone/report/createActivity.js.map +1 -0
  58. package/dist/client/types/tools/ozone/report/defs.d.ts +185 -0
  59. package/dist/client/types/tools/ozone/report/defs.d.ts.map +1 -1
  60. package/dist/client/types/tools/ozone/report/defs.js +108 -0
  61. package/dist/client/types/tools/ozone/report/defs.js.map +1 -1
  62. package/dist/client/types/tools/ozone/report/getAssignments.d.ts +31 -0
  63. package/dist/client/types/tools/ozone/report/getAssignments.d.ts.map +1 -0
  64. package/dist/client/types/tools/ozone/report/getAssignments.js +11 -0
  65. package/dist/client/types/tools/ozone/report/getAssignments.js.map +1 -0
  66. package/dist/client/types/tools/ozone/report/getHistoricalStats.d.ts +37 -0
  67. package/dist/client/types/tools/ozone/report/getHistoricalStats.d.ts.map +1 -0
  68. package/dist/client/types/tools/ozone/report/getHistoricalStats.js +11 -0
  69. package/dist/client/types/tools/ozone/report/getHistoricalStats.js.map +1 -0
  70. package/dist/client/types/tools/ozone/report/getLatestReport.d.ts +24 -0
  71. package/dist/client/types/tools/ozone/report/getLatestReport.d.ts.map +1 -0
  72. package/dist/client/types/tools/ozone/report/getLatestReport.js +26 -0
  73. package/dist/client/types/tools/ozone/report/getLatestReport.js.map +1 -0
  74. package/dist/client/types/tools/ozone/report/getLiveStats.d.ts +28 -0
  75. package/dist/client/types/tools/ozone/report/getLiveStats.d.ts.map +1 -0
  76. package/dist/client/types/tools/ozone/report/getLiveStats.js +11 -0
  77. package/dist/client/types/tools/ozone/report/getLiveStats.js.map +1 -0
  78. package/dist/client/types/tools/ozone/report/getReport.d.ts +25 -0
  79. package/dist/client/types/tools/ozone/report/getReport.d.ts.map +1 -0
  80. package/dist/client/types/tools/ozone/report/getReport.js +26 -0
  81. package/dist/client/types/tools/ozone/report/getReport.js.map +1 -0
  82. package/dist/client/types/tools/ozone/report/listActivities.d.ts +27 -0
  83. package/dist/client/types/tools/ozone/report/listActivities.d.ts.map +1 -0
  84. package/dist/client/types/tools/ozone/report/listActivities.js +11 -0
  85. package/dist/client/types/tools/ozone/report/listActivities.js.map +1 -0
  86. package/dist/client/types/tools/ozone/report/queryReports.d.ts +49 -0
  87. package/dist/client/types/tools/ozone/report/queryReports.d.ts.map +1 -0
  88. package/dist/client/types/tools/ozone/report/queryReports.js +11 -0
  89. package/dist/client/types/tools/ozone/report/queryReports.js.map +1 -0
  90. package/dist/client/types/tools/ozone/report/reassignQueue.d.ts +45 -0
  91. package/dist/client/types/tools/ozone/report/reassignQueue.d.ts.map +1 -0
  92. package/dist/client/types/tools/ozone/report/reassignQueue.js +58 -0
  93. package/dist/client/types/tools/ozone/report/reassignQueue.js.map +1 -0
  94. package/dist/client/types/tools/ozone/report/refreshStats.d.ts +28 -0
  95. package/dist/client/types/tools/ozone/report/refreshStats.d.ts.map +1 -0
  96. package/dist/client/types/tools/ozone/report/refreshStats.js +11 -0
  97. package/dist/client/types/tools/ozone/report/refreshStats.js.map +1 -0
  98. package/dist/client/types/tools/ozone/report/unassignModerator.d.ts +27 -0
  99. package/dist/client/types/tools/ozone/report/unassignModerator.d.ts.map +1 -0
  100. package/dist/client/types/tools/ozone/report/unassignModerator.js +26 -0
  101. package/dist/client/types/tools/ozone/report/unassignModerator.js.map +1 -0
  102. package/package.json +2 -2
  103. package/src/client/index.ts +292 -0
  104. package/src/client/lexicons.ts +1908 -164
  105. package/src/client/types/tools/ozone/moderation/emitEvent.ts +24 -0
  106. package/src/client/types/tools/ozone/queue/assignModerator.ts +55 -0
  107. package/src/client/types/tools/ozone/queue/createQueue.ts +63 -0
  108. package/src/client/types/tools/ozone/queue/defs.ts +99 -0
  109. package/src/client/types/tools/ozone/queue/deleteQueue.ts +48 -0
  110. package/src/client/types/tools/ozone/queue/getAssignments.ts +49 -0
  111. package/src/client/types/tools/ozone/queue/listQueues.ts +51 -0
  112. package/src/client/types/tools/ozone/queue/routeReports.ts +59 -0
  113. package/src/client/types/tools/ozone/queue/unassignModerator.ts +51 -0
  114. package/src/client/types/tools/ozone/queue/updateQueue.ts +51 -0
  115. package/src/client/types/tools/ozone/report/assignModerator.ts +66 -0
  116. package/src/client/types/tools/ozone/report/createActivity.ts +85 -0
  117. package/src/client/types/tools/ozone/report/defs.ts +327 -0
  118. package/src/client/types/tools/ozone/report/getAssignments.ts +49 -0
  119. package/src/client/types/tools/ozone/report/getHistoricalStats.ts +55 -0
  120. package/src/client/types/tools/ozone/report/getLatestReport.ts +49 -0
  121. package/src/client/types/tools/ozone/report/getLiveStats.ts +46 -0
  122. package/src/client/types/tools/ozone/report/getReport.ts +49 -0
  123. package/src/client/types/tools/ozone/report/listActivities.ts +45 -0
  124. package/src/client/types/tools/ozone/report/queryReports.ts +73 -0
  125. package/src/client/types/tools/ozone/report/reassignQueue.ts +88 -0
  126. package/src/client/types/tools/ozone/report/refreshStats.ts +46 -0
  127. package/src/client/types/tools/ozone/report/unassignModerator.ts +53 -0
  128. package/tsconfig.build.tsbuildinfo +1 -1
@@ -0,0 +1,85 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc'
5
+ import { type ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { CID } from 'multiformats/cid'
7
+ import { validate as _validate } from '../../../../lexicons'
8
+ import {
9
+ type $Typed,
10
+ is$typed as _is$typed,
11
+ type OmitKey,
12
+ } from '../../../../util'
13
+ import type * as ToolsOzoneReportDefs from './defs.js'
14
+
15
+ const is$typed = _is$typed,
16
+ validate = _validate
17
+ const id = 'tools.ozone.report.createActivity'
18
+
19
+ export type QueryParams = {}
20
+
21
+ export interface InputSchema {
22
+ /** ID of the report to record activity on */
23
+ reportId: number
24
+ activity:
25
+ | $Typed<ToolsOzoneReportDefs.QueueActivity>
26
+ | $Typed<ToolsOzoneReportDefs.AssignmentActivity>
27
+ | $Typed<ToolsOzoneReportDefs.EscalationActivity>
28
+ | $Typed<ToolsOzoneReportDefs.CloseActivity>
29
+ | $Typed<ToolsOzoneReportDefs.ReopenActivity>
30
+ | $Typed<ToolsOzoneReportDefs.NoteActivity>
31
+ | { $type: string }
32
+ /** Optional moderator-only note. Not visible to reporters. */
33
+ internalNote?: string
34
+ /** Optional public-facing note, potentially visible to the reporter. */
35
+ publicNote?: string
36
+ /** Set true when this activity is triggered by an automated process. Defaults to false. */
37
+ isAutomated?: boolean
38
+ }
39
+
40
+ export interface OutputSchema {
41
+ activity: ToolsOzoneReportDefs.ReportActivityView
42
+ }
43
+
44
+ export interface CallOptions {
45
+ signal?: AbortSignal
46
+ headers?: HeadersMap
47
+ qp?: QueryParams
48
+ encoding?: 'application/json'
49
+ }
50
+
51
+ export interface Response {
52
+ success: boolean
53
+ headers: HeadersMap
54
+ data: OutputSchema
55
+ }
56
+
57
+ export class ReportNotFoundError extends XRPCError {
58
+ constructor(src: XRPCError) {
59
+ super(src.status, src.error, src.message, src.headers, { cause: src })
60
+ }
61
+ }
62
+
63
+ export class InvalidStateTransitionError extends XRPCError {
64
+ constructor(src: XRPCError) {
65
+ super(src.status, src.error, src.message, src.headers, { cause: src })
66
+ }
67
+ }
68
+
69
+ export class AlreadyInTargetStateError extends XRPCError {
70
+ constructor(src: XRPCError) {
71
+ super(src.status, src.error, src.message, src.headers, { cause: src })
72
+ }
73
+ }
74
+
75
+ export function toKnownErr(e: any) {
76
+ if (e instanceof XRPCError) {
77
+ if (e.error === 'ReportNotFound') return new ReportNotFoundError(e)
78
+ if (e.error === 'InvalidStateTransition')
79
+ return new InvalidStateTransitionError(e)
80
+ if (e.error === 'AlreadyInTargetState')
81
+ return new AlreadyInTargetStateError(e)
82
+ }
83
+
84
+ return e
85
+ }
@@ -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,49 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc'
5
+ import { type ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { CID } from 'multiformats/cid'
7
+ import { validate as _validate } from '../../../../lexicons'
8
+ import {
9
+ type $Typed,
10
+ is$typed as _is$typed,
11
+ type OmitKey,
12
+ } from '../../../../util'
13
+ import type * as ToolsOzoneReportDefs from './defs.js'
14
+
15
+ const is$typed = _is$typed,
16
+ validate = _validate
17
+ const id = 'tools.ozone.report.getAssignments'
18
+
19
+ export type QueryParams = {
20
+ /** When true, only returns active assignments. */
21
+ onlyActive?: boolean
22
+ /** If specified, returns assignments for these reports only. */
23
+ reportIds?: number[]
24
+ /** If specified, returns assignments for these moderators only. */
25
+ dids?: string[]
26
+ limit?: number
27
+ cursor?: string
28
+ }
29
+ export type InputSchema = undefined
30
+
31
+ export interface OutputSchema {
32
+ cursor?: string
33
+ assignments: ToolsOzoneReportDefs.AssignmentView[]
34
+ }
35
+
36
+ export interface CallOptions {
37
+ signal?: AbortSignal
38
+ headers?: HeadersMap
39
+ }
40
+
41
+ export interface Response {
42
+ success: boolean
43
+ headers: HeadersMap
44
+ data: OutputSchema
45
+ }
46
+
47
+ export function toKnownErr(e: any) {
48
+ return e
49
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc'
5
+ import { type ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { CID } from 'multiformats/cid'
7
+ import { validate as _validate } from '../../../../lexicons'
8
+ import {
9
+ type $Typed,
10
+ is$typed as _is$typed,
11
+ type OmitKey,
12
+ } from '../../../../util'
13
+ import type * as ToolsOzoneReportDefs from './defs.js'
14
+
15
+ const is$typed = _is$typed,
16
+ validate = _validate
17
+ const id = 'tools.ozone.report.getHistoricalStats'
18
+
19
+ export type QueryParams = {
20
+ /** Filter stats by queue. Use -1 for unqueued reports. */
21
+ queueId?: number
22
+ /** Filter stats by moderator DID. */
23
+ moderatorDid?: string
24
+ /** Filter stats by report types. */
25
+ reportTypes?: string[]
26
+ /** Earliest date to include (inclusive). */
27
+ startDate?: string
28
+ /** Latest date to include (inclusive). */
29
+ endDate?: string
30
+ /** Maximum number of entries to return. */
31
+ limit?: number
32
+ /** Pagination cursor. */
33
+ cursor?: string
34
+ }
35
+ export type InputSchema = undefined
36
+
37
+ export interface OutputSchema {
38
+ stats: ToolsOzoneReportDefs.HistoricalStats[]
39
+ cursor?: string
40
+ }
41
+
42
+ export interface CallOptions {
43
+ signal?: AbortSignal
44
+ headers?: HeadersMap
45
+ }
46
+
47
+ export interface Response {
48
+ success: boolean
49
+ headers: HeadersMap
50
+ data: OutputSchema
51
+ }
52
+
53
+ export function toKnownErr(e: any) {
54
+ return e
55
+ }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc'
5
+ import { type ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { CID } from 'multiformats/cid'
7
+ import { validate as _validate } from '../../../../lexicons'
8
+ import {
9
+ type $Typed,
10
+ is$typed as _is$typed,
11
+ type OmitKey,
12
+ } from '../../../../util'
13
+ import type * as ToolsOzoneReportDefs from './defs.js'
14
+
15
+ const is$typed = _is$typed,
16
+ validate = _validate
17
+ const id = 'tools.ozone.report.getLatestReport'
18
+
19
+ export type QueryParams = {}
20
+ export type InputSchema = undefined
21
+
22
+ export interface OutputSchema {
23
+ report: ToolsOzoneReportDefs.ReportView
24
+ }
25
+
26
+ export interface CallOptions {
27
+ signal?: AbortSignal
28
+ headers?: HeadersMap
29
+ }
30
+
31
+ export interface Response {
32
+ success: boolean
33
+ headers: HeadersMap
34
+ data: OutputSchema
35
+ }
36
+
37
+ export class NotFoundError extends XRPCError {
38
+ constructor(src: XRPCError) {
39
+ super(src.status, src.error, src.message, src.headers, { cause: src })
40
+ }
41
+ }
42
+
43
+ export function toKnownErr(e: any) {
44
+ if (e instanceof XRPCError) {
45
+ if (e.error === 'NotFound') return new NotFoundError(e)
46
+ }
47
+
48
+ return e
49
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc'
5
+ import { type ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { CID } from 'multiformats/cid'
7
+ import { validate as _validate } from '../../../../lexicons'
8
+ import {
9
+ type $Typed,
10
+ is$typed as _is$typed,
11
+ type OmitKey,
12
+ } from '../../../../util'
13
+ import type * as ToolsOzoneReportDefs from './defs.js'
14
+
15
+ const is$typed = _is$typed,
16
+ validate = _validate
17
+ const id = 'tools.ozone.report.getLiveStats'
18
+
19
+ export type QueryParams = {
20
+ /** Filter stats by queue. Use -1 for unqueued reports. */
21
+ queueId?: number
22
+ /** Filter stats by moderator DID. */
23
+ moderatorDid?: string
24
+ /** Filter stats by report types. */
25
+ reportTypes?: string[]
26
+ }
27
+ export type InputSchema = undefined
28
+
29
+ export interface OutputSchema {
30
+ stats: ToolsOzoneReportDefs.LiveStats
31
+ }
32
+
33
+ export interface CallOptions {
34
+ signal?: AbortSignal
35
+ headers?: HeadersMap
36
+ }
37
+
38
+ export interface Response {
39
+ success: boolean
40
+ headers: HeadersMap
41
+ data: OutputSchema
42
+ }
43
+
44
+ export function toKnownErr(e: any) {
45
+ return e
46
+ }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc'
5
+ import { type ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { CID } from 'multiformats/cid'
7
+ import { validate as _validate } from '../../../../lexicons'
8
+ import {
9
+ type $Typed,
10
+ is$typed as _is$typed,
11
+ type OmitKey,
12
+ } from '../../../../util'
13
+ import type * as ToolsOzoneReportDefs from './defs.js'
14
+
15
+ const is$typed = _is$typed,
16
+ validate = _validate
17
+ const id = 'tools.ozone.report.getReport'
18
+
19
+ export type QueryParams = {
20
+ /** The ID of the report to retrieve. */
21
+ id: number
22
+ }
23
+ export type InputSchema = undefined
24
+ export type OutputSchema = ToolsOzoneReportDefs.ReportView
25
+
26
+ export interface CallOptions {
27
+ signal?: AbortSignal
28
+ headers?: HeadersMap
29
+ }
30
+
31
+ export interface Response {
32
+ success: boolean
33
+ headers: HeadersMap
34
+ data: OutputSchema
35
+ }
36
+
37
+ export class NotFoundError extends XRPCError {
38
+ constructor(src: XRPCError) {
39
+ super(src.status, src.error, src.message, src.headers, { cause: src })
40
+ }
41
+ }
42
+
43
+ export function toKnownErr(e: any) {
44
+ if (e instanceof XRPCError) {
45
+ if (e.error === 'NotFound') return new NotFoundError(e)
46
+ }
47
+
48
+ return e
49
+ }