@atproto/ozone 0.0.17-next.0 → 0.0.17-next.1

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 (146) hide show
  1. package/dist/api/util.d.ts +10 -0
  2. package/dist/auth-verifier.d.ts +2 -2
  3. package/dist/communication-service/template.d.ts +2 -2
  4. package/dist/config/config.d.ts +5 -0
  5. package/dist/config/env.d.ts +2 -0
  6. package/dist/context.d.ts +6 -0
  7. package/dist/daemon/blob-diverter.d.ts +26 -0
  8. package/dist/daemon/event-pusher.d.ts +4 -0
  9. package/dist/daemon/index.d.ts +1 -0
  10. package/dist/db/index.js +21 -1
  11. package/dist/db/index.js.map +3 -3
  12. package/dist/db/migrations/20240228T003647759Z-add-label-sigs.d.ts +3 -0
  13. package/dist/db/migrations/index.d.ts +1 -0
  14. package/dist/db/schema/index.d.ts +2 -1
  15. package/dist/db/schema/label.d.ts +4 -0
  16. package/dist/db/schema/moderation_event.d.ts +1 -1
  17. package/dist/db/schema/moderation_subject_status.d.ts +1 -1
  18. package/dist/db/schema/signing_key.d.ts +9 -0
  19. package/dist/index.js +10949 -10628
  20. package/dist/index.js.map +3 -3
  21. package/dist/lexicon/index.d.ts +48 -28
  22. package/dist/lexicon/lexicons.d.ts +4641 -4650
  23. package/dist/lexicon/types/app/bsky/actor/defs.d.ts +7 -7
  24. package/dist/lexicon/types/app/bsky/feed/defs.d.ts +1 -0
  25. package/dist/lexicon/types/app/bsky/graph/defs.d.ts +3 -0
  26. package/dist/lexicon/types/com/atproto/admin/defs.d.ts +0 -305
  27. package/dist/lexicon/types/com/atproto/label/defs.d.ts +5 -0
  28. package/dist/lexicon/types/{com/atproto/admin/createCommunicationTemplate.d.ts → tools/ozone/communication/createTemplate.d.ts} +2 -2
  29. package/dist/lexicon/types/tools/ozone/communication/defs.d.ts +14 -0
  30. package/dist/lexicon/types/{com/atproto/admin/listCommunicationTemplates.d.ts → tools/ozone/communication/listTemplates.d.ts} +2 -2
  31. package/dist/lexicon/types/{com/atproto/admin/updateCommunicationTemplate.d.ts → tools/ozone/communication/updateTemplate.d.ts} +2 -2
  32. package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts +269 -0
  33. package/dist/lexicon/types/{com/atproto/admin/emitModerationEvent.d.ts → tools/ozone/moderation/emitEvent.d.ts} +5 -4
  34. package/dist/lexicon/types/{com/atproto/admin/getModerationEvent.d.ts → tools/ozone/moderation/getEvent.d.ts} +2 -2
  35. package/dist/lexicon/types/{com/atproto/admin → tools/ozone/moderation}/getRecord.d.ts +2 -2
  36. package/dist/lexicon/types/{com/atproto/admin → tools/ozone/moderation}/getRepo.d.ts +2 -2
  37. package/dist/lexicon/types/{com/atproto/admin/queryModerationEvents.d.ts → tools/ozone/moderation/queryEvents.d.ts} +2 -2
  38. package/dist/lexicon/types/{com/atproto/admin/queryModerationStatuses.d.ts → tools/ozone/moderation/queryStatuses.d.ts} +2 -2
  39. package/dist/lexicon/types/{com/atproto/admin → tools/ozone/moderation}/searchRepos.d.ts +2 -2
  40. package/dist/mod-service/index.d.ts +16 -15
  41. package/dist/mod-service/subject.d.ts +1 -1
  42. package/dist/mod-service/types.d.ts +2 -2
  43. package/dist/mod-service/util.d.ts +6 -0
  44. package/dist/mod-service/views.d.ts +9 -3
  45. package/dist/sequencer/sequencer.d.ts +6 -4
  46. package/dist/util.d.ts +2 -0
  47. package/package.json +7 -7
  48. package/src/api/{admin/createCommunicationTemplate.ts → communication/createTemplate.ts} +1 -1
  49. package/src/api/{admin/deleteCommunicationTemplate.ts → communication/deleteTemplate.ts} +1 -1
  50. package/src/api/{admin/listCommunicationTemplates.ts → communication/listTemplates.ts} +1 -1
  51. package/src/api/{admin/updateCommunicationTemplate.ts → communication/updateTemplate.ts} +1 -1
  52. package/src/api/index.ts +21 -21
  53. package/src/api/{temp → label}/fetchLabels.ts +4 -2
  54. package/src/api/label/queryLabels.ts +4 -2
  55. package/src/api/moderation/emitEvent.ts +218 -0
  56. package/src/api/{admin/getModerationEvent.ts → moderation/getEvent.ts} +1 -1
  57. package/src/api/{admin → moderation}/getRecord.ts +2 -2
  58. package/src/api/{admin → moderation}/getRepo.ts +2 -2
  59. package/src/api/{admin/queryModerationEvents.ts → moderation/queryEvents.ts} +2 -2
  60. package/src/api/{admin/queryModerationStatuses.ts → moderation/queryStatuses.ts} +2 -2
  61. package/src/api/{admin → moderation}/searchRepos.ts +1 -1
  62. package/src/api/{moderation → report}/createReport.ts +1 -1
  63. package/src/api/util.ts +119 -0
  64. package/src/auth-verifier.ts +2 -2
  65. package/src/communication-service/template.ts +2 -2
  66. package/src/config/config.ts +14 -0
  67. package/src/config/env.ts +4 -0
  68. package/src/context.ts +35 -9
  69. package/src/daemon/blob-diverter.ts +150 -0
  70. package/src/daemon/context.ts +9 -5
  71. package/src/daemon/event-pusher.ts +49 -14
  72. package/src/daemon/index.ts +1 -0
  73. package/src/db/migrations/20240228T003647759Z-add-label-sigs.ts +25 -0
  74. package/src/db/migrations/index.ts +1 -0
  75. package/src/db/schema/index.ts +2 -0
  76. package/src/db/schema/label.ts +3 -0
  77. package/src/db/schema/moderation_event.ts +11 -11
  78. package/src/db/schema/moderation_subject_status.ts +1 -1
  79. package/src/db/schema/signing_key.ts +10 -0
  80. package/src/lexicon/index.ts +178 -138
  81. package/src/lexicon/lexicons.ts +6078 -6106
  82. package/src/lexicon/types/app/bsky/actor/defs.ts +11 -11
  83. package/src/lexicon/types/app/bsky/feed/defs.ts +1 -0
  84. package/src/lexicon/types/app/bsky/graph/defs.ts +3 -0
  85. package/src/lexicon/types/com/atproto/admin/defs.ts +0 -697
  86. package/src/lexicon/types/com/atproto/label/defs.ts +10 -0
  87. package/src/lexicon/types/{com/atproto/admin/createCommunicationTemplate.ts → tools/ozone/communication/createTemplate.ts} +2 -2
  88. package/src/lexicon/types/tools/ozone/communication/defs.ts +35 -0
  89. package/src/lexicon/types/{com/atproto/admin/listCommunicationTemplates.ts → tools/ozone/communication/listTemplates.ts} +2 -2
  90. package/src/lexicon/types/{com/atproto/admin/updateCommunicationTemplate.ts → tools/ozone/communication/updateTemplate.ts} +2 -2
  91. package/src/lexicon/types/tools/ozone/moderation/defs.ts +641 -0
  92. package/src/lexicon/types/{com/atproto/admin/emitModerationEvent.ts → tools/ozone/moderation/emitEvent.ts} +15 -14
  93. package/src/lexicon/types/{com/atproto/admin/getModerationEvent.ts → tools/ozone/moderation/getEvent.ts} +2 -2
  94. package/src/lexicon/types/{com/atproto/admin → tools/ozone/moderation}/getRecord.ts +2 -2
  95. package/src/lexicon/types/{com/atproto/admin → tools/ozone/moderation}/getRepo.ts +2 -2
  96. package/src/lexicon/types/{com/atproto/admin/queryModerationEvents.ts → tools/ozone/moderation/queryEvents.ts} +3 -3
  97. package/src/lexicon/types/{com/atproto/admin/queryModerationStatuses.ts → tools/ozone/moderation/queryStatuses.ts} +2 -2
  98. package/src/lexicon/types/{com/atproto/admin → tools/ozone/moderation}/searchRepos.ts +2 -2
  99. package/src/mod-service/index.ts +42 -47
  100. package/src/mod-service/lang.ts +1 -1
  101. package/src/mod-service/status.ts +19 -16
  102. package/src/mod-service/subject.ts +1 -1
  103. package/src/mod-service/types.ts +10 -10
  104. package/src/mod-service/util.ts +49 -5
  105. package/src/mod-service/views.ts +45 -18
  106. package/src/sequencer/sequencer.ts +12 -11
  107. package/src/util.ts +21 -0
  108. package/tests/__snapshots__/blob-divert.test.ts.snap +22 -0
  109. package/tests/__snapshots__/get-record.test.ts.snap +10 -2
  110. package/tests/__snapshots__/get-repo.test.ts.snap +5 -1
  111. package/tests/__snapshots__/moderation-events.test.ts.snap +8 -8
  112. package/tests/__snapshots__/moderation-statuses.test.ts.snap +6 -6
  113. package/tests/_util.ts +5 -0
  114. package/tests/blob-divert.test.ts +87 -0
  115. package/tests/communication-templates.test.ts +30 -34
  116. package/tests/db.test.ts +6 -6
  117. package/tests/get-record.test.ts +6 -6
  118. package/tests/get-repo.test.ts +11 -11
  119. package/tests/moderation-appeals.test.ts +28 -28
  120. package/tests/moderation-events.test.ts +44 -44
  121. package/tests/moderation-status-tags.test.ts +8 -10
  122. package/tests/moderation-statuses.test.ts +27 -27
  123. package/tests/moderation.test.ts +50 -57
  124. package/tests/query-labels.test.ts +86 -10
  125. package/tests/repo-search.test.ts +8 -8
  126. package/tests/sequencer.test.ts +6 -3
  127. package/dist/api/admin/util.d.ts +0 -5
  128. package/dist/api/moderation/util.d.ts +0 -4
  129. package/src/api/admin/emitModerationEvent.ts +0 -174
  130. package/src/api/admin/util.ts +0 -54
  131. package/src/api/moderation/util.ts +0 -67
  132. /package/dist/api/{admin/createCommunicationTemplate.d.ts → communication/createTemplate.d.ts} +0 -0
  133. /package/dist/api/{admin/deleteCommunicationTemplate.d.ts → communication/deleteTemplate.d.ts} +0 -0
  134. /package/dist/api/{admin/emitModerationEvent.d.ts → communication/listTemplates.d.ts} +0 -0
  135. /package/dist/api/{admin/getModerationEvent.d.ts → communication/updateTemplate.d.ts} +0 -0
  136. /package/dist/api/{temp → label}/fetchLabels.d.ts +0 -0
  137. /package/dist/api/{admin/getRecord.d.ts → moderation/emitEvent.d.ts} +0 -0
  138. /package/dist/api/{admin/getRepo.d.ts → moderation/getEvent.d.ts} +0 -0
  139. /package/dist/api/{admin/listCommunicationTemplates.d.ts → moderation/getRecord.d.ts} +0 -0
  140. /package/dist/api/{admin/queryModerationEvents.d.ts → moderation/getRepo.d.ts} +0 -0
  141. /package/dist/api/{admin/queryModerationStatuses.d.ts → moderation/queryEvents.d.ts} +0 -0
  142. /package/dist/api/{admin/searchRepos.d.ts → moderation/queryStatuses.d.ts} +0 -0
  143. /package/dist/api/{admin/updateCommunicationTemplate.d.ts → moderation/searchRepos.d.ts} +0 -0
  144. /package/dist/api/{moderation → report}/createReport.d.ts +0 -0
  145. /package/dist/lexicon/types/{com/atproto/admin/deleteCommunicationTemplate.d.ts → tools/ozone/communication/deleteTemplate.d.ts} +0 -0
  146. /package/src/lexicon/types/{com/atproto/admin/deleteCommunicationTemplate.ts → tools/ozone/communication/deleteTemplate.ts} +0 -0
@@ -0,0 +1,269 @@
1
+ import { ValidationResult } from '@atproto/lexicon';
2
+ import * as ComAtprotoAdminDefs from '../../../com/atproto/admin/defs';
3
+ import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef';
4
+ import * as ComAtprotoModerationDefs from '../../../com/atproto/moderation/defs';
5
+ import * as ComAtprotoServerDefs from '../../../com/atproto/server/defs';
6
+ import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs';
7
+ export interface ModEventView {
8
+ id: number;
9
+ event: ModEventTakedown | ModEventReverseTakedown | ModEventComment | ModEventReport | ModEventLabel | ModEventAcknowledge | ModEventEscalate | ModEventMute | ModEventEmail | ModEventResolveAppeal | ModEventDivert | {
10
+ $type: string;
11
+ [k: string]: unknown;
12
+ };
13
+ subject: ComAtprotoAdminDefs.RepoRef | ComAtprotoRepoStrongRef.Main | {
14
+ $type: string;
15
+ [k: string]: unknown;
16
+ };
17
+ subjectBlobCids: string[];
18
+ createdBy: string;
19
+ createdAt: string;
20
+ creatorHandle?: string;
21
+ subjectHandle?: string;
22
+ [k: string]: unknown;
23
+ }
24
+ export declare function isModEventView(v: unknown): v is ModEventView;
25
+ export declare function validateModEventView(v: unknown): ValidationResult;
26
+ export interface ModEventViewDetail {
27
+ id: number;
28
+ event: ModEventTakedown | ModEventReverseTakedown | ModEventComment | ModEventReport | ModEventLabel | ModEventAcknowledge | ModEventEscalate | ModEventMute | ModEventEmail | ModEventResolveAppeal | ModEventDivert | {
29
+ $type: string;
30
+ [k: string]: unknown;
31
+ };
32
+ subject: RepoView | RepoViewNotFound | RecordView | RecordViewNotFound | {
33
+ $type: string;
34
+ [k: string]: unknown;
35
+ };
36
+ subjectBlobs: BlobView[];
37
+ createdBy: string;
38
+ createdAt: string;
39
+ [k: string]: unknown;
40
+ }
41
+ export declare function isModEventViewDetail(v: unknown): v is ModEventViewDetail;
42
+ export declare function validateModEventViewDetail(v: unknown): ValidationResult;
43
+ export interface SubjectStatusView {
44
+ id: number;
45
+ subject: ComAtprotoAdminDefs.RepoRef | ComAtprotoRepoStrongRef.Main | {
46
+ $type: string;
47
+ [k: string]: unknown;
48
+ };
49
+ subjectBlobCids?: string[];
50
+ subjectRepoHandle?: string;
51
+ updatedAt: string;
52
+ createdAt: string;
53
+ reviewState: SubjectReviewState;
54
+ comment?: string;
55
+ muteUntil?: string;
56
+ lastReviewedBy?: string;
57
+ lastReviewedAt?: string;
58
+ lastReportedAt?: string;
59
+ lastAppealedAt?: string;
60
+ takendown?: boolean;
61
+ appealed?: boolean;
62
+ suspendUntil?: string;
63
+ tags?: string[];
64
+ [k: string]: unknown;
65
+ }
66
+ export declare function isSubjectStatusView(v: unknown): v is SubjectStatusView;
67
+ export declare function validateSubjectStatusView(v: unknown): ValidationResult;
68
+ export type SubjectReviewState = 'lex:tools.ozone.moderation.defs#reviewOpen' | 'lex:tools.ozone.moderation.defs#reviewEscalated' | 'lex:tools.ozone.moderation.defs#reviewClosed' | 'lex:tools.ozone.moderation.defs#reviewNone' | (string & {});
69
+ export declare const REVIEWOPEN = "tools.ozone.moderation.defs#reviewOpen";
70
+ export declare const REVIEWESCALATED = "tools.ozone.moderation.defs#reviewEscalated";
71
+ export declare const REVIEWCLOSED = "tools.ozone.moderation.defs#reviewClosed";
72
+ export declare const REVIEWNONE = "tools.ozone.moderation.defs#reviewNone";
73
+ export interface ModEventTakedown {
74
+ comment?: string;
75
+ durationInHours?: number;
76
+ [k: string]: unknown;
77
+ }
78
+ export declare function isModEventTakedown(v: unknown): v is ModEventTakedown;
79
+ export declare function validateModEventTakedown(v: unknown): ValidationResult;
80
+ export interface ModEventReverseTakedown {
81
+ comment?: string;
82
+ [k: string]: unknown;
83
+ }
84
+ export declare function isModEventReverseTakedown(v: unknown): v is ModEventReverseTakedown;
85
+ export declare function validateModEventReverseTakedown(v: unknown): ValidationResult;
86
+ export interface ModEventResolveAppeal {
87
+ comment?: string;
88
+ [k: string]: unknown;
89
+ }
90
+ export declare function isModEventResolveAppeal(v: unknown): v is ModEventResolveAppeal;
91
+ export declare function validateModEventResolveAppeal(v: unknown): ValidationResult;
92
+ export interface ModEventComment {
93
+ comment: string;
94
+ sticky?: boolean;
95
+ [k: string]: unknown;
96
+ }
97
+ export declare function isModEventComment(v: unknown): v is ModEventComment;
98
+ export declare function validateModEventComment(v: unknown): ValidationResult;
99
+ export interface ModEventReport {
100
+ comment?: string;
101
+ reportType: ComAtprotoModerationDefs.ReasonType;
102
+ [k: string]: unknown;
103
+ }
104
+ export declare function isModEventReport(v: unknown): v is ModEventReport;
105
+ export declare function validateModEventReport(v: unknown): ValidationResult;
106
+ export interface ModEventLabel {
107
+ comment?: string;
108
+ createLabelVals: string[];
109
+ negateLabelVals: string[];
110
+ [k: string]: unknown;
111
+ }
112
+ export declare function isModEventLabel(v: unknown): v is ModEventLabel;
113
+ export declare function validateModEventLabel(v: unknown): ValidationResult;
114
+ export interface ModEventAcknowledge {
115
+ comment?: string;
116
+ [k: string]: unknown;
117
+ }
118
+ export declare function isModEventAcknowledge(v: unknown): v is ModEventAcknowledge;
119
+ export declare function validateModEventAcknowledge(v: unknown): ValidationResult;
120
+ export interface ModEventEscalate {
121
+ comment?: string;
122
+ [k: string]: unknown;
123
+ }
124
+ export declare function isModEventEscalate(v: unknown): v is ModEventEscalate;
125
+ export declare function validateModEventEscalate(v: unknown): ValidationResult;
126
+ export interface ModEventMute {
127
+ comment?: string;
128
+ durationInHours: number;
129
+ [k: string]: unknown;
130
+ }
131
+ export declare function isModEventMute(v: unknown): v is ModEventMute;
132
+ export declare function validateModEventMute(v: unknown): ValidationResult;
133
+ export interface ModEventUnmute {
134
+ comment?: string;
135
+ [k: string]: unknown;
136
+ }
137
+ export declare function isModEventUnmute(v: unknown): v is ModEventUnmute;
138
+ export declare function validateModEventUnmute(v: unknown): ValidationResult;
139
+ export interface ModEventEmail {
140
+ subjectLine: string;
141
+ content?: string;
142
+ comment?: string;
143
+ [k: string]: unknown;
144
+ }
145
+ export declare function isModEventEmail(v: unknown): v is ModEventEmail;
146
+ export declare function validateModEventEmail(v: unknown): ValidationResult;
147
+ export interface ModEventDivert {
148
+ comment?: string;
149
+ [k: string]: unknown;
150
+ }
151
+ export declare function isModEventDivert(v: unknown): v is ModEventDivert;
152
+ export declare function validateModEventDivert(v: unknown): ValidationResult;
153
+ export interface ModEventTag {
154
+ add: string[];
155
+ remove: string[];
156
+ comment?: string;
157
+ [k: string]: unknown;
158
+ }
159
+ export declare function isModEventTag(v: unknown): v is ModEventTag;
160
+ export declare function validateModEventTag(v: unknown): ValidationResult;
161
+ export interface RepoView {
162
+ did: string;
163
+ handle: string;
164
+ email?: string;
165
+ relatedRecords: {}[];
166
+ indexedAt: string;
167
+ moderation: Moderation;
168
+ invitedBy?: ComAtprotoServerDefs.InviteCode;
169
+ invitesDisabled?: boolean;
170
+ inviteNote?: string;
171
+ [k: string]: unknown;
172
+ }
173
+ export declare function isRepoView(v: unknown): v is RepoView;
174
+ export declare function validateRepoView(v: unknown): ValidationResult;
175
+ export interface RepoViewDetail {
176
+ did: string;
177
+ handle: string;
178
+ email?: string;
179
+ relatedRecords: {}[];
180
+ indexedAt: string;
181
+ moderation: ModerationDetail;
182
+ labels?: ComAtprotoLabelDefs.Label[];
183
+ invitedBy?: ComAtprotoServerDefs.InviteCode;
184
+ invites?: ComAtprotoServerDefs.InviteCode[];
185
+ invitesDisabled?: boolean;
186
+ inviteNote?: string;
187
+ emailConfirmedAt?: string;
188
+ [k: string]: unknown;
189
+ }
190
+ export declare function isRepoViewDetail(v: unknown): v is RepoViewDetail;
191
+ export declare function validateRepoViewDetail(v: unknown): ValidationResult;
192
+ export interface RepoViewNotFound {
193
+ did: string;
194
+ [k: string]: unknown;
195
+ }
196
+ export declare function isRepoViewNotFound(v: unknown): v is RepoViewNotFound;
197
+ export declare function validateRepoViewNotFound(v: unknown): ValidationResult;
198
+ export interface RecordView {
199
+ uri: string;
200
+ cid: string;
201
+ value: {};
202
+ blobCids: string[];
203
+ indexedAt: string;
204
+ moderation: Moderation;
205
+ repo: RepoView;
206
+ [k: string]: unknown;
207
+ }
208
+ export declare function isRecordView(v: unknown): v is RecordView;
209
+ export declare function validateRecordView(v: unknown): ValidationResult;
210
+ export interface RecordViewDetail {
211
+ uri: string;
212
+ cid: string;
213
+ value: {};
214
+ blobs: BlobView[];
215
+ labels?: ComAtprotoLabelDefs.Label[];
216
+ indexedAt: string;
217
+ moderation: ModerationDetail;
218
+ repo: RepoView;
219
+ [k: string]: unknown;
220
+ }
221
+ export declare function isRecordViewDetail(v: unknown): v is RecordViewDetail;
222
+ export declare function validateRecordViewDetail(v: unknown): ValidationResult;
223
+ export interface RecordViewNotFound {
224
+ uri: string;
225
+ [k: string]: unknown;
226
+ }
227
+ export declare function isRecordViewNotFound(v: unknown): v is RecordViewNotFound;
228
+ export declare function validateRecordViewNotFound(v: unknown): ValidationResult;
229
+ export interface Moderation {
230
+ subjectStatus?: SubjectStatusView;
231
+ [k: string]: unknown;
232
+ }
233
+ export declare function isModeration(v: unknown): v is Moderation;
234
+ export declare function validateModeration(v: unknown): ValidationResult;
235
+ export interface ModerationDetail {
236
+ subjectStatus?: SubjectStatusView;
237
+ [k: string]: unknown;
238
+ }
239
+ export declare function isModerationDetail(v: unknown): v is ModerationDetail;
240
+ export declare function validateModerationDetail(v: unknown): ValidationResult;
241
+ export interface BlobView {
242
+ cid: string;
243
+ mimeType: string;
244
+ size: number;
245
+ createdAt: string;
246
+ details?: ImageDetails | VideoDetails | {
247
+ $type: string;
248
+ [k: string]: unknown;
249
+ };
250
+ moderation?: Moderation;
251
+ [k: string]: unknown;
252
+ }
253
+ export declare function isBlobView(v: unknown): v is BlobView;
254
+ export declare function validateBlobView(v: unknown): ValidationResult;
255
+ export interface ImageDetails {
256
+ width: number;
257
+ height: number;
258
+ [k: string]: unknown;
259
+ }
260
+ export declare function isImageDetails(v: unknown): v is ImageDetails;
261
+ export declare function validateImageDetails(v: unknown): ValidationResult;
262
+ export interface VideoDetails {
263
+ width: number;
264
+ height: number;
265
+ length: number;
266
+ [k: string]: unknown;
267
+ }
268
+ export declare function isVideoDetails(v: unknown): v is VideoDetails;
269
+ export declare function validateVideoDetails(v: unknown): ValidationResult;
@@ -1,11 +1,12 @@
1
1
  import express from 'express';
2
2
  import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
3
- import * as ComAtprotoAdminDefs from './defs';
4
- import * as ComAtprotoRepoStrongRef from '../repo/strongRef';
3
+ import * as ToolsOzoneModerationDefs from './defs';
4
+ import * as ComAtprotoAdminDefs from '../../../com/atproto/admin/defs';
5
+ import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef';
5
6
  export interface QueryParams {
6
7
  }
7
8
  export interface InputSchema {
8
- event: ComAtprotoAdminDefs.ModEventTakedown | ComAtprotoAdminDefs.ModEventAcknowledge | ComAtprotoAdminDefs.ModEventEscalate | ComAtprotoAdminDefs.ModEventComment | ComAtprotoAdminDefs.ModEventLabel | ComAtprotoAdminDefs.ModEventReport | ComAtprotoAdminDefs.ModEventMute | ComAtprotoAdminDefs.ModEventReverseTakedown | ComAtprotoAdminDefs.ModEventUnmute | ComAtprotoAdminDefs.ModEventEmail | ComAtprotoAdminDefs.ModEventTag | {
9
+ event: ToolsOzoneModerationDefs.ModEventTakedown | ToolsOzoneModerationDefs.ModEventAcknowledge | ToolsOzoneModerationDefs.ModEventEscalate | ToolsOzoneModerationDefs.ModEventComment | ToolsOzoneModerationDefs.ModEventLabel | ToolsOzoneModerationDefs.ModEventReport | ToolsOzoneModerationDefs.ModEventMute | ToolsOzoneModerationDefs.ModEventReverseTakedown | ToolsOzoneModerationDefs.ModEventUnmute | ToolsOzoneModerationDefs.ModEventEmail | ToolsOzoneModerationDefs.ModEventTag | {
9
10
  $type: string;
10
11
  [k: string]: unknown;
11
12
  };
@@ -17,7 +18,7 @@ export interface InputSchema {
17
18
  createdBy: string;
18
19
  [k: string]: unknown;
19
20
  }
20
- export type OutputSchema = ComAtprotoAdminDefs.ModEventView;
21
+ export type OutputSchema = ToolsOzoneModerationDefs.ModEventView;
21
22
  export interface HandlerInput {
22
23
  encoding: 'application/json';
23
24
  body: InputSchema;
@@ -1,11 +1,11 @@
1
1
  import express from 'express';
2
2
  import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
3
- import * as ComAtprotoAdminDefs from './defs';
3
+ import * as ToolsOzoneModerationDefs from './defs';
4
4
  export interface QueryParams {
5
5
  id: number;
6
6
  }
7
7
  export type InputSchema = undefined;
8
- export type OutputSchema = ComAtprotoAdminDefs.ModEventViewDetail;
8
+ export type OutputSchema = ToolsOzoneModerationDefs.ModEventViewDetail;
9
9
  export type HandlerInput = undefined;
10
10
  export interface HandlerSuccess {
11
11
  encoding: 'application/json';
@@ -1,12 +1,12 @@
1
1
  import express from 'express';
2
2
  import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
3
- import * as ComAtprotoAdminDefs from './defs';
3
+ import * as ToolsOzoneModerationDefs from './defs';
4
4
  export interface QueryParams {
5
5
  uri: string;
6
6
  cid?: string;
7
7
  }
8
8
  export type InputSchema = undefined;
9
- export type OutputSchema = ComAtprotoAdminDefs.RecordViewDetail;
9
+ export type OutputSchema = ToolsOzoneModerationDefs.RecordViewDetail;
10
10
  export type HandlerInput = undefined;
11
11
  export interface HandlerSuccess {
12
12
  encoding: 'application/json';
@@ -1,11 +1,11 @@
1
1
  import express from 'express';
2
2
  import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
3
- import * as ComAtprotoAdminDefs from './defs';
3
+ import * as ToolsOzoneModerationDefs from './defs';
4
4
  export interface QueryParams {
5
5
  did: string;
6
6
  }
7
7
  export type InputSchema = undefined;
8
- export type OutputSchema = ComAtprotoAdminDefs.RepoViewDetail;
8
+ export type OutputSchema = ToolsOzoneModerationDefs.RepoViewDetail;
9
9
  export type HandlerInput = undefined;
10
10
  export interface HandlerSuccess {
11
11
  encoding: 'application/json';
@@ -1,6 +1,6 @@
1
1
  import express from 'express';
2
2
  import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
3
- import * as ComAtprotoAdminDefs from './defs';
3
+ import * as ToolsOzoneModerationDefs from './defs';
4
4
  export interface QueryParams {
5
5
  types?: string[];
6
6
  createdBy?: string;
@@ -22,7 +22,7 @@ export interface QueryParams {
22
22
  export type InputSchema = undefined;
23
23
  export interface OutputSchema {
24
24
  cursor?: string;
25
- events: ComAtprotoAdminDefs.ModEventView[];
25
+ events: ToolsOzoneModerationDefs.ModEventView[];
26
26
  [k: string]: unknown;
27
27
  }
28
28
  export type HandlerInput = undefined;
@@ -1,6 +1,6 @@
1
1
  import express from 'express';
2
2
  import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
3
- import * as ComAtprotoAdminDefs from './defs';
3
+ import * as ToolsOzoneModerationDefs from './defs';
4
4
  export interface QueryParams {
5
5
  subject?: string;
6
6
  comment?: string;
@@ -24,7 +24,7 @@ export interface QueryParams {
24
24
  export type InputSchema = undefined;
25
25
  export interface OutputSchema {
26
26
  cursor?: string;
27
- subjectStatuses: ComAtprotoAdminDefs.SubjectStatusView[];
27
+ subjectStatuses: ToolsOzoneModerationDefs.SubjectStatusView[];
28
28
  [k: string]: unknown;
29
29
  }
30
30
  export type HandlerInput = undefined;
@@ -1,6 +1,6 @@
1
1
  import express from 'express';
2
2
  import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
3
- import * as ComAtprotoAdminDefs from './defs';
3
+ import * as ToolsOzoneModerationDefs from './defs';
4
4
  export interface QueryParams {
5
5
  term?: string;
6
6
  q?: string;
@@ -10,7 +10,7 @@ export interface QueryParams {
10
10
  export type InputSchema = undefined;
11
11
  export interface OutputSchema {
12
12
  cursor?: string;
13
- repos: ComAtprotoAdminDefs.RepoView[];
13
+ repos: ToolsOzoneModerationDefs.RepoView[];
14
14
  [k: string]: unknown;
15
15
  }
16
16
  export type HandlerInput = undefined;
@@ -1,5 +1,6 @@
1
1
  import { CID } from 'multiformats/cid';
2
2
  import { AtUri } from '@atproto/syntax';
3
+ import { Keypair } from '@atproto/crypto';
3
4
  import { IdResolver } from '@atproto/identity';
4
5
  import AtpAgent from '@atproto/api';
5
6
  import { Database } from '../db';
@@ -17,17 +18,17 @@ import { OzoneConfig } from '../config';
17
18
  export type ModerationServiceCreator = (db: Database) => ModerationService;
18
19
  export declare class ModerationService {
19
20
  db: Database;
21
+ signingKey: Keypair;
22
+ signingKeyId: number;
20
23
  cfg: OzoneConfig;
21
24
  backgroundQueue: BackgroundQueue;
22
25
  idResolver: IdResolver;
23
26
  eventPusher: EventPusher;
24
27
  appviewAgent: AtpAgent;
25
28
  private createAuthHeaders;
26
- serverDid: string;
27
29
  imgInvalidator?: ImageInvalidator | undefined;
28
- cdnPaths?: string[] | undefined;
29
- constructor(db: Database, cfg: OzoneConfig, backgroundQueue: BackgroundQueue, idResolver: IdResolver, eventPusher: EventPusher, appviewAgent: AtpAgent, createAuthHeaders: (aud: string) => Promise<AuthHeaders>, serverDid: string, imgInvalidator?: ImageInvalidator | undefined, cdnPaths?: string[] | undefined);
30
- static creator(cfg: OzoneConfig, backgroundQueue: BackgroundQueue, idResolver: IdResolver, eventPusher: EventPusher, appviewAgent: AtpAgent, createAuthHeaders: (aud: string) => Promise<AuthHeaders>, serverDid: string, imgInvalidator?: ImageInvalidator, cdnPaths?: string[]): (db: Database) => ModerationService;
30
+ constructor(db: Database, signingKey: Keypair, signingKeyId: number, cfg: OzoneConfig, backgroundQueue: BackgroundQueue, idResolver: IdResolver, eventPusher: EventPusher, appviewAgent: AtpAgent, createAuthHeaders: (aud: string) => Promise<AuthHeaders>, imgInvalidator?: ImageInvalidator | undefined);
31
+ static creator(signingKey: Keypair, signingKeyId: number, cfg: OzoneConfig, backgroundQueue: BackgroundQueue, idResolver: IdResolver, eventPusher: EventPusher, appviewAgent: AtpAgent, createAuthHeaders: (aud: string) => Promise<AuthHeaders>, imgInvalidator?: ImageInvalidator): (db: Database) => ModerationService;
31
32
  views: ModerationViews;
32
33
  getEvent(id: number): Promise<ModerationEventRow | undefined>;
33
34
  getEventOrThrow(id: number): Promise<ModerationEventRow>;
@@ -63,13 +64,13 @@ export declare class ModerationService {
63
64
  id: number;
64
65
  did: string;
65
66
  createdAt: string;
67
+ tags: string[] | null;
66
68
  updatedAt: string;
67
- reviewState: "com.atproto.admin.defs#reviewOpen" | "com.atproto.admin.defs#reviewEscalated" | "com.atproto.admin.defs#reviewClosed" | "com.atproto.admin.defs#reviewNone";
68
- blobCids: string[] | null;
69
+ reviewState: "tools.ozone.moderation.defs#reviewOpen" | "tools.ozone.moderation.defs#reviewEscalated" | "tools.ozone.moderation.defs#reviewClosed" | "tools.ozone.moderation.defs#reviewNone";
69
70
  comment: string | null;
71
+ blobCids: string[] | null;
70
72
  lastReportedAt: string | null;
71
73
  lastReviewedAt: string | null;
72
- tags: string[] | null;
73
74
  muteUntil: string | null;
74
75
  lastReviewedBy: string | null;
75
76
  lastAppealedAt: string | null;
@@ -90,15 +91,15 @@ export declare class ModerationService {
90
91
  }>;
91
92
  getLastReversibleEventForSubject(subject: ReversalSubject): Promise<{
92
93
  id: number;
93
- subjectBlobCids: string[] | null;
94
- createdBy: string;
95
94
  createdAt: string;
95
+ createdBy: string;
96
+ action: "tools.ozone.moderation.defs#modEventTakedown" | "tools.ozone.moderation.defs#modEventAcknowledge" | "tools.ozone.moderation.defs#modEventEscalate" | "tools.ozone.moderation.defs#modEventComment" | "tools.ozone.moderation.defs#modEventLabel" | "tools.ozone.moderation.defs#modEventReport" | "tools.ozone.moderation.defs#modEventMute" | "tools.ozone.moderation.defs#modEventReverseTakedown" | "tools.ozone.moderation.defs#modEventEmail" | "tools.ozone.moderation.defs#modEventResolveAppeal" | "tools.ozone.moderation.defs#modEventTag";
97
+ subjectType: "com.atproto.admin.defs#repoRef" | "com.atproto.repo.strongRef";
98
+ subjectBlobCids: string[] | null;
96
99
  comment: string | null;
97
100
  createLabelVals: string | null;
98
101
  negateLabelVals: string | null;
99
102
  durationInHours: number | null;
100
- action: "com.atproto.admin.defs#modEventTakedown" | "com.atproto.admin.defs#modEventAcknowledge" | "com.atproto.admin.defs#modEventEscalate" | "com.atproto.admin.defs#modEventComment" | "com.atproto.admin.defs#modEventLabel" | "com.atproto.admin.defs#modEventReport" | "com.atproto.admin.defs#modEventMute" | "com.atproto.admin.defs#modEventReverseTakedown" | "com.atproto.admin.defs#modEventEmail" | "com.atproto.admin.defs#modEventResolveAppeal" | "com.atproto.admin.defs#modEventTag";
101
- subjectType: "com.atproto.admin.defs#repoRef" | "com.atproto.repo.strongRef";
102
103
  subjectDid: string;
103
104
  subjectUri: string | null;
104
105
  subjectCid: string | null;
@@ -149,13 +150,13 @@ export declare class ModerationService {
149
150
  id: number;
150
151
  did: string;
151
152
  createdAt: string;
153
+ tags: string[] | null;
152
154
  updatedAt: string;
153
- reviewState: "com.atproto.admin.defs#reviewOpen" | "com.atproto.admin.defs#reviewEscalated" | "com.atproto.admin.defs#reviewClosed" | "com.atproto.admin.defs#reviewNone";
154
- blobCids: string[] | null;
155
+ reviewState: "tools.ozone.moderation.defs#reviewOpen" | "tools.ozone.moderation.defs#reviewEscalated" | "tools.ozone.moderation.defs#reviewClosed" | "tools.ozone.moderation.defs#reviewNone";
155
156
  comment: string | null;
157
+ blobCids: string[] | null;
156
158
  lastReportedAt: string | null;
157
159
  lastReviewedAt: string | null;
158
- tags: string[] | null;
159
160
  muteUntil: string | null;
160
161
  lastReviewedBy: string | null;
161
162
  lastAppealedAt: string | null;
@@ -172,7 +173,7 @@ export declare class ModerationService {
172
173
  create?: string[];
173
174
  negate?: string[];
174
175
  }): Promise<Label[]>;
175
- createLabels(labels: Label[]): Promise<void>;
176
+ createLabels(labels: Label[]): Promise<Label[]>;
176
177
  sendEmail(opts: {
177
178
  content: string;
178
179
  recipientDid: string;
@@ -1,6 +1,6 @@
1
1
  import { AtUri } from '@atproto/syntax';
2
2
  import { InputSchema as ReportInput } from '../lexicon/types/com/atproto/moderation/createReport';
3
- import { InputSchema as ActionInput } from '../lexicon/types/com/atproto/admin/emitModerationEvent';
3
+ import { InputSchema as ActionInput } from '../lexicon/types/tools/ozone/moderation/emitEvent';
4
4
  import { ModerationEventRow, ModerationSubjectStatusRow } from './types';
5
5
  import { RepoRef } from '../lexicon/types/com/atproto/admin/defs';
6
6
  import { Main as StrongRef } from '../lexicon/types/com/atproto/repo/strongRef';
@@ -1,7 +1,7 @@
1
1
  import { Selectable } from 'kysely';
2
2
  import { ModerationEvent } from '../db/schema/moderation_event';
3
3
  import { ModerationSubjectStatus } from '../db/schema/moderation_subject_status';
4
- import { ComAtprotoAdminDefs } from '@atproto/api';
4
+ import { ToolsOzoneModerationDefs } from '@atproto/api';
5
5
  import { ModSubject } from './subject';
6
6
  export type ModerationEventRow = Selectable<ModerationEvent>;
7
7
  export type ReversibleModerationEvent = Pick<ModerationEventRow, 'createdBy' | 'comment' | 'action'> & {
@@ -16,6 +16,6 @@ export type ModerationSubjectStatusRow = Selectable<ModerationSubjectStatus>;
16
16
  export type ModerationSubjectStatusRowWithHandle = ModerationSubjectStatusRow & {
17
17
  handle: string | null;
18
18
  };
19
- export type ModEventType = ComAtprotoAdminDefs.ModEventTakedown | ComAtprotoAdminDefs.ModEventAcknowledge | ComAtprotoAdminDefs.ModEventEscalate | ComAtprotoAdminDefs.ModEventComment | ComAtprotoAdminDefs.ModEventLabel | ComAtprotoAdminDefs.ModEventReport | ComAtprotoAdminDefs.ModEventMute | ComAtprotoAdminDefs.ModEventReverseTakedown | ComAtprotoAdminDefs.ModEventTag;
19
+ export type ModEventType = ToolsOzoneModerationDefs.ModEventTakedown | ToolsOzoneModerationDefs.ModEventAcknowledge | ToolsOzoneModerationDefs.ModEventEscalate | ToolsOzoneModerationDefs.ModEventComment | ToolsOzoneModerationDefs.ModEventLabel | ToolsOzoneModerationDefs.ModEventReport | ToolsOzoneModerationDefs.ModEventMute | ToolsOzoneModerationDefs.ModEventReverseTakedown | ToolsOzoneModerationDefs.ModEventTag;
20
20
  export declare const UNSPECCED_TAKEDOWN_LABEL = "!unspecced-takedown";
21
21
  export declare const UNSPECCED_TAKEDOWN_BLOBS_LABEL = "!unspecced-takedown-blobs";
@@ -1,3 +1,9 @@
1
+ import { Keypair } from '@atproto/crypto';
1
2
  import { LabelRow } from '../db/schema/label';
2
3
  import { Label } from '../lexicon/types/com/atproto/label/defs';
4
+ export type SignedLabel = Label & {
5
+ sig: Uint8Array;
6
+ };
3
7
  export declare const formatLabel: (row: LabelRow) => Label;
8
+ export declare const formatLabelRow: (label: Label, signingKeyId?: number) => Omit<LabelRow, 'id'>;
9
+ export declare const signLabel: (label: Label, signingKey: Keypair) => Promise<SignedLabel>;
@@ -1,10 +1,13 @@
1
1
  import AtpAgent, { AppBskyFeedDefs } from '@atproto/api';
2
2
  import { BlobRef } from '@atproto/lexicon';
3
+ import { Keypair } from '@atproto/crypto';
3
4
  import { Database } from '../db';
4
- import { ModEventView, RepoView, RepoViewDetail, RecordView, RecordViewDetail, ReportViewDetail, BlobView, SubjectStatusView, ModEventViewDetail, AccountView } from '../lexicon/types/com/atproto/admin/defs';
5
+ import { ModEventView, RepoView, RepoViewDetail, RecordView, RecordViewDetail, BlobView, SubjectStatusView, ModEventViewDetail } from '../lexicon/types/tools/ozone/moderation/defs';
6
+ import { AccountView } from '../lexicon/types/com/atproto/admin/defs';
5
7
  import { OutputSchema as ReportOutput } from '../lexicon/types/com/atproto/moderation/createReport';
6
8
  import { Label } from '../lexicon/types/com/atproto/label/defs';
7
9
  import { ModerationEventRowWithHandle, ModerationSubjectStatusRowWithHandle } from './types';
10
+ import { LabelRow } from '../db/schema/label';
8
11
  export type AuthHeaders = {
9
12
  headers: {
10
13
  authorization: string;
@@ -12,9 +15,11 @@ export type AuthHeaders = {
12
15
  };
13
16
  export declare class ModerationViews {
14
17
  private db;
18
+ private signingKey;
19
+ private signingKeyId;
15
20
  private appviewAgent;
16
21
  private appviewAuth;
17
- constructor(db: Database, appviewAgent: AtpAgent, appviewAuth: () => Promise<AuthHeaders>);
22
+ constructor(db: Database, signingKey: Keypair, signingKeyId: number, appviewAgent: AtpAgent, appviewAuth: () => Promise<AuthHeaders>);
18
23
  getAccoutInfosByDid(dids: string[]): Promise<Map<string, AccountView>>;
19
24
  repos(dids: string[]): Promise<Map<string, RepoView>>;
20
25
  formatEvent(event: ModerationEventRowWithHandle): ModEventView;
@@ -27,6 +32,7 @@ export declare class ModerationViews {
27
32
  subject(subject: string): Promise<SubjectView>;
28
33
  blob(blobs: BlobRef[]): Promise<BlobView[]>;
29
34
  labels(subject: string, includeNeg?: boolean): Promise<Label[]>;
35
+ formatLabelAndEnsureSig(row: LabelRow): Promise<Label>;
30
36
  getSubjectStatus(subjects: string[]): Promise<Map<string, ModerationSubjectStatusRowWithHandle>>;
31
37
  formatSubjectStatus(status: ModerationSubjectStatusRowWithHandle): SubjectStatusView;
32
38
  fetchAuthorFeed(actor: string): Promise<AppBskyFeedDefs.FeedViewPost[]>;
@@ -35,7 +41,7 @@ type RecordSubject = {
35
41
  uri: string;
36
42
  cid?: string;
37
43
  };
38
- type SubjectView = ModEventViewDetail['subject'] & ReportViewDetail['subject'];
44
+ type SubjectView = ModEventViewDetail['subject'];
39
45
  type RecordInfo = {
40
46
  uri: string;
41
47
  cid: string;
@@ -1,20 +1,22 @@
1
1
  import TypedEmitter from 'typed-emitter';
2
+ import { Selectable } from 'kysely';
3
+ import { PoolClient } from 'pg';
2
4
  import Database from '../db';
3
5
  import { Labels as LabelsEvt } from '../lexicon/types/com/atproto/label/subscribeLabels';
4
6
  import { Label as LabelTable } from '../db/schema/label';
5
- import { Selectable } from 'kysely';
6
- import { PoolClient } from 'pg';
7
+ import { ModerationService } from '../mod-service';
7
8
  export type { Labels as LabelsEvt } from '../lexicon/types/com/atproto/label/subscribeLabels';
8
9
  type LabelRow = Selectable<LabelTable>;
9
10
  declare const Sequencer_base: new () => SequencerEmitter;
10
11
  export declare class Sequencer extends Sequencer_base {
11
- db: Database;
12
+ modSrvc: ModerationService;
12
13
  lastSeen: number;
14
+ db: Database;
13
15
  destroyed: boolean;
14
16
  pollPromise: Promise<void> | undefined;
15
17
  queued: boolean;
16
18
  conn: PoolClient | undefined;
17
- constructor(db: Database, lastSeen?: number);
19
+ constructor(modSrvc: ModerationService, lastSeen?: number);
18
20
  start(): Promise<void>;
19
21
  destroy(): Promise<void>;
20
22
  curr(): Promise<number | null>;
package/dist/util.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  import { RetryOptions } from '@atproto/common';
2
+ import Database from './db';
3
+ export declare const getSigningKeyId: (db: Database, signingKey: string) => Promise<number>;
2
4
  export declare function retryHttp<T>(fn: () => Promise<T>, opts?: RetryOptions): Promise<T>;
3
5
  export declare function retryableHttp(err: unknown): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/ozone",
3
- "version": "0.0.17-next.0",
3
+ "version": "0.0.17-next.1",
4
4
  "license": "MIT",
5
5
  "description": "Backend service for moderating the Bluesky network.",
6
6
  "keywords": [
@@ -30,12 +30,12 @@
30
30
  "pino-http": "^8.2.1",
31
31
  "typed-emitter": "^2.1.0",
32
32
  "uint8arrays": "3.0.0",
33
- "@atproto/api": "^0.10.5",
34
33
  "@atproto/common": "^0.3.3",
35
34
  "@atproto/identity": "^0.3.2",
36
35
  "@atproto/lexicon": "^0.3.2",
37
- "@atproto/xrpc-server": "^0.4.3",
38
36
  "@atproto/syntax": "^0.2.0",
37
+ "@atproto/xrpc-server": "^0.4.3",
38
+ "@atproto/api": "^0.11.0-next",
39
39
  "@atproto/crypto": "^0.3.0"
40
40
  },
41
41
  "devDependencies": {
@@ -48,13 +48,13 @@
48
48
  "axios": "^0.27.2",
49
49
  "nodemailer": "^6.8.0",
50
50
  "@atproto/dev-env": "^0.2.37",
51
- "@atproto/api": "^0.10.5",
52
- "@atproto/lex-cli": "^0.3.1",
51
+ "@atproto/api": "^0.11.0-next",
52
+ "@atproto/xrpc": "^0.4.2",
53
53
  "@atproto/pds": "^0.4.5",
54
- "@atproto/xrpc": "^0.4.2"
54
+ "@atproto/lex-cli": "^0.3.1"
55
55
  },
56
56
  "scripts": {
57
- "codegen": "lex gen-server ./src/lexicon ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/*",
57
+ "codegen": "lex gen-server ./src/lexicon ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/* ../../lexicons/tools/ozone/*/*",
58
58
  "build": "node ./build.js",
59
59
  "postbuild": "tsc --build tsconfig.build.json",
60
60
  "update-main-to-dist": "node ../../update-main-to-dist.js packages/ozone",
@@ -3,7 +3,7 @@ import { Server } from '../../lexicon'
3
3
  import AppContext from '../../context'
4
4
 
5
5
  export default function (server: Server, ctx: AppContext) {
6
- server.com.atproto.admin.createCommunicationTemplate({
6
+ server.tools.ozone.communication.createTemplate({
7
7
  auth: ctx.authVerifier.modOrAdminToken,
8
8
  handler: async ({ input, auth }) => {
9
9
  const access = auth.credentials