@atproto/bsky 0.0.77 → 0.0.79
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 +22 -0
- package/dist/api/app/bsky/feed/getListFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getListFeed.js +19 -3
- package/dist/api/app/bsky/feed/getListFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/getPostThread.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getPostThread.js +6 -2
- package/dist/api/app/bsky/feed/getPostThread.js.map +1 -1
- package/dist/api/app/bsky/feed/getQuotes.js +9 -8
- package/dist/api/app/bsky/feed/getQuotes.js.map +1 -1
- package/dist/api/app/bsky/graph/getList.js +4 -4
- package/dist/api/app/bsky/graph/getList.js.map +1 -1
- package/dist/data-plane/server/routes/quotes.js +2 -2
- package/dist/data-plane/server/routes/quotes.js.map +1 -1
- package/dist/data-plane/server/routes/records.js +1 -1
- package/dist/hydration/feed.js +1 -1
- package/dist/lexicon/lexicons.d.ts +7 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +8 -1
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/record.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/embed/record.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/record.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/getPostThread.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/feed/getPostThread.d.ts.map +1 -1
- package/dist/proto/bsky_connect.d.ts +20 -11
- package/dist/proto/bsky_connect.d.ts.map +1 -1
- package/dist/proto/bsky_connect.js +19 -10
- package/dist/proto/bsky_connect.js.map +1 -1
- package/dist/proto/bsky_pb.d.ts +101 -63
- package/dist/proto/bsky_pb.d.ts.map +1 -1
- package/dist/proto/bsky_pb.js +278 -160
- package/dist/proto/bsky_pb.js.map +1 -1
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +1 -0
- package/dist/views/index.js.map +1 -1
- package/package.json +9 -9
- package/proto/bsky.proto +30 -23
- package/src/api/app/bsky/feed/getListFeed.ts +30 -3
- package/src/api/app/bsky/feed/getPostThread.ts +18 -3
- package/src/api/app/bsky/feed/getQuotes.ts +14 -10
- package/src/api/app/bsky/graph/getList.ts +4 -4
- package/src/data-plane/server/routes/quotes.ts +2 -2
- package/src/data-plane/server/routes/records.ts +1 -1
- package/src/hydration/feed.ts +1 -1
- package/src/lexicon/lexicons.ts +8 -1
- package/src/lexicon/types/app/bsky/embed/record.ts +1 -0
- package/src/lexicon/types/app/bsky/feed/getPostThread.ts +1 -0
- package/src/proto/bsky_connect.ts +25 -14
- package/src/proto/bsky_pb.ts +293 -159
- package/src/views/index.ts +1 -0
- package/tests/__snapshots__/feed-generation.test.ts.snap +5 -0
- package/tests/data-plane/__snapshots__/indexing.test.ts.snap +2 -0
- package/tests/views/__snapshots__/author-feed.test.ts.snap +9 -0
- package/tests/views/__snapshots__/block-lists.test.ts.snap +1 -0
- package/tests/views/__snapshots__/blocks.test.ts.snap +1 -0
- package/tests/views/__snapshots__/list-feed.test.ts.snap +2 -0
- package/tests/views/__snapshots__/lists.test.ts.snap +185 -1
- package/tests/views/__snapshots__/posts.test.ts.snap +3 -0
- package/tests/views/__snapshots__/quotes.test.ts.snap +3 -0
- package/tests/views/__snapshots__/timeline.test.ts.snap +21 -0
- package/tests/views/list-feed.test.ts +12 -0
- package/tests/views/lists.test.ts +83 -18
- package/tests/views/quotes.test.ts +14 -0
- package/tests/views/threadgating.test.ts +8 -6
|
@@ -8,7 +8,9 @@ describe('bsky actor likes feed views', () => {
|
|
|
8
8
|
let agent: AtpAgent
|
|
9
9
|
let sc: SeedClient
|
|
10
10
|
|
|
11
|
+
let curateList: string
|
|
11
12
|
let referenceList: string
|
|
13
|
+
let alice: string
|
|
12
14
|
let eve: string
|
|
13
15
|
let frankie: string
|
|
14
16
|
let greta: string
|
|
@@ -35,17 +37,32 @@ describe('bsky actor likes feed views', () => {
|
|
|
35
37
|
email: 'greta@greta.com',
|
|
36
38
|
password: 'hunter4real',
|
|
37
39
|
})
|
|
38
|
-
|
|
40
|
+
|
|
41
|
+
const newRefList = await sc.createList(
|
|
39
42
|
sc.dids.eve,
|
|
40
43
|
'blah starter pack list!',
|
|
41
44
|
'reference',
|
|
42
45
|
)
|
|
43
|
-
await sc.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
const newCurrList = await sc.createList(
|
|
47
|
+
sc.dids.eve,
|
|
48
|
+
'blah curate list!',
|
|
49
|
+
'curate',
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
await sc.addToList(sc.dids.eve, sc.dids.eve, newRefList)
|
|
53
|
+
await sc.addToList(sc.dids.eve, sc.dids.bob, newRefList)
|
|
54
|
+
await sc.addToList(sc.dids.eve, sc.dids.frankie, newRefList)
|
|
55
|
+
|
|
56
|
+
await sc.addToList(sc.dids.eve, sc.dids.eve, newCurrList)
|
|
57
|
+
await sc.addToList(sc.dids.eve, sc.dids.bob, newCurrList)
|
|
58
|
+
await sc.addToList(sc.dids.eve, sc.dids.frankie, newCurrList)
|
|
59
|
+
|
|
46
60
|
await sc.block(sc.dids.frankie, sc.dids.eve)
|
|
61
|
+
|
|
47
62
|
await network.processAll()
|
|
48
|
-
|
|
63
|
+
curateList = newCurrList.uriStr
|
|
64
|
+
referenceList = newRefList.uriStr
|
|
65
|
+
alice = sc.dids.alice
|
|
49
66
|
eve = sc.dids.eve
|
|
50
67
|
frankie = sc.dids.frankie
|
|
51
68
|
greta = sc.dids.greta
|
|
@@ -61,44 +78,92 @@ describe('bsky actor likes feed views', () => {
|
|
|
61
78
|
const view = await agent.api.app.bsky.graph.getLists({
|
|
62
79
|
actor: eve,
|
|
63
80
|
})
|
|
64
|
-
expect(view.data.lists.length).toBe(
|
|
81
|
+
expect(view.data.lists.length).toBe(2)
|
|
65
82
|
expect(forSnapshot(view.data.lists)).toMatchSnapshot()
|
|
66
83
|
})
|
|
67
84
|
|
|
68
85
|
it('does not include users with creator block relationship in reference lists for non-creator, in-list viewers', async () => {
|
|
69
|
-
const
|
|
86
|
+
const curView = await agent.api.app.bsky.graph.getList(
|
|
87
|
+
{
|
|
88
|
+
list: curateList,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
headers: await network.serviceHeaders(frankie, ids.AppBskyGraphGetList),
|
|
92
|
+
},
|
|
93
|
+
)
|
|
94
|
+
expect(curView.data.items.length).toBe(2)
|
|
95
|
+
expect(forSnapshot(curView.data.items)).toMatchSnapshot()
|
|
96
|
+
|
|
97
|
+
const refView = await agent.api.app.bsky.graph.getList(
|
|
70
98
|
{ list: referenceList },
|
|
71
99
|
{
|
|
72
100
|
headers: await network.serviceHeaders(frankie, ids.AppBskyGraphGetList),
|
|
73
101
|
},
|
|
74
102
|
)
|
|
75
|
-
expect(
|
|
76
|
-
expect(forSnapshot(
|
|
103
|
+
expect(refView.data.items.length).toBe(2)
|
|
104
|
+
expect(forSnapshot(refView.data.items)).toMatchSnapshot()
|
|
77
105
|
})
|
|
78
106
|
|
|
79
107
|
it('does not include users with creator block relationship in reference lists for non-creator, not-in-list viewers', async () => {
|
|
80
|
-
const
|
|
108
|
+
const curView = await agent.api.app.bsky.graph.getList(
|
|
109
|
+
{
|
|
110
|
+
list: curateList,
|
|
111
|
+
},
|
|
112
|
+
{ headers: await network.serviceHeaders(greta, ids.AppBskyGraphGetList) },
|
|
113
|
+
)
|
|
114
|
+
expect(curView.data.items.length).toBe(2)
|
|
115
|
+
expect(forSnapshot(curView.data.items)).toMatchSnapshot()
|
|
116
|
+
|
|
117
|
+
const refView = await agent.api.app.bsky.graph.getList(
|
|
81
118
|
{ list: referenceList },
|
|
82
119
|
{ headers: await network.serviceHeaders(greta, ids.AppBskyGraphGetList) },
|
|
83
120
|
)
|
|
84
|
-
expect(
|
|
85
|
-
expect(forSnapshot(
|
|
121
|
+
expect(refView.data.items.length).toBe(2)
|
|
122
|
+
expect(forSnapshot(refView.data.items)).toMatchSnapshot()
|
|
86
123
|
})
|
|
87
124
|
|
|
88
|
-
it('does not include users with creator block relationship in reference lists for signed-out viewers', async () => {
|
|
89
|
-
const
|
|
125
|
+
it('does not include users with creator block relationship in reference and curate lists for signed-out viewers', async () => {
|
|
126
|
+
const curView = await agent.api.app.bsky.graph.getList({
|
|
127
|
+
list: curateList,
|
|
128
|
+
})
|
|
129
|
+
expect(curView.data.items.length).toBe(2)
|
|
130
|
+
expect(forSnapshot(curView.data.items)).toMatchSnapshot()
|
|
131
|
+
|
|
132
|
+
const refView = await agent.api.app.bsky.graph.getList({
|
|
90
133
|
list: referenceList,
|
|
91
134
|
})
|
|
92
|
-
expect(
|
|
93
|
-
expect(forSnapshot(
|
|
135
|
+
expect(refView.data.items.length).toBe(2)
|
|
136
|
+
expect(forSnapshot(refView.data.items)).toMatchSnapshot()
|
|
94
137
|
})
|
|
95
138
|
|
|
96
139
|
it('does include users with creator block relationship in reference lists for creator', async () => {
|
|
97
|
-
const
|
|
140
|
+
const curView = await agent.api.app.bsky.graph.getList(
|
|
141
|
+
{ list: curateList },
|
|
142
|
+
{ headers: await network.serviceHeaders(eve, ids.AppBskyGraphGetList) },
|
|
143
|
+
)
|
|
144
|
+
expect(curView.data.items.length).toBe(3)
|
|
145
|
+
expect(forSnapshot(curView.data.items)).toMatchSnapshot()
|
|
146
|
+
|
|
147
|
+
const refView = await agent.api.app.bsky.graph.getList(
|
|
98
148
|
{ list: referenceList },
|
|
99
149
|
{ headers: await network.serviceHeaders(eve, ids.AppBskyGraphGetList) },
|
|
100
150
|
)
|
|
101
|
-
expect(
|
|
151
|
+
expect(refView.data.items.length).toBe(3)
|
|
152
|
+
expect(forSnapshot(refView.data.items)).toMatchSnapshot()
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
it('does return all users regardless of creator block relationship in moderation lists', async () => {
|
|
156
|
+
const blockList = await sc.createList(eve, 'block list', 'mod')
|
|
157
|
+
await sc.addToList(eve, frankie, blockList)
|
|
158
|
+
await sc.addToList(eve, greta, blockList)
|
|
159
|
+
await sc.block(frankie, greta)
|
|
160
|
+
await network.processAll()
|
|
161
|
+
|
|
162
|
+
const view = await agent.api.app.bsky.graph.getList(
|
|
163
|
+
{ list: blockList.uriStr },
|
|
164
|
+
{ headers: await network.serviceHeaders(alice, ids.AppBskyGraphGetList) },
|
|
165
|
+
)
|
|
166
|
+
expect(view.data.items.length).toBe(2)
|
|
102
167
|
expect(forSnapshot(view.data.items)).toMatchSnapshot()
|
|
103
168
|
})
|
|
104
169
|
})
|
|
@@ -11,6 +11,7 @@ describe('pds quote views', () => {
|
|
|
11
11
|
// account dids, for convenience
|
|
12
12
|
let alice: string
|
|
13
13
|
let bob: string
|
|
14
|
+
let carol: string
|
|
14
15
|
let eve: string
|
|
15
16
|
|
|
16
17
|
beforeAll(async () => {
|
|
@@ -23,6 +24,7 @@ describe('pds quote views', () => {
|
|
|
23
24
|
await network.processAll()
|
|
24
25
|
alice = sc.dids.alice
|
|
25
26
|
bob = sc.dids.bob
|
|
27
|
+
carol = sc.dids.carol
|
|
26
28
|
eve = sc.dids.eve
|
|
27
29
|
})
|
|
28
30
|
|
|
@@ -102,4 +104,16 @@ describe('pds quote views', () => {
|
|
|
102
104
|
expect(bobPost.data.posts[0].quoteCount).toEqual(0)
|
|
103
105
|
expect(forSnapshot(bobPost.data)).toMatchSnapshot()
|
|
104
106
|
})
|
|
107
|
+
|
|
108
|
+
it('does not return post in list when the embed is blocked', async () => {
|
|
109
|
+
await sc.block(carol, eve)
|
|
110
|
+
await network.processAll()
|
|
111
|
+
|
|
112
|
+
const quotes = await agent.api.app.bsky.feed.getQuotes(
|
|
113
|
+
{ uri: sc.posts[carol][1].ref.uriStr },
|
|
114
|
+
{ headers: await network.serviceHeaders(bob, ids.AppBskyFeedGetQuotes) },
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
expect(quotes.data.posts.length).toBe(0)
|
|
118
|
+
})
|
|
105
119
|
})
|
|
@@ -44,16 +44,17 @@ describe('views with thread gating', () => {
|
|
|
44
44
|
|
|
45
45
|
it('applies gate for empty rules.', async () => {
|
|
46
46
|
const post = await sc.post(sc.dids.carol, 'empty rules')
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
const { uri: threadgateUri } =
|
|
48
|
+
await pdsAgent.api.app.bsky.feed.threadgate.create(
|
|
49
|
+
{ repo: sc.dids.carol, rkey: post.ref.uri.rkey },
|
|
50
|
+
{ post: post.ref.uriStr, createdAt: iso(), allow: [] },
|
|
51
|
+
sc.getHeaders(sc.dids.carol),
|
|
52
|
+
)
|
|
52
53
|
await network.processAll()
|
|
53
54
|
await sc.reply(sc.dids.alice, post.ref, post.ref, 'empty rules reply')
|
|
54
55
|
await network.processAll()
|
|
55
56
|
const {
|
|
56
|
-
data: { thread },
|
|
57
|
+
data: { thread, threadgate },
|
|
57
58
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
58
59
|
{ uri: post.ref.uriStr },
|
|
59
60
|
{
|
|
@@ -67,6 +68,7 @@ describe('views with thread gating', () => {
|
|
|
67
68
|
expect(forSnapshot(thread.post.threadgate)).toMatchSnapshot()
|
|
68
69
|
expect(thread.post.viewer?.replyDisabled).toBe(true)
|
|
69
70
|
expect(thread.replies?.length).toEqual(0)
|
|
71
|
+
expect(threadgate?.uri).toEqual(threadgateUri)
|
|
70
72
|
await checkReplyDisabled(post.ref.uriStr, sc.dids.alice, true)
|
|
71
73
|
})
|
|
72
74
|
|