@atproto/api 0.1.1 → 0.1.3

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.
Files changed (47) hide show
  1. package/build.js +8 -0
  2. package/dist/client/index.d.ts +14 -0
  3. package/dist/client/lexicons.d.ts +251 -227
  4. package/dist/client/types/app/bsky/actor/getProfile.d.ts +2 -24
  5. package/dist/client/types/app/bsky/actor/getSuggestions.d.ts +2 -15
  6. package/dist/client/types/app/bsky/actor/profile.d.ts +24 -1
  7. package/dist/client/types/app/bsky/actor/ref.d.ts +2 -0
  8. package/dist/client/types/app/bsky/actor/search.d.ts +2 -15
  9. package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +2 -13
  10. package/dist/client/types/app/bsky/actor/updateProfile.d.ts +3 -3
  11. package/dist/client/types/app/bsky/embed/record.d.ts +33 -0
  12. package/dist/client/types/app/bsky/feed/getRepostedBy.d.ts +2 -15
  13. package/dist/client/types/app/bsky/feed/post.d.ts +3 -2
  14. package/dist/client/types/app/bsky/graph/getFollowers.d.ts +1 -15
  15. package/dist/client/types/app/bsky/graph/getFollows.d.ts +1 -15
  16. package/dist/client/types/app/bsky/graph/getMutes.d.ts +2 -13
  17. package/dist/client/types/com/atproto/handle/update.d.ts +17 -0
  18. package/dist/client/types/com/atproto/report/reasonType.d.ts +1 -1
  19. package/dist/client/types/com/atproto/sync/getBlocks.d.ts +15 -0
  20. package/dist/client/types/com/atproto/sync/notifyOfUpdate.d.ts +12 -0
  21. package/dist/client/types/com/atproto/sync/requestCrawl.d.ts +13 -0
  22. package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +1 -0
  23. package/dist/index.js +709 -545
  24. package/dist/index.js.map +4 -4
  25. package/package.json +1 -1
  26. package/src/client/index.ts +56 -0
  27. package/src/client/lexicons.ts +290 -253
  28. package/src/client/types/app/bsky/actor/getProfile.ts +2 -35
  29. package/src/client/types/app/bsky/actor/getSuggestions.ts +2 -25
  30. package/src/client/types/app/bsky/actor/profile.ts +47 -1
  31. package/src/client/types/app/bsky/actor/ref.ts +2 -0
  32. package/src/client/types/app/bsky/actor/search.ts +2 -23
  33. package/src/client/types/app/bsky/actor/searchTypeahead.ts +2 -23
  34. package/src/client/types/app/bsky/actor/updateProfile.ts +3 -3
  35. package/src/client/types/app/bsky/embed/record.ts +83 -0
  36. package/src/client/types/app/bsky/feed/getRepostedBy.ts +2 -25
  37. package/src/client/types/app/bsky/feed/post.ts +3 -0
  38. package/src/client/types/app/bsky/graph/getFollowers.ts +1 -25
  39. package/src/client/types/app/bsky/graph/getFollows.ts +1 -25
  40. package/src/client/types/app/bsky/graph/getMutes.ts +2 -23
  41. package/src/client/types/com/atproto/handle/update.ts +31 -0
  42. package/src/client/types/com/atproto/report/reasonType.ts +2 -2
  43. package/src/client/types/com/atproto/sync/getBlocks.ts +31 -0
  44. package/src/client/types/com/atproto/sync/notifyOfUpdate.ts +26 -0
  45. package/src/client/types/com/atproto/sync/requestCrawl.ts +29 -0
  46. package/src/client/types/com/atproto/sync/subscribeAllRepos.ts +7 -0
  47. package/tsconfig.build.tsbuildinfo +1 -1
@@ -1,6 +1,5 @@
1
1
  import { Headers } from '@atproto/xrpc';
2
- import { ValidationResult } from '@atproto/lexicon';
3
- import * as AppBskySystemDeclRef from '../system/declRef';
2
+ import * as AppBskyActorProfile from './profile';
4
3
  export interface QueryParams {
5
4
  limit?: number;
6
5
  cursor?: string;
@@ -8,7 +7,7 @@ export interface QueryParams {
8
7
  export declare type InputSchema = undefined;
9
8
  export interface OutputSchema {
10
9
  cursor?: string;
11
- actors: Actor[];
10
+ actors: AppBskyActorProfile.ViewBasic[];
12
11
  [k: string]: unknown;
13
12
  }
14
13
  export interface CallOptions {
@@ -20,15 +19,3 @@ export interface Response {
20
19
  data: OutputSchema;
21
20
  }
22
21
  export declare function toKnownErr(e: any): any;
23
- export interface Actor {
24
- did: string;
25
- declaration: AppBskySystemDeclRef.Main;
26
- handle: string;
27
- displayName?: string;
28
- description?: string;
29
- avatar?: string;
30
- indexedAt?: string;
31
- [k: string]: unknown;
32
- }
33
- export declare function isActor(v: unknown): v is Actor;
34
- export declare function validateActor(v: unknown): ValidationResult;
@@ -21,7 +21,6 @@ export interface View {
21
21
  did: string;
22
22
  declaration: AppBskySystemDeclRef.Main;
23
23
  handle: string;
24
- creator: string;
25
24
  displayName?: string;
26
25
  description?: string;
27
26
  avatar?: string;
@@ -29,11 +28,35 @@ export interface View {
29
28
  followersCount: number;
30
29
  followsCount: number;
31
30
  postsCount: number;
31
+ creator: string;
32
+ indexedAt?: string;
33
+ viewer?: ViewerState;
32
34
  myState?: MyState;
33
35
  [k: string]: unknown;
34
36
  }
35
37
  export declare function isView(v: unknown): v is View;
36
38
  export declare function validateView(v: unknown): ValidationResult;
39
+ export interface ViewBasic {
40
+ did: string;
41
+ declaration: AppBskySystemDeclRef.Main;
42
+ handle: string;
43
+ displayName?: string;
44
+ description?: string;
45
+ avatar?: string;
46
+ indexedAt?: string;
47
+ viewer?: ViewerState;
48
+ [k: string]: unknown;
49
+ }
50
+ export declare function isViewBasic(v: unknown): v is ViewBasic;
51
+ export declare function validateViewBasic(v: unknown): ValidationResult;
52
+ export interface ViewerState {
53
+ muted?: boolean;
54
+ following?: string;
55
+ followedBy?: string;
56
+ [k: string]: unknown;
57
+ }
58
+ export declare function isViewerState(v: unknown): v is ViewerState;
59
+ export declare function validateViewerState(v: unknown): ValidationResult;
37
60
  export interface MyState {
38
61
  follow?: string;
39
62
  muted?: boolean;
@@ -20,6 +20,8 @@ export declare function isWithInfo(v: unknown): v is WithInfo;
20
20
  export declare function validateWithInfo(v: unknown): ValidationResult;
21
21
  export interface ViewerState {
22
22
  muted?: boolean;
23
+ following?: string;
24
+ followedBy?: string;
23
25
  [k: string]: unknown;
24
26
  }
25
27
  export declare function isViewerState(v: unknown): v is ViewerState;
@@ -1,6 +1,5 @@
1
1
  import { Headers } from '@atproto/xrpc';
2
- import { ValidationResult } from '@atproto/lexicon';
3
- import * as AppBskySystemDeclRef from '../system/declRef';
2
+ import * as AppBskyActorProfile from './profile';
4
3
  export interface QueryParams {
5
4
  term?: string;
6
5
  limit?: number;
@@ -9,7 +8,7 @@ export interface QueryParams {
9
8
  export declare type InputSchema = undefined;
10
9
  export interface OutputSchema {
11
10
  cursor?: string;
12
- users: User[];
11
+ users: AppBskyActorProfile.ViewBasic[];
13
12
  [k: string]: unknown;
14
13
  }
15
14
  export interface CallOptions {
@@ -21,15 +20,3 @@ export interface Response {
21
20
  data: OutputSchema;
22
21
  }
23
22
  export declare function toKnownErr(e: any): any;
24
- export interface User {
25
- did: string;
26
- declaration: AppBskySystemDeclRef.Main;
27
- handle: string;
28
- displayName?: string;
29
- avatar?: string;
30
- description?: string;
31
- indexedAt?: string;
32
- [k: string]: unknown;
33
- }
34
- export declare function isUser(v: unknown): v is User;
35
- export declare function validateUser(v: unknown): ValidationResult;
@@ -1,13 +1,12 @@
1
1
  import { Headers } from '@atproto/xrpc';
2
- import { ValidationResult } from '@atproto/lexicon';
3
- import * as AppBskySystemDeclRef from '../system/declRef';
2
+ import * as AppBskyActorRef from './ref';
4
3
  export interface QueryParams {
5
4
  term?: string;
6
5
  limit?: number;
7
6
  }
8
7
  export declare type InputSchema = undefined;
9
8
  export interface OutputSchema {
10
- users: User[];
9
+ users: AppBskyActorRef.WithInfo[];
11
10
  [k: string]: unknown;
12
11
  }
13
12
  export interface CallOptions {
@@ -19,13 +18,3 @@ export interface Response {
19
18
  data: OutputSchema;
20
19
  }
21
20
  export declare function toKnownErr(e: any): any;
22
- export interface User {
23
- did: string;
24
- declaration: AppBskySystemDeclRef.Main;
25
- handle: string;
26
- displayName?: string;
27
- avatar?: string;
28
- [k: string]: unknown;
29
- }
30
- export declare function isUser(v: unknown): v is User;
31
- export declare function validateUser(v: unknown): ValidationResult;
@@ -3,17 +3,17 @@ export interface QueryParams {
3
3
  }
4
4
  export interface InputSchema {
5
5
  displayName?: string;
6
- description?: string;
6
+ description?: string | null;
7
7
  avatar?: {
8
8
  cid: string;
9
9
  mimeType: string;
10
10
  [k: string]: unknown;
11
- };
11
+ } | null;
12
12
  banner?: {
13
13
  cid: string;
14
14
  mimeType: string;
15
15
  [k: string]: unknown;
16
- };
16
+ } | null;
17
17
  [k: string]: unknown;
18
18
  }
19
19
  export interface OutputSchema {
@@ -0,0 +1,33 @@
1
+ import { ValidationResult } from '@atproto/lexicon';
2
+ import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef';
3
+ import * as AppBskyActorRef from '../actor/ref';
4
+ export interface Main {
5
+ record: ComAtprotoRepoStrongRef.Main;
6
+ [k: string]: unknown;
7
+ }
8
+ export declare function isMain(v: unknown): v is Main;
9
+ export declare function validateMain(v: unknown): ValidationResult;
10
+ export interface Presented {
11
+ record: PresentedRecord | PresentedNotFound | {
12
+ $type: string;
13
+ [k: string]: unknown;
14
+ };
15
+ [k: string]: unknown;
16
+ }
17
+ export declare function isPresented(v: unknown): v is Presented;
18
+ export declare function validatePresented(v: unknown): ValidationResult;
19
+ export interface PresentedRecord {
20
+ uri: string;
21
+ cid: string;
22
+ author: AppBskyActorRef.WithInfo;
23
+ record: {};
24
+ [k: string]: unknown;
25
+ }
26
+ export declare function isPresentedRecord(v: unknown): v is PresentedRecord;
27
+ export declare function validatePresentedRecord(v: unknown): ValidationResult;
28
+ export interface PresentedNotFound {
29
+ uri: string;
30
+ [k: string]: unknown;
31
+ }
32
+ export declare function isPresentedNotFound(v: unknown): v is PresentedNotFound;
33
+ export declare function validatePresentedNotFound(v: unknown): ValidationResult;
@@ -1,6 +1,5 @@
1
1
  import { Headers } from '@atproto/xrpc';
2
- import { ValidationResult } from '@atproto/lexicon';
3
- import * as AppBskySystemDeclRef from '../system/declRef';
2
+ import * as AppBskyActorRef from '../actor/ref';
4
3
  export interface QueryParams {
5
4
  uri: string;
6
5
  cid?: string;
@@ -12,7 +11,7 @@ export interface OutputSchema {
12
11
  uri: string;
13
12
  cid?: string;
14
13
  cursor?: string;
15
- repostedBy: RepostedBy[];
14
+ repostedBy: AppBskyActorRef.WithInfo[];
16
15
  [k: string]: unknown;
17
16
  }
18
17
  export interface CallOptions {
@@ -24,15 +23,3 @@ export interface Response {
24
23
  data: OutputSchema;
25
24
  }
26
25
  export declare function toKnownErr(e: any): any;
27
- export interface RepostedBy {
28
- did: string;
29
- declaration: AppBskySystemDeclRef.Main;
30
- handle: string;
31
- displayName?: string;
32
- avatar?: string;
33
- createdAt?: string;
34
- indexedAt: string;
35
- [k: string]: unknown;
36
- }
37
- export declare function isRepostedBy(v: unknown): v is RepostedBy;
38
- export declare function validateRepostedBy(v: unknown): ValidationResult;
@@ -1,13 +1,14 @@
1
1
  import { ValidationResult } from '@atproto/lexicon';
2
2
  import * as AppBskyEmbedImages from '../embed/images';
3
3
  import * as AppBskyEmbedExternal from '../embed/external';
4
+ import * as AppBskyEmbedRecord from '../embed/record';
4
5
  import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef';
5
6
  import * as AppBskyActorRef from '../actor/ref';
6
7
  export interface Record {
7
8
  text: string;
8
9
  entities?: Entity[];
9
10
  reply?: ReplyRef;
10
- embed?: AppBskyEmbedImages.Main | AppBskyEmbedExternal.Main | {
11
+ embed?: AppBskyEmbedImages.Main | AppBskyEmbedExternal.Main | AppBskyEmbedRecord.Main | {
11
12
  $type: string;
12
13
  [k: string]: unknown;
13
14
  };
@@ -43,7 +44,7 @@ export interface View {
43
44
  cid: string;
44
45
  author: AppBskyActorRef.WithInfo;
45
46
  record: {};
46
- embed?: AppBskyEmbedImages.Presented | AppBskyEmbedExternal.Presented | {
47
+ embed?: AppBskyEmbedImages.Presented | AppBskyEmbedExternal.Presented | AppBskyEmbedRecord.Presented | {
47
48
  $type: string;
48
49
  [k: string]: unknown;
49
50
  };
@@ -1,7 +1,5 @@
1
1
  import { Headers } from '@atproto/xrpc';
2
- import { ValidationResult } from '@atproto/lexicon';
3
2
  import * as AppBskyActorRef from '../actor/ref';
4
- import * as AppBskySystemDeclRef from '../system/declRef';
5
3
  export interface QueryParams {
6
4
  user: string;
7
5
  limit?: number;
@@ -11,7 +9,7 @@ export declare type InputSchema = undefined;
11
9
  export interface OutputSchema {
12
10
  subject: AppBskyActorRef.WithInfo;
13
11
  cursor?: string;
14
- followers: Follower[];
12
+ followers: AppBskyActorRef.WithInfo[];
15
13
  [k: string]: unknown;
16
14
  }
17
15
  export interface CallOptions {
@@ -23,15 +21,3 @@ export interface Response {
23
21
  data: OutputSchema;
24
22
  }
25
23
  export declare function toKnownErr(e: any): any;
26
- export interface Follower {
27
- did: string;
28
- declaration: AppBskySystemDeclRef.Main;
29
- handle: string;
30
- displayName?: string;
31
- avatar?: string;
32
- createdAt?: string;
33
- indexedAt: string;
34
- [k: string]: unknown;
35
- }
36
- export declare function isFollower(v: unknown): v is Follower;
37
- export declare function validateFollower(v: unknown): ValidationResult;
@@ -1,7 +1,5 @@
1
1
  import { Headers } from '@atproto/xrpc';
2
- import { ValidationResult } from '@atproto/lexicon';
3
2
  import * as AppBskyActorRef from '../actor/ref';
4
- import * as AppBskySystemDeclRef from '../system/declRef';
5
3
  export interface QueryParams {
6
4
  user: string;
7
5
  limit?: number;
@@ -11,7 +9,7 @@ export declare type InputSchema = undefined;
11
9
  export interface OutputSchema {
12
10
  subject: AppBskyActorRef.WithInfo;
13
11
  cursor?: string;
14
- follows: Follow[];
12
+ follows: AppBskyActorRef.WithInfo[];
15
13
  [k: string]: unknown;
16
14
  }
17
15
  export interface CallOptions {
@@ -23,15 +21,3 @@ export interface Response {
23
21
  data: OutputSchema;
24
22
  }
25
23
  export declare function toKnownErr(e: any): any;
26
- export interface Follow {
27
- did: string;
28
- declaration: AppBskySystemDeclRef.Main;
29
- handle: string;
30
- displayName?: string;
31
- avatar?: string;
32
- createdAt?: string;
33
- indexedAt: string;
34
- [k: string]: unknown;
35
- }
36
- export declare function isFollow(v: unknown): v is Follow;
37
- export declare function validateFollow(v: unknown): ValidationResult;
@@ -1,6 +1,5 @@
1
1
  import { Headers } from '@atproto/xrpc';
2
- import { ValidationResult } from '@atproto/lexicon';
3
- import * as AppBskySystemDeclRef from '../system/declRef';
2
+ import * as AppBskyActorRef from '../actor/ref';
4
3
  export interface QueryParams {
5
4
  limit?: number;
6
5
  before?: string;
@@ -8,7 +7,7 @@ export interface QueryParams {
8
7
  export declare type InputSchema = undefined;
9
8
  export interface OutputSchema {
10
9
  cursor?: string;
11
- mutes: Mute[];
10
+ mutes: AppBskyActorRef.WithInfo[];
12
11
  [k: string]: unknown;
13
12
  }
14
13
  export interface CallOptions {
@@ -20,13 +19,3 @@ export interface Response {
20
19
  data: OutputSchema;
21
20
  }
22
21
  export declare function toKnownErr(e: any): any;
23
- export interface Mute {
24
- did: string;
25
- declaration: AppBskySystemDeclRef.Main;
26
- handle: string;
27
- displayName?: string;
28
- createdAt: string;
29
- [k: string]: unknown;
30
- }
31
- export declare function isMute(v: unknown): v is Mute;
32
- export declare function validateMute(v: unknown): ValidationResult;
@@ -0,0 +1,17 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ }
4
+ export interface InputSchema {
5
+ handle: string;
6
+ [k: string]: unknown;
7
+ }
8
+ export interface CallOptions {
9
+ headers?: Headers;
10
+ qp?: QueryParams;
11
+ encoding: 'application/json';
12
+ }
13
+ export interface Response {
14
+ success: boolean;
15
+ headers: Headers;
16
+ }
17
+ export declare function toKnownErr(e: any): any;
@@ -1,3 +1,3 @@
1
- export declare type Main = 'com.atproto.report.reason#spam' | 'com.atproto.report.reason#other' | (string & {});
1
+ export declare type Main = 'com.atproto.report.reasonType#spam' | 'com.atproto.report.reasonType#other' | (string & {});
2
2
  export declare const SPAM = "com.atproto.report.reasonType#spam";
3
3
  export declare const OTHER = "com.atproto.report.reasonType#other";
@@ -0,0 +1,15 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ did: string;
4
+ cids: string[];
5
+ }
6
+ export declare type InputSchema = undefined;
7
+ export interface CallOptions {
8
+ headers?: Headers;
9
+ }
10
+ export interface Response {
11
+ success: boolean;
12
+ headers: Headers;
13
+ data: Uint8Array;
14
+ }
15
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,12 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ }
4
+ export declare type InputSchema = undefined;
5
+ export interface CallOptions {
6
+ headers?: Headers;
7
+ }
8
+ export interface Response {
9
+ success: boolean;
10
+ headers: Headers;
11
+ }
12
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,13 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ host?: string;
4
+ }
5
+ export declare type InputSchema = undefined;
6
+ export interface CallOptions {
7
+ headers?: Headers;
8
+ }
9
+ export interface Response {
10
+ success: boolean;
11
+ headers: Headers;
12
+ }
13
+ export declare function toKnownErr(e: any): any;