@atproto/bsky 0.0.11 → 0.0.13
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 +29 -0
- package/LICENSE.txt +7 -0
- package/README.md +6 -1
- package/dist/api/com/atproto/admin/util.d.ts +5 -0
- package/dist/context.d.ts +6 -1
- package/dist/db/index.js +51 -2
- package/dist/db/index.js.map +3 -3
- package/dist/db/migrations/20230929T192920807Z-record-cursor-indexes.d.ts +3 -0
- package/dist/db/migrations/index.d.ts +1 -0
- package/dist/did-cache.d.ts +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1630 -755
- package/dist/index.js.map +3 -3
- package/dist/lexicon/index.d.ts +8 -0
- package/dist/lexicon/lexicons.d.ts +243 -3
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts +28 -0
- package/dist/lexicon/types/com/atproto/admin/getAccountInfo.d.ts +29 -0
- package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts +39 -0
- package/dist/lexicon/types/com/atproto/admin/searchRepos.d.ts +0 -1
- package/dist/lexicon/types/com/atproto/admin/updateSubjectStatus.d.ts +46 -0
- package/dist/lexicon/types/com/atproto/server/createAccount.d.ts +4 -2
- package/dist/lexicon/types/com/atproto/server/createSession.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/server/reserveSigningKey.d.ts +36 -0
- package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts +1 -0
- package/dist/services/actor/types.d.ts +1 -0
- package/dist/services/graph/index.d.ts +2 -0
- package/dist/services/moderation/index.d.ts +13 -3
- package/package.json +14 -15
- package/src/api/app/bsky/feed/getAuthorFeed.ts +2 -2
- package/src/api/app/bsky/feed/getPostThread.ts +2 -2
- package/src/api/app/bsky/notification/listNotifications.ts +33 -22
- package/src/api/com/atproto/admin/getModerationAction.ts +28 -2
- package/src/api/com/atproto/admin/getModerationReport.ts +27 -2
- package/src/api/com/atproto/admin/getRecord.ts +14 -2
- package/src/api/com/atproto/admin/getRepo.ts +13 -2
- package/src/api/com/atproto/admin/reverseModerationAction.ts +31 -5
- package/src/api/com/atproto/admin/searchRepos.ts +2 -5
- package/src/api/com/atproto/admin/takeModerationAction.ts +41 -7
- package/src/api/com/atproto/admin/util.ts +50 -0
- package/src/api/well-known.ts +8 -0
- package/src/auth.ts +12 -5
- package/src/auto-moderator/index.ts +1 -0
- package/src/context.ts +25 -1
- package/src/db/migrations/20230929T192920807Z-record-cursor-indexes.ts +40 -0
- package/src/db/migrations/index.ts +1 -0
- package/src/did-cache.ts +29 -14
- package/src/feed-gen/with-friends.ts +2 -2
- package/src/index.ts +4 -1
- package/src/indexer/subscription.ts +1 -21
- package/src/lexicon/index.ts +48 -0
- package/src/lexicon/lexicons.ts +259 -5
- package/src/lexicon/types/app/bsky/actor/defs.ts +1 -0
- package/src/lexicon/types/com/atproto/admin/defs.ts +61 -0
- package/src/lexicon/types/com/atproto/admin/getAccountInfo.ts +41 -0
- package/src/lexicon/types/com/atproto/admin/getSubjectStatus.ts +54 -0
- package/src/lexicon/types/com/atproto/admin/searchRepos.ts +0 -1
- package/src/lexicon/types/com/atproto/admin/updateSubjectStatus.ts +61 -0
- package/src/lexicon/types/com/atproto/server/createAccount.ts +4 -2
- package/src/lexicon/types/com/atproto/server/createSession.ts +1 -0
- package/src/lexicon/types/com/atproto/server/refreshSession.ts +1 -0
- package/src/lexicon/types/com/atproto/server/reserveSigningKey.ts +51 -0
- package/src/lexicon/types/com/atproto/sync/listRepos.ts +1 -0
- package/src/logger.ts +8 -0
- package/src/services/actor/index.ts +7 -1
- package/src/services/actor/types.ts +1 -0
- package/src/services/actor/views.ts +26 -8
- package/src/services/graph/index.ts +26 -7
- package/src/services/indexing/index.ts +15 -17
- package/src/services/moderation/index.ts +94 -14
- package/src/services/moderation/views.ts +1 -0
- package/tests/__snapshots__/feed-generation.test.ts.snap +12 -12
- package/tests/__snapshots__/indexing.test.ts.snap +4 -4
- package/tests/admin/__snapshots__/get-moderation-action.test.ts.snap +172 -0
- package/tests/admin/__snapshots__/get-moderation-actions.test.ts.snap +178 -0
- package/tests/admin/__snapshots__/get-moderation-report.test.ts.snap +177 -0
- package/tests/admin/__snapshots__/get-moderation-reports.test.ts.snap +307 -0
- package/tests/admin/__snapshots__/get-record.test.ts.snap +275 -0
- package/tests/admin/__snapshots__/get-repo.test.ts.snap +103 -0
- package/tests/admin/get-moderation-action.test.ts +100 -0
- package/tests/admin/get-moderation-actions.test.ts +164 -0
- package/tests/admin/get-moderation-report.test.ts +100 -0
- package/tests/admin/get-moderation-reports.test.ts +332 -0
- package/tests/admin/get-record.test.ts +115 -0
- package/tests/admin/get-repo.test.ts +101 -0
- package/tests/{moderation.test.ts → admin/moderation.test.ts} +107 -9
- package/tests/admin/repo-search.test.ts +124 -0
- package/tests/algos/hot-classic.test.ts +3 -5
- package/tests/algos/whats-hot.test.ts +3 -5
- package/tests/algos/with-friends.test.ts +2 -4
- package/tests/auth.test.ts +64 -0
- package/tests/auto-moderator/fuzzy-matcher.test.ts +2 -3
- package/tests/auto-moderator/labeler.test.ts +5 -7
- package/tests/auto-moderator/takedowns.test.ts +11 -12
- package/tests/blob-resolver.test.ts +1 -3
- package/tests/did-cache.test.ts +2 -5
- package/tests/feed-generation.test.ts +8 -6
- package/tests/handle-invalidation.test.ts +2 -3
- package/tests/image/server.test.ts +1 -4
- package/tests/image/sharp.test.ts +1 -1
- package/tests/indexing.test.ts +4 -4
- package/tests/notification-server.test.ts +2 -3
- package/tests/pipeline/backpressure.test.ts +2 -3
- package/tests/pipeline/reingest.test.ts +7 -4
- package/tests/pipeline/repartition.test.ts +2 -3
- package/tests/reprocessing.test.ts +2 -6
- package/tests/seeds/basic.ts +4 -4
- package/tests/seeds/follows.ts +1 -1
- package/tests/seeds/likes.ts +1 -1
- package/tests/seeds/reposts.ts +1 -1
- package/tests/seeds/users-bulk.ts +1 -1
- package/tests/seeds/users.ts +1 -1
- package/tests/server.test.ts +1 -3
- package/tests/subscription/repo.test.ts +2 -4
- package/tests/views/__snapshots__/author-feed.test.ts.snap +24 -24
- package/tests/views/__snapshots__/block-lists.test.ts.snap +42 -7
- package/tests/views/__snapshots__/blocks.test.ts.snap +2 -2
- package/tests/views/__snapshots__/list-feed.test.ts.snap +6 -6
- package/tests/views/__snapshots__/mute-lists.test.ts.snap +15 -4
- package/tests/views/__snapshots__/mutes.test.ts.snap +2 -2
- package/tests/views/__snapshots__/notifications.test.ts.snap +2 -2
- package/tests/views/__snapshots__/posts.test.ts.snap +8 -8
- package/tests/views/__snapshots__/thread.test.ts.snap +10 -10
- package/tests/views/__snapshots__/timeline.test.ts.snap +58 -58
- package/tests/views/actor-likes.test.ts +2 -3
- package/tests/views/actor-search.test.ts +5 -5
- package/tests/views/admin/repo-search.test.ts +2 -4
- package/tests/views/author-feed.test.ts +2 -4
- package/tests/views/block-lists.test.ts +34 -7
- package/tests/views/blocks.test.ts +6 -3
- package/tests/views/follows.test.ts +2 -4
- package/tests/views/likes.test.ts +2 -5
- package/tests/views/list-feed.test.ts +2 -4
- package/tests/views/mute-lists.test.ts +23 -5
- package/tests/views/mutes.test.ts +2 -5
- package/tests/views/notifications.test.ts +2 -4
- package/tests/views/posts.test.ts +2 -5
- package/tests/views/profile.test.ts +4 -5
- package/tests/views/reposts.test.ts +2 -4
- package/tests/views/suggested-follows.test.ts +2 -3
- package/tests/views/suggestions.test.ts +2 -4
- package/tests/views/thread.test.ts +2 -4
- package/tests/views/threadgating.test.ts +2 -3
- package/tests/views/timeline.test.ts +2 -4
- package/LICENSE +0 -21
- package/dist/env.d.ts +0 -1
- package/example.dev.env +0 -5
- package/src/env.ts +0 -9
- package/tests/seeds/client.ts +0 -466
- /package/tests/{__snapshots__ → admin/__snapshots__}/moderation.test.ts.snap +0 -0
- /package/tests/{image/fixtures → sample-img}/at.png +0 -0
- /package/tests/{image/fixtures → sample-img}/hd-key.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-alt.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-landscape-large.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-landscape-small.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-portrait-large.jpg +0 -0
- /package/tests/{image/fixtures → sample-img}/key-portrait-small.jpg +0 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`admin get moderation action view gets moderation action for a record. 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"action": "com.atproto.admin.defs#takedown",
|
|
6
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
7
|
+
"createdBy": "did:example:admin",
|
|
8
|
+
"id": 2,
|
|
9
|
+
"reason": "X",
|
|
10
|
+
"resolvedReports": Array [
|
|
11
|
+
Object {
|
|
12
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
13
|
+
"id": 2,
|
|
14
|
+
"reason": "defamation",
|
|
15
|
+
"reasonType": "com.atproto.moderation.defs#reasonOther",
|
|
16
|
+
"reportedBy": "user(1)",
|
|
17
|
+
"resolvedByActionIds": Array [
|
|
18
|
+
2,
|
|
19
|
+
1,
|
|
20
|
+
],
|
|
21
|
+
"subject": Object {
|
|
22
|
+
"$type": "com.atproto.repo.strongRef",
|
|
23
|
+
"cid": "cids(0)",
|
|
24
|
+
"uri": "record(0)",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
"subject": Object {
|
|
29
|
+
"$type": "com.atproto.admin.defs#recordView",
|
|
30
|
+
"blobCids": Array [],
|
|
31
|
+
"cid": "cids(0)",
|
|
32
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
33
|
+
"moderation": Object {
|
|
34
|
+
"currentAction": Object {
|
|
35
|
+
"action": "com.atproto.admin.defs#takedown",
|
|
36
|
+
"id": 2,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
"repo": Object {
|
|
40
|
+
"did": "user(0)",
|
|
41
|
+
"email": "alice@test.com",
|
|
42
|
+
"handle": "alice.test",
|
|
43
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
44
|
+
"invitesDisabled": false,
|
|
45
|
+
"moderation": Object {},
|
|
46
|
+
"relatedRecords": Array [
|
|
47
|
+
Object {
|
|
48
|
+
"$type": "app.bsky.actor.profile",
|
|
49
|
+
"avatar": Object {
|
|
50
|
+
"$type": "blob",
|
|
51
|
+
"mimeType": "image/jpeg",
|
|
52
|
+
"ref": Object {
|
|
53
|
+
"$link": "cids(1)",
|
|
54
|
+
},
|
|
55
|
+
"size": 3976,
|
|
56
|
+
},
|
|
57
|
+
"description": "its me!",
|
|
58
|
+
"displayName": "ali",
|
|
59
|
+
"labels": Object {
|
|
60
|
+
"$type": "com.atproto.label.defs#selfLabels",
|
|
61
|
+
"values": Array [
|
|
62
|
+
Object {
|
|
63
|
+
"val": "self-label-a",
|
|
64
|
+
},
|
|
65
|
+
Object {
|
|
66
|
+
"val": "self-label-b",
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
"uri": "record(0)",
|
|
74
|
+
"value": Object {
|
|
75
|
+
"$type": "app.bsky.feed.post",
|
|
76
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
77
|
+
"labels": Object {
|
|
78
|
+
"$type": "com.atproto.label.defs#selfLabels",
|
|
79
|
+
"values": Array [
|
|
80
|
+
Object {
|
|
81
|
+
"val": "self-label",
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
"text": "hey there",
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
"subjectBlobs": Array [],
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
|
|
92
|
+
exports[`admin get moderation action view gets moderation action for a repo. 1`] = `
|
|
93
|
+
Object {
|
|
94
|
+
"action": "com.atproto.admin.defs#flag",
|
|
95
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
96
|
+
"createdBy": "did:example:admin",
|
|
97
|
+
"id": 1,
|
|
98
|
+
"reason": "X",
|
|
99
|
+
"resolvedReports": Array [
|
|
100
|
+
Object {
|
|
101
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
102
|
+
"id": 2,
|
|
103
|
+
"reason": "defamation",
|
|
104
|
+
"reasonType": "com.atproto.moderation.defs#reasonOther",
|
|
105
|
+
"reportedBy": "user(1)",
|
|
106
|
+
"resolvedByActionIds": Array [
|
|
107
|
+
2,
|
|
108
|
+
1,
|
|
109
|
+
],
|
|
110
|
+
"subject": Object {
|
|
111
|
+
"$type": "com.atproto.repo.strongRef",
|
|
112
|
+
"cid": "cids(1)",
|
|
113
|
+
"uri": "record(0)",
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
Object {
|
|
117
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
118
|
+
"id": 1,
|
|
119
|
+
"reasonType": "com.atproto.moderation.defs#reasonSpam",
|
|
120
|
+
"reportedBy": "user(2)",
|
|
121
|
+
"resolvedByActionIds": Array [
|
|
122
|
+
1,
|
|
123
|
+
],
|
|
124
|
+
"subject": Object {
|
|
125
|
+
"$type": "com.atproto.admin.defs#repoRef",
|
|
126
|
+
"did": "user(0)",
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
"reversal": Object {
|
|
131
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
132
|
+
"createdBy": "did:example:admin",
|
|
133
|
+
"reason": "X",
|
|
134
|
+
},
|
|
135
|
+
"subject": Object {
|
|
136
|
+
"$type": "com.atproto.admin.defs#repoView",
|
|
137
|
+
"did": "user(0)",
|
|
138
|
+
"email": "alice@test.com",
|
|
139
|
+
"handle": "alice.test",
|
|
140
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
141
|
+
"invitesDisabled": false,
|
|
142
|
+
"moderation": Object {},
|
|
143
|
+
"relatedRecords": Array [
|
|
144
|
+
Object {
|
|
145
|
+
"$type": "app.bsky.actor.profile",
|
|
146
|
+
"avatar": Object {
|
|
147
|
+
"$type": "blob",
|
|
148
|
+
"mimeType": "image/jpeg",
|
|
149
|
+
"ref": Object {
|
|
150
|
+
"$link": "cids(0)",
|
|
151
|
+
},
|
|
152
|
+
"size": 3976,
|
|
153
|
+
},
|
|
154
|
+
"description": "its me!",
|
|
155
|
+
"displayName": "ali",
|
|
156
|
+
"labels": Object {
|
|
157
|
+
"$type": "com.atproto.label.defs#selfLabels",
|
|
158
|
+
"values": Array [
|
|
159
|
+
Object {
|
|
160
|
+
"val": "self-label-a",
|
|
161
|
+
},
|
|
162
|
+
Object {
|
|
163
|
+
"val": "self-label-b",
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
"subjectBlobs": Array [],
|
|
171
|
+
}
|
|
172
|
+
`;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`admin get moderation actions view gets all moderation actions for a record. 1`] = `
|
|
4
|
+
Array [
|
|
5
|
+
Object {
|
|
6
|
+
"action": "com.atproto.admin.defs#flag",
|
|
7
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
8
|
+
"createdBy": "did:example:admin",
|
|
9
|
+
"id": 1,
|
|
10
|
+
"reason": "X",
|
|
11
|
+
"resolvedReportIds": Array [
|
|
12
|
+
1,
|
|
13
|
+
],
|
|
14
|
+
"reversal": Object {
|
|
15
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
16
|
+
"createdBy": "did:example:admin",
|
|
17
|
+
"reason": "X",
|
|
18
|
+
},
|
|
19
|
+
"subject": Object {
|
|
20
|
+
"$type": "com.atproto.repo.strongRef",
|
|
21
|
+
"cid": "cids(0)",
|
|
22
|
+
"uri": "record(0)",
|
|
23
|
+
},
|
|
24
|
+
"subjectBlobCids": Array [],
|
|
25
|
+
},
|
|
26
|
+
]
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
exports[`admin get moderation actions view gets all moderation actions for a repo. 1`] = `
|
|
30
|
+
Array [
|
|
31
|
+
Object {
|
|
32
|
+
"action": "com.atproto.admin.defs#flag",
|
|
33
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
34
|
+
"createdBy": "did:example:admin",
|
|
35
|
+
"id": 5,
|
|
36
|
+
"reason": "X",
|
|
37
|
+
"resolvedReportIds": Array [
|
|
38
|
+
3,
|
|
39
|
+
],
|
|
40
|
+
"subject": Object {
|
|
41
|
+
"$type": "com.atproto.admin.defs#repoRef",
|
|
42
|
+
"did": "user(0)",
|
|
43
|
+
},
|
|
44
|
+
"subjectBlobCids": Array [],
|
|
45
|
+
},
|
|
46
|
+
Object {
|
|
47
|
+
"action": "com.atproto.admin.defs#acknowledge",
|
|
48
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
49
|
+
"createdBy": "did:example:admin",
|
|
50
|
+
"id": 2,
|
|
51
|
+
"reason": "X",
|
|
52
|
+
"resolvedReportIds": Array [],
|
|
53
|
+
"subject": Object {
|
|
54
|
+
"$type": "com.atproto.repo.strongRef",
|
|
55
|
+
"cid": "cids(0)",
|
|
56
|
+
"uri": "record(0)",
|
|
57
|
+
},
|
|
58
|
+
"subjectBlobCids": Array [],
|
|
59
|
+
},
|
|
60
|
+
Object {
|
|
61
|
+
"action": "com.atproto.admin.defs#flag",
|
|
62
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
63
|
+
"createdBy": "did:example:admin",
|
|
64
|
+
"id": 1,
|
|
65
|
+
"reason": "X",
|
|
66
|
+
"resolvedReportIds": Array [
|
|
67
|
+
1,
|
|
68
|
+
],
|
|
69
|
+
"reversal": Object {
|
|
70
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
71
|
+
"createdBy": "did:example:admin",
|
|
72
|
+
"reason": "X",
|
|
73
|
+
},
|
|
74
|
+
"subject": Object {
|
|
75
|
+
"$type": "com.atproto.repo.strongRef",
|
|
76
|
+
"cid": "cids(1)",
|
|
77
|
+
"uri": "record(1)",
|
|
78
|
+
},
|
|
79
|
+
"subjectBlobCids": Array [],
|
|
80
|
+
},
|
|
81
|
+
]
|
|
82
|
+
`;
|
|
83
|
+
|
|
84
|
+
exports[`admin get moderation actions view gets all moderation actions. 1`] = `
|
|
85
|
+
Array [
|
|
86
|
+
Object {
|
|
87
|
+
"action": "com.atproto.admin.defs#acknowledge",
|
|
88
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
89
|
+
"createdBy": "did:example:admin",
|
|
90
|
+
"id": 6,
|
|
91
|
+
"reason": "X",
|
|
92
|
+
"resolvedReportIds": Array [],
|
|
93
|
+
"subject": Object {
|
|
94
|
+
"$type": "com.atproto.admin.defs#repoRef",
|
|
95
|
+
"did": "user(0)",
|
|
96
|
+
},
|
|
97
|
+
"subjectBlobCids": Array [],
|
|
98
|
+
},
|
|
99
|
+
Object {
|
|
100
|
+
"action": "com.atproto.admin.defs#flag",
|
|
101
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
102
|
+
"createdBy": "did:example:admin",
|
|
103
|
+
"id": 5,
|
|
104
|
+
"reason": "X",
|
|
105
|
+
"resolvedReportIds": Array [
|
|
106
|
+
3,
|
|
107
|
+
],
|
|
108
|
+
"subject": Object {
|
|
109
|
+
"$type": "com.atproto.admin.defs#repoRef",
|
|
110
|
+
"did": "user(1)",
|
|
111
|
+
},
|
|
112
|
+
"subjectBlobCids": Array [],
|
|
113
|
+
},
|
|
114
|
+
Object {
|
|
115
|
+
"action": "com.atproto.admin.defs#flag",
|
|
116
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
117
|
+
"createdBy": "did:example:admin",
|
|
118
|
+
"id": 4,
|
|
119
|
+
"reason": "X",
|
|
120
|
+
"resolvedReportIds": Array [],
|
|
121
|
+
"subject": Object {
|
|
122
|
+
"$type": "com.atproto.repo.strongRef",
|
|
123
|
+
"cid": "cids(0)",
|
|
124
|
+
"uri": "record(0)",
|
|
125
|
+
},
|
|
126
|
+
"subjectBlobCids": Array [],
|
|
127
|
+
},
|
|
128
|
+
Object {
|
|
129
|
+
"action": "com.atproto.admin.defs#takedown",
|
|
130
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
131
|
+
"createdBy": "did:example:admin",
|
|
132
|
+
"id": 3,
|
|
133
|
+
"reason": "X",
|
|
134
|
+
"resolvedReportIds": Array [],
|
|
135
|
+
"subject": Object {
|
|
136
|
+
"$type": "com.atproto.repo.strongRef",
|
|
137
|
+
"cid": "cids(1)",
|
|
138
|
+
"uri": "record(1)",
|
|
139
|
+
},
|
|
140
|
+
"subjectBlobCids": Array [],
|
|
141
|
+
},
|
|
142
|
+
Object {
|
|
143
|
+
"action": "com.atproto.admin.defs#acknowledge",
|
|
144
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
145
|
+
"createdBy": "did:example:admin",
|
|
146
|
+
"id": 2,
|
|
147
|
+
"reason": "X",
|
|
148
|
+
"resolvedReportIds": Array [],
|
|
149
|
+
"subject": Object {
|
|
150
|
+
"$type": "com.atproto.repo.strongRef",
|
|
151
|
+
"cid": "cids(2)",
|
|
152
|
+
"uri": "record(2)",
|
|
153
|
+
},
|
|
154
|
+
"subjectBlobCids": Array [],
|
|
155
|
+
},
|
|
156
|
+
Object {
|
|
157
|
+
"action": "com.atproto.admin.defs#flag",
|
|
158
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
159
|
+
"createdBy": "did:example:admin",
|
|
160
|
+
"id": 1,
|
|
161
|
+
"reason": "X",
|
|
162
|
+
"resolvedReportIds": Array [
|
|
163
|
+
1,
|
|
164
|
+
],
|
|
165
|
+
"reversal": Object {
|
|
166
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
167
|
+
"createdBy": "did:example:admin",
|
|
168
|
+
"reason": "X",
|
|
169
|
+
},
|
|
170
|
+
"subject": Object {
|
|
171
|
+
"$type": "com.atproto.repo.strongRef",
|
|
172
|
+
"cid": "cids(3)",
|
|
173
|
+
"uri": "record(3)",
|
|
174
|
+
},
|
|
175
|
+
"subjectBlobCids": Array [],
|
|
176
|
+
},
|
|
177
|
+
]
|
|
178
|
+
`;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`admin get moderation action view gets moderation report for a record. 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
6
|
+
"id": 2,
|
|
7
|
+
"reason": "defamation",
|
|
8
|
+
"reasonType": "com.atproto.moderation.defs#reasonOther",
|
|
9
|
+
"reportedBy": "user(0)",
|
|
10
|
+
"resolvedByActions": Array [
|
|
11
|
+
Object {
|
|
12
|
+
"action": "com.atproto.admin.defs#takedown",
|
|
13
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
14
|
+
"createdBy": "did:example:admin",
|
|
15
|
+
"id": 2,
|
|
16
|
+
"reason": "X",
|
|
17
|
+
"resolvedReportIds": Array [
|
|
18
|
+
2,
|
|
19
|
+
],
|
|
20
|
+
"subject": Object {
|
|
21
|
+
"$type": "com.atproto.repo.strongRef",
|
|
22
|
+
"cid": "cids(0)",
|
|
23
|
+
"uri": "record(0)",
|
|
24
|
+
},
|
|
25
|
+
"subjectBlobCids": Array [],
|
|
26
|
+
},
|
|
27
|
+
Object {
|
|
28
|
+
"action": "com.atproto.admin.defs#flag",
|
|
29
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
30
|
+
"createdBy": "did:example:admin",
|
|
31
|
+
"id": 1,
|
|
32
|
+
"reason": "X",
|
|
33
|
+
"resolvedReportIds": Array [
|
|
34
|
+
2,
|
|
35
|
+
1,
|
|
36
|
+
],
|
|
37
|
+
"reversal": Object {
|
|
38
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
39
|
+
"createdBy": "did:example:admin",
|
|
40
|
+
"reason": "X",
|
|
41
|
+
},
|
|
42
|
+
"subject": Object {
|
|
43
|
+
"$type": "com.atproto.admin.defs#repoRef",
|
|
44
|
+
"did": "user(1)",
|
|
45
|
+
},
|
|
46
|
+
"subjectBlobCids": Array [],
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
"subject": Object {
|
|
50
|
+
"$type": "com.atproto.admin.defs#recordView",
|
|
51
|
+
"blobCids": Array [],
|
|
52
|
+
"cid": "cids(0)",
|
|
53
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
54
|
+
"moderation": Object {
|
|
55
|
+
"currentAction": Object {
|
|
56
|
+
"action": "com.atproto.admin.defs#takedown",
|
|
57
|
+
"id": 2,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
"repo": Object {
|
|
61
|
+
"did": "user(1)",
|
|
62
|
+
"email": "alice@test.com",
|
|
63
|
+
"handle": "alice.test",
|
|
64
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
65
|
+
"invitesDisabled": false,
|
|
66
|
+
"moderation": Object {},
|
|
67
|
+
"relatedRecords": Array [
|
|
68
|
+
Object {
|
|
69
|
+
"$type": "app.bsky.actor.profile",
|
|
70
|
+
"avatar": Object {
|
|
71
|
+
"$type": "blob",
|
|
72
|
+
"mimeType": "image/jpeg",
|
|
73
|
+
"ref": Object {
|
|
74
|
+
"$link": "cids(1)",
|
|
75
|
+
},
|
|
76
|
+
"size": 3976,
|
|
77
|
+
},
|
|
78
|
+
"description": "its me!",
|
|
79
|
+
"displayName": "ali",
|
|
80
|
+
"labels": Object {
|
|
81
|
+
"$type": "com.atproto.label.defs#selfLabels",
|
|
82
|
+
"values": Array [
|
|
83
|
+
Object {
|
|
84
|
+
"val": "self-label-a",
|
|
85
|
+
},
|
|
86
|
+
Object {
|
|
87
|
+
"val": "self-label-b",
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
"uri": "record(0)",
|
|
95
|
+
"value": Object {
|
|
96
|
+
"$type": "app.bsky.feed.post",
|
|
97
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
98
|
+
"labels": Object {
|
|
99
|
+
"$type": "com.atproto.label.defs#selfLabels",
|
|
100
|
+
"values": Array [
|
|
101
|
+
Object {
|
|
102
|
+
"val": "self-label",
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
"text": "hey there",
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
|
|
112
|
+
exports[`admin get moderation action view gets moderation report for a repo. 1`] = `
|
|
113
|
+
Object {
|
|
114
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
115
|
+
"id": 1,
|
|
116
|
+
"reasonType": "com.atproto.moderation.defs#reasonSpam",
|
|
117
|
+
"reportedBy": "user(0)",
|
|
118
|
+
"resolvedByActions": Array [
|
|
119
|
+
Object {
|
|
120
|
+
"action": "com.atproto.admin.defs#flag",
|
|
121
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
122
|
+
"createdBy": "did:example:admin",
|
|
123
|
+
"id": 1,
|
|
124
|
+
"reason": "X",
|
|
125
|
+
"resolvedReportIds": Array [
|
|
126
|
+
2,
|
|
127
|
+
1,
|
|
128
|
+
],
|
|
129
|
+
"reversal": Object {
|
|
130
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
131
|
+
"createdBy": "did:example:admin",
|
|
132
|
+
"reason": "X",
|
|
133
|
+
},
|
|
134
|
+
"subject": Object {
|
|
135
|
+
"$type": "com.atproto.admin.defs#repoRef",
|
|
136
|
+
"did": "user(1)",
|
|
137
|
+
},
|
|
138
|
+
"subjectBlobCids": Array [],
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
"subject": Object {
|
|
142
|
+
"$type": "com.atproto.admin.defs#repoView",
|
|
143
|
+
"did": "user(1)",
|
|
144
|
+
"email": "alice@test.com",
|
|
145
|
+
"handle": "alice.test",
|
|
146
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
147
|
+
"invitesDisabled": false,
|
|
148
|
+
"moderation": Object {},
|
|
149
|
+
"relatedRecords": Array [
|
|
150
|
+
Object {
|
|
151
|
+
"$type": "app.bsky.actor.profile",
|
|
152
|
+
"avatar": Object {
|
|
153
|
+
"$type": "blob",
|
|
154
|
+
"mimeType": "image/jpeg",
|
|
155
|
+
"ref": Object {
|
|
156
|
+
"$link": "cids(0)",
|
|
157
|
+
},
|
|
158
|
+
"size": 3976,
|
|
159
|
+
},
|
|
160
|
+
"description": "its me!",
|
|
161
|
+
"displayName": "ali",
|
|
162
|
+
"labels": Object {
|
|
163
|
+
"$type": "com.atproto.label.defs#selfLabels",
|
|
164
|
+
"values": Array [
|
|
165
|
+
Object {
|
|
166
|
+
"val": "self-label-a",
|
|
167
|
+
},
|
|
168
|
+
Object {
|
|
169
|
+
"val": "self-label-b",
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
}
|
|
177
|
+
`;
|