@atproto/api 0.3.3 → 0.3.4
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/bench/agent.bench.ts +9 -0
- package/dist/client/lexicons.d.ts +34 -0
- package/dist/client/types/com/atproto/admin/defs.d.ts +14 -2
- package/dist/client/types/com/atproto/admin/getModerationReports.d.ts +1 -0
- package/dist/client/types/com/atproto/admin/getRecord.d.ts +4 -1
- package/dist/client/types/com/atproto/admin/getRepo.d.ts +4 -1
- package/dist/client/types/com/atproto/server/createAccount.d.ts +7 -0
- package/dist/index.js +8902 -5
- package/dist/index.js.map +4 -4
- package/jest.bench.config.js +8 -0
- package/package.json +4 -2
- package/src/client/lexicons.ts +53 -0
- package/src/client/types/com/atproto/admin/defs.ts +46 -2
- package/src/client/types/com/atproto/admin/getModerationReports.ts +6 -0
- package/src/client/types/com/atproto/admin/getRecord.ts +7 -0
- package/src/client/types/com/atproto/admin/getRepo.ts +7 -0
- package/src/client/types/com/atproto/server/createAccount.ts +15 -0
- package/tests/agent.test.ts +63 -0
- package/tests/bsky-agent.test.ts +63 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/client/types/app/bsky/actor/createScene.d.ts +0 -32
- package/dist/client/types/app/bsky/actor/ref.d.ts +0 -28
- package/dist/client/types/app/bsky/actor/search.d.ts +0 -22
- package/dist/client/types/app/bsky/actor/searchActor.d.ts +0 -22
- package/dist/client/types/app/bsky/actor/searchActorTypeahead.d.ts +0 -20
- package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +0 -20
- package/dist/client/types/app/bsky/actor/updateProfile.d.ts +0 -47
- package/dist/client/types/app/bsky/feed/bookmarkFeed.d.ts +0 -17
- package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +0 -28
- package/dist/client/types/app/bsky/feed/generator.d.ts +0 -13
- package/dist/client/types/app/bsky/feed/getActorFeeds.d.ts +0 -22
- package/dist/client/types/app/bsky/feed/getBookmarkedFeeds.d.ts +0 -21
- package/dist/client/types/app/bsky/feed/getFeed.d.ts +0 -22
- package/dist/client/types/app/bsky/feed/getFeedSkeleton.d.ts +0 -22
- package/dist/client/types/app/bsky/feed/getVotes.d.ts +0 -36
- package/dist/client/types/app/bsky/feed/setVote.d.ts +0 -25
- package/dist/client/types/app/bsky/feed/trend.d.ts +0 -9
- package/dist/client/types/app/bsky/feed/unbookmarkFeed.d.ts +0 -17
- package/dist/client/types/app/bsky/feed/vote.d.ts +0 -10
- package/dist/client/types/app/bsky/graph/assertCreator.d.ts +0 -1
- package/dist/client/types/app/bsky/graph/assertMember.d.ts +0 -1
- package/dist/client/types/app/bsky/graph/assertion.d.ts +0 -10
- package/dist/client/types/app/bsky/graph/confirmation.d.ts +0 -11
- package/dist/client/types/app/bsky/graph/getAssertions.d.ts +0 -48
- package/dist/client/types/app/bsky/graph/getMembers.d.ts +0 -36
- package/dist/client/types/app/bsky/graph/getMemberships.d.ts +0 -36
- package/dist/client/types/app/bsky/graph/mute.d.ts +0 -17
- package/dist/client/types/app/bsky/graph/unmute.d.ts +0 -17
- package/dist/client/types/app/bsky/notification/getCount.d.ts +0 -17
- package/dist/client/types/app/bsky/notification/list.d.ts +0 -35
- package/dist/client/types/app/bsky/system/actorScene.d.ts +0 -1
- package/dist/client/types/app/bsky/system/actorUser.d.ts +0 -1
- package/dist/client/types/app/bsky/system/declRef.d.ts +0 -8
- package/dist/client/types/app/bsky/system/declaration.d.ts +0 -7
- package/dist/client/types/com/atproto/account/create.d.ts +0 -41
- package/dist/client/types/com/atproto/account/createInviteCode.d.ts +0 -22
- package/dist/client/types/com/atproto/account/delete.d.ts +0 -25
- package/dist/client/types/com/atproto/account/get.d.ts +0 -12
- package/dist/client/types/com/atproto/account/requestDelete.d.ts +0 -13
- package/dist/client/types/com/atproto/account/requestPasswordReset.d.ts +0 -17
- package/dist/client/types/com/atproto/account/resetPassword.d.ts +0 -24
- package/dist/client/types/com/atproto/admin/blob.d.ts +0 -37
- package/dist/client/types/com/atproto/admin/getInviteCodeUsage.d.ts +0 -29
- package/dist/client/types/com/atproto/admin/moderationAction.d.ts +0 -60
- package/dist/client/types/com/atproto/admin/moderationReport.d.ts +0 -37
- package/dist/client/types/com/atproto/admin/record.d.ts +0 -43
- package/dist/client/types/com/atproto/admin/repo.d.ts +0 -45
- package/dist/client/types/com/atproto/blob/upload.d.ts +0 -19
- package/dist/client/types/com/atproto/handle/resolve.d.ts +0 -18
- package/dist/client/types/com/atproto/handle/update.d.ts +0 -17
- package/dist/client/types/com/atproto/repo/batchWrite.d.ts +0 -46
- package/dist/client/types/com/atproto/repo/describe.d.ts +0 -22
- package/dist/client/types/com/atproto/repo/importRepo.d.ts +0 -19
- package/dist/client/types/com/atproto/repo/recordRef.d.ts +0 -8
- package/dist/client/types/com/atproto/repo/repoRef.d.ts +0 -7
- package/dist/client/types/com/atproto/repo/uploadRepo.d.ts +0 -19
- package/dist/client/types/com/atproto/report/create.d.ts +0 -39
- package/dist/client/types/com/atproto/report/reasonType.d.ts +0 -3
- package/dist/client/types/com/atproto/report/subject.d.ts +0 -23
- package/dist/client/types/com/atproto/server/getAccountsConfig.d.ts +0 -27
- package/dist/client/types/com/atproto/server/getUserInviteCodes.d.ts +0 -31
- package/dist/client/types/com/atproto/session/create.d.ts +0 -29
- package/dist/client/types/com/atproto/session/delete.d.ts +0 -13
- package/dist/client/types/com/atproto/session/get.d.ts +0 -18
- package/dist/client/types/com/atproto/session/refresh.d.ts +0 -24
- package/dist/client/types/com/atproto/sync/getRoot.d.ts +0 -18
- package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +0 -9
- package/dist/client/types/com/atproto/sync/updateRepo.d.ts +0 -15
- package/dist/session.d.ts +0 -42
- package/dist/src/client/index.d.ts +0 -462
- package/dist/src/client/lexicons.d.ts +0 -2910
- 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/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 -18
- 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/delete.d.ts +0 -13
- 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 -26
- 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 -21
- 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/acceptedBadge.d.ts +0 -10
- 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/src/types/todo/adx/createAccount.d.ts +0 -36
- package/dist/src/types/todo/adx/createInviteCode.d.ts +0 -19
- package/dist/src/types/todo/adx/createSession.d.ts +0 -22
- package/dist/src/types/todo/adx/deleteAccount.d.ts +0 -19
- package/dist/src/types/todo/adx/deleteSession.d.ts +0 -19
- package/dist/src/types/todo/adx/getAccount.d.ts +0 -19
- package/dist/src/types/todo/adx/getAccountsConfig.d.ts +0 -17
- package/dist/src/types/todo/adx/getSession.d.ts +0 -17
- package/dist/src/types/todo/adx/repoBatchWrite.d.ts +0 -34
- package/dist/src/types/todo/adx/repoCreateRecord.d.ts +0 -22
- package/dist/src/types/todo/adx/repoDeleteRecord.d.ts +0 -15
- package/dist/src/types/todo/adx/repoDescribe.d.ts +0 -21
- package/dist/src/types/todo/adx/repoGetRecord.d.ts +0 -20
- package/dist/src/types/todo/adx/repoListRecords.d.ts +0 -25
- package/dist/src/types/todo/adx/repoPutRecord.d.ts +0 -23
- package/dist/src/types/todo/adx/requestAccountPasswordReset.d.ts +0 -18
- package/dist/src/types/todo/adx/resetAccountPassword.d.ts +0 -25
- package/dist/src/types/todo/adx/resolveName.d.ts +0 -17
- package/dist/src/types/todo/adx/syncGetRepo.d.ts +0 -15
- package/dist/src/types/todo/adx/syncGetRoot.d.ts +0 -17
- package/dist/src/types/todo/adx/syncUpdateRepo.d.ts +0 -14
- package/dist/src/types/todo/social/badge.d.ts +0 -23
- package/dist/src/types/todo/social/follow.d.ts +0 -5
- package/dist/src/types/todo/social/getAuthorFeed.d.ts +0 -55
- package/dist/src/types/todo/social/getFeed.d.ts +0 -55
- package/dist/src/types/todo/social/getHomeFeed.d.ts +0 -55
- package/dist/src/types/todo/social/getLikedBy.d.ts +0 -26
- package/dist/src/types/todo/social/getNotificationCount.d.ts +0 -16
- package/dist/src/types/todo/social/getNotifications.d.ts +0 -31
- package/dist/src/types/todo/social/getPostThread.d.ts +0 -54
- package/dist/src/types/todo/social/getProfile.d.ts +0 -40
- package/dist/src/types/todo/social/getRepostedBy.d.ts +0 -26
- package/dist/src/types/todo/social/getUserFollowers.d.ts +0 -30
- package/dist/src/types/todo/social/getUserFollows.d.ts +0 -30
- package/dist/src/types/todo/social/like.d.ts +0 -5
- package/dist/src/types/todo/social/mediaEmbed.d.ts +0 -15
- package/dist/src/types/todo/social/post.d.ts +0 -18
- package/dist/src/types/todo/social/postNotificationsSeen.d.ts +0 -19
- package/dist/src/types/todo/social/profile.d.ts +0 -10
- package/dist/src/types/todo/social/repost.d.ts +0 -5
- package/dist/tsconfig.build.tsbuildinfo +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"codegen": "lex gen-api ./src/client ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/*",
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"update-main-to-src": "node ./update-pkg.js --update-main-to-src",
|
|
11
11
|
"prepublish": "npm run update-main-to-dist",
|
|
12
12
|
"postpublish": "npm run update-main-to-src",
|
|
13
|
-
"test": "jest"
|
|
13
|
+
"test": "jest",
|
|
14
|
+
"bench": "jest --config jest.bench.config.js",
|
|
15
|
+
"bench:profile": "node --inspect-brk ../../node_modules/.bin/jest --config jest.bench.config.js"
|
|
14
16
|
},
|
|
15
17
|
"license": "MIT",
|
|
16
18
|
"repository": {
|
package/src/client/lexicons.ts
CHANGED
|
@@ -100,7 +100,9 @@ export const schemaDict = {
|
|
|
100
100
|
type: 'union',
|
|
101
101
|
refs: [
|
|
102
102
|
'lex:com.atproto.admin.defs#repoView',
|
|
103
|
+
'lex:com.atproto.admin.defs#repoViewNotFound',
|
|
103
104
|
'lex:com.atproto.admin.defs#recordView',
|
|
105
|
+
'lex:com.atproto.admin.defs#recordViewNotFound',
|
|
104
106
|
],
|
|
105
107
|
},
|
|
106
108
|
subjectBlobs: {
|
|
@@ -274,7 +276,9 @@ export const schemaDict = {
|
|
|
274
276
|
type: 'union',
|
|
275
277
|
refs: [
|
|
276
278
|
'lex:com.atproto.admin.defs#repoView',
|
|
279
|
+
'lex:com.atproto.admin.defs#repoViewNotFound',
|
|
277
280
|
'lex:com.atproto.admin.defs#recordView',
|
|
281
|
+
'lex:com.atproto.admin.defs#recordViewNotFound',
|
|
278
282
|
],
|
|
279
283
|
},
|
|
280
284
|
reportedBy: {
|
|
@@ -396,6 +400,16 @@ export const schemaDict = {
|
|
|
396
400
|
},
|
|
397
401
|
},
|
|
398
402
|
},
|
|
403
|
+
repoViewNotFound: {
|
|
404
|
+
type: 'object',
|
|
405
|
+
required: ['did'],
|
|
406
|
+
properties: {
|
|
407
|
+
did: {
|
|
408
|
+
type: 'string',
|
|
409
|
+
format: 'did',
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
},
|
|
399
413
|
repoRef: {
|
|
400
414
|
type: 'object',
|
|
401
415
|
required: ['did'],
|
|
@@ -501,6 +515,16 @@ export const schemaDict = {
|
|
|
501
515
|
},
|
|
502
516
|
},
|
|
503
517
|
},
|
|
518
|
+
recordViewNotFound: {
|
|
519
|
+
type: 'object',
|
|
520
|
+
required: ['uri'],
|
|
521
|
+
properties: {
|
|
522
|
+
uri: {
|
|
523
|
+
type: 'string',
|
|
524
|
+
format: 'at-uri',
|
|
525
|
+
},
|
|
526
|
+
},
|
|
527
|
+
},
|
|
504
528
|
moderation: {
|
|
505
529
|
type: 'object',
|
|
506
530
|
required: [],
|
|
@@ -835,6 +859,15 @@ export const schemaDict = {
|
|
|
835
859
|
resolved: {
|
|
836
860
|
type: 'boolean',
|
|
837
861
|
},
|
|
862
|
+
actionType: {
|
|
863
|
+
type: 'string',
|
|
864
|
+
knownValues: [
|
|
865
|
+
'com.atproto.admin.defs#takedown',
|
|
866
|
+
'com.atproto.admin.defs#flag',
|
|
867
|
+
'com.atproto.admin.defs#acknowledge',
|
|
868
|
+
'com.atproto.admin.defs#escalate',
|
|
869
|
+
],
|
|
870
|
+
},
|
|
838
871
|
limit: {
|
|
839
872
|
type: 'integer',
|
|
840
873
|
minimum: 1,
|
|
@@ -896,6 +929,11 @@ export const schemaDict = {
|
|
|
896
929
|
ref: 'lex:com.atproto.admin.defs#recordViewDetail',
|
|
897
930
|
},
|
|
898
931
|
},
|
|
932
|
+
errors: [
|
|
933
|
+
{
|
|
934
|
+
name: 'RecordNotFound',
|
|
935
|
+
},
|
|
936
|
+
],
|
|
899
937
|
},
|
|
900
938
|
},
|
|
901
939
|
},
|
|
@@ -923,6 +961,11 @@ export const schemaDict = {
|
|
|
923
961
|
ref: 'lex:com.atproto.admin.defs#repoViewDetail',
|
|
924
962
|
},
|
|
925
963
|
},
|
|
964
|
+
errors: [
|
|
965
|
+
{
|
|
966
|
+
name: 'RepoNotFound',
|
|
967
|
+
},
|
|
968
|
+
],
|
|
926
969
|
},
|
|
927
970
|
},
|
|
928
971
|
},
|
|
@@ -2114,6 +2157,10 @@ export const schemaDict = {
|
|
|
2114
2157
|
type: 'string',
|
|
2115
2158
|
format: 'handle',
|
|
2116
2159
|
},
|
|
2160
|
+
did: {
|
|
2161
|
+
type: 'string',
|
|
2162
|
+
format: 'did',
|
|
2163
|
+
},
|
|
2117
2164
|
inviteCode: {
|
|
2118
2165
|
type: 'string',
|
|
2119
2166
|
},
|
|
@@ -2165,6 +2212,12 @@ export const schemaDict = {
|
|
|
2165
2212
|
{
|
|
2166
2213
|
name: 'UnsupportedDomain',
|
|
2167
2214
|
},
|
|
2215
|
+
{
|
|
2216
|
+
name: 'UnresolvableDid',
|
|
2217
|
+
},
|
|
2218
|
+
{
|
|
2219
|
+
name: 'IncompatibleDidDoc',
|
|
2220
|
+
},
|
|
2168
2221
|
],
|
|
2169
2222
|
},
|
|
2170
2223
|
},
|
|
@@ -43,7 +43,12 @@ export function validateActionView(v: unknown): ValidationResult {
|
|
|
43
43
|
export interface ActionViewDetail {
|
|
44
44
|
id: number
|
|
45
45
|
action: ActionType
|
|
46
|
-
subject:
|
|
46
|
+
subject:
|
|
47
|
+
| RepoView
|
|
48
|
+
| RepoViewNotFound
|
|
49
|
+
| RecordView
|
|
50
|
+
| RecordViewNotFound
|
|
51
|
+
| { $type: string; [k: string]: unknown }
|
|
47
52
|
subjectBlobs: BlobView[]
|
|
48
53
|
createLabelVals?: string[]
|
|
49
54
|
negateLabelVals?: string[]
|
|
@@ -150,7 +155,12 @@ export interface ReportViewDetail {
|
|
|
150
155
|
id: number
|
|
151
156
|
reasonType: ComAtprotoModerationDefs.ReasonType
|
|
152
157
|
reason?: string
|
|
153
|
-
subject:
|
|
158
|
+
subject:
|
|
159
|
+
| RepoView
|
|
160
|
+
| RepoViewNotFound
|
|
161
|
+
| RecordView
|
|
162
|
+
| RecordViewNotFound
|
|
163
|
+
| { $type: string; [k: string]: unknown }
|
|
154
164
|
reportedBy: string
|
|
155
165
|
createdAt: string
|
|
156
166
|
resolvedByActions: ActionView[]
|
|
@@ -219,6 +229,23 @@ export function validateRepoViewDetail(v: unknown): ValidationResult {
|
|
|
219
229
|
return lexicons.validate('com.atproto.admin.defs#repoViewDetail', v)
|
|
220
230
|
}
|
|
221
231
|
|
|
232
|
+
export interface RepoViewNotFound {
|
|
233
|
+
did: string
|
|
234
|
+
[k: string]: unknown
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export function isRepoViewNotFound(v: unknown): v is RepoViewNotFound {
|
|
238
|
+
return (
|
|
239
|
+
isObj(v) &&
|
|
240
|
+
hasProp(v, '$type') &&
|
|
241
|
+
v.$type === 'com.atproto.admin.defs#repoViewNotFound'
|
|
242
|
+
)
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export function validateRepoViewNotFound(v: unknown): ValidationResult {
|
|
246
|
+
return lexicons.validate('com.atproto.admin.defs#repoViewNotFound', v)
|
|
247
|
+
}
|
|
248
|
+
|
|
222
249
|
export interface RepoRef {
|
|
223
250
|
did: string
|
|
224
251
|
[k: string]: unknown
|
|
@@ -283,6 +310,23 @@ export function validateRecordViewDetail(v: unknown): ValidationResult {
|
|
|
283
310
|
return lexicons.validate('com.atproto.admin.defs#recordViewDetail', v)
|
|
284
311
|
}
|
|
285
312
|
|
|
313
|
+
export interface RecordViewNotFound {
|
|
314
|
+
uri: string
|
|
315
|
+
[k: string]: unknown
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export function isRecordViewNotFound(v: unknown): v is RecordViewNotFound {
|
|
319
|
+
return (
|
|
320
|
+
isObj(v) &&
|
|
321
|
+
hasProp(v, '$type') &&
|
|
322
|
+
v.$type === 'com.atproto.admin.defs#recordViewNotFound'
|
|
323
|
+
)
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export function validateRecordViewNotFound(v: unknown): ValidationResult {
|
|
327
|
+
return lexicons.validate('com.atproto.admin.defs#recordViewNotFound', v)
|
|
328
|
+
}
|
|
329
|
+
|
|
286
330
|
export interface Moderation {
|
|
287
331
|
currentAction?: ActionViewCurrent
|
|
288
332
|
[k: string]: unknown
|
|
@@ -11,6 +11,12 @@ import * as ComAtprotoAdminDefs from './defs'
|
|
|
11
11
|
export interface QueryParams {
|
|
12
12
|
subject?: string
|
|
13
13
|
resolved?: boolean
|
|
14
|
+
actionType?:
|
|
15
|
+
| 'com.atproto.admin.defs#takedown'
|
|
16
|
+
| 'com.atproto.admin.defs#flag'
|
|
17
|
+
| 'com.atproto.admin.defs#acknowledge'
|
|
18
|
+
| 'com.atproto.admin.defs#escalate'
|
|
19
|
+
| (string & {})
|
|
14
20
|
limit?: number
|
|
15
21
|
cursor?: string
|
|
16
22
|
}
|
|
@@ -26,8 +26,15 @@ export interface Response {
|
|
|
26
26
|
data: OutputSchema
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
export class RecordNotFoundError extends XRPCError {
|
|
30
|
+
constructor(src: XRPCError) {
|
|
31
|
+
super(src.status, src.error, src.message)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
29
35
|
export function toKnownErr(e: any) {
|
|
30
36
|
if (e instanceof XRPCError) {
|
|
37
|
+
if (e.error === 'RecordNotFound') return new RecordNotFoundError(e)
|
|
31
38
|
}
|
|
32
39
|
return e
|
|
33
40
|
}
|
|
@@ -25,8 +25,15 @@ export interface Response {
|
|
|
25
25
|
data: OutputSchema
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
export class RepoNotFoundError extends XRPCError {
|
|
29
|
+
constructor(src: XRPCError) {
|
|
30
|
+
super(src.status, src.error, src.message)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
export function toKnownErr(e: any) {
|
|
29
35
|
if (e instanceof XRPCError) {
|
|
36
|
+
if (e.error === 'RepoNotFound') return new RepoNotFoundError(e)
|
|
30
37
|
}
|
|
31
38
|
return e
|
|
32
39
|
}
|
|
@@ -12,6 +12,7 @@ export interface QueryParams {}
|
|
|
12
12
|
export interface InputSchema {
|
|
13
13
|
email: string
|
|
14
14
|
handle: string
|
|
15
|
+
did?: string
|
|
15
16
|
inviteCode?: string
|
|
16
17
|
password: string
|
|
17
18
|
recoveryKey?: string
|
|
@@ -68,6 +69,18 @@ export class UnsupportedDomainError extends XRPCError {
|
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
|
|
72
|
+
export class UnresolvableDidError extends XRPCError {
|
|
73
|
+
constructor(src: XRPCError) {
|
|
74
|
+
super(src.status, src.error, src.message)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export class IncompatibleDidDocError extends XRPCError {
|
|
79
|
+
constructor(src: XRPCError) {
|
|
80
|
+
super(src.status, src.error, src.message)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
71
84
|
export function toKnownErr(e: any) {
|
|
72
85
|
if (e instanceof XRPCError) {
|
|
73
86
|
if (e.error === 'InvalidHandle') return new InvalidHandleError(e)
|
|
@@ -75,6 +88,8 @@ export function toKnownErr(e: any) {
|
|
|
75
88
|
if (e.error === 'InvalidInviteCode') return new InvalidInviteCodeError(e)
|
|
76
89
|
if (e.error === 'HandleNotAvailable') return new HandleNotAvailableError(e)
|
|
77
90
|
if (e.error === 'UnsupportedDomain') return new UnsupportedDomainError(e)
|
|
91
|
+
if (e.error === 'UnresolvableDid') return new UnresolvableDidError(e)
|
|
92
|
+
if (e.error === 'IncompatibleDidDoc') return new IncompatibleDidDocError(e)
|
|
78
93
|
}
|
|
79
94
|
return e
|
|
80
95
|
}
|
package/tests/agent.test.ts
CHANGED
|
@@ -398,4 +398,67 @@ describe('agent', () => {
|
|
|
398
398
|
expect(sessions.length).toEqual(1)
|
|
399
399
|
expect(sessions[0]?.accessJwt).toEqual(origAccessJwt)
|
|
400
400
|
})
|
|
401
|
+
|
|
402
|
+
describe('setPersistSessionHandler', () => {
|
|
403
|
+
it('sets persist session handler', async () => {
|
|
404
|
+
let originalHandlerCallCount = 0
|
|
405
|
+
let newHandlerCallCount = 0
|
|
406
|
+
|
|
407
|
+
const persistSession = () => {
|
|
408
|
+
originalHandlerCallCount++
|
|
409
|
+
}
|
|
410
|
+
const newPersistSession = () => {
|
|
411
|
+
newHandlerCallCount++
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
const agent = new AtpAgent({ service: server.url, persistSession })
|
|
415
|
+
|
|
416
|
+
await agent.createAccount({
|
|
417
|
+
handle: 'user7.test',
|
|
418
|
+
email: 'user7@test.com',
|
|
419
|
+
password: 'password',
|
|
420
|
+
})
|
|
421
|
+
|
|
422
|
+
expect(originalHandlerCallCount).toEqual(1)
|
|
423
|
+
|
|
424
|
+
agent.setPersistSessionHandler(newPersistSession)
|
|
425
|
+
|
|
426
|
+
await agent.createAccount({
|
|
427
|
+
handle: 'user8.test',
|
|
428
|
+
email: 'user8@test.com',
|
|
429
|
+
password: 'password',
|
|
430
|
+
})
|
|
431
|
+
|
|
432
|
+
expect(originalHandlerCallCount).toEqual(1)
|
|
433
|
+
expect(newHandlerCallCount).toEqual(1)
|
|
434
|
+
})
|
|
435
|
+
})
|
|
436
|
+
|
|
437
|
+
describe('createAccount', () => {
|
|
438
|
+
it('persists an empty session on failure', async () => {
|
|
439
|
+
const events: string[] = []
|
|
440
|
+
const sessions: (AtpSessionData | undefined)[] = []
|
|
441
|
+
const persistSession = (evt: AtpSessionEvent, sess?: AtpSessionData) => {
|
|
442
|
+
events.push(evt)
|
|
443
|
+
sessions.push(sess)
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
const agent = new AtpAgent({ service: server.url, persistSession })
|
|
447
|
+
|
|
448
|
+
await expect(
|
|
449
|
+
agent.createAccount({
|
|
450
|
+
handle: '',
|
|
451
|
+
email: '',
|
|
452
|
+
password: 'password',
|
|
453
|
+
}),
|
|
454
|
+
).rejects.toThrow()
|
|
455
|
+
|
|
456
|
+
expect(agent.hasSession).toEqual(false)
|
|
457
|
+
expect(agent.session).toEqual(undefined)
|
|
458
|
+
expect(events.length).toEqual(1)
|
|
459
|
+
expect(events[0]).toEqual('create-failed')
|
|
460
|
+
expect(sessions.length).toEqual(1)
|
|
461
|
+
expect(sessions[0]).toEqual(undefined)
|
|
462
|
+
})
|
|
463
|
+
})
|
|
401
464
|
})
|
package/tests/bsky-agent.test.ts
CHANGED
|
@@ -137,4 +137,67 @@ describe('agent', () => {
|
|
|
137
137
|
})
|
|
138
138
|
await expect(p).rejects.toThrow('Record/displayName must be a string')
|
|
139
139
|
})
|
|
140
|
+
|
|
141
|
+
describe('app', () => {
|
|
142
|
+
it('should retrieve the api app', () => {
|
|
143
|
+
const agent = new BskyAgent({ service: server.url })
|
|
144
|
+
expect(agent.app).toBe(agent.api.app)
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
describe('post', () => {
|
|
149
|
+
it('should throw if no session', async () => {
|
|
150
|
+
const agent = new BskyAgent({ service: server.url })
|
|
151
|
+
await expect(agent.post({ text: 'foo' })).rejects.toThrow('Not logged in')
|
|
152
|
+
})
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
describe('deletePost', () => {
|
|
156
|
+
it('should throw if no session', async () => {
|
|
157
|
+
const agent = new BskyAgent({ service: server.url })
|
|
158
|
+
await expect(agent.deletePost('foo')).rejects.toThrow('Not logged in')
|
|
159
|
+
})
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
describe('like', () => {
|
|
163
|
+
it('should throw if no session', async () => {
|
|
164
|
+
const agent = new BskyAgent({ service: server.url })
|
|
165
|
+
await expect(agent.like('foo', 'bar')).rejects.toThrow('Not logged in')
|
|
166
|
+
})
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
describe('deleteLike', () => {
|
|
170
|
+
it('should throw if no session', async () => {
|
|
171
|
+
const agent = new BskyAgent({ service: server.url })
|
|
172
|
+
await expect(agent.deleteLike('foo')).rejects.toThrow('Not logged in')
|
|
173
|
+
})
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
describe('repost', () => {
|
|
177
|
+
it('should throw if no session', async () => {
|
|
178
|
+
const agent = new BskyAgent({ service: server.url })
|
|
179
|
+
await expect(agent.repost('foo', 'bar')).rejects.toThrow('Not logged in')
|
|
180
|
+
})
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
describe('deleteRepost', () => {
|
|
184
|
+
it('should throw if no session', async () => {
|
|
185
|
+
const agent = new BskyAgent({ service: server.url })
|
|
186
|
+
await expect(agent.deleteRepost('foo')).rejects.toThrow('Not logged in')
|
|
187
|
+
})
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
describe('follow', () => {
|
|
191
|
+
it('should throw if no session', async () => {
|
|
192
|
+
const agent = new BskyAgent({ service: server.url })
|
|
193
|
+
await expect(agent.follow('foo')).rejects.toThrow('Not logged in')
|
|
194
|
+
})
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
describe('deleteFollow', () => {
|
|
198
|
+
it('should throw if no session', async () => {
|
|
199
|
+
const agent = new BskyAgent({ service: server.url })
|
|
200
|
+
await expect(agent.deleteFollow('foo')).rejects.toThrow('Not logged in')
|
|
201
|
+
})
|
|
202
|
+
})
|
|
140
203
|
})
|