@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,907 @@
1
+ <!-- this doc is generated by ./scripts/docs/profile-moderation-behaviors.mjs -->
2
+
3
+ # Profile moderation behaviors
4
+
5
+ This document is a reference for the expected behaviors for a profile in the application based on some given scenarios. The <code>moderateProfile()</code> command condense down to the following yes or no decisions:
6
+
7
+ - <code>res.account.filter</code> Do not show the account in feeds.
8
+ - <code>res.account.blur</code> Put the account (in listings, when viewing) behind a warning cover.
9
+ - <code>res.account.noOverride</code> Do not allow the account's blur cover to be lifted.
10
+ - <code>res.account.alert</code> Add a warning to the account but do not cover it.
11
+ - <code>res.profile.blur</code> Put the profile details (handle, display name, bio) behind a warning cover.
12
+ - <code>res.profile.noOverride</code> Do not allow the profile's blur cover to be lifted.
13
+ - <code>res.profile.alert</code> Add a warning to the profile but do not cover it.
14
+ - <code>res.avatar.blur</code> Put the avatar behind a cover.
15
+ - <code>res.avatar.noOverride</code> Do not allow the avatars's blur cover to be lifted.
16
+ - <code>res.avatar.alert</code> Put a warning icon on the avatar.
17
+
18
+ Key:
19
+
20
+ - ❌ = Filter Content
21
+ - 🚫 = Blur (no-override)
22
+ - ✋ = Blur
23
+ - 🪧 = Alert
24
+
25
+ ## Scenarios
26
+
27
+ <table>
28
+
29
+ <tr><th>Scenario</th><th>Filter</th><th>Account</th><th>Profile</td><th>Avatar</th></tr>
30
+ <tr>
31
+ <td><strong>Imperative label ('!hide') on account</strong></td>
32
+ <td>
33
+
34
+ </td>
35
+ <td>
36
+ 🚫
37
+
38
+ </td>
39
+ <td>
40
+
41
+
42
+ </td>
43
+ <td>
44
+ 🚫
45
+
46
+ </td>
47
+ </tr>
48
+
49
+
50
+
51
+
52
+ <tr>
53
+ <td><strong>Imperative label ('!hide') on profile</strong></td>
54
+ <td>
55
+
56
+ </td>
57
+ <td>
58
+
59
+
60
+ </td>
61
+ <td>
62
+ 🚫
63
+
64
+ </td>
65
+ <td>
66
+ 🚫
67
+
68
+ </td>
69
+ </tr>
70
+
71
+
72
+
73
+
74
+ <tr>
75
+ <td><strong>Imperative label ('!no-promote') on account</strong></td>
76
+ <td>
77
+
78
+ </td>
79
+ <td>
80
+
81
+
82
+ </td>
83
+ <td>
84
+
85
+
86
+ </td>
87
+ <td>
88
+
89
+
90
+ </td>
91
+ </tr>
92
+
93
+
94
+
95
+
96
+ <tr>
97
+ <td><strong>Imperative label ('!no-promote') on profile</strong></td>
98
+ <td>
99
+
100
+ </td>
101
+ <td>
102
+
103
+
104
+ </td>
105
+ <td>
106
+
107
+
108
+ </td>
109
+ <td>
110
+
111
+
112
+ </td>
113
+ </tr>
114
+
115
+
116
+
117
+
118
+ <tr>
119
+ <td><strong>Imperative label ('!warn') on account</strong></td>
120
+ <td>
121
+
122
+ </td>
123
+ <td>
124
+
125
+
126
+ </td>
127
+ <td>
128
+
129
+
130
+ </td>
131
+ <td>
132
+
133
+
134
+ </td>
135
+ </tr>
136
+
137
+
138
+
139
+
140
+ <tr>
141
+ <td><strong>Imperative label ('!warn') on profile</strong></td>
142
+ <td>
143
+
144
+ </td>
145
+ <td>
146
+
147
+
148
+ </td>
149
+ <td>
150
+
151
+
152
+ </td>
153
+ <td>
154
+
155
+
156
+ </td>
157
+ </tr>
158
+
159
+
160
+
161
+ <tr><th>Scenario</th><th>Filter</th><th>Account</th><th>Profile</td><th>Avatar</th></tr>
162
+ <tr>
163
+ <td><strong>Blur label ('intolerant') on account (hide)</strong></td>
164
+ <td>
165
+
166
+ </td>
167
+ <td>
168
+
169
+
170
+ </td>
171
+ <td>
172
+
173
+
174
+ </td>
175
+ <td>
176
+
177
+
178
+ </td>
179
+ </tr>
180
+
181
+
182
+
183
+
184
+ <tr>
185
+ <td><strong>Blur label ('intolerant') on profile (hide)</strong></td>
186
+ <td>
187
+
188
+ </td>
189
+ <td>
190
+
191
+
192
+ </td>
193
+ <td>
194
+
195
+
196
+ </td>
197
+ <td>
198
+
199
+
200
+ </td>
201
+ </tr>
202
+
203
+
204
+
205
+
206
+ <tr>
207
+ <td><strong>Blur label ('intolerant') on account (warn)</strong></td>
208
+ <td>
209
+
210
+ </td>
211
+ <td>
212
+
213
+
214
+ </td>
215
+ <td>
216
+
217
+
218
+ </td>
219
+ <td>
220
+
221
+
222
+ </td>
223
+ </tr>
224
+
225
+
226
+
227
+
228
+ <tr>
229
+ <td><strong>Blur label ('intolerant') on profile (warn)</strong></td>
230
+ <td>
231
+
232
+ </td>
233
+ <td>
234
+
235
+
236
+ </td>
237
+ <td>
238
+
239
+
240
+ </td>
241
+ <td>
242
+
243
+
244
+ </td>
245
+ </tr>
246
+
247
+
248
+
249
+
250
+ <tr>
251
+ <td><strong>Blur label ('intolerant') on account (ignore)</strong></td>
252
+ <td>
253
+
254
+ </td>
255
+ <td>
256
+
257
+
258
+ </td>
259
+ <td>
260
+
261
+
262
+ </td>
263
+ <td>
264
+
265
+
266
+ </td>
267
+ </tr>
268
+
269
+
270
+
271
+
272
+ <tr>
273
+ <td><strong>Blur label ('intolerant') on profile (ignore)</strong></td>
274
+ <td>
275
+
276
+ </td>
277
+ <td>
278
+
279
+
280
+ </td>
281
+ <td>
282
+
283
+
284
+ </td>
285
+ <td>
286
+
287
+
288
+ </td>
289
+ </tr>
290
+
291
+
292
+
293
+ <tr><th>Scenario</th><th>Filter</th><th>Account</th><th>Profile</td><th>Avatar</th></tr>
294
+ <tr>
295
+ <td><strong>Blur-media label ('porn') on account (hide)</strong></td>
296
+ <td>
297
+
298
+ </td>
299
+ <td>
300
+
301
+
302
+ </td>
303
+ <td>
304
+
305
+
306
+ </td>
307
+ <td>
308
+
309
+
310
+ </td>
311
+ </tr>
312
+
313
+
314
+
315
+
316
+ <tr>
317
+ <td><strong>Blur-media label ('porn') on profile (hide)</strong></td>
318
+ <td>
319
+
320
+ </td>
321
+ <td>
322
+
323
+
324
+ </td>
325
+ <td>
326
+
327
+
328
+ </td>
329
+ <td>
330
+
331
+
332
+ </td>
333
+ </tr>
334
+
335
+
336
+
337
+
338
+ <tr>
339
+ <td><strong>Blur-media label ('porn') on account (warn)</strong></td>
340
+ <td>
341
+
342
+ </td>
343
+ <td>
344
+
345
+
346
+ </td>
347
+ <td>
348
+
349
+
350
+ </td>
351
+ <td>
352
+
353
+
354
+ </td>
355
+ </tr>
356
+
357
+
358
+
359
+
360
+ <tr>
361
+ <td><strong>Blur-media label ('porn') on profile (warn)</strong></td>
362
+ <td>
363
+
364
+ </td>
365
+ <td>
366
+
367
+
368
+ </td>
369
+ <td>
370
+
371
+
372
+ </td>
373
+ <td>
374
+
375
+
376
+ </td>
377
+ </tr>
378
+
379
+
380
+
381
+
382
+ <tr>
383
+ <td><strong>Blur-media label ('porn') on account (ignore)</strong></td>
384
+ <td>
385
+
386
+ </td>
387
+ <td>
388
+
389
+
390
+ </td>
391
+ <td>
392
+
393
+
394
+ </td>
395
+ <td>
396
+
397
+
398
+ </td>
399
+ </tr>
400
+
401
+
402
+
403
+
404
+ <tr>
405
+ <td><strong>Blur-media label ('porn') on profile (ignore)</strong></td>
406
+ <td>
407
+
408
+ </td>
409
+ <td>
410
+
411
+
412
+ </td>
413
+ <td>
414
+
415
+
416
+ </td>
417
+ <td>
418
+
419
+
420
+ </td>
421
+ </tr>
422
+
423
+
424
+
425
+ <tr><th>Scenario</th><th>Filter</th><th>Account</th><th>Profile</td><th>Avatar</th></tr>
426
+ <tr>
427
+ <td><strong>Notice label ('scam') on account (hide)</strong></td>
428
+ <td>
429
+
430
+ </td>
431
+ <td>
432
+
433
+ 🪧
434
+ </td>
435
+ <td>
436
+
437
+
438
+ </td>
439
+ <td>
440
+
441
+ 🪧
442
+ </td>
443
+ </tr>
444
+
445
+
446
+
447
+
448
+ <tr>
449
+ <td><strong>Notice label ('scam') on profile (hide)</strong></td>
450
+ <td>
451
+
452
+ </td>
453
+ <td>
454
+
455
+
456
+ </td>
457
+ <td>
458
+
459
+ 🪧
460
+ </td>
461
+ <td>
462
+
463
+ 🪧
464
+ </td>
465
+ </tr>
466
+
467
+
468
+
469
+
470
+ <tr>
471
+ <td><strong>Notice label ('scam') on account (warn)</strong></td>
472
+ <td>
473
+
474
+ </td>
475
+ <td>
476
+
477
+ 🪧
478
+ </td>
479
+ <td>
480
+
481
+
482
+ </td>
483
+ <td>
484
+
485
+ 🪧
486
+ </td>
487
+ </tr>
488
+
489
+
490
+
491
+
492
+ <tr>
493
+ <td><strong>Notice label ('scam') on profile (warn)</strong></td>
494
+ <td>
495
+
496
+ </td>
497
+ <td>
498
+
499
+
500
+ </td>
501
+ <td>
502
+
503
+ 🪧
504
+ </td>
505
+ <td>
506
+
507
+ 🪧
508
+ </td>
509
+ </tr>
510
+
511
+
512
+
513
+
514
+ <tr>
515
+ <td><strong>Notice label ('scam') on account (ignore)</strong></td>
516
+ <td>
517
+
518
+ </td>
519
+ <td>
520
+
521
+
522
+ </td>
523
+ <td>
524
+
525
+
526
+ </td>
527
+ <td>
528
+
529
+
530
+ </td>
531
+ </tr>
532
+
533
+
534
+
535
+
536
+ <tr>
537
+ <td><strong>Notice label ('scam') on profile (ignore)</strong></td>
538
+ <td>
539
+
540
+ </td>
541
+ <td>
542
+
543
+
544
+ </td>
545
+ <td>
546
+
547
+
548
+ </td>
549
+ <td>
550
+
551
+
552
+ </td>
553
+ </tr>
554
+
555
+
556
+
557
+ <tr><th>Scenario</th><th>Filter</th><th>Account</th><th>Profile</td><th>Avatar</th></tr>
558
+ <tr>
559
+ <td><strong>Adult-only label on account when adult content is disabled</strong></td>
560
+ <td>
561
+
562
+ </td>
563
+ <td>
564
+ 🚫
565
+
566
+ </td>
567
+ <td>
568
+
569
+
570
+ </td>
571
+ <td>
572
+ 🚫
573
+
574
+ </td>
575
+ </tr>
576
+
577
+
578
+
579
+
580
+ <tr>
581
+ <td><strong>Adult-only label on profile when adult content is disabled</strong></td>
582
+ <td>
583
+
584
+ </td>
585
+ <td>
586
+
587
+
588
+ </td>
589
+ <td>
590
+
591
+
592
+ </td>
593
+ <td>
594
+ 🚫
595
+
596
+ </td>
597
+ </tr>
598
+
599
+
600
+
601
+ <tr><th>Scenario</th><th>Filter</th><th>Account</th><th>Profile</td><th>Avatar</th></tr>
602
+ <tr>
603
+ <td><strong>Self-profile: !hide on account</strong></td>
604
+ <td>
605
+
606
+ </td>
607
+ <td>
608
+
609
+ 🪧
610
+ </td>
611
+ <td>
612
+
613
+
614
+ </td>
615
+ <td>
616
+
617
+ 🪧
618
+ </td>
619
+ </tr>
620
+
621
+
622
+
623
+
624
+ <tr>
625
+ <td><strong>Self-profile: !hide on profile</strong></td>
626
+ <td>
627
+
628
+ </td>
629
+ <td>
630
+
631
+
632
+ </td>
633
+ <td>
634
+
635
+ 🪧
636
+ </td>
637
+ <td>
638
+
639
+ 🪧
640
+ </td>
641
+ </tr>
642
+
643
+
644
+
645
+ <tr><th>Scenario</th><th>Filter</th><th>Account</th><th>Profile</td><th>Avatar</th></tr>
646
+ <tr>
647
+ <td><strong>Mute/block: Blocking user</strong></td>
648
+ <td>
649
+
650
+ </td>
651
+ <td>
652
+
653
+
654
+ </td>
655
+ <td>
656
+
657
+
658
+ </td>
659
+ <td>
660
+ 🚫
661
+
662
+ </td>
663
+ </tr>
664
+
665
+
666
+
667
+
668
+ <tr>
669
+ <td><strong>Mute/block: Blocked by user</strong></td>
670
+ <td>
671
+
672
+ </td>
673
+ <td>
674
+
675
+
676
+ </td>
677
+ <td>
678
+
679
+
680
+ </td>
681
+ <td>
682
+ 🚫
683
+
684
+ </td>
685
+ </tr>
686
+
687
+
688
+
689
+
690
+ <tr>
691
+ <td><strong>Mute/block: Muted user</strong></td>
692
+ <td>
693
+
694
+ </td>
695
+ <td>
696
+
697
+
698
+ </td>
699
+ <td>
700
+
701
+
702
+ </td>
703
+ <td>
704
+
705
+
706
+ </td>
707
+ </tr>
708
+
709
+
710
+
711
+
712
+ <tr>
713
+ <td><strong>Mute/block: Muted-by-list user</strong></td>
714
+ <td>
715
+
716
+ </td>
717
+ <td>
718
+
719
+
720
+ </td>
721
+ <td>
722
+
723
+
724
+ </td>
725
+ <td>
726
+
727
+
728
+ </td>
729
+ </tr>
730
+
731
+
732
+
733
+ <tr><th>Scenario</th><th>Filter</th><th>Account</th><th>Profile</td><th>Avatar</th></tr>
734
+ <tr>
735
+ <td><strong>Prioritization: blocking & blocked-by user</strong></td>
736
+ <td>
737
+
738
+ </td>
739
+ <td>
740
+
741
+
742
+ </td>
743
+ <td>
744
+
745
+
746
+ </td>
747
+ <td>
748
+ 🚫
749
+
750
+ </td>
751
+ </tr>
752
+
753
+
754
+
755
+
756
+ <tr>
757
+ <td><strong>Prioritization: '!hide' label on account of blocked user</strong></td>
758
+ <td>
759
+
760
+ </td>
761
+ <td>
762
+ 🚫
763
+
764
+ </td>
765
+ <td>
766
+
767
+
768
+ </td>
769
+ <td>
770
+ 🚫
771
+
772
+ </td>
773
+ </tr>
774
+
775
+
776
+
777
+
778
+ <tr>
779
+ <td><strong>Prioritization: '!hide' and 'intolerant' labels on account (hide)</strong></td>
780
+ <td>
781
+
782
+ </td>
783
+ <td>
784
+ 🚫
785
+
786
+ </td>
787
+ <td>
788
+
789
+
790
+ </td>
791
+ <td>
792
+ 🚫
793
+
794
+ </td>
795
+ </tr>
796
+
797
+
798
+
799
+
800
+ <tr>
801
+ <td><strong>Prioritization: '!warn' and 'intolerant' labels on account (hide)</strong></td>
802
+ <td>
803
+
804
+ </td>
805
+ <td>
806
+
807
+
808
+ </td>
809
+ <td>
810
+
811
+
812
+ </td>
813
+ <td>
814
+
815
+
816
+ </td>
817
+ </tr>
818
+
819
+
820
+
821
+
822
+ <tr>
823
+ <td><strong>Prioritization: '!warn' and 'porn' labels on account (hide)</strong></td>
824
+ <td>
825
+
826
+ </td>
827
+ <td>
828
+
829
+
830
+ </td>
831
+ <td>
832
+
833
+
834
+ </td>
835
+ <td>
836
+
837
+
838
+ </td>
839
+ </tr>
840
+
841
+
842
+
843
+
844
+ <tr>
845
+ <td><strong>Prioritization: intolerant label on account (hide) and scam label on profile (warn)</strong></td>
846
+ <td>
847
+
848
+ </td>
849
+ <td>
850
+
851
+
852
+ </td>
853
+ <td>
854
+
855
+ 🪧
856
+ </td>
857
+ <td>
858
+
859
+ 🪧
860
+ </td>
861
+ </tr>
862
+
863
+
864
+
865
+
866
+ <tr>
867
+ <td><strong>Prioritization: !hide on account, !warn on profile</strong></td>
868
+ <td>
869
+
870
+ </td>
871
+ <td>
872
+ 🚫
873
+
874
+ </td>
875
+ <td>
876
+
877
+
878
+ </td>
879
+ <td>
880
+ 🚫
881
+
882
+ </td>
883
+ </tr>
884
+
885
+
886
+
887
+
888
+ <tr>
889
+ <td><strong>Prioritization: !warn on account, !hide on profile</strong></td>
890
+ <td>
891
+
892
+ </td>
893
+ <td>
894
+
895
+
896
+ </td>
897
+ <td>
898
+ 🚫
899
+
900
+ </td>
901
+ <td>
902
+ 🚫
903
+
904
+ </td>
905
+ </tr>
906
+
907
+ </table>