@atproto/bsky 0.0.175 → 0.0.177
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 +19 -0
- package/dist/api/app/bsky/graph/getList.js +1 -6
- package/dist/api/app/bsky/graph/getList.js.map +1 -1
- package/dist/api/app/bsky/graph/getLists.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/getLists.js +16 -4
- package/dist/api/app/bsky/graph/getLists.js.map +1 -1
- package/dist/api/app/bsky/graph/getListsWithMembership.d.ts +4 -0
- package/dist/api/app/bsky/graph/getListsWithMembership.d.ts.map +1 -0
- package/dist/api/app/bsky/graph/getListsWithMembership.js +88 -0
- package/dist/api/app/bsky/graph/getListsWithMembership.js.map +1 -0
- package/dist/api/app/bsky/graph/getStarterPacksWithMembership.d.ts +4 -0
- package/dist/api/app/bsky/graph/getStarterPacksWithMembership.d.ts.map +1 -0
- package/dist/api/app/bsky/graph/getStarterPacksWithMembership.js +72 -0
- package/dist/api/app/bsky/graph/getStarterPacksWithMembership.js.map +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +4 -0
- package/dist/api/index.js.map +1 -1
- package/dist/hydration/graph.d.ts +4 -0
- package/dist/hydration/graph.d.ts.map +1 -1
- package/dist/hydration/graph.js.map +1 -1
- package/dist/hydration/hydrator.d.ts +3 -1
- package/dist/hydration/hydrator.d.ts.map +1 -1
- package/dist/hydration/hydrator.js +27 -0
- package/dist/hydration/hydrator.js.map +1 -1
- package/dist/lexicon/index.d.ts +4 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +8 -0
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +288 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +146 -0
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/graph/getLists.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/graph/getLists.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/graph/getListsWithMembership.d.ts +40 -0
- package/dist/lexicon/types/app/bsky/graph/getListsWithMembership.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getListsWithMembership.js +16 -0
- package/dist/lexicon/types/app/bsky/graph/getListsWithMembership.js.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPacksWithMembership.d.ts +38 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPacksWithMembership.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPacksWithMembership.js +16 -0
- package/dist/lexicon/types/app/bsky/graph/getStarterPacksWithMembership.js.map +1 -0
- package/dist/views/index.d.ts +2 -1
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +7 -0
- package/dist/views/index.js.map +1 -1
- package/package.json +8 -8
- package/src/api/app/bsky/graph/getList.ts +3 -5
- package/src/api/app/bsky/graph/getLists.ts +18 -5
- package/src/api/app/bsky/graph/getListsWithMembership.ts +139 -0
- package/src/api/app/bsky/graph/getStarterPacksWithMembership.ts +135 -0
- package/src/api/index.ts +4 -0
- package/src/hydration/graph.ts +8 -0
- package/src/hydration/hydrator.ts +43 -0
- package/src/lexicon/index.ts +26 -0
- package/src/lexicon/lexicons.ts +153 -0
- package/src/lexicon/types/app/bsky/graph/getLists.ts +2 -0
- package/src/lexicon/types/app/bsky/graph/getListsWithMembership.ts +63 -0
- package/src/lexicon/types/app/bsky/graph/getStarterPacksWithMembership.ts +65 -0
- package/src/views/index.ts +12 -0
- package/tests/__snapshots__/feed-generation.test.ts.snap +115 -12
- package/tests/feed-generation.test.ts +47 -8
- package/tests/views/__snapshots__/lists.test.ts.snap +160 -8
- package/tests/views/lists.test.ts +270 -36
- package/tests/views/starter-packs.test.ts +132 -3
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
import type * as AppBskyGraphDefs from './defs.js'
|
|
13
|
+
|
|
14
|
+
const is$typed = _is$typed,
|
|
15
|
+
validate = _validate
|
|
16
|
+
const id = 'app.bsky.graph.getStarterPacksWithMembership'
|
|
17
|
+
|
|
18
|
+
export type QueryParams = {
|
|
19
|
+
/** The account (actor) to check for membership. */
|
|
20
|
+
actor: string
|
|
21
|
+
limit: number
|
|
22
|
+
cursor?: string
|
|
23
|
+
}
|
|
24
|
+
export type InputSchema = undefined
|
|
25
|
+
|
|
26
|
+
export interface OutputSchema {
|
|
27
|
+
cursor?: string
|
|
28
|
+
starterPacksWithMembership: StarterPackWithMembership[]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type HandlerInput = void
|
|
32
|
+
|
|
33
|
+
export interface HandlerSuccess {
|
|
34
|
+
encoding: 'application/json'
|
|
35
|
+
body: OutputSchema
|
|
36
|
+
headers?: { [key: string]: string }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface HandlerError {
|
|
40
|
+
status: number
|
|
41
|
+
message?: string
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
45
|
+
|
|
46
|
+
/** A starter pack and an optional list item indicating membership of a target user to that starter pack. */
|
|
47
|
+
export interface StarterPackWithMembership {
|
|
48
|
+
$type?: 'app.bsky.graph.getStarterPacksWithMembership#starterPackWithMembership'
|
|
49
|
+
starterPack: AppBskyGraphDefs.StarterPackView
|
|
50
|
+
listItem?: AppBskyGraphDefs.ListItemView
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const hashStarterPackWithMembership = 'starterPackWithMembership'
|
|
54
|
+
|
|
55
|
+
export function isStarterPackWithMembership<V>(v: V) {
|
|
56
|
+
return is$typed(v, id, hashStarterPackWithMembership)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function validateStarterPackWithMembership<V>(v: V) {
|
|
60
|
+
return validate<StarterPackWithMembership & V>(
|
|
61
|
+
v,
|
|
62
|
+
id,
|
|
63
|
+
hashStarterPackWithMembership,
|
|
64
|
+
)
|
|
65
|
+
}
|
package/src/views/index.ts
CHANGED
|
@@ -44,6 +44,7 @@ import {
|
|
|
44
44
|
import { Record as RepostRecord } from '../lexicon/types/app/bsky/feed/repost'
|
|
45
45
|
import { isListRule } from '../lexicon/types/app/bsky/feed/threadgate'
|
|
46
46
|
import {
|
|
47
|
+
ListItemView,
|
|
47
48
|
ListView,
|
|
48
49
|
ListViewBasic,
|
|
49
50
|
StarterPackView,
|
|
@@ -625,6 +626,16 @@ export class Views {
|
|
|
625
626
|
}
|
|
626
627
|
}
|
|
627
628
|
|
|
629
|
+
listItemView(
|
|
630
|
+
uri: string,
|
|
631
|
+
did: string,
|
|
632
|
+
state: HydrationState,
|
|
633
|
+
): Un$Typed<ListItemView> | undefined {
|
|
634
|
+
const subject = this.profile(did, state)
|
|
635
|
+
if (!subject) return
|
|
636
|
+
return { uri, subject }
|
|
637
|
+
}
|
|
638
|
+
|
|
628
639
|
starterPackBasic(
|
|
629
640
|
uri: string,
|
|
630
641
|
state: HydrationState,
|
|
@@ -840,6 +851,7 @@ export class Views {
|
|
|
840
851
|
)
|
|
841
852
|
: undefined,
|
|
842
853
|
likeCount: aggs?.likes ?? 0,
|
|
854
|
+
acceptsInteractions: feedgen.record.acceptsInteractions,
|
|
843
855
|
labels,
|
|
844
856
|
viewer: viewer
|
|
845
857
|
? {
|
|
@@ -358,7 +358,55 @@ Array [
|
|
|
358
358
|
"viewer": Object {},
|
|
359
359
|
},
|
|
360
360
|
Object {
|
|
361
|
+
"acceptsInteractions": true,
|
|
361
362
|
"cid": "cids(3)",
|
|
363
|
+
"creator": Object {
|
|
364
|
+
"associated": Object {
|
|
365
|
+
"activitySubscription": Object {
|
|
366
|
+
"allowSubscriptions": "followers",
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
"avatar": "https://bsky.public.url/img/avatar/plain/user(2)/cids(1)@jpeg",
|
|
370
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
371
|
+
"description": "its me!",
|
|
372
|
+
"did": "user(1)",
|
|
373
|
+
"displayName": "ali",
|
|
374
|
+
"handle": "alice.test",
|
|
375
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
376
|
+
"labels": Array [
|
|
377
|
+
Object {
|
|
378
|
+
"cid": "cids(2)",
|
|
379
|
+
"cts": "1970-01-01T00:00:00.000Z",
|
|
380
|
+
"src": "user(1)",
|
|
381
|
+
"uri": "record(3)",
|
|
382
|
+
"val": "self-label-a",
|
|
383
|
+
},
|
|
384
|
+
Object {
|
|
385
|
+
"cid": "cids(2)",
|
|
386
|
+
"cts": "1970-01-01T00:00:00.000Z",
|
|
387
|
+
"src": "user(1)",
|
|
388
|
+
"uri": "record(3)",
|
|
389
|
+
"val": "self-label-b",
|
|
390
|
+
},
|
|
391
|
+
],
|
|
392
|
+
"viewer": Object {
|
|
393
|
+
"blockedBy": false,
|
|
394
|
+
"followedBy": "record(2)",
|
|
395
|
+
"following": "record(1)",
|
|
396
|
+
"muted": false,
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
"description": "Has acceptsInteractions set to true",
|
|
400
|
+
"did": "user(0)",
|
|
401
|
+
"displayName": "Accepts Interactions",
|
|
402
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
403
|
+
"labels": Array [],
|
|
404
|
+
"likeCount": 0,
|
|
405
|
+
"uri": "record(4)",
|
|
406
|
+
"viewer": Object {},
|
|
407
|
+
},
|
|
408
|
+
Object {
|
|
409
|
+
"cid": "cids(4)",
|
|
362
410
|
"contentMode": "app.bsky.feed.defs#contentModeVideo",
|
|
363
411
|
"creator": Object {
|
|
364
412
|
"associated": Object {
|
|
@@ -402,11 +450,11 @@ Array [
|
|
|
402
450
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
403
451
|
"labels": Array [],
|
|
404
452
|
"likeCount": 0,
|
|
405
|
-
"uri": "record(
|
|
453
|
+
"uri": "record(5)",
|
|
406
454
|
"viewer": Object {},
|
|
407
455
|
},
|
|
408
456
|
Object {
|
|
409
|
-
"cid": "cids(
|
|
457
|
+
"cid": "cids(5)",
|
|
410
458
|
"creator": Object {
|
|
411
459
|
"associated": Object {
|
|
412
460
|
"activitySubscription": Object {
|
|
@@ -449,11 +497,11 @@ Array [
|
|
|
449
497
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
450
498
|
"labels": Array [],
|
|
451
499
|
"likeCount": 0,
|
|
452
|
-
"uri": "record(
|
|
500
|
+
"uri": "record(6)",
|
|
453
501
|
"viewer": Object {},
|
|
454
502
|
},
|
|
455
503
|
Object {
|
|
456
|
-
"cid": "cids(
|
|
504
|
+
"cid": "cids(6)",
|
|
457
505
|
"creator": Object {
|
|
458
506
|
"associated": Object {
|
|
459
507
|
"activitySubscription": Object {
|
|
@@ -496,11 +544,11 @@ Array [
|
|
|
496
544
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
497
545
|
"labels": Array [],
|
|
498
546
|
"likeCount": 0,
|
|
499
|
-
"uri": "record(
|
|
547
|
+
"uri": "record(7)",
|
|
500
548
|
"viewer": Object {},
|
|
501
549
|
},
|
|
502
550
|
Object {
|
|
503
|
-
"cid": "cids(
|
|
551
|
+
"cid": "cids(7)",
|
|
504
552
|
"creator": Object {
|
|
505
553
|
"associated": Object {
|
|
506
554
|
"activitySubscription": Object {
|
|
@@ -543,11 +591,11 @@ Array [
|
|
|
543
591
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
544
592
|
"labels": Array [],
|
|
545
593
|
"likeCount": 0,
|
|
546
|
-
"uri": "record(
|
|
594
|
+
"uri": "record(8)",
|
|
547
595
|
"viewer": Object {},
|
|
548
596
|
},
|
|
549
597
|
Object {
|
|
550
|
-
"cid": "cids(
|
|
598
|
+
"cid": "cids(8)",
|
|
551
599
|
"creator": Object {
|
|
552
600
|
"associated": Object {
|
|
553
601
|
"activitySubscription": Object {
|
|
@@ -590,11 +638,11 @@ Array [
|
|
|
590
638
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
591
639
|
"labels": Array [],
|
|
592
640
|
"likeCount": 0,
|
|
593
|
-
"uri": "record(
|
|
641
|
+
"uri": "record(9)",
|
|
594
642
|
"viewer": Object {},
|
|
595
643
|
},
|
|
596
644
|
Object {
|
|
597
|
-
"cid": "cids(
|
|
645
|
+
"cid": "cids(9)",
|
|
598
646
|
"creator": Object {
|
|
599
647
|
"associated": Object {
|
|
600
648
|
"activitySubscription": Object {
|
|
@@ -637,9 +685,9 @@ Array [
|
|
|
637
685
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
638
686
|
"labels": Array [],
|
|
639
687
|
"likeCount": 2,
|
|
640
|
-
"uri": "record(
|
|
688
|
+
"uri": "record(10)",
|
|
641
689
|
"viewer": Object {
|
|
642
|
-
"like": "record(
|
|
690
|
+
"like": "record(11)",
|
|
643
691
|
},
|
|
644
692
|
},
|
|
645
693
|
]
|
|
@@ -1957,6 +2005,61 @@ Array [
|
|
|
1957
2005
|
]
|
|
1958
2006
|
`;
|
|
1959
2007
|
|
|
2008
|
+
exports[`feed generation getFeedGenerator describes a feed gen & returns acceptsInteractions when true 1`] = `
|
|
2009
|
+
Object {
|
|
2010
|
+
"isOnline": true,
|
|
2011
|
+
"isValid": true,
|
|
2012
|
+
"view": Object {
|
|
2013
|
+
"acceptsInteractions": true,
|
|
2014
|
+
"cid": "cids(0)",
|
|
2015
|
+
"creator": Object {
|
|
2016
|
+
"associated": Object {
|
|
2017
|
+
"activitySubscription": Object {
|
|
2018
|
+
"allowSubscriptions": "followers",
|
|
2019
|
+
},
|
|
2020
|
+
},
|
|
2021
|
+
"avatar": "https://bsky.public.url/img/avatar/plain/user(2)/cids(1)@jpeg",
|
|
2022
|
+
"createdAt": "1970-01-01T00:00:00.000Z",
|
|
2023
|
+
"description": "its me!",
|
|
2024
|
+
"did": "user(1)",
|
|
2025
|
+
"displayName": "ali",
|
|
2026
|
+
"handle": "alice.test",
|
|
2027
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
2028
|
+
"labels": Array [
|
|
2029
|
+
Object {
|
|
2030
|
+
"cid": "cids(2)",
|
|
2031
|
+
"cts": "1970-01-01T00:00:00.000Z",
|
|
2032
|
+
"src": "user(1)",
|
|
2033
|
+
"uri": "record(3)",
|
|
2034
|
+
"val": "self-label-a",
|
|
2035
|
+
},
|
|
2036
|
+
Object {
|
|
2037
|
+
"cid": "cids(2)",
|
|
2038
|
+
"cts": "1970-01-01T00:00:00.000Z",
|
|
2039
|
+
"src": "user(1)",
|
|
2040
|
+
"uri": "record(3)",
|
|
2041
|
+
"val": "self-label-b",
|
|
2042
|
+
},
|
|
2043
|
+
],
|
|
2044
|
+
"viewer": Object {
|
|
2045
|
+
"blockedBy": false,
|
|
2046
|
+
"followedBy": "record(2)",
|
|
2047
|
+
"following": "record(1)",
|
|
2048
|
+
"muted": false,
|
|
2049
|
+
},
|
|
2050
|
+
},
|
|
2051
|
+
"description": "Has acceptsInteractions set to true",
|
|
2052
|
+
"did": "user(0)",
|
|
2053
|
+
"displayName": "Accepts Interactions",
|
|
2054
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
2055
|
+
"labels": Array [],
|
|
2056
|
+
"likeCount": 0,
|
|
2057
|
+
"uri": "record(0)",
|
|
2058
|
+
"viewer": Object {},
|
|
2059
|
+
},
|
|
2060
|
+
}
|
|
2061
|
+
`;
|
|
2062
|
+
|
|
1960
2063
|
exports[`feed generation getFeedGenerator describes a feed gen & returns content mode 1`] = `
|
|
1961
2064
|
Object {
|
|
1962
2065
|
"isOnline": true,
|
|
@@ -38,6 +38,7 @@ describe('feed generation', () => {
|
|
|
38
38
|
let feedUriPrimeRef: RecordRef
|
|
39
39
|
let feedUriNeedsAuth: string
|
|
40
40
|
let feedUriContentModeVideo: string
|
|
41
|
+
let feedUriAcceptsInteractions: string
|
|
41
42
|
let starterPackRef: { uri: string; cid: string }
|
|
42
43
|
|
|
43
44
|
beforeAll(async () => {
|
|
@@ -68,6 +69,11 @@ describe('feed generation', () => {
|
|
|
68
69
|
'app.bsky.feed.generator',
|
|
69
70
|
'needs-auth',
|
|
70
71
|
)
|
|
72
|
+
const acceptsInteractionsUri = AtUri.make(
|
|
73
|
+
alice,
|
|
74
|
+
'app.bsky.feed.generator',
|
|
75
|
+
'accepts-interactions',
|
|
76
|
+
)
|
|
71
77
|
gen = await network.createFeedGen({
|
|
72
78
|
[allUri.toString()]: feedGenHandler('all'),
|
|
73
79
|
[evenUri.toString()]: feedGenHandler('even'),
|
|
@@ -79,6 +85,9 @@ describe('feed generation', () => {
|
|
|
79
85
|
),
|
|
80
86
|
[primeUri.toString()]: feedGenHandler('prime'),
|
|
81
87
|
[needsAuthUri.toString()]: feedGenHandler('needs-auth'),
|
|
88
|
+
[acceptsInteractionsUri.toString()]: feedGenHandler(
|
|
89
|
+
'accepts-interactions',
|
|
90
|
+
),
|
|
82
91
|
})
|
|
83
92
|
|
|
84
93
|
const feedSuggestions = [
|
|
@@ -187,6 +196,18 @@ describe('feed generation', () => {
|
|
|
187
196
|
},
|
|
188
197
|
sc.getHeaders(alice),
|
|
189
198
|
)
|
|
199
|
+
const acceptsInteraction =
|
|
200
|
+
await pdsAgent.api.app.bsky.feed.generator.create(
|
|
201
|
+
{ repo: alice, rkey: 'accepts-interactions' },
|
|
202
|
+
{
|
|
203
|
+
did: gen.did,
|
|
204
|
+
displayName: 'Accepts Interactions',
|
|
205
|
+
description: 'Has acceptsInteractions set to true',
|
|
206
|
+
acceptsInteractions: true,
|
|
207
|
+
createdAt: new Date().toISOString(),
|
|
208
|
+
},
|
|
209
|
+
sc.getHeaders(alice),
|
|
210
|
+
)
|
|
190
211
|
await network.processAll()
|
|
191
212
|
await network.bsky.ctx.dataplane.takedownRecord({
|
|
192
213
|
recordUri: prime.uri,
|
|
@@ -202,6 +223,7 @@ describe('feed generation', () => {
|
|
|
202
223
|
feedUriPrimeRef = new RecordRef(prime.uri, prime.cid)
|
|
203
224
|
feedUriNeedsAuth = needsAuth.uri
|
|
204
225
|
feedUriContentModeVideo = contentModeVideo.uri
|
|
226
|
+
feedUriAcceptsInteractions = acceptsInteraction.uri
|
|
205
227
|
})
|
|
206
228
|
|
|
207
229
|
it('feed gen records can be updated', async () => {
|
|
@@ -245,14 +267,15 @@ describe('feed generation', () => {
|
|
|
245
267
|
|
|
246
268
|
const paginatedAll = results(await paginateAll(paginator))
|
|
247
269
|
|
|
248
|
-
expect(paginatedAll.length).toEqual(
|
|
270
|
+
expect(paginatedAll.length).toEqual(8)
|
|
249
271
|
expect(paginatedAll[0].uri).toEqual(feedUriOdd)
|
|
250
|
-
expect(paginatedAll[1].uri).toEqual(
|
|
251
|
-
expect(paginatedAll[2].uri).toEqual(
|
|
252
|
-
expect(paginatedAll[3].uri).toEqual(
|
|
253
|
-
expect(paginatedAll[4].uri).toEqual(
|
|
254
|
-
expect(paginatedAll[5].uri).toEqual(
|
|
255
|
-
expect(paginatedAll[6].uri).toEqual(
|
|
272
|
+
expect(paginatedAll[1].uri).toEqual(feedUriAcceptsInteractions)
|
|
273
|
+
expect(paginatedAll[2].uri).toEqual(feedUriContentModeVideo)
|
|
274
|
+
expect(paginatedAll[3].uri).toEqual(feedUriNeedsAuth)
|
|
275
|
+
expect(paginatedAll[4].uri).toEqual(feedUriBadPaginationCursor)
|
|
276
|
+
expect(paginatedAll[5].uri).toEqual(feedUriBadPaginationLimit)
|
|
277
|
+
expect(paginatedAll[6].uri).toEqual(feedUriEven)
|
|
278
|
+
expect(paginatedAll[7].uri).toEqual(feedUriAll)
|
|
256
279
|
expect(paginatedAll.map((fg) => fg.uri)).not.toContain(feedUriPrime) // taken-down
|
|
257
280
|
expect(forSnapshot(paginatedAll)).toMatchSnapshot()
|
|
258
281
|
})
|
|
@@ -432,6 +455,21 @@ describe('feed generation', () => {
|
|
|
432
455
|
)
|
|
433
456
|
})
|
|
434
457
|
|
|
458
|
+
it('describes a feed gen & returns acceptsInteractions when true', async () => {
|
|
459
|
+
const resAcceptsInteractions =
|
|
460
|
+
await agent.api.app.bsky.feed.getFeedGenerator(
|
|
461
|
+
{ feed: feedUriAcceptsInteractions },
|
|
462
|
+
{
|
|
463
|
+
headers: await network.serviceHeaders(
|
|
464
|
+
sc.dids.bob,
|
|
465
|
+
ids.AppBskyFeedGetFeedGenerator,
|
|
466
|
+
),
|
|
467
|
+
},
|
|
468
|
+
)
|
|
469
|
+
expect(forSnapshot(resAcceptsInteractions.data)).toMatchSnapshot()
|
|
470
|
+
expect(resAcceptsInteractions.data.view.acceptsInteractions).toBe(true)
|
|
471
|
+
})
|
|
472
|
+
|
|
435
473
|
it('does not describe taken-down feed', async () => {
|
|
436
474
|
const tryGetFeed = agent.api.app.bsky.feed.getFeedGenerator(
|
|
437
475
|
{ feed: feedUriPrime },
|
|
@@ -795,7 +833,8 @@ describe('feed generation', () => {
|
|
|
795
833
|
| 'prime'
|
|
796
834
|
| 'bad-pagination-limit'
|
|
797
835
|
| 'bad-pagination-cursor'
|
|
798
|
-
| 'needs-auth'
|
|
836
|
+
| 'needs-auth'
|
|
837
|
+
| 'accepts-interactions',
|
|
799
838
|
): MethodHandler<
|
|
800
839
|
void,
|
|
801
840
|
AppBskyFeedGetFeedSkeleton.QueryParams,
|
|
@@ -139,8 +139,8 @@ Array [
|
|
|
139
139
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
140
140
|
"labels": Array [],
|
|
141
141
|
"listItemCount": 0,
|
|
142
|
-
"name": "
|
|
143
|
-
"purpose": "app.bsky.graph.defs#
|
|
142
|
+
"name": "mod2",
|
|
143
|
+
"purpose": "app.bsky.graph.defs#modlist",
|
|
144
144
|
"uri": "record(0)",
|
|
145
145
|
},
|
|
146
146
|
Object {
|
|
@@ -157,10 +157,86 @@ Array [
|
|
|
157
157
|
},
|
|
158
158
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
159
159
|
"labels": Array [],
|
|
160
|
+
"listItemCount": 0,
|
|
161
|
+
"name": "mod1",
|
|
162
|
+
"purpose": "app.bsky.graph.defs#modlist",
|
|
163
|
+
"uri": "record(1)",
|
|
164
|
+
},
|
|
165
|
+
Object {
|
|
166
|
+
"cid": "cids(2)",
|
|
167
|
+
"creator": Object {
|
|
168
|
+
"associated": Object {
|
|
169
|
+
"activitySubscription": Object {
|
|
170
|
+
"allowSubscriptions": "followers",
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
"did": "user(0)",
|
|
174
|
+
"handle": "eve.test",
|
|
175
|
+
"labels": Array [],
|
|
176
|
+
},
|
|
177
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
178
|
+
"labels": Array [],
|
|
179
|
+
"listItemCount": 2,
|
|
180
|
+
"name": "mod0",
|
|
181
|
+
"purpose": "app.bsky.graph.defs#modlist",
|
|
182
|
+
"uri": "record(2)",
|
|
183
|
+
},
|
|
184
|
+
Object {
|
|
185
|
+
"cid": "cids(3)",
|
|
186
|
+
"creator": Object {
|
|
187
|
+
"associated": Object {
|
|
188
|
+
"activitySubscription": Object {
|
|
189
|
+
"allowSubscriptions": "followers",
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
"did": "user(0)",
|
|
193
|
+
"handle": "eve.test",
|
|
194
|
+
"labels": Array [],
|
|
195
|
+
},
|
|
196
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
197
|
+
"labels": Array [],
|
|
198
|
+
"listItemCount": 0,
|
|
199
|
+
"name": "cur2",
|
|
200
|
+
"purpose": "app.bsky.graph.defs#curatelist",
|
|
201
|
+
"uri": "record(3)",
|
|
202
|
+
},
|
|
203
|
+
Object {
|
|
204
|
+
"cid": "cids(4)",
|
|
205
|
+
"creator": Object {
|
|
206
|
+
"associated": Object {
|
|
207
|
+
"activitySubscription": Object {
|
|
208
|
+
"allowSubscriptions": "followers",
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
"did": "user(0)",
|
|
212
|
+
"handle": "eve.test",
|
|
213
|
+
"labels": Array [],
|
|
214
|
+
},
|
|
215
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
216
|
+
"labels": Array [],
|
|
217
|
+
"listItemCount": 0,
|
|
218
|
+
"name": "cur1",
|
|
219
|
+
"purpose": "app.bsky.graph.defs#curatelist",
|
|
220
|
+
"uri": "record(4)",
|
|
221
|
+
},
|
|
222
|
+
Object {
|
|
223
|
+
"cid": "cids(5)",
|
|
224
|
+
"creator": Object {
|
|
225
|
+
"associated": Object {
|
|
226
|
+
"activitySubscription": Object {
|
|
227
|
+
"allowSubscriptions": "followers",
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
"did": "user(0)",
|
|
231
|
+
"handle": "eve.test",
|
|
232
|
+
"labels": Array [],
|
|
233
|
+
},
|
|
234
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
235
|
+
"labels": Array [],
|
|
160
236
|
"listItemCount": 3,
|
|
161
|
-
"name": "
|
|
237
|
+
"name": "cur0",
|
|
162
238
|
"purpose": "app.bsky.graph.defs#curatelist",
|
|
163
|
-
"uri": "record(
|
|
239
|
+
"uri": "record(5)",
|
|
164
240
|
},
|
|
165
241
|
]
|
|
166
242
|
`;
|
|
@@ -471,8 +547,8 @@ Array [
|
|
|
471
547
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
472
548
|
"labels": Array [],
|
|
473
549
|
"listItemCount": 0,
|
|
474
|
-
"name": "
|
|
475
|
-
"purpose": "app.bsky.graph.defs#
|
|
550
|
+
"name": "mod2",
|
|
551
|
+
"purpose": "app.bsky.graph.defs#modlist",
|
|
476
552
|
"uri": "record(0)",
|
|
477
553
|
},
|
|
478
554
|
Object {
|
|
@@ -489,10 +565,86 @@ Array [
|
|
|
489
565
|
},
|
|
490
566
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
491
567
|
"labels": Array [],
|
|
568
|
+
"listItemCount": 0,
|
|
569
|
+
"name": "mod1",
|
|
570
|
+
"purpose": "app.bsky.graph.defs#modlist",
|
|
571
|
+
"uri": "record(1)",
|
|
572
|
+
},
|
|
573
|
+
Object {
|
|
574
|
+
"cid": "cids(2)",
|
|
575
|
+
"creator": Object {
|
|
576
|
+
"associated": Object {
|
|
577
|
+
"activitySubscription": Object {
|
|
578
|
+
"allowSubscriptions": "followers",
|
|
579
|
+
},
|
|
580
|
+
},
|
|
581
|
+
"did": "user(0)",
|
|
582
|
+
"handle": "eve.test",
|
|
583
|
+
"labels": Array [],
|
|
584
|
+
},
|
|
585
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
586
|
+
"labels": Array [],
|
|
587
|
+
"listItemCount": 2,
|
|
588
|
+
"name": "mod0",
|
|
589
|
+
"purpose": "app.bsky.graph.defs#modlist",
|
|
590
|
+
"uri": "record(2)",
|
|
591
|
+
},
|
|
592
|
+
Object {
|
|
593
|
+
"cid": "cids(3)",
|
|
594
|
+
"creator": Object {
|
|
595
|
+
"associated": Object {
|
|
596
|
+
"activitySubscription": Object {
|
|
597
|
+
"allowSubscriptions": "followers",
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
"did": "user(0)",
|
|
601
|
+
"handle": "eve.test",
|
|
602
|
+
"labels": Array [],
|
|
603
|
+
},
|
|
604
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
605
|
+
"labels": Array [],
|
|
606
|
+
"listItemCount": 0,
|
|
607
|
+
"name": "cur2",
|
|
608
|
+
"purpose": "app.bsky.graph.defs#curatelist",
|
|
609
|
+
"uri": "record(3)",
|
|
610
|
+
},
|
|
611
|
+
Object {
|
|
612
|
+
"cid": "cids(4)",
|
|
613
|
+
"creator": Object {
|
|
614
|
+
"associated": Object {
|
|
615
|
+
"activitySubscription": Object {
|
|
616
|
+
"allowSubscriptions": "followers",
|
|
617
|
+
},
|
|
618
|
+
},
|
|
619
|
+
"did": "user(0)",
|
|
620
|
+
"handle": "eve.test",
|
|
621
|
+
"labels": Array [],
|
|
622
|
+
},
|
|
623
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
624
|
+
"labels": Array [],
|
|
625
|
+
"listItemCount": 0,
|
|
626
|
+
"name": "cur1",
|
|
627
|
+
"purpose": "app.bsky.graph.defs#curatelist",
|
|
628
|
+
"uri": "record(4)",
|
|
629
|
+
},
|
|
630
|
+
Object {
|
|
631
|
+
"cid": "cids(5)",
|
|
632
|
+
"creator": Object {
|
|
633
|
+
"associated": Object {
|
|
634
|
+
"activitySubscription": Object {
|
|
635
|
+
"allowSubscriptions": "followers",
|
|
636
|
+
},
|
|
637
|
+
},
|
|
638
|
+
"did": "user(0)",
|
|
639
|
+
"handle": "eve.test",
|
|
640
|
+
"labels": Array [],
|
|
641
|
+
},
|
|
642
|
+
"indexedAt": "1970-01-01T00:00:00.000Z",
|
|
643
|
+
"labels": Array [],
|
|
492
644
|
"listItemCount": 3,
|
|
493
|
-
"name": "
|
|
645
|
+
"name": "cur0",
|
|
494
646
|
"purpose": "app.bsky.graph.defs#curatelist",
|
|
495
|
-
"uri": "record(
|
|
647
|
+
"uri": "record(5)",
|
|
496
648
|
},
|
|
497
649
|
]
|
|
498
650
|
`;
|