@atproto/pds 0.4.16 → 0.4.18
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +16 -0
- package/dist/api/com/atproto/repo/uploadBlob.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/uploadBlob.js +11 -1
- package/dist/api/com/atproto/repo/uploadBlob.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.map +1 -1
- package/dist/context.js +1 -0
- package/dist/context.js.map +1 -1
- package/dist/db/tables/moderation.d.ts +1 -1
- package/dist/db/tables/moderation.d.ts.map +1 -1
- package/dist/lexicon/lexicons.d.ts +68 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +78 -0
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +16 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js +21 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts +22 -2
- package/dist/lexicon/types/tools/ozone/moderation/defs.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/defs.js +22 -2
- package/dist/lexicon/types/tools/ozone/moderation/defs.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/emitEvent.d.ts +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/emitEvent.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/queryStatuses.d.ts +2 -0
- package/dist/lexicon/types/tools/ozone/moderation/queryStatuses.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/com/atproto/repo/uploadBlob.ts +17 -5
- package/src/config/config.ts +2 -0
- package/src/config/env.ts +2 -0
- package/src/context.ts +1 -0
- package/src/db/tables/moderation.ts +6 -0
- package/src/lexicon/lexicons.ts +80 -0
- package/src/lexicon/types/app/bsky/actor/defs.ts +38 -0
- package/src/lexicon/types/tools/ozone/moderation/defs.ts +56 -0
- package/src/lexicon/types/tools/ozone/moderation/emitEvent.ts +3 -0
- package/src/lexicon/types/tools/ozone/moderation/queryStatuses.ts +2 -0
- package/tests/proxied/__snapshots__/admin.test.ts.snap +4 -2
package/src/lexicon/lexicons.ts
CHANGED
@@ -3822,6 +3822,7 @@ export const schemaDict = {
|
|
3822
3822
|
'lex:app.bsky.actor.defs#adultContentPref',
|
3823
3823
|
'lex:app.bsky.actor.defs#contentLabelPref',
|
3824
3824
|
'lex:app.bsky.actor.defs#savedFeedsPref',
|
3825
|
+
'lex:app.bsky.actor.defs#savedFeedsPrefV2',
|
3825
3826
|
'lex:app.bsky.actor.defs#personalDetailsPref',
|
3826
3827
|
'lex:app.bsky.actor.defs#feedViewPref',
|
3827
3828
|
'lex:app.bsky.actor.defs#threadViewPref',
|
@@ -3860,6 +3861,38 @@ export const schemaDict = {
|
|
3860
3861
|
},
|
3861
3862
|
},
|
3862
3863
|
},
|
3864
|
+
savedFeed: {
|
3865
|
+
type: 'object',
|
3866
|
+
required: ['id', 'type', 'value', 'pinned'],
|
3867
|
+
properties: {
|
3868
|
+
id: {
|
3869
|
+
type: 'string',
|
3870
|
+
},
|
3871
|
+
type: {
|
3872
|
+
type: 'string',
|
3873
|
+
knownValues: ['feed', 'list', 'timeline'],
|
3874
|
+
},
|
3875
|
+
value: {
|
3876
|
+
type: 'string',
|
3877
|
+
},
|
3878
|
+
pinned: {
|
3879
|
+
type: 'boolean',
|
3880
|
+
},
|
3881
|
+
},
|
3882
|
+
},
|
3883
|
+
savedFeedsPrefV2: {
|
3884
|
+
type: 'object',
|
3885
|
+
required: ['items'],
|
3886
|
+
properties: {
|
3887
|
+
items: {
|
3888
|
+
type: 'array',
|
3889
|
+
items: {
|
3890
|
+
type: 'ref',
|
3891
|
+
ref: 'lex:app.bsky.actor.defs#savedFeed',
|
3892
|
+
},
|
3893
|
+
},
|
3894
|
+
},
|
3895
|
+
},
|
3863
3896
|
savedFeedsPref: {
|
3864
3897
|
type: 'object',
|
3865
3898
|
required: ['pinned', 'saved'],
|
@@ -8375,6 +8408,9 @@ export const schemaDict = {
|
|
8375
8408
|
'lex:tools.ozone.moderation.defs#modEventAcknowledge',
|
8376
8409
|
'lex:tools.ozone.moderation.defs#modEventEscalate',
|
8377
8410
|
'lex:tools.ozone.moderation.defs#modEventMute',
|
8411
|
+
'lex:tools.ozone.moderation.defs#modEventUnmute',
|
8412
|
+
'lex:tools.ozone.moderation.defs#modEventMuteReporter',
|
8413
|
+
'lex:tools.ozone.moderation.defs#modEventUnmuteReporter',
|
8378
8414
|
'lex:tools.ozone.moderation.defs#modEventEmail',
|
8379
8415
|
'lex:tools.ozone.moderation.defs#modEventResolveAppeal',
|
8380
8416
|
'lex:tools.ozone.moderation.defs#modEventDivert',
|
@@ -8434,6 +8470,9 @@ export const schemaDict = {
|
|
8434
8470
|
'lex:tools.ozone.moderation.defs#modEventAcknowledge',
|
8435
8471
|
'lex:tools.ozone.moderation.defs#modEventEscalate',
|
8436
8472
|
'lex:tools.ozone.moderation.defs#modEventMute',
|
8473
|
+
'lex:tools.ozone.moderation.defs#modEventUnmute',
|
8474
|
+
'lex:tools.ozone.moderation.defs#modEventMuteReporter',
|
8475
|
+
'lex:tools.ozone.moderation.defs#modEventUnmuteReporter',
|
8437
8476
|
'lex:tools.ozone.moderation.defs#modEventEmail',
|
8438
8477
|
'lex:tools.ozone.moderation.defs#modEventResolveAppeal',
|
8439
8478
|
'lex:tools.ozone.moderation.defs#modEventDivert',
|
@@ -8513,6 +8552,10 @@ export const schemaDict = {
|
|
8513
8552
|
type: 'string',
|
8514
8553
|
format: 'datetime',
|
8515
8554
|
},
|
8555
|
+
muteReportingUntil: {
|
8556
|
+
type: 'string',
|
8557
|
+
format: 'datetime',
|
8558
|
+
},
|
8516
8559
|
lastReviewedBy: {
|
8517
8560
|
type: 'string',
|
8518
8561
|
format: 'did',
|
@@ -8636,6 +8679,11 @@ export const schemaDict = {
|
|
8636
8679
|
comment: {
|
8637
8680
|
type: 'string',
|
8638
8681
|
},
|
8682
|
+
isReporterMuted: {
|
8683
|
+
type: 'boolean',
|
8684
|
+
description:
|
8685
|
+
"Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject.",
|
8686
|
+
},
|
8639
8687
|
reportType: {
|
8640
8688
|
type: 'ref',
|
8641
8689
|
ref: 'lex:com.atproto.moderation.defs#reasonType',
|
@@ -8704,6 +8752,30 @@ export const schemaDict = {
|
|
8704
8752
|
},
|
8705
8753
|
},
|
8706
8754
|
},
|
8755
|
+
modEventMuteReporter: {
|
8756
|
+
type: 'object',
|
8757
|
+
description: 'Mute incoming reports from an account',
|
8758
|
+
required: ['durationInHours'],
|
8759
|
+
properties: {
|
8760
|
+
comment: {
|
8761
|
+
type: 'string',
|
8762
|
+
},
|
8763
|
+
durationInHours: {
|
8764
|
+
type: 'integer',
|
8765
|
+
description: 'Indicates how long the account should remain muted.',
|
8766
|
+
},
|
8767
|
+
},
|
8768
|
+
},
|
8769
|
+
modEventUnmuteReporter: {
|
8770
|
+
type: 'object',
|
8771
|
+
description: 'Unmute incoming reports from an account',
|
8772
|
+
properties: {
|
8773
|
+
comment: {
|
8774
|
+
type: 'string',
|
8775
|
+
description: 'Describe reasoning behind the reversal.',
|
8776
|
+
},
|
8777
|
+
},
|
8778
|
+
},
|
8707
8779
|
modEventEmail: {
|
8708
8780
|
type: 'object',
|
8709
8781
|
description: 'Keep a log of outgoing email to a user',
|
@@ -9088,6 +9160,9 @@ export const schemaDict = {
|
|
9088
9160
|
'lex:tools.ozone.moderation.defs#modEventLabel',
|
9089
9161
|
'lex:tools.ozone.moderation.defs#modEventReport',
|
9090
9162
|
'lex:tools.ozone.moderation.defs#modEventMute',
|
9163
|
+
'lex:tools.ozone.moderation.defs#modEventUnmute',
|
9164
|
+
'lex:tools.ozone.moderation.defs#modEventMuteReporter',
|
9165
|
+
'lex:tools.ozone.moderation.defs#modEventUnmuteReporter',
|
9091
9166
|
'lex:tools.ozone.moderation.defs#modEventReverseTakedown',
|
9092
9167
|
'lex:tools.ozone.moderation.defs#modEventUnmute',
|
9093
9168
|
'lex:tools.ozone.moderation.defs#modEventEmail',
|
@@ -9396,6 +9471,11 @@ export const schemaDict = {
|
|
9396
9471
|
description:
|
9397
9472
|
"By default, we don't include muted subjects in the results. Set this to true to include them.",
|
9398
9473
|
},
|
9474
|
+
onlyMuted: {
|
9475
|
+
type: 'boolean',
|
9476
|
+
description:
|
9477
|
+
'When set to true, only muted subjects and reporters will be returned.',
|
9478
|
+
},
|
9399
9479
|
reviewState: {
|
9400
9480
|
type: 'string',
|
9401
9481
|
description: 'Specify when fetching subjects in a certain state',
|
@@ -132,6 +132,7 @@ export type Preferences = (
|
|
132
132
|
| AdultContentPref
|
133
133
|
| ContentLabelPref
|
134
134
|
| SavedFeedsPref
|
135
|
+
| SavedFeedsPrefV2
|
135
136
|
| PersonalDetailsPref
|
136
137
|
| FeedViewPref
|
137
138
|
| ThreadViewPref
|
@@ -178,6 +179,43 @@ export function validateContentLabelPref(v: unknown): ValidationResult {
|
|
178
179
|
return lexicons.validate('app.bsky.actor.defs#contentLabelPref', v)
|
179
180
|
}
|
180
181
|
|
182
|
+
export interface SavedFeed {
|
183
|
+
id: string
|
184
|
+
type: 'feed' | 'list' | 'timeline' | (string & {})
|
185
|
+
value: string
|
186
|
+
pinned: boolean
|
187
|
+
[k: string]: unknown
|
188
|
+
}
|
189
|
+
|
190
|
+
export function isSavedFeed(v: unknown): v is SavedFeed {
|
191
|
+
return (
|
192
|
+
isObj(v) &&
|
193
|
+
hasProp(v, '$type') &&
|
194
|
+
v.$type === 'app.bsky.actor.defs#savedFeed'
|
195
|
+
)
|
196
|
+
}
|
197
|
+
|
198
|
+
export function validateSavedFeed(v: unknown): ValidationResult {
|
199
|
+
return lexicons.validate('app.bsky.actor.defs#savedFeed', v)
|
200
|
+
}
|
201
|
+
|
202
|
+
export interface SavedFeedsPrefV2 {
|
203
|
+
items: SavedFeed[]
|
204
|
+
[k: string]: unknown
|
205
|
+
}
|
206
|
+
|
207
|
+
export function isSavedFeedsPrefV2(v: unknown): v is SavedFeedsPrefV2 {
|
208
|
+
return (
|
209
|
+
isObj(v) &&
|
210
|
+
hasProp(v, '$type') &&
|
211
|
+
v.$type === 'app.bsky.actor.defs#savedFeedsPrefV2'
|
212
|
+
)
|
213
|
+
}
|
214
|
+
|
215
|
+
export function validateSavedFeedsPrefV2(v: unknown): ValidationResult {
|
216
|
+
return lexicons.validate('app.bsky.actor.defs#savedFeedsPrefV2', v)
|
217
|
+
}
|
218
|
+
|
181
219
|
export interface SavedFeedsPref {
|
182
220
|
pinned: string[]
|
183
221
|
saved: string[]
|
@@ -22,6 +22,9 @@ export interface ModEventView {
|
|
22
22
|
| ModEventAcknowledge
|
23
23
|
| ModEventEscalate
|
24
24
|
| ModEventMute
|
25
|
+
| ModEventUnmute
|
26
|
+
| ModEventMuteReporter
|
27
|
+
| ModEventUnmuteReporter
|
25
28
|
| ModEventEmail
|
26
29
|
| ModEventResolveAppeal
|
27
30
|
| ModEventDivert
|
@@ -61,6 +64,9 @@ export interface ModEventViewDetail {
|
|
61
64
|
| ModEventAcknowledge
|
62
65
|
| ModEventEscalate
|
63
66
|
| ModEventMute
|
67
|
+
| ModEventUnmute
|
68
|
+
| ModEventMuteReporter
|
69
|
+
| ModEventUnmuteReporter
|
64
70
|
| ModEventEmail
|
65
71
|
| ModEventResolveAppeal
|
66
72
|
| ModEventDivert
|
@@ -105,6 +111,7 @@ export interface SubjectStatusView {
|
|
105
111
|
/** Sticky comment on the subject. */
|
106
112
|
comment?: string
|
107
113
|
muteUntil?: string
|
114
|
+
muteReportingUntil?: string
|
108
115
|
lastReviewedBy?: string
|
109
116
|
lastReviewedAt?: string
|
110
117
|
lastReportedAt?: string
|
@@ -237,6 +244,8 @@ export function validateModEventComment(v: unknown): ValidationResult {
|
|
237
244
|
/** Report a subject */
|
238
245
|
export interface ModEventReport {
|
239
246
|
comment?: string
|
247
|
+
/** Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject. */
|
248
|
+
isReporterMuted?: boolean
|
240
249
|
reportType: ComAtprotoModerationDefs.ReasonType
|
241
250
|
[k: string]: unknown
|
242
251
|
}
|
@@ -346,6 +355,53 @@ export function validateModEventUnmute(v: unknown): ValidationResult {
|
|
346
355
|
return lexicons.validate('tools.ozone.moderation.defs#modEventUnmute', v)
|
347
356
|
}
|
348
357
|
|
358
|
+
/** Mute incoming reports from an account */
|
359
|
+
export interface ModEventMuteReporter {
|
360
|
+
comment?: string
|
361
|
+
/** Indicates how long the account should remain muted. */
|
362
|
+
durationInHours: number
|
363
|
+
[k: string]: unknown
|
364
|
+
}
|
365
|
+
|
366
|
+
export function isModEventMuteReporter(v: unknown): v is ModEventMuteReporter {
|
367
|
+
return (
|
368
|
+
isObj(v) &&
|
369
|
+
hasProp(v, '$type') &&
|
370
|
+
v.$type === 'tools.ozone.moderation.defs#modEventMuteReporter'
|
371
|
+
)
|
372
|
+
}
|
373
|
+
|
374
|
+
export function validateModEventMuteReporter(v: unknown): ValidationResult {
|
375
|
+
return lexicons.validate(
|
376
|
+
'tools.ozone.moderation.defs#modEventMuteReporter',
|
377
|
+
v,
|
378
|
+
)
|
379
|
+
}
|
380
|
+
|
381
|
+
/** Unmute incoming reports from an account */
|
382
|
+
export interface ModEventUnmuteReporter {
|
383
|
+
/** Describe reasoning behind the reversal. */
|
384
|
+
comment?: string
|
385
|
+
[k: string]: unknown
|
386
|
+
}
|
387
|
+
|
388
|
+
export function isModEventUnmuteReporter(
|
389
|
+
v: unknown,
|
390
|
+
): v is ModEventUnmuteReporter {
|
391
|
+
return (
|
392
|
+
isObj(v) &&
|
393
|
+
hasProp(v, '$type') &&
|
394
|
+
v.$type === 'tools.ozone.moderation.defs#modEventUnmuteReporter'
|
395
|
+
)
|
396
|
+
}
|
397
|
+
|
398
|
+
export function validateModEventUnmuteReporter(v: unknown): ValidationResult {
|
399
|
+
return lexicons.validate(
|
400
|
+
'tools.ozone.moderation.defs#modEventUnmuteReporter',
|
401
|
+
v,
|
402
|
+
)
|
403
|
+
}
|
404
|
+
|
349
405
|
/** Keep a log of outgoing email to a user */
|
350
406
|
export interface ModEventEmail {
|
351
407
|
/** The subject line of the email sent to the user. */
|
@@ -22,6 +22,9 @@ export interface InputSchema {
|
|
22
22
|
| ToolsOzoneModerationDefs.ModEventLabel
|
23
23
|
| ToolsOzoneModerationDefs.ModEventReport
|
24
24
|
| ToolsOzoneModerationDefs.ModEventMute
|
25
|
+
| ToolsOzoneModerationDefs.ModEventUnmute
|
26
|
+
| ToolsOzoneModerationDefs.ModEventMuteReporter
|
27
|
+
| ToolsOzoneModerationDefs.ModEventUnmuteReporter
|
25
28
|
| ToolsOzoneModerationDefs.ModEventReverseTakedown
|
26
29
|
| ToolsOzoneModerationDefs.ModEventUnmute
|
27
30
|
| ToolsOzoneModerationDefs.ModEventEmail
|
@@ -23,6 +23,8 @@ export interface QueryParams {
|
|
23
23
|
reviewedBefore?: string
|
24
24
|
/** By default, we don't include muted subjects in the results. Set this to true to include them. */
|
25
25
|
includeMuted?: boolean
|
26
|
+
/** When set to true, only muted subjects and reporters will be returned. */
|
27
|
+
onlyMuted?: boolean
|
26
28
|
/** Specify when fetching subjects in a certain state */
|
27
29
|
reviewState?: string
|
28
30
|
ignoreSubjects?: string[]
|
@@ -50,6 +50,7 @@ Array [
|
|
50
50
|
"event": Object {
|
51
51
|
"$type": "tools.ozone.moderation.defs#modEventReport",
|
52
52
|
"comment": "impersonation",
|
53
|
+
"isReporterMuted": false,
|
53
54
|
"reportType": "com.atproto.moderation.defs#reasonOther",
|
54
55
|
},
|
55
56
|
"id": 3,
|
@@ -85,6 +86,7 @@ Array [
|
|
85
86
|
"creatorHandle": "alice.test",
|
86
87
|
"event": Object {
|
87
88
|
"$type": "tools.ozone.moderation.defs#modEventReport",
|
89
|
+
"isReporterMuted": false,
|
88
90
|
"reportType": "com.atproto.moderation.defs#reasonSpam",
|
89
91
|
},
|
90
92
|
"id": 1,
|
@@ -167,7 +169,7 @@ Array [
|
|
167
169
|
"event": Object {
|
168
170
|
"$type": "tools.ozone.moderation.defs#modEventTag",
|
169
171
|
"add": Array [
|
170
|
-
"lang:
|
172
|
+
"lang:en",
|
171
173
|
],
|
172
174
|
"remove": Array [],
|
173
175
|
},
|
@@ -221,7 +223,7 @@ Object {
|
|
221
223
|
"subjectBlobCids": Array [],
|
222
224
|
"subjectRepoHandle": "bob.test",
|
223
225
|
"tags": Array [
|
224
|
-
"lang:
|
226
|
+
"lang:en",
|
225
227
|
],
|
226
228
|
"takendown": false,
|
227
229
|
"updatedAt": "1970-01-01T00:00:00.000Z",
|