@atproto/bsky 0.0.11 → 0.0.12

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 (155) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/api/com/atproto/admin/util.d.ts +5 -0
  3. package/dist/context.d.ts +6 -1
  4. package/dist/db/index.js +51 -2
  5. package/dist/db/index.js.map +3 -3
  6. package/dist/db/migrations/20230929T192920807Z-record-cursor-indexes.d.ts +3 -0
  7. package/dist/db/migrations/index.d.ts +1 -0
  8. package/dist/did-cache.d.ts +2 -2
  9. package/dist/index.d.ts +2 -0
  10. package/dist/index.js +1381 -530
  11. package/dist/index.js.map +3 -3
  12. package/dist/lexicon/index.d.ts +8 -0
  13. package/dist/lexicon/lexicons.d.ts +231 -3
  14. package/dist/lexicon/types/app/bsky/actor/defs.d.ts +1 -0
  15. package/dist/lexicon/types/com/atproto/admin/defs.d.ts +28 -0
  16. package/dist/lexicon/types/com/atproto/admin/getAccountInfo.d.ts +29 -0
  17. package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts +39 -0
  18. package/dist/lexicon/types/com/atproto/admin/searchRepos.d.ts +0 -1
  19. package/dist/lexicon/types/com/atproto/admin/updateSubjectStatus.d.ts +46 -0
  20. package/dist/lexicon/types/com/atproto/server/createAccount.d.ts +2 -0
  21. package/dist/lexicon/types/com/atproto/server/createSession.d.ts +1 -0
  22. package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +1 -0
  23. package/dist/lexicon/types/com/atproto/server/reserveSigningKey.d.ts +30 -0
  24. package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts +1 -0
  25. package/dist/services/actor/types.d.ts +1 -0
  26. package/dist/services/graph/index.d.ts +2 -0
  27. package/dist/services/moderation/index.d.ts +13 -3
  28. package/package.json +13 -14
  29. package/src/api/app/bsky/feed/getAuthorFeed.ts +2 -2
  30. package/src/api/app/bsky/feed/getPostThread.ts +2 -2
  31. package/src/api/app/bsky/notification/listNotifications.ts +33 -22
  32. package/src/api/com/atproto/admin/getModerationAction.ts +28 -2
  33. package/src/api/com/atproto/admin/getModerationReport.ts +27 -2
  34. package/src/api/com/atproto/admin/getRecord.ts +14 -2
  35. package/src/api/com/atproto/admin/getRepo.ts +13 -2
  36. package/src/api/com/atproto/admin/reverseModerationAction.ts +31 -5
  37. package/src/api/com/atproto/admin/searchRepos.ts +2 -5
  38. package/src/api/com/atproto/admin/takeModerationAction.ts +41 -7
  39. package/src/api/com/atproto/admin/util.ts +50 -0
  40. package/src/api/well-known.ts +8 -0
  41. package/src/auth.ts +12 -5
  42. package/src/auto-moderator/index.ts +1 -0
  43. package/src/context.ts +25 -1
  44. package/src/db/migrations/20230929T192920807Z-record-cursor-indexes.ts +40 -0
  45. package/src/db/migrations/index.ts +1 -0
  46. package/src/did-cache.ts +29 -14
  47. package/src/feed-gen/with-friends.ts +2 -2
  48. package/src/index.ts +4 -1
  49. package/src/indexer/subscription.ts +1 -21
  50. package/src/lexicon/index.ts +48 -0
  51. package/src/lexicon/lexicons.ts +246 -4
  52. package/src/lexicon/types/app/bsky/actor/defs.ts +1 -0
  53. package/src/lexicon/types/com/atproto/admin/defs.ts +61 -0
  54. package/src/lexicon/types/com/atproto/admin/getAccountInfo.ts +41 -0
  55. package/src/lexicon/types/com/atproto/admin/getSubjectStatus.ts +54 -0
  56. package/src/lexicon/types/com/atproto/admin/searchRepos.ts +0 -1
  57. package/src/lexicon/types/com/atproto/admin/updateSubjectStatus.ts +61 -0
  58. package/src/lexicon/types/com/atproto/server/createAccount.ts +2 -0
  59. package/src/lexicon/types/com/atproto/server/createSession.ts +1 -0
  60. package/src/lexicon/types/com/atproto/server/refreshSession.ts +1 -0
  61. package/src/lexicon/types/com/atproto/server/reserveSigningKey.ts +44 -0
  62. package/src/lexicon/types/com/atproto/sync/listRepos.ts +1 -0
  63. package/src/logger.ts +8 -0
  64. package/src/services/actor/index.ts +7 -1
  65. package/src/services/actor/types.ts +1 -0
  66. package/src/services/actor/views.ts +26 -8
  67. package/src/services/graph/index.ts +26 -7
  68. package/src/services/indexing/index.ts +15 -17
  69. package/src/services/moderation/index.ts +94 -14
  70. package/src/services/moderation/views.ts +1 -0
  71. package/tests/__snapshots__/feed-generation.test.ts.snap +12 -12
  72. package/tests/__snapshots__/indexing.test.ts.snap +4 -4
  73. package/tests/admin/__snapshots__/get-moderation-action.test.ts.snap +172 -0
  74. package/tests/admin/__snapshots__/get-moderation-actions.test.ts.snap +178 -0
  75. package/tests/admin/__snapshots__/get-moderation-report.test.ts.snap +177 -0
  76. package/tests/admin/__snapshots__/get-moderation-reports.test.ts.snap +307 -0
  77. package/tests/admin/__snapshots__/get-record.test.ts.snap +275 -0
  78. package/tests/admin/__snapshots__/get-repo.test.ts.snap +103 -0
  79. package/tests/admin/get-moderation-action.test.ts +100 -0
  80. package/tests/admin/get-moderation-actions.test.ts +164 -0
  81. package/tests/admin/get-moderation-report.test.ts +100 -0
  82. package/tests/admin/get-moderation-reports.test.ts +332 -0
  83. package/tests/admin/get-record.test.ts +115 -0
  84. package/tests/admin/get-repo.test.ts +101 -0
  85. package/tests/{moderation.test.ts → admin/moderation.test.ts} +107 -9
  86. package/tests/admin/repo-search.test.ts +124 -0
  87. package/tests/algos/hot-classic.test.ts +3 -5
  88. package/tests/algos/whats-hot.test.ts +3 -5
  89. package/tests/algos/with-friends.test.ts +2 -4
  90. package/tests/auth.test.ts +64 -0
  91. package/tests/auto-moderator/fuzzy-matcher.test.ts +2 -3
  92. package/tests/auto-moderator/labeler.test.ts +5 -7
  93. package/tests/auto-moderator/takedowns.test.ts +11 -12
  94. package/tests/blob-resolver.test.ts +1 -3
  95. package/tests/did-cache.test.ts +2 -5
  96. package/tests/feed-generation.test.ts +8 -6
  97. package/tests/handle-invalidation.test.ts +2 -3
  98. package/tests/image/server.test.ts +1 -4
  99. package/tests/image/sharp.test.ts +1 -1
  100. package/tests/indexing.test.ts +4 -4
  101. package/tests/notification-server.test.ts +2 -3
  102. package/tests/pipeline/backpressure.test.ts +2 -3
  103. package/tests/pipeline/reingest.test.ts +7 -4
  104. package/tests/pipeline/repartition.test.ts +2 -3
  105. package/tests/reprocessing.test.ts +2 -6
  106. package/tests/seeds/basic.ts +4 -4
  107. package/tests/seeds/follows.ts +1 -1
  108. package/tests/seeds/likes.ts +1 -1
  109. package/tests/seeds/reposts.ts +1 -1
  110. package/tests/seeds/users-bulk.ts +1 -1
  111. package/tests/seeds/users.ts +1 -1
  112. package/tests/server.test.ts +1 -3
  113. package/tests/subscription/repo.test.ts +2 -4
  114. package/tests/views/__snapshots__/author-feed.test.ts.snap +24 -24
  115. package/tests/views/__snapshots__/block-lists.test.ts.snap +42 -7
  116. package/tests/views/__snapshots__/blocks.test.ts.snap +2 -2
  117. package/tests/views/__snapshots__/list-feed.test.ts.snap +6 -6
  118. package/tests/views/__snapshots__/mute-lists.test.ts.snap +15 -4
  119. package/tests/views/__snapshots__/mutes.test.ts.snap +2 -2
  120. package/tests/views/__snapshots__/notifications.test.ts.snap +2 -2
  121. package/tests/views/__snapshots__/posts.test.ts.snap +8 -8
  122. package/tests/views/__snapshots__/thread.test.ts.snap +10 -10
  123. package/tests/views/__snapshots__/timeline.test.ts.snap +58 -58
  124. package/tests/views/actor-likes.test.ts +2 -3
  125. package/tests/views/actor-search.test.ts +5 -5
  126. package/tests/views/admin/repo-search.test.ts +2 -4
  127. package/tests/views/author-feed.test.ts +2 -4
  128. package/tests/views/block-lists.test.ts +34 -7
  129. package/tests/views/blocks.test.ts +6 -3
  130. package/tests/views/follows.test.ts +2 -4
  131. package/tests/views/likes.test.ts +2 -5
  132. package/tests/views/list-feed.test.ts +2 -4
  133. package/tests/views/mute-lists.test.ts +23 -5
  134. package/tests/views/mutes.test.ts +2 -5
  135. package/tests/views/notifications.test.ts +2 -4
  136. package/tests/views/posts.test.ts +2 -5
  137. package/tests/views/profile.test.ts +4 -5
  138. package/tests/views/reposts.test.ts +2 -4
  139. package/tests/views/suggested-follows.test.ts +2 -3
  140. package/tests/views/suggestions.test.ts +2 -4
  141. package/tests/views/thread.test.ts +2 -4
  142. package/tests/views/threadgating.test.ts +2 -3
  143. package/tests/views/timeline.test.ts +2 -4
  144. package/dist/env.d.ts +0 -1
  145. package/example.dev.env +0 -5
  146. package/src/env.ts +0 -9
  147. package/tests/seeds/client.ts +0 -466
  148. /package/tests/{__snapshots__ → admin/__snapshots__}/moderation.test.ts.snap +0 -0
  149. /package/tests/{image/fixtures → sample-img}/at.png +0 -0
  150. /package/tests/{image/fixtures → sample-img}/hd-key.jpg +0 -0
  151. /package/tests/{image/fixtures → sample-img}/key-alt.jpg +0 -0
  152. /package/tests/{image/fixtures → sample-img}/key-landscape-large.jpg +0 -0
  153. /package/tests/{image/fixtures → sample-img}/key-landscape-small.jpg +0 -0
  154. /package/tests/{image/fixtures → sample-img}/key-portrait-large.jpg +0 -0
  155. /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
+ `;