@atproto/bsky 0.0.75 → 0.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/api/app/bsky/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/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/getPosts.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getPosts.js +8 -1
- package/dist/api/app/bsky/feed/getPosts.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/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/hydration/hydrator.d.ts +1 -0
- package/dist/hydration/hydrator.d.ts.map +1 -1
- package/dist/hydration/hydrator.js +15 -6
- package/dist/hydration/hydrator.js.map +1 -1
- package/package.json +4 -4
- 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/getFeed.ts +12 -1
- package/src/api/app/bsky/feed/getPosts.ts +9 -1
- package/src/api/app/bsky/graph/getList.ts +47 -4
- package/src/auth-verifier.ts +78 -51
- package/src/hydration/hydrator.ts +18 -2
- package/tests/admin/admin-auth.test.ts +15 -8
- package/tests/auth.test.ts +2 -1
- package/tests/data-plane/handle-invalidation.test.ts +31 -5
- package/tests/data-plane/indexing.test.ts +138 -23
- package/tests/data-plane/thread-mutes.test.ts +41 -9
- package/tests/feed-generation.test.ts +150 -32
- package/tests/server.test.ts +1 -1
- package/tests/views/__snapshots__/lists.test.ts.snap +145 -26
- package/tests/views/__snapshots__/starter-packs.test.ts.snap +245 -4
- 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 +73 -12
- package/tests/views/block-lists.test.ts +201 -40
- package/tests/views/blocks.test.ts +245 -46
- 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/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
package/tests/auth.test.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { AtpAgent } from '@atproto/api'
|
|
|
2
2
|
import { SeedClient, TestNetwork, usersSeed } from '@atproto/dev-env'
|
|
3
3
|
import { createServiceJwt } from '@atproto/xrpc-server'
|
|
4
4
|
import { Keypair, Secp256k1Keypair } from '@atproto/crypto'
|
|
5
|
+
import { ids } from '../src/lexicon/lexicons'
|
|
5
6
|
|
|
6
7
|
describe('auth', () => {
|
|
7
8
|
let network: TestNetwork
|
|
@@ -29,7 +30,7 @@ describe('auth', () => {
|
|
|
29
30
|
const jwt = await createServiceJwt({
|
|
30
31
|
iss: issuer,
|
|
31
32
|
aud: network.bsky.ctx.cfg.serverDid,
|
|
32
|
-
lxm:
|
|
33
|
+
lxm: ids.AppBskyActorGetProfile,
|
|
33
34
|
keypair,
|
|
34
35
|
})
|
|
35
36
|
return agent.api.app.bsky.actor.getProfile(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DAY } from '@atproto/common'
|
|
2
2
|
import { TestNetwork, SeedClient, usersSeed } from '@atproto/dev-env'
|
|
3
3
|
import { AtpAgent } from '@atproto/api'
|
|
4
|
+
import { ids } from '../../src/lexicon/lexicons'
|
|
4
5
|
|
|
5
6
|
describe('handle invalidation', () => {
|
|
6
7
|
let network: TestNetwork
|
|
@@ -62,7 +63,12 @@ describe('handle invalidation', () => {
|
|
|
62
63
|
|
|
63
64
|
const res = await agent.api.app.bsky.actor.getProfile(
|
|
64
65
|
{ actor: eveAccnt.did },
|
|
65
|
-
{
|
|
66
|
+
{
|
|
67
|
+
headers: await network.serviceHeaders(
|
|
68
|
+
alice,
|
|
69
|
+
ids.AppBskyActorGetProfile,
|
|
70
|
+
),
|
|
71
|
+
},
|
|
66
72
|
)
|
|
67
73
|
expect(res.data.handle).toEqual('handle.invalid')
|
|
68
74
|
})
|
|
@@ -77,7 +83,12 @@ describe('handle invalidation', () => {
|
|
|
77
83
|
await network.processAll()
|
|
78
84
|
const res = await agent.api.app.bsky.actor.getProfile(
|
|
79
85
|
{ actor: alice },
|
|
80
|
-
{
|
|
86
|
+
{
|
|
87
|
+
headers: await network.serviceHeaders(
|
|
88
|
+
alice,
|
|
89
|
+
ids.AppBskyActorGetProfile,
|
|
90
|
+
),
|
|
91
|
+
},
|
|
81
92
|
)
|
|
82
93
|
expect(res.data.handle).toEqual('handle.invalid')
|
|
83
94
|
})
|
|
@@ -92,7 +103,12 @@ describe('handle invalidation', () => {
|
|
|
92
103
|
await network.processAll()
|
|
93
104
|
const res = await agent.api.app.bsky.actor.getProfile(
|
|
94
105
|
{ actor: alice },
|
|
95
|
-
{
|
|
106
|
+
{
|
|
107
|
+
headers: await network.serviceHeaders(
|
|
108
|
+
alice,
|
|
109
|
+
ids.AppBskyActorGetProfile,
|
|
110
|
+
),
|
|
111
|
+
},
|
|
96
112
|
)
|
|
97
113
|
expect(res.data.handle).toEqual(sc.accounts[alice].handle)
|
|
98
114
|
})
|
|
@@ -112,13 +128,23 @@ describe('handle invalidation', () => {
|
|
|
112
128
|
|
|
113
129
|
const aliceRes = await agent.api.app.bsky.actor.getProfile(
|
|
114
130
|
{ actor: alice },
|
|
115
|
-
{
|
|
131
|
+
{
|
|
132
|
+
headers: await network.serviceHeaders(
|
|
133
|
+
alice,
|
|
134
|
+
ids.AppBskyActorGetProfile,
|
|
135
|
+
),
|
|
136
|
+
},
|
|
116
137
|
)
|
|
117
138
|
expect(aliceRes.data.handle).toEqual('handle.invalid')
|
|
118
139
|
|
|
119
140
|
const bobRes = await agent.api.app.bsky.actor.getProfile(
|
|
120
141
|
{ actor: bob },
|
|
121
|
-
{
|
|
142
|
+
{
|
|
143
|
+
headers: await network.serviceHeaders(
|
|
144
|
+
alice,
|
|
145
|
+
ids.AppBskyActorGetProfile,
|
|
146
|
+
),
|
|
147
|
+
},
|
|
122
148
|
)
|
|
123
149
|
expect(bobRes.data.handle).toEqual(sc.accounts[alice].handle)
|
|
124
150
|
})
|
|
@@ -97,7 +97,12 @@ describe('indexing', () => {
|
|
|
97
97
|
|
|
98
98
|
const getAfterCreate = await agent.api.app.bsky.feed.getPostThread(
|
|
99
99
|
{ uri: uri.toString() },
|
|
100
|
-
{
|
|
100
|
+
{
|
|
101
|
+
headers: await network.serviceHeaders(
|
|
102
|
+
sc.dids.alice,
|
|
103
|
+
ids.AppBskyFeedGetPostThread,
|
|
104
|
+
),
|
|
105
|
+
},
|
|
101
106
|
)
|
|
102
107
|
expect(forSnapshot(getAfterCreate.data)).toMatchSnapshot()
|
|
103
108
|
const createNotifications = await getNotifications(db, uri)
|
|
@@ -107,7 +112,12 @@ describe('indexing', () => {
|
|
|
107
112
|
|
|
108
113
|
const getAfterUpdate = await agent.api.app.bsky.feed.getPostThread(
|
|
109
114
|
{ uri: uri.toString() },
|
|
110
|
-
{
|
|
115
|
+
{
|
|
116
|
+
headers: await network.serviceHeaders(
|
|
117
|
+
sc.dids.alice,
|
|
118
|
+
ids.AppBskyFeedGetPostThread,
|
|
119
|
+
),
|
|
120
|
+
},
|
|
111
121
|
)
|
|
112
122
|
expect(forSnapshot(getAfterUpdate.data)).toMatchSnapshot()
|
|
113
123
|
const updateNotifications = await getNotifications(db, uri)
|
|
@@ -117,7 +127,12 @@ describe('indexing', () => {
|
|
|
117
127
|
|
|
118
128
|
const getAfterDelete = agent.api.app.bsky.feed.getPostThread(
|
|
119
129
|
{ uri: uri.toString() },
|
|
120
|
-
{
|
|
130
|
+
{
|
|
131
|
+
headers: await network.serviceHeaders(
|
|
132
|
+
sc.dids.alice,
|
|
133
|
+
ids.AppBskyFeedGetPostThread,
|
|
134
|
+
),
|
|
135
|
+
},
|
|
121
136
|
)
|
|
122
137
|
await expect(getAfterDelete).rejects.toThrow(/Post not found:/)
|
|
123
138
|
const deleteNotifications = await getNotifications(db, uri)
|
|
@@ -162,7 +177,12 @@ describe('indexing', () => {
|
|
|
162
177
|
|
|
163
178
|
const getAfterCreate = await agent.api.app.bsky.actor.getProfile(
|
|
164
179
|
{ actor: sc.dids.dan },
|
|
165
|
-
{
|
|
180
|
+
{
|
|
181
|
+
headers: await network.serviceHeaders(
|
|
182
|
+
sc.dids.alice,
|
|
183
|
+
ids.AppBskyActorGetProfile,
|
|
184
|
+
),
|
|
185
|
+
},
|
|
166
186
|
)
|
|
167
187
|
expect(forSnapshot(getAfterCreate.data)).toMatchSnapshot()
|
|
168
188
|
|
|
@@ -171,7 +191,12 @@ describe('indexing', () => {
|
|
|
171
191
|
|
|
172
192
|
const getAfterUpdate = await agent.api.app.bsky.actor.getProfile(
|
|
173
193
|
{ actor: sc.dids.dan },
|
|
174
|
-
{
|
|
194
|
+
{
|
|
195
|
+
headers: await network.serviceHeaders(
|
|
196
|
+
sc.dids.alice,
|
|
197
|
+
ids.AppBskyActorGetProfile,
|
|
198
|
+
),
|
|
199
|
+
},
|
|
175
200
|
)
|
|
176
201
|
expect(forSnapshot(getAfterUpdate.data)).toMatchSnapshot()
|
|
177
202
|
|
|
@@ -180,7 +205,12 @@ describe('indexing', () => {
|
|
|
180
205
|
|
|
181
206
|
const getAfterDelete = await agent.api.app.bsky.actor.getProfile(
|
|
182
207
|
{ actor: sc.dids.dan },
|
|
183
|
-
{
|
|
208
|
+
{
|
|
209
|
+
headers: await network.serviceHeaders(
|
|
210
|
+
sc.dids.alice,
|
|
211
|
+
ids.AppBskyActorGetProfile,
|
|
212
|
+
),
|
|
213
|
+
},
|
|
184
214
|
)
|
|
185
215
|
expect(forSnapshot(getAfterDelete.data)).toMatchSnapshot()
|
|
186
216
|
})
|
|
@@ -331,7 +361,12 @@ describe('indexing', () => {
|
|
|
331
361
|
data: { notifications },
|
|
332
362
|
} = await agent.api.app.bsky.notification.listNotifications(
|
|
333
363
|
{},
|
|
334
|
-
{
|
|
364
|
+
{
|
|
365
|
+
headers: await network.serviceHeaders(
|
|
366
|
+
sc.dids.bob,
|
|
367
|
+
ids.AppBskyNotificationListNotifications,
|
|
368
|
+
),
|
|
369
|
+
},
|
|
335
370
|
)
|
|
336
371
|
|
|
337
372
|
expect(notifications).toHaveLength(2)
|
|
@@ -404,15 +439,30 @@ describe('indexing', () => {
|
|
|
404
439
|
// Mark originals
|
|
405
440
|
const { data: origProfile } = await agent.api.app.bsky.actor.getProfile(
|
|
406
441
|
{ actor: sc.dids.alice },
|
|
407
|
-
{
|
|
442
|
+
{
|
|
443
|
+
headers: await network.serviceHeaders(
|
|
444
|
+
sc.dids.alice,
|
|
445
|
+
ids.AppBskyActorGetProfile,
|
|
446
|
+
),
|
|
447
|
+
},
|
|
408
448
|
)
|
|
409
449
|
const { data: origFeed } = await agent.api.app.bsky.feed.getAuthorFeed(
|
|
410
450
|
{ actor: sc.dids.alice },
|
|
411
|
-
{
|
|
451
|
+
{
|
|
452
|
+
headers: await network.serviceHeaders(
|
|
453
|
+
sc.dids.alice,
|
|
454
|
+
ids.AppBskyFeedGetAuthorFeed,
|
|
455
|
+
),
|
|
456
|
+
},
|
|
412
457
|
)
|
|
413
458
|
const { data: origFollows } = await agent.api.app.bsky.graph.getFollows(
|
|
414
459
|
{ actor: sc.dids.alice },
|
|
415
|
-
{
|
|
460
|
+
{
|
|
461
|
+
headers: await network.serviceHeaders(
|
|
462
|
+
sc.dids.alice,
|
|
463
|
+
ids.AppBskyGraphGetFollows,
|
|
464
|
+
),
|
|
465
|
+
},
|
|
416
466
|
)
|
|
417
467
|
// Index
|
|
418
468
|
const { data: commit } =
|
|
@@ -424,15 +474,30 @@ describe('indexing', () => {
|
|
|
424
474
|
// Check
|
|
425
475
|
const { data: profile } = await agent.api.app.bsky.actor.getProfile(
|
|
426
476
|
{ actor: sc.dids.alice },
|
|
427
|
-
{
|
|
477
|
+
{
|
|
478
|
+
headers: await network.serviceHeaders(
|
|
479
|
+
sc.dids.alice,
|
|
480
|
+
ids.AppBskyActorGetProfile,
|
|
481
|
+
),
|
|
482
|
+
},
|
|
428
483
|
)
|
|
429
484
|
const { data: feed } = await agent.api.app.bsky.feed.getAuthorFeed(
|
|
430
485
|
{ actor: sc.dids.alice },
|
|
431
|
-
{
|
|
486
|
+
{
|
|
487
|
+
headers: await network.serviceHeaders(
|
|
488
|
+
sc.dids.alice,
|
|
489
|
+
ids.AppBskyFeedGetAuthorFeed,
|
|
490
|
+
),
|
|
491
|
+
},
|
|
432
492
|
)
|
|
433
493
|
const { data: follows } = await agent.api.app.bsky.graph.getFollows(
|
|
434
494
|
{ actor: sc.dids.alice },
|
|
435
|
-
{
|
|
495
|
+
{
|
|
496
|
+
headers: await network.serviceHeaders(
|
|
497
|
+
sc.dids.alice,
|
|
498
|
+
ids.AppBskyGraphGetFollows,
|
|
499
|
+
),
|
|
500
|
+
},
|
|
436
501
|
)
|
|
437
502
|
expect(forSnapshot([origProfile, origFeed, origFollows])).toEqual(
|
|
438
503
|
forSnapshot([profile, feed, follows]),
|
|
@@ -468,15 +533,30 @@ describe('indexing', () => {
|
|
|
468
533
|
// Check
|
|
469
534
|
const { data: profile } = await agent.api.app.bsky.actor.getProfile(
|
|
470
535
|
{ actor: sc.dids.alice },
|
|
471
|
-
{
|
|
536
|
+
{
|
|
537
|
+
headers: await network.serviceHeaders(
|
|
538
|
+
sc.dids.alice,
|
|
539
|
+
ids.AppBskyActorGetProfile,
|
|
540
|
+
),
|
|
541
|
+
},
|
|
472
542
|
)
|
|
473
543
|
const { data: feed } = await agent.api.app.bsky.feed.getAuthorFeed(
|
|
474
544
|
{ actor: sc.dids.alice },
|
|
475
|
-
{
|
|
545
|
+
{
|
|
546
|
+
headers: await network.serviceHeaders(
|
|
547
|
+
sc.dids.alice,
|
|
548
|
+
ids.AppBskyFeedGetAuthorFeed,
|
|
549
|
+
),
|
|
550
|
+
},
|
|
476
551
|
)
|
|
477
552
|
const { data: follows } = await agent.api.app.bsky.graph.getFollows(
|
|
478
553
|
{ actor: sc.dids.alice },
|
|
479
|
-
{
|
|
554
|
+
{
|
|
555
|
+
headers: await network.serviceHeaders(
|
|
556
|
+
sc.dids.alice,
|
|
557
|
+
ids.AppBskyGraphGetFollows,
|
|
558
|
+
),
|
|
559
|
+
},
|
|
480
560
|
)
|
|
481
561
|
expect(profile.description).toEqual('freshening things up')
|
|
482
562
|
expect(feed.feed[0].post.uri).toEqual(newPost.ref.uriStr)
|
|
@@ -525,12 +605,22 @@ describe('indexing', () => {
|
|
|
525
605
|
// Check
|
|
526
606
|
const getGoodPost = agent.api.app.bsky.feed.getPostThread(
|
|
527
607
|
{ uri: writes[0].uri.toString(), depth: 0 },
|
|
528
|
-
{
|
|
608
|
+
{
|
|
609
|
+
headers: await network.serviceHeaders(
|
|
610
|
+
sc.dids.alice,
|
|
611
|
+
ids.AppBskyFeedGetPostThread,
|
|
612
|
+
),
|
|
613
|
+
},
|
|
529
614
|
)
|
|
530
615
|
await expect(getGoodPost).resolves.toBeDefined()
|
|
531
616
|
const getBadPost = agent.api.app.bsky.feed.getPostThread(
|
|
532
617
|
{ uri: writes[1].uri.toString(), depth: 0 },
|
|
533
|
-
{
|
|
618
|
+
{
|
|
619
|
+
headers: await network.serviceHeaders(
|
|
620
|
+
sc.dids.alice,
|
|
621
|
+
ids.AppBskyFeedGetPostThread,
|
|
622
|
+
),
|
|
623
|
+
},
|
|
534
624
|
)
|
|
535
625
|
await expect(getBadPost).rejects.toThrow('Post not found')
|
|
536
626
|
})
|
|
@@ -540,7 +630,12 @@ describe('indexing', () => {
|
|
|
540
630
|
const getIndexedHandle = async (did) => {
|
|
541
631
|
const res = await agent.api.app.bsky.actor.getProfile(
|
|
542
632
|
{ actor: did },
|
|
543
|
-
{
|
|
633
|
+
{
|
|
634
|
+
headers: await network.serviceHeaders(
|
|
635
|
+
sc.dids.alice,
|
|
636
|
+
ids.AppBskyActorGetProfile,
|
|
637
|
+
),
|
|
638
|
+
},
|
|
544
639
|
)
|
|
545
640
|
return res.data.handle
|
|
546
641
|
}
|
|
@@ -618,13 +713,23 @@ describe('indexing', () => {
|
|
|
618
713
|
it('does not unindex actor when they are still being hosted by their pds', async () => {
|
|
619
714
|
const { data: profileBefore } = await agent.api.app.bsky.actor.getProfile(
|
|
620
715
|
{ actor: sc.dids.alice },
|
|
621
|
-
{
|
|
716
|
+
{
|
|
717
|
+
headers: await network.serviceHeaders(
|
|
718
|
+
sc.dids.bob,
|
|
719
|
+
ids.AppBskyActorGetProfile,
|
|
720
|
+
),
|
|
721
|
+
},
|
|
622
722
|
)
|
|
623
723
|
// Attempt indexing tombstone
|
|
624
724
|
await network.bsky.sub.indexingSvc.deleteActor(sc.dids.alice)
|
|
625
725
|
const { data: profileAfter } = await agent.api.app.bsky.actor.getProfile(
|
|
626
726
|
{ actor: sc.dids.alice },
|
|
627
|
-
{
|
|
727
|
+
{
|
|
728
|
+
headers: await network.serviceHeaders(
|
|
729
|
+
sc.dids.bob,
|
|
730
|
+
ids.AppBskyActorGetProfile,
|
|
731
|
+
),
|
|
732
|
+
},
|
|
628
733
|
)
|
|
629
734
|
expect(profileAfter).toEqual(profileBefore)
|
|
630
735
|
})
|
|
@@ -633,7 +738,12 @@ describe('indexing', () => {
|
|
|
633
738
|
const { alice } = sc.dids
|
|
634
739
|
const getProfileBefore = agent.api.app.bsky.actor.getProfile(
|
|
635
740
|
{ actor: alice },
|
|
636
|
-
{
|
|
741
|
+
{
|
|
742
|
+
headers: await network.serviceHeaders(
|
|
743
|
+
sc.dids.bob,
|
|
744
|
+
ids.AppBskyActorGetProfile,
|
|
745
|
+
),
|
|
746
|
+
},
|
|
637
747
|
)
|
|
638
748
|
await expect(getProfileBefore).resolves.toBeDefined()
|
|
639
749
|
// Delete account on pds
|
|
@@ -651,7 +761,12 @@ describe('indexing', () => {
|
|
|
651
761
|
await network.bsky.sub.indexingSvc.deleteActor(alice)
|
|
652
762
|
const getProfileAfter = agent.api.app.bsky.actor.getProfile(
|
|
653
763
|
{ actor: alice },
|
|
654
|
-
{
|
|
764
|
+
{
|
|
765
|
+
headers: await network.serviceHeaders(
|
|
766
|
+
sc.dids.bob,
|
|
767
|
+
ids.AppBskyActorGetProfile,
|
|
768
|
+
),
|
|
769
|
+
},
|
|
655
770
|
)
|
|
656
771
|
await expect(getProfileAfter).rejects.toThrow('Profile not found')
|
|
657
772
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RecordRef, SeedClient, TestNetwork, usersSeed } from '@atproto/dev-env'
|
|
2
2
|
import { AtpAgent } from '@atproto/api'
|
|
3
|
+
import { ids } from '../../src/lexicon/lexicons'
|
|
3
4
|
|
|
4
5
|
describe('thread mutes', () => {
|
|
5
6
|
let network: TestNetwork
|
|
@@ -35,7 +36,10 @@ describe('thread mutes', () => {
|
|
|
35
36
|
{ root: rootPost.uriStr },
|
|
36
37
|
{
|
|
37
38
|
encoding: 'application/json',
|
|
38
|
-
headers: await network.serviceHeaders(
|
|
39
|
+
headers: await network.serviceHeaders(
|
|
40
|
+
alice,
|
|
41
|
+
ids.AppBskyGraphMuteThread,
|
|
42
|
+
),
|
|
39
43
|
},
|
|
40
44
|
)
|
|
41
45
|
})
|
|
@@ -46,7 +50,7 @@ describe('thread mutes', () => {
|
|
|
46
50
|
uris: [rootPost.uriStr, replyPost.uriStr],
|
|
47
51
|
},
|
|
48
52
|
{
|
|
49
|
-
headers: await network.serviceHeaders(alice),
|
|
53
|
+
headers: await network.serviceHeaders(alice, ids.AppBskyFeedGetPosts),
|
|
50
54
|
},
|
|
51
55
|
)
|
|
52
56
|
expect(res.data.posts[0].viewer?.threadMuted).toBe(true)
|
|
@@ -60,7 +64,12 @@ describe('thread mutes', () => {
|
|
|
60
64
|
|
|
61
65
|
const notifsRes = await agent.api.app.bsky.notification.listNotifications(
|
|
62
66
|
{},
|
|
63
|
-
{
|
|
67
|
+
{
|
|
68
|
+
headers: await network.serviceHeaders(
|
|
69
|
+
alice,
|
|
70
|
+
ids.AppBskyNotificationListNotifications,
|
|
71
|
+
),
|
|
72
|
+
},
|
|
64
73
|
)
|
|
65
74
|
expect(notifsRes.data.notifications.length).toBe(0)
|
|
66
75
|
})
|
|
@@ -72,7 +81,12 @@ describe('thread mutes', () => {
|
|
|
72
81
|
|
|
73
82
|
const notifsRes = await agent.api.app.bsky.notification.listNotifications(
|
|
74
83
|
{},
|
|
75
|
-
{
|
|
84
|
+
{
|
|
85
|
+
headers: await network.serviceHeaders(
|
|
86
|
+
alice,
|
|
87
|
+
ids.AppBskyNotificationListNotifications,
|
|
88
|
+
),
|
|
89
|
+
},
|
|
76
90
|
)
|
|
77
91
|
expect(notifsRes.data.notifications.length).toBe(0)
|
|
78
92
|
})
|
|
@@ -84,7 +98,12 @@ describe('thread mutes', () => {
|
|
|
84
98
|
|
|
85
99
|
const notifsRes = await agent.api.app.bsky.notification.listNotifications(
|
|
86
100
|
{},
|
|
87
|
-
{
|
|
101
|
+
{
|
|
102
|
+
headers: await network.serviceHeaders(
|
|
103
|
+
alice,
|
|
104
|
+
ids.AppBskyNotificationListNotifications,
|
|
105
|
+
),
|
|
106
|
+
},
|
|
88
107
|
)
|
|
89
108
|
expect(notifsRes.data.notifications.length).toBe(0)
|
|
90
109
|
})
|
|
@@ -96,7 +115,12 @@ describe('thread mutes', () => {
|
|
|
96
115
|
|
|
97
116
|
const notifsRes = await agent.api.app.bsky.notification.listNotifications(
|
|
98
117
|
{},
|
|
99
|
-
{
|
|
118
|
+
{
|
|
119
|
+
headers: await network.serviceHeaders(
|
|
120
|
+
alice,
|
|
121
|
+
ids.AppBskyNotificationListNotifications,
|
|
122
|
+
),
|
|
123
|
+
},
|
|
100
124
|
)
|
|
101
125
|
expect(notifsRes.data.notifications.length).toBe(0)
|
|
102
126
|
})
|
|
@@ -106,7 +130,10 @@ describe('thread mutes', () => {
|
|
|
106
130
|
{ root: rootPost.uriStr },
|
|
107
131
|
{
|
|
108
132
|
encoding: 'application/json',
|
|
109
|
-
headers: await network.serviceHeaders(
|
|
133
|
+
headers: await network.serviceHeaders(
|
|
134
|
+
alice,
|
|
135
|
+
ids.AppBskyGraphUnmuteThread,
|
|
136
|
+
),
|
|
110
137
|
},
|
|
111
138
|
)
|
|
112
139
|
})
|
|
@@ -117,7 +144,7 @@ describe('thread mutes', () => {
|
|
|
117
144
|
uris: [rootPost.uriStr, replyPost.uriStr],
|
|
118
145
|
},
|
|
119
146
|
{
|
|
120
|
-
headers: await network.serviceHeaders(alice),
|
|
147
|
+
headers: await network.serviceHeaders(alice, ids.AppBskyFeedGetPosts),
|
|
121
148
|
},
|
|
122
149
|
)
|
|
123
150
|
expect(res.data.posts[0].viewer?.threadMuted).toBe(false)
|
|
@@ -133,7 +160,12 @@ describe('thread mutes', () => {
|
|
|
133
160
|
|
|
134
161
|
const notifsRes = await agent.api.app.bsky.notification.listNotifications(
|
|
135
162
|
{},
|
|
136
|
-
{
|
|
163
|
+
{
|
|
164
|
+
headers: await network.serviceHeaders(
|
|
165
|
+
alice,
|
|
166
|
+
ids.AppBskyNotificationListNotifications,
|
|
167
|
+
),
|
|
168
|
+
},
|
|
137
169
|
)
|
|
138
170
|
expect(notifsRes.data.notifications.length).toBe(4)
|
|
139
171
|
})
|