@atproto/api 0.6.15 → 0.6.16

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atproto/api
2
2
 
3
+ ## 0.6.16
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1653](https://github.com/bluesky-social/atproto/pull/1653) [`56e2cf89`](https://github.com/bluesky-social/atproto/commit/56e2cf8999f6d7522529a9be8652c47545f82242) Thanks [@pfrazee](https://github.com/pfrazee)! - Improve the types of the thread and feed preferences APIs
8
+
3
9
  ## 0.6.15
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -31,6 +31,8 @@ Log into a server or create accounts using these APIs. You'll need an active ses
31
31
 
32
32
  ```typescript
33
33
  import { BskyAgent, AtpSessionEvent, AtpSessionData } from '@atproto/api'
34
+
35
+ // configure connection to the server, without account authentication
34
36
  const agent = new BskyAgent({
35
37
  service: 'https://example.com',
36
38
  persistSession: (evt: AtpSessionEvent, sess?: AtpSessionData) => {
@@ -38,13 +40,19 @@ const agent = new BskyAgent({
38
40
  },
39
41
  })
40
42
 
41
- await agent.login({ identifier: 'alice@mail.com', password: 'hunter2' })
42
- await agent.resumeSession(savedSessionData)
43
+ // create a new account on the server
43
44
  await agent.createAccount({
44
45
  email: 'alice@mail.com',
45
46
  password: 'hunter2',
46
47
  handle: 'alice.example.com',
48
+ inviteCode: 'some-code-12345-abcde',
47
49
  })
50
+
51
+ // if an existing session (accessed with 'agent.session') was securely stored previously, then reuse that
52
+ await agent.resumeSession(savedSessionData)
53
+
54
+ // if no old session was available, create a new one by logging in with password (App Password)
55
+ await agent.login({ identifier: 'alice@mail.com', password: 'hunter2' })
48
56
  ```
49
57
 
50
58
  ### API calls
@@ -1,6 +1,6 @@
1
1
  import { AtpAgent } from './agent';
2
- import { AppBskyFeedPost, AppBskyActorProfile, AppBskyActorDefs } from './client';
3
- import { BskyPreferences, BskyLabelPreference } from './types';
2
+ import { AppBskyFeedPost, AppBskyActorProfile } from './client';
3
+ import { BskyPreferences, BskyLabelPreference, BskyFeedViewPreference, BskyThreadViewPreference } from './types';
4
4
  declare global {
5
5
  interface Array<T> {
6
6
  findLast(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T;
@@ -75,6 +75,6 @@ export declare class BskyAgent extends AtpAgent {
75
75
  setPersonalDetails({ birthDate, }: {
76
76
  birthDate: string | Date | undefined;
77
77
  }): Promise<void>;
78
- setFeedViewPrefs(feed: string, pref: Omit<AppBskyActorDefs.FeedViewPref, '$type' | 'feed'>): Promise<void>;
79
- setThreadViewPrefs(pref: Omit<AppBskyActorDefs.ThreadViewPref, '$type'>): Promise<void>;
78
+ setFeedViewPrefs(feed: string, pref: Partial<BskyFeedViewPreference>): Promise<void>;
79
+ setThreadViewPrefs(pref: Partial<BskyThreadViewPreference>): Promise<void>;
80
80
  }
package/dist/index.js CHANGED
@@ -22382,7 +22382,7 @@ var schemaDict = {
22382
22382
  defs: {
22383
22383
  main: {
22384
22384
  type: "query",
22385
- description: "An unspecced view of globally popular items",
22385
+ description: "DEPRECATED: will be removed soon, please find a feed generator alternative",
22386
22386
  parameters: {
22387
22387
  type: "params",
22388
22388
  properties: {
@@ -28892,12 +28892,12 @@ function decideQuotedPostWithMediaAccount(subject, opts) {
28892
28892
  }
28893
28893
 
28894
28894
  // src/moderation/subjects/feed-generator.ts
28895
- function decideFeedGenerator(subject, opts) {
28895
+ function decideFeedGenerator(_subject, _opts) {
28896
28896
  return ModerationDecision.noop();
28897
28897
  }
28898
28898
 
28899
28899
  // src/moderation/subjects/user-list.ts
28900
- function decideUserList(subject, opts) {
28900
+ function decideUserList(_subject, _opts) {
28901
28901
  return ModerationDecision.noop();
28902
28902
  }
28903
28903