diff --git a/src/server/api/define.ts b/src/server/api/define.ts index f9e9813a877fe7443f5132cb1c93cbcd66c00100..d4ca5aa8099e8e4eb2c23039be3615cbf793fa40 100644 --- a/src/server/api/define.ts +++ b/src/server/api/define.ts @@ -14,12 +14,12 @@ type Params<T extends IEndpointMeta> = { export type Response = Record<string, any> | void; type executor<T extends IEndpointMeta> = - (params: Params<T>, user: ILocalUser, app: App, file?: any, cleanup?: Function) => + (params: Params<T>, user: T['requireCredential'] extends true ? ILocalUser : ILocalUser | null, app: App, file?: any, cleanup?: Function) => Promise<T['res'] extends undefined ? Response : SchemaType<NonNullable<T['res']>>>; export default function <T extends IEndpointMeta>(meta: T, cb: executor<T>) - : (params: any, user: ILocalUser, app: App, file?: any) => Promise<any> { - return (params: any, user: ILocalUser, app: App, file?: any) => { + : (params: any, user: T['requireCredential'] extends true ? ILocalUser : ILocalUser | null, app: App, file?: any) => Promise<any> { + return (params: any, user: T['requireCredential'] extends true ? ILocalUser : ILocalUser | null, app: App, file?: any) => { function cleanup() { fs.unlink(file.path, () => {}); } diff --git a/src/server/api/endpoints/admin/abuse-user-reports.ts b/src/server/api/endpoints/admin/abuse-user-reports.ts index 63d1dd795cfa69a80c07e273449807aaaf7350a4..d5a52184d1fbe7fa58658a0e25311f714489c1be 100644 --- a/src/server/api/endpoints/admin/abuse-user-reports.ts +++ b/src/server/api/endpoints/admin/abuse-user-reports.ts @@ -7,7 +7,7 @@ import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/announcements/create.ts b/src/server/api/endpoints/admin/announcements/create.ts index c1d48a7d3857c7c7f00981b23f14b06af52a9da9..f9fb30f49f9e1633dc8f392b115ede0bbeec50b3 100644 --- a/src/server/api/endpoints/admin/announcements/create.ts +++ b/src/server/api/endpoints/admin/announcements/create.ts @@ -6,7 +6,7 @@ import { genId } from '../../../../../misc/gen-id'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/announcements/delete.ts b/src/server/api/endpoints/admin/announcements/delete.ts index 284b4bf54925a1ff6d3e08df57b6c05c9898bb6a..1b7a0bf9213774b8e989fc45407251408fc1bd9a 100644 --- a/src/server/api/endpoints/admin/announcements/delete.ts +++ b/src/server/api/endpoints/admin/announcements/delete.ts @@ -7,7 +7,7 @@ import { ApiError } from '../../../error'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/announcements/list.ts b/src/server/api/endpoints/admin/announcements/list.ts index f4e622144e5fa5366c21e8d98d5a3145910fb824..4c3af5a3180c35a5e8798ea3189a1fe4115ee101 100644 --- a/src/server/api/endpoints/admin/announcements/list.ts +++ b/src/server/api/endpoints/admin/announcements/list.ts @@ -7,7 +7,7 @@ import { makePaginationQuery } from '../../../common/make-pagination-query'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/announcements/update.ts b/src/server/api/endpoints/admin/announcements/update.ts index b65c3a4f93041ef2cd9de697a35eac0a6aeafd89..fd24f8cc8e701ef29afd79f8f8f5c2267a3ecef5 100644 --- a/src/server/api/endpoints/admin/announcements/update.ts +++ b/src/server/api/endpoints/admin/announcements/update.ts @@ -7,7 +7,7 @@ import { ApiError } from '../../../error'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts b/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts index 276d1f37bdeb25d15267804d0fa17b05bbf98b52..83397f1079dcb11b4b4baa00aca71ca80e6d8202 100644 --- a/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts +++ b/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts @@ -7,7 +7,7 @@ import { ID } from '../../../../misc/cafy-id'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/delete-logs.ts b/src/server/api/endpoints/admin/delete-logs.ts index 26cf13c1f6ab5a1bc616fc3582a3c0be6341b8cf..9cb9f809d773f7efcb5f92f5ac25f40788fbb059 100644 --- a/src/server/api/endpoints/admin/delete-logs.ts +++ b/src/server/api/endpoints/admin/delete-logs.ts @@ -4,7 +4,7 @@ import { Logs } from '../../../../models'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, }; diff --git a/src/server/api/endpoints/admin/drive/clean-remote-files.ts b/src/server/api/endpoints/admin/drive/clean-remote-files.ts index e837ae1bb6a99e397eb11b103ff966a0c14f6574..5a5adb8a8bfaab76c4c0ad23f1a85063de973650 100644 --- a/src/server/api/endpoints/admin/drive/clean-remote-files.ts +++ b/src/server/api/endpoints/admin/drive/clean-remote-files.ts @@ -4,7 +4,7 @@ import { createCleanRemoteFilesJob } from '../../../../../queue'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, }; diff --git a/src/server/api/endpoints/admin/drive/cleanup.ts b/src/server/api/endpoints/admin/drive/cleanup.ts index 272416dee89a20b39df098435fc93c304801445e..b76236a7f04ae1472ef702e05a169404e7c1cc2f 100644 --- a/src/server/api/endpoints/admin/drive/cleanup.ts +++ b/src/server/api/endpoints/admin/drive/cleanup.ts @@ -6,7 +6,7 @@ import { DriveFiles } from '../../../../../models'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, }; diff --git a/src/server/api/endpoints/admin/drive/files.ts b/src/server/api/endpoints/admin/drive/files.ts index 7c6672e6de47d98204a360e7e09120f36a23d29d..776aec9ec607bef2bda3b9e3c3392f7b65d78c2b 100644 --- a/src/server/api/endpoints/admin/drive/files.ts +++ b/src/server/api/endpoints/admin/drive/files.ts @@ -6,7 +6,7 @@ import { DriveFiles } from '../../../../../models'; export const meta = { tags: ['admin'], - requireCredential: false, + requireCredential: false as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/drive/show-file.ts b/src/server/api/endpoints/admin/drive/show-file.ts index a2b6c158f0b3464da83b5e0719da0c9ca9fa2693..415bfc28b30d80953692aae0c0edb8e7e4c70c0e 100644 --- a/src/server/api/endpoints/admin/drive/show-file.ts +++ b/src/server/api/endpoints/admin/drive/show-file.ts @@ -7,7 +7,7 @@ import { DriveFiles } from '../../../../../models'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/emoji/add.ts b/src/server/api/endpoints/admin/emoji/add.ts index 610efbbe8ffcd3d5c720fa18ae47821900db4aae..f56303b32f4342ed62d95fa02a12fe6ae971b52d 100644 --- a/src/server/api/endpoints/admin/emoji/add.ts +++ b/src/server/api/endpoints/admin/emoji/add.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/emoji/copy.ts b/src/server/api/endpoints/admin/emoji/copy.ts index 4b4319ca819856f143c107cd16b7ef8d5dcdfaa9..5d4e57a28fac322e8610727ddea6b5c408beb0d2 100644 --- a/src/server/api/endpoints/admin/emoji/copy.ts +++ b/src/server/api/endpoints/admin/emoji/copy.ts @@ -11,7 +11,7 @@ import uploadFromUrl from '../../../../../services/drive/upload-from-url'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/emoji/list-remote.ts b/src/server/api/endpoints/admin/emoji/list-remote.ts index 0a3e74c33322f009e4d10c228ab1e825042a6801..fd215ed6fe377803a49a736de6f4cc43cce4aa72 100644 --- a/src/server/api/endpoints/admin/emoji/list-remote.ts +++ b/src/server/api/endpoints/admin/emoji/list-remote.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/emoji/list.ts b/src/server/api/endpoints/admin/emoji/list.ts index 5a6fffc3b8a086e78cbbc9e0f53ae5fc67a89dd6..2b6516a1aa2d74050090dfcc7652905423160784 100644 --- a/src/server/api/endpoints/admin/emoji/list.ts +++ b/src/server/api/endpoints/admin/emoji/list.ts @@ -11,7 +11,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/emoji/remove.ts b/src/server/api/endpoints/admin/emoji/remove.ts index a591d4c3dd52ae45bc09060a483511bb3573278e..19ffa1c166637e05e70c54b42ab2e33592f53270 100644 --- a/src/server/api/endpoints/admin/emoji/remove.ts +++ b/src/server/api/endpoints/admin/emoji/remove.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/emoji/update.ts b/src/server/api/endpoints/admin/emoji/update.ts index b6ecb39b43101bdbac91a9f8b13e9db456a4351f..cffc2dfdf256a0394ac2a4b31f96fa8d896c77eb 100644 --- a/src/server/api/endpoints/admin/emoji/update.ts +++ b/src/server/api/endpoints/admin/emoji/update.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/federation/delete-all-files.ts b/src/server/api/endpoints/admin/federation/delete-all-files.ts index 24ad9ce808350ad4df1b56df90944220694e9dad..eef53cd92ca1e36c2109d511af292e3fd3e2663b 100644 --- a/src/server/api/endpoints/admin/federation/delete-all-files.ts +++ b/src/server/api/endpoints/admin/federation/delete-all-files.ts @@ -6,7 +6,7 @@ import { DriveFiles } from '../../../../../models'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/federation/remove-all-following.ts b/src/server/api/endpoints/admin/federation/remove-all-following.ts index 25aae6db88172056bcdf7a2191bd6edb45ccb580..76497c0dd835515c3a306cd64e5f9c5db8e1f453 100644 --- a/src/server/api/endpoints/admin/federation/remove-all-following.ts +++ b/src/server/api/endpoints/admin/federation/remove-all-following.ts @@ -7,7 +7,7 @@ import { ensure } from '../../../../../prelude/ensure'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/federation/update-instance.ts b/src/server/api/endpoints/admin/federation/update-instance.ts index 88bd2e3dffaa1497a972bd01183a7cde8b2b205c..8f8b3334b35c60428514ffe6a3f1a8138e96adb7 100644 --- a/src/server/api/endpoints/admin/federation/update-instance.ts +++ b/src/server/api/endpoints/admin/federation/update-instance.ts @@ -6,7 +6,7 @@ import { toPuny } from '../../../../../misc/convert-host'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/get-table-stats.ts b/src/server/api/endpoints/admin/get-table-stats.ts index 1abea1849278984a180b68b9177d141fae389653..58c9c6e7c30896439890404597408668129674dd 100644 --- a/src/server/api/endpoints/admin/get-table-stats.ts +++ b/src/server/api/endpoints/admin/get-table-stats.ts @@ -2,7 +2,7 @@ import define from '../../define'; import { getConnection } from 'typeorm'; export const meta = { - requireCredential: false, + requireCredential: false as const, desc: { 'en-US': 'Get table stats' diff --git a/src/server/api/endpoints/admin/invite.ts b/src/server/api/endpoints/admin/invite.ts index d4c572e2e0ea47cd7df7cc500c6d9d9107c19772..52e3da8f846c997f6ffc355d1fbdeb3efc6c566e 100644 --- a/src/server/api/endpoints/admin/invite.ts +++ b/src/server/api/endpoints/admin/invite.ts @@ -10,7 +10,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: {} diff --git a/src/server/api/endpoints/admin/logs.ts b/src/server/api/endpoints/admin/logs.ts index 060df09adf25c067cfe3bb2c2549d2a2eb90b9b9..fef2eab80b7d2a14decd31075fd69c3dbc1ea88d 100644 --- a/src/server/api/endpoints/admin/logs.ts +++ b/src/server/api/endpoints/admin/logs.ts @@ -6,7 +6,7 @@ import { Brackets } from 'typeorm'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/moderators/add.ts b/src/server/api/endpoints/admin/moderators/add.ts index a15f0a17a2ea9bcfa3ed3669238a2f5dbcd4c01d..71a214928c7dee237781adbc517ff22217e4e03f 100644 --- a/src/server/api/endpoints/admin/moderators/add.ts +++ b/src/server/api/endpoints/admin/moderators/add.ts @@ -11,7 +11,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireAdmin: true, params: { diff --git a/src/server/api/endpoints/admin/moderators/remove.ts b/src/server/api/endpoints/admin/moderators/remove.ts index 209cf0814f2010804c41e4ebf74c750a8d1a7131..1eee750bc4bc47b11e960e82d479e3b15bc62e0d 100644 --- a/src/server/api/endpoints/admin/moderators/remove.ts +++ b/src/server/api/endpoints/admin/moderators/remove.ts @@ -11,7 +11,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireAdmin: true, params: { diff --git a/src/server/api/endpoints/admin/queue/clear.ts b/src/server/api/endpoints/admin/queue/clear.ts index 03c1ae8463de8d26b447d4aa558b60255dd27c6f..0375f55f01871831f636a6a964f1564780be1e6f 100644 --- a/src/server/api/endpoints/admin/queue/clear.ts +++ b/src/server/api/endpoints/admin/queue/clear.ts @@ -5,7 +5,7 @@ import { insertModerationLog } from '../../../../../services/insert-moderation-l export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: {} diff --git a/src/server/api/endpoints/admin/queue/deliver-delayed.ts b/src/server/api/endpoints/admin/queue/deliver-delayed.ts index d33837c09925add93d5f5c88c2dec1bf014a8d96..6bfb5b50fe4368ad60107f87839b0a3dc971cf56 100644 --- a/src/server/api/endpoints/admin/queue/deliver-delayed.ts +++ b/src/server/api/endpoints/admin/queue/deliver-delayed.ts @@ -4,7 +4,7 @@ import { deliverQueue } from '../../../../../queue'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/queue/inbox-delayed.ts b/src/server/api/endpoints/admin/queue/inbox-delayed.ts index 643e22f10da014017d36a57a112c1ffbf19ca715..4627cefdd88c8afe086e0d0bf3984e856e0d59a7 100644 --- a/src/server/api/endpoints/admin/queue/inbox-delayed.ts +++ b/src/server/api/endpoints/admin/queue/inbox-delayed.ts @@ -4,7 +4,7 @@ import { inboxQueue } from '../../../../../queue'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/queue/jobs.ts b/src/server/api/endpoints/admin/queue/jobs.ts index 0d23ca3e575e9c1ff066ad034c23870b3c6849eb..0cd3f40d4ed8e67de060f8bfb27b155bb6c9183f 100644 --- a/src/server/api/endpoints/admin/queue/jobs.ts +++ b/src/server/api/endpoints/admin/queue/jobs.ts @@ -5,7 +5,7 @@ import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '../../../ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/queue/stats.ts b/src/server/api/endpoints/admin/queue/stats.ts index 83684685ff61600bbc51b2d621034725ea86f55f..da29c5285eb8419d547e4c495b51c418fd325e66 100644 --- a/src/server/api/endpoints/admin/queue/stats.ts +++ b/src/server/api/endpoints/admin/queue/stats.ts @@ -4,7 +4,7 @@ import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '../../../ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: {} diff --git a/src/server/api/endpoints/admin/remove-abuse-user-report.ts b/src/server/api/endpoints/admin/remove-abuse-user-report.ts index f293c007183153cbb198bfebcb077880a755ec37..150de5f5d455e1afd6dd47bdefb7cd6e0b804642 100644 --- a/src/server/api/endpoints/admin/remove-abuse-user-report.ts +++ b/src/server/api/endpoints/admin/remove-abuse-user-report.ts @@ -6,7 +6,7 @@ import { AbuseUserReports } from '../../../../models'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/reset-password.ts b/src/server/api/endpoints/admin/reset-password.ts index 42df66860650a77d3c0303b13120aed17fb174bb..1b8a5ee6513070e304d9cfe9d8faa113c8f37fe8 100644 --- a/src/server/api/endpoints/admin/reset-password.ts +++ b/src/server/api/endpoints/admin/reset-password.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/resync-chart.ts b/src/server/api/endpoints/admin/resync-chart.ts index 7f4c5e03c8c096a2c040962129e8ca9a257b138f..84e19d37e61d1941b12de35ec7ea36dbb9d907be 100644 --- a/src/server/api/endpoints/admin/resync-chart.ts +++ b/src/server/api/endpoints/admin/resync-chart.ts @@ -5,7 +5,7 @@ import { insertModerationLog } from '../../../../services/insert-moderation-log' export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, }; diff --git a/src/server/api/endpoints/admin/send-email.ts b/src/server/api/endpoints/admin/send-email.ts index fed4f2df1480b10df39cb3bae14cefc77d647428..9af931ad999f2250163570d6691e2e933b4cd68d 100644 --- a/src/server/api/endpoints/admin/send-email.ts +++ b/src/server/api/endpoints/admin/send-email.ts @@ -5,7 +5,7 @@ import { sendEmail } from '../../../../services/send-email'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/server-info.ts b/src/server/api/endpoints/admin/server-info.ts index f51040a2c88f4c408aedcc1895ca22754b07813d..2563ff52ef8d9d508ad1739adbd7c576e49a09fa 100644 --- a/src/server/api/endpoints/admin/server-info.ts +++ b/src/server/api/endpoints/admin/server-info.ts @@ -5,7 +5,7 @@ import define from '../../define'; import redis from '../../../../db/redis'; export const meta = { - requireCredential: false, + requireCredential: false as const, desc: { }, diff --git a/src/server/api/endpoints/admin/show-moderation-logs.ts b/src/server/api/endpoints/admin/show-moderation-logs.ts index bc67b3e55bc7195edaa16ffe3f09276245bb2e4f..acdfda51abfa8d27712c40baef7579786a58bb8b 100644 --- a/src/server/api/endpoints/admin/show-moderation-logs.ts +++ b/src/server/api/endpoints/admin/show-moderation-logs.ts @@ -7,7 +7,7 @@ import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/show-user.ts b/src/server/api/endpoints/admin/show-user.ts index 452125dea0668e5fa5e36372b041badab671b6f9..c08eddff6a44881e5924cdd34af6740e2c270bc5 100644 --- a/src/server/api/endpoints/admin/show-user.ts +++ b/src/server/api/endpoints/admin/show-user.ts @@ -10,7 +10,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/show-users.ts b/src/server/api/endpoints/admin/show-users.ts index a1fadf3d81d2b01cf2c3a77e8b44eaa3575f77e3..294d7208b3102185ad9d6604d2461849067205ac 100644 --- a/src/server/api/endpoints/admin/show-users.ts +++ b/src/server/api/endpoints/admin/show-users.ts @@ -5,7 +5,7 @@ import { Users } from '../../../../models'; export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/silence-user.ts b/src/server/api/endpoints/admin/silence-user.ts index 8cc84aa1ccfb35f06e81bfa5d0e8a3c473faf135..cd5c339a5b2433f7cbe469b6cd4da00a8bd59669 100644 --- a/src/server/api/endpoints/admin/silence-user.ts +++ b/src/server/api/endpoints/admin/silence-user.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/suspend-user.ts b/src/server/api/endpoints/admin/suspend-user.ts index 1202315541de769f91434992195f58aa6d13d0f3..10be88b8f11b08fc85169bef94ffa129983fba69 100644 --- a/src/server/api/endpoints/admin/suspend-user.ts +++ b/src/server/api/endpoints/admin/suspend-user.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/unsilence-user.ts b/src/server/api/endpoints/admin/unsilence-user.ts index 607c9b699ae9cccc53fcfbef08daab92e8380ecd..63e4be06f3156005366a07d5f333057c6e001999 100644 --- a/src/server/api/endpoints/admin/unsilence-user.ts +++ b/src/server/api/endpoints/admin/unsilence-user.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/unsuspend-user.ts b/src/server/api/endpoints/admin/unsuspend-user.ts index 237585e2769fd40ef748f29b91b7b4210282a78b..9690d6ef0b90ffd5a88cee48eec19ab35ab03a62 100644 --- a/src/server/api/endpoints/admin/unsuspend-user.ts +++ b/src/server/api/endpoints/admin/unsuspend-user.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/update-meta.ts b/src/server/api/endpoints/admin/update-meta.ts index adcd34bd5056f35a061d345641a5653203d361c1..e9527d9ac52c1777449c959c39692e903cecd7f9 100644 --- a/src/server/api/endpoints/admin/update-meta.ts +++ b/src/server/api/endpoints/admin/update-meta.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireAdmin: true, params: { diff --git a/src/server/api/endpoints/admin/update-remote-user.ts b/src/server/api/endpoints/admin/update-remote-user.ts index f9716328d521ec4892ef4fb7a498ed7a55198402..a6b5ef1e854139781c3bc35a929a143a697bf18a 100644 --- a/src/server/api/endpoints/admin/update-remote-user.ts +++ b/src/server/api/endpoints/admin/update-remote-user.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/admin/vacuum.ts b/src/server/api/endpoints/admin/vacuum.ts index 4921e228e57e947a1b8546f0f7bf2b8683f1996d..e041e6543121798d9f4fa01a40319f1d276830ab 100644 --- a/src/server/api/endpoints/admin/vacuum.ts +++ b/src/server/api/endpoints/admin/vacuum.ts @@ -6,7 +6,7 @@ import { insertModerationLog } from '../../../../services/insert-moderation-log' export const meta = { tags: ['admin'], - requireCredential: true, + requireCredential: true as const, requireModerator: true, params: { diff --git a/src/server/api/endpoints/announcements.ts b/src/server/api/endpoints/announcements.ts index 2b7f90c31f4c9b78f1dd9e5de5a17cdb73e28650..35c70a7546880ba80f539fc51e6db9508850b971 100644 --- a/src/server/api/endpoints/announcements.ts +++ b/src/server/api/endpoints/announcements.ts @@ -5,7 +5,7 @@ import { Announcements, AnnouncementReads } from '../../../models'; import { makePaginationQuery } from '../common/make-pagination-query'; export const meta = { - requireCredential: false, + requireCredential: false as const, params: { limit: { diff --git a/src/server/api/endpoints/antennas/create.ts b/src/server/api/endpoints/antennas/create.ts index 26915c19b383474438c463c3633074048d6a74cd..658b8221f2c3460635ea2ea7cde7526596c9a675 100644 --- a/src/server/api/endpoints/antennas/create.ts +++ b/src/server/api/endpoints/antennas/create.ts @@ -8,7 +8,7 @@ import { ApiError } from '../../error'; export const meta = { tags: ['antennas'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/antennas/delete.ts b/src/server/api/endpoints/antennas/delete.ts index 6bf9165aedfe5803c1904911523f8c1818c87f2c..087834a7bd401e876480c7a486755daab191e978 100644 --- a/src/server/api/endpoints/antennas/delete.ts +++ b/src/server/api/endpoints/antennas/delete.ts @@ -7,7 +7,7 @@ import { Antennas } from '../../../../models'; export const meta = { tags: ['antennas'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/antennas/list.ts b/src/server/api/endpoints/antennas/list.ts index 3f9deff32f9dbeb2b71f4e84c5f7372e65e04846..cbc4e827b97674332a26006d31076e64ca9fe5bd 100644 --- a/src/server/api/endpoints/antennas/list.ts +++ b/src/server/api/endpoints/antennas/list.ts @@ -4,7 +4,7 @@ import { Antennas } from '../../../../models'; export const meta = { tags: ['antennas', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'read:account', }; diff --git a/src/server/api/endpoints/antennas/notes.ts b/src/server/api/endpoints/antennas/notes.ts index b4c8e7e698b4a8939287b532eb61700b16e6955b..b8428f86a83ede6d8ad9014895791ec5a8baa0a2 100644 --- a/src/server/api/endpoints/antennas/notes.ts +++ b/src/server/api/endpoints/antennas/notes.ts @@ -10,7 +10,7 @@ import { ApiError } from '../../error'; export const meta = { tags: ['account', 'notes', 'antennas'], - requireCredential: true, + requireCredential: true as const, kind: 'read:account', diff --git a/src/server/api/endpoints/antennas/show.ts b/src/server/api/endpoints/antennas/show.ts index dd87de1dce2b5fc9a1bb35c5ebe557c4941e01ce..bc2093ba61eaae1882dfc4b9a7db5efd9276f322 100644 --- a/src/server/api/endpoints/antennas/show.ts +++ b/src/server/api/endpoints/antennas/show.ts @@ -7,7 +7,7 @@ import { Antennas } from '../../../../models'; export const meta = { tags: ['antennas', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'read:account', diff --git a/src/server/api/endpoints/antennas/update.ts b/src/server/api/endpoints/antennas/update.ts index b4e7168888f3eae2b3524b05ad8c698c2860b961..520e17c4ae0a8960c72a23709e376154d724f19f 100644 --- a/src/server/api/endpoints/antennas/update.ts +++ b/src/server/api/endpoints/antennas/update.ts @@ -7,7 +7,7 @@ import { Antennas, UserLists, UserGroupJoinings } from '../../../../models'; export const meta = { tags: ['antennas'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/ap/show.ts b/src/server/api/endpoints/ap/show.ts index bbaa1fa109a3d6182427fee78448234e4b2f49d4..214116c8c3d60c1d4226b6a5c72319194d747662 100644 --- a/src/server/api/endpoints/ap/show.ts +++ b/src/server/api/endpoints/ap/show.ts @@ -19,7 +19,7 @@ export const meta = { 'ja-JP': 'URIを指定ã—ã¦ActivityPubオブジェクトをå‚ç…§ã—ã¾ã™ã€‚' }, - requireCredential: false, + requireCredential: false as const, params: { uri: { diff --git a/src/server/api/endpoints/app/create.ts b/src/server/api/endpoints/app/create.ts index 81c851f3a3ab4b5a63e5e17f51f13899881185fa..ac3e8a18d22f4f23cab7a668061b2c82cbb5e862 100644 --- a/src/server/api/endpoints/app/create.ts +++ b/src/server/api/endpoints/app/create.ts @@ -8,7 +8,7 @@ import { unique } from '../../../../prelude/array'; export const meta = { tags: ['app'], - requireCredential: false, + requireCredential: false as const, desc: { 'ja-JP': 'アプリを作æˆã—ã¾ã™ã€‚', diff --git a/src/server/api/endpoints/auth/accept.ts b/src/server/api/endpoints/auth/accept.ts index be7f3b54684af9e4feccbdc145b74ac3844f7659..8ba15ba8154a54f65ed3f8957fa0d76053a26149 100644 --- a/src/server/api/endpoints/auth/accept.ts +++ b/src/server/api/endpoints/auth/accept.ts @@ -10,7 +10,7 @@ import { ensure } from '../../../../prelude/ensure'; export const meta = { tags: ['auth'], - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/auth/session/generate.ts b/src/server/api/endpoints/auth/session/generate.ts index 23d4f7e9b5d33f25909deb0a0e510fb829d7eaad..5596e6122be675e3e2a5255f6da7039914d08bea 100644 --- a/src/server/api/endpoints/auth/session/generate.ts +++ b/src/server/api/endpoints/auth/session/generate.ts @@ -9,7 +9,7 @@ import { genId } from '../../../../../misc/gen-id'; export const meta = { tags: ['auth'], - requireCredential: false, + requireCredential: false as const, desc: { 'ja-JP': 'アプリをèªè¨¼ã™ã‚‹ãŸã‚ã®ãƒˆãƒ¼ã‚¯ãƒ³ã‚’作æˆã—ã¾ã™ã€‚', diff --git a/src/server/api/endpoints/auth/session/show.ts b/src/server/api/endpoints/auth/session/show.ts index e6ecd8b8390d43d62a717858cd988949a83846bf..fe92ff3624984d664da426cb55b1096d28b9bddb 100644 --- a/src/server/api/endpoints/auth/session/show.ts +++ b/src/server/api/endpoints/auth/session/show.ts @@ -6,7 +6,7 @@ import { AuthSessions } from '../../../../../models'; export const meta = { tags: ['auth'], - requireCredential: false, + requireCredential: false as const, params: { token: { diff --git a/src/server/api/endpoints/auth/session/userkey.ts b/src/server/api/endpoints/auth/session/userkey.ts index 1dc78eeabd7566de21b10921ad839c59816c29f1..7b474c82954153fcce04d225cd90ae554014983e 100644 --- a/src/server/api/endpoints/auth/session/userkey.ts +++ b/src/server/api/endpoints/auth/session/userkey.ts @@ -7,7 +7,7 @@ import { ensure } from '../../../../../prelude/ensure'; export const meta = { tags: ['auth'], - requireCredential: false, + requireCredential: false as const, params: { appSecret: { diff --git a/src/server/api/endpoints/blocking/create.ts b/src/server/api/endpoints/blocking/create.ts index 045be6aef39f4b43305dd6f937ee639c462d0a57..88ff487cadd00aa763d7f06ec2f133dd789e6725 100644 --- a/src/server/api/endpoints/blocking/create.ts +++ b/src/server/api/endpoints/blocking/create.ts @@ -22,7 +22,7 @@ export const meta = { max: 100 }, - requireCredential: true, + requireCredential: true as const, kind: 'write:blocks', diff --git a/src/server/api/endpoints/blocking/delete.ts b/src/server/api/endpoints/blocking/delete.ts index ecb5d1109e1757f4f4cc63f922f6945e0f92eb88..b0f7d7bd74ddc016828d9a27f190f5acb2b6456d 100644 --- a/src/server/api/endpoints/blocking/delete.ts +++ b/src/server/api/endpoints/blocking/delete.ts @@ -22,7 +22,7 @@ export const meta = { max: 100 }, - requireCredential: true, + requireCredential: true as const, kind: 'write:blocks', diff --git a/src/server/api/endpoints/blocking/list.ts b/src/server/api/endpoints/blocking/list.ts index c99ba09df0a48e8ddec36918e972fff63948d00f..5342e1108899b6738a871c15e797c7a5d2cb57ac 100644 --- a/src/server/api/endpoints/blocking/list.ts +++ b/src/server/api/endpoints/blocking/list.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['blocking', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'read:blocks', diff --git a/src/server/api/endpoints/clips/create.ts b/src/server/api/endpoints/clips/create.ts index a6761c5533e38c9736f0516178d6694858e61964..f1b20c115728cda6b4ab269529d67a6f196dc6bc 100644 --- a/src/server/api/endpoints/clips/create.ts +++ b/src/server/api/endpoints/clips/create.ts @@ -6,7 +6,7 @@ import { Clips } from '../../../../models'; export const meta = { tags: ['clips'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/clips/delete.ts b/src/server/api/endpoints/clips/delete.ts index 7e185e4652da40822c4b06fa67174b75d0f6f4ac..746f93188c35f88ab125c81b40c0cabd74bbc25d 100644 --- a/src/server/api/endpoints/clips/delete.ts +++ b/src/server/api/endpoints/clips/delete.ts @@ -7,7 +7,7 @@ import { Clips } from '../../../../models'; export const meta = { tags: ['clips'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/clips/list.ts b/src/server/api/endpoints/clips/list.ts index aa16a18d42cc630eaf44521e96819bfbc66dc659..6ede8ea0fc8cd46340cb31ae6bbbc2da7a9e17d6 100644 --- a/src/server/api/endpoints/clips/list.ts +++ b/src/server/api/endpoints/clips/list.ts @@ -4,7 +4,7 @@ import { Clips } from '../../../../models'; export const meta = { tags: ['clips', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'read:account', }; diff --git a/src/server/api/endpoints/clips/notes.ts b/src/server/api/endpoints/clips/notes.ts index 4e76a4d1f364c0d4b560ba3d5521bf602e60a69a..d4d994d55ae7395311919953189978cdfbcbdd35 100644 --- a/src/server/api/endpoints/clips/notes.ts +++ b/src/server/api/endpoints/clips/notes.ts @@ -9,7 +9,7 @@ import { generateMuteQuery } from '../../common/generate-mute-query'; export const meta = { tags: ['account', 'notes', 'clips'], - requireCredential: true, + requireCredential: true as const, kind: 'read:account', diff --git a/src/server/api/endpoints/clips/show.ts b/src/server/api/endpoints/clips/show.ts index 0766b3e929fabd37bc4747f835536816739f3e66..5b2b7b7d5e0b22bfbc0d946def9bce68f8cc4f2f 100644 --- a/src/server/api/endpoints/clips/show.ts +++ b/src/server/api/endpoints/clips/show.ts @@ -7,7 +7,7 @@ import { Clips } from '../../../../models'; export const meta = { tags: ['clips', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'read:account', diff --git a/src/server/api/endpoints/clips/update.ts b/src/server/api/endpoints/clips/update.ts index d1c31eb8e69172bf270675178d73d5c5b3d3efb7..483941214cba1f6efaa65311456468a0c73f1886 100644 --- a/src/server/api/endpoints/clips/update.ts +++ b/src/server/api/endpoints/clips/update.ts @@ -7,7 +7,7 @@ import { Clips } from '../../../../models'; export const meta = { tags: ['clips'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/drive.ts b/src/server/api/endpoints/drive.ts index bb85bab148f10de1aa28621d857bf776617f9268..9b723a054243ef562fa5a261d72e660760224397 100644 --- a/src/server/api/endpoints/drive.ts +++ b/src/server/api/endpoints/drive.ts @@ -10,7 +10,7 @@ export const meta = { tags: ['drive', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'read:drive', diff --git a/src/server/api/endpoints/drive/files.ts b/src/server/api/endpoints/drive/files.ts index 77cefdfbe35dc39b67758a1ec473aa3ecea56aaf..1a8a21d630507727d022929abcbdad33562426ac 100644 --- a/src/server/api/endpoints/drive/files.ts +++ b/src/server/api/endpoints/drive/files.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, kind: 'read:drive', diff --git a/src/server/api/endpoints/drive/files/attached-notes.ts b/src/server/api/endpoints/drive/files/attached-notes.ts index 2b84e114b373357fd8837069f65b97ec7676d347..e1bef8e8d96052875d77a52a1af520e60d02823a 100644 --- a/src/server/api/endpoints/drive/files/attached-notes.ts +++ b/src/server/api/endpoints/drive/files/attached-notes.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['drive', 'notes'], - requireCredential: true, + requireCredential: true as const, kind: 'read:drive', diff --git a/src/server/api/endpoints/drive/files/check-existence.ts b/src/server/api/endpoints/drive/files/check-existence.ts index a6cd14caf2ba170341a5ca43626457d4e0d256aa..f1741cf086e5adc1cba238d6ee6af3dcb13faa89 100644 --- a/src/server/api/endpoints/drive/files/check-existence.ts +++ b/src/server/api/endpoints/drive/files/check-existence.ts @@ -10,7 +10,7 @@ export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, kind: 'read:drive', diff --git a/src/server/api/endpoints/drive/files/create.ts b/src/server/api/endpoints/drive/files/create.ts index 61055c5d18685c9777503a06e4ac7c1d2705f041..3c5c9825348c7b2cf1ff32fb3f42cd39e4629bad 100644 --- a/src/server/api/endpoints/drive/files/create.ts +++ b/src/server/api/endpoints/drive/files/create.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, limit: { duration: ms('1hour'), diff --git a/src/server/api/endpoints/drive/files/delete.ts b/src/server/api/endpoints/drive/files/delete.ts index d6a20f352e9419520c03e2d98bb2047363564ad5..e10ffb891cc25d55f51d2c0a6278ebe25a6542b2 100644 --- a/src/server/api/endpoints/drive/files/delete.ts +++ b/src/server/api/endpoints/drive/files/delete.ts @@ -16,7 +16,7 @@ export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, kind: 'write:drive', diff --git a/src/server/api/endpoints/drive/files/find-by-hash.ts b/src/server/api/endpoints/drive/files/find-by-hash.ts index 84cc4f92b10a01e2087e48c890b95e74c80807ad..336c85c4441195b47b1191087b8a497e11cac853 100644 --- a/src/server/api/endpoints/drive/files/find-by-hash.ts +++ b/src/server/api/endpoints/drive/files/find-by-hash.ts @@ -9,7 +9,7 @@ export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, kind: 'read:drive', diff --git a/src/server/api/endpoints/drive/files/find.ts b/src/server/api/endpoints/drive/files/find.ts index 732596a33feb4e477ba4b8b4efcca6b4442680e8..5872e2c0c179006a7189290f8c517a9e6c7d27b3 100644 --- a/src/server/api/endpoints/drive/files/find.ts +++ b/src/server/api/endpoints/drive/files/find.ts @@ -4,7 +4,7 @@ import define from '../../../define'; import { DriveFiles } from '../../../../../models'; export const meta = { - requireCredential: true, + requireCredential: true as const, tags: ['drive'], diff --git a/src/server/api/endpoints/drive/files/show.ts b/src/server/api/endpoints/drive/files/show.ts index 4384b2114dbd497f1acef52861d20fd946c78b50..3384c4523a3fa357cf49dbb2e50c1083668e142a 100644 --- a/src/server/api/endpoints/drive/files/show.ts +++ b/src/server/api/endpoints/drive/files/show.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, kind: 'read:drive', diff --git a/src/server/api/endpoints/drive/files/update.ts b/src/server/api/endpoints/drive/files/update.ts index 81e86a27345c235bb4121a90207e9271f1614e0b..f57166a2f68511f9fd5858b41734f6378297cd49 100644 --- a/src/server/api/endpoints/drive/files/update.ts +++ b/src/server/api/endpoints/drive/files/update.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, kind: 'write:drive', diff --git a/src/server/api/endpoints/drive/files/upload-from-url.ts b/src/server/api/endpoints/drive/files/upload-from-url.ts index 034ab10f19e5eb3e23b9de087dfdf5f15f4f93aa..04e13a05cfe9eed0eeb7bc2f35b0659e5196c6b0 100644 --- a/src/server/api/endpoints/drive/files/upload-from-url.ts +++ b/src/server/api/endpoints/drive/files/upload-from-url.ts @@ -17,7 +17,7 @@ export const meta = { max: 60 }, - requireCredential: true, + requireCredential: true as const, kind: 'write:drive', diff --git a/src/server/api/endpoints/drive/folders.ts b/src/server/api/endpoints/drive/folders.ts index e2d22e708117a9819ed17a1bf97f159437053cc5..f662d53ba664c3fb0805cd1465edfad3f14a4218 100644 --- a/src/server/api/endpoints/drive/folders.ts +++ b/src/server/api/endpoints/drive/folders.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, kind: 'read:drive', diff --git a/src/server/api/endpoints/drive/folders/create.ts b/src/server/api/endpoints/drive/folders/create.ts index 5530abf9dc310fae5002a06602f5817da206746a..f6604a3cb23ee539695fa2cb682cfd9fe4fc55df 100644 --- a/src/server/api/endpoints/drive/folders/create.ts +++ b/src/server/api/endpoints/drive/folders/create.ts @@ -16,7 +16,7 @@ export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, kind: 'write:drive', diff --git a/src/server/api/endpoints/drive/folders/delete.ts b/src/server/api/endpoints/drive/folders/delete.ts index fe6c05ad07d65543154af96c3e007d1cb88720eb..2faae93f93b4ea10de201a2064166f24828c0e68 100644 --- a/src/server/api/endpoints/drive/folders/delete.ts +++ b/src/server/api/endpoints/drive/folders/delete.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, kind: 'write:drive', diff --git a/src/server/api/endpoints/drive/folders/find.ts b/src/server/api/endpoints/drive/folders/find.ts index 04bec1b170d729d32fabade65810be9b3b0c60dc..72ce1d192b8cdc8eff1044b328e0bd60f1372619 100644 --- a/src/server/api/endpoints/drive/folders/find.ts +++ b/src/server/api/endpoints/drive/folders/find.ts @@ -6,7 +6,7 @@ import { DriveFolders } from '../../../../../models'; export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, kind: 'read:drive', diff --git a/src/server/api/endpoints/drive/folders/show.ts b/src/server/api/endpoints/drive/folders/show.ts index f48f21d73027a9bffc8c29bdf7e3652a38b64291..9026c8dff99bda240573861b62efc5d08ade6358 100644 --- a/src/server/api/endpoints/drive/folders/show.ts +++ b/src/server/api/endpoints/drive/folders/show.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, kind: 'read:drive', diff --git a/src/server/api/endpoints/drive/folders/update.ts b/src/server/api/endpoints/drive/folders/update.ts index 7d3ece00a3b7a658ab9fa99a43bffd86d317d5c0..6c20b4c5184967f4b0c67b11ea8671738aa17af4 100644 --- a/src/server/api/endpoints/drive/folders/update.ts +++ b/src/server/api/endpoints/drive/folders/update.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, kind: 'write:drive', diff --git a/src/server/api/endpoints/drive/stream.ts b/src/server/api/endpoints/drive/stream.ts index b93ee11a141ff1de39dcbe246ca54f3944be7e8e..94c2051bbe04748766975503d8db25d9c1258815 100644 --- a/src/server/api/endpoints/drive/stream.ts +++ b/src/server/api/endpoints/drive/stream.ts @@ -7,7 +7,7 @@ import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['drive'], - requireCredential: true, + requireCredential: true as const, kind: 'read:drive', diff --git a/src/server/api/endpoints/endpoint.ts b/src/server/api/endpoints/endpoint.ts index 48e78cd04c7cbc2d1aa86a7f3e1560ec5ce8a220..1a04d8bee855277c41c4f7f2e2993f15eb63c27a 100644 --- a/src/server/api/endpoints/endpoint.ts +++ b/src/server/api/endpoints/endpoint.ts @@ -3,7 +3,7 @@ import define from '../define'; import endpoints from '../endpoints'; export const meta = { - requireCredential: false, + requireCredential: false as const, tags: ['meta'], diff --git a/src/server/api/endpoints/endpoints.ts b/src/server/api/endpoints/endpoints.ts index d1e4edaa212992ea52e5297ffee53c99b6b7d358..3ab14389a9f01ec2f5872b752907fd78b81ceb53 100644 --- a/src/server/api/endpoints/endpoints.ts +++ b/src/server/api/endpoints/endpoints.ts @@ -2,7 +2,7 @@ import define from '../define'; import endpoints from '../endpoints'; export const meta = { - requireCredential: false, + requireCredential: false as const, tags: ['meta'], diff --git a/src/server/api/endpoints/federation/followers.ts b/src/server/api/endpoints/federation/followers.ts index d885daf70e006e9c2b8d858794bae5ba94390a81..c3ab8c29aaf98ca55a3f22ad7523ba1e96ee2d82 100644 --- a/src/server/api/endpoints/federation/followers.ts +++ b/src/server/api/endpoints/federation/followers.ts @@ -7,7 +7,7 @@ import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['users'], - requireCredential: false, + requireCredential: false as const, params: { host: { diff --git a/src/server/api/endpoints/federation/following.ts b/src/server/api/endpoints/federation/following.ts index 1f7981731826e0380cbe3a94dd805f5bcf92e0eb..dea5c832742a1f354b8162ea14c55cbc3a7b0629 100644 --- a/src/server/api/endpoints/federation/following.ts +++ b/src/server/api/endpoints/federation/following.ts @@ -7,7 +7,7 @@ import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['users'], - requireCredential: false, + requireCredential: false as const, params: { host: { diff --git a/src/server/api/endpoints/federation/instances.ts b/src/server/api/endpoints/federation/instances.ts index 002cfd4335e78d2309d74e15d583eedd7f7e9394..7f0ad44aa59060394a134106e1f0269e24c6eda1 100644 --- a/src/server/api/endpoints/federation/instances.ts +++ b/src/server/api/endpoints/federation/instances.ts @@ -6,7 +6,7 @@ import { fetchMeta } from '../../../../misc/fetch-meta'; export const meta = { tags: ['federation'], - requireCredential: false, + requireCredential: false as const, params: { host: { diff --git a/src/server/api/endpoints/federation/show-instance.ts b/src/server/api/endpoints/federation/show-instance.ts index 9afcf28a7cffb91dbf7ef7fb6c10d4da85c8988c..8c3b4699722a980f473c639b7aa343c436717603 100644 --- a/src/server/api/endpoints/federation/show-instance.ts +++ b/src/server/api/endpoints/federation/show-instance.ts @@ -6,7 +6,7 @@ import { toPuny } from '../../../../misc/convert-host'; export const meta = { tags: ['federation'], - requireCredential: false, + requireCredential: false as const, params: { host: { diff --git a/src/server/api/endpoints/federation/users.ts b/src/server/api/endpoints/federation/users.ts index f69bbf949c9a572ac495533fb33e1cf461bb8f55..82db4f9f845996d42285b4a61afc12741e44585d 100644 --- a/src/server/api/endpoints/federation/users.ts +++ b/src/server/api/endpoints/federation/users.ts @@ -7,7 +7,7 @@ import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { tags: ['users'], - requireCredential: false, + requireCredential: false as const, params: { host: { diff --git a/src/server/api/endpoints/following/create.ts b/src/server/api/endpoints/following/create.ts index 5b43815a5e0f663f69885dcbc971df7f618a4cfc..9db4518282549bf06767b06ae3c970222320d1f0 100644 --- a/src/server/api/endpoints/following/create.ts +++ b/src/server/api/endpoints/following/create.ts @@ -22,7 +22,7 @@ export const meta = { max: 100 }, - requireCredential: true, + requireCredential: true as const, kind: 'write:following', diff --git a/src/server/api/endpoints/following/delete.ts b/src/server/api/endpoints/following/delete.ts index 240a037c9e30dc6eaeeab21f82923a92de2eb5a7..02957077cbdb390971166dee1dff145438a07bdd 100644 --- a/src/server/api/endpoints/following/delete.ts +++ b/src/server/api/endpoints/following/delete.ts @@ -22,7 +22,7 @@ export const meta = { max: 100 }, - requireCredential: true, + requireCredential: true as const, kind: 'write:following', diff --git a/src/server/api/endpoints/following/requests/accept.ts b/src/server/api/endpoints/following/requests/accept.ts index 65c24f7be90c99c3867d32dbd1aebfd84292c36a..6f3a0510a166882b8710d7e96bf5fb53d78e5293 100644 --- a/src/server/api/endpoints/following/requests/accept.ts +++ b/src/server/api/endpoints/following/requests/accept.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['following', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'write:following', diff --git a/src/server/api/endpoints/following/requests/cancel.ts b/src/server/api/endpoints/following/requests/cancel.ts index 79cdb776f28c3a69768b5b67c73ec51990304434..a12e1f76b6363f722d664af6db47f184019c7dc3 100644 --- a/src/server/api/endpoints/following/requests/cancel.ts +++ b/src/server/api/endpoints/following/requests/cancel.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['following', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'write:following', diff --git a/src/server/api/endpoints/following/requests/list.ts b/src/server/api/endpoints/following/requests/list.ts index 13e4a39388ec3537d03105800ef906f099d800e7..78f937bb0b0cc8dc93d5f1d95ee5b3054f676182 100644 --- a/src/server/api/endpoints/following/requests/list.ts +++ b/src/server/api/endpoints/following/requests/list.ts @@ -9,7 +9,7 @@ export const meta = { tags: ['following', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'read:following' }; diff --git a/src/server/api/endpoints/following/requests/reject.ts b/src/server/api/endpoints/following/requests/reject.ts index cccb60b24317d47d6823492f856468b437a42b13..d5c9a5b7e4e1950a44f36a280a0b12d02eedf5f8 100644 --- a/src/server/api/endpoints/following/requests/reject.ts +++ b/src/server/api/endpoints/following/requests/reject.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['following', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'write:following', diff --git a/src/server/api/endpoints/games/reversi/games/surrender.ts b/src/server/api/endpoints/games/reversi/games/surrender.ts index 56d66fb20535a37fc4e07db37d1cfa5295e40438..9fb436d42711ca1bb067a7616976175f662ed637 100644 --- a/src/server/api/endpoints/games/reversi/games/surrender.ts +++ b/src/server/api/endpoints/games/reversi/games/surrender.ts @@ -12,7 +12,7 @@ export const meta = { 'ja-JP': '指定ã—ãŸãƒªãƒãƒ¼ã‚·ã®å¯¾å±€ã§æŠ•äº†ã—ã¾ã™ã€‚' }, - requireCredential: true, + requireCredential: true as const, params: { gameId: { diff --git a/src/server/api/endpoints/games/reversi/invitations.ts b/src/server/api/endpoints/games/reversi/invitations.ts index 71f5aca1d1f337026032e72ea4d58f961a9002a3..93ea1bd58eeabc25589535b146665cfca0f27a52 100644 --- a/src/server/api/endpoints/games/reversi/invitations.ts +++ b/src/server/api/endpoints/games/reversi/invitations.ts @@ -4,7 +4,7 @@ import { ReversiMatchings } from '../../../../../models'; export const meta = { tags: ['games'], - requireCredential: true + requireCredential: true as const }; export default define(meta, async (ps, user) => { diff --git a/src/server/api/endpoints/games/reversi/match.ts b/src/server/api/endpoints/games/reversi/match.ts index da367b59782612cc0830888cf8c792ab3688b0ab..f1eb3aba28d17925e26f207f6bc6a6c1a7d9962c 100644 --- a/src/server/api/endpoints/games/reversi/match.ts +++ b/src/server/api/endpoints/games/reversi/match.ts @@ -13,7 +13,7 @@ import { ReversiMatching } from '../../../../../models/entities/games/reversi/ma export const meta = { tags: ['games'], - requireCredential: true, + requireCredential: true as const, params: { userId: { diff --git a/src/server/api/endpoints/games/reversi/match/cancel.ts b/src/server/api/endpoints/games/reversi/match/cancel.ts index 71aaae5ee1c52628c93aaec9bc8539aad41fb34c..0abd4b5c8f702b4f0993578d919b68b40b47c0a0 100644 --- a/src/server/api/endpoints/games/reversi/match/cancel.ts +++ b/src/server/api/endpoints/games/reversi/match/cancel.ts @@ -4,7 +4,7 @@ import { ReversiMatchings } from '../../../../../../models'; export const meta = { tags: ['games'], - requireCredential: true + requireCredential: true as const }; export default define(meta, async (ps, user) => { diff --git a/src/server/api/endpoints/hashtags/list.ts b/src/server/api/endpoints/hashtags/list.ts index 9bc2677793224544938f133dccf8721acc8e73a0..6e37f909ee52cd2c21c60a14a014183e2f81ba79 100644 --- a/src/server/api/endpoints/hashtags/list.ts +++ b/src/server/api/endpoints/hashtags/list.ts @@ -5,7 +5,7 @@ import { Hashtags } from '../../../../models'; export const meta = { tags: ['hashtags'], - requireCredential: false, + requireCredential: false as const, params: { limit: { diff --git a/src/server/api/endpoints/hashtags/search.ts b/src/server/api/endpoints/hashtags/search.ts index 7caaf3484647734101fa4da1d79ac11777ff9467..32342a63dcf437d72b79ea478327c3fa9604b82c 100644 --- a/src/server/api/endpoints/hashtags/search.ts +++ b/src/server/api/endpoints/hashtags/search.ts @@ -9,7 +9,7 @@ export const meta = { tags: ['hashtags'], - requireCredential: false, + requireCredential: false as const, params: { limit: { diff --git a/src/server/api/endpoints/hashtags/show.ts b/src/server/api/endpoints/hashtags/show.ts index 5de906fb1f89ad6bc555ec8844db0d3871df8e18..9462342aac6fb4067cf17a5f6c562d765bcdc879 100644 --- a/src/server/api/endpoints/hashtags/show.ts +++ b/src/server/api/endpoints/hashtags/show.ts @@ -10,7 +10,7 @@ export const meta = { tags: ['hashtags'], - requireCredential: false, + requireCredential: false as const, params: { tag: { diff --git a/src/server/api/endpoints/hashtags/trend.ts b/src/server/api/endpoints/hashtags/trend.ts index f820f0bed57445b63b879fc04038ed51fbd0edf9..0cfc62efba6ac1cf90a846f46cf350b9cbf3331d 100644 --- a/src/server/api/endpoints/hashtags/trend.ts +++ b/src/server/api/endpoints/hashtags/trend.ts @@ -21,7 +21,7 @@ const max = 5; export const meta = { tags: ['hashtags'], - requireCredential: false, + requireCredential: false as const, res: { type: 'array' as const, diff --git a/src/server/api/endpoints/hashtags/users.ts b/src/server/api/endpoints/hashtags/users.ts index 28a78ff8e6d8c2f27e4edd0fbadb5625c47bcc2b..532a490d9e95e427ee329e073a0795a3d8a36323 100644 --- a/src/server/api/endpoints/hashtags/users.ts +++ b/src/server/api/endpoints/hashtags/users.ts @@ -3,7 +3,7 @@ import define from '../../define'; import { Users } from '../../../../models'; export const meta = { - requireCredential: false, + requireCredential: false as const, tags: ['hashtags', 'users'], diff --git a/src/server/api/endpoints/i.ts b/src/server/api/endpoints/i.ts index 20a0c604f673d7ef6b22c06133d927c6570c8bb1..7983e77f00cb987404d3cbea3ea716d366f439b5 100644 --- a/src/server/api/endpoints/i.ts +++ b/src/server/api/endpoints/i.ts @@ -10,7 +10,7 @@ export const meta = { tags: ['account'], - requireCredential: true, + requireCredential: true as const, params: {}, diff --git a/src/server/api/endpoints/i/2fa/done.ts b/src/server/api/endpoints/i/2fa/done.ts index 3420bc3f64398e31a97fa75fb27c830ed7254578..7d35f929e0571795b3006b8d0571cdc4b72b1904 100644 --- a/src/server/api/endpoints/i/2fa/done.ts +++ b/src/server/api/endpoints/i/2fa/done.ts @@ -5,7 +5,7 @@ import { UserProfiles } from '../../../../../models'; import { ensure } from '../../../../../prelude/ensure'; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/2fa/key-done.ts b/src/server/api/endpoints/i/2fa/key-done.ts index d751dabc410c9859ac7241659f332fa59c8a6b5c..8ac165e629fde067f9c0c90bb3239f2ffcf64f6b 100644 --- a/src/server/api/endpoints/i/2fa/key-done.ts +++ b/src/server/api/endpoints/i/2fa/key-done.ts @@ -17,7 +17,7 @@ import { publishMainStream } from '../../../../../services/stream'; const cborDecodeFirst = promisify(cbor.decodeFirst) as any; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/2fa/password-less.ts b/src/server/api/endpoints/i/2fa/password-less.ts index 19e75ca1c507ca44900679709543ddf74baf2ab3..ee0a065e43ae4e1ba3e37bd03895d2e459e9d461 100644 --- a/src/server/api/endpoints/i/2fa/password-less.ts +++ b/src/server/api/endpoints/i/2fa/password-less.ts @@ -3,7 +3,7 @@ import define from '../../../define'; import { UserProfiles } from '../../../../../models'; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/2fa/register-key.ts b/src/server/api/endpoints/i/2fa/register-key.ts index 1c2cc32e37ff7674c8c5fa781f9f65b220f7a9f3..e189519a4cfca6d112cefb485f1616ac2e4a772e 100644 --- a/src/server/api/endpoints/i/2fa/register-key.ts +++ b/src/server/api/endpoints/i/2fa/register-key.ts @@ -11,7 +11,7 @@ import { hash } from '../../../2fa'; const randomBytes = promisify(crypto.randomBytes); export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/2fa/register.ts b/src/server/api/endpoints/i/2fa/register.ts index 112cdd6b7c34f79bbf6475bf3177ea29fc0346f5..784b276a26cccb3605c4b0013f391bfa54c3e366 100644 --- a/src/server/api/endpoints/i/2fa/register.ts +++ b/src/server/api/endpoints/i/2fa/register.ts @@ -8,7 +8,7 @@ import { UserProfiles } from '../../../../../models'; import { ensure } from '../../../../../prelude/ensure'; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/2fa/remove-key.ts b/src/server/api/endpoints/i/2fa/remove-key.ts index cb28c8fbfba89b9a05bdb627bb9aa414af410926..3eb92ba19dd855fe9bbcc3e576cc4201cfa1f21d 100644 --- a/src/server/api/endpoints/i/2fa/remove-key.ts +++ b/src/server/api/endpoints/i/2fa/remove-key.ts @@ -6,7 +6,7 @@ import { ensure } from '../../../../../prelude/ensure'; import { publishMainStream } from '../../../../../services/stream'; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/2fa/unregister.ts b/src/server/api/endpoints/i/2fa/unregister.ts index 8fda128095b755905be3f8b57209cfac63cddb08..f1287b2dcaccbcaa43e28b9d1503427f3a21bdf9 100644 --- a/src/server/api/endpoints/i/2fa/unregister.ts +++ b/src/server/api/endpoints/i/2fa/unregister.ts @@ -5,7 +5,7 @@ import { UserProfiles } from '../../../../../models'; import { ensure } from '../../../../../prelude/ensure'; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/authorized-apps.ts b/src/server/api/endpoints/i/authorized-apps.ts index 3e9fea19e2e7b405bc75e9971c466974952c362c..050d079d9b3e595ecfa7eaa8d47a3b024bdec45b 100644 --- a/src/server/api/endpoints/i/authorized-apps.ts +++ b/src/server/api/endpoints/i/authorized-apps.ts @@ -3,7 +3,7 @@ import define from '../../define'; import { AccessTokens, Apps } from '../../../../models'; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/change-password.ts b/src/server/api/endpoints/i/change-password.ts index 0f44bbf826fc919bd9f903c668528159cbded1ff..bc2ec3d7b54914153ee362b10a6867ef281f7a17 100644 --- a/src/server/api/endpoints/i/change-password.ts +++ b/src/server/api/endpoints/i/change-password.ts @@ -5,7 +5,7 @@ import { UserProfiles } from '../../../../models'; import { ensure } from '../../../../prelude/ensure'; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/delete-account.ts b/src/server/api/endpoints/i/delete-account.ts index b4950cb1fb809003a240ecfe7bd33ef32255e848..49a334917034abd12a5263dcb93d78891cfa5f5e 100644 --- a/src/server/api/endpoints/i/delete-account.ts +++ b/src/server/api/endpoints/i/delete-account.ts @@ -6,7 +6,7 @@ import { ensure } from '../../../../prelude/ensure'; import { doPostSuspend } from '../../../../services/suspend-user'; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/export-blocking.ts b/src/server/api/endpoints/i/export-blocking.ts index 14d49487e8417f753ec3f166e6c54d2e039a4f3c..87cf7655b075b8501f6bde7860899f0e9b094305 100644 --- a/src/server/api/endpoints/i/export-blocking.ts +++ b/src/server/api/endpoints/i/export-blocking.ts @@ -4,7 +4,7 @@ import ms = require('ms'); export const meta = { secure: true, - requireCredential: true, + requireCredential: true as const, limit: { duration: ms('1hour'), max: 1, diff --git a/src/server/api/endpoints/i/export-following.ts b/src/server/api/endpoints/i/export-following.ts index 50dd28837fcb48faa5ed449777604c4c7138cd4d..9afc96a24ad4fbb262b8d3f7d36f63a4f46e5080 100644 --- a/src/server/api/endpoints/i/export-following.ts +++ b/src/server/api/endpoints/i/export-following.ts @@ -4,7 +4,7 @@ import ms = require('ms'); export const meta = { secure: true, - requireCredential: true, + requireCredential: true as const, limit: { duration: ms('1hour'), max: 1, diff --git a/src/server/api/endpoints/i/export-mute.ts b/src/server/api/endpoints/i/export-mute.ts index 1eb51cd77ecc8bca3a77f7fbdd8e022a8a047a01..7bb24f8f84fea0fabfd4f057386624055f763d3f 100644 --- a/src/server/api/endpoints/i/export-mute.ts +++ b/src/server/api/endpoints/i/export-mute.ts @@ -4,7 +4,7 @@ import ms = require('ms'); export const meta = { secure: true, - requireCredential: true, + requireCredential: true as const, limit: { duration: ms('1hour'), max: 1, diff --git a/src/server/api/endpoints/i/export-notes.ts b/src/server/api/endpoints/i/export-notes.ts index dd32c18d11cab4f2d8197f6a253a551afc67515a..368a3405124bc9bc53c540b0503edc92fff28f7d 100644 --- a/src/server/api/endpoints/i/export-notes.ts +++ b/src/server/api/endpoints/i/export-notes.ts @@ -4,7 +4,7 @@ import ms = require('ms'); export const meta = { secure: true, - requireCredential: true, + requireCredential: true as const, limit: { duration: ms('1day'), max: 1, diff --git a/src/server/api/endpoints/i/export-user-lists.ts b/src/server/api/endpoints/i/export-user-lists.ts index 7650ca721081ec738a57c290b820b556df2b9c2c..e1de59f321e36c41dafb2530a63a385d8aa34f8c 100644 --- a/src/server/api/endpoints/i/export-user-lists.ts +++ b/src/server/api/endpoints/i/export-user-lists.ts @@ -4,7 +4,7 @@ import ms = require('ms'); export const meta = { secure: true, - requireCredential: true, + requireCredential: true as const, limit: { duration: ms('1min'), max: 1, diff --git a/src/server/api/endpoints/i/favorites.ts b/src/server/api/endpoints/i/favorites.ts index 1bbc16256a7ad656b6fe3c55c9880fc70a83cc92..3518bd9c4d5e6f21294a9f3fd2b15de8bad02c20 100644 --- a/src/server/api/endpoints/i/favorites.ts +++ b/src/server/api/endpoints/i/favorites.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['account', 'notes', 'favorites'], - requireCredential: true, + requireCredential: true as const, kind: 'read:favorites', diff --git a/src/server/api/endpoints/i/import-following.ts b/src/server/api/endpoints/i/import-following.ts index deafec18ecd9a549fef23491219bae1f948a8494..c8a539cda325499a43edb45c0cc0c6fc3fa6ea4d 100644 --- a/src/server/api/endpoints/i/import-following.ts +++ b/src/server/api/endpoints/i/import-following.ts @@ -8,7 +8,7 @@ import { DriveFiles } from '../../../../models'; export const meta = { secure: true, - requireCredential: true, + requireCredential: true as const, limit: { duration: ms('1hour'), max: 1, diff --git a/src/server/api/endpoints/i/import-user-lists.ts b/src/server/api/endpoints/i/import-user-lists.ts index b7d9d029b7ab6d2f0df94e62d67c40040c1ef602..e360a5468180f7ad258ba946a3f6b8ed1647833f 100644 --- a/src/server/api/endpoints/i/import-user-lists.ts +++ b/src/server/api/endpoints/i/import-user-lists.ts @@ -8,7 +8,7 @@ import { DriveFiles } from '../../../../models'; export const meta = { secure: true, - requireCredential: true, + requireCredential: true as const, limit: { duration: ms('1hour'), max: 1, diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts index f624550d493fb89aab2ae48ac20e776ff1ee9738..9a2e17a717f778dded5a0414a24268e7e4b8ef91 100644 --- a/src/server/api/endpoints/i/notifications.ts +++ b/src/server/api/endpoints/i/notifications.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['account', 'notifications'], - requireCredential: true, + requireCredential: true as const, kind: 'read:notifications', diff --git a/src/server/api/endpoints/i/page-likes.ts b/src/server/api/endpoints/i/page-likes.ts index 23bde74c994f3119f3e58591151bee2d6228254a..7f44df85db27962dd87b016980c154c0b8e8495b 100644 --- a/src/server/api/endpoints/i/page-likes.ts +++ b/src/server/api/endpoints/i/page-likes.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['account', 'pages'], - requireCredential: true, + requireCredential: true as const, kind: 'read:page-likes', diff --git a/src/server/api/endpoints/i/pages.ts b/src/server/api/endpoints/i/pages.ts index 5eb4db81b731036435f36cb7a012ef90cdb018dd..f55f228d804dfc3095cca88d481113cd2acda227 100644 --- a/src/server/api/endpoints/i/pages.ts +++ b/src/server/api/endpoints/i/pages.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['account', 'pages'], - requireCredential: true, + requireCredential: true as const, kind: 'read:pages', diff --git a/src/server/api/endpoints/i/pin.ts b/src/server/api/endpoints/i/pin.ts index ac104b19f9b945a7b7feb86306bd0a843b8be281..612eaebdb1e0ae37ae946196a20fb17fe97b0c29 100644 --- a/src/server/api/endpoints/i/pin.ts +++ b/src/server/api/endpoints/i/pin.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['account', 'notes'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/i/read-all-messaging-messages.ts b/src/server/api/endpoints/i/read-all-messaging-messages.ts index e8ada277e976b8fa477450957abe9ae2fa9a0447..036ec02d6b72e540ea5e73f173b1f942788c8ddd 100644 --- a/src/server/api/endpoints/i/read-all-messaging-messages.ts +++ b/src/server/api/endpoints/i/read-all-messaging-messages.ts @@ -10,7 +10,7 @@ export const meta = { tags: ['account', 'messaging'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/i/read-all-unread-notes.ts b/src/server/api/endpoints/i/read-all-unread-notes.ts index cc8ebf58ec5b3a245e0dfb85b27f9baf9f2a97af..efb8a7f0f8128c21779e3d7ec8cdb62233b65db5 100644 --- a/src/server/api/endpoints/i/read-all-unread-notes.ts +++ b/src/server/api/endpoints/i/read-all-unread-notes.ts @@ -10,7 +10,7 @@ export const meta = { tags: ['account'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/i/read-announcement.ts b/src/server/api/endpoints/i/read-announcement.ts index c5fbe7d576da76dddc73a35d1afa8e6ced942e4d..070e49eed09e0c16a88ea2483fa47007a726e18e 100644 --- a/src/server/api/endpoints/i/read-announcement.ts +++ b/src/server/api/endpoints/i/read-announcement.ts @@ -9,7 +9,7 @@ import { publishMainStream } from '../../../../services/stream'; export const meta = { tags: ['account'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/i/regenerate-token.ts b/src/server/api/endpoints/i/regenerate-token.ts index e27cf0b18c8e8b75d51193986fd9da6f3de482ec..5d322aa122f40bae3ea7f52ffb8964303fe9fb3b 100644 --- a/src/server/api/endpoints/i/regenerate-token.ts +++ b/src/server/api/endpoints/i/regenerate-token.ts @@ -7,7 +7,7 @@ import { Users, UserProfiles } from '../../../../models'; import { ensure } from '../../../../prelude/ensure'; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/signin-history.ts b/src/server/api/endpoints/i/signin-history.ts index 74648951fdbdfa446926437ba1ed4d71c5e04fb9..4f7da7d343a0dcd626d660077098551f5c5627da 100644 --- a/src/server/api/endpoints/i/signin-history.ts +++ b/src/server/api/endpoints/i/signin-history.ts @@ -5,7 +5,7 @@ import { Signins } from '../../../../models'; import { makePaginationQuery } from '../../common/make-pagination-query'; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/unpin.ts b/src/server/api/endpoints/i/unpin.ts index 4688533578d5a9613bdb2dce30c71a01143fda61..4d883c4fdcf197c7fbf6c5381fc81675b400d65a 100644 --- a/src/server/api/endpoints/i/unpin.ts +++ b/src/server/api/endpoints/i/unpin.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['account', 'notes'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/i/update-client-setting.ts b/src/server/api/endpoints/i/update-client-setting.ts index f79961a4f9db89b3289b7ba173c2867b69f26b0b..5143d3d9ba322eb5d692bf3b34b84a86ff80604f 100644 --- a/src/server/api/endpoints/i/update-client-setting.ts +++ b/src/server/api/endpoints/i/update-client-setting.ts @@ -5,7 +5,7 @@ import { UserProfiles } from '../../../../models'; import { ensure } from '../../../../prelude/ensure'; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/update-email.ts b/src/server/api/endpoints/i/update-email.ts index 92ac3d79eb9ace1577a841853ae31e1baf6d47f5..20d97033206832c0ef2285bac65b9820f1135a62 100644 --- a/src/server/api/endpoints/i/update-email.ts +++ b/src/server/api/endpoints/i/update-email.ts @@ -11,7 +11,7 @@ import { sendEmail } from '../../../../services/send-email'; import { ApiError } from '../../error'; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts index 14ed27fe5ac9c133d2e2056ac06bd4d350ec355e..08c37a4f6328b5604747a64ff1e1db144df5de32 100644 --- a/src/server/api/endpoints/i/update.ts +++ b/src/server/api/endpoints/i/update.ts @@ -23,7 +23,7 @@ export const meta = { tags: ['account'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/i/user-group-invites.ts b/src/server/api/endpoints/i/user-group-invites.ts index 37eaba06d234a959e04a333008518b7c2f29c2cd..9885082a4940a86de7bb144b8c6b903f433f98b6 100644 --- a/src/server/api/endpoints/i/user-group-invites.ts +++ b/src/server/api/endpoints/i/user-group-invites.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['account', 'groups'], - requireCredential: true, + requireCredential: true as const, kind: 'read:user-groups', diff --git a/src/server/api/endpoints/messaging/history.ts b/src/server/api/endpoints/messaging/history.ts index 2c143c26b5bb198f7482a5dc63632543dbfd4189..15302eb35501edf29d00f9043c26edd775800bbe 100644 --- a/src/server/api/endpoints/messaging/history.ts +++ b/src/server/api/endpoints/messaging/history.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['messaging'], - requireCredential: true, + requireCredential: true as const, kind: 'read:messaging', diff --git a/src/server/api/endpoints/messaging/messages.ts b/src/server/api/endpoints/messaging/messages.ts index ea01086a8b959a52ab31adfd8c60d6b56c40494c..479f8da8ad214a334fb7781668c328be60e65cfd 100644 --- a/src/server/api/endpoints/messaging/messages.ts +++ b/src/server/api/endpoints/messaging/messages.ts @@ -16,7 +16,7 @@ export const meta = { tags: ['messaging'], - requireCredential: true, + requireCredential: true as const, kind: 'read:messaging', diff --git a/src/server/api/endpoints/messaging/messages/create.ts b/src/server/api/endpoints/messaging/messages/create.ts index 10b82c8f78d163f0a0a469abba4289daceba7c81..3d7a1f4c4a41c2133efe14127a5343c9dfef0a52 100644 --- a/src/server/api/endpoints/messaging/messages/create.ts +++ b/src/server/api/endpoints/messaging/messages/create.ts @@ -16,7 +16,7 @@ export const meta = { tags: ['messaging'], - requireCredential: true, + requireCredential: true as const, kind: 'write:messaging', diff --git a/src/server/api/endpoints/messaging/messages/delete.ts b/src/server/api/endpoints/messaging/messages/delete.ts index fb1bb42a56046da864c769943b749157b2673d5b..bef55bbc31c55c1acf74d3fb34c87b4a2974d107 100644 --- a/src/server/api/endpoints/messaging/messages/delete.ts +++ b/src/server/api/endpoints/messaging/messages/delete.ts @@ -16,7 +16,7 @@ export const meta = { tags: ['messaging'], - requireCredential: true, + requireCredential: true as const, kind: 'write:messaging', diff --git a/src/server/api/endpoints/messaging/messages/read.ts b/src/server/api/endpoints/messaging/messages/read.ts index 7829fcef6c0d903dd2c7f484a5f8872be7bea42b..3a7aae1bd01eefe940372c9c3caf4ccfdb527827 100644 --- a/src/server/api/endpoints/messaging/messages/read.ts +++ b/src/server/api/endpoints/messaging/messages/read.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['messaging'], - requireCredential: true, + requireCredential: true as const, kind: 'write:messaging', diff --git a/src/server/api/endpoints/meta.ts b/src/server/api/endpoints/meta.ts index 281d58ba9df046af52f1d30db59a364af445b1ea..2bf7b7ed036036b2a817920a782d4e75a79439df 100644 --- a/src/server/api/endpoints/meta.ts +++ b/src/server/api/endpoints/meta.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['meta'], - requireCredential: false, + requireCredential: false as const, params: { detail: { diff --git a/src/server/api/endpoints/mute/create.ts b/src/server/api/endpoints/mute/create.ts index d13c546fdc6f82e9845e9087befb91a94852c4f1..6ad82420e206563b7d869b2200a3865482dde1b3 100644 --- a/src/server/api/endpoints/mute/create.ts +++ b/src/server/api/endpoints/mute/create.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['mute', 'users'], - requireCredential: true, + requireCredential: true as const, kind: 'write:mutes', diff --git a/src/server/api/endpoints/mute/delete.ts b/src/server/api/endpoints/mute/delete.ts index 1aae15af910804d6053b76865a4815561a93e17c..059b7989fd8db43ee7d02175418cd336912b889c 100644 --- a/src/server/api/endpoints/mute/delete.ts +++ b/src/server/api/endpoints/mute/delete.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['mute', 'users'], - requireCredential: true, + requireCredential: true as const, kind: 'write:mutes', diff --git a/src/server/api/endpoints/mute/list.ts b/src/server/api/endpoints/mute/list.ts index 1afc120f5f12b74cd8c5d4c13448b91c95fa0baf..25bf96aa2dbb33f48bca845f3503a1015ccedc59 100644 --- a/src/server/api/endpoints/mute/list.ts +++ b/src/server/api/endpoints/mute/list.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['mute', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'read:mutes', diff --git a/src/server/api/endpoints/my/apps.ts b/src/server/api/endpoints/my/apps.ts index e8b26362a4d165f4b0693d63dc83b54f18554276..348cbfc9f860113101d6f5b0ebe41f685ab7cc41 100644 --- a/src/server/api/endpoints/my/apps.ts +++ b/src/server/api/endpoints/my/apps.ts @@ -10,7 +10,7 @@ export const meta = { 'en-US': 'Get my apps' }, - requireCredential: true, + requireCredential: true as const, params: { limit: { diff --git a/src/server/api/endpoints/notes/children.ts b/src/server/api/endpoints/notes/children.ts index 79e1e5ea0f84e93da29bef11cebfa73b6fe8a139..e1a5cc1c8ff9a44e414213fa1c0cb76bfaeb530a 100644 --- a/src/server/api/endpoints/notes/children.ts +++ b/src/server/api/endpoints/notes/children.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['notes'], - requireCredential: false, + requireCredential: false as const, params: { noteId: { diff --git a/src/server/api/endpoints/notes/conversation.ts b/src/server/api/endpoints/notes/conversation.ts index 245d427923f0f48e02ff095d68fb762135715334..0dea309b880c53a45a5f648f71d6274b4e28d42c 100644 --- a/src/server/api/endpoints/notes/conversation.ts +++ b/src/server/api/endpoints/notes/conversation.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['notes'], - requireCredential: false, + requireCredential: false as const, params: { noteId: { diff --git a/src/server/api/endpoints/notes/create.ts b/src/server/api/endpoints/notes/create.ts index 73db73ed97d40d9fa76d3f98a618760f40b589e9..f4bdd5fb55cf513ccd3325209afe4cb49150ece9 100644 --- a/src/server/api/endpoints/notes/create.ts +++ b/src/server/api/endpoints/notes/create.ts @@ -29,7 +29,7 @@ export const meta = { tags: ['notes'], - requireCredential: true, + requireCredential: true as const, limit: { duration: ms('1hour'), diff --git a/src/server/api/endpoints/notes/delete.ts b/src/server/api/endpoints/notes/delete.ts index 17d44c424d304ca473756cb680fb8aa5593d5c67..f185ab2e222a0212c09ccedf3acdee08e7d27e22 100644 --- a/src/server/api/endpoints/notes/delete.ts +++ b/src/server/api/endpoints/notes/delete.ts @@ -18,7 +18,7 @@ export const meta = { tags: ['notes'], - requireCredential: true, + requireCredential: true as const, kind: 'write:notes', diff --git a/src/server/api/endpoints/notes/favorites/create.ts b/src/server/api/endpoints/notes/favorites/create.ts index e3a786fdbd595c4eab70a4d58fb28d7ab4801f35..0ca01c42d2c93104a17d133cb2fdd0aa00f76879 100644 --- a/src/server/api/endpoints/notes/favorites/create.ts +++ b/src/server/api/endpoints/notes/favorites/create.ts @@ -16,7 +16,7 @@ export const meta = { tags: ['notes', 'favorites'], - requireCredential: true, + requireCredential: true as const, kind: 'write:favorites', diff --git a/src/server/api/endpoints/notes/favorites/delete.ts b/src/server/api/endpoints/notes/favorites/delete.ts index eea35ef589fad9db60b1537b1c2cbf8eca2dd097..7035b91d5f77ef0fb194e7f7d351fa6d3b48a7b0 100644 --- a/src/server/api/endpoints/notes/favorites/delete.ts +++ b/src/server/api/endpoints/notes/favorites/delete.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['notes', 'favorites'], - requireCredential: true, + requireCredential: true as const, kind: 'write:favorites', diff --git a/src/server/api/endpoints/notes/featured.ts b/src/server/api/endpoints/notes/featured.ts index a499afabf0e3e5875eb28efb97970b3e28352ce4..5fc60eeccf071aa538607090603655458d9983c6 100644 --- a/src/server/api/endpoints/notes/featured.ts +++ b/src/server/api/endpoints/notes/featured.ts @@ -11,7 +11,7 @@ export const meta = { tags: ['notes'], - requireCredential: false, + requireCredential: false as const, params: { limit: { diff --git a/src/server/api/endpoints/notes/hybrid-timeline.ts b/src/server/api/endpoints/notes/hybrid-timeline.ts index 4ff8e65e30e65e0e3266b04b3a479a1d5076398e..a4f376f8e97b20fb4d6bf21a68c9879a9fb9cac1 100644 --- a/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -17,7 +17,7 @@ export const meta = { tags: ['notes'], - requireCredential: true, + requireCredential: true as const, params: { limit: { diff --git a/src/server/api/endpoints/notes/mentions.ts b/src/server/api/endpoints/notes/mentions.ts index fd3767f6329885779fe6d9ff0e578db15830183e..a478d89c0774e5b2408776718f21f1ea0597a1c1 100644 --- a/src/server/api/endpoints/notes/mentions.ts +++ b/src/server/api/endpoints/notes/mentions.ts @@ -16,7 +16,7 @@ export const meta = { tags: ['notes'], - requireCredential: true, + requireCredential: true as const, params: { following: { diff --git a/src/server/api/endpoints/notes/polls/recommendation.ts b/src/server/api/endpoints/notes/polls/recommendation.ts index cbd4d35cd4be080d309d040e77e3e93448fcbede..a915c95a3fd8ceba9d0a7a32a7dca0123666ddd1 100644 --- a/src/server/api/endpoints/notes/polls/recommendation.ts +++ b/src/server/api/endpoints/notes/polls/recommendation.ts @@ -11,7 +11,7 @@ export const meta = { tags: ['notes'], - requireCredential: true, + requireCredential: true as const, params: { limit: { diff --git a/src/server/api/endpoints/notes/polls/vote.ts b/src/server/api/endpoints/notes/polls/vote.ts index 0510e70d3ef8c2bd5b6a3b940a774a5b79bbe373..3c5492f8ee72a5303dc301a13af0bb649edae856 100644 --- a/src/server/api/endpoints/notes/polls/vote.ts +++ b/src/server/api/endpoints/notes/polls/vote.ts @@ -24,7 +24,7 @@ export const meta = { tags: ['notes'], - requireCredential: true, + requireCredential: true as const, kind: 'write:votes', diff --git a/src/server/api/endpoints/notes/reactions.ts b/src/server/api/endpoints/notes/reactions.ts index 742489c0cd47954bb38c46293b261d27745ac5c8..4874c85b67ef33f9a6c2730128851dc6c2834fce 100644 --- a/src/server/api/endpoints/notes/reactions.ts +++ b/src/server/api/endpoints/notes/reactions.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['notes', 'reactions'], - requireCredential: false, + requireCredential: false as const, params: { noteId: { diff --git a/src/server/api/endpoints/notes/reactions/create.ts b/src/server/api/endpoints/notes/reactions/create.ts index b6aa4c58f3a9d21938943d2d196fb44356604ada..eab1dfde7c2ecee11ec4dde0eb94ea0b472278ee 100644 --- a/src/server/api/endpoints/notes/reactions/create.ts +++ b/src/server/api/endpoints/notes/reactions/create.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['reactions', 'notes'], - requireCredential: true, + requireCredential: true as const, kind: 'write:reactions', diff --git a/src/server/api/endpoints/notes/reactions/delete.ts b/src/server/api/endpoints/notes/reactions/delete.ts index 0bdea58027926d9865767a29ab38934968c13a77..267d8417c2528d6a06437158d4369284493662fa 100644 --- a/src/server/api/endpoints/notes/reactions/delete.ts +++ b/src/server/api/endpoints/notes/reactions/delete.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['reactions', 'notes'], - requireCredential: true, + requireCredential: true as const, kind: 'write:reactions', diff --git a/src/server/api/endpoints/notes/renotes.ts b/src/server/api/endpoints/notes/renotes.ts index 7f77f16a6a164af7e4b1d63d807b3584fa23c44d..1a6f66b36857d61a508f115b36c277810c57736f 100644 --- a/src/server/api/endpoints/notes/renotes.ts +++ b/src/server/api/endpoints/notes/renotes.ts @@ -16,7 +16,7 @@ export const meta = { tags: ['notes'], - requireCredential: false, + requireCredential: false as const, params: { noteId: { diff --git a/src/server/api/endpoints/notes/replies.ts b/src/server/api/endpoints/notes/replies.ts index 7830ce7acb6acbe77ffa1335c16e5c3b633c03ea..3bf16804ef129fdd750b52395096b11abd933ff5 100644 --- a/src/server/api/endpoints/notes/replies.ts +++ b/src/server/api/endpoints/notes/replies.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['notes'], - requireCredential: false, + requireCredential: false as const, params: { noteId: { diff --git a/src/server/api/endpoints/notes/search.ts b/src/server/api/endpoints/notes/search.ts index efc08d0d4a403b9071509ec4caea84ce37e0c0f5..602c1a71f5f3a4c4b79a3c4bd50013a3eb85b9f4 100644 --- a/src/server/api/endpoints/notes/search.ts +++ b/src/server/api/endpoints/notes/search.ts @@ -17,7 +17,7 @@ export const meta = { tags: ['notes'], - requireCredential: false, + requireCredential: false as const, params: { query: { diff --git a/src/server/api/endpoints/notes/show.ts b/src/server/api/endpoints/notes/show.ts index 75abbae55fb15fc841773732b851bf9946cacd61..2ce2a2b35e1aa96346d075d2e2b51ba6825ccae4 100644 --- a/src/server/api/endpoints/notes/show.ts +++ b/src/server/api/endpoints/notes/show.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['notes'], - requireCredential: false, + requireCredential: false as const, params: { noteId: { diff --git a/src/server/api/endpoints/notes/state.ts b/src/server/api/endpoints/notes/state.ts index df1d9d9fb0d42c136763dc040d1d0bf9e1a069f3..73adb8026bd40972a2e1d1a05a97423d070127e3 100644 --- a/src/server/api/endpoints/notes/state.ts +++ b/src/server/api/endpoints/notes/state.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['notes'], - requireCredential: true, + requireCredential: true as const, params: { noteId: { diff --git a/src/server/api/endpoints/notes/timeline.ts b/src/server/api/endpoints/notes/timeline.ts index 1cf8cc4d18848b653d25102341fcb616e790c2be..68a5784d9344bc04f407ec18d18240e5d900fad1 100644 --- a/src/server/api/endpoints/notes/timeline.ts +++ b/src/server/api/endpoints/notes/timeline.ts @@ -16,7 +16,7 @@ export const meta = { tags: ['notes'], - requireCredential: true, + requireCredential: true as const, params: { limit: { diff --git a/src/server/api/endpoints/notes/unrenote.ts b/src/server/api/endpoints/notes/unrenote.ts index a2070fd221875f319cbeb7fc6dc625bda21b3731..af558a9897edb96924dcc6b49e5521dad4c1a77c 100644 --- a/src/server/api/endpoints/notes/unrenote.ts +++ b/src/server/api/endpoints/notes/unrenote.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['notes'], - requireCredential: true, + requireCredential: true as const, kind: 'write:notes', diff --git a/src/server/api/endpoints/notes/user-list-timeline.ts b/src/server/api/endpoints/notes/user-list-timeline.ts index 1e669b9d82059c5abea203201758e467bfc23ff3..b0ff499d955c49ad98842f25c1f7a6347c813961 100644 --- a/src/server/api/endpoints/notes/user-list-timeline.ts +++ b/src/server/api/endpoints/notes/user-list-timeline.ts @@ -16,7 +16,7 @@ export const meta = { tags: ['notes', 'lists'], - requireCredential: true, + requireCredential: true as const, params: { listId: { diff --git a/src/server/api/endpoints/notes/watching/create.ts b/src/server/api/endpoints/notes/watching/create.ts index b4045fe93c07ccf86161bc34a4b3b5539578f087..b6baf3464a29fd536c633ac2520ace7c4e2c8754 100644 --- a/src/server/api/endpoints/notes/watching/create.ts +++ b/src/server/api/endpoints/notes/watching/create.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['notes'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/notes/watching/delete.ts b/src/server/api/endpoints/notes/watching/delete.ts index a272ecc37d29e8d54ccd217b952187b914a383c8..70db66b6d2f8e08e0ef37fa441aa26912b934617 100644 --- a/src/server/api/endpoints/notes/watching/delete.ts +++ b/src/server/api/endpoints/notes/watching/delete.ts @@ -15,7 +15,7 @@ export const meta = { tags: ['notes'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/notifications/mark-all-as-read.ts b/src/server/api/endpoints/notifications/mark-all-as-read.ts index 9f34a32e80acc9c7a900d6eb99257e933328a75b..a17a3e721605f23936eeb08fbd6292aa9df378bf 100644 --- a/src/server/api/endpoints/notifications/mark-all-as-read.ts +++ b/src/server/api/endpoints/notifications/mark-all-as-read.ts @@ -10,7 +10,7 @@ export const meta = { tags: ['notifications', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'write:notifications' }; diff --git a/src/server/api/endpoints/page-push.ts b/src/server/api/endpoints/page-push.ts index bdd2ebfe516b88915e2b1ff094b6148fa56a9484..3b19e1e192522f82b475c3e3b5962773f0e16e7e 100644 --- a/src/server/api/endpoints/page-push.ts +++ b/src/server/api/endpoints/page-push.ts @@ -6,7 +6,7 @@ import { Users, Pages } from '../../../models'; import { ApiError } from '../error'; export const meta = { - requireCredential: true, + requireCredential: true as const, secure: true, params: { diff --git a/src/server/api/endpoints/pages/create.ts b/src/server/api/endpoints/pages/create.ts index 62077fa956ef1da729ddff3293cecfd08a393dd8..11e476242ecea2555f536967fc0a70175ca3f31e 100644 --- a/src/server/api/endpoints/pages/create.ts +++ b/src/server/api/endpoints/pages/create.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['pages'], - requireCredential: true, + requireCredential: true as const, kind: 'write:pages', diff --git a/src/server/api/endpoints/pages/delete.ts b/src/server/api/endpoints/pages/delete.ts index 043805aa33f572315923cef2b82cb62ee0654d73..99849ab5fe34b6c02d941a6d39a4346cae05c9df 100644 --- a/src/server/api/endpoints/pages/delete.ts +++ b/src/server/api/endpoints/pages/delete.ts @@ -11,7 +11,7 @@ export const meta = { tags: ['pages'], - requireCredential: true, + requireCredential: true as const, kind: 'write:pages', diff --git a/src/server/api/endpoints/pages/like.ts b/src/server/api/endpoints/pages/like.ts index 5a50bd6c6c453a13bd8ee181dc67a6440de9db34..5c7e13f1c819645ed56fbb77218b9fff1e6334d5 100644 --- a/src/server/api/endpoints/pages/like.ts +++ b/src/server/api/endpoints/pages/like.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['pages'], - requireCredential: true, + requireCredential: true as const, kind: 'write:page-likes', diff --git a/src/server/api/endpoints/pages/show.ts b/src/server/api/endpoints/pages/show.ts index 84808418f3a8286fdc6b80adda19eb9c9c33ec41..c8e5ad1d9bd29e62aa887fa6f729ac18a169eaab 100644 --- a/src/server/api/endpoints/pages/show.ts +++ b/src/server/api/endpoints/pages/show.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['pages'], - requireCredential: false, + requireCredential: false as const, params: { pageId: { diff --git a/src/server/api/endpoints/pages/unlike.ts b/src/server/api/endpoints/pages/unlike.ts index 49ad999b31d2711f67b27666b3d3b9f87e919998..865df91c3e97e924b832ec4ff24db1f36828e386 100644 --- a/src/server/api/endpoints/pages/unlike.ts +++ b/src/server/api/endpoints/pages/unlike.ts @@ -11,7 +11,7 @@ export const meta = { tags: ['pages'], - requireCredential: true, + requireCredential: true as const, kind: 'write:page-likes', diff --git a/src/server/api/endpoints/pages/update.ts b/src/server/api/endpoints/pages/update.ts index e98aedefa608c5b08ad3bd47998b143de8eb761c..a0fed28891b25c089bfac38306f976c483e24ba3 100644 --- a/src/server/api/endpoints/pages/update.ts +++ b/src/server/api/endpoints/pages/update.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['pages'], - requireCredential: true, + requireCredential: true as const, kind: 'write:pages', diff --git a/src/server/api/endpoints/pinned-users.ts b/src/server/api/endpoints/pinned-users.ts index 853e1cd4b8bc8bdf042f63b0bfbe91c1de16bd99..a129a56d87e27b7172f2b6376f249e53849c0da4 100644 --- a/src/server/api/endpoints/pinned-users.ts +++ b/src/server/api/endpoints/pinned-users.ts @@ -7,7 +7,7 @@ import { User } from '../../../models/entities/user'; export const meta = { tags: ['users'], - requireCredential: false, + requireCredential: false as const, params: { }, diff --git a/src/server/api/endpoints/room/show.ts b/src/server/api/endpoints/room/show.ts index 2dc69210a0b5686ee18a571b43a7ad80fc14e696..96248a8c0cf4933536080b1dd7dc8e71ee82bf8e 100644 --- a/src/server/api/endpoints/room/show.ts +++ b/src/server/api/endpoints/room/show.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['room'], - requireCredential: false, + requireCredential: false as const, params: { userId: { diff --git a/src/server/api/endpoints/room/update.ts b/src/server/api/endpoints/room/update.ts index 97586eb6f3923afd811a1f3283acd7f9fbbf97cd..c2955f625b58fca2c1a3bb5fd7b2d2cfdb6a66f7 100644 --- a/src/server/api/endpoints/room/update.ts +++ b/src/server/api/endpoints/room/update.ts @@ -4,7 +4,7 @@ import define from '../../define'; import { Users, UserProfiles } from '../../../../models'; export const meta = { - requireCredential: true, + requireCredential: true as const, params: { room: { diff --git a/src/server/api/endpoints/stats.ts b/src/server/api/endpoints/stats.ts index c86d893d5ec2c87ed57950f1ba75706b329088ce..5bc224450ba37df9c97a77b235f478bb57861ae3 100644 --- a/src/server/api/endpoints/stats.ts +++ b/src/server/api/endpoints/stats.ts @@ -3,7 +3,7 @@ import { Notes, Users } from '../../../models'; import { federationChart, driveChart } from '../../../services/chart'; export const meta = { - requireCredential: false, + requireCredential: false as const, desc: { 'en-US': 'Get the instance\'s statistics' diff --git a/src/server/api/endpoints/sw/register.ts b/src/server/api/endpoints/sw/register.ts index a4838b45654b236431122bd8d6a39c404ab57182..4253c9557ee9c4c7c0f0d76921a38863c9a4bc95 100644 --- a/src/server/api/endpoints/sw/register.ts +++ b/src/server/api/endpoints/sw/register.ts @@ -7,7 +7,7 @@ import { SwSubscriptions } from '../../../../models'; export const meta = { tags: ['account'], - requireCredential: true, + requireCredential: true as const, params: { endpoint: { diff --git a/src/server/api/endpoints/username/available.ts b/src/server/api/endpoints/username/available.ts index f393d6ed0d8e92a31c1be114dce317849a629897..89f14d3dc29b6b1ad0b00c75bbd3f222ed28c321 100644 --- a/src/server/api/endpoints/username/available.ts +++ b/src/server/api/endpoints/username/available.ts @@ -5,7 +5,7 @@ import { Users, UsedUsernames } from '../../../../models'; export const meta = { tags: ['users'], - requireCredential: false, + requireCredential: false as const, params: { username: { diff --git a/src/server/api/endpoints/users.ts b/src/server/api/endpoints/users.ts index 93cf01a6f8669d9e3759b5deda6516ac5bfc2435..d21dceb27ce20aaa4dc8c10f1aa7b7c358789103 100644 --- a/src/server/api/endpoints/users.ts +++ b/src/server/api/endpoints/users.ts @@ -6,7 +6,7 @@ import { generateMuteQueryForUsers } from '../common/generate-mute-query'; export const meta = { tags: ['users'], - requireCredential: false, + requireCredential: false as const, params: { limit: { diff --git a/src/server/api/endpoints/users/followers.ts b/src/server/api/endpoints/users/followers.ts index 68c32fe983ee891a69b35428a884bbb88cff25a2..bd4a2739c6077c0f97dd25b5cdac25540161a68d 100644 --- a/src/server/api/endpoints/users/followers.ts +++ b/src/server/api/endpoints/users/followers.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['users'], - requireCredential: false, + requireCredential: false as const, params: { userId: { diff --git a/src/server/api/endpoints/users/following.ts b/src/server/api/endpoints/users/following.ts index eb699b29037fd784c89a0b5613365c5df98ab0be..9efb8bfc937c80cac9454476e4d6efc1f2abe237 100644 --- a/src/server/api/endpoints/users/following.ts +++ b/src/server/api/endpoints/users/following.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['users'], - requireCredential: false, + requireCredential: false as const, params: { userId: { diff --git a/src/server/api/endpoints/users/get-frequently-replied-users.ts b/src/server/api/endpoints/users/get-frequently-replied-users.ts index 1a17b488f09aec71add2eaac22ba4e5c08d9a0e6..d0650a172deff9483a5a62e24efa37d7e4a5ef5d 100644 --- a/src/server/api/endpoints/users/get-frequently-replied-users.ts +++ b/src/server/api/endpoints/users/get-frequently-replied-users.ts @@ -10,7 +10,7 @@ import { Notes, Users } from '../../../../models'; export const meta = { tags: ['users'], - requireCredential: false, + requireCredential: false as const, params: { userId: { diff --git a/src/server/api/endpoints/users/groups/create.ts b/src/server/api/endpoints/users/groups/create.ts index 2a6e5135e55732c5c29463abe5f013f4d5ca2675..ca011d5cd653d8276f01d71ea746ad188ccc0487 100644 --- a/src/server/api/endpoints/users/groups/create.ts +++ b/src/server/api/endpoints/users/groups/create.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['groups'], - requireCredential: true, + requireCredential: true as const, kind: 'write:user-groups', diff --git a/src/server/api/endpoints/users/groups/delete.ts b/src/server/api/endpoints/users/groups/delete.ts index 4f89c324a1aae9f68cbed9e3a34de92287f67950..71b882516925ffcc1296d8d9f0abeac0330eb1b5 100644 --- a/src/server/api/endpoints/users/groups/delete.ts +++ b/src/server/api/endpoints/users/groups/delete.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['groups'], - requireCredential: true, + requireCredential: true as const, kind: 'write:user-groups', diff --git a/src/server/api/endpoints/users/groups/invitations/accept.ts b/src/server/api/endpoints/users/groups/invitations/accept.ts index cb5cb7bd055f309d05a9c01675eabbba28c6abc6..e86709f83b946a7cd717e8f49afad90f97872214 100644 --- a/src/server/api/endpoints/users/groups/invitations/accept.ts +++ b/src/server/api/endpoints/users/groups/invitations/accept.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['groups', 'users'], - requireCredential: true, + requireCredential: true as const, kind: 'write:user-groups', diff --git a/src/server/api/endpoints/users/groups/invitations/reject.ts b/src/server/api/endpoints/users/groups/invitations/reject.ts index b9c25c767055ab4fbde53dcda51973f53e171fd7..42803d37c75816cf33097bec55f699b3a6c503da 100644 --- a/src/server/api/endpoints/users/groups/invitations/reject.ts +++ b/src/server/api/endpoints/users/groups/invitations/reject.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['groups', 'users'], - requireCredential: true, + requireCredential: true as const, kind: 'write:user-groups', diff --git a/src/server/api/endpoints/users/groups/invite.ts b/src/server/api/endpoints/users/groups/invite.ts index bd32b00a63005e847db657fa3e30f061a74a5983..da0fd1c2ca90a0bdff54282d3486ba2c54011c2a 100644 --- a/src/server/api/endpoints/users/groups/invite.ts +++ b/src/server/api/endpoints/users/groups/invite.ts @@ -16,7 +16,7 @@ export const meta = { tags: ['groups', 'users'], - requireCredential: true, + requireCredential: true as const, kind: 'write:user-groups', diff --git a/src/server/api/endpoints/users/groups/joined.ts b/src/server/api/endpoints/users/groups/joined.ts index c60ba57c0912c8255b752c07d94587db691c4927..a579a738e584d6d4d45d7dc49d2793f9352d2817 100644 --- a/src/server/api/endpoints/users/groups/joined.ts +++ b/src/server/api/endpoints/users/groups/joined.ts @@ -9,7 +9,7 @@ export const meta = { tags: ['groups', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'read:user-groups', diff --git a/src/server/api/endpoints/users/groups/owned.ts b/src/server/api/endpoints/users/groups/owned.ts index e2c0bf2fc1802b4b7f2d4e97939021e23ac0f711..bb34090cbc9a4a4052b4d3aea21650f110b72a00 100644 --- a/src/server/api/endpoints/users/groups/owned.ts +++ b/src/server/api/endpoints/users/groups/owned.ts @@ -8,7 +8,7 @@ export const meta = { tags: ['groups', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'read:user-groups', diff --git a/src/server/api/endpoints/users/groups/pull.ts b/src/server/api/endpoints/users/groups/pull.ts index 648cdc3ddf057eca7b9f6dd6ea7ee0c6247d8d34..f4af884dd153c89337c0c4d379d454230fdb011d 100644 --- a/src/server/api/endpoints/users/groups/pull.ts +++ b/src/server/api/endpoints/users/groups/pull.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['groups', 'users'], - requireCredential: true, + requireCredential: true as const, kind: 'write:user-groups', diff --git a/src/server/api/endpoints/users/groups/show.ts b/src/server/api/endpoints/users/groups/show.ts index 643f1acf7a611cd43c4f5844c065b923db1a95ac..13f171f61416919fd192ece37920c1f5c8e6bfa7 100644 --- a/src/server/api/endpoints/users/groups/show.ts +++ b/src/server/api/endpoints/users/groups/show.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['groups', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'read:user-groups', diff --git a/src/server/api/endpoints/users/groups/transfer.ts b/src/server/api/endpoints/users/groups/transfer.ts index 012f9f4ef3755ac2f45cc6c2f2564045d977026f..03f5f39279daa286ef57a168c702b674a2aa1075 100644 --- a/src/server/api/endpoints/users/groups/transfer.ts +++ b/src/server/api/endpoints/users/groups/transfer.ts @@ -13,7 +13,7 @@ export const meta = { tags: ['groups', 'users'], - requireCredential: true, + requireCredential: true as const, kind: 'write:user-groups', diff --git a/src/server/api/endpoints/users/groups/update.ts b/src/server/api/endpoints/users/groups/update.ts index 2fc0a803a19403d33fbef1b8f6960664ff41299c..805b2de6a8dafb4915ffef5f97ea4944207553b2 100644 --- a/src/server/api/endpoints/users/groups/update.ts +++ b/src/server/api/endpoints/users/groups/update.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['groups'], - requireCredential: true, + requireCredential: true as const, kind: 'write:user-groups', diff --git a/src/server/api/endpoints/users/lists/create.ts b/src/server/api/endpoints/users/lists/create.ts index 28af3c8d86e9f0c15997ac23fded67dc53a27a75..d02696aed418e7aad74c884e97a7effac19feef0 100644 --- a/src/server/api/endpoints/users/lists/create.ts +++ b/src/server/api/endpoints/users/lists/create.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['lists'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/users/lists/delete.ts b/src/server/api/endpoints/users/lists/delete.ts index 0634bca4e3b04a4345bd535f4ec8a97cbda9907f..930af1827f152398a396d1e5eef76c3f0ffa857d 100644 --- a/src/server/api/endpoints/users/lists/delete.ts +++ b/src/server/api/endpoints/users/lists/delete.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['lists'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/users/lists/list.ts b/src/server/api/endpoints/users/lists/list.ts index 7b89d34314f1b7cc9e167db27b25cd6c2ddc426b..16f1b0639c00b75f2d05b5025f1d91e8ad3e2702 100644 --- a/src/server/api/endpoints/users/lists/list.ts +++ b/src/server/api/endpoints/users/lists/list.ts @@ -8,7 +8,7 @@ export const meta = { tags: ['lists', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'read:account', diff --git a/src/server/api/endpoints/users/lists/pull.ts b/src/server/api/endpoints/users/lists/pull.ts index 7776423012012f2141d61154ecaf0b3c77537f32..1a5be2afc4b5e93c687639c5cfc6f049d113dd57 100644 --- a/src/server/api/endpoints/users/lists/pull.ts +++ b/src/server/api/endpoints/users/lists/pull.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['lists', 'users'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/users/lists/push.ts b/src/server/api/endpoints/users/lists/push.ts index bdc84030833d4eb1294f107f7055725a866525f9..fd76cb8159840c24b70b8ca5f113a648923fdc5f 100644 --- a/src/server/api/endpoints/users/lists/push.ts +++ b/src/server/api/endpoints/users/lists/push.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['lists', 'users'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/users/lists/show.ts b/src/server/api/endpoints/users/lists/show.ts index 01d03d1bfb4860a5768897f5e4c20c0dd103b49a..5d80a8f472163eadeaed706026a4093345ed6bde 100644 --- a/src/server/api/endpoints/users/lists/show.ts +++ b/src/server/api/endpoints/users/lists/show.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['lists', 'account'], - requireCredential: true, + requireCredential: true as const, kind: 'read:account', diff --git a/src/server/api/endpoints/users/lists/update.ts b/src/server/api/endpoints/users/lists/update.ts index dc08d59f6a4a128777f89d6970e7be01cc17d1d9..600d834f9e695793ffff7c12a476d8eba6727acf 100644 --- a/src/server/api/endpoints/users/lists/update.ts +++ b/src/server/api/endpoints/users/lists/update.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['lists'], - requireCredential: true, + requireCredential: true as const, kind: 'write:account', diff --git a/src/server/api/endpoints/users/recommendation.ts b/src/server/api/endpoints/users/recommendation.ts index 5f7f287fe8f3b41498d54a0cd5ba9d4519e380f8..73ac615d46ce1a737e3269f16a13777dfd005fa7 100644 --- a/src/server/api/endpoints/users/recommendation.ts +++ b/src/server/api/endpoints/users/recommendation.ts @@ -12,7 +12,7 @@ export const meta = { tags: ['users'], - requireCredential: true, + requireCredential: true as const, kind: 'read:account', diff --git a/src/server/api/endpoints/users/relation.ts b/src/server/api/endpoints/users/relation.ts index 4971738d32038b5b69f5a3c8c25ed31b61141f27..086e9bd1ea44ab34a405c8e23a547a845a6b4633 100644 --- a/src/server/api/endpoints/users/relation.ts +++ b/src/server/api/endpoints/users/relation.ts @@ -10,7 +10,7 @@ export const meta = { tags: ['users'], - requireCredential: true, + requireCredential: true as const, params: { userId: { diff --git a/src/server/api/endpoints/users/report-abuse.ts b/src/server/api/endpoints/users/report-abuse.ts index 2ee28c90023e4dcc1f0cc6fe3166b3b1dedaea3b..a9b5543f3cffcaf7ab77d595f0154e91e2bebcba 100644 --- a/src/server/api/endpoints/users/report-abuse.ts +++ b/src/server/api/endpoints/users/report-abuse.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['users'], - requireCredential: true, + requireCredential: true as const, params: { userId: { diff --git a/src/server/api/endpoints/users/search-by-username-and-host.ts b/src/server/api/endpoints/users/search-by-username-and-host.ts index 8544731dfd2777d24931d8a7367ca816e6988d49..81ff19ff6f4569420d20ede4d00345c573fcfd98 100644 --- a/src/server/api/endpoints/users/search-by-username-and-host.ts +++ b/src/server/api/endpoints/users/search-by-username-and-host.ts @@ -10,7 +10,7 @@ export const meta = { tags: ['users'], - requireCredential: false, + requireCredential: false as const, params: { username: { diff --git a/src/server/api/endpoints/users/search.ts b/src/server/api/endpoints/users/search.ts index 9aa9e398e31eb26a318394242b49f3447cd6897a..dbeb6eb6af688110d7b114a989e978a3768c4cbd 100644 --- a/src/server/api/endpoints/users/search.ts +++ b/src/server/api/endpoints/users/search.ts @@ -10,7 +10,7 @@ export const meta = { tags: ['users'], - requireCredential: false, + requireCredential: false as const, params: { query: { diff --git a/src/server/api/endpoints/users/show.ts b/src/server/api/endpoints/users/show.ts index f49017a8c3afb566d49988dadefdbd395251ea06..ee068e8e26d78657bfa2b7944186b34a77bb7a65 100644 --- a/src/server/api/endpoints/users/show.ts +++ b/src/server/api/endpoints/users/show.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['users'], - requireCredential: false, + requireCredential: false as const, params: { userId: {