@atproto/api 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -0
- package/definitions/labels.json +212 -0
- package/definitions/locale/en/label-groups.json +38 -0
- package/definitions/locale/en/labels.json +366 -0
- package/definitions/locale/en/proposed-label-groups.json +38 -0
- package/definitions/locale/en/proposed-labels.json +632 -0
- package/definitions/moderation-behaviors.d.ts +48 -0
- package/definitions/post-moderation-behaviors.json +879 -0
- package/definitions/profile-moderation-behaviors.json +447 -0
- package/definitions/proposed-labels.json +326 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/lexicons.d.ts +27 -1
- package/dist/client/types/app/bsky/actor/updateProfile.d.ts +3 -10
- package/dist/client/types/app/bsky/{feed/getBookmarkedFeeds.d.ts → graph/getListBlocks.d.ts} +2 -2
- package/dist/client/types/app/bsky/graph/listblock.d.ts +8 -0
- package/dist/client/types/app/bsky/{feed/unbookmarkFeed.d.ts → graph/subscribeMuteList.d.ts} +1 -1
- package/dist/client/types/app/bsky/{feed/bookmarkFeed.d.ts → graph/unsubscribeMuteList.d.ts} +1 -1
- package/dist/{src/client/types/app/bsky/notification/updateSeen.d.ts → client/types/app/bsky/unspecced/applyLabels.d.ts} +2 -1
- package/dist/helpers/bsky.d.ts +20 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1401 -12
- package/dist/index.js.map +4 -4
- package/dist/mixins/bsky.d.ts +23 -0
- package/dist/moderation/accumulator.d.ts +14 -0
- package/dist/moderation/const/label-groups.d.ts +2 -0
- package/dist/moderation/const/labels.d.ts +2 -0
- package/dist/moderation/index.d.ts +44 -0
- package/dist/moderation/subjects/account.d.ts +3 -0
- package/dist/moderation/subjects/feed-generator.d.ts +2 -0
- package/dist/moderation/subjects/post.d.ts +2 -0
- package/dist/moderation/subjects/profile.d.ts +3 -0
- package/dist/moderation/subjects/quoted-post.d.ts +6 -0
- package/dist/moderation/subjects/user-list.d.ts +2 -0
- package/dist/moderation/types.d.ts +97 -0
- package/dist/moderation/util.d.ts +12 -0
- package/dist/rich-text/sanitize.d.ts +4 -0
- package/docs/labels.md +522 -0
- package/docs/moderation-behaviors/posts.md +1919 -0
- package/docs/moderation-behaviors/profiles.md +907 -0
- package/docs/moderation.md +144 -0
- package/package.json +6 -4
- package/scripts/code/label-groups.mjs +68 -0
- package/scripts/code/labels.mjs +68 -0
- package/scripts/docs/labels.mjs +164 -0
- package/scripts/docs/post-moderation-behaviors.mjs +122 -0
- package/scripts/docs/profile-moderation-behaviors.mjs +122 -0
- package/scripts/generate-code.mjs +4 -0
- package/scripts/generate-docs.mjs +5 -0
- package/src/client/index.ts +13 -0
- package/src/client/lexicons.ts +29 -3
- package/src/client/types/app/bsky/unspecced/applyLabels.ts +33 -0
- package/src/client/types/com/atproto/admin/enableAccountInvites.ts +1 -1
- package/src/client/types/com/atproto/moderation/defs.ts +1 -1
- package/src/index.ts +4 -0
- package/src/moderation/accumulator.ts +181 -0
- package/src/moderation/const/label-groups.ts +143 -0
- package/src/moderation/const/labels.ts +798 -0
- package/src/moderation/index.ts +343 -0
- package/src/moderation/subjects/account.ts +40 -0
- package/src/moderation/subjects/feed-generator.ts +13 -0
- package/src/moderation/subjects/post.ts +23 -0
- package/src/moderation/subjects/profile.ts +31 -0
- package/src/moderation/subjects/quoted-post.ts +62 -0
- package/src/moderation/subjects/user-list.ts +13 -0
- package/src/moderation/types.ts +141 -0
- package/src/moderation/util.ts +98 -0
- package/tests/post-moderation.test.ts +46 -0
- package/tests/profile-moderation.test.ts +46 -0
- package/tests/util/index.ts +176 -0
- package/tests/util/moderation-behavior.ts +180 -0
- 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/com/atproto/admin/getInviteCodeUsage.d.ts +0 -29
- package/dist/client/types/com/atproto/repo/importRepo.d.ts +0 -19
- package/dist/client/types/com/atproto/repo/uploadRepo.d.ts +0 -19
- package/dist/client/types/com/atproto/server/getUserInviteCodes.d.ts +0 -31
- 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/post.d.ts +0 -23
- package/dist/src/client/types/app/bsky/postNotificationsSeen.d.ts +0 -20
- package/dist/src/client/types/app/bsky/profile.d.ts +0 -5
- package/dist/src/client/types/app/bsky/repost.d.ts +0 -10
- package/dist/src/client/types/app/bsky/system/actorScene.d.ts +0 -1
- package/dist/src/client/types/app/bsky/system/actorUser.d.ts +0 -1
- package/dist/src/client/types/app/bsky/system/declRef.d.ts +0 -5
- package/dist/src/client/types/app/bsky/system/declaration.d.ts +0 -4
- package/dist/src/client/types/app/bsky/updateProfile.d.ts +0 -23
- package/dist/src/client/types/com/atproto/account/create.d.ts +0 -41
- package/dist/src/client/types/com/atproto/account/createInviteCode.d.ts +0 -22
- package/dist/src/client/types/com/atproto/account/delete.d.ts +0 -13
- package/dist/src/client/types/com/atproto/account/get.d.ts +0 -12
- package/dist/src/client/types/com/atproto/account/requestPasswordReset.d.ts +0 -17
- package/dist/src/client/types/com/atproto/account/resetPassword.d.ts +0 -24
- package/dist/src/client/types/com/atproto/blob/upload.d.ts +0 -19
- package/dist/src/client/types/com/atproto/createAccount.d.ts +0 -40
- package/dist/src/client/types/com/atproto/createInviteCode.d.ts +0 -20
- package/dist/src/client/types/com/atproto/createSession.d.ts +0 -24
- package/dist/src/client/types/com/atproto/data/uploadFile.d.ts +0 -19
- package/dist/src/client/types/com/atproto/deleteAccount.d.ts +0 -20
- package/dist/src/client/types/com/atproto/deleteSession.d.ts +0 -17
- package/dist/src/client/types/com/atproto/getAccount.d.ts +0 -16
- package/dist/src/client/types/com/atproto/getAccountsConfig.d.ts +0 -17
- package/dist/src/client/types/com/atproto/getSession.d.ts +0 -17
- package/dist/src/client/types/com/atproto/handle/resolve.d.ts +0 -18
- package/dist/src/client/types/com/atproto/refreshSession.d.ts +0 -20
- package/dist/src/client/types/com/atproto/repo/batchWrite.d.ts +0 -39
- package/dist/src/client/types/com/atproto/repo/createRecord.d.ts +0 -26
- package/dist/src/client/types/com/atproto/repo/deleteRecord.d.ts +0 -19
- package/dist/src/client/types/com/atproto/repo/describe.d.ts +0 -22
- package/dist/src/client/types/com/atproto/repo/getRecord.d.ts +0 -23
- package/dist/src/client/types/com/atproto/repo/listRecords.d.ts +0 -30
- package/dist/src/client/types/com/atproto/repo/putRecord.d.ts +0 -27
- package/dist/src/client/types/com/atproto/repo/strongRef.d.ts +0 -5
- package/dist/src/client/types/com/atproto/repoBatchWrite.d.ts +0 -36
- package/dist/src/client/types/com/atproto/repoCreateRecord.d.ts +0 -24
- package/dist/src/client/types/com/atproto/repoDeleteRecord.d.ts +0 -18
- package/dist/src/client/types/com/atproto/repoDescribe.d.ts +0 -21
- package/dist/src/client/types/com/atproto/repoGetRecord.d.ts +0 -22
- package/dist/src/client/types/com/atproto/repoListRecords.d.ts +0 -27
- package/dist/src/client/types/com/atproto/repoPutRecord.d.ts +0 -25
- package/dist/src/client/types/com/atproto/requestAccountPasswordReset.d.ts +0 -19
- package/dist/src/client/types/com/atproto/resetAccountPassword.d.ts +0 -26
- package/dist/src/client/types/com/atproto/resolveHandle.d.ts +0 -17
- package/dist/src/client/types/com/atproto/resolveName.d.ts +0 -17
- package/dist/src/client/types/com/atproto/server/getAccountsConfig.d.ts +0 -24
- package/dist/src/client/types/com/atproto/session/create.d.ts +0 -26
- package/dist/src/client/types/com/atproto/session/delete.d.ts +0 -13
- package/dist/src/client/types/com/atproto/session/get.d.ts +0 -18
- package/dist/src/client/types/com/atproto/session/refresh.d.ts +0 -21
- package/dist/src/client/types/com/atproto/sync/getRepo.d.ts +0 -15
- package/dist/src/client/types/com/atproto/sync/getRoot.d.ts +0 -18
- package/dist/src/client/types/com/atproto/sync/updateRepo.d.ts +0 -15
- package/dist/src/client/types/com/atproto/syncGetRepo.d.ts +0 -15
- package/dist/src/client/types/com/atproto/syncGetRoot.d.ts +0 -17
- package/dist/src/client/types/com/atproto/syncUpdateRepo.d.ts +0 -15
- package/dist/src/index.d.ts +0 -4
- package/dist/src/schemas.d.ts +0 -19
- package/dist/src/session.d.ts +0 -42
- package/dist/src/types/app/bsky/acceptedBadge.d.ts +0 -10
- package/dist/src/types/app/bsky/badge.d.ts +0 -22
- package/dist/src/types/app/bsky/badgeAccept.d.ts +0 -11
- package/dist/src/types/app/bsky/badgeOffer.d.ts +0 -11
- package/dist/src/types/app/bsky/declaration.d.ts +0 -6
- package/dist/src/types/app/bsky/follow.d.ts +0 -9
- package/dist/src/types/app/bsky/getAuthorFeed.d.ts +0 -56
- package/dist/src/types/app/bsky/getBadgeMembers.d.ts +0 -29
- package/dist/src/types/app/bsky/getHomeFeed.d.ts +0 -56
- package/dist/src/types/app/bsky/getLikedBy.d.ts +0 -29
- package/dist/src/types/app/bsky/getNotificationCount.d.ts +0 -16
- package/dist/src/types/app/bsky/getNotifications.d.ts +0 -33
- package/dist/src/types/app/bsky/getPostThread.d.ts +0 -55
- package/dist/src/types/app/bsky/getProfile.d.ts +0 -42
- package/dist/src/types/app/bsky/getRepostedBy.d.ts +0 -29
- package/dist/src/types/app/bsky/getUserFollowers.d.ts +0 -31
- package/dist/src/types/app/bsky/getUserFollows.d.ts +0 -31
- package/dist/src/types/app/bsky/getUsersSearch.d.ts +0 -26
- package/dist/src/types/app/bsky/getUsersTypeahead.d.ts +0 -22
- package/dist/src/types/app/bsky/invite.d.ts +0 -10
- package/dist/src/types/app/bsky/inviteAccept.d.ts +0 -14
- package/dist/src/types/app/bsky/like.d.ts +0 -10
- package/dist/src/types/app/bsky/mediaEmbed.d.ts +0 -15
- package/dist/src/types/app/bsky/post.d.ts +0 -23
- package/dist/src/types/app/bsky/postNotificationsSeen.d.ts +0 -19
- package/dist/src/types/app/bsky/profile.d.ts +0 -11
- package/dist/src/types/app/bsky/repost.d.ts +0 -10
- package/dist/src/types/app/bsky/updateProfile.d.ts +0 -27
- package/dist/src/types/com/atproto/createAccount.d.ts +0 -39
- package/dist/src/types/com/atproto/createInviteCode.d.ts +0 -19
- package/dist/src/types/com/atproto/createSession.d.ts +0 -23
- package/dist/src/types/com/atproto/deleteAccount.d.ts +0 -19
- package/dist/src/types/com/atproto/deleteSession.d.ts +0 -16
- package/dist/src/types/com/atproto/getAccount.d.ts +0 -19
- package/dist/src/types/com/atproto/getAccountsConfig.d.ts +0 -17
- package/dist/src/types/com/atproto/getSession.d.ts +0 -17
- package/dist/src/types/com/atproto/refreshSession.d.ts +0 -19
- package/dist/src/types/com/atproto/repoBatchWrite.d.ts +0 -35
- package/dist/src/types/com/atproto/repoCreateRecord.d.ts +0 -23
- package/dist/src/types/com/atproto/repoDeleteRecord.d.ts +0 -15
- package/dist/src/types/com/atproto/repoDescribe.d.ts +0 -21
- package/dist/src/types/com/atproto/repoGetRecord.d.ts +0 -22
- package/dist/src/types/com/atproto/repoListRecords.d.ts +0 -27
- package/dist/src/types/com/atproto/repoPutRecord.d.ts +0 -24
- package/dist/src/types/com/atproto/requestAccountPasswordReset.d.ts +0 -18
- package/dist/src/types/com/atproto/resetAccountPassword.d.ts +0 -25
- package/dist/src/types/com/atproto/resolveName.d.ts +0 -17
- package/dist/src/types/com/atproto/syncGetRepo.d.ts +0 -15
- package/dist/src/types/com/atproto/syncGetRoot.d.ts +0 -17
- package/dist/src/types/com/atproto/syncUpdateRepo.d.ts +0 -14
- package/dist/src/types/todo/adx/createAccount.d.ts +0 -36
- package/dist/src/types/todo/adx/createInviteCode.d.ts +0 -19
- package/dist/src/types/todo/adx/createSession.d.ts +0 -22
- package/dist/src/types/todo/adx/deleteAccount.d.ts +0 -19
- package/dist/src/types/todo/adx/deleteSession.d.ts +0 -19
- package/dist/src/types/todo/adx/getAccount.d.ts +0 -19
- package/dist/src/types/todo/adx/getAccountsConfig.d.ts +0 -17
- package/dist/src/types/todo/adx/getSession.d.ts +0 -17
- package/dist/src/types/todo/adx/repoBatchWrite.d.ts +0 -34
- package/dist/src/types/todo/adx/repoCreateRecord.d.ts +0 -22
- package/dist/src/types/todo/adx/repoDeleteRecord.d.ts +0 -15
- package/dist/src/types/todo/adx/repoDescribe.d.ts +0 -21
- package/dist/src/types/todo/adx/repoGetRecord.d.ts +0 -20
- package/dist/src/types/todo/adx/repoListRecords.d.ts +0 -25
- package/dist/src/types/todo/adx/repoPutRecord.d.ts +0 -23
- package/dist/src/types/todo/adx/requestAccountPasswordReset.d.ts +0 -18
- package/dist/src/types/todo/adx/resetAccountPassword.d.ts +0 -25
- package/dist/src/types/todo/adx/resolveName.d.ts +0 -17
- package/dist/src/types/todo/adx/syncGetRepo.d.ts +0 -15
- package/dist/src/types/todo/adx/syncGetRoot.d.ts +0 -17
- package/dist/src/types/todo/adx/syncUpdateRepo.d.ts +0 -14
- package/dist/src/types/todo/social/badge.d.ts +0 -23
- package/dist/src/types/todo/social/follow.d.ts +0 -5
- package/dist/src/types/todo/social/getAuthorFeed.d.ts +0 -55
- package/dist/src/types/todo/social/getFeed.d.ts +0 -55
- package/dist/src/types/todo/social/getHomeFeed.d.ts +0 -55
- package/dist/src/types/todo/social/getLikedBy.d.ts +0 -26
- package/dist/src/types/todo/social/getNotificationCount.d.ts +0 -16
- package/dist/src/types/todo/social/getNotifications.d.ts +0 -31
- package/dist/src/types/todo/social/getPostThread.d.ts +0 -54
- package/dist/src/types/todo/social/getProfile.d.ts +0 -40
- package/dist/src/types/todo/social/getRepostedBy.d.ts +0 -26
- package/dist/src/types/todo/social/getUserFollowers.d.ts +0 -30
- package/dist/src/types/todo/social/getUserFollows.d.ts +0 -30
- package/dist/src/types/todo/social/like.d.ts +0 -5
- package/dist/src/types/todo/social/mediaEmbed.d.ts +0 -15
- package/dist/src/types/todo/social/post.d.ts +0 -18
- package/dist/src/types/todo/social/postNotificationsSeen.d.ts +0 -19
- package/dist/src/types/todo/social/profile.d.ts +0 -10
- package/dist/src/types/todo/social/repost.d.ts +0 -5
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/tests/_util.ts +0 -26
- package/tsconfig.build.tsbuildinfo +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AtpAgentType } from '../types';
|
|
2
|
+
export declare function addBsky<TBase extends AtpAgentType>(Base: TBase): {
|
|
3
|
+
new (...args: any[]): {
|
|
4
|
+
like(uri: string, cid: string): Promise<{
|
|
5
|
+
uri: string;
|
|
6
|
+
cid: string;
|
|
7
|
+
}>;
|
|
8
|
+
unlike(likeUri: string): Promise<void>;
|
|
9
|
+
repost(uri: string, cid: string): Promise<{
|
|
10
|
+
uri: string;
|
|
11
|
+
cid: string;
|
|
12
|
+
}>;
|
|
13
|
+
unrepost(repostUri: string): Promise<void>;
|
|
14
|
+
follow(subjectDid: string): Promise<{
|
|
15
|
+
uri: string;
|
|
16
|
+
cid: string;
|
|
17
|
+
}>;
|
|
18
|
+
unfollow(followUri: string): Promise<void>;
|
|
19
|
+
service: URL;
|
|
20
|
+
api: import("..").AtpServiceClient;
|
|
21
|
+
session?: import("../types").AtpSessionData | undefined;
|
|
22
|
+
};
|
|
23
|
+
} & TBase;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AppBskyGraphDefs } from '../client/index';
|
|
2
|
+
import { Label, ModerationCause, ModerationOpts, ModerationDecision } from './types';
|
|
3
|
+
export declare class ModerationCauseAccumulator {
|
|
4
|
+
did: string;
|
|
5
|
+
causes: ModerationCause[];
|
|
6
|
+
constructor();
|
|
7
|
+
setDid(did: string): void;
|
|
8
|
+
addBlocking(blocking: string | undefined): void;
|
|
9
|
+
addBlockedBy(blockedBy: boolean | undefined): void;
|
|
10
|
+
addLabel(label: Label, opts: ModerationOpts): void;
|
|
11
|
+
addMuted(muted: boolean | undefined): void;
|
|
12
|
+
addMutedByList(mutedByList: AppBskyGraphDefs.ListViewBasic | undefined): void;
|
|
13
|
+
finalizeDecision(opts: ModerationOpts): ModerationDecision;
|
|
14
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ModerationSubjectProfile, ModerationSubjectPost, ModerationSubjectFeedGenerator, ModerationSubjectUserList, ModerationOpts, ModerationDecision, ModerationUI } from './types';
|
|
2
|
+
export interface ProfileModeration {
|
|
3
|
+
decisions: {
|
|
4
|
+
account: ModerationDecision;
|
|
5
|
+
profile: ModerationDecision;
|
|
6
|
+
};
|
|
7
|
+
account: ModerationUI;
|
|
8
|
+
profile: ModerationUI;
|
|
9
|
+
avatar: ModerationUI;
|
|
10
|
+
}
|
|
11
|
+
export declare function moderateProfile(subject: ModerationSubjectProfile, opts: ModerationOpts): ProfileModeration;
|
|
12
|
+
export interface PostModeration {
|
|
13
|
+
decisions: {
|
|
14
|
+
post: ModerationDecision;
|
|
15
|
+
account: ModerationDecision;
|
|
16
|
+
profile: ModerationDecision;
|
|
17
|
+
quote?: ModerationDecision;
|
|
18
|
+
quotedAccount?: ModerationDecision;
|
|
19
|
+
};
|
|
20
|
+
content: ModerationUI;
|
|
21
|
+
avatar: ModerationUI;
|
|
22
|
+
embed: ModerationUI;
|
|
23
|
+
}
|
|
24
|
+
export declare function moderatePost(subject: ModerationSubjectPost, opts: ModerationOpts): PostModeration;
|
|
25
|
+
export interface FeedGeneratorModeration {
|
|
26
|
+
decisions: {
|
|
27
|
+
feedGenerator: ModerationDecision;
|
|
28
|
+
account: ModerationDecision;
|
|
29
|
+
profile: ModerationDecision;
|
|
30
|
+
};
|
|
31
|
+
content: ModerationUI;
|
|
32
|
+
avatar: ModerationUI;
|
|
33
|
+
}
|
|
34
|
+
export declare function moderateFeedGenerator(subject: ModerationSubjectFeedGenerator, opts: ModerationOpts): FeedGeneratorModeration;
|
|
35
|
+
export interface UserListModeration {
|
|
36
|
+
decisions: {
|
|
37
|
+
userList: ModerationDecision;
|
|
38
|
+
account: ModerationDecision;
|
|
39
|
+
profile: ModerationDecision;
|
|
40
|
+
};
|
|
41
|
+
content: ModerationUI;
|
|
42
|
+
avatar: ModerationUI;
|
|
43
|
+
}
|
|
44
|
+
export declare function moderateUserList(subject: ModerationSubjectUserList, opts: ModerationOpts): UserListModeration;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Label, ModerationSubjectProfile, ModerationOpts, ModerationDecision } from '../types';
|
|
2
|
+
export declare function decideAccount(subject: ModerationSubjectProfile, opts: ModerationOpts): ModerationDecision;
|
|
3
|
+
export declare function filterAccountLabels(labels?: Label[]): Label[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Label, ModerationSubjectProfile, ModerationOpts, ModerationDecision } from '../types';
|
|
2
|
+
export declare function decideProfile(subject: ModerationSubjectProfile, opts: ModerationOpts): ModerationDecision;
|
|
3
|
+
export declare function filterProfileLabels(labels?: Label[]): Label[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AppBskyEmbedRecord, AppBskyEmbedRecordWithMedia } from '../../client';
|
|
2
|
+
import { ModerationOpts, ModerationDecision } from '../types';
|
|
3
|
+
export declare function decideQuotedPost(subject: AppBskyEmbedRecord.View, opts: ModerationOpts): ModerationDecision;
|
|
4
|
+
export declare function decideQuotedPostAccount(subject: AppBskyEmbedRecord.View, opts: ModerationOpts): ModerationDecision;
|
|
5
|
+
export declare function decideQuotedPostWithMedia(subject: AppBskyEmbedRecordWithMedia.View, opts: ModerationOpts): ModerationDecision;
|
|
6
|
+
export declare function decideQuotedPostWithMediaAccount(subject: AppBskyEmbedRecordWithMedia.View, opts: ModerationOpts): ModerationDecision;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { AppBskyActorDefs, AppBskyFeedDefs, AppBskyGraphDefs, ComAtprotoLabelDefs } from '../client/index';
|
|
2
|
+
export declare type Label = ComAtprotoLabelDefs.Label;
|
|
3
|
+
export declare type LabelPreference = 'ignore' | 'warn' | 'hide';
|
|
4
|
+
export declare type LabelDefinitionFlag = 'no-override' | 'adult';
|
|
5
|
+
export declare type LabelDefinitionOnWarnBehavior = 'blur' | 'blur-media' | 'alert' | null;
|
|
6
|
+
export interface LabelDefinitionLocalizedStrings {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
}
|
|
10
|
+
export declare type LabelDefinitionLocalizedStringsMap = Record<string, LabelDefinitionLocalizedStrings>;
|
|
11
|
+
export interface LabelDefinition {
|
|
12
|
+
id: string;
|
|
13
|
+
groupId: string;
|
|
14
|
+
configurable: boolean;
|
|
15
|
+
preferences: LabelPreference[];
|
|
16
|
+
flags: LabelDefinitionFlag[];
|
|
17
|
+
onwarn: LabelDefinitionOnWarnBehavior;
|
|
18
|
+
strings: {
|
|
19
|
+
settings: LabelDefinitionLocalizedStringsMap;
|
|
20
|
+
account: LabelDefinitionLocalizedStringsMap;
|
|
21
|
+
content: LabelDefinitionLocalizedStringsMap;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface LabelGroupDefinition {
|
|
25
|
+
id: string;
|
|
26
|
+
configurable: boolean;
|
|
27
|
+
labels: LabelDefinition[];
|
|
28
|
+
strings: {
|
|
29
|
+
settings: LabelDefinitionLocalizedStringsMap;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export declare type LabelDefinitionMap = Record<string, LabelDefinition>;
|
|
33
|
+
export declare type LabelGroupDefinitionMap = Record<string, LabelGroupDefinition>;
|
|
34
|
+
interface Labeler {
|
|
35
|
+
did: string;
|
|
36
|
+
displayName: string;
|
|
37
|
+
}
|
|
38
|
+
export interface LabelerSettings {
|
|
39
|
+
labeler: Labeler;
|
|
40
|
+
settings: Record<string, LabelPreference>;
|
|
41
|
+
}
|
|
42
|
+
export declare type ModerationSubjectProfile = AppBskyActorDefs.ProfileViewBasic | AppBskyActorDefs.ProfileView | AppBskyActorDefs.ProfileViewDetailed;
|
|
43
|
+
export declare type ModerationSubjectPost = AppBskyFeedDefs.PostView;
|
|
44
|
+
export declare type ModerationSubjectFeedGenerator = AppBskyFeedDefs.GeneratorView;
|
|
45
|
+
export declare type ModerationSubjectUserList = AppBskyGraphDefs.ListViewBasic | AppBskyGraphDefs.ListView;
|
|
46
|
+
export declare type ModerationSubject = ModerationSubjectProfile | ModerationSubjectPost | ModerationSubjectFeedGenerator | ModerationSubjectUserList;
|
|
47
|
+
export declare type ModerationCauseSource = {
|
|
48
|
+
type: 'user';
|
|
49
|
+
} | {
|
|
50
|
+
type: 'list';
|
|
51
|
+
list: AppBskyGraphDefs.ListViewBasic;
|
|
52
|
+
};
|
|
53
|
+
export declare type ModerationCause = {
|
|
54
|
+
type: 'blocking';
|
|
55
|
+
source: ModerationCauseSource;
|
|
56
|
+
priority: 3;
|
|
57
|
+
} | {
|
|
58
|
+
type: 'blocked-by';
|
|
59
|
+
source: ModerationCauseSource;
|
|
60
|
+
priority: 4;
|
|
61
|
+
} | {
|
|
62
|
+
type: 'label';
|
|
63
|
+
labeler: Labeler;
|
|
64
|
+
label: Label;
|
|
65
|
+
labelDef: LabelDefinition;
|
|
66
|
+
setting: LabelPreference;
|
|
67
|
+
priority: 1 | 2 | 5 | 7 | 8;
|
|
68
|
+
} | {
|
|
69
|
+
type: 'muted';
|
|
70
|
+
source: ModerationCauseSource;
|
|
71
|
+
priority: 6;
|
|
72
|
+
};
|
|
73
|
+
export interface ModerationOpts {
|
|
74
|
+
userDid: string;
|
|
75
|
+
adultContentEnabled: boolean;
|
|
76
|
+
labelerSettings: LabelerSettings[];
|
|
77
|
+
}
|
|
78
|
+
export declare class ModerationDecision {
|
|
79
|
+
cause: ModerationCause | undefined;
|
|
80
|
+
alert: boolean;
|
|
81
|
+
blur: boolean;
|
|
82
|
+
blurMedia: boolean;
|
|
83
|
+
filter: boolean;
|
|
84
|
+
noOverride: boolean;
|
|
85
|
+
additionalCauses: ModerationCause[];
|
|
86
|
+
did: string;
|
|
87
|
+
static noop(): ModerationDecision;
|
|
88
|
+
constructor(cause?: ModerationCause | undefined, alert?: boolean, blur?: boolean, blurMedia?: boolean, filter?: boolean, noOverride?: boolean, additionalCauses?: ModerationCause[], did?: string);
|
|
89
|
+
}
|
|
90
|
+
export interface ModerationUI {
|
|
91
|
+
filter?: boolean;
|
|
92
|
+
blur?: boolean;
|
|
93
|
+
alert?: boolean;
|
|
94
|
+
cause?: ModerationCause;
|
|
95
|
+
noOverride?: boolean;
|
|
96
|
+
}
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppBskyEmbedRecord, AppBskyEmbedRecordWithMedia } from '../client';
|
|
2
|
+
import { ModerationDecision, ModerationUI } from './types';
|
|
3
|
+
export declare function takeHighestPriorityDecision(...decisions: (ModerationDecision | undefined)[]): ModerationDecision;
|
|
4
|
+
export declare function downgradeDecision(decision: ModerationDecision, { alert }: {
|
|
5
|
+
alert: boolean;
|
|
6
|
+
}): void;
|
|
7
|
+
export declare function isModerationDecisionNoop(decision: ModerationDecision | undefined, { ignoreFilter }?: {
|
|
8
|
+
ignoreFilter: boolean;
|
|
9
|
+
}): boolean;
|
|
10
|
+
export declare function isQuotedPost(embed: unknown): embed is AppBskyEmbedRecord.View;
|
|
11
|
+
export declare function isQuotedPostWithMedia(embed: unknown): embed is AppBskyEmbedRecordWithMedia.View;
|
|
12
|
+
export declare function toModerationUI(decision: ModerationDecision): ModerationUI;
|