@atproto/ozone 0.0.8 → 0.0.10
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 +16 -0
- package/dist/api/moderation/util.d.ts +1 -1
- package/dist/db/index.js +300 -16
- package/dist/db/index.js.map +3 -3
- package/dist/db/migrations/20240208T213404429Z-add-tags-column-to-moderation-subject.d.ts +3 -0
- package/dist/db/migrations/index.d.ts +1 -0
- package/dist/db/schema/moderation_event.d.ts +3 -1
- package/dist/db/schema/moderation_subject_status.d.ts +1 -0
- package/dist/index.js +1193 -453
- package/dist/index.js.map +3 -3
- package/dist/lexicon/lexicons.d.ts +153 -5
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/actor/getPreferences.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/actor/getProfile.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/actor/getProfiles.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/actor/getSuggestions.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/actor/searchActors.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/actor/searchActorsTypeahead.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/describeFeedGenerator.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getActorFeeds.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getActorLikes.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getAuthorFeed.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getFeed.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getFeedGenerator.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getFeedGenerators.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getFeedSkeleton.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getLikes.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getListFeed.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getPostThread.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getPosts.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getRepostedBy.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getSuggestedFeeds.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getTimeline.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/searchPosts.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getBlocks.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getFollowers.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getFollows.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getList.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getListBlocks.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getListMutes.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getLists.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getMutes.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getRelationships.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/notification/getUnreadCount.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/unspecced/getPopularFeedGenerators.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/unspecced/getTaggedSuggestions.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/createCommunicationTemplate.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts +9 -0
- package/dist/lexicon/types/com/atproto/admin/emitModerationEvent.d.ts +3 -3
- package/dist/lexicon/types/com/atproto/admin/getAccountInfo.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/getAccountInfos.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/getInviteCodes.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/getModerationEvent.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/getRecord.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/getRepo.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/listCommunicationTemplates.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/queryModerationEvents.d.ts +4 -2
- package/dist/lexicon/types/com/atproto/admin/queryModerationStatuses.d.ts +4 -2
- package/dist/lexicon/types/com/atproto/admin/searchRepos.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/sendEmail.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/updateCommunicationTemplate.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/updateSubjectStatus.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/identity/resolveHandle.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/label/queryLabels.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/moderation/createReport.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/repo/createRecord.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/repo/describeRepo.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/repo/getRecord.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/repo/listRecords.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/repo/putRecord.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/repo/uploadBlob.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/createAccount.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/createAppPassword.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/createInviteCode.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/createInviteCodes.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/createSession.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/describeServer.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/getAccountInviteCodes.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/getSession.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/listAppPasswords.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/requestEmailUpdate.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/reserveSigningKey.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getBlob.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getBlocks.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getCheckout.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getHead.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getLatestCommit.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getRecord.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getRepo.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/listBlobs.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/temp/checkSignupQueue.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/temp/fetchLabels.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/temp/importRepo.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/temp/transferAccount.d.ts +2 -2
- package/dist/logger.d.ts +1 -0
- package/dist/mod-service/index.d.ts +18 -4
- package/dist/mod-service/lang.d.ts +15 -0
- package/dist/mod-service/status.d.ts +1 -1
- package/dist/mod-service/types.d.ts +1 -1
- package/dist/mod-service/views.d.ts +2 -1
- package/package.json +6 -6
- package/src/api/admin/emitModerationEvent.ts +22 -10
- package/src/api/admin/queryModerationEvents.ts +4 -0
- package/src/api/admin/queryModerationStatuses.ts +4 -0
- package/src/api/moderation/createReport.ts +15 -4
- package/src/api/moderation/util.ts +1 -0
- package/src/db/migrations/20240208T213404429Z-add-tags-column-to-moderation-subject.ts +31 -0
- package/src/db/migrations/index.ts +1 -0
- package/src/db/schema/moderation_event.ts +3 -0
- package/src/db/schema/moderation_subject_status.ts +1 -0
- package/src/lexicon/lexicons.ts +401 -123
- package/src/lexicon/types/app/bsky/actor/defs.ts +2 -0
- package/src/lexicon/types/app/bsky/actor/getPreferences.ts +2 -2
- package/src/lexicon/types/app/bsky/actor/getProfile.ts +3 -2
- package/src/lexicon/types/app/bsky/actor/getProfiles.ts +2 -2
- package/src/lexicon/types/app/bsky/actor/getSuggestions.ts +2 -2
- package/src/lexicon/types/app/bsky/actor/profile.ts +3 -0
- package/src/lexicon/types/app/bsky/actor/putPreferences.ts +1 -1
- package/src/lexicon/types/app/bsky/actor/searchActors.ts +2 -2
- package/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts +2 -2
- package/src/lexicon/types/app/bsky/embed/external.ts +1 -0
- package/src/lexicon/types/app/bsky/embed/images.ts +4 -0
- package/src/lexicon/types/app/bsky/embed/record.ts +1 -0
- package/src/lexicon/types/app/bsky/feed/defs.ts +1 -0
- package/src/lexicon/types/app/bsky/feed/describeFeedGenerator.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/getActorFeeds.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/getActorLikes.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/getAuthorFeed.ts +3 -2
- package/src/lexicon/types/app/bsky/feed/getFeed.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/getFeedGenerator.ts +5 -2
- package/src/lexicon/types/app/bsky/feed/getFeedGenerators.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/getFeedSkeleton.ts +3 -2
- package/src/lexicon/types/app/bsky/feed/getLikes.ts +4 -2
- package/src/lexicon/types/app/bsky/feed/getListFeed.ts +3 -2
- package/src/lexicon/types/app/bsky/feed/getPostThread.ts +5 -2
- package/src/lexicon/types/app/bsky/feed/getPosts.ts +3 -2
- package/src/lexicon/types/app/bsky/feed/getRepostedBy.ts +4 -2
- package/src/lexicon/types/app/bsky/feed/getSuggestedFeeds.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/getTimeline.ts +3 -2
- package/src/lexicon/types/app/bsky/feed/post.ts +5 -1
- package/src/lexicon/types/app/bsky/feed/searchPosts.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/threadgate.ts +1 -0
- package/src/lexicon/types/app/bsky/graph/block.ts +1 -0
- package/src/lexicon/types/app/bsky/graph/getBlocks.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/getFollowers.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/getFollows.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/getList.ts +3 -2
- package/src/lexicon/types/app/bsky/graph/getListBlocks.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/getListMutes.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/getLists.ts +3 -2
- package/src/lexicon/types/app/bsky/graph/getMutes.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/getRelationships.ts +4 -2
- package/src/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/list.ts +1 -0
- package/src/lexicon/types/app/bsky/graph/listblock.ts +1 -0
- package/src/lexicon/types/app/bsky/graph/listitem.ts +2 -0
- package/src/lexicon/types/app/bsky/graph/muteActor.ts +1 -1
- package/src/lexicon/types/app/bsky/graph/muteActorList.ts +1 -1
- package/src/lexicon/types/app/bsky/graph/unmuteActor.ts +1 -1
- package/src/lexicon/types/app/bsky/graph/unmuteActorList.ts +1 -1
- package/src/lexicon/types/app/bsky/notification/getUnreadCount.ts +2 -2
- package/src/lexicon/types/app/bsky/notification/listNotifications.ts +2 -2
- package/src/lexicon/types/app/bsky/notification/registerPush.ts +1 -1
- package/src/lexicon/types/app/bsky/notification/updateSeen.ts +1 -1
- package/src/lexicon/types/app/bsky/richtext/facet.ts +5 -4
- package/src/lexicon/types/app/bsky/unspecced/getPopularFeedGenerators.ts +2 -2
- package/src/lexicon/types/app/bsky/unspecced/getTaggedSuggestions.ts +2 -2
- package/src/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.ts +2 -2
- package/src/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/defs.ts +24 -0
- package/src/lexicon/types/com/atproto/admin/deleteAccount.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/disableAccountInvites.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/disableInviteCodes.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts +3 -2
- package/src/lexicon/types/com/atproto/admin/enableAccountInvites.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/getAccountInfo.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/getAccountInfos.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/getInviteCodes.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/getModerationEvent.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/getRecord.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/getRepo.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/getSubjectStatus.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts +6 -2
- package/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts +4 -2
- package/src/lexicon/types/com/atproto/admin/searchRepos.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/sendEmail.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/updateAccountEmail.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/updateAccountHandle.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/updateSubjectStatus.ts +2 -2
- package/src/lexicon/types/com/atproto/identity/resolveHandle.ts +2 -2
- package/src/lexicon/types/com/atproto/identity/updateHandle.ts +2 -1
- package/src/lexicon/types/com/atproto/label/queryLabels.ts +2 -2
- package/src/lexicon/types/com/atproto/label/subscribeLabels.ts +1 -1
- package/src/lexicon/types/com/atproto/moderation/createReport.ts +3 -2
- package/src/lexicon/types/com/atproto/repo/applyWrites.ts +7 -6
- package/src/lexicon/types/com/atproto/repo/createRecord.ts +6 -6
- package/src/lexicon/types/com/atproto/repo/deleteRecord.ts +3 -3
- package/src/lexicon/types/com/atproto/repo/describeRepo.ts +5 -2
- package/src/lexicon/types/com/atproto/repo/getRecord.ts +3 -3
- package/src/lexicon/types/com/atproto/repo/listRecords.ts +2 -2
- package/src/lexicon/types/com/atproto/repo/putRecord.ts +6 -6
- package/src/lexicon/types/com/atproto/repo/uploadBlob.ts +2 -2
- package/src/lexicon/types/com/atproto/server/confirmEmail.ts +1 -1
- package/src/lexicon/types/com/atproto/server/createAccount.ts +10 -2
- package/src/lexicon/types/com/atproto/server/createAppPassword.ts +3 -2
- package/src/lexicon/types/com/atproto/server/createInviteCode.ts +2 -2
- package/src/lexicon/types/com/atproto/server/createInviteCodes.ts +2 -2
- package/src/lexicon/types/com/atproto/server/createSession.ts +2 -2
- package/src/lexicon/types/com/atproto/server/deleteAccount.ts +1 -1
- package/src/lexicon/types/com/atproto/server/deleteSession.ts +1 -1
- package/src/lexicon/types/com/atproto/server/describeServer.ts +5 -2
- package/src/lexicon/types/com/atproto/server/getAccountInviteCodes.ts +3 -2
- package/src/lexicon/types/com/atproto/server/getSession.ts +2 -2
- package/src/lexicon/types/com/atproto/server/listAppPasswords.ts +2 -2
- package/src/lexicon/types/com/atproto/server/refreshSession.ts +2 -2
- package/src/lexicon/types/com/atproto/server/requestAccountDelete.ts +1 -1
- package/src/lexicon/types/com/atproto/server/requestEmailConfirmation.ts +1 -1
- package/src/lexicon/types/com/atproto/server/requestEmailUpdate.ts +2 -2
- package/src/lexicon/types/com/atproto/server/requestPasswordReset.ts +1 -1
- package/src/lexicon/types/com/atproto/server/reserveSigningKey.ts +4 -4
- package/src/lexicon/types/com/atproto/server/resetPassword.ts +1 -1
- package/src/lexicon/types/com/atproto/server/revokeAppPassword.ts +1 -1
- package/src/lexicon/types/com/atproto/server/updateEmail.ts +1 -1
- package/src/lexicon/types/com/atproto/sync/getBlob.ts +3 -3
- package/src/lexicon/types/com/atproto/sync/getBlocks.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/getCheckout.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/getHead.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/getLatestCommit.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/getRecord.ts +3 -2
- package/src/lexicon/types/com/atproto/sync/getRepo.ts +3 -3
- package/src/lexicon/types/com/atproto/sync/listBlobs.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/listRepos.ts +3 -2
- package/src/lexicon/types/com/atproto/sync/notifyOfUpdate.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/requestCrawl.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +17 -5
- package/src/lexicon/types/com/atproto/temp/checkSignupQueue.ts +2 -2
- package/src/lexicon/types/com/atproto/temp/fetchLabels.ts +2 -2
- package/src/lexicon/types/com/atproto/temp/importRepo.ts +2 -2
- package/src/lexicon/types/com/atproto/temp/pushBlob.ts +1 -1
- package/src/lexicon/types/com/atproto/temp/requestPhoneVerification.ts +1 -1
- package/src/lexicon/types/com/atproto/temp/transferAccount.ts +2 -2
- package/src/logger.ts +2 -0
- package/src/mod-service/index.ts +60 -10
- package/src/mod-service/lang.ts +82 -0
- package/src/mod-service/status.ts +18 -4
- package/src/mod-service/types.ts +1 -0
- package/src/mod-service/views.ts +21 -2
- package/tests/__snapshots__/get-record.test.ts.snap +6 -0
- package/tests/__snapshots__/get-repo.test.ts.snap +3 -0
- package/tests/__snapshots__/moderation-events.test.ts.snap +45 -4
- package/tests/__snapshots__/moderation-statuses.test.ts.snap +59 -3
- package/tests/__snapshots__/moderation.test.ts.snap +3 -3
- package/tests/get-record.test.ts +0 -8
- package/tests/moderation-events.test.ts +57 -5
- package/tests/moderation-status-tags.test.ts +92 -0
- package/tests/moderation-statuses.test.ts +20 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
}
|
|
5
5
|
export type InputSchema = undefined;
|
|
@@ -19,7 +19,7 @@ export interface HandlerError {
|
|
|
19
19
|
status: number;
|
|
20
20
|
message?: string;
|
|
21
21
|
}
|
|
22
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
22
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
23
23
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
24
24
|
auth: HA;
|
|
25
25
|
params: QueryParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
}
|
|
5
5
|
export interface InputSchema {
|
|
@@ -25,7 +25,7 @@ export interface HandlerError {
|
|
|
25
25
|
status: number;
|
|
26
26
|
message?: string;
|
|
27
27
|
}
|
|
28
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
28
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
29
29
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
30
30
|
auth: HA;
|
|
31
31
|
params: QueryParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import stream from 'stream';
|
|
4
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
4
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
did: string;
|
|
7
7
|
cid: string;
|
|
@@ -19,7 +19,7 @@ export interface HandlerError {
|
|
|
19
19
|
status: number;
|
|
20
20
|
message?: string;
|
|
21
21
|
}
|
|
22
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
22
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
23
23
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
24
24
|
auth: HA;
|
|
25
25
|
params: QueryParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import stream from 'stream';
|
|
4
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
4
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
did: string;
|
|
7
7
|
cids: string[];
|
|
@@ -19,7 +19,7 @@ export interface HandlerError {
|
|
|
19
19
|
status: number;
|
|
20
20
|
message?: string;
|
|
21
21
|
}
|
|
22
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
22
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
23
23
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
24
24
|
auth: HA;
|
|
25
25
|
params: QueryParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import stream from 'stream';
|
|
4
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
4
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
did: string;
|
|
7
7
|
}
|
|
@@ -18,7 +18,7 @@ export interface HandlerError {
|
|
|
18
18
|
status: number;
|
|
19
19
|
message?: string;
|
|
20
20
|
}
|
|
21
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
21
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
22
22
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
23
23
|
auth: HA;
|
|
24
24
|
params: QueryParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
did: string;
|
|
5
5
|
}
|
|
@@ -21,7 +21,7 @@ export interface HandlerError {
|
|
|
21
21
|
message?: string;
|
|
22
22
|
error?: 'HeadNotFound';
|
|
23
23
|
}
|
|
24
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
24
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
25
25
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
26
26
|
auth: HA;
|
|
27
27
|
params: QueryParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
did: string;
|
|
5
5
|
}
|
|
@@ -22,7 +22,7 @@ export interface HandlerError {
|
|
|
22
22
|
message?: string;
|
|
23
23
|
error?: 'RepoNotFound';
|
|
24
24
|
}
|
|
25
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
25
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
26
26
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
27
27
|
auth: HA;
|
|
28
28
|
params: QueryParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import stream from 'stream';
|
|
4
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
4
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
did: string;
|
|
7
7
|
collection: string;
|
|
@@ -21,7 +21,7 @@ export interface HandlerError {
|
|
|
21
21
|
status: number;
|
|
22
22
|
message?: string;
|
|
23
23
|
}
|
|
24
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
24
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
25
25
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
26
26
|
auth: HA;
|
|
27
27
|
params: QueryParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import stream from 'stream';
|
|
4
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
4
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
did: string;
|
|
7
7
|
since?: string;
|
|
@@ -19,7 +19,7 @@ export interface HandlerError {
|
|
|
19
19
|
status: number;
|
|
20
20
|
message?: string;
|
|
21
21
|
}
|
|
22
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
22
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
23
23
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
24
24
|
auth: HA;
|
|
25
25
|
params: QueryParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
did: string;
|
|
5
5
|
since?: string;
|
|
@@ -24,7 +24,7 @@ export interface HandlerError {
|
|
|
24
24
|
status: number;
|
|
25
25
|
message?: string;
|
|
26
26
|
}
|
|
27
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
27
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
28
28
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
29
29
|
auth: HA;
|
|
30
30
|
params: QueryParams;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { ValidationResult } from '@atproto/lexicon';
|
|
3
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
3
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
4
4
|
export interface QueryParams {
|
|
5
5
|
limit: number;
|
|
6
6
|
cursor?: string;
|
|
@@ -23,7 +23,7 @@ export interface HandlerError {
|
|
|
23
23
|
status: number;
|
|
24
24
|
message?: string;
|
|
25
25
|
}
|
|
26
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
26
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
27
27
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
28
28
|
auth: HA;
|
|
29
29
|
params: QueryParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
}
|
|
5
5
|
export type InputSchema = undefined;
|
|
@@ -21,7 +21,7 @@ export interface HandlerError {
|
|
|
21
21
|
status: number;
|
|
22
22
|
message?: string;
|
|
23
23
|
}
|
|
24
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
24
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
25
25
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
26
26
|
auth: HA;
|
|
27
27
|
params: QueryParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
import * as ComAtprotoLabelDefs from '../label/defs';
|
|
4
4
|
export interface QueryParams {
|
|
5
5
|
since?: number;
|
|
@@ -22,7 +22,7 @@ export interface HandlerError {
|
|
|
22
22
|
status: number;
|
|
23
23
|
message?: string;
|
|
24
24
|
}
|
|
25
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
25
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
26
26
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
27
27
|
auth: HA;
|
|
28
28
|
params: QueryParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import stream from 'stream';
|
|
4
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
4
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
did: string;
|
|
7
7
|
}
|
|
@@ -21,7 +21,7 @@ export interface HandlerError {
|
|
|
21
21
|
status: number;
|
|
22
22
|
message?: string;
|
|
23
23
|
}
|
|
24
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
24
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
25
25
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
26
26
|
auth: HA;
|
|
27
27
|
params: QueryParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
}
|
|
5
5
|
export interface InputSchema {
|
|
@@ -31,7 +31,7 @@ export interface HandlerError {
|
|
|
31
31
|
message?: string;
|
|
32
32
|
error?: 'InvalidHandle' | 'InvalidPassword' | 'InvalidInviteCode' | 'HandleNotAvailable' | 'UnsupportedDomain' | 'UnresolvableDid' | 'IncompatibleDidDoc';
|
|
33
33
|
}
|
|
34
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
34
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
35
35
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
36
36
|
auth: HA;
|
|
37
37
|
params: QueryParams;
|
package/dist/logger.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { subsystemLogger } from '@atproto/common';
|
|
2
2
|
export declare const dbLogger: ReturnType<typeof subsystemLogger>;
|
|
3
3
|
export declare const httpLogger: ReturnType<typeof subsystemLogger>;
|
|
4
|
+
export declare const langLogger: ReturnType<typeof subsystemLogger>;
|
|
4
5
|
export declare const loggerMiddleware: import("pino-http").HttpLogger;
|
|
@@ -38,6 +38,8 @@ export declare class ModerationService {
|
|
|
38
38
|
createdBefore?: string;
|
|
39
39
|
addedLabels: string[];
|
|
40
40
|
removedLabels: string[];
|
|
41
|
+
addedTags: string[];
|
|
42
|
+
removedTags: string[];
|
|
41
43
|
reportTypes?: string[];
|
|
42
44
|
}): Promise<{
|
|
43
45
|
cursor?: string;
|
|
@@ -60,6 +62,7 @@ export declare class ModerationService {
|
|
|
60
62
|
comment: string | null;
|
|
61
63
|
lastReportedAt: string | null;
|
|
62
64
|
lastReviewedAt: string | null;
|
|
65
|
+
tags: string[] | null;
|
|
63
66
|
muteUntil: string | null;
|
|
64
67
|
lastReviewedBy: string | null;
|
|
65
68
|
lastAppealedAt: string | null;
|
|
@@ -74,7 +77,10 @@ export declare class ModerationService {
|
|
|
74
77
|
subject: ModSubject;
|
|
75
78
|
createdBy: string;
|
|
76
79
|
createdAt?: Date;
|
|
77
|
-
}): Promise<
|
|
80
|
+
}): Promise<{
|
|
81
|
+
event: ModerationEventRow;
|
|
82
|
+
subjectStatus: ModerationSubjectStatusRow | null;
|
|
83
|
+
}>;
|
|
78
84
|
getLastReversibleEventForSubject(subject: ReversalSubject): Promise<{
|
|
79
85
|
id: number;
|
|
80
86
|
subjectBlobCids: string[] | null;
|
|
@@ -84,7 +90,7 @@ export declare class ModerationService {
|
|
|
84
90
|
createLabelVals: string | null;
|
|
85
91
|
negateLabelVals: string | null;
|
|
86
92
|
durationInHours: number | null;
|
|
87
|
-
action: "com.atproto.admin.defs#modEventTakedown" | "com.atproto.admin.defs#modEventAcknowledge" | "com.atproto.admin.defs#modEventEscalate" | "com.atproto.admin.defs#modEventComment" | "com.atproto.admin.defs#modEventLabel" | "com.atproto.admin.defs#modEventReport" | "com.atproto.admin.defs#modEventMute" | "com.atproto.admin.defs#modEventReverseTakedown" | "com.atproto.admin.defs#modEventEmail" | "com.atproto.admin.defs#modEventResolveAppeal";
|
|
93
|
+
action: "com.atproto.admin.defs#modEventTakedown" | "com.atproto.admin.defs#modEventAcknowledge" | "com.atproto.admin.defs#modEventEscalate" | "com.atproto.admin.defs#modEventComment" | "com.atproto.admin.defs#modEventLabel" | "com.atproto.admin.defs#modEventReport" | "com.atproto.admin.defs#modEventMute" | "com.atproto.admin.defs#modEventReverseTakedown" | "com.atproto.admin.defs#modEventEmail" | "com.atproto.admin.defs#modEventResolveAppeal" | "com.atproto.admin.defs#modEventTag";
|
|
88
94
|
subjectType: "com.atproto.admin.defs#repoRef" | "com.atproto.repo.strongRef";
|
|
89
95
|
subjectDid: string;
|
|
90
96
|
subjectUri: string | null;
|
|
@@ -92,6 +98,8 @@ export declare class ModerationService {
|
|
|
92
98
|
meta: Record<string, string | boolean> | null;
|
|
93
99
|
expiresAt: string | null;
|
|
94
100
|
legacyRefId: number | null;
|
|
101
|
+
addedTags: string[] | null;
|
|
102
|
+
removedTags: string[] | null;
|
|
95
103
|
} | null | undefined>;
|
|
96
104
|
getSubjectsDueForReversal(): Promise<ReversalSubject[]>;
|
|
97
105
|
isSubjectSuspended(did: string): Promise<boolean>;
|
|
@@ -106,8 +114,11 @@ export declare class ModerationService {
|
|
|
106
114
|
subject: ModSubject;
|
|
107
115
|
reportedBy: string;
|
|
108
116
|
createdAt?: Date;
|
|
109
|
-
}): Promise<
|
|
110
|
-
|
|
117
|
+
}): Promise<{
|
|
118
|
+
event: ModerationEventRow;
|
|
119
|
+
subjectStatus: ModerationSubjectStatusRow | null;
|
|
120
|
+
}>;
|
|
121
|
+
getSubjectStatuses({ cursor, limit, takendown, appealed, reviewState, reviewedAfter, reviewedBefore, reportedAfter, reportedBefore, includeMuted, ignoreSubjects, sortDirection, lastReviewedBy, sortField, subject, tags, excludeTags, }: {
|
|
111
122
|
cursor?: string;
|
|
112
123
|
limit?: number;
|
|
113
124
|
takendown?: boolean;
|
|
@@ -123,6 +134,8 @@ export declare class ModerationService {
|
|
|
123
134
|
sortDirection: 'asc' | 'desc';
|
|
124
135
|
lastReviewedBy?: string;
|
|
125
136
|
sortField: 'lastReviewedAt' | 'lastReportedAt';
|
|
137
|
+
tags: string[];
|
|
138
|
+
excludeTags: string[];
|
|
126
139
|
}): Promise<{
|
|
127
140
|
statuses: {
|
|
128
141
|
handle: string;
|
|
@@ -135,6 +148,7 @@ export declare class ModerationService {
|
|
|
135
148
|
comment: string | null;
|
|
136
149
|
lastReportedAt: string | null;
|
|
137
150
|
lastReviewedAt: string | null;
|
|
151
|
+
tags: string[] | null;
|
|
138
152
|
muteUntil: string | null;
|
|
139
153
|
lastReviewedBy: string | null;
|
|
140
154
|
lastAppealedAt: string | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ModerationService } from '.';
|
|
2
|
+
import { ModSubject } from './subject';
|
|
3
|
+
import { ModerationSubjectStatusRow } from './types';
|
|
4
|
+
export declare class ModerationLangService {
|
|
5
|
+
private moderationService;
|
|
6
|
+
constructor(moderationService: ModerationService);
|
|
7
|
+
tagSubjectWithLang({ subject, subjectStatus, createdBy, }: {
|
|
8
|
+
subject: ModSubject;
|
|
9
|
+
createdBy: string;
|
|
10
|
+
subjectStatus: ModerationSubjectStatusRow | null;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
getRecordLang({ subject, }: {
|
|
13
|
+
subject: ModSubject;
|
|
14
|
+
}): Promise<string[] | null>;
|
|
15
|
+
}
|
|
@@ -2,7 +2,7 @@ import { AtUri } from '@atproto/syntax';
|
|
|
2
2
|
import { Database } from '../db';
|
|
3
3
|
import { ModerationSubjectStatus } from '../db/schema/moderation_subject_status';
|
|
4
4
|
import { ModerationEventRow } from './types';
|
|
5
|
-
export declare const adjustModerationSubjectStatus: (db: Database, moderationEvent: ModerationEventRow, blobCids?: string[]) => Promise<import("kysely").
|
|
5
|
+
export declare const adjustModerationSubjectStatus: (db: Database, moderationEvent: ModerationEventRow, blobCids?: string[]) => Promise<import("kysely").Selectable<ModerationSubjectStatus> | null>;
|
|
6
6
|
type ModerationSubjectStatusFilter = Pick<ModerationSubjectStatus, 'did'> | Pick<ModerationSubjectStatus, 'did' | 'recordPath'> | Pick<ModerationSubjectStatus, 'did' | 'recordPath' | 'recordCid'>;
|
|
7
7
|
export declare const getModerationSubjectStatus: (db: Database, filters: ModerationSubjectStatusFilter) => Promise<{} | undefined>;
|
|
8
8
|
export declare const getStatusIdentifierFromSubject: (subject: string | AtUri) => {
|
|
@@ -16,6 +16,6 @@ export type ModerationSubjectStatusRow = Selectable<ModerationSubjectStatus>;
|
|
|
16
16
|
export type ModerationSubjectStatusRowWithHandle = ModerationSubjectStatusRow & {
|
|
17
17
|
handle: string | null;
|
|
18
18
|
};
|
|
19
|
-
export type ModEventType = ComAtprotoAdminDefs.ModEventTakedown | ComAtprotoAdminDefs.ModEventAcknowledge | ComAtprotoAdminDefs.ModEventEscalate | ComAtprotoAdminDefs.ModEventComment | ComAtprotoAdminDefs.ModEventLabel | ComAtprotoAdminDefs.ModEventReport | ComAtprotoAdminDefs.ModEventMute | ComAtprotoAdminDefs.ModEventReverseTakedown;
|
|
19
|
+
export type ModEventType = ComAtprotoAdminDefs.ModEventTakedown | ComAtprotoAdminDefs.ModEventAcknowledge | ComAtprotoAdminDefs.ModEventEscalate | ComAtprotoAdminDefs.ModEventComment | ComAtprotoAdminDefs.ModEventLabel | ComAtprotoAdminDefs.ModEventReport | ComAtprotoAdminDefs.ModEventMute | ComAtprotoAdminDefs.ModEventReverseTakedown | ComAtprotoAdminDefs.ModEventTag;
|
|
20
20
|
export declare const UNSPECCED_TAKEDOWN_LABEL = "!unspecced-takedown";
|
|
21
21
|
export declare const UNSPECCED_TAKEDOWN_BLOBS_LABEL = "!unspecced-takedown-blobs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import AtpAgent from '@atproto/api';
|
|
1
|
+
import AtpAgent, { AppBskyFeedDefs } from '@atproto/api';
|
|
2
2
|
import { BlobRef } from '@atproto/lexicon';
|
|
3
3
|
import { Database } from '../db';
|
|
4
4
|
import { ModEventView, RepoView, RepoViewDetail, RecordView, RecordViewDetail, ReportViewDetail, BlobView, SubjectStatusView, ModEventViewDetail, AccountView } from '../lexicon/types/com/atproto/admin/defs';
|
|
@@ -29,6 +29,7 @@ export declare class ModerationViews {
|
|
|
29
29
|
labels(subject: string, includeNeg?: boolean): Promise<Label[]>;
|
|
30
30
|
getSubjectStatus(subjects: string[]): Promise<Map<string, ModerationSubjectStatusRowWithHandle>>;
|
|
31
31
|
formatSubjectStatus(status: ModerationSubjectStatusRowWithHandle): SubjectStatusView;
|
|
32
|
+
fetchAuthorFeed(actor: string): Promise<AppBskyFeedDefs.FeedViewPost[]>;
|
|
32
33
|
}
|
|
33
34
|
type RecordSubject = {
|
|
34
35
|
uri: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/ozone",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Backend service for moderating the Bluesky network.",
|
|
6
6
|
"keywords": [
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"pino-http": "^8.2.1",
|
|
31
31
|
"typed-emitter": "^2.1.0",
|
|
32
32
|
"uint8arrays": "3.0.0",
|
|
33
|
-
"@atproto/api": "^0.9.
|
|
33
|
+
"@atproto/api": "^0.9.8",
|
|
34
34
|
"@atproto/common": "^0.3.3",
|
|
35
35
|
"@atproto/crypto": "^0.3.0",
|
|
36
|
-
"@atproto/syntax": "^0.1.5",
|
|
37
36
|
"@atproto/identity": "^0.3.2",
|
|
38
37
|
"@atproto/lexicon": "^0.3.1",
|
|
38
|
+
"@atproto/syntax": "^0.1.5",
|
|
39
39
|
"@atproto/xrpc-server": "^0.4.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"@types/pg": "^8.6.6",
|
|
47
47
|
"@types/qs": "^6.9.7",
|
|
48
48
|
"axios": "^0.27.2",
|
|
49
|
-
"@atproto/api": "^0.9.
|
|
50
|
-
"@atproto/dev-env": "^0.2.
|
|
49
|
+
"@atproto/api": "^0.9.8",
|
|
50
|
+
"@atproto/dev-env": "^0.2.31",
|
|
51
51
|
"@atproto/lex-cli": "^0.3.0",
|
|
52
|
-
"@atproto/pds": "^0.3.
|
|
52
|
+
"@atproto/pds": "^0.3.19",
|
|
53
53
|
"@atproto/xrpc": "^0.4.1"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
isModEventTakedown,
|
|
8
8
|
} from '../../lexicon/types/com/atproto/admin/defs'
|
|
9
9
|
import { subjectFromInput } from '../../mod-service/subject'
|
|
10
|
+
import { ModerationLangService } from '../../mod-service/lang'
|
|
10
11
|
|
|
11
12
|
export default function (server: Server, ctx: AppContext) {
|
|
12
13
|
server.com.atproto.admin.emitModerationEvent({
|
|
@@ -77,10 +78,21 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
77
78
|
createdBy,
|
|
78
79
|
})
|
|
79
80
|
|
|
81
|
+
const moderationLangService = new ModerationLangService(moderationTxn)
|
|
82
|
+
await moderationLangService.tagSubjectWithLang({
|
|
83
|
+
subject,
|
|
84
|
+
createdBy: ctx.cfg.service.did,
|
|
85
|
+
subjectStatus: result.subjectStatus,
|
|
86
|
+
})
|
|
87
|
+
|
|
80
88
|
if (subject.isRepo()) {
|
|
81
89
|
if (isTakedownEvent) {
|
|
82
|
-
const isSuspend = !!result.durationInHours
|
|
83
|
-
await moderationTxn.takedownRepo(
|
|
90
|
+
const isSuspend = !!result.event.durationInHours
|
|
91
|
+
await moderationTxn.takedownRepo(
|
|
92
|
+
subject,
|
|
93
|
+
result.event.id,
|
|
94
|
+
isSuspend,
|
|
95
|
+
)
|
|
84
96
|
} else if (isReverseTakedownEvent) {
|
|
85
97
|
await moderationTxn.reverseTakedownRepo(subject)
|
|
86
98
|
}
|
|
@@ -88,7 +100,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
88
100
|
|
|
89
101
|
if (subject.isRecord()) {
|
|
90
102
|
if (isTakedownEvent) {
|
|
91
|
-
await moderationTxn.takedownRecord(subject, result.id)
|
|
103
|
+
await moderationTxn.takedownRecord(subject, result.event.id)
|
|
92
104
|
} else if (isReverseTakedownEvent) {
|
|
93
105
|
await moderationTxn.reverseTakedownRecord(subject)
|
|
94
106
|
}
|
|
@@ -96,20 +108,20 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
96
108
|
|
|
97
109
|
if (isLabelEvent) {
|
|
98
110
|
await moderationTxn.formatAndCreateLabels(
|
|
99
|
-
result.subjectUri ?? result.subjectDid,
|
|
100
|
-
result.subjectCid,
|
|
111
|
+
result.event.subjectUri ?? result.event.subjectDid,
|
|
112
|
+
result.event.subjectCid,
|
|
101
113
|
{
|
|
102
|
-
create: result.createLabelVals?.length
|
|
103
|
-
? result.createLabelVals.split(' ')
|
|
114
|
+
create: result.event.createLabelVals?.length
|
|
115
|
+
? result.event.createLabelVals.split(' ')
|
|
104
116
|
: undefined,
|
|
105
|
-
negate: result.negateLabelVals?.length
|
|
106
|
-
? result.negateLabelVals.split(' ')
|
|
117
|
+
negate: result.event.negateLabelVals?.length
|
|
118
|
+
? result.event.negateLabelVals.split(' ')
|
|
107
119
|
: undefined,
|
|
108
120
|
},
|
|
109
121
|
)
|
|
110
122
|
}
|
|
111
123
|
|
|
112
|
-
return result
|
|
124
|
+
return result.event
|
|
113
125
|
})
|
|
114
126
|
|
|
115
127
|
return {
|
|
@@ -20,6 +20,8 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
20
20
|
createdBefore,
|
|
21
21
|
addedLabels = [],
|
|
22
22
|
removedLabels = [],
|
|
23
|
+
addedTags = [],
|
|
24
|
+
removedTags = [],
|
|
23
25
|
reportTypes,
|
|
24
26
|
} = params
|
|
25
27
|
const db = ctx.db
|
|
@@ -37,7 +39,9 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
37
39
|
createdAfter,
|
|
38
40
|
createdBefore,
|
|
39
41
|
addedLabels,
|
|
42
|
+
addedTags,
|
|
40
43
|
removedLabels,
|
|
44
|
+
removedTags,
|
|
41
45
|
reportTypes,
|
|
42
46
|
})
|
|
43
47
|
return {
|
|
@@ -22,6 +22,8 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
22
22
|
includeMuted = false,
|
|
23
23
|
limit = 50,
|
|
24
24
|
cursor,
|
|
25
|
+
tags = [],
|
|
26
|
+
excludeTags = [],
|
|
25
27
|
} = params
|
|
26
28
|
const db = ctx.db
|
|
27
29
|
const modService = ctx.modService(db)
|
|
@@ -41,6 +43,8 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
41
43
|
sortField,
|
|
42
44
|
limit,
|
|
43
45
|
cursor,
|
|
46
|
+
tags,
|
|
47
|
+
excludeTags,
|
|
44
48
|
})
|
|
45
49
|
const subjectStatuses = results.statuses.map((status) =>
|
|
46
50
|
modService.views.formatSubjectStatus(status),
|
|
@@ -4,6 +4,7 @@ import { getReasonType } from './util'
|
|
|
4
4
|
import { subjectFromInput } from '../../mod-service/subject'
|
|
5
5
|
import { REASONAPPEAL } from '../../lexicon/types/com/atproto/moderation/defs'
|
|
6
6
|
import { ForbiddenError } from '@atproto/xrpc-server'
|
|
7
|
+
import { ModerationLangService } from '../../mod-service/lang'
|
|
7
8
|
|
|
8
9
|
export default function (server: Server, ctx: AppContext) {
|
|
9
10
|
server.com.atproto.moderation.createReport({
|
|
@@ -23,12 +24,22 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
23
24
|
const db = ctx.db
|
|
24
25
|
const report = await db.transaction(async (dbTxn) => {
|
|
25
26
|
const moderationTxn = ctx.modService(dbTxn)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const { event: reportEvent, subjectStatus } =
|
|
28
|
+
await moderationTxn.report({
|
|
29
|
+
reasonType: getReasonType(reasonType),
|
|
30
|
+
reason,
|
|
31
|
+
subject,
|
|
32
|
+
reportedBy: requester || ctx.cfg.service.did,
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const moderationLangService = new ModerationLangService(moderationTxn)
|
|
36
|
+
await moderationLangService.tagSubjectWithLang({
|
|
29
37
|
subject,
|
|
30
|
-
|
|
38
|
+
subjectStatus,
|
|
39
|
+
createdBy: ctx.cfg.service.did,
|
|
31
40
|
})
|
|
41
|
+
|
|
42
|
+
return reportEvent
|
|
32
43
|
})
|
|
33
44
|
|
|
34
45
|
const body = ctx.modService(db).views.formatReport(report)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Kysely } from 'kysely'
|
|
2
|
+
|
|
3
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
4
|
+
await db.schema
|
|
5
|
+
.alterTable('moderation_event')
|
|
6
|
+
.addColumn('addedTags', 'jsonb')
|
|
7
|
+
.execute()
|
|
8
|
+
await db.schema
|
|
9
|
+
.alterTable('moderation_event')
|
|
10
|
+
.addColumn('removedTags', 'jsonb')
|
|
11
|
+
.execute()
|
|
12
|
+
await db.schema
|
|
13
|
+
.alterTable('moderation_subject_status')
|
|
14
|
+
.addColumn('tags', 'jsonb')
|
|
15
|
+
.execute()
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
19
|
+
await db.schema
|
|
20
|
+
.alterTable('moderation_event')
|
|
21
|
+
.dropColumn('addedTags')
|
|
22
|
+
.execute()
|
|
23
|
+
await db.schema
|
|
24
|
+
.alterTable('moderation_event')
|
|
25
|
+
.dropColumn('removedTags')
|
|
26
|
+
.execute()
|
|
27
|
+
await db.schema
|
|
28
|
+
.alterTable('moderation_subject_status')
|
|
29
|
+
.dropColumn('tags')
|
|
30
|
+
.execute()
|
|
31
|
+
}
|
|
@@ -5,3 +5,4 @@
|
|
|
5
5
|
export * as _20231219T205730722Z from './20231219T205730722Z-init'
|
|
6
6
|
export * as _20240116T085607200Z from './20240116T085607200Z-communication-template'
|
|
7
7
|
export * as _20240201T051104136Z from './20240201T051104136Z-mod-event-blobs'
|
|
8
|
+
export * as _20240208T213404429Z from './20240208T213404429Z-add-tags-column-to-moderation-subject'
|
|
@@ -15,6 +15,7 @@ export interface ModerationEvent {
|
|
|
15
15
|
| 'com.atproto.admin.defs#modEventReverseTakedown'
|
|
16
16
|
| 'com.atproto.admin.defs#modEventEmail'
|
|
17
17
|
| 'com.atproto.admin.defs#modEventResolveAppeal'
|
|
18
|
+
| 'com.atproto.admin.defs#modEventTag'
|
|
18
19
|
subjectType: 'com.atproto.admin.defs#repoRef' | 'com.atproto.repo.strongRef'
|
|
19
20
|
subjectDid: string
|
|
20
21
|
subjectUri: string | null
|
|
@@ -28,6 +29,8 @@ export interface ModerationEvent {
|
|
|
28
29
|
durationInHours: number | null
|
|
29
30
|
expiresAt: string | null
|
|
30
31
|
meta: Record<string, string | boolean> | null
|
|
32
|
+
addedTags: string[] | null
|
|
33
|
+
removedTags: string[] | null
|
|
31
34
|
legacyRefId: number | null
|
|
32
35
|
}
|
|
33
36
|
|