@atproto/bsky 0.0.74 → 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.
Files changed (64) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/api/app/bsky/actor/getProfiles.d.ts.map +1 -1
  3. package/dist/api/app/bsky/actor/getProfiles.js +9 -1
  4. package/dist/api/app/bsky/actor/getProfiles.js.map +1 -1
  5. package/dist/api/app/bsky/actor/searchActorsTypeahead.js +10 -2
  6. package/dist/api/app/bsky/actor/searchActorsTypeahead.js.map +1 -1
  7. package/dist/api/app/bsky/feed/getFeed.d.ts.map +1 -1
  8. package/dist/api/app/bsky/feed/getFeed.js +8 -1
  9. package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
  10. package/dist/api/app/bsky/feed/getPosts.d.ts.map +1 -1
  11. package/dist/api/app/bsky/feed/getPosts.js +8 -1
  12. package/dist/api/app/bsky/feed/getPosts.js.map +1 -1
  13. package/dist/api/app/bsky/graph/getList.d.ts.map +1 -1
  14. package/dist/api/app/bsky/graph/getList.js +32 -2
  15. package/dist/api/app/bsky/graph/getList.js.map +1 -1
  16. package/dist/auth-verifier.d.ts +8 -3
  17. package/dist/auth-verifier.d.ts.map +1 -1
  18. package/dist/auth-verifier.js +43 -29
  19. package/dist/auth-verifier.js.map +1 -1
  20. package/dist/hydration/hydrator.d.ts +1 -0
  21. package/dist/hydration/hydrator.d.ts.map +1 -1
  22. package/dist/hydration/hydrator.js +15 -6
  23. package/dist/hydration/hydrator.js.map +1 -1
  24. package/package.json +5 -5
  25. package/src/api/app/bsky/actor/getProfiles.ts +10 -1
  26. package/src/api/app/bsky/actor/searchActorsTypeahead.ts +9 -4
  27. package/src/api/app/bsky/feed/getFeed.ts +12 -1
  28. package/src/api/app/bsky/feed/getPosts.ts +9 -1
  29. package/src/api/app/bsky/graph/getList.ts +47 -4
  30. package/src/auth-verifier.ts +78 -51
  31. package/src/hydration/hydrator.ts +18 -2
  32. package/tests/admin/admin-auth.test.ts +15 -8
  33. package/tests/auth.test.ts +2 -1
  34. package/tests/data-plane/handle-invalidation.test.ts +31 -5
  35. package/tests/data-plane/indexing.test.ts +138 -23
  36. package/tests/data-plane/thread-mutes.test.ts +41 -9
  37. package/tests/feed-generation.test.ts +150 -32
  38. package/tests/server.test.ts +1 -1
  39. package/tests/views/__snapshots__/lists.test.ts.snap +145 -26
  40. package/tests/views/__snapshots__/starter-packs.test.ts.snap +245 -4
  41. package/tests/views/account-deactivation.test.ts +8 -2
  42. package/tests/views/actor-likes.test.ts +27 -6
  43. package/tests/views/actor-search.test.ts +5 -1
  44. package/tests/views/author-feed.test.ts +73 -12
  45. package/tests/views/block-lists.test.ts +201 -40
  46. package/tests/views/blocks.test.ts +245 -46
  47. package/tests/views/follows.test.ts +133 -22
  48. package/tests/views/known-followers.test.ts +43 -7
  49. package/tests/views/labeler-service.test.ts +36 -6
  50. package/tests/views/likes.test.ts +8 -5
  51. package/tests/views/list-feed.test.ts +25 -4
  52. package/tests/views/lists.test.ts +73 -31
  53. package/tests/views/mute-lists.test.ts +101 -29
  54. package/tests/views/mutes.test.ts +77 -17
  55. package/tests/views/notifications.test.ts +141 -25
  56. package/tests/views/posts.test.ts +13 -2
  57. package/tests/views/profile.test.ts +37 -11
  58. package/tests/views/reposts.test.ts +31 -5
  59. package/tests/views/starter-packs.test.ts +83 -3
  60. package/tests/views/suggested-follows.test.ts +31 -5
  61. package/tests/views/suggestions.test.ts +37 -6
  62. package/tests/views/thread.test.ts +121 -20
  63. package/tests/views/threadgating.test.ts +128 -22
  64. package/tests/views/timeline.test.ts +67 -14
@@ -3,6 +3,7 @@ import { AtpAgent } from '@atproto/api'
3
3
  import { Secp256k1Keypair } from '@atproto/crypto'
4
4
  import { createServiceAuthHeaders } from '@atproto/xrpc-server'
5
5
  import { RepoRef } from '../../src/lexicon/types/com/atproto/admin/defs'
6
+ import { ids } from '../../src/lexicon/lexicons'
6
7
 
7
8
  describe('admin auth', () => {
8
9
  let network: TestNetwork
@@ -68,10 +69,10 @@ describe('admin auth', () => {
68
69
  })
69
70
 
70
71
  it('allows service auth requests from the configured appview did', async () => {
71
- const headers = await createServiceAuthHeaders({
72
+ const updateHeaders = await createServiceAuthHeaders({
72
73
  iss: modServiceDid,
73
74
  aud: bskyDid,
74
- lxm: null,
75
+ lxm: ids.ComAtprotoAdminUpdateSubjectStatus,
75
76
  keypair: modServiceKey,
76
77
  })
77
78
  await agent.api.com.atproto.admin.updateSubjectStatus(
@@ -80,14 +81,20 @@ describe('admin auth', () => {
80
81
  takedown: { applied: true, ref: 'test-repo' },
81
82
  },
82
83
  {
83
- ...headers,
84
+ ...updateHeaders,
84
85
  encoding: 'application/json',
85
86
  },
86
87
  )
87
88
 
89
+ const getHeaders = await createServiceAuthHeaders({
90
+ iss: modServiceDid,
91
+ aud: bskyDid,
92
+ lxm: ids.ComAtprotoAdminGetSubjectStatus,
93
+ keypair: modServiceKey,
94
+ })
88
95
  const res = await agent.api.com.atproto.admin.getSubjectStatus(
89
96
  { did: repoSubject.did },
90
- headers,
97
+ getHeaders,
91
98
  )
92
99
  expect(res.data.subject.did).toBe(repoSubject.did)
93
100
  expect(res.data.takedown?.applied).toBe(true)
@@ -97,7 +104,7 @@ describe('admin auth', () => {
97
104
  const headers = await createServiceAuthHeaders({
98
105
  iss: altModDid,
99
106
  aud: bskyDid,
100
- lxm: null,
107
+ lxm: ids.ComAtprotoAdminUpdateSubjectStatus,
101
108
  keypair: modServiceKey,
102
109
  })
103
110
  const attempt = agent.api.com.atproto.admin.updateSubjectStatus(
@@ -118,7 +125,7 @@ describe('admin auth', () => {
118
125
  const headers = await createServiceAuthHeaders({
119
126
  iss: sc.dids.alice,
120
127
  aud: bskyDid,
121
- lxm: null,
128
+ lxm: ids.ComAtprotoAdminUpdateSubjectStatus,
122
129
  keypair: aliceKey,
123
130
  })
124
131
  const attempt = agent.api.com.atproto.admin.updateSubjectStatus(
@@ -139,7 +146,7 @@ describe('admin auth', () => {
139
146
  const headers = await createServiceAuthHeaders({
140
147
  iss: modServiceDid,
141
148
  aud: bskyDid,
142
- lxm: null,
149
+ lxm: ids.ComAtprotoAdminUpdateSubjectStatus,
143
150
  keypair: badKey,
144
151
  })
145
152
  const attempt = agent.api.com.atproto.admin.updateSubjectStatus(
@@ -162,7 +169,7 @@ describe('admin auth', () => {
162
169
  const headers = await createServiceAuthHeaders({
163
170
  iss: modServiceDid,
164
171
  aud: sc.dids.alice,
165
- lxm: null,
172
+ lxm: ids.ComAtprotoAdminUpdateSubjectStatus,
166
173
  keypair: modServiceKey,
167
174
  })
168
175
  const attempt = agent.api.com.atproto.admin.updateSubjectStatus(
@@ -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: null,
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
- { headers: await network.serviceHeaders(alice) },
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
- { headers: await network.serviceHeaders(alice) },
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
- { headers: await network.serviceHeaders(alice) },
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
- { headers: await network.serviceHeaders(alice) },
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
- { headers: await network.serviceHeaders(alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.bob) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.alice) },
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
- { headers: await network.serviceHeaders(sc.dids.bob) },
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
- { headers: await network.serviceHeaders(sc.dids.bob) },
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
- { headers: await network.serviceHeaders(sc.dids.bob) },
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
- { headers: await network.serviceHeaders(sc.dids.bob) },
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(alice),
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
- { headers: await network.serviceHeaders(alice) },
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
- { headers: await network.serviceHeaders(alice) },
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
- { headers: await network.serviceHeaders(alice) },
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
- { headers: await network.serviceHeaders(alice) },
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(alice),
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
- { headers: await network.serviceHeaders(alice) },
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
  })