@atproto/ozone 0.1.139 → 0.1.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/api/moderation/emitEvent.d.ts.map +1 -1
- package/dist/api/moderation/emitEvent.js +3 -0
- package/dist/api/moderation/emitEvent.js.map +1 -1
- package/dist/api/report/createReport.d.ts.map +1 -1
- package/dist/api/report/createReport.js +7 -5
- package/dist/api/report/createReport.js.map +1 -1
- package/dist/api/util.d.ts +2 -3
- package/dist/api/util.d.ts.map +1 -1
- package/dist/api/util.js +7 -17
- package/dist/api/util.js.map +1 -1
- package/dist/config/config.d.ts +1 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +1 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/env.d.ts +1 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +1 -0
- package/dist/config/env.js.map +1 -1
- package/dist/context.d.ts +3 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +6 -0
- package/dist/context.js.map +1 -1
- package/dist/db/migrations/20250718T150931000Z-update-appeal-reason-stats.d.ts +5 -0
- package/dist/db/migrations/20250718T150931000Z-update-appeal-reason-stats.d.ts.map +1 -0
- package/dist/db/migrations/20250718T150931000Z-update-appeal-reason-stats.js +228 -0
- package/dist/db/migrations/20250718T150931000Z-update-appeal-reason-stats.js.map +1 -0
- package/dist/db/migrations/index.d.ts +1 -0
- package/dist/db/migrations/index.d.ts.map +1 -1
- package/dist/db/migrations/index.js +2 -1
- package/dist/db/migrations/index.js.map +1 -1
- package/dist/lexicon/index.d.ts +60 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +83 -1
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +758 -16
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +485 -7
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/bookmark/createBookmark.d.ts +16 -0
- package/dist/lexicon/types/app/bsky/bookmark/createBookmark.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/bookmark/createBookmark.js +7 -0
- package/dist/lexicon/types/app/bsky/bookmark/createBookmark.js.map +1 -0
- package/dist/lexicon/types/app/bsky/bookmark/defs.d.ts +25 -0
- package/dist/lexicon/types/app/bsky/bookmark/defs.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/bookmark/defs.js +25 -0
- package/dist/lexicon/types/app/bsky/bookmark/defs.js.map +1 -0
- package/dist/lexicon/types/app/bsky/bookmark/deleteBookmark.d.ts +15 -0
- package/dist/lexicon/types/app/bsky/bookmark/deleteBookmark.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/bookmark/deleteBookmark.js +7 -0
- package/dist/lexicon/types/app/bsky/bookmark/deleteBookmark.js.map +1 -0
- package/dist/lexicon/types/app/bsky/bookmark/getBookmarks.d.ts +24 -0
- package/dist/lexicon/types/app/bsky/bookmark/getBookmarks.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/bookmark/getBookmarks.js +7 -0
- package/dist/lexicon/types/app/bsky/bookmark/getBookmarks.js.map +1 -0
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/defs.js.map +1 -1
- package/dist/lexicon/types/com/atproto/moderation/defs.d.ts +8 -8
- package/dist/lexicon/types/com/atproto/moderation/defs.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/moderation/defs.js +7 -7
- package/dist/lexicon/types/com/atproto/moderation/defs.js.map +1 -1
- package/dist/lexicon/types/com/atproto/temp/dereferenceScope.d.ts +24 -0
- package/dist/lexicon/types/com/atproto/temp/dereferenceScope.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/temp/dereferenceScope.js +7 -0
- package/dist/lexicon/types/com/atproto/temp/dereferenceScope.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/defs.d.ts +92 -0
- package/dist/lexicon/types/tools/ozone/report/defs.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/report/defs.js +98 -0
- package/dist/lexicon/types/tools/ozone/report/defs.js.map +1 -0
- package/dist/mod-service/profile.d.ts +15 -0
- package/dist/mod-service/profile.d.ts.map +1 -0
- package/dist/mod-service/profile.js +135 -0
- package/dist/mod-service/profile.js.map +1 -0
- package/dist/mod-service/status.d.ts.map +1 -1
- package/dist/mod-service/status.js +18 -17
- package/dist/mod-service/status.js.map +1 -1
- package/dist/tag-service/util.d.ts.map +1 -1
- package/dist/tag-service/util.js +7 -1
- package/dist/tag-service/util.js.map +1 -1
- package/package.json +9 -9
- package/src/api/moderation/emitEvent.ts +4 -0
- package/src/api/report/createReport.ts +9 -9
- package/src/api/util.ts +7 -28
- package/src/config/config.ts +3 -1
- package/src/config/env.ts +2 -0
- package/src/context.ts +14 -0
- package/src/db/migrations/20250718T150931000Z-update-appeal-reason-stats.ts +311 -0
- package/src/db/migrations/index.ts +1 -0
- package/src/lexicon/index.ts +131 -0
- package/src/lexicon/lexicons.ts +503 -7
- package/src/lexicon/types/app/bsky/bookmark/createBookmark.ts +35 -0
- package/src/lexicon/types/app/bsky/bookmark/defs.ts +54 -0
- package/src/lexicon/types/app/bsky/bookmark/deleteBookmark.ts +34 -0
- package/src/lexicon/types/app/bsky/bookmark/getBookmarks.ts +42 -0
- package/src/lexicon/types/app/bsky/feed/defs.ts +2 -0
- package/src/lexicon/types/com/atproto/moderation/defs.ts +52 -7
- package/src/lexicon/types/com/atproto/temp/dereferenceScope.ts +42 -0
- package/src/lexicon/types/tools/ozone/report/defs.ts +154 -0
- package/src/mod-service/profile.ts +143 -0
- package/src/mod-service/status.ts +3 -2
- package/src/tag-service/util.ts +9 -1
- package/tests/__snapshots__/report-reason.test.ts.snap +14 -0
- package/tests/report-reason.test.ts +154 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.tests.tsbuildinfo +1 -1
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { Kysely, sql } from 'kysely'
|
|
2
|
+
import { OZONE_APPEAL_REASON_TYPE } from '../../api/util'
|
|
3
|
+
import { REASONAPPEAL } from '../../lexicon/types/com/atproto/moderation/defs'
|
|
4
|
+
import { DatabaseSchemaType } from '../schema'
|
|
5
|
+
import * as modEvent from '../schema/moderation_event'
|
|
6
|
+
import * as recordEventsStats from '../schema/record_events_stats'
|
|
7
|
+
|
|
8
|
+
export async function up(db: Kysely<any>): Promise<void> {
|
|
9
|
+
// Drop and recreate materialized views to update appeal reason counting
|
|
10
|
+
// to include both REASONAPPEAL and OZONE_APPEAL_REASON_TYPE
|
|
11
|
+
// The primary difference between the old and new query is that we were using = and != operators
|
|
12
|
+
// to match against the meta->>'reportType' field and now we use IN and NOT IN
|
|
13
|
+
|
|
14
|
+
// Drop existing materialized views in reverse dependency order
|
|
15
|
+
await db.schema
|
|
16
|
+
.dropView('account_record_events_stats')
|
|
17
|
+
.materialized()
|
|
18
|
+
.execute()
|
|
19
|
+
await db.schema.dropView('record_events_stats').materialized().execute()
|
|
20
|
+
await db.schema.dropView('account_events_stats').materialized().execute()
|
|
21
|
+
|
|
22
|
+
// Recreate account_events_stats with updated appeal counting
|
|
23
|
+
await db.schema
|
|
24
|
+
.createView('account_events_stats')
|
|
25
|
+
.materialized()
|
|
26
|
+
.as(
|
|
27
|
+
(db as Kysely<modEvent.PartialDB>)
|
|
28
|
+
.selectFrom('moderation_event')
|
|
29
|
+
.where('subjectType', '=', 'com.atproto.admin.defs#repoRef')
|
|
30
|
+
.where('subjectUri', 'is', null)
|
|
31
|
+
.select('subjectDid')
|
|
32
|
+
.select([
|
|
33
|
+
(eb) =>
|
|
34
|
+
sql<number>`COUNT(*) FILTER(
|
|
35
|
+
WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventTakedown'
|
|
36
|
+
AND ${eb.ref('durationInHours')} IS NULL
|
|
37
|
+
)`.as('takedownCount'),
|
|
38
|
+
(eb) =>
|
|
39
|
+
sql<number>`COUNT(*) FILTER(
|
|
40
|
+
WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventTakedown'
|
|
41
|
+
AND ${eb.ref('durationInHours')} IS NOT NULL
|
|
42
|
+
)`.as('suspendCount'),
|
|
43
|
+
(eb) =>
|
|
44
|
+
sql<number>`COUNT(*) FILTER(
|
|
45
|
+
WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventEscalate'
|
|
46
|
+
)`.as('escalateCount'),
|
|
47
|
+
(eb) =>
|
|
48
|
+
sql<number>`COUNT(*) FILTER(
|
|
49
|
+
WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventReport'
|
|
50
|
+
AND ${eb.ref('meta')} ->> 'reportType' NOT IN (${REASONAPPEAL}, ${OZONE_APPEAL_REASON_TYPE})
|
|
51
|
+
)`.as('reportCount'),
|
|
52
|
+
(eb) =>
|
|
53
|
+
sql<number>`COUNT(*) FILTER(
|
|
54
|
+
WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventReport'
|
|
55
|
+
AND ${eb.ref('meta')} ->> 'reportType' IN (${REASONAPPEAL}, ${OZONE_APPEAL_REASON_TYPE})
|
|
56
|
+
)`.as('appealCount'),
|
|
57
|
+
])
|
|
58
|
+
.groupBy('subjectDid'),
|
|
59
|
+
)
|
|
60
|
+
.execute()
|
|
61
|
+
|
|
62
|
+
// Recreate record_events_stats with updated appeal counting
|
|
63
|
+
await db.schema
|
|
64
|
+
.createView('record_events_stats')
|
|
65
|
+
.materialized()
|
|
66
|
+
.as(
|
|
67
|
+
(db as Kysely<modEvent.PartialDB>)
|
|
68
|
+
.selectFrom('moderation_event')
|
|
69
|
+
.select([
|
|
70
|
+
'subjectDid',
|
|
71
|
+
'subjectUri',
|
|
72
|
+
(eb) =>
|
|
73
|
+
sql<number>`COUNT(*) FILTER (WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventEscalate')`.as(
|
|
74
|
+
'escalateCount',
|
|
75
|
+
),
|
|
76
|
+
(eb) =>
|
|
77
|
+
sql<number>`COUNT(*) FILTER (WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventReport' AND ${eb.ref('meta')} ->> 'reportType' NOT IN (${REASONAPPEAL}, ${OZONE_APPEAL_REASON_TYPE}))`.as(
|
|
78
|
+
'reportCount',
|
|
79
|
+
),
|
|
80
|
+
(eb) =>
|
|
81
|
+
sql<number>`COUNT(*) FILTER (WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventReport' AND ${eb.ref('meta')} ->> 'reportType' IN (${REASONAPPEAL}, ${OZONE_APPEAL_REASON_TYPE}))`.as(
|
|
82
|
+
'appealCount',
|
|
83
|
+
),
|
|
84
|
+
])
|
|
85
|
+
.where('subjectType', '=', 'com.atproto.repo.strongRef')
|
|
86
|
+
.where('subjectUri', 'is not', null)
|
|
87
|
+
.groupBy(['subjectDid', 'subjectUri']),
|
|
88
|
+
)
|
|
89
|
+
.execute()
|
|
90
|
+
|
|
91
|
+
// Recreate account_record_events_stats (unchanged logic, but depends on record_events_stats)
|
|
92
|
+
await db.schema
|
|
93
|
+
.createView('account_record_events_stats')
|
|
94
|
+
.materialized()
|
|
95
|
+
.as(
|
|
96
|
+
(db as Kysely<recordEventsStats.PartialDB>)
|
|
97
|
+
.selectFrom('record_events_stats')
|
|
98
|
+
.select([
|
|
99
|
+
'subjectDid',
|
|
100
|
+
(eb) =>
|
|
101
|
+
sql<number>`SUM(${eb.ref('reportCount')})::bigint`.as(
|
|
102
|
+
'totalReports',
|
|
103
|
+
),
|
|
104
|
+
(eb) =>
|
|
105
|
+
sql<number>`COUNT(*) FILTER (WHERE ${eb.ref('reportCount')} > 0)`.as(
|
|
106
|
+
'reportedCount',
|
|
107
|
+
),
|
|
108
|
+
(eb) =>
|
|
109
|
+
sql<number>`COUNT(*) FILTER (WHERE ${eb.ref('escalateCount')} > 0)`.as(
|
|
110
|
+
'escalatedCount',
|
|
111
|
+
),
|
|
112
|
+
(eb) =>
|
|
113
|
+
sql<number>`COUNT(*) FILTER (WHERE ${eb.ref('appealCount')} > 0)`.as(
|
|
114
|
+
'appealedCount',
|
|
115
|
+
),
|
|
116
|
+
])
|
|
117
|
+
.groupBy('subjectDid'),
|
|
118
|
+
)
|
|
119
|
+
.execute()
|
|
120
|
+
|
|
121
|
+
// Recreate all indexes for the materialized views
|
|
122
|
+
await db.schema
|
|
123
|
+
.createIndex('account_events_stats_did_idx')
|
|
124
|
+
.unique()
|
|
125
|
+
.on('account_events_stats')
|
|
126
|
+
.column('subjectDid')
|
|
127
|
+
.execute()
|
|
128
|
+
|
|
129
|
+
await db.schema
|
|
130
|
+
.createIndex('account_events_stats_suspend_count_idx')
|
|
131
|
+
.on('account_events_stats')
|
|
132
|
+
.expression(sql`"suspendCount" ASC NULLS FIRST`)
|
|
133
|
+
.column('subjectDid')
|
|
134
|
+
.execute()
|
|
135
|
+
|
|
136
|
+
await db.schema
|
|
137
|
+
.createIndex('record_events_stats_uri_idx')
|
|
138
|
+
.unique()
|
|
139
|
+
.on('record_events_stats')
|
|
140
|
+
.column('subjectUri')
|
|
141
|
+
.execute()
|
|
142
|
+
|
|
143
|
+
await db.schema
|
|
144
|
+
.createIndex('record_events_stats_did_idx')
|
|
145
|
+
.on('record_events_stats')
|
|
146
|
+
.column('subjectDid')
|
|
147
|
+
.execute()
|
|
148
|
+
|
|
149
|
+
await db.schema
|
|
150
|
+
.createIndex('account_record_events_stats_did_idx')
|
|
151
|
+
.unique()
|
|
152
|
+
.on('account_record_events_stats')
|
|
153
|
+
.column('subjectDid')
|
|
154
|
+
.execute()
|
|
155
|
+
|
|
156
|
+
await db.schema
|
|
157
|
+
.createIndex('account_record_events_stats_reported_count_idx')
|
|
158
|
+
.on('account_record_events_stats')
|
|
159
|
+
.expression(sql`"reportedCount" ASC NULLS FIRST`)
|
|
160
|
+
.column('subjectDid')
|
|
161
|
+
.execute()
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export async function down(db: Kysely<DatabaseSchemaType>): Promise<void> {
|
|
165
|
+
// Drop the updated materialized views
|
|
166
|
+
await db.schema
|
|
167
|
+
.dropView('account_record_events_stats')
|
|
168
|
+
.materialized()
|
|
169
|
+
.execute()
|
|
170
|
+
await db.schema.dropView('record_events_stats').materialized().execute()
|
|
171
|
+
await db.schema.dropView('account_events_stats').materialized().execute()
|
|
172
|
+
|
|
173
|
+
// Recreate the original views with single appeal reason type
|
|
174
|
+
await db.schema
|
|
175
|
+
.createView('account_events_stats')
|
|
176
|
+
.materialized()
|
|
177
|
+
.as(
|
|
178
|
+
(db as Kysely<modEvent.PartialDB>)
|
|
179
|
+
.selectFrom('moderation_event')
|
|
180
|
+
.where('subjectType', '=', 'com.atproto.admin.defs#repoRef')
|
|
181
|
+
.where('subjectUri', 'is', null)
|
|
182
|
+
.select('subjectDid')
|
|
183
|
+
.select([
|
|
184
|
+
(eb) =>
|
|
185
|
+
sql<number>`COUNT(*) FILTER(
|
|
186
|
+
WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventTakedown'
|
|
187
|
+
AND ${eb.ref('durationInHours')} IS NULL
|
|
188
|
+
)`.as('takedownCount'),
|
|
189
|
+
(eb) =>
|
|
190
|
+
sql<number>`COUNT(*) FILTER(
|
|
191
|
+
WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventTakedown'
|
|
192
|
+
AND ${eb.ref('durationInHours')} IS NOT NULL
|
|
193
|
+
)`.as('suspendCount'),
|
|
194
|
+
(eb) =>
|
|
195
|
+
sql<number>`COUNT(*) FILTER(
|
|
196
|
+
WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventEscalate'
|
|
197
|
+
)`.as('escalateCount'),
|
|
198
|
+
(eb) =>
|
|
199
|
+
sql<number>`COUNT(*) FILTER(
|
|
200
|
+
WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventReport'
|
|
201
|
+
AND ${eb.ref('meta')} ->> 'reportType' != ${REASONAPPEAL}
|
|
202
|
+
)`.as('reportCount'),
|
|
203
|
+
(eb) =>
|
|
204
|
+
sql<number>`COUNT(*) FILTER(
|
|
205
|
+
WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventReport'
|
|
206
|
+
AND ${eb.ref('meta')} ->> 'reportType' = ${REASONAPPEAL}
|
|
207
|
+
)`.as('appealCount'),
|
|
208
|
+
])
|
|
209
|
+
.groupBy('subjectDid'),
|
|
210
|
+
)
|
|
211
|
+
.execute()
|
|
212
|
+
|
|
213
|
+
await db.schema
|
|
214
|
+
.createView('record_events_stats')
|
|
215
|
+
.materialized()
|
|
216
|
+
.as(
|
|
217
|
+
(db as Kysely<modEvent.PartialDB>)
|
|
218
|
+
.selectFrom('moderation_event')
|
|
219
|
+
.select([
|
|
220
|
+
'subjectDid',
|
|
221
|
+
'subjectUri',
|
|
222
|
+
(eb) =>
|
|
223
|
+
sql<number>`COUNT(*) FILTER (WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventEscalate')`.as(
|
|
224
|
+
'escalateCount',
|
|
225
|
+
),
|
|
226
|
+
(eb) =>
|
|
227
|
+
sql<number>`COUNT(*) FILTER (WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventReport' AND ${eb.ref('meta')} ->> 'reportType' != 'com.atproto.moderation.defs#reasonAppeal')`.as(
|
|
228
|
+
'reportCount',
|
|
229
|
+
),
|
|
230
|
+
(eb) =>
|
|
231
|
+
sql<number>`COUNT(*) FILTER (WHERE ${eb.ref('action')} = 'tools.ozone.moderation.defs#modEventReport' AND ${eb.ref('meta')} ->> 'reportType' = 'com.atproto.moderation.defs#reasonAppeal')`.as(
|
|
232
|
+
'appealCount',
|
|
233
|
+
),
|
|
234
|
+
])
|
|
235
|
+
.where('subjectType', '=', 'com.atproto.repo.strongRef')
|
|
236
|
+
.where('subjectUri', 'is not', null)
|
|
237
|
+
.groupBy(['subjectDid', 'subjectUri']),
|
|
238
|
+
)
|
|
239
|
+
.execute()
|
|
240
|
+
|
|
241
|
+
await db.schema
|
|
242
|
+
.createView('account_record_events_stats')
|
|
243
|
+
.materialized()
|
|
244
|
+
.as(
|
|
245
|
+
(db as Kysely<recordEventsStats.PartialDB>)
|
|
246
|
+
.selectFrom('record_events_stats')
|
|
247
|
+
.select([
|
|
248
|
+
'subjectDid',
|
|
249
|
+
(eb) =>
|
|
250
|
+
sql<number>`SUM(${eb.ref('reportCount')})::bigint`.as(
|
|
251
|
+
'totalReports',
|
|
252
|
+
),
|
|
253
|
+
(eb) =>
|
|
254
|
+
sql<number>`COUNT(*) FILTER (WHERE ${eb.ref('reportCount')} > 0)`.as(
|
|
255
|
+
'reportedCount',
|
|
256
|
+
),
|
|
257
|
+
(eb) =>
|
|
258
|
+
sql<number>`COUNT(*) FILTER (WHERE ${eb.ref('escalateCount')} > 0)`.as(
|
|
259
|
+
'escalatedCount',
|
|
260
|
+
),
|
|
261
|
+
(eb) =>
|
|
262
|
+
sql<number>`COUNT(*) FILTER (WHERE ${eb.ref('appealCount')} > 0)`.as(
|
|
263
|
+
'appealedCount',
|
|
264
|
+
),
|
|
265
|
+
])
|
|
266
|
+
.groupBy('subjectDid'),
|
|
267
|
+
)
|
|
268
|
+
.execute()
|
|
269
|
+
|
|
270
|
+
// Recreate indexes
|
|
271
|
+
await db.schema
|
|
272
|
+
.createIndex('account_events_stats_did_idx')
|
|
273
|
+
.unique()
|
|
274
|
+
.on('account_events_stats')
|
|
275
|
+
.column('subjectDid')
|
|
276
|
+
.execute()
|
|
277
|
+
|
|
278
|
+
await db.schema
|
|
279
|
+
.createIndex('account_events_stats_suspend_count_idx')
|
|
280
|
+
.on('account_events_stats')
|
|
281
|
+
.expression(sql`"suspendCount" ASC NULLS FIRST`)
|
|
282
|
+
.column('subjectDid')
|
|
283
|
+
.execute()
|
|
284
|
+
|
|
285
|
+
await db.schema
|
|
286
|
+
.createIndex('record_events_stats_uri_idx')
|
|
287
|
+
.unique()
|
|
288
|
+
.on('record_events_stats')
|
|
289
|
+
.column('subjectUri')
|
|
290
|
+
.execute()
|
|
291
|
+
|
|
292
|
+
await db.schema
|
|
293
|
+
.createIndex('record_events_stats_did_idx')
|
|
294
|
+
.on('record_events_stats')
|
|
295
|
+
.column('subjectDid')
|
|
296
|
+
.execute()
|
|
297
|
+
|
|
298
|
+
await db.schema
|
|
299
|
+
.createIndex('account_record_events_stats_did_idx')
|
|
300
|
+
.unique()
|
|
301
|
+
.on('account_record_events_stats')
|
|
302
|
+
.column('subjectDid')
|
|
303
|
+
.execute()
|
|
304
|
+
|
|
305
|
+
await db.schema
|
|
306
|
+
.createIndex('account_record_events_stats_reported_count_idx')
|
|
307
|
+
.on('account_record_events_stats')
|
|
308
|
+
.expression(sql`"reportedCount" ASC NULLS FIRST`)
|
|
309
|
+
.column('subjectDid')
|
|
310
|
+
.execute()
|
|
311
|
+
}
|
|
@@ -29,3 +29,4 @@ export * as _20250609T110704000Z from './20250609T110704000Z-safelink'
|
|
|
29
29
|
export * as _20250618T180246000Z from './20250618T180246000Z-add-mod-tool-to-moderation-event'
|
|
30
30
|
export * as _20250701T000000000Z from './20250701T000000000Z-add-age-assurance-state'
|
|
31
31
|
export * as _20250715T000000000Z from './20250715T000000000Z-add-mod-event-external-id'
|
|
32
|
+
export * as _20250718T150931000Z from './20250718T150931000Z-update-appeal-reason-stats'
|
package/src/lexicon/index.ts
CHANGED
|
@@ -17,6 +17,9 @@ import * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestio
|
|
|
17
17
|
import * as AppBskyActorPutPreferences from './types/app/bsky/actor/putPreferences.js'
|
|
18
18
|
import * as AppBskyActorSearchActors from './types/app/bsky/actor/searchActors.js'
|
|
19
19
|
import * as AppBskyActorSearchActorsTypeahead from './types/app/bsky/actor/searchActorsTypeahead.js'
|
|
20
|
+
import * as AppBskyBookmarkCreateBookmark from './types/app/bsky/bookmark/createBookmark.js'
|
|
21
|
+
import * as AppBskyBookmarkDeleteBookmark from './types/app/bsky/bookmark/deleteBookmark.js'
|
|
22
|
+
import * as AppBskyBookmarkGetBookmarks from './types/app/bsky/bookmark/getBookmarks.js'
|
|
20
23
|
import * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator.js'
|
|
21
24
|
import * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds.js'
|
|
22
25
|
import * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes.js'
|
|
@@ -195,6 +198,7 @@ import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscrib
|
|
|
195
198
|
import * as ComAtprotoTempAddReservedHandle from './types/com/atproto/temp/addReservedHandle.js'
|
|
196
199
|
import * as ComAtprotoTempCheckHandleAvailability from './types/com/atproto/temp/checkHandleAvailability.js'
|
|
197
200
|
import * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue.js'
|
|
201
|
+
import * as ComAtprotoTempDereferenceScope from './types/com/atproto/temp/dereferenceScope.js'
|
|
198
202
|
import * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels.js'
|
|
199
203
|
import * as ComAtprotoTempRequestPhoneVerification from './types/com/atproto/temp/requestPhoneVerification.js'
|
|
200
204
|
import * as ComAtprotoTempRevokeAccountCredentials from './types/com/atproto/temp/revokeAccountCredentials.js'
|
|
@@ -286,6 +290,75 @@ export const TOOLS_OZONE_MODERATION = {
|
|
|
286
290
|
DefsTimelineEventPlcTombstone:
|
|
287
291
|
'tools.ozone.moderation.defs#timelineEventPlcTombstone',
|
|
288
292
|
}
|
|
293
|
+
export const TOOLS_OZONE_REPORT = {
|
|
294
|
+
DefsReasonAppeal: 'tools.ozone.report.defs#reasonAppeal',
|
|
295
|
+
DefsReasonViolenceAnimalWelfare:
|
|
296
|
+
'tools.ozone.report.defs#reasonViolenceAnimalWelfare',
|
|
297
|
+
DefsReasonViolenceThreats: 'tools.ozone.report.defs#reasonViolenceThreats',
|
|
298
|
+
DefsReasonViolenceGraphicContent:
|
|
299
|
+
'tools.ozone.report.defs#reasonViolenceGraphicContent',
|
|
300
|
+
DefsReasonViolenceSelfHarm: 'tools.ozone.report.defs#reasonViolenceSelfHarm',
|
|
301
|
+
DefsReasonViolenceGlorification:
|
|
302
|
+
'tools.ozone.report.defs#reasonViolenceGlorification',
|
|
303
|
+
DefsReasonViolenceExtremistContent:
|
|
304
|
+
'tools.ozone.report.defs#reasonViolenceExtremistContent',
|
|
305
|
+
DefsReasonViolenceTrafficking:
|
|
306
|
+
'tools.ozone.report.defs#reasonViolenceTrafficking',
|
|
307
|
+
DefsReasonViolenceOther: 'tools.ozone.report.defs#reasonViolenceOther',
|
|
308
|
+
DefsReasonSexualAbuseContent:
|
|
309
|
+
'tools.ozone.report.defs#reasonSexualAbuseContent',
|
|
310
|
+
DefsReasonSexualNCII: 'tools.ozone.report.defs#reasonSexualNCII',
|
|
311
|
+
DefsReasonSexualSextortion: 'tools.ozone.report.defs#reasonSexualSextortion',
|
|
312
|
+
DefsReasonSexualDeepfake: 'tools.ozone.report.defs#reasonSexualDeepfake',
|
|
313
|
+
DefsReasonSexualAnimal: 'tools.ozone.report.defs#reasonSexualAnimal',
|
|
314
|
+
DefsReasonSexualUnlabeled: 'tools.ozone.report.defs#reasonSexualUnlabeled',
|
|
315
|
+
DefsReasonSexualOther: 'tools.ozone.report.defs#reasonSexualOther',
|
|
316
|
+
DefsReasonChildSafetyCSAM: 'tools.ozone.report.defs#reasonChildSafetyCSAM',
|
|
317
|
+
DefsReasonChildSafetyGroom: 'tools.ozone.report.defs#reasonChildSafetyGroom',
|
|
318
|
+
DefsReasonChildSafetyMinorPrivacy:
|
|
319
|
+
'tools.ozone.report.defs#reasonChildSafetyMinorPrivacy',
|
|
320
|
+
DefsReasonChildSafetyEndangerment:
|
|
321
|
+
'tools.ozone.report.defs#reasonChildSafetyEndangerment',
|
|
322
|
+
DefsReasonChildSafetyHarassment:
|
|
323
|
+
'tools.ozone.report.defs#reasonChildSafetyHarassment',
|
|
324
|
+
DefsReasonChildSafetyPromotion:
|
|
325
|
+
'tools.ozone.report.defs#reasonChildSafetyPromotion',
|
|
326
|
+
DefsReasonChildSafetyOther: 'tools.ozone.report.defs#reasonChildSafetyOther',
|
|
327
|
+
DefsReasonHarassmentTroll: 'tools.ozone.report.defs#reasonHarassmentTroll',
|
|
328
|
+
DefsReasonHarassmentTargeted:
|
|
329
|
+
'tools.ozone.report.defs#reasonHarassmentTargeted',
|
|
330
|
+
DefsReasonHarassmentHateSpeech:
|
|
331
|
+
'tools.ozone.report.defs#reasonHarassmentHateSpeech',
|
|
332
|
+
DefsReasonHarassmentDoxxing:
|
|
333
|
+
'tools.ozone.report.defs#reasonHarassmentDoxxing',
|
|
334
|
+
DefsReasonHarassmentOther: 'tools.ozone.report.defs#reasonHarassmentOther',
|
|
335
|
+
DefsReasonMisleadingBot: 'tools.ozone.report.defs#reasonMisleadingBot',
|
|
336
|
+
DefsReasonMisleadingImpersonation:
|
|
337
|
+
'tools.ozone.report.defs#reasonMisleadingImpersonation',
|
|
338
|
+
DefsReasonMisleadingSpam: 'tools.ozone.report.defs#reasonMisleadingSpam',
|
|
339
|
+
DefsReasonMisleadingScam: 'tools.ozone.report.defs#reasonMisleadingScam',
|
|
340
|
+
DefsReasonMisleadingSyntheticContent:
|
|
341
|
+
'tools.ozone.report.defs#reasonMisleadingSyntheticContent',
|
|
342
|
+
DefsReasonMisleadingMisinformation:
|
|
343
|
+
'tools.ozone.report.defs#reasonMisleadingMisinformation',
|
|
344
|
+
DefsReasonMisleadingOther: 'tools.ozone.report.defs#reasonMisleadingOther',
|
|
345
|
+
DefsReasonRuleSiteSecurity: 'tools.ozone.report.defs#reasonRuleSiteSecurity',
|
|
346
|
+
DefsReasonRuleStolenContent:
|
|
347
|
+
'tools.ozone.report.defs#reasonRuleStolenContent',
|
|
348
|
+
DefsReasonRuleProhibitedSales:
|
|
349
|
+
'tools.ozone.report.defs#reasonRuleProhibitedSales',
|
|
350
|
+
DefsReasonRuleBanEvasion: 'tools.ozone.report.defs#reasonRuleBanEvasion',
|
|
351
|
+
DefsReasonRuleOther: 'tools.ozone.report.defs#reasonRuleOther',
|
|
352
|
+
DefsReasonCivicElectoralProcess:
|
|
353
|
+
'tools.ozone.report.defs#reasonCivicElectoralProcess',
|
|
354
|
+
DefsReasonCivicDisclosure: 'tools.ozone.report.defs#reasonCivicDisclosure',
|
|
355
|
+
DefsReasonCivicInterference:
|
|
356
|
+
'tools.ozone.report.defs#reasonCivicInterference',
|
|
357
|
+
DefsReasonCivicMisinformation:
|
|
358
|
+
'tools.ozone.report.defs#reasonCivicMisinformation',
|
|
359
|
+
DefsReasonCivicImpersonation:
|
|
360
|
+
'tools.ozone.report.defs#reasonCivicImpersonation',
|
|
361
|
+
}
|
|
289
362
|
export const TOOLS_OZONE_TEAM = {
|
|
290
363
|
DefsRoleAdmin: 'tools.ozone.team.defs#roleAdmin',
|
|
291
364
|
DefsRoleModerator: 'tools.ozone.team.defs#roleModerator',
|
|
@@ -326,6 +399,7 @@ export class AppNS {
|
|
|
326
399
|
export class AppBskyNS {
|
|
327
400
|
_server: Server
|
|
328
401
|
actor: AppBskyActorNS
|
|
402
|
+
bookmark: AppBskyBookmarkNS
|
|
329
403
|
embed: AppBskyEmbedNS
|
|
330
404
|
feed: AppBskyFeedNS
|
|
331
405
|
graph: AppBskyGraphNS
|
|
@@ -338,6 +412,7 @@ export class AppBskyNS {
|
|
|
338
412
|
constructor(server: Server) {
|
|
339
413
|
this._server = server
|
|
340
414
|
this.actor = new AppBskyActorNS(server)
|
|
415
|
+
this.bookmark = new AppBskyBookmarkNS(server)
|
|
341
416
|
this.embed = new AppBskyEmbedNS(server)
|
|
342
417
|
this.feed = new AppBskyFeedNS(server)
|
|
343
418
|
this.graph = new AppBskyGraphNS(server)
|
|
@@ -441,6 +516,50 @@ export class AppBskyActorNS {
|
|
|
441
516
|
}
|
|
442
517
|
}
|
|
443
518
|
|
|
519
|
+
export class AppBskyBookmarkNS {
|
|
520
|
+
_server: Server
|
|
521
|
+
|
|
522
|
+
constructor(server: Server) {
|
|
523
|
+
this._server = server
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
createBookmark<A extends Auth = void>(
|
|
527
|
+
cfg: MethodConfigOrHandler<
|
|
528
|
+
A,
|
|
529
|
+
AppBskyBookmarkCreateBookmark.QueryParams,
|
|
530
|
+
AppBskyBookmarkCreateBookmark.HandlerInput,
|
|
531
|
+
AppBskyBookmarkCreateBookmark.HandlerOutput
|
|
532
|
+
>,
|
|
533
|
+
) {
|
|
534
|
+
const nsid = 'app.bsky.bookmark.createBookmark' // @ts-ignore
|
|
535
|
+
return this._server.xrpc.method(nsid, cfg)
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
deleteBookmark<A extends Auth = void>(
|
|
539
|
+
cfg: MethodConfigOrHandler<
|
|
540
|
+
A,
|
|
541
|
+
AppBskyBookmarkDeleteBookmark.QueryParams,
|
|
542
|
+
AppBskyBookmarkDeleteBookmark.HandlerInput,
|
|
543
|
+
AppBskyBookmarkDeleteBookmark.HandlerOutput
|
|
544
|
+
>,
|
|
545
|
+
) {
|
|
546
|
+
const nsid = 'app.bsky.bookmark.deleteBookmark' // @ts-ignore
|
|
547
|
+
return this._server.xrpc.method(nsid, cfg)
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
getBookmarks<A extends Auth = void>(
|
|
551
|
+
cfg: MethodConfigOrHandler<
|
|
552
|
+
A,
|
|
553
|
+
AppBskyBookmarkGetBookmarks.QueryParams,
|
|
554
|
+
AppBskyBookmarkGetBookmarks.HandlerInput,
|
|
555
|
+
AppBskyBookmarkGetBookmarks.HandlerOutput
|
|
556
|
+
>,
|
|
557
|
+
) {
|
|
558
|
+
const nsid = 'app.bsky.bookmark.getBookmarks' // @ts-ignore
|
|
559
|
+
return this._server.xrpc.method(nsid, cfg)
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
444
563
|
export class AppBskyEmbedNS {
|
|
445
564
|
_server: Server
|
|
446
565
|
|
|
@@ -2794,6 +2913,18 @@ export class ComAtprotoTempNS {
|
|
|
2794
2913
|
return this._server.xrpc.method(nsid, cfg)
|
|
2795
2914
|
}
|
|
2796
2915
|
|
|
2916
|
+
dereferenceScope<A extends Auth = void>(
|
|
2917
|
+
cfg: MethodConfigOrHandler<
|
|
2918
|
+
A,
|
|
2919
|
+
ComAtprotoTempDereferenceScope.QueryParams,
|
|
2920
|
+
ComAtprotoTempDereferenceScope.HandlerInput,
|
|
2921
|
+
ComAtprotoTempDereferenceScope.HandlerOutput
|
|
2922
|
+
>,
|
|
2923
|
+
) {
|
|
2924
|
+
const nsid = 'com.atproto.temp.dereferenceScope' // @ts-ignore
|
|
2925
|
+
return this._server.xrpc.method(nsid, cfg)
|
|
2926
|
+
}
|
|
2927
|
+
|
|
2797
2928
|
fetchLabels<A extends Auth = void>(
|
|
2798
2929
|
cfg: MethodConfigOrHandler<
|
|
2799
2930
|
A,
|