@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.
Files changed (158) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/LICENSE.txt +7 -0
  3. package/README.md +6 -1
  4. package/dist/api/com/atproto/admin/util.d.ts +5 -0
  5. package/dist/context.d.ts +6 -1
  6. package/dist/db/index.js +51 -2
  7. package/dist/db/index.js.map +3 -3
  8. package/dist/db/migrations/20230929T192920807Z-record-cursor-indexes.d.ts +3 -0
  9. package/dist/db/migrations/index.d.ts +1 -0
  10. package/dist/did-cache.d.ts +2 -2
  11. package/dist/index.d.ts +2 -0
  12. package/dist/index.js +1630 -755
  13. package/dist/index.js.map +3 -3
  14. package/dist/lexicon/index.d.ts +8 -0
  15. package/dist/lexicon/lexicons.d.ts +243 -3
  16. package/dist/lexicon/types/app/bsky/actor/defs.d.ts +1 -0
  17. package/dist/lexicon/types/com/atproto/admin/defs.d.ts +28 -0
  18. package/dist/lexicon/types/com/atproto/admin/getAccountInfo.d.ts +29 -0
  19. package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts +39 -0
  20. package/dist/lexicon/types/com/atproto/admin/searchRepos.d.ts +0 -1
  21. package/dist/lexicon/types/com/atproto/admin/updateSubjectStatus.d.ts +46 -0
  22. package/dist/lexicon/types/com/atproto/server/createAccount.d.ts +4 -2
  23. package/dist/lexicon/types/com/atproto/server/createSession.d.ts +1 -0
  24. package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +1 -0
  25. package/dist/lexicon/types/com/atproto/server/reserveSigningKey.d.ts +36 -0
  26. package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts +1 -0
  27. package/dist/services/actor/types.d.ts +1 -0
  28. package/dist/services/graph/index.d.ts +2 -0
  29. package/dist/services/moderation/index.d.ts +13 -3
  30. package/package.json +14 -15
  31. package/src/api/app/bsky/feed/getAuthorFeed.ts +2 -2
  32. package/src/api/app/bsky/feed/getPostThread.ts +2 -2
  33. package/src/api/app/bsky/notification/listNotifications.ts +33 -22
  34. package/src/api/com/atproto/admin/getModerationAction.ts +28 -2
  35. package/src/api/com/atproto/admin/getModerationReport.ts +27 -2
  36. package/src/api/com/atproto/admin/getRecord.ts +14 -2
  37. package/src/api/com/atproto/admin/getRepo.ts +13 -2
  38. package/src/api/com/atproto/admin/reverseModerationAction.ts +31 -5
  39. package/src/api/com/atproto/admin/searchRepos.ts +2 -5
  40. package/src/api/com/atproto/admin/takeModerationAction.ts +41 -7
  41. package/src/api/com/atproto/admin/util.ts +50 -0
  42. package/src/api/well-known.ts +8 -0
  43. package/src/auth.ts +12 -5
  44. package/src/auto-moderator/index.ts +1 -0
  45. package/src/context.ts +25 -1
  46. package/src/db/migrations/20230929T192920807Z-record-cursor-indexes.ts +40 -0
  47. package/src/db/migrations/index.ts +1 -0
  48. package/src/did-cache.ts +29 -14
  49. package/src/feed-gen/with-friends.ts +2 -2
  50. package/src/index.ts +4 -1
  51. package/src/indexer/subscription.ts +1 -21
  52. package/src/lexicon/index.ts +48 -0
  53. package/src/lexicon/lexicons.ts +259 -5
  54. package/src/lexicon/types/app/bsky/actor/defs.ts +1 -0
  55. package/src/lexicon/types/com/atproto/admin/defs.ts +61 -0
  56. package/src/lexicon/types/com/atproto/admin/getAccountInfo.ts +41 -0
  57. package/src/lexicon/types/com/atproto/admin/getSubjectStatus.ts +54 -0
  58. package/src/lexicon/types/com/atproto/admin/searchRepos.ts +0 -1
  59. package/src/lexicon/types/com/atproto/admin/updateSubjectStatus.ts +61 -0
  60. package/src/lexicon/types/com/atproto/server/createAccount.ts +4 -2
  61. package/src/lexicon/types/com/atproto/server/createSession.ts +1 -0
  62. package/src/lexicon/types/com/atproto/server/refreshSession.ts +1 -0
  63. package/src/lexicon/types/com/atproto/server/reserveSigningKey.ts +51 -0
  64. package/src/lexicon/types/com/atproto/sync/listRepos.ts +1 -0
  65. package/src/logger.ts +8 -0
  66. package/src/services/actor/index.ts +7 -1
  67. package/src/services/actor/types.ts +1 -0
  68. package/src/services/actor/views.ts +26 -8
  69. package/src/services/graph/index.ts +26 -7
  70. package/src/services/indexing/index.ts +15 -17
  71. package/src/services/moderation/index.ts +94 -14
  72. package/src/services/moderation/views.ts +1 -0
  73. package/tests/__snapshots__/feed-generation.test.ts.snap +12 -12
  74. package/tests/__snapshots__/indexing.test.ts.snap +4 -4
  75. package/tests/admin/__snapshots__/get-moderation-action.test.ts.snap +172 -0
  76. package/tests/admin/__snapshots__/get-moderation-actions.test.ts.snap +178 -0
  77. package/tests/admin/__snapshots__/get-moderation-report.test.ts.snap +177 -0
  78. package/tests/admin/__snapshots__/get-moderation-reports.test.ts.snap +307 -0
  79. package/tests/admin/__snapshots__/get-record.test.ts.snap +275 -0
  80. package/tests/admin/__snapshots__/get-repo.test.ts.snap +103 -0
  81. package/tests/admin/get-moderation-action.test.ts +100 -0
  82. package/tests/admin/get-moderation-actions.test.ts +164 -0
  83. package/tests/admin/get-moderation-report.test.ts +100 -0
  84. package/tests/admin/get-moderation-reports.test.ts +332 -0
  85. package/tests/admin/get-record.test.ts +115 -0
  86. package/tests/admin/get-repo.test.ts +101 -0
  87. package/tests/{moderation.test.ts → admin/moderation.test.ts} +107 -9
  88. package/tests/admin/repo-search.test.ts +124 -0
  89. package/tests/algos/hot-classic.test.ts +3 -5
  90. package/tests/algos/whats-hot.test.ts +3 -5
  91. package/tests/algos/with-friends.test.ts +2 -4
  92. package/tests/auth.test.ts +64 -0
  93. package/tests/auto-moderator/fuzzy-matcher.test.ts +2 -3
  94. package/tests/auto-moderator/labeler.test.ts +5 -7
  95. package/tests/auto-moderator/takedowns.test.ts +11 -12
  96. package/tests/blob-resolver.test.ts +1 -3
  97. package/tests/did-cache.test.ts +2 -5
  98. package/tests/feed-generation.test.ts +8 -6
  99. package/tests/handle-invalidation.test.ts +2 -3
  100. package/tests/image/server.test.ts +1 -4
  101. package/tests/image/sharp.test.ts +1 -1
  102. package/tests/indexing.test.ts +4 -4
  103. package/tests/notification-server.test.ts +2 -3
  104. package/tests/pipeline/backpressure.test.ts +2 -3
  105. package/tests/pipeline/reingest.test.ts +7 -4
  106. package/tests/pipeline/repartition.test.ts +2 -3
  107. package/tests/reprocessing.test.ts +2 -6
  108. package/tests/seeds/basic.ts +4 -4
  109. package/tests/seeds/follows.ts +1 -1
  110. package/tests/seeds/likes.ts +1 -1
  111. package/tests/seeds/reposts.ts +1 -1
  112. package/tests/seeds/users-bulk.ts +1 -1
  113. package/tests/seeds/users.ts +1 -1
  114. package/tests/server.test.ts +1 -3
  115. package/tests/subscription/repo.test.ts +2 -4
  116. package/tests/views/__snapshots__/author-feed.test.ts.snap +24 -24
  117. package/tests/views/__snapshots__/block-lists.test.ts.snap +42 -7
  118. package/tests/views/__snapshots__/blocks.test.ts.snap +2 -2
  119. package/tests/views/__snapshots__/list-feed.test.ts.snap +6 -6
  120. package/tests/views/__snapshots__/mute-lists.test.ts.snap +15 -4
  121. package/tests/views/__snapshots__/mutes.test.ts.snap +2 -2
  122. package/tests/views/__snapshots__/notifications.test.ts.snap +2 -2
  123. package/tests/views/__snapshots__/posts.test.ts.snap +8 -8
  124. package/tests/views/__snapshots__/thread.test.ts.snap +10 -10
  125. package/tests/views/__snapshots__/timeline.test.ts.snap +58 -58
  126. package/tests/views/actor-likes.test.ts +2 -3
  127. package/tests/views/actor-search.test.ts +5 -5
  128. package/tests/views/admin/repo-search.test.ts +2 -4
  129. package/tests/views/author-feed.test.ts +2 -4
  130. package/tests/views/block-lists.test.ts +34 -7
  131. package/tests/views/blocks.test.ts +6 -3
  132. package/tests/views/follows.test.ts +2 -4
  133. package/tests/views/likes.test.ts +2 -5
  134. package/tests/views/list-feed.test.ts +2 -4
  135. package/tests/views/mute-lists.test.ts +23 -5
  136. package/tests/views/mutes.test.ts +2 -5
  137. package/tests/views/notifications.test.ts +2 -4
  138. package/tests/views/posts.test.ts +2 -5
  139. package/tests/views/profile.test.ts +4 -5
  140. package/tests/views/reposts.test.ts +2 -4
  141. package/tests/views/suggested-follows.test.ts +2 -3
  142. package/tests/views/suggestions.test.ts +2 -4
  143. package/tests/views/thread.test.ts +2 -4
  144. package/tests/views/threadgating.test.ts +2 -3
  145. package/tests/views/timeline.test.ts +2 -4
  146. package/LICENSE +0 -21
  147. package/dist/env.d.ts +0 -1
  148. package/example.dev.env +0 -5
  149. package/src/env.ts +0 -9
  150. package/tests/seeds/client.ts +0 -466
  151. /package/tests/{__snapshots__ → admin/__snapshots__}/moderation.test.ts.snap +0 -0
  152. /package/tests/{image/fixtures → sample-img}/at.png +0 -0
  153. /package/tests/{image/fixtures → sample-img}/hd-key.jpg +0 -0
  154. /package/tests/{image/fixtures → sample-img}/key-alt.jpg +0 -0
  155. /package/tests/{image/fixtures → sample-img}/key-landscape-large.jpg +0 -0
  156. /package/tests/{image/fixtures → sample-img}/key-landscape-small.jpg +0 -0
  157. /package/tests/{image/fixtures → sample-img}/key-portrait-large.jpg +0 -0
  158. /package/tests/{image/fixtures → sample-img}/key-portrait-small.jpg +0 -0
@@ -0,0 +1,307 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`admin get moderation reports view gets all moderation reports actioned by a certain moderator. 1`] = `
4
+ Array [
5
+ Object {
6
+ "createdAt": "1970-01-01T00:00:00.000Z",
7
+ "id": 1,
8
+ "reasonType": "com.atproto.moderation.defs#reasonOther",
9
+ "reportedBy": "user(0)",
10
+ "resolvedByActionIds": Array [
11
+ 1,
12
+ ],
13
+ "subject": Object {
14
+ "$type": "com.atproto.repo.strongRef",
15
+ "cid": "cids(0)",
16
+ "uri": "record(0)",
17
+ },
18
+ "subjectRepoHandle": "alice.test",
19
+ },
20
+ ]
21
+ `;
22
+
23
+ exports[`admin get moderation reports view gets all moderation reports actioned by a certain moderator. 2`] = `
24
+ Array [
25
+ Object {
26
+ "createdAt": "1970-01-01T00:00:00.000Z",
27
+ "id": 3,
28
+ "reasonType": "com.atproto.moderation.defs#reasonOther",
29
+ "reportedBy": "user(0)",
30
+ "resolvedByActionIds": Array [
31
+ 3,
32
+ ],
33
+ "subject": Object {
34
+ "$type": "com.atproto.repo.strongRef",
35
+ "cid": "cids(0)",
36
+ "uri": "record(0)",
37
+ },
38
+ "subjectRepoHandle": "bob.test",
39
+ },
40
+ ]
41
+ `;
42
+
43
+ exports[`admin get moderation reports view gets all moderation reports by active resolution action type. 1`] = `
44
+ Array [
45
+ Object {
46
+ "createdAt": "1970-01-01T00:00:00.000Z",
47
+ "id": 3,
48
+ "reasonType": "com.atproto.moderation.defs#reasonOther",
49
+ "reportedBy": "user(0)",
50
+ "resolvedByActionIds": Array [
51
+ 3,
52
+ ],
53
+ "subject": Object {
54
+ "$type": "com.atproto.repo.strongRef",
55
+ "cid": "cids(0)",
56
+ "uri": "record(0)",
57
+ },
58
+ "subjectRepoHandle": "bob.test",
59
+ },
60
+ ]
61
+ `;
62
+
63
+ exports[`admin get moderation reports view gets all moderation reports for a record. 1`] = `
64
+ Array [
65
+ Object {
66
+ "createdAt": "1970-01-01T00:00:00.000Z",
67
+ "id": 1,
68
+ "reasonType": "com.atproto.moderation.defs#reasonOther",
69
+ "reportedBy": "user(0)",
70
+ "resolvedByActionIds": Array [
71
+ 1,
72
+ ],
73
+ "subject": Object {
74
+ "$type": "com.atproto.repo.strongRef",
75
+ "cid": "cids(0)",
76
+ "uri": "record(0)",
77
+ },
78
+ "subjectRepoHandle": "alice.test",
79
+ },
80
+ ]
81
+ `;
82
+
83
+ exports[`admin get moderation reports view gets all moderation reports for a repo. 1`] = `
84
+ Array [
85
+ Object {
86
+ "createdAt": "1970-01-01T00:00:00.000Z",
87
+ "id": 5,
88
+ "reasonType": "com.atproto.moderation.defs#reasonOther",
89
+ "reportedBy": "user(0)",
90
+ "resolvedByActionIds": Array [
91
+ 5,
92
+ ],
93
+ "subject": Object {
94
+ "$type": "com.atproto.admin.defs#repoRef",
95
+ "did": "user(0)",
96
+ },
97
+ "subjectRepoHandle": "alice.test",
98
+ },
99
+ Object {
100
+ "createdAt": "1970-01-01T00:00:00.000Z",
101
+ "id": 2,
102
+ "reasonType": "com.atproto.moderation.defs#reasonSpam",
103
+ "reportedBy": "user(1)",
104
+ "resolvedByActionIds": Array [],
105
+ "subject": Object {
106
+ "$type": "com.atproto.repo.strongRef",
107
+ "cid": "cids(0)",
108
+ "uri": "record(0)",
109
+ },
110
+ "subjectRepoHandle": "alice.test",
111
+ },
112
+ Object {
113
+ "createdAt": "1970-01-01T00:00:00.000Z",
114
+ "id": 1,
115
+ "reasonType": "com.atproto.moderation.defs#reasonOther",
116
+ "reportedBy": "user(0)",
117
+ "resolvedByActionIds": Array [
118
+ 1,
119
+ ],
120
+ "subject": Object {
121
+ "$type": "com.atproto.repo.strongRef",
122
+ "cid": "cids(1)",
123
+ "uri": "record(1)",
124
+ },
125
+ "subjectRepoHandle": "alice.test",
126
+ },
127
+ ]
128
+ `;
129
+
130
+ exports[`admin get moderation reports view gets all moderation reports. 1`] = `
131
+ Array [
132
+ Object {
133
+ "createdAt": "1970-01-01T00:00:00.000Z",
134
+ "id": 6,
135
+ "reasonType": "com.atproto.moderation.defs#reasonSpam",
136
+ "reportedBy": "user(0)",
137
+ "resolvedByActionIds": Array [],
138
+ "subject": Object {
139
+ "$type": "com.atproto.admin.defs#repoRef",
140
+ "did": "user(0)",
141
+ },
142
+ "subjectRepoHandle": "carol.test",
143
+ },
144
+ Object {
145
+ "createdAt": "1970-01-01T00:00:00.000Z",
146
+ "id": 5,
147
+ "reasonType": "com.atproto.moderation.defs#reasonOther",
148
+ "reportedBy": "user(1)",
149
+ "resolvedByActionIds": Array [
150
+ 5,
151
+ ],
152
+ "subject": Object {
153
+ "$type": "com.atproto.admin.defs#repoRef",
154
+ "did": "user(1)",
155
+ },
156
+ "subjectRepoHandle": "alice.test",
157
+ },
158
+ Object {
159
+ "createdAt": "1970-01-01T00:00:00.000Z",
160
+ "id": 4,
161
+ "reasonType": "com.atproto.moderation.defs#reasonSpam",
162
+ "reportedBy": "user(0)",
163
+ "resolvedByActionIds": Array [],
164
+ "subject": Object {
165
+ "$type": "com.atproto.repo.strongRef",
166
+ "cid": "cids(0)",
167
+ "uri": "record(0)",
168
+ },
169
+ "subjectRepoHandle": "dan.test",
170
+ },
171
+ Object {
172
+ "createdAt": "1970-01-01T00:00:00.000Z",
173
+ "id": 3,
174
+ "reasonType": "com.atproto.moderation.defs#reasonOther",
175
+ "reportedBy": "user(1)",
176
+ "resolvedByActionIds": Array [
177
+ 3,
178
+ ],
179
+ "subject": Object {
180
+ "$type": "com.atproto.repo.strongRef",
181
+ "cid": "cids(1)",
182
+ "uri": "record(1)",
183
+ },
184
+ "subjectRepoHandle": "bob.test",
185
+ },
186
+ Object {
187
+ "createdAt": "1970-01-01T00:00:00.000Z",
188
+ "id": 2,
189
+ "reasonType": "com.atproto.moderation.defs#reasonSpam",
190
+ "reportedBy": "user(0)",
191
+ "resolvedByActionIds": Array [],
192
+ "subject": Object {
193
+ "$type": "com.atproto.repo.strongRef",
194
+ "cid": "cids(2)",
195
+ "uri": "record(2)",
196
+ },
197
+ "subjectRepoHandle": "alice.test",
198
+ },
199
+ Object {
200
+ "createdAt": "1970-01-01T00:00:00.000Z",
201
+ "id": 1,
202
+ "reasonType": "com.atproto.moderation.defs#reasonOther",
203
+ "reportedBy": "user(1)",
204
+ "resolvedByActionIds": Array [
205
+ 1,
206
+ ],
207
+ "subject": Object {
208
+ "$type": "com.atproto.repo.strongRef",
209
+ "cid": "cids(3)",
210
+ "uri": "record(3)",
211
+ },
212
+ "subjectRepoHandle": "alice.test",
213
+ },
214
+ ]
215
+ `;
216
+
217
+ exports[`admin get moderation reports view gets all resolved/unresolved moderation reports. 1`] = `
218
+ Array [
219
+ Object {
220
+ "createdAt": "1970-01-01T00:00:00.000Z",
221
+ "id": 5,
222
+ "reasonType": "com.atproto.moderation.defs#reasonOther",
223
+ "reportedBy": "user(0)",
224
+ "resolvedByActionIds": Array [
225
+ 5,
226
+ ],
227
+ "subject": Object {
228
+ "$type": "com.atproto.admin.defs#repoRef",
229
+ "did": "user(0)",
230
+ },
231
+ "subjectRepoHandle": "alice.test",
232
+ },
233
+ Object {
234
+ "createdAt": "1970-01-01T00:00:00.000Z",
235
+ "id": 3,
236
+ "reasonType": "com.atproto.moderation.defs#reasonOther",
237
+ "reportedBy": "user(0)",
238
+ "resolvedByActionIds": Array [
239
+ 3,
240
+ ],
241
+ "subject": Object {
242
+ "$type": "com.atproto.repo.strongRef",
243
+ "cid": "cids(0)",
244
+ "uri": "record(0)",
245
+ },
246
+ "subjectRepoHandle": "bob.test",
247
+ },
248
+ Object {
249
+ "createdAt": "1970-01-01T00:00:00.000Z",
250
+ "id": 1,
251
+ "reasonType": "com.atproto.moderation.defs#reasonOther",
252
+ "reportedBy": "user(0)",
253
+ "resolvedByActionIds": Array [
254
+ 1,
255
+ ],
256
+ "subject": Object {
257
+ "$type": "com.atproto.repo.strongRef",
258
+ "cid": "cids(1)",
259
+ "uri": "record(1)",
260
+ },
261
+ "subjectRepoHandle": "alice.test",
262
+ },
263
+ ]
264
+ `;
265
+
266
+ exports[`admin get moderation reports view gets all resolved/unresolved moderation reports. 2`] = `
267
+ Array [
268
+ Object {
269
+ "createdAt": "1970-01-01T00:00:00.000Z",
270
+ "id": 6,
271
+ "reasonType": "com.atproto.moderation.defs#reasonSpam",
272
+ "reportedBy": "user(0)",
273
+ "resolvedByActionIds": Array [],
274
+ "subject": Object {
275
+ "$type": "com.atproto.admin.defs#repoRef",
276
+ "did": "user(0)",
277
+ },
278
+ "subjectRepoHandle": "carol.test",
279
+ },
280
+ Object {
281
+ "createdAt": "1970-01-01T00:00:00.000Z",
282
+ "id": 4,
283
+ "reasonType": "com.atproto.moderation.defs#reasonSpam",
284
+ "reportedBy": "user(0)",
285
+ "resolvedByActionIds": Array [],
286
+ "subject": Object {
287
+ "$type": "com.atproto.repo.strongRef",
288
+ "cid": "cids(0)",
289
+ "uri": "record(0)",
290
+ },
291
+ "subjectRepoHandle": "dan.test",
292
+ },
293
+ Object {
294
+ "createdAt": "1970-01-01T00:00:00.000Z",
295
+ "id": 2,
296
+ "reasonType": "com.atproto.moderation.defs#reasonSpam",
297
+ "reportedBy": "user(0)",
298
+ "resolvedByActionIds": Array [],
299
+ "subject": Object {
300
+ "$type": "com.atproto.repo.strongRef",
301
+ "cid": "cids(1)",
302
+ "uri": "record(1)",
303
+ },
304
+ "subjectRepoHandle": "alice.test",
305
+ },
306
+ ]
307
+ `;
@@ -0,0 +1,275 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`admin get record view gets a record by uri and cid. 1`] = `
4
+ Object {
5
+ "blobCids": Array [],
6
+ "blobs": Array [],
7
+ "cid": "cids(0)",
8
+ "indexedAt": "1970-01-01T00:00:00.000Z",
9
+ "labels": Array [
10
+ Object {
11
+ "cid": "cids(0)",
12
+ "cts": "1970-01-01T00:00:00.000Z",
13
+ "neg": false,
14
+ "src": "user(0)",
15
+ "uri": "record(0)",
16
+ "val": "self-label",
17
+ },
18
+ ],
19
+ "moderation": Object {
20
+ "actions": Array [
21
+ Object {
22
+ "action": "com.atproto.admin.defs#takedown",
23
+ "createdAt": "1970-01-01T00:00:00.000Z",
24
+ "createdBy": "did:example:admin",
25
+ "id": 2,
26
+ "reason": "X",
27
+ "resolvedReportIds": Array [],
28
+ "subject": Object {
29
+ "$type": "com.atproto.repo.strongRef",
30
+ "cid": "cids(0)",
31
+ "uri": "record(0)",
32
+ },
33
+ "subjectBlobCids": Array [],
34
+ },
35
+ Object {
36
+ "action": "com.atproto.admin.defs#acknowledge",
37
+ "createdAt": "1970-01-01T00:00:00.000Z",
38
+ "createdBy": "did:example:admin",
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,
58
+ },
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
+ },
89
+ "repo": Object {
90
+ "did": "user(0)",
91
+ "email": "alice@test.com",
92
+ "handle": "alice.test",
93
+ "indexedAt": "1970-01-01T00:00:00.000Z",
94
+ "invitesDisabled": false,
95
+ "moderation": Object {},
96
+ "relatedRecords": Array [
97
+ Object {
98
+ "$type": "app.bsky.actor.profile",
99
+ "avatar": Object {
100
+ "$type": "blob",
101
+ "mimeType": "image/jpeg",
102
+ "ref": Object {
103
+ "$link": "cids(1)",
104
+ },
105
+ "size": 3976,
106
+ },
107
+ "description": "its me!",
108
+ "displayName": "ali",
109
+ "labels": Object {
110
+ "$type": "com.atproto.label.defs#selfLabels",
111
+ "values": Array [
112
+ Object {
113
+ "val": "self-label-a",
114
+ },
115
+ Object {
116
+ "val": "self-label-b",
117
+ },
118
+ ],
119
+ },
120
+ },
121
+ ],
122
+ },
123
+ "uri": "record(0)",
124
+ "value": Object {
125
+ "$type": "app.bsky.feed.post",
126
+ "createdAt": "1970-01-01T00:00:00.000Z",
127
+ "labels": Object {
128
+ "$type": "com.atproto.label.defs#selfLabels",
129
+ "values": Array [
130
+ Object {
131
+ "val": "self-label",
132
+ },
133
+ ],
134
+ },
135
+ "text": "hey there",
136
+ },
137
+ }
138
+ `;
139
+
140
+ exports[`admin get record view gets a record by uri, even when taken down. 1`] = `
141
+ Object {
142
+ "blobCids": Array [],
143
+ "blobs": Array [],
144
+ "cid": "cids(0)",
145
+ "indexedAt": "1970-01-01T00:00:00.000Z",
146
+ "labels": Array [
147
+ Object {
148
+ "cid": "cids(0)",
149
+ "cts": "1970-01-01T00:00:00.000Z",
150
+ "neg": false,
151
+ "src": "user(0)",
152
+ "uri": "record(0)",
153
+ "val": "self-label",
154
+ },
155
+ ],
156
+ "moderation": Object {
157
+ "actions": Array [
158
+ Object {
159
+ "action": "com.atproto.admin.defs#takedown",
160
+ "createdAt": "1970-01-01T00:00:00.000Z",
161
+ "createdBy": "did:example:admin",
162
+ "id": 2,
163
+ "reason": "X",
164
+ "resolvedReportIds": Array [],
165
+ "subject": Object {
166
+ "$type": "com.atproto.repo.strongRef",
167
+ "cid": "cids(0)",
168
+ "uri": "record(0)",
169
+ },
170
+ "subjectBlobCids": Array [],
171
+ },
172
+ Object {
173
+ "action": "com.atproto.admin.defs#acknowledge",
174
+ "createdAt": "1970-01-01T00:00:00.000Z",
175
+ "createdBy": "did:example:admin",
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,
195
+ },
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
+ },
226
+ "repo": Object {
227
+ "did": "user(0)",
228
+ "email": "alice@test.com",
229
+ "handle": "alice.test",
230
+ "indexedAt": "1970-01-01T00:00:00.000Z",
231
+ "invitesDisabled": false,
232
+ "moderation": Object {},
233
+ "relatedRecords": Array [
234
+ Object {
235
+ "$type": "app.bsky.actor.profile",
236
+ "avatar": Object {
237
+ "$type": "blob",
238
+ "mimeType": "image/jpeg",
239
+ "ref": Object {
240
+ "$link": "cids(1)",
241
+ },
242
+ "size": 3976,
243
+ },
244
+ "description": "its me!",
245
+ "displayName": "ali",
246
+ "labels": Object {
247
+ "$type": "com.atproto.label.defs#selfLabels",
248
+ "values": Array [
249
+ Object {
250
+ "val": "self-label-a",
251
+ },
252
+ Object {
253
+ "val": "self-label-b",
254
+ },
255
+ ],
256
+ },
257
+ },
258
+ ],
259
+ },
260
+ "uri": "record(0)",
261
+ "value": Object {
262
+ "$type": "app.bsky.feed.post",
263
+ "createdAt": "1970-01-01T00:00:00.000Z",
264
+ "labels": Object {
265
+ "$type": "com.atproto.label.defs#selfLabels",
266
+ "values": Array [
267
+ Object {
268
+ "val": "self-label",
269
+ },
270
+ ],
271
+ },
272
+ "text": "hey there",
273
+ },
274
+ }
275
+ `;
@@ -0,0 +1,103 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`admin get repo view gets a repo by did, even when taken down. 1`] = `
4
+ Object {
5
+ "did": "user(0)",
6
+ "email": "alice@test.com",
7
+ "handle": "alice.test",
8
+ "indexedAt": "1970-01-01T00:00:00.000Z",
9
+ "invites": Array [],
10
+ "invitesDisabled": false,
11
+ "labels": Array [],
12
+ "moderation": Object {
13
+ "actions": Array [
14
+ Object {
15
+ "action": "com.atproto.admin.defs#takedown",
16
+ "createdAt": "1970-01-01T00:00:00.000Z",
17
+ "createdBy": "did:example:admin",
18
+ "id": 2,
19
+ "reason": "X",
20
+ "resolvedReportIds": Array [],
21
+ "subject": Object {
22
+ "$type": "com.atproto.admin.defs#repoRef",
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 [],
44
+ },
45
+ ],
46
+ "currentAction": Object {
47
+ "action": "com.atproto.admin.defs#takedown",
48
+ "id": 2,
49
+ },
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
+ },
76
+ "relatedRecords": Array [
77
+ Object {
78
+ "$type": "app.bsky.actor.profile",
79
+ "avatar": Object {
80
+ "$type": "blob",
81
+ "mimeType": "image/jpeg",
82
+ "ref": Object {
83
+ "$link": "cids(0)",
84
+ },
85
+ "size": 3976,
86
+ },
87
+ "description": "its me!",
88
+ "displayName": "ali",
89
+ "labels": Object {
90
+ "$type": "com.atproto.label.defs#selfLabels",
91
+ "values": Array [
92
+ Object {
93
+ "val": "self-label-a",
94
+ },
95
+ Object {
96
+ "val": "self-label-b",
97
+ },
98
+ ],
99
+ },
100
+ },
101
+ ],
102
+ }
103
+ `;