@atproto/api 0.9.2 → 0.9.4
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 +13 -0
- package/dist/bsky-agent.d.ts +2 -1
- package/dist/client/index.d.ts +6 -0
- package/dist/client/lexicons.d.ts +153 -0
- package/dist/client/types/app/bsky/actor/defs.d.ts +7 -1
- package/dist/client/types/app/bsky/graph/defs.d.ts +15 -0
- package/dist/client/types/app/bsky/graph/getRelationships.d.ts +27 -0
- package/dist/client/types/app/bsky/unspecced/getTaggedSuggestions.d.ts +26 -0
- package/dist/index.js +288 -42
- package/dist/index.js.map +3 -3
- package/dist/types.d.ts +5 -0
- package/package.json +2 -2
- package/src/bsky-agent.ts +27 -0
- package/src/client/index.ts +26 -0
- package/src/client/lexicons.ts +167 -0
- package/src/client/types/app/bsky/actor/defs.ts +19 -0
- package/src/client/types/app/bsky/graph/defs.ts +41 -0
- package/src/client/types/app/bsky/graph/getRelationships.ts +49 -0
- package/src/client/types/app/bsky/unspecced/getTaggedSuggestions.ts +55 -0
- package/src/types.ts +9 -0
- package/tests/bsky-agent.test.ts +109 -0
package/tests/bsky-agent.test.ts
CHANGED
|
@@ -236,6 +236,9 @@ describe('agent', () => {
|
|
|
236
236
|
sort: 'oldest',
|
|
237
237
|
prioritizeFollowedUsers: true,
|
|
238
238
|
},
|
|
239
|
+
interests: {
|
|
240
|
+
tags: [],
|
|
241
|
+
},
|
|
239
242
|
})
|
|
240
243
|
|
|
241
244
|
await agent.setAdultContentEnabled(true)
|
|
@@ -257,6 +260,9 @@ describe('agent', () => {
|
|
|
257
260
|
sort: 'oldest',
|
|
258
261
|
prioritizeFollowedUsers: true,
|
|
259
262
|
},
|
|
263
|
+
interests: {
|
|
264
|
+
tags: [],
|
|
265
|
+
},
|
|
260
266
|
})
|
|
261
267
|
|
|
262
268
|
await agent.setAdultContentEnabled(false)
|
|
@@ -278,6 +284,9 @@ describe('agent', () => {
|
|
|
278
284
|
sort: 'oldest',
|
|
279
285
|
prioritizeFollowedUsers: true,
|
|
280
286
|
},
|
|
287
|
+
interests: {
|
|
288
|
+
tags: [],
|
|
289
|
+
},
|
|
281
290
|
})
|
|
282
291
|
|
|
283
292
|
await agent.setContentLabelPref('impersonation', 'warn')
|
|
@@ -301,6 +310,9 @@ describe('agent', () => {
|
|
|
301
310
|
sort: 'oldest',
|
|
302
311
|
prioritizeFollowedUsers: true,
|
|
303
312
|
},
|
|
313
|
+
interests: {
|
|
314
|
+
tags: [],
|
|
315
|
+
},
|
|
304
316
|
})
|
|
305
317
|
|
|
306
318
|
await agent.setContentLabelPref('spam', 'show') // will convert to 'ignore'
|
|
@@ -326,6 +338,9 @@ describe('agent', () => {
|
|
|
326
338
|
sort: 'oldest',
|
|
327
339
|
prioritizeFollowedUsers: true,
|
|
328
340
|
},
|
|
341
|
+
interests: {
|
|
342
|
+
tags: [],
|
|
343
|
+
},
|
|
329
344
|
})
|
|
330
345
|
|
|
331
346
|
await agent.addSavedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -353,6 +368,9 @@ describe('agent', () => {
|
|
|
353
368
|
sort: 'oldest',
|
|
354
369
|
prioritizeFollowedUsers: true,
|
|
355
370
|
},
|
|
371
|
+
interests: {
|
|
372
|
+
tags: [],
|
|
373
|
+
},
|
|
356
374
|
})
|
|
357
375
|
|
|
358
376
|
await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -380,6 +398,9 @@ describe('agent', () => {
|
|
|
380
398
|
sort: 'oldest',
|
|
381
399
|
prioritizeFollowedUsers: true,
|
|
382
400
|
},
|
|
401
|
+
interests: {
|
|
402
|
+
tags: [],
|
|
403
|
+
},
|
|
383
404
|
})
|
|
384
405
|
|
|
385
406
|
await agent.removePinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -407,6 +428,9 @@ describe('agent', () => {
|
|
|
407
428
|
sort: 'oldest',
|
|
408
429
|
prioritizeFollowedUsers: true,
|
|
409
430
|
},
|
|
431
|
+
interests: {
|
|
432
|
+
tags: [],
|
|
433
|
+
},
|
|
410
434
|
})
|
|
411
435
|
|
|
412
436
|
await agent.removeSavedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -434,6 +458,9 @@ describe('agent', () => {
|
|
|
434
458
|
sort: 'oldest',
|
|
435
459
|
prioritizeFollowedUsers: true,
|
|
436
460
|
},
|
|
461
|
+
interests: {
|
|
462
|
+
tags: [],
|
|
463
|
+
},
|
|
437
464
|
})
|
|
438
465
|
|
|
439
466
|
await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -461,6 +488,9 @@ describe('agent', () => {
|
|
|
461
488
|
sort: 'oldest',
|
|
462
489
|
prioritizeFollowedUsers: true,
|
|
463
490
|
},
|
|
491
|
+
interests: {
|
|
492
|
+
tags: [],
|
|
493
|
+
},
|
|
464
494
|
})
|
|
465
495
|
|
|
466
496
|
await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake2')
|
|
@@ -494,6 +524,9 @@ describe('agent', () => {
|
|
|
494
524
|
sort: 'oldest',
|
|
495
525
|
prioritizeFollowedUsers: true,
|
|
496
526
|
},
|
|
527
|
+
interests: {
|
|
528
|
+
tags: [],
|
|
529
|
+
},
|
|
497
530
|
})
|
|
498
531
|
|
|
499
532
|
await agent.removeSavedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -521,6 +554,9 @@ describe('agent', () => {
|
|
|
521
554
|
sort: 'oldest',
|
|
522
555
|
prioritizeFollowedUsers: true,
|
|
523
556
|
},
|
|
557
|
+
interests: {
|
|
558
|
+
tags: [],
|
|
559
|
+
},
|
|
524
560
|
})
|
|
525
561
|
|
|
526
562
|
await agent.setPersonalDetails({ birthDate: '2023-09-11T18:05:42.556Z' })
|
|
@@ -548,6 +584,9 @@ describe('agent', () => {
|
|
|
548
584
|
sort: 'oldest',
|
|
549
585
|
prioritizeFollowedUsers: true,
|
|
550
586
|
},
|
|
587
|
+
interests: {
|
|
588
|
+
tags: [],
|
|
589
|
+
},
|
|
551
590
|
})
|
|
552
591
|
|
|
553
592
|
await agent.setFeedViewPrefs('home', { hideReplies: true })
|
|
@@ -575,6 +614,9 @@ describe('agent', () => {
|
|
|
575
614
|
sort: 'oldest',
|
|
576
615
|
prioritizeFollowedUsers: true,
|
|
577
616
|
},
|
|
617
|
+
interests: {
|
|
618
|
+
tags: [],
|
|
619
|
+
},
|
|
578
620
|
})
|
|
579
621
|
|
|
580
622
|
await agent.setFeedViewPrefs('home', { hideReplies: false })
|
|
@@ -602,6 +644,9 @@ describe('agent', () => {
|
|
|
602
644
|
sort: 'oldest',
|
|
603
645
|
prioritizeFollowedUsers: true,
|
|
604
646
|
},
|
|
647
|
+
interests: {
|
|
648
|
+
tags: [],
|
|
649
|
+
},
|
|
605
650
|
})
|
|
606
651
|
|
|
607
652
|
await agent.setFeedViewPrefs('other', { hideReplies: true })
|
|
@@ -636,6 +681,9 @@ describe('agent', () => {
|
|
|
636
681
|
sort: 'oldest',
|
|
637
682
|
prioritizeFollowedUsers: true,
|
|
638
683
|
},
|
|
684
|
+
interests: {
|
|
685
|
+
tags: [],
|
|
686
|
+
},
|
|
639
687
|
})
|
|
640
688
|
|
|
641
689
|
await agent.setThreadViewPrefs({ sort: 'random' })
|
|
@@ -670,6 +718,9 @@ describe('agent', () => {
|
|
|
670
718
|
sort: 'random',
|
|
671
719
|
prioritizeFollowedUsers: true,
|
|
672
720
|
},
|
|
721
|
+
interests: {
|
|
722
|
+
tags: [],
|
|
723
|
+
},
|
|
673
724
|
})
|
|
674
725
|
|
|
675
726
|
await agent.setThreadViewPrefs({ sort: 'oldest' })
|
|
@@ -704,6 +755,46 @@ describe('agent', () => {
|
|
|
704
755
|
sort: 'oldest',
|
|
705
756
|
prioritizeFollowedUsers: true,
|
|
706
757
|
},
|
|
758
|
+
interests: {
|
|
759
|
+
tags: [],
|
|
760
|
+
},
|
|
761
|
+
})
|
|
762
|
+
|
|
763
|
+
await agent.setInterestsPref({ tags: ['foo', 'bar'] })
|
|
764
|
+
await expect(agent.getPreferences()).resolves.toStrictEqual({
|
|
765
|
+
feeds: {
|
|
766
|
+
pinned: ['at://bob.com/app.bsky.feed.generator/fake2'],
|
|
767
|
+
saved: ['at://bob.com/app.bsky.feed.generator/fake2'],
|
|
768
|
+
},
|
|
769
|
+
adultContentEnabled: false,
|
|
770
|
+
contentLabels: {
|
|
771
|
+
impersonation: 'hide',
|
|
772
|
+
spam: 'ignore',
|
|
773
|
+
},
|
|
774
|
+
birthDate: new Date('2023-09-11T18:05:42.556Z'),
|
|
775
|
+
feedViewPrefs: {
|
|
776
|
+
home: {
|
|
777
|
+
hideReplies: false,
|
|
778
|
+
hideRepliesByUnfollowed: false,
|
|
779
|
+
hideRepliesByLikeCount: 0,
|
|
780
|
+
hideReposts: false,
|
|
781
|
+
hideQuotePosts: false,
|
|
782
|
+
},
|
|
783
|
+
other: {
|
|
784
|
+
hideReplies: true,
|
|
785
|
+
hideRepliesByUnfollowed: false,
|
|
786
|
+
hideRepliesByLikeCount: 0,
|
|
787
|
+
hideReposts: false,
|
|
788
|
+
hideQuotePosts: false,
|
|
789
|
+
},
|
|
790
|
+
},
|
|
791
|
+
threadViewPrefs: {
|
|
792
|
+
sort: 'oldest',
|
|
793
|
+
prioritizeFollowedUsers: true,
|
|
794
|
+
},
|
|
795
|
+
interests: {
|
|
796
|
+
tags: ['foo', 'bar'],
|
|
797
|
+
},
|
|
707
798
|
})
|
|
708
799
|
})
|
|
709
800
|
|
|
@@ -827,6 +918,9 @@ describe('agent', () => {
|
|
|
827
918
|
sort: 'newest',
|
|
828
919
|
prioritizeFollowedUsers: false,
|
|
829
920
|
},
|
|
921
|
+
interests: {
|
|
922
|
+
tags: [],
|
|
923
|
+
},
|
|
830
924
|
})
|
|
831
925
|
|
|
832
926
|
await agent.setAdultContentEnabled(false)
|
|
@@ -853,6 +947,9 @@ describe('agent', () => {
|
|
|
853
947
|
sort: 'newest',
|
|
854
948
|
prioritizeFollowedUsers: false,
|
|
855
949
|
},
|
|
950
|
+
interests: {
|
|
951
|
+
tags: [],
|
|
952
|
+
},
|
|
856
953
|
})
|
|
857
954
|
|
|
858
955
|
await agent.setContentLabelPref('nsfw', 'hide')
|
|
@@ -879,6 +976,9 @@ describe('agent', () => {
|
|
|
879
976
|
sort: 'newest',
|
|
880
977
|
prioritizeFollowedUsers: false,
|
|
881
978
|
},
|
|
979
|
+
interests: {
|
|
980
|
+
tags: [],
|
|
981
|
+
},
|
|
882
982
|
})
|
|
883
983
|
|
|
884
984
|
await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -905,6 +1005,9 @@ describe('agent', () => {
|
|
|
905
1005
|
sort: 'newest',
|
|
906
1006
|
prioritizeFollowedUsers: false,
|
|
907
1007
|
},
|
|
1008
|
+
interests: {
|
|
1009
|
+
tags: [],
|
|
1010
|
+
},
|
|
908
1011
|
})
|
|
909
1012
|
|
|
910
1013
|
await agent.setPersonalDetails({ birthDate: '2023-09-11T18:05:42.556Z' })
|
|
@@ -931,6 +1034,9 @@ describe('agent', () => {
|
|
|
931
1034
|
sort: 'newest',
|
|
932
1035
|
prioritizeFollowedUsers: false,
|
|
933
1036
|
},
|
|
1037
|
+
interests: {
|
|
1038
|
+
tags: [],
|
|
1039
|
+
},
|
|
934
1040
|
})
|
|
935
1041
|
|
|
936
1042
|
await agent.setFeedViewPrefs('home', {
|
|
@@ -968,6 +1074,9 @@ describe('agent', () => {
|
|
|
968
1074
|
sort: 'oldest',
|
|
969
1075
|
prioritizeFollowedUsers: true,
|
|
970
1076
|
},
|
|
1077
|
+
interests: {
|
|
1078
|
+
tags: [],
|
|
1079
|
+
},
|
|
971
1080
|
})
|
|
972
1081
|
|
|
973
1082
|
const res = await agent.app.bsky.actor.getPreferences()
|