misskey-dev / misskey

🌎 A completely free and open interplanetary microblogging platform 🚀
https://misskey-hub.net/
GNU Affero General Public License v3.0
9.95k stars 1.35k forks source link

refactor(backend): すべてのエンドポイントの型チェックを強化 #14518

Open kakkokari-gtyih opened 1 month ago

kakkokari-gtyih commented 1 month ago

What

全エンドポイントのmetaとparamDefにsatisfiesを追加

Why

metaとかparamDefを書くときに補完が効くようになる

Additional info (optional)

正規表現で一括置き換えしたのでミスがあるかも

Checklist

github-actions[bot] commented 1 month ago

このPRによるapi.jsonの差分

差分はこちら ```diff ```

Get diff files from Workflow Page

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 40.07%. Comparing base (567acea) to head (e612fbf).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #14518 +/- ## ============================================ + Coverage 20.16% 40.07% +19.90% ============================================ Files 725 1547 +822 Lines 100579 191792 +91213 Branches 1045 3543 +2498 ============================================ + Hits 20279 76852 +56573 - Misses 79758 114378 +34620 - Partials 542 562 +20 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kakkokari-gtyih commented 1 month ago

typecheckが落ちてるわね

KisaragiEffective commented 1 month ago

Schemaのプロパティが足りないっぽい

KisaragiEffective commented 1 month ago
 Error: src/server/api/endpoints/admin/abuse-report/notification-recipient/create.ts(36,4): error TS2353: Object literal may only specify known properties, and 'httpStatusCode' does not exist in type '{ readonly message: string; readonly code: string; readonly id: string; }'.
Error: src/server/api/endpoints/admin/abuse-report/notification-recipient/create.ts(42,4): error TS2353: Object literal may only specify known properties, and 'httpStatusCode' does not exist in type '{ readonly message: string; readonly code: string; readonly id: string; }'.
Error: src/server/api/endpoints/admin/abuse-report/notification-recipient/create.ts(48,4): error TS2353: Object literal may only specify known properties, and 'httpStatusCode' does not exist in type '{ readonly message: string; readonly code: string; readonly id: string; }'.
Error: src/server/api/endpoints/admin/abuse-report/notification-recipient/show.ts(34,4): error TS2353: Object literal may only specify known properties, and 'kind' does not exist in type '{ readonly message: string; readonly code: string; readonly id: string; }'.
Error: src/server/api/endpoints/admin/abuse-report/notification-recipient/update.ts(36,4): error TS2353: Object literal may only specify known properties, and 'httpStatusCode' does not exist in type '{ readonly message: string; readonly code: string; readonly id: string; }'.
Error: src/server/api/endpoints/admin/abuse-report/notification-recipient/update.ts(42,4): error TS2353: Object literal may only specify known properties, and 'httpStatusCode' does not exist in type '{ readonly message: string; readonly code: string; readonly id: string; }'.
Error: src/server/api/endpoints/admin/abuse-report/notification-recipient/update.ts(48,4): error TS2353: Object literal may only specify known properties, and 'httpStatusCode' does not exist in type '{ readonly message: string; readonly code: string; readonly id: string; }'.

kakkokari-gtyih commented 1 month ago

https://github.com/misskey-dev/misskey/pull/14518#issuecomment-2334331977 は普通に型定義が足りてなかったみたい