@atproto/bsky 0.0.5 → 0.0.7

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.
@@ -3472,6 +3472,50 @@ export declare const schemaDict: {
3472
3472
  };
3473
3473
  };
3474
3474
  };
3475
+ feedViewPref: {
3476
+ type: string;
3477
+ required: string[];
3478
+ properties: {
3479
+ feed: {
3480
+ type: string;
3481
+ description: string;
3482
+ };
3483
+ hideReplies: {
3484
+ type: string;
3485
+ description: string;
3486
+ };
3487
+ hideRepliesByUnfollowed: {
3488
+ type: string;
3489
+ description: string;
3490
+ };
3491
+ hideRepliesByLikeCount: {
3492
+ type: string;
3493
+ description: string;
3494
+ };
3495
+ hideReposts: {
3496
+ type: string;
3497
+ description: string;
3498
+ };
3499
+ hideQuotePosts: {
3500
+ type: string;
3501
+ description: string;
3502
+ };
3503
+ };
3504
+ };
3505
+ threadViewPref: {
3506
+ type: string;
3507
+ properties: {
3508
+ sort: {
3509
+ type: string;
3510
+ description: string;
3511
+ knownValues: string[];
3512
+ };
3513
+ prioritizeFollowedUsers: {
3514
+ type: string;
3515
+ description: string;
3516
+ };
3517
+ };
3518
+ };
3475
3519
  };
3476
3520
  };
3477
3521
  AppBskyActorGetPreferences: {
@@ -5342,10 +5386,12 @@ export declare const schemaDict: {
5342
5386
  mentionRule: {
5343
5387
  type: string;
5344
5388
  description: string;
5389
+ properties: {};
5345
5390
  };
5346
5391
  followingRule: {
5347
5392
  type: string;
5348
5393
  description: string;
5394
+ properties: {};
5349
5395
  };
5350
5396
  listRule: {
5351
5397
  type: string;
@@ -53,7 +53,7 @@ export interface ViewerState {
53
53
  }
54
54
  export declare function isViewerState(v: unknown): v is ViewerState;
55
55
  export declare function validateViewerState(v: unknown): ValidationResult;
56
- export declare type Preferences = (AdultContentPref | ContentLabelPref | SavedFeedsPref | PersonalDetailsPref | {
56
+ export declare type Preferences = (AdultContentPref | ContentLabelPref | SavedFeedsPref | PersonalDetailsPref | FeedViewPref | ThreadViewPref | {
57
57
  $type: string;
58
58
  [k: string]: unknown;
59
59
  })[];
@@ -83,3 +83,21 @@ export interface PersonalDetailsPref {
83
83
  }
84
84
  export declare function isPersonalDetailsPref(v: unknown): v is PersonalDetailsPref;
85
85
  export declare function validatePersonalDetailsPref(v: unknown): ValidationResult;
86
+ export interface FeedViewPref {
87
+ feed: string;
88
+ hideReplies?: boolean;
89
+ hideRepliesByUnfollowed?: boolean;
90
+ hideRepliesByLikeCount?: number;
91
+ hideReposts?: boolean;
92
+ hideQuotePosts?: boolean;
93
+ [k: string]: unknown;
94
+ }
95
+ export declare function isFeedViewPref(v: unknown): v is FeedViewPref;
96
+ export declare function validateFeedViewPref(v: unknown): ValidationResult;
97
+ export interface ThreadViewPref {
98
+ sort?: 'oldest' | 'newest' | 'most-likes' | 'random' | (string & {});
99
+ prioritizeFollowedUsers?: boolean;
100
+ [k: string]: unknown;
101
+ }
102
+ export declare function isThreadViewPref(v: unknown): v is ThreadViewPref;
103
+ export declare function validateThreadViewPref(v: unknown): ValidationResult;
@@ -11,10 +11,12 @@ export interface Record {
11
11
  export declare function isRecord(v: unknown): v is Record;
12
12
  export declare function validateRecord(v: unknown): ValidationResult;
13
13
  export interface MentionRule {
14
+ [k: string]: unknown;
14
15
  }
15
16
  export declare function isMentionRule(v: unknown): v is MentionRule;
16
17
  export declare function validateMentionRule(v: unknown): ValidationResult;
17
18
  export interface FollowingRule {
19
+ [k: string]: unknown;
18
20
  }
19
21
  export declare function isFollowingRule(v: unknown): v is FollowingRule;
20
22
  export declare function validateFollowingRule(v: unknown): ValidationResult;
package/package.json CHANGED
@@ -1,10 +1,16 @@
1
1
  {
2
2
  "name": "@atproto/bsky",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "license": "MIT",
5
+ "description": "Reference implementation of app.bsky App View (Bluesky API)",
6
+ "keywords": [
7
+ "atproto",
8
+ "bluesky"
9
+ ],
10
+ "homepage": "https://atproto.com",
5
11
  "repository": {
6
12
  "type": "git",
7
- "url": "https://github.com/bluesky-social/atproto.git",
13
+ "url": "https://github.com/bluesky-social/atproto",
8
14
  "directory": "packages/bsky"
9
15
  },
10
16
  "main": "dist/index.js",
@@ -31,7 +37,7 @@
31
37
  "sharp": "^0.31.2",
32
38
  "typed-emitter": "^2.1.0",
33
39
  "uint8arrays": "3.0.0",
34
- "@atproto/api": "^0.6.14",
40
+ "@atproto/api": "^0.6.16",
35
41
  "@atproto/common": "^0.3.0",
36
42
  "@atproto/crypto": "^0.2.2",
37
43
  "@atproto/syntax": "^0.1.1",
@@ -49,10 +55,10 @@
49
55
  "@types/qs": "^6.9.7",
50
56
  "@types/sharp": "^0.31.0",
51
57
  "axios": "^0.27.2",
52
- "@atproto/api": "^0.6.14",
53
- "@atproto/dev-env": "^0.2.5",
58
+ "@atproto/api": "^0.6.16",
59
+ "@atproto/dev-env": "^0.2.7",
54
60
  "@atproto/lex-cli": "^0.2.1",
55
- "@atproto/pds": "^0.1.14",
61
+ "@atproto/pds": "^0.1.16",
56
62
  "@atproto/xrpc": "^0.3.1"
57
63
  },
58
64
  "scripts": {
@@ -1,4 +1,3 @@
1
- import { AtUri } from '@atproto/syntax'
2
1
  import { AuthRequiredError, InvalidRequestError } from '@atproto/xrpc-server'
3
2
  import {
4
3
  ACKNOWLEDGE,
@@ -3687,6 +3687,8 @@ export const schemaDict = {
3687
3687
  'lex:app.bsky.actor.defs#contentLabelPref',
3688
3688
  'lex:app.bsky.actor.defs#savedFeedsPref',
3689
3689
  'lex:app.bsky.actor.defs#personalDetailsPref',
3690
+ 'lex:app.bsky.actor.defs#feedViewPref',
3691
+ 'lex:app.bsky.actor.defs#threadViewPref',
3690
3692
  ],
3691
3693
  },
3692
3694
  },
@@ -3743,6 +3745,53 @@ export const schemaDict = {
3743
3745
  },
3744
3746
  },
3745
3747
  },
3748
+ feedViewPref: {
3749
+ type: 'object',
3750
+ required: ['feed'],
3751
+ properties: {
3752
+ feed: {
3753
+ type: 'string',
3754
+ description:
3755
+ 'The URI of the feed, or an identifier which describes the feed.',
3756
+ },
3757
+ hideReplies: {
3758
+ type: 'boolean',
3759
+ description: 'Hide replies in the feed.',
3760
+ },
3761
+ hideRepliesByUnfollowed: {
3762
+ type: 'boolean',
3763
+ description:
3764
+ 'Hide replies in the feed if they are not by followed users.',
3765
+ },
3766
+ hideRepliesByLikeCount: {
3767
+ type: 'integer',
3768
+ description:
3769
+ 'Hide replies in the feed if they do not have this number of likes.',
3770
+ },
3771
+ hideReposts: {
3772
+ type: 'boolean',
3773
+ description: 'Hide reposts in the feed.',
3774
+ },
3775
+ hideQuotePosts: {
3776
+ type: 'boolean',
3777
+ description: 'Hide quote posts in the feed.',
3778
+ },
3779
+ },
3780
+ },
3781
+ threadViewPref: {
3782
+ type: 'object',
3783
+ properties: {
3784
+ sort: {
3785
+ type: 'string',
3786
+ description: 'Sorting mode.',
3787
+ knownValues: ['oldest', 'newest', 'most-likes', 'random'],
3788
+ },
3789
+ prioritizeFollowedUsers: {
3790
+ type: 'boolean',
3791
+ description: 'Show followed users at the top of all replies.',
3792
+ },
3793
+ },
3794
+ },
3746
3795
  },
3747
3796
  },
3748
3797
  AppBskyActorGetPreferences: {
@@ -5693,10 +5742,12 @@ export const schemaDict = {
5693
5742
  mentionRule: {
5694
5743
  type: 'object',
5695
5744
  description: 'Allow replies from actors mentioned in your post.',
5745
+ properties: {},
5696
5746
  },
5697
5747
  followingRule: {
5698
5748
  type: 'object',
5699
5749
  description: 'Allow replies from actors you follow.',
5750
+ properties: {},
5700
5751
  },
5701
5752
  listRule: {
5702
5753
  type: 'object',
@@ -6787,7 +6838,8 @@ export const schemaDict = {
6787
6838
  defs: {
6788
6839
  main: {
6789
6840
  type: 'query',
6790
- description: 'An unspecced view of globally popular items',
6841
+ description:
6842
+ 'DEPRECATED: will be removed soon, please find a feed generator alternative',
6791
6843
  parameters: {
6792
6844
  type: 'params',
6793
6845
  properties: {
@@ -109,6 +109,8 @@ export type Preferences = (
109
109
  | ContentLabelPref
110
110
  | SavedFeedsPref
111
111
  | PersonalDetailsPref
112
+ | FeedViewPref
113
+ | ThreadViewPref
112
114
  | { $type: string; [k: string]: unknown }
113
115
  )[]
114
116
 
@@ -182,3 +184,51 @@ export function isPersonalDetailsPref(v: unknown): v is PersonalDetailsPref {
182
184
  export function validatePersonalDetailsPref(v: unknown): ValidationResult {
183
185
  return lexicons.validate('app.bsky.actor.defs#personalDetailsPref', v)
184
186
  }
187
+
188
+ export interface FeedViewPref {
189
+ /** The URI of the feed, or an identifier which describes the feed. */
190
+ feed: string
191
+ /** Hide replies in the feed. */
192
+ hideReplies?: boolean
193
+ /** Hide replies in the feed if they are not by followed users. */
194
+ hideRepliesByUnfollowed?: boolean
195
+ /** Hide replies in the feed if they do not have this number of likes. */
196
+ hideRepliesByLikeCount?: number
197
+ /** Hide reposts in the feed. */
198
+ hideReposts?: boolean
199
+ /** Hide quote posts in the feed. */
200
+ hideQuotePosts?: boolean
201
+ [k: string]: unknown
202
+ }
203
+
204
+ export function isFeedViewPref(v: unknown): v is FeedViewPref {
205
+ return (
206
+ isObj(v) &&
207
+ hasProp(v, '$type') &&
208
+ v.$type === 'app.bsky.actor.defs#feedViewPref'
209
+ )
210
+ }
211
+
212
+ export function validateFeedViewPref(v: unknown): ValidationResult {
213
+ return lexicons.validate('app.bsky.actor.defs#feedViewPref', v)
214
+ }
215
+
216
+ export interface ThreadViewPref {
217
+ /** Sorting mode. */
218
+ sort?: 'oldest' | 'newest' | 'most-likes' | 'random' | (string & {})
219
+ /** Show followed users at the top of all replies. */
220
+ prioritizeFollowedUsers?: boolean
221
+ [k: string]: unknown
222
+ }
223
+
224
+ export function isThreadViewPref(v: unknown): v is ThreadViewPref {
225
+ return (
226
+ isObj(v) &&
227
+ hasProp(v, '$type') &&
228
+ v.$type === 'app.bsky.actor.defs#threadViewPref'
229
+ )
230
+ }
231
+
232
+ export function validateThreadViewPref(v: unknown): ValidationResult {
233
+ return lexicons.validate('app.bsky.actor.defs#threadViewPref', v)
234
+ }
@@ -32,7 +32,9 @@ export function validateRecord(v: unknown): ValidationResult {
32
32
  }
33
33
 
34
34
  /** Allow replies from actors mentioned in your post. */
35
- export interface MentionRule {}
35
+ export interface MentionRule {
36
+ [k: string]: unknown
37
+ }
36
38
 
37
39
  export function isMentionRule(v: unknown): v is MentionRule {
38
40
  return (
@@ -47,7 +49,9 @@ export function validateMentionRule(v: unknown): ValidationResult {
47
49
  }
48
50
 
49
51
  /** Allow replies from actors you follow. */
50
- export interface FollowingRule {}
52
+ export interface FollowingRule {
53
+ [k: string]: unknown
54
+ }
51
55
 
52
56
  export function isFollowingRule(v: unknown): v is FollowingRule {
53
57
  return (
@@ -9,7 +9,6 @@ import { InputSchema as CreateReportInput } from '@atproto/api/src/client/types/
9
9
  import { Record as PostRecord } from '@atproto/api/src/client/types/app/bsky/feed/post'
10
10
  import { Record as LikeRecord } from '@atproto/api/src/client/types/app/bsky/feed/like'
11
11
  import { Record as FollowRecord } from '@atproto/api/src/client/types/app/bsky/graph/follow'
12
- import { Record as ListRecord } from '@atproto/api/src/client/types/app/bsky/graph/list'
13
12
 
14
13
  // Makes it simple to create data via the XRPC client,
15
14
  // and keeps track of all created data in memory for convenience.
@@ -2,10 +2,6 @@ import AtpAgent, { AtUri } from '@atproto/api'
2
2
  import { TestNetwork } from '@atproto/dev-env'
3
3
  import { SeedClient } from '../seeds/client'
4
4
  import basicSeed from '../seeds/basic'
5
- import {
6
- BlockedByActorError,
7
- BlockedActorError,
8
- } from '@atproto/api/src/client/types/app/bsky/feed/getActorLikes'
9
5
 
10
6
  describe('bsky actor likes feed views', () => {
11
7
  let network: TestNetwork
@@ -17,7 +13,6 @@ describe('bsky actor likes feed views', () => {
17
13
  let alice: string
18
14
  let bob: string
19
15
  let carol: string
20
- let dan: string
21
16
 
22
17
  beforeAll(async () => {
23
18
  network = await TestNetwork.create({
@@ -31,7 +26,6 @@ describe('bsky actor likes feed views', () => {
31
26
  alice = sc.dids.alice
32
27
  bob = sc.dids.bob
33
28
  carol = sc.dids.carol
34
- dan = sc.dids.dan
35
29
  })
36
30
 
37
31
  afterAll(async () => {