@atproto/api 0.1.2 → 0.2.0
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/README.md +179 -25
- package/build.js +10 -1
- package/dist/agent.d.ts +11 -6
- package/dist/bsky-agent.d.ts +43 -0
- package/dist/client/index.d.ts +127 -215
- package/dist/client/lexicons.d.ts +1496 -1347
- package/dist/client/types/app/bsky/actor/defs.d.ts +47 -0
- package/dist/client/types/app/bsky/actor/getProfile.d.ts +2 -2
- package/dist/client/types/app/bsky/actor/getProfiles.d.ts +2 -2
- package/dist/client/types/app/bsky/actor/getSuggestions.d.ts +2 -2
- package/dist/client/types/app/bsky/actor/profile.d.ts +4 -60
- package/dist/client/types/app/bsky/actor/searchActors.d.ts +22 -0
- package/dist/client/types/app/bsky/actor/searchActorsTypeahead.d.ts +20 -0
- package/dist/client/types/app/bsky/actor/updateProfile.d.ts +4 -11
- package/dist/client/types/app/bsky/embed/external.d.ts +9 -13
- package/dist/client/types/app/bsky/embed/images.d.ts +9 -13
- package/dist/client/types/app/bsky/embed/record.d.ts +41 -0
- package/dist/client/types/app/bsky/embed/recordWithMedia.d.ts +24 -0
- package/dist/client/types/app/bsky/feed/defs.d.ts +77 -0
- package/dist/client/types/app/bsky/feed/getAuthorFeed.d.ts +4 -4
- package/dist/client/types/app/bsky/feed/getLikes.d.ts +34 -0
- package/dist/client/types/app/bsky/feed/getPostThread.d.ts +2 -24
- package/dist/client/types/app/bsky/feed/getRepostedBy.d.ts +3 -3
- package/dist/client/types/app/bsky/feed/getTimeline.d.ts +3 -3
- package/dist/client/types/app/bsky/feed/like.d.ts +9 -0
- package/dist/client/types/app/bsky/feed/post.d.ts +5 -29
- package/dist/client/types/app/bsky/graph/follow.d.ts +1 -2
- package/dist/client/types/app/bsky/graph/getFollowers.d.ts +5 -5
- package/dist/client/types/app/bsky/graph/getFollows.d.ts +5 -5
- package/dist/client/types/app/bsky/graph/getMutes.d.ts +3 -3
- package/dist/client/types/app/bsky/graph/muteActor.d.ts +17 -0
- package/dist/client/types/app/bsky/graph/unmuteActor.d.ts +17 -0
- package/dist/client/types/app/bsky/notification/getUnreadCount.d.ts +17 -0
- package/dist/client/types/app/bsky/notification/listNotifications.d.ts +35 -0
- package/dist/client/types/app/bsky/richtext/facet.d.ts +30 -0
- package/dist/client/types/app/bsky/unspecced/getPopular.d.ts +21 -0
- package/dist/client/types/com/atproto/admin/defs.d.ts +181 -0
- package/dist/client/types/com/atproto/admin/getModerationAction.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/getModerationActions.d.ts +3 -3
- package/dist/client/types/com/atproto/admin/getModerationReport.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/getModerationReports.d.ts +3 -3
- package/dist/client/types/com/atproto/admin/getRecord.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/getRepo.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/resolveModerationReports.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/reverseModerationAction.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/searchRepos.d.ts +3 -3
- package/dist/client/types/com/atproto/admin/takeModerationAction.d.ts +5 -6
- package/dist/client/types/com/atproto/identity/resolveHandle.d.ts +18 -0
- package/dist/client/types/com/atproto/identity/updateHandle.d.ts +17 -0
- package/dist/client/types/com/atproto/moderation/createReport.d.ts +38 -0
- package/dist/client/types/com/atproto/moderation/defs.d.ts +3 -0
- package/dist/client/types/com/atproto/repo/applyWrites.d.ts +47 -0
- package/dist/client/types/com/atproto/repo/createRecord.d.ts +7 -2
- package/dist/client/types/com/atproto/repo/deleteRecord.d.ts +7 -2
- package/dist/client/types/com/atproto/repo/describeRepo.d.ts +22 -0
- package/dist/client/types/com/atproto/repo/getRecord.d.ts +1 -1
- package/dist/client/types/com/atproto/repo/listRecords.d.ts +3 -3
- package/dist/client/types/com/atproto/repo/putRecord.d.ts +7 -2
- package/dist/client/types/com/atproto/repo/uploadBlob.d.ts +20 -0
- package/dist/client/types/com/atproto/server/createAccount.d.ts +44 -0
- package/dist/client/types/com/atproto/server/createInviteCode.d.ts +22 -0
- package/dist/client/types/com/atproto/server/createSession.d.ts +29 -0
- package/dist/client/types/com/atproto/server/deleteAccount.d.ts +25 -0
- package/dist/client/types/com/atproto/server/deleteSession.d.ts +13 -0
- package/dist/client/types/com/atproto/server/describeServer.d.ts +27 -0
- package/dist/client/types/com/atproto/server/getSession.d.ts +18 -0
- package/dist/client/types/com/atproto/server/refreshSession.d.ts +24 -0
- package/dist/client/types/com/atproto/server/requestAccountDelete.d.ts +13 -0
- package/dist/client/types/com/atproto/server/requestPasswordReset.d.ts +17 -0
- package/dist/client/types/com/atproto/server/resetPassword.d.ts +24 -0
- package/dist/client/types/com/atproto/sync/getBlob.d.ts +15 -0
- package/dist/client/types/com/atproto/sync/getBlocks.d.ts +15 -0
- package/dist/client/types/com/atproto/sync/listBlobs.d.ts +20 -0
- package/dist/client/types/com/atproto/sync/notifyOfUpdate.d.ts +13 -0
- package/dist/client/types/com/atproto/sync/requestCrawl.d.ts +13 -0
- package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +6 -17
- package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +58 -0
- package/dist/helpers/bsky.d.ts +20 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +8222 -3608
- package/dist/index.js.map +4 -4
- package/dist/mixins/bsky.d.ts +23 -0
- package/dist/rich-text/detection.d.ts +4 -0
- package/dist/rich-text/rich-text.d.ts +39 -0
- package/dist/rich-text/sanitization.d.ts +4 -0
- package/dist/rich-text/sanitize.d.ts +4 -0
- package/dist/rich-text/unicode.d.ts +11 -0
- package/dist/types.d.ts +2 -2
- package/docs/rn-fetch-handler.ts +88 -0
- package/package.json +4 -1
- package/src/agent.ts +51 -15
- package/src/bsky-agent.ts +228 -0
- package/src/client/index.ts +371 -581
- package/src/client/lexicons.ts +1920 -1746
- package/src/client/types/app/bsky/actor/defs.ts +97 -0
- package/src/client/types/app/bsky/actor/getProfile.ts +4 -3
- package/src/client/types/app/bsky/actor/getProfiles.ts +4 -3
- package/src/client/types/app/bsky/actor/getSuggestions.ts +4 -3
- package/src/client/types/app/bsky/actor/profile.ts +5 -95
- package/src/client/types/app/bsky/actor/{searchTypeahead.ts → searchActors.ts} +6 -3
- package/src/client/types/app/bsky/actor/{search.ts → searchActorsTypeahead.ts} +4 -5
- package/src/client/types/app/bsky/embed/external.ts +14 -13
- package/src/client/types/app/bsky/embed/images.ts +14 -15
- package/src/client/types/app/bsky/embed/record.ts +90 -0
- package/src/client/types/app/bsky/embed/recordWithMedia.ts +53 -0
- package/src/client/types/app/bsky/feed/defs.ts +156 -0
- package/src/client/types/app/bsky/feed/getAuthorFeed.ts +6 -5
- package/src/client/types/app/bsky/feed/{getVotes.ts → getLikes.ts} +11 -12
- package/src/client/types/app/bsky/feed/getPostThread.ts +5 -48
- package/src/client/types/app/bsky/feed/getRepostedBy.ts +5 -4
- package/src/client/types/app/bsky/feed/getTimeline.ts +5 -4
- package/src/client/types/app/bsky/feed/{vote.ts → like.ts} +4 -4
- package/src/client/types/app/bsky/feed/post.ts +12 -51
- package/src/client/types/app/bsky/feed/repost.ts +2 -1
- package/src/client/types/app/bsky/graph/follow.ts +3 -3
- package/src/client/types/app/bsky/graph/getFollowers.ts +7 -6
- package/src/client/types/app/bsky/graph/getFollows.ts +7 -6
- package/src/client/types/app/bsky/graph/getMutes.ts +5 -4
- package/src/client/types/app/bsky/graph/{mute.ts → muteActor.ts} +3 -2
- package/src/client/types/app/bsky/graph/{unmute.ts → unmuteActor.ts} +3 -2
- package/src/client/types/app/bsky/notification/{getCount.ts → getUnreadCount.ts} +2 -1
- package/src/client/types/app/bsky/notification/{list.ts → listNotifications.ts} +13 -9
- package/src/client/types/app/bsky/notification/updateSeen.ts +2 -1
- package/src/client/types/app/bsky/richtext/facet.ts +81 -0
- package/src/client/types/app/bsky/unspecced/getPopular.ts +38 -0
- package/src/client/types/com/atproto/admin/defs.ts +366 -0
- package/src/client/types/com/atproto/admin/getModerationAction.ts +4 -3
- package/src/client/types/com/atproto/admin/getModerationActions.ts +5 -4
- package/src/client/types/com/atproto/admin/getModerationReport.ts +4 -3
- package/src/client/types/com/atproto/admin/getModerationReports.ts +5 -4
- package/src/client/types/com/atproto/admin/getRecord.ts +4 -3
- package/src/client/types/com/atproto/admin/getRepo.ts +4 -3
- package/src/client/types/com/atproto/admin/resolveModerationReports.ts +4 -3
- package/src/client/types/com/atproto/admin/reverseModerationAction.ts +4 -3
- package/src/client/types/com/atproto/admin/searchRepos.ts +5 -4
- package/src/client/types/com/atproto/admin/takeModerationAction.ts +10 -10
- package/src/client/types/com/atproto/{handle/resolve.ts → identity/resolveHandle.ts} +2 -1
- package/src/client/types/com/atproto/{handle/update.ts → identity/updateHandle.ts} +2 -1
- package/src/client/types/com/atproto/{report/create.ts → moderation/createReport.ts} +10 -10
- package/src/client/types/com/atproto/moderation/defs.ts +17 -0
- package/src/client/types/com/atproto/repo/{batchWrite.ts → applyWrites.ts} +21 -12
- package/src/client/types/com/atproto/repo/createRecord.ts +15 -3
- package/src/client/types/com/atproto/repo/deleteRecord.ts +15 -3
- package/src/client/types/com/atproto/repo/{describe.ts → describeRepo.ts} +3 -2
- package/src/client/types/com/atproto/repo/getRecord.ts +4 -3
- package/src/client/types/com/atproto/repo/listRecords.ts +7 -6
- package/src/client/types/com/atproto/repo/putRecord.ts +18 -6
- package/src/client/types/com/atproto/repo/strongRef.ts +2 -1
- package/src/client/types/com/atproto/{blob/upload.ts → repo/uploadBlob.ts} +3 -2
- package/src/client/types/com/atproto/{account/create.ts → server/createAccount.ts} +9 -1
- package/src/client/types/com/atproto/{account → server}/createInviteCode.ts +2 -1
- package/src/client/types/com/atproto/{session/create.ts → server/createSession.ts} +2 -1
- package/src/client/types/com/atproto/{account/delete.ts → server/deleteAccount.ts} +2 -1
- package/src/client/types/com/atproto/{account/requestDelete.ts → server/deleteSession.ts} +2 -1
- package/src/client/types/com/atproto/server/{getAccountsConfig.ts → describeServer.ts} +4 -3
- package/src/client/types/com/atproto/{session/get.ts → server/getSession.ts} +2 -1
- package/src/client/types/com/atproto/{session/refresh.ts → server/refreshSession.ts} +2 -1
- package/src/client/types/com/atproto/{session/delete.ts → server/requestAccountDelete.ts} +2 -1
- package/src/client/types/com/atproto/{account → server}/requestPasswordReset.ts +2 -1
- package/src/client/types/com/atproto/{account → server}/resetPassword.ts +2 -1
- package/src/client/types/com/atproto/sync/getBlob.ts +33 -0
- package/src/client/types/com/atproto/sync/getBlocks.ts +32 -0
- package/src/client/types/com/atproto/sync/getCheckout.ts +2 -1
- package/src/client/types/com/atproto/sync/getCommitPath.ts +2 -1
- package/src/client/types/com/atproto/sync/getHead.ts +2 -1
- package/src/client/types/com/atproto/sync/getRecord.ts +2 -1
- package/src/client/types/com/atproto/sync/getRepo.ts +2 -1
- package/src/client/types/com/atproto/sync/listBlobs.ts +40 -0
- package/src/client/types/com/atproto/sync/notifyOfUpdate.ts +30 -0
- package/src/client/types/com/atproto/{account/get.ts → sync/requestCrawl.ts} +6 -2
- package/src/client/types/com/atproto/sync/subscribeRepos.ts +131 -0
- package/src/index.ts +12 -0
- package/src/rich-text/detection.ts +83 -0
- package/src/rich-text/rich-text.ts +401 -0
- package/src/rich-text/sanitization.ts +40 -0
- package/src/rich-text/unicode.ts +47 -0
- package/src/types.ts +2 -2
- package/tests/agent.test.ts +10 -6
- package/tests/bsky-agent.test.ts +140 -0
- package/tests/errors.test.ts +4 -4
- package/tests/rich-text-detection.test.ts +229 -0
- package/tests/rich-text-sanitization.test.ts +211 -0
- package/tests/rich-text.test.ts +661 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/src/client/types/app/bsky/actor/ref.ts +0 -64
- package/src/client/types/app/bsky/actor/updateProfile.ts +0 -71
- package/src/client/types/app/bsky/feed/feedViewPost.ts +0 -64
- package/src/client/types/app/bsky/feed/setVote.ts +0 -40
- package/src/client/types/app/bsky/graph/assertCreator.ts +0 -9
- package/src/client/types/app/bsky/graph/assertMember.ts +0 -9
- package/src/client/types/app/bsky/graph/assertion.ts +0 -27
- package/src/client/types/app/bsky/graph/confirmation.ts +0 -28
- package/src/client/types/app/bsky/system/actorUser.ts +0 -9
- package/src/client/types/app/bsky/system/declRef.ts +0 -26
- package/src/client/types/app/bsky/system/declaration.ts +0 -24
- package/src/client/types/com/atproto/admin/blob.ts +0 -84
- package/src/client/types/com/atproto/admin/moderationAction.ts +0 -118
- package/src/client/types/com/atproto/admin/moderationReport.ts +0 -64
- package/src/client/types/com/atproto/admin/record.ts +0 -92
- package/src/client/types/com/atproto/admin/repo.ts +0 -103
- package/src/client/types/com/atproto/repo/recordRef.ts +0 -25
- package/src/client/types/com/atproto/repo/repoRef.ts +0 -24
- package/src/client/types/com/atproto/report/reasonType.ts +0 -16
- package/src/client/types/com/atproto/report/subject.ts +0 -66
- package/src/client/types/com/atproto/sync/subscribeAllRepos.ts +0 -48
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Headers, XRPCError } from '@atproto/xrpc';
|
|
2
|
+
import { ValidationResult } from '@atproto/lexicon';
|
|
3
|
+
export interface QueryParams {
|
|
4
|
+
}
|
|
5
|
+
export interface InputSchema {
|
|
6
|
+
repo: string;
|
|
7
|
+
validate?: boolean;
|
|
8
|
+
writes: (Create | Update | Delete)[];
|
|
9
|
+
swapCommit?: string;
|
|
10
|
+
[k: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface CallOptions {
|
|
13
|
+
headers?: Headers;
|
|
14
|
+
qp?: QueryParams;
|
|
15
|
+
encoding: 'application/json';
|
|
16
|
+
}
|
|
17
|
+
export interface Response {
|
|
18
|
+
success: boolean;
|
|
19
|
+
headers: Headers;
|
|
20
|
+
}
|
|
21
|
+
export declare class InvalidSwapError extends XRPCError {
|
|
22
|
+
constructor(src: XRPCError);
|
|
23
|
+
}
|
|
24
|
+
export declare function toKnownErr(e: any): any;
|
|
25
|
+
export interface Create {
|
|
26
|
+
collection: string;
|
|
27
|
+
rkey?: string;
|
|
28
|
+
value: {};
|
|
29
|
+
[k: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
export declare function isCreate(v: unknown): v is Create;
|
|
32
|
+
export declare function validateCreate(v: unknown): ValidationResult;
|
|
33
|
+
export interface Update {
|
|
34
|
+
collection: string;
|
|
35
|
+
rkey: string;
|
|
36
|
+
value: {};
|
|
37
|
+
[k: string]: unknown;
|
|
38
|
+
}
|
|
39
|
+
export declare function isUpdate(v: unknown): v is Update;
|
|
40
|
+
export declare function validateUpdate(v: unknown): ValidationResult;
|
|
41
|
+
export interface Delete {
|
|
42
|
+
collection: string;
|
|
43
|
+
rkey: string;
|
|
44
|
+
[k: string]: unknown;
|
|
45
|
+
}
|
|
46
|
+
export declare function isDelete(v: unknown): v is Delete;
|
|
47
|
+
export declare function validateDelete(v: unknown): ValidationResult;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Headers } from '@atproto/xrpc';
|
|
1
|
+
import { Headers, XRPCError } from '@atproto/xrpc';
|
|
2
2
|
export interface QueryParams {
|
|
3
3
|
}
|
|
4
4
|
export interface InputSchema {
|
|
5
|
-
|
|
5
|
+
repo: string;
|
|
6
6
|
collection: string;
|
|
7
|
+
rkey?: string;
|
|
7
8
|
validate?: boolean;
|
|
8
9
|
record: {};
|
|
10
|
+
swapCommit?: string;
|
|
9
11
|
[k: string]: unknown;
|
|
10
12
|
}
|
|
11
13
|
export interface OutputSchema {
|
|
@@ -23,4 +25,7 @@ export interface Response {
|
|
|
23
25
|
headers: Headers;
|
|
24
26
|
data: OutputSchema;
|
|
25
27
|
}
|
|
28
|
+
export declare class InvalidSwapError extends XRPCError {
|
|
29
|
+
constructor(src: XRPCError);
|
|
30
|
+
}
|
|
26
31
|
export declare function toKnownErr(e: any): any;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { Headers } from '@atproto/xrpc';
|
|
1
|
+
import { Headers, XRPCError } from '@atproto/xrpc';
|
|
2
2
|
export interface QueryParams {
|
|
3
3
|
}
|
|
4
4
|
export interface InputSchema {
|
|
5
|
-
|
|
5
|
+
repo: string;
|
|
6
6
|
collection: string;
|
|
7
7
|
rkey: string;
|
|
8
|
+
swapRecord?: string;
|
|
9
|
+
swapCommit?: string;
|
|
8
10
|
[k: string]: unknown;
|
|
9
11
|
}
|
|
10
12
|
export interface CallOptions {
|
|
@@ -16,4 +18,7 @@ export interface Response {
|
|
|
16
18
|
success: boolean;
|
|
17
19
|
headers: Headers;
|
|
18
20
|
}
|
|
21
|
+
export declare class InvalidSwapError extends XRPCError {
|
|
22
|
+
constructor(src: XRPCError);
|
|
23
|
+
}
|
|
19
24
|
export declare function toKnownErr(e: any): any;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Headers } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
repo: string;
|
|
4
|
+
}
|
|
5
|
+
export declare type InputSchema = undefined;
|
|
6
|
+
export interface OutputSchema {
|
|
7
|
+
handle: string;
|
|
8
|
+
did: string;
|
|
9
|
+
didDoc: {};
|
|
10
|
+
collections: string[];
|
|
11
|
+
handleIsCorrect: boolean;
|
|
12
|
+
[k: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
export interface CallOptions {
|
|
15
|
+
headers?: Headers;
|
|
16
|
+
}
|
|
17
|
+
export interface Response {
|
|
18
|
+
success: boolean;
|
|
19
|
+
headers: Headers;
|
|
20
|
+
data: OutputSchema;
|
|
21
|
+
}
|
|
22
|
+
export declare function toKnownErr(e: any): any;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Headers } from '@atproto/xrpc';
|
|
2
2
|
import { ValidationResult } from '@atproto/lexicon';
|
|
3
3
|
export interface QueryParams {
|
|
4
|
-
|
|
4
|
+
repo: string;
|
|
5
5
|
collection: string;
|
|
6
6
|
limit?: number;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
rkeyStart?: string;
|
|
8
|
+
rkeyEnd?: string;
|
|
9
9
|
reverse?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare type InputSchema = undefined;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { Headers } from '@atproto/xrpc';
|
|
1
|
+
import { Headers, XRPCError } from '@atproto/xrpc';
|
|
2
2
|
export interface QueryParams {
|
|
3
3
|
}
|
|
4
4
|
export interface InputSchema {
|
|
5
|
-
|
|
5
|
+
repo: string;
|
|
6
6
|
collection: string;
|
|
7
7
|
rkey: string;
|
|
8
8
|
validate?: boolean;
|
|
9
9
|
record: {};
|
|
10
|
+
swapRecord?: string | null;
|
|
11
|
+
swapCommit?: string;
|
|
10
12
|
[k: string]: unknown;
|
|
11
13
|
}
|
|
12
14
|
export interface OutputSchema {
|
|
@@ -24,4 +26,7 @@ export interface Response {
|
|
|
24
26
|
headers: Headers;
|
|
25
27
|
data: OutputSchema;
|
|
26
28
|
}
|
|
29
|
+
export declare class InvalidSwapError extends XRPCError {
|
|
30
|
+
constructor(src: XRPCError);
|
|
31
|
+
}
|
|
27
32
|
export declare function toKnownErr(e: any): any;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Headers } from '@atproto/xrpc';
|
|
2
|
+
import { BlobRef } from '@atproto/lexicon';
|
|
3
|
+
export interface QueryParams {
|
|
4
|
+
}
|
|
5
|
+
export declare type InputSchema = string | Uint8Array;
|
|
6
|
+
export interface OutputSchema {
|
|
7
|
+
blob: BlobRef;
|
|
8
|
+
[k: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface CallOptions {
|
|
11
|
+
headers?: Headers;
|
|
12
|
+
qp?: QueryParams;
|
|
13
|
+
encoding: string;
|
|
14
|
+
}
|
|
15
|
+
export interface Response {
|
|
16
|
+
success: boolean;
|
|
17
|
+
headers: Headers;
|
|
18
|
+
data: OutputSchema;
|
|
19
|
+
}
|
|
20
|
+
export declare function toKnownErr(e: any): any;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Headers, XRPCError } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
}
|
|
4
|
+
export interface InputSchema {
|
|
5
|
+
email: string;
|
|
6
|
+
handle: string;
|
|
7
|
+
inviteCode?: string;
|
|
8
|
+
password: string;
|
|
9
|
+
recoveryKey?: string;
|
|
10
|
+
[k: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface OutputSchema {
|
|
13
|
+
accessJwt: string;
|
|
14
|
+
refreshJwt: string;
|
|
15
|
+
handle: string;
|
|
16
|
+
did: string;
|
|
17
|
+
[k: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface CallOptions {
|
|
20
|
+
headers?: Headers;
|
|
21
|
+
qp?: QueryParams;
|
|
22
|
+
encoding: 'application/json';
|
|
23
|
+
}
|
|
24
|
+
export interface Response {
|
|
25
|
+
success: boolean;
|
|
26
|
+
headers: Headers;
|
|
27
|
+
data: OutputSchema;
|
|
28
|
+
}
|
|
29
|
+
export declare class InvalidHandleError extends XRPCError {
|
|
30
|
+
constructor(src: XRPCError);
|
|
31
|
+
}
|
|
32
|
+
export declare class InvalidPasswordError extends XRPCError {
|
|
33
|
+
constructor(src: XRPCError);
|
|
34
|
+
}
|
|
35
|
+
export declare class InvalidInviteCodeError extends XRPCError {
|
|
36
|
+
constructor(src: XRPCError);
|
|
37
|
+
}
|
|
38
|
+
export declare class HandleNotAvailableError extends XRPCError {
|
|
39
|
+
constructor(src: XRPCError);
|
|
40
|
+
}
|
|
41
|
+
export declare class UnsupportedDomainError extends XRPCError {
|
|
42
|
+
constructor(src: XRPCError);
|
|
43
|
+
}
|
|
44
|
+
export declare function toKnownErr(e: any): any;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Headers } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
}
|
|
4
|
+
export interface InputSchema {
|
|
5
|
+
useCount: number;
|
|
6
|
+
[k: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface OutputSchema {
|
|
9
|
+
code: string;
|
|
10
|
+
[k: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface CallOptions {
|
|
13
|
+
headers?: Headers;
|
|
14
|
+
qp?: QueryParams;
|
|
15
|
+
encoding: 'application/json';
|
|
16
|
+
}
|
|
17
|
+
export interface Response {
|
|
18
|
+
success: boolean;
|
|
19
|
+
headers: Headers;
|
|
20
|
+
data: OutputSchema;
|
|
21
|
+
}
|
|
22
|
+
export declare function toKnownErr(e: any): any;
|
|
@@ -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,25 @@
|
|
|
1
|
+
import { Headers, XRPCError } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
}
|
|
4
|
+
export interface InputSchema {
|
|
5
|
+
did: string;
|
|
6
|
+
password: string;
|
|
7
|
+
token: string;
|
|
8
|
+
[k: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface CallOptions {
|
|
11
|
+
headers?: Headers;
|
|
12
|
+
qp?: QueryParams;
|
|
13
|
+
encoding: 'application/json';
|
|
14
|
+
}
|
|
15
|
+
export interface Response {
|
|
16
|
+
success: boolean;
|
|
17
|
+
headers: Headers;
|
|
18
|
+
}
|
|
19
|
+
export declare class ExpiredTokenError extends XRPCError {
|
|
20
|
+
constructor(src: XRPCError);
|
|
21
|
+
}
|
|
22
|
+
export declare class InvalidTokenError extends XRPCError {
|
|
23
|
+
constructor(src: XRPCError);
|
|
24
|
+
}
|
|
25
|
+
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,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,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,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,17 @@
|
|
|
1
|
+
import { Headers } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
}
|
|
4
|
+
export interface InputSchema {
|
|
5
|
+
email: 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;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Headers, XRPCError } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
}
|
|
4
|
+
export interface InputSchema {
|
|
5
|
+
token: string;
|
|
6
|
+
password: string;
|
|
7
|
+
[k: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface CallOptions {
|
|
10
|
+
headers?: Headers;
|
|
11
|
+
qp?: QueryParams;
|
|
12
|
+
encoding: 'application/json';
|
|
13
|
+
}
|
|
14
|
+
export interface Response {
|
|
15
|
+
success: boolean;
|
|
16
|
+
headers: Headers;
|
|
17
|
+
}
|
|
18
|
+
export declare class ExpiredTokenError extends XRPCError {
|
|
19
|
+
constructor(src: XRPCError);
|
|
20
|
+
}
|
|
21
|
+
export declare class InvalidTokenError extends XRPCError {
|
|
22
|
+
constructor(src: XRPCError);
|
|
23
|
+
}
|
|
24
|
+
export declare function toKnownErr(e: any): any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Headers } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
did: string;
|
|
4
|
+
cid: 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,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,20 @@
|
|
|
1
|
+
import { Headers } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
did: string;
|
|
4
|
+
latest?: string;
|
|
5
|
+
earliest?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare type InputSchema = undefined;
|
|
8
|
+
export interface OutputSchema {
|
|
9
|
+
cids: string[];
|
|
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;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Headers } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
hostname: 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;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Headers } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
hostname: 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;
|
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
import { ValidationResult } from '@atproto/lexicon';
|
|
2
|
-
export interface
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
prev?: string;
|
|
7
|
-
blocks: {};
|
|
8
|
-
blobs: string[];
|
|
2
|
+
export interface RepoOp {
|
|
3
|
+
action: 'create' | 'update' | 'delete' | (string & {});
|
|
4
|
+
path: string;
|
|
5
|
+
cid: string | null;
|
|
9
6
|
[k: string]: unknown;
|
|
10
7
|
}
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function
|
|
13
|
-
export interface RepoRebase {
|
|
14
|
-
time: string;
|
|
15
|
-
repo: string;
|
|
16
|
-
commit: string;
|
|
17
|
-
[k: string]: unknown;
|
|
18
|
-
}
|
|
19
|
-
export declare function isRepoRebase(v: unknown): v is RepoRebase;
|
|
20
|
-
export declare function validateRepoRebase(v: unknown): ValidationResult;
|
|
8
|
+
export declare function isRepoOp(v: unknown): v is RepoOp;
|
|
9
|
+
export declare function validateRepoOp(v: unknown): ValidationResult;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ValidationResult } from '@atproto/lexicon';
|
|
2
|
+
import { CID } from 'multiformats/cid';
|
|
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;
|
|
15
|
+
}
|
|
16
|
+
export declare function isCommit(v: unknown): v is Commit;
|
|
17
|
+
export declare function validateCommit(v: unknown): ValidationResult;
|
|
18
|
+
export interface Handle {
|
|
19
|
+
seq: number;
|
|
20
|
+
did: string;
|
|
21
|
+
handle: string;
|
|
22
|
+
time: string;
|
|
23
|
+
[k: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
export declare function isHandle(v: unknown): v is Handle;
|
|
26
|
+
export declare function validateHandle(v: unknown): ValidationResult;
|
|
27
|
+
export interface Migrate {
|
|
28
|
+
seq: number;
|
|
29
|
+
did: string;
|
|
30
|
+
migrateTo: string | null;
|
|
31
|
+
time: string;
|
|
32
|
+
[k: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
export declare function isMigrate(v: unknown): v is Migrate;
|
|
35
|
+
export declare function validateMigrate(v: unknown): ValidationResult;
|
|
36
|
+
export interface Tombstone {
|
|
37
|
+
seq: number;
|
|
38
|
+
did: string;
|
|
39
|
+
time: string;
|
|
40
|
+
[k: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
export declare function isTombstone(v: unknown): v is Tombstone;
|
|
43
|
+
export declare function validateTombstone(v: unknown): ValidationResult;
|
|
44
|
+
export interface Info {
|
|
45
|
+
name: 'OutdatedCursor' | (string & {});
|
|
46
|
+
message?: string;
|
|
47
|
+
[k: string]: unknown;
|
|
48
|
+
}
|
|
49
|
+
export declare function isInfo(v: unknown): v is Info;
|
|
50
|
+
export declare function validateInfo(v: unknown): ValidationResult;
|
|
51
|
+
export interface RepoOp {
|
|
52
|
+
action: 'create' | 'update' | 'delete' | (string & {});
|
|
53
|
+
path: string;
|
|
54
|
+
cid: CID | null;
|
|
55
|
+
[k: string]: unknown;
|
|
56
|
+
}
|
|
57
|
+
export declare function isRepoOp(v: unknown): v is RepoOp;
|
|
58
|
+
export declare function validateRepoOp(v: unknown): ValidationResult;
|
|
@@ -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,10 @@
|
|
|
1
|
+
export { AtUri } from '@atproto/uri';
|
|
2
|
+
export { BlobRef, lexToJson, stringifyLex, jsonToLex, jsonStringToLex, } from '@atproto/lexicon';
|
|
1
3
|
export * from './types';
|
|
2
4
|
export * from './client';
|
|
3
5
|
export * from './agent';
|
|
6
|
+
export * from './rich-text/rich-text';
|
|
7
|
+
export * from './rich-text/sanitization';
|
|
8
|
+
export * from './rich-text/unicode';
|
|
9
|
+
export { BskyAgent } from './bsky-agent';
|
|
4
10
|
export { AtpAgent as default } from './agent';
|