@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.
Files changed (64) hide show
  1. package/CHANGELOG.md +7 -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 +4 -4
  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
@@ -1,6 +1,7 @@
1
1
  import { AtpAgent } from '@atproto/api'
2
2
  import { TestNetwork, SeedClient, followsSeed } from '@atproto/dev-env'
3
3
  import { forSnapshot, paginateAll, stripViewer } from '../_util'
4
+ import { ids } from '../../src/lexicon/lexicons'
4
5
 
5
6
  describe('pds follow views', () => {
6
7
  let agent: AtpAgent
@@ -31,35 +32,60 @@ describe('pds follow views', () => {
31
32
  it('fetches followers', async () => {
32
33
  const aliceFollowers = await agent.api.app.bsky.graph.getFollowers(
33
34
  { actor: sc.dids.alice },
34
- { headers: await network.serviceHeaders(alice) },
35
+ {
36
+ headers: await network.serviceHeaders(
37
+ alice,
38
+ ids.AppBskyGraphGetFollowers,
39
+ ),
40
+ },
35
41
  )
36
42
 
37
43
  expect(forSnapshot(aliceFollowers.data)).toMatchSnapshot()
38
44
 
39
45
  const bobFollowers = await agent.api.app.bsky.graph.getFollowers(
40
46
  { actor: sc.dids.bob },
41
- { headers: await network.serviceHeaders(alice) },
47
+ {
48
+ headers: await network.serviceHeaders(
49
+ alice,
50
+ ids.AppBskyGraphGetFollowers,
51
+ ),
52
+ },
42
53
  )
43
54
 
44
55
  expect(forSnapshot(bobFollowers.data)).toMatchSnapshot()
45
56
 
46
57
  const carolFollowers = await agent.api.app.bsky.graph.getFollowers(
47
58
  { actor: sc.dids.carol },
48
- { headers: await network.serviceHeaders(alice) },
59
+ {
60
+ headers: await network.serviceHeaders(
61
+ alice,
62
+ ids.AppBskyGraphGetFollowers,
63
+ ),
64
+ },
49
65
  )
50
66
 
51
67
  expect(forSnapshot(carolFollowers.data)).toMatchSnapshot()
52
68
 
53
69
  const danFollowers = await agent.api.app.bsky.graph.getFollowers(
54
70
  { actor: sc.dids.dan },
55
- { headers: await network.serviceHeaders(alice) },
71
+ {
72
+ headers: await network.serviceHeaders(
73
+ alice,
74
+ ids.AppBskyGraphGetFollowers,
75
+ ),
76
+ },
56
77
  )
57
78
 
58
79
  expect(forSnapshot(danFollowers.data)).toMatchSnapshot()
59
80
 
60
81
  const eveFollowers = await agent.api.app.bsky.graph.getFollowers(
61
82
  { actor: sc.dids.eve },
62
- { headers: await network.serviceHeaders(alice) },
83
+ {
84
+ headers: await network.serviceHeaders(
85
+ alice,
86
+ ids.AppBskyGraphGetFollowers,
87
+ ),
88
+ },
63
89
  )
64
90
 
65
91
  expect(forSnapshot(eveFollowers.data)).toMatchSnapshot()
@@ -68,11 +94,21 @@ describe('pds follow views', () => {
68
94
  it('fetches followers by handle', async () => {
69
95
  const byDid = await agent.api.app.bsky.graph.getFollowers(
70
96
  { actor: sc.dids.alice },
71
- { headers: await network.serviceHeaders(alice) },
97
+ {
98
+ headers: await network.serviceHeaders(
99
+ alice,
100
+ ids.AppBskyGraphGetFollowers,
101
+ ),
102
+ },
72
103
  )
73
104
  const byHandle = await agent.api.app.bsky.graph.getFollowers(
74
105
  { actor: sc.accounts[alice].handle },
75
- { headers: await network.serviceHeaders(alice) },
106
+ {
107
+ headers: await network.serviceHeaders(
108
+ alice,
109
+ ids.AppBskyGraphGetFollowers,
110
+ ),
111
+ },
76
112
  )
77
113
  expect(byHandle.data).toEqual(byDid.data)
78
114
  })
@@ -86,7 +122,12 @@ describe('pds follow views', () => {
86
122
  cursor,
87
123
  limit: 2,
88
124
  },
89
- { headers: await network.serviceHeaders(alice) },
125
+ {
126
+ headers: await network.serviceHeaders(
127
+ alice,
128
+ ids.AppBskyGraphGetFollowers,
129
+ ),
130
+ },
90
131
  )
91
132
  return res.data
92
133
  }
@@ -98,7 +139,12 @@ describe('pds follow views', () => {
98
139
 
99
140
  const full = await agent.api.app.bsky.graph.getFollowers(
100
141
  { actor: sc.dids.alice },
101
- { headers: await network.serviceHeaders(alice) },
142
+ {
143
+ headers: await network.serviceHeaders(
144
+ alice,
145
+ ids.AppBskyGraphGetFollowers,
146
+ ),
147
+ },
102
148
  )
103
149
 
104
150
  expect(full.data.followers.length).toEqual(4)
@@ -108,7 +154,12 @@ describe('pds follow views', () => {
108
154
  it('fetches followers unauthed', async () => {
109
155
  const { data: authed } = await agent.api.app.bsky.graph.getFollowers(
110
156
  { actor: sc.dids.alice },
111
- { headers: await network.serviceHeaders(alice) },
157
+ {
158
+ headers: await network.serviceHeaders(
159
+ alice,
160
+ ids.AppBskyGraphGetFollowers,
161
+ ),
162
+ },
112
163
  )
113
164
  const { data: unauthed } = await agent.api.app.bsky.graph.getFollowers({
114
165
  actor: sc.dids.alice,
@@ -124,7 +175,12 @@ describe('pds follow views', () => {
124
175
 
125
176
  const aliceFollowers = await agent.api.app.bsky.graph.getFollowers(
126
177
  { actor: sc.dids.alice },
127
- { headers: await network.serviceHeaders(alice) },
178
+ {
179
+ headers: await network.serviceHeaders(
180
+ alice,
181
+ ids.AppBskyGraphGetFollowers,
182
+ ),
183
+ },
128
184
  )
129
185
 
130
186
  expect(aliceFollowers.data.followers.map((f) => f.did)).not.toContain(
@@ -139,35 +195,60 @@ describe('pds follow views', () => {
139
195
  it('fetches follows', async () => {
140
196
  const aliceFollowers = await agent.api.app.bsky.graph.getFollows(
141
197
  { actor: sc.dids.alice },
142
- { headers: await network.serviceHeaders(alice) },
198
+ {
199
+ headers: await network.serviceHeaders(
200
+ alice,
201
+ ids.AppBskyGraphGetFollows,
202
+ ),
203
+ },
143
204
  )
144
205
 
145
206
  expect(forSnapshot(aliceFollowers.data)).toMatchSnapshot()
146
207
 
147
208
  const bobFollowers = await agent.api.app.bsky.graph.getFollows(
148
209
  { actor: sc.dids.bob },
149
- { headers: await network.serviceHeaders(alice) },
210
+ {
211
+ headers: await network.serviceHeaders(
212
+ alice,
213
+ ids.AppBskyGraphGetFollows,
214
+ ),
215
+ },
150
216
  )
151
217
 
152
218
  expect(forSnapshot(bobFollowers.data)).toMatchSnapshot()
153
219
 
154
220
  const carolFollowers = await agent.api.app.bsky.graph.getFollows(
155
221
  { actor: sc.dids.carol },
156
- { headers: await network.serviceHeaders(alice) },
222
+ {
223
+ headers: await network.serviceHeaders(
224
+ alice,
225
+ ids.AppBskyGraphGetFollows,
226
+ ),
227
+ },
157
228
  )
158
229
 
159
230
  expect(forSnapshot(carolFollowers.data)).toMatchSnapshot()
160
231
 
161
232
  const danFollowers = await agent.api.app.bsky.graph.getFollows(
162
233
  { actor: sc.dids.dan },
163
- { headers: await network.serviceHeaders(alice) },
234
+ {
235
+ headers: await network.serviceHeaders(
236
+ alice,
237
+ ids.AppBskyGraphGetFollows,
238
+ ),
239
+ },
164
240
  )
165
241
 
166
242
  expect(forSnapshot(danFollowers.data)).toMatchSnapshot()
167
243
 
168
244
  const eveFollowers = await agent.api.app.bsky.graph.getFollows(
169
245
  { actor: sc.dids.eve },
170
- { headers: await network.serviceHeaders(alice) },
246
+ {
247
+ headers: await network.serviceHeaders(
248
+ alice,
249
+ ids.AppBskyGraphGetFollows,
250
+ ),
251
+ },
171
252
  )
172
253
 
173
254
  expect(forSnapshot(eveFollowers.data)).toMatchSnapshot()
@@ -176,11 +257,21 @@ describe('pds follow views', () => {
176
257
  it('fetches follows by handle', async () => {
177
258
  const byDid = await agent.api.app.bsky.graph.getFollows(
178
259
  { actor: sc.dids.alice },
179
- { headers: await network.serviceHeaders(alice) },
260
+ {
261
+ headers: await network.serviceHeaders(
262
+ alice,
263
+ ids.AppBskyGraphGetFollows,
264
+ ),
265
+ },
180
266
  )
181
267
  const byHandle = await agent.api.app.bsky.graph.getFollows(
182
268
  { actor: sc.accounts[alice].handle },
183
- { headers: await network.serviceHeaders(alice) },
269
+ {
270
+ headers: await network.serviceHeaders(
271
+ alice,
272
+ ids.AppBskyGraphGetFollows,
273
+ ),
274
+ },
184
275
  )
185
276
  expect(byHandle.data).toEqual(byDid.data)
186
277
  })
@@ -194,7 +285,12 @@ describe('pds follow views', () => {
194
285
  cursor,
195
286
  limit: 2,
196
287
  },
197
- { headers: await network.serviceHeaders(alice) },
288
+ {
289
+ headers: await network.serviceHeaders(
290
+ alice,
291
+ ids.AppBskyGraphGetFollows,
292
+ ),
293
+ },
198
294
  )
199
295
  return res.data
200
296
  }
@@ -206,7 +302,12 @@ describe('pds follow views', () => {
206
302
 
207
303
  const full = await agent.api.app.bsky.graph.getFollows(
208
304
  { actor: sc.dids.alice },
209
- { headers: await network.serviceHeaders(alice) },
305
+ {
306
+ headers: await network.serviceHeaders(
307
+ alice,
308
+ ids.AppBskyGraphGetFollows,
309
+ ),
310
+ },
210
311
  )
211
312
 
212
313
  expect(full.data.follows.length).toEqual(4)
@@ -216,7 +317,12 @@ describe('pds follow views', () => {
216
317
  it('fetches follows unauthed', async () => {
217
318
  const { data: authed } = await agent.api.app.bsky.graph.getFollows(
218
319
  { actor: sc.dids.alice },
219
- { headers: await network.serviceHeaders(alice) },
320
+ {
321
+ headers: await network.serviceHeaders(
322
+ alice,
323
+ ids.AppBskyGraphGetFollows,
324
+ ),
325
+ },
220
326
  )
221
327
  const { data: unauthed } = await agent.api.app.bsky.graph.getFollows({
222
328
  actor: sc.dids.alice,
@@ -232,7 +338,12 @@ describe('pds follow views', () => {
232
338
 
233
339
  const aliceFollows = await agent.api.app.bsky.graph.getFollows(
234
340
  { actor: sc.dids.alice },
235
- { headers: await network.serviceHeaders(alice) },
341
+ {
342
+ headers: await network.serviceHeaders(
343
+ alice,
344
+ ids.AppBskyGraphGetFollows,
345
+ ),
346
+ },
236
347
  )
237
348
 
238
349
  expect(aliceFollows.data.follows.map((f) => f.did)).not.toContain(
@@ -2,6 +2,7 @@ import { TestNetwork, SeedClient } from '@atproto/dev-env'
2
2
  import { AtpAgent } from '@atproto/api'
3
3
 
4
4
  import { knownFollowersSeed } from '../seed/known-followers'
5
+ import { ids } from '../../src/lexicon/lexicons'
5
6
 
6
7
  describe('known followers (social proof)', () => {
7
8
  let network: TestNetwork
@@ -70,7 +71,12 @@ describe('known followers (social proof)', () => {
70
71
  it('basic profile views do not return knownFollowers', async () => {
71
72
  const { data } = await agent.api.app.bsky.graph.getFollows(
72
73
  { actor: dids.base_res_1 },
73
- { headers: await network.serviceHeaders(dids.base_view) },
74
+ {
75
+ headers: await network.serviceHeaders(
76
+ dids.base_view,
77
+ ids.AppBskyGraphGetFollows,
78
+ ),
79
+ },
74
80
  )
75
81
  const follow = data.follows[0]
76
82
 
@@ -80,7 +86,12 @@ describe('known followers (social proof)', () => {
80
86
  it('getKnownFollowers: returns data', async () => {
81
87
  const { data } = await agent.api.app.bsky.graph.getKnownFollowers(
82
88
  { actor: dids.base_sub },
83
- { headers: await network.serviceHeaders(dids.base_view) },
89
+ {
90
+ headers: await network.serviceHeaders(
91
+ dids.base_view,
92
+ ids.AppBskyGraphGetKnownFollowers,
93
+ ),
94
+ },
84
95
  )
85
96
 
86
97
  expect(data.subject.did).toBe(dids.base_sub)
@@ -91,7 +102,12 @@ describe('known followers (social proof)', () => {
91
102
  it('getProfile: returns knownFollowers', async () => {
92
103
  const { data } = await agent.api.app.bsky.actor.getProfile(
93
104
  { actor: dids.base_sub },
94
- { headers: await network.serviceHeaders(dids.base_view) },
105
+ {
106
+ headers: await network.serviceHeaders(
107
+ dids.base_view,
108
+ ids.AppBskyActorGetProfile,
109
+ ),
110
+ },
95
111
  )
96
112
 
97
113
  const knownFollowers = data.viewer?.knownFollowers
@@ -103,7 +119,12 @@ describe('known followers (social proof)', () => {
103
119
  it('getProfile: filters 1st-party blocks', async () => {
104
120
  const { data } = await agent.api.app.bsky.actor.getProfile(
105
121
  { actor: dids.fp_block_sub },
106
- { headers: await network.serviceHeaders(dids.fp_block_view) },
122
+ {
123
+ headers: await network.serviceHeaders(
124
+ dids.fp_block_view,
125
+ ids.AppBskyActorGetProfile,
126
+ ),
127
+ },
107
128
  )
108
129
 
109
130
  const knownFollowers = data.viewer?.knownFollowers
@@ -114,7 +135,12 @@ describe('known followers (social proof)', () => {
114
135
  it('getProfile: filters second-party blocks', async () => {
115
136
  const result = await agent.api.app.bsky.actor.getProfile(
116
137
  { actor: dids.sp_block_sub },
117
- { headers: await network.serviceHeaders(dids.sp_block_view) },
138
+ {
139
+ headers: await network.serviceHeaders(
140
+ dids.sp_block_view,
141
+ ids.AppBskyActorGetProfile,
142
+ ),
143
+ },
118
144
  )
119
145
 
120
146
  const knownFollowers = result.data.viewer?.knownFollowers
@@ -125,7 +151,12 @@ describe('known followers (social proof)', () => {
125
151
  it('getProfiles: filters second-party blocks', async () => {
126
152
  const result = await agent.api.app.bsky.actor.getProfiles(
127
153
  { actors: [dids.sp_block_sub] },
128
- { headers: await network.serviceHeaders(dids.sp_block_view) },
154
+ {
155
+ headers: await network.serviceHeaders(
156
+ dids.sp_block_view,
157
+ ids.AppBskyActorGetProfiles,
158
+ ),
159
+ },
129
160
  )
130
161
 
131
162
  expect(result.data.profiles).toHaveLength(1)
@@ -138,7 +169,12 @@ describe('known followers (social proof)', () => {
138
169
  it('getProfiles: mix of results', async () => {
139
170
  const result = await agent.api.app.bsky.actor.getProfiles(
140
171
  { actors: [dids.mix_sub_1, dids.mix_sub_2, dids.mix_sub_3] },
141
- { headers: await network.serviceHeaders(dids.mix_view) },
172
+ {
173
+ headers: await network.serviceHeaders(
174
+ dids.mix_view,
175
+ ids.AppBskyActorGetProfiles,
176
+ ),
177
+ },
142
178
  )
143
179
 
144
180
  expect(result.data.profiles).toHaveLength(3)
@@ -68,7 +68,12 @@ describe('labeler service views', () => {
68
68
  it('fetches labelers', async () => {
69
69
  const view = await agent.api.app.bsky.labeler.getServices(
70
70
  { dids: [alice, bob, 'did:example:missing'] },
71
- { headers: await network.serviceHeaders(bob) },
71
+ {
72
+ headers: await network.serviceHeaders(
73
+ bob,
74
+ ids.AppBskyLabelerGetServices,
75
+ ),
76
+ },
72
77
  )
73
78
 
74
79
  expect(forSnapshot(view.data)).toMatchSnapshot()
@@ -77,7 +82,12 @@ describe('labeler service views', () => {
77
82
  it('fetches labelers detailed', async () => {
78
83
  const view = await agent.api.app.bsky.labeler.getServices(
79
84
  { dids: [alice, bob, 'did:example:missing'], detailed: true },
80
- { headers: await network.serviceHeaders(bob) },
85
+ {
86
+ headers: await network.serviceHeaders(
87
+ bob,
88
+ ids.AppBskyLabelerGetServices,
89
+ ),
90
+ },
81
91
  )
82
92
 
83
93
  expect(forSnapshot(view.data)).toMatchSnapshot()
@@ -86,7 +96,12 @@ describe('labeler service views', () => {
86
96
  it('fetches labelers unauthed', async () => {
87
97
  const { data: authed } = await agent.api.app.bsky.labeler.getServices(
88
98
  { dids: [alice] },
89
- { headers: await network.serviceHeaders(bob) },
99
+ {
100
+ headers: await network.serviceHeaders(
101
+ bob,
102
+ ids.AppBskyLabelerGetServices,
103
+ ),
104
+ },
90
105
  )
91
106
  const { data: unauthed } = await agent.api.app.bsky.labeler.getServices({
92
107
  dids: [alice],
@@ -99,7 +114,12 @@ describe('labeler service views', () => {
99
114
  {
100
115
  dids: [alice, bob, 'did:example:missing'],
101
116
  },
102
- { headers: await network.serviceHeaders(bob) },
117
+ {
118
+ headers: await network.serviceHeaders(
119
+ bob,
120
+ ids.AppBskyLabelerGetServices,
121
+ ),
122
+ },
103
123
  )
104
124
  const { data: unauthed } = await agent.api.app.bsky.labeler.getServices({
105
125
  dids: [alice, bob, 'did:example:missing'],
@@ -138,7 +158,12 @@ describe('labeler service views', () => {
138
158
  it('renders profile as labeler in non-detailed profile views', async () => {
139
159
  const { data: res } = await agent.api.app.bsky.actor.searchActors(
140
160
  { q: sc.accounts[alice].handle },
141
- { headers: await network.serviceHeaders(bob) },
161
+ {
162
+ headers: await network.serviceHeaders(
163
+ bob,
164
+ ids.AppBskyActorSearchActors,
165
+ ),
166
+ },
142
167
  )
143
168
  expect(res.actors.length).toBe(1)
144
169
  expect(res.actors[0].associated?.labeler).toBe(true)
@@ -148,7 +173,12 @@ describe('labeler service views', () => {
148
173
  await network.bsky.ctx.dataplane.takedownActor({ did: alice })
149
174
  const res = await agent.api.app.bsky.labeler.getServices(
150
175
  { dids: [alice, bob] },
151
- { headers: await network.serviceHeaders(bob) },
176
+ {
177
+ headers: await network.serviceHeaders(
178
+ bob,
179
+ ids.AppBskyLabelerGetServices,
180
+ ),
181
+ },
152
182
  )
153
183
  expect(res.data.views.length).toBe(1)
154
184
  // @ts-ignore
@@ -1,6 +1,7 @@
1
1
  import { AtpAgent } from '@atproto/api'
2
2
  import { TestNetwork, SeedClient, likesSeed } from '@atproto/dev-env'
3
3
  import { constantDate, forSnapshot, paginateAll, stripViewer } from '../_util'
4
+ import { ids } from '../../src/lexicon/lexicons'
4
5
 
5
6
  describe('pds like views', () => {
6
7
  let network: TestNetwork
@@ -38,7 +39,7 @@ describe('pds like views', () => {
38
39
  it('fetches post likes', async () => {
39
40
  const alicePost = await agent.api.app.bsky.feed.getLikes(
40
41
  { uri: sc.posts[alice][1].ref.uriStr },
41
- { headers: await network.serviceHeaders(alice) },
42
+ { headers: await network.serviceHeaders(alice, ids.AppBskyFeedGetLikes) },
42
43
  )
43
44
 
44
45
  expect(forSnapshot(alicePost.data)).toMatchSnapshot()
@@ -50,7 +51,7 @@ describe('pds like views', () => {
50
51
  it('fetches reply likes', async () => {
51
52
  const bobReply = await agent.api.app.bsky.feed.getLikes(
52
53
  { uri: sc.replies[bob][0].ref.uriStr },
53
- { headers: await network.serviceHeaders(alice) },
54
+ { headers: await network.serviceHeaders(alice, ids.AppBskyFeedGetLikes) },
54
55
  )
55
56
 
56
57
  expect(forSnapshot(bobReply.data)).toMatchSnapshot()
@@ -68,7 +69,9 @@ describe('pds like views', () => {
68
69
  cursor,
69
70
  limit: 2,
70
71
  },
71
- { headers: await network.serviceHeaders(alice) },
72
+ {
73
+ headers: await network.serviceHeaders(alice, ids.AppBskyFeedGetLikes),
74
+ },
72
75
  )
73
76
  return res.data
74
77
  }
@@ -80,7 +83,7 @@ describe('pds like views', () => {
80
83
 
81
84
  const full = await agent.api.app.bsky.feed.getLikes(
82
85
  { uri: sc.posts[alice][1].ref.uriStr },
83
- { headers: await network.serviceHeaders(alice) },
86
+ { headers: await network.serviceHeaders(alice, ids.AppBskyFeedGetLikes) },
84
87
  )
85
88
 
86
89
  expect(full.data.likes.length).toEqual(4)
@@ -90,7 +93,7 @@ describe('pds like views', () => {
90
93
  it('fetches post likes unauthed', async () => {
91
94
  const { data: authed } = await agent.api.app.bsky.feed.getLikes(
92
95
  { uri: sc.posts[alice][1].ref.uriStr },
93
- { headers: await network.serviceHeaders(alice) },
96
+ { headers: await network.serviceHeaders(alice, ids.AppBskyFeedGetLikes) },
94
97
  )
95
98
  const { data: unauthed } = await agent.api.app.bsky.feed.getLikes({
96
99
  uri: sc.posts[alice][1].ref.uriStr,
@@ -6,6 +6,7 @@ import {
6
6
  stripViewer,
7
7
  stripViewerFromPost,
8
8
  } from '../_util'
9
+ import { ids } from '../../src/lexicon/lexicons'
9
10
 
10
11
  describe('list feed views', () => {
11
12
  let network: TestNetwork
@@ -42,7 +43,12 @@ describe('list feed views', () => {
42
43
  it('fetches list feed', async () => {
43
44
  const res = await agent.api.app.bsky.feed.getListFeed(
44
45
  { list: listRef.uriStr },
45
- { headers: await network.serviceHeaders(carol) },
46
+ {
47
+ headers: await network.serviceHeaders(
48
+ carol,
49
+ ids.AppBskyFeedGetListFeed,
50
+ ),
51
+ },
46
52
  )
47
53
  expect(forSnapshot(res.data.feed)).toMatchSnapshot()
48
54
 
@@ -61,7 +67,12 @@ describe('list feed views', () => {
61
67
  cursor,
62
68
  limit: 2,
63
69
  },
64
- { headers: await network.serviceHeaders(carol) },
70
+ {
71
+ headers: await network.serviceHeaders(
72
+ carol,
73
+ ids.AppBskyFeedGetListFeed,
74
+ ),
75
+ },
65
76
  )
66
77
  return res.data
67
78
  }
@@ -73,7 +84,12 @@ describe('list feed views', () => {
73
84
 
74
85
  const full = await agent.api.app.bsky.feed.getListFeed(
75
86
  { list: listRef.uriStr },
76
- { headers: await network.serviceHeaders(carol) },
87
+ {
88
+ headers: await network.serviceHeaders(
89
+ carol,
90
+ ids.AppBskyFeedGetListFeed,
91
+ ),
92
+ },
77
93
  )
78
94
 
79
95
  expect(full.data.feed.length).toEqual(7)
@@ -83,7 +99,12 @@ describe('list feed views', () => {
83
99
  it('fetches results unauthed', async () => {
84
100
  const { data: authed } = await agent.api.app.bsky.feed.getListFeed(
85
101
  { list: listRef.uriStr },
86
- { headers: await network.serviceHeaders(alice) },
102
+ {
103
+ headers: await network.serviceHeaders(
104
+ alice,
105
+ ids.AppBskyFeedGetListFeed,
106
+ ),
107
+ },
87
108
  )
88
109
  const { data: unauthed } = await agent.api.app.bsky.feed.getListFeed({
89
110
  list: listRef.uriStr,