@atproto/bsky 0.0.60 → 0.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/api/app/bsky/graph/getKnownFollowers.d.ts +4 -0
- package/dist/api/app/bsky/graph/getKnownFollowers.d.ts.map +1 -0
- package/dist/api/app/bsky/graph/getKnownFollowers.js +71 -0
- package/dist/api/app/bsky/graph/getKnownFollowers.js.map +1 -0
- package/dist/api/app/bsky/graph/muteThread.d.ts +4 -0
- package/dist/api/app/bsky/graph/muteThread.d.ts.map +1 -0
- package/dist/api/app/bsky/graph/muteThread.js +19 -0
- package/dist/api/app/bsky/graph/muteThread.js.map +1 -0
- package/dist/api/app/bsky/graph/unmuteThread.d.ts +4 -0
- package/dist/api/app/bsky/graph/unmuteThread.d.ts.map +1 -0
- package/dist/api/app/bsky/graph/unmuteThread.js +19 -0
- package/dist/api/app/bsky/graph/unmuteThread.js.map +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +6 -0
- package/dist/api/index.js.map +1 -1
- package/dist/data-plane/bsync/index.d.ts.map +1 -1
- package/dist/data-plane/bsync/index.js +41 -15
- package/dist/data-plane/bsync/index.js.map +1 -1
- package/dist/data-plane/server/db/database-schema.d.ts +2 -1
- package/dist/data-plane/server/db/database-schema.d.ts.map +1 -1
- package/dist/data-plane/server/db/migrations/20240606T171229898Z-thread-mutes.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20240606T171229898Z-thread-mutes.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20240606T171229898Z-thread-mutes.js +18 -0
- package/dist/data-plane/server/db/migrations/20240606T171229898Z-thread-mutes.js.map +1 -0
- package/dist/data-plane/server/db/migrations/index.d.ts +1 -0
- package/dist/data-plane/server/db/migrations/index.d.ts.map +1 -1
- package/dist/data-plane/server/db/migrations/index.js +2 -1
- package/dist/data-plane/server/db/migrations/index.js.map +1 -1
- package/dist/data-plane/server/db/tables/thread-mute.d.ts +10 -0
- package/dist/data-plane/server/db/tables/thread-mute.d.ts.map +1 -0
- package/dist/data-plane/server/db/tables/thread-mute.js +5 -0
- package/dist/data-plane/server/db/tables/thread-mute.js.map +1 -0
- package/dist/data-plane/server/indexing/processor.d.ts +2 -0
- package/dist/data-plane/server/indexing/processor.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/processor.js +28 -1
- package/dist/data-plane/server/indexing/processor.js.map +1 -1
- package/dist/data-plane/server/routes/follows.d.ts.map +1 -1
- package/dist/data-plane/server/routes/follows.js +34 -2
- package/dist/data-plane/server/routes/follows.js.map +1 -1
- package/dist/data-plane/server/routes/mutes.d.ts.map +1 -1
- package/dist/data-plane/server/routes/mutes.js +16 -0
- package/dist/data-plane/server/routes/mutes.js.map +1 -1
- package/dist/data-plane/server/util.d.ts +6 -6
- package/dist/hydration/actor.d.ts +6 -0
- package/dist/hydration/actor.d.ts.map +1 -1
- package/dist/hydration/actor.js +17 -0
- package/dist/hydration/actor.js.map +1 -1
- package/dist/hydration/feed.d.ts +6 -1
- package/dist/hydration/feed.d.ts.map +1 -1
- package/dist/hydration/feed.js +16 -2
- package/dist/hydration/feed.js.map +1 -1
- package/dist/hydration/hydrator.d.ts +2 -1
- package/dist/hydration/hydrator.d.ts.map +1 -1
- package/dist/hydration/hydrator.js +28 -7
- package/dist/hydration/hydrator.js.map +1 -1
- package/dist/lexicon/index.d.ts +6 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +12 -0
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +127 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +127 -0
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +9 -0
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js +11 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/graph/getKnownFollowers.d.ts +40 -0
- package/dist/lexicon/types/app/bsky/graph/getKnownFollowers.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getKnownFollowers.js +3 -0
- package/dist/lexicon/types/app/bsky/graph/getKnownFollowers.js.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/muteThread.d.ts +29 -0
- package/dist/lexicon/types/app/bsky/graph/muteThread.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/muteThread.js +3 -0
- package/dist/lexicon/types/app/bsky/graph/muteThread.js.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/unmuteThread.d.ts +29 -0
- package/dist/lexicon/types/app/bsky/graph/unmuteThread.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/unmuteThread.js +3 -0
- package/dist/lexicon/types/app/bsky/graph/unmuteThread.js.map +1 -0
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +2 -1
- package/dist/logger.js.map +1 -1
- package/dist/proto/bsky_connect.d.ts +39 -1
- package/dist/proto/bsky_connect.d.ts.map +1 -1
- package/dist/proto/bsky_connect.js +38 -0
- package/dist/proto/bsky_connect.js.map +1 -1
- package/dist/proto/bsky_pb.d.ts +161 -4
- package/dist/proto/bsky_pb.d.ts.map +1 -1
- package/dist/proto/bsky_pb.js +512 -12
- package/dist/proto/bsky_pb.js.map +1 -1
- package/dist/views/index.d.ts +5 -0
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +20 -0
- package/dist/views/index.js.map +1 -1
- package/package.json +5 -5
- package/proto/bsky.proto +47 -2
- package/src/api/app/bsky/graph/getKnownFollowers.ts +119 -0
- package/src/api/app/bsky/graph/muteThread.ts +18 -0
- package/src/api/app/bsky/graph/unmuteThread.ts +18 -0
- package/src/api/index.ts +6 -0
- package/src/data-plane/bsync/index.ts +39 -15
- package/src/data-plane/server/db/database-schema.ts +2 -0
- package/src/data-plane/server/db/migrations/20240606T171229898Z-thread-mutes.ts +15 -0
- package/src/data-plane/server/db/migrations/index.ts +1 -0
- package/src/data-plane/server/db/tables/thread-mute.ts +9 -0
- package/src/data-plane/server/indexing/processor.ts +29 -1
- package/src/data-plane/server/routes/follows.ts +45 -2
- package/src/data-plane/server/routes/mutes.ts +17 -0
- package/src/hydration/actor.ts +30 -0
- package/src/hydration/feed.ts +23 -3
- package/src/hydration/hydrator.ts +36 -7
- package/src/lexicon/index.ts +36 -0
- package/src/lexicon/lexicons.ts +129 -0
- package/src/lexicon/types/app/bsky/actor/defs.ts +20 -0
- package/src/lexicon/types/app/bsky/feed/defs.ts +1 -0
- package/src/lexicon/types/app/bsky/graph/getKnownFollowers.ts +50 -0
- package/src/lexicon/types/app/bsky/graph/muteThread.ts +38 -0
- package/src/lexicon/types/app/bsky/graph/unmuteThread.ts +38 -0
- package/src/logger.ts +2 -0
- package/src/proto/bsky_connect.ts +46 -0
- package/src/proto/bsky_pb.ts +540 -8
- package/src/views/index.ts +25 -0
- package/tests/__snapshots__/feed-generation.test.ts.snap +38 -12
- package/tests/data-plane/__snapshots__/indexing.test.ts.snap +73 -37
- package/tests/data-plane/thread-mutes.test.ts +140 -0
- package/tests/label-hydration.test.ts +0 -2
- package/tests/query-labels.test.ts +0 -3
- package/tests/views/__snapshots__/author-feed.test.ts.snap +62 -17
- package/tests/views/__snapshots__/block-lists.test.ts.snap +7 -2
- package/tests/views/__snapshots__/blocks.test.ts.snap +13 -4
- package/tests/views/__snapshots__/list-feed.test.ts.snap +23 -6
- package/tests/views/__snapshots__/mute-lists.test.ts.snap +10 -3
- package/tests/views/__snapshots__/mutes.test.ts.snap +9 -3
- package/tests/views/__snapshots__/posts.test.ts.snap +16 -5
- package/tests/views/__snapshots__/profile.test.ts.snap +230 -10
- package/tests/views/__snapshots__/thread.test.ts.snap +53 -14
- package/tests/views/__snapshots__/timeline.test.ts.snap +213 -64
- package/tests/views/blocks.test.ts +13 -0
- package/tests/views/profile.test.ts +35 -0
- package/tests/views/threadgating.test.ts +19 -19
|
@@ -40,7 +40,9 @@ Object {
|
|
|
40
40
|
"replyCount": 0,
|
|
41
41
|
"repostCount": 0,
|
|
42
42
|
"uri": "record(0)",
|
|
43
|
-
"viewer": Object {
|
|
43
|
+
"viewer": Object {
|
|
44
|
+
"threadMuted": false,
|
|
45
|
+
},
|
|
44
46
|
}
|
|
45
47
|
`;
|
|
46
48
|
|
|
@@ -123,7 +125,9 @@ Object {
|
|
|
123
125
|
"replyCount": 0,
|
|
124
126
|
"repostCount": 0,
|
|
125
127
|
"uri": "record(0)",
|
|
126
|
-
"viewer": Object {
|
|
128
|
+
"viewer": Object {
|
|
129
|
+
"threadMuted": false,
|
|
130
|
+
},
|
|
127
131
|
}
|
|
128
132
|
`;
|
|
129
133
|
|
|
@@ -398,7 +402,9 @@ Array [
|
|
|
398
402
|
"replyCount": 0,
|
|
399
403
|
"repostCount": 0,
|
|
400
404
|
"uri": "record(0)",
|
|
401
|
-
"viewer": Object {
|
|
405
|
+
"viewer": Object {
|
|
406
|
+
"threadMuted": false,
|
|
407
|
+
},
|
|
402
408
|
},
|
|
403
409
|
},
|
|
404
410
|
Object {
|
|
@@ -433,7 +439,9 @@ Array [
|
|
|
433
439
|
"replyCount": 0,
|
|
434
440
|
"repostCount": 0,
|
|
435
441
|
"uri": "record(2)",
|
|
436
|
-
"viewer": Object {
|
|
442
|
+
"viewer": Object {
|
|
443
|
+
"threadMuted": false,
|
|
444
|
+
},
|
|
437
445
|
},
|
|
438
446
|
},
|
|
439
447
|
Object {
|
|
@@ -553,6 +561,7 @@ Array [
|
|
|
553
561
|
"uri": "record(5)",
|
|
554
562
|
"viewer": Object {
|
|
555
563
|
"like": "record(8)",
|
|
564
|
+
"threadMuted": false,
|
|
556
565
|
},
|
|
557
566
|
},
|
|
558
567
|
},
|
|
@@ -592,7 +601,9 @@ Array [
|
|
|
592
601
|
"replyCount": 0,
|
|
593
602
|
"repostCount": 0,
|
|
594
603
|
"uri": "record(9)",
|
|
595
|
-
"viewer": Object {
|
|
604
|
+
"viewer": Object {
|
|
605
|
+
"threadMuted": false,
|
|
606
|
+
},
|
|
596
607
|
},
|
|
597
608
|
"reply": Object {
|
|
598
609
|
"parent": Object {
|
|
@@ -635,7 +646,9 @@ Array [
|
|
|
635
646
|
"replyCount": 2,
|
|
636
647
|
"repostCount": 1,
|
|
637
648
|
"uri": "record(10)",
|
|
638
|
-
"viewer": Object {
|
|
649
|
+
"viewer": Object {
|
|
650
|
+
"threadMuted": false,
|
|
651
|
+
},
|
|
639
652
|
},
|
|
640
653
|
"root": Object {
|
|
641
654
|
"$type": "app.bsky.feed.defs#postView",
|
|
@@ -677,7 +690,9 @@ Array [
|
|
|
677
690
|
"replyCount": 2,
|
|
678
691
|
"repostCount": 1,
|
|
679
692
|
"uri": "record(10)",
|
|
680
|
-
"viewer": Object {
|
|
693
|
+
"viewer": Object {
|
|
694
|
+
"threadMuted": false,
|
|
695
|
+
},
|
|
681
696
|
},
|
|
682
697
|
},
|
|
683
698
|
},
|
|
@@ -851,7 +866,9 @@ Array [
|
|
|
851
866
|
"replyCount": 0,
|
|
852
867
|
"repostCount": 1,
|
|
853
868
|
"uri": "record(11)",
|
|
854
|
-
"viewer": Object {
|
|
869
|
+
"viewer": Object {
|
|
870
|
+
"threadMuted": false,
|
|
871
|
+
},
|
|
855
872
|
},
|
|
856
873
|
"reason": Object {
|
|
857
874
|
"$type": "app.bsky.feed.defs#reasonRepost",
|
|
@@ -1204,7 +1221,9 @@ Array [
|
|
|
1204
1221
|
"replyCount": 0,
|
|
1205
1222
|
"repostCount": 0,
|
|
1206
1223
|
"uri": "record(0)",
|
|
1207
|
-
"viewer": Object {
|
|
1224
|
+
"viewer": Object {
|
|
1225
|
+
"threadMuted": false,
|
|
1226
|
+
},
|
|
1208
1227
|
},
|
|
1209
1228
|
},
|
|
1210
1229
|
Object {
|
|
@@ -1324,6 +1343,7 @@ Array [
|
|
|
1324
1343
|
"uri": "record(2)",
|
|
1325
1344
|
"viewer": Object {
|
|
1326
1345
|
"like": "record(8)",
|
|
1346
|
+
"threadMuted": false,
|
|
1327
1347
|
},
|
|
1328
1348
|
},
|
|
1329
1349
|
},
|
|
@@ -1363,7 +1383,9 @@ Array [
|
|
|
1363
1383
|
"replyCount": 0,
|
|
1364
1384
|
"repostCount": 0,
|
|
1365
1385
|
"uri": "record(9)",
|
|
1366
|
-
"viewer": Object {
|
|
1386
|
+
"viewer": Object {
|
|
1387
|
+
"threadMuted": false,
|
|
1388
|
+
},
|
|
1367
1389
|
},
|
|
1368
1390
|
"reply": Object {
|
|
1369
1391
|
"parent": Object {
|
|
@@ -1406,7 +1428,9 @@ Array [
|
|
|
1406
1428
|
"replyCount": 2,
|
|
1407
1429
|
"repostCount": 1,
|
|
1408
1430
|
"uri": "record(10)",
|
|
1409
|
-
"viewer": Object {
|
|
1431
|
+
"viewer": Object {
|
|
1432
|
+
"threadMuted": false,
|
|
1433
|
+
},
|
|
1410
1434
|
},
|
|
1411
1435
|
"root": Object {
|
|
1412
1436
|
"$type": "app.bsky.feed.defs#postView",
|
|
@@ -1448,7 +1472,9 @@ Array [
|
|
|
1448
1472
|
"replyCount": 2,
|
|
1449
1473
|
"repostCount": 1,
|
|
1450
1474
|
"uri": "record(10)",
|
|
1451
|
-
"viewer": Object {
|
|
1475
|
+
"viewer": Object {
|
|
1476
|
+
"threadMuted": false,
|
|
1477
|
+
},
|
|
1452
1478
|
},
|
|
1453
1479
|
},
|
|
1454
1480
|
},
|
|
@@ -18,6 +18,24 @@ Array [
|
|
|
18
18
|
"postsCount": 5,
|
|
19
19
|
"viewer": Object {
|
|
20
20
|
"blockedBy": false,
|
|
21
|
+
"knownFollowers": Object {
|
|
22
|
+
"count": 1,
|
|
23
|
+
"followers": Array [
|
|
24
|
+
Object {
|
|
25
|
+
"avatar": "https://bsky.public.url/img/avatar/plain/user(2)/cids(0)@jpeg",
|
|
26
|
+
"did": "user(1)",
|
|
27
|
+
"displayName": "bobby",
|
|
28
|
+
"handle": "bob.test",
|
|
29
|
+
"labels": Array [],
|
|
30
|
+
"viewer": Object {
|
|
31
|
+
"blockedBy": false,
|
|
32
|
+
"followedBy": "record(1)",
|
|
33
|
+
"following": "record(0)",
|
|
34
|
+
"muted": false,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
21
39
|
"muted": false,
|
|
22
40
|
},
|
|
23
41
|
},
|
|
@@ -35,7 +53,7 @@ Array [
|
|
|
35
53
|
"muted": false,
|
|
36
54
|
},
|
|
37
55
|
},
|
|
38
|
-
"cid": "cids(
|
|
56
|
+
"cid": "cids(1)",
|
|
39
57
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
40
58
|
"labels": Array [],
|
|
41
59
|
"likeCount": 0,
|
|
@@ -46,8 +64,10 @@ Array [
|
|
|
46
64
|
},
|
|
47
65
|
"replyCount": 0,
|
|
48
66
|
"repostCount": 0,
|
|
49
|
-
"uri": "record(
|
|
50
|
-
"viewer": Object {
|
|
67
|
+
"uri": "record(2)",
|
|
68
|
+
"viewer": Object {
|
|
69
|
+
"threadMuted": false,
|
|
70
|
+
},
|
|
51
71
|
},
|
|
52
72
|
},
|
|
53
73
|
Object {
|
|
@@ -61,7 +81,7 @@ Array [
|
|
|
61
81
|
"muted": false,
|
|
62
82
|
},
|
|
63
83
|
},
|
|
64
|
-
"cid": "cids(
|
|
84
|
+
"cid": "cids(2)",
|
|
65
85
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
66
86
|
"labels": Array [],
|
|
67
87
|
"likeCount": 0,
|
|
@@ -70,20 +90,22 @@ Array [
|
|
|
70
90
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
71
91
|
"reply": Object {
|
|
72
92
|
"parent": Object {
|
|
73
|
-
"cid": "cids(
|
|
74
|
-
"uri": "record(
|
|
93
|
+
"cid": "cids(4)",
|
|
94
|
+
"uri": "record(5)",
|
|
75
95
|
},
|
|
76
96
|
"root": Object {
|
|
77
|
-
"cid": "cids(
|
|
78
|
-
"uri": "record(
|
|
97
|
+
"cid": "cids(3)",
|
|
98
|
+
"uri": "record(4)",
|
|
79
99
|
},
|
|
80
100
|
},
|
|
81
101
|
"text": "thanks bob",
|
|
82
102
|
},
|
|
83
103
|
"replyCount": 0,
|
|
84
104
|
"repostCount": 1,
|
|
85
|
-
"uri": "record(
|
|
86
|
-
"viewer": Object {
|
|
105
|
+
"uri": "record(3)",
|
|
106
|
+
"viewer": Object {
|
|
107
|
+
"threadMuted": false,
|
|
108
|
+
},
|
|
87
109
|
},
|
|
88
110
|
"reply": Object {
|
|
89
111
|
"grandparentAuthor": Object {
|
|
@@ -98,19 +120,19 @@ Array [
|
|
|
98
120
|
"parent": Object {
|
|
99
121
|
"$type": "app.bsky.feed.defs#postView",
|
|
100
122
|
"author": Object {
|
|
101
|
-
"avatar": "https://bsky.public.url/img/avatar/plain/user(2)/cids(
|
|
123
|
+
"avatar": "https://bsky.public.url/img/avatar/plain/user(2)/cids(0)@jpeg",
|
|
102
124
|
"did": "user(1)",
|
|
103
125
|
"displayName": "bobby",
|
|
104
126
|
"handle": "bob.test",
|
|
105
127
|
"labels": Array [],
|
|
106
128
|
"viewer": Object {
|
|
107
129
|
"blockedBy": false,
|
|
108
|
-
"followedBy": "record(
|
|
109
|
-
"following": "record(
|
|
130
|
+
"followedBy": "record(1)",
|
|
131
|
+
"following": "record(0)",
|
|
110
132
|
"muted": false,
|
|
111
133
|
},
|
|
112
134
|
},
|
|
113
|
-
"cid": "cids(
|
|
135
|
+
"cid": "cids(4)",
|
|
114
136
|
"embed": Object {
|
|
115
137
|
"$type": "app.bsky.embed.images#view",
|
|
116
138
|
"images": Array [
|
|
@@ -124,17 +146,17 @@ Array [
|
|
|
124
146
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
125
147
|
"labels": Array [
|
|
126
148
|
Object {
|
|
127
|
-
"cid": "cids(
|
|
149
|
+
"cid": "cids(4)",
|
|
128
150
|
"cts": "1970-01-01T00:00:00.000Z",
|
|
129
151
|
"src": "did:example:labeler",
|
|
130
|
-
"uri": "record(
|
|
152
|
+
"uri": "record(5)",
|
|
131
153
|
"val": "test-label",
|
|
132
154
|
},
|
|
133
155
|
Object {
|
|
134
|
-
"cid": "cids(
|
|
156
|
+
"cid": "cids(4)",
|
|
135
157
|
"cts": "1970-01-01T00:00:00.000Z",
|
|
136
158
|
"src": "did:example:labeler",
|
|
137
|
-
"uri": "record(
|
|
159
|
+
"uri": "record(5)",
|
|
138
160
|
"val": "test-label-2",
|
|
139
161
|
},
|
|
140
162
|
],
|
|
@@ -160,20 +182,22 @@ Array [
|
|
|
160
182
|
},
|
|
161
183
|
"reply": Object {
|
|
162
184
|
"parent": Object {
|
|
163
|
-
"cid": "cids(
|
|
164
|
-
"uri": "record(
|
|
185
|
+
"cid": "cids(3)",
|
|
186
|
+
"uri": "record(4)",
|
|
165
187
|
},
|
|
166
188
|
"root": Object {
|
|
167
|
-
"cid": "cids(
|
|
168
|
-
"uri": "record(
|
|
189
|
+
"cid": "cids(3)",
|
|
190
|
+
"uri": "record(4)",
|
|
169
191
|
},
|
|
170
192
|
},
|
|
171
193
|
"text": "hear that label_me label_me_2",
|
|
172
194
|
},
|
|
173
195
|
"replyCount": 1,
|
|
174
196
|
"repostCount": 0,
|
|
175
|
-
"uri": "record(
|
|
176
|
-
"viewer": Object {
|
|
197
|
+
"uri": "record(5)",
|
|
198
|
+
"viewer": Object {
|
|
199
|
+
"threadMuted": false,
|
|
200
|
+
},
|
|
177
201
|
},
|
|
178
202
|
"root": Object {
|
|
179
203
|
"$type": "app.bsky.feed.defs#postView",
|
|
@@ -186,7 +210,7 @@ Array [
|
|
|
186
210
|
"muted": false,
|
|
187
211
|
},
|
|
188
212
|
},
|
|
189
|
-
"cid": "cids(
|
|
213
|
+
"cid": "cids(3)",
|
|
190
214
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
191
215
|
"labels": Array [],
|
|
192
216
|
"likeCount": 3,
|
|
@@ -197,8 +221,10 @@ Array [
|
|
|
197
221
|
},
|
|
198
222
|
"replyCount": 2,
|
|
199
223
|
"repostCount": 1,
|
|
200
|
-
"uri": "record(
|
|
201
|
-
"viewer": Object {
|
|
224
|
+
"uri": "record(4)",
|
|
225
|
+
"viewer": Object {
|
|
226
|
+
"threadMuted": false,
|
|
227
|
+
},
|
|
202
228
|
},
|
|
203
229
|
},
|
|
204
230
|
},
|
|
@@ -360,7 +386,9 @@ Array [
|
|
|
360
386
|
"replyCount": 0,
|
|
361
387
|
"repostCount": 0,
|
|
362
388
|
"uri": "record(6)",
|
|
363
|
-
"viewer": Object {
|
|
389
|
+
"viewer": Object {
|
|
390
|
+
"threadMuted": false,
|
|
391
|
+
},
|
|
364
392
|
},
|
|
365
393
|
},
|
|
366
394
|
Object {
|
|
@@ -374,7 +402,7 @@ Array [
|
|
|
374
402
|
"muted": false,
|
|
375
403
|
},
|
|
376
404
|
},
|
|
377
|
-
"cid": "cids(
|
|
405
|
+
"cid": "cids(3)",
|
|
378
406
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
379
407
|
"labels": Array [],
|
|
380
408
|
"likeCount": 3,
|
|
@@ -385,8 +413,10 @@ Array [
|
|
|
385
413
|
},
|
|
386
414
|
"replyCount": 2,
|
|
387
415
|
"repostCount": 1,
|
|
388
|
-
"uri": "record(
|
|
389
|
-
"viewer": Object {
|
|
416
|
+
"uri": "record(4)",
|
|
417
|
+
"viewer": Object {
|
|
418
|
+
"threadMuted": false,
|
|
419
|
+
},
|
|
390
420
|
},
|
|
391
421
|
},
|
|
392
422
|
Object {
|
|
@@ -428,7 +458,9 @@ Array [
|
|
|
428
458
|
"replyCount": 0,
|
|
429
459
|
"repostCount": 0,
|
|
430
460
|
"uri": "record(12)",
|
|
431
|
-
"viewer": Object {
|
|
461
|
+
"viewer": Object {
|
|
462
|
+
"threadMuted": false,
|
|
463
|
+
},
|
|
432
464
|
},
|
|
433
465
|
},
|
|
434
466
|
],
|
|
@@ -452,7 +484,7 @@ Array [
|
|
|
452
484
|
},
|
|
453
485
|
},
|
|
454
486
|
Object {
|
|
455
|
-
"avatar": "https://bsky.public.url/img/avatar/plain/user(2)/cids(
|
|
487
|
+
"avatar": "https://bsky.public.url/img/avatar/plain/user(2)/cids(0)@jpeg",
|
|
456
488
|
"description": "hi im bob label_me",
|
|
457
489
|
"did": "user(1)",
|
|
458
490
|
"displayName": "bobby",
|
|
@@ -461,8 +493,8 @@ Array [
|
|
|
461
493
|
"labels": Array [],
|
|
462
494
|
"viewer": Object {
|
|
463
495
|
"blockedBy": false,
|
|
464
|
-
"followedBy": "record(
|
|
465
|
-
"following": "record(
|
|
496
|
+
"followedBy": "record(1)",
|
|
497
|
+
"following": "record(0)",
|
|
466
498
|
"muted": false,
|
|
467
499
|
},
|
|
468
500
|
},
|
|
@@ -539,7 +571,9 @@ Object {
|
|
|
539
571
|
"replyCount": 0,
|
|
540
572
|
"repostCount": 0,
|
|
541
573
|
"uri": "record(0)",
|
|
542
|
-
"viewer": Object {
|
|
574
|
+
"viewer": Object {
|
|
575
|
+
"threadMuted": false,
|
|
576
|
+
},
|
|
543
577
|
},
|
|
544
578
|
"replies": Array [],
|
|
545
579
|
},
|
|
@@ -603,7 +637,9 @@ Object {
|
|
|
603
637
|
"replyCount": 0,
|
|
604
638
|
"repostCount": 0,
|
|
605
639
|
"uri": "record(0)",
|
|
606
|
-
"viewer": Object {
|
|
640
|
+
"viewer": Object {
|
|
641
|
+
"threadMuted": false,
|
|
642
|
+
},
|
|
607
643
|
},
|
|
608
644
|
"replies": Array [],
|
|
609
645
|
},
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { RecordRef, SeedClient, TestNetwork, usersSeed } from '@atproto/dev-env'
|
|
2
|
+
import AtpAgent from '@atproto/api'
|
|
3
|
+
|
|
4
|
+
describe('thread mutes', () => {
|
|
5
|
+
let network: TestNetwork
|
|
6
|
+
let agent: AtpAgent
|
|
7
|
+
let sc: SeedClient
|
|
8
|
+
|
|
9
|
+
let alice: string
|
|
10
|
+
let bob: string
|
|
11
|
+
|
|
12
|
+
let rootPost: RecordRef
|
|
13
|
+
let replyPost: RecordRef
|
|
14
|
+
|
|
15
|
+
beforeAll(async () => {
|
|
16
|
+
network = await TestNetwork.create({
|
|
17
|
+
dbPostgresSchema: 'bsky_thread_mutes',
|
|
18
|
+
})
|
|
19
|
+
sc = network.getSeedClient()
|
|
20
|
+
agent = network.bsky.getClient()
|
|
21
|
+
await usersSeed(sc)
|
|
22
|
+
alice = sc.dids.alice
|
|
23
|
+
bob = sc.dids.bob
|
|
24
|
+
rootPost = (await sc.post(alice, 'root post')).ref
|
|
25
|
+
replyPost = (await sc.reply(alice, rootPost, rootPost, 'first reply')).ref
|
|
26
|
+
await network.processAll()
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
afterAll(async () => {
|
|
30
|
+
await network.close()
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('mutes threads', async () => {
|
|
34
|
+
await agent.api.app.bsky.graph.muteThread(
|
|
35
|
+
{ root: rootPost.uriStr },
|
|
36
|
+
{
|
|
37
|
+
encoding: 'application/json',
|
|
38
|
+
headers: await network.serviceHeaders(alice),
|
|
39
|
+
},
|
|
40
|
+
)
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it('notes that threads are muted in viewer state', async () => {
|
|
44
|
+
const res = await agent.api.app.bsky.feed.getPosts(
|
|
45
|
+
{
|
|
46
|
+
uris: [rootPost.uriStr, replyPost.uriStr],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
headers: await network.serviceHeaders(alice),
|
|
50
|
+
},
|
|
51
|
+
)
|
|
52
|
+
expect(res.data.posts[0].viewer?.threadMuted).toBe(true)
|
|
53
|
+
expect(res.data.posts[1].viewer?.threadMuted).toBe(true)
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it('prevents notifs from replies', async () => {
|
|
57
|
+
await sc.reply(bob, rootPost, rootPost, 'reply')
|
|
58
|
+
await sc.reply(bob, rootPost, replyPost, 'reply')
|
|
59
|
+
await network.processAll()
|
|
60
|
+
|
|
61
|
+
const notifsRes = await agent.api.app.bsky.notification.listNotifications(
|
|
62
|
+
{},
|
|
63
|
+
{ headers: await network.serviceHeaders(alice) },
|
|
64
|
+
)
|
|
65
|
+
expect(notifsRes.data.notifications.length).toBe(0)
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it('prevents notifs from quote posts', async () => {
|
|
69
|
+
await sc.post(bob, 'quote', undefined, undefined, rootPost)
|
|
70
|
+
await sc.post(bob, 'quote', undefined, undefined, replyPost)
|
|
71
|
+
await network.processAll()
|
|
72
|
+
|
|
73
|
+
const notifsRes = await agent.api.app.bsky.notification.listNotifications(
|
|
74
|
+
{},
|
|
75
|
+
{ headers: await network.serviceHeaders(alice) },
|
|
76
|
+
)
|
|
77
|
+
expect(notifsRes.data.notifications.length).toBe(0)
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
it('prevents notifs from likes', async () => {
|
|
81
|
+
await sc.like(bob, rootPost)
|
|
82
|
+
await sc.like(bob, replyPost)
|
|
83
|
+
await network.processAll()
|
|
84
|
+
|
|
85
|
+
const notifsRes = await agent.api.app.bsky.notification.listNotifications(
|
|
86
|
+
{},
|
|
87
|
+
{ headers: await network.serviceHeaders(alice) },
|
|
88
|
+
)
|
|
89
|
+
expect(notifsRes.data.notifications.length).toBe(0)
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
it('prevents notifs from reposts', async () => {
|
|
93
|
+
await sc.repost(bob, rootPost)
|
|
94
|
+
await sc.repost(bob, replyPost)
|
|
95
|
+
await network.processAll()
|
|
96
|
+
|
|
97
|
+
const notifsRes = await agent.api.app.bsky.notification.listNotifications(
|
|
98
|
+
{},
|
|
99
|
+
{ headers: await network.serviceHeaders(alice) },
|
|
100
|
+
)
|
|
101
|
+
expect(notifsRes.data.notifications.length).toBe(0)
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
it('unmutes threads', async () => {
|
|
105
|
+
await agent.api.app.bsky.graph.unmuteThread(
|
|
106
|
+
{ root: rootPost.uriStr },
|
|
107
|
+
{
|
|
108
|
+
encoding: 'application/json',
|
|
109
|
+
headers: await network.serviceHeaders(alice),
|
|
110
|
+
},
|
|
111
|
+
)
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
it('no longer notes that threads are muted in viewer state after unmuting', async () => {
|
|
115
|
+
const res = await agent.api.app.bsky.feed.getPosts(
|
|
116
|
+
{
|
|
117
|
+
uris: [rootPost.uriStr, replyPost.uriStr],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
headers: await network.serviceHeaders(alice),
|
|
121
|
+
},
|
|
122
|
+
)
|
|
123
|
+
expect(res.data.posts[0].viewer?.threadMuted).toBe(false)
|
|
124
|
+
expect(res.data.posts[1].viewer?.threadMuted).toBe(false)
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it('sends notifications after unmuting', async () => {
|
|
128
|
+
await sc.reply(bob, rootPost, rootPost, 'new reply')
|
|
129
|
+
await sc.reply(bob, rootPost, replyPost, 'new reply')
|
|
130
|
+
await sc.like(bob, rootPost)
|
|
131
|
+
await sc.repost(bob, replyPost)
|
|
132
|
+
await network.processAll()
|
|
133
|
+
|
|
134
|
+
const notifsRes = await agent.api.app.bsky.notification.listNotifications(
|
|
135
|
+
{},
|
|
136
|
+
{ headers: await network.serviceHeaders(alice) },
|
|
137
|
+
)
|
|
138
|
+
expect(notifsRes.data.notifications.length).toBe(4)
|
|
139
|
+
})
|
|
140
|
+
})
|
|
@@ -4,7 +4,6 @@ import axios from 'axios'
|
|
|
4
4
|
|
|
5
5
|
describe('label hydration', () => {
|
|
6
6
|
let network: TestNetwork
|
|
7
|
-
let agent: AtpAgent
|
|
8
7
|
let pdsAgent: AtpAgent
|
|
9
8
|
let sc: SeedClient
|
|
10
9
|
|
|
@@ -17,7 +16,6 @@ describe('label hydration', () => {
|
|
|
17
16
|
network = await TestNetwork.create({
|
|
18
17
|
dbPostgresSchema: 'bsky_label_hydration',
|
|
19
18
|
})
|
|
20
|
-
agent = network.bsky.getClient()
|
|
21
19
|
pdsAgent = network.pds.getClient()
|
|
22
20
|
sc = network.getSeedClient()
|
|
23
21
|
await basicSeed(sc)
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { AtpAgent } from '@atproto/api'
|
|
2
2
|
import { TestNetwork, SeedClient, basicSeed } from '@atproto/dev-env'
|
|
3
|
-
import axios from 'axios'
|
|
4
3
|
|
|
5
4
|
describe('label hydration', () => {
|
|
6
5
|
let network: TestNetwork
|
|
7
|
-
let agent: AtpAgent
|
|
8
6
|
let pdsAgent: AtpAgent
|
|
9
7
|
let sc: SeedClient
|
|
10
8
|
|
|
@@ -17,7 +15,6 @@ describe('label hydration', () => {
|
|
|
17
15
|
network = await TestNetwork.create({
|
|
18
16
|
dbPostgresSchema: 'bsky_label_hydration',
|
|
19
17
|
})
|
|
20
|
-
agent = network.bsky.getClient()
|
|
21
18
|
pdsAgent = network.pds.getClient()
|
|
22
19
|
sc = network.getSeedClient()
|
|
23
20
|
await basicSeed(sc)
|