@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.
- package/CHANGELOG.md +14 -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 +5 -5
- 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
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
isThreadViewPost,
|
|
7
7
|
} from '../../src/lexicon/types/app/bsky/feed/defs'
|
|
8
8
|
import { forSnapshot } from '../_util'
|
|
9
|
+
import { ids } from '../../src/lexicon/lexicons'
|
|
9
10
|
|
|
10
11
|
describe('views with thread gating', () => {
|
|
11
12
|
let network: TestNetwork
|
|
@@ -36,7 +37,7 @@ describe('views with thread gating', () => {
|
|
|
36
37
|
) => {
|
|
37
38
|
const res = await agent.api.app.bsky.feed.getPosts(
|
|
38
39
|
{ uris: [uri] },
|
|
39
|
-
{ headers: await network.serviceHeaders(user) },
|
|
40
|
+
{ headers: await network.serviceHeaders(user, ids.AppBskyFeedGetPosts) },
|
|
40
41
|
)
|
|
41
42
|
expect(res.data.posts[0].viewer?.replyDisabled).toBe(blocked)
|
|
42
43
|
}
|
|
@@ -55,7 +56,12 @@ describe('views with thread gating', () => {
|
|
|
55
56
|
data: { thread },
|
|
56
57
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
57
58
|
{ uri: post.ref.uriStr },
|
|
58
|
-
{
|
|
59
|
+
{
|
|
60
|
+
headers: await network.serviceHeaders(
|
|
61
|
+
sc.dids.alice,
|
|
62
|
+
ids.AppBskyFeedGetPostThread,
|
|
63
|
+
),
|
|
64
|
+
},
|
|
59
65
|
)
|
|
60
66
|
assert(isThreadViewPost(thread))
|
|
61
67
|
expect(forSnapshot(thread.post.threadgate)).toMatchSnapshot()
|
|
@@ -83,7 +89,12 @@ describe('views with thread gating', () => {
|
|
|
83
89
|
data: { notifications },
|
|
84
90
|
} = await agent.api.app.bsky.notification.listNotifications(
|
|
85
91
|
{},
|
|
86
|
-
{
|
|
92
|
+
{
|
|
93
|
+
headers: await network.serviceHeaders(
|
|
94
|
+
sc.dids.carol,
|
|
95
|
+
ids.AppBskyNotificationListNotifications,
|
|
96
|
+
),
|
|
97
|
+
},
|
|
87
98
|
)
|
|
88
99
|
const notificationFromReply = notifications.find(
|
|
89
100
|
(notif) => notif.uri === reply.ref.uriStr,
|
|
@@ -137,7 +148,12 @@ describe('views with thread gating', () => {
|
|
|
137
148
|
data: { thread: aliceThread },
|
|
138
149
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
139
150
|
{ uri: post.ref.uriStr },
|
|
140
|
-
{
|
|
151
|
+
{
|
|
152
|
+
headers: await network.serviceHeaders(
|
|
153
|
+
sc.dids.alice,
|
|
154
|
+
ids.AppBskyFeedGetPostThread,
|
|
155
|
+
),
|
|
156
|
+
},
|
|
141
157
|
)
|
|
142
158
|
assert(isThreadViewPost(aliceThread))
|
|
143
159
|
expect(aliceThread.post.viewer?.replyDisabled).toBe(true)
|
|
@@ -146,7 +162,12 @@ describe('views with thread gating', () => {
|
|
|
146
162
|
data: { thread: danThread },
|
|
147
163
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
148
164
|
{ uri: post.ref.uriStr },
|
|
149
|
-
{
|
|
165
|
+
{
|
|
166
|
+
headers: await network.serviceHeaders(
|
|
167
|
+
sc.dids.dan,
|
|
168
|
+
ids.AppBskyFeedGetPostThread,
|
|
169
|
+
),
|
|
170
|
+
},
|
|
150
171
|
)
|
|
151
172
|
assert(isThreadViewPost(danThread))
|
|
152
173
|
expect(forSnapshot(danThread.post.threadgate)).toMatchSnapshot()
|
|
@@ -188,7 +209,12 @@ describe('views with thread gating', () => {
|
|
|
188
209
|
data: { thread: danThread },
|
|
189
210
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
190
211
|
{ uri: post.ref.uriStr },
|
|
191
|
-
{
|
|
212
|
+
{
|
|
213
|
+
headers: await network.serviceHeaders(
|
|
214
|
+
sc.dids.dan,
|
|
215
|
+
ids.AppBskyFeedGetPostThread,
|
|
216
|
+
),
|
|
217
|
+
},
|
|
192
218
|
)
|
|
193
219
|
assert(isThreadViewPost(danThread))
|
|
194
220
|
expect(danThread.post.viewer?.replyDisabled).toBe(true)
|
|
@@ -197,7 +223,12 @@ describe('views with thread gating', () => {
|
|
|
197
223
|
data: { thread: aliceThread },
|
|
198
224
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
199
225
|
{ uri: post.ref.uriStr },
|
|
200
|
-
{
|
|
226
|
+
{
|
|
227
|
+
headers: await network.serviceHeaders(
|
|
228
|
+
sc.dids.alice,
|
|
229
|
+
ids.AppBskyFeedGetPostThread,
|
|
230
|
+
),
|
|
231
|
+
},
|
|
201
232
|
)
|
|
202
233
|
assert(isThreadViewPost(aliceThread))
|
|
203
234
|
expect(forSnapshot(aliceThread.post.threadgate)).toMatchSnapshot()
|
|
@@ -280,7 +311,12 @@ describe('views with thread gating', () => {
|
|
|
280
311
|
data: { thread: bobThread },
|
|
281
312
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
282
313
|
{ uri: post.ref.uriStr },
|
|
283
|
-
{
|
|
314
|
+
{
|
|
315
|
+
headers: await network.serviceHeaders(
|
|
316
|
+
sc.dids.bob,
|
|
317
|
+
ids.AppBskyFeedGetPostThread,
|
|
318
|
+
),
|
|
319
|
+
},
|
|
284
320
|
)
|
|
285
321
|
assert(isThreadViewPost(bobThread))
|
|
286
322
|
expect(bobThread.post.viewer?.replyDisabled).toBe(true)
|
|
@@ -289,7 +325,12 @@ describe('views with thread gating', () => {
|
|
|
289
325
|
data: { thread: aliceThread },
|
|
290
326
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
291
327
|
{ uri: post.ref.uriStr },
|
|
292
|
-
{
|
|
328
|
+
{
|
|
329
|
+
headers: await network.serviceHeaders(
|
|
330
|
+
sc.dids.alice,
|
|
331
|
+
ids.AppBskyFeedGetPostThread,
|
|
332
|
+
),
|
|
333
|
+
},
|
|
293
334
|
)
|
|
294
335
|
assert(isThreadViewPost(aliceThread))
|
|
295
336
|
expect(aliceThread.post.viewer?.replyDisabled).toBe(false)
|
|
@@ -298,7 +339,12 @@ describe('views with thread gating', () => {
|
|
|
298
339
|
data: { thread: danThread },
|
|
299
340
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
300
341
|
{ uri: post.ref.uriStr },
|
|
301
|
-
{
|
|
342
|
+
{
|
|
343
|
+
headers: await network.serviceHeaders(
|
|
344
|
+
sc.dids.dan,
|
|
345
|
+
ids.AppBskyFeedGetPostThread,
|
|
346
|
+
),
|
|
347
|
+
},
|
|
302
348
|
)
|
|
303
349
|
assert(isThreadViewPost(danThread))
|
|
304
350
|
expect(forSnapshot(danThread.post.threadgate)).toMatchSnapshot()
|
|
@@ -341,7 +387,12 @@ describe('views with thread gating', () => {
|
|
|
341
387
|
data: { thread },
|
|
342
388
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
343
389
|
{ uri: post.ref.uriStr },
|
|
344
|
-
{
|
|
390
|
+
{
|
|
391
|
+
headers: await network.serviceHeaders(
|
|
392
|
+
sc.dids.alice,
|
|
393
|
+
ids.AppBskyFeedGetPostThread,
|
|
394
|
+
),
|
|
395
|
+
},
|
|
345
396
|
)
|
|
346
397
|
assert(isThreadViewPost(thread))
|
|
347
398
|
expect(forSnapshot(thread.post.threadgate)).toMatchSnapshot()
|
|
@@ -391,7 +442,12 @@ describe('views with thread gating', () => {
|
|
|
391
442
|
data: { thread: bobThread },
|
|
392
443
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
393
444
|
{ uri: post.ref.uriStr },
|
|
394
|
-
{
|
|
445
|
+
{
|
|
446
|
+
headers: await network.serviceHeaders(
|
|
447
|
+
sc.dids.bob,
|
|
448
|
+
ids.AppBskyFeedGetPostThread,
|
|
449
|
+
),
|
|
450
|
+
},
|
|
395
451
|
)
|
|
396
452
|
assert(isThreadViewPost(bobThread))
|
|
397
453
|
expect(bobThread.post.viewer?.replyDisabled).toBe(true)
|
|
@@ -400,7 +456,12 @@ describe('views with thread gating', () => {
|
|
|
400
456
|
data: { thread: aliceThread },
|
|
401
457
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
402
458
|
{ uri: post.ref.uriStr },
|
|
403
|
-
{
|
|
459
|
+
{
|
|
460
|
+
headers: await network.serviceHeaders(
|
|
461
|
+
sc.dids.alice,
|
|
462
|
+
ids.AppBskyFeedGetPostThread,
|
|
463
|
+
),
|
|
464
|
+
},
|
|
404
465
|
)
|
|
405
466
|
assert(isThreadViewPost(aliceThread))
|
|
406
467
|
expect(aliceThread.post.viewer?.replyDisabled).toBe(false)
|
|
@@ -409,7 +470,12 @@ describe('views with thread gating', () => {
|
|
|
409
470
|
data: { thread: danThread },
|
|
410
471
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
411
472
|
{ uri: post.ref.uriStr },
|
|
412
|
-
{
|
|
473
|
+
{
|
|
474
|
+
headers: await network.serviceHeaders(
|
|
475
|
+
sc.dids.dan,
|
|
476
|
+
ids.AppBskyFeedGetPostThread,
|
|
477
|
+
),
|
|
478
|
+
},
|
|
413
479
|
)
|
|
414
480
|
assert(isThreadViewPost(danThread))
|
|
415
481
|
expect(forSnapshot(danThread.post.threadgate)).toMatchSnapshot()
|
|
@@ -443,7 +509,12 @@ describe('views with thread gating', () => {
|
|
|
443
509
|
data: { thread },
|
|
444
510
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
445
511
|
{ uri: post.ref.uriStr },
|
|
446
|
-
{
|
|
512
|
+
{
|
|
513
|
+
headers: await network.serviceHeaders(
|
|
514
|
+
sc.dids.alice,
|
|
515
|
+
ids.AppBskyFeedGetPostThread,
|
|
516
|
+
),
|
|
517
|
+
},
|
|
447
518
|
)
|
|
448
519
|
assert(isThreadViewPost(thread))
|
|
449
520
|
expect(forSnapshot(thread.post.threadgate)).toMatchSnapshot()
|
|
@@ -497,7 +568,12 @@ describe('views with thread gating', () => {
|
|
|
497
568
|
data: { thread: danThread },
|
|
498
569
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
499
570
|
{ uri: orphanedReply.ref.uriStr },
|
|
500
|
-
{
|
|
571
|
+
{
|
|
572
|
+
headers: await network.serviceHeaders(
|
|
573
|
+
sc.dids.dan,
|
|
574
|
+
ids.AppBskyFeedGetPostThread,
|
|
575
|
+
),
|
|
576
|
+
},
|
|
501
577
|
)
|
|
502
578
|
assert(isThreadViewPost(danThread))
|
|
503
579
|
expect(danThread.post.viewer?.replyDisabled).toBe(true)
|
|
@@ -506,7 +582,12 @@ describe('views with thread gating', () => {
|
|
|
506
582
|
data: { thread: aliceThread },
|
|
507
583
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
508
584
|
{ uri: orphanedReply.ref.uriStr },
|
|
509
|
-
{
|
|
585
|
+
{
|
|
586
|
+
headers: await network.serviceHeaders(
|
|
587
|
+
sc.dids.alice,
|
|
588
|
+
ids.AppBskyFeedGetPostThread,
|
|
589
|
+
),
|
|
590
|
+
},
|
|
510
591
|
)
|
|
511
592
|
assert(isThreadViewPost(aliceThread))
|
|
512
593
|
assert(
|
|
@@ -541,7 +622,12 @@ describe('views with thread gating', () => {
|
|
|
541
622
|
data: { thread },
|
|
542
623
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
543
624
|
{ uri: post.ref.uriStr },
|
|
544
|
-
{
|
|
625
|
+
{
|
|
626
|
+
headers: await network.serviceHeaders(
|
|
627
|
+
sc.dids.carol,
|
|
628
|
+
ids.AppBskyFeedGetPostThread,
|
|
629
|
+
),
|
|
630
|
+
},
|
|
545
631
|
)
|
|
546
632
|
assert(isThreadViewPost(thread))
|
|
547
633
|
expect(forSnapshot(thread.post.threadgate)).toMatchSnapshot()
|
|
@@ -580,7 +666,12 @@ describe('views with thread gating', () => {
|
|
|
580
666
|
data: { thread },
|
|
581
667
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
582
668
|
{ uri: badReply.ref.uriStr },
|
|
583
|
-
{
|
|
669
|
+
{
|
|
670
|
+
headers: await network.serviceHeaders(
|
|
671
|
+
sc.dids.alice,
|
|
672
|
+
ids.AppBskyFeedGetPostThread,
|
|
673
|
+
),
|
|
674
|
+
},
|
|
584
675
|
)
|
|
585
676
|
assert(isThreadViewPost(thread))
|
|
586
677
|
expect(thread.post.viewer?.replyDisabled).toBe(true) // nobody can reply to this, not even alice.
|
|
@@ -593,7 +684,12 @@ describe('views with thread gating', () => {
|
|
|
593
684
|
data: { feed },
|
|
594
685
|
} = await agent.api.app.bsky.feed.getAuthorFeed(
|
|
595
686
|
{ actor: sc.dids.dan },
|
|
596
|
-
{
|
|
687
|
+
{
|
|
688
|
+
headers: await network.serviceHeaders(
|
|
689
|
+
sc.dids.alice,
|
|
690
|
+
ids.AppBskyFeedGetAuthorFeed,
|
|
691
|
+
),
|
|
692
|
+
},
|
|
597
693
|
)
|
|
598
694
|
const [feedItem] = feed
|
|
599
695
|
expect(feedItem.post.uri).toEqual(badReply.ref.uriStr)
|
|
@@ -617,7 +713,12 @@ describe('views with thread gating', () => {
|
|
|
617
713
|
data: { thread: threadA },
|
|
618
714
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
619
715
|
{ uri: postA.ref.uriStr },
|
|
620
|
-
{
|
|
716
|
+
{
|
|
717
|
+
headers: await network.serviceHeaders(
|
|
718
|
+
sc.dids.alice,
|
|
719
|
+
ids.AppBskyFeedGetPostThread,
|
|
720
|
+
),
|
|
721
|
+
},
|
|
621
722
|
)
|
|
622
723
|
assert(isThreadViewPost(threadA))
|
|
623
724
|
expect(threadA.post.threadgate).toBeUndefined()
|
|
@@ -628,7 +729,12 @@ describe('views with thread gating', () => {
|
|
|
628
729
|
data: { thread: threadB },
|
|
629
730
|
} = await agent.api.app.bsky.feed.getPostThread(
|
|
630
731
|
{ uri: postB.ref.uriStr },
|
|
631
|
-
{
|
|
732
|
+
{
|
|
733
|
+
headers: await network.serviceHeaders(
|
|
734
|
+
sc.dids.alice,
|
|
735
|
+
ids.AppBskyFeedGetPostThread,
|
|
736
|
+
),
|
|
737
|
+
},
|
|
632
738
|
)
|
|
633
739
|
assert(isThreadViewPost(threadB))
|
|
634
740
|
expect(threadB.post.threadgate).toBeUndefined()
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import { forSnapshot, getOriginator, paginateAll } from '../_util'
|
|
10
10
|
import { FeedViewPost } from '../../src/lexicon/types/app/bsky/feed/defs'
|
|
11
11
|
import { Database } from '../../src'
|
|
12
|
+
import { ids } from '../../src/lexicon/lexicons'
|
|
12
13
|
|
|
13
14
|
const REVERSE_CHRON = 'reverse-chronological'
|
|
14
15
|
|
|
@@ -68,7 +69,10 @@ describe('timeline views', () => {
|
|
|
68
69
|
const aliceTL = await agent.api.app.bsky.feed.getTimeline(
|
|
69
70
|
{ algorithm: REVERSE_CHRON },
|
|
70
71
|
{
|
|
71
|
-
headers: await network.serviceHeaders(
|
|
72
|
+
headers: await network.serviceHeaders(
|
|
73
|
+
alice,
|
|
74
|
+
ids.AppBskyFeedGetTimeline,
|
|
75
|
+
),
|
|
72
76
|
},
|
|
73
77
|
)
|
|
74
78
|
|
|
@@ -78,7 +82,7 @@ describe('timeline views', () => {
|
|
|
78
82
|
const bobTL = await agent.api.app.bsky.feed.getTimeline(
|
|
79
83
|
{ algorithm: REVERSE_CHRON },
|
|
80
84
|
{
|
|
81
|
-
headers: await network.serviceHeaders(bob),
|
|
85
|
+
headers: await network.serviceHeaders(bob, ids.AppBskyFeedGetTimeline),
|
|
82
86
|
},
|
|
83
87
|
)
|
|
84
88
|
|
|
@@ -88,7 +92,10 @@ describe('timeline views', () => {
|
|
|
88
92
|
const carolTL = await agent.api.app.bsky.feed.getTimeline(
|
|
89
93
|
{ algorithm: REVERSE_CHRON },
|
|
90
94
|
{
|
|
91
|
-
headers: await network.serviceHeaders(
|
|
95
|
+
headers: await network.serviceHeaders(
|
|
96
|
+
carol,
|
|
97
|
+
ids.AppBskyFeedGetTimeline,
|
|
98
|
+
),
|
|
92
99
|
},
|
|
93
100
|
)
|
|
94
101
|
|
|
@@ -98,7 +105,7 @@ describe('timeline views', () => {
|
|
|
98
105
|
const danTL = await agent.api.app.bsky.feed.getTimeline(
|
|
99
106
|
{ algorithm: REVERSE_CHRON },
|
|
100
107
|
{
|
|
101
|
-
headers: await network.serviceHeaders(dan),
|
|
108
|
+
headers: await network.serviceHeaders(dan, ids.AppBskyFeedGetTimeline),
|
|
102
109
|
},
|
|
103
110
|
)
|
|
104
111
|
|
|
@@ -110,13 +117,19 @@ describe('timeline views', () => {
|
|
|
110
117
|
const defaultTL = await agent.api.app.bsky.feed.getTimeline(
|
|
111
118
|
{},
|
|
112
119
|
{
|
|
113
|
-
headers: await network.serviceHeaders(
|
|
120
|
+
headers: await network.serviceHeaders(
|
|
121
|
+
alice,
|
|
122
|
+
ids.AppBskyFeedGetTimeline,
|
|
123
|
+
),
|
|
114
124
|
},
|
|
115
125
|
)
|
|
116
126
|
const reverseChronologicalTL = await agent.api.app.bsky.feed.getTimeline(
|
|
117
127
|
{ algorithm: REVERSE_CHRON },
|
|
118
128
|
{
|
|
119
|
-
headers: await network.serviceHeaders(
|
|
129
|
+
headers: await network.serviceHeaders(
|
|
130
|
+
alice,
|
|
131
|
+
ids.AppBskyFeedGetTimeline,
|
|
132
|
+
),
|
|
120
133
|
},
|
|
121
134
|
)
|
|
122
135
|
expect(defaultTL.data.feed).toEqual(reverseChronologicalTL.data.feed)
|
|
@@ -131,7 +144,12 @@ describe('timeline views', () => {
|
|
|
131
144
|
cursor,
|
|
132
145
|
limit: 4,
|
|
133
146
|
},
|
|
134
|
-
{
|
|
147
|
+
{
|
|
148
|
+
headers: await network.serviceHeaders(
|
|
149
|
+
carol,
|
|
150
|
+
ids.AppBskyFeedGetTimeline,
|
|
151
|
+
),
|
|
152
|
+
},
|
|
135
153
|
)
|
|
136
154
|
return res.data
|
|
137
155
|
}
|
|
@@ -145,7 +163,12 @@ describe('timeline views', () => {
|
|
|
145
163
|
{
|
|
146
164
|
algorithm: REVERSE_CHRON,
|
|
147
165
|
},
|
|
148
|
-
{
|
|
166
|
+
{
|
|
167
|
+
headers: await network.serviceHeaders(
|
|
168
|
+
carol,
|
|
169
|
+
ids.AppBskyFeedGetTimeline,
|
|
170
|
+
),
|
|
171
|
+
},
|
|
149
172
|
)
|
|
150
173
|
|
|
151
174
|
expect(full.data.feed.length).toEqual(7)
|
|
@@ -155,11 +178,21 @@ describe('timeline views', () => {
|
|
|
155
178
|
it('agrees what the first item is for limit=1 and other limits', async () => {
|
|
156
179
|
const { data: timeline } = await agent.api.app.bsky.feed.getTimeline(
|
|
157
180
|
{ limit: 10 },
|
|
158
|
-
{
|
|
181
|
+
{
|
|
182
|
+
headers: await network.serviceHeaders(
|
|
183
|
+
alice,
|
|
184
|
+
ids.AppBskyFeedGetTimeline,
|
|
185
|
+
),
|
|
186
|
+
},
|
|
159
187
|
)
|
|
160
188
|
const { data: timelineLimit1 } = await agent.api.app.bsky.feed.getTimeline(
|
|
161
189
|
{ limit: 1 },
|
|
162
|
-
{
|
|
190
|
+
{
|
|
191
|
+
headers: await network.serviceHeaders(
|
|
192
|
+
alice,
|
|
193
|
+
ids.AppBskyFeedGetTimeline,
|
|
194
|
+
),
|
|
195
|
+
},
|
|
163
196
|
)
|
|
164
197
|
expect(timeline.feed.length).toBeGreaterThan(1)
|
|
165
198
|
expect(timelineLimit1.feed.length).toEqual(1)
|
|
@@ -169,7 +202,12 @@ describe('timeline views', () => {
|
|
|
169
202
|
it('reflects self-labels', async () => {
|
|
170
203
|
const carolTL = await agent.api.app.bsky.feed.getTimeline(
|
|
171
204
|
{},
|
|
172
|
-
{
|
|
205
|
+
{
|
|
206
|
+
headers: await network.serviceHeaders(
|
|
207
|
+
carol,
|
|
208
|
+
ids.AppBskyFeedGetTimeline,
|
|
209
|
+
),
|
|
210
|
+
},
|
|
173
211
|
)
|
|
174
212
|
|
|
175
213
|
const alicePost = carolTL.data.feed.find(
|
|
@@ -201,7 +239,12 @@ describe('timeline views', () => {
|
|
|
201
239
|
|
|
202
240
|
const aliceTL = await agent.api.app.bsky.feed.getTimeline(
|
|
203
241
|
{ algorithm: REVERSE_CHRON },
|
|
204
|
-
{
|
|
242
|
+
{
|
|
243
|
+
headers: await network.serviceHeaders(
|
|
244
|
+
alice,
|
|
245
|
+
ids.AppBskyFeedGetTimeline,
|
|
246
|
+
),
|
|
247
|
+
},
|
|
205
248
|
)
|
|
206
249
|
|
|
207
250
|
expect(forSnapshot(aliceTL.data.feed)).toMatchSnapshot()
|
|
@@ -227,7 +270,12 @@ describe('timeline views', () => {
|
|
|
227
270
|
|
|
228
271
|
const aliceTL = await agent.api.app.bsky.feed.getTimeline(
|
|
229
272
|
{ algorithm: REVERSE_CHRON },
|
|
230
|
-
{
|
|
273
|
+
{
|
|
274
|
+
headers: await network.serviceHeaders(
|
|
275
|
+
alice,
|
|
276
|
+
ids.AppBskyFeedGetTimeline,
|
|
277
|
+
),
|
|
278
|
+
},
|
|
231
279
|
)
|
|
232
280
|
|
|
233
281
|
expect(forSnapshot(aliceTL.data.feed)).toMatchSnapshot()
|
|
@@ -245,7 +293,12 @@ describe('timeline views', () => {
|
|
|
245
293
|
it('fails open on clearly bad cursor.', async () => {
|
|
246
294
|
const { data: timeline } = await agent.api.app.bsky.feed.getTimeline(
|
|
247
295
|
{ cursor: '90210::bafycid' },
|
|
248
|
-
{
|
|
296
|
+
{
|
|
297
|
+
headers: await network.serviceHeaders(
|
|
298
|
+
alice,
|
|
299
|
+
ids.AppBskyFeedGetTimeline,
|
|
300
|
+
),
|
|
301
|
+
},
|
|
249
302
|
)
|
|
250
303
|
expect(timeline).toEqual({ feed: [] })
|
|
251
304
|
})
|