From 9a9f61a6c05926f0ba5c4d9243dbcf0d2bf7b36d Mon Sep 17 00:00:00 2001 From: Marie Date: Thu, 28 Dec 2023 12:52:12 +0100 Subject: [PATCH] fix: typecheck --- .../backend/src/server/api/endpoints/admin/approve-user.ts | 1 + .../backend/src/server/api/endpoints/admin/nsfw-user.ts | 1 + .../backend/src/server/api/endpoints/admin/silence-user.ts | 1 + .../backend/src/server/api/endpoints/admin/unnsfw-user.ts | 1 + .../src/server/api/endpoints/admin/unsilence-user.ts | 1 + .../src/server/api/endpoints/i/registry/get-unsecure.ts | 1 + .../src/server/api/stream/channels/bubble-timeline.ts | 7 ++++--- packages/misskey-js/src/consts.ts | 5 +++++ 8 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/admin/approve-user.ts b/packages/backend/src/server/api/endpoints/admin/approve-user.ts index 0ea656ddaf..53002a71fd 100644 --- a/packages/backend/src/server/api/endpoints/admin/approve-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/approve-user.ts @@ -10,6 +10,7 @@ export const meta = { requireCredential: true, requireModerator: true, + kind: 'write:admin:approve-user', } as const; export const paramDef = { diff --git a/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts b/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts index 2dff0e8d09..2a47abe03c 100644 --- a/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts @@ -8,6 +8,7 @@ export const meta = { requireCredential: true, requireModerator: true, + kind: 'write:admin:nsfw-user', } as const; export const paramDef = { diff --git a/packages/backend/src/server/api/endpoints/admin/silence-user.ts b/packages/backend/src/server/api/endpoints/admin/silence-user.ts index ed1141da43..007bed5c03 100644 --- a/packages/backend/src/server/api/endpoints/admin/silence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/silence-user.ts @@ -9,6 +9,7 @@ export const meta = { requireCredential: true, requireModerator: true, + kind: 'write:admin:silence-user', } as const; export const paramDef = { diff --git a/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts b/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts index 9c414ed55c..013e7771ba 100644 --- a/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts @@ -8,6 +8,7 @@ export const meta = { requireCredential: true, requireModerator: true, + kind: 'write:admin:unnsfw-user', } as const; export const paramDef = { diff --git a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts index 7cfedca7de..5e514ccda6 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts @@ -8,6 +8,7 @@ export const meta = { requireCredential: true, requireModerator: true, + kind: 'write:admin:unsilence-user', } as const; export const paramDef = { diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts b/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts index 74d896e650..bb471284c9 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts @@ -6,6 +6,7 @@ import { ApiError } from '../../../error.js'; export const meta = { requireCredential: true, + kind: 'read:account', secure: false, diff --git a/packages/backend/src/server/api/stream/channels/bubble-timeline.ts b/packages/backend/src/server/api/stream/channels/bubble-timeline.ts index 1a3fcede62..4f8809edbe 100644 --- a/packages/backend/src/server/api/stream/channels/bubble-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/bubble-timeline.ts @@ -13,12 +13,12 @@ import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { bindThis } from '@/decorators.js'; import { RoleService } from '@/core/RoleService.js'; import type { MiMeta } from '@/models/Meta.js'; -import Channel from '../channel.js'; +import Channel, { MiChannelService } from '../channel.js'; class BubbleTimelineChannel extends Channel { public readonly chName = 'bubbleTimeline'; public static shouldShare = false; - public static requireCredential = false; + public static requireCredential = false as const; private withRenotes: boolean; private withFiles: boolean; private withBots: boolean; @@ -100,9 +100,10 @@ class BubbleTimelineChannel extends Channel { } @Injectable() -export class BubbleTimelineChannelService { +export class BubbleTimelineChannelService implements MiChannelService { public readonly shouldShare = BubbleTimelineChannel.shouldShare; public readonly requireCredential = BubbleTimelineChannel.requireCredential; + public readonly kind = BubbleTimelineChannel.kind; constructor( private metaService: MetaService, diff --git a/packages/misskey-js/src/consts.ts b/packages/misskey-js/src/consts.ts index 9b25e2af74..0748d9863e 100644 --- a/packages/misskey-js/src/consts.ts +++ b/packages/misskey-js/src/consts.ts @@ -60,6 +60,11 @@ export const permissions = [ 'read:admin:show-user', 'read:admin:show-users', 'write:admin:suspend-user', + 'write:admin:approve-user', + 'write:admin:nsfw-user', + 'write:admin:unnsfw-user', + 'write:admin:silence-user', + 'write:admin:unsilence-user', 'write:admin:unset-user-avatar', 'write:admin:unset-user-banner', 'write:admin:unsuspend-user',