@atproto/api 0.11.0-next → 0.11.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/CHANGELOG.md +23 -0
- package/README.md +41 -58
- package/definitions/labels.json +3 -60
- package/dist/agent.d.ts +11 -5
- package/dist/bsky-agent.d.ts +5 -3
- package/dist/client/lexicons.d.ts +34 -3
- package/dist/client/types/app/bsky/actor/defs.d.ts +7 -7
- package/dist/client/types/app/bsky/feed/defs.d.ts +1 -0
- package/dist/client/types/app/bsky/graph/defs.d.ts +3 -0
- package/dist/client/types/com/atproto/label/defs.d.ts +2 -0
- package/dist/const.d.ts +1 -1
- package/dist/index.js +581 -204
- package/dist/index.js.map +3 -3
- package/dist/mocker.d.ts +2 -1
- package/dist/moderation/const/labels.d.ts +3 -3
- package/dist/moderation/decision.d.ts +2 -0
- package/dist/moderation/index.d.ts +1 -0
- package/dist/moderation/mutewords.d.ts +8 -0
- package/dist/moderation/subjects/feed-generator.d.ts +1 -1
- package/dist/moderation/subjects/user-list.d.ts +1 -1
- package/dist/moderation/types.d.ts +22 -6
- package/dist/moderation/util.d.ts +3 -3
- package/dist/types.d.ts +3 -4
- package/docs/moderation.md +204 -95
- package/package.json +9 -9
- package/scripts/code/labels.mjs +2 -2
- package/src/agent.ts +61 -16
- package/src/bsky-agent.ts +190 -71
- package/src/client/lexicons.ts +37 -5
- package/src/client/types/app/bsky/actor/defs.ts +11 -11
- package/src/client/types/app/bsky/feed/defs.ts +1 -0
- package/src/client/types/app/bsky/graph/defs.ts +3 -0
- package/src/client/types/com/atproto/label/defs.ts +4 -0
- package/src/const.ts +1 -1
- package/src/mocker.ts +4 -0
- package/src/moderation/const/labels.ts +9 -72
- package/src/moderation/decision.ts +82 -36
- package/src/moderation/index.ts +5 -24
- package/src/moderation/mutewords.ts +125 -0
- package/src/moderation/subjects/feed-generator.ts +18 -4
- package/src/moderation/subjects/notification.ts +7 -1
- package/src/moderation/subjects/post.ts +260 -1
- package/src/moderation/subjects/user-list.ts +38 -4
- package/src/moderation/types.ts +51 -12
- package/src/moderation/util.ts +33 -16
- package/src/types.ts +7 -3
- package/tests/agent.test.ts +71 -5
- package/tests/bsky-agent.test.ts +150 -217
- package/tests/moderation-behaviors.test.ts +5 -60
- package/tests/moderation-custom-labels.test.ts +46 -71
- package/tests/moderation-mutewords.test.ts +691 -0
- package/tests/moderation-prefs.test.ts +157 -92
- package/tests/moderation-quoteposts.test.ts +277 -0
- package/tests/moderation.test.ts +302 -38
- package/tests/util/moderation-behavior.ts +3 -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/getBookmarkedFeeds.d.ts +0 -21
- package/dist/client/types/app/bsky/feed/getSavedFeeds.d.ts +0 -21
- package/dist/client/types/app/bsky/feed/getVotes.d.ts +0 -36
- package/dist/client/types/app/bsky/feed/saveFeed.d.ts +0 -17
- 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/unsaveFeed.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/moderation/defs.d.ts +0 -41
- package/dist/client/types/app/bsky/moderation/getService.d.ts +0 -16
- package/dist/client/types/app/bsky/moderation/getServices.d.ts +0 -23
- package/dist/client/types/app/bsky/moderation/service.d.ts +0 -14
- 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/app/bsky/unspecced/applyLabels.d.ts +0 -18
- package/dist/client/types/app/bsky/unspecced/getPopular.d.ts +0 -22
- package/dist/client/types/app/bsky/unspecced/getTimelineSkeleton.d.ts +0 -24
- 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/createCommunicationTemplate.d.ts +0 -23
- package/dist/client/types/com/atproto/admin/deleteCommunicationTemplate.d.ts +0 -17
- package/dist/client/types/com/atproto/admin/emitModerationEvent.d.ts +0 -33
- package/dist/client/types/com/atproto/admin/getInviteCodeUsage.d.ts +0 -29
- package/dist/client/types/com/atproto/admin/getModerationAction.d.ts +0 -16
- package/dist/client/types/com/atproto/admin/getModerationActions.d.ts +0 -22
- package/dist/client/types/com/atproto/admin/getModerationEvent.d.ts +0 -16
- package/dist/client/types/com/atproto/admin/getModerationReport.d.ts +0 -16
- package/dist/client/types/com/atproto/admin/getModerationReports.d.ts +0 -28
- package/dist/client/types/com/atproto/admin/getRecord.d.ts +0 -20
- package/dist/client/types/com/atproto/admin/getRepo.d.ts +0 -19
- package/dist/client/types/com/atproto/admin/getSubjectState.d.ts +0 -26
- package/dist/client/types/com/atproto/admin/getUserAccountInfo.d.ts +0 -16
- package/dist/client/types/com/atproto/admin/listCommunicationTemplates.d.ts +0 -18
- 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/queryModerationEvents.d.ts +0 -35
- package/dist/client/types/com/atproto/admin/queryModerationStatuses.d.ts +0 -37
- package/dist/client/types/com/atproto/admin/rebaseRepo.d.ts +0 -24
- 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/admin/resolveModerationReports.d.ts +0 -22
- package/dist/client/types/com/atproto/admin/reverseModerationAction.d.ts +0 -22
- package/dist/client/types/com/atproto/admin/searchRepos.d.ts +0 -23
- package/dist/client/types/com/atproto/admin/takeModerationAction.d.ts +0 -34
- package/dist/client/types/com/atproto/admin/updateCommunicationTemplate.d.ts +0 -25
- package/dist/client/types/com/atproto/admin/updateSubjectState.d.ts +0 -32
- 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/rebaseRepo.d.ts +0 -24
- 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/getCommitPath.d.ts +0 -20
- package/dist/client/types/com/atproto/sync/getCurrent.d.ts +0 -22
- package/dist/client/types/com/atproto/sync/getRoot.d.ts +0 -21
- package/dist/client/types/com/atproto/sync/importRepo.d.ts +0 -16
- 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/client/types/com/atproto/temp/importRepo.d.ts +0 -16
- package/dist/client/types/com/atproto/temp/pushBlob.d.ts +0 -15
- package/dist/client/types/com/atproto/temp/transferAccount.d.ts +0 -48
- package/dist/client/types/com/atproto/temp/upgradeRepoVersion.d.ts +0 -18
- package/dist/moderation/accumulator.d.ts +0 -16
- package/dist/moderation/const/label-groups.d.ts +0 -2
- package/dist/moderation/subjects/quoted-post.d.ts +0 -6
- 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/docs/labels.md +0 -108
- package/scripts/docs/labels.mjs +0 -87
- package/scripts/generate-docs.mjs +0 -3
package/tests/bsky-agent.test.ts
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
BskyAgent,
|
|
4
4
|
ComAtprotoRepoPutRecord,
|
|
5
5
|
AppBskyActorProfile,
|
|
6
|
-
BSKY_MODSERVICE_DID,
|
|
7
6
|
DEFAULT_LABEL_SETTINGS,
|
|
8
7
|
} from '..'
|
|
9
8
|
|
|
@@ -34,6 +33,13 @@ describe('agent', () => {
|
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
|
|
36
|
+
it('clones correctly', () => {
|
|
37
|
+
const agent = new BskyAgent({ service: network.pds.url })
|
|
38
|
+
const agent2 = agent.clone()
|
|
39
|
+
expect(agent2 instanceof BskyAgent).toBeTruthy()
|
|
40
|
+
expect(agent.service).toEqual(agent2.service)
|
|
41
|
+
})
|
|
42
|
+
|
|
37
43
|
it('upsertProfile correctly creates and updates profiles.', async () => {
|
|
38
44
|
const agent = new BskyAgent({ service: network.pds.url })
|
|
39
45
|
|
|
@@ -224,17 +230,19 @@ describe('agent', () => {
|
|
|
224
230
|
password: 'password',
|
|
225
231
|
})
|
|
226
232
|
|
|
233
|
+
const DEFAULT_LABELERS = BskyAgent.appLabelers.map((did) => ({
|
|
234
|
+
did,
|
|
235
|
+
labels: {},
|
|
236
|
+
}))
|
|
237
|
+
|
|
227
238
|
await expect(agent.getPreferences()).resolves.toStrictEqual({
|
|
228
239
|
feeds: { pinned: undefined, saved: undefined },
|
|
229
240
|
moderationPrefs: {
|
|
230
241
|
adultContentEnabled: false,
|
|
231
242
|
labels: DEFAULT_LABEL_SETTINGS,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
labels: {},
|
|
236
|
-
},
|
|
237
|
-
],
|
|
243
|
+
labelers: DEFAULT_LABELERS,
|
|
244
|
+
mutedWords: [],
|
|
245
|
+
hiddenPosts: [],
|
|
238
246
|
},
|
|
239
247
|
birthDate: undefined,
|
|
240
248
|
feedViewPrefs: {
|
|
@@ -253,8 +261,6 @@ describe('agent', () => {
|
|
|
253
261
|
interests: {
|
|
254
262
|
tags: [],
|
|
255
263
|
},
|
|
256
|
-
mutedWords: [],
|
|
257
|
-
hiddenPosts: [],
|
|
258
264
|
})
|
|
259
265
|
|
|
260
266
|
await agent.setAdultContentEnabled(true)
|
|
@@ -263,12 +269,9 @@ describe('agent', () => {
|
|
|
263
269
|
moderationPrefs: {
|
|
264
270
|
adultContentEnabled: true,
|
|
265
271
|
labels: DEFAULT_LABEL_SETTINGS,
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
labels: {},
|
|
270
|
-
},
|
|
271
|
-
],
|
|
272
|
+
labelers: DEFAULT_LABELERS,
|
|
273
|
+
mutedWords: [],
|
|
274
|
+
hiddenPosts: [],
|
|
272
275
|
},
|
|
273
276
|
birthDate: undefined,
|
|
274
277
|
feedViewPrefs: {
|
|
@@ -287,8 +290,6 @@ describe('agent', () => {
|
|
|
287
290
|
interests: {
|
|
288
291
|
tags: [],
|
|
289
292
|
},
|
|
290
|
-
mutedWords: [],
|
|
291
|
-
hiddenPosts: [],
|
|
292
293
|
})
|
|
293
294
|
|
|
294
295
|
await agent.setAdultContentEnabled(false)
|
|
@@ -297,12 +298,9 @@ describe('agent', () => {
|
|
|
297
298
|
moderationPrefs: {
|
|
298
299
|
adultContentEnabled: false,
|
|
299
300
|
labels: DEFAULT_LABEL_SETTINGS,
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
labels: {},
|
|
304
|
-
},
|
|
305
|
-
],
|
|
301
|
+
labelers: DEFAULT_LABELERS,
|
|
302
|
+
mutedWords: [],
|
|
303
|
+
hiddenPosts: [],
|
|
306
304
|
},
|
|
307
305
|
birthDate: undefined,
|
|
308
306
|
feedViewPrefs: {
|
|
@@ -321,8 +319,6 @@ describe('agent', () => {
|
|
|
321
319
|
interests: {
|
|
322
320
|
tags: [],
|
|
323
321
|
},
|
|
324
|
-
mutedWords: [],
|
|
325
|
-
hiddenPosts: [],
|
|
326
322
|
})
|
|
327
323
|
|
|
328
324
|
await agent.setContentLabelPref('misinfo', 'hide')
|
|
@@ -331,12 +327,9 @@ describe('agent', () => {
|
|
|
331
327
|
moderationPrefs: {
|
|
332
328
|
adultContentEnabled: false,
|
|
333
329
|
labels: { ...DEFAULT_LABEL_SETTINGS, misinfo: 'hide' },
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
labels: {},
|
|
338
|
-
},
|
|
339
|
-
],
|
|
330
|
+
labelers: DEFAULT_LABELERS,
|
|
331
|
+
mutedWords: [],
|
|
332
|
+
hiddenPosts: [],
|
|
340
333
|
},
|
|
341
334
|
birthDate: undefined,
|
|
342
335
|
feedViewPrefs: {
|
|
@@ -355,8 +348,6 @@ describe('agent', () => {
|
|
|
355
348
|
interests: {
|
|
356
349
|
tags: [],
|
|
357
350
|
},
|
|
358
|
-
mutedWords: [],
|
|
359
|
-
hiddenPosts: [],
|
|
360
351
|
})
|
|
361
352
|
|
|
362
353
|
await agent.setContentLabelPref('spam', 'ignore')
|
|
@@ -369,12 +360,9 @@ describe('agent', () => {
|
|
|
369
360
|
misinfo: 'hide',
|
|
370
361
|
spam: 'ignore',
|
|
371
362
|
},
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
labels: {},
|
|
376
|
-
},
|
|
377
|
-
],
|
|
363
|
+
labelers: DEFAULT_LABELERS,
|
|
364
|
+
mutedWords: [],
|
|
365
|
+
hiddenPosts: [],
|
|
378
366
|
},
|
|
379
367
|
birthDate: undefined,
|
|
380
368
|
feedViewPrefs: {
|
|
@@ -393,8 +381,6 @@ describe('agent', () => {
|
|
|
393
381
|
interests: {
|
|
394
382
|
tags: [],
|
|
395
383
|
},
|
|
396
|
-
mutedWords: [],
|
|
397
|
-
hiddenPosts: [],
|
|
398
384
|
})
|
|
399
385
|
|
|
400
386
|
await agent.addSavedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -410,12 +396,9 @@ describe('agent', () => {
|
|
|
410
396
|
misinfo: 'hide',
|
|
411
397
|
spam: 'ignore',
|
|
412
398
|
},
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
labels: {},
|
|
417
|
-
},
|
|
418
|
-
],
|
|
399
|
+
labelers: DEFAULT_LABELERS,
|
|
400
|
+
mutedWords: [],
|
|
401
|
+
hiddenPosts: [],
|
|
419
402
|
},
|
|
420
403
|
birthDate: undefined,
|
|
421
404
|
feedViewPrefs: {
|
|
@@ -434,8 +417,6 @@ describe('agent', () => {
|
|
|
434
417
|
interests: {
|
|
435
418
|
tags: [],
|
|
436
419
|
},
|
|
437
|
-
mutedWords: [],
|
|
438
|
-
hiddenPosts: [],
|
|
439
420
|
})
|
|
440
421
|
|
|
441
422
|
await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -451,12 +432,9 @@ describe('agent', () => {
|
|
|
451
432
|
misinfo: 'hide',
|
|
452
433
|
spam: 'ignore',
|
|
453
434
|
},
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
labels: {},
|
|
458
|
-
},
|
|
459
|
-
],
|
|
435
|
+
labelers: DEFAULT_LABELERS,
|
|
436
|
+
mutedWords: [],
|
|
437
|
+
hiddenPosts: [],
|
|
460
438
|
},
|
|
461
439
|
birthDate: undefined,
|
|
462
440
|
feedViewPrefs: {
|
|
@@ -475,8 +453,6 @@ describe('agent', () => {
|
|
|
475
453
|
interests: {
|
|
476
454
|
tags: [],
|
|
477
455
|
},
|
|
478
|
-
mutedWords: [],
|
|
479
|
-
hiddenPosts: [],
|
|
480
456
|
})
|
|
481
457
|
|
|
482
458
|
await agent.removePinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -492,12 +468,9 @@ describe('agent', () => {
|
|
|
492
468
|
misinfo: 'hide',
|
|
493
469
|
spam: 'ignore',
|
|
494
470
|
},
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
labels: {},
|
|
499
|
-
},
|
|
500
|
-
],
|
|
471
|
+
labelers: DEFAULT_LABELERS,
|
|
472
|
+
mutedWords: [],
|
|
473
|
+
hiddenPosts: [],
|
|
501
474
|
},
|
|
502
475
|
birthDate: undefined,
|
|
503
476
|
feedViewPrefs: {
|
|
@@ -516,8 +489,6 @@ describe('agent', () => {
|
|
|
516
489
|
interests: {
|
|
517
490
|
tags: [],
|
|
518
491
|
},
|
|
519
|
-
mutedWords: [],
|
|
520
|
-
hiddenPosts: [],
|
|
521
492
|
})
|
|
522
493
|
|
|
523
494
|
await agent.removeSavedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -533,12 +504,9 @@ describe('agent', () => {
|
|
|
533
504
|
misinfo: 'hide',
|
|
534
505
|
spam: 'ignore',
|
|
535
506
|
},
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
labels: {},
|
|
540
|
-
},
|
|
541
|
-
],
|
|
507
|
+
labelers: DEFAULT_LABELERS,
|
|
508
|
+
mutedWords: [],
|
|
509
|
+
hiddenPosts: [],
|
|
542
510
|
},
|
|
543
511
|
birthDate: undefined,
|
|
544
512
|
feedViewPrefs: {
|
|
@@ -557,8 +525,6 @@ describe('agent', () => {
|
|
|
557
525
|
interests: {
|
|
558
526
|
tags: [],
|
|
559
527
|
},
|
|
560
|
-
mutedWords: [],
|
|
561
|
-
hiddenPosts: [],
|
|
562
528
|
})
|
|
563
529
|
|
|
564
530
|
await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -574,12 +540,9 @@ describe('agent', () => {
|
|
|
574
540
|
misinfo: 'hide',
|
|
575
541
|
spam: 'ignore',
|
|
576
542
|
},
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
labels: {},
|
|
581
|
-
},
|
|
582
|
-
],
|
|
543
|
+
labelers: DEFAULT_LABELERS,
|
|
544
|
+
mutedWords: [],
|
|
545
|
+
hiddenPosts: [],
|
|
583
546
|
},
|
|
584
547
|
birthDate: undefined,
|
|
585
548
|
feedViewPrefs: {
|
|
@@ -598,8 +561,6 @@ describe('agent', () => {
|
|
|
598
561
|
interests: {
|
|
599
562
|
tags: [],
|
|
600
563
|
},
|
|
601
|
-
mutedWords: [],
|
|
602
|
-
hiddenPosts: [],
|
|
603
564
|
})
|
|
604
565
|
|
|
605
566
|
await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake2')
|
|
@@ -621,12 +582,9 @@ describe('agent', () => {
|
|
|
621
582
|
misinfo: 'hide',
|
|
622
583
|
spam: 'ignore',
|
|
623
584
|
},
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
labels: {},
|
|
628
|
-
},
|
|
629
|
-
],
|
|
585
|
+
labelers: DEFAULT_LABELERS,
|
|
586
|
+
mutedWords: [],
|
|
587
|
+
hiddenPosts: [],
|
|
630
588
|
},
|
|
631
589
|
birthDate: undefined,
|
|
632
590
|
feedViewPrefs: {
|
|
@@ -645,8 +603,6 @@ describe('agent', () => {
|
|
|
645
603
|
interests: {
|
|
646
604
|
tags: [],
|
|
647
605
|
},
|
|
648
|
-
mutedWords: [],
|
|
649
|
-
hiddenPosts: [],
|
|
650
606
|
})
|
|
651
607
|
|
|
652
608
|
await agent.removeSavedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -662,12 +618,9 @@ describe('agent', () => {
|
|
|
662
618
|
misinfo: 'hide',
|
|
663
619
|
spam: 'ignore',
|
|
664
620
|
},
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
labels: {},
|
|
669
|
-
},
|
|
670
|
-
],
|
|
621
|
+
labelers: DEFAULT_LABELERS,
|
|
622
|
+
mutedWords: [],
|
|
623
|
+
hiddenPosts: [],
|
|
671
624
|
},
|
|
672
625
|
birthDate: undefined,
|
|
673
626
|
feedViewPrefs: {
|
|
@@ -686,8 +639,6 @@ describe('agent', () => {
|
|
|
686
639
|
interests: {
|
|
687
640
|
tags: [],
|
|
688
641
|
},
|
|
689
|
-
mutedWords: [],
|
|
690
|
-
hiddenPosts: [],
|
|
691
642
|
})
|
|
692
643
|
|
|
693
644
|
await agent.setPersonalDetails({ birthDate: '2023-09-11T18:05:42.556Z' })
|
|
@@ -703,12 +654,9 @@ describe('agent', () => {
|
|
|
703
654
|
misinfo: 'hide',
|
|
704
655
|
spam: 'ignore',
|
|
705
656
|
},
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
labels: {},
|
|
710
|
-
},
|
|
711
|
-
],
|
|
657
|
+
labelers: DEFAULT_LABELERS,
|
|
658
|
+
mutedWords: [],
|
|
659
|
+
hiddenPosts: [],
|
|
712
660
|
},
|
|
713
661
|
birthDate: new Date('2023-09-11T18:05:42.556Z'),
|
|
714
662
|
feedViewPrefs: {
|
|
@@ -727,8 +675,6 @@ describe('agent', () => {
|
|
|
727
675
|
interests: {
|
|
728
676
|
tags: [],
|
|
729
677
|
},
|
|
730
|
-
mutedWords: [],
|
|
731
|
-
hiddenPosts: [],
|
|
732
678
|
})
|
|
733
679
|
|
|
734
680
|
await agent.setFeedViewPrefs('home', { hideReplies: true })
|
|
@@ -744,12 +690,9 @@ describe('agent', () => {
|
|
|
744
690
|
misinfo: 'hide',
|
|
745
691
|
spam: 'ignore',
|
|
746
692
|
},
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
labels: {},
|
|
751
|
-
},
|
|
752
|
-
],
|
|
693
|
+
labelers: DEFAULT_LABELERS,
|
|
694
|
+
mutedWords: [],
|
|
695
|
+
hiddenPosts: [],
|
|
753
696
|
},
|
|
754
697
|
birthDate: new Date('2023-09-11T18:05:42.556Z'),
|
|
755
698
|
feedViewPrefs: {
|
|
@@ -768,8 +711,6 @@ describe('agent', () => {
|
|
|
768
711
|
interests: {
|
|
769
712
|
tags: [],
|
|
770
713
|
},
|
|
771
|
-
mutedWords: [],
|
|
772
|
-
hiddenPosts: [],
|
|
773
714
|
})
|
|
774
715
|
|
|
775
716
|
await agent.setFeedViewPrefs('home', { hideReplies: false })
|
|
@@ -785,12 +726,9 @@ describe('agent', () => {
|
|
|
785
726
|
misinfo: 'hide',
|
|
786
727
|
spam: 'ignore',
|
|
787
728
|
},
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
labels: {},
|
|
792
|
-
},
|
|
793
|
-
],
|
|
729
|
+
labelers: DEFAULT_LABELERS,
|
|
730
|
+
mutedWords: [],
|
|
731
|
+
hiddenPosts: [],
|
|
794
732
|
},
|
|
795
733
|
birthDate: new Date('2023-09-11T18:05:42.556Z'),
|
|
796
734
|
feedViewPrefs: {
|
|
@@ -809,8 +747,6 @@ describe('agent', () => {
|
|
|
809
747
|
interests: {
|
|
810
748
|
tags: [],
|
|
811
749
|
},
|
|
812
|
-
mutedWords: [],
|
|
813
|
-
hiddenPosts: [],
|
|
814
750
|
})
|
|
815
751
|
|
|
816
752
|
await agent.setFeedViewPrefs('other', { hideReplies: true })
|
|
@@ -826,12 +762,9 @@ describe('agent', () => {
|
|
|
826
762
|
misinfo: 'hide',
|
|
827
763
|
spam: 'ignore',
|
|
828
764
|
},
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
labels: {},
|
|
833
|
-
},
|
|
834
|
-
],
|
|
765
|
+
labelers: DEFAULT_LABELERS,
|
|
766
|
+
mutedWords: [],
|
|
767
|
+
hiddenPosts: [],
|
|
835
768
|
},
|
|
836
769
|
birthDate: new Date('2023-09-11T18:05:42.556Z'),
|
|
837
770
|
feedViewPrefs: {
|
|
@@ -857,8 +790,6 @@ describe('agent', () => {
|
|
|
857
790
|
interests: {
|
|
858
791
|
tags: [],
|
|
859
792
|
},
|
|
860
|
-
mutedWords: [],
|
|
861
|
-
hiddenPosts: [],
|
|
862
793
|
})
|
|
863
794
|
|
|
864
795
|
await agent.setThreadViewPrefs({ sort: 'random' })
|
|
@@ -874,12 +805,9 @@ describe('agent', () => {
|
|
|
874
805
|
misinfo: 'hide',
|
|
875
806
|
spam: 'ignore',
|
|
876
807
|
},
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
labels: {},
|
|
881
|
-
},
|
|
882
|
-
],
|
|
808
|
+
labelers: DEFAULT_LABELERS,
|
|
809
|
+
mutedWords: [],
|
|
810
|
+
hiddenPosts: [],
|
|
883
811
|
},
|
|
884
812
|
birthDate: new Date('2023-09-11T18:05:42.556Z'),
|
|
885
813
|
feedViewPrefs: {
|
|
@@ -905,8 +833,6 @@ describe('agent', () => {
|
|
|
905
833
|
interests: {
|
|
906
834
|
tags: [],
|
|
907
835
|
},
|
|
908
|
-
mutedWords: [],
|
|
909
|
-
hiddenPosts: [],
|
|
910
836
|
})
|
|
911
837
|
|
|
912
838
|
await agent.setThreadViewPrefs({ sort: 'oldest' })
|
|
@@ -922,12 +848,9 @@ describe('agent', () => {
|
|
|
922
848
|
misinfo: 'hide',
|
|
923
849
|
spam: 'ignore',
|
|
924
850
|
},
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
labels: {},
|
|
929
|
-
},
|
|
930
|
-
],
|
|
851
|
+
labelers: DEFAULT_LABELERS,
|
|
852
|
+
mutedWords: [],
|
|
853
|
+
hiddenPosts: [],
|
|
931
854
|
},
|
|
932
855
|
birthDate: new Date('2023-09-11T18:05:42.556Z'),
|
|
933
856
|
feedViewPrefs: {
|
|
@@ -953,8 +876,6 @@ describe('agent', () => {
|
|
|
953
876
|
interests: {
|
|
954
877
|
tags: [],
|
|
955
878
|
},
|
|
956
|
-
mutedWords: [],
|
|
957
|
-
hiddenPosts: [],
|
|
958
879
|
})
|
|
959
880
|
|
|
960
881
|
await agent.setInterestsPref({ tags: ['foo', 'bar'] })
|
|
@@ -970,12 +891,9 @@ describe('agent', () => {
|
|
|
970
891
|
misinfo: 'hide',
|
|
971
892
|
spam: 'ignore',
|
|
972
893
|
},
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
labels: {},
|
|
977
|
-
},
|
|
978
|
-
],
|
|
894
|
+
labelers: DEFAULT_LABELERS,
|
|
895
|
+
mutedWords: [],
|
|
896
|
+
hiddenPosts: [],
|
|
979
897
|
},
|
|
980
898
|
birthDate: new Date('2023-09-11T18:05:42.556Z'),
|
|
981
899
|
feedViewPrefs: {
|
|
@@ -1001,8 +919,6 @@ describe('agent', () => {
|
|
|
1001
919
|
interests: {
|
|
1002
920
|
tags: ['foo', 'bar'],
|
|
1003
921
|
},
|
|
1004
|
-
mutedWords: [],
|
|
1005
|
-
hiddenPosts: [],
|
|
1006
922
|
})
|
|
1007
923
|
})
|
|
1008
924
|
|
|
@@ -1038,18 +954,18 @@ describe('agent', () => {
|
|
|
1038
954
|
visibility: 'warn',
|
|
1039
955
|
},
|
|
1040
956
|
{
|
|
1041
|
-
$type: 'app.bsky.actor.defs#
|
|
1042
|
-
|
|
957
|
+
$type: 'app.bsky.actor.defs#labelersPref',
|
|
958
|
+
labelers: [
|
|
1043
959
|
{
|
|
1044
|
-
did:
|
|
960
|
+
did: 'did:plc:first-labeler',
|
|
1045
961
|
},
|
|
1046
962
|
],
|
|
1047
963
|
},
|
|
1048
964
|
{
|
|
1049
|
-
$type: 'app.bsky.actor.defs#
|
|
1050
|
-
|
|
965
|
+
$type: 'app.bsky.actor.defs#labelersPref',
|
|
966
|
+
labelers: [
|
|
1051
967
|
{
|
|
1052
|
-
did:
|
|
968
|
+
did: 'did:plc:first-labeler',
|
|
1053
969
|
},
|
|
1054
970
|
{
|
|
1055
971
|
did: 'did:plc:other',
|
|
@@ -1133,9 +1049,10 @@ describe('agent', () => {
|
|
|
1133
1049
|
...DEFAULT_LABEL_SETTINGS,
|
|
1134
1050
|
porn: 'warn',
|
|
1135
1051
|
},
|
|
1136
|
-
|
|
1052
|
+
labelers: [
|
|
1053
|
+
...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
|
|
1137
1054
|
{
|
|
1138
|
-
did:
|
|
1055
|
+
did: 'did:plc:first-labeler',
|
|
1139
1056
|
labels: {},
|
|
1140
1057
|
},
|
|
1141
1058
|
{
|
|
@@ -1143,6 +1060,8 @@ describe('agent', () => {
|
|
|
1143
1060
|
labels: {},
|
|
1144
1061
|
},
|
|
1145
1062
|
],
|
|
1063
|
+
mutedWords: [],
|
|
1064
|
+
hiddenPosts: [],
|
|
1146
1065
|
},
|
|
1147
1066
|
birthDate: new Date('2021-09-11T18:05:42.556Z'),
|
|
1148
1067
|
feedViewPrefs: {
|
|
@@ -1161,8 +1080,6 @@ describe('agent', () => {
|
|
|
1161
1080
|
interests: {
|
|
1162
1081
|
tags: [],
|
|
1163
1082
|
},
|
|
1164
|
-
mutedWords: [],
|
|
1165
|
-
hiddenPosts: [],
|
|
1166
1083
|
})
|
|
1167
1084
|
|
|
1168
1085
|
await agent.setAdultContentEnabled(false)
|
|
@@ -1177,9 +1094,10 @@ describe('agent', () => {
|
|
|
1177
1094
|
...DEFAULT_LABEL_SETTINGS,
|
|
1178
1095
|
porn: 'warn',
|
|
1179
1096
|
},
|
|
1180
|
-
|
|
1097
|
+
labelers: [
|
|
1098
|
+
...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
|
|
1181
1099
|
{
|
|
1182
|
-
did:
|
|
1100
|
+
did: 'did:plc:first-labeler',
|
|
1183
1101
|
labels: {},
|
|
1184
1102
|
},
|
|
1185
1103
|
{
|
|
@@ -1187,6 +1105,8 @@ describe('agent', () => {
|
|
|
1187
1105
|
labels: {},
|
|
1188
1106
|
},
|
|
1189
1107
|
],
|
|
1108
|
+
mutedWords: [],
|
|
1109
|
+
hiddenPosts: [],
|
|
1190
1110
|
},
|
|
1191
1111
|
birthDate: new Date('2021-09-11T18:05:42.556Z'),
|
|
1192
1112
|
feedViewPrefs: {
|
|
@@ -1205,8 +1125,6 @@ describe('agent', () => {
|
|
|
1205
1125
|
interests: {
|
|
1206
1126
|
tags: [],
|
|
1207
1127
|
},
|
|
1208
|
-
mutedWords: [],
|
|
1209
|
-
hiddenPosts: [],
|
|
1210
1128
|
})
|
|
1211
1129
|
|
|
1212
1130
|
await agent.setContentLabelPref('porn', 'ignore')
|
|
@@ -1219,11 +1137,13 @@ describe('agent', () => {
|
|
|
1219
1137
|
adultContentEnabled: false,
|
|
1220
1138
|
labels: {
|
|
1221
1139
|
...DEFAULT_LABEL_SETTINGS,
|
|
1140
|
+
nsfw: 'ignore',
|
|
1222
1141
|
porn: 'ignore',
|
|
1223
1142
|
},
|
|
1224
|
-
|
|
1143
|
+
labelers: [
|
|
1144
|
+
...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
|
|
1225
1145
|
{
|
|
1226
|
-
did:
|
|
1146
|
+
did: 'did:plc:first-labeler',
|
|
1227
1147
|
labels: {},
|
|
1228
1148
|
},
|
|
1229
1149
|
{
|
|
@@ -1231,6 +1151,8 @@ describe('agent', () => {
|
|
|
1231
1151
|
labels: {},
|
|
1232
1152
|
},
|
|
1233
1153
|
],
|
|
1154
|
+
mutedWords: [],
|
|
1155
|
+
hiddenPosts: [],
|
|
1234
1156
|
},
|
|
1235
1157
|
birthDate: new Date('2021-09-11T18:05:42.556Z'),
|
|
1236
1158
|
feedViewPrefs: {
|
|
@@ -1249,11 +1171,9 @@ describe('agent', () => {
|
|
|
1249
1171
|
interests: {
|
|
1250
1172
|
tags: [],
|
|
1251
1173
|
},
|
|
1252
|
-
mutedWords: [],
|
|
1253
|
-
hiddenPosts: [],
|
|
1254
1174
|
})
|
|
1255
1175
|
|
|
1256
|
-
await agent.
|
|
1176
|
+
await agent.removeLabeler('did:plc:other')
|
|
1257
1177
|
await expect(agent.getPreferences()).resolves.toStrictEqual({
|
|
1258
1178
|
feeds: {
|
|
1259
1179
|
pinned: [],
|
|
@@ -1263,14 +1183,18 @@ describe('agent', () => {
|
|
|
1263
1183
|
adultContentEnabled: false,
|
|
1264
1184
|
labels: {
|
|
1265
1185
|
...DEFAULT_LABEL_SETTINGS,
|
|
1186
|
+
nsfw: 'ignore',
|
|
1266
1187
|
porn: 'ignore',
|
|
1267
1188
|
},
|
|
1268
|
-
|
|
1189
|
+
labelers: [
|
|
1190
|
+
...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
|
|
1269
1191
|
{
|
|
1270
|
-
did:
|
|
1192
|
+
did: 'did:plc:first-labeler',
|
|
1271
1193
|
labels: {},
|
|
1272
1194
|
},
|
|
1273
1195
|
],
|
|
1196
|
+
mutedWords: [],
|
|
1197
|
+
hiddenPosts: [],
|
|
1274
1198
|
},
|
|
1275
1199
|
birthDate: new Date('2021-09-11T18:05:42.556Z'),
|
|
1276
1200
|
feedViewPrefs: {
|
|
@@ -1289,8 +1213,6 @@ describe('agent', () => {
|
|
|
1289
1213
|
interests: {
|
|
1290
1214
|
tags: [],
|
|
1291
1215
|
},
|
|
1292
|
-
mutedWords: [],
|
|
1293
|
-
hiddenPosts: [],
|
|
1294
1216
|
})
|
|
1295
1217
|
|
|
1296
1218
|
await agent.addPinnedFeed('at://bob.com/app.bsky.feed.generator/fake')
|
|
@@ -1303,14 +1225,18 @@ describe('agent', () => {
|
|
|
1303
1225
|
adultContentEnabled: false,
|
|
1304
1226
|
labels: {
|
|
1305
1227
|
...DEFAULT_LABEL_SETTINGS,
|
|
1228
|
+
nsfw: 'ignore',
|
|
1306
1229
|
porn: 'ignore',
|
|
1307
1230
|
},
|
|
1308
|
-
|
|
1231
|
+
labelers: [
|
|
1232
|
+
...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
|
|
1309
1233
|
{
|
|
1310
|
-
did:
|
|
1234
|
+
did: 'did:plc:first-labeler',
|
|
1311
1235
|
labels: {},
|
|
1312
1236
|
},
|
|
1313
1237
|
],
|
|
1238
|
+
mutedWords: [],
|
|
1239
|
+
hiddenPosts: [],
|
|
1314
1240
|
},
|
|
1315
1241
|
birthDate: new Date('2021-09-11T18:05:42.556Z'),
|
|
1316
1242
|
feedViewPrefs: {
|
|
@@ -1329,8 +1255,6 @@ describe('agent', () => {
|
|
|
1329
1255
|
interests: {
|
|
1330
1256
|
tags: [],
|
|
1331
1257
|
},
|
|
1332
|
-
mutedWords: [],
|
|
1333
|
-
hiddenPosts: [],
|
|
1334
1258
|
})
|
|
1335
1259
|
|
|
1336
1260
|
await agent.setPersonalDetails({ birthDate: '2023-09-11T18:05:42.556Z' })
|
|
@@ -1343,14 +1267,18 @@ describe('agent', () => {
|
|
|
1343
1267
|
adultContentEnabled: false,
|
|
1344
1268
|
labels: {
|
|
1345
1269
|
...DEFAULT_LABEL_SETTINGS,
|
|
1270
|
+
nsfw: 'ignore',
|
|
1346
1271
|
porn: 'ignore',
|
|
1347
1272
|
},
|
|
1348
|
-
|
|
1273
|
+
labelers: [
|
|
1274
|
+
...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
|
|
1349
1275
|
{
|
|
1350
|
-
did:
|
|
1276
|
+
did: 'did:plc:first-labeler',
|
|
1351
1277
|
labels: {},
|
|
1352
1278
|
},
|
|
1353
1279
|
],
|
|
1280
|
+
mutedWords: [],
|
|
1281
|
+
hiddenPosts: [],
|
|
1354
1282
|
},
|
|
1355
1283
|
birthDate: new Date('2023-09-11T18:05:42.556Z'),
|
|
1356
1284
|
feedViewPrefs: {
|
|
@@ -1369,8 +1297,6 @@ describe('agent', () => {
|
|
|
1369
1297
|
interests: {
|
|
1370
1298
|
tags: [],
|
|
1371
1299
|
},
|
|
1372
|
-
mutedWords: [],
|
|
1373
|
-
hiddenPosts: [],
|
|
1374
1300
|
})
|
|
1375
1301
|
|
|
1376
1302
|
await agent.setFeedViewPrefs('home', {
|
|
@@ -1394,14 +1320,18 @@ describe('agent', () => {
|
|
|
1394
1320
|
adultContentEnabled: false,
|
|
1395
1321
|
labels: {
|
|
1396
1322
|
...DEFAULT_LABEL_SETTINGS,
|
|
1323
|
+
nsfw: 'ignore',
|
|
1397
1324
|
porn: 'ignore',
|
|
1398
1325
|
},
|
|
1399
|
-
|
|
1326
|
+
labelers: [
|
|
1327
|
+
...BskyAgent.appLabelers.map((did) => ({ did, labels: {} })),
|
|
1400
1328
|
{
|
|
1401
|
-
did:
|
|
1329
|
+
did: 'did:plc:first-labeler',
|
|
1402
1330
|
labels: {},
|
|
1403
1331
|
},
|
|
1404
1332
|
],
|
|
1333
|
+
mutedWords: [],
|
|
1334
|
+
hiddenPosts: [],
|
|
1405
1335
|
},
|
|
1406
1336
|
birthDate: new Date('2023-09-11T18:05:42.556Z'),
|
|
1407
1337
|
feedViewPrefs: {
|
|
@@ -1420,8 +1350,6 @@ describe('agent', () => {
|
|
|
1420
1350
|
interests: {
|
|
1421
1351
|
tags: [],
|
|
1422
1352
|
},
|
|
1423
|
-
mutedWords: [],
|
|
1424
|
-
hiddenPosts: [],
|
|
1425
1353
|
})
|
|
1426
1354
|
|
|
1427
1355
|
const res = await agent.app.bsky.actor.getPreferences()
|
|
@@ -1437,10 +1365,15 @@ describe('agent', () => {
|
|
|
1437
1365
|
visibility: 'ignore',
|
|
1438
1366
|
},
|
|
1439
1367
|
{
|
|
1440
|
-
$type: 'app.bsky.actor.defs#
|
|
1441
|
-
|
|
1368
|
+
$type: 'app.bsky.actor.defs#contentLabelPref',
|
|
1369
|
+
label: 'nsfw',
|
|
1370
|
+
visibility: 'ignore',
|
|
1371
|
+
},
|
|
1372
|
+
{
|
|
1373
|
+
$type: 'app.bsky.actor.defs#labelersPref',
|
|
1374
|
+
labelers: [
|
|
1442
1375
|
{
|
|
1443
|
-
did:
|
|
1376
|
+
did: 'did:plc:first-labeler',
|
|
1444
1377
|
},
|
|
1445
1378
|
],
|
|
1446
1379
|
},
|
|
@@ -1496,7 +1429,7 @@ describe('agent', () => {
|
|
|
1496
1429
|
await agent.upsertMutedWords(mutedWords)
|
|
1497
1430
|
await agent.upsertMutedWords(mutedWords) // double
|
|
1498
1431
|
await expect(agent.getPreferences()).resolves.toHaveProperty(
|
|
1499
|
-
'mutedWords',
|
|
1432
|
+
'moderationPrefs.mutedWords',
|
|
1500
1433
|
mutedWords,
|
|
1501
1434
|
)
|
|
1502
1435
|
})
|
|
@@ -1508,7 +1441,7 @@ describe('agent', () => {
|
|
|
1508
1441
|
// is sanitized to `hashtag`
|
|
1509
1442
|
await agent.upsertMutedWords([{ value: '#hashtag', targets: ['tag'] }])
|
|
1510
1443
|
|
|
1511
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1444
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1512
1445
|
|
|
1513
1446
|
expect(mutedWords.find((m) => m.value === '#hashtag')).toBeFalsy()
|
|
1514
1447
|
// merged with existing
|
|
@@ -1531,7 +1464,7 @@ describe('agent', () => {
|
|
|
1531
1464
|
})
|
|
1532
1465
|
await agent.updateMutedWord({ value: 'tag_then_none', targets: [] })
|
|
1533
1466
|
await agent.updateMutedWord({ value: 'no_exist', targets: ['tag'] })
|
|
1534
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1467
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1535
1468
|
|
|
1536
1469
|
expect(
|
|
1537
1470
|
mutedWords.find((m) => m.value === 'tag_then_content'),
|
|
@@ -1556,7 +1489,7 @@ describe('agent', () => {
|
|
|
1556
1489
|
value: '#just_a_tag',
|
|
1557
1490
|
targets: ['tag', 'content'],
|
|
1558
1491
|
})
|
|
1559
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1492
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1560
1493
|
expect(mutedWords.find((m) => m.value === 'just_a_tag')).toStrictEqual({
|
|
1561
1494
|
value: 'just_a_tag',
|
|
1562
1495
|
targets: ['tag'],
|
|
@@ -1567,7 +1500,7 @@ describe('agent', () => {
|
|
|
1567
1500
|
await agent.removeMutedWord({ value: 'tag_then_content', targets: [] })
|
|
1568
1501
|
await agent.removeMutedWord({ value: 'tag_then_both', targets: [] })
|
|
1569
1502
|
await agent.removeMutedWord({ value: 'tag_then_none', targets: [] })
|
|
1570
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1503
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1571
1504
|
|
|
1572
1505
|
expect(
|
|
1573
1506
|
mutedWords.find((m) => m.value === 'tag_then_content'),
|
|
@@ -1578,17 +1511,17 @@ describe('agent', () => {
|
|
|
1578
1511
|
|
|
1579
1512
|
it('removeMutedWord with #, no match, no removal', async () => {
|
|
1580
1513
|
await agent.removeMutedWord({ value: '#hashtag', targets: [] })
|
|
1581
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1514
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1582
1515
|
|
|
1583
1516
|
// was inserted with #hashtag, but we don't sanitize on remove
|
|
1584
1517
|
expect(mutedWords.find((m) => m.value === 'hashtag')).toBeTruthy()
|
|
1585
1518
|
})
|
|
1586
1519
|
|
|
1587
1520
|
it('single-hash #', async () => {
|
|
1588
|
-
const prev = await agent.getPreferences()
|
|
1521
|
+
const prev = (await agent.getPreferences()).moderationPrefs
|
|
1589
1522
|
const length = prev.mutedWords.length
|
|
1590
1523
|
await agent.upsertMutedWords([{ value: '#', targets: [] }])
|
|
1591
|
-
const end = await agent.getPreferences()
|
|
1524
|
+
const end = (await agent.getPreferences()).moderationPrefs
|
|
1592
1525
|
|
|
1593
1526
|
// sanitized to empty string, not inserted
|
|
1594
1527
|
expect(end.mutedWords.length).toEqual(length)
|
|
@@ -1596,65 +1529,65 @@ describe('agent', () => {
|
|
|
1596
1529
|
|
|
1597
1530
|
it('multi-hash ##', async () => {
|
|
1598
1531
|
await agent.upsertMutedWords([{ value: '##', targets: [] }])
|
|
1599
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1532
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1600
1533
|
|
|
1601
1534
|
expect(mutedWords.find((m) => m.value === '#')).toBeTruthy()
|
|
1602
1535
|
})
|
|
1603
1536
|
|
|
1604
1537
|
it('multi-hash ##hashtag', async () => {
|
|
1605
1538
|
await agent.upsertMutedWords([{ value: '##hashtag', targets: [] }])
|
|
1606
|
-
const a = await agent.getPreferences()
|
|
1539
|
+
const a = (await agent.getPreferences()).moderationPrefs
|
|
1607
1540
|
|
|
1608
1541
|
expect(a.mutedWords.find((w) => w.value === '#hashtag')).toBeTruthy()
|
|
1609
1542
|
|
|
1610
1543
|
await agent.removeMutedWord({ value: '#hashtag', targets: [] })
|
|
1611
|
-
const b = await agent.getPreferences()
|
|
1544
|
+
const b = (await agent.getPreferences()).moderationPrefs
|
|
1612
1545
|
|
|
1613
1546
|
expect(b.mutedWords.find((w) => w.value === '#hashtag')).toBeFalsy()
|
|
1614
1547
|
})
|
|
1615
1548
|
|
|
1616
1549
|
it('hash emoji #️⃣', async () => {
|
|
1617
1550
|
await agent.upsertMutedWords([{ value: '#️⃣', targets: [] }])
|
|
1618
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1551
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1619
1552
|
|
|
1620
1553
|
expect(mutedWords.find((m) => m.value === '#️⃣')).toBeTruthy()
|
|
1621
1554
|
|
|
1622
1555
|
await agent.removeMutedWord({ value: '#️⃣', targets: [] })
|
|
1623
|
-
const end = await agent.getPreferences()
|
|
1556
|
+
const end = (await agent.getPreferences()).moderationPrefs
|
|
1624
1557
|
|
|
1625
1558
|
expect(end.mutedWords.find((m) => m.value === '#️⃣')).toBeFalsy()
|
|
1626
1559
|
})
|
|
1627
1560
|
|
|
1628
1561
|
it('hash emoji ##️⃣', async () => {
|
|
1629
1562
|
await agent.upsertMutedWords([{ value: '##️⃣', targets: [] }])
|
|
1630
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1563
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1631
1564
|
|
|
1632
1565
|
expect(mutedWords.find((m) => m.value === '#️⃣')).toBeTruthy()
|
|
1633
1566
|
|
|
1634
1567
|
await agent.removeMutedWord({ value: '#️⃣', targets: [] })
|
|
1635
|
-
const end = await agent.getPreferences()
|
|
1568
|
+
const end = (await agent.getPreferences()).moderationPrefs
|
|
1636
1569
|
|
|
1637
1570
|
expect(end.mutedWords.find((m) => m.value === '#️⃣')).toBeFalsy()
|
|
1638
1571
|
})
|
|
1639
1572
|
|
|
1640
1573
|
it('hash emoji ###️⃣', async () => {
|
|
1641
1574
|
await agent.upsertMutedWords([{ value: '###️⃣', targets: [] }])
|
|
1642
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1575
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1643
1576
|
|
|
1644
1577
|
expect(mutedWords.find((m) => m.value === '##️⃣')).toBeTruthy()
|
|
1645
1578
|
|
|
1646
1579
|
await agent.removeMutedWord({ value: '##️⃣', targets: [] })
|
|
1647
|
-
const end = await agent.getPreferences()
|
|
1580
|
+
const end = (await agent.getPreferences()).moderationPrefs
|
|
1648
1581
|
|
|
1649
1582
|
expect(end.mutedWords.find((m) => m.value === '##️⃣')).toBeFalsy()
|
|
1650
1583
|
})
|
|
1651
1584
|
|
|
1652
1585
|
describe(`invalid characters`, () => {
|
|
1653
1586
|
it('zero width space', async () => {
|
|
1654
|
-
const prev = await agent.getPreferences()
|
|
1587
|
+
const prev = (await agent.getPreferences()).moderationPrefs
|
|
1655
1588
|
const length = prev.mutedWords.length
|
|
1656
1589
|
await agent.upsertMutedWords([{ value: '#', targets: [] }])
|
|
1657
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1590
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1658
1591
|
|
|
1659
1592
|
expect(mutedWords.length).toEqual(length)
|
|
1660
1593
|
})
|
|
@@ -1663,7 +1596,7 @@ describe('agent', () => {
|
|
|
1663
1596
|
await agent.upsertMutedWords([
|
|
1664
1597
|
{ value: 'test value\n with newline', targets: [] },
|
|
1665
1598
|
])
|
|
1666
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1599
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1667
1600
|
|
|
1668
1601
|
expect(
|
|
1669
1602
|
mutedWords.find((m) => m.value === 'test value with newline'),
|
|
@@ -1674,7 +1607,7 @@ describe('agent', () => {
|
|
|
1674
1607
|
await agent.upsertMutedWords([
|
|
1675
1608
|
{ value: 'test value\n\r with newline', targets: [] },
|
|
1676
1609
|
])
|
|
1677
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1610
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1678
1611
|
|
|
1679
1612
|
expect(
|
|
1680
1613
|
mutedWords.find((m) => m.value === 'test value with newline'),
|
|
@@ -1683,14 +1616,14 @@ describe('agent', () => {
|
|
|
1683
1616
|
|
|
1684
1617
|
it('empty space', async () => {
|
|
1685
1618
|
await agent.upsertMutedWords([{ value: ' ', targets: [] }])
|
|
1686
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1619
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1687
1620
|
|
|
1688
1621
|
expect(mutedWords.find((m) => m.value === ' ')).toBeFalsy()
|
|
1689
1622
|
})
|
|
1690
1623
|
|
|
1691
1624
|
it('leading/trailing space', async () => {
|
|
1692
1625
|
await agent.upsertMutedWords([{ value: ' trim ', targets: [] }])
|
|
1693
|
-
const { mutedWords } = await agent.getPreferences()
|
|
1626
|
+
const { mutedWords } = (await agent.getPreferences()).moderationPrefs
|
|
1694
1627
|
|
|
1695
1628
|
expect(mutedWords.find((m) => m.value === 'trim')).toBeTruthy()
|
|
1696
1629
|
})
|
|
@@ -1714,7 +1647,7 @@ describe('agent', () => {
|
|
|
1714
1647
|
await agent.hidePost(postUri)
|
|
1715
1648
|
await agent.hidePost(postUri) // double, should dedupe
|
|
1716
1649
|
await expect(agent.getPreferences()).resolves.toHaveProperty(
|
|
1717
|
-
'hiddenPosts',
|
|
1650
|
+
'moderationPrefs.hiddenPosts',
|
|
1718
1651
|
[postUri],
|
|
1719
1652
|
)
|
|
1720
1653
|
})
|
|
@@ -1722,13 +1655,13 @@ describe('agent', () => {
|
|
|
1722
1655
|
it('unhidePost', async () => {
|
|
1723
1656
|
await agent.unhidePost(postUri)
|
|
1724
1657
|
await expect(agent.getPreferences()).resolves.toHaveProperty(
|
|
1725
|
-
'hiddenPosts',
|
|
1658
|
+
'moderationPrefs.hiddenPosts',
|
|
1726
1659
|
[],
|
|
1727
1660
|
)
|
|
1728
1661
|
// no issues calling a second time
|
|
1729
1662
|
await agent.unhidePost(postUri)
|
|
1730
1663
|
await expect(agent.getPreferences()).resolves.toHaveProperty(
|
|
1731
|
-
'hiddenPosts',
|
|
1664
|
+
'moderationPrefs.hiddenPosts',
|
|
1732
1665
|
[],
|
|
1733
1666
|
)
|
|
1734
1667
|
})
|