@atproto/bsky 0.0.37 → 0.0.39

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 (149) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/api/app/bsky/feed/getAuthorFeed.d.ts +2 -3
  3. package/dist/api/app/bsky/feed/getListFeed.d.ts +2 -2
  4. package/dist/api/app/bsky/feed/getTimeline.d.ts +4 -2
  5. package/dist/api/app/bsky/labeler/getServices.d.ts +3 -0
  6. package/dist/api/util.d.ts +9 -2
  7. package/dist/auth-verifier.d.ts +1 -1
  8. package/dist/context.d.ts +3 -0
  9. package/dist/data-plane/server/db/database-schema.d.ts +2 -2
  10. package/dist/data-plane/server/db/migrations/20240226T225725627Z-labelers.d.ts +3 -0
  11. package/dist/data-plane/server/db/migrations/index.d.ts +1 -0
  12. package/dist/data-plane/server/db/tables/labeler.d.ts +13 -0
  13. package/dist/data-plane/server/indexing/index.d.ts +2 -0
  14. package/dist/data-plane/server/indexing/plugins/labeler.d.ts +10 -0
  15. package/dist/data-plane/server/util.d.ts +6 -6
  16. package/dist/hydration/actor.d.ts +3 -0
  17. package/dist/hydration/hydrator.d.ts +27 -22
  18. package/dist/hydration/label.d.ts +23 -9
  19. package/dist/index.js +4100 -4645
  20. package/dist/index.js.map +3 -3
  21. package/dist/lexicon/index.d.ts +7 -27
  22. package/dist/lexicon/lexicons.d.ts +516 -1463
  23. package/dist/lexicon/types/app/bsky/actor/defs.d.ts +23 -1
  24. package/dist/lexicon/types/app/bsky/embed/record.d.ts +2 -1
  25. package/dist/lexicon/types/app/bsky/feed/defs.d.ts +1 -0
  26. package/dist/lexicon/types/app/bsky/graph/defs.d.ts +3 -0
  27. package/dist/lexicon/types/app/bsky/labeler/defs.d.ts +41 -0
  28. package/dist/lexicon/types/{com/atproto/admin/searchRepos.d.ts → app/bsky/labeler/getServices.d.ts} +7 -7
  29. package/dist/lexicon/types/app/bsky/labeler/service.d.ts +14 -0
  30. package/dist/lexicon/types/com/atproto/admin/defs.d.ts +0 -304
  31. package/dist/lexicon/types/com/atproto/label/defs.d.ts +23 -0
  32. package/dist/lexicon/types/com/atproto/server/describeServer.d.ts +7 -0
  33. package/dist/proto/bsky_connect.d.ts +7 -1
  34. package/dist/proto/bsky_pb.d.ts +25 -0
  35. package/dist/util.d.ts +7 -0
  36. package/dist/views/index.d.ts +3 -0
  37. package/dist/views/types.d.ts +2 -1
  38. package/package.json +14 -13
  39. package/proto/bsky.proto +12 -0
  40. package/src/api/app/bsky/actor/getProfile.ts +21 -17
  41. package/src/api/app/bsky/actor/getProfiles.ts +16 -7
  42. package/src/api/app/bsky/actor/getSuggestions.ts +18 -13
  43. package/src/api/app/bsky/actor/searchActors.ts +9 -5
  44. package/src/api/app/bsky/actor/searchActorsTypeahead.ts +12 -5
  45. package/src/api/app/bsky/feed/getActorFeeds.ts +16 -6
  46. package/src/api/app/bsky/feed/getActorLikes.ts +18 -8
  47. package/src/api/app/bsky/feed/getAuthorFeed.ts +18 -19
  48. package/src/api/app/bsky/feed/getFeed.ts +14 -7
  49. package/src/api/app/bsky/feed/getFeedGenerator.ts +8 -2
  50. package/src/api/app/bsky/feed/getFeedGenerators.ts +16 -5
  51. package/src/api/app/bsky/feed/getLikes.ts +13 -6
  52. package/src/api/app/bsky/feed/getListFeed.ts +13 -7
  53. package/src/api/app/bsky/feed/getPostThread.ts +15 -8
  54. package/src/api/app/bsky/feed/getPosts.ts +14 -5
  55. package/src/api/app/bsky/feed/getRepostedBy.ts +13 -6
  56. package/src/api/app/bsky/feed/getSuggestedFeeds.ts +8 -2
  57. package/src/api/app/bsky/feed/getTimeline.ts +14 -8
  58. package/src/api/app/bsky/feed/searchPosts.ts +9 -5
  59. package/src/api/app/bsky/graph/getBlocks.ts +10 -9
  60. package/src/api/app/bsky/graph/getFollowers.ts +23 -15
  61. package/src/api/app/bsky/graph/getFollows.ts +23 -15
  62. package/src/api/app/bsky/graph/getList.ts +14 -8
  63. package/src/api/app/bsky/graph/getListBlocks.ts +10 -7
  64. package/src/api/app/bsky/graph/getListMutes.ts +10 -7
  65. package/src/api/app/bsky/graph/getLists.ts +9 -7
  66. package/src/api/app/bsky/graph/getMutes.ts +10 -8
  67. package/src/api/app/bsky/graph/getSuggestedFollowsByActor.ts +10 -7
  68. package/src/api/app/bsky/graph/muteActor.ts +1 -1
  69. package/src/api/app/bsky/labeler/getServices.ts +46 -0
  70. package/src/api/app/bsky/notification/listNotifications.ts +12 -8
  71. package/src/api/app/bsky/unspecced/getPopularFeedGenerators.ts +6 -3
  72. package/src/api/com/atproto/admin/getAccountInfos.ts +10 -3
  73. package/src/api/index.ts +2 -0
  74. package/src/api/util.ts +19 -4
  75. package/src/auth-verifier.ts +2 -2
  76. package/src/context.ts +20 -0
  77. package/src/data-plane/server/db/database-schema.ts +4 -4
  78. package/src/data-plane/server/db/migrations/20240226T225725627Z-labelers.ts +27 -0
  79. package/src/data-plane/server/db/migrations/index.ts +1 -0
  80. package/src/data-plane/server/db/tables/labeler.ts +16 -0
  81. package/src/data-plane/server/indexing/index.ts +4 -0
  82. package/src/data-plane/server/indexing/plugins/labeler.ts +77 -0
  83. package/src/data-plane/server/routes/interactions.ts +17 -1
  84. package/src/data-plane/server/routes/labels.ts +4 -2
  85. package/src/data-plane/server/routes/profile.ts +15 -1
  86. package/src/data-plane/server/routes/records.ts +1 -0
  87. package/src/hydration/actor.ts +6 -0
  88. package/src/hydration/hydrator.ts +171 -97
  89. package/src/hydration/label.ts +106 -20
  90. package/src/index.ts +1 -3
  91. package/src/lexicon/index.ts +22 -137
  92. package/src/lexicon/lexicons.ts +552 -1635
  93. package/src/lexicon/types/app/bsky/actor/defs.ts +57 -1
  94. package/src/lexicon/types/app/bsky/embed/record.ts +2 -0
  95. package/src/lexicon/types/app/bsky/feed/defs.ts +1 -0
  96. package/src/lexicon/types/app/bsky/graph/defs.ts +3 -0
  97. package/src/lexicon/types/app/bsky/labeler/defs.ts +93 -0
  98. package/src/lexicon/types/{com/atproto/admin/searchRepos.ts → app/bsky/labeler/getServices.ts} +8 -8
  99. package/src/lexicon/types/app/bsky/labeler/service.ts +31 -0
  100. package/src/lexicon/types/com/atproto/admin/defs.ts +0 -694
  101. package/src/lexicon/types/com/atproto/label/defs.ts +78 -0
  102. package/src/lexicon/types/com/atproto/server/describeServer.ts +18 -0
  103. package/src/proto/bsky_connect.ts +11 -0
  104. package/src/proto/bsky_pb.ts +146 -0
  105. package/src/util.ts +44 -0
  106. package/src/views/index.ts +77 -8
  107. package/src/views/types.ts +6 -3
  108. package/tests/__snapshots__/feed-generation.test.ts.snap +12 -45
  109. package/tests/_util.ts +21 -0
  110. package/tests/data-plane/__snapshots__/indexing.test.ts.snap +20 -8
  111. package/tests/label-hydration.test.ts +162 -0
  112. package/tests/views/__snapshots__/author-feed.test.ts.snap +0 -46
  113. package/tests/views/__snapshots__/block-lists.test.ts.snap +7 -17
  114. package/tests/views/__snapshots__/blocks.test.ts.snap +0 -9
  115. package/tests/views/__snapshots__/labeler-service.test.ts.snap +156 -0
  116. package/tests/views/__snapshots__/list-feed.test.ts.snap +0 -20
  117. package/tests/views/__snapshots__/mute-lists.test.ts.snap +10 -18
  118. package/tests/views/__snapshots__/mutes.test.ts.snap +0 -4
  119. package/tests/views/__snapshots__/notifications.test.ts.snap +0 -9
  120. package/tests/views/__snapshots__/posts.test.ts.snap +0 -7
  121. package/tests/views/__snapshots__/profile.test.ts.snap +40 -6
  122. package/tests/views/__snapshots__/thread.test.ts.snap +0 -38
  123. package/tests/views/__snapshots__/threadgating.test.ts.snap +2 -0
  124. package/tests/views/__snapshots__/timeline.test.ts.snap +0 -145
  125. package/tests/views/labeler-service.test.ts +156 -0
  126. package/tests/views/takedown-labels.test.ts +133 -0
  127. package/tests/views/timeline.test.ts +7 -2
  128. package/dist/data-plane/server/db/tables/moderation.d.ts +0 -42
  129. package/dist/lexicon/types/com/atproto/admin/createCommunicationTemplate.d.ts +0 -37
  130. package/dist/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.d.ts +0 -25
  131. package/dist/lexicon/types/com/atproto/admin/emitModerationEvent.d.ts +0 -45
  132. package/dist/lexicon/types/com/atproto/admin/getModerationEvent.d.ts +0 -29
  133. package/dist/lexicon/types/com/atproto/admin/getRecord.d.ts +0 -31
  134. package/dist/lexicon/types/com/atproto/admin/getRepo.d.ts +0 -30
  135. package/dist/lexicon/types/com/atproto/admin/listCommunicationTemplates.d.ts +0 -31
  136. package/dist/lexicon/types/com/atproto/admin/queryModerationEvents.d.ts +0 -48
  137. package/dist/lexicon/types/com/atproto/admin/queryModerationStatuses.d.ts +0 -50
  138. package/dist/lexicon/types/com/atproto/admin/updateCommunicationTemplate.d.ts +0 -39
  139. package/src/data-plane/server/db/tables/moderation.ts +0 -59
  140. package/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts +0 -54
  141. package/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts +0 -38
  142. package/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts +0 -67
  143. package/src/lexicon/types/com/atproto/admin/getModerationEvent.ts +0 -41
  144. package/src/lexicon/types/com/atproto/admin/getRecord.ts +0 -43
  145. package/src/lexicon/types/com/atproto/admin/getRepo.ts +0 -42
  146. package/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts +0 -44
  147. package/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts +0 -73
  148. package/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts +0 -74
  149. package/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts +0 -57
@@ -74,7 +74,6 @@ Object {
74
74
  Object {
75
75
  "cid": "cids(3)",
76
76
  "cts": "1970-01-01T00:00:00.000Z",
77
- "neg": false,
78
77
  "src": "user(3)",
79
78
  "uri": "record(4)",
80
79
  "val": "self-label-a",
@@ -82,7 +81,6 @@ Object {
82
81
  Object {
83
82
  "cid": "cids(3)",
84
83
  "cts": "1970-01-01T00:00:00.000Z",
85
- "neg": false,
86
84
  "src": "user(3)",
87
85
  "uri": "record(4)",
88
86
  "val": "self-label-b",
@@ -99,6 +97,7 @@ Object {
99
97
  "did": "user(2)",
100
98
  "displayName": "All",
101
99
  "indexedAt": "1970-01-01T00:00:00.000Z",
100
+ "labels": Array [],
102
101
  "likeCount": 2,
103
102
  "uri": "record(1)",
104
103
  "viewer": Object {
@@ -143,7 +142,6 @@ Array [
143
142
  Object {
144
143
  "cid": "cids(2)",
145
144
  "cts": "1970-01-01T00:00:00.000Z",
146
- "neg": false,
147
145
  "src": "user(1)",
148
146
  "uri": "record(3)",
149
147
  "val": "self-label-a",
@@ -151,7 +149,6 @@ Array [
151
149
  Object {
152
150
  "cid": "cids(2)",
153
151
  "cts": "1970-01-01T00:00:00.000Z",
154
- "neg": false,
155
152
  "src": "user(1)",
156
153
  "uri": "record(3)",
157
154
  "val": "self-label-b",
@@ -168,6 +165,7 @@ Array [
168
165
  "did": "user(0)",
169
166
  "displayName": "Odd",
170
167
  "indexedAt": "1970-01-01T00:00:00.000Z",
168
+ "labels": Array [],
171
169
  "likeCount": 0,
172
170
  "uri": "record(0)",
173
171
  "viewer": Object {},
@@ -185,7 +183,6 @@ Array [
185
183
  Object {
186
184
  "cid": "cids(2)",
187
185
  "cts": "1970-01-01T00:00:00.000Z",
188
- "neg": false,
189
186
  "src": "user(1)",
190
187
  "uri": "record(3)",
191
188
  "val": "self-label-a",
@@ -193,7 +190,6 @@ Array [
193
190
  Object {
194
191
  "cid": "cids(2)",
195
192
  "cts": "1970-01-01T00:00:00.000Z",
196
- "neg": false,
197
193
  "src": "user(1)",
198
194
  "uri": "record(3)",
199
195
  "val": "self-label-b",
@@ -210,6 +206,7 @@ Array [
210
206
  "did": "user(0)",
211
207
  "displayName": "Needs Auth",
212
208
  "indexedAt": "1970-01-01T00:00:00.000Z",
209
+ "labels": Array [],
213
210
  "likeCount": 0,
214
211
  "uri": "record(4)",
215
212
  "viewer": Object {},
@@ -227,7 +224,6 @@ Array [
227
224
  Object {
228
225
  "cid": "cids(2)",
229
226
  "cts": "1970-01-01T00:00:00.000Z",
230
- "neg": false,
231
227
  "src": "user(1)",
232
228
  "uri": "record(3)",
233
229
  "val": "self-label-a",
@@ -235,7 +231,6 @@ Array [
235
231
  Object {
236
232
  "cid": "cids(2)",
237
233
  "cts": "1970-01-01T00:00:00.000Z",
238
- "neg": false,
239
234
  "src": "user(1)",
240
235
  "uri": "record(3)",
241
236
  "val": "self-label-b",
@@ -252,6 +247,7 @@ Array [
252
247
  "did": "user(0)",
253
248
  "displayName": "Bad Pagination",
254
249
  "indexedAt": "1970-01-01T00:00:00.000Z",
250
+ "labels": Array [],
255
251
  "likeCount": 0,
256
252
  "uri": "record(5)",
257
253
  "viewer": Object {},
@@ -269,7 +265,6 @@ Array [
269
265
  Object {
270
266
  "cid": "cids(2)",
271
267
  "cts": "1970-01-01T00:00:00.000Z",
272
- "neg": false,
273
268
  "src": "user(1)",
274
269
  "uri": "record(3)",
275
270
  "val": "self-label-a",
@@ -277,7 +272,6 @@ Array [
277
272
  Object {
278
273
  "cid": "cids(2)",
279
274
  "cts": "1970-01-01T00:00:00.000Z",
280
- "neg": false,
281
275
  "src": "user(1)",
282
276
  "uri": "record(3)",
283
277
  "val": "self-label-b",
@@ -294,6 +288,7 @@ Array [
294
288
  "did": "user(0)",
295
289
  "displayName": "Even",
296
290
  "indexedAt": "1970-01-01T00:00:00.000Z",
291
+ "labels": Array [],
297
292
  "likeCount": 0,
298
293
  "uri": "record(6)",
299
294
  "viewer": Object {},
@@ -311,7 +306,6 @@ Array [
311
306
  Object {
312
307
  "cid": "cids(2)",
313
308
  "cts": "1970-01-01T00:00:00.000Z",
314
- "neg": false,
315
309
  "src": "user(1)",
316
310
  "uri": "record(3)",
317
311
  "val": "self-label-a",
@@ -319,7 +313,6 @@ Array [
319
313
  Object {
320
314
  "cid": "cids(2)",
321
315
  "cts": "1970-01-01T00:00:00.000Z",
322
- "neg": false,
323
316
  "src": "user(1)",
324
317
  "uri": "record(3)",
325
318
  "val": "self-label-b",
@@ -336,6 +329,7 @@ Array [
336
329
  "did": "user(0)",
337
330
  "displayName": "All",
338
331
  "indexedAt": "1970-01-01T00:00:00.000Z",
332
+ "labels": Array [],
339
333
  "likeCount": 2,
340
334
  "uri": "record(7)",
341
335
  "viewer": Object {
@@ -358,7 +352,6 @@ Array [
358
352
  Object {
359
353
  "cid": "cids(2)",
360
354
  "cts": "1970-01-01T00:00:00.000Z",
361
- "neg": false,
362
355
  "src": "user(0)",
363
356
  "uri": "record(1)",
364
357
  "val": "self-label-a",
@@ -366,7 +359,6 @@ Array [
366
359
  Object {
367
360
  "cid": "cids(2)",
368
361
  "cts": "1970-01-01T00:00:00.000Z",
369
- "neg": false,
370
362
  "src": "user(0)",
371
363
  "uri": "record(1)",
372
364
  "val": "self-label-b",
@@ -383,7 +375,6 @@ Array [
383
375
  Object {
384
376
  "cid": "cids(0)",
385
377
  "cts": "1970-01-01T00:00:00.000Z",
386
- "neg": false,
387
378
  "src": "user(0)",
388
379
  "uri": "record(0)",
389
380
  "val": "self-label",
@@ -608,7 +599,6 @@ Array [
608
599
  Object {
609
600
  "cid": "cids(2)",
610
601
  "cts": "1970-01-01T00:00:00.000Z",
611
- "neg": false,
612
602
  "src": "user(0)",
613
603
  "uri": "record(1)",
614
604
  "val": "self-label-a",
@@ -616,7 +606,6 @@ Array [
616
606
  Object {
617
607
  "cid": "cids(2)",
618
608
  "cts": "1970-01-01T00:00:00.000Z",
619
- "neg": false,
620
609
  "src": "user(0)",
621
610
  "uri": "record(1)",
622
611
  "val": "self-label-b",
@@ -652,7 +641,6 @@ Array [
652
641
  Object {
653
642
  "cid": "cids(2)",
654
643
  "cts": "1970-01-01T00:00:00.000Z",
655
- "neg": false,
656
644
  "src": "user(0)",
657
645
  "uri": "record(1)",
658
646
  "val": "self-label-a",
@@ -660,7 +648,6 @@ Array [
660
648
  Object {
661
649
  "cid": "cids(2)",
662
650
  "cts": "1970-01-01T00:00:00.000Z",
663
- "neg": false,
664
651
  "src": "user(0)",
665
652
  "uri": "record(1)",
666
653
  "val": "self-label-b",
@@ -879,7 +866,6 @@ Array [
879
866
  Object {
880
867
  "cid": "cids(2)",
881
868
  "cts": "1970-01-01T00:00:00.000Z",
882
- "neg": false,
883
869
  "src": "user(0)",
884
870
  "uri": "record(1)",
885
871
  "val": "self-label-a",
@@ -887,7 +873,6 @@ Array [
887
873
  Object {
888
874
  "cid": "cids(2)",
889
875
  "cts": "1970-01-01T00:00:00.000Z",
890
- "neg": false,
891
876
  "src": "user(0)",
892
877
  "uri": "record(1)",
893
878
  "val": "self-label-b",
@@ -900,7 +885,6 @@ Array [
900
885
  Object {
901
886
  "cid": "cids(0)",
902
887
  "cts": "1970-01-01T00:00:00.000Z",
903
- "neg": false,
904
888
  "src": "user(0)",
905
889
  "uri": "record(0)",
906
890
  "val": "self-label",
@@ -1068,7 +1052,6 @@ Array [
1068
1052
  Object {
1069
1053
  "cid": "cids(2)",
1070
1054
  "cts": "1970-01-01T00:00:00.000Z",
1071
- "neg": false,
1072
1055
  "src": "user(0)",
1073
1056
  "uri": "record(1)",
1074
1057
  "val": "self-label-a",
@@ -1076,7 +1059,6 @@ Array [
1076
1059
  Object {
1077
1060
  "cid": "cids(2)",
1078
1061
  "cts": "1970-01-01T00:00:00.000Z",
1079
- "neg": false,
1080
1062
  "src": "user(0)",
1081
1063
  "uri": "record(1)",
1082
1064
  "val": "self-label-b",
@@ -1107,7 +1089,6 @@ Array [
1107
1089
  Object {
1108
1090
  "cid": "cids(2)",
1109
1091
  "cts": "1970-01-01T00:00:00.000Z",
1110
- "neg": false,
1111
1092
  "src": "user(0)",
1112
1093
  "uri": "record(1)",
1113
1094
  "val": "self-label-a",
@@ -1115,7 +1096,6 @@ Array [
1115
1096
  Object {
1116
1097
  "cid": "cids(2)",
1117
1098
  "cts": "1970-01-01T00:00:00.000Z",
1118
- "neg": false,
1119
1099
  "src": "user(0)",
1120
1100
  "uri": "record(1)",
1121
1101
  "val": "self-label-b",
@@ -1153,7 +1133,6 @@ Array [
1153
1133
  Object {
1154
1134
  "cid": "cids(2)",
1155
1135
  "cts": "1970-01-01T00:00:00.000Z",
1156
- "neg": false,
1157
1136
  "src": "user(0)",
1158
1137
  "uri": "record(1)",
1159
1138
  "val": "self-label-a",
@@ -1161,7 +1140,6 @@ Array [
1161
1140
  Object {
1162
1141
  "cid": "cids(2)",
1163
1142
  "cts": "1970-01-01T00:00:00.000Z",
1164
- "neg": false,
1165
1143
  "src": "user(0)",
1166
1144
  "uri": "record(1)",
1167
1145
  "val": "self-label-b",
@@ -1178,7 +1156,6 @@ Array [
1178
1156
  Object {
1179
1157
  "cid": "cids(0)",
1180
1158
  "cts": "1970-01-01T00:00:00.000Z",
1181
- "neg": false,
1182
1159
  "src": "user(0)",
1183
1160
  "uri": "record(0)",
1184
1161
  "val": "self-label",
@@ -1369,7 +1346,6 @@ Array [
1369
1346
  Object {
1370
1347
  "cid": "cids(2)",
1371
1348
  "cts": "1970-01-01T00:00:00.000Z",
1372
- "neg": false,
1373
1349
  "src": "user(0)",
1374
1350
  "uri": "record(1)",
1375
1351
  "val": "self-label-a",
@@ -1377,7 +1353,6 @@ Array [
1377
1353
  Object {
1378
1354
  "cid": "cids(2)",
1379
1355
  "cts": "1970-01-01T00:00:00.000Z",
1380
- "neg": false,
1381
1356
  "src": "user(0)",
1382
1357
  "uri": "record(1)",
1383
1358
  "val": "self-label-b",
@@ -1413,7 +1388,6 @@ Array [
1413
1388
  Object {
1414
1389
  "cid": "cids(2)",
1415
1390
  "cts": "1970-01-01T00:00:00.000Z",
1416
- "neg": false,
1417
1391
  "src": "user(0)",
1418
1392
  "uri": "record(1)",
1419
1393
  "val": "self-label-a",
@@ -1421,7 +1395,6 @@ Array [
1421
1395
  Object {
1422
1396
  "cid": "cids(2)",
1423
1397
  "cts": "1970-01-01T00:00:00.000Z",
1424
- "neg": false,
1425
1398
  "src": "user(0)",
1426
1399
  "uri": "record(1)",
1427
1400
  "val": "self-label-b",
@@ -1468,7 +1441,6 @@ Object {
1468
1441
  Object {
1469
1442
  "cid": "cids(2)",
1470
1443
  "cts": "1970-01-01T00:00:00.000Z",
1471
- "neg": false,
1472
1444
  "src": "user(1)",
1473
1445
  "uri": "record(3)",
1474
1446
  "val": "self-label-a",
@@ -1476,7 +1448,6 @@ Object {
1476
1448
  Object {
1477
1449
  "cid": "cids(2)",
1478
1450
  "cts": "1970-01-01T00:00:00.000Z",
1479
- "neg": false,
1480
1451
  "src": "user(1)",
1481
1452
  "uri": "record(3)",
1482
1453
  "val": "self-label-b",
@@ -1493,6 +1464,7 @@ Object {
1493
1464
  "did": "user(0)",
1494
1465
  "displayName": "All",
1495
1466
  "indexedAt": "1970-01-01T00:00:00.000Z",
1467
+ "labels": Array [],
1496
1468
  "likeCount": 2,
1497
1469
  "uri": "record(0)",
1498
1470
  "viewer": Object {
@@ -1518,7 +1490,6 @@ Object {
1518
1490
  Object {
1519
1491
  "cid": "cids(2)",
1520
1492
  "cts": "1970-01-01T00:00:00.000Z",
1521
- "neg": false,
1522
1493
  "src": "user(1)",
1523
1494
  "uri": "record(3)",
1524
1495
  "val": "self-label-a",
@@ -1526,7 +1497,6 @@ Object {
1526
1497
  Object {
1527
1498
  "cid": "cids(2)",
1528
1499
  "cts": "1970-01-01T00:00:00.000Z",
1529
- "neg": false,
1530
1500
  "src": "user(1)",
1531
1501
  "uri": "record(3)",
1532
1502
  "val": "self-label-b",
@@ -1543,6 +1513,7 @@ Object {
1543
1513
  "did": "user(0)",
1544
1514
  "displayName": "Even",
1545
1515
  "indexedAt": "1970-01-01T00:00:00.000Z",
1516
+ "labels": Array [],
1546
1517
  "likeCount": 0,
1547
1518
  "uri": "record(0)",
1548
1519
  "viewer": Object {},
@@ -1560,7 +1531,6 @@ Object {
1560
1531
  Object {
1561
1532
  "cid": "cids(2)",
1562
1533
  "cts": "1970-01-01T00:00:00.000Z",
1563
- "neg": false,
1564
1534
  "src": "user(1)",
1565
1535
  "uri": "record(3)",
1566
1536
  "val": "self-label-a",
@@ -1568,7 +1538,6 @@ Object {
1568
1538
  Object {
1569
1539
  "cid": "cids(2)",
1570
1540
  "cts": "1970-01-01T00:00:00.000Z",
1571
- "neg": false,
1572
1541
  "src": "user(1)",
1573
1542
  "uri": "record(3)",
1574
1543
  "val": "self-label-b",
@@ -1585,6 +1554,7 @@ Object {
1585
1554
  "did": "user(0)",
1586
1555
  "displayName": "All",
1587
1556
  "indexedAt": "1970-01-01T00:00:00.000Z",
1557
+ "labels": Array [],
1588
1558
  "likeCount": 2,
1589
1559
  "uri": "record(4)",
1590
1560
  "viewer": Object {
@@ -1612,7 +1582,6 @@ Object {
1612
1582
  Object {
1613
1583
  "cid": "cids(2)",
1614
1584
  "cts": "1970-01-01T00:00:00.000Z",
1615
- "neg": false,
1616
1585
  "src": "user(1)",
1617
1586
  "uri": "record(3)",
1618
1587
  "val": "self-label-a",
@@ -1620,7 +1589,6 @@ Object {
1620
1589
  Object {
1621
1590
  "cid": "cids(2)",
1622
1591
  "cts": "1970-01-01T00:00:00.000Z",
1623
- "neg": false,
1624
1592
  "src": "user(1)",
1625
1593
  "uri": "record(3)",
1626
1594
  "val": "self-label-b",
@@ -1637,6 +1605,7 @@ Object {
1637
1605
  "did": "user(0)",
1638
1606
  "displayName": "All",
1639
1607
  "indexedAt": "1970-01-01T00:00:00.000Z",
1608
+ "labels": Array [],
1640
1609
  "likeCount": 2,
1641
1610
  "uri": "record(0)",
1642
1611
  "viewer": Object {
@@ -1656,7 +1625,6 @@ Object {
1656
1625
  Object {
1657
1626
  "cid": "cids(2)",
1658
1627
  "cts": "1970-01-01T00:00:00.000Z",
1659
- "neg": false,
1660
1628
  "src": "user(1)",
1661
1629
  "uri": "record(3)",
1662
1630
  "val": "self-label-a",
@@ -1664,7 +1632,6 @@ Object {
1664
1632
  Object {
1665
1633
  "cid": "cids(2)",
1666
1634
  "cts": "1970-01-01T00:00:00.000Z",
1667
- "neg": false,
1668
1635
  "src": "user(1)",
1669
1636
  "uri": "record(3)",
1670
1637
  "val": "self-label-b",
@@ -1681,6 +1648,7 @@ Object {
1681
1648
  "did": "user(0)",
1682
1649
  "displayName": "Even",
1683
1650
  "indexedAt": "1970-01-01T00:00:00.000Z",
1651
+ "labels": Array [],
1684
1652
  "likeCount": 0,
1685
1653
  "uri": "record(5)",
1686
1654
  "viewer": Object {},
@@ -1698,7 +1666,6 @@ Object {
1698
1666
  Object {
1699
1667
  "cid": "cids(2)",
1700
1668
  "cts": "1970-01-01T00:00:00.000Z",
1701
- "neg": false,
1702
1669
  "src": "user(1)",
1703
1670
  "uri": "record(3)",
1704
1671
  "val": "self-label-a",
@@ -1706,7 +1673,6 @@ Object {
1706
1673
  Object {
1707
1674
  "cid": "cids(2)",
1708
1675
  "cts": "1970-01-01T00:00:00.000Z",
1709
- "neg": false,
1710
1676
  "src": "user(1)",
1711
1677
  "uri": "record(3)",
1712
1678
  "val": "self-label-b",
@@ -1723,6 +1689,7 @@ Object {
1723
1689
  "did": "user(0)",
1724
1690
  "displayName": "Bad Pagination",
1725
1691
  "indexedAt": "1970-01-01T00:00:00.000Z",
1692
+ "labels": Array [],
1726
1693
  "likeCount": 0,
1727
1694
  "uri": "record(6)",
1728
1695
  "viewer": Object {},
package/tests/_util.ts CHANGED
@@ -8,6 +8,11 @@ import {
8
8
  isThreadViewPost,
9
9
  } from '../src/lexicon/types/app/bsky/feed/defs'
10
10
  import { isViewRecord } from '../src/lexicon/types/app/bsky/embed/record'
11
+ import {
12
+ LabelerView,
13
+ isLabelerView,
14
+ isLabelerViewDetailed,
15
+ } from '../src/lexicon/types/app/bsky/labeler/defs'
11
16
 
12
17
  // Swap out identifiers and dates with stable
13
18
  // values for the purpose of snapshot testing
@@ -190,3 +195,19 @@ export const stripViewerFromThread = <T>(thread: T): T => {
190
195
  }
191
196
  return thread
192
197
  }
198
+
199
+ // @NOTE mutates
200
+ export const stripViewerFromLabeler = (
201
+ serviceUnknown: unknown,
202
+ ): LabelerView => {
203
+ if (
204
+ serviceUnknown?.['$type'] &&
205
+ !isLabelerView(serviceUnknown) &&
206
+ !isLabelerViewDetailed(serviceUnknown)
207
+ ) {
208
+ throw new Error('Expected mod service view')
209
+ }
210
+ const labeler = serviceUnknown as LabelerView
211
+ labeler.creator = stripViewer(labeler.creator)
212
+ return stripViewer(labeler)
213
+ }
@@ -3,6 +3,11 @@
3
3
  exports[`indexing indexRepo updates indexes when records change. 1`] = `
4
4
  Array [
5
5
  Object {
6
+ "associated": Object {
7
+ "feedgens": 0,
8
+ "labeler": false,
9
+ "lists": 0,
10
+ },
6
11
  "description": "freshening things up",
7
12
  "did": "user(0)",
8
13
  "followersCount": 2,
@@ -112,7 +117,6 @@ Array [
112
117
  Object {
113
118
  "cid": "cids(3)",
114
119
  "cts": "1970-01-01T00:00:00.000Z",
115
- "neg": false,
116
120
  "src": "did:example:labeler",
117
121
  "uri": "record(3)",
118
122
  "val": "test-label",
@@ -120,7 +124,6 @@ Array [
120
124
  Object {
121
125
  "cid": "cids(3)",
122
126
  "cts": "1970-01-01T00:00:00.000Z",
123
- "neg": false,
124
127
  "src": "did:example:labeler",
125
128
  "uri": "record(3)",
126
129
  "val": "test-label-2",
@@ -316,7 +319,6 @@ Array [
316
319
  Object {
317
320
  "cid": "cids(6)",
318
321
  "cts": "1970-01-01T00:00:00.000Z",
319
- "neg": false,
320
322
  "src": "did:example:labeler",
321
323
  "uri": "record(6)",
322
324
  "val": "test-label",
@@ -384,7 +386,6 @@ Array [
384
386
  Object {
385
387
  "cid": "cids(11)",
386
388
  "cts": "1970-01-01T00:00:00.000Z",
387
- "neg": false,
388
389
  "src": "user(0)",
389
390
  "uri": "record(12)",
390
391
  "val": "self-label",
@@ -470,7 +471,6 @@ Object {
470
471
  Object {
471
472
  "cid": "cids(2)",
472
473
  "cts": "1970-01-01T00:00:00.000Z",
473
- "neg": false,
474
474
  "src": "user(0)",
475
475
  "uri": "record(1)",
476
476
  "val": "self-label-a",
@@ -478,7 +478,6 @@ Object {
478
478
  Object {
479
479
  "cid": "cids(2)",
480
480
  "cts": "1970-01-01T00:00:00.000Z",
481
- "neg": false,
482
481
  "src": "user(0)",
483
482
  "uri": "record(1)",
484
483
  "val": "self-label-b",
@@ -536,7 +535,6 @@ Object {
536
535
  Object {
537
536
  "cid": "cids(2)",
538
537
  "cts": "1970-01-01T00:00:00.000Z",
539
- "neg": false,
540
538
  "src": "user(0)",
541
539
  "uri": "record(1)",
542
540
  "val": "self-label-a",
@@ -544,7 +542,6 @@ Object {
544
542
  Object {
545
543
  "cid": "cids(2)",
546
544
  "cts": "1970-01-01T00:00:00.000Z",
547
- "neg": false,
548
545
  "src": "user(0)",
549
546
  "uri": "record(1)",
550
547
  "val": "self-label-b",
@@ -620,6 +617,11 @@ Object {
620
617
 
621
618
  exports[`indexing indexes profiles. 1`] = `
622
619
  Object {
620
+ "associated": Object {
621
+ "feedgens": 0,
622
+ "labeler": false,
623
+ "lists": 0,
624
+ },
623
625
  "did": "user(0)",
624
626
  "displayName": "dan",
625
627
  "followersCount": 0,
@@ -637,6 +639,11 @@ Object {
637
639
 
638
640
  exports[`indexing indexes profiles. 2`] = `
639
641
  Object {
642
+ "associated": Object {
643
+ "feedgens": 0,
644
+ "labeler": false,
645
+ "lists": 0,
646
+ },
640
647
  "did": "user(0)",
641
648
  "displayName": "danny",
642
649
  "followersCount": 0,
@@ -654,6 +661,11 @@ Object {
654
661
 
655
662
  exports[`indexing indexes profiles. 3`] = `
656
663
  Object {
664
+ "associated": Object {
665
+ "feedgens": 0,
666
+ "labeler": false,
667
+ "lists": 0,
668
+ },
657
669
  "did": "user(0)",
658
670
  "followersCount": 0,
659
671
  "followsCount": 0,