@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,22 +1,54 @@
|
|
|
1
1
|
import { AtpAgent } from '@atproto/api'
|
|
2
2
|
import { TestNetwork, SeedClient, basicSeed } from '@atproto/dev-env'
|
|
3
3
|
import { forSnapshot } from '../_util'
|
|
4
|
+
import { ids } from '../../src/lexicon/lexicons'
|
|
4
5
|
|
|
5
6
|
describe('bsky actor likes feed views', () => {
|
|
6
7
|
let network: TestNetwork
|
|
7
8
|
let agent: AtpAgent
|
|
8
|
-
let pdsAgent: AtpAgent
|
|
9
9
|
let sc: SeedClient
|
|
10
10
|
|
|
11
|
+
let referenceList: string
|
|
12
|
+
let eve: string
|
|
13
|
+
let frankie: string
|
|
14
|
+
let greta: string
|
|
15
|
+
|
|
11
16
|
beforeAll(async () => {
|
|
12
17
|
network = await TestNetwork.create({
|
|
13
18
|
dbPostgresSchema: 'bsky_views_actor_lists',
|
|
14
19
|
})
|
|
15
20
|
agent = network.bsky.getClient()
|
|
16
|
-
pdsAgent = network.pds.getClient()
|
|
17
21
|
sc = network.getSeedClient()
|
|
18
22
|
await basicSeed(sc)
|
|
23
|
+
await sc.createAccount('eve', {
|
|
24
|
+
handle: 'eve.test',
|
|
25
|
+
email: 'eve@eve.com',
|
|
26
|
+
password: 'hunter2',
|
|
27
|
+
})
|
|
28
|
+
await sc.createAccount('frankie', {
|
|
29
|
+
handle: 'frankie.test',
|
|
30
|
+
email: 'frankie@frankie.com',
|
|
31
|
+
password: '2hunter2real',
|
|
32
|
+
})
|
|
33
|
+
await sc.createAccount('greta', {
|
|
34
|
+
handle: 'greta.test',
|
|
35
|
+
email: 'greta@greta.com',
|
|
36
|
+
password: 'hunter4real',
|
|
37
|
+
})
|
|
38
|
+
const newList = await sc.createList(
|
|
39
|
+
sc.dids.eve,
|
|
40
|
+
'blah starter pack list!',
|
|
41
|
+
'reference',
|
|
42
|
+
)
|
|
43
|
+
await sc.addToList(sc.dids.eve, sc.dids.eve, newList)
|
|
44
|
+
await sc.addToList(sc.dids.eve, sc.dids.bob, newList)
|
|
45
|
+
await sc.addToList(sc.dids.eve, sc.dids.frankie, newList)
|
|
46
|
+
await sc.block(sc.dids.frankie, sc.dids.eve)
|
|
19
47
|
await network.processAll()
|
|
48
|
+
referenceList = newList.uriStr
|
|
49
|
+
eve = sc.dids.eve
|
|
50
|
+
frankie = sc.dids.frankie
|
|
51
|
+
greta = sc.dids.greta
|
|
20
52
|
})
|
|
21
53
|
|
|
22
54
|
afterAll(async () => {
|
|
@@ -24,39 +56,49 @@ describe('bsky actor likes feed views', () => {
|
|
|
24
56
|
})
|
|
25
57
|
|
|
26
58
|
it('does not include reference lists in getActorLists', async () => {
|
|
27
|
-
await
|
|
28
|
-
{
|
|
29
|
-
repo: sc.dids.alice,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
name: 'awesome starter pack list!',
|
|
33
|
-
description: '',
|
|
34
|
-
descriptionFacets: [],
|
|
35
|
-
avatar: undefined,
|
|
36
|
-
createdAt: new Date().toISOString(),
|
|
37
|
-
purpose: 'app.bsky.graph.defs#referencelist',
|
|
38
|
-
},
|
|
39
|
-
sc.getHeaders(sc.dids.alice),
|
|
40
|
-
)
|
|
41
|
-
await pdsAgent.api.app.bsky.graph.list.create(
|
|
42
|
-
{
|
|
43
|
-
repo: sc.dids.alice,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'cool curate list!',
|
|
47
|
-
description: '',
|
|
48
|
-
descriptionFacets: [],
|
|
49
|
-
avatar: undefined,
|
|
50
|
-
createdAt: new Date().toISOString(),
|
|
51
|
-
purpose: 'app.bsky.graph.defs#curatelist',
|
|
52
|
-
},
|
|
53
|
-
sc.getHeaders(sc.dids.alice),
|
|
54
|
-
)
|
|
59
|
+
await sc.createList(eve, 'cool curate list', 'curate')
|
|
55
60
|
await network.processAll()
|
|
56
61
|
const view = await agent.api.app.bsky.graph.getLists({
|
|
57
|
-
actor:
|
|
62
|
+
actor: eve,
|
|
58
63
|
})
|
|
59
64
|
expect(view.data.lists.length).toBe(1)
|
|
60
65
|
expect(forSnapshot(view.data.lists)).toMatchSnapshot()
|
|
61
66
|
})
|
|
67
|
+
|
|
68
|
+
it('does not include users with creator block relationship in reference lists for non-creator, in-list viewers', async () => {
|
|
69
|
+
const view = await agent.api.app.bsky.graph.getList(
|
|
70
|
+
{ list: referenceList },
|
|
71
|
+
{
|
|
72
|
+
headers: await network.serviceHeaders(frankie, ids.AppBskyGraphGetList),
|
|
73
|
+
},
|
|
74
|
+
)
|
|
75
|
+
expect(view.data.items.length).toBe(2)
|
|
76
|
+
expect(forSnapshot(view.data.items)).toMatchSnapshot()
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
it('does not include users with creator block relationship in reference lists for non-creator, not-in-list viewers', async () => {
|
|
80
|
+
const view = await agent.api.app.bsky.graph.getList(
|
|
81
|
+
{ list: referenceList },
|
|
82
|
+
{ headers: await network.serviceHeaders(greta, ids.AppBskyGraphGetList) },
|
|
83
|
+
)
|
|
84
|
+
expect(view.data.items.length).toBe(2)
|
|
85
|
+
expect(forSnapshot(view.data.items)).toMatchSnapshot()
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
it('does not include users with creator block relationship in reference lists for signed-out viewers', async () => {
|
|
89
|
+
const view = await agent.api.app.bsky.graph.getList({
|
|
90
|
+
list: referenceList,
|
|
91
|
+
})
|
|
92
|
+
expect(view.data.items.length).toBe(2)
|
|
93
|
+
expect(forSnapshot(view.data.items)).toMatchSnapshot()
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
it('does include users with creator block relationship in reference lists for creator', async () => {
|
|
97
|
+
const view = await agent.api.app.bsky.graph.getList(
|
|
98
|
+
{ list: referenceList },
|
|
99
|
+
{ headers: await network.serviceHeaders(eve, ids.AppBskyGraphGetList) },
|
|
100
|
+
)
|
|
101
|
+
expect(view.data.items.length).toBe(3)
|
|
102
|
+
expect(forSnapshot(view.data.items)).toMatchSnapshot()
|
|
103
|
+
})
|
|
62
104
|
})
|
|
@@ -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('bsky views with mutes from mute lists', () => {
|
|
6
7
|
let network: TestNetwork
|
|
@@ -98,7 +99,10 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
98
99
|
},
|
|
99
100
|
{
|
|
100
101
|
encoding: 'application/json',
|
|
101
|
-
headers: await network.serviceHeaders(
|
|
102
|
+
headers: await network.serviceHeaders(
|
|
103
|
+
dan,
|
|
104
|
+
ids.AppBskyGraphMuteActorList,
|
|
105
|
+
),
|
|
102
106
|
},
|
|
103
107
|
)
|
|
104
108
|
})
|
|
@@ -106,7 +110,12 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
106
110
|
it('flags mutes in threads', async () => {
|
|
107
111
|
const res = await agent.api.app.bsky.feed.getPostThread(
|
|
108
112
|
{ depth: 1, uri: sc.posts[alice][1].ref.uriStr },
|
|
109
|
-
{
|
|
113
|
+
{
|
|
114
|
+
headers: await network.serviceHeaders(
|
|
115
|
+
dan,
|
|
116
|
+
ids.AppBskyFeedGetPostThread,
|
|
117
|
+
),
|
|
118
|
+
},
|
|
110
119
|
)
|
|
111
120
|
expect(forSnapshot(res.data.thread)).toMatchSnapshot()
|
|
112
121
|
})
|
|
@@ -117,7 +126,12 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
117
126
|
|
|
118
127
|
const res = await agent.api.app.bsky.feed.getAuthorFeed(
|
|
119
128
|
{ actor: alice },
|
|
120
|
-
{
|
|
129
|
+
{
|
|
130
|
+
headers: await network.serviceHeaders(
|
|
131
|
+
dan,
|
|
132
|
+
ids.AppBskyFeedGetAuthorFeed,
|
|
133
|
+
),
|
|
134
|
+
},
|
|
121
135
|
)
|
|
122
136
|
expect(
|
|
123
137
|
res.data.feed.some((post) => [bob, carol].includes(post.post.author.did)),
|
|
@@ -127,7 +141,9 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
127
141
|
it('removes content from muted users on getTimeline', async () => {
|
|
128
142
|
const res = await agent.api.app.bsky.feed.getTimeline(
|
|
129
143
|
{ limit: 100 },
|
|
130
|
-
{
|
|
144
|
+
{
|
|
145
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyFeedGetTimeline),
|
|
146
|
+
},
|
|
131
147
|
)
|
|
132
148
|
expect(
|
|
133
149
|
res.data.feed.some((post) => [bob, carol].includes(post.post.author.did)),
|
|
@@ -141,7 +157,12 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
141
157
|
await sc.addToList(alice, dan, listRef)
|
|
142
158
|
const res = await agent.api.app.bsky.feed.getListFeed(
|
|
143
159
|
{ list: listRef.uriStr },
|
|
144
|
-
{
|
|
160
|
+
{
|
|
161
|
+
headers: await network.serviceHeaders(
|
|
162
|
+
alice,
|
|
163
|
+
ids.AppBskyFeedGetListFeed,
|
|
164
|
+
),
|
|
165
|
+
},
|
|
145
166
|
)
|
|
146
167
|
expect(
|
|
147
168
|
res.data.feed.some((post) => [bob, carol].includes(post.post.author.did)),
|
|
@@ -151,7 +172,9 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
151
172
|
it('returns mute status on getProfile', async () => {
|
|
152
173
|
const res = await agent.api.app.bsky.actor.getProfile(
|
|
153
174
|
{ actor: carol },
|
|
154
|
-
{
|
|
175
|
+
{
|
|
176
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyActorGetProfile),
|
|
177
|
+
},
|
|
155
178
|
)
|
|
156
179
|
expect(res.data.viewer?.muted).toBe(true)
|
|
157
180
|
expect(res.data.viewer?.mutedByList?.uri).toBe(listUri)
|
|
@@ -160,7 +183,9 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
160
183
|
it('returns mute status on getProfiles', async () => {
|
|
161
184
|
const res = await agent.api.app.bsky.actor.getProfiles(
|
|
162
185
|
{ actors: [alice, carol] },
|
|
163
|
-
{
|
|
186
|
+
{
|
|
187
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyActorGetProfiles),
|
|
188
|
+
},
|
|
164
189
|
)
|
|
165
190
|
expect(res.data.profiles[0].viewer?.muted).toBe(false)
|
|
166
191
|
expect(res.data.profiles[0].viewer?.mutedByList).toBeUndefined()
|
|
@@ -171,7 +196,9 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
171
196
|
it('ignores self-mutes', async () => {
|
|
172
197
|
const res = await agent.api.app.bsky.actor.getProfile(
|
|
173
198
|
{ actor: dan }, // dan subscribes to list that contains himself
|
|
174
|
-
{
|
|
199
|
+
{
|
|
200
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyActorGetProfile),
|
|
201
|
+
},
|
|
175
202
|
)
|
|
176
203
|
expect(res.data.viewer?.muted).toBe(false)
|
|
177
204
|
expect(res.data.viewer?.mutedByList).toBeUndefined()
|
|
@@ -182,7 +209,12 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
182
209
|
{
|
|
183
210
|
limit: 100,
|
|
184
211
|
},
|
|
185
|
-
{
|
|
212
|
+
{
|
|
213
|
+
headers: await network.serviceHeaders(
|
|
214
|
+
dan,
|
|
215
|
+
ids.AppBskyNotificationListNotifications,
|
|
216
|
+
),
|
|
217
|
+
},
|
|
186
218
|
)
|
|
187
219
|
expect(
|
|
188
220
|
res.data.notifications.some((notif) =>
|
|
@@ -200,7 +232,12 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
200
232
|
{
|
|
201
233
|
limit: 100,
|
|
202
234
|
},
|
|
203
|
-
{
|
|
235
|
+
{
|
|
236
|
+
headers: await network.serviceHeaders(
|
|
237
|
+
dan,
|
|
238
|
+
ids.AppBskyActorGetSuggestions,
|
|
239
|
+
),
|
|
240
|
+
},
|
|
204
241
|
)
|
|
205
242
|
for (const actor of res.data.actors) {
|
|
206
243
|
if ([bob, carol].includes(actor.did)) {
|
|
@@ -216,7 +253,7 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
216
253
|
it('returns the contents of a list', async () => {
|
|
217
254
|
const res = await agent.api.app.bsky.graph.getList(
|
|
218
255
|
{ list: listUri },
|
|
219
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
256
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetList) },
|
|
220
257
|
)
|
|
221
258
|
expect(forSnapshot(res.data)).toMatchSnapshot()
|
|
222
259
|
})
|
|
@@ -224,15 +261,15 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
224
261
|
it('paginates getList', async () => {
|
|
225
262
|
const full = await agent.api.app.bsky.graph.getList(
|
|
226
263
|
{ list: listUri },
|
|
227
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
264
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetList) },
|
|
228
265
|
)
|
|
229
266
|
const first = await agent.api.app.bsky.graph.getList(
|
|
230
267
|
{ list: listUri, limit: 1 },
|
|
231
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
268
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetList) },
|
|
232
269
|
)
|
|
233
270
|
const second = await agent.api.app.bsky.graph.getList(
|
|
234
271
|
{ list: listUri, cursor: first.data.cursor },
|
|
235
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
272
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetList) },
|
|
236
273
|
)
|
|
237
274
|
const combined = [...first.data.items, ...second.data.items]
|
|
238
275
|
expect(combined).toEqual(full.data.items)
|
|
@@ -257,7 +294,7 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
257
294
|
|
|
258
295
|
const res = await agent.api.app.bsky.graph.getLists(
|
|
259
296
|
{ actor: alice },
|
|
260
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
297
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetLists) },
|
|
261
298
|
)
|
|
262
299
|
expect(forSnapshot(res.data)).toMatchSnapshot()
|
|
263
300
|
})
|
|
@@ -265,15 +302,15 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
265
302
|
it('paginates getLists', async () => {
|
|
266
303
|
const full = await agent.api.app.bsky.graph.getLists(
|
|
267
304
|
{ actor: alice },
|
|
268
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
305
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetLists) },
|
|
269
306
|
)
|
|
270
307
|
const first = await agent.api.app.bsky.graph.getLists(
|
|
271
308
|
{ actor: alice, limit: 1 },
|
|
272
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
309
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetLists) },
|
|
273
310
|
)
|
|
274
311
|
const second = await agent.api.app.bsky.graph.getLists(
|
|
275
312
|
{ actor: alice, cursor: first.data.cursor },
|
|
276
|
-
{ headers: await network.serviceHeaders(dan) },
|
|
313
|
+
{ headers: await network.serviceHeaders(dan, ids.AppBskyGraphGetLists) },
|
|
277
314
|
)
|
|
278
315
|
const combined = [...first.data.lists, ...second.data.lists]
|
|
279
316
|
expect(combined).toEqual(full.data.lists)
|
|
@@ -286,13 +323,21 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
286
323
|
},
|
|
287
324
|
{
|
|
288
325
|
encoding: 'application/json',
|
|
289
|
-
headers: await network.serviceHeaders(
|
|
326
|
+
headers: await network.serviceHeaders(
|
|
327
|
+
dan,
|
|
328
|
+
ids.AppBskyGraphMuteActorList,
|
|
329
|
+
),
|
|
290
330
|
},
|
|
291
331
|
)
|
|
292
332
|
|
|
293
333
|
const res = await agent.api.app.bsky.graph.getListMutes(
|
|
294
334
|
{},
|
|
295
|
-
{
|
|
335
|
+
{
|
|
336
|
+
headers: await network.serviceHeaders(
|
|
337
|
+
dan,
|
|
338
|
+
ids.AppBskyGraphGetListMutes,
|
|
339
|
+
),
|
|
340
|
+
},
|
|
296
341
|
)
|
|
297
342
|
expect(forSnapshot(res.data)).toMatchSnapshot()
|
|
298
343
|
})
|
|
@@ -300,15 +345,30 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
300
345
|
it('paginates getListMutes', async () => {
|
|
301
346
|
const full = await agent.api.app.bsky.graph.getListMutes(
|
|
302
347
|
{},
|
|
303
|
-
{
|
|
348
|
+
{
|
|
349
|
+
headers: await network.serviceHeaders(
|
|
350
|
+
dan,
|
|
351
|
+
ids.AppBskyGraphGetListMutes,
|
|
352
|
+
),
|
|
353
|
+
},
|
|
304
354
|
)
|
|
305
355
|
const first = await agent.api.app.bsky.graph.getListMutes(
|
|
306
356
|
{ limit: 1 },
|
|
307
|
-
{
|
|
357
|
+
{
|
|
358
|
+
headers: await network.serviceHeaders(
|
|
359
|
+
dan,
|
|
360
|
+
ids.AppBskyGraphGetListMutes,
|
|
361
|
+
),
|
|
362
|
+
},
|
|
308
363
|
)
|
|
309
364
|
const second = await agent.api.app.bsky.graph.getListMutes(
|
|
310
365
|
{ cursor: first.data.cursor },
|
|
311
|
-
{
|
|
366
|
+
{
|
|
367
|
+
headers: await network.serviceHeaders(
|
|
368
|
+
dan,
|
|
369
|
+
ids.AppBskyGraphGetListMutes,
|
|
370
|
+
),
|
|
371
|
+
},
|
|
312
372
|
)
|
|
313
373
|
const combined = [...first.data.lists, ...second.data.lists]
|
|
314
374
|
expect(combined).toEqual(full.data.lists)
|
|
@@ -321,13 +381,21 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
321
381
|
},
|
|
322
382
|
{
|
|
323
383
|
encoding: 'application/json',
|
|
324
|
-
headers: await network.serviceHeaders(
|
|
384
|
+
headers: await network.serviceHeaders(
|
|
385
|
+
dan,
|
|
386
|
+
ids.AppBskyGraphUnmuteActorList,
|
|
387
|
+
),
|
|
325
388
|
},
|
|
326
389
|
)
|
|
327
390
|
|
|
328
391
|
const res = await agent.api.app.bsky.graph.getListMutes(
|
|
329
392
|
{},
|
|
330
|
-
{
|
|
393
|
+
{
|
|
394
|
+
headers: await network.serviceHeaders(
|
|
395
|
+
dan,
|
|
396
|
+
ids.AppBskyGraphGetListMutes,
|
|
397
|
+
),
|
|
398
|
+
},
|
|
331
399
|
)
|
|
332
400
|
expect(res.data.lists.length).toBe(1)
|
|
333
401
|
})
|
|
@@ -353,7 +421,7 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
353
421
|
|
|
354
422
|
const got = await agent.api.app.bsky.graph.getList(
|
|
355
423
|
{ list: listUri },
|
|
356
|
-
{ headers: await network.serviceHeaders(alice) },
|
|
424
|
+
{ headers: await network.serviceHeaders(alice, ids.AppBskyGraphGetList) },
|
|
357
425
|
)
|
|
358
426
|
expect(got.data.list.name).toBe('updated alice mutes')
|
|
359
427
|
expect(got.data.list.description).toBe('new descript')
|
|
@@ -372,7 +440,7 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
372
440
|
await network.processAll()
|
|
373
441
|
const res = await agent.api.app.bsky.feed.getPosts(
|
|
374
442
|
{ uris: [postRef.ref.uriStr] },
|
|
375
|
-
{ headers: await network.serviceHeaders(alice) },
|
|
443
|
+
{ headers: await network.serviceHeaders(alice, ids.AppBskyFeedGetPosts) },
|
|
376
444
|
)
|
|
377
445
|
expect(res.data.posts.length).toBe(1)
|
|
378
446
|
expect(forSnapshot(res.data.posts[0])).toMatchSnapshot()
|
|
@@ -397,7 +465,9 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
397
465
|
|
|
398
466
|
const res = await agent.api.app.bsky.feed.getTimeline(
|
|
399
467
|
{ limit: 100 },
|
|
400
|
-
{
|
|
468
|
+
{
|
|
469
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyFeedGetTimeline),
|
|
470
|
+
},
|
|
401
471
|
)
|
|
402
472
|
expect(
|
|
403
473
|
res.data.feed.some((post) => [bob, carol].includes(post.post.author.did)),
|
|
@@ -417,7 +487,9 @@ describe('bsky views with mutes from mute lists', () => {
|
|
|
417
487
|
|
|
418
488
|
const res = await agent.api.app.bsky.feed.getTimeline(
|
|
419
489
|
{ limit: 100 },
|
|
420
|
-
{
|
|
490
|
+
{
|
|
491
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyFeedGetTimeline),
|
|
492
|
+
},
|
|
421
493
|
)
|
|
422
494
|
expect(
|
|
423
495
|
res.data.feed.some((post) => [bob, carol].includes(post.post.author.did)),
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
usersBulkSeed,
|
|
7
7
|
} from '@atproto/dev-env'
|
|
8
8
|
import { forSnapshot, paginateAll } from '../_util'
|
|
9
|
+
import { ids } from '../../src/lexicon/lexicons'
|
|
9
10
|
|
|
10
11
|
describe('mute views', () => {
|
|
11
12
|
let network: TestNetwork
|
|
@@ -45,7 +46,10 @@ describe('mute views', () => {
|
|
|
45
46
|
await agent.api.app.bsky.graph.muteActor(
|
|
46
47
|
{ actor: did },
|
|
47
48
|
{
|
|
48
|
-
headers: await network.serviceHeaders(
|
|
49
|
+
headers: await network.serviceHeaders(
|
|
50
|
+
alice,
|
|
51
|
+
ids.AppBskyGraphMuteActor,
|
|
52
|
+
),
|
|
49
53
|
encoding: 'application/json',
|
|
50
54
|
},
|
|
51
55
|
)
|
|
@@ -59,7 +63,12 @@ describe('mute views', () => {
|
|
|
59
63
|
it('flags mutes in threads', async () => {
|
|
60
64
|
const res = await agent.api.app.bsky.feed.getPostThread(
|
|
61
65
|
{ depth: 1, uri: sc.posts[alice][1].ref.uriStr },
|
|
62
|
-
{
|
|
66
|
+
{
|
|
67
|
+
headers: await network.serviceHeaders(
|
|
68
|
+
alice,
|
|
69
|
+
ids.AppBskyFeedGetPostThread,
|
|
70
|
+
),
|
|
71
|
+
},
|
|
63
72
|
)
|
|
64
73
|
expect(forSnapshot(res.data.thread)).toMatchSnapshot()
|
|
65
74
|
})
|
|
@@ -71,7 +80,12 @@ describe('mute views', () => {
|
|
|
71
80
|
|
|
72
81
|
const res = await agent.api.app.bsky.feed.getAuthorFeed(
|
|
73
82
|
{ actor: dan },
|
|
74
|
-
{
|
|
83
|
+
{
|
|
84
|
+
headers: await network.serviceHeaders(
|
|
85
|
+
alice,
|
|
86
|
+
ids.AppBskyFeedGetAuthorFeed,
|
|
87
|
+
),
|
|
88
|
+
},
|
|
75
89
|
)
|
|
76
90
|
expect(
|
|
77
91
|
res.data.feed.some((post) => [bob, carol].includes(post.post.author.did)),
|
|
@@ -81,7 +95,12 @@ describe('mute views', () => {
|
|
|
81
95
|
it('removes content from muted users on getTimeline', async () => {
|
|
82
96
|
const res = await agent.api.app.bsky.feed.getTimeline(
|
|
83
97
|
{ limit: 100 },
|
|
84
|
-
{
|
|
98
|
+
{
|
|
99
|
+
headers: await network.serviceHeaders(
|
|
100
|
+
alice,
|
|
101
|
+
ids.AppBskyFeedGetTimeline,
|
|
102
|
+
),
|
|
103
|
+
},
|
|
85
104
|
)
|
|
86
105
|
expect(
|
|
87
106
|
res.data.feed.some((post) => [bob, carol].includes(post.post.author.did)),
|
|
@@ -95,7 +114,12 @@ describe('mute views', () => {
|
|
|
95
114
|
await sc.addToList(alice, dan, listRef)
|
|
96
115
|
const res = await agent.api.app.bsky.feed.getListFeed(
|
|
97
116
|
{ list: listRef.uriStr },
|
|
98
|
-
{
|
|
117
|
+
{
|
|
118
|
+
headers: await network.serviceHeaders(
|
|
119
|
+
alice,
|
|
120
|
+
ids.AppBskyFeedGetListFeed,
|
|
121
|
+
),
|
|
122
|
+
},
|
|
99
123
|
)
|
|
100
124
|
expect(
|
|
101
125
|
res.data.feed.some((post) => [bob, carol].includes(post.post.author.did)),
|
|
@@ -105,7 +129,12 @@ describe('mute views', () => {
|
|
|
105
129
|
it('returns mute status on getProfile', async () => {
|
|
106
130
|
const res = await agent.api.app.bsky.actor.getProfile(
|
|
107
131
|
{ actor: bob },
|
|
108
|
-
{
|
|
132
|
+
{
|
|
133
|
+
headers: await network.serviceHeaders(
|
|
134
|
+
alice,
|
|
135
|
+
ids.AppBskyActorGetProfile,
|
|
136
|
+
),
|
|
137
|
+
},
|
|
109
138
|
)
|
|
110
139
|
expect(res.data.viewer?.muted).toBe(true)
|
|
111
140
|
})
|
|
@@ -113,7 +142,12 @@ describe('mute views', () => {
|
|
|
113
142
|
it('returns mute status on getProfiles', async () => {
|
|
114
143
|
const res = await agent.api.app.bsky.actor.getProfiles(
|
|
115
144
|
{ actors: [bob, carol, dan] },
|
|
116
|
-
{
|
|
145
|
+
{
|
|
146
|
+
headers: await network.serviceHeaders(
|
|
147
|
+
alice,
|
|
148
|
+
ids.AppBskyActorGetProfiles,
|
|
149
|
+
),
|
|
150
|
+
},
|
|
117
151
|
)
|
|
118
152
|
expect(res.data.profiles[0].viewer?.muted).toBe(true)
|
|
119
153
|
expect(res.data.profiles[1].viewer?.muted).toBe(true)
|
|
@@ -125,7 +159,12 @@ describe('mute views', () => {
|
|
|
125
159
|
{
|
|
126
160
|
limit: 100,
|
|
127
161
|
},
|
|
128
|
-
{
|
|
162
|
+
{
|
|
163
|
+
headers: await network.serviceHeaders(
|
|
164
|
+
alice,
|
|
165
|
+
ids.AppBskyNotificationListNotifications,
|
|
166
|
+
),
|
|
167
|
+
},
|
|
129
168
|
)
|
|
130
169
|
expect(
|
|
131
170
|
res.data.notifications.some((notif) =>
|
|
@@ -145,7 +184,12 @@ describe('mute views', () => {
|
|
|
145
184
|
{
|
|
146
185
|
limit: 100,
|
|
147
186
|
},
|
|
148
|
-
{
|
|
187
|
+
{
|
|
188
|
+
headers: await network.serviceHeaders(
|
|
189
|
+
alice,
|
|
190
|
+
ids.AppBskyActorGetSuggestions,
|
|
191
|
+
),
|
|
192
|
+
},
|
|
149
193
|
)
|
|
150
194
|
for (const actor of res.data.actors) {
|
|
151
195
|
if (mutes.includes(actor.did) || mutes.includes(actor.handle)) {
|
|
@@ -159,7 +203,9 @@ describe('mute views', () => {
|
|
|
159
203
|
it('fetches mutes for the logged-in user.', async () => {
|
|
160
204
|
const { data: view } = await agent.api.app.bsky.graph.getMutes(
|
|
161
205
|
{},
|
|
162
|
-
{
|
|
206
|
+
{
|
|
207
|
+
headers: await network.serviceHeaders(alice, ids.AppBskyGraphGetMutes),
|
|
208
|
+
},
|
|
163
209
|
)
|
|
164
210
|
expect(forSnapshot(view.mutes)).toMatchSnapshot()
|
|
165
211
|
})
|
|
@@ -169,7 +215,12 @@ describe('mute views', () => {
|
|
|
169
215
|
const paginator = async (cursor?: string) => {
|
|
170
216
|
const { data: view } = await agent.api.app.bsky.graph.getMutes(
|
|
171
217
|
{ cursor, limit: 2 },
|
|
172
|
-
{
|
|
218
|
+
{
|
|
219
|
+
headers: await network.serviceHeaders(
|
|
220
|
+
alice,
|
|
221
|
+
ids.AppBskyGraphGetMutes,
|
|
222
|
+
),
|
|
223
|
+
},
|
|
173
224
|
)
|
|
174
225
|
return view
|
|
175
226
|
}
|
|
@@ -181,7 +232,9 @@ describe('mute views', () => {
|
|
|
181
232
|
|
|
182
233
|
const full = await agent.api.app.bsky.graph.getMutes(
|
|
183
234
|
{},
|
|
184
|
-
{
|
|
235
|
+
{
|
|
236
|
+
headers: await network.serviceHeaders(alice, ids.AppBskyGraphGetMutes),
|
|
237
|
+
},
|
|
185
238
|
)
|
|
186
239
|
|
|
187
240
|
expect(full.data.mutes.length).toEqual(8)
|
|
@@ -191,7 +244,9 @@ describe('mute views', () => {
|
|
|
191
244
|
it('removes mute.', async () => {
|
|
192
245
|
const { data: initial } = await agent.api.app.bsky.graph.getMutes(
|
|
193
246
|
{},
|
|
194
|
-
{
|
|
247
|
+
{
|
|
248
|
+
headers: await network.serviceHeaders(alice, ids.AppBskyGraphGetMutes),
|
|
249
|
+
},
|
|
195
250
|
)
|
|
196
251
|
expect(initial.mutes.length).toEqual(8)
|
|
197
252
|
expect(initial.mutes.map((m) => m.handle)).toContain('elta48.test')
|
|
@@ -199,14 +254,19 @@ describe('mute views', () => {
|
|
|
199
254
|
await agent.api.app.bsky.graph.unmuteActor(
|
|
200
255
|
{ actor: sc.dids['elta48.test'] },
|
|
201
256
|
{
|
|
202
|
-
headers: await network.serviceHeaders(
|
|
257
|
+
headers: await network.serviceHeaders(
|
|
258
|
+
alice,
|
|
259
|
+
ids.AppBskyGraphUnmuteActor,
|
|
260
|
+
),
|
|
203
261
|
encoding: 'application/json',
|
|
204
262
|
},
|
|
205
263
|
)
|
|
206
264
|
|
|
207
265
|
const { data: final } = await agent.api.app.bsky.graph.getMutes(
|
|
208
266
|
{},
|
|
209
|
-
{
|
|
267
|
+
{
|
|
268
|
+
headers: await network.serviceHeaders(alice, ids.AppBskyGraphGetMutes),
|
|
269
|
+
},
|
|
210
270
|
)
|
|
211
271
|
expect(final.mutes.length).toEqual(7)
|
|
212
272
|
expect(final.mutes.map((m) => m.handle)).not.toContain('elta48.test')
|
|
@@ -214,7 +274,7 @@ describe('mute views', () => {
|
|
|
214
274
|
await agent.api.app.bsky.graph.muteActor(
|
|
215
275
|
{ actor: sc.dids['elta48.test'] },
|
|
216
276
|
{
|
|
217
|
-
headers: await network.serviceHeaders(alice),
|
|
277
|
+
headers: await network.serviceHeaders(alice, ids.AppBskyGraphMuteActor),
|
|
218
278
|
encoding: 'application/json',
|
|
219
279
|
},
|
|
220
280
|
)
|
|
@@ -224,7 +284,7 @@ describe('mute views', () => {
|
|
|
224
284
|
const promise = agent.api.app.bsky.graph.muteActor(
|
|
225
285
|
{ actor: alice },
|
|
226
286
|
{
|
|
227
|
-
headers: await network.serviceHeaders(alice),
|
|
287
|
+
headers: await network.serviceHeaders(alice, ids.AppBskyGraphMuteActor),
|
|
228
288
|
encoding: 'application/json',
|
|
229
289
|
},
|
|
230
290
|
)
|