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