@atproto/api 0.4.4 → 0.5.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 (64) hide show
  1. package/README.md +81 -0
  2. package/definitions/labels.json +212 -0
  3. package/definitions/locale/en/label-groups.json +38 -0
  4. package/definitions/locale/en/labels.json +366 -0
  5. package/definitions/locale/en/proposed-label-groups.json +38 -0
  6. package/definitions/locale/en/proposed-labels.json +632 -0
  7. package/definitions/moderation-behaviors.d.ts +48 -0
  8. package/definitions/post-moderation-behaviors.json +879 -0
  9. package/definitions/profile-moderation-behaviors.json +447 -0
  10. package/definitions/proposed-labels.json +326 -0
  11. package/dist/client/index.d.ts +3 -0
  12. package/dist/client/lexicons.d.ts +27 -1
  13. package/dist/client/types/app/bsky/unspecced/applyLabels.d.ts +18 -0
  14. package/dist/index.d.ts +4 -0
  15. package/dist/index.js +1401 -12
  16. package/dist/index.js.map +4 -4
  17. package/dist/moderation/accumulator.d.ts +14 -0
  18. package/dist/moderation/const/label-groups.d.ts +2 -0
  19. package/dist/moderation/const/labels.d.ts +2 -0
  20. package/dist/moderation/index.d.ts +44 -0
  21. package/dist/moderation/subjects/account.d.ts +3 -0
  22. package/dist/moderation/subjects/feed-generator.d.ts +2 -0
  23. package/dist/moderation/subjects/post.d.ts +2 -0
  24. package/dist/moderation/subjects/profile.d.ts +3 -0
  25. package/dist/moderation/subjects/quoted-post.d.ts +6 -0
  26. package/dist/moderation/subjects/user-list.d.ts +2 -0
  27. package/dist/moderation/types.d.ts +97 -0
  28. package/dist/moderation/util.d.ts +12 -0
  29. package/docs/labels.md +522 -0
  30. package/docs/moderation-behaviors/posts.md +1919 -0
  31. package/docs/moderation-behaviors/profiles.md +907 -0
  32. package/docs/moderation.md +144 -0
  33. package/package.json +5 -3
  34. package/scripts/code/label-groups.mjs +68 -0
  35. package/scripts/code/labels.mjs +68 -0
  36. package/scripts/docs/labels.mjs +164 -0
  37. package/scripts/docs/post-moderation-behaviors.mjs +122 -0
  38. package/scripts/docs/profile-moderation-behaviors.mjs +122 -0
  39. package/scripts/generate-code.mjs +4 -0
  40. package/scripts/generate-docs.mjs +5 -0
  41. package/src/client/index.ts +13 -0
  42. package/src/client/lexicons.ts +29 -3
  43. package/src/client/types/app/bsky/unspecced/applyLabels.ts +33 -0
  44. package/src/client/types/com/atproto/admin/enableAccountInvites.ts +1 -1
  45. package/src/client/types/com/atproto/moderation/defs.ts +1 -1
  46. package/src/index.ts +4 -0
  47. package/src/moderation/accumulator.ts +181 -0
  48. package/src/moderation/const/label-groups.ts +143 -0
  49. package/src/moderation/const/labels.ts +798 -0
  50. package/src/moderation/index.ts +343 -0
  51. package/src/moderation/subjects/account.ts +40 -0
  52. package/src/moderation/subjects/feed-generator.ts +13 -0
  53. package/src/moderation/subjects/post.ts +23 -0
  54. package/src/moderation/subjects/profile.ts +31 -0
  55. package/src/moderation/subjects/quoted-post.ts +62 -0
  56. package/src/moderation/subjects/user-list.ts +13 -0
  57. package/src/moderation/types.ts +141 -0
  58. package/src/moderation/util.ts +98 -0
  59. package/tests/post-moderation.test.ts +46 -0
  60. package/tests/profile-moderation.test.ts +46 -0
  61. package/tests/util/index.ts +176 -0
  62. package/tests/util/moderation-behavior.ts +180 -0
  63. package/tsconfig.build.tsbuildinfo +1 -1
  64. package/tests/_util.ts +0 -26
@@ -0,0 +1,447 @@
1
+
2
+ {
3
+ "users": {
4
+ "self": {"blocking": false, "blockedBy": false, "muted": false, "mutedByList": false},
5
+ "alice": {"blocking": false, "blockedBy": false, "muted": false, "mutedByList": false},
6
+ "bob": {"blocking": true, "blockedBy": false, "muted": false, "mutedByList": false},
7
+ "carla": {"blocking": false, "blockedBy": true, "muted": false, "mutedByList": false},
8
+ "dan": {"blocking": false, "blockedBy": false, "muted": true, "mutedByList": false},
9
+ "elise": {"blocking": false, "blockedBy": false, "muted": false, "mutedByList": true},
10
+ "fern": {"blocking": true, "blockedBy": true, "muted": false, "mutedByList": false}
11
+ },
12
+ "configurations": {
13
+ "none": {},
14
+ "adult-disabled": {
15
+ "adultContentEnabled": false
16
+ },
17
+ "intolerant-hide": {
18
+ "settings": {"intolerant": "hide"}
19
+ },
20
+ "intolerant-warn": {
21
+ "settings": {"intolerant": "warn"}
22
+ },
23
+ "intolerant-ignore": {
24
+ "settings": {"intolerant": "ignore"}
25
+ },
26
+ "porn-hide": {
27
+ "adultContentEnabled": true,
28
+ "settings": {"porn": "hide"}
29
+ },
30
+ "porn-warn": {
31
+ "adultContentEnabled": true,
32
+ "settings": {"porn": "warn"}
33
+ },
34
+ "porn-ignore": {
35
+ "adultContentEnabled": true,
36
+ "settings": {"porn": "ignore"}
37
+ },
38
+ "scam-hide": {
39
+ "settings": {"scam": "hide"}
40
+ },
41
+ "scam-warn": {
42
+ "settings": {"scam": "warn"}
43
+ },
44
+ "scam-ignore": {
45
+ "settings": {"scam": "ignore"}
46
+ },
47
+ "intolerant-hide-scam-warn": {
48
+ "settings": {"intolerant": "hide", "scam": "hide"}
49
+ }
50
+ },
51
+ "scenarios": {
52
+ "Imperative label ('!hide') on account": {
53
+ "cfg": "none",
54
+ "subject": "profile",
55
+ "author": "alice",
56
+ "labels": {"account": ["!hide"]},
57
+ "behaviors": {
58
+ "account": {"cause": "label:!hide", "filter": true, "blur": true, "noOverride": true},
59
+ "avatar": {"blur": true, "noOverride": true}
60
+ }
61
+ },
62
+ "Imperative label ('!hide') on profile": {
63
+ "cfg": "none",
64
+ "subject": "profile",
65
+ "author": "alice",
66
+ "labels": {"profile": ["!hide"]},
67
+ "behaviors": {
68
+ "profile": {"cause": "label:!hide", "blur": true, "noOverride": true},
69
+ "avatar": {"blur": true, "noOverride": true}
70
+ }
71
+ },
72
+
73
+ "Imperative label ('!no-promote') on account": {
74
+ "cfg": "none",
75
+ "subject": "profile",
76
+ "author": "alice",
77
+ "labels": {"account": ["!no-promote"]},
78
+ "behaviors": {
79
+ "account": {"cause": "label:!no-promote", "filter": true}
80
+ }
81
+ },
82
+ "Imperative label ('!no-promote') on profile": {
83
+ "cfg": "none",
84
+ "subject": "profile",
85
+ "author": "alice",
86
+ "labels": {"profile": ["!no-promote"]},
87
+ "behaviors": {}
88
+ },
89
+
90
+ "Imperative label ('!warn') on account": {
91
+ "cfg": "none",
92
+ "subject": "profile",
93
+ "author": "alice",
94
+ "labels": {"account": ["!warn"]},
95
+ "behaviors": {
96
+ "account": {"cause": "label:!warn", "blur": true},
97
+ "avatar": {"blur": true}
98
+ }
99
+ },
100
+ "Imperative label ('!warn') on profile": {
101
+ "cfg": "none",
102
+ "subject": "profile",
103
+ "author": "alice",
104
+ "labels": {"profile": ["!warn"]},
105
+ "behaviors": {
106
+ "profile": {"cause": "label:!warn", "blur": true},
107
+ "avatar": {"blur": true}
108
+ }
109
+ },
110
+
111
+ "Blur label ('intolerant') on account (hide)": {
112
+ "cfg": "intolerant-hide",
113
+ "subject": "profile",
114
+ "author": "alice",
115
+ "labels": {"account": ["intolerant"]},
116
+ "behaviors": {
117
+ "account": {"cause": "label:intolerant", "filter": true, "blur": true},
118
+ "avatar": {"blur": true}
119
+ }
120
+ },
121
+ "Blur label ('intolerant') on profile (hide)": {
122
+ "cfg": "intolerant-hide",
123
+ "subject": "profile",
124
+ "author": "alice",
125
+ "labels": {"profile": ["intolerant"]},
126
+ "behaviors": {
127
+ "profile": {"cause": "label:intolerant", "blur": true},
128
+ "avatar": {"blur": true}
129
+ }
130
+ },
131
+
132
+ "Blur label ('intolerant') on account (warn)": {
133
+ "cfg": "intolerant-warn",
134
+ "subject": "profile",
135
+ "author": "alice",
136
+ "labels": {"account": ["intolerant"]},
137
+ "behaviors": {
138
+ "account": {"cause": "label:intolerant", "blur": true},
139
+ "avatar": {"blur": true}
140
+ }
141
+ },
142
+ "Blur label ('intolerant') on profile (warn)": {
143
+ "cfg": "intolerant-warn",
144
+ "subject": "profile",
145
+ "author": "alice",
146
+ "labels": {"profile": ["intolerant"]},
147
+ "behaviors": {
148
+ "profile": {"cause": "label:intolerant", "blur": true},
149
+ "avatar": {"blur": true}
150
+ }
151
+ },
152
+
153
+ "Blur label ('intolerant') on account (ignore)": {
154
+ "cfg": "intolerant-ignore",
155
+ "subject": "profile",
156
+ "author": "alice",
157
+ "labels": {"account": ["intolerant"]},
158
+ "behaviors": {}
159
+ },
160
+ "Blur label ('intolerant') on profile (ignore)": {
161
+ "cfg": "intolerant-ignore",
162
+ "subject": "profile",
163
+ "author": "alice",
164
+ "labels": {"profile": ["intolerant"]},
165
+ "behaviors": {}
166
+ },
167
+
168
+ "Blur-media label ('porn') on account (hide)": {
169
+ "cfg": "porn-hide",
170
+ "subject": "profile",
171
+ "author": "alice",
172
+ "labels": {"account": ["porn"]},
173
+ "behaviors": {
174
+ "account": {"cause": "label:porn", "filter": true, "blur": true},
175
+ "avatar": {"blur": true}
176
+ }
177
+ },
178
+ "Blur-media label ('porn') on profile (hide)": {
179
+ "cfg": "porn-hide",
180
+ "subject": "profile",
181
+ "author": "alice",
182
+ "labels": {"profile": ["porn"]},
183
+ "behaviors": {
184
+ "avatar": {"blur": true}
185
+ }
186
+ },
187
+
188
+ "Blur-media label ('porn') on account (warn)": {
189
+ "cfg": "porn-warn",
190
+ "subject": "profile",
191
+ "author": "alice",
192
+ "labels": {"account": ["porn"]},
193
+ "behaviors": {
194
+ "account": {"cause": "label:porn", "blur": true},
195
+ "avatar": {"blur": true}
196
+ }
197
+ },
198
+ "Blur-media label ('porn') on profile (warn)": {
199
+ "cfg": "porn-warn",
200
+ "subject": "profile",
201
+ "author": "alice",
202
+ "labels": {"profile": ["porn"]},
203
+ "behaviors": {
204
+ "avatar": {"blur": true}
205
+ }
206
+ },
207
+
208
+ "Blur-media label ('porn') on account (ignore)": {
209
+ "cfg": "porn-ignore",
210
+ "subject": "profile",
211
+ "author": "alice",
212
+ "labels": {"account": ["porn"]},
213
+ "behaviors": {}
214
+ },
215
+ "Blur-media label ('porn') on profile (ignore)": {
216
+ "cfg": "porn-ignore",
217
+ "subject": "profile",
218
+ "author": "alice",
219
+ "labels": {"profile": ["porn"]},
220
+ "behaviors": {}
221
+ },
222
+
223
+ "Notice label ('scam') on account (hide)": {
224
+ "cfg": "scam-hide",
225
+ "subject": "profile",
226
+ "author": "alice",
227
+ "labels": {"account": ["scam"]},
228
+ "behaviors": {
229
+ "account": {"cause": "label:scam", "filter": true, "alert": true},
230
+ "avatar": {"alert": true}
231
+ }
232
+ },
233
+ "Notice label ('scam') on profile (hide)": {
234
+ "cfg": "scam-hide",
235
+ "subject": "profile",
236
+ "author": "alice",
237
+ "labels": {"profile": ["scam"]},
238
+ "behaviors": {
239
+ "profile": {"cause": "label:scam", "alert": true},
240
+ "avatar": {"alert": true}
241
+ }
242
+ },
243
+
244
+ "Notice label ('scam') on account (warn)": {
245
+ "cfg": "scam-warn",
246
+ "subject": "profile",
247
+ "author": "alice",
248
+ "labels": {"account": ["scam"]},
249
+ "behaviors": {
250
+ "account": {"cause": "label:scam", "alert": true},
251
+ "avatar": {"alert": true}
252
+ }
253
+ },
254
+ "Notice label ('scam') on profile (warn)": {
255
+ "cfg": "scam-warn",
256
+ "subject": "profile",
257
+ "author": "alice",
258
+ "labels": {"profile": ["scam"]},
259
+ "behaviors": {
260
+ "profile": {"cause": "label:scam", "alert": true},
261
+ "avatar": {"alert": true}
262
+ }
263
+ },
264
+
265
+ "Notice label ('scam') on account (ignore)": {
266
+ "cfg": "scam-ignore",
267
+ "subject": "profile",
268
+ "author": "alice",
269
+ "labels": {"account": ["scam"]},
270
+ "behaviors": {}
271
+ },
272
+ "Notice label ('scam') on profile (ignore)": {
273
+ "cfg": "scam-ignore",
274
+ "subject": "profile",
275
+ "author": "alice",
276
+ "labels": {"profile": ["scam"]},
277
+ "behaviors": {}
278
+ },
279
+
280
+ "Adult-only label on account when adult content is disabled": {
281
+ "cfg": "adult-disabled",
282
+ "subject": "profile",
283
+ "author": "alice",
284
+ "labels": {"account": ["porn"]},
285
+ "behaviors": {
286
+ "account": {"cause": "label:porn", "filter": true, "blur": true, "noOverride": true},
287
+ "avatar": {"blur": true, "noOverride": true}
288
+ }
289
+ },
290
+ "Adult-only label on profile when adult content is disabled": {
291
+ "cfg": "adult-disabled",
292
+ "subject": "profile",
293
+ "author": "alice",
294
+ "labels": {"profile": ["porn"]},
295
+ "behaviors": {
296
+ "avatar": {"blur": true, "noOverride": true}
297
+ }
298
+ },
299
+
300
+ "Self-profile: !hide on account": {
301
+ "cfg": "none",
302
+ "subject": "profile",
303
+ "author": "self",
304
+ "labels": {"account": ["!hide"]},
305
+ "behaviors": {
306
+ "account": {"cause": "label:!hide", "alert": true},
307
+ "avatar": {"alert": true}
308
+ }
309
+ },
310
+ "Self-profile: !hide on profile": {
311
+ "cfg": "none",
312
+ "subject": "profile",
313
+ "author": "self",
314
+ "labels": {"profile": ["!hide"]},
315
+ "behaviors": {
316
+ "profile": {"cause": "label:!hide", "alert": true},
317
+ "avatar": {"alert": true}
318
+ }
319
+ },
320
+
321
+ "Mute/block: Blocking user": {
322
+ "cfg": "none",
323
+ "subject": "profile",
324
+ "author": "bob",
325
+ "labels": {},
326
+ "behaviors": {
327
+ "account": {"cause": "blocking", "filter": true},
328
+ "avatar": {"blur": true, "noOverride": true}
329
+ }
330
+ },
331
+
332
+ "Mute/block: Blocked by user": {
333
+ "cfg": "none",
334
+ "subject": "profile",
335
+ "author": "carla",
336
+ "labels": {},
337
+ "behaviors": {
338
+ "account": {"cause": "blocked-by", "filter": true},
339
+ "avatar": {"blur": true, "noOverride": true}
340
+ }
341
+ },
342
+
343
+ "Mute/block: Muted user": {
344
+ "cfg": "none",
345
+ "subject": "profile",
346
+ "author": "dan",
347
+ "labels": {},
348
+ "behaviors": {
349
+ "account": {"cause": "muted", "filter": true}
350
+ }
351
+ },
352
+
353
+ "Mute/block: Muted-by-list user": {
354
+ "cfg": "none",
355
+ "subject": "profile",
356
+ "author": "elise",
357
+ "labels": {},
358
+ "behaviors": {
359
+ "account": {"cause": "muted-by-list", "filter": true}
360
+ }
361
+ },
362
+
363
+ "Prioritization: blocking & blocked-by user": {
364
+ "cfg": "none",
365
+ "subject": "profile",
366
+ "author": "fern",
367
+ "labels": {},
368
+ "behaviors": {
369
+ "account": {"cause": "blocking", "filter": true, "blur": false},
370
+ "avatar": {"blur": true, "noOverride": true}
371
+ }
372
+ },
373
+ "Prioritization: '!hide' label on account of blocked user": {
374
+ "cfg": "none",
375
+ "subject": "profile",
376
+ "author": "bob",
377
+ "labels": {"account": ["!hide"]},
378
+ "behaviors": {
379
+ "account": {"cause": "label:!hide", "filter": true, "blur": true, "noOverride": true},
380
+ "avatar": {"blur": true, "noOverride": true}
381
+ }
382
+ },
383
+ "Prioritization: '!hide' and 'intolerant' labels on account (hide)": {
384
+ "cfg": "intolerant-hide",
385
+ "subject": "profile",
386
+ "author": "alice",
387
+ "labels": {"account": ["!hide", "intolerant"]},
388
+ "behaviors": {
389
+ "account": {"cause": "label:!hide", "filter": true, "blur": true, "noOverride": true},
390
+ "avatar": {"blur": true, "noOverride": true}
391
+ }
392
+ },
393
+ "Prioritization: '!warn' and 'intolerant' labels on account (hide)": {
394
+ "cfg": "intolerant-hide",
395
+ "subject": "profile",
396
+ "author": "alice",
397
+ "labels": {"account": ["!warn", "intolerant"]},
398
+ "behaviors": {
399
+ "account": {"cause": "label:intolerant", "filter": true, "blur": true},
400
+ "avatar": {"blur": true}
401
+ }
402
+ },
403
+ "Prioritization: '!warn' and 'porn' labels on account (hide)": {
404
+ "cfg": "porn-hide",
405
+ "subject": "profile",
406
+ "author": "alice",
407
+ "labels": {"account": ["!warn", "porn"]},
408
+ "behaviors": {
409
+ "account": {"cause": "label:porn", "filter": true, "blur": true},
410
+ "avatar": {"blur": true}
411
+ }
412
+ },
413
+ "Prioritization: intolerant label on account (hide) and scam label on profile (warn)": {
414
+ "cfg": "intolerant-hide-scam-warn",
415
+ "subject": "profile",
416
+ "author": "alice",
417
+ "labels": {"account": ["intolerant"], "profile": ["scam"]},
418
+ "behaviors": {
419
+ "account": {"cause": "label:intolerant", "filter": true, "blur": true},
420
+ "profile": {"cause": "label:scam", "alert": true},
421
+ "avatar": {"blur": true, "alert": true}
422
+ }
423
+ },
424
+ "Prioritization: !hide on account, !warn on profile": {
425
+ "cfg": "none",
426
+ "subject": "profile",
427
+ "author": "alice",
428
+ "labels": {"account": ["!hide"], "profile": ["!warn"]},
429
+ "behaviors": {
430
+ "account": {"cause": "label:!hide", "filter": true, "blur": true, "noOverride": true},
431
+ "profile": {"cause": "label:!warn", "blur": true},
432
+ "avatar": {"blur": true, "noOverride": true}
433
+ }
434
+ },
435
+ "Prioritization: !warn on account, !hide on profile": {
436
+ "cfg": "none",
437
+ "subject": "profile",
438
+ "author": "alice",
439
+ "labels": {"account": ["!warn"], "profile": ["!hide"]},
440
+ "behaviors": {
441
+ "account": {"cause": "label:!warn", "blur": true},
442
+ "profile": {"cause": "label:!hide", "blur": true, "noOverride": true},
443
+ "avatar": {"blur": true, "noOverride": true}
444
+ }
445
+ }
446
+ }
447
+ }