@atproto/bsky 0.0.15 → 0.0.17
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 +18 -0
- package/dist/api/com/atproto/moderation/util.d.ts +4 -3
- package/dist/cache/read-through.d.ts +30 -0
- package/dist/config.d.ts +18 -0
- package/dist/context.d.ts +21 -6
- package/dist/daemon/config.d.ts +15 -0
- package/dist/daemon/context.d.ts +15 -0
- package/dist/daemon/index.d.ts +23 -0
- package/dist/daemon/logger.d.ts +3 -0
- package/dist/daemon/notifications.d.ts +18 -0
- package/dist/daemon/services.d.ts +11 -0
- package/dist/db/database-schema.d.ts +1 -2
- package/dist/db/index.js +41 -1
- package/dist/db/index.js.map +3 -3
- package/dist/db/migrations/20231003T202833377Z-create-moderation-subject-status.d.ts +3 -0
- package/dist/db/migrations/20231205T000257238Z-remove-did-cache.d.ts +3 -0
- package/dist/db/migrations/index.d.ts +2 -0
- package/dist/db/pagination.d.ts +2 -1
- package/dist/db/{periodic-moderation-action-reversal.d.ts → periodic-moderation-event-reversal.d.ts} +3 -5
- package/dist/db/tables/moderation.d.ts +24 -34
- package/dist/did-cache.d.ts +10 -7
- package/dist/feed-gen/types.d.ts +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +4370 -2758
- package/dist/index.js.map +3 -3
- package/dist/indexer/context.d.ts +2 -0
- package/dist/indexer/index.d.ts +1 -0
- package/dist/lexicon/index.d.ts +23 -18
- package/dist/lexicon/lexicons.d.ts +561 -412
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts +1 -7
- package/dist/lexicon/types/app/bsky/graph/defs.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts +114 -48
- package/dist/lexicon/types/com/atproto/admin/{resolveModerationReports.d.ts → deleteAccount.d.ts} +2 -13
- package/dist/lexicon/types/com/atproto/admin/{takeModerationAction.d.ts → emitModerationEvent.d.ts} +5 -6
- package/dist/lexicon/types/com/atproto/admin/{getModerationAction.d.ts → getModerationEvent.d.ts} +1 -1
- package/dist/lexicon/types/com/atproto/admin/{getModerationActions.d.ts → queryModerationEvents.d.ts} +5 -1
- package/dist/lexicon/types/com/atproto/admin/{getModerationReports.d.ts → queryModerationStatuses.d.ts} +12 -6
- package/dist/lexicon/types/com/atproto/admin/sendEmail.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/{admin/getModerationReport.d.ts → temp/importRepo.d.ts} +10 -7
- package/dist/lexicon/types/com/atproto/temp/pushBlob.d.ts +25 -0
- package/dist/lexicon/types/com/atproto/{admin/reverseModerationAction.d.ts → temp/transferAccount.d.ts} +11 -5
- package/dist/logger.d.ts +1 -0
- package/dist/migrate-moderation-data.d.ts +1 -0
- package/dist/redis.d.ts +10 -1
- package/dist/services/actor/index.d.ts +18 -4
- package/dist/services/actor/views.d.ts +6 -8
- package/dist/services/feed/index.d.ts +7 -4
- package/dist/services/feed/util.d.ts +9 -1
- package/dist/services/feed/views.d.ts +11 -21
- package/dist/services/graph/index.d.ts +5 -29
- package/dist/services/graph/types.d.ts +1 -0
- package/dist/services/index.d.ts +3 -7
- package/dist/services/label/index.d.ts +10 -4
- package/dist/services/moderation/index.d.ts +134 -72
- package/dist/services/moderation/pagination.d.ts +36 -0
- package/dist/services/moderation/status.d.ts +13 -0
- package/dist/services/moderation/types.d.ts +35 -0
- package/dist/services/moderation/views.d.ts +18 -14
- package/dist/services/types.d.ts +3 -0
- package/dist/services/util/notification.d.ts +5 -0
- package/dist/services/util/post.d.ts +6 -6
- package/dist/util/debug.d.ts +1 -1
- package/dist/util/retry.d.ts +1 -6
- package/package.json +11 -11
- package/src/api/app/bsky/feed/getActorFeeds.ts +2 -1
- package/src/api/app/bsky/feed/getActorLikes.ts +1 -3
- package/src/api/app/bsky/feed/getAuthorFeed.ts +1 -3
- package/src/api/app/bsky/feed/getFeed.ts +9 -9
- package/src/api/app/bsky/feed/getFeedGenerator.ts +3 -0
- package/src/api/app/bsky/feed/getFeedGenerators.ts +2 -1
- package/src/api/app/bsky/feed/getListFeed.ts +1 -3
- package/src/api/app/bsky/feed/getPostThread.ts +15 -54
- package/src/api/app/bsky/feed/getPosts.ts +21 -18
- package/src/api/app/bsky/feed/getSuggestedFeeds.ts +2 -1
- package/src/api/app/bsky/feed/getTimeline.ts +1 -3
- package/src/api/app/bsky/feed/searchPosts.ts +20 -17
- package/src/api/app/bsky/graph/getList.ts +6 -3
- package/src/api/app/bsky/graph/getListBlocks.ts +3 -2
- package/src/api/app/bsky/graph/getListMutes.ts +2 -1
- package/src/api/app/bsky/graph/getLists.ts +2 -1
- package/src/api/app/bsky/unspecced/getPopularFeedGenerators.ts +3 -1
- package/src/api/blob-resolver.ts +6 -11
- package/src/api/com/atproto/admin/emitModerationEvent.ts +220 -0
- package/src/api/com/atproto/admin/{getModerationActions.ts → getModerationEvent.ts} +5 -11
- package/src/api/com/atproto/admin/getRecord.ts +1 -0
- package/src/api/com/atproto/admin/{getModerationReports.ts → queryModerationEvents.ts} +13 -16
- package/src/api/com/atproto/admin/queryModerationStatuses.ts +55 -0
- package/src/api/com/atproto/moderation/createReport.ts +9 -7
- package/src/api/com/atproto/moderation/util.ts +38 -20
- package/src/api/index.ts +8 -14
- package/src/auth.ts +29 -21
- package/src/auto-moderator/index.ts +26 -19
- package/src/cache/read-through.ts +151 -0
- package/src/config.ts +90 -1
- package/src/context.ts +11 -7
- package/src/daemon/config.ts +60 -0
- package/src/daemon/context.ts +27 -0
- package/src/daemon/index.ts +78 -0
- package/src/daemon/logger.ts +6 -0
- package/src/daemon/notifications.ts +54 -0
- package/src/daemon/services.ts +22 -0
- package/src/db/database-schema.ts +0 -2
- package/src/db/migrations/20231003T202833377Z-create-moderation-subject-status.ts +123 -0
- package/src/db/migrations/20231205T000257238Z-remove-did-cache.ts +14 -0
- package/src/db/migrations/index.ts +2 -0
- package/src/db/pagination.ts +26 -3
- package/src/db/{periodic-moderation-action-reversal.ts → periodic-moderation-event-reversal.ts} +50 -46
- package/src/db/tables/moderation.ts +35 -52
- package/src/did-cache.ts +33 -56
- package/src/feed-gen/bsky-team.ts +1 -1
- package/src/feed-gen/hot-classic.ts +1 -1
- package/src/feed-gen/index.ts +0 -4
- package/src/feed-gen/mutuals.ts +6 -2
- package/src/feed-gen/types.ts +1 -1
- package/src/index.ts +57 -17
- package/src/indexer/context.ts +5 -0
- package/src/indexer/index.ts +10 -7
- package/src/lexicon/index.ts +80 -67
- package/src/lexicon/lexicons.ts +698 -507
- package/src/lexicon/types/app/bsky/feed/defs.ts +1 -18
- package/src/lexicon/types/app/bsky/graph/defs.ts +1 -0
- package/src/lexicon/types/com/atproto/admin/defs.ts +276 -84
- package/src/lexicon/types/com/atproto/admin/{resolveModerationReports.ts → deleteAccount.ts} +2 -13
- package/src/lexicon/types/com/atproto/admin/{takeModerationAction.ts → emitModerationEvent.ts} +13 -11
- package/src/lexicon/types/com/atproto/admin/{getModerationReport.ts → getModerationEvent.ts} +1 -1
- package/src/lexicon/types/com/atproto/admin/{getModerationActions.ts → queryModerationEvents.ts} +8 -1
- package/src/lexicon/types/com/atproto/admin/{getModerationReports.ts → queryModerationStatuses.ts} +21 -14
- package/src/lexicon/types/com/atproto/admin/sendEmail.ts +1 -0
- package/src/lexicon/types/com/atproto/{admin/getModerationAction.ts → temp/importRepo.ts} +11 -7
- package/src/lexicon/types/com/atproto/temp/pushBlob.ts +39 -0
- package/src/lexicon/types/com/atproto/{admin/reverseModerationAction.ts → temp/transferAccount.ts} +18 -5
- package/src/logger.ts +2 -0
- package/src/migrate-moderation-data.ts +414 -0
- package/src/redis.ts +43 -3
- package/src/services/actor/index.ts +55 -7
- package/src/services/actor/views.ts +18 -21
- package/src/services/feed/index.ts +52 -19
- package/src/services/feed/util.ts +47 -19
- package/src/services/feed/views.ts +87 -13
- package/src/services/graph/index.ts +21 -3
- package/src/services/graph/types.ts +1 -0
- package/src/services/index.ts +14 -14
- package/src/services/indexing/index.ts +7 -10
- package/src/services/indexing/plugins/block.ts +2 -3
- package/src/services/indexing/plugins/feed-generator.ts +2 -3
- package/src/services/indexing/plugins/follow.ts +2 -3
- package/src/services/indexing/plugins/like.ts +2 -3
- package/src/services/indexing/plugins/list-block.ts +2 -3
- package/src/services/indexing/plugins/list-item.ts +2 -3
- package/src/services/indexing/plugins/list.ts +2 -3
- package/src/services/indexing/plugins/post.ts +16 -4
- package/src/services/indexing/plugins/repost.ts +2 -3
- package/src/services/indexing/plugins/thread-gate.ts +2 -3
- package/src/services/label/index.ts +68 -25
- package/src/services/moderation/index.ts +380 -395
- package/src/services/moderation/pagination.ts +96 -0
- package/src/services/moderation/status.ts +241 -0
- package/src/services/moderation/types.ts +49 -0
- package/src/services/moderation/views.ts +278 -329
- package/src/services/types.ts +4 -0
- package/src/services/util/notification.ts +70 -0
- package/src/util/debug.ts +2 -2
- package/src/util/retry.ts +1 -44
- package/tests/__snapshots__/feed-generation.test.ts.snap +322 -6
- package/tests/__snapshots__/indexing.test.ts.snap +0 -6
- package/tests/admin/__snapshots__/get-record.test.ts.snap +30 -132
- package/tests/admin/__snapshots__/get-repo.test.ts.snap +14 -60
- package/tests/admin/__snapshots__/moderation-events.test.ts.snap +146 -0
- package/tests/admin/__snapshots__/moderation-statuses.test.ts.snap +64 -0
- package/tests/admin/__snapshots__/moderation.test.ts.snap +0 -125
- package/tests/admin/get-record.test.ts +5 -9
- package/tests/admin/get-repo.test.ts +10 -12
- package/tests/admin/moderation-events.test.ts +221 -0
- package/tests/admin/moderation-statuses.test.ts +145 -0
- package/tests/admin/moderation.test.ts +512 -860
- package/tests/admin/repo-search.test.ts +3 -3
- package/tests/algos/hot-classic.test.ts +1 -2
- package/tests/auth.test.ts +1 -1
- package/tests/auto-moderator/fuzzy-matcher.test.ts +2 -1
- package/tests/auto-moderator/labeler.test.ts +19 -20
- package/tests/auto-moderator/takedowns.test.ts +61 -28
- package/tests/blob-resolver.test.ts +4 -2
- package/tests/daemon.test.ts +191 -0
- package/tests/did-cache.test.ts +20 -5
- package/tests/feed-generation.test.ts +57 -9
- package/tests/handle-invalidation.test.ts +1 -5
- package/tests/indexing.test.ts +20 -13
- package/tests/redis-cache.test.ts +231 -0
- package/tests/seeds/basic.ts +3 -0
- package/tests/subscription/repo.test.ts +4 -7
- package/tests/views/__snapshots__/block-lists.test.ts.snap +3 -9
- package/tests/views/__snapshots__/blocks.test.ts.snap +0 -9
- package/tests/views/__snapshots__/mute-lists.test.ts.snap +5 -5
- package/tests/views/__snapshots__/mutes.test.ts.snap +0 -3
- package/tests/views/__snapshots__/thread.test.ts.snap +0 -30
- package/tests/views/actor-search.test.ts +2 -3
- package/tests/views/author-feed.test.ts +42 -36
- package/tests/views/follows.test.ts +40 -35
- package/tests/views/list-feed.test.ts +17 -9
- package/tests/views/notifications.test.ts +13 -9
- package/tests/views/profile.test.ts +20 -19
- package/tests/views/thread.test.ts +117 -94
- package/tests/views/threadgating.test.ts +89 -19
- package/tests/views/timeline.test.ts +21 -13
- package/dist/api/com/atproto/admin/resolveModerationReports.d.ts +0 -3
- package/dist/api/com/atproto/admin/reverseModerationAction.d.ts +0 -3
- package/dist/api/com/atproto/admin/takeModerationAction.d.ts +0 -3
- package/dist/db/tables/did-cache.d.ts +0 -10
- package/dist/feed-gen/best-of-follows.d.ts +0 -29
- package/dist/feed-gen/whats-hot.d.ts +0 -29
- package/dist/feed-gen/with-friends.d.ts +0 -3
- package/dist/label-cache.d.ts +0 -19
- package/src/api/com/atproto/admin/getModerationAction.ts +0 -44
- package/src/api/com/atproto/admin/getModerationReport.ts +0 -43
- package/src/api/com/atproto/admin/resolveModerationReports.ts +0 -24
- package/src/api/com/atproto/admin/reverseModerationAction.ts +0 -115
- package/src/api/com/atproto/admin/takeModerationAction.ts +0 -156
- package/src/db/tables/did-cache.ts +0 -13
- package/src/feed-gen/best-of-follows.ts +0 -74
- package/src/feed-gen/whats-hot.ts +0 -101
- package/src/feed-gen/with-friends.ts +0 -39
- package/src/label-cache.ts +0 -90
- package/tests/admin/__snapshots__/get-moderation-action.test.ts.snap +0 -172
- package/tests/admin/__snapshots__/get-moderation-actions.test.ts.snap +0 -178
- package/tests/admin/__snapshots__/get-moderation-report.test.ts.snap +0 -177
- package/tests/admin/__snapshots__/get-moderation-reports.test.ts.snap +0 -307
- package/tests/admin/get-moderation-action.test.ts +0 -100
- package/tests/admin/get-moderation-actions.test.ts +0 -164
- package/tests/admin/get-moderation-report.test.ts +0 -100
- package/tests/admin/get-moderation-reports.test.ts +0 -332
- package/tests/algos/whats-hot.test.ts +0 -118
- package/tests/algos/with-friends.test.ts +0 -145
- /package/dist/api/com/atproto/admin/{getModerationAction.d.ts → emitModerationEvent.d.ts} +0 -0
- /package/dist/api/com/atproto/admin/{getModerationActions.d.ts → getModerationEvent.d.ts} +0 -0
- /package/dist/api/com/atproto/admin/{getModerationReport.d.ts → queryModerationEvents.d.ts} +0 -0
- /package/dist/api/com/atproto/admin/{getModerationReports.d.ts → queryModerationStatuses.d.ts} +0 -0
|
@@ -17,74 +17,23 @@ Object {
|
|
|
17
17
|
},
|
|
18
18
|
],
|
|
19
19
|
"moderation": Object {
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"uri": "record(0)",
|
|
32
|
-
},
|
|
33
|
-
"subjectBlobCids": Array [],
|
|
20
|
+
"subjectStatus": Object {
|
|
21
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
22
|
+
"id": 1,
|
|
23
|
+
"lastReportedAt": "1970-01-01T00:00:00.000Z",
|
|
24
|
+
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
|
|
25
|
+
"lastReviewedBy": "did:example:admin",
|
|
26
|
+
"reviewState": "com.atproto.admin.defs#reviewClosed",
|
|
27
|
+
"subject": Object {
|
|
28
|
+
"$type": "com.atproto.repo.strongRef",
|
|
29
|
+
"cid": "cids(0)",
|
|
30
|
+
"uri": "record(0)",
|
|
34
31
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"id": 1,
|
|
40
|
-
"reason": "X",
|
|
41
|
-
"resolvedReportIds": Array [],
|
|
42
|
-
"reversal": Object {
|
|
43
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
44
|
-
"createdBy": "did:example:admin",
|
|
45
|
-
"reason": "X",
|
|
46
|
-
},
|
|
47
|
-
"subject": Object {
|
|
48
|
-
"$type": "com.atproto.repo.strongRef",
|
|
49
|
-
"cid": "cids(0)",
|
|
50
|
-
"uri": "record(0)",
|
|
51
|
-
},
|
|
52
|
-
"subjectBlobCids": Array [],
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
"currentAction": Object {
|
|
56
|
-
"action": "com.atproto.admin.defs#takedown",
|
|
57
|
-
"id": 2,
|
|
32
|
+
"subjectBlobCids": Array [],
|
|
33
|
+
"subjectRepoHandle": "alice.test",
|
|
34
|
+
"takendown": true,
|
|
35
|
+
"updatedAt": "1970-01-01T00:00:00.000Z",
|
|
58
36
|
},
|
|
59
|
-
"reports": Array [
|
|
60
|
-
Object {
|
|
61
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
62
|
-
"id": 2,
|
|
63
|
-
"reason": "defamation",
|
|
64
|
-
"reasonType": "com.atproto.moderation.defs#reasonOther",
|
|
65
|
-
"reportedBy": "user(1)",
|
|
66
|
-
"resolvedByActionIds": Array [],
|
|
67
|
-
"subject": Object {
|
|
68
|
-
"$type": "com.atproto.repo.strongRef",
|
|
69
|
-
"cid": "cids(0)",
|
|
70
|
-
"uri": "record(0)",
|
|
71
|
-
},
|
|
72
|
-
"subjectRepoHandle": "alice.test",
|
|
73
|
-
},
|
|
74
|
-
Object {
|
|
75
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
76
|
-
"id": 1,
|
|
77
|
-
"reasonType": "com.atproto.moderation.defs#reasonSpam",
|
|
78
|
-
"reportedBy": "user(2)",
|
|
79
|
-
"resolvedByActionIds": Array [],
|
|
80
|
-
"subject": Object {
|
|
81
|
-
"$type": "com.atproto.repo.strongRef",
|
|
82
|
-
"cid": "cids(0)",
|
|
83
|
-
"uri": "record(0)",
|
|
84
|
-
},
|
|
85
|
-
"subjectRepoHandle": "alice.test",
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
37
|
},
|
|
89
38
|
"repo": Object {
|
|
90
39
|
"did": "user(0)",
|
|
@@ -154,74 +103,23 @@ Object {
|
|
|
154
103
|
},
|
|
155
104
|
],
|
|
156
105
|
"moderation": Object {
|
|
157
|
-
"
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
"
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
"uri": "record(0)",
|
|
169
|
-
},
|
|
170
|
-
"subjectBlobCids": Array [],
|
|
106
|
+
"subjectStatus": Object {
|
|
107
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
108
|
+
"id": 1,
|
|
109
|
+
"lastReportedAt": "1970-01-01T00:00:00.000Z",
|
|
110
|
+
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
|
|
111
|
+
"lastReviewedBy": "did:example:admin",
|
|
112
|
+
"reviewState": "com.atproto.admin.defs#reviewClosed",
|
|
113
|
+
"subject": Object {
|
|
114
|
+
"$type": "com.atproto.repo.strongRef",
|
|
115
|
+
"cid": "cids(0)",
|
|
116
|
+
"uri": "record(0)",
|
|
171
117
|
},
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
"id": 1,
|
|
177
|
-
"reason": "X",
|
|
178
|
-
"resolvedReportIds": Array [],
|
|
179
|
-
"reversal": Object {
|
|
180
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
181
|
-
"createdBy": "did:example:admin",
|
|
182
|
-
"reason": "X",
|
|
183
|
-
},
|
|
184
|
-
"subject": Object {
|
|
185
|
-
"$type": "com.atproto.repo.strongRef",
|
|
186
|
-
"cid": "cids(0)",
|
|
187
|
-
"uri": "record(0)",
|
|
188
|
-
},
|
|
189
|
-
"subjectBlobCids": Array [],
|
|
190
|
-
},
|
|
191
|
-
],
|
|
192
|
-
"currentAction": Object {
|
|
193
|
-
"action": "com.atproto.admin.defs#takedown",
|
|
194
|
-
"id": 2,
|
|
118
|
+
"subjectBlobCids": Array [],
|
|
119
|
+
"subjectRepoHandle": "alice.test",
|
|
120
|
+
"takendown": true,
|
|
121
|
+
"updatedAt": "1970-01-01T00:00:00.000Z",
|
|
195
122
|
},
|
|
196
|
-
"reports": Array [
|
|
197
|
-
Object {
|
|
198
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
199
|
-
"id": 2,
|
|
200
|
-
"reason": "defamation",
|
|
201
|
-
"reasonType": "com.atproto.moderation.defs#reasonOther",
|
|
202
|
-
"reportedBy": "user(1)",
|
|
203
|
-
"resolvedByActionIds": Array [],
|
|
204
|
-
"subject": Object {
|
|
205
|
-
"$type": "com.atproto.repo.strongRef",
|
|
206
|
-
"cid": "cids(0)",
|
|
207
|
-
"uri": "record(0)",
|
|
208
|
-
},
|
|
209
|
-
"subjectRepoHandle": "alice.test",
|
|
210
|
-
},
|
|
211
|
-
Object {
|
|
212
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
213
|
-
"id": 1,
|
|
214
|
-
"reasonType": "com.atproto.moderation.defs#reasonSpam",
|
|
215
|
-
"reportedBy": "user(2)",
|
|
216
|
-
"resolvedByActionIds": Array [],
|
|
217
|
-
"subject": Object {
|
|
218
|
-
"$type": "com.atproto.repo.strongRef",
|
|
219
|
-
"cid": "cids(0)",
|
|
220
|
-
"uri": "record(0)",
|
|
221
|
-
},
|
|
222
|
-
"subjectRepoHandle": "alice.test",
|
|
223
|
-
},
|
|
224
|
-
],
|
|
225
123
|
},
|
|
226
124
|
"repo": Object {
|
|
227
125
|
"did": "user(0)",
|
|
@@ -10,68 +10,22 @@ Object {
|
|
|
10
10
|
"invitesDisabled": false,
|
|
11
11
|
"labels": Array [],
|
|
12
12
|
"moderation": Object {
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
"did": "user(0)",
|
|
24
|
-
},
|
|
25
|
-
"subjectBlobCids": Array [],
|
|
26
|
-
},
|
|
27
|
-
Object {
|
|
28
|
-
"action": "com.atproto.admin.defs#acknowledge",
|
|
29
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
30
|
-
"createdBy": "did:example:admin",
|
|
31
|
-
"id": 1,
|
|
32
|
-
"reason": "X",
|
|
33
|
-
"resolvedReportIds": Array [],
|
|
34
|
-
"reversal": Object {
|
|
35
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
36
|
-
"createdBy": "did:example:admin",
|
|
37
|
-
"reason": "X",
|
|
38
|
-
},
|
|
39
|
-
"subject": Object {
|
|
40
|
-
"$type": "com.atproto.admin.defs#repoRef",
|
|
41
|
-
"did": "user(0)",
|
|
42
|
-
},
|
|
43
|
-
"subjectBlobCids": Array [],
|
|
13
|
+
"subjectStatus": Object {
|
|
14
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
15
|
+
"id": 1,
|
|
16
|
+
"lastReportedAt": "1970-01-01T00:00:00.000Z",
|
|
17
|
+
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
|
|
18
|
+
"lastReviewedBy": "did:example:admin",
|
|
19
|
+
"reviewState": "com.atproto.admin.defs#reviewClosed",
|
|
20
|
+
"subject": Object {
|
|
21
|
+
"$type": "com.atproto.admin.defs#repoRef",
|
|
22
|
+
"did": "user(0)",
|
|
44
23
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
24
|
+
"subjectBlobCids": Array [],
|
|
25
|
+
"subjectRepoHandle": "alice.test",
|
|
26
|
+
"takendown": true,
|
|
27
|
+
"updatedAt": "1970-01-01T00:00:00.000Z",
|
|
49
28
|
},
|
|
50
|
-
"reports": Array [
|
|
51
|
-
Object {
|
|
52
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
53
|
-
"id": 2,
|
|
54
|
-
"reason": "defamation",
|
|
55
|
-
"reasonType": "com.atproto.moderation.defs#reasonOther",
|
|
56
|
-
"reportedBy": "user(1)",
|
|
57
|
-
"resolvedByActionIds": Array [],
|
|
58
|
-
"subject": Object {
|
|
59
|
-
"$type": "com.atproto.admin.defs#repoRef",
|
|
60
|
-
"did": "user(0)",
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
Object {
|
|
64
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
65
|
-
"id": 1,
|
|
66
|
-
"reasonType": "com.atproto.moderation.defs#reasonSpam",
|
|
67
|
-
"reportedBy": "user(2)",
|
|
68
|
-
"resolvedByActionIds": Array [],
|
|
69
|
-
"subject": Object {
|
|
70
|
-
"$type": "com.atproto.admin.defs#repoRef",
|
|
71
|
-
"did": "user(0)",
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
29
|
},
|
|
76
30
|
"relatedRecords": Array [
|
|
77
31
|
Object {
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`moderation-events get event gets an event by specific id 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
6
|
+
"createdBy": "user(2)",
|
|
7
|
+
"event": Object {
|
|
8
|
+
"$type": "com.atproto.admin.defs#modEventReport",
|
|
9
|
+
"comment": "X",
|
|
10
|
+
"reportType": "com.atproto.moderation.defs#reasonMisleading",
|
|
11
|
+
},
|
|
12
|
+
"id": 1,
|
|
13
|
+
"subject": Object {
|
|
14
|
+
"$type": "com.atproto.admin.defs#repoView",
|
|
15
|
+
"did": "user(0)",
|
|
16
|
+
"handle": "alice.test",
|
|
17
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
18
|
+
"moderation": Object {
|
|
19
|
+
"subjectStatus": Object {
|
|
20
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
21
|
+
"id": 1,
|
|
22
|
+
"lastReportedAt": "1970-01-01T00:00:00.000Z",
|
|
23
|
+
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
|
|
24
|
+
"lastReviewedBy": "user(1)",
|
|
25
|
+
"reviewState": "com.atproto.admin.defs#reviewEscalated",
|
|
26
|
+
"subject": Object {
|
|
27
|
+
"$type": "com.atproto.admin.defs#repoRef",
|
|
28
|
+
"did": "user(0)",
|
|
29
|
+
},
|
|
30
|
+
"subjectBlobCids": Array [],
|
|
31
|
+
"subjectRepoHandle": "alice.test",
|
|
32
|
+
"takendown": false,
|
|
33
|
+
"updatedAt": "1970-01-01T00:00:00.000Z",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
"relatedRecords": Array [
|
|
37
|
+
Object {
|
|
38
|
+
"$type": "app.bsky.actor.profile",
|
|
39
|
+
"avatar": Object {
|
|
40
|
+
"$type": "blob",
|
|
41
|
+
"mimeType": "image/jpeg",
|
|
42
|
+
"ref": Object {
|
|
43
|
+
"$link": "cids(0)",
|
|
44
|
+
},
|
|
45
|
+
"size": 3976,
|
|
46
|
+
},
|
|
47
|
+
"description": "its me!",
|
|
48
|
+
"displayName": "ali",
|
|
49
|
+
"labels": Object {
|
|
50
|
+
"$type": "com.atproto.label.defs#selfLabels",
|
|
51
|
+
"values": Array [
|
|
52
|
+
Object {
|
|
53
|
+
"val": "self-label-a",
|
|
54
|
+
},
|
|
55
|
+
Object {
|
|
56
|
+
"val": "self-label-b",
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
"subjectBlobCids": Array [],
|
|
64
|
+
"subjectBlobs": Array [],
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
exports[`moderation-events query events returns all events for record or repo 1`] = `
|
|
69
|
+
Array [
|
|
70
|
+
Object {
|
|
71
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
72
|
+
"createdBy": "user(1)",
|
|
73
|
+
"creatorHandle": "alice.test",
|
|
74
|
+
"event": Object {
|
|
75
|
+
"$type": "com.atproto.admin.defs#modEventReport",
|
|
76
|
+
"comment": "X",
|
|
77
|
+
"reportType": "com.atproto.moderation.defs#reasonSpam",
|
|
78
|
+
},
|
|
79
|
+
"id": 7,
|
|
80
|
+
"subject": Object {
|
|
81
|
+
"$type": "com.atproto.admin.defs#repoRef",
|
|
82
|
+
"did": "user(0)",
|
|
83
|
+
},
|
|
84
|
+
"subjectBlobCids": Array [],
|
|
85
|
+
"subjectHandle": "bob.test",
|
|
86
|
+
},
|
|
87
|
+
Object {
|
|
88
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
89
|
+
"createdBy": "user(1)",
|
|
90
|
+
"creatorHandle": "alice.test",
|
|
91
|
+
"event": Object {
|
|
92
|
+
"$type": "com.atproto.admin.defs#modEventReport",
|
|
93
|
+
"comment": "X",
|
|
94
|
+
"reportType": "com.atproto.moderation.defs#reasonSpam",
|
|
95
|
+
},
|
|
96
|
+
"id": 3,
|
|
97
|
+
"subject": Object {
|
|
98
|
+
"$type": "com.atproto.admin.defs#repoRef",
|
|
99
|
+
"did": "user(0)",
|
|
100
|
+
},
|
|
101
|
+
"subjectBlobCids": Array [],
|
|
102
|
+
"subjectHandle": "bob.test",
|
|
103
|
+
},
|
|
104
|
+
]
|
|
105
|
+
`;
|
|
106
|
+
|
|
107
|
+
exports[`moderation-events query events returns all events for record or repo 2`] = `
|
|
108
|
+
Array [
|
|
109
|
+
Object {
|
|
110
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
111
|
+
"createdBy": "user(0)",
|
|
112
|
+
"creatorHandle": "bob.test",
|
|
113
|
+
"event": Object {
|
|
114
|
+
"$type": "com.atproto.admin.defs#modEventReport",
|
|
115
|
+
"comment": "X",
|
|
116
|
+
"reportType": "com.atproto.moderation.defs#reasonSpam",
|
|
117
|
+
},
|
|
118
|
+
"id": 6,
|
|
119
|
+
"subject": Object {
|
|
120
|
+
"$type": "com.atproto.repo.strongRef",
|
|
121
|
+
"cid": "cids(0)",
|
|
122
|
+
"uri": "record(0)",
|
|
123
|
+
},
|
|
124
|
+
"subjectBlobCids": Array [],
|
|
125
|
+
"subjectHandle": "alice.test",
|
|
126
|
+
},
|
|
127
|
+
Object {
|
|
128
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
129
|
+
"createdBy": "user(0)",
|
|
130
|
+
"creatorHandle": "bob.test",
|
|
131
|
+
"event": Object {
|
|
132
|
+
"$type": "com.atproto.admin.defs#modEventReport",
|
|
133
|
+
"comment": "X",
|
|
134
|
+
"reportType": "com.atproto.moderation.defs#reasonSpam",
|
|
135
|
+
},
|
|
136
|
+
"id": 2,
|
|
137
|
+
"subject": Object {
|
|
138
|
+
"$type": "com.atproto.repo.strongRef",
|
|
139
|
+
"cid": "cids(0)",
|
|
140
|
+
"uri": "record(0)",
|
|
141
|
+
},
|
|
142
|
+
"subjectBlobCids": Array [],
|
|
143
|
+
"subjectHandle": "alice.test",
|
|
144
|
+
},
|
|
145
|
+
]
|
|
146
|
+
`;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`moderation-statuses query statuses returns statuses for subjects that received moderation events 1`] = `
|
|
4
|
+
Array [
|
|
5
|
+
Object {
|
|
6
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
7
|
+
"id": 4,
|
|
8
|
+
"lastReportedAt": "1970-01-01T00:00:00.000Z",
|
|
9
|
+
"reviewState": "com.atproto.admin.defs#reviewOpen",
|
|
10
|
+
"subject": Object {
|
|
11
|
+
"$type": "com.atproto.repo.strongRef",
|
|
12
|
+
"cid": "cids(0)",
|
|
13
|
+
"uri": "record(0)",
|
|
14
|
+
},
|
|
15
|
+
"subjectBlobCids": Array [],
|
|
16
|
+
"subjectRepoHandle": "bob.test",
|
|
17
|
+
"takendown": false,
|
|
18
|
+
"updatedAt": "1970-01-01T00:00:00.000Z",
|
|
19
|
+
},
|
|
20
|
+
Object {
|
|
21
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
22
|
+
"id": 3,
|
|
23
|
+
"lastReportedAt": "1970-01-01T00:00:00.000Z",
|
|
24
|
+
"reviewState": "com.atproto.admin.defs#reviewOpen",
|
|
25
|
+
"subject": Object {
|
|
26
|
+
"$type": "com.atproto.admin.defs#repoRef",
|
|
27
|
+
"did": "user(0)",
|
|
28
|
+
},
|
|
29
|
+
"subjectBlobCids": Array [],
|
|
30
|
+
"subjectRepoHandle": "bob.test",
|
|
31
|
+
"takendown": false,
|
|
32
|
+
"updatedAt": "1970-01-01T00:00:00.000Z",
|
|
33
|
+
},
|
|
34
|
+
Object {
|
|
35
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
36
|
+
"id": 2,
|
|
37
|
+
"lastReportedAt": "1970-01-01T00:00:00.000Z",
|
|
38
|
+
"reviewState": "com.atproto.admin.defs#reviewOpen",
|
|
39
|
+
"subject": Object {
|
|
40
|
+
"$type": "com.atproto.repo.strongRef",
|
|
41
|
+
"cid": "cids(1)",
|
|
42
|
+
"uri": "record(1)",
|
|
43
|
+
},
|
|
44
|
+
"subjectBlobCids": Array [],
|
|
45
|
+
"subjectRepoHandle": "alice.test",
|
|
46
|
+
"takendown": false,
|
|
47
|
+
"updatedAt": "1970-01-01T00:00:00.000Z",
|
|
48
|
+
},
|
|
49
|
+
Object {
|
|
50
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
51
|
+
"id": 1,
|
|
52
|
+
"lastReportedAt": "1970-01-01T00:00:00.000Z",
|
|
53
|
+
"reviewState": "com.atproto.admin.defs#reviewOpen",
|
|
54
|
+
"subject": Object {
|
|
55
|
+
"$type": "com.atproto.admin.defs#repoRef",
|
|
56
|
+
"did": "user(1)",
|
|
57
|
+
},
|
|
58
|
+
"subjectBlobCids": Array [],
|
|
59
|
+
"subjectRepoHandle": "alice.test",
|
|
60
|
+
"takendown": false,
|
|
61
|
+
"updatedAt": "1970-01-01T00:00:00.000Z",
|
|
62
|
+
},
|
|
63
|
+
]
|
|
64
|
+
`;
|
|
@@ -1,130 +1,5 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`moderation actioning resolves reports on missing repos and records. 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"recordActionDetail": Object {
|
|
6
|
-
"action": "com.atproto.admin.defs#flag",
|
|
7
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
8
|
-
"createdBy": "did:example:admin",
|
|
9
|
-
"id": 2,
|
|
10
|
-
"reason": "Y",
|
|
11
|
-
"resolvedReports": Array [
|
|
12
|
-
Object {
|
|
13
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
14
|
-
"id": 11,
|
|
15
|
-
"reason": "defamation",
|
|
16
|
-
"reasonType": "com.atproto.moderation.defs#reasonOther",
|
|
17
|
-
"reportedBy": "user(0)",
|
|
18
|
-
"resolvedByActionIds": Array [
|
|
19
|
-
2,
|
|
20
|
-
],
|
|
21
|
-
"subject": Object {
|
|
22
|
-
"$type": "com.atproto.repo.strongRef",
|
|
23
|
-
"cid": "cids(0)",
|
|
24
|
-
"uri": "record(0)",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
Object {
|
|
28
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
29
|
-
"id": 10,
|
|
30
|
-
"reasonType": "com.atproto.moderation.defs#reasonSpam",
|
|
31
|
-
"reportedBy": "user(1)",
|
|
32
|
-
"resolvedByActionIds": Array [
|
|
33
|
-
2,
|
|
34
|
-
],
|
|
35
|
-
"subject": Object {
|
|
36
|
-
"$type": "com.atproto.admin.defs#repoRef",
|
|
37
|
-
"did": "user(2)",
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
"subject": Object {
|
|
42
|
-
"$type": "com.atproto.admin.defs#recordViewNotFound",
|
|
43
|
-
"uri": "record(0)",
|
|
44
|
-
},
|
|
45
|
-
"subjectBlobs": Array [],
|
|
46
|
-
},
|
|
47
|
-
"reportADetail": Object {
|
|
48
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
49
|
-
"id": 10,
|
|
50
|
-
"reasonType": "com.atproto.moderation.defs#reasonSpam",
|
|
51
|
-
"reportedBy": "user(1)",
|
|
52
|
-
"resolvedByActions": Array [
|
|
53
|
-
Object {
|
|
54
|
-
"action": "com.atproto.admin.defs#flag",
|
|
55
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
56
|
-
"createdBy": "did:example:admin",
|
|
57
|
-
"id": 2,
|
|
58
|
-
"reason": "Y",
|
|
59
|
-
"resolvedReportIds": Array [
|
|
60
|
-
11,
|
|
61
|
-
10,
|
|
62
|
-
],
|
|
63
|
-
"subject": Object {
|
|
64
|
-
"$type": "com.atproto.repo.strongRef",
|
|
65
|
-
"cid": "cids(0)",
|
|
66
|
-
"uri": "record(0)",
|
|
67
|
-
},
|
|
68
|
-
"subjectBlobCids": Array [],
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
"subject": Object {
|
|
72
|
-
"$type": "com.atproto.admin.defs#repoViewNotFound",
|
|
73
|
-
"did": "user(2)",
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
"reportBDetail": Object {
|
|
77
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
78
|
-
"id": 11,
|
|
79
|
-
"reason": "defamation",
|
|
80
|
-
"reasonType": "com.atproto.moderation.defs#reasonOther",
|
|
81
|
-
"reportedBy": "user(0)",
|
|
82
|
-
"resolvedByActions": Array [
|
|
83
|
-
Object {
|
|
84
|
-
"action": "com.atproto.admin.defs#flag",
|
|
85
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
86
|
-
"createdBy": "did:example:admin",
|
|
87
|
-
"id": 2,
|
|
88
|
-
"reason": "Y",
|
|
89
|
-
"resolvedReportIds": Array [
|
|
90
|
-
11,
|
|
91
|
-
10,
|
|
92
|
-
],
|
|
93
|
-
"subject": Object {
|
|
94
|
-
"$type": "com.atproto.repo.strongRef",
|
|
95
|
-
"cid": "cids(0)",
|
|
96
|
-
"uri": "record(0)",
|
|
97
|
-
},
|
|
98
|
-
"subjectBlobCids": Array [],
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
"subject": Object {
|
|
102
|
-
"$type": "com.atproto.admin.defs#recordViewNotFound",
|
|
103
|
-
"uri": "record(0)",
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
}
|
|
107
|
-
`;
|
|
108
|
-
|
|
109
|
-
exports[`moderation actioning resolves reports on repos and records. 1`] = `
|
|
110
|
-
Object {
|
|
111
|
-
"action": "com.atproto.admin.defs#takedown",
|
|
112
|
-
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
113
|
-
"createdBy": "did:example:admin",
|
|
114
|
-
"id": 1,
|
|
115
|
-
"reason": "Y",
|
|
116
|
-
"resolvedReportIds": Array [
|
|
117
|
-
9,
|
|
118
|
-
8,
|
|
119
|
-
],
|
|
120
|
-
"subject": Object {
|
|
121
|
-
"$type": "com.atproto.admin.defs#repoRef",
|
|
122
|
-
"did": "user(0)",
|
|
123
|
-
},
|
|
124
|
-
"subjectBlobCids": Array [],
|
|
125
|
-
}
|
|
126
|
-
`;
|
|
127
|
-
|
|
128
3
|
exports[`moderation reporting creates reports of a record. 1`] = `
|
|
129
4
|
Array [
|
|
130
5
|
Object {
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { SeedClient, TestNetwork } from '@atproto/dev-env'
|
|
2
2
|
import AtpAgent from '@atproto/api'
|
|
3
3
|
import { AtUri } from '@atproto/syntax'
|
|
4
|
-
import {
|
|
5
|
-
ACKNOWLEDGE,
|
|
6
|
-
TAKEDOWN,
|
|
7
|
-
} from '@atproto/api/src/client/types/com/atproto/admin/defs'
|
|
8
4
|
import {
|
|
9
5
|
REASONOTHER,
|
|
10
6
|
REASONSPAM,
|
|
@@ -24,6 +20,7 @@ describe('admin get record view', () => {
|
|
|
24
20
|
agent = network.pds.getClient()
|
|
25
21
|
sc = network.getSeedClient()
|
|
26
22
|
await basicSeed(sc)
|
|
23
|
+
await network.processAll()
|
|
27
24
|
})
|
|
28
25
|
|
|
29
26
|
afterAll(async () => {
|
|
@@ -31,8 +28,8 @@ describe('admin get record view', () => {
|
|
|
31
28
|
})
|
|
32
29
|
|
|
33
30
|
beforeAll(async () => {
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
await sc.emitModerationEvent({
|
|
32
|
+
event: { $type: 'com.atproto.admin.defs#modEventFlag' },
|
|
36
33
|
subject: {
|
|
37
34
|
$type: 'com.atproto.repo.strongRef',
|
|
38
35
|
uri: sc.posts[sc.dids.alice][0].ref.uriStr,
|
|
@@ -58,9 +55,8 @@ describe('admin get record view', () => {
|
|
|
58
55
|
cid: sc.posts[sc.dids.alice][0].ref.cidStr,
|
|
59
56
|
},
|
|
60
57
|
})
|
|
61
|
-
await sc.
|
|
62
|
-
|
|
63
|
-
action: TAKEDOWN,
|
|
58
|
+
await sc.emitModerationEvent({
|
|
59
|
+
event: { $type: 'com.atproto.admin.defs#modEventTakedown' },
|
|
64
60
|
subject: {
|
|
65
61
|
$type: 'com.atproto.repo.strongRef',
|
|
66
62
|
uri: sc.posts[sc.dids.alice][0].ref.uriStr,
|