@atproto/bsky 0.0.150 → 0.0.152
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 +16 -0
- package/dist/api/app/bsky/unspecced/getPostThreadHiddenV2.d.ts +4 -0
- package/dist/api/app/bsky/unspecced/getPostThreadHiddenV2.d.ts.map +1 -0
- package/dist/api/app/bsky/unspecced/getPostThreadHiddenV2.js +76 -0
- package/dist/api/app/bsky/unspecced/getPostThreadHiddenV2.js.map +1 -0
- package/dist/api/app/bsky/unspecced/getPostThreadV2.d.ts +4 -0
- package/dist/api/app/bsky/unspecced/getPostThreadV2.d.ts.map +1 -0
- package/dist/api/app/bsky/unspecced/getPostThreadV2.js +86 -0
- package/dist/api/app/bsky/unspecced/getPostThreadV2.js.map +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +4 -0
- package/dist/api/index.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -1
- package/dist/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.js +17 -0
- package/dist/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.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/like.d.ts +2 -0
- package/dist/data-plane/server/db/tables/like.d.ts.map +1 -1
- package/dist/data-plane/server/db/tables/repost.d.ts +2 -0
- package/dist/data-plane/server/db/tables/repost.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/like.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/like.js +32 -9
- package/dist/data-plane/server/indexing/plugins/like.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/repost.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/repost.js +32 -9
- package/dist/data-plane/server/indexing/plugins/repost.js.map +1 -1
- package/dist/hydration/feed.d.ts.map +1 -1
- package/dist/hydration/feed.js.map +1 -1
- package/dist/lexicon/index.d.ts +6 -2
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +12 -4
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +536 -88
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +279 -44
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts +2 -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/feed/like.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/feed/like.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/like.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/repost.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/feed/repost.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/repost.js.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.js.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.d.ts +61 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.js +25 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.js.map +1 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.d.ts +92 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.js +52 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.js.map +1 -0
- package/dist/views/index.d.ts +36 -1
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +468 -2
- package/dist/views/index.js.map +1 -1
- package/dist/views/threads-v2.d.ts +62 -0
- package/dist/views/threads-v2.d.ts.map +1 -0
- package/dist/views/threads-v2.js +180 -0
- package/dist/views/threads-v2.js.map +1 -0
- package/package.json +4 -4
- package/src/api/app/bsky/unspecced/getPostThreadHiddenV2.ts +116 -0
- package/src/api/app/bsky/unspecced/getPostThreadV2.ts +130 -0
- package/src/api/index.ts +4 -0
- package/src/config.ts +9 -0
- package/src/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.ts +17 -0
- package/src/data-plane/server/db/migrations/index.ts +1 -0
- package/src/data-plane/server/db/tables/like.ts +2 -0
- package/src/data-plane/server/db/tables/repost.ts +2 -0
- package/src/data-plane/server/indexing/plugins/like.ts +39 -9
- package/src/data-plane/server/indexing/plugins/repost.ts +38 -9
- package/src/hydration/feed.ts +1 -0
- package/src/lexicon/index.ts +33 -9
- package/src/lexicon/lexicons.ts +298 -45
- package/src/lexicon/types/app/bsky/feed/defs.ts +2 -0
- package/src/lexicon/types/app/bsky/feed/like.ts +1 -0
- package/src/lexicon/types/app/bsky/feed/repost.ts +1 -0
- package/src/lexicon/types/app/bsky/notification/listNotifications.ts +3 -1
- package/src/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.ts +93 -0
- package/src/lexicon/types/app/bsky/unspecced/getPostThreadV2.ts +160 -0
- package/src/views/index.ts +747 -2
- package/src/views/threads-v2.ts +351 -0
- package/tests/__snapshots__/feed-generation.test.ts.snap +2 -0
- package/tests/seed/thread-v2.ts +775 -0
- package/tests/seed/util.ts +52 -0
- package/tests/views/__snapshots__/author-feed.test.ts.snap +30 -24
- package/tests/views/__snapshots__/notifications.test.ts.snap +1164 -229
- package/tests/views/__snapshots__/thread-v2.test.ts.snap +1091 -0
- package/tests/views/__snapshots__/timeline.test.ts.snap +398 -376
- package/tests/views/notifications.test.ts +177 -0
- package/tests/views/thread-v2.test.ts +2009 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.tests.tsbuildinfo +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { SeedClient, TestNetwork, TestNetworkNoAppView } from '@atproto/dev-env'
|
|
2
|
+
|
|
3
|
+
export type User = {
|
|
4
|
+
id: string
|
|
5
|
+
did: string
|
|
6
|
+
email: string
|
|
7
|
+
handle: string
|
|
8
|
+
password: string
|
|
9
|
+
displayName: string
|
|
10
|
+
description: string
|
|
11
|
+
selfLabels: undefined
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function createUserStub(name: string): User {
|
|
15
|
+
return {
|
|
16
|
+
id: name,
|
|
17
|
+
// @ts-ignore overwritten during seeding
|
|
18
|
+
did: undefined,
|
|
19
|
+
email: `${name}@test.com`,
|
|
20
|
+
handle: `${name}.test`,
|
|
21
|
+
password: `${name}-pass`,
|
|
22
|
+
displayName: name,
|
|
23
|
+
description: `hi im ${name} label_me`,
|
|
24
|
+
selfLabels: undefined,
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function createUsers<T extends readonly string[]>(
|
|
29
|
+
seedClient: SeedClient<TestNetwork | TestNetworkNoAppView>,
|
|
30
|
+
prefix: string,
|
|
31
|
+
handles: T,
|
|
32
|
+
) {
|
|
33
|
+
const stubs = handles.reduce((acc, handle) => {
|
|
34
|
+
acc[handle] = createUserStub(`${prefix}-${handle}`)
|
|
35
|
+
return acc
|
|
36
|
+
}, {}) as Record<(typeof handles)[number], User>
|
|
37
|
+
const users = await Promise.all(
|
|
38
|
+
handles
|
|
39
|
+
.map((h) => prefix + '-' + h)
|
|
40
|
+
.map(async (handle) => {
|
|
41
|
+
const user = createUserStub(handle)
|
|
42
|
+
await seedClient.createAccount(handle, user)
|
|
43
|
+
user.did = seedClient.dids[handle]
|
|
44
|
+
return user
|
|
45
|
+
}),
|
|
46
|
+
)
|
|
47
|
+
return users.reduce((acc, user) => {
|
|
48
|
+
const id = user.id.split('-')[1]
|
|
49
|
+
acc[id].did = user.did
|
|
50
|
+
return acc
|
|
51
|
+
}, stubs)
|
|
52
|
+
}
|
|
@@ -971,7 +971,9 @@ Array [
|
|
|
971
971
|
"muted": false,
|
|
972
972
|
},
|
|
973
973
|
},
|
|
974
|
+
"cid": "cids(6)",
|
|
974
975
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
976
|
+
"uri": "record(4)",
|
|
975
977
|
},
|
|
976
978
|
},
|
|
977
979
|
Object {
|
|
@@ -985,7 +987,7 @@ Array [
|
|
|
985
987
|
"muted": false,
|
|
986
988
|
},
|
|
987
989
|
},
|
|
988
|
-
"cid": "cids(
|
|
990
|
+
"cid": "cids(7)",
|
|
989
991
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
990
992
|
"labels": Array [],
|
|
991
993
|
"likeCount": 0,
|
|
@@ -995,11 +997,11 @@ Array [
|
|
|
995
997
|
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
996
998
|
"reply": Object {
|
|
997
999
|
"parent": Object {
|
|
998
|
-
"cid": "cids(
|
|
1000
|
+
"cid": "cids(8)",
|
|
999
1001
|
"uri": "record(6)",
|
|
1000
1002
|
},
|
|
1001
1003
|
"root": Object {
|
|
1002
|
-
"cid": "cids(
|
|
1004
|
+
"cid": "cids(8)",
|
|
1003
1005
|
"uri": "record(6)",
|
|
1004
1006
|
},
|
|
1005
1007
|
},
|
|
@@ -1024,14 +1026,14 @@ Array [
|
|
|
1024
1026
|
"handle": "alice.test",
|
|
1025
1027
|
"labels": Array [
|
|
1026
1028
|
Object {
|
|
1027
|
-
"cid": "cids(
|
|
1029
|
+
"cid": "cids(9)",
|
|
1028
1030
|
"cts": "1970-01-01T00:00:00.000Z",
|
|
1029
1031
|
"src": "user(1)",
|
|
1030
1032
|
"uri": "record(9)",
|
|
1031
1033
|
"val": "self-label-a",
|
|
1032
1034
|
},
|
|
1033
1035
|
Object {
|
|
1034
|
-
"cid": "cids(
|
|
1036
|
+
"cid": "cids(9)",
|
|
1035
1037
|
"cts": "1970-01-01T00:00:00.000Z",
|
|
1036
1038
|
"src": "user(1)",
|
|
1037
1039
|
"uri": "record(9)",
|
|
@@ -1045,7 +1047,7 @@ Array [
|
|
|
1045
1047
|
"muted": false,
|
|
1046
1048
|
},
|
|
1047
1049
|
},
|
|
1048
|
-
"cid": "cids(
|
|
1050
|
+
"cid": "cids(8)",
|
|
1049
1051
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
1050
1052
|
"labels": Array [],
|
|
1051
1053
|
"likeCount": 3,
|
|
@@ -1074,14 +1076,14 @@ Array [
|
|
|
1074
1076
|
"handle": "alice.test",
|
|
1075
1077
|
"labels": Array [
|
|
1076
1078
|
Object {
|
|
1077
|
-
"cid": "cids(
|
|
1079
|
+
"cid": "cids(9)",
|
|
1078
1080
|
"cts": "1970-01-01T00:00:00.000Z",
|
|
1079
1081
|
"src": "user(1)",
|
|
1080
1082
|
"uri": "record(9)",
|
|
1081
1083
|
"val": "self-label-a",
|
|
1082
1084
|
},
|
|
1083
1085
|
Object {
|
|
1084
|
-
"cid": "cids(
|
|
1086
|
+
"cid": "cids(9)",
|
|
1085
1087
|
"cts": "1970-01-01T00:00:00.000Z",
|
|
1086
1088
|
"src": "user(1)",
|
|
1087
1089
|
"uri": "record(9)",
|
|
@@ -1095,7 +1097,7 @@ Array [
|
|
|
1095
1097
|
"muted": false,
|
|
1096
1098
|
},
|
|
1097
1099
|
},
|
|
1098
|
-
"cid": "cids(
|
|
1100
|
+
"cid": "cids(8)",
|
|
1099
1101
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
1100
1102
|
"labels": Array [],
|
|
1101
1103
|
"likeCount": 3,
|
|
@@ -1316,7 +1318,9 @@ Array [
|
|
|
1316
1318
|
"muted": false,
|
|
1317
1319
|
},
|
|
1318
1320
|
},
|
|
1321
|
+
"cid": "cids(5)",
|
|
1319
1322
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
1323
|
+
"uri": "record(5)",
|
|
1320
1324
|
},
|
|
1321
1325
|
"reply": Object {
|
|
1322
1326
|
"grandparentAuthor": Object {
|
|
@@ -1368,8 +1372,8 @@ Array [
|
|
|
1368
1372
|
"images": Array [
|
|
1369
1373
|
Object {
|
|
1370
1374
|
"alt": "../dev-env/assets/key-landscape-small.jpg",
|
|
1371
|
-
"fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(4)/cids(
|
|
1372
|
-
"thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(4)/cids(
|
|
1375
|
+
"fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(4)/cids(6)@jpeg",
|
|
1376
|
+
"thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(4)/cids(6)@jpeg",
|
|
1373
1377
|
},
|
|
1374
1378
|
],
|
|
1375
1379
|
},
|
|
@@ -1404,7 +1408,7 @@ Array [
|
|
|
1404
1408
|
"$type": "blob",
|
|
1405
1409
|
"mimeType": "image/jpeg",
|
|
1406
1410
|
"ref": Object {
|
|
1407
|
-
"$link": "cids(
|
|
1411
|
+
"$link": "cids(6)",
|
|
1408
1412
|
},
|
|
1409
1413
|
"size": 4114,
|
|
1410
1414
|
},
|
|
@@ -1549,7 +1553,9 @@ Array [
|
|
|
1549
1553
|
"muted": false,
|
|
1550
1554
|
},
|
|
1551
1555
|
},
|
|
1556
|
+
"cid": "cids(7)",
|
|
1552
1557
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
1558
|
+
"uri": "record(6)",
|
|
1553
1559
|
},
|
|
1554
1560
|
},
|
|
1555
1561
|
Object {
|
|
@@ -1568,7 +1574,7 @@ Array [
|
|
|
1568
1574
|
"muted": false,
|
|
1569
1575
|
},
|
|
1570
1576
|
},
|
|
1571
|
-
"cid": "cids(
|
|
1577
|
+
"cid": "cids(8)",
|
|
1572
1578
|
"embed": Object {
|
|
1573
1579
|
"$type": "app.bsky.embed.record#view",
|
|
1574
1580
|
"record": Object {
|
|
@@ -1582,7 +1588,7 @@ Array [
|
|
|
1582
1588
|
"muted": false,
|
|
1583
1589
|
},
|
|
1584
1590
|
},
|
|
1585
|
-
"cid": "cids(
|
|
1591
|
+
"cid": "cids(9)",
|
|
1586
1592
|
"embeds": Array [
|
|
1587
1593
|
Object {
|
|
1588
1594
|
"$type": "app.bsky.embed.recordWithMedia#view",
|
|
@@ -1591,13 +1597,13 @@ Array [
|
|
|
1591
1597
|
"images": Array [
|
|
1592
1598
|
Object {
|
|
1593
1599
|
"alt": "../dev-env/assets/key-landscape-small.jpg",
|
|
1594
|
-
"fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(6)/cids(
|
|
1595
|
-
"thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(6)/cids(
|
|
1600
|
+
"fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(6)/cids(6)@jpeg",
|
|
1601
|
+
"thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(6)/cids(6)@jpeg",
|
|
1596
1602
|
},
|
|
1597
1603
|
Object {
|
|
1598
1604
|
"alt": "../dev-env/assets/key-alt.jpg",
|
|
1599
|
-
"fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(6)/cids(
|
|
1600
|
-
"thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(6)/cids(
|
|
1605
|
+
"fullsize": "https://bsky.public.url/img/feed_fullsize/plain/user(6)/cids(10)@jpeg",
|
|
1606
|
+
"thumb": "https://bsky.public.url/img/feed_thumbnail/plain/user(6)/cids(10)@jpeg",
|
|
1601
1607
|
},
|
|
1602
1608
|
],
|
|
1603
1609
|
},
|
|
@@ -1617,7 +1623,7 @@ Array [
|
|
|
1617
1623
|
"muted": false,
|
|
1618
1624
|
},
|
|
1619
1625
|
},
|
|
1620
|
-
"cid": "cids(
|
|
1626
|
+
"cid": "cids(11)",
|
|
1621
1627
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
1622
1628
|
"labels": Array [],
|
|
1623
1629
|
"likeCount": 0,
|
|
@@ -1659,7 +1665,7 @@ Array [
|
|
|
1659
1665
|
"$type": "blob",
|
|
1660
1666
|
"mimeType": "image/jpeg",
|
|
1661
1667
|
"ref": Object {
|
|
1662
|
-
"$link": "cids(
|
|
1668
|
+
"$link": "cids(6)",
|
|
1663
1669
|
},
|
|
1664
1670
|
"size": 4114,
|
|
1665
1671
|
},
|
|
@@ -1670,7 +1676,7 @@ Array [
|
|
|
1670
1676
|
"$type": "blob",
|
|
1671
1677
|
"mimeType": "image/jpeg",
|
|
1672
1678
|
"ref": Object {
|
|
1673
|
-
"$link": "cids(
|
|
1679
|
+
"$link": "cids(10)",
|
|
1674
1680
|
},
|
|
1675
1681
|
"size": 12736,
|
|
1676
1682
|
},
|
|
@@ -1679,7 +1685,7 @@ Array [
|
|
|
1679
1685
|
},
|
|
1680
1686
|
"record": Object {
|
|
1681
1687
|
"record": Object {
|
|
1682
|
-
"cid": "cids(
|
|
1688
|
+
"cid": "cids(11)",
|
|
1683
1689
|
"uri": "record(11)",
|
|
1684
1690
|
},
|
|
1685
1691
|
},
|
|
@@ -1698,7 +1704,7 @@ Array [
|
|
|
1698
1704
|
"embed": Object {
|
|
1699
1705
|
"$type": "app.bsky.embed.record",
|
|
1700
1706
|
"record": Object {
|
|
1701
|
-
"cid": "cids(
|
|
1707
|
+
"cid": "cids(9)",
|
|
1702
1708
|
"uri": "record(10)",
|
|
1703
1709
|
},
|
|
1704
1710
|
},
|
|
@@ -1743,7 +1749,7 @@ Array [
|
|
|
1743
1749
|
"muted": false,
|
|
1744
1750
|
},
|
|
1745
1751
|
},
|
|
1746
|
-
"cid": "cids(
|
|
1752
|
+
"cid": "cids(12)",
|
|
1747
1753
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
1748
1754
|
"labels": Array [],
|
|
1749
1755
|
"likeCount": 0,
|