@atproto/bsky 0.0.75 → 0.0.77
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 +18 -0
- package/dist/api/app/bsky/actor/getProfiles.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/getProfiles.js +9 -1
- package/dist/api/app/bsky/actor/getProfiles.js.map +1 -1
- package/dist/api/app/bsky/actor/searchActorsTypeahead.js +10 -2
- package/dist/api/app/bsky/actor/searchActorsTypeahead.js.map +1 -1
- package/dist/api/app/bsky/feed/getActorLikes.js +2 -2
- package/dist/api/app/bsky/feed/getActorLikes.js.map +1 -1
- package/dist/api/app/bsky/feed/getFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getFeed.js +8 -1
- package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/getLikes.js +6 -6
- package/dist/api/app/bsky/feed/getLikes.js.map +1 -1
- package/dist/api/app/bsky/feed/getPosts.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getPosts.js +12 -5
- package/dist/api/app/bsky/feed/getPosts.js.map +1 -1
- package/dist/api/app/bsky/feed/getQuotes.d.ts +4 -0
- package/dist/api/app/bsky/feed/getQuotes.d.ts.map +1 -0
- package/dist/api/app/bsky/feed/getQuotes.js +67 -0
- package/dist/api/app/bsky/feed/getQuotes.js.map +1 -0
- package/dist/api/app/bsky/feed/getRepostedBy.js +6 -6
- package/dist/api/app/bsky/feed/getRepostedBy.js.map +1 -1
- package/dist/api/app/bsky/feed/searchPosts.js +4 -4
- package/dist/api/app/bsky/feed/searchPosts.js.map +1 -1
- package/dist/api/app/bsky/graph/getFollowers.js +8 -8
- package/dist/api/app/bsky/graph/getFollowers.js.map +1 -1
- package/dist/api/app/bsky/graph/getList.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getList.js +32 -2
- package/dist/api/app/bsky/graph/getList.js.map +1 -1
- package/dist/api/app/bsky/notification/listNotifications.d.ts.map +1 -1
- package/dist/api/app/bsky/notification/listNotifications.js +29 -8
- package/dist/api/app/bsky/notification/listNotifications.js.map +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +2 -0
- package/dist/api/index.js.map +1 -1
- package/dist/auth-verifier.d.ts +8 -3
- package/dist/auth-verifier.d.ts.map +1 -1
- package/dist/auth-verifier.js +43 -29
- package/dist/auth-verifier.js.map +1 -1
- package/dist/data-plane/server/db/database-schema.d.ts +4 -2
- package/dist/data-plane/server/db/database-schema.d.ts.map +1 -1
- package/dist/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.js +15 -0
- package/dist/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.js.map +1 -0
- package/dist/data-plane/server/db/migrations/20240723T220703655Z-quotes.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20240723T220703655Z-quotes.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20240723T220703655Z-quotes.js +30 -0
- package/dist/data-plane/server/db/migrations/20240723T220703655Z-quotes.js.map +1 -0
- package/dist/data-plane/server/db/migrations/20240801T193939827Z-post-gate.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20240801T193939827Z-post-gate.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20240801T193939827Z-post-gate.js +20 -0
- package/dist/data-plane/server/db/migrations/20240801T193939827Z-post-gate.js.map +1 -0
- package/dist/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.js +28 -0
- package/dist/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.js.map +1 -0
- package/dist/data-plane/server/db/migrations/index.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/index.d.ts.map +1 -1
- package/dist/data-plane/server/db/migrations/index.js +5 -1
- package/dist/data-plane/server/db/migrations/index.js.map +1 -1
- package/dist/data-plane/server/db/tables/post-agg.d.ts +1 -0
- package/dist/data-plane/server/db/tables/post-agg.d.ts.map +1 -1
- package/dist/data-plane/server/db/tables/post-gate.d.ts +14 -0
- package/dist/data-plane/server/db/tables/post-gate.d.ts.map +1 -0
- package/dist/data-plane/server/db/tables/post-gate.js +4 -0
- package/dist/data-plane/server/db/tables/post-gate.js.map +1 -0
- package/dist/data-plane/server/db/tables/post.d.ts +3 -0
- package/dist/data-plane/server/db/tables/post.d.ts.map +1 -1
- package/dist/data-plane/server/db/tables/quote.d.ts +16 -0
- package/dist/data-plane/server/db/tables/quote.d.ts.map +1 -0
- package/dist/data-plane/server/db/tables/quote.js +4 -0
- package/dist/data-plane/server/db/tables/quote.js.map +1 -0
- package/dist/data-plane/server/indexing/index.d.ts +2 -0
- package/dist/data-plane/server/indexing/index.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/index.js +6 -0
- package/dist/data-plane/server/indexing/index.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/post-gate.d.ts +10 -0
- package/dist/data-plane/server/indexing/plugins/post-gate.d.ts.map +1 -0
- package/dist/data-plane/server/indexing/plugins/post-gate.js +101 -0
- package/dist/data-plane/server/indexing/plugins/post-gate.js.map +1 -0
- package/dist/data-plane/server/indexing/plugins/post.d.ts +2 -0
- package/dist/data-plane/server/indexing/plugins/post.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/post.js +122 -15
- package/dist/data-plane/server/indexing/plugins/post.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/thread-gate.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/thread-gate.js +12 -0
- package/dist/data-plane/server/indexing/plugins/thread-gate.js.map +1 -1
- package/dist/data-plane/server/routes/index.d.ts.map +1 -1
- package/dist/data-plane/server/routes/index.js +2 -0
- package/dist/data-plane/server/routes/index.js.map +1 -1
- package/dist/data-plane/server/routes/interactions.d.ts.map +1 -1
- package/dist/data-plane/server/routes/interactions.js +2 -1
- package/dist/data-plane/server/routes/interactions.js.map +1 -1
- package/dist/data-plane/server/routes/quotes.d.ts +6 -0
- package/dist/data-plane/server/routes/quotes.d.ts.map +1 -0
- package/dist/data-plane/server/routes/quotes.js +27 -0
- package/dist/data-plane/server/routes/quotes.js.map +1 -0
- package/dist/data-plane/server/routes/records.d.ts.map +1 -1
- package/dist/data-plane/server/routes/records.js +11 -1
- package/dist/data-plane/server/routes/records.js.map +1 -1
- package/dist/data-plane/server/util.d.ts +6 -7
- package/dist/data-plane/server/util.d.ts.map +1 -1
- package/dist/data-plane/server/util.js +1 -9
- package/dist/data-plane/server/util.js.map +1 -1
- package/dist/hydration/feed.d.ts +10 -0
- package/dist/hydration/feed.d.ts.map +1 -1
- package/dist/hydration/feed.js +31 -7
- package/dist/hydration/feed.js.map +1 -1
- package/dist/hydration/hydrator.d.ts +5 -2
- package/dist/hydration/hydrator.d.ts.map +1 -1
- package/dist/hydration/hydrator.js +102 -38
- package/dist/hydration/hydrator.js.map +1 -1
- package/dist/hydration/util.d.ts +0 -1
- package/dist/hydration/util.d.ts.map +1 -1
- package/dist/hydration/util.js +1 -5
- package/dist/hydration/util.js.map +1 -1
- package/dist/lexicon/index.d.ts +2 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +4 -0
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +141 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +142 -0
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/record.d.ts +8 -1
- package/dist/lexicon/types/app/bsky/embed/record.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/record.js +11 -1
- package/dist/lexicon/types/app/bsky/embed/record.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/getQuotes.d.ts +44 -0
- package/dist/lexicon/types/app/bsky/feed/getQuotes.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/feed/getQuotes.js +3 -0
- package/dist/lexicon/types/app/bsky/feed/getQuotes.js.map +1 -0
- package/dist/lexicon/types/app/bsky/feed/postgate.d.ts +25 -0
- package/dist/lexicon/types/app/bsky/feed/postgate.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/feed/postgate.js +27 -0
- package/dist/lexicon/types/app/bsky/feed/postgate.js.map +1 -0
- package/dist/lexicon/types/app/bsky/feed/threadgate.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/feed/threadgate.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/threadgate.js.map +1 -1
- package/dist/proto/bsky_connect.d.ts +21 -1
- package/dist/proto/bsky_connect.d.ts.map +1 -1
- package/dist/proto/bsky_connect.js +20 -0
- package/dist/proto/bsky_connect.js.map +1 -1
- package/dist/proto/bsky_pb.d.ts +96 -0
- package/dist/proto/bsky_pb.d.ts.map +1 -1
- package/dist/proto/bsky_pb.js +306 -4
- package/dist/proto/bsky_pb.js.map +1 -1
- package/dist/util/uris.d.ts +12 -0
- package/dist/util/uris.d.ts.map +1 -0
- package/dist/util/uris.js +34 -0
- package/dist/util/uris.js.map +1 -0
- package/dist/views/index.d.ts +8 -2
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +83 -39
- package/dist/views/index.js.map +1 -1
- package/dist/views/types.d.ts +1 -1
- package/dist/views/types.d.ts.map +1 -1
- package/dist/views/types.js.map +1 -1
- package/dist/views/util.d.ts +11 -1
- package/dist/views/util.d.ts.map +1 -1
- package/dist/views/util.js +19 -8
- package/dist/views/util.js.map +1 -1
- package/package.json +6 -6
- package/proto/bsky.proto +33 -0
- package/src/api/app/bsky/actor/getProfiles.ts +10 -1
- package/src/api/app/bsky/actor/searchActorsTypeahead.ts +9 -4
- package/src/api/app/bsky/feed/getActorLikes.ts +1 -1
- package/src/api/app/bsky/feed/getFeed.ts +12 -1
- package/src/api/app/bsky/feed/getLikes.ts +1 -1
- package/src/api/app/bsky/feed/getPosts.ts +10 -2
- package/src/api/app/bsky/feed/getQuotes.ts +105 -0
- package/src/api/app/bsky/feed/getRepostedBy.ts +1 -1
- package/src/api/app/bsky/feed/searchPosts.ts +1 -1
- package/src/api/app/bsky/graph/getFollowers.ts +1 -1
- package/src/api/app/bsky/graph/getList.ts +47 -4
- package/src/api/app/bsky/notification/listNotifications.ts +32 -6
- package/src/api/index.ts +2 -0
- package/src/auth-verifier.ts +78 -51
- package/src/data-plane/server/db/database-schema.ts +7 -3
- package/src/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.ts +12 -0
- package/src/data-plane/server/db/migrations/20240723T220703655Z-quotes.ts +28 -0
- package/src/data-plane/server/db/migrations/20240801T193939827Z-post-gate.ts +17 -0
- package/src/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.ts +25 -0
- package/src/data-plane/server/db/migrations/index.ts +4 -0
- package/src/data-plane/server/db/tables/post-agg.ts +1 -0
- package/src/data-plane/server/db/tables/post-gate.ts +12 -0
- package/src/data-plane/server/db/tables/post.ts +3 -0
- package/src/data-plane/server/db/tables/quote.ts +15 -0
- package/src/data-plane/server/indexing/index.ts +7 -0
- package/src/data-plane/server/indexing/plugins/post-gate.ts +104 -0
- package/src/data-plane/server/indexing/plugins/post.ts +151 -16
- package/src/data-plane/server/indexing/plugins/thread-gate.ts +12 -0
- package/src/data-plane/server/routes/index.ts +2 -0
- package/src/data-plane/server/routes/interactions.ts +2 -1
- package/src/data-plane/server/routes/quotes.ts +32 -0
- package/src/data-plane/server/routes/records.ts +11 -1
- package/src/data-plane/server/util.ts +0 -8
- package/src/hydration/feed.ts +58 -12
- package/src/hydration/hydrator.ts +112 -24
- package/src/hydration/util.ts +0 -4
- package/src/lexicon/index.ts +12 -0
- package/src/lexicon/lexicons.ts +145 -0
- package/src/lexicon/types/app/bsky/embed/record.ts +19 -0
- package/src/lexicon/types/app/bsky/feed/defs.ts +2 -0
- package/src/lexicon/types/app/bsky/feed/getQuotes.ts +54 -0
- package/src/lexicon/types/app/bsky/feed/postgate.ts +47 -0
- package/src/lexicon/types/app/bsky/feed/threadgate.ts +2 -0
- package/src/proto/bsky_connect.ts +24 -0
- package/src/proto/bsky_pb.ts +289 -0
- package/src/util/uris.ts +31 -0
- package/src/views/index.ts +90 -35
- package/src/views/types.ts +1 -0
- package/src/views/util.ts +37 -7
- package/tests/__snapshots__/feed-generation.test.ts.snap +37 -0
- package/tests/admin/admin-auth.test.ts +15 -8
- package/tests/auth.test.ts +2 -1
- package/tests/data-plane/__snapshots__/indexing.test.ts.snap +18 -0
- package/tests/data-plane/handle-invalidation.test.ts +31 -5
- package/tests/data-plane/indexing.test.ts +139 -23
- package/tests/data-plane/thread-mutes.test.ts +41 -9
- package/tests/feed-generation.test.ts +150 -32
- package/tests/postgates.test.ts +186 -0
- package/tests/seed/feed-hidden-replies.ts +62 -0
- package/tests/seed/postgates.ts +56 -0
- package/tests/server.test.ts +1 -1
- package/tests/views/__snapshots__/author-feed.test.ts.snap +56 -0
- package/tests/views/__snapshots__/block-lists.test.ts.snap +6 -0
- package/tests/views/__snapshots__/blocks.test.ts.snap +10 -0
- package/tests/views/__snapshots__/list-feed.test.ts.snap +22 -0
- package/tests/views/__snapshots__/lists.test.ts.snap +145 -26
- package/tests/views/__snapshots__/mute-lists.test.ts.snap +8 -0
- package/tests/views/__snapshots__/mutes.test.ts.snap +6 -0
- package/tests/views/__snapshots__/posts.test.ts.snap +12 -0
- package/tests/views/__snapshots__/quotes.test.ts.snap +399 -0
- package/tests/views/__snapshots__/starter-packs.test.ts.snap +245 -4
- package/tests/views/__snapshots__/thread.test.ts.snap +50 -0
- package/tests/views/__snapshots__/timeline.test.ts.snap +170 -0
- package/tests/views/account-deactivation.test.ts +8 -2
- package/tests/views/actor-likes.test.ts +27 -6
- package/tests/views/actor-search.test.ts +5 -1
- package/tests/views/author-feed.test.ts +76 -21
- package/tests/views/block-lists.test.ts +201 -40
- package/tests/views/blocks.test.ts +245 -46
- package/tests/views/feed-hidden-replies.test.ts +246 -0
- package/tests/views/feed-view-post.test.ts +501 -0
- package/tests/views/follows.test.ts +133 -22
- package/tests/views/known-followers.test.ts +43 -7
- package/tests/views/labeler-service.test.ts +36 -6
- package/tests/views/likes.test.ts +8 -5
- package/tests/views/list-feed.test.ts +25 -4
- package/tests/views/lists.test.ts +73 -31
- package/tests/views/mute-lists.test.ts +101 -29
- package/tests/views/mutes.test.ts +77 -17
- package/tests/views/notifications.test.ts +141 -25
- package/tests/views/posts.test.ts +13 -2
- package/tests/views/profile.test.ts +37 -11
- package/tests/views/quotes.test.ts +105 -0
- package/tests/views/reposts.test.ts +31 -5
- package/tests/views/starter-packs.test.ts +83 -3
- package/tests/views/suggested-follows.test.ts +31 -5
- package/tests/views/suggestions.test.ts +37 -6
- package/tests/views/thread.test.ts +121 -20
- package/tests/views/threadgating.test.ts +128 -22
- package/tests/views/timeline.test.ts +67 -14
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AtpAgent, AtUri } from '@atproto/api'
|
|
2
2
|
import { TestNetwork, SeedClient, RecordRef, basicSeed } from '@atproto/dev-env'
|
|
3
3
|
import { forSnapshot } from '../_util'
|
|
4
|
+
import { ids } from '../../src/lexicon/lexicons'
|
|
4
5
|
|
|
5
6
|
describe('pds views with blocking from block lists', () => {
|
|
6
7
|
let network: TestNetwork
|
|
@@ -109,7 +110,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
109
110
|
const { carol, dan } = sc.dids
|
|
110
111
|
const { data: threadAlice } = await agent.api.app.bsky.feed.getPostThread(
|
|
111
112
|
{ depth: 1, uri: sc.posts[carol][0].ref.uriStr },
|
|
112
|
-
{
|
|
113
|
+
{
|
|
114
|
+
headers: await network.serviceHeaders(
|
|
115
|
+
dan,
|
|
116
|
+
ids.AppBskyFeedGetPostThread,
|
|
117
|
+
),
|
|
118
|
+
},
|
|
113
119
|
)
|
|
114
120
|
expect(threadAlice.thread).toEqual(
|
|
115
121
|
expect.objectContaining({
|
|
@@ -120,7 +126,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
120
126
|
)
|
|
121
127
|
const { data: threadCarol } = await agent.api.app.bsky.feed.getPostThread(
|
|
122
128
|
{ depth: 1, uri: sc.posts[dan][0].ref.uriStr },
|
|
123
|
-
{
|
|
129
|
+
{
|
|
130
|
+
headers: await network.serviceHeaders(
|
|
131
|
+
carol,
|
|
132
|
+
ids.AppBskyFeedGetPostThread,
|
|
133
|
+
),
|
|
134
|
+
},
|
|
124
135
|
)
|
|
125
136
|
expect(threadCarol.thread).toEqual(
|
|
126
137
|
expect.objectContaining({
|
|
@@ -135,7 +146,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
135
146
|
// Contains reply by carol
|
|
136
147
|
const { data: thread } = await agent.api.app.bsky.feed.getPostThread(
|
|
137
148
|
{ depth: 1, uri: sc.posts[alice][1].ref.uriStr },
|
|
138
|
-
{
|
|
149
|
+
{
|
|
150
|
+
headers: await network.serviceHeaders(
|
|
151
|
+
dan,
|
|
152
|
+
ids.AppBskyFeedGetPostThread,
|
|
153
|
+
),
|
|
154
|
+
},
|
|
139
155
|
)
|
|
140
156
|
expect(forSnapshot(thread)).toMatchSnapshot()
|
|
141
157
|
})
|
|
@@ -144,7 +160,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
144
160
|
// Parent is a post by dan
|
|
145
161
|
const { data: thread } = await agent.api.app.bsky.feed.getPostThread(
|
|
146
162
|
{ depth: 1, uri: aliceReplyToDan.ref.uriStr },
|
|
147
|
-
{
|
|
163
|
+
{
|
|
164
|
+
headers: await network.serviceHeaders(
|
|
165
|
+
carol,
|
|
166
|
+
ids.AppBskyFeedGetPostThread,
|
|
167
|
+
),
|
|
168
|
+
},
|
|
148
169
|
)
|
|
149
170
|
expect(forSnapshot(thread)).toMatchSnapshot()
|
|
150
171
|
})
|
|
@@ -153,7 +174,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
153
174
|
// Contains a deep embed of carol's post, blocked by dan
|
|
154
175
|
const { data: thread } = await agent.api.app.bsky.feed.getPostThread(
|
|
155
176
|
{ depth: 0, uri: sc.posts[alice][2].ref.uriStr },
|
|
156
|
-
{
|
|
177
|
+
{
|
|
178
|
+
headers: await network.serviceHeaders(
|
|
179
|
+
dan,
|
|
180
|
+
ids.AppBskyFeedGetPostThread,
|
|
181
|
+
),
|
|
182
|
+
},
|
|
157
183
|
)
|
|
158
184
|
expect(forSnapshot(thread)).toMatchSnapshot()
|
|
159
185
|
})
|
|
@@ -161,7 +187,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
161
187
|
it('errors on getting author feed', async () => {
|
|
162
188
|
const attempt1 = agent.api.app.bsky.feed.getAuthorFeed(
|
|
163
189
|
{ actor: carol },
|
|
164
|
-
{
|
|
190
|
+
{
|
|
191
|
+
headers: await network.serviceHeaders(
|
|
192
|
+
dan,
|
|
193
|
+
ids.AppBskyFeedGetAuthorFeed,
|
|
194
|
+
),
|
|
195
|
+
},
|
|
165
196
|
)
|
|
166
197
|
await expect(attempt1).rejects.toMatchObject({
|
|
167
198
|
error: 'BlockedActor',
|
|
@@ -169,7 +200,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
169
200
|
|
|
170
201
|
const attempt2 = agent.api.app.bsky.feed.getAuthorFeed(
|
|
171
202
|
{ actor: dan },
|
|
172
|
-
{
|
|
203
|
+
{
|
|
204
|
+
headers: await network.serviceHeaders(
|
|
205
|
+
carol,
|
|
206
|
+
ids.AppBskyFeedGetAuthorFeed,
|
|
207
|
+
),
|
|
208
|
+
},
|
|
173
209
|
)
|
|
174
210
|
await expect(attempt2).rejects.toMatchObject({
|
|
175
211
|
error: 'BlockedByActor',
|
|
@@ -179,7 +215,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
179
215
|
it('strips blocked users out of getTimeline', async () => {
|
|
180
216
|
const resCarol = await agent.api.app.bsky.feed.getTimeline(
|
|
181
217
|
{ limit: 100 },
|
|
182
|
-
{
|
|
218
|
+
{
|
|
219
|
+
headers: await network.serviceHeaders(
|
|
220
|
+
carol,
|
|
221
|
+
ids.AppBskyFeedGetTimeline,
|
|
222
|
+
),
|
|
223
|
+
},
|
|
183
224
|
)
|
|
184
225
|
expect(
|
|
185
226
|
resCarol.data.feed.some((post) => post.post.author.did === dan),
|
|
@@ -187,7 +228,9 @@ describe('pds views with blocking from block lists', () => {
|
|
|
187
228
|
|
|
188
229
|
const resDan = await agent.api.app.bsky.feed.getTimeline(
|
|
189
230
|
{ limit: 100 },
|
|
190
|
-
{
|
|
231
|
+
{
|
|
232
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyFeedGetTimeline),
|
|
233
|
+
},
|
|
191
234
|
)
|
|
192
235
|
expect(
|
|
193
236
|
resDan.data.feed.some((post) =>
|
|
@@ -199,7 +242,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
199
242
|
it('returns block status on getProfile', async () => {
|
|
200
243
|
const resCarol = await agent.api.app.bsky.actor.getProfile(
|
|
201
244
|
{ actor: dan },
|
|
202
|
-
{
|
|
245
|
+
{
|
|
246
|
+
headers: await network.serviceHeaders(
|
|
247
|
+
carol,
|
|
248
|
+
ids.AppBskyActorGetProfile,
|
|
249
|
+
),
|
|
250
|
+
},
|
|
203
251
|
)
|
|
204
252
|
expect(resCarol.data.viewer?.blocking).toBeUndefined()
|
|
205
253
|
expect(resCarol.data.viewer?.blockingByList).toBeUndefined()
|
|
@@ -207,7 +255,9 @@ describe('pds views with blocking from block lists', () => {
|
|
|
207
255
|
|
|
208
256
|
const resDan = await agent.api.app.bsky.actor.getProfile(
|
|
209
257
|
{ actor: carol },
|
|
210
|
-
{
|
|
258
|
+
{
|
|
259
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyActorGetProfile),
|
|
260
|
+
},
|
|
211
261
|
)
|
|
212
262
|
expect(resDan.data.viewer?.blocking).toBeDefined()
|
|
213
263
|
expect(resDan.data.viewer?.blockingByList?.uri).toEqual(
|
|
@@ -219,7 +269,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
219
269
|
it('returns block status on getProfiles', async () => {
|
|
220
270
|
const resCarol = await agent.api.app.bsky.actor.getProfiles(
|
|
221
271
|
{ actors: [alice, dan] },
|
|
222
|
-
{
|
|
272
|
+
{
|
|
273
|
+
headers: await network.serviceHeaders(
|
|
274
|
+
carol,
|
|
275
|
+
ids.AppBskyActorGetProfiles,
|
|
276
|
+
),
|
|
277
|
+
},
|
|
223
278
|
)
|
|
224
279
|
expect(resCarol.data.profiles[0].viewer?.blocking).toBeUndefined()
|
|
225
280
|
expect(resCarol.data.profiles[0].viewer?.blockingByList).toBeUndefined()
|
|
@@ -230,7 +285,9 @@ describe('pds views with blocking from block lists', () => {
|
|
|
230
285
|
|
|
231
286
|
const resDan = await agent.api.app.bsky.actor.getProfiles(
|
|
232
287
|
{ actors: [alice, carol] },
|
|
233
|
-
{
|
|
288
|
+
{
|
|
289
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyActorGetProfiles),
|
|
290
|
+
},
|
|
234
291
|
)
|
|
235
292
|
expect(resDan.data.profiles[0].viewer?.blocking).toBeUndefined()
|
|
236
293
|
expect(resDan.data.profiles[0].viewer?.blockingByList).toBeUndefined()
|
|
@@ -245,7 +302,9 @@ describe('pds views with blocking from block lists', () => {
|
|
|
245
302
|
it('ignores self-blocks', async () => {
|
|
246
303
|
const res = await agent.api.app.bsky.actor.getProfile(
|
|
247
304
|
{ actor: dan }, // dan subscribes to list that contains himself
|
|
248
|
-
{
|
|
305
|
+
{
|
|
306
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyActorGetProfile),
|
|
307
|
+
},
|
|
249
308
|
)
|
|
250
309
|
expect(res.data.viewer?.blocking).toBeUndefined()
|
|
251
310
|
expect(res.data.viewer?.blockingByList).toBeUndefined()
|
|
@@ -257,7 +316,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
257
316
|
{
|
|
258
317
|
limit: 100,
|
|
259
318
|
},
|
|
260
|
-
{
|
|
319
|
+
{
|
|
320
|
+
headers: await network.serviceHeaders(
|
|
321
|
+
carol,
|
|
322
|
+
ids.AppBskyNotificationListNotifications,
|
|
323
|
+
),
|
|
324
|
+
},
|
|
261
325
|
)
|
|
262
326
|
expect(
|
|
263
327
|
resCarol.data.notifications.some((notif) => notif.author.did === dan),
|
|
@@ -267,7 +331,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
267
331
|
{
|
|
268
332
|
limit: 100,
|
|
269
333
|
},
|
|
270
|
-
{
|
|
334
|
+
{
|
|
335
|
+
headers: await network.serviceHeaders(
|
|
336
|
+
carol,
|
|
337
|
+
ids.AppBskyNotificationListNotifications,
|
|
338
|
+
),
|
|
339
|
+
},
|
|
271
340
|
)
|
|
272
341
|
expect(
|
|
273
342
|
resDan.data.notifications.some((notif) => notif.author.did === carol),
|
|
@@ -279,7 +348,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
279
348
|
{
|
|
280
349
|
term: 'dan.test',
|
|
281
350
|
},
|
|
282
|
-
{
|
|
351
|
+
{
|
|
352
|
+
headers: await network.serviceHeaders(
|
|
353
|
+
carol,
|
|
354
|
+
ids.AppBskyActorSearchActors,
|
|
355
|
+
),
|
|
356
|
+
},
|
|
283
357
|
)
|
|
284
358
|
expect(resCarol.data.actors.some((actor) => actor.did === dan)).toBeFalsy()
|
|
285
359
|
|
|
@@ -287,7 +361,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
287
361
|
{
|
|
288
362
|
term: 'carol.test',
|
|
289
363
|
},
|
|
290
|
-
{
|
|
364
|
+
{
|
|
365
|
+
headers: await network.serviceHeaders(
|
|
366
|
+
dan,
|
|
367
|
+
ids.AppBskyActorSearchActors,
|
|
368
|
+
),
|
|
369
|
+
},
|
|
291
370
|
)
|
|
292
371
|
expect(resDan.data.actors.some((actor) => actor.did === carol)).toBeFalsy()
|
|
293
372
|
})
|
|
@@ -295,21 +374,59 @@ describe('pds views with blocking from block lists', () => {
|
|
|
295
374
|
it('does not return blocked accounts in actor search typeahead', async () => {
|
|
296
375
|
const resCarol = await agent.api.app.bsky.actor.searchActorsTypeahead(
|
|
297
376
|
{
|
|
298
|
-
term: 'dan.
|
|
377
|
+
term: 'dan.tes',
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
headers: await network.serviceHeaders(
|
|
381
|
+
carol,
|
|
382
|
+
ids.AppBskyActorSearchActorsTypeahead,
|
|
383
|
+
),
|
|
299
384
|
},
|
|
300
|
-
{ headers: await network.serviceHeaders(carol) },
|
|
301
385
|
)
|
|
302
386
|
expect(resCarol.data.actors.some((actor) => actor.did === dan)).toBeFalsy()
|
|
303
387
|
|
|
304
388
|
const resDan = await agent.api.app.bsky.actor.searchActorsTypeahead(
|
|
305
389
|
{
|
|
306
|
-
term: 'carol.
|
|
390
|
+
term: 'carol.tes',
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
headers: await network.serviceHeaders(
|
|
394
|
+
dan,
|
|
395
|
+
ids.AppBskyActorSearchActorsTypeahead,
|
|
396
|
+
),
|
|
307
397
|
},
|
|
308
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
309
398
|
)
|
|
310
399
|
expect(resDan.data.actors.some((actor) => actor.did === carol)).toBeFalsy()
|
|
311
400
|
})
|
|
312
401
|
|
|
402
|
+
it('does return blocked accounts in actor search typeahead when term is exact handle', async () => {
|
|
403
|
+
const resCarol = await agent.api.app.bsky.actor.searchActorsTypeahead(
|
|
404
|
+
{
|
|
405
|
+
term: 'dan.test',
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
headers: await network.serviceHeaders(
|
|
409
|
+
carol,
|
|
410
|
+
ids.AppBskyActorSearchActorsTypeahead,
|
|
411
|
+
),
|
|
412
|
+
},
|
|
413
|
+
)
|
|
414
|
+
expect(resCarol.data.actors.some((actor) => actor.did === dan)).toBeTruthy()
|
|
415
|
+
|
|
416
|
+
const resDan = await agent.api.app.bsky.actor.searchActorsTypeahead(
|
|
417
|
+
{
|
|
418
|
+
term: 'carol.test',
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
headers: await network.serviceHeaders(
|
|
422
|
+
dan,
|
|
423
|
+
ids.AppBskyActorSearchActorsTypeahead,
|
|
424
|
+
),
|
|
425
|
+
},
|
|
426
|
+
)
|
|
427
|
+
expect(resDan.data.actors.some((actor) => actor.did === carol)).toBeTruthy()
|
|
428
|
+
})
|
|
429
|
+
|
|
313
430
|
it('does not return blocked accounts in get suggestions', async () => {
|
|
314
431
|
// unfollow so they _would_ show up in suggestions if not for block
|
|
315
432
|
await sc.unfollow(carol, dan)
|
|
@@ -320,7 +437,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
320
437
|
{
|
|
321
438
|
limit: 100,
|
|
322
439
|
},
|
|
323
|
-
{
|
|
440
|
+
{
|
|
441
|
+
headers: await network.serviceHeaders(
|
|
442
|
+
carol,
|
|
443
|
+
ids.AppBskyActorGetSuggestions,
|
|
444
|
+
),
|
|
445
|
+
},
|
|
324
446
|
)
|
|
325
447
|
expect(resCarol.data.actors.some((actor) => actor.did === dan)).toBeFalsy()
|
|
326
448
|
|
|
@@ -328,7 +450,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
328
450
|
{
|
|
329
451
|
limit: 100,
|
|
330
452
|
},
|
|
331
|
-
{
|
|
453
|
+
{
|
|
454
|
+
headers: await network.serviceHeaders(
|
|
455
|
+
dan,
|
|
456
|
+
ids.AppBskyActorGetSuggestions,
|
|
457
|
+
),
|
|
458
|
+
},
|
|
332
459
|
)
|
|
333
460
|
expect(resDan.data.actors.some((actor) => actor.did === carol)).toBeFalsy()
|
|
334
461
|
})
|
|
@@ -336,7 +463,7 @@ describe('pds views with blocking from block lists', () => {
|
|
|
336
463
|
it('returns the contents of a list', async () => {
|
|
337
464
|
const res = await agent.api.app.bsky.graph.getList(
|
|
338
465
|
{ list: listUri },
|
|
339
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
466
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetList) },
|
|
340
467
|
)
|
|
341
468
|
expect(forSnapshot(res.data)).toMatchSnapshot()
|
|
342
469
|
})
|
|
@@ -344,15 +471,15 @@ describe('pds views with blocking from block lists', () => {
|
|
|
344
471
|
it('paginates getList', async () => {
|
|
345
472
|
const full = await agent.api.app.bsky.graph.getList(
|
|
346
473
|
{ list: listUri },
|
|
347
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
474
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetList) },
|
|
348
475
|
)
|
|
349
476
|
const first = await agent.api.app.bsky.graph.getList(
|
|
350
477
|
{ list: listUri, limit: 1 },
|
|
351
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
478
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetList) },
|
|
352
479
|
)
|
|
353
480
|
const second = await agent.api.app.bsky.graph.getList(
|
|
354
481
|
{ list: listUri, cursor: first.data.cursor },
|
|
355
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
482
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetList) },
|
|
356
483
|
)
|
|
357
484
|
const combined = [...first.data.items, ...second.data.items]
|
|
358
485
|
expect(combined).toEqual(full.data.items)
|
|
@@ -376,7 +503,7 @@ describe('pds views with blocking from block lists', () => {
|
|
|
376
503
|
|
|
377
504
|
const res = await agent.api.app.bsky.graph.getLists(
|
|
378
505
|
{ actor: alice },
|
|
379
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
506
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetLists) },
|
|
380
507
|
)
|
|
381
508
|
expect(forSnapshot(res.data)).toMatchSnapshot()
|
|
382
509
|
})
|
|
@@ -384,15 +511,15 @@ describe('pds views with blocking from block lists', () => {
|
|
|
384
511
|
it('paginates getLists', async () => {
|
|
385
512
|
const full = await agent.api.app.bsky.graph.getLists(
|
|
386
513
|
{ actor: alice },
|
|
387
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
514
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetLists) },
|
|
388
515
|
)
|
|
389
516
|
const first = await agent.api.app.bsky.graph.getLists(
|
|
390
517
|
{ actor: alice, limit: 1 },
|
|
391
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
518
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetLists) },
|
|
392
519
|
)
|
|
393
520
|
const second = await agent.api.app.bsky.graph.getLists(
|
|
394
521
|
{ actor: alice, cursor: first.data.cursor },
|
|
395
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
522
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetLists) },
|
|
396
523
|
)
|
|
397
524
|
const combined = [...first.data.lists, ...second.data.lists]
|
|
398
525
|
expect(combined).toEqual(full.data.lists)
|
|
@@ -411,7 +538,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
411
538
|
|
|
412
539
|
const res = await agent.api.app.bsky.graph.getListBlocks(
|
|
413
540
|
{},
|
|
414
|
-
{
|
|
541
|
+
{
|
|
542
|
+
headers: await network.serviceHeaders(
|
|
543
|
+
dan,
|
|
544
|
+
ids.AppBskyGraphGetListBlocks,
|
|
545
|
+
),
|
|
546
|
+
},
|
|
415
547
|
)
|
|
416
548
|
expect(forSnapshot(res.data)).toMatchSnapshot()
|
|
417
549
|
})
|
|
@@ -419,15 +551,30 @@ describe('pds views with blocking from block lists', () => {
|
|
|
419
551
|
it('paginates getListBlocks', async () => {
|
|
420
552
|
const full = await agent.api.app.bsky.graph.getListBlocks(
|
|
421
553
|
{},
|
|
422
|
-
{
|
|
554
|
+
{
|
|
555
|
+
headers: await network.serviceHeaders(
|
|
556
|
+
dan,
|
|
557
|
+
ids.AppBskyGraphGetListBlocks,
|
|
558
|
+
),
|
|
559
|
+
},
|
|
423
560
|
)
|
|
424
561
|
const first = await agent.api.app.bsky.graph.getListBlocks(
|
|
425
562
|
{ limit: 1 },
|
|
426
|
-
{
|
|
563
|
+
{
|
|
564
|
+
headers: await network.serviceHeaders(
|
|
565
|
+
dan,
|
|
566
|
+
ids.AppBskyGraphGetListBlocks,
|
|
567
|
+
),
|
|
568
|
+
},
|
|
427
569
|
)
|
|
428
570
|
const second = await agent.api.app.bsky.graph.getListBlocks(
|
|
429
571
|
{ cursor: first.data.cursor },
|
|
430
|
-
{
|
|
572
|
+
{
|
|
573
|
+
headers: await network.serviceHeaders(
|
|
574
|
+
dan,
|
|
575
|
+
ids.AppBskyGraphGetListBlocks,
|
|
576
|
+
),
|
|
577
|
+
},
|
|
431
578
|
)
|
|
432
579
|
const combined = [...first.data.lists, ...second.data.lists]
|
|
433
580
|
expect(combined).toEqual(full.data.lists)
|
|
@@ -452,7 +599,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
452
599
|
|
|
453
600
|
const resCarol = await agent.api.app.bsky.feed.getTimeline(
|
|
454
601
|
{ limit: 100 },
|
|
455
|
-
{
|
|
602
|
+
{
|
|
603
|
+
headers: await network.serviceHeaders(
|
|
604
|
+
carol,
|
|
605
|
+
ids.AppBskyFeedGetTimeline,
|
|
606
|
+
),
|
|
607
|
+
},
|
|
456
608
|
)
|
|
457
609
|
expect(
|
|
458
610
|
resCarol.data.feed.some((post) => post.post.author.did === dan),
|
|
@@ -460,7 +612,9 @@ describe('pds views with blocking from block lists', () => {
|
|
|
460
612
|
|
|
461
613
|
const resDan = await agent.api.app.bsky.feed.getTimeline(
|
|
462
614
|
{ limit: 100 },
|
|
463
|
-
{
|
|
615
|
+
{
|
|
616
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyFeedGetTimeline),
|
|
617
|
+
},
|
|
464
618
|
)
|
|
465
619
|
expect(
|
|
466
620
|
resDan.data.feed.some((post) =>
|
|
@@ -482,7 +636,12 @@ describe('pds views with blocking from block lists', () => {
|
|
|
482
636
|
|
|
483
637
|
const resCarol = await agent.api.app.bsky.feed.getTimeline(
|
|
484
638
|
{ limit: 100 },
|
|
485
|
-
{
|
|
639
|
+
{
|
|
640
|
+
headers: await network.serviceHeaders(
|
|
641
|
+
carol,
|
|
642
|
+
ids.AppBskyFeedGetTimeline,
|
|
643
|
+
),
|
|
644
|
+
},
|
|
486
645
|
)
|
|
487
646
|
expect(
|
|
488
647
|
resCarol.data.feed.some((post) => post.post.author.did === dan),
|
|
@@ -490,7 +649,9 @@ describe('pds views with blocking from block lists', () => {
|
|
|
490
649
|
|
|
491
650
|
const resDan = await agent.api.app.bsky.feed.getTimeline(
|
|
492
651
|
{ limit: 100 },
|
|
493
|
-
{
|
|
652
|
+
{
|
|
653
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyFeedGetTimeline),
|
|
654
|
+
},
|
|
494
655
|
)
|
|
495
656
|
expect(
|
|
496
657
|
resDan.data.feed.some((post) =>
|