@atproto/api 0.0.7 → 0.1.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 +44 -6
- package/dist/agent.d.ts +22 -0
- package/dist/client/index.d.ts +63 -61
- package/dist/client/lexicons.d.ts +168 -22
- package/dist/client/types/app/bsky/actor/getSuggestions.d.ts +0 -7
- package/dist/client/types/com/atproto/account/delete.d.ts +14 -2
- package/dist/{src/client/types/com/atproto/account/delete.d.ts → client/types/com/atproto/account/requestDelete.d.ts} +0 -0
- package/dist/client/types/com/atproto/admin/blob.d.ts +37 -0
- package/dist/client/types/com/atproto/admin/moderationAction.d.ts +13 -2
- package/dist/client/types/com/atproto/admin/record.d.ts +5 -2
- package/dist/client/types/com/atproto/admin/repo.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/takeModerationAction.d.ts +5 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +667 -368
- package/dist/index.js.map +4 -4
- package/dist/types.d.ts +33 -0
- package/package.json +1 -1
- package/src/agent.ts +305 -0
- package/src/client/index.ts +75 -63
- package/src/client/lexicons.ts +219 -49
- package/src/client/types/app/bsky/actor/getSuggestions.ts +0 -18
- package/src/client/types/com/atproto/account/delete.ts +21 -1
- package/src/client/types/com/atproto/account/requestDelete.ts +27 -0
- package/src/client/types/com/atproto/admin/blob.ts +84 -0
- package/src/client/types/com/atproto/admin/moderationAction.ts +29 -10
- package/src/client/types/com/atproto/admin/record.ts +5 -2
- package/src/client/types/com/atproto/admin/repo.ts +2 -2
- package/src/client/types/com/atproto/admin/takeModerationAction.ts +8 -0
- package/src/index.ts +3 -3
- package/src/types.ts +71 -0
- package/tests/_util.ts +26 -0
- package/tests/agent.test.ts +391 -0
- package/tests/errors.test.ts +4 -8
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/src/client/index.d.ts +0 -474
- package/dist/src/client/lexicons.d.ts +0 -3036
- package/dist/src/client/schemas.d.ts +0 -17
- package/dist/src/client/types/app/bsky/actor/createScene.d.ts +0 -32
- package/dist/src/client/types/app/bsky/actor/getProfile.d.ts +0 -36
- package/dist/src/client/types/app/bsky/actor/getSuggestions.d.ts +0 -36
- package/dist/src/client/types/app/bsky/actor/profile.d.ts +0 -15
- package/dist/src/client/types/app/bsky/actor/ref.d.ts +0 -14
- package/dist/src/client/types/app/bsky/actor/search.d.ts +0 -32
- package/dist/src/client/types/app/bsky/actor/searchTypeahead.d.ts +0 -28
- package/dist/src/client/types/app/bsky/actor/updateProfile.d.ts +0 -48
- package/dist/src/client/types/app/bsky/administration/moderationAction.d.ts +0 -16
- package/dist/src/client/types/app/bsky/administration/reverseModerationAction.d.ts +0 -22
- package/dist/src/client/types/app/bsky/administration/takeModerationAction.d.ts +0 -27
- package/dist/src/client/types/app/bsky/badge.d.ts +0 -22
- package/dist/src/client/types/app/bsky/badgeAccept.d.ts +0 -11
- package/dist/src/client/types/app/bsky/badgeOffer.d.ts +0 -11
- package/dist/src/client/types/app/bsky/declaration.d.ts +0 -6
- package/dist/src/client/types/app/bsky/embed/external.d.ts +0 -26
- package/dist/src/client/types/app/bsky/embed/images.d.ts +0 -23
- package/dist/src/client/types/app/bsky/feed/embed.d.ts +0 -36
- package/dist/src/client/types/app/bsky/feed/feedViewPost.d.ts +0 -26
- package/dist/src/client/types/app/bsky/feed/getAuthorFeed.d.ts +0 -22
- package/dist/src/client/types/app/bsky/feed/getPostThread.d.ts +0 -43
- package/dist/src/client/types/app/bsky/feed/getRepostedBy.d.ts +0 -35
- package/dist/src/client/types/app/bsky/feed/getTimeline.d.ts +0 -22
- package/dist/src/client/types/app/bsky/feed/getVotes.d.ts +0 -33
- package/dist/src/client/types/app/bsky/feed/mediaEmbed.d.ts +0 -15
- package/dist/src/client/types/app/bsky/feed/post.d.ts +0 -54
- package/dist/src/client/types/app/bsky/feed/repost.d.ts +0 -6
- package/dist/src/client/types/app/bsky/feed/setVote.d.ts +0 -25
- package/dist/src/client/types/app/bsky/feed/trend.d.ts +0 -6
- package/dist/src/client/types/app/bsky/feed/vote.d.ts +0 -7
- package/dist/src/client/types/app/bsky/follow.d.ts +0 -9
- package/dist/src/client/types/app/bsky/getAuthorFeed.d.ts +0 -56
- package/dist/src/client/types/app/bsky/getBadgeMembers.d.ts +0 -29
- package/dist/src/client/types/app/bsky/getHomeFeed.d.ts +0 -56
- package/dist/src/client/types/app/bsky/getLikedBy.d.ts +0 -29
- package/dist/src/client/types/app/bsky/getNotificationCount.d.ts +0 -16
- package/dist/src/client/types/app/bsky/getNotifications.d.ts +0 -33
- package/dist/src/client/types/app/bsky/getPostThread.d.ts +0 -55
- package/dist/src/client/types/app/bsky/getProfile.d.ts +0 -26
- package/dist/src/client/types/app/bsky/getRepostedBy.d.ts +0 -29
- package/dist/src/client/types/app/bsky/getTimeline.d.ts +0 -56
- package/dist/src/client/types/app/bsky/getUserFollowers.d.ts +0 -31
- package/dist/src/client/types/app/bsky/getUserFollows.d.ts +0 -31
- package/dist/src/client/types/app/bsky/getUsersSearch.d.ts +0 -26
- package/dist/src/client/types/app/bsky/getUsersTypeahead.d.ts +0 -22
- package/dist/src/client/types/app/bsky/graph/assertCreator.d.ts +0 -1
- package/dist/src/client/types/app/bsky/graph/assertMember.d.ts +0 -1
- package/dist/src/client/types/app/bsky/graph/assertion.d.ts +0 -7
- package/dist/src/client/types/app/bsky/graph/confirmation.d.ts +0 -8
- package/dist/src/client/types/app/bsky/graph/follow.d.ts +0 -6
- package/dist/src/client/types/app/bsky/graph/getAssertions.d.ts +0 -43
- package/dist/src/client/types/app/bsky/graph/getFollowers.d.ts +0 -34
- package/dist/src/client/types/app/bsky/graph/getFollows.d.ts +0 -33
- package/dist/src/client/types/app/bsky/graph/getMembers.d.ts +0 -33
- package/dist/src/client/types/app/bsky/graph/getMemberships.d.ts +0 -33
- package/dist/src/client/types/app/bsky/invite.d.ts +0 -10
- package/dist/src/client/types/app/bsky/inviteAccept.d.ts +0 -14
- package/dist/src/client/types/app/bsky/like.d.ts +0 -10
- package/dist/src/client/types/app/bsky/mediaEmbed.d.ts +0 -15
- package/dist/src/client/types/app/bsky/notification/getCount.d.ts +0 -17
- package/dist/src/client/types/app/bsky/notification/list.d.ts +0 -32
- package/dist/src/client/types/app/bsky/notification/updateSeen.d.ts +0 -17
- package/dist/src/client/types/app/bsky/post.d.ts +0 -23
- package/dist/src/client/types/app/bsky/postNotificationsSeen.d.ts +0 -20
- package/dist/src/client/types/app/bsky/profile.d.ts +0 -5
- package/dist/src/client/types/app/bsky/repost.d.ts +0 -10
- package/dist/src/client/types/app/bsky/system/actorScene.d.ts +0 -1
- package/dist/src/client/types/app/bsky/system/actorUser.d.ts +0 -1
- package/dist/src/client/types/app/bsky/system/declRef.d.ts +0 -5
- package/dist/src/client/types/app/bsky/system/declaration.d.ts +0 -4
- package/dist/src/client/types/app/bsky/updateProfile.d.ts +0 -23
- package/dist/src/client/types/com/atproto/account/create.d.ts +0 -41
- package/dist/src/client/types/com/atproto/account/createInviteCode.d.ts +0 -22
- package/dist/src/client/types/com/atproto/account/get.d.ts +0 -12
- package/dist/src/client/types/com/atproto/account/requestPasswordReset.d.ts +0 -17
- package/dist/src/client/types/com/atproto/account/resetPassword.d.ts +0 -24
- package/dist/src/client/types/com/atproto/blob/upload.d.ts +0 -19
- package/dist/src/client/types/com/atproto/createAccount.d.ts +0 -40
- package/dist/src/client/types/com/atproto/createInviteCode.d.ts +0 -20
- package/dist/src/client/types/com/atproto/createSession.d.ts +0 -24
- package/dist/src/client/types/com/atproto/data/uploadFile.d.ts +0 -19
- package/dist/src/client/types/com/atproto/deleteAccount.d.ts +0 -20
- package/dist/src/client/types/com/atproto/deleteSession.d.ts +0 -17
- package/dist/src/client/types/com/atproto/getAccount.d.ts +0 -16
- package/dist/src/client/types/com/atproto/getAccountsConfig.d.ts +0 -17
- package/dist/src/client/types/com/atproto/getSession.d.ts +0 -17
- package/dist/src/client/types/com/atproto/handle/resolve.d.ts +0 -18
- package/dist/src/client/types/com/atproto/refreshSession.d.ts +0 -20
- package/dist/src/client/types/com/atproto/repo/batchWrite.d.ts +0 -39
- package/dist/src/client/types/com/atproto/repo/createRecord.d.ts +0 -26
- package/dist/src/client/types/com/atproto/repo/deleteRecord.d.ts +0 -19
- package/dist/src/client/types/com/atproto/repo/describe.d.ts +0 -22
- package/dist/src/client/types/com/atproto/repo/getRecord.d.ts +0 -23
- package/dist/src/client/types/com/atproto/repo/listRecords.d.ts +0 -30
- package/dist/src/client/types/com/atproto/repo/putRecord.d.ts +0 -27
- package/dist/src/client/types/com/atproto/repo/strongRef.d.ts +0 -5
- package/dist/src/client/types/com/atproto/repoBatchWrite.d.ts +0 -36
- package/dist/src/client/types/com/atproto/repoCreateRecord.d.ts +0 -24
- package/dist/src/client/types/com/atproto/repoDeleteRecord.d.ts +0 -18
- package/dist/src/client/types/com/atproto/repoDescribe.d.ts +0 -21
- package/dist/src/client/types/com/atproto/repoGetRecord.d.ts +0 -22
- package/dist/src/client/types/com/atproto/repoListRecords.d.ts +0 -27
- package/dist/src/client/types/com/atproto/repoPutRecord.d.ts +0 -25
- package/dist/src/client/types/com/atproto/requestAccountPasswordReset.d.ts +0 -19
- package/dist/src/client/types/com/atproto/resetAccountPassword.d.ts +0 -26
- package/dist/src/client/types/com/atproto/resolveHandle.d.ts +0 -17
- package/dist/src/client/types/com/atproto/resolveName.d.ts +0 -17
- package/dist/src/client/types/com/atproto/server/getAccountsConfig.d.ts +0 -24
- package/dist/src/client/types/com/atproto/session/create.d.ts +0 -29
- package/dist/src/client/types/com/atproto/session/delete.d.ts +0 -13
- package/dist/src/client/types/com/atproto/session/get.d.ts +0 -18
- package/dist/src/client/types/com/atproto/session/refresh.d.ts +0 -24
- package/dist/src/client/types/com/atproto/sync/getRepo.d.ts +0 -15
- package/dist/src/client/types/com/atproto/sync/getRoot.d.ts +0 -18
- package/dist/src/client/types/com/atproto/sync/updateRepo.d.ts +0 -15
- package/dist/src/client/types/com/atproto/syncGetRepo.d.ts +0 -15
- package/dist/src/client/types/com/atproto/syncGetRoot.d.ts +0 -17
- package/dist/src/client/types/com/atproto/syncUpdateRepo.d.ts +0 -15
- package/dist/src/index.d.ts +0 -4
- package/dist/src/schemas.d.ts +0 -19
- package/dist/src/session.d.ts +0 -42
- package/dist/src/types/app/bsky/badge.d.ts +0 -22
- package/dist/src/types/app/bsky/badgeAccept.d.ts +0 -11
- package/dist/src/types/app/bsky/badgeOffer.d.ts +0 -11
- package/dist/src/types/app/bsky/declaration.d.ts +0 -6
- package/dist/src/types/app/bsky/follow.d.ts +0 -9
- package/dist/src/types/app/bsky/getAuthorFeed.d.ts +0 -56
- package/dist/src/types/app/bsky/getBadgeMembers.d.ts +0 -29
- package/dist/src/types/app/bsky/getHomeFeed.d.ts +0 -56
- package/dist/src/types/app/bsky/getLikedBy.d.ts +0 -29
- package/dist/src/types/app/bsky/getNotificationCount.d.ts +0 -16
- package/dist/src/types/app/bsky/getNotifications.d.ts +0 -33
- package/dist/src/types/app/bsky/getPostThread.d.ts +0 -55
- package/dist/src/types/app/bsky/getProfile.d.ts +0 -42
- package/dist/src/types/app/bsky/getRepostedBy.d.ts +0 -29
- package/dist/src/types/app/bsky/getUserFollowers.d.ts +0 -31
- package/dist/src/types/app/bsky/getUserFollows.d.ts +0 -31
- package/dist/src/types/app/bsky/getUsersSearch.d.ts +0 -26
- package/dist/src/types/app/bsky/getUsersTypeahead.d.ts +0 -22
- package/dist/src/types/app/bsky/invite.d.ts +0 -10
- package/dist/src/types/app/bsky/inviteAccept.d.ts +0 -14
- package/dist/src/types/app/bsky/like.d.ts +0 -10
- package/dist/src/types/app/bsky/mediaEmbed.d.ts +0 -15
- package/dist/src/types/app/bsky/post.d.ts +0 -23
- package/dist/src/types/app/bsky/postNotificationsSeen.d.ts +0 -19
- package/dist/src/types/app/bsky/profile.d.ts +0 -11
- package/dist/src/types/app/bsky/repost.d.ts +0 -10
- package/dist/src/types/app/bsky/updateProfile.d.ts +0 -27
- package/dist/src/types/com/atproto/createAccount.d.ts +0 -39
- package/dist/src/types/com/atproto/createInviteCode.d.ts +0 -19
- package/dist/src/types/com/atproto/createSession.d.ts +0 -23
- package/dist/src/types/com/atproto/deleteAccount.d.ts +0 -19
- package/dist/src/types/com/atproto/deleteSession.d.ts +0 -16
- package/dist/src/types/com/atproto/getAccount.d.ts +0 -19
- package/dist/src/types/com/atproto/getAccountsConfig.d.ts +0 -17
- package/dist/src/types/com/atproto/getSession.d.ts +0 -17
- package/dist/src/types/com/atproto/refreshSession.d.ts +0 -19
- package/dist/src/types/com/atproto/repoBatchWrite.d.ts +0 -35
- package/dist/src/types/com/atproto/repoCreateRecord.d.ts +0 -23
- package/dist/src/types/com/atproto/repoDeleteRecord.d.ts +0 -15
- package/dist/src/types/com/atproto/repoDescribe.d.ts +0 -21
- package/dist/src/types/com/atproto/repoGetRecord.d.ts +0 -22
- package/dist/src/types/com/atproto/repoListRecords.d.ts +0 -27
- package/dist/src/types/com/atproto/repoPutRecord.d.ts +0 -24
- package/dist/src/types/com/atproto/requestAccountPasswordReset.d.ts +0 -18
- package/dist/src/types/com/atproto/resetAccountPassword.d.ts +0 -25
- package/dist/src/types/com/atproto/resolveName.d.ts +0 -17
- package/dist/src/types/com/atproto/syncGetRepo.d.ts +0 -15
- package/dist/src/types/com/atproto/syncGetRoot.d.ts +0 -17
- package/dist/src/types/com/atproto/syncUpdateRepo.d.ts +0 -14
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/src/session.ts +0 -194
- package/tests/session.test.ts +0 -239
package/README.md
CHANGED
|
@@ -3,12 +3,50 @@
|
|
|
3
3
|
## Usage
|
|
4
4
|
|
|
5
5
|
```typescript
|
|
6
|
-
import
|
|
6
|
+
import AtpAgent from '@atproto/api'
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const agent = new AtpAgent({service: 'https://example.com'})
|
|
9
9
|
|
|
10
|
+
// provide a custom fetch implementation (shouldnt be needed in node or the browser)
|
|
11
|
+
import {AtpAgentFetchHeaders, AtpAgentFetchHandlerResponse} from '@atproto/api'
|
|
12
|
+
AtpAgent.configure({
|
|
13
|
+
async fetch(
|
|
14
|
+
httpUri: string,
|
|
15
|
+
httpMethod: string,
|
|
16
|
+
httpHeaders: AtpAgentFetchHeaders,
|
|
17
|
+
httpReqBody: any,
|
|
18
|
+
): Promise<AtpAgentFetchHandlerResponse> {
|
|
19
|
+
// insert definition here...
|
|
20
|
+
return {status: 200, /*...*/}
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Session management
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import AtpAgent, {AtpSessionEvent, AtpSessionData} from '@atproto/api'
|
|
29
|
+
const agent = new AtpAgent({
|
|
30
|
+
service: 'https://example.com',
|
|
31
|
+
persistSession: (evt: AtpSessionEvent, sess?: AtpSessionData) {
|
|
32
|
+
// store the session-data for reuse
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
await agent.login({identifier: 'alice@mail.com', password: 'hunter2'})
|
|
37
|
+
await agent.resumeSession(savedSessionData)
|
|
38
|
+
await agent.createAccount({
|
|
39
|
+
email: 'alice@mail.com',
|
|
40
|
+
password: 'hunter2',
|
|
41
|
+
handle: 'alice.example.com'
|
|
42
|
+
})
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### API calls
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
10
48
|
// xrpc methods
|
|
11
|
-
const res1 = await
|
|
49
|
+
const res1 = await agent.api.com.atproto.repo.createRecord(
|
|
12
50
|
{
|
|
13
51
|
did: alice.did,
|
|
14
52
|
collection: 'app.bsky.feed.post',
|
|
@@ -19,14 +57,14 @@ const res1 = await client.com.atproto.repo.createRecord(
|
|
|
19
57
|
}
|
|
20
58
|
}
|
|
21
59
|
)
|
|
22
|
-
const res2 = await
|
|
60
|
+
const res2 = await agent.api.com.atproto.repo.listRecords({did: alice.did, type: 'app.bsky.feed.post'})
|
|
23
61
|
|
|
24
62
|
// repo record methods
|
|
25
|
-
const res3 = await
|
|
63
|
+
const res3 = await agent.api.app.bsky.feed.post.create({did: alice.did}, {
|
|
26
64
|
text: 'Hello, world!',
|
|
27
65
|
createdAt: (new Date()).toISOString()
|
|
28
66
|
})
|
|
29
|
-
const res4 = await
|
|
67
|
+
const res4 = await agent.api.app.bsky.feed.post.list({did: alice.did})
|
|
30
68
|
```
|
|
31
69
|
|
|
32
70
|
## License
|
package/dist/agent.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AtpServiceClient, ComAtprotoAccountCreate, ComAtprotoSessionCreate, ComAtprotoSessionGet } from './client';
|
|
2
|
+
import { AtpSessionData, AtpAgentCreateAccountOpts, AtpAgentLoginOpts, AptAgentFetchHandler, AtpAgentGlobalOpts, AtpPersistSessionHandler, AtpAgentOpts } from './types';
|
|
3
|
+
export declare class AtpAgent {
|
|
4
|
+
service: URL;
|
|
5
|
+
api: AtpServiceClient;
|
|
6
|
+
session?: AtpSessionData;
|
|
7
|
+
private _baseClient;
|
|
8
|
+
private _persistSession?;
|
|
9
|
+
private _refreshSessionPromise;
|
|
10
|
+
static fetch: AptAgentFetchHandler | undefined;
|
|
11
|
+
static configure(opts: AtpAgentGlobalOpts): void;
|
|
12
|
+
constructor(opts: AtpAgentOpts);
|
|
13
|
+
get hasSession(): boolean;
|
|
14
|
+
setPersistSessionHandler(handler?: AtpPersistSessionHandler): void;
|
|
15
|
+
createAccount(opts: AtpAgentCreateAccountOpts): Promise<ComAtprotoAccountCreate.Response>;
|
|
16
|
+
login(opts: AtpAgentLoginOpts): Promise<ComAtprotoSessionCreate.Response>;
|
|
17
|
+
resumeSession(session: AtpSessionData): Promise<ComAtprotoSessionGet.Response>;
|
|
18
|
+
private _addAuthHeader;
|
|
19
|
+
private _fetch;
|
|
20
|
+
private _refreshSession;
|
|
21
|
+
private _refreshSessionInner;
|
|
22
|
+
}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as ComAtprotoAccountCreate from './types/com/atproto/account/create';
|
|
|
3
3
|
import * as ComAtprotoAccountCreateInviteCode from './types/com/atproto/account/createInviteCode';
|
|
4
4
|
import * as ComAtprotoAccountDelete from './types/com/atproto/account/delete';
|
|
5
5
|
import * as ComAtprotoAccountGet from './types/com/atproto/account/get';
|
|
6
|
+
import * as ComAtprotoAccountRequestDelete from './types/com/atproto/account/requestDelete';
|
|
6
7
|
import * as ComAtprotoAccountRequestPasswordReset from './types/com/atproto/account/requestPasswordReset';
|
|
7
8
|
import * as ComAtprotoAccountResetPassword from './types/com/atproto/account/resetPassword';
|
|
8
9
|
import * as ComAtprotoAdminGetModerationAction from './types/com/atproto/admin/getModerationAction';
|
|
@@ -66,8 +67,10 @@ export * as ComAtprotoAccountCreate from './types/com/atproto/account/create';
|
|
|
66
67
|
export * as ComAtprotoAccountCreateInviteCode from './types/com/atproto/account/createInviteCode';
|
|
67
68
|
export * as ComAtprotoAccountDelete from './types/com/atproto/account/delete';
|
|
68
69
|
export * as ComAtprotoAccountGet from './types/com/atproto/account/get';
|
|
70
|
+
export * as ComAtprotoAccountRequestDelete from './types/com/atproto/account/requestDelete';
|
|
69
71
|
export * as ComAtprotoAccountRequestPasswordReset from './types/com/atproto/account/requestPasswordReset';
|
|
70
72
|
export * as ComAtprotoAccountResetPassword from './types/com/atproto/account/resetPassword';
|
|
73
|
+
export * as ComAtprotoAdminBlob from './types/com/atproto/admin/blob';
|
|
71
74
|
export * as ComAtprotoAdminGetModerationAction from './types/com/atproto/admin/getModerationAction';
|
|
72
75
|
export * as ComAtprotoAdminGetModerationActions from './types/com/atproto/admin/getModerationActions';
|
|
73
76
|
export * as ComAtprotoAdminGetModerationReport from './types/com/atproto/admin/getModerationReport';
|
|
@@ -158,28 +161,26 @@ export declare const APP_BSKY_GRAPH: {
|
|
|
158
161
|
export declare const APP_BSKY_SYSTEM: {
|
|
159
162
|
ActorUser: string;
|
|
160
163
|
};
|
|
161
|
-
export declare class
|
|
164
|
+
export declare class AtpBaseClient {
|
|
162
165
|
xrpc: XrpcClient;
|
|
163
166
|
constructor();
|
|
164
|
-
service(serviceUri: string | URL):
|
|
167
|
+
service(serviceUri: string | URL): AtpServiceClient;
|
|
165
168
|
}
|
|
166
|
-
declare
|
|
167
|
-
|
|
168
|
-
export declare class ServiceClient {
|
|
169
|
-
_baseClient: Client;
|
|
169
|
+
export declare class AtpServiceClient {
|
|
170
|
+
_baseClient: AtpBaseClient;
|
|
170
171
|
xrpc: XrpcServiceClient;
|
|
171
172
|
com: ComNS;
|
|
172
173
|
app: AppNS;
|
|
173
|
-
constructor(baseClient:
|
|
174
|
+
constructor(baseClient: AtpBaseClient, xrpcService: XrpcServiceClient);
|
|
174
175
|
setHeader(key: string, value: string): void;
|
|
175
176
|
}
|
|
176
177
|
export declare class ComNS {
|
|
177
|
-
_service:
|
|
178
|
+
_service: AtpServiceClient;
|
|
178
179
|
atproto: AtprotoNS;
|
|
179
|
-
constructor(service:
|
|
180
|
+
constructor(service: AtpServiceClient);
|
|
180
181
|
}
|
|
181
182
|
export declare class AtprotoNS {
|
|
182
|
-
_service:
|
|
183
|
+
_service: AtpServiceClient;
|
|
183
184
|
account: AccountNS;
|
|
184
185
|
admin: AdminNS;
|
|
185
186
|
blob: BlobNS;
|
|
@@ -189,21 +190,22 @@ export declare class AtprotoNS {
|
|
|
189
190
|
server: ServerNS;
|
|
190
191
|
session: SessionNS;
|
|
191
192
|
sync: SyncNS;
|
|
192
|
-
constructor(service:
|
|
193
|
+
constructor(service: AtpServiceClient);
|
|
193
194
|
}
|
|
194
195
|
export declare class AccountNS {
|
|
195
|
-
_service:
|
|
196
|
-
constructor(service:
|
|
196
|
+
_service: AtpServiceClient;
|
|
197
|
+
constructor(service: AtpServiceClient);
|
|
197
198
|
create(data?: ComAtprotoAccountCreate.InputSchema, opts?: ComAtprotoAccountCreate.CallOptions): Promise<ComAtprotoAccountCreate.Response>;
|
|
198
199
|
createInviteCode(data?: ComAtprotoAccountCreateInviteCode.InputSchema, opts?: ComAtprotoAccountCreateInviteCode.CallOptions): Promise<ComAtprotoAccountCreateInviteCode.Response>;
|
|
199
200
|
delete(data?: ComAtprotoAccountDelete.InputSchema, opts?: ComAtprotoAccountDelete.CallOptions): Promise<ComAtprotoAccountDelete.Response>;
|
|
200
201
|
get(params?: ComAtprotoAccountGet.QueryParams, opts?: ComAtprotoAccountGet.CallOptions): Promise<ComAtprotoAccountGet.Response>;
|
|
202
|
+
requestDelete(data?: ComAtprotoAccountRequestDelete.InputSchema, opts?: ComAtprotoAccountRequestDelete.CallOptions): Promise<ComAtprotoAccountRequestDelete.Response>;
|
|
201
203
|
requestPasswordReset(data?: ComAtprotoAccountRequestPasswordReset.InputSchema, opts?: ComAtprotoAccountRequestPasswordReset.CallOptions): Promise<ComAtprotoAccountRequestPasswordReset.Response>;
|
|
202
204
|
resetPassword(data?: ComAtprotoAccountResetPassword.InputSchema, opts?: ComAtprotoAccountResetPassword.CallOptions): Promise<ComAtprotoAccountResetPassword.Response>;
|
|
203
205
|
}
|
|
204
206
|
export declare class AdminNS {
|
|
205
|
-
_service:
|
|
206
|
-
constructor(service:
|
|
207
|
+
_service: AtpServiceClient;
|
|
208
|
+
constructor(service: AtpServiceClient);
|
|
207
209
|
getModerationAction(params?: ComAtprotoAdminGetModerationAction.QueryParams, opts?: ComAtprotoAdminGetModerationAction.CallOptions): Promise<ComAtprotoAdminGetModerationAction.Response>;
|
|
208
210
|
getModerationActions(params?: ComAtprotoAdminGetModerationActions.QueryParams, opts?: ComAtprotoAdminGetModerationActions.CallOptions): Promise<ComAtprotoAdminGetModerationActions.Response>;
|
|
209
211
|
getModerationReport(params?: ComAtprotoAdminGetModerationReport.QueryParams, opts?: ComAtprotoAdminGetModerationReport.CallOptions): Promise<ComAtprotoAdminGetModerationReport.Response>;
|
|
@@ -216,18 +218,18 @@ export declare class AdminNS {
|
|
|
216
218
|
takeModerationAction(data?: ComAtprotoAdminTakeModerationAction.InputSchema, opts?: ComAtprotoAdminTakeModerationAction.CallOptions): Promise<ComAtprotoAdminTakeModerationAction.Response>;
|
|
217
219
|
}
|
|
218
220
|
export declare class BlobNS {
|
|
219
|
-
_service:
|
|
220
|
-
constructor(service:
|
|
221
|
+
_service: AtpServiceClient;
|
|
222
|
+
constructor(service: AtpServiceClient);
|
|
221
223
|
upload(data?: ComAtprotoBlobUpload.InputSchema, opts?: ComAtprotoBlobUpload.CallOptions): Promise<ComAtprotoBlobUpload.Response>;
|
|
222
224
|
}
|
|
223
225
|
export declare class HandleNS {
|
|
224
|
-
_service:
|
|
225
|
-
constructor(service:
|
|
226
|
+
_service: AtpServiceClient;
|
|
227
|
+
constructor(service: AtpServiceClient);
|
|
226
228
|
resolve(params?: ComAtprotoHandleResolve.QueryParams, opts?: ComAtprotoHandleResolve.CallOptions): Promise<ComAtprotoHandleResolve.Response>;
|
|
227
229
|
}
|
|
228
230
|
export declare class RepoNS {
|
|
229
|
-
_service:
|
|
230
|
-
constructor(service:
|
|
231
|
+
_service: AtpServiceClient;
|
|
232
|
+
constructor(service: AtpServiceClient);
|
|
231
233
|
batchWrite(data?: ComAtprotoRepoBatchWrite.InputSchema, opts?: ComAtprotoRepoBatchWrite.CallOptions): Promise<ComAtprotoRepoBatchWrite.Response>;
|
|
232
234
|
createRecord(data?: ComAtprotoRepoCreateRecord.InputSchema, opts?: ComAtprotoRepoCreateRecord.CallOptions): Promise<ComAtprotoRepoCreateRecord.Response>;
|
|
233
235
|
deleteRecord(data?: ComAtprotoRepoDeleteRecord.InputSchema, opts?: ComAtprotoRepoDeleteRecord.CallOptions): Promise<ComAtprotoRepoDeleteRecord.Response>;
|
|
@@ -237,26 +239,26 @@ export declare class RepoNS {
|
|
|
237
239
|
putRecord(data?: ComAtprotoRepoPutRecord.InputSchema, opts?: ComAtprotoRepoPutRecord.CallOptions): Promise<ComAtprotoRepoPutRecord.Response>;
|
|
238
240
|
}
|
|
239
241
|
export declare class ReportNS {
|
|
240
|
-
_service:
|
|
241
|
-
constructor(service:
|
|
242
|
+
_service: AtpServiceClient;
|
|
243
|
+
constructor(service: AtpServiceClient);
|
|
242
244
|
create(data?: ComAtprotoReportCreate.InputSchema, opts?: ComAtprotoReportCreate.CallOptions): Promise<ComAtprotoReportCreate.Response>;
|
|
243
245
|
}
|
|
244
246
|
export declare class ServerNS {
|
|
245
|
-
_service:
|
|
246
|
-
constructor(service:
|
|
247
|
+
_service: AtpServiceClient;
|
|
248
|
+
constructor(service: AtpServiceClient);
|
|
247
249
|
getAccountsConfig(params?: ComAtprotoServerGetAccountsConfig.QueryParams, opts?: ComAtprotoServerGetAccountsConfig.CallOptions): Promise<ComAtprotoServerGetAccountsConfig.Response>;
|
|
248
250
|
}
|
|
249
251
|
export declare class SessionNS {
|
|
250
|
-
_service:
|
|
251
|
-
constructor(service:
|
|
252
|
+
_service: AtpServiceClient;
|
|
253
|
+
constructor(service: AtpServiceClient);
|
|
252
254
|
create(data?: ComAtprotoSessionCreate.InputSchema, opts?: ComAtprotoSessionCreate.CallOptions): Promise<ComAtprotoSessionCreate.Response>;
|
|
253
255
|
delete(data?: ComAtprotoSessionDelete.InputSchema, opts?: ComAtprotoSessionDelete.CallOptions): Promise<ComAtprotoSessionDelete.Response>;
|
|
254
256
|
get(params?: ComAtprotoSessionGet.QueryParams, opts?: ComAtprotoSessionGet.CallOptions): Promise<ComAtprotoSessionGet.Response>;
|
|
255
257
|
refresh(data?: ComAtprotoSessionRefresh.InputSchema, opts?: ComAtprotoSessionRefresh.CallOptions): Promise<ComAtprotoSessionRefresh.Response>;
|
|
256
258
|
}
|
|
257
259
|
export declare class SyncNS {
|
|
258
|
-
_service:
|
|
259
|
-
constructor(service:
|
|
260
|
+
_service: AtpServiceClient;
|
|
261
|
+
constructor(service: AtpServiceClient);
|
|
260
262
|
getCheckout(params?: ComAtprotoSyncGetCheckout.QueryParams, opts?: ComAtprotoSyncGetCheckout.CallOptions): Promise<ComAtprotoSyncGetCheckout.Response>;
|
|
261
263
|
getCommitPath(params?: ComAtprotoSyncGetCommitPath.QueryParams, opts?: ComAtprotoSyncGetCommitPath.CallOptions): Promise<ComAtprotoSyncGetCommitPath.Response>;
|
|
262
264
|
getHead(params?: ComAtprotoSyncGetHead.QueryParams, opts?: ComAtprotoSyncGetHead.CallOptions): Promise<ComAtprotoSyncGetHead.Response>;
|
|
@@ -264,24 +266,24 @@ export declare class SyncNS {
|
|
|
264
266
|
getRepo(params?: ComAtprotoSyncGetRepo.QueryParams, opts?: ComAtprotoSyncGetRepo.CallOptions): Promise<ComAtprotoSyncGetRepo.Response>;
|
|
265
267
|
}
|
|
266
268
|
export declare class AppNS {
|
|
267
|
-
_service:
|
|
269
|
+
_service: AtpServiceClient;
|
|
268
270
|
bsky: BskyNS;
|
|
269
|
-
constructor(service:
|
|
271
|
+
constructor(service: AtpServiceClient);
|
|
270
272
|
}
|
|
271
273
|
export declare class BskyNS {
|
|
272
|
-
_service:
|
|
274
|
+
_service: AtpServiceClient;
|
|
273
275
|
actor: ActorNS;
|
|
274
276
|
embed: EmbedNS;
|
|
275
277
|
feed: FeedNS;
|
|
276
278
|
graph: GraphNS;
|
|
277
279
|
notification: NotificationNS;
|
|
278
280
|
system: SystemNS;
|
|
279
|
-
constructor(service:
|
|
281
|
+
constructor(service: AtpServiceClient);
|
|
280
282
|
}
|
|
281
283
|
export declare class ActorNS {
|
|
282
|
-
_service:
|
|
284
|
+
_service: AtpServiceClient;
|
|
283
285
|
profile: ProfileRecord;
|
|
284
|
-
constructor(service:
|
|
286
|
+
constructor(service: AtpServiceClient);
|
|
285
287
|
getProfile(params?: AppBskyActorGetProfile.QueryParams, opts?: AppBskyActorGetProfile.CallOptions): Promise<AppBskyActorGetProfile.Response>;
|
|
286
288
|
getSuggestions(params?: AppBskyActorGetSuggestions.QueryParams, opts?: AppBskyActorGetSuggestions.CallOptions): Promise<AppBskyActorGetSuggestions.Response>;
|
|
287
289
|
search(params?: AppBskyActorSearch.QueryParams, opts?: AppBskyActorSearch.CallOptions): Promise<AppBskyActorSearch.Response>;
|
|
@@ -289,8 +291,8 @@ export declare class ActorNS {
|
|
|
289
291
|
updateProfile(data?: AppBskyActorUpdateProfile.InputSchema, opts?: AppBskyActorUpdateProfile.CallOptions): Promise<AppBskyActorUpdateProfile.Response>;
|
|
290
292
|
}
|
|
291
293
|
export declare class ProfileRecord {
|
|
292
|
-
_service:
|
|
293
|
-
constructor(service:
|
|
294
|
+
_service: AtpServiceClient;
|
|
295
|
+
constructor(service: AtpServiceClient);
|
|
294
296
|
list(params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>): Promise<{
|
|
295
297
|
cursor?: string;
|
|
296
298
|
records: {
|
|
@@ -310,15 +312,15 @@ export declare class ProfileRecord {
|
|
|
310
312
|
delete(params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, headers?: Record<string, string>): Promise<void>;
|
|
311
313
|
}
|
|
312
314
|
export declare class EmbedNS {
|
|
313
|
-
_service:
|
|
314
|
-
constructor(service:
|
|
315
|
+
_service: AtpServiceClient;
|
|
316
|
+
constructor(service: AtpServiceClient);
|
|
315
317
|
}
|
|
316
318
|
export declare class FeedNS {
|
|
317
|
-
_service:
|
|
319
|
+
_service: AtpServiceClient;
|
|
318
320
|
post: PostRecord;
|
|
319
321
|
repost: RepostRecord;
|
|
320
322
|
vote: VoteRecord;
|
|
321
|
-
constructor(service:
|
|
323
|
+
constructor(service: AtpServiceClient);
|
|
322
324
|
getAuthorFeed(params?: AppBskyFeedGetAuthorFeed.QueryParams, opts?: AppBskyFeedGetAuthorFeed.CallOptions): Promise<AppBskyFeedGetAuthorFeed.Response>;
|
|
323
325
|
getPostThread(params?: AppBskyFeedGetPostThread.QueryParams, opts?: AppBskyFeedGetPostThread.CallOptions): Promise<AppBskyFeedGetPostThread.Response>;
|
|
324
326
|
getRepostedBy(params?: AppBskyFeedGetRepostedBy.QueryParams, opts?: AppBskyFeedGetRepostedBy.CallOptions): Promise<AppBskyFeedGetRepostedBy.Response>;
|
|
@@ -327,8 +329,8 @@ export declare class FeedNS {
|
|
|
327
329
|
setVote(data?: AppBskyFeedSetVote.InputSchema, opts?: AppBskyFeedSetVote.CallOptions): Promise<AppBskyFeedSetVote.Response>;
|
|
328
330
|
}
|
|
329
331
|
export declare class PostRecord {
|
|
330
|
-
_service:
|
|
331
|
-
constructor(service:
|
|
332
|
+
_service: AtpServiceClient;
|
|
333
|
+
constructor(service: AtpServiceClient);
|
|
332
334
|
list(params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>): Promise<{
|
|
333
335
|
cursor?: string;
|
|
334
336
|
records: {
|
|
@@ -348,8 +350,8 @@ export declare class PostRecord {
|
|
|
348
350
|
delete(params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, headers?: Record<string, string>): Promise<void>;
|
|
349
351
|
}
|
|
350
352
|
export declare class RepostRecord {
|
|
351
|
-
_service:
|
|
352
|
-
constructor(service:
|
|
353
|
+
_service: AtpServiceClient;
|
|
354
|
+
constructor(service: AtpServiceClient);
|
|
353
355
|
list(params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>): Promise<{
|
|
354
356
|
cursor?: string;
|
|
355
357
|
records: {
|
|
@@ -369,8 +371,8 @@ export declare class RepostRecord {
|
|
|
369
371
|
delete(params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, headers?: Record<string, string>): Promise<void>;
|
|
370
372
|
}
|
|
371
373
|
export declare class VoteRecord {
|
|
372
|
-
_service:
|
|
373
|
-
constructor(service:
|
|
374
|
+
_service: AtpServiceClient;
|
|
375
|
+
constructor(service: AtpServiceClient);
|
|
374
376
|
list(params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>): Promise<{
|
|
375
377
|
cursor?: string;
|
|
376
378
|
records: {
|
|
@@ -390,11 +392,11 @@ export declare class VoteRecord {
|
|
|
390
392
|
delete(params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, headers?: Record<string, string>): Promise<void>;
|
|
391
393
|
}
|
|
392
394
|
export declare class GraphNS {
|
|
393
|
-
_service:
|
|
395
|
+
_service: AtpServiceClient;
|
|
394
396
|
assertion: AssertionRecord;
|
|
395
397
|
confirmation: ConfirmationRecord;
|
|
396
398
|
follow: FollowRecord;
|
|
397
|
-
constructor(service:
|
|
399
|
+
constructor(service: AtpServiceClient);
|
|
398
400
|
getFollowers(params?: AppBskyGraphGetFollowers.QueryParams, opts?: AppBskyGraphGetFollowers.CallOptions): Promise<AppBskyGraphGetFollowers.Response>;
|
|
399
401
|
getFollows(params?: AppBskyGraphGetFollows.QueryParams, opts?: AppBskyGraphGetFollows.CallOptions): Promise<AppBskyGraphGetFollows.Response>;
|
|
400
402
|
getMutes(params?: AppBskyGraphGetMutes.QueryParams, opts?: AppBskyGraphGetMutes.CallOptions): Promise<AppBskyGraphGetMutes.Response>;
|
|
@@ -402,8 +404,8 @@ export declare class GraphNS {
|
|
|
402
404
|
unmute(data?: AppBskyGraphUnmute.InputSchema, opts?: AppBskyGraphUnmute.CallOptions): Promise<AppBskyGraphUnmute.Response>;
|
|
403
405
|
}
|
|
404
406
|
export declare class AssertionRecord {
|
|
405
|
-
_service:
|
|
406
|
-
constructor(service:
|
|
407
|
+
_service: AtpServiceClient;
|
|
408
|
+
constructor(service: AtpServiceClient);
|
|
407
409
|
list(params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>): Promise<{
|
|
408
410
|
cursor?: string;
|
|
409
411
|
records: {
|
|
@@ -423,8 +425,8 @@ export declare class AssertionRecord {
|
|
|
423
425
|
delete(params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, headers?: Record<string, string>): Promise<void>;
|
|
424
426
|
}
|
|
425
427
|
export declare class ConfirmationRecord {
|
|
426
|
-
_service:
|
|
427
|
-
constructor(service:
|
|
428
|
+
_service: AtpServiceClient;
|
|
429
|
+
constructor(service: AtpServiceClient);
|
|
428
430
|
list(params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>): Promise<{
|
|
429
431
|
cursor?: string;
|
|
430
432
|
records: {
|
|
@@ -444,8 +446,8 @@ export declare class ConfirmationRecord {
|
|
|
444
446
|
delete(params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, headers?: Record<string, string>): Promise<void>;
|
|
445
447
|
}
|
|
446
448
|
export declare class FollowRecord {
|
|
447
|
-
_service:
|
|
448
|
-
constructor(service:
|
|
449
|
+
_service: AtpServiceClient;
|
|
450
|
+
constructor(service: AtpServiceClient);
|
|
449
451
|
list(params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>): Promise<{
|
|
450
452
|
cursor?: string;
|
|
451
453
|
records: {
|
|
@@ -465,20 +467,20 @@ export declare class FollowRecord {
|
|
|
465
467
|
delete(params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, headers?: Record<string, string>): Promise<void>;
|
|
466
468
|
}
|
|
467
469
|
export declare class NotificationNS {
|
|
468
|
-
_service:
|
|
469
|
-
constructor(service:
|
|
470
|
+
_service: AtpServiceClient;
|
|
471
|
+
constructor(service: AtpServiceClient);
|
|
470
472
|
getCount(params?: AppBskyNotificationGetCount.QueryParams, opts?: AppBskyNotificationGetCount.CallOptions): Promise<AppBskyNotificationGetCount.Response>;
|
|
471
473
|
list(params?: AppBskyNotificationList.QueryParams, opts?: AppBskyNotificationList.CallOptions): Promise<AppBskyNotificationList.Response>;
|
|
472
474
|
updateSeen(data?: AppBskyNotificationUpdateSeen.InputSchema, opts?: AppBskyNotificationUpdateSeen.CallOptions): Promise<AppBskyNotificationUpdateSeen.Response>;
|
|
473
475
|
}
|
|
474
476
|
export declare class SystemNS {
|
|
475
|
-
_service:
|
|
477
|
+
_service: AtpServiceClient;
|
|
476
478
|
declaration: DeclarationRecord;
|
|
477
|
-
constructor(service:
|
|
479
|
+
constructor(service: AtpServiceClient);
|
|
478
480
|
}
|
|
479
481
|
export declare class DeclarationRecord {
|
|
480
|
-
_service:
|
|
481
|
-
constructor(service:
|
|
482
|
+
_service: AtpServiceClient;
|
|
483
|
+
constructor(service: AtpServiceClient);
|
|
482
484
|
list(params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>): Promise<{
|
|
483
485
|
cursor?: string;
|
|
484
486
|
records: {
|