@atproto/api 0.10.5 → 0.11.0-next
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/definitions/labels.json +191 -189
- package/dist/agent.d.ts +3 -1
- package/dist/bsky-agent.d.ts +6 -2
- package/dist/client/index.d.ts +94 -38
- package/dist/client/lexicons.d.ts +5091 -4833
- package/dist/client/types/app/bsky/actor/createScene.d.ts +32 -0
- package/dist/client/types/app/bsky/actor/defs.d.ts +23 -1
- package/dist/client/types/app/bsky/actor/ref.d.ts +28 -0
- package/dist/client/types/app/bsky/actor/search.d.ts +22 -0
- package/dist/client/types/app/bsky/actor/searchActor.d.ts +22 -0
- package/dist/client/types/app/bsky/actor/searchActorTypeahead.d.ts +20 -0
- package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +20 -0
- package/dist/client/types/app/bsky/actor/updateProfile.d.ts +47 -0
- package/dist/client/types/app/bsky/embed/record.d.ts +2 -1
- package/dist/client/types/app/bsky/feed/bookmarkFeed.d.ts +17 -0
- package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +28 -0
- package/dist/client/types/app/bsky/feed/getBookmarkedFeeds.d.ts +21 -0
- package/dist/client/types/app/bsky/feed/getSavedFeeds.d.ts +21 -0
- package/dist/client/types/app/bsky/feed/getVotes.d.ts +36 -0
- package/dist/client/types/app/bsky/feed/saveFeed.d.ts +17 -0
- package/dist/client/types/app/bsky/feed/setVote.d.ts +25 -0
- package/dist/client/types/app/bsky/feed/trend.d.ts +9 -0
- package/dist/client/types/app/bsky/feed/unbookmarkFeed.d.ts +17 -0
- package/dist/client/types/app/bsky/feed/unsaveFeed.d.ts +17 -0
- package/dist/client/types/app/bsky/feed/vote.d.ts +10 -0
- package/dist/client/types/app/bsky/graph/assertCreator.d.ts +1 -0
- package/dist/client/types/app/bsky/graph/assertMember.d.ts +1 -0
- package/dist/client/types/app/bsky/graph/assertion.d.ts +10 -0
- package/dist/client/types/app/bsky/graph/confirmation.d.ts +11 -0
- package/dist/client/types/app/bsky/graph/getAssertions.d.ts +48 -0
- package/dist/client/types/app/bsky/graph/getMembers.d.ts +36 -0
- package/dist/client/types/app/bsky/graph/getMemberships.d.ts +36 -0
- package/dist/client/types/app/bsky/graph/mute.d.ts +17 -0
- package/dist/client/types/app/bsky/graph/unmute.d.ts +17 -0
- package/dist/client/types/app/bsky/labeler/defs.d.ts +41 -0
- package/dist/client/types/app/bsky/labeler/getServices.d.ts +23 -0
- package/dist/client/types/app/bsky/labeler/service.d.ts +14 -0
- package/dist/client/types/app/bsky/moderation/defs.d.ts +41 -0
- package/dist/client/types/app/bsky/moderation/getService.d.ts +16 -0
- package/dist/client/types/app/bsky/moderation/getServices.d.ts +23 -0
- package/dist/client/types/app/bsky/moderation/service.d.ts +14 -0
- package/dist/client/types/app/bsky/notification/getCount.d.ts +17 -0
- package/dist/client/types/app/bsky/notification/list.d.ts +35 -0
- package/dist/client/types/app/bsky/system/actorScene.d.ts +1 -0
- package/dist/client/types/app/bsky/system/actorUser.d.ts +1 -0
- package/dist/client/types/app/bsky/system/declRef.d.ts +8 -0
- package/dist/client/types/app/bsky/system/declaration.d.ts +7 -0
- package/dist/client/types/app/bsky/unspecced/applyLabels.d.ts +18 -0
- package/dist/client/types/app/bsky/unspecced/getPopular.d.ts +22 -0
- package/dist/client/types/app/bsky/unspecced/getTimelineSkeleton.d.ts +24 -0
- package/dist/client/types/com/atproto/account/create.d.ts +41 -0
- package/dist/client/types/com/atproto/account/createInviteCode.d.ts +22 -0
- package/dist/client/types/com/atproto/account/delete.d.ts +25 -0
- package/dist/client/types/com/atproto/account/get.d.ts +12 -0
- package/dist/client/types/com/atproto/account/requestDelete.d.ts +13 -0
- package/dist/client/types/com/atproto/account/requestPasswordReset.d.ts +17 -0
- package/dist/client/types/com/atproto/account/resetPassword.d.ts +24 -0
- package/dist/client/types/com/atproto/admin/blob.d.ts +37 -0
- package/dist/client/types/com/atproto/admin/defs.d.ts +0 -304
- package/dist/client/types/com/atproto/admin/getInviteCodeUsage.d.ts +29 -0
- package/dist/client/types/com/atproto/admin/getModerationAction.d.ts +16 -0
- package/dist/client/types/com/atproto/admin/getModerationActions.d.ts +22 -0
- package/dist/client/types/com/atproto/admin/getModerationReport.d.ts +16 -0
- package/dist/client/types/com/atproto/admin/getModerationReports.d.ts +28 -0
- package/dist/client/types/com/atproto/admin/getSubjectState.d.ts +26 -0
- package/dist/client/types/com/atproto/admin/getUserAccountInfo.d.ts +16 -0
- package/dist/client/types/com/atproto/admin/moderationAction.d.ts +60 -0
- package/dist/client/types/com/atproto/admin/moderationReport.d.ts +37 -0
- package/dist/client/types/com/atproto/admin/rebaseRepo.d.ts +24 -0
- package/dist/client/types/com/atproto/admin/record.d.ts +43 -0
- package/dist/client/types/com/atproto/admin/repo.d.ts +45 -0
- package/dist/client/types/com/atproto/admin/resolveModerationReports.d.ts +22 -0
- package/dist/client/types/com/atproto/admin/reverseModerationAction.d.ts +22 -0
- package/dist/client/types/com/atproto/admin/takeModerationAction.d.ts +34 -0
- package/dist/client/types/com/atproto/admin/updateSubjectState.d.ts +32 -0
- package/dist/client/types/com/atproto/blob/upload.d.ts +19 -0
- package/dist/client/types/com/atproto/handle/resolve.d.ts +18 -0
- package/dist/client/types/com/atproto/handle/update.d.ts +17 -0
- package/dist/client/types/com/atproto/label/defs.d.ts +21 -0
- package/dist/client/types/com/atproto/repo/batchWrite.d.ts +46 -0
- package/dist/client/types/com/atproto/repo/describe.d.ts +22 -0
- package/dist/client/types/com/atproto/repo/rebaseRepo.d.ts +24 -0
- package/dist/client/types/com/atproto/repo/recordRef.d.ts +8 -0
- package/dist/client/types/com/atproto/repo/repoRef.d.ts +7 -0
- package/dist/client/types/com/atproto/repo/uploadRepo.d.ts +19 -0
- package/dist/client/types/com/atproto/report/create.d.ts +39 -0
- package/dist/client/types/com/atproto/report/reasonType.d.ts +3 -0
- package/dist/client/types/com/atproto/report/subject.d.ts +23 -0
- package/dist/client/types/com/atproto/server/getAccountsConfig.d.ts +27 -0
- package/dist/client/types/com/atproto/server/getUserInviteCodes.d.ts +31 -0
- package/dist/client/types/com/atproto/session/create.d.ts +29 -0
- package/dist/client/types/com/atproto/session/delete.d.ts +13 -0
- package/dist/client/types/com/atproto/session/get.d.ts +18 -0
- package/dist/client/types/com/atproto/session/refresh.d.ts +24 -0
- package/dist/client/types/com/atproto/sync/getCommitPath.d.ts +20 -0
- package/dist/client/types/com/atproto/sync/getCurrent.d.ts +22 -0
- package/dist/client/types/com/atproto/sync/getRoot.d.ts +21 -0
- package/dist/client/types/com/atproto/sync/importRepo.d.ts +16 -0
- package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +9 -0
- package/dist/client/types/com/atproto/sync/updateRepo.d.ts +15 -0
- package/dist/client/types/com/atproto/temp/importRepo.d.ts +16 -0
- package/dist/client/types/com/atproto/temp/pushBlob.d.ts +15 -0
- package/dist/client/types/com/atproto/temp/transferAccount.d.ts +48 -0
- package/dist/client/types/com/atproto/temp/upgradeRepoVersion.d.ts +18 -0
- package/dist/client/types/tools/ozone/communication/createTemplate.d.ts +23 -0
- package/dist/client/types/tools/ozone/communication/defs.d.ts +14 -0
- package/dist/client/types/tools/ozone/communication/deleteTemplate.d.ts +17 -0
- package/dist/client/types/tools/ozone/communication/listTemplates.d.ts +18 -0
- package/dist/client/types/tools/ozone/communication/updateTemplate.d.ts +25 -0
- package/dist/client/types/tools/ozone/moderation/defs.d.ts +269 -0
- package/dist/client/types/tools/ozone/moderation/emitEvent.d.ts +34 -0
- package/dist/client/types/tools/ozone/moderation/getEvent.d.ts +16 -0
- package/dist/client/types/tools/ozone/moderation/getRecord.d.ts +20 -0
- package/dist/client/types/tools/ozone/moderation/getRepo.d.ts +19 -0
- package/dist/client/types/tools/ozone/moderation/queryEvents.d.ts +35 -0
- package/dist/client/types/tools/ozone/moderation/queryStatuses.d.ts +37 -0
- package/dist/client/types/tools/ozone/moderation/searchRepos.d.ts +23 -0
- package/dist/const.d.ts +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +7865 -7922
- package/dist/index.js.map +3 -3
- package/dist/mocker.d.ts +57 -0
- package/dist/moderation/const/labels.d.ts +4 -2
- package/dist/moderation/decision.d.ts +26 -0
- package/dist/moderation/index.d.ts +10 -44
- package/dist/moderation/subjects/account.d.ts +2 -1
- package/dist/moderation/subjects/feed-generator.d.ts +2 -1
- package/dist/moderation/subjects/notification.d.ts +3 -0
- package/dist/moderation/subjects/post.d.ts +2 -1
- package/dist/moderation/subjects/profile.d.ts +2 -1
- package/dist/moderation/subjects/user-list.d.ts +2 -1
- package/dist/moderation/types.d.ts +47 -61
- package/dist/moderation/ui.d.ts +12 -0
- package/dist/moderation/util.d.ts +4 -8
- package/dist/session.d.ts +42 -0
- package/dist/src/client/index.d.ts +462 -0
- package/dist/src/client/lexicons.d.ts +2910 -0
- package/dist/src/client/schemas.d.ts +17 -0
- package/dist/src/client/types/app/bsky/actor/createScene.d.ts +32 -0
- package/dist/src/client/types/app/bsky/actor/getProfile.d.ts +36 -0
- package/dist/src/client/types/app/bsky/actor/getSuggestions.d.ts +36 -0
- package/dist/src/client/types/app/bsky/actor/profile.d.ts +15 -0
- package/dist/src/client/types/app/bsky/actor/ref.d.ts +14 -0
- package/dist/src/client/types/app/bsky/actor/search.d.ts +32 -0
- package/dist/src/client/types/app/bsky/actor/searchTypeahead.d.ts +28 -0
- package/dist/src/client/types/app/bsky/actor/updateProfile.d.ts +48 -0
- package/dist/src/client/types/app/bsky/badge.d.ts +22 -0
- package/dist/src/client/types/app/bsky/badgeAccept.d.ts +11 -0
- package/dist/src/client/types/app/bsky/badgeOffer.d.ts +11 -0
- package/dist/src/client/types/app/bsky/declaration.d.ts +6 -0
- package/dist/src/client/types/app/bsky/embed/external.d.ts +26 -0
- package/dist/src/client/types/app/bsky/embed/images.d.ts +23 -0
- package/dist/src/client/types/app/bsky/feed/embed.d.ts +36 -0
- package/dist/src/client/types/app/bsky/feed/feedViewPost.d.ts +26 -0
- package/dist/src/client/types/app/bsky/feed/getAuthorFeed.d.ts +22 -0
- package/dist/src/client/types/app/bsky/feed/getPostThread.d.ts +43 -0
- package/dist/src/client/types/app/bsky/feed/getRepostedBy.d.ts +35 -0
- package/dist/src/client/types/app/bsky/feed/getTimeline.d.ts +22 -0
- package/dist/src/client/types/app/bsky/feed/getVotes.d.ts +33 -0
- package/dist/src/client/types/app/bsky/feed/mediaEmbed.d.ts +18 -0
- package/dist/src/client/types/app/bsky/feed/post.d.ts +54 -0
- package/dist/src/client/types/app/bsky/feed/repost.d.ts +6 -0
- package/dist/src/client/types/app/bsky/feed/setVote.d.ts +25 -0
- package/dist/src/client/types/app/bsky/feed/trend.d.ts +6 -0
- package/dist/src/client/types/app/bsky/feed/vote.d.ts +7 -0
- package/dist/src/client/types/app/bsky/follow.d.ts +9 -0
- package/dist/src/client/types/app/bsky/getAuthorFeed.d.ts +56 -0
- package/dist/src/client/types/app/bsky/getBadgeMembers.d.ts +29 -0
- package/dist/src/client/types/app/bsky/getHomeFeed.d.ts +56 -0
- package/dist/src/client/types/app/bsky/getLikedBy.d.ts +29 -0
- package/dist/src/client/types/app/bsky/getNotificationCount.d.ts +16 -0
- package/dist/src/client/types/app/bsky/getNotifications.d.ts +33 -0
- package/dist/src/client/types/app/bsky/getPostThread.d.ts +55 -0
- package/dist/src/client/types/app/bsky/getProfile.d.ts +26 -0
- package/dist/src/client/types/app/bsky/getRepostedBy.d.ts +29 -0
- package/dist/src/client/types/app/bsky/getTimeline.d.ts +56 -0
- package/dist/src/client/types/app/bsky/getUserFollowers.d.ts +31 -0
- package/dist/src/client/types/app/bsky/getUserFollows.d.ts +31 -0
- package/dist/src/client/types/app/bsky/getUsersSearch.d.ts +26 -0
- package/dist/src/client/types/app/bsky/getUsersTypeahead.d.ts +22 -0
- package/dist/src/client/types/app/bsky/graph/assertCreator.d.ts +1 -0
- package/dist/src/client/types/app/bsky/graph/assertMember.d.ts +1 -0
- package/dist/src/client/types/app/bsky/graph/assertion.d.ts +7 -0
- package/dist/src/client/types/app/bsky/graph/confirmation.d.ts +8 -0
- package/dist/src/client/types/app/bsky/graph/follow.d.ts +6 -0
- package/dist/src/client/types/app/bsky/graph/getAssertions.d.ts +43 -0
- package/dist/src/client/types/app/bsky/graph/getFollowers.d.ts +34 -0
- package/dist/src/client/types/app/bsky/graph/getFollows.d.ts +33 -0
- package/dist/src/client/types/app/bsky/graph/getMembers.d.ts +33 -0
- package/dist/src/client/types/app/bsky/graph/getMemberships.d.ts +33 -0
- package/dist/src/client/types/app/bsky/invite.d.ts +10 -0
- package/dist/src/client/types/app/bsky/inviteAccept.d.ts +14 -0
- package/dist/src/client/types/app/bsky/like.d.ts +10 -0
- package/dist/src/client/types/app/bsky/mediaEmbed.d.ts +15 -0
- package/dist/src/client/types/app/bsky/notification/getCount.d.ts +17 -0
- package/dist/src/client/types/app/bsky/notification/list.d.ts +32 -0
- package/dist/src/client/types/app/bsky/notification/updateSeen.d.ts +17 -0
- package/dist/src/client/types/app/bsky/post.d.ts +23 -0
- package/dist/src/client/types/app/bsky/postNotificationsSeen.d.ts +20 -0
- package/dist/src/client/types/app/bsky/profile.d.ts +5 -0
- package/dist/src/client/types/app/bsky/repost.d.ts +10 -0
- package/dist/src/client/types/app/bsky/system/actorScene.d.ts +1 -0
- package/dist/src/client/types/app/bsky/system/actorUser.d.ts +1 -0
- package/dist/src/client/types/app/bsky/system/declRef.d.ts +5 -0
- package/dist/src/client/types/app/bsky/system/declaration.d.ts +4 -0
- package/dist/src/client/types/app/bsky/updateProfile.d.ts +23 -0
- package/dist/src/client/types/com/atproto/account/create.d.ts +41 -0
- package/dist/src/client/types/com/atproto/account/createInviteCode.d.ts +22 -0
- package/dist/src/client/types/com/atproto/account/delete.d.ts +13 -0
- package/dist/src/client/types/com/atproto/account/get.d.ts +12 -0
- package/dist/src/client/types/com/atproto/account/requestPasswordReset.d.ts +17 -0
- package/dist/src/client/types/com/atproto/account/resetPassword.d.ts +24 -0
- package/dist/src/client/types/com/atproto/blob/upload.d.ts +19 -0
- package/dist/src/client/types/com/atproto/createAccount.d.ts +40 -0
- package/dist/src/client/types/com/atproto/createInviteCode.d.ts +20 -0
- package/dist/src/client/types/com/atproto/createSession.d.ts +24 -0
- package/dist/src/client/types/com/atproto/data/uploadFile.d.ts +19 -0
- package/dist/src/client/types/com/atproto/deleteAccount.d.ts +20 -0
- package/dist/src/client/types/com/atproto/deleteSession.d.ts +17 -0
- package/dist/src/client/types/com/atproto/getAccount.d.ts +16 -0
- package/dist/src/client/types/com/atproto/getAccountsConfig.d.ts +17 -0
- package/dist/src/client/types/com/atproto/getSession.d.ts +17 -0
- package/dist/src/client/types/com/atproto/handle/resolve.d.ts +18 -0
- package/dist/src/client/types/com/atproto/refreshSession.d.ts +20 -0
- package/dist/src/client/types/com/atproto/repo/batchWrite.d.ts +39 -0
- package/dist/src/client/types/com/atproto/repo/createRecord.d.ts +26 -0
- package/dist/src/client/types/com/atproto/repo/deleteRecord.d.ts +19 -0
- package/dist/src/client/types/com/atproto/repo/describe.d.ts +22 -0
- package/dist/src/client/types/com/atproto/repo/getRecord.d.ts +23 -0
- package/dist/src/client/types/com/atproto/repo/listRecords.d.ts +30 -0
- package/dist/src/client/types/com/atproto/repo/putRecord.d.ts +27 -0
- package/dist/src/client/types/com/atproto/repo/strongRef.d.ts +5 -0
- package/dist/src/client/types/com/atproto/repoBatchWrite.d.ts +36 -0
- package/dist/src/client/types/com/atproto/repoCreateRecord.d.ts +24 -0
- package/dist/src/client/types/com/atproto/repoDeleteRecord.d.ts +18 -0
- package/dist/src/client/types/com/atproto/repoDescribe.d.ts +21 -0
- package/dist/src/client/types/com/atproto/repoGetRecord.d.ts +22 -0
- package/dist/src/client/types/com/atproto/repoListRecords.d.ts +27 -0
- package/dist/src/client/types/com/atproto/repoPutRecord.d.ts +25 -0
- package/dist/src/client/types/com/atproto/requestAccountPasswordReset.d.ts +19 -0
- package/dist/src/client/types/com/atproto/resetAccountPassword.d.ts +26 -0
- package/dist/src/client/types/com/atproto/resolveHandle.d.ts +17 -0
- package/dist/src/client/types/com/atproto/resolveName.d.ts +17 -0
- package/dist/src/client/types/com/atproto/server/getAccountsConfig.d.ts +24 -0
- package/dist/src/client/types/com/atproto/session/create.d.ts +26 -0
- package/dist/src/client/types/com/atproto/session/delete.d.ts +13 -0
- package/dist/src/client/types/com/atproto/session/get.d.ts +18 -0
- package/dist/src/client/types/com/atproto/session/refresh.d.ts +21 -0
- package/dist/src/client/types/com/atproto/sync/getRepo.d.ts +15 -0
- package/dist/src/client/types/com/atproto/sync/getRoot.d.ts +18 -0
- package/dist/src/client/types/com/atproto/sync/updateRepo.d.ts +15 -0
- package/dist/src/client/types/com/atproto/syncGetRepo.d.ts +15 -0
- package/dist/src/client/types/com/atproto/syncGetRoot.d.ts +17 -0
- package/dist/src/client/types/com/atproto/syncUpdateRepo.d.ts +15 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/schemas.d.ts +19 -0
- package/dist/src/session.d.ts +42 -0
- package/dist/src/types/app/bsky/acceptedBadge.d.ts +10 -0
- package/dist/src/types/app/bsky/badge.d.ts +22 -0
- package/dist/src/types/app/bsky/badgeAccept.d.ts +11 -0
- package/dist/src/types/app/bsky/badgeOffer.d.ts +11 -0
- package/dist/src/types/app/bsky/declaration.d.ts +6 -0
- package/dist/src/types/app/bsky/follow.d.ts +9 -0
- package/dist/src/types/app/bsky/getAuthorFeed.d.ts +56 -0
- package/dist/src/types/app/bsky/getBadgeMembers.d.ts +29 -0
- package/dist/src/types/app/bsky/getHomeFeed.d.ts +56 -0
- package/dist/src/types/app/bsky/getLikedBy.d.ts +29 -0
- package/dist/src/types/app/bsky/getNotificationCount.d.ts +16 -0
- package/dist/src/types/app/bsky/getNotifications.d.ts +33 -0
- package/dist/src/types/app/bsky/getPostThread.d.ts +55 -0
- package/dist/src/types/app/bsky/getProfile.d.ts +42 -0
- package/dist/src/types/app/bsky/getRepostedBy.d.ts +29 -0
- package/dist/src/types/app/bsky/getUserFollowers.d.ts +31 -0
- package/dist/src/types/app/bsky/getUserFollows.d.ts +31 -0
- package/dist/src/types/app/bsky/getUsersSearch.d.ts +26 -0
- package/dist/src/types/app/bsky/getUsersTypeahead.d.ts +22 -0
- package/dist/src/types/app/bsky/invite.d.ts +10 -0
- package/dist/src/types/app/bsky/inviteAccept.d.ts +14 -0
- package/dist/src/types/app/bsky/like.d.ts +10 -0
- package/dist/src/types/app/bsky/mediaEmbed.d.ts +15 -0
- package/dist/src/types/app/bsky/post.d.ts +23 -0
- package/dist/src/types/app/bsky/postNotificationsSeen.d.ts +19 -0
- package/dist/src/types/app/bsky/profile.d.ts +11 -0
- package/dist/src/types/app/bsky/repost.d.ts +10 -0
- package/dist/src/types/app/bsky/updateProfile.d.ts +27 -0
- package/dist/src/types/com/atproto/createAccount.d.ts +39 -0
- package/dist/src/types/com/atproto/createInviteCode.d.ts +19 -0
- package/dist/src/types/com/atproto/createSession.d.ts +23 -0
- package/dist/src/types/com/atproto/deleteAccount.d.ts +19 -0
- package/dist/src/types/com/atproto/deleteSession.d.ts +16 -0
- package/dist/src/types/com/atproto/getAccount.d.ts +19 -0
- package/dist/src/types/com/atproto/getAccountsConfig.d.ts +17 -0
- package/dist/src/types/com/atproto/getSession.d.ts +17 -0
- package/dist/src/types/com/atproto/refreshSession.d.ts +19 -0
- package/dist/src/types/com/atproto/repoBatchWrite.d.ts +35 -0
- package/dist/src/types/com/atproto/repoCreateRecord.d.ts +23 -0
- package/dist/src/types/com/atproto/repoDeleteRecord.d.ts +15 -0
- package/dist/src/types/com/atproto/repoDescribe.d.ts +21 -0
- package/dist/src/types/com/atproto/repoGetRecord.d.ts +22 -0
- package/dist/src/types/com/atproto/repoListRecords.d.ts +27 -0
- package/dist/src/types/com/atproto/repoPutRecord.d.ts +24 -0
- package/dist/src/types/com/atproto/requestAccountPasswordReset.d.ts +18 -0
- package/dist/src/types/com/atproto/resetAccountPassword.d.ts +25 -0
- package/dist/src/types/com/atproto/resolveName.d.ts +17 -0
- package/dist/src/types/com/atproto/syncGetRepo.d.ts +15 -0
- package/dist/src/types/com/atproto/syncGetRoot.d.ts +17 -0
- package/dist/src/types/com/atproto/syncUpdateRepo.d.ts +14 -0
- package/dist/src/types/todo/adx/createAccount.d.ts +36 -0
- package/dist/src/types/todo/adx/createInviteCode.d.ts +19 -0
- package/dist/src/types/todo/adx/createSession.d.ts +22 -0
- package/dist/src/types/todo/adx/deleteAccount.d.ts +19 -0
- package/dist/src/types/todo/adx/deleteSession.d.ts +19 -0
- package/dist/src/types/todo/adx/getAccount.d.ts +19 -0
- package/dist/src/types/todo/adx/getAccountsConfig.d.ts +17 -0
- package/dist/src/types/todo/adx/getSession.d.ts +17 -0
- package/dist/src/types/todo/adx/repoBatchWrite.d.ts +34 -0
- package/dist/src/types/todo/adx/repoCreateRecord.d.ts +22 -0
- package/dist/src/types/todo/adx/repoDeleteRecord.d.ts +15 -0
- package/dist/src/types/todo/adx/repoDescribe.d.ts +21 -0
- package/dist/src/types/todo/adx/repoGetRecord.d.ts +20 -0
- package/dist/src/types/todo/adx/repoListRecords.d.ts +25 -0
- package/dist/src/types/todo/adx/repoPutRecord.d.ts +23 -0
- package/dist/src/types/todo/adx/requestAccountPasswordReset.d.ts +18 -0
- package/dist/src/types/todo/adx/resetAccountPassword.d.ts +25 -0
- package/dist/src/types/todo/adx/resolveName.d.ts +17 -0
- package/dist/src/types/todo/adx/syncGetRepo.d.ts +15 -0
- package/dist/src/types/todo/adx/syncGetRoot.d.ts +17 -0
- package/dist/src/types/todo/adx/syncUpdateRepo.d.ts +14 -0
- package/dist/src/types/todo/social/badge.d.ts +23 -0
- package/dist/src/types/todo/social/follow.d.ts +5 -0
- package/dist/src/types/todo/social/getAuthorFeed.d.ts +55 -0
- package/dist/src/types/todo/social/getFeed.d.ts +55 -0
- package/dist/src/types/todo/social/getHomeFeed.d.ts +55 -0
- package/dist/src/types/todo/social/getLikedBy.d.ts +26 -0
- package/dist/src/types/todo/social/getNotificationCount.d.ts +16 -0
- package/dist/src/types/todo/social/getNotifications.d.ts +31 -0
- package/dist/src/types/todo/social/getPostThread.d.ts +54 -0
- package/dist/src/types/todo/social/getProfile.d.ts +40 -0
- package/dist/src/types/todo/social/getRepostedBy.d.ts +26 -0
- package/dist/src/types/todo/social/getUserFollowers.d.ts +30 -0
- package/dist/src/types/todo/social/getUserFollows.d.ts +30 -0
- package/dist/src/types/todo/social/like.d.ts +5 -0
- package/dist/src/types/todo/social/mediaEmbed.d.ts +15 -0
- package/dist/src/types/todo/social/post.d.ts +18 -0
- package/dist/src/types/todo/social/postNotificationsSeen.d.ts +19 -0
- package/dist/src/types/todo/social/profile.d.ts +10 -0
- package/dist/src/types/todo/social/repost.d.ts +5 -0
- package/dist/types.d.ts +2 -4
- package/docs/labels.md +22 -468
- package/docs/moderation.md +0 -2
- package/package.json +5 -5
- package/scripts/code/labels.mjs +17 -35
- package/scripts/docs/labels.mjs +8 -85
- package/scripts/generate-code.mjs +0 -1
- package/scripts/generate-docs.mjs +0 -2
- package/src/agent.ts +24 -4
- package/src/bsky-agent.ts +184 -24
- package/src/client/index.ts +292 -173
- package/src/client/lexicons.ts +6192 -5926
- package/src/client/types/app/bsky/actor/defs.ts +57 -1
- package/src/client/types/app/bsky/embed/record.ts +2 -0
- package/src/client/types/app/bsky/labeler/defs.ts +93 -0
- package/src/client/types/app/bsky/labeler/getServices.ts +41 -0
- package/src/client/types/app/bsky/labeler/service.ts +31 -0
- package/src/client/types/com/atproto/admin/defs.ts +0 -694
- package/src/client/types/com/atproto/label/defs.ts +74 -0
- package/src/client/types/{com/atproto/admin/createCommunicationTemplate.ts → tools/ozone/communication/createTemplate.ts} +2 -2
- package/src/client/types/tools/ozone/communication/defs.ts +35 -0
- package/src/client/types/{com/atproto/admin/listCommunicationTemplates.ts → tools/ozone/communication/listTemplates.ts} +2 -2
- package/src/client/types/{com/atproto/admin/updateCommunicationTemplate.ts → tools/ozone/communication/updateTemplate.ts} +2 -2
- package/src/client/types/tools/ozone/moderation/defs.ts +641 -0
- package/src/client/types/{com/atproto/admin/emitModerationEvent.ts → tools/ozone/moderation/emitEvent.ts} +15 -14
- package/src/client/types/{com/atproto/admin/getModerationEvent.ts → tools/ozone/moderation/getEvent.ts} +2 -2
- package/src/client/types/{com/atproto/admin → tools/ozone/moderation}/getRecord.ts +2 -2
- package/src/client/types/{com/atproto/admin → tools/ozone/moderation}/getRepo.ts +2 -2
- package/src/client/types/{com/atproto/admin/queryModerationEvents.ts → tools/ozone/moderation/queryEvents.ts} +3 -3
- package/src/client/types/{com/atproto/admin/queryModerationStatuses.ts → tools/ozone/moderation/queryStatuses.ts} +2 -2
- package/src/client/types/{com/atproto/admin → tools/ozone/moderation}/searchRepos.ts +2 -2
- package/src/const.ts +1 -0
- package/src/index.ts +3 -2
- package/src/mocker.ts +214 -0
- package/src/moderation/const/labels.ts +247 -847
- package/src/moderation/decision.ts +337 -0
- package/src/moderation/index.ts +38 -304
- package/src/moderation/subjects/account.ts +6 -10
- package/src/moderation/subjects/feed-generator.ts +3 -6
- package/src/moderation/subjects/notification.ts +19 -0
- package/src/moderation/subjects/post.ts +6 -10
- package/src/moderation/subjects/profile.ts +6 -11
- package/src/moderation/subjects/user-list.ts +3 -6
- package/src/moderation/types.ts +81 -77
- package/src/moderation/ui.ts +21 -0
- package/src/moderation/util.ts +82 -72
- package/src/types.ts +3 -10
- package/tests/agent.test.ts +20 -0
- package/tests/bsky-agent.test.ts +401 -98
- package/tests/moderation-behaviors.test.ts +969 -0
- package/tests/moderation-custom-labels.test.ts +358 -0
- package/tests/moderation-prefs.test.ts +276 -0
- package/tests/moderation.test.ts +303 -201
- package/tests/util/echo-server.ts +21 -0
- package/tests/util/index.ts +1 -154
- package/tests/util/moderation-behavior.ts +129 -55
- package/definitions/locale/en/label-groups.json +0 -38
- package/definitions/locale/en/labels.json +0 -394
- package/definitions/locale/en/proposed-label-groups.json +0 -38
- package/definitions/locale/en/proposed-labels.json +0 -632
- package/definitions/moderation-behaviors.d.ts +0 -50
- package/definitions/post-moderation-behaviors.json +0 -1222
- package/definitions/profile-moderation-behaviors.json +0 -597
- package/definitions/proposed-labels.json +0 -326
- package/docs/moderation-behaviors/posts.md +0 -1813
- package/docs/moderation-behaviors/profiles.md +0 -833
- package/scripts/code/label-groups.mjs +0 -68
- package/scripts/docs/post-moderation-behaviors.mjs +0 -117
- package/scripts/docs/profile-moderation-behaviors.mjs +0 -122
- package/src/moderation/accumulator.ts +0 -217
- package/src/moderation/const/label-groups.ts +0 -149
- package/src/moderation/subjects/quoted-post.ts +0 -80
- package/tests/post-moderation.test.ts +0 -46
- package/tests/profile-moderation.test.ts +0 -46
- /package/src/client/types/{com/atproto/admin/deleteCommunicationTemplate.ts → tools/ozone/communication/deleteTemplate.ts} +0 -0
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import {
|
|
2
|
+
moderateProfile,
|
|
3
|
+
moderatePost,
|
|
4
|
+
mock,
|
|
5
|
+
ModerationOpts,
|
|
6
|
+
InterprettedLabelValueDefinition,
|
|
7
|
+
interpretLabelValueDefinition,
|
|
8
|
+
} from '../src'
|
|
9
|
+
import './util/moderation-behavior'
|
|
10
|
+
|
|
11
|
+
interface ScenarioResult {
|
|
12
|
+
profileList?: string[]
|
|
13
|
+
profileView?: string[]
|
|
14
|
+
avatar?: string[]
|
|
15
|
+
banner?: string[]
|
|
16
|
+
displayName?: string[]
|
|
17
|
+
contentList?: string[]
|
|
18
|
+
contentView?: string[]
|
|
19
|
+
contentMedia?: string[]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface Scenario {
|
|
23
|
+
blurs: 'content' | 'media' | 'none'
|
|
24
|
+
severity: 'alert' | 'inform' | 'none'
|
|
25
|
+
account: ScenarioResult
|
|
26
|
+
profile: ScenarioResult
|
|
27
|
+
post: ScenarioResult
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const TESTS: Scenario[] = [
|
|
31
|
+
{
|
|
32
|
+
blurs: 'content',
|
|
33
|
+
severity: 'alert',
|
|
34
|
+
account: {
|
|
35
|
+
profileList: ['filter', 'alert'],
|
|
36
|
+
profileView: ['alert'],
|
|
37
|
+
contentList: ['filter', 'blur'],
|
|
38
|
+
contentView: ['alert'],
|
|
39
|
+
},
|
|
40
|
+
profile: {
|
|
41
|
+
profileList: ['filter'],
|
|
42
|
+
avatar: ['blur'],
|
|
43
|
+
banner: ['blur'],
|
|
44
|
+
displayName: ['blur'],
|
|
45
|
+
contentList: ['filter'],
|
|
46
|
+
},
|
|
47
|
+
post: {
|
|
48
|
+
profileList: ['filter'],
|
|
49
|
+
contentList: ['filter', 'blur'],
|
|
50
|
+
contentView: ['alert'],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
blurs: 'content',
|
|
55
|
+
severity: 'inform',
|
|
56
|
+
account: {
|
|
57
|
+
profileList: ['filter', 'inform'],
|
|
58
|
+
profileView: ['inform'],
|
|
59
|
+
contentList: ['filter', 'blur'],
|
|
60
|
+
contentView: ['inform'],
|
|
61
|
+
},
|
|
62
|
+
profile: {
|
|
63
|
+
profileList: ['filter'],
|
|
64
|
+
avatar: ['blur'],
|
|
65
|
+
banner: ['blur'],
|
|
66
|
+
displayName: ['blur'],
|
|
67
|
+
contentList: ['filter'],
|
|
68
|
+
},
|
|
69
|
+
post: {
|
|
70
|
+
profileList: ['filter'],
|
|
71
|
+
contentList: ['filter', 'blur'],
|
|
72
|
+
contentView: ['inform'],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
blurs: 'content',
|
|
77
|
+
severity: 'none',
|
|
78
|
+
account: {
|
|
79
|
+
profileList: ['filter'],
|
|
80
|
+
profileView: [],
|
|
81
|
+
contentList: ['filter', 'blur'],
|
|
82
|
+
contentView: [],
|
|
83
|
+
},
|
|
84
|
+
profile: {
|
|
85
|
+
profileList: ['filter'],
|
|
86
|
+
avatar: ['blur'],
|
|
87
|
+
banner: ['blur'],
|
|
88
|
+
displayName: ['blur'],
|
|
89
|
+
contentList: ['filter'],
|
|
90
|
+
},
|
|
91
|
+
post: {
|
|
92
|
+
profileList: ['filter'],
|
|
93
|
+
contentList: ['filter', 'blur'],
|
|
94
|
+
contentView: [],
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
{
|
|
99
|
+
blurs: 'media',
|
|
100
|
+
severity: 'alert',
|
|
101
|
+
account: {
|
|
102
|
+
profileList: ['filter', 'alert'],
|
|
103
|
+
profileView: ['alert'],
|
|
104
|
+
avatar: ['blur'],
|
|
105
|
+
banner: ['blur'],
|
|
106
|
+
contentList: ['filter'],
|
|
107
|
+
contentMedia: ['blur'],
|
|
108
|
+
},
|
|
109
|
+
profile: {
|
|
110
|
+
profileList: ['filter'],
|
|
111
|
+
profileView: ['alert'],
|
|
112
|
+
avatar: ['blur'],
|
|
113
|
+
banner: ['blur'],
|
|
114
|
+
contentList: ['filter'],
|
|
115
|
+
},
|
|
116
|
+
post: {
|
|
117
|
+
profileList: ['filter'],
|
|
118
|
+
contentList: ['filter'],
|
|
119
|
+
contentMedia: ['blur'],
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
blurs: 'media',
|
|
124
|
+
severity: 'inform',
|
|
125
|
+
account: {
|
|
126
|
+
profileList: ['filter', 'inform'],
|
|
127
|
+
profileView: ['inform'],
|
|
128
|
+
avatar: ['blur'],
|
|
129
|
+
banner: ['blur'],
|
|
130
|
+
contentList: ['filter'],
|
|
131
|
+
contentMedia: ['blur'],
|
|
132
|
+
},
|
|
133
|
+
profile: {
|
|
134
|
+
profileList: ['filter'],
|
|
135
|
+
profileView: ['inform'],
|
|
136
|
+
avatar: ['blur'],
|
|
137
|
+
banner: ['blur'],
|
|
138
|
+
contentList: ['filter'],
|
|
139
|
+
},
|
|
140
|
+
post: {
|
|
141
|
+
profileList: ['filter'],
|
|
142
|
+
contentList: ['filter'],
|
|
143
|
+
contentMedia: ['blur'],
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
blurs: 'media',
|
|
148
|
+
severity: 'none',
|
|
149
|
+
account: {
|
|
150
|
+
profileList: ['filter'],
|
|
151
|
+
avatar: ['blur'],
|
|
152
|
+
banner: ['blur'],
|
|
153
|
+
contentList: ['filter'],
|
|
154
|
+
contentMedia: ['blur'],
|
|
155
|
+
},
|
|
156
|
+
profile: {
|
|
157
|
+
profileList: ['filter'],
|
|
158
|
+
avatar: ['blur'],
|
|
159
|
+
banner: ['blur'],
|
|
160
|
+
contentList: ['filter'],
|
|
161
|
+
},
|
|
162
|
+
post: {
|
|
163
|
+
profileList: ['filter'],
|
|
164
|
+
contentList: ['filter'],
|
|
165
|
+
contentMedia: ['blur'],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
{
|
|
170
|
+
blurs: 'none',
|
|
171
|
+
severity: 'alert',
|
|
172
|
+
account: {
|
|
173
|
+
profileList: ['filter', 'alert'],
|
|
174
|
+
profileView: ['alert'],
|
|
175
|
+
contentList: ['filter', 'alert'],
|
|
176
|
+
contentView: ['alert'],
|
|
177
|
+
},
|
|
178
|
+
profile: {
|
|
179
|
+
profileList: ['filter'],
|
|
180
|
+
profileView: ['alert'],
|
|
181
|
+
contentList: ['filter'],
|
|
182
|
+
},
|
|
183
|
+
post: {
|
|
184
|
+
profileList: ['filter'],
|
|
185
|
+
contentList: ['filter', 'alert'],
|
|
186
|
+
contentView: ['alert'],
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
blurs: 'none',
|
|
191
|
+
severity: 'inform',
|
|
192
|
+
account: {
|
|
193
|
+
profileList: ['filter', 'inform'],
|
|
194
|
+
profileView: ['inform'],
|
|
195
|
+
contentList: ['filter', 'inform'],
|
|
196
|
+
contentView: ['inform'],
|
|
197
|
+
},
|
|
198
|
+
profile: {
|
|
199
|
+
profileList: ['filter'],
|
|
200
|
+
profileView: ['inform'],
|
|
201
|
+
contentList: ['filter'],
|
|
202
|
+
},
|
|
203
|
+
post: {
|
|
204
|
+
profileList: ['filter'],
|
|
205
|
+
contentList: ['filter', 'inform'],
|
|
206
|
+
contentView: ['inform'],
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
blurs: 'none',
|
|
211
|
+
severity: 'none',
|
|
212
|
+
account: {
|
|
213
|
+
profileList: ['filter'],
|
|
214
|
+
contentList: ['filter'],
|
|
215
|
+
},
|
|
216
|
+
profile: {
|
|
217
|
+
profileList: ['filter'],
|
|
218
|
+
contentList: ['filter'],
|
|
219
|
+
},
|
|
220
|
+
post: {
|
|
221
|
+
profileList: ['filter'],
|
|
222
|
+
contentList: ['filter'],
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
]
|
|
226
|
+
|
|
227
|
+
describe('Moderation: custom labels', () => {
|
|
228
|
+
const scenarios = TESTS.flatMap((test) => [
|
|
229
|
+
{
|
|
230
|
+
blurs: test.blurs,
|
|
231
|
+
severity: test.severity,
|
|
232
|
+
target: 'post',
|
|
233
|
+
expected: test.post,
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
blurs: test.blurs,
|
|
237
|
+
severity: test.severity,
|
|
238
|
+
target: 'profile',
|
|
239
|
+
expected: test.profile,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
blurs: test.blurs,
|
|
243
|
+
severity: test.severity,
|
|
244
|
+
target: 'account',
|
|
245
|
+
expected: test.account,
|
|
246
|
+
},
|
|
247
|
+
])
|
|
248
|
+
it.each(scenarios)(
|
|
249
|
+
'blurs=$blurs, severity=$severity, target=$target',
|
|
250
|
+
({ blurs, severity, target, expected }) => {
|
|
251
|
+
let res
|
|
252
|
+
if (target === 'post') {
|
|
253
|
+
res = moderatePost(
|
|
254
|
+
mock.postView({
|
|
255
|
+
record: {
|
|
256
|
+
text: 'Hello',
|
|
257
|
+
createdAt: new Date().toISOString(),
|
|
258
|
+
},
|
|
259
|
+
author: mock.profileViewBasic({
|
|
260
|
+
handle: 'bob.test',
|
|
261
|
+
displayName: 'Bob',
|
|
262
|
+
}),
|
|
263
|
+
labels: [
|
|
264
|
+
mock.label({
|
|
265
|
+
val: 'custom',
|
|
266
|
+
uri: 'at://did:web:bob.test/app.bsky.feed.post/fake',
|
|
267
|
+
src: 'did:web:labeler.test',
|
|
268
|
+
}),
|
|
269
|
+
],
|
|
270
|
+
}),
|
|
271
|
+
modOpts(blurs, severity),
|
|
272
|
+
)
|
|
273
|
+
} else if (target === 'profile') {
|
|
274
|
+
res = moderateProfile(
|
|
275
|
+
mock.profileViewBasic({
|
|
276
|
+
handle: 'bob.test',
|
|
277
|
+
displayName: 'Bob',
|
|
278
|
+
labels: [
|
|
279
|
+
mock.label({
|
|
280
|
+
val: 'custom',
|
|
281
|
+
uri: 'at://did:web:bob.test/app.bsky.actor.profile/self',
|
|
282
|
+
src: 'did:web:labeler.test',
|
|
283
|
+
}),
|
|
284
|
+
],
|
|
285
|
+
}),
|
|
286
|
+
modOpts(blurs, severity),
|
|
287
|
+
)
|
|
288
|
+
} else {
|
|
289
|
+
res = moderateProfile(
|
|
290
|
+
mock.profileViewBasic({
|
|
291
|
+
handle: 'bob.test',
|
|
292
|
+
displayName: 'Bob',
|
|
293
|
+
labels: [
|
|
294
|
+
mock.label({
|
|
295
|
+
val: 'custom',
|
|
296
|
+
uri: 'did:web:bob.test',
|
|
297
|
+
src: 'did:web:labeler.test',
|
|
298
|
+
}),
|
|
299
|
+
],
|
|
300
|
+
}),
|
|
301
|
+
modOpts(blurs, severity),
|
|
302
|
+
)
|
|
303
|
+
expect(res.ui('profileList')).toBeModerationResult(
|
|
304
|
+
expected.profileList || [],
|
|
305
|
+
)
|
|
306
|
+
expect(res.ui('profileView')).toBeModerationResult(
|
|
307
|
+
expected.profileView || [],
|
|
308
|
+
)
|
|
309
|
+
expect(res.ui('avatar')).toBeModerationResult(expected.avatar || [])
|
|
310
|
+
expect(res.ui('banner')).toBeModerationResult(expected.banner || [])
|
|
311
|
+
expect(res.ui('displayName')).toBeModerationResult(
|
|
312
|
+
expected.displayName || [],
|
|
313
|
+
)
|
|
314
|
+
expect(res.ui('contentList')).toBeModerationResult(
|
|
315
|
+
expected.contentList || [],
|
|
316
|
+
)
|
|
317
|
+
expect(res.ui('contentView')).toBeModerationResult(
|
|
318
|
+
expected.contentView || [],
|
|
319
|
+
)
|
|
320
|
+
expect(res.ui('contentMedia')).toBeModerationResult(
|
|
321
|
+
expected.contentMedia || [],
|
|
322
|
+
)
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
)
|
|
326
|
+
})
|
|
327
|
+
|
|
328
|
+
function modOpts(blurs: string, severity: string): ModerationOpts {
|
|
329
|
+
return {
|
|
330
|
+
userDid: 'did:web:alice.test',
|
|
331
|
+
prefs: {
|
|
332
|
+
adultContentEnabled: true,
|
|
333
|
+
labels: {},
|
|
334
|
+
mods: [
|
|
335
|
+
{
|
|
336
|
+
did: 'did:web:labeler.test',
|
|
337
|
+
labels: { custom: 'hide' },
|
|
338
|
+
},
|
|
339
|
+
],
|
|
340
|
+
},
|
|
341
|
+
labelDefs: {
|
|
342
|
+
'did:web:labeler.test': [makeCustomLabel(blurs, severity)],
|
|
343
|
+
},
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
function makeCustomLabel(
|
|
348
|
+
blurs: string,
|
|
349
|
+
severity: string,
|
|
350
|
+
): InterprettedLabelValueDefinition {
|
|
351
|
+
return interpretLabelValueDefinition({
|
|
352
|
+
identifier: 'custom',
|
|
353
|
+
blurs,
|
|
354
|
+
severity,
|
|
355
|
+
defaultSetting: 'warn',
|
|
356
|
+
locales: [],
|
|
357
|
+
})
|
|
358
|
+
}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { TestNetworkNoAppView } from '@atproto/dev-env'
|
|
2
|
+
import { BskyAgent, BSKY_MODSERVICE_DID, DEFAULT_LABEL_SETTINGS } from '..'
|
|
3
|
+
import './util/moderation-behavior'
|
|
4
|
+
|
|
5
|
+
describe('agent', () => {
|
|
6
|
+
let network: TestNetworkNoAppView
|
|
7
|
+
|
|
8
|
+
beforeAll(async () => {
|
|
9
|
+
network = await TestNetworkNoAppView.create({
|
|
10
|
+
dbPostgresSchema: 'bsky_agent',
|
|
11
|
+
})
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
afterAll(async () => {
|
|
15
|
+
await network.close()
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
it('migrates legacy content-label prefs (no mutations)', async () => {
|
|
19
|
+
const agent = new BskyAgent({ service: network.pds.url })
|
|
20
|
+
|
|
21
|
+
await agent.createAccount({
|
|
22
|
+
handle: 'user1.test',
|
|
23
|
+
email: 'user1@test.com',
|
|
24
|
+
password: 'password',
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
await agent.app.bsky.actor.putPreferences({
|
|
28
|
+
preferences: [
|
|
29
|
+
{
|
|
30
|
+
$type: 'app.bsky.actor.defs#contentLabelPref',
|
|
31
|
+
label: 'nsfw',
|
|
32
|
+
visibility: 'show',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
$type: 'app.bsky.actor.defs#contentLabelPref',
|
|
36
|
+
label: 'nudity',
|
|
37
|
+
visibility: 'show',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
$type: 'app.bsky.actor.defs#contentLabelPref',
|
|
41
|
+
label: 'suggestive',
|
|
42
|
+
visibility: 'show',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
$type: 'app.bsky.actor.defs#contentLabelPref',
|
|
46
|
+
label: 'gore',
|
|
47
|
+
visibility: 'show',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
})
|
|
51
|
+
await expect(agent.getPreferences()).resolves.toStrictEqual({
|
|
52
|
+
feeds: {
|
|
53
|
+
pinned: undefined,
|
|
54
|
+
saved: undefined,
|
|
55
|
+
},
|
|
56
|
+
hiddenPosts: [],
|
|
57
|
+
interests: { tags: [] },
|
|
58
|
+
moderationPrefs: {
|
|
59
|
+
adultContentEnabled: false,
|
|
60
|
+
labels: {
|
|
61
|
+
porn: 'ignore',
|
|
62
|
+
nudity: 'ignore',
|
|
63
|
+
sexual: 'ignore',
|
|
64
|
+
gore: 'ignore',
|
|
65
|
+
},
|
|
66
|
+
mods: [
|
|
67
|
+
{
|
|
68
|
+
did: BSKY_MODSERVICE_DID,
|
|
69
|
+
labels: {},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
birthDate: undefined,
|
|
74
|
+
feedViewPrefs: {
|
|
75
|
+
home: {
|
|
76
|
+
hideQuotePosts: false,
|
|
77
|
+
hideReplies: false,
|
|
78
|
+
hideRepliesByLikeCount: 0,
|
|
79
|
+
hideRepliesByUnfollowed: true,
|
|
80
|
+
hideReposts: false,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
mutedWords: [],
|
|
84
|
+
threadViewPrefs: {
|
|
85
|
+
prioritizeFollowedUsers: true,
|
|
86
|
+
sort: 'oldest',
|
|
87
|
+
},
|
|
88
|
+
})
|
|
89
|
+
expect(agent.labelersHeader).toStrictEqual([BSKY_MODSERVICE_DID])
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
it('adds/removes moderation services', async () => {
|
|
93
|
+
const agent = new BskyAgent({ service: network.pds.url })
|
|
94
|
+
|
|
95
|
+
await agent.createAccount({
|
|
96
|
+
handle: 'user5.test',
|
|
97
|
+
email: 'user5@test.com',
|
|
98
|
+
password: 'password',
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
await agent.addModService('did:plc:other')
|
|
102
|
+
expect(agent.labelersHeader).toStrictEqual([
|
|
103
|
+
BSKY_MODSERVICE_DID,
|
|
104
|
+
'did:plc:other',
|
|
105
|
+
])
|
|
106
|
+
await expect(agent.getPreferences()).resolves.toStrictEqual({
|
|
107
|
+
feeds: { pinned: undefined, saved: undefined },
|
|
108
|
+
hiddenPosts: [],
|
|
109
|
+
interests: { tags: [] },
|
|
110
|
+
moderationPrefs: {
|
|
111
|
+
adultContentEnabled: false,
|
|
112
|
+
labels: DEFAULT_LABEL_SETTINGS,
|
|
113
|
+
mods: [
|
|
114
|
+
{
|
|
115
|
+
did: BSKY_MODSERVICE_DID,
|
|
116
|
+
labels: {},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
did: 'did:plc:other',
|
|
120
|
+
labels: {},
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
birthDate: undefined,
|
|
125
|
+
feedViewPrefs: {
|
|
126
|
+
home: {
|
|
127
|
+
hideReplies: false,
|
|
128
|
+
hideRepliesByUnfollowed: true,
|
|
129
|
+
hideRepliesByLikeCount: 0,
|
|
130
|
+
hideReposts: false,
|
|
131
|
+
hideQuotePosts: false,
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
mutedWords: [],
|
|
135
|
+
threadViewPrefs: {
|
|
136
|
+
sort: 'oldest',
|
|
137
|
+
prioritizeFollowedUsers: true,
|
|
138
|
+
},
|
|
139
|
+
})
|
|
140
|
+
expect(agent.labelersHeader).toStrictEqual([
|
|
141
|
+
BSKY_MODSERVICE_DID,
|
|
142
|
+
'did:plc:other',
|
|
143
|
+
])
|
|
144
|
+
|
|
145
|
+
await agent.removeModService('did:plc:other')
|
|
146
|
+
expect(agent.labelersHeader).toStrictEqual([BSKY_MODSERVICE_DID])
|
|
147
|
+
await expect(agent.getPreferences()).resolves.toStrictEqual({
|
|
148
|
+
feeds: { pinned: undefined, saved: undefined },
|
|
149
|
+
hiddenPosts: [],
|
|
150
|
+
interests: { tags: [] },
|
|
151
|
+
moderationPrefs: {
|
|
152
|
+
adultContentEnabled: false,
|
|
153
|
+
labels: DEFAULT_LABEL_SETTINGS,
|
|
154
|
+
mods: [
|
|
155
|
+
{
|
|
156
|
+
did: BSKY_MODSERVICE_DID,
|
|
157
|
+
labels: {},
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
birthDate: undefined,
|
|
162
|
+
feedViewPrefs: {
|
|
163
|
+
home: {
|
|
164
|
+
hideReplies: false,
|
|
165
|
+
hideRepliesByUnfollowed: true,
|
|
166
|
+
hideRepliesByLikeCount: 0,
|
|
167
|
+
hideReposts: false,
|
|
168
|
+
hideQuotePosts: false,
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
mutedWords: [],
|
|
172
|
+
threadViewPrefs: {
|
|
173
|
+
sort: 'oldest',
|
|
174
|
+
prioritizeFollowedUsers: true,
|
|
175
|
+
},
|
|
176
|
+
})
|
|
177
|
+
expect(agent.labelersHeader).toStrictEqual([BSKY_MODSERVICE_DID])
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
it('cant remove the default moderation service', async () => {
|
|
181
|
+
const agent = new BskyAgent({ service: network.pds.url })
|
|
182
|
+
|
|
183
|
+
await agent.createAccount({
|
|
184
|
+
handle: 'user6.test',
|
|
185
|
+
email: 'user6@test.com',
|
|
186
|
+
password: 'password',
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
await agent.removeModService(BSKY_MODSERVICE_DID)
|
|
190
|
+
expect(agent.labelersHeader).toStrictEqual([BSKY_MODSERVICE_DID])
|
|
191
|
+
await expect(agent.getPreferences()).resolves.toStrictEqual({
|
|
192
|
+
feeds: { pinned: undefined, saved: undefined },
|
|
193
|
+
hiddenPosts: [],
|
|
194
|
+
interests: { tags: [] },
|
|
195
|
+
moderationPrefs: {
|
|
196
|
+
adultContentEnabled: false,
|
|
197
|
+
labels: DEFAULT_LABEL_SETTINGS,
|
|
198
|
+
mods: [
|
|
199
|
+
{
|
|
200
|
+
did: BSKY_MODSERVICE_DID,
|
|
201
|
+
labels: {},
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
birthDate: undefined,
|
|
206
|
+
feedViewPrefs: {
|
|
207
|
+
home: {
|
|
208
|
+
hideReplies: false,
|
|
209
|
+
hideRepliesByUnfollowed: true,
|
|
210
|
+
hideRepliesByLikeCount: 0,
|
|
211
|
+
hideReposts: false,
|
|
212
|
+
hideQuotePosts: false,
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
mutedWords: [],
|
|
216
|
+
threadViewPrefs: {
|
|
217
|
+
sort: 'oldest',
|
|
218
|
+
prioritizeFollowedUsers: true,
|
|
219
|
+
},
|
|
220
|
+
})
|
|
221
|
+
expect(agent.labelersHeader).toStrictEqual([BSKY_MODSERVICE_DID])
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
it('sets label preferences globally and per-moderator', async () => {
|
|
225
|
+
const agent = new BskyAgent({ service: network.pds.url })
|
|
226
|
+
|
|
227
|
+
await agent.createAccount({
|
|
228
|
+
handle: 'user7.test',
|
|
229
|
+
email: 'user7@test.com',
|
|
230
|
+
password: 'password',
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
await agent.addModService('did:plc:other')
|
|
234
|
+
await agent.setContentLabelPref('porn', 'ignore')
|
|
235
|
+
await agent.setContentLabelPref('porn', 'hide', 'did:plc:other')
|
|
236
|
+
await agent.setContentLabelPref('x-custom', 'warn', 'did:plc:other')
|
|
237
|
+
|
|
238
|
+
await expect(agent.getPreferences()).resolves.toStrictEqual({
|
|
239
|
+
feeds: { pinned: undefined, saved: undefined },
|
|
240
|
+
hiddenPosts: [],
|
|
241
|
+
interests: { tags: [] },
|
|
242
|
+
moderationPrefs: {
|
|
243
|
+
adultContentEnabled: false,
|
|
244
|
+
labels: { ...DEFAULT_LABEL_SETTINGS, porn: 'ignore' },
|
|
245
|
+
mods: [
|
|
246
|
+
{
|
|
247
|
+
did: BSKY_MODSERVICE_DID,
|
|
248
|
+
labels: {},
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
did: 'did:plc:other',
|
|
252
|
+
labels: {
|
|
253
|
+
porn: 'hide',
|
|
254
|
+
'x-custom': 'warn',
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
},
|
|
259
|
+
birthDate: undefined,
|
|
260
|
+
feedViewPrefs: {
|
|
261
|
+
home: {
|
|
262
|
+
hideReplies: false,
|
|
263
|
+
hideRepliesByUnfollowed: true,
|
|
264
|
+
hideRepliesByLikeCount: 0,
|
|
265
|
+
hideReposts: false,
|
|
266
|
+
hideQuotePosts: false,
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
mutedWords: [],
|
|
270
|
+
threadViewPrefs: {
|
|
271
|
+
sort: 'oldest',
|
|
272
|
+
prioritizeFollowedUsers: true,
|
|
273
|
+
},
|
|
274
|
+
})
|
|
275
|
+
})
|
|
276
|
+
})
|