@atproto/bsky 0.0.52 → 0.0.53
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 +7 -0
- package/dist/api/app/bsky/feed/getPostThread.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getPostThread.js +13 -3
- package/dist/api/app/bsky/feed/getPostThread.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +9 -4
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +12 -7
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/chat/bsky/convo/defs.d.ts +4 -4
- package/dist/lexicon/types/chat/bsky/convo/defs.d.ts.map +1 -1
- package/dist/lexicon/types/chat/bsky/convo/defs.js +7 -7
- package/dist/lexicon/types/chat/bsky/convo/defs.js.map +1 -1
- package/dist/lexicon/types/chat/bsky/convo/sendMessage.d.ts +1 -1
- package/dist/lexicon/types/chat/bsky/convo/sendMessage.d.ts.map +1 -1
- package/dist/lexicon/types/chat/bsky/convo/sendMessageBatch.d.ts +1 -1
- package/dist/lexicon/types/chat/bsky/convo/sendMessageBatch.d.ts.map +1 -1
- package/dist/lexicon/types/chat/bsky/moderation/getMessageContext.d.ts +2 -0
- package/dist/lexicon/types/chat/bsky/moderation/getMessageContext.d.ts.map +1 -1
- package/dist/views/index.d.ts +1 -1
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +6 -2
- package/dist/views/index.js.map +1 -1
- package/package.json +4 -4
- package/src/api/app/bsky/feed/getPostThread.ts +13 -3
- package/src/lexicon/lexicons.ts +13 -7
- package/src/lexicon/types/chat/bsky/convo/defs.ts +6 -6
- package/src/lexicon/types/chat/bsky/convo/sendMessage.ts +1 -1
- package/src/lexicon/types/chat/bsky/convo/sendMessageBatch.ts +1 -1
- package/src/lexicon/types/chat/bsky/moderation/getMessageContext.ts +2 -0
- package/src/views/index.ts +7 -2
- package/tests/views/__snapshots__/thread.test.ts.snap +177 -11
- package/tests/views/thread.test.ts +15 -0
|
@@ -594,6 +594,177 @@ Object {
|
|
|
594
594
|
}
|
|
595
595
|
`;
|
|
596
596
|
|
|
597
|
+
exports[`pds thread views fetches thread with handle in uri 1`] = `
|
|
598
|
+
Object {
|
|
599
|
+
"$type": "app.bsky.feed.defs#threadViewPost",
|
|
600
|
+
"post": Object {
|
|
601
|
+
"author": Object {
|
|
602
|
+
"avatar": "https://bsky.public.url/img/avatar/plain/user(1)/cids(1)@jpeg",
|
|
603
|
+
"did": "user(0)",
|
|
604
|
+
"displayName": "ali",
|
|
605
|
+
"handle": "alice.test",
|
|
606
|
+
"labels": Array [
|
|
607
|
+
Object {
|
|
608
|
+
"cid": "cids(2)",
|
|
609
|
+
"cts": "1970-01-01T00:00:00.000Z",
|
|
610
|
+
"src": "user(0)",
|
|
611
|
+
"uri": "record(3)",
|
|
612
|
+
"val": "self-label-a",
|
|
613
|
+
},
|
|
614
|
+
Object {
|
|
615
|
+
"cid": "cids(2)",
|
|
616
|
+
"cts": "1970-01-01T00:00:00.000Z",
|
|
617
|
+
"src": "user(0)",
|
|
618
|
+
"uri": "record(3)",
|
|
619
|
+
"val": "self-label-b",
|
|
620
|
+
},
|
|
621
|
+
],
|
|
622
|
+
"viewer": Object {
|
|
623
|
+
"blockedBy": false,
|
|
624
|
+
"followedBy": "record(2)",
|
|
625
|
+
"following": "record(1)",
|
|
626
|
+
"muted": false,
|
|
627
|
+
},
|
|
628
|
+
},
|
|
629
|
+
"cid": "cids(0)",
|
|
630
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
631
|
+
"labels": Array [],
|
|
632
|
+
"likeCount": 3,
|
|
633
|
+
"record": Object {
|
|
634
|
+
"$type": "app.bsky.feed.post",
|
|
635
|
+
"createdAt": "1970-01-01T00:00:00.000000Z",
|
|
636
|
+
"text": "again",
|
|
637
|
+
},
|
|
638
|
+
"replyCount": 2,
|
|
639
|
+
"repostCount": 1,
|
|
640
|
+
"uri": "record(0)",
|
|
641
|
+
"viewer": Object {
|
|
642
|
+
"like": "record(4)",
|
|
643
|
+
},
|
|
644
|
+
},
|
|
645
|
+
"replies": Array [
|
|
646
|
+
Object {
|
|
647
|
+
"$type": "app.bsky.feed.defs#threadViewPost",
|
|
648
|
+
"post": Object {
|
|
649
|
+
"author": Object {
|
|
650
|
+
"did": "user(2)",
|
|
651
|
+
"handle": "carol.test",
|
|
652
|
+
"labels": Array [],
|
|
653
|
+
"viewer": Object {
|
|
654
|
+
"blockedBy": false,
|
|
655
|
+
"following": "record(6)",
|
|
656
|
+
"muted": false,
|
|
657
|
+
},
|
|
658
|
+
},
|
|
659
|
+
"cid": "cids(3)",
|
|
660
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
661
|
+
"labels": Array [],
|
|
662
|
+
"likeCount": 0,
|
|
663
|
+
"record": Object {
|
|
664
|
+
"$type": "app.bsky.feed.post",
|
|
665
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
666
|
+
"reply": Object {
|
|
667
|
+
"parent": Object {
|
|
668
|
+
"cid": "cids(0)",
|
|
669
|
+
"uri": "record(0)",
|
|
670
|
+
},
|
|
671
|
+
"root": Object {
|
|
672
|
+
"cid": "cids(0)",
|
|
673
|
+
"uri": "record(0)",
|
|
674
|
+
},
|
|
675
|
+
},
|
|
676
|
+
"text": "of course",
|
|
677
|
+
},
|
|
678
|
+
"replyCount": 0,
|
|
679
|
+
"repostCount": 0,
|
|
680
|
+
"uri": "record(5)",
|
|
681
|
+
"viewer": Object {},
|
|
682
|
+
},
|
|
683
|
+
},
|
|
684
|
+
Object {
|
|
685
|
+
"$type": "app.bsky.feed.defs#threadViewPost",
|
|
686
|
+
"post": Object {
|
|
687
|
+
"author": Object {
|
|
688
|
+
"avatar": "https://bsky.public.url/img/avatar/plain/user(4)/cids(1)@jpeg",
|
|
689
|
+
"did": "user(3)",
|
|
690
|
+
"displayName": "bobby",
|
|
691
|
+
"handle": "bob.test",
|
|
692
|
+
"labels": Array [],
|
|
693
|
+
"viewer": Object {
|
|
694
|
+
"blockedBy": false,
|
|
695
|
+
"muted": false,
|
|
696
|
+
},
|
|
697
|
+
},
|
|
698
|
+
"cid": "cids(4)",
|
|
699
|
+
"embed": Object {
|
|
700
|
+
"$type": "app.bsky.embed.images#view",
|
|
701
|
+
"images": Array [
|
|
702
|
+
Object {
|
|
703
|
+
"alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
|
|
704
|
+
"fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(4)/cids(5)@jpeg",
|
|
705
|
+
"thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(4)/cids(5)@jpeg",
|
|
706
|
+
},
|
|
707
|
+
],
|
|
708
|
+
},
|
|
709
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
710
|
+
"labels": Array [
|
|
711
|
+
Object {
|
|
712
|
+
"cid": "cids(4)",
|
|
713
|
+
"cts": "1970-01-01T00:00:00.000Z",
|
|
714
|
+
"src": "did:example:labeler",
|
|
715
|
+
"uri": "record(7)",
|
|
716
|
+
"val": "test-label",
|
|
717
|
+
},
|
|
718
|
+
Object {
|
|
719
|
+
"cid": "cids(4)",
|
|
720
|
+
"cts": "1970-01-01T00:00:00.000Z",
|
|
721
|
+
"src": "did:example:labeler",
|
|
722
|
+
"uri": "record(7)",
|
|
723
|
+
"val": "test-label-2",
|
|
724
|
+
},
|
|
725
|
+
],
|
|
726
|
+
"likeCount": 0,
|
|
727
|
+
"record": Object {
|
|
728
|
+
"$type": "app.bsky.feed.post",
|
|
729
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
730
|
+
"embed": Object {
|
|
731
|
+
"$type": "app.bsky.embed.images",
|
|
732
|
+
"images": Array [
|
|
733
|
+
Object {
|
|
734
|
+
"alt": "../dev-env/src/seed/img/key-landscape-small.jpg",
|
|
735
|
+
"image": Object {
|
|
736
|
+
"$type": "blob",
|
|
737
|
+
"mimeType": "image/jpeg",
|
|
738
|
+
"ref": Object {
|
|
739
|
+
"$link": "cids(5)",
|
|
740
|
+
},
|
|
741
|
+
"size": 4114,
|
|
742
|
+
},
|
|
743
|
+
},
|
|
744
|
+
],
|
|
745
|
+
},
|
|
746
|
+
"reply": Object {
|
|
747
|
+
"parent": Object {
|
|
748
|
+
"cid": "cids(0)",
|
|
749
|
+
"uri": "record(0)",
|
|
750
|
+
},
|
|
751
|
+
"root": Object {
|
|
752
|
+
"cid": "cids(0)",
|
|
753
|
+
"uri": "record(0)",
|
|
754
|
+
},
|
|
755
|
+
},
|
|
756
|
+
"text": "hear that label_me label_me_2",
|
|
757
|
+
},
|
|
758
|
+
"replyCount": 1,
|
|
759
|
+
"repostCount": 0,
|
|
760
|
+
"uri": "record(7)",
|
|
761
|
+
"viewer": Object {},
|
|
762
|
+
},
|
|
763
|
+
},
|
|
764
|
+
],
|
|
765
|
+
}
|
|
766
|
+
`;
|
|
767
|
+
|
|
597
768
|
exports[`pds thread views handles deleted posts correctly 1`] = `
|
|
598
769
|
Object {
|
|
599
770
|
"$type": "app.bsky.feed.defs#threadViewPost",
|
|
@@ -1041,11 +1212,6 @@ Object {
|
|
|
1041
1212
|
},
|
|
1042
1213
|
},
|
|
1043
1214
|
"replies": Array [
|
|
1044
|
-
Object {
|
|
1045
|
-
"$type": "app.bsky.feed.defs#notFoundPost",
|
|
1046
|
-
"notFound": true,
|
|
1047
|
-
"uri": "record(5)",
|
|
1048
|
-
},
|
|
1049
1215
|
Object {
|
|
1050
1216
|
"$type": "app.bsky.feed.defs#threadViewPost",
|
|
1051
1217
|
"post": Object {
|
|
@@ -1077,14 +1243,14 @@ Object {
|
|
|
1077
1243
|
"cid": "cids(3)",
|
|
1078
1244
|
"cts": "1970-01-01T00:00:00.000Z",
|
|
1079
1245
|
"src": "did:example:labeler",
|
|
1080
|
-
"uri": "record(
|
|
1246
|
+
"uri": "record(5)",
|
|
1081
1247
|
"val": "test-label",
|
|
1082
1248
|
},
|
|
1083
1249
|
Object {
|
|
1084
1250
|
"cid": "cids(3)",
|
|
1085
1251
|
"cts": "1970-01-01T00:00:00.000Z",
|
|
1086
1252
|
"src": "did:example:labeler",
|
|
1087
|
-
"uri": "record(
|
|
1253
|
+
"uri": "record(5)",
|
|
1088
1254
|
"val": "test-label-2",
|
|
1089
1255
|
},
|
|
1090
1256
|
],
|
|
@@ -1122,7 +1288,7 @@ Object {
|
|
|
1122
1288
|
},
|
|
1123
1289
|
"replyCount": 1,
|
|
1124
1290
|
"repostCount": 0,
|
|
1125
|
-
"uri": "record(
|
|
1291
|
+
"uri": "record(5)",
|
|
1126
1292
|
"viewer": Object {},
|
|
1127
1293
|
},
|
|
1128
1294
|
"replies": Array [
|
|
@@ -1167,7 +1333,7 @@ Object {
|
|
|
1167
1333
|
"reply": Object {
|
|
1168
1334
|
"parent": Object {
|
|
1169
1335
|
"cid": "cids(3)",
|
|
1170
|
-
"uri": "record(
|
|
1336
|
+
"uri": "record(5)",
|
|
1171
1337
|
},
|
|
1172
1338
|
"root": Object {
|
|
1173
1339
|
"cid": "cids(0)",
|
|
@@ -1178,9 +1344,9 @@ Object {
|
|
|
1178
1344
|
},
|
|
1179
1345
|
"replyCount": 0,
|
|
1180
1346
|
"repostCount": 2,
|
|
1181
|
-
"uri": "record(
|
|
1347
|
+
"uri": "record(6)",
|
|
1182
1348
|
"viewer": Object {
|
|
1183
|
-
"repost": "record(
|
|
1349
|
+
"repost": "record(7)",
|
|
1184
1350
|
},
|
|
1185
1351
|
},
|
|
1186
1352
|
"replies": Array [],
|
|
@@ -56,6 +56,21 @@ describe('pds thread views', () => {
|
|
|
56
56
|
expect(forSnapshot(thread.data.thread)).toMatchSnapshot()
|
|
57
57
|
})
|
|
58
58
|
|
|
59
|
+
it('fetches thread with handle in uri', async () => {
|
|
60
|
+
const thread = await agent.api.app.bsky.feed.getPostThread(
|
|
61
|
+
{
|
|
62
|
+
depth: 1,
|
|
63
|
+
uri: sc.posts[alice][1].ref.uriStr.replace(
|
|
64
|
+
`at://${alice}`,
|
|
65
|
+
`at://${sc.accounts[alice].handle}`,
|
|
66
|
+
),
|
|
67
|
+
},
|
|
68
|
+
{ headers: await network.serviceHeaders(bob) },
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
expect(forSnapshot(thread.data.thread)).toMatchSnapshot()
|
|
72
|
+
})
|
|
73
|
+
|
|
59
74
|
it('fetches ancestors', async () => {
|
|
60
75
|
const thread = await agent.api.app.bsky.feed.getPostThread(
|
|
61
76
|
{ depth: 1, uri: sc.replies[alice][0].ref.uriStr },
|