@atproto/api 0.6.7 → 0.6.8

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 (111) hide show
  1. package/build.js +8 -0
  2. package/dist/agent.d.ts +25 -44
  3. package/dist/bsky-agent.d.ts +24 -0
  4. package/dist/client/types/app/bsky/actor/createScene.d.ts +32 -0
  5. package/dist/client/types/app/bsky/actor/defs.d.ts +65 -74
  6. package/dist/client/types/app/bsky/actor/ref.d.ts +28 -0
  7. package/dist/client/types/app/bsky/actor/search.d.ts +22 -0
  8. package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +20 -0
  9. package/dist/client/types/app/bsky/actor/updateProfile.d.ts +40 -0
  10. package/dist/client/types/app/bsky/embed/external.d.ts +23 -23
  11. package/dist/client/types/app/bsky/embed/images.d.ts +20 -20
  12. package/dist/client/types/app/bsky/embed/recordWithMedia.d.ts +20 -26
  13. package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +28 -0
  14. package/dist/client/types/app/bsky/feed/getSavedFeeds.d.ts +21 -0
  15. package/dist/client/types/app/bsky/feed/getVotes.d.ts +36 -0
  16. package/dist/client/types/app/bsky/feed/like.d.ts +7 -7
  17. package/dist/client/types/app/bsky/feed/repost.d.ts +7 -7
  18. package/dist/client/types/app/bsky/feed/saveFeed.d.ts +17 -0
  19. package/dist/client/types/app/bsky/feed/setVote.d.ts +25 -0
  20. package/dist/client/types/app/bsky/feed/trend.d.ts +9 -0
  21. package/dist/client/types/app/bsky/feed/unsaveFeed.d.ts +17 -0
  22. package/dist/client/types/app/bsky/feed/vote.d.ts +10 -0
  23. package/dist/client/types/app/bsky/graph/assertCreator.d.ts +1 -0
  24. package/dist/client/types/app/bsky/graph/assertMember.d.ts +1 -0
  25. package/dist/client/types/app/bsky/graph/assertion.d.ts +10 -0
  26. package/dist/client/types/app/bsky/graph/block.d.ts +6 -6
  27. package/dist/client/types/app/bsky/graph/confirmation.d.ts +11 -0
  28. package/dist/client/types/app/bsky/graph/defs.d.ts +36 -36
  29. package/dist/client/types/app/bsky/graph/follow.d.ts +6 -6
  30. package/dist/client/types/app/bsky/graph/getAssertions.d.ts +48 -0
  31. package/dist/client/types/app/bsky/graph/getListBlocks.d.ts +21 -0
  32. package/dist/client/types/app/bsky/graph/getMembers.d.ts +36 -0
  33. package/dist/client/types/app/bsky/graph/getMemberships.d.ts +36 -0
  34. package/dist/client/types/app/bsky/graph/listblock.d.ts +8 -0
  35. package/dist/client/types/app/bsky/graph/listitem.d.ts +7 -7
  36. package/dist/client/types/app/bsky/graph/mute.d.ts +17 -0
  37. package/dist/client/types/app/bsky/graph/subscribeMuteList.d.ts +17 -0
  38. package/dist/client/types/app/bsky/graph/unmute.d.ts +17 -0
  39. package/dist/client/types/app/bsky/graph/unsubscribeMuteList.d.ts +17 -0
  40. package/dist/client/types/app/bsky/notification/getCount.d.ts +17 -0
  41. package/dist/client/types/app/bsky/notification/list.d.ts +35 -0
  42. package/dist/client/types/app/bsky/richtext/facet.d.ts +22 -26
  43. package/dist/client/types/app/bsky/system/actorScene.d.ts +1 -0
  44. package/dist/client/types/app/bsky/system/actorUser.d.ts +1 -0
  45. package/dist/client/types/app/bsky/system/declRef.d.ts +8 -0
  46. package/dist/client/types/app/bsky/system/declaration.d.ts +7 -0
  47. package/dist/client/types/com/atproto/account/create.d.ts +41 -0
  48. package/dist/client/types/com/atproto/account/createInviteCode.d.ts +22 -0
  49. package/dist/client/types/com/atproto/account/delete.d.ts +25 -0
  50. package/dist/client/types/com/atproto/account/get.d.ts +12 -0
  51. package/dist/client/types/com/atproto/account/requestDelete.d.ts +13 -0
  52. package/dist/client/types/com/atproto/account/requestPasswordReset.d.ts +17 -0
  53. package/dist/client/types/com/atproto/account/resetPassword.d.ts +24 -0
  54. package/dist/client/types/com/atproto/admin/blob.d.ts +37 -0
  55. package/dist/client/types/com/atproto/admin/moderationAction.d.ts +60 -0
  56. package/dist/client/types/com/atproto/admin/moderationReport.d.ts +37 -0
  57. package/dist/client/types/com/atproto/admin/record.d.ts +43 -0
  58. package/dist/client/types/com/atproto/admin/repo.d.ts +45 -0
  59. package/dist/client/types/com/atproto/blob/upload.d.ts +19 -0
  60. package/dist/client/types/com/atproto/handle/resolve.d.ts +18 -0
  61. package/dist/client/types/com/atproto/handle/update.d.ts +17 -0
  62. package/dist/client/types/com/atproto/label/subscribeLabels.d.ts +12 -12
  63. package/dist/client/types/com/atproto/moderation/defs.d.ts +7 -16
  64. package/dist/client/types/com/atproto/repo/batchWrite.d.ts +46 -0
  65. package/dist/client/types/com/atproto/repo/describe.d.ts +22 -0
  66. package/dist/client/types/com/atproto/repo/recordRef.d.ts +8 -0
  67. package/dist/client/types/com/atproto/repo/repoRef.d.ts +7 -0
  68. package/dist/client/types/com/atproto/repo/strongRef.d.ts +6 -6
  69. package/dist/client/types/com/atproto/report/create.d.ts +39 -0
  70. package/dist/client/types/com/atproto/report/reasonType.d.ts +3 -0
  71. package/dist/client/types/com/atproto/report/subject.d.ts +23 -0
  72. package/dist/client/types/com/atproto/server/defs.d.ts +16 -16
  73. package/dist/client/types/com/atproto/server/getAccountsConfig.d.ts +27 -0
  74. package/dist/client/types/com/atproto/session/create.d.ts +29 -0
  75. package/dist/client/types/com/atproto/session/delete.d.ts +13 -0
  76. package/dist/client/types/com/atproto/session/get.d.ts +18 -0
  77. package/dist/client/types/com/atproto/session/refresh.d.ts +24 -0
  78. package/dist/client/types/com/atproto/sync/getRoot.d.ts +18 -0
  79. package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +9 -0
  80. package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +46 -46
  81. package/dist/client/types/com/atproto/sync/updateRepo.d.ts +15 -0
  82. package/dist/client/util.d.ts +2 -5
  83. package/dist/helpers/bsky.d.ts +20 -0
  84. package/dist/index.d.ts +1 -1
  85. package/dist/index.js +1260 -865
  86. package/dist/index.js.map +4 -4
  87. package/dist/mixins/bsky.d.ts +23 -0
  88. package/dist/rich-text/detection.d.ts +4 -4
  89. package/dist/rich-text/rich-text.d.ts +31 -31
  90. package/dist/rich-text/sanitization.d.ts +4 -7
  91. package/dist/rich-text/sanitize.d.ts +4 -0
  92. package/dist/rich-text/unicode.d.ts +9 -9
  93. package/dist/session.d.ts +42 -0
  94. package/dist/types.d.ts +32 -34
  95. package/package.json +23 -22
  96. package/src/bsky-agent.ts +181 -1
  97. package/src/client/index.ts +36 -39
  98. package/src/client/lexicons.ts +76 -129
  99. package/src/client/types/com/atproto/sync/getCheckout.ts +0 -2
  100. package/src/client/types/com/atproto/sync/{getCommitPath.ts → getLatestCommit.ts} +9 -5
  101. package/src/client/types/com/atproto/sync/getRepo.ts +2 -4
  102. package/src/client/types/com/atproto/sync/listBlobs.ts +5 -4
  103. package/src/client/types/com/atproto/sync/subscribeRepos.ts +5 -1
  104. package/src/client/types/com/atproto/{admin/rebaseRepo.ts → temp/upgradeRepoVersion.ts} +1 -18
  105. package/src/index.ts +1 -1
  106. package/src/types.ts +20 -0
  107. package/tests/bsky-agent.test.ts +149 -0
  108. package/tsconfig.build.tsbuildinfo +1 -1
  109. package/update-pkg.js +14 -0
  110. package/LICENSE +0 -21
  111. package/src/client/types/com/atproto/repo/rebaseRepo.ts +0 -49
@@ -0,0 +1,39 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ import * as ComAtprotoReportReasonType from './reasonType';
3
+ import * as ComAtprotoRepoRepoRef from '../repo/repoRef';
4
+ import * as ComAtprotoRepoRecordRef from '../repo/recordRef';
5
+ import * as ComAtprotoRepoStrongRef from '../repo/strongRef';
6
+ export interface QueryParams {
7
+ }
8
+ export interface InputSchema {
9
+ reasonType: ComAtprotoReportReasonType.Main;
10
+ reason?: string;
11
+ subject: ComAtprotoRepoRepoRef.Main | ComAtprotoRepoRecordRef.Main | {
12
+ $type: string;
13
+ [k: string]: unknown;
14
+ };
15
+ [k: string]: unknown;
16
+ }
17
+ export interface OutputSchema {
18
+ id: number;
19
+ reasonType: ComAtprotoReportReasonType.Main;
20
+ reason?: string;
21
+ subject: ComAtprotoRepoRepoRef.Main | ComAtprotoRepoStrongRef.Main | {
22
+ $type: string;
23
+ [k: string]: unknown;
24
+ };
25
+ reportedByDid: string;
26
+ createdAt: string;
27
+ [k: string]: unknown;
28
+ }
29
+ export interface CallOptions {
30
+ headers?: Headers;
31
+ qp?: QueryParams;
32
+ encoding: 'application/json';
33
+ }
34
+ export interface Response {
35
+ success: boolean;
36
+ headers: Headers;
37
+ data: OutputSchema;
38
+ }
39
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,3 @@
1
+ export declare type Main = 'com.atproto.report.reasonType#spam' | 'com.atproto.report.reasonType#other' | (string & {});
2
+ export declare const SPAM = "com.atproto.report.reasonType#spam";
3
+ export declare const OTHER = "com.atproto.report.reasonType#other";
@@ -0,0 +1,23 @@
1
+ import { ValidationResult } from '@atproto/lexicon';
2
+ export interface Repo {
3
+ did: string;
4
+ [k: string]: unknown;
5
+ }
6
+ export declare function isRepo(v: unknown): v is Repo;
7
+ export declare function validateRepo(v: unknown): ValidationResult;
8
+ export interface Record {
9
+ did: string;
10
+ collection: string;
11
+ rkey: string;
12
+ cid?: string;
13
+ [k: string]: unknown;
14
+ }
15
+ export declare function isRecord(v: unknown): v is Record;
16
+ export declare function validateRecord(v: unknown): ValidationResult;
17
+ export interface RecordRef {
18
+ uri: string;
19
+ cid: string;
20
+ [k: string]: unknown;
21
+ }
22
+ export declare function isRecordRef(v: unknown): v is RecordRef;
23
+ export declare function validateRecordRef(v: unknown): ValidationResult;
@@ -1,20 +1,20 @@
1
- import { ValidationResult } from '@atproto/lexicon'
1
+ import { ValidationResult } from '@atproto/lexicon';
2
2
  export interface InviteCode {
3
- code: string
4
- available: number
5
- disabled: boolean
6
- forAccount: string
7
- createdBy: string
8
- createdAt: string
9
- uses: InviteCodeUse[]
10
- [k: string]: unknown
3
+ code: string;
4
+ available: number;
5
+ disabled: boolean;
6
+ forAccount: string;
7
+ createdBy: string;
8
+ createdAt: string;
9
+ uses: InviteCodeUse[];
10
+ [k: string]: unknown;
11
11
  }
12
- export declare function isInviteCode(v: unknown): v is InviteCode
13
- export declare function validateInviteCode(v: unknown): ValidationResult
12
+ export declare function isInviteCode(v: unknown): v is InviteCode;
13
+ export declare function validateInviteCode(v: unknown): ValidationResult;
14
14
  export interface InviteCodeUse {
15
- usedBy: string
16
- usedAt: string
17
- [k: string]: unknown
15
+ usedBy: string;
16
+ usedAt: string;
17
+ [k: string]: unknown;
18
18
  }
19
- export declare function isInviteCodeUse(v: unknown): v is InviteCodeUse
20
- export declare function validateInviteCodeUse(v: unknown): ValidationResult
19
+ export declare function isInviteCodeUse(v: unknown): v is InviteCodeUse;
20
+ export declare function validateInviteCodeUse(v: unknown): ValidationResult;
@@ -0,0 +1,27 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ import { ValidationResult } from '@atproto/lexicon';
3
+ export interface QueryParams {
4
+ }
5
+ export declare type InputSchema = undefined;
6
+ export interface OutputSchema {
7
+ inviteCodeRequired?: boolean;
8
+ availableUserDomains: string[];
9
+ links?: Links;
10
+ [k: string]: unknown;
11
+ }
12
+ export interface CallOptions {
13
+ headers?: Headers;
14
+ }
15
+ export interface Response {
16
+ success: boolean;
17
+ headers: Headers;
18
+ data: OutputSchema;
19
+ }
20
+ export declare function toKnownErr(e: any): any;
21
+ export interface Links {
22
+ privacyPolicy?: string;
23
+ termsOfService?: string;
24
+ [k: string]: unknown;
25
+ }
26
+ export declare function isLinks(v: unknown): v is Links;
27
+ export declare function validateLinks(v: unknown): ValidationResult;
@@ -0,0 +1,29 @@
1
+ import { Headers, XRPCError } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ }
4
+ export interface InputSchema {
5
+ identifier?: string;
6
+ password: string;
7
+ [k: string]: unknown;
8
+ }
9
+ export interface OutputSchema {
10
+ accessJwt: string;
11
+ refreshJwt: string;
12
+ handle: string;
13
+ did: string;
14
+ [k: string]: unknown;
15
+ }
16
+ export interface CallOptions {
17
+ headers?: Headers;
18
+ qp?: QueryParams;
19
+ encoding: 'application/json';
20
+ }
21
+ export interface Response {
22
+ success: boolean;
23
+ headers: Headers;
24
+ data: OutputSchema;
25
+ }
26
+ export declare class AccountTakedownError extends XRPCError {
27
+ constructor(src: XRPCError);
28
+ }
29
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,13 @@
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
+ qp?: QueryParams;
8
+ }
9
+ export interface Response {
10
+ success: boolean;
11
+ headers: Headers;
12
+ }
13
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,18 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ }
4
+ export declare type InputSchema = undefined;
5
+ export interface OutputSchema {
6
+ handle: string;
7
+ did: string;
8
+ [k: string]: unknown;
9
+ }
10
+ export interface CallOptions {
11
+ headers?: Headers;
12
+ }
13
+ export interface Response {
14
+ success: boolean;
15
+ headers: Headers;
16
+ data: OutputSchema;
17
+ }
18
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,24 @@
1
+ import { Headers, XRPCError } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ }
4
+ export declare type InputSchema = undefined;
5
+ export interface OutputSchema {
6
+ accessJwt: string;
7
+ refreshJwt: string;
8
+ handle: string;
9
+ did: string;
10
+ [k: string]: unknown;
11
+ }
12
+ export interface CallOptions {
13
+ headers?: Headers;
14
+ qp?: QueryParams;
15
+ }
16
+ export interface Response {
17
+ success: boolean;
18
+ headers: Headers;
19
+ data: OutputSchema;
20
+ }
21
+ export declare class AccountTakedownError extends XRPCError {
22
+ constructor(src: XRPCError);
23
+ }
24
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,18 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ did: string;
4
+ }
5
+ export declare type InputSchema = undefined;
6
+ export interface OutputSchema {
7
+ root: string;
8
+ [k: string]: unknown;
9
+ }
10
+ export interface CallOptions {
11
+ headers?: Headers;
12
+ }
13
+ export interface Response {
14
+ success: boolean;
15
+ headers: Headers;
16
+ data: OutputSchema;
17
+ }
18
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,9 @@
1
+ import { ValidationResult } from '@atproto/lexicon';
2
+ export interface RepoOp {
3
+ action: 'create' | 'update' | 'delete' | (string & {});
4
+ path: string;
5
+ cid: string | null;
6
+ [k: string]: unknown;
7
+ }
8
+ export declare function isRepoOp(v: unknown): v is RepoOp;
9
+ export declare function validateRepoOp(v: unknown): ValidationResult;
@@ -1,58 +1,58 @@
1
- import { ValidationResult } from '@atproto/lexicon'
2
- import { CID } from 'multiformats/cid'
1
+ import { ValidationResult } from '@atproto/lexicon';
2
+ import { CID } from 'multiformats/cid';
3
3
  export interface Commit {
4
- seq: number
5
- rebase: boolean
6
- tooBig: boolean
7
- repo: string
8
- commit: CID
9
- prev: CID | null
10
- blocks: Uint8Array
11
- ops: RepoOp[]
12
- blobs: CID[]
13
- time: string
14
- [k: string]: unknown
4
+ seq: number;
5
+ rebase: boolean;
6
+ tooBig: boolean;
7
+ repo: string;
8
+ commit: CID;
9
+ prev: CID | null;
10
+ blocks: Uint8Array;
11
+ ops: RepoOp[];
12
+ blobs: CID[];
13
+ time: string;
14
+ [k: string]: unknown;
15
15
  }
16
- export declare function isCommit(v: unknown): v is Commit
17
- export declare function validateCommit(v: unknown): ValidationResult
16
+ export declare function isCommit(v: unknown): v is Commit;
17
+ export declare function validateCommit(v: unknown): ValidationResult;
18
18
  export interface Handle {
19
- seq: number
20
- did: string
21
- handle: string
22
- time: string
23
- [k: string]: unknown
19
+ seq: number;
20
+ did: string;
21
+ handle: string;
22
+ time: string;
23
+ [k: string]: unknown;
24
24
  }
25
- export declare function isHandle(v: unknown): v is Handle
26
- export declare function validateHandle(v: unknown): ValidationResult
25
+ export declare function isHandle(v: unknown): v is Handle;
26
+ export declare function validateHandle(v: unknown): ValidationResult;
27
27
  export interface Migrate {
28
- seq: number
29
- did: string
30
- migrateTo: string | null
31
- time: string
32
- [k: string]: unknown
28
+ seq: number;
29
+ did: string;
30
+ migrateTo: string | null;
31
+ time: string;
32
+ [k: string]: unknown;
33
33
  }
34
- export declare function isMigrate(v: unknown): v is Migrate
35
- export declare function validateMigrate(v: unknown): ValidationResult
34
+ export declare function isMigrate(v: unknown): v is Migrate;
35
+ export declare function validateMigrate(v: unknown): ValidationResult;
36
36
  export interface Tombstone {
37
- seq: number
38
- did: string
39
- time: string
40
- [k: string]: unknown
37
+ seq: number;
38
+ did: string;
39
+ time: string;
40
+ [k: string]: unknown;
41
41
  }
42
- export declare function isTombstone(v: unknown): v is Tombstone
43
- export declare function validateTombstone(v: unknown): ValidationResult
42
+ export declare function isTombstone(v: unknown): v is Tombstone;
43
+ export declare function validateTombstone(v: unknown): ValidationResult;
44
44
  export interface Info {
45
- name: 'OutdatedCursor' | (string & {})
46
- message?: string
47
- [k: string]: unknown
45
+ name: 'OutdatedCursor' | (string & {});
46
+ message?: string;
47
+ [k: string]: unknown;
48
48
  }
49
- export declare function isInfo(v: unknown): v is Info
50
- export declare function validateInfo(v: unknown): ValidationResult
49
+ export declare function isInfo(v: unknown): v is Info;
50
+ export declare function validateInfo(v: unknown): ValidationResult;
51
51
  export interface RepoOp {
52
- action: 'create' | 'update' | 'delete' | (string & {})
53
- path: string
54
- cid: CID | null
55
- [k: string]: unknown
52
+ action: 'create' | 'update' | 'delete' | (string & {});
53
+ path: string;
54
+ cid: CID | null;
55
+ [k: string]: unknown;
56
56
  }
57
- export declare function isRepoOp(v: unknown): v is RepoOp
58
- export declare function validateRepoOp(v: unknown): ValidationResult
57
+ export declare function isRepoOp(v: unknown): v is RepoOp;
58
+ export declare function validateRepoOp(v: unknown): ValidationResult;
@@ -0,0 +1,15 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ did: string;
4
+ }
5
+ export declare type InputSchema = string | Uint8Array;
6
+ export interface CallOptions {
7
+ headers?: Headers;
8
+ qp?: QueryParams;
9
+ encoding: 'application/cbor';
10
+ }
11
+ export interface Response {
12
+ success: boolean;
13
+ headers: Headers;
14
+ }
15
+ export declare function toKnownErr(e: any): any;
@@ -1,5 +1,2 @@
1
- export declare function isObj(v: unknown): v is Record<string, unknown>
2
- export declare function hasProp<K extends PropertyKey>(
3
- data: object,
4
- prop: K,
5
- ): data is Record<K, unknown>
1
+ export declare function isObj(v: unknown): v is Record<string, unknown>;
2
+ export declare function hasProp<K extends PropertyKey>(data: object, prop: K): data is Record<K, unknown>;
@@ -0,0 +1,20 @@
1
+ import { AtpAgent } from '../agent';
2
+ export declare class Bsky {
3
+ private agent;
4
+ constructor(agent: AtpAgent);
5
+ like(uri: string, cid: string): Promise<{
6
+ uri: string;
7
+ cid: string;
8
+ }>;
9
+ unlike(likeUri: string): Promise<void>;
10
+ repost(uri: string, cid: string): Promise<{
11
+ uri: string;
12
+ cid: string;
13
+ }>;
14
+ unrepost(repostUri: string): Promise<void>;
15
+ follow(subjectDid: string): Promise<{
16
+ uri: string;
17
+ cid: string;
18
+ }>;
19
+ unfollow(followUri: string): Promise<void>;
20
+ }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { AtUri } from '@atproto/uri';
1
+ export { AtUri } from '@atproto/syntax';
2
2
  export { BlobRef, lexToJson, stringifyLex, jsonToLex, jsonStringToLex, } from '@atproto/lexicon';
3
3
  export { parseLanguage } from '@atproto/common-web';
4
4
  export * from './types';