@atproto/bsky 0.0.107 → 0.0.108

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.
@@ -324,6 +324,7 @@ Array [
324
324
  },
325
325
  Object {
326
326
  "cid": "cids(3)",
327
+ "contentMode": "app.bsky.feed.defs#contentModeVideo",
327
328
  "creator": Object {
328
329
  "avatar": "https://bsky.public.url/img/avatar/plain/user(2)/cids(1)@jpeg",
329
330
  "createdAt": "1970-01-01T00:00:00.000Z",
@@ -355,9 +356,9 @@ Array [
355
356
  "muted": false,
356
357
  },
357
358
  },
358
- "description": "Provides all feed candidates when authed",
359
+ "description": "Has a contentMode specified",
359
360
  "did": "user(0)",
360
- "displayName": "Needs Auth",
361
+ "displayName": "Content mode video",
361
362
  "indexedAt": "1970-01-01T00:00:00.000Z",
362
363
  "labels": Array [],
363
364
  "likeCount": 0,
@@ -397,9 +398,9 @@ Array [
397
398
  "muted": false,
398
399
  },
399
400
  },
400
- "description": "Echoes back the same cursor it received",
401
+ "description": "Provides all feed candidates when authed",
401
402
  "did": "user(0)",
402
- "displayName": "Bad Pagination Cursor",
403
+ "displayName": "Needs Auth",
403
404
  "indexedAt": "1970-01-01T00:00:00.000Z",
404
405
  "labels": Array [],
405
406
  "likeCount": 0,
@@ -439,9 +440,9 @@ Array [
439
440
  "muted": false,
440
441
  },
441
442
  },
442
- "description": "Provides all feed candidates, blindly ignoring pagination limit",
443
+ "description": "Echoes back the same cursor it received",
443
444
  "did": "user(0)",
444
- "displayName": "Bad Pagination Limit",
445
+ "displayName": "Bad Pagination Cursor",
445
446
  "indexedAt": "1970-01-01T00:00:00.000Z",
446
447
  "labels": Array [],
447
448
  "likeCount": 0,
@@ -481,9 +482,9 @@ Array [
481
482
  "muted": false,
482
483
  },
483
484
  },
484
- "description": "Provides even-indexed feed candidates",
485
+ "description": "Provides all feed candidates, blindly ignoring pagination limit",
485
486
  "did": "user(0)",
486
- "displayName": "Even",
487
+ "displayName": "Bad Pagination Limit",
487
488
  "indexedAt": "1970-01-01T00:00:00.000Z",
488
489
  "labels": Array [],
489
490
  "likeCount": 0,
@@ -523,15 +524,57 @@ Array [
523
524
  "muted": false,
524
525
  },
525
526
  },
527
+ "description": "Provides even-indexed feed candidates",
528
+ "did": "user(0)",
529
+ "displayName": "Even",
530
+ "indexedAt": "1970-01-01T00:00:00.000Z",
531
+ "labels": Array [],
532
+ "likeCount": 0,
533
+ "uri": "record(8)",
534
+ "viewer": Object {},
535
+ },
536
+ Object {
537
+ "cid": "cids(8)",
538
+ "creator": Object {
539
+ "avatar": "https://bsky.public.url/img/avatar/plain/user(2)/cids(1)@jpeg",
540
+ "createdAt": "1970-01-01T00:00:00.000Z",
541
+ "description": "its me!",
542
+ "did": "user(1)",
543
+ "displayName": "ali",
544
+ "handle": "alice.test",
545
+ "indexedAt": "1970-01-01T00:00:00.000Z",
546
+ "labels": Array [
547
+ Object {
548
+ "cid": "cids(2)",
549
+ "cts": "1970-01-01T00:00:00.000Z",
550
+ "src": "user(1)",
551
+ "uri": "record(3)",
552
+ "val": "self-label-a",
553
+ },
554
+ Object {
555
+ "cid": "cids(2)",
556
+ "cts": "1970-01-01T00:00:00.000Z",
557
+ "src": "user(1)",
558
+ "uri": "record(3)",
559
+ "val": "self-label-b",
560
+ },
561
+ ],
562
+ "viewer": Object {
563
+ "blockedBy": false,
564
+ "followedBy": "record(2)",
565
+ "following": "record(1)",
566
+ "muted": false,
567
+ },
568
+ },
526
569
  "description": "Provides all feed candidates",
527
570
  "did": "user(0)",
528
571
  "displayName": "All",
529
572
  "indexedAt": "1970-01-01T00:00:00.000Z",
530
573
  "labels": Array [],
531
574
  "likeCount": 2,
532
- "uri": "record(8)",
575
+ "uri": "record(9)",
533
576
  "viewer": Object {
534
- "like": "record(9)",
577
+ "like": "record(10)",
535
578
  },
536
579
  },
537
580
  ]
@@ -1723,6 +1766,56 @@ Array [
1723
1766
  ]
1724
1767
  `;
1725
1768
 
1769
+ exports[`feed generation getFeedGenerator describes a feed gen & returns content mode 1`] = `
1770
+ Object {
1771
+ "isOnline": true,
1772
+ "isValid": true,
1773
+ "view": Object {
1774
+ "cid": "cids(0)",
1775
+ "contentMode": "app.bsky.feed.defs#contentModeVideo",
1776
+ "creator": Object {
1777
+ "avatar": "https://bsky.public.url/img/avatar/plain/user(2)/cids(1)@jpeg",
1778
+ "createdAt": "1970-01-01T00:00:00.000Z",
1779
+ "description": "its me!",
1780
+ "did": "user(1)",
1781
+ "displayName": "ali",
1782
+ "handle": "alice.test",
1783
+ "indexedAt": "1970-01-01T00:00:00.000Z",
1784
+ "labels": Array [
1785
+ Object {
1786
+ "cid": "cids(2)",
1787
+ "cts": "1970-01-01T00:00:00.000Z",
1788
+ "src": "user(1)",
1789
+ "uri": "record(3)",
1790
+ "val": "self-label-a",
1791
+ },
1792
+ Object {
1793
+ "cid": "cids(2)",
1794
+ "cts": "1970-01-01T00:00:00.000Z",
1795
+ "src": "user(1)",
1796
+ "uri": "record(3)",
1797
+ "val": "self-label-b",
1798
+ },
1799
+ ],
1800
+ "viewer": Object {
1801
+ "blockedBy": false,
1802
+ "followedBy": "record(2)",
1803
+ "following": "record(1)",
1804
+ "muted": false,
1805
+ },
1806
+ },
1807
+ "description": "Has a contentMode specified",
1808
+ "did": "user(0)",
1809
+ "displayName": "Content mode video",
1810
+ "indexedAt": "1970-01-01T00:00:00.000Z",
1811
+ "labels": Array [],
1812
+ "likeCount": 0,
1813
+ "uri": "record(0)",
1814
+ "viewer": Object {},
1815
+ },
1816
+ }
1817
+ `;
1818
+
1726
1819
  exports[`feed generation getFeedGenerator describes a feed gen & returns online status 1`] = `
1727
1820
  Object {
1728
1821
  "isOnline": true,
@@ -35,6 +35,7 @@ describe('feed generation', () => {
35
35
  let feedUriPrime: string // Taken-down
36
36
  let feedUriPrimeRef: RecordRef
37
37
  let feedUriNeedsAuth: string
38
+ let feedUriContentModeVideo: string
38
39
  let starterPackRef: { uri: string; cid: string }
39
40
 
40
41
  beforeAll(async () => {
@@ -173,6 +174,17 @@ describe('feed generation', () => {
173
174
  },
174
175
  sc.getHeaders(alice),
175
176
  )
177
+ const contentModeVideo = await pdsAgent.api.app.bsky.feed.generator.create(
178
+ { repo: alice, rkey: 'content-mode-video' },
179
+ {
180
+ did: gen.did,
181
+ displayName: 'Content mode video',
182
+ description: 'Has a contentMode specified',
183
+ createdAt: new Date().toISOString(),
184
+ contentMode: 'app.bsky.feed.defs#contentModeVideo',
185
+ },
186
+ sc.getHeaders(alice),
187
+ )
176
188
  await network.processAll()
177
189
  await network.bsky.ctx.dataplane.takedownRecord({
178
190
  recordUri: prime.uri,
@@ -187,6 +199,7 @@ describe('feed generation', () => {
187
199
  feedUriPrime = prime.uri
188
200
  feedUriPrimeRef = new RecordRef(prime.uri, prime.cid)
189
201
  feedUriNeedsAuth = needsAuth.uri
202
+ feedUriContentModeVideo = contentModeVideo.uri
190
203
  })
191
204
 
192
205
  it('feed gen records can be updated', async () => {
@@ -229,13 +242,14 @@ describe('feed generation', () => {
229
242
 
230
243
  const paginatedAll = results(await paginateAll(paginator))
231
244
 
232
- expect(paginatedAll.length).toEqual(6)
245
+ expect(paginatedAll.length).toEqual(7)
233
246
  expect(paginatedAll[0].uri).toEqual(feedUriOdd)
234
- expect(paginatedAll[1].uri).toEqual(feedUriNeedsAuth)
235
- expect(paginatedAll[2].uri).toEqual(feedUriBadPaginationCursor)
236
- expect(paginatedAll[3].uri).toEqual(feedUriBadPaginationLimit)
237
- expect(paginatedAll[4].uri).toEqual(feedUriEven)
238
- expect(paginatedAll[5].uri).toEqual(feedUriAll)
247
+ expect(paginatedAll[1].uri).toEqual(feedUriContentModeVideo)
248
+ expect(paginatedAll[2].uri).toEqual(feedUriNeedsAuth)
249
+ expect(paginatedAll[3].uri).toEqual(feedUriBadPaginationCursor)
250
+ expect(paginatedAll[4].uri).toEqual(feedUriBadPaginationLimit)
251
+ expect(paginatedAll[5].uri).toEqual(feedUriEven)
252
+ expect(paginatedAll[6].uri).toEqual(feedUriAll)
239
253
  expect(paginatedAll.map((fg) => fg.uri)).not.toContain(feedUriPrime) // taken-down
240
254
  expect(forSnapshot(paginatedAll)).toMatchSnapshot()
241
255
  })
@@ -399,6 +413,22 @@ describe('feed generation', () => {
399
413
  expect(resEven.data.isValid).toBe(true)
400
414
  })
401
415
 
416
+ it('describes a feed gen & returns content mode', async () => {
417
+ const resEven = await agent.api.app.bsky.feed.getFeedGenerator(
418
+ { feed: feedUriContentModeVideo },
419
+ {
420
+ headers: await network.serviceHeaders(
421
+ sc.dids.bob,
422
+ ids.AppBskyFeedGetFeedGenerator,
423
+ ),
424
+ },
425
+ )
426
+ expect(forSnapshot(resEven.data)).toMatchSnapshot()
427
+ expect(resEven.data.view.contentMode).toBe(
428
+ 'app.bsky.feed.defs#contentModeVideo',
429
+ )
430
+ })
431
+
402
432
  it('does not describe taken-down feed', async () => {
403
433
  const tryGetFeed = agent.api.app.bsky.feed.getFeedGenerator(
404
434
  { feed: feedUriPrime },