diff --git a/.config/docker_example.yml b/.config/docker_example.yml index d457569167..6465a9527b 100644 --- a/.config/docker_example.yml +++ b/.config/docker_example.yml @@ -114,6 +114,7 @@ redis: # Available methods: # aid ... Short, Millisecond accuracy +# aidx ... Millisecond accuracy # meid ... Similar to ObjectID, Millisecond accuracy # ulid ... Millisecond accuracy # objectid ... This is left for backward compatibility @@ -121,7 +122,7 @@ redis: # ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE # ID SETTINGS AFTER THAT! -id: 'aid' +id: 'aidx' # ┌─────────────────────┐ #───┘ Other configuration └───────────────────────────────────── @@ -165,8 +166,8 @@ proxyBypassHosts: # Media Proxy #mediaProxy: https://example.com/proxy -# Proxy remote files (default: false) -#proxyRemoteFiles: true +# Proxy remote files (default: true) +proxyRemoteFiles: true # Sign to ActivityPub GET request (default: true) signToActivityPubGet: true diff --git a/.config/example.yml b/.config/example.yml index 400f827492..5e38490454 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -125,6 +125,7 @@ redis: # Available methods: # aid ... Short, Millisecond accuracy +# aidx ... Millisecond accuracy # meid ... Similar to ObjectID, Millisecond accuracy # ulid ... Millisecond accuracy # objectid ... This is left for backward compatibility @@ -132,7 +133,7 @@ redis: # ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE # ID SETTINGS AFTER THAT! -id: 'aid' +id: 'aidx' # ┌─────────────────────┐ #───┘ Other configuration └───────────────────────────────────── @@ -159,6 +160,9 @@ id: 'aid' #deliverJobMaxAttempts: 12 #inboxJobMaxAttempts: 8 +# Local address used for outgoing requests +#outgoingAddress: 127.0.0.1 + # IP address family used for outgoing request (ipv4, ipv6 or dual) #outgoingAddressFamily: ipv4 @@ -183,9 +187,9 @@ proxyBypassHosts: # * Perform image compression (on a different server resource than the main process) #mediaProxy: https://example.com/proxy -# Proxy remote files (default: false) +# Proxy remote files (default: true) # Proxy remote files by this instance or mediaProxy to prevent remote files from running in remote domains. -#proxyRemoteFiles: true +proxyRemoteFiles: true # Movie Thumbnail Generation URL # There is no reference implementation. diff --git a/.devcontainer/devcontainer.yml b/.devcontainer/devcontainer.yml index 824a046dc0..5dcd41599a 100644 --- a/.devcontainer/devcontainer.yml +++ b/.devcontainer/devcontainer.yml @@ -114,6 +114,7 @@ redis: # Available methods: # aid ... Short, Millisecond accuracy +# aidx ... Millisecond accuracy # meid ... Similar to ObjectID, Millisecond accuracy # ulid ... Millisecond accuracy # objectid ... This is left for backward compatibility @@ -121,7 +122,7 @@ redis: # ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE # ID SETTINGS AFTER THAT! -id: 'aid' +id: 'aidx' # ┌─────────────────────┐ #───┘ Other configuration └───────────────────────────────────── @@ -165,8 +166,8 @@ proxyBypassHosts: # Media Proxy #mediaProxy: https://example.com/proxy -# Proxy remote files (default: false) -#proxyRemoteFiles: true +# Proxy remote files (default: true) +proxyRemoteFiles: true # Sign to ActivityPub GET request (default: true) signToActivityPubGet: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 730647b086..e8b65dc3b9 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,7 +1,4 @@ contact_links: - - name: 👪 Misskey Forum - url: https://forum.misskey.io/ - about: Ask questions and share knowledge - name: 💬 Misskey official Discord url: https://discord.gg/Wp8gVStHW3 about: Chat freely about Misskey diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e878e5836a..5955f6b5d9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,24 +9,24 @@ updates: directory: "/" schedule: interval: daily - open-pull-requests-limit: 0 + open-pull-requests-limit: 100 + +# Add only the root, not each workspace item +# https://github.com/dependabot/dependabot-core/issues/4993#issuecomment-1289133027 - package-ecosystem: npm directory: "/" schedule: interval: daily + # PNPM has an issue with dependabot. See: + # https://github.com/dependabot/dependabot-core/issues/7258 + # https://github.com/pnpm/pnpm/issues/6530 + # TODO: Restore this when the issue is solved open-pull-requests-limit: 0 -- package-ecosystem: npm - directory: "/packages/backend" - schedule: - interval: daily - open-pull-requests-limit: 0 -- package-ecosystem: npm - directory: "/packages/frontend" - schedule: - interval: daily - open-pull-requests-limit: 0 -- package-ecosystem: npm - directory: "/packages/sw" - schedule: - interval: daily - open-pull-requests-limit: 0 + groups: + swc: + patterns: + - "@swc/*" + storybook: + patterns: + - "storybook*" + - "@storybook/*" diff --git a/.github/misskey/test.yml b/.github/misskey/test.yml index f43f74be14..7a4aa4ae6c 100644 --- a/.github/misskey/test.yml +++ b/.github/misskey/test.yml @@ -12,4 +12,4 @@ db: redis: host: 127.0.0.1 port: 56312 -id: aid +id: aidx diff --git a/.github/workflows/api-misskey-js.yml b/.github/workflows/api-misskey-js.yml index ed004c78dc..4cf523a6b9 100644 --- a/.github/workflows/api-misskey-js.yml +++ b/.github/workflows/api-misskey-js.yml @@ -9,12 +9,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v4.0.0 - run: corepack enable - name: Setup Node.js - uses: actions/setup-node@v3.6.0 + uses: actions/setup-node@v3.8.1 with: node-version-file: '.node-version' cache: 'pnpm' diff --git a/.github/workflows/check_copyright_year.yml b/.github/workflows/check_copyright_year.yml index 8daea44a83..313265f671 100644 --- a/.github/workflows/check_copyright_year.yml +++ b/.github/workflows/check_copyright_year.yml @@ -10,7 +10,7 @@ jobs: check_copyright_year: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.2.0 + - uses: actions/checkout@v4.0.0 - run: | if [ "$(grep Copyright COPYING | sed -e 's/.*2014-\([0-9]*\) .*/\1/g')" -ne "$(date +%Y)" ]; then echo "Please change copyright year!" diff --git a/.github/workflows/docker-develop.yml b/.github/workflows/docker-develop.yml index 09a2c33e0c..05bb7f77f9 100644 --- a/.github/workflows/docker-develop.yml +++ b/.github/workflows/docker-develop.yml @@ -13,24 +13,24 @@ jobs: if: github.repository == 'misskey-dev/misskey' steps: - name: Check out the repo - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v4.0.0 - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v2.3.0 + uses: docker/setup-buildx-action@v3.0.0 with: platforms: linux/amd64,linux/arm64 - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: misskey/misskey - name: Log in to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and Push to Docker Hub - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: builder: ${{ steps.buildx.outputs.name }} context: . diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a465d92eaf..32a98a416d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -12,15 +12,15 @@ jobs: steps: - name: Check out the repo - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v4.0.0 - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v2.3.0 + uses: docker/setup-buildx-action@v3.0.0 with: platforms: linux/amd64,linux/arm64 - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: misskey/misskey tags: | @@ -31,12 +31,12 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - name: Log in to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and Push to Docker Hub - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: builder: ${{ steps.buildx.outputs.name }} context: . diff --git a/.github/workflows/dockle.yml b/.github/workflows/dockle.yml index 9b79ee54f0..d811944d61 100644 --- a/.github/workflows/dockle.yml +++ b/.github/workflows/dockle.yml @@ -14,7 +14,7 @@ jobs: env: DOCKER_CONTENT_TRUST: 1 steps: - - uses: actions/checkout@v3.2.0 + - uses: actions/checkout@v4.0.0 - run: | curl -L -o dockle.deb "https://github.com/goodwithtech/dockle/releases/download/v0.4.10/dockle_0.4.10_Linux-64bit.deb" sudo dpkg -i dockle.deb diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0f3702f958..7c10c23e77 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,7 @@ jobs: pnpm_install: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.0.0 with: fetch-depth: 0 submodules: true @@ -19,7 +19,7 @@ jobs: with: version: 8 run_install: false - - uses: actions/setup-node@v3.6.0 + - uses: actions/setup-node@v3.8.1 with: node-version-file: '.node-version' cache: 'pnpm' @@ -38,7 +38,7 @@ jobs: - sw - misskey-js steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.0.0 with: fetch-depth: 0 submodules: true @@ -46,7 +46,7 @@ jobs: with: version: 7 run_install: false - - uses: actions/setup-node@v3.6.0 + - uses: actions/setup-node@v3.8.1 with: node-version-file: '.node-version' cache: 'pnpm' @@ -64,7 +64,7 @@ jobs: - backend - misskey-js steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.0.0 with: fetch-depth: 0 submodules: true @@ -72,7 +72,7 @@ jobs: with: version: 7 run_install: false - - uses: actions/setup-node@v3.6.0 + - uses: actions/setup-node@v3.8.1 with: node-version-file: '.node-version' cache: 'pnpm' diff --git a/.github/workflows/ok-to-test.yml b/.github/workflows/ok-to-test.yml index 87af3a6ba6..c02b980e4d 100644 --- a/.github/workflows/ok-to-test.yml +++ b/.github/workflows/ok-to-test.yml @@ -17,13 +17,13 @@ jobs: # See app.yml for an example app manifest - name: Generate token id: generate_token - uses: tibdex/github-app-token@v1 + uses: tibdex/github-app-token@v2 with: app_id: ${{ secrets.DEPLOYBOT_APP_ID }} private_key: ${{ secrets.DEPLOYBOT_PRIVATE_KEY }} - name: Slash Command Dispatch - uses: peter-evans/slash-command-dispatch@v1 + uses: peter-evans/slash-command-dispatch@v3 env: TOKEN: ${{ steps.generate_token.outputs.token }} with: diff --git a/.github/workflows/pr-preview-deploy.yml b/.github/workflows/pr-preview-deploy.yml index 9b786d34aa..702d8917e3 100644 --- a/.github/workflows/pr-preview-deploy.yml +++ b/.github/workflows/pr-preview-deploy.yml @@ -53,7 +53,7 @@ jobs: # Check out merge commit - name: Fork based /deploy checkout - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v4.0.0 with: ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge' diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml index d7be15bd4f..d3cb415801 100644 --- a/.github/workflows/test-backend.yml +++ b/.github/workflows/test-backend.yml @@ -29,7 +29,7 @@ jobs: - 56312:6379 steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.0.0 with: submodules: true - name: Install pnpm @@ -38,7 +38,7 @@ jobs: version: 8 run_install: false - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.6.0 + uses: actions/setup-node@v3.8.1 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml index 4ea4ba4628..7b8c52049d 100644 --- a/.github/workflows/test-frontend.yml +++ b/.github/workflows/test-frontend.yml @@ -16,7 +16,7 @@ jobs: node-version: [18.x] steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.0.0 with: submodules: true - name: Install pnpm @@ -25,7 +25,7 @@ jobs: version: 8 run_install: false - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.6.0 + uses: actions/setup-node@v3.8.1 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' @@ -68,7 +68,7 @@ jobs: - 56312:6379 steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.0.0 with: submodules: true # https://github.com/cypress-io/cypress-docker-images/issues/150 @@ -83,7 +83,7 @@ jobs: version: 7 run_install: false - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.6.0 + uses: actions/setup-node@v3.8.1 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' @@ -101,7 +101,7 @@ jobs: - name: Cypress install run: pnpm exec cypress install - name: Cypress run - uses: cypress-io/github-action@v5 + uses: cypress-io/github-action@v6 with: install: false start: pnpm start:test diff --git a/.github/workflows/test-misskey-js.yml b/.github/workflows/test-misskey-js.yml index b15e704c7f..51fe54581f 100644 --- a/.github/workflows/test-misskey-js.yml +++ b/.github/workflows/test-misskey-js.yml @@ -21,12 +21,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3.3.0 + uses: actions/checkout@v4.0.0 - run: corepack enable - name: Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.6.0 + uses: actions/setup-node@v3.8.1 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' diff --git a/.github/workflows/test-production.yml b/.github/workflows/test-production.yml index 5243a83777..00d624d8b7 100644 --- a/.github/workflows/test-production.yml +++ b/.github/workflows/test-production.yml @@ -19,7 +19,7 @@ jobs: node-version: [18.x] steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v4.0.0 with: submodules: true - name: Install pnpm @@ -28,7 +28,7 @@ jobs: version: 8 run_install: false - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3.6.0 + uses: actions/setup-node@v3.8.1 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' diff --git a/CHANGELOG.md b/CHANGELOG.md index 5385b800ef..6b696116b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ +## 2023.9.0 (unreleased) + +### Note +- meilisearchを使用する場合、v1.2以上が必要です + +### General +- Feat: OAuth 2.0のサポート +- Feat: お知らせ機能の強化 + - ユーザー個別のお知らせを作成可能に + - お知らせのバナー表示やダイアログ表示が可能に + - お知らせのアイコンを設定可能に +- Feat: チャンネルをセンシティブ指定できるようになりました + - センシティブチャンネルのNoteのReNoteはデフォルトでHome TLに流れるようになりました + - センシティブチャンネルのノートはユーザープロフィールに表示されません +- Feat: 二要素認証のバックアップコードが生成されるようになりました + - ref. https://github.com/MisskeyIO/misskey/pull/121 +- Feat: 二要素認証でパスキーをサポートするようになりました +- Feat: 指定したユーザーが投稿したときに通知できるようになりました +- Feat: プロフィールでのリンク検証 +- Feat: モデレーションログ機能 +- Feat: 通知をテストできるようになりました +- Feat: PWAのアイコンが設定できるようになりました +- Enhance: サーバー名の略称が設定できるようになりました +- Enhance: アンテナの受信ソースに指定したユーザを除外するものを追加 +- Enhance: 二要素認証設定時のセキュリティを強化 + - パスワード入力が必要な操作を行う際、二要素認証が有効であれば確認コードの入力も必要になりました +- Enhance: manifest.jsonをオーバーライド可能に +- Enhance: 依存関係の更新 +- Enhance: ローカリゼーションの更新 + +### Client +- Feat: 任意のユーザーリストをタイムラインページにピン留めできるように + - 設定->クライアント設定->全般 から設定可能です +- Feat: Playで直接投稿フォームを埋め込めるように(`Ui:C:postForm`) +- Feat: クライアントを起動している間、デバイスの画面が自動でオフになるのを防ぐオプションを追加 +- Feat: 新しい実績を追加 +- Enhance: ノート詳細ページでリノート一覧、リアクション一覧タブを追加 + - ノートのメニューからは当該項目は消えました +- Enhance: センシティブなメディアを目立たせる設定を追加 +- Enhance: プロフィールにその人が作ったPlayの一覧出せるように +- Enhance: メニューのスイッチの動作を改善 +- Enhance: 絵文字ピッカーの検索の表示件数を100件に増加 +- Enhance: 投稿フォームのプレビューの表示状態を記憶するように +- Enhance: ユーザーメニューでスイッチでユーザーリストに追加・削除できるように +- Enhance: 自分が押したリアクションのデザインを改善 +- Enhance: ノート検索にローカルのみ検索可能なオプションの追加 +- Enhance: Renote自体を通報できるように +- Enhance: データセーバーモードの強化 +- Enhance: Renoteを管理者権限で削除可能に +- Enhance: `$[rainbow ]`記法が、動きのあるMFMが無効になっていても使用できるようになりました +- Enhance: Playの操作を行うAPI TokenをAPIコンソールから発行できるように +- Enhance: リアクションの表示サイズをより大きくできるように +- Enhance: AiScriptを0.16.0に更新 +- Enhance: AiScriptからMisskeyサーバーAPIを呼び出す際の制限を撤廃 +- Enhance: AiScriptで`LOCALE`として現在の設定言語を取得できるように +- Enhance: Mk:apiが失敗した時にエラー型の値(AiScript 0.16.0で追加)を返すように +- Enhance: ScratchpadでAsync:系関数やボタンのコールバックなどのエラーにもダイアログを出すように(試験的なためPlayなどには未実装) +- Enhance: ノート詳細ページ読み込み時のパフォーマンスが向上しました +- Enhance: タイムラインでリスト/アンテナ選択時のパフォーマンスを改善 +- Enhance: 「Moderation note」、「Add moderation note」をローカライズできるように +- Enhance: プラグインのソースコードを確認・コピーできるように +- Enhance: 細かなデザインの調整 +- Fix: サーバー情報画面(`/instance-info/{domain}`)でブロックができないのを修正 +- Fix: 未読のお知らせの「わかった」をクリック・タップしてもその場で「わかった」が消えない問題を修正 +- Fix: iOSで画面を回転させるとテキストサイズが変わる問題を修正 +- Fix: word mute for sub note is not applied +- Fix: タイムラインを下にスクロールしてノート画面に移動して再び戻ったら以前のスクロール位置を失う問題を修正 +- Fix: Misskeyプラグインをインストールする際のAiScriptバージョンのチェックが0.14.0以降に対応していない問題を修正 +- Fix: 他のサーバーのユーザーへ「メッセージを送信」した時の初期テキストのメンションが間違っている問題を修正 +- Fix: 環境によってはMisskey Webが開けない問題を修正 +- Fix: プラグインの権限リストが見れない問題を修正 +- Fix: 複数の階層があるメニューで、短くタップすると正常に動かない場合がある問題を修正 +- Fix: アニメーションがオフのとき、スマホで子メニューの選択ができない問題を修正 +- Fix: ドロワーメニューで、親メニュー項目をマウスでホバーすると子メニューが表示されてしまう問題を修正 +- Fix: AiScriptでMk:apiが外部と通信できる問題を修正 + +### Server +- Change: cacheRemoteFilesの初期値はfalseになりました +- Enhance: ファイルアップロード時等にファイル名の拡張子を修正する関数(correctFilename)の挙動を改善 +- Enhance: Webhookのペイロードにサーバーのurlが含まれるようになりました +- Enhance: Webhook設定でsecretを空に出来るように +- Enhance: 使われていないアンテナの自動停止を設定可能に +- Enhance: nodeinfo 2.1対応 +- Enhance: 自分へのメンション一覧を取得する際のパフォーマンスを向上 +- Enhance: Docker環境でjemallocを使用することでメモリ使用量を削減 +- Enhance: ID生成方式としてaidxを追加、かつデフォルトに +- Fix: MK_ONLY_SERVERオプションを指定した際にクラッシュする問題を修正 +- Fix: notes/reactionsのページネーションが機能しない問題を修正 +- Fix: ノート検索 `notes/search` にてhostを指定した際に検索結果に反映されるように +- Fix: 一部のfeatured noteを照会できない問題を修正 +- Fix: muteがapiからのuser list timeline取得で機能しない問題を修正 +- Fix: ジョブキュー管理画面の認証を回避できる問題を修正 +- Fix: 一部のサーバー内部エラーがスタックトレースを返さないように修正 +- Fix: 一部のリモートユーザーをフォローすることができない問題を修正 + ## 13.14.2 ### Client @@ -25,6 +120,7 @@ ### Server - Fix: APIのオフセットが壊れていたせいで「もっと見る」でもっと見れない問題を修正 - Fix: 外部サーバーの投稿がタイムラインに表示されないことがある問題を修正 +- Enhance: Add address bind config option (outgoingAddress) ## 13.14.1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 62bc11cd99..484fd99413 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -301,6 +301,12 @@ export const handlers = [ Don't forget to re-run the `.storybook/generate.js` script after adding, editing, or removing the above files. ## Notes + +### Misskeyのドメイン固有の概念は`Mi`をprefixする +例えばGoogleが自社サービスをMap、Earth、DriveではなくGoogle Map、Google Earth、Google Driveのように命名するのと同じ +コード上でMisskeyのドメイン固有の概念には`Mi`をprefixすることで、他のドメインの同様の概念と区別できるほか、名前の衝突を防ぐ。 +ただし、文脈上Misskeyのものを指すことが明らかであり、名前の衝突の恐れがない場合は、一時的なローカル変数に限って`Mi`を省略してもよい。 + ### How to resolve conflictions occurred at pnpm-lock.yaml? Just execute `pnpm` to fix it. @@ -430,3 +436,6 @@ marginはそのコンポーネントを使う側が設定する ## その他 ### HTMLのクラス名で follow という単語は使わない 広告ブロッカーで誤ってブロックされる + +### indexというファイル名を使うな +ESMではディレクトリインポートは廃止されているのと、ディレクトリインポートせずともファイル名が index だと何故か一部のライブラリ?でディレクトリインポートだと見做されてエラーになる diff --git a/Dockerfile b/Dockerfile index 787e248cb1..97a3eb9c1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,7 +62,8 @@ ARG GID="991" RUN apt-get update \ && apt-get install -y --no-install-recommends \ - ffmpeg tini curl libjemalloc2 \ + ffmpeg tini curl libjemalloc-dev libjemalloc2 \ + && ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so \ && corepack enable \ && groupadd -g "${GID}" misskey \ && useradd -l -u "${UID}" -g "${GID}" -m -d /misskey misskey \ @@ -81,7 +82,7 @@ COPY --chown=misskey:misskey --from=native-builder /misskey/packages/backend/bui COPY --chown=misskey:misskey --from=native-builder /misskey/fluent-emojis /misskey/fluent-emojis COPY --chown=misskey:misskey . ./ -ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 +ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so ENV MALLOC_CONF=background_thread:true,metadata_thp:auto,dirty_decay_ms:30000,muzzy_decay_ms:30000 ENV NODE_ENV=production HEALTHCHECK --interval=5s --retries=20 CMD ["/bin/bash", "/misskey/healthcheck.sh"] diff --git a/ROADMAP.md b/ROADMAP.md index 420f728758..3077c41e73 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -22,7 +22,7 @@ This is the phase we are at now. We need to make a high-maintenance environment Once Phase 1 is complete and an environment conducive to the development of a stable system is in place, the implementation of new functions can begin gradually. - Improve features for moderation -- OAuth2 support https://github.com/misskey-dev/misskey/issues/8262 +- ~~OAuth2 support https://github.com/misskey-dev/misskey/issues/8262~~ → Done ✔️ - GraphQL support? ## (3) Improve scalability diff --git a/chart/files/default.yml b/chart/files/default.yml index e62032abfd..90b574b99f 100644 --- a/chart/files/default.yml +++ b/chart/files/default.yml @@ -135,6 +135,7 @@ redis: # Available methods: # aid ... Short, Millisecond accuracy +# aidx ... Millisecond accuracy # meid ... Similar to ObjectID, Millisecond accuracy # ulid ... Millisecond accuracy # objectid ... This is left for backward compatibility @@ -142,7 +143,7 @@ redis: # ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE # ID SETTINGS AFTER THAT! -id: "aid" +id: "aidx" # ┌─────────────────────┐ #───┘ Other configuration └───────────────────────────────────── diff --git a/docker-compose.yml.example b/docker-compose.yml.example index a0061c5c20..60ba4dc8ca 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -50,7 +50,7 @@ services: # meilisearch: # restart: always -# image: getmeili/meilisearch:v1.1.1 +# image: getmeili/meilisearch:v1.3.4 # environment: # - MEILI_NO_ANALYTICS=true # - MEILI_ENV=production diff --git a/gulpfile.mjs b/gulpfile.mjs deleted file mode 100644 index aaa96cf4d1..0000000000 --- a/gulpfile.mjs +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Gulp tasks - */ - -import * as fs from 'node:fs'; -import gulp from 'gulp'; -import rename from 'gulp-rename'; -import replace from 'gulp-replace'; -import terser from 'gulp-terser'; -import cssnano from 'gulp-cssnano'; - -import locales from './locales/index.js'; -import meta from './package.json' assert { type: "json" }; - -gulp.task('copy:backend:views', () => - gulp.src('./packages/backend/src/server/web/views/**/*').pipe(gulp.dest('./packages/backend/built/server/web/views')) -); - -gulp.task('copy:frontend:fonts', () => - gulp.src('./packages/frontend/node_modules/three/examples/fonts/**/*').pipe(gulp.dest('./built/_frontend_dist_/fonts/')) -); - -gulp.task('copy:frontend:tabler-icons', () => - gulp.src('./packages/frontend/node_modules/@tabler/icons-webfont/**/*').pipe(gulp.dest('./built/_frontend_dist_/tabler-icons/')) -); - -gulp.task('copy:frontend:locales', cb => { - fs.mkdirSync('./built/_frontend_dist_/locales', { recursive: true }); - - const v = { '_version_': meta.version }; - - for (const [lang, locale] of Object.entries(locales)) { - fs.writeFileSync(`./built/_frontend_dist_/locales/${lang}.${meta.version}.json`, JSON.stringify({ ...locale, ...v }), 'utf-8'); - } - - cb(); -}); - -gulp.task('build:backend:script', () => { - const clientManifestExists = fs.existsSync('./built/_vite_/manifest.json'); - const clientEntry = clientManifestExists ? - JSON.parse(fs.readFileSync('./built/_vite_/manifest.json', 'utf-8'))['src/_boot_.ts'].file - : 'src/_boot_.ts' - - return gulp.src(['./packages/backend/src/server/web/boot.js', './packages/backend/src/server/web/bios.js', './packages/backend/src/server/web/cli.js', './packages/backend/src/server/web/flush.js']) - .pipe(replace('LANGS', JSON.stringify(Object.keys(locales)))) - .pipe(replace('CLIENT_ENTRY', JSON.stringify(clientEntry))) - .pipe(terser({ - toplevel: true - })) - .pipe(rename({ suffix: `.${meta.version}` })) - .pipe(gulp.dest('./built/_frontend_dist_/')); -}); - -gulp.task('build:backend:style', () => { - return gulp.src(['./packages/backend/src/server/web/style.css', './packages/backend/src/server/web/bios.css', './packages/backend/src/server/web/cli.css', './packages/backend/src/server/web/error.css']) - .pipe(cssnano({ - zindex: false - })) - .pipe(gulp.dest('./packages/backend/built/server/web/')); -}); - -gulp.task('build', gulp.parallel( - 'copy:frontend:locales', 'copy:backend:views', 'build:backend:script', 'build:backend:style', 'copy:frontend:fonts', 'copy:frontend:tabler-icons' -)); - -gulp.task('default', gulp.task('build')); - -gulp.task('watch', () => { - gulp.watch([ - './packages/*/src/**/*', - ], { ignoreInitial: false }, gulp.task('build')); -}); diff --git a/locales/ar-SA.yml b/locales/ar-SA.yml index d7df0233f0..a7b3844ef4 100644 --- a/locales/ar-SA.yml +++ b/locales/ar-SA.yml @@ -348,7 +348,6 @@ invite: "دعوة" driveCapacityPerLocalAccount: "حصة التخزين لكل مستخدم محلي" driveCapacityPerRemoteAccount: "حصة التخزين لكل مستخدم بعيد" inMb: "بالميغابايت" -iconUrl: "رابط الأيقونة" bannerUrl: "رابط صورة اللافتة" backgroundImageUrl: "رابط صورة الخلفية" basicInfo: "المعلومات الأساسية " @@ -645,6 +644,7 @@ optional: "اختياري" createNewClip: "أنشئ مِشبكَا جديدًا" confirmToUnclipAlreadyClippedNote: "هذه الملاحظة تنتمي للمشبك {name} سلفًا، أتريد حذفها منه⸮" public: "علني" +private: "خاص" i18nInfo: "يترجم متطوعون ميسكي إلى عدة لغات، يمكنك المساعدة عبر {link}" manageAccessTokens: "إدارة رموز الوصول" accountInfo: "معلومات الحساب" @@ -798,6 +798,7 @@ accountDeletionInProgress: "حذف الحساب جارٍ" usernameInfo: "الاسم الذي يميزك عن بافي مستخدمي هذا الخادم، يمكنك استخدام الحروف اللاتينية (a~z, A~Z) والأرقام (0~9) والشرطة السفلية (_). لا يمكنك تغييره بعد تسجيله." devMode: "وضع المُطوّر" keepCw: "أبقِ على تحذيرات المحتوى" +pubSub: "حسابات Pub/Sub" lastCommunication: "آخر تواصل" resolved: "عولج" unresolved: "لم يعالج" @@ -806,6 +807,7 @@ breakFollowConfirm: "أمتأكد من إزالة المتابِع ؟" itsOn: "مفعّل" itsOff: "معطّل" on: "مفعل" +off: "معطل" emailRequiredForSignup: "عنوان البريد الإلكتروني إلزامي للتسجيل" unread: "غير مقروءة" filter: "رشّح" @@ -852,6 +854,7 @@ recentNDays: "آخر {n} أيام" noEmailServerWarning: "خادم البريد غير مضبوط." thereIsUnresolvedAbuseReportWarning: "توجد بلاغات غير معالجة." recommended: "مقترح" +check: "التحقق" driveCapOverrideLabel: "غيّر حجم قرص التخزين لهذا المستخدم" driveCapOverrideCaption: "أعد الحجم إلى القيمة الافتراضية بإدخال 0 أو أقل." requireAdminForView: "لاستعراض هذه الصفحة وجب عليك الولوج كمدير." @@ -875,6 +878,7 @@ slow: "بطيء" fast: "سريع" sensitiveMediaDetection: "التعرف على المحتوى الحساس" localOnly: "المحلي فقط" +remoteOnly: "بُعدي فقط" failedToUpload: "فشل الرفع" cannotUploadBecauseInappropriate: "تعذر رفع الملف لوجود محتوى حساس فيه." cannotUploadBecauseNoFreeSpace: "تعذر رفع الملف لنقص مساحة التخزين." @@ -894,6 +898,7 @@ pushNotificationAlreadySubscribed: "إرسال الإشعارات مفعل سل pushNotificationNotSupported: "متصفحك لا يدعم إرسال الإشعارات أو المثيل لا يدعمها." sendPushNotificationReadMessage: "احذف الإشعارات فور قراءتها" sendPushNotificationReadMessageCaption: "هذا قد يزيد من معدل استهلاك الطاقة لجهازك." +windowMaximize: "املأ الشاشة" windowRestore: "استرجاع" caption: "التعليق التوضيحي" loggedInAsBot: "والج كآلي" @@ -951,6 +956,8 @@ accountMoved: "نقل هذا المستخدم حسابه:" accountMovedShort: "رُحل هذا الحساب." operationForbidden: "عملية ممنوعة" forceShowAds: "أظهر الإعلانات التجارية دائما" +reactionsList: "التفاعلات" +renotesList: "إعادات النشر" leftTop: "أعلى اليسار" rightTop: "أعلى اليمين" leftBottom: "أسفل اليسار" @@ -986,6 +993,12 @@ later: "لاحقاً" goToMisskey: "لميسكي" additionalEmojiDictionary: "قواميس إيموجي إضافية" installed: "مُثبت" +expirationDate: "تاريخ انتهاء الصلاحية" +unused: "غير مستعمَل" +expired: "منتهية صلاحيته" +icon: "الصورة الرمزية" +replies: "رد" +renotes: "أعد النشر" _initialAccountSetting: accountCreated: "نجح إنشاء حسابك!" letsStartAccountSetup: "إذا كنت جديدًا لنعدّ حسابك الشخصي." @@ -1071,6 +1084,7 @@ _role: description: "وصف الدور" permission: "أذونات الدور" assignTarget: "نوع الإسناد" + condition: "الشرط" options: "خيارات" policies: "السياسة العامة" priority: "الأولوية" @@ -1126,6 +1140,10 @@ _plugin: install: "ثبّت إضافات" installWarn: "رجاءً لا تثبت إضافات غير موثوقة." manage: "إدارة الإضافات" + viewSource: "اظهر المصدر" +_preferencesBackups: + createdAt: "تم إنشاؤه: {date} {time}" + updatedAt: "آخر تحديث: {date} {time}" _registry: scope: "الحيّز" key: "مفتاح" @@ -1250,6 +1268,9 @@ _time: minute: "د" hour: "سا" day: "ي" +_timelineTutorial: + title: "كيف تستخدم Misskey" + step3_1: "هل نشرت ملاحظتك الأولى؟" _2fa: alreadyRegistered: "سجلت سلفًا جهازًا للاستيثاق بعاملين." step1: "أولًا ثبّت تطبيق استيثاق على جهازك (مثل {a} و{b})." @@ -1487,22 +1508,22 @@ _notification: fileUploaded: "نجح رفع الملف" youGotMention: "{name} أشار إليك" youGotReply: "ردّ عليك {name}" - youGotQuote: "اقتبس منك {name}" - youRenoted: "إعادت نشر من {name}" + youGotQuote: "اقتبس {name} منشورك" + youRenoted: "أعاد {name} نشر منشورك" youWereFollowed: "يتابعك" youReceivedFollowRequest: "تلقيتَ طلب متابعة" yourFollowRequestAccepted: "قُبل طلب المتابعة" - pollEnded: "ظهرت نتائج الاستطلاع" + pollEnded: "انتهى الاستطلاع" unreadAntennaNote: "هوائي {name}" _types: all: "الكل" follow: "متابِعون جدد" mention: "الإشارات" reply: "الردود" - renote: "أعد النشر" + renote: "أعاد النشر" quote: "الاقتباسات" - reaction: "التفاعلات" - receiveFollowRequest: "طلبات المتابعة المتلقاة" + reaction: "التفاعل" + receiveFollowRequest: "طلبات المتابعة" followRequestAccepted: "طلبات المتابعة المقبولة" app: "إشعارات التطبيقات المرتبطة" _actions: @@ -1510,26 +1531,31 @@ _notification: reply: "رد" renote: "أعد النشر" _deck: - alwaysShowMainColumn: "أظهر العمود الرئيسي دائمًا" - columnAlign: "حاذِ الأعمدة" - addColumn: "أضف عمودًا" - swapLeft: "حرّك لليسار" - swapRight: "حرّك لليمين" - swapUp: "حرّك لأعلى" - swapDown: "حرّك لأسفل" - profile: "الملف الشخصي" + alwaysShowMainColumn: "أظهر العمود الأساسي دائمًا" + columnAlign: "محاذاة الأعمدة" + addColumn: "إضافة عمود" + swapLeft: "التحريك إلى اليسار" + swapRight: "التحريك إلى اليمين" + swapUp: "التحريك إلى الأعلى" + swapDown: "التحريك إلى الأسفل" + profile: "حسابي الشخصي" + newProfile: "ملف تعريفي جديد" + deleteProfile: "حذف الملف التعريفي" _columns: - main: "الرئيسي" - widgets: "الودجات" + main: "الرئيسية" + widgets: "التطبيقات المُصغّرة" notifications: "الإشعارات" - tl: "الخيط الزمني" + tl: "الخط الزمني" antenna: "الهوائيات" list: "القوائم" channel: "القنوات" mentions: "الإشارات" direct: "مباشرة" _webhookSettings: - name: "الإسم" - active: "مفعّل" + name: "الاسم" + active: "مُفعّل" _events: - reaction: "عند تلقي تفاعل" + reaction: "عند التفاعل" +_moderationLogTypes: + suspend: "علِق" + resetPassword: "أعد تعيين كلمتك السرية" diff --git a/locales/bn-BD.yml b/locales/bn-BD.yml index de9502acf4..c980fd8c57 100644 --- a/locales/bn-BD.yml +++ b/locales/bn-BD.yml @@ -328,7 +328,6 @@ invite: "আমন্ত্রণ" driveCapacityPerLocalAccount: "প্রত্যেক স্থানীয় ব্যাবহারকারীর জন্য ড্রাইভের জায়গা" driveCapacityPerRemoteAccount: "প্রত্যেক রিমোট ব্যাবহারকারীর জন্য ড্রাইভের জায়গা" inMb: "মেগাবাইটে লিখুন" -iconUrl: "আইকনের URL (ফ্যাভিকন, ইত্যাদি)" bannerUrl: "ব্যানার ছবির URL" backgroundImageUrl: "পটভূমির চিত্রের URL" basicInfo: "আপনার ব্যক্তিগত তথ্য" @@ -628,6 +627,7 @@ createNew: "নতুন" optional: "প্রয়োজনীয় নয়" createNewClip: "নতুন ক্লিপ তৈরি করুন" public: "সর্বজনীন" +private: "ব্যাক্তিগত" i18nInfo: "Misskey স্বেচ্ছাসেবকদের দ্বারা বিভিন্ন ভাষায় অনুবাদ করা হচ্ছে। আপনি {link} এ গিয়ে অনুবাদে সহযোগিতা করতে পারেন।" manageAccessTokens: "অ্যাক্সেস টোকেন পরিচালনা করুন" accountInfo: "অ্যাকাউন্টের তথ্য" @@ -837,6 +837,9 @@ show: "প্রদর্শন" color: "রং" horizontal: "পাশে" youFollowing: "অনুসরণ করা হচ্ছে" +icon: "প্রোফাইল ছবি" +replies: "জবাব" +renotes: "রিনোট" _role: priority: "অগ্রাধিকার" _priority: @@ -886,6 +889,7 @@ _plugin: install: "প্লাগইন ইন্সটল করুন" installWarn: "অবিশ্বস্ত প্লাগইন ইনস্টল করবেন না।" manage: "প্লাগইন ম্যানেজ করুন" + viewSource: "উৎস দেখুন" _registry: scope: "স্কোপ" key: "কী" @@ -1040,7 +1044,6 @@ _2fa: alreadyRegistered: "আপনি ইতিমধ্যে একটি 2-ফ্যাক্টর অথেনটিকেশন ডিভাইস নিবন্ধন করেছেন৷" step1: "প্রথমে, আপনার ডিভাইসে {a} বা {b} এর মতো একটি অথেনটিকেশন অ্যাপ ইনস্টল করুন৷" step2: "এরপরে, অ্যাপের সাহায্যে প্রদর্শিত QR কোডটি স্ক্যান করুন।" - step2Url: "ডেস্কটপ অ্যাপে, নিম্নলিখিত URL লিখুন:" step3: "অ্যাপে প্রদর্শিত টোকেনটি লিখুন এবং আপনার কাজ শেষ।" step4: "আপনাকে এখন থেকে লগ ইন করার সময়, এইভাবে টোকেন লিখতে হবে।\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" securityKeyInfo: "আপনি একটি হার্ডওয়্যার সিকিউরিটি কী ব্যবহার করে লগ ইন করতে পারেন যা FIDO2 বা ডিভাইসের ফিঙ্গারপ্রিন্ট সেন্সর বা পিন সমর্থন করে৷" @@ -1330,3 +1333,6 @@ _deck: _webhookSettings: name: "নাম" active: "চালু" +_moderationLogTypes: + suspend: "স্থগিত করা" + resetPassword: "পাসওয়ার্ড রিসেট করুন" diff --git a/locales/ca-ES.yml b/locales/ca-ES.yml index e3a6ec11b2..d1fd73b666 100644 --- a/locales/ca-ES.yml +++ b/locales/ca-ES.yml @@ -13,12 +13,14 @@ fetchingAsApObject: "Cercant en el Fediverse..." ok: "OK" gotIt: "Ho he entès!" cancel: "Cancel·lar" +noThankYou: "No, gràcies" enterUsername: "Introdueix el teu nom d'usuari" renotedBy: "Impulsat per {usuari}" noNotes: "Cap nota" noNotifications: "Cap notificació" instance: "Servidor" settings: "Preferències" +notificationSettings: "Paràmetres de notificacions" basicSettings: "Configuració bàsica" otherSettings: "Configuració avançada" openInWindow: "Obrir en una nova finestra" @@ -47,8 +49,15 @@ delete: "Elimina" deleteAndEdit: "Elimina i edita" deleteAndEditConfirm: "Segur que vols eliminar aquesta publicació i editar-la? Perdràs totes les reaccions, impulsos i respostes." addToList: "Afegir a una llista" +addToAntenna: "Afegir a l'antena" sendMessage: "Enviar un missatge" +copyRSS: "Copiar RSS" copyUsername: "Copiar nom d'usuari" +copyUserId: "Copiar ID d'usuari" +copyNoteId: "Copiar ID de nota" +copyFileId: "Copiar ID d'arxiu" +copyFolderId: "Copiar ID de carpeta" +copyProfileUrl: "Copiar URL del perfil" searchUser: "Cercar un usuari" reply: "Respondre" loadMore: "Carregar més" @@ -128,6 +137,7 @@ suspendConfirm: "Estàs segur que vols suspendre aquest compte?" unsuspendConfirm: "Estàs segur que vols treure la suspensió d'aquest compte?" selectList: "Tria una llista" selectAntenna: "Tria una antena" +editAntenna: "Modificar antena" selectWidget: "Triar un giny" editWidgets: "Editar ginys" editWidgetsExit: "Fet" @@ -298,8 +308,10 @@ manageAntennas: "Gestiona les antenes" antennaSource: "Font de l'antena" antennaKeywords: "Paraules clau a seguir" antennaExcludeKeywords: "Paraules clau a excloure" +antennaKeywordsDescription: "Separar amb espais per la condició AND o amb salts de línia per la condició OR." notifyAntenna: "Notifica'm les publicacions noves" withFileAntenna: "Només les publicacions amb fitxers" +antennaUsersDescription: "Llistar un nom d'usuari per línia" notesAndReplies: "Amb respostes" silence: "Silencia" silenceConfirm: "Segur que vols silenciar aquest usuari?" @@ -369,6 +381,11 @@ user: "Usuaris" global: "Global" searchByGoogle: "Cercar" file: "Fitxers" +replies: "Respondre" +renotes: "Impulsa" +_role: + _options: + antennaMax: "Nombre màxim d'antenes" _email: _follow: title: "t'ha seguit" @@ -384,7 +401,7 @@ _sfx: chat: "Xat" antenna: "Antenes" _2fa: - step2Url: "També pots inserir aquest enllaç i utilitzes una aplicació d'escriptori:" + renewTOTPCancel: "No, gràcies" _antennaSources: all: "Totes les publicacions" homeTimeline: "Publicacions dels usuaris seguits" @@ -430,6 +447,7 @@ _pages: _notification: youRenoted: "Impulsat per {name}" youWereFollowed: "t'ha seguit" + unreadAntennaNote: "Antena {name}" _types: all: "Tots" follow: "Seguint" @@ -461,3 +479,6 @@ _deck: list: "Llistes" mentions: "Mencions" direct: "Publicacions directes" +_moderationLogTypes: + suspend: "Suspèn" + resetPassword: "Restableix la contrasenya" diff --git a/locales/cs-CZ.yml b/locales/cs-CZ.yml index 21d0c46482..751cc064ad 100644 --- a/locales/cs-CZ.yml +++ b/locales/cs-CZ.yml @@ -226,6 +226,7 @@ preview: "Náhled" default: "Výchozí" defaultValueIs: "Základní hodnota: {value}" noCustomEmojis: "Bez Emoji" +noJobs: "Žádné úlohy" federating: "Sdružování" blocked: "Blokováno" suspended: "Suspendováno" @@ -353,7 +354,6 @@ invite: "Pozvat" driveCapacityPerLocalAccount: "Kapacita disku na lokálního uživatele" driveCapacityPerRemoteAccount: "Kapacita disku na vzdáleného uživatele" inMb: "V megabajtech" -iconUrl: "Favicon URL" bannerUrl: "Baner URL" backgroundImageUrl: "Adresa URL obrázku pozadí" basicInfo: "Základní informace" @@ -659,10 +659,13 @@ reporter: "Nahlásil" reporteeOrigin: "Původ nahlášení" reporterOrigin: "Původ nahlasovače" forwardReport: "Přeposlat nahlášení do vzdálené instance" +forwardReportIsAnonymous: "Místo vašeho účtu se ve vzdálené instanci zobrazí anonymní systémový účet jako nahlašovač." send: "Odeslat" +abuseMarkAsResolved: "Označit nahlášení jako vyřešené" openInNewTab: "Otevřít v nové kartě" openInSideView: "Otevřít v bočním panelu" defaultNavigationBehaviour: "Výchozí chování navigace" +editTheseSettingsMayBreakAccount: "Uprávou těchto nastavení si můžete poškodit účet." instanceTicker: "Informace instance o poznámkách" waitingFor: "Čeká se na {x}" random: "Náhodně" @@ -676,6 +679,7 @@ createNewClip: "Vytvořit nový klip" unclip: "Odepnout" confirmToUnclipAlreadyClippedNote: "Tahle poznámku je už součásti \"{name}\" klipu. Chcete ji místo toho odepnout z tohodle klipu?" public: "Veřejný" +private: "Soukromý" i18nInfo: "Misskey je překládán do jiných jazyků dobrovolníkama. Můžete pomoci na {link}." manageAccessTokens: "Spravovat přístupové tokeny" accountInfo: "Informace o účtu" @@ -695,6 +699,7 @@ no: "Ne" driveFilesCount: "Počet souborů na disku" driveUsage: "Využití disku" noCrawle: "Odmítat indexování crawleru" +noCrawleDescription: "Požádat vyhledávače aby neindexovali váš profil, poznámky, stránky, atd." lockedAccountInfo: "Pokud nenastavíte viditelnost poznámek na \"Pouze pro sledující\", budou poznámky viditelné všem i přesto že vyžadujete manuální potvrzení pro sledování." alwaysMarkSensitive: "Výchozně označovat jako citlivý" loadRawImages: "Načítat originální obrázky místo náhledů" @@ -702,25 +707,40 @@ disableShowingAnimatedImages: "Nepřehrávat animované obrázky" verificationEmailSent: "Ověřovací email byl zaslán. Ověření dokončíte kliknutím na odkaz v emailu." notSet: "Není nastaveno" emailVerified: "Váš e-mail byl ověřen" +noteFavoritesCount: "Počet oblíbených poznámek" +pageLikesCount: "Počet oblíbených stránek" +pageLikedCount: "Počet přijatých \"Libí se mi\"" contact: "Kontakt" useSystemFont: "Použít výchozí font systému" clips: "Oříznout" experimentalFeatures: "Experimentální funkce" +experimental: "Experimentální" +thisIsExperimentalFeature: "Tohle je experimentální funkce. Její funkce se může změnit a nemusí fungovat tak, jak bylo zamýšleno." developer: "Vývojář" +makeExplorable: "Udělat účet viditelný v \"Objevit\"" +makeExplorableDescription: "Pokud tohle vypnete, tak se účet přestane zobrazovat v sekci \"Objevit\"." +showGapBetweenNotesInTimeline: "Zobrazit mezeru mezi příspěvkama na časové ose" duplicate: "Duplikovat" left: "Vlevo" center: "Uprostřed" wide: "Široké" narrow: "Úzké" +reloadToApplySetting: "Tohle nastavení se použije až po obnovení stránky. Obnovit teď?" +needReloadToApply: "K projevení nastavení je zapotřebí obnovit stránku." +showTitlebar: "Zobrazit řádek s nadpisem" clearCache: "Vyprázdnit mezipaměť" +onlineUsersCount: "{n} uživatelů je online" nUsers: "{n} užívatelů" nNotes: "{n} poznámek" +sendErrorReports: "Odesílat chybové záznamy" +sendErrorReportsDescription: "Pokud je tato funkce zapnutá, budou se při výskytu problému sdílet podrobné informace o chybách se službou Misskey, což pomůže zlepšit kvalitu služby Misskey. Tyto informace budou zahrnovat například verzi operačního systému, jaký prohlížeč používáte, vaši aktivitu v Misskey atd." myTheme: "Moje vzhledy" backgroundColor: "Pozadí" accentColor: "Akcent" textColor: "Barva textu" saveAs: "Uložit jako…" advanced: "Pokročilé" +advancedSettings: "Pokročilá nastavení" value: "Hodnota" createdAt: "Vytvořeno" updatedAt: "Upraveno" @@ -728,7 +748,35 @@ saveConfirm: "Uložit změny?" deleteConfirm: "Opravdu smazat?" invalidValue: "Neplatná hodnota." registry: "Registr" +closeAccount: "Uzavřít účet" +currentVersion: "Aktuální verze" +latestVersion: "Nejnovější verze" +youAreRunningUpToDateClient: "Používáte nejnovější verzi klienta." +newVersionOfClientAvailable: "Nová verze klienta je k dispozici." +usageAmount: "Využití" +capacity: "Kapacita" +inUse: "Používáno" +editCode: "Upravit kód" +apply: "Potvrdit" +receiveAnnouncementFromInstance: "Dostávat oznámení z téhle instance" +emailNotification: "Emailové oznámení" +publish: "Zveřejnit" +inChannelSearch: "Vyhledat v kanálech" +useReactionPickerForContextMenu: "Otevřít výběr reakce na kliknutí pravého tlačítka myši" +typingUsers: "{users} píše..." +jumpToSpecifiedDate: "Skočit do konkrétního datumu" +showingPastTimeline: "Právě je zobrazována stará časová osa" +clear: "Vrátit" +markAllAsRead: "Označit všechno jako přečtené" +goBack: "Zpět" +unlikeConfirm: "Opravdu chcete odstranit like?" +fullView: "Plné zobrazení" +quitFullView: "Odejít z plného zobrazení" +addDescription: "Přidat popis" +userPagePinTip: "Zde můžete zobrazovat poznámky vybráním \"Připnout na profil\" z menu jednotlivých poznámek." +notSpecifiedMentionWarning: "Tahle poznámka zmiňuje uživatele, které nejsou mezi adresáty" info: "Informace" +userInfo: "Informace o uživateli" unknown: "Neznámý" onlineStatus: "Online status" hideOnlineStatus: "Skrýt Váš online status" @@ -748,10 +796,18 @@ user: "Uživatelé" administration: "Administrace" accounts: "Účty" switch: "Přepnout" +noMaintainerInformationWarning: "Informace o správci nejsou nastavené" +noBotProtectionWarning: "Ochrana proti botům není nastavena" configure: "Nastavit" +postToGallery: "Vytvořit nový příspěvek v galerii" +postToHashtag: "Přidat příspěvek k tomuhle hastagu" gallery: "Galerie" recentPosts: "Poslední příspěvky" +popularPosts: "Populární příspěvky" +shareWithNote: "Sdílet s poznámkou" ads: "Reklamy" +expiration: "Ukončit hlasování" +startingperiod: "Začátek" memo: "Memo" priority: "Priorita" high: "Vysoká" @@ -759,63 +815,702 @@ middle: "Střední" low: "Nízká" emailNotConfiguredWarning: "E-mailová adresa není nastavena." ratio: "Poměr" +previewNoteText: "Zobrazit náhled" +customCss: "Vlastní CSS" +customCssWarn: "Tohle nastavení by mělo být použito pouze v případě pokud víte co děláte. Vložením nesprávných hodnot může způsobit nefunkčnost klienta." global: "Globální" +squareAvatars: "Zobrazovat čtvercové avatary" sent: "Odeslat" +received: "Přijaté" +searchResult: "Výsledky hledání" hashtags: "Hashtagy" troubleshooting: "Poradce při potížích" +useBlurEffect: "Použít efekt rozostření v UI" +learnMore: "Zjistit více" +misskeyUpdated: "Misskey byl aktualizován!" whatIsNew: "Zobrazit změny" translate: "Přeložit" +translatedFrom: "Přeloženo z {x}" +accountDeletionInProgress: "Smazání účtu právě probíhá" +usernameInfo: "Jméno které identifikuje váš účet od jiných na tomhle serveru. Můžete použít abecedu (a~z, A~Z), čísla (0~9) nebo podtržítka (_). Uživatelské jména nemůžou být změněna později." +aiChanMode: "Režim Ai" +devMode: "Vývojářský režim" +keepCw: "Zachovat varování o obsahu" +pubSub: "Pub/Sub účty" +lastCommunication: "Poslední komunikace" +resolved: "Vyřešeno" +unresolved: "Nevyřešené" +breakFollow: "Odstranit sledujícího" +breakFollowConfirm: "Opravdu chcete odstranit tohodle sledujícího?" +itsOn: "Zapnuto" +itsOff: "Vypnuto" +on: "Zapnuto" +off: "Vypnuto" +emailRequiredForSignup: "Vyžadovat email pro registraci" +unread: "Nepřečtený" +filter: "Filtr" +controlPanel: "Ovládací panel" +manageAccounts: "Spravovat účty" +makeReactionsPublic: "Nastavit historii reakcí jako veřejnou" +makeReactionsPublicDescription: "Tohle zviditelný seznam vašich předchozích reakcí veřejně." +classic: "Klasický" +muteThread: "Ztlumit vlákno" +unmuteThread: "Zrušit ztlumení vlákna" +ffVisibility: "Viditelnost Sledovaných/Sledujících" +ffVisibilityDescription: "Umožní vám nastavit kdo uvidí koho sledujete a kdo vás sleduje." +continueThread: "Zobrazit pokračování vlákna" +deleteAccountConfirm: "Tohle nenávratně smaže váš účet, chcete pokračovat?" +incorrectPassword: "Nesprávné heslo." +voteConfirm: "Potvrdit hlas pro \"{choice}\"?" hide: "Skrýt" +useDrawerReactionPickerForMobile: "Zobrazit výběr reakcí jako šuplík na mobilním zařízení" +welcomeBackWithName: "Vítejte zpět, {name}" +clickToFinishEmailVerification: "Prosíme klikněte na [{ok}] pro dokončení ověření emailu." +overridedDeviceKind: "Typ zařízení" smartphone: "Telefon" tablet: "Tablet" auto: "Auto" +themeColor: "Barva motivu" size: "Velikost" numberOfColumn: "Počet sloupců" searchByGoogle: "Vyhledávání" +instanceDefaultLightTheme: "Výchozí světlý motiv instance" +instanceDefaultDarkTheme: "Výhozí tmavý motiv instance" +instanceDefaultThemeDescription: "Zadejte kód motivu v objektovém formátu" +mutePeriod: "Délka ztlumení" +period: "Časový limit" indefinitely: "Navždy" tenMinutes: "10 minut" oneHour: "1 hodina" oneDay: "1 den" oneWeek: "1 týden" +oneMonth: "1 měsíc" reflectMayTakeTime: "Může trvat nějakou dobu, než se projeví změny." +failedToFetchAccountInformation: "Nepodařily se načíst informace o účtě" +rateLimitExceeded: "Překročení rychlostního limitu" cropImage: "Oříznout obrázek" +cropImageAsk: "Chcete oříznout tenhle obrázek?" +cropYes: "Uříznout" +cropNo: "Použít tak jak je" file: "Soubor(ů)" recentNHours: "Posledních {n} hodin" recentNDays: "Posledních {n} dnů" +noEmailServerWarning: "Emailový server není nastavený" +thereIsUnresolvedAbuseReportWarning: "Jsou k dispozici nevyřešené nahlášení zneužití" recommended: "Doporučeno" +check: "Zkontrolovat" +driveCapOverrideLabel: "Změnit velikost disku pro tohoto uživatele" +driveCapOverrideCaption: "K vyresetování velikosti na výchozí hodnotu zadejte hodnotu 0 nebo nižší." +requireAdminForView: "Pro zobrazení se musíte přihlásit administrátorským účtem." +isSystemAccount: "Účet automaticky vytvořený a ovládaný serverem." +typeToConfirm: "Prosíme zadejte {x} pro potvrzení" deleteAccount: "Odstranit účet" document: "Dokumentace" +numberOfPageCache: "Počet stránek uložených v mezipaměti" +numberOfPageCacheDescription: "Zvýšením čísla zlepšíte pohodlí pro uživatele ale může to způsobit větší zátěž na server a na paměť." logoutConfirm: "Opravdu se chcete odhlásit?" +lastActiveDate: "Naposledy použito" +statusbar: "Stavový řádek" pleaseSelect: "Vybrat možnost" reverse: "Otočit" colored: "Barevné" +refreshInterval: "Interval obnovení" +label: "Popisek" type: "Typ" speed: "Rychlost" slow: "Pomalá" fast: "Rychlá" +sensitiveMediaDetection: "Detekce citlivého média" +localOnly: "Jenom lokální" +remoteOnly: "Jenom vzdáleně" +failedToUpload: "Nahrání se nezdařilo" +cannotUploadBecauseInappropriate: "Tenhle soubor se nenahrál, protože některé části byly detekovány jako nevhodné." +cannotUploadBecauseNoFreeSpace: "Nahrání se nezdařilo z důvodu nedostatku místa na disku." +cannotUploadBecauseExceedsFileSizeLimit: "Tenhle soubor nemůže být nahráný protože překračuje velikostní limit." +beta: "Beta verze" +enableAutoSensitive: "Automaticky označovat jako citlivé" +enableAutoSensitiveDescription: "Umožňuje automatickou detekci a označování citlivého média skrze strojového účení všude kde je možno. I pokud je tahle možnost vypnutá, může být povolena instancí." +activeEmailValidationDescription: "Umožňuje striktní validaci emailové adresy, která zahrnuje kontrolu pro jednorázové adresy a pokud je možno s ní komunikovat. Pokud je to vypnuté, bude se kontrolovat pouze formát emailu." +navbar: "Navigační panel" +shuffle: "Zamíchat" account: "Účty" +move: "Přesunout" +pushNotification: "Push oznámení" +subscribePushNotification: "Povolit push oznamení" +unsubscribePushNotification: "Vypnout push oznámení" +pushNotificationAlreadySubscribed: "Push oznámení jsou už zapnuté" +pushNotificationNotSupported: "Tenhle prohlížeč nepodporuje push oznámení" +sendPushNotificationReadMessage: "Odstraněnit oznámení push po jejich přečtení" +sendPushNotificationReadMessageCaption: "Tohle může zvýšit spotřebu energie vašeho zařízení." +windowMaximize: "Maximalizovat" +windowMinimize: "Minimalizovat" +windowRestore: "Obnovit" +caption: "Titulek" +loggedInAsBot: "Právě jste přihlášen jako bot" +tools: "Nástroje" +cannotLoad: "Načtení se nezdařilo" +numberOfProfileView: "Počet zobrazení profilu" +like: "To se mi líbí" +unlike: "Už se mi to nelíbí" +numberOfLikes: "Počet \"To se mi líbí\"" show: "Zobrazit" +neverShow: "Znovu nezobrazovat" +remindMeLater: "Možná později" +didYouLikeMisskey: "Oblíbili jste si Misskey?" +pleaseDonate: "{host} používá bezplatný software Misskey. Velmi bychom ocenili vaše dary, aby mohl vývoj Misskey pokračovat!" +roles: "Role" +role: "Role" +noRole: "Role nenalezena" +normalUser: "Normální uživatel" +undefined: "Neurčeno" +assign: "Přiřadit" +unassign: "Zrušit přirazení" color: "Barva" +manageCustomEmojis: "Spravovat vlastní emoji" +youCannotCreateAnymore: "Narazili jste na limit pro vytváření." +cannotPerformTemporary: "Dočasně nedostupné" +cannotPerformTemporaryDescription: "Tuto akci nelze dočasně provést z důvodu překročení limitu provedení. Chvíli počkejte a zkuste to znovu." +invalidParamError: "Neplatné parametry" +invalidParamErrorDescription: "Parametry požadavku jsou neplatné. Obvykle je to způsobeno chybou, ale může to být také způsobeno překročením limitů velikosti vstupů nebo podobně." +permissionDeniedError: "Operace zamítnuta" +permissionDeniedErrorDescription: "Tento účet nemá oprávnění k provedení této akce." +preset: "Předvolba" +selectFromPresets: "Vybrat z předvoleb" +achievements: "Úspěchy" +gotInvalidResponseError: "Neplatná odpověď serveru" +gotInvalidResponseErrorDescription: "Server může být nedostupný nebo na něm probíhá údržba. Zkuste to prosím později." +thisPostMayBeAnnoying: "Tato poznámka může ostatní obtěžovat." +thisPostMayBeAnnoyingHome: "Zveřejnit na domovskou časovou osu" +thisPostMayBeAnnoyingCancel: "Zrušit" +thisPostMayBeAnnoyingIgnore: "I přesto zveřejnit" +collapseRenotes: "Sbalit poznámky, které jste již viděli" +internalServerError: "Interní chyba serveru" +internalServerErrorDescription: "Server narazil na neočekávanou chybu." +copyErrorInfo: "Zkopírovat detaily erroru" +joinThisServer: "Zaregistrovat se v této instanci" +exploreOtherServers: "Podívat se na ostatní instance" +letsLookAtTimeline: "Podívejte se na časovou osu" +disableFederationConfirm: "Chcete opravdu vypnout federace?" +disableFederationConfirmWarn: "I v případě defederace budou příspěvky nadále veřejné, pokud nebude nastaveno jinak. Obvykle to není nutné." +disableFederationOk: "Vypnout" +invitationRequiredToRegister: "Tahle instance je pouze na pozvánku. Musíte zadat validní kód pozvánky." +emailNotSupported: "Tahle instance nepodporuje zasílání emailů" +postToTheChannel: "Vložit do kanálu" +cannotBeChangedLater: "Tohle nemůže být změněno později." +reactionAcceptance: "Přijímání reakcí" +likeOnly: "Jenom \"oblíbené\"" +likeOnlyForRemote: "Všechny (Pouze \"oblíbené\" pro vzdálenou instanci)" +nonSensitiveOnly: "Pouze bez citlivých medií" +nonSensitiveOnlyForLocalLikeOnlyForRemote: "Pouze bez citlivých medií (Pouze vzdálený \"oblíbený\")" +rolesAssignedToMe: "Přiřazené role ke mně" +resetPasswordConfirm: "Opravdu chcete resetovat heslo?" +sensitiveWords: "Citlivá slova" +sensitiveWordsDescription: "Viditelnost všech poznámek obsahujících některé z nakonfigurovaných slov bude automaticky nastavena na \"Domů\". Můžete jich uvést více tak, že je oddělíte pomocí řádků." +sensitiveWordsDescription2: "Použití mezer vytvoří výrazy AND a obklopení klíčových slov lomítky je změní na regulární výraz." +notesSearchNotAvailable: "Vyhledávání poznámek je nedostupné." +license: "Licence" +unfavoriteConfirm: "Opravdu chcete odstranit z oblíbených?" +myClips: "Moje klipy" +drivecleaner: "Čistič disku" +retryAllQueuesNow: "Obnovit všechny běžící fronty" +retryAllQueuesConfirmTitle: "Opravdu chcete obnovit všechno?" +retryAllQueuesConfirmText: "Tohle dočasně zvýší zatěž na server." +enableChartsForRemoteUser: "Vygenerovat grafy dat vzdálených uživatelů" +enableChartsForFederatedInstances: "Vygenerovat grafy dat vzdálených instancí" +showClipButtonInNoteFooter: "Přidat \"Připnout\" do akčního menu poznámky" +noteIdOrUrl: "ID nebo URL poznámky" +video: "Video" +videos: "Videa" +dataSaver: "Spořič dat" +accountMigration: "Migrace účtu" +accountMoved: "Tenhle uživatel se přesunul na nový účet:" +accountMovedShort: "Tenhle účet byl migrován." +operationForbidden: "Zakázaná operace" +forceShowAds: "Vždycky zobrazovat reklamy" +addMemo: "Přidat memo" +editMemo: "Upravit memo" +reactionsList: "Reakce" +renotesList: "Poznámky" +notificationDisplay: "Oznámení" +leftTop: "Vlevo nahoře" +rightTop: "Vpravo nahoře" +leftBottom: "Vlevo dole" +rightBottom: "Vpravo dole" +stackAxis: "Směr ukládání" +vertical: "Svisle" +horizontal: "Vodorovně" +position: "Pozice" +serverRules: "Pravidla serveru" +pleaseConfirmBelowBeforeSignup: "Abyste se mohli přihlásit na server, musíte souhlasit s následujícím." +pleaseAgreeAllToContinue: "Musíte souhlasit se vším abyste mohli pokračovat." +continue: "Pokračovat" +preservedUsernames: "Rezervované uživatelské jména" +preservedUsernamesDescription: "Seznam uživatelských jmén na rezervaci oddělené mezerama. Tyhle jména se potom nebudou moc použít při normálním procesu vytvoření účtu ale můžou být použiti manuálně administratorém. Existujících účtů se to nedotkne." +createNoteFromTheFile: "Vytvořit poznámku z tohodle souboru" +archive: "Archiv" +channelArchiveConfirmTitle: "Opravdu chcete archivovat {name}?" +channelArchiveConfirmDescription: "Archivovaný kanál se objeví v seznamu kanálů nebo ve výsledcích hledání. Nové poznámky se nedají vložit do seznamu." +thisChannelArchived: "Tenhle kanál je archivovaný" +displayOfNote: "Zobrazit poznámku" +initialAccountSetting: "Nastavení profilu" +youFollowing: "Sleduji" +preventAiLearning: "Odmítnout použití v strojovém učení (Generative AI)" +preventAiLearningDescription: "Požaduje, aby prohlížeče nepoužívaly zveřejněný textový nebo obrazový materiál atd. v datových sadách pro strojové učení (prediktivní / generativní umělá inteligence). Toho se dosáhne přidáním příznaku \"noai\" HTML-Response k příslušnému obsahu. Úplné prevence však tímto příznakem nelze dosáhnout, protože může být jednoduše ignorován." +options: "Možnosti" +specifyUser: "Upřesnit uživatele" +failedToPreviewUrl: "Náhled se nezdařil" +update: "Aktualizovat" +rolesThatCanBeUsedThisEmojiAsReaction: "Role, které můžou tuhle emoji použít jako reakci" +rolesThatCanBeUsedThisEmojiAsReactionEmptyDescription: "Pokud nejsou určena role, tak pak každý může použít tenhle emoji." +rolesThatCanBeUsedThisEmojiAsReactionPublicRoleWarn: "Role musí být veřejné." +cancelReactionConfirm: "Opravdu chcete odstranit vaší reakci?" +changeReactionConfirm: "Opravdu chcete změnit vaši reakci?" +later: "Později" +goToMisskey: "Jít na Misskey" +additionalEmojiDictionary: "Další slovníky emoji" +installed: "Nainstalováno" +branding: "Značka" +enableServerMachineStats: "Zveřejněnit statistiky hardwaru serveru" +enableIdenticonGeneration: "Povolit generování identicon uživatele" +turnOffToImprovePerformance: "Vypnutí této funkce může zvýšit výkon." +createInviteCode: "Vygenerovat pozvánku" +createWithOptions: "Vygenerovat s nastavením" +createCount: "Počet vytvořených pozvánek" +inviteCodeCreated: "Pozvánka vygenerována" +inviteLimitExceeded: "Překročili jste limit pozvánek, které můžete vygenerovat." +createLimitRemaining: "Limit pozvánek: {limit} zbývá" +inviteLimitResetCycle: "Tento limit se obnoví na hodnotu {limit} v {time}." +expirationDate: "Datum expirace" +noExpirationDate: "Bez expirace" +inviteCodeUsedAt: "Kód pozvánky použitý na" +registeredUserUsingInviteCode: "Pozvánku používá" +waitingForMailAuth: "Čeká se na ověření emailu" +inviteCodeCreator: "Pozvánku vytvořil" +usedAt: "Používá se v" +unused: "Nepoužívaná" +used: "Používaná" +expired: "Prošlá" +doYouAgree: "Souhlasíte?" +beSureToReadThisAsItIsImportant: "Přečtěte si prosím tyto důležité informace." +iHaveReadXCarefullyAndAgree: "Přečetl jsem si text \"{x}\" a souhlasím s ním." +icon: "Avatar" +replies: "Odpovědět" +renotes: "Přeposlat" +_initialAccountSetting: + accountCreated: "Váš účet byl úspěšně vytvořen!" + letsStartAccountSetup: "Pro začátek si nastavte svůj profil." + letsFillYourProfile: "Nejprve si nastavte svůj profil." + profileSetting: "Nastavení profilu" + privacySetting: "Nastavení soukromí" + theseSettingsCanEditLater: "Tato nastavení můžete vždy později změnit." + youCanEditMoreSettingsInSettingsPageLater: "Na stránce \"Nastavení\" můžete nakonfigurovat mnoho dalších nastavení. Nezapomeňte ji navštívit později." + followUsers: "Zkuste sledovat některé uživatele, kteří vás zajímají pro vystavění časový osy." + pushNotificationDescription: "Povolení push oznámení vám umožní přijímat oznámení od {name} přímo ve vašem zařízení." + initialAccountSettingCompleted: "Nastavení profilu dokončeno!" + haveFun: "Užívejte {name}!" + ifYouNeedLearnMore: "Pokud se chcete dozvědět více o tom, jak používat {name} (Misskey), navštivte {link}." + skipAreYouSure: "Opravdu chcete přeskočit nastavení profilu?" + laterAreYouSure: "Opravdu chcete provést nastavení profilu později?" +_serverRules: + description: "Soubor pravidel, která se zobrazí před registrací. Doporučuje se nastavit shrnutí podmínek služby." +_serverSettings: + iconUrl: "URL ikony" +_accountMigration: + moveFrom: "Migrace jiného účtu na tento účet" + moveFromSub: "Vytvořit alias na jiný účet" + moveFromLabel: "Původní účet #{n}" + moveFromDescription: "Pro účet, ze kterého se chcete přesunout, musíte vytvořit alias na tomto účtu.\nZadejte účet, ze kterého chcete přejít, v následujícím formátu: @username@server.example.com\nChcete-li alias odstranit, ponechte pole prázdné (nedoporučuje se)." + moveTo: "Přesunout tenhle účet do jiného" + moveToLabel: "Cílový účet pro přesunutí:" + moveCannotBeUndone: "Migrace účtu nemůže být vrácena." + moveAccountDescription: "Tím dojde k migraci vašeho účtu na jiný účet.\n ・Sledovatelé z tohoto účtu budou automaticky převedeni na nový účet.\n ・Tento účet zruší sledování všech uživatelů, které aktuálně sleduje.\n ・Na tomto účtu nebude možné vytvářet nové poznámky atd.\n\nZatímco migrace sledovaných uživatelů probíhá automaticky, pro migraci seznamu sledovaných uživatelů je nutné připravit některé kroky ručně. Za tímto účelem proveďte export sledovaných, který později naimportujete na nový účet v nabídce nastavení. Stejný postup platí pro seznamy i pro ztlumené a zablokované uživatele.\n\n(Tento výklad platí pro Misskey v13.12.0 a novější. Jiný software ActivityPub, například Mastodon, může fungovat jinak.)" + moveAccountHowTo: "Chcete-li migrovat, vytvořte nejprve alias tohoto účtu na účtu, na který chcete přejít.\nPo vytvoření aliasu zadejte účet, na který chcete přejít, v následujícím formátu: @username@server.example.com" + startMigration: "Migrovat" + migrationConfirm: "Opravdu chcete migrovat tento účet na {account}? Jednou zahájený proces nelze zastavit ani vrátit zpět a tento účet již nebudete moci používat v původním stavu." + movedAndCannotBeUndone: "\nTento účet byl převeden.\nMigraci nelze vrátit zpět." + postMigrationNote: "Tento účet zruší sledování všech účtů, které aktuálně sleduje, 24 hodin po dokončení migrace.\nPočet sledujících i následovníků se poté vynuluje. Aby se zabránilo tomu, že vaši sledující nebudou moci vidět příspěvky tohoto účtu určené pouze pro sledující, budou však tento účet sledovat i nadále." + movedTo: "Cílový účet pro přesunutí:" +_achievements: + earnedAt: "Odemčeno v" + _types: + _notes1: + title: "Dobrý den Misskey!" + description: "Zveřejněte vaší první poznámku" + flavor: "Užijte si to s Misskey!" + _notes10: + title: "Pár poznámek" + description: "Zveřejněte 10 poznámek" + _notes100: + title: "Hodně poznámek" + description: "Zveřejněte 100 poznámek" + _notes500: + title: "Zahlcen poznámkama" + description: "Zveřejněte 500 poznámek" + _notes1000: + title: "Hora poznámek" + description: "Zveřejněte 1000 poznámek" + _notes5000: + title: "Přetékající poznámky" + description: "Zveřejněte 5000 poznámek" + _notes10000: + title: "Super poznámka" + description: "Zveřejněte 10 000 poznámek" + _notes20000: + title: "Potřebuju... více... poznámek..." + description: "Zveřejněte 20 000 poznámek" + _notes30000: + title: "Poznámky, poznámky, POZNÁMKY!" + description: "Zveřejněte 30 000 poznámek" + _notes40000: + title: "Továrna na poznámky" + description: "Zveřejněte 40 000 poznámek" + _notes50000: + title: "Planeta poznámek" + description: "Zveřejněte 50 000 poznámek" + _notes60000: + title: "Poznámkový kvasar" + description: "Zveřejněte 60 000 poznámek" + _notes70000: + title: "Černá díra poznámek" + description: "Zveřejněte 70 000 poznámek" + _notes80000: + title: "Galaxie poznámek" + description: "Zveřejněte 80 000 poznámek" + _notes90000: + title: "Vesmír poznámek" + description: "Zveřejněte 90 000 poznámek" + _notes100000: + title: "ALL YOUR NOTE ARE BELONG TO US" + description: "Zveřejněte 100 000 poznámek" + flavor: "Máte toho hodně co říct." + _login3: + title: "Začátečník I" + description: "Přihlaste se celkově za 3 dny" + flavor: "Ode dneška mi říkejte Misskista." + _login7: + title: "Začátečník II" + description: "Přihlaste se celkově za 7 dní" + flavor: "Máte pocit, že už jste se v tom vyznali?" + _login15: + title: "Začátečník III" + description: "Přihlaste se celkově za 15 dní" + _login30: + title: "Misskista I" + description: "Přihlaste se celkově za 30 dní" + _login60: + title: "Misskista II" + description: "Přihlaste se celkově za 60 dní" + _login100: + title: "Misskista III" + description: "Přihlaste se celkově za 100 dní" + flavor: "Violent Misskista" + _login200: + title: "Stálý zákazník I" + description: "Přihlaste se celkově za 200 dní" + _login300: + title: "Stálý zákazník II" + description: "Přihlaste se celkově za 300 dní" + _login400: + title: "Stálý zákazník III" + description: "Přihlaste se celkově za 400 dní" + _login500: + title: "Expert I" + description: "Přihlaste se celkově za 500 dní" + flavor: "Moji přátelé, často se říká, že mám rád poznámky." + _login600: + title: "Expert II" + description: "Přihlaste se celkově za 600 dní" + _login700: + title: "Expert III" + description: "Přihlaste se celkově za 700 dní" + _login800: + title: "Mistr poznámek I" + description: "Přihlaste se celkově za 800 dní" + _login900: + title: "Mistr poznámek II" + description: "Přihlaste se celkově za 900 dní" + _login1000: + title: "Mistr poznámek III" + description: "Přihlaste se celkově za 1000 dní" + flavor: "Děkujeme, že používáte Misskey!" + _noteClipped1: + title: "Musím... připnout..." + description: "Připněte si první poznámku" + _noteFavorited1: + title: "Hvězdář" + description: "Oblíbena první poznámka" + _myNoteFavorited1: + title: "Hledání hvězd" + description: "Někdo si oblíbil jednu z vašich poznámek" + _profileFilled: + title: "Dobře připravený" + description: "Nastavte si profil" + _markedAsCat: + title: "Já jsem kočka" + description: "Označte váš účet \"jako kočka\"" + flavor: "Jméno ti dám později." + _following1: + title: "Sledujte prvního uživatele" + description: "Sledujte uživatele" + _following10: + title: "Drž se... drž se..." + description: "Sledujte 10 uživatelů" + _following50: + title: "Hodně přátel" + description: "Sledujte 50 uživatelů" + _following100: + title: "100 přátel" + description: "Sledujte 100 uživatelů" + _following300: + title: "Přetížení přátel" + description: "Sledujte 300 účtů" + _followers1: + title: "První sledující" + description: "Získejte 1 sledujícího" + _followers10: + title: "Sledujte mě!" + description: "Získejte 10 sledujících" + _followers50: + title: "Přicházejí davy" + description: "Získejte 50 sledujících" + _followers100: + title: "Populární" + description: "Získejte 100 sledujících" + _followers300: + title: "Prosíme srovnejte se do jedné řady!" + description: "Získejte 300 sledujících" + _followers500: + title: "Rádiová věž" + description: "Získejte 500 sledujících" + _followers1000: + title: "Influencer" + description: "Získejte 1000 sledujících" + _collectAchievements30: + title: "Sběratel úspěchů" + description: "Získejte 30 úspěchů" + _viewAchievements3min: + title: "Máš rád úspěchy" + description: "Koukejte na váš seznam úspěchů alespoň po dobu 3 minut" + _iLoveMisskey: + title: "Miluju Misskey" + description: "Zveřejněte \" I ❤ #Misskey\"" + flavor: "Vývojový tým Misskey si velmi váží vaší podpory!" + _foundTreasure: + title: "Hon za pokladem" + description: "Našli jste schovaný poklad!" + _client30min: + title: "Krátká pauza" + description: "Mějte otevřený Misskey alespoň po dobu 30 minut" + _client60min: + title: "Žádný \"Miss\" v Misskey" + description: "Mějte otevřený Misskey alespoň po dobu 60 minut" + _noteDeletedWithin1min: + title: "Ups, nevadí" + description: "Vymažte poznámku během minuty co ji zveřejníte" + _postedAtLateNight: + title: "Noční typ" + description: "Zveřejněte poznámku pozdě v noci" + flavor: "Je nejvyšší čas jít spát." + _postedAt0min0sec: + title: "Mluvící hodiny" + description: "Zveřejněte poznámku přesně v 00:00" + flavor: "Klik Klik Klik Bum" + _selfQuote: + title: "Sebereference" + description: "Citujte vlastní poznámku" + _htl20npm: + title: "Plynoucí časová osa" + description: "Mějte rychlost vaší domovské časové osy vyšší než 20 pzm (poznámek za minutu)." + _viewInstanceChart: + title: "Analytik" + description: "Zobrazte graf instance" + _outputHelloWorldOnScratchpad: + title: "Hello, world!" + description: "Dostaňte výpis \"hello world\" do Scratchpadu" + _open3windows: + title: "Splitscreen" + description: "Mějte otevřená alespoň 3 okna zároveň" + _driveFolderCircularReference: + title: "Okružní reference" + description: "Pokuste se o vytvoření rekurzivně vnořené složky v disku" + _reactWithoutRead: + title: "Opravdu jste to četl/a?" + description: "Reagujte na poznámku, která má více než 100 znaků, do 3 sekund od jejího zveřejnění." + _clickedClickHere: + title: "Klikněte sem" + description: "Kliknul si tam" + _justPlainLucky: + title: "Čisté štěstí" + description: "Mějte šanci na získání s pravděpodobností 0,005 % každých 10 sekund." + _setNameToSyuilo: + title: "Boží komplex" + description: "Nastavte si jméno na \"syuilo\"" + _passedSinceAccountCreated1: + title: "Roční výročí" + description: "Od vytvoření vašeho účtu uplynul jeden rok" + _passedSinceAccountCreated2: + title: "Dvouleté výročí" + description: "Od vytvoření vašeho účtu uplynuly dva roky" + _passedSinceAccountCreated3: + title: "Tříleté výročí" + description: "Od vytvoření vašeho účtu uplynuly tři roky" + _loggedInOnBirthday: + title: "Všechno nejlepší!" + description: "Přihlašte se v den vašich narozenin" + _loggedInOnNewYearsDay: + title: "Štastný nový rok!" + description: "Přihlašte se v den nového roku" + flavor: "Na další skvělý rok v této instanci" + _cookieClicked: + title: "Hra, ve které klikáte na sušenky" + description: "Klikněte na soubor cookie" + flavor: "Počkejte, jste na správné webové stránce?" + _brainDiver: + title: "Brain Diver" + description: "Zveřejněte odkaz na Brain Diver" + flavor: "Misskey-Misskey La-Tu-Ma" _role: + new: "Nová role" + edit: "Upravit roli" + name: "Název role" + description: "Popis role" + permission: "Oprávnění role" + descriptionOfPermission: "Moderators může provádět základní operace moderování.\nAdministrators může měnit všechna nastavení instance." + assignTarget: "Přiřadit" + descriptionOfAssignTarget: "Manual ručně změnit, kdo je součástí této role a kdo ne.\nConditional mít uživatelé automaticky přiřazováni a odebíráni z této role na základě podmínky." + manual: "Dokumentace" + conditional: "Podmíněné" + condition: "Podmínky" + isConditionalRole: "Tato role je podmíněná." + isPublic: "Veřejná role" + descriptionOfIsPublic: "Tato role se zobrazí v profilech přiřazených uživatelů." + options: "Nastavení" + policies: "Zásady" + baseRole: "Šablona role" + useBaseValue: "Použít hodnotu šablony role" + chooseRoleToAssign: "Vyberte roli, kterou chcete přiřadit" + iconUrl: "URL ikony" + asBadge: "Zobrazovat jako odznak" + descriptionOfAsBadge: "Ikona této role se zobrazí vedle uživatelského jména uživatelů s touto rolí, pokud je zapnuta." + isExplorable: "Udělat roli objevitelnou" + descriptionOfIsExplorable: "Časová osa této role a seznam uživatelů s touto rolí budou zveřejněny, pokud jsou povoleny." + displayOrder: "Pozice" + descriptionOfDisplayOrder: "Čím vyšší číslo, tím vyšší pozice v uživatelském rozhraní." + canEditMembersByModerator: "Umožnit moderátorům upravovat seznam členů pro tuto roli" + descriptionOfCanEditMembersByModerator: "Po zapnutí této role budou moci moderátoři i administrátoři přiřazovat a odebírat uživatele do této role. Pokud je tato funkce vypnutá, budou moci uživatele přiřazovat pouze správci." priority: "Priorita" _priority: low: "Nízká" middle: "Střední" high: "Vysoká" + _options: + gtlAvailable: "Může zobrazit globální časovou osu" + ltlAvailable: "Může zobrazit místní časovou osu" + canPublicNote: "Může posílat veřejné poznámky" + canInvite: "Může vytvářet kódy pozvánek instance" + inviteLimit: "Limit pozvánek" + inviteLimitCycle: "Limit mezi pozvánkama" + inviteExpirationTime: "Interval vypršení platnosti pozvánky" + canManageCustomEmojis: "Spravovat vlastní emoji" + driveCapacity: "Velikost disku" + alwaysMarkNsfw: "Vždy označovat soubory jako NSFW" + pinMax: "Maximální počet připnutých poznámek" + antennaMax: "Maximální počet antén" + wordMuteMax: "Maximální počet znaků povolených v ztlumených slovech" + webhookMax: "Maximální počet Webhooků" + clipMax: "Maximální počet připnutí" + noteEachClipsMax: "Maximální počet poznámek v připnutí" + userListMax: "Maximální počet seznamů uživatelů" + userEachUserListsMax: "Maximální počet uživatelů v seznamu uživatelů" + rateLimitFactor: "Limit rychlosti" + descriptionOfRateLimitFactor: "Nižší limity rychlosti jsou méně omezující, vyšší více omezující. " + canHideAds: "Může schovat reklamy" + canSearchNotes: "Použití vyhledávání poznámek" + _condition: + isLocal: "Místní uživatel" + isRemote: "Vzdálený uživatel" + createdLessThan: "Od vytvoření účtu uplynulo méně než X" + createdMoreThan: "Od vytvoření účtu uplynulo více než X" + followersLessThanOrEq: "Má X nebo méně sledujících" + followersMoreThanOrEq: "Má X nebo více sledujících" + followingLessThanOrEq: "Sleduje X nebo méně účtů" + followingMoreThanOrEq: "Sleduje X nebo více účtů" + notesLessThanOrEq: "Počet příspěvků je menší než/rovná se" + notesMoreThanOrEq: "Počet příspěvků je větší než/rovná se" + and: "AND kondice" + or: "OR kondice" + not: "NOT kondice" +_sensitiveMediaDetection: + description: "Snižuje náročnost moderování serveru díky automatickému rozpoznávání citlivých médií pomocí strojového učení. Tím se mírně zvýší zatížení serveru." + sensitivity: "Detekce citlivosti" + sensitivityDescription: "Snížení citlivosti povede k menšímu počtu chybných detekcí (falešně pozitivních), zatímco její zvýšení povede k menšímu počtu chybných detekcí (falešně negativních)." + setSensitiveFlagAutomatically: "Označit jako citlivé" + setSensitiveFlagAutomaticallyDescription: "Výsledky interní detekce se zachovají, i když je tato možnost vypnutá." + analyzeVideos: "Povolit analýzy videí" + analyzeVideosDescription: "Kromě obrázků analyzuje i videa. Tím se mírně zvýší zatížení serveru." +_emailUnavailable: + used: "Tato emailová adresa se již používá" + format: "Formát této emailové adresy je neplatný" + disposable: "Jednorázové emailové adresy se nesmí používat" + mx: "Tento e-mailový server je neplatný" + smtp: "Tento emailový server neodpovídá" +_ffVisibility: + public: "Zveřejnit" + followers: "Viditelné pouze pro sledující" + private: "Soukromý" +_signup: + almostThere: "Už to skoro je" + emailAddressInfo: "Zadejte prosím svou emailovou adresu. Nebude zveřejněna." + emailSent: "Na vaši e-mailovou adresu ({email}) byl odeslán potvrzovací e-mail. Kliknutím na přiložený odkaz dokončete vytvoření účtu." +_accountDelete: + accountDelete: "Smazat účet" + mayTakeTime: "Vzhledem k tomu, že odstranění účtu je proces náročný na zdroje, může jeho dokončení trvat určitou dobu v závislosti na tom, kolik obsahu jste vytvořili a kolik souborů jste nahráli." + sendEmail: "Po dokončení odstranění účtu bude na emailovou adresu registrovanou k tomuto účtu zaslán email." + requestAccountDelete: "Žádost o smazání účtu" + started: "Bylo zahájeno mazání." + inProgress: "V současné době probíhá mazání" _ad: back: "Zpět" + reduceFrequencyOfThisAd: "Zobrazovat tuto reklamu méně" + hide: "Schovat" + timezoneinfo: "Den v týdnu se určuje podle časového pásma serveru." +_forgotPassword: + enterEmail: "Zadejte emailovou adresu, kterou jste použili při registraci. Na ni vám pak bude zaslán odkaz, pomocí kterého si můžete obnovit heslo." + ifNoEmail: "Pokud jste při registraci nepoužili email, obraťte se na správce instance." + contactAdmin: "Tato instance nepodporuje používání emailových adres, pro obnovení hesla se obraťte na správce instance." _gallery: my: "Moje galerie" + liked: "Oblíbené příspěvky" + like: "To se mi líbí" + unlike: "Už se mi to nelíbí" _email: _follow: title: "Máte nového následovníka" + _receiveFollowRequest: + title: "Obdrželi jste žádost o sledování" _plugin: install: "Instalovat plugin" + installWarn: "Neinstalujte nedůvěryhodné pluginy." manage: "Správce pluginů" + viewSource: "Zobrazit zdroj" _preferencesBackups: list: "Vytvořit backup" + saveNew: "Uložit novou zálohu" loadFile: "Načíst ze souboru" + apply: "Použít pro toto zařízení" save: "Uložit změny" + inputName: "Zadejte prosím název pro tuto zálohu" + cannotSave: "Uložení selhalo" + nameAlreadyExists: "Záloha s názvem \"{name}\" již existuje. Zadejte prosím jiný název." + applyConfirm: "Opravdu chcete na toto zařízení použít zálohu \"{name}\"? Stávající nastavení tohoto zařízení bude přepsáno." + saveConfirm: "Uložit zálohu jako {name}?" + deleteConfirm: "Odstranit zálohu {name}?" + renameConfirm: "Přejmenovat tuto zálohu z \"{old}\" na \"{new}\"?" + noBackups: "Neexistují žádné zálohy. Nastavení klienta na tomto serveru můžete zálohovat pomocí \"Vytvořit novou zálohu\"." + createdAt: "Vytvořeno v: {date} {time}" + updatedAt: "Aktualizováno: {date} {time}" + cannotLoad: "Načítání selhalo" + invalidFile: "Neplatný typ souboru" _registry: scope: "Rozsah" key: "Klíč" @@ -823,46 +1518,235 @@ _registry: domain: "Doména" createKey: "Vytvořit klíč" _aboutMisskey: + about: "Misskey je open-source software vyvíjený syuilo od roku 2014." + contributors: "Hlavní přispěvatelé" allContributors: "Všichni přispěvatelé" source: "Zdrojový kód" + translation: "Přeložit Misskey" + donate: "Přispějte na Misskey" + morePatrons: "Vážíme si také podpory mnoha dalších pomocníků, kteří zde nejsou uvedeni. Děkujeme! 🥰" + patrons: "Patroni" +_displayOfSensitiveMedia: + respect: "Skrýt média označená jako citlivá" + ignore: "Zobrazit média označená jako citlivá" + force: "Skrýt všechna média" +_instanceTicker: + none: "Nikdy nezobrazovat" + remote: "Zobrazit pro vzdálené uživatelé" + always: "Vždy zobrazovat" +_serverDisconnectedBehavior: + reload: "Automatické znovunačtení" + dialog: "Zobrazení dialogového okna s varováním" + quiet: "Zobrazit nerušivé upozornění" _channel: + create: "Vytvořit kanál" + edit: "Upravit kanál" + setBanner: "Nastavit banner" + removeBanner: "Odstranit banner" featured: "Trendy" + owned: "Vlastněný" + following: "Sledovaný" + usersCount: "{n} Účastníků" + notesCount: "{n} Poznámek" + nameAndDescription: "Název a popis" + nameOnly: "Pouze název" _menuDisplay: + sideFull: "Postranně" + sideIcon: "Postranně (Ikony)" top: "Nahoru" hide: "Skrýt" +_wordMute: + muteWords: "Ztlumená slova" + muteWordsDescription: "Podmínku AND oddělujte mezerami, podmínku OR oddělujte řádkovými zlomy." + muteWordsDescription2: "Chcete-li použít regulární výrazy, obklopte klíčová slova lomítky." + softDescription: "Skrýt poznámky, které splňují nastavené podmínky, z časové osy." + hardDescription: "Zabrání přidání poznámek splňujících nastavené podmínky na časovou osu. Kromě toho nebudou tyto poznámky přidány na časovou osu, ani když se podmínky změní." + soft: "Měkký" + hard: "Tvrdý" + mutedNotes: "Ztlumené poznámky" +_instanceMute: + instanceMuteDescription: "Tímhle se ztlumí všechny poznámky/poznámky z uvedených instancí, včetně poznámek uživatelů, kteří odpovídají uživateli ze ztlumené instance." + instanceMuteDescription2: "Oddělte novými řádky" + title: "Skryje poznámky z uvedených případů." + heading: "Seznam instancí, které mají být ztlumeny" _theme: + explore: "Objevit témata" install: "Nainstalovat vzhled" manage: "Správa vzhledů" code: "Kód vzhledu" description: "Popis" + installed: "{name} byl nainstalován" installedThemes: "Nainstalované vzhledy" + builtinThemes: "Vestavěné temáta" + alreadyInstalled: "Tento vzhled je již nainstalován." + invalid: "Formát tohoto tématu je neplatný" + make: "Vytvořit téma" + base: "Základ" + addConstant: "Přidat konstantu" constant: "Konstanta" defaultValue: "Výchozí hodnota" color: "Barva" + refProp: "Odkázat na vlastnost" + refConst: "Odkázat na konstantu" key: "Klíč" func: "Funkce " + funcKind: "Typ funkce" + argument: "Argument" + basedProp: "Odkazovaná vlastnost" + alpha: "Průhlednost" + darken: "Ztmavit" + lighten: "Zesvětlit" + inputConstantName: "Zadejte název pro tuto konstantu" + importInfo: "Pokud zde zadáte kód motivu, můžete jej importovat do editoru motivu." + deleteConstantConfirm: "Opravdu chcete odstranit konstantu {const}?" keys: + accent: "Akcent" + bg: "Pozadí" + fg: "Text" + focus: "Fokus" + indicator: "Indikátor" + panel: "Panely" shadow: "Stín" header: "Nadpis" + navBg: "Pozadí postranního panelu" + navFg: "Text na postranním panelu" + navHoverFg: "Text na postranním panelu (Hover)" + navActive: "Text na postranním panelu (Aktivní)" + navIndicator: "Indikátor na postranním panelu" link: "Odkaz" hashtag: "Hashtag" mention: "Zmínění" + mentionMe: "Zmínky (mě)" renote: "Přeposlat" + modalBg: "Pozadí Modalu" divider: "Dělící čára" + scrollbarHandle: "Rukojeť posuvníku" + scrollbarHandleHover: "Rukojeť posuvníku (Hover)" + dateLabelFg: "Text štítku s datem" + infoBg: "Pozadí informací" + infoFg: "Text informací" + infoWarnBg: "Pozadí varování" + infoWarnFg: "Text varování" + cwBg: "Pozadí CW tlačítka" + cwFg: "Text CW tlačítka" + cwHoverBg: "Pozadí CW tlačítka (Hover)" + toastBg: "Pozadí oznámení" + toastFg: "Text oznámení" + buttonBg: "Pozadí tlačítka" + buttonHoverBg: "Pozadí tlačítka (Hover)" + inputBorder: "Ohraničení vstupního pole" + listItemHoverBg: "Pozadí položky seznamu (Hover)" + driveFolderBg: "Pozadí složky disku" + wallpaperOverlay: "Překrytí tapety" + badge: "Odznak" + messageBg: "Pozadí chatu" + accentDarken: "Akcent (Ztmavený)" + accentLighten: "Akcent (Zesvětlený)" + fgHighlighted: "Zvýrazněný text" _sfx: note: "Poznámky" + noteMy: "Moje poznámka" notification: "Oznámení" chat: "Zprávy" + chatBg: "Chat (Pozadí)" + antenna: "Antény" + channel: "Oznámení kanálu" _ago: future: "Budoucí" justNow: "Teď" + secondsAgo: "Před {n}s" + minutesAgo: "Před {n}min" + hoursAgo: "Před {n}h" + daysAgo: "Před {n}d" + weeksAgo: "Před {n}t" + monthsAgo: "Před {n}m" + yearsAgo: "Před {n}r" invalid: "Nic nebylo nalezeno" _time: second: "Sekund" minute: "Minut" hour: "Hodin" + day: "Dnů" +_timelineTutorial: + title: "Jak používat Misskey" + step1_1: "Toto je \"časová osa\". Zde se chronologicky zobrazují všechny \"poznámky\" odeslané na {name}." + step1_2: "Existuje několik různých časových plánů. Například \"Domácí časová osa\" bude obsahovat poznámky uživatelů, které sledujete, a \"Místní časová osa\" bude obsahovat poznámky všech uživatelů {name}." + step2_1: "Zkusme zveřejnit poznámku. Můžete tak učinit stisknutím tlačítka s ikonou tužky." + step2_2: "Co takhle napsat sebepředstavení, nebo jen \"Ahoj {name}!\", pokud se vám nechce?" + step3_1: "Dokončil jsi svou první poznámku?" + step3_2: "Na časové ose by se nyní měla zobrazit vaše první poznámka." + step4_1: "K poznámkám můžete také připojit \"Reakce\"." + step4_2: "Chcete-li připojit reakci, stiskněte na poznámce znaménko \"+\" a vyberte emoji, kterým chcete reagovat." _2fa: + alreadyRegistered: "Již jste zaregistrovali dvoufaktorové ověřovací zařízení." + registerTOTP: "Registrovat aplikaci autentizátoru" + step1: "Nejprve si do zařízení nainstalujte aplikaci pro ověřování (například {a} nebo {b})." + step2: "Poté naskenujte QR kód zobrazený na této obrazovce." + step2Click: "Kliknutím na tento QR kód můžete zaregistrovat 2FA do bezpečnostního klíče nebo aplikace autentizace telefonu." + step3Title: "Zadejte ověřovací kód" + step3: "Pro dokončení nastavení zadejte token poskytnutý vaší aplikací." + step4: "Od této chvíle budou všechny budoucí pokusy o přihlášení vyžadovat tento přihlašovací token." + securityKeyNotSupported: "Váš prohlížeč nepodporuje bezpečnostní klíče." + registerTOTPBeforeKey: "Nastavte aplikaci autentizátoru pro registraci bezpečnostního nebo přístupového klíče." + securityKeyInfo: "Kromě ověřování otiskem prstu nebo PIN můžete nastavit také ověřování pomocí hardwarových bezpečnostních klíčů, které podporují FIDO2, a svůj účet tak dále zabezpečit." + registerSecurityKey: "Registrace bezpečnostního nebo přístupového klíče" + securityKeyName: "Zadejte název klíče" + tapSecurityKey: "Při registraci bezpečnostního nebo přístupového klíče postupujte podle svého prohlížeče." + removeKey: "Odstranit bezpečnostní klíč" + removeKeyConfirm: "Opravdu chcete odstranit klíč {name}?" + whyTOTPOnlyRenew: "Aplikaci autentizátoru nelze odstranit, dokud je zaregistrován bezpečnostní klíč." + renewTOTP: "Překonfigurování aplikace autentizátor" + renewTOTPConfirm: "Tohle způsobí, že ověřovací kódy z předchozí aplikace přestanou fungovat." + renewTOTPOk: "Přenastavit" renewTOTPCancel: "Ne děkuji" +_permissions: + "read:account": "Zobrazit informace o účtu" + "write:account": "Upravit informace o účtu" + "read:blocks": "Zobrazit seznam blokovaných uživatelů" + "write:blocks": "Upravit seznam blokovaných uživatelů" + "read:drive": "Přístup k souborům a složkám na disku" + "write:drive": "Úprava nebo odstranění souborů a složek na disku" + "read:favorites": "Zobrazit seznam oblíbených" + "write:favorites": "Upravit seznam oblíbených" + "read:following": "Zobrazit informace o tom, koho sledujete" + "write:following": "Sledování nebo zrušení sledování jiných účtů" + "read:messaging": "Zobrazit chat" + "write:messaging": "Sestavit nebo mazat zprávy chatu" + "read:mutes": "Zobrazit seznam ztlumených uživatelů" + "write:mutes": "Upravit seznam ztlumených uživatelů" + "write:notes": "Sestavit nebo odstranit poznámky" + "read:notifications": "Zobrazit oznámení" + "write:notifications": "Spravit oznámení" + "read:reactions": "Zobrazit vaše reakce" + "write:reactions": "Upravit své reakce" + "write:votes": "Hlasovat v anketě" + "read:pages": "Zobrazit své stránky" + "write:pages": "Upravit nebo odstranit stránky" + "read:page-likes": "Zobrazit to se mi líbí na stránkách" + "write:page-likes": "Upravit to se mi líbí na stránkách" + "read:user-groups": "Zobrazit skupiny uživatelů" + "write:user-groups": "Upravit nebo odstranit skupiny uživatelů" + "read:channels": "Zobrazit své kanály" + "write:channels": "Upravit kanály" + "read:gallery": "Zobrazit galerii" + "write:gallery": "Upravit galerii" + "read:gallery-likes": "Zobrazit seznam to se mi líbí příspěvků v galerii" + "write:gallery-likes": "Upravit seznam to se mi líbí příspěvků v galerii" +_auth: + shareAccessTitle: "Udělovat oprávnění k aplikacím" + shareAccess: "Chcete autorizovat \"{name}\" pro přístup k tomuto účtu?" + shareAccessAsk: "Opravdu chcete této aplikaci povolit přístup k vašemu účtu?" + permission: "{jméno} požaduje tato oprávnění" + permissionAsk: "Tato aplikace požaduje následující oprávnění" + pleaseGoBack: "Vraťte se prosím zpět do aplikace" + callback: "Návrat k aplikaci" + denied: "Přístup odepřen" + pleaseLogin: "Pro autorizaci aplikací se prosím přihlaste." +_antennaSources: + all: "Všechny poznámky" + homeTimeline: "Poznámky sledovaných uživatelů" + users: "Poznámky konkrétních uživatelů" + userList: "Poznámky z určitého seznamu uživatelů" _weekday: sunday: "Neděle" monday: "Pondělí" @@ -874,38 +1758,81 @@ _weekday: _widgets: profile: "Váš profil" instanceInfo: "Informace o instanci" + memo: "Přilepené poznámky" notifications: "Oznámení" timeline: "Časová osa" calendar: "Kalendář" trends: "Trendy" clock: "Hodiny" rss: "RSS čtečka" + rssTicker: "RSS Ticker" activity: "Aktivita" photos: "Fotky" digitalClock: "Digitální hodiny" + unixClock: "Hodiny UNIX" federation: "Federace" + instanceCloud: "Cloud instance" + postForm: "Formulář pro odeslání" slideshow: "Prezentace" button: "Tlačítko" onlineUsers: "Online uživatelé" jobQueue: "Fronta úloh" + serverMetric: "Metriky serveru" aiscript: "AiScript conzole" + aiscriptApp: "Aplikace AiScript" aichan: "Ai" + userList: "Seznam uživatelů" _userList: chooseList: "Vybrat seznam" + clicker: "Clicker" _cw: hide: "Skrýt" show: "Zobrazit více" + chars: "{count} charakterů" + files: "{count} souborů" _poll: + noOnlyOneChoice: "Jsou zapotřebí alespoň dvě možnosti" + choiceN: "Volba {n}" noMore: "Více už přidat nemůžete" + canMultipleVote: "Umožnit výběr více možností" + expiration: "Ukončení ankety" infinite: "Nikdy" + at: "Ukončit v" + after: "Ukončit po" deadlineDate: "Datum ukončení" deadlineTime: "Hodin" duration: "Trvání" + votesCount: "{n} hlasů" + totalVotes: "{n} hlasů celkově" + vote: "Hlasovat v anketě" + showResult: "Zobrazit výsledky" + voted: "Odhlasováno" + closed: "Uzavřeno" + remainingDays: "Zbývá {d} den/dní a {h} hodin/a" + remainingHours: "Zbývá {h} hodin/a a {m} minut/a" + remainingMinutes: "Zbývá {m} minut/a a {s} sekund/a" + remainingSeconds: "Zbývá {s} sekund/a" _visibility: + public: "Veřejný" + publicDescription: "Vaše poznámka bude viditelná pro všechny uživatele" home: "Domů" + homeDescription: "Zveřejnit příspěvek pouze na domovskou časovou osu" followers: "Sledující" + followersDescription: "Zviditelnit pouze pro své sledující" + specified: "Přímý" + specifiedDescription: "Zviditelnit pouze pro určité uživatele" + disableFederation: "Defederace" + disableFederationDescription: "Nepřenášet do jiných instancí" _postForm: + replyPlaceholder: "Odpovědět na tuto poznámku..." + quotePlaceholder: "Citovat tuto poznámku..." + channelPlaceholder: "Zveřejnit příspěvek do kanálu..." _placeholders: + a: "Co máte v plánu?" + b: "Co se děje kolem vás?" + c: "Co máte na mysli?" + d: "Co chcete říct?" + e: "Začít psát..." f: "Čekám, až něco napíšete..." _profile: name: "Jméno" @@ -913,36 +1840,100 @@ _profile: description: "O mně" youCanIncludeHashtags: "V popisku o Vás můžete použít i hastagy." metadata: "Doplňující informace" + metadataEdit: "Upravit doplňující informace" + metadataDescription: "Pomocí nich můžete ve svém profilu zobrazit doplňující informační pole." + metadataLabel: "Popisek" metadataContent: "Obsah" + changeAvatar: "Změnit avatara" + changeBanner: "Změnit banner" _exportOrImport: allNotes: "Všechny poznámky" + favoritedNotes: "Oblíbené poznámky" followingList: "Sledovaní" muteList: "Ztlumit" blockingList: "Zablokovat" userLists: "Seznamy" + excludeMutingUsers: "Vyloučit ztlumené uživatele" + excludeInactiveUsers: "Vyloučit neaktivní uživatele" _charts: federation: "Federace" apRequest: "Požadavek" + usersIncDec: "Rozdíl v počtech uživatelů" usersTotal: "Celkem uživatelů" activeUsers: "Aktivní uživatelé" + notesIncDec: "Rozdíl v počtu poznámek" + localNotesIncDec: "Rozdíl v počtu místních poznámek" + remoteNotesIncDec: "Rozdíl v počtu vzdálených poznámek" notesTotal: "Celkový počet poznámek" + filesIncDec: "Rozdíl v počtu souborů" + filesTotal: "Celkový počet souborů" + storageUsageIncDec: "Rozdíl ve využití úložiště" + storageUsageTotal: "Celkové využití úložiště" +_instanceCharts: + requests: "Požadavky" + users: "Rozdíl v počtech uživatelů" + usersTotal: "Kumulativní počet uživatelů" + notes: "Rozdíl v počtu poznámek" + notesTotal: "Kumulativní počet poznámek" + ff: "Rozdíl v počtu sledovaných uživatelů / sledujících" + ffTotal: "Kumulativní počet sledovaných uživatelů / sledujících" + cacheSize: "Rozdíl ve velikosti mezipaměti" + cacheSizeTotal: "Kumulativní celková velikost mezipaměti" + files: "Rozdíl v počtu souborů" + filesTotal: "Kumulativní počet souborů" _timelines: home: "Domů" + local: "Místní" + social: "Sociální síť" global: "Globální" _play: + new: "Vytvořit Play" + edit: "Upravit Play" + created: "Play vytvořen" + updated: "Play upraven" + deleted: "Play smazán" + pageSetting: "Nastavení Play" + editThisPage: "Upravit tenhle Play" + viewSource: "Zobrazit zdroj" + my: "Moje Plays" + liked: "To se mi líbí Plays" + featured: "Populární" + title: "Titulek" script: "Skript" summary: "Popis" _pages: newPage: "Vytvořit novou stránku" editPage: "Upravit stránku" + readPage: "Prohlížení zdroje této stránky" created: "Stránka byla úspěšně vytvořena" updated: "Stránka byla úspěšně aktualizována" deleted: "Stránka byla úspěšně smazána" pageSetting: "Nastavení stránky" + nameAlreadyExists: "Zadaná adresa URL stránky již existuje" + invalidNameTitle: "Zadaná adresa URL stránky je neplatná" invalidNameText: "Ujistěte se že jméno stránky je vyplněno" + editThisPage: "Upravit tuto stránku" + viewSource: "Zobrazit zdroj" + viewPage: "Zobrazit své stránky" + like: "To se mi líbí" + unlike: "Už se mi to nelíbí" + my: "Moje stránky" + liked: "To se mi líbí stránky" + featured: "Populární" + inspector: "Inspektor" contents: "Obsah" + content: "Blok stránky" + variables: "Proměnné" + title: "Titulek" + url: "URL stránky" + summary: "Přehled stránky" + alignCenter: "Vycentrovat prvky" + hideTitleWhenPinned: "Skrytí názvu stránky při připnutí k profilu" + font: "Písmo" fontSerif: "Serif" fontSansSerif: "Sans Serif" + eyeCatchingImageSet: "Nastavení miniatury" + eyeCatchingImageRemove: "Smazání miniatury" chooseBlock: "Přidat blok" selectType: "Vyberte typ" contentBlocks: "Obsah" @@ -954,8 +1945,28 @@ _pages: section: "Sekce" image: "Obrázky" button: "Tlačítko" + note: "Vestavěná poznámka" + _note: + id: "ID poznámky" + idDescription: "Adresu URL poznámky můžete vložit také sem." + detailed: "Podrobné zobrazení" +_relayStatus: + requesting: "Čeká se" + accepted: "Schváleno" + rejected: "Odmítnuto" _notification: + fileUploaded: "Soubor úspěšně nahrán" + youGotMention: "{name} vás zmínil" + youGotReply: "{name} vám odpověděl" + youGotQuote: "{name} vás citoval" + youRenoted: "Poznámka od {jméno}" youWereFollowed: "Máte nového následovníka" + youReceivedFollowRequest: "Obdrželi jste žádost o sledování" + yourFollowRequestAccepted: "Vaše žádost o sledování byla přijata" + pollEnded: "Výsledky ankety jsou k dispozici" + unreadAntennaNote: "Anténa {name}" + emptyPushNotificationMessage: "Push oznámení byla aktualizována" + achievementEarned: "Úspěch odemčen" _types: all: "Vše" follow: "Sledovaní" @@ -964,17 +1975,67 @@ _notification: renote: "Přeposlat" quote: "Citovat" reaction: "Reakce" + pollEnded: "Anketa končí" + receiveFollowRequest: "Obdržené žádosti o sledování" + followRequestAccepted: "Přijaté žádosti o sledování" + achievementEarned: "Úspěch odemčen" + app: "Oznámení z propojených aplikací" _actions: + followBack: "vás začal sledovat zpět" reply: "Odpovědět" renote: "Přeposlat" _deck: + alwaysShowMainColumn: "Vždy zobrazovat hlavní sloupec" + columnAlign: "Zarovnat sloupce" + addColumn: "Přidat sloupec" + configureColumn: "Nastavení sloupců" + swapLeft: "Prohodit s levým sloupcem" + swapRight: "Prohodit s pravým sloupcem" + swapUp: "Prohodit s výše uvedeným sloupcem" + swapDown: "Prohodit s níže uvedeným sloupcem" + stackLeft: "Nahromadit v levém sloupci" + popRight: "Popnout sloupec na pravou stranu" + profile: "Profil" + newProfile: "Nový profil" + deleteProfile: "Smazat profil" + introduction: "Vytvořte si dokonalé rozhraní volným uspořádáním sloupců!" + introduction2: "Kliknutím na tlačítko + v pravé části obrazovky můžete kdykoli přidat nové sloupce." + widgetsIntroduction: "V nabídce sloupce vyberte možnost \"Upravit widgety\" a přidejte widget." + useSimpleUiForNonRootPages: "Použít zjednodušené uživatelské rozhraní pro navigaci na stránkách" _columns: + main: "Hlavní" + widgets: "Widgety" notifications: "Oznámení" tl: "Časová osa" antenna: "Antény" list: "Seznamy" channel: "Kanály" mentions: "Zmínění" + direct: "Přímý" + roleTimeline: "Časová osa role" +_dialog: + charactersExceeded: "Překročili jste maximální počet znaků! V současné době je na hodnotě {current} z {max}." + charactersBelow: "Nedosahujete minimálního limitu znaků! V současné době je na {current} z {min}." +_disabledTimeline: + title: "Časová osa vypnuta" + description: "Tuto časovou osu nemůžete používat v rámci svých současných rolí." +_drivecleaner: + orderBySizeDesc: "Sestupná velikost souborů" + orderByCreatedAtAsc: "Vzestupné datumy" _webhookSettings: + createWebhook: "Vytvořit Webhook" name: "Jméno" + secret: "Tajné" + events: "Události Webhook" active: "Zapnuto" + _events: + follow: "Při sledování uživatele" + followed: "Při sledování" + note: "Při zveřejňování poznámky" + reply: "Při obdržení odpovědi" + renote: "Při renotaci poznámky" + reaction: "Při obdržení reakce" + mention: "Při zmínce" +_moderationLogTypes: + suspend: "Zmrazit" + resetPassword: "Resetovat heslo" diff --git a/locales/de-DE.yml b/locales/de-DE.yml index 874c70dd85..eb3a8cc3bf 100644 --- a/locales/de-DE.yml +++ b/locales/de-DE.yml @@ -2,7 +2,7 @@ _lang_: "Deutsch" headlineMisskey: "Ein durch Notizen verbundenes Netzwerk" introMisskey: "Willkommen! Misskey ist eine dezentralisierte Open-Source Microblogging-Platform.\nVerfasse „Notizen“ um mitzuteilen, was gerade passiert oder um Ereignisse mit anderen zu teilen. 📡\nMit „Reaktionen“ kannst du außerdem schnell deine Gefühle über Notizen anderer Benutzer zum Ausdruck bringen. 👍\nEine neue Welt wartet auf dich! 🚀" -poweredByMisskeyDescription: "{name} ist einer der durch die Open-Source-Plattform Misskey betriebenen Dienste (meist als \"Misskey-Instanz\" bezeichnet)." +poweredByMisskeyDescription: "{name} ist einer der durch die Open-Source-Plattform Misskey betriebenen Dienste." monthAndDay: "{day}.{month}." search: "Suchen" notifications: "Benachrichtigungen" @@ -45,6 +45,7 @@ pin: "An dein Profil anheften" unpin: "Von deinem Profil lösen" copyContent: "Inhalt kopieren" copyLink: "Link kopieren" +copyLinkRenote: "Renote-Link kopieren" delete: "Löschen" deleteAndEdit: "Löschen und Bearbeiten" deleteAndEditConfirm: "Möchtest du diese Notiz wirklich löschen und bearbeiten? Alle Reaktionen, Renotes und Antworten dieser Notiz werden verloren gehen." @@ -74,7 +75,7 @@ import: "Import" export: "Export" files: "Dateien" download: "Herunterladen" -driveFileDeleteConfirm: "Möchtest du die Datei „{name}“ wirklich löschen? Sie wird in allen Inhalten, die sie verwenden, auch verschwinden." +driveFileDeleteConfirm: "Möchtest du die Datei „{name}“ wirklich löschen? Einige Inhalte, die diese Datei verwenden, werden auch verschwinden." unfollowConfirm: "Möchtest du {name} wirklich nicht mehr folgen?" exportRequested: "Du hast einen Export angefragt. Dies kann etwas Zeit in Anspruch nehmen. Sobald der Export abgeschlossen ist, wird er deiner Drive hinzugefügt." importRequested: "Du hast einen Import angefragt. Dies kann etwas Zeit in Anspruch nehmen." @@ -156,6 +157,7 @@ addEmoji: "Emoji hinzufügen" settingGuide: "Empfohlene Einstellung" cacheRemoteFiles: "Dateien von fremden Instanzen im Cache speichern" cacheRemoteFilesDescription: "Ist diese Einstellung deaktiviert, so werden Dateien fremder Instanzen direkt von dort geladen. Hierdurch wird Speicherplatz auf diesem Server gespart, aber durch fehlende Generierung von Vorschaubildern mehr Bandbreite verwendet." +youCanCleanRemoteFilesCache: "Klicke auf den 🗑️-Knopf der Dateiverwaltungsansicht, um den Cache zu leeren." cacheRemoteSensitiveFiles: "Sensitive Dateien von fremden Instanzen im Cache speichern" cacheRemoteSensitiveFilesDescription: "Ist diese Einstellung deaktiviert, so werden sensitive Dateien fremder Instanzen direkt von dort ohne Zwischenspeicherung geladen." flagAsBot: "Als Bot markieren" @@ -230,7 +232,7 @@ noJobs: "Keine Jobs vorhanden" federating: "Wird föderiert" blocked: "Blockiert" suspended: "Gesperrt" -all: "Alles" +all: "Alle" subscribing: "Wird abonniert" publishing: "Wird veröffentlicht" notResponding: "Antwortet nicht" @@ -319,7 +321,7 @@ copyUrl: "URL kopieren" rename: "Umbenennen" avatar: "Profilbild" banner: "Banner" -displayOfSensitiveMedia: "Anzeige von sensiblen Medien" +displayOfSensitiveMedia: "Darstellung sensibler Medien" whenServerDisconnected: "Bei Verbindungsverlust zum Server" disconnectedFromServer: "Die Verbindung zum Server wurde getrennt" reload: "Aktualisieren" @@ -354,7 +356,6 @@ invite: "Einladen" driveCapacityPerLocalAccount: "Drive-Kapazität pro lokalem Benutzerkonto" driveCapacityPerRemoteAccount: "Drive-Kapazität pro Benutzer fremder Instanzen" inMb: "In Megabytes" -iconUrl: "Icon-URL (favicon etc)" bannerUrl: "Banner-URL" backgroundImageUrl: "Hintergrundbild-URL" basicInfo: "Grundlegende Informationen" @@ -410,13 +411,17 @@ aboutMisskey: "Über Misskey" administrator: "Administrator" token: "Token" 2fa: "Zwei-Faktor-Authentifizierung" +setupOf2fa: "Zweifaktorauthentifizierung einrichten" totp: "Authentifizierungs-App" totpDescription: "Logge dich via Authentifizierungs-App mit Einmalpasswort ein" moderator: "Moderator" moderation: "Moderation" +moderationNote: "Moderationsnotiz" +addModerationNote: "Moderationsnotiz hinzufügen" +moderationLogs: "Moderationsprotokolle" nUsersMentioned: "Von {n} Benutzern erwähnt" -securityKeyAndPasskey: "Security-Tokens und Passkeys" -securityKey: "Sicherheitsschlüssel" +securityKeyAndPasskey: "Hardware-Sicherheitsschlüssel und Passkeys" +securityKey: "Hardware-Sicherheitsschlüssel" lastUsed: "Zuletzt benutzt" lastUsedAt: "Zuletzt verwendet: {t}" unregister: "Deaktivieren" @@ -540,7 +545,7 @@ chooseEmoji: "Emoji auswählen" unableToProcess: "Der Vorgang konnte nicht abgeschlossen werden" recentUsed: "Vor kurzem verwendet" install: "Installieren" -uninstall: "Uninstallieren" +uninstall: "Deinstallieren" installedApps: "Authorisierte Anwendungen" nothing: "Hier gibt es nichts zu sehen" installedDate: "Authorisiert am" @@ -631,11 +636,11 @@ regexpErrorDescription: "Im regulären Ausdruck deiner {tab}en Wortstummschaltun instanceMute: "Instanzstummschaltungen" userSaysSomething: "{name} hat etwas gesagt" makeActive: "Aktivieren" -display: "Anzeigen" +display: "Anzeigeart" copy: "Kopieren" metrics: "Metriken" overview: "Übersicht" -logs: "Logs" +logs: "Protokolle" delayed: "Verzögert" database: "Datenbank" channel: "Kanäle" @@ -653,6 +658,7 @@ behavior: "Verhalten" sample: "Beispiel" abuseReports: "Meldungen" reportAbuse: "Melden" +reportAbuseRenote: "Renote melden" reportAbuseOf: "{name} melden" fillAbuseReportDescription: "Bitte gib zusätzliche Informationen zu dieser Meldung an. Falls es sich um eine spezielle Notiz handelt, bitte gib dessen URL an." abuseReported: "Deine Meldung wurde versendet. Vielen Dank." @@ -680,6 +686,7 @@ createNewClip: "Neuen Clip erstellen" unclip: "Aus Clip entfernen" confirmToUnclipAlreadyClippedNote: "Diese Notiz ist bereits im \"{name}\" Clip enthalten. Möchtest du sie aus diesem Clip entfernen?" public: "Öffentlich" +private: "Privat" i18nInfo: "Misskey wird durch freiwillige Helfer in viele verschiedene Sprachen übersetzt. Auf {link} kannst du mithelfen." manageAccessTokens: "Zugriffstokens verwalten" accountInfo: "Benutzerkonto-Informationen" @@ -704,6 +711,7 @@ lockedAccountInfo: "Auch wenn du Follow-Anfragen auf manuelle Bestätigung setzt alwaysMarkSensitive: "Medien standardmäßig als sensibel markieren" loadRawImages: "Anstatt Vorschaubilder immer Originalbilder anzeigen" disableShowingAnimatedImages: "Animierte Bilder nicht abspielen" +highlightSensitiveMedia: "Sensitive Medien markieren" verificationEmailSent: "Eine Bestätigungsmail wurde an deine Email-Adresse versendet. Besuche den dort enthaltenen Link, um die Verifizierung abzuschließen." notSet: "Nicht konfiguriert" emailVerified: "Email-Adresse bestätigt" @@ -907,7 +915,7 @@ typeToConfirm: "Bitte gib zur Bestätigung {x} ein" deleteAccount: "Benutzerkonto löschen" document: "Dokumentation" numberOfPageCache: "Seitencachegröße" -numberOfPageCacheDescription: "Das Erhöhen dieses Caches führt zu einer angenehmerern Benutzererfahrung, erhöht aber Serverlast und Arbeitsspeicherauslastung." +numberOfPageCacheDescription: "Das Erhöhen dieses Caches führt zu einer angenehmerern Benutzererfahrung, aber erhöht Last und Arbeitsspeicherauslastung auf dem Nutzergerät." logoutConfirm: "Wirklich abmelden?" lastActiveDate: "Zuletzt verwendet am" statusbar: "Statusleiste" @@ -1018,7 +1026,7 @@ retryAllQueuesConfirmText: "Dies wird zu einer temporären Erhöhung der Serverl enableChartsForRemoteUser: "Diagramme für Nutzer fremder Instanzen erstellen" enableChartsForFederatedInstances: "Diagramme für fremde Instanzen erstellen" showClipButtonInNoteFooter: "\"Clip\" zum Notizmenu hinzufügen" -largeNoteReactions: "Reaktionen vergrößert anzeigen" +reactionsDisplaySize: "Reaktionsanzeigegröße" noteIdOrUrl: "Notiz-ID oder URL" video: "Video" videos: "Videos" @@ -1042,7 +1050,7 @@ vertical: "Vertikal" horizontal: "Horizontal" position: "Position" serverRules: "Serverregeln" -pleaseConfirmBelowBeforeSignup: "Lies bitte Untenstehendes vor der Registration." +pleaseConfirmBelowBeforeSignup: "Lies bitte diese Informationen und stimme ihnen vor der Registration zu." pleaseAgreeAllToContinue: "Zum Fortfahren muss allen obigen Feldern zugestimmt werden." continue: "Fortfahren" preservedUsernames: "Reservierte Benutzernamen" @@ -1052,7 +1060,7 @@ archive: "Archivieren" channelArchiveConfirmTitle: "{name} wirklich archivieren?" channelArchiveConfirmDescription: "Ein archivierter Kanal taucht nicht mehr in der Kanalliste oder in Suchergebnissen auf. Zudem können ihm keine Beiträge mehr hinzugefügt werden." thisChannelArchived: "Dieser Kanal wurde archiviert." -displayOfNote: "Anzeige von Notizen" +displayOfNote: "Darstellung von Notizen" initialAccountSetting: "Kontoeinrichtung" youFollowing: "Gefolgt" preventAiLearning: "Verwendung in machinellem Lernen (Generative bzw. Prediktive AI/KI) ablehnen" @@ -1094,6 +1102,33 @@ expired: "Abgelaufen" doYouAgree: "Zustimmen?" beSureToReadThisAsItIsImportant: "Lies bitte diese wichtige Informationen." iHaveReadXCarefullyAndAgree: "Ich habe den Text \"{x}\" gelesen und stimme zu." +dialog: "Dialogfeld" +icon: "Symbol" +forYou: "Für dich" +currentAnnouncements: "Aktuelle Ankündigungen" +pastAnnouncements: "Alte Ankündigungen" +youHaveUnreadAnnouncements: "Es gibt neue Ankündigungen." +useSecurityKey: "Folge bitten den Anweisungen deines Browsers bzw. Gerätes und verwende deinen Hardware-Sicherheitsschlüssel oder Passkey." +replies: "Antworten" +renotes: "Renotes" +loadReplies: "Antworten anzeigen" +loadConversation: "Unterhaltung anzeigen" +pinnedList: "Angeheftete Liste" +keepScreenOn: "Bildschirm angeschaltet lassen" +verifiedLink: "Link-Besitz wurde verifiziert" +notifyNotes: "Über neue Notizen benachrichtigen" +unnotifyNotes: "Nicht über neue Notizen benachrichtigen" +authentication: "Authentifikation" +authenticationRequiredToContinue: "Bitte authentifiziere dich, um fortzufahren" +_announcement: + forExistingUsers: "Nur für existierende Nutzer" + forExistingUsersDescription: "Ist diese Option aktiviert, wird diese Ankündigung nur Nutzern angezeigt, die zum Zeitpunkt der Ankündigung bereits registriert sind. Ist sie deaktiviert, wird sie auch Nutzern, die sich nach dessen Veröffentlichung registrieren, angezeigt." + needConfirmationToRead: "Separate Lesebestätigung erfordern" + needConfirmationToReadDescription: "Ist dies aktiviert, so wird beim Markieren dieser Ankündigung als gelesen ein separates Bestätigungsfenster angezeigt. Auch wird sie von der \"Alle als gelesen markieren\"-Funktion ausgenommen." + end: "Ankündigung archivieren" + tooManyActiveAnnouncementDescription: "Zu viele aktive Ankündigungen können die Benutzerfreundlichkeit verschlechtern. Es wird empfohlen, veraltete Ankündigungen zu archivieren." + readConfirmTitle: "Als gelesen markieren?" + readConfirmText: "Dies markiert den Inhalt von \"{title}\" als gelesen." _initialAccountSetting: accountCreated: "Dein Konto wurde erfolgreich erstellt!" letsStartAccountSetup: "Lass uns nun dein Konto einrichten." @@ -1111,6 +1146,15 @@ _initialAccountSetting: laterAreYouSure: "Die Kontoeinrichtung wirklich später erledigen?" _serverRules: description: "Eine Reihe von Regeln, die vor der Registrierung angezeigt werden. Eine Zusammenfassung der Nutzungsbedingungen anzuzeigen ist empfohlen." +_serverSettings: + iconUrl: "Icon-URL" + appIconDescription: "Gibt das zu verwendende Icon bei der Anzeige von {host} als App an." + appIconUsageExample: "Beispielsweise als PWA, oder bei Lesezeichen auf dem Startbildschirm von Smartphones" + appIconStyleRecommendation: "Da das Icon zu einem Kreis oder Quadrat zugeschnitten wird, wird ein Icon mit gefülltem Margin um den Inhalt herum empfohlen." + appIconResolutionMustBe: "Die Mindestauflösung ist {resolution}." + manifestJsonOverride: "Überschreiben von manifest.json" + shortName: "Abkürzung" + shortNameDescription: "Ein Kürzel für den Namen der Instanz, der angezeigt werden kann, falls der volle Instanzname lang ist." _accountMigration: moveFrom: "Von einem anderen Konto zu diesem migrieren" moveFromSub: "Alias für ein anderes Konto erstellen" @@ -1365,6 +1409,9 @@ _achievements: title: "Brain Diver" description: "Sende den Link zu Brain Diver" flavor: "Misskey-Misskey La-Tu-Ma" + _smashTestNotificationButton: + title: "Testüberfluss" + description: "Betätige den Benachrichtigungstest mehrfach innerhalb einer extrem kurzen Zeitspanne" _role: new: "Rolle erstellen" edit: "Rolle bearbeiten" @@ -1488,6 +1535,7 @@ _plugin: install: "Plugins installieren" installWarn: "Installiere bitte nur vertrauenswürdige Plugins." manage: "Plugins verwalten" + viewSource: "Quelltext anzeigen" _preferencesBackups: list: "Erstellte Backups" saveNew: "Neu erstellen" @@ -1675,18 +1723,18 @@ _timelineTutorial: _2fa: alreadyRegistered: "Du hast bereits ein Gerät für Zwei-Faktor-Authentifizierung registriert." registerTOTP: "Authentifizierungs-App registrieren" - passwordToTOTP: "Bitte Passwort eingeben" step1: "Installiere zuerst eine Authentifizierungsapp (z.B. {a} oder {b}) auf deinem Gerät." step2: "Dann, scanne den angezeigten QR-Code mit deinem Gerät." step2Click: "Durch Klicken dieses QR-Codes kannst du Verifikation mit deinem Security-Token oder einer App registrieren." - step2Url: "Nutzt du ein Desktopprogramm kannst du alternativ diese URL eingeben:" + step2Uri: "Nutzt du ein Desktopprogramm, gib folgende URI eingeben" step3Title: "Authentifizierungsscode eingeben" - step3: "Gib zum Abschluss den Token ein, der von deiner App angezeigt wird." + step3: "Gib zum Abschluss den Code (Token) ein, der von deiner App angezeigt wird." + setupCompleted: "Einrichtung abgeschlossen" step4: "Alle folgenden Anmeldeversuche werden ab sofort die Eingabe eines solchen Tokens benötigen.\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" - securityKeyNotSupported: "Dein Browser unterstützt keine Security-Tokens." + securityKeyNotSupported: "Dein Browser unterstützt keine Hardware-Sicherheitsschlüssel." registerTOTPBeforeKey: "Um einen Security-Token oder einen Passkey zu registrieren, musst du zuerst eine Authentifizierungs-App registrieren." securityKeyInfo: "Du kannst neben Fingerabdruck- oder PIN-Authentifizierung auf deinem Gerät auch Anmeldung mit Hilfe eines FIDO2-kompatiblen Hardware-Sicherheitsschlüssels einrichten." - registerSecurityKey: "Security-Token oder Passkey registrieren" + registerSecurityKey: "Hardware-Sicherheitsschlüssel oder Passkey registrieren" securityKeyName: "Schlüsselname eingeben" tapSecurityKey: "Bitten folge den Anweisungen deines Browsers zur Registrierung" removeKey: "Sicherheitsschlüssel entfernen" @@ -1696,6 +1744,11 @@ _2fa: renewTOTPConfirm: "Codes der bisherigen App werden hierdurch nutzlos" renewTOTPOk: "Neu einrichten" renewTOTPCancel: "Abbrechen" + checkBackupCodesBeforeCloseThisWizard: "Notiere bitte deine Backup-Codes, bevor du dieses Fenster schließt." + backupCodes: "Backup-Codes" + backupCodesDescription: "Verwende diese Codes, falls du nicht mehr auf deine App zur Zweifaktorauthentifizierung zugreifen kannst. Jeder Code kann nur einmal verwendet werden. Bewahre sie an einem sicheren Ort auf." + backupCodeUsedWarning: "Ein Backup-Code wurde verwendet. Falls du den Zugriff zu deiner Zweifaktorauthentifizierungsapp verloren hast, konfiguriere diese bitte möglichst bald erneut." + backupCodesExhaustedWarning: "Alle Backup-Codes wurden verwendet. Falls du den Zugang zu deiner Zweifaktorauthentifizierungsapp verlierst, wirst du dich nicht mehr in dieses Konto einloggen können. Bitte konfiguriere diese App erneut." _permissions: "read:account": "Deine Benutzerkontoinformationen lesen" "write:account": "Deine Benutzerkontoinformationen bearbeiten" @@ -1729,6 +1782,10 @@ _permissions: "write:gallery": "Deine Galerie bearbeiten" "read:gallery-likes": "Liste deiner mit \"Gefällt mir\" markierten Galerie-Beiträge lesen" "write:gallery-likes": "Liste deiner mit \"Gefällt mir\" markierten Galerie-Beiträge bearbeiten" + "read:flash": "Deine Plays lesen" + "write:flash": "Deine Plays bearbeiten oder löschen" + "read:flash-likes": "Liste der Plays, die mir gefallen, lesen" + "write:flash-likes": "Liste der Plays, die mir gefallen, bearbeiten" _auth: shareAccessTitle: "Verteilung von App-Berechtigungen" shareAccess: "Möchtest du „{name}“ authorisieren, auf dieses Benutzerkonto zugreifen zu können?" @@ -1744,6 +1801,7 @@ _antennaSources: homeTimeline: "Notizen von Benutzern, denen gefolgt wird" users: "Notizen von einem oder mehreren angegebenen Benutzern" userList: "Notizen von allen Benutzern einer Liste" + userBlacklist: "Alle Notizen abgesehen derer angegebener Benutzer" _weekday: sunday: "Sonntag" monday: "Montag" @@ -1843,6 +1901,7 @@ _profile: metadataContent: "Inhalt" changeAvatar: "Profilbild ändern" changeBanner: "Banner ändern" + verifiedLinkDescription: "Gibst du hier eine URL ein, die einen Link zu deinem Profile enthält, wird neben diesem Feld ein Icon zur Besitzbestätigung angezeigt." _exportOrImport: allNotes: "Alle Notizen" favoritedNotes: "Als Favorit markierte Notizen" @@ -1961,11 +2020,17 @@ _notification: youReceivedFollowRequest: "Du hast eine Follow-Anfrage erhalten" yourFollowRequestAccepted: "Deine Follow-Anfrage wurde akzeptiert" pollEnded: "Umfrageergebnisse sind verfügbar" + newNote: "Neue Notiz" unreadAntennaNote: "Antenne {name}" emptyPushNotificationMessage: "Push-Benachrichtigungen wurden aktualisiert" achievementEarned: "Errungenschaft freigeschaltet" + testNotification: "Testbenachrichtigung" + checkNotificationBehavior: "Aussehen von Benachrichtigungen überprüfen" + sendTestNotification: "Testbenachrichtigung senden" + notificationWillBeDisplayedLikeThis: "Benachrichtigungen sehen so aus" _types: all: "Alle" + note: "Neue Notizen" follow: "Neue Follower" mention: "Erwähnungen" reply: "Antworten" @@ -1999,6 +2064,8 @@ _deck: introduction2: "Klicke auf das + rechts um wann immer du möchtest neue Spalten hinzuzufügen." widgetsIntroduction: "Drücke bitte \"Widgets bearbeiten\" im Spaltenmenü und füge ein Widget hinzu." useSimpleUiForNonRootPages: "Simple Benutzeroberfläche für navigierte Seiten verwenden" + usedAsMinWidthWhenFlexible: "Ist \"Automatische Breitenanpassung\" aktiviert, wird hierfür die minimale Breite verwendet" + flexible: "Automatische Breitenanpassung" _columns: main: "Hauptspalte" widgets: "Widgets" @@ -2033,3 +2100,27 @@ _webhookSettings: renote: "Wenn du ein Renote erhältst" reaction: "Wenn du eine Reaktion erhältst" mention: "Wenn du erwähnt wirst" +_moderationLogTypes: + assignRole: "Zu Rolle zugewiesen" + unassignRole: "Aus Rolle entfernt" + updateRole: "Rolle aktualisiert" + suspend: "Gesperrt" + unsuspend: "Entsperrt" + addCustomEmoji: "Benutzerdefiniertes Emoji hinzugefügt" + updateCustomEmoji: "Benutzerdefiniertes Emoji aktualisiert" + deleteCustomEmoji: "Benutzerdefiniertes Emoji gelöscht" + updateServerSettings: "Servereinstellungen aktualisiert" + updateUserNote: "Moderationsnotiz aktualisiert" + deleteDriveFile: "Datei gelöscht" + deleteNote: "Notiz gelöscht" + createGlobalAnnouncement: "Globale Ankündigung erstellt" + createUserAnnouncement: "Benutzerspezifische Ankündigung erstellt" + updateGlobalAnnouncement: "Globale Ankündigung aktualisiert" + updateUserAnnouncement: "Benutzerspezifische Ankündigung aktualisiert" + deleteGlobalAnnouncement: "Globale Ankündigung gelöscht" + deleteUserAnnouncement: "Benutzerspezifische Ankündigung gelöscht" + resetPassword: "Passwort zurückgesetzt" + suspendRemoteInstance: "Fremde Instanz gesperrt" + unsuspendRemoteInstance: "Fremde Instanz entsperrt" + markSensitiveDriveFile: "Datei als sensitiv markiert" + unmarkSensitiveDriveFile: "Datei als nicht sensitiv markiert" diff --git a/locales/el-GR.yml b/locales/el-GR.yml index 41b1ea7c65..e46efcec1f 100644 --- a/locales/el-GR.yml +++ b/locales/el-GR.yml @@ -287,6 +287,9 @@ searchByGoogle: "Αναζήτηση" file: "Αρχεία" recommended: "Προτεινόμενα" cannotUploadBecauseNoFreeSpace: "Το ανέβασμα απέτυχε λόγω ανεπαρκούς Αποθηκευτικού Χώρου" +icon: "Εικονίδιο" +replies: "Απάντηση" +renotes: "Κοινοποίηση σημειώματος" _email: _follow: title: "Έχετε ένα νέο ακόλουθο" @@ -394,3 +397,5 @@ _deck: mentions: "Επισημάνσεις" _webhookSettings: name: "Όνομα" +_moderationLogTypes: + suspend: "Αποβολή" diff --git a/locales/en-US.yml b/locales/en-US.yml index b693f791bb..5c7e1f7496 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -45,9 +45,10 @@ pin: "Pin to profile" unpin: "Unpin from profile" copyContent: "Copy contents" copyLink: "Copy link" +copyLinkRenote: "Copy renote link" delete: "Delete" deleteAndEdit: "Delete and edit" -deleteAndEditConfirm: "Are you sure you want to delete this note and edit it? You will lose all reactions, renotes and replies to it." +deleteAndEditConfirm: "Are you sure you want to redraft this note? This means you will lose all reactions, renotes, and replies to it." addToList: "Add to list" addToAntenna: "Add to antenna" sendMessage: "Send a message" @@ -74,7 +75,7 @@ import: "Import" export: "Export" files: "Files" download: "Download" -driveFileDeleteConfirm: "Are you sure you want to delete \"{name}\"? It will also vanish from all contents that use it." +driveFileDeleteConfirm: "Do you want to remove the file \"{name}\"? Some content using this file will also be removed." unfollowConfirm: "Are you sure you want to unfollow {name}?" exportRequested: "You've requested an export. This may take a while. It will be added to your Drive once completed." importRequested: "You've requested an import. This may take a while." @@ -105,7 +106,7 @@ unfollow: "Unfollow" followRequestPending: "Follow request pending" enterEmoji: "Enter an emoji" renote: "Renote" -unrenote: "Take back renote" +unrenote: "Remove renote" renoted: "Renoted." cantRenote: "This post can't be renoted." cantReRenote: "A renote can't be renoted." @@ -156,6 +157,7 @@ addEmoji: "Add an emoji" settingGuide: "Recommended settings" cacheRemoteFiles: "Cache remote files" cacheRemoteFilesDescription: "When this setting is disabled, remote files are loaded directly from the remote instance. Disabling this will decrease storage usage, but increase traffic, as thumbnails will not be generated." +youCanCleanRemoteFilesCache: "You can clear the cache by clicking the 🗑️ button in the file management view." cacheRemoteSensitiveFiles: "Cache sensitive remote files" cacheRemoteSensitiveFilesDescription: "When this setting is disabled, sensitive remote files are loaded directly from the remote instance without caching." flagAsBot: "Mark this account as a bot" @@ -355,7 +357,6 @@ invite: "Invite" driveCapacityPerLocalAccount: "Drive capacity per local user" driveCapacityPerRemoteAccount: "Drive capacity per remote user" inMb: "In megabytes" -iconUrl: "Icon URL" bannerUrl: "Banner image URL" backgroundImageUrl: "Background image URL" basicInfo: "Basic info" @@ -411,11 +412,14 @@ aboutMisskey: "About Misskey" administrator: "Administrator" token: "Token" 2fa: "Two-factor authentication" +setupOf2fa: "Setup two-factor authentification" totp: "Authenticator App" totpDescription: "Use an authenticator app to enter one-time passwords" -useSecurityKey: "Please use the security key or passkey according to the browser or device instructions." moderator: "Moderator" moderation: "Moderation" +moderationNote: "Moderation note" +addModerationNote: "Add moderation note" +moderationLogs: "Moderation logs" nUsersMentioned: "Mentioned by {n} users" securityKeyAndPasskey: "Security- and passkeys" securityKey: "Security key" @@ -581,7 +585,7 @@ serviceworkerInfo: "Must be enabled for push notifications." deletedNote: "Deleted note" invisibleNote: "Invisible note" enableInfiniteScroll: "Automatically load more" -visibility: "Visiblility" +visibility: "Visibility" poll: "Poll" useCw: "Hide content" enablePlayer: "Open video player" @@ -655,6 +659,7 @@ behavior: "Behavior" sample: "Sample" abuseReports: "Reports" reportAbuse: "Report" +reportAbuseRenote: "Report renote" reportAbuseOf: "Report {name}" fillAbuseReportDescription: "Please fill in details regarding this report. If it is about a specific note, please include its URL." abuseReported: "Your report has been sent. Thank you very much." @@ -682,6 +687,7 @@ createNewClip: "Create new clip" unclip: "Unclip" confirmToUnclipAlreadyClippedNote: "This note is already part of the \"{name}\" clip. Do you want to remove it from this clip instead?" public: "Public" +private: "Private" i18nInfo: "Misskey is being translated into various languages by volunteers. You can help at {link}." manageAccessTokens: "Manage access tokens" accountInfo: "Account Info" @@ -706,6 +712,7 @@ lockedAccountInfo: "Unless you set your note visiblity to \"Followers only\", yo alwaysMarkSensitive: "Mark as sensitive by default" loadRawImages: "Load original images instead of showing thumbnails" disableShowingAnimatedImages: "Don't play animated images" +highlightSensitiveMedia: "Highlight sensitive media" verificationEmailSent: "A verification email has been sent. Please follow the included link to complete verification." notSet: "Not set" emailVerified: "Email has been verified" @@ -909,7 +916,7 @@ typeToConfirm: "Please enter {x} to confirm" deleteAccount: "Delete account" document: "Documentation" numberOfPageCache: "Number of cached pages" -numberOfPageCacheDescription: "Increasing this number will improve convenience for users but cause more server load as well as more memory to be used." +numberOfPageCacheDescription: "Increasing this number will improve convenience for but cause more load as more memory usage on the user's device." logoutConfirm: "Really log out?" lastActiveDate: "Last used at" statusbar: "Status bar" @@ -1020,7 +1027,7 @@ retryAllQueuesConfirmText: "This will temporarily increase the server load." enableChartsForRemoteUser: "Generate remote user data charts" enableChartsForFederatedInstances: "Generate remote instance data charts" showClipButtonInNoteFooter: "Add \"Clip\" to note action menu" -largeNoteReactions: "Enlargen displayed reactions" +reactionsDisplaySize: "Reaction display size" noteIdOrUrl: "Note ID or URL" video: "Video" videos: "Videos" @@ -1097,6 +1104,33 @@ expired: "Expired" doYouAgree: "Agree?" beSureToReadThisAsItIsImportant: "Please read this important information." iHaveReadXCarefullyAndAgree: "I have read the text \"{x}\" and agree." +dialog: "Dialog" +icon: "Icon" +forYou: "For you" +currentAnnouncements: "Current announcements" +pastAnnouncements: "Past announcements" +youHaveUnreadAnnouncements: "There are unread announcements." +useSecurityKey: "Please follow your browser's or device's instructions to use your security- or passkey." +replies: "Reply" +renotes: "Renotes" +loadReplies: "Show replies" +loadConversation: "Show conversation" +pinnedList: "Pinned list" +keepScreenOn: "Keep screen on" +verifiedLink: "Link ownership has been verified" +notifyNotes: "Notify about new notes" +unnotifyNotes: "Stop notifying about new notes" +authentication: "Authentication" +authenticationRequiredToContinue: "Please authenticate to continue" +_announcement: + forExistingUsers: "Existing users only" + forExistingUsersDescription: "This announcement will only be shown to users existing at the point of publishment if enabled. If disabled, those newly signing up after it has been posted will also see it." + needConfirmationToRead: "Require separate read confirmation" + needConfirmationToReadDescription: "A separate prompt to confirm marking this announcement as read will be displayed if enabled. This announcement will also be excluded from any \"Mark all as read\" functionality." + end: "Archive announcement" + tooManyActiveAnnouncementDescription: "Having too many active announcements may worsen the user experience. Please consider archiving announcements that have become obsolete." + readConfirmTitle: "Mark as read?" + readConfirmText: "This will mark the contents of \"{title}\" as read." _initialAccountSetting: accountCreated: "Your account was successfully created!" letsStartAccountSetup: "For starters, let's set up your profile." @@ -1114,6 +1148,15 @@ _initialAccountSetting: laterAreYouSure: "Really do profile setup later?" _serverRules: description: "A set of rules to be displayed before registration. Setting a summary of the Terms of Service is recommended." +_serverSettings: + iconUrl: "Icon URL" + appIconDescription: "Specifies the icon to use when {host} is displayed as an app." + appIconUsageExample: "E.g. As PWA, or when displayed as a home screen bookmark on a phone" + appIconStyleRecommendation: "As the icon may be cropped to a square or circle, an icon with colored margin around the content is recommended." + appIconResolutionMustBe: "The minimum resolution is {resolution}." + manifestJsonOverride: "manifest.json Override" + shortName: "Short name" + shortNameDescription: "A shorthand for the instance's name that can be displayed if the full official name is long." _accountMigration: moveFrom: "Migrate another account to this one" moveFromSub: "Create alias to another account" @@ -1368,6 +1411,9 @@ _achievements: title: "Brain Diver" description: "Post the link to Brain Diver" flavor: "Misskey-Misskey La-Tu-Ma" + _smashTestNotificationButton: + title: "Test overflow" + description: "Trigger the notification test repeatedly within an extremely short time" _role: new: "New role" edit: "Edit role" @@ -1494,6 +1540,7 @@ _plugin: install: "Install plugins" installWarn: "Please do not install untrustworthy plugins." manage: "Manage plugins" + viewSource: "View source" _preferencesBackups: list: "Created backups" saveNew: "Save new backup" @@ -1681,16 +1728,14 @@ _timelineTutorial: _2fa: alreadyRegistered: "You have already registered a 2-factor authentication device." registerTOTP: "Register authenticator app" - passwordToTOTP: "Enter your password" step1: "First, install an authentication app (such as {a} or {b}) on your device." step2: "Then, scan the QR code displayed on this screen." step2Click: "Clicking on this QR code will allow you to register 2FA to your security key or phone authenticator app." - step2Url: "You can also enter this URL if you're using a desktop program:" + step2Uri: "Enter the following URI if you are using a desktop program" step3Title: "Enter an authentication code" step3: "Enter the token provided by your app to finish setup." + setupCompleted: "Setup complete" step4: "From now on, any future login attempts will ask for such a login token.\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" - twoFactorBackupSecretWarning: "You have used some of your backup codes. If your authentication app is no longer available, please reconfigure your authentication app as soon as possible." - twoFactorBackupSecretExhausted: "You have exhausted all your backup codes. If your authentication app is no longer available, you will not be able to access your account anymore. please reconfigure your authentication app as soon as possible." securityKeyNotSupported: "Your browser does not support security keys." registerTOTPBeforeKey: "Please set up an authenticator app to register a security or pass key." securityKeyInfo: "Besides fingerprint or PIN authentication, you can also setup authentication via hardware security keys that support FIDO2 to further secure your account." @@ -1704,6 +1749,11 @@ _2fa: renewTOTPConfirm: "This will cause verification codes from your previous app and backup codes to stop working" renewTOTPOk: "Reconfigure" renewTOTPCancel: "Cancel" + checkBackupCodesBeforeCloseThisWizard: "Before you close this window, please note the following backup codes." + backupCodes: "Backup codes" + backupCodesDescription: "You can use these codes to gain access to your account in case of becoming unable to use your two-factor authentificator app. Each can only be used once. Please keep them in a safe place." + backupCodeUsedWarning: "A backup code has been used. Please reconfigure two-factor authentification as soon as possible if you are no longer able to use it." + backupCodesExhaustedWarning: "All backup codes have been used. Should you lose access to your two-factor authentification app, you will be unable to access this account. Please reconfigure two-factor authentification." _permissions: "read:account": "View your account information" "write:account": "Edit your account information" @@ -1725,10 +1775,10 @@ _permissions: "read:reactions": "View your reactions" "write:reactions": "Edit your reactions" "write:votes": "Vote on a poll" - "read:pages": "View your pages" - "write:pages": "Edit or delete your pages" - "read:page-likes": "View your likes on pages" - "write:page-likes": "Edit your likes on pages" + "read:pages": "View your Pages" + "write:pages": "Edit or delete your Pages" + "read:page-likes": "View list of liked Pages" + "write:page-likes": "Edit list of liked Pages" "read:user-groups": "View your user groups" "write:user-groups": "Edit or delete your user groups" "read:channels": "View your channels" @@ -1737,6 +1787,10 @@ _permissions: "write:gallery": "Edit your gallery" "read:gallery-likes": "View your list of liked gallery posts" "write:gallery-likes": "Edit your list of liked gallery posts" + "read:flash": "View Play" + "write:flash": "Edit Plays" + "read:flash-likes": "View list of liked Plays" + "write:flash-likes": "Edit list of liked Plays" _auth: shareAccessTitle: "Granting application permissions" shareAccess: "Would you like to authorize \"{name}\" to access this account?" @@ -1752,6 +1806,7 @@ _antennaSources: homeTimeline: "Notes from followed users" users: "Notes from specific users" userList: "Notes from a specified list of users" + userBlacklist: "All notes except for those of one or more specified users" _weekday: sunday: "Sunday" monday: "Monday" @@ -1851,6 +1906,7 @@ _profile: metadataContent: "Content" changeAvatar: "Change avatar" changeBanner: "Change banner" + verifiedLinkDescription: "By entering an URL that contains a link to your profile here, an ownership verification icon can be displayed next to the field." _exportOrImport: allNotes: "All notes" favoritedNotes: "Favorite notes" @@ -1970,11 +2026,17 @@ _notification: youReceivedFollowRequest: "You've received a follow request" yourFollowRequestAccepted: "Your follow request was accepted" pollEnded: "Poll results have become available" + newNote: "New note" unreadAntennaNote: "Antenna {name}" emptyPushNotificationMessage: "Push notifications have been updated" achievementEarned: "Achievement unlocked" + testNotification: "Test notification" + checkNotificationBehavior: "Check notification appearance" + sendTestNotification: "Send test notification" + notificationWillBeDisplayedLikeThis: "Notifications look like this" _types: all: "All" + note: "New notes" follow: "New followers" mention: "Mentions" reply: "Replies" @@ -2008,6 +2070,8 @@ _deck: introduction2: "Click on the + on the right of the screen to add new colums whenever you want." widgetsIntroduction: "Please select \"Edit widgets\" in the column menu and add a widget." useSimpleUiForNonRootPages: "Use simplified UI to navigated pages" + usedAsMinWidthWhenFlexible: "Minimum width will be used for this when the \"Auto-adjust width\" option is enabled" + flexible: "Auto-adjust width" _columns: main: "Main" widgets: "Widgets" @@ -2042,3 +2106,27 @@ _webhookSettings: renote: "When renoted" reaction: "When receiving a reaction" mention: "When being mentioned" +_moderationLogTypes: + assignRole: "Assigned to role" + unassignRole: "Removed from role" + updateRole: "Role updated" + suspend: "Suspended" + unsuspend: "Unsuspended" + addCustomEmoji: "Custom emoji added" + updateCustomEmoji: "Custom emoji updated" + deleteCustomEmoji: "Custom emoji deleted" + updateServerSettings: "Server settings updated" + updateUserNote: "Moderation note updated" + deleteDriveFile: "File deleted" + deleteNote: "Note deleted" + createGlobalAnnouncement: "Global announcement created" + createUserAnnouncement: "User announcement created" + updateGlobalAnnouncement: "Global announcement updated" + updateUserAnnouncement: "User announcement updated" + deleteGlobalAnnouncement: "Global announcement deleted" + deleteUserAnnouncement: "User announcement deleted" + resetPassword: "Password reset" + suspendRemoteInstance: "Remote instance suspended" + unsuspendRemoteInstance: "Remote instance unsuspended" + markSensitiveDriveFile: "File marked as sensitive" + unmarkSensitiveDriveFile: "File unmarked as sensitive" diff --git a/locales/es-ES.yml b/locales/es-ES.yml index 83c8732952..10c7b97c04 100644 --- a/locales/es-ES.yml +++ b/locales/es-ES.yml @@ -8,10 +8,10 @@ search: "Buscar" notifications: "Notificaciones" username: "Nombre de usuario" password: "Contraseña" -forgotPassword: "Olvidé mi Contraseña" +forgotPassword: "Olvidé mi contraseña" fetchingAsApObject: "Buscando en el fediverso" ok: "OK" -gotIt: "¡Lo tengo!" +gotIt: "Entendido" cancel: "Cancelar" noThankYou: "No gracias" enterUsername: "Introduce el nombre de usuario" @@ -20,8 +20,8 @@ noNotes: "No hay notas" noNotifications: "No hay notificaciones" instance: "Instancia" settings: "Configuración" -notificationSettings: "Configurar las notificaciones" -basicSettings: "Configuración Básica" +notificationSettings: "Ajustes de notificaciones" +basicSettings: "Configuración básica" otherSettings: "Configuración avanzada" openInWindow: "Abrir en una ventana" profile: "Perfil" @@ -45,6 +45,7 @@ pin: "Fijar al perfil" unpin: "Desfijar" copyContent: "Copiar contenido" copyLink: "Copiar enlace" +copyLinkRenote: "Copiar enlace de renota" delete: "Borrar" deleteAndEdit: "Borrar y editar" deleteAndEditConfirm: "¿Estás seguro de que quieres borrar esta nota y editarla? Perderás todas las reacciones, renotas y respuestas." @@ -55,8 +56,8 @@ copyRSS: "Copiar RSS" copyUsername: "Copiar nombre de usuario" copyUserId: "Copiar ID del usuario" copyNoteId: "Copiar ID de la nota" -copyFileId: "Copiar un archivo ID" -copyFolderId: "Copiar carpeta ID" +copyFileId: "Copiar ID del archivo" +copyFolderId: "Copiar ID de carpeta" copyProfileUrl: "Copiar la URL del perfil" searchUser: "Buscar un usuario" reply: "Responder" @@ -156,6 +157,7 @@ addEmoji: "Agregar emoji" settingGuide: "Configuración sugerida" cacheRemoteFiles: "Mantener en cache los archivos remotos" cacheRemoteFilesDescription: "Si desactiva esta configuración, Los archivos remotos se cargarán desde el link directo sin usar la caché. Con eso se puede ahorrar almacenamiento del servidor, pero eso aumentará el tráfico al no crear miniaturas." +youCanCleanRemoteFilesCache: "Puedes vaciar la caché pulsando en el botón 🗑️ en el administrador de archivos." cacheRemoteSensitiveFiles: "Cachear archivos remotos sensibles" cacheRemoteSensitiveFilesDescription: "Cuando esta opción está desactivada, los archivos remotos sensibles son cargador directamente de la instancia origen sin ser cacheados." flagAsBot: "Esta cuenta es un bot" @@ -354,7 +356,6 @@ invite: "Invitar" driveCapacityPerLocalAccount: "Capacidad del drive por usuario local" driveCapacityPerRemoteAccount: "Capacidad del drive por usuario remoto" inMb: "En megabytes" -iconUrl: "URL de la imagen del avatar" bannerUrl: "URL de la imagen del banner" backgroundImageUrl: "URL de la imagen de fondo" basicInfo: "Información básica" @@ -410,10 +411,13 @@ aboutMisskey: "Sobre Misskey" administrator: "Administrador" token: "Token" 2fa: "Autenticación de doble factor" +setupOf2fa: "Configurar la autenticación de dos factores" totp: "Aplicación autentícadora" totpDescription: "Ingresa una contaseña de un sólo uso usando la aplicación autenticadora" moderator: "Moderador" moderation: "Moderación" +moderationNote: "Nota de moderación" +addModerationNote: "Añadir nota de moderación" nUsersMentioned: "{n} usuarios mencionados" securityKeyAndPasskey: "Clave de seguridad / clave de paso" securityKey: "Clave de seguridad" @@ -653,6 +657,7 @@ behavior: "Comportamiento" sample: "Muestra" abuseReports: "Reportes" reportAbuse: "Reportar" +reportAbuseRenote: "Reportar renota" reportAbuseOf: "Reportar a {name}" fillAbuseReportDescription: "Ingrese los detalles del reporte. Si hay una nota en particular, ingrese la URL de esta." abuseReported: "Se ha enviado el reporte. Muchas gracias." @@ -680,6 +685,7 @@ createNewClip: "Crear clip nuevo" unclip: "Quitar clip" confirmToUnclipAlreadyClippedNote: "Esta nota ya está incluida en el clip \"{name}\". ¿Quiere quitar la nota del clip?" public: "Público" +private: "Privado" i18nInfo: "Misskey está siendo traducido a varios idiomas gracias a voluntarios. Se puede colaborar traduciendo en {link}" manageAccessTokens: "Administrar tokens de acceso" accountInfo: "Información de la Cuenta" @@ -1018,7 +1024,7 @@ retryAllQueuesConfirmText: "La carga del servidor está incrementándose tempora enableChartsForRemoteUser: "Generar gráficas de usuarios remotos." enableChartsForFederatedInstances: "Generar gráficos de servidores remotos" showClipButtonInNoteFooter: "Añadir \"Clip\" al menú de notas" -largeNoteReactions: "Agrandar las reacciones de las notas" +reactionsDisplaySize: "Tamaño de las reacciones" noteIdOrUrl: "ID o URL de la nota" video: "Video" videos: "Video" @@ -1094,6 +1100,24 @@ expired: "Caducada" doYouAgree: "¿Está de acuerdo?" beSureToReadThisAsItIsImportant: "Por favor lea esto que es importante" iHaveReadXCarefullyAndAgree: "He leído el texto {x} y estoy de acuerdo" +dialog: "Diálogo" +icon: "Avatar" +forYou: "Para ti" +currentAnnouncements: "Anuncios actuales" +pastAnnouncements: "Anuncios anteriores" +youHaveUnreadAnnouncements: "Hay anuncios sin leer" +useSecurityKey: "Por favor, sigue las instrucciones de tu dispositivo o navegador para usar tu clave de seguridad o tu clave de paso." +replies: "Responder" +renotes: "Renotar" +_announcement: + forExistingUsers: "Solo para usuarios registrados" + forExistingUsersDescription: "Este anuncio solo se mostrará a aquellos usuarios registrados en el momento de su publicación. Si se deshabilita esta opción, aquellos usuarios que se registren tras su publicación también lo verán." + needConfirmationToRead: "Requerir confirmación de lectura aparte" + needConfirmationToReadDescription: "Si se habilita esta opción, se pedirá una confirmación de lectura aparte. Además, este anuncio será excluido de cualquier funcionalidad de \"Marcar todos como leídos\"." + end: "Anuncios archivados" + tooManyActiveAnnouncementDescription: "Tener demasiados anuncios activos empeora la experiencia de usuario. Por favor, considera archivar aquellos anuncios que hayan quedado obsoletos." + readConfirmTitle: "¿Marcar como leído?" + readConfirmText: "Esto marcará el contenido de \"{title}\" como leído." _initialAccountSetting: accountCreated: "¡La cuenta ha sido creada!" letsStartAccountSetup: "Para empezar, creemos tu perfil." @@ -1111,6 +1135,9 @@ _initialAccountSetting: laterAreYouSure: "¿Realmente quieres configurar tu perfil después?" _serverRules: description: "Un conjunto de reglas que serán mostradas antes del registro. Configurar un sumario de términos de servicio es recomendado." +_serverSettings: + iconUrl: "URL del ícono" + manifestJsonOverride: "Sobreescribir manifest.json" _accountMigration: moveFrom: "Trasladar de otra cuenta a ésta" moveFromSub: "Crear un alias para otra cuenta." @@ -1365,6 +1392,9 @@ _achievements: title: "Brain Diver" description: "Publicaste un vínculo a \"Brain Diver\"" flavor: "Misskey-Misskey La-Tu-Ma" + _smashTestNotificationButton: + title: "Sobrecarga de pruebas" + description: "Envía muchas notificaciones de prueba en un corto espacio de tiempo" _role: new: "Crear rol" edit: "Editar rol" @@ -1488,6 +1518,7 @@ _plugin: install: "Instalar plugins" installWarn: "Por favor no instale plugins que no son de confianza" manage: "Gestionar plugins" + viewSource: "Ver la fuente" _preferencesBackups: list: "Respaldos creados" saveNew: "Guardar nuevo respaldo" @@ -1675,13 +1706,13 @@ _timelineTutorial: _2fa: alreadyRegistered: "Ya has completado la configuración." registerTOTP: "Registrar aplicación autenticadora" - passwordToTOTP: "Ingresa tu contraseña" step1: "Primero, instale en su dispositivo la aplicación de autenticación {a} o {b} u otra." step2: "Luego, escanee con la aplicación el código QR mostrado en pantalla." step2Click: "Clicking on this QR code will allow you to register 2FA to your security key or phone authenticator app.\nTocar este código QR te permitirá registrar la autenticación 2FA a tu llave de seguridad o aplicación autenticadora." - step2Url: "En una aplicación de escritorio se puede ingresar la siguiente URL:" + step2Uri: "Si usas una aplicación de escritorio, introduce en ella la siguiente URL." step3Title: "Ingresa un código de autenticación" step3: "Para terminar, ingrese el token mostrado en la aplicación." + setupCompleted: "Configuración completada" step4: "Ahora cuando inicie sesión, ingrese el mismo token\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" securityKeyNotSupported: "Tu navegador no soporta claves de autenticación." registerTOTPBeforeKey: "Please set up an authenticator app to register a security or pass key.\npor favor. configura una aplicación de autenticación para registrar una llave de seguridad." @@ -1696,6 +1727,11 @@ _2fa: renewTOTPConfirm: "This will cause verification codes from your previous app to stop working\nEsto hará que los códigos de verificación de la aplicación anterior dejen de funcionar" renewTOTPOk: "Reconfigurar" renewTOTPCancel: "No gracias" + checkBackupCodesBeforeCloseThisWizard: "Por favor, copia los siguientes códigos de respaldo antes de finalizar el asistente." + backupCodes: "Códigos de Respaldo" + backupCodesDescription: "En caso de que no puedas usar tu aplicación de autenticación, podrás usar los códigos de respaldo que figuran abajo para acceder a tu cuenta. Asegúrate de guardar en lugar seguro los códigos de respaldo. Cada uno de los códigos de respaldo es de un solo uso." + backupCodeUsedWarning: "Has usado todos los códigos de respaldo. Si dejas de tener acceso a tu aplicación de autenticación, no podrás volver a iniciar sesión en tu cuenta. Por favor, reconfigura tu aplicación de autenticación lo antes posible." + backupCodesExhaustedWarning: "Has usado todos los códigos de respaldo. Si dejas de tener acceso a tu aplicación de autenticación, no podrás volver a iniciar sesión en la cuenta que figura arriba. Por favor, reconfigura tu aplicación de autenticación lo antes posible." _permissions: "read:account": "Ver información de la cuenta" "write:account": "Editar información de la cuenta" @@ -1729,6 +1765,10 @@ _permissions: "write:gallery": "Editar galería" "read:gallery-likes": "Ver favoritos de la galería" "write:gallery-likes": "Editar favoritos de la galería" + "read:flash": "Ver Play" + "write:flash": "Editar Plays" + "read:flash-likes": "Ver los Play que me gustan" + "write:flash-likes": "Editar lista de Play que me gustan" _auth: shareAccessTitle: "Permisos de la aplicación" shareAccess: "¿Desea permitir el acceso a la cuenta \"{name}\"?" @@ -1964,6 +2004,10 @@ _notification: unreadAntennaNote: "Antena {name}" emptyPushNotificationMessage: "Se han actualizado las notificaciones push" achievementEarned: "Logro desbloqueado" + testNotification: "Notificación de prueba" + checkNotificationBehavior: "Comprobar comportamiento de la notificación" + sendTestNotification: "Enviar notificación de prueba" + notificationWillBeDisplayedLikeThis: "Las notificaciones tendrán este aspecto" _types: all: "Todo" follow: "Siguiendo" @@ -1999,6 +2043,8 @@ _deck: introduction2: "Presiona en la + de la derecha de la pantalla para añadir nuevas columnas donde quieras." widgetsIntroduction: "Por favor selecciona \"Editar Widgets\" en el menú columna y agrega un widget." useSimpleUiForNonRootPages: "Mostrar páginas no pertenecientes a la raíz con la interfaz simple" + usedAsMinWidthWhenFlexible: "Se usará el ancho mínimo cuando la opción \"Autoajustar ancho\" esté habilitada" + flexible: "Autoajustar ancho" _columns: main: "Principal" widgets: "Widgets" @@ -2033,3 +2079,6 @@ _webhookSettings: renote: "Cuando reciba un \"re-note\"" reaction: "Cuando se recibe una reacción" mention: "Cuando hay una mención" +_moderationLogTypes: + suspend: "Suspender" + resetPassword: "Resetear contraseña" diff --git a/locales/fr-FR.yml b/locales/fr-FR.yml index f53613948e..0352f11103 100644 --- a/locales/fr-FR.yml +++ b/locales/fr-FR.yml @@ -47,7 +47,7 @@ copyContent: "Copier le contenu" copyLink: "Copier le lien" delete: "Supprimer" deleteAndEdit: "Supprimer et réécrire" -deleteAndEditConfirm: "Êtes-vous sûr·e de vouloir supprimer cette note et la reformuler ? Vous perdrez toutes les réactions, renotes et réponses y afférentes." +deleteAndEditConfirm: "Êtes-vous sûr de vouloir effacer cette note et la modifier ? Vous perdrez toutes les réactions, renotes et réponses." addToList: "Ajouter à une liste" addToAntenna: "Ajouter à l’antenne" sendMessage: "Envoyer un message" @@ -58,7 +58,7 @@ copyNoteId: "Copier l'identifiant de la note" copyFileId: "Copier l'identifiant du fichier" copyFolderId: "Copier l'identifiant du dossier" copyProfileUrl: "Copier l'URL du profil" -searchUser: "Chercher un utilisateur" +searchUser: "Chercher un·e utilisateur·rice" reply: "Répondre" loadMore: "Afficher plus …" showMore: "Voir plus" @@ -76,14 +76,14 @@ files: "Fichiers" download: "Télécharger" driveFileDeleteConfirm: "Êtes-vous sûr de vouloir supprimer le fichier \"{name}\" ? Les notes liées à ce fichier seront aussi supprimées." unfollowConfirm: "Désirez-vous vous désabonner de {name} ?" -exportRequested: "Vous avez demandé une exportation. L’opération pourrait prendre un peu de temps. Une terminée, le fichier résultant sera ajouté au Drive." +exportRequested: "Vous avez demandé une exportation. L’opération pourrait prendre un peu de temps. Une fois terminée, le fichier sera ajouté au Drive." importRequested: "Vous avez initié un import. Cela pourrait prendre un peu de temps." lists: "Listes" noLists: "Vous n’avez aucune liste" note: "Note" notes: "Notes" following: "Abonnements" -followers: "Abonnés" +followers: "Abonné·e·s" followsYou: "Vous suit" createList: "Créer une liste" manageLists: "Gérer les listes" @@ -138,6 +138,7 @@ unblockConfirm: "Êtes-vous sûr·e de vouloir débloquer ce compte ?" suspendConfirm: "Êtes-vous sûr·e de vouloir suspendre ce compte ?" unsuspendConfirm: "Êtes-vous sûr·e de vouloir annuler la suspension de ce compte ?" selectList: "Sélectionner une liste" +editList: "Modifier la liste" selectChannel: "Sélectionner un canal" selectAntenna: "Sélectionner une antenne" editAntenna: "Modifier l'antenne" @@ -250,7 +251,7 @@ announcements: "Annonces" imageUrl: "URL de l’image" remove: "Supprimer" removed: "Supprimé" -removeAreYouSure: "Êtes-vous sûr·e de vouloir supprimer「{x}」?" +removeAreYouSure: "Êtes-vous sûr·e de vouloir supprimer « {x} » ?" deleteAreYouSure: "Êtes-vous sûr·e de vouloir supprimer「{x}」?" resetAreYouSure: "Voulez-vous réinitialiser ?" saved: "Enregistré" @@ -271,6 +272,8 @@ startMessaging: "Commencer à discuter" nUsersRead: "Lu par {n} personnes" agreeTo: "J’accepte {0}" agree: "Accepter" +agreeBelow: "J’accepte ce qui suit" +basicNotesBeforeCreateAccount: "Notes importantes" termsOfService: "Conditions d'utilisation" start: "Commencer" home: "Principal" @@ -349,7 +352,6 @@ invite: "Inviter" driveCapacityPerLocalAccount: "Volume du Drive par utilisateur local" driveCapacityPerRemoteAccount: "Volume du Drive par utilisateur distant" inMb: "en mégaoctets" -iconUrl: "URL de l'icône" bannerUrl: "URL de l’image de la bannière" backgroundImageUrl: "URL de l'image d'arrière-plan" basicInfo: "Informations basiques" @@ -405,11 +407,15 @@ aboutMisskey: "À propos de Misskey" administrator: "Administrateur" token: "Jeton" 2fa: "Authentification à deux facteurs" +setupOf2fa: "Configuration de l’authentification à deux facteurs" totp: "Application d'authentification" totpDescription: "Entrez un mot de passe à usage unique à l'aide d'une application d'authentification" moderator: "Modérateur·rice·s" moderation: "Modérations" +moderationNote: "Note de modération" +addModerationNote: "Ajouter une note de modération" nUsersMentioned: "{n} utilisateur·rice·s mentionné·e·s" +securityKeyAndPasskey: "Sécurité et clés de sécurité" securityKey: "Clé de sécurité" lastUsed: "Dernier utilisé" lastUsedAt: "Dernière utilisation : {t}" @@ -477,6 +483,7 @@ createAccount: "Créer un compte" existingAccount: "Compte existant" regenerate: "Générer à nouveau" fontSize: "Taille de la police" +limitTo: "Limiter à {x}" noFollowRequests: "Vous n’avez aucune demande d’abonnement en attente" openImageInNewTab: "Ouvrir les images dans un nouvel onglet" dashboard: "Tableau de bord" @@ -598,7 +605,7 @@ tokenRequested: "Autoriser l'accès au compte" pluginTokenRequestedDescription: "Ce plugin pourra utiliser les autorisations définies ici." notificationType: "Type de notifications" edit: "Editer" -emailServer: "Serveur mail" +emailServer: "Serveur de messagerie" enableEmail: "Activer la distribution de courriel" emailConfigInfo: "Utilisé pour confirmer votre adresse de courriel et la réinitialisation de votre mot de passe en cas d’oubli." email: "E-mail " @@ -665,6 +672,7 @@ createNew: "Créer nouveau" optional: "Facultatif" createNewClip: "Créer un nouveau clip" public: "Public" +private: "Privé" i18nInfo: "Misskey est traduit dans différentes langues par des bénévoles. Vous pouvez contribuer à {link}." manageAccessTokens: "Gérer les jetons d'accès" accountInfo: " Informations du compte " @@ -792,6 +800,7 @@ popularPosts: "Les plus consultées" shareWithNote: "Partager dans une note" ads: "Publicité" expiration: "Échéance" +startingperiod: "Commencer" memo: "Pense-bête" priority: "Priorité" high: "Haute" @@ -818,6 +827,7 @@ translatedFrom: "Traduit depuis {x}" accountDeletionInProgress: "La suppression de votre compte est en cours" usernameInfo: "C'est un nom qui identifie votre compte sur l'instance de manière unique. Vous pouvez utiliser des lettres de l'alphabet (minuscules et majuscules), des chiffres (de 0 à 9), ou bien le tiret « _ ». Vous ne pourrez pas modifier votre nom d'utilisateur·rice par la suite." aiChanMode: "Mode Ai" +devMode: "Mode développement" keepCw: "Garder le CW" pubSub: "Comptes Pub/Sub" lastCommunication: "Dernière communication" @@ -827,10 +837,12 @@ breakFollow: "Ne plus suivre" breakFollowConfirm: "Êtes-vous sûr de vouloir vous désabonner ?" itsOn: "Activé" itsOff: "Désactivé" +on: "Activé" +off: "Désactivé" emailRequiredForSignup: "Une adresse e-mail est nécessaire pour créer un compte" unread: "Non lu" filter: "Filtre" -controlPanel: "Panneau de contrôle" +controlPanel: "Panneau de configuration" manageAccounts: "Gérer les comptes" makeReactionsPublic: "Rendre les réactions publiques" makeReactionsPublicDescription: "Ceci rendra la liste de toutes vos réactions données publique." @@ -935,20 +947,32 @@ roles: "Rôles" role: "Rôles" noRole: "Aucun rôle" normalUser: "Simple utilisateur·rice" +undefined: "Non défini" assign: "Attribuer" color: "Couleur" manageCustomEmojis: "Gestion des émojis personnalisés" preset: "Préréglage" selectFromPresets: "Sélectionner à partir des préréglages" +achievements: "Accomplissements" thisPostMayBeAnnoying: "Cette note peut gêner d'autres personnes." +thisPostMayBeAnnoyingHome: "Publier vers le fil principal" thisPostMayBeAnnoyingCancel: "Annuler" +thisPostMayBeAnnoyingIgnore: "Publier quand-même" +internalServerError: "Erreur interne du serveur" +copyErrorInfo: "Copier les détails de l’erreur" +exploreOtherServers: "Trouver une autre instance" +disableFederationOk: "Désactiver" +likeOnly: "Les favoris uniquement" license: "Licence" video: "Vidéo" videos: "Vidéos" dataSaver: "Économiseur de données" accountMigration: "Migration de compte" accountMoved: "Cet·te utilisateur·rice a migré son compte vers :" +accountMovedShort: "Ce compte a migré" +operationForbidden: "Opération non autorisée" addMemo: "Ajouter un mémo" +reactionsList: "Réactions" notificationDisplay: "Style des notifications" leftTop: "En haut à gauche" rightTop: "En haut à droite" @@ -957,12 +981,50 @@ rightBottom: "En bas à droite" vertical: "Vertical" horizontal: "Latéral" serverRules: "Règles du serveur" +archive: "Archive" youFollowing: "Abonné·e" +options: "Options" +later: "Plus tard" +goToMisskey: "Retour vers Misskey" +expirationDate: "Date d’expiration" +usedAt: "Utilisé le" +unused: "Non-utilisé" +used: "Utilisé" +expired: "Expiré" +doYouAgree: "Êtes-vous d’accord ?" +icon: "Avatar" +forYou: "Pour vous" +replies: "Répondre" +renotes: "Renoter" +loadReplies: "Inclure les réponses" +pinnedList: "Liste épinglée" +notifyNotes: "Notifier à propos des nouvelles notes" +authentication: "Authentification" +authenticationRequiredToContinue: "Veuillez vous authentifier pour continuer" +_announcement: + readConfirmTitle: "Marquer comme lu ?" +_initialAccountSetting: + profileSetting: "Paramètres du profil" + privacySetting: "Paramètres de confidentialité" + initialAccountSettingCompleted: "Configuration du profil terminée avec succès !" + ifYouNeedLearnMore: "Si vous voulez en savoir plus comment utiliser {name}(Misskey), veuillez visiter {link}." + skipAreYouSure: "Désirez-vous ignorer la configuration du profile ?" +_serverSettings: + iconUrl: "URL de l’icône" +_accountMigration: + moveFrom: "Migrer un autre compte vers le présent compte" + moveFromSub: "Créer un alias vers un autre compte" + moveToLabel: "Compte vers lequel vous migrez :" + startMigration: "Migrer" + movedTo: "Compte vers lequel vous migrez :" _achievements: _types: _notes1: + title: "Je viens tout juste de configurer mon msky" description: "Publiez votre première note" flavor: "Passez un bon moment avec Misskey !" + _notes10: + title: "Quelques notes" _notes100: title: "Beaucoup de notes" _notes100000: @@ -977,16 +1039,23 @@ _achievements: title: "Débutant Ⅲ" description: "Se connecter pour un total de 15 jours" _login30: + title: "Misskeynaute I" description: "Se connecter pour un total de 30 jours" _login60: + title: "Misskeynaute II" description: "Se connecter pour un total de 60 jours" _login100: + title: "Misskeynaute III" description: "Se connecter pour un total de 100 jours" + flavor: "Misskeynaute acharné·e" _login200: + title: "Régulier I" description: "Se connecter pour un total de 200 jours" _login300: + title: "Régulier II" description: "Se connecter pour un total de 300 jours" _login400: + title: "Régulier III" description: "Se connecter pour un total de 400 jours" _login500: description: "Se connecter pour un total de 500 jours" @@ -1000,25 +1069,81 @@ _achievements: description: "Se connecter pour un total de 900 jours" _login1000: flavor: "Merci d'utiliser Misskey !" + _profileFilled: + title: "Bien préparé" + description: "Configuration de votre profil" _markedAsCat: title: "Je suis un chat" + description: "Rendre votre compte comme un chat" flavor: "Je n'ai pas encore de nom" + _following1: + title: "Vous suivez votre premier utilisateur·rice" _following50: title: "Beaucoup d'amis" _followers10: title: "Abonnez-moi !" + _followers100: + title: "Populaire" + _followers500: + title: "Tour radio" + _followers1000: + title: "Influenceur·euse" _iLoveMisskey: title: "J’adore Misskey" + description: "Publication « J’❤ #Misskey »" + flavor: "L'équipe de développement de Misskey apprécie vraiment votre aide !" + _foundTreasure: + title: "Chasse au trésor" + description: "Vous avez trouvé le trésor caché" + _client30min: + title: "Pause bien méritée" + _postedAtLateNight: + flavor: "C’est l’heure d’aller au lit." + _postedAt0min0sec: + title: "Horloge parlante" + description: "Publication d’une note à 00:00" + flavor: "Tic tac, tic tac, tic tac, ding !" _viewInstanceChart: title: "Analyste" + _outputHelloWorldOnScratchpad: + title: "Bonjour tout le monde !" + _open3windows: + title: "Multi-fenêtres" + _driveFolderCircularReference: + title: "Référence circulaire" + _setNameToSyuilo: + description: "Vous avez spécifié « syuilo » comme nom" + _passedSinceAccountCreated1: + title: "Premier anniversaire" + _passedSinceAccountCreated2: + title: "Second anniversaire" + _passedSinceAccountCreated3: + title: "3ème anniversaire" _loggedInOnBirthday: title: "Joyeux Anniversaire !" + description: "Vous vous êtes connecté à la date de votre anniversaire" _loggedInOnNewYearsDay: title: "Bonne année !" _cookieClicked: flavor: "Attendez une minute, vous êtes sur le mauvais site web ?" + _brainDiver: + flavor: "Misskey-Misskey La-Tu-Ma" _role: + new: "Nouveau rôle" + edit: "Modifier le rôle" + name: "Nom du rôle" + description: "Description du rôle" + permission: "Rôle et autorisations" assignTarget: "Attribuer" + condition: "Condition" + isPublic: "Rôle public" + options: "Options" + policies: "Stratégies" + baseRole: "Modèle de rôle" + useBaseValue: "Utiliser la valeur du modèle de rôle" + chooseRoleToAssign: "Sélectionner le rôle à assigner" + iconUrl: "URL de l’icône" + displayOrder: "Classement" priority: "Priorité" _priority: low: "Basse" @@ -1077,6 +1202,7 @@ _plugin: install: "Installation de plugin" installWarn: "N’installez que des extensions provenant de sources de confiance." manage: "Gestion des plugins" + viewSource: "Afficher la source" _preferencesBackups: list: "Sauvegardes créées" saveNew: "Nouvelle sauvegarde" @@ -1110,6 +1236,8 @@ _aboutMisskey: donate: "Soutenir Misskey" morePatrons: "Nous apprécions vraiment le soutien de nombreuses autres personnes non mentionnées ici. Merci à toutes et à tous ! 🥰" patrons: "Contributeurs" +_displayOfSensitiveMedia: + force: "Masquer tous les médias" _instanceTicker: none: "Cacher " remote: "Montrer pour les utilisateur·ice·s distant·e·s" @@ -1128,6 +1256,8 @@ _channel: following: "Abonné·e" usersCount: "{n} Participant·e·s" notesCount: "{n} Notes" + nameAndDescription: "Nom et description" + nameOnly: "Nom seulement" _menuDisplay: sideFull: "Latéral" sideIcon: "Latéral (icônes)" @@ -1245,16 +1375,25 @@ _time: minute: "min" hour: "h" day: "j" +_timelineTutorial: + title: "Comment utiliser Misskey" + step3_1: "Avez-vous publié votre première note ?" _2fa: alreadyRegistered: "Configuration déjà achevée." step1: "Tout d'abord, installez une application d'authentification, telle que {a} ou {b}, sur votre appareil." step2: "Ensuite, scannez le code QR affiché sur l’écran." - step2Url: "Vous pouvez également saisir cette URL si vous utilisez un programme de bureau :" + step3Title: "Veuillez saisir le code d’authentification" step3: "Entrez le jeton affiché sur votre application pour compléter la configuration." + setupCompleted: "Configuration terminée avec succès !" step4: "À partir de maintenant, ce même jeton vous sera demandé à chacune de vos connexions.\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" + securityKeyNotSupported: "Votre navigateur ne prend pas en charge les clés de sécurité." securityKeyInfo: "Vous pouvez configurer l'authentification WebAuthN pour sécuriser davantage le processus de connexion grâce à une clé de sécurité matérielle qui prend en charge FIDO2, ou bien en configurant l'authentification par empreinte digitale ou par code PIN sur votre appareil." + securityKeyName: "Nom de la clé" + removeKey: "Supprimer la clé de sécurité" removeKeyConfirm: "Voulez-vous supprimer {name} ?" + renewTOTPOk: "Reconfigurer" renewTOTPCancel: "Pas maintenant" + backupCodes: "Codes de Secours" _permissions: "read:account": "Afficher les informations du compte" "write:account": "Mettre à jour les informations de votre compte" @@ -1471,7 +1610,7 @@ _pages: fontSerif: "Serif" fontSansSerif: "Sans Serif" eyeCatchingImageSet: "Définir une image attractive" - eyeCatchingImageRemove: "Supprimer l'image attractive" + eyeCatchingImageRemove: "Supprimer la miniature" chooseBlock: "Ajouter un bloc" selectType: "Choisir un type" contentBlocks: "Contenu" @@ -1504,6 +1643,7 @@ _notification: pollEnded: "Les résultats du sondage sont disponibles" unreadAntennaNote: "Antenne {name}" emptyPushNotificationMessage: "Les notifications push ont été mises à jour" + achievementEarned: "Accomplissement" _types: all: "Toutes" follow: "Nouvel·le abonné·e" @@ -1515,6 +1655,7 @@ _notification: pollEnded: "Sondages se cloturant" receiveFollowRequest: "Demande d'abonnement reçue" followRequestAccepted: "Demande d'abonnement acceptée" + achievementEarned: "Accomplissement" app: "Notifications provenant des apps" _actions: followBack: "Suivre" @@ -1536,6 +1677,7 @@ _deck: deleteProfile: "Supprimer le profil" introduction: "Créez l’interface parfaite qui vous sied en arrangeant librement les colonnes !" introduction2: "Cliquez sur le + à droite de l'écran pour ajouter de nouvelles colonnes quand vous le souhaitez." + flexible: "Ajuster automatiquement la largeur" _columns: main: "Principale" widgets: "Widgets" @@ -1549,3 +1691,6 @@ _deck: _webhookSettings: name: "Nom" active: "Activé" +_moderationLogTypes: + suspend: "Suspendre" + resetPassword: "Réinitialiser le mot de passe" diff --git a/locales/generateDTS.js b/locales/generateDTS.js index 7369dfbb47..7af773f3b1 100644 --- a/locales/generateDTS.js +++ b/locales/generateDTS.js @@ -1,6 +1,11 @@ import * as fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import { dirname } from 'node:path'; import * as yaml from 'js-yaml'; -import * as ts from 'typescript'; +import ts from 'typescript'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); function createMembers(record) { return Object.entries(record) diff --git a/locales/hu-HU.yml b/locales/hu-HU.yml index fdab9645c1..023a91494d 100644 --- a/locales/hu-HU.yml +++ b/locales/hu-HU.yml @@ -77,6 +77,7 @@ smtpUser: "Felhasználónév" smtpPass: "Jelszó" user: "Felhasználók" searchByGoogle: "Keresés" +renotes: "Renote" _theme: keys: renote: "Renote" diff --git a/locales/id-ID.yml b/locales/id-ID.yml index c72538a1a3..495e534e2b 100644 --- a/locales/id-ID.yml +++ b/locales/id-ID.yml @@ -133,12 +133,12 @@ renoteMute: "Matikan renote" renoteUnmute: "Batal mematikan renote" block: "Blokir" unblock: "Buka blokir" -suspend: "Bekukan" -unsuspend: "Buka pembekuan" +suspend: "Tangguhkan" +unsuspend: "Batalkan penangguhan" blockConfirm: "Apakah kamu yakin ingin memblokir akun ini?" unblockConfirm: "Apakah kamu yakin ingin membuka blokir akun ini?" -suspendConfirm: "Apakah kamu yakin ingin membekukan akun ini?" -unsuspendConfirm: "Apakah kamu yakin ingin membuka pembekuan akun ini?" +suspendConfirm: "Apakah kamu yakin ingin menangguhkan akun ini?" +unsuspendConfirm: "Apakah kamu yakin ingin membatalkan penangguhan akun ini?" selectList: "Pilih daftar" editList: "Sunting daftar" selectChannel: "Pilih kanal" @@ -156,6 +156,8 @@ addEmoji: "Tambahkan emoji" settingGuide: "Pengaturan rekomendasi" cacheRemoteFiles: "Tembolokkan berkas dari instansi luar" cacheRemoteFilesDescription: "Ketika pengaturan ini dinonaktifkan, berkas dari instansi luar akan dimuat langsung. Menonaktifkan ini akan mengurangi penggunaan penyimpanan peladen, namun dapat menyebabkan peningkatan lalu lintas bandwidth, karena keluku tidak dihasilkan." +cacheRemoteSensitiveFiles: "Tembolokkan berkas dari instansi luar" +cacheRemoteSensitiveFilesDescription: "Menonaktifkan pengaturan ini menyebabkan berkas sensitif dari instansi luar ditautkan secara langsung, bukan ditembolok." flagAsBot: "Atur akun ini sebagai Bot" flagAsBotDescription: "Jika akun ini dikendalikan oleh program, tetapkanlah opsi ini. Jika diaktifkan, ini akan berfungsi sebagai tanda bagi pengembang lain untuk mencegah interaksi berantai dengan bot lain dan menyesuaikan sistem internal Misskey untuk memperlakukan akun ini sebagai bot." flagAsCat: "Atur akun ini sebagai kucing" @@ -227,7 +229,7 @@ noCustomEmojis: "Tidak ada emoji kustom" noJobs: "Tidak ada kerja" federating: "memfederasi" blocked: "Diblokir" -suspended: "Diberhentikan" +suspended: "Ditangguhkan" all: "Semua" subscribing: "Berlangganan" publishing: "Sedang menyiarkan langsung" @@ -352,7 +354,6 @@ invite: "Undang" driveCapacityPerLocalAccount: "Kapasitas drive per pengguna lokal" driveCapacityPerRemoteAccount: "Kapasitas drive per pengguna remote" inMb: "dalam Megabytes" -iconUrl: "URL Gambar ikon" bannerUrl: "URL Banner" backgroundImageUrl: "URL Gambar latar" basicInfo: "Informasi Umum" @@ -391,10 +392,10 @@ withReplies: "Termasuk balasan" connectedTo: "Akun berikut terhubung" notesAndReplies: "Catatan dan balasan" withFiles: "Media" -silence: "Bungkam" -silenceConfirm: "Apakah kamu yakin ingin membungkam pengguna ini?" -unsilence: "Hapus bungkam" -unsilenceConfirm: "Apakah kamu ingin untuk batal membungkam pengguna ini?" +silence: "Senyapkan" +silenceConfirm: "Apakah kamu yakin ingin menyenyapkan pengguna ini?" +unsilence: "Batalkan senyap" +unsilenceConfirm: "Apakah kamu ingin untuk batal menyenyapkan pengguna ini?" popularUsers: "Pengguna populer" recentlyUpdatedUsers: "Pengguna dengan aktivitas terkini" recentlyRegisteredUsers: "Pengguna baru saja bergabung" @@ -557,10 +558,10 @@ deleteAllFiles: "Hapus semua berkas" deleteAllFilesConfirm: "Apakah kamu yakin ingin menghapus semua berkas?" removeAllFollowing: "Batalkan mengikuti semua pengguna" removeAllFollowingDescription: "Batal mengikuti semua akun dari {host}. Mohon jalankan ini ketika instansi sudah tidak ada lagi." -userSuspended: "Pengguna ini telah dibekukan." -userSilenced: "Pengguna ini telah dibungkam." -yourAccountSuspendedTitle: "Akun ini dibekukan" -yourAccountSuspendedDescription: "Akun ini dibekukan karena melanggar ketentuan penggunaan layanan peladen atau semacamnya. Hubungi admin apabila ingin tahu alasan lebih lanjut. Mohon untuk tidak membuat akun baru." +userSuspended: "Pengguna ini telah ditangguhkan" +userSilenced: "Pengguna ini telah disenyapkan." +yourAccountSuspendedTitle: "Akun ini ditangguhkan" +yourAccountSuspendedDescription: "Akun ini ditangguhkan karena melanggar ketentuan penggunaan layanan peladen atau semacamnya. Hubungi admin apabila ingin mengetahui alasan lebih lanjut. Mohon untuk tidak membuat akun baru." tokenRevoked: "Token tidak valid" tokenRevokedDescription: "Token ini telah kedaluwarsa. Mohon masuk lagi." accountDeleted: "Akun telah dihapus" @@ -678,6 +679,7 @@ createNewClip: "Buat klip baru" unclip: "Batalkan klip" confirmToUnclipAlreadyClippedNote: "Catatan ini sudah disertakan di klip \"{name}\". Yakin ingin membatalkan catatan dari klip ini?" public: "Publik" +private: "Tersembunyi" i18nInfo: "Misskey diterjemahkan ke dalam banyak bahasa oleh sukarelawan. Kamu juga dapat ikut membantu menerjemahkannya di {link}." manageAccessTokens: "Kelola token akses" accountInfo: "Informasi akun" @@ -987,7 +989,7 @@ internalServerErrorDescription: "Peladen sedang mengalami galat tak terduga" copyErrorInfo: "Salin detil galat" joinThisServer: "Gabung peladen ini" exploreOtherServers: "Cari peladen lain" -letsLookAtTimeline: "LIhat timeline" +letsLookAtTimeline: "LIhat lini masa" disableFederationConfirm: "Matikan federasi?" disableFederationConfirmWarn: "Mematikan federasi tidak membuat kiriman menjadi privat. Umumnya, mematikan federasi tidak diperlukan." disableFederationOk: "Matikan federasi" @@ -1016,7 +1018,6 @@ retryAllQueuesConfirmText: "Hal ini akan meningkatkan beban sementara ke peladen enableChartsForRemoteUser: "Buat bagan data pengguna instansi luar" enableChartsForFederatedInstances: "Buat bagan data peladen instansi luar" showClipButtonInNoteFooter: "Tambahkan \"Klip\" ke menu aksi catatan" -largeNoteReactions: "Besarkan reaksi yang ditampilkan" noteIdOrUrl: "ID catatan atau URL" video: "Video" videos: "Video" @@ -1073,9 +1074,32 @@ enableServerMachineStats: "Tampilkan informasi mesin peladen menjadi publik" enableIdenticonGeneration: "Nyalakan pembuatan Identicon per pengguna" turnOffToImprovePerformance: "Matikan untuk tingkatkan performa." createInviteCode: "Buat kode undangan" +createWithOptions: "Buat dengan opsi" +createCount: "Jumlah undangan" inviteCodeCreated: "Kode undangan dibuat" inviteLimitExceeded: "Kamu telah mencapai jumlah maksimum kode undangan yang dapat dibuat." +createLimitRemaining: "Kode undangan yang dapat dibuat: tersisa {limit}" +inviteLimitResetCycle: "Kamu dapat membuat hingga {limit} kode undangan dalam {time}." expirationDate: "Tanggal kedaluwarsa" +noExpirationDate: "tidak ada tanggal kedaluwarsa" +inviteCodeUsedAt: "Kode undangan digunakan pada" +registeredUserUsingInviteCode: "Undangan digunakan oleh" +waitingForMailAuth: "Menunggu verifikasi surel" +inviteCodeCreator: "Undangan dibuat oleh" +usedAt: "Digunakan pada" +unused: "Tidak digunakan" +used: "Digunakan" +expired: "Kedaluwarsa" +doYouAgree: "Apa kamu setuju?" +beSureToReadThisAsItIsImportant: "Mohon baca informasi penting berikut." +iHaveReadXCarefullyAndAgree: "Saya telah membaca \"{x}\" dan menyetujui." +dialog: "Dialog" +icon: "Avatar" +forYou: "Untuk Anda" +currentAnnouncements: "Pengumuman Saat Ini" +pastAnnouncements: "Pengumuman Terdahulu" +replies: "Balas" +renotes: "Renote" _initialAccountSetting: accountCreated: "Akun kamu telah sukses dibuat!" letsStartAccountSetup: "Untuk pemula, ayo atur profilmu dulu." @@ -1093,6 +1117,8 @@ _initialAccountSetting: laterAreYouSure: "Yakin banget untuk atur profil nanti?" _serverRules: description: "Daftar peraturan akan ditampilkan sebelum pendaftaran. Mengatur ringkasan dari Syarat dan Ketentuan sangat direkomendasikan." +_serverSettings: + iconUrl: "URL ikon" _accountMigration: moveFrom: "Pindahkan akun lain ke akun ini" moveFromSub: "Buat alias ke akun lain" @@ -1386,6 +1412,9 @@ _role: ltlAvailable: "Dapat melihat lini masa lokal" canPublicNote: "Dapat mengirim catatan publik" canInvite: "Dapat membuat kode undangan instansi" + inviteLimit: "Batas jumlah undangan" + inviteLimitCycle: "Interval Penerbitan Kode Undangan" + inviteExpirationTime: "Interval kedaluwarsa undangan" canManageCustomEmojis: "Dapat mengelola Emoji kustom" driveCapacity: "Kapasitas Drive" alwaysMarkNsfw: "Selalu tandai berkas sebagai NSFW" @@ -1448,6 +1477,7 @@ _ad: back: "Kembali" reduceFrequencyOfThisAd: "Tampilkan iklan ini lebih sedikit" hide: "Jangan tampilkan" + timezoneinfo: "Hari dalam satu minggu ditentukan dari zona waktu peladen." _forgotPassword: enterEmail: "Masukkan alamat surel yang kamu gunakan pada saat mendaftar. Sebuah tautan untuk mengatur ulang kata sandi kamu akan dikirimkan ke alamat surel tersebut." ifNoEmail: "Apabila kamu tidak menggunakan surel pada saat pendaftaran, mohon hubungi admin segera." @@ -1466,6 +1496,7 @@ _plugin: install: "Memasang plugin" installWarn: "Mohon jangan memasang plugin yang tidak dapat dipercayai." manage: "Manajemen plugin" + viewSource: "Lihat sumber" _preferencesBackups: list: "Cadangan yang dibuat" saveNew: "Simpan cadangan baru" @@ -1499,6 +1530,10 @@ _aboutMisskey: donate: "Donasi ke Misskey" morePatrons: "Kami sangat mengapresiasi dukungan dari banyak penolong lain yang tidak tercantum disini. Terima kasih! 🥰" patrons: "Pendukung" +_displayOfSensitiveMedia: + respect: "Sembunyikan media yang ditandai sensitif" + ignore: "Tampilkan media yang ditandai sensitif" + force: "Sembunyikan semua media" _instanceTicker: none: "Jangan tampilkan" remote: "Tampilkan untuk pengguna instansi luar" @@ -1649,11 +1684,9 @@ _timelineTutorial: _2fa: alreadyRegistered: "Kamu telah mendaftarkan perangkat otentikasi dua faktor." registerTOTP: "Daftarkan aplikasi autentikator" - passwordToTOTP: "Masukkan kata sandimu" step1: "Pertama, pasang aplikasi otentikasi (seperti {a} atau {b}) di perangkat kamu." step2: "Lalu, pindai kode QR yang ada di layar." step2Click: "Mengeklik kode QR ini akan membolehkanmu untuk mendaftarkan 2FA ke security-key atau aplikasi autentikator ponsel." - step2Url: "Di aplikasi desktop, masukkan URL berikut:" step3Title: "Masukkan kode autentikasi" step3: "Masukkan token yang telah disediakan oleh aplikasimu untuk menyelesaikan pemasangan." step4: "Mulai sekarang, upaya login apapun akan meminta token login dari aplikasi otentikasi kamu.\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" @@ -1670,6 +1703,7 @@ _2fa: renewTOTPConfirm: "Hal ini akan menyebabkan kode verifikasi dari aplikasi autentikator sebelumnya berhenti bekerja" renewTOTPOk: "Atur ulang" renewTOTPCancel: "Tidak sekarang." + backupCodes: "Kode Pencadangan" _permissions: "read:account": "Lihat informasi akun" "write:account": "Sunting informasi akun" @@ -1972,6 +2006,7 @@ _deck: introduction: "Buat antarmuka sempurna untukmu dengan menata kolom secara bebas!" introduction2: "Klik \"+\" pada kanan layar untuk menambahkan kolom baru kapanpun yang kamu mau." widgetsIntroduction: "Mohon pilih \"Sunting gawit\" pada menu kolom dan tambahkan gawit." + useSimpleUiForNonRootPages: "Gunakan antarmuka sederhana ke halaman yang dituju" _columns: main: "Utama" widgets: "Widget" @@ -2006,3 +2041,6 @@ _webhookSettings: renote: "Ketika direnote" reaction: "Ketika menerima reaksi" mention: "Ketika sedang disebut" +_moderationLogTypes: + suspend: "Tangguhkan" + resetPassword: "Atur ulang kata sandi" diff --git a/locales/index.d.ts b/locales/index.d.ts index 3fc1473be1..4b1e0a1873 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -48,6 +48,7 @@ export interface Locale { "unpin": string; "copyContent": string; "copyLink": string; + "copyLinkRenote": string; "delete": string; "deleteAndEdit": string; "deleteAndEditConfirm": string; @@ -159,6 +160,7 @@ export interface Locale { "settingGuide": string; "cacheRemoteFiles": string; "cacheRemoteFilesDescription": string; + "youCanCleanRemoteFilesCache": string; "cacheRemoteSensitiveFiles": string; "cacheRemoteSensitiveFilesDescription": string; "flagAsBot": string; @@ -358,7 +360,6 @@ export interface Locale { "driveCapacityPerLocalAccount": string; "driveCapacityPerRemoteAccount": string; "inMb": string; - "iconUrl": string; "bannerUrl": string; "backgroundImageUrl": string; "basicInfo": string; @@ -414,11 +415,14 @@ export interface Locale { "administrator": string; "token": string; "2fa": string; + "setupOf2fa": string; "totp": string; "totpDescription": string; - "useSecurityKey": string; "moderator": string; "moderation": string; + "moderationNote": string; + "addModerationNote": string; + "moderationLogs": string; "nUsersMentioned": string; "securityKeyAndPasskey": string; "securityKey": string; @@ -658,6 +662,7 @@ export interface Locale { "sample": string; "abuseReports": string; "reportAbuse": string; + "reportAbuseRenote": string; "reportAbuseOf": string; "fillAbuseReportDescription": string; "abuseReported": string; @@ -685,6 +690,7 @@ export interface Locale { "unclip": string; "confirmToUnclipAlreadyClippedNote": string; "public": string; + "private": string; "i18nInfo": string; "manageAccessTokens": string; "accountInfo": string; @@ -709,6 +715,7 @@ export interface Locale { "alwaysMarkSensitive": string; "loadRawImages": string; "disableShowingAnimatedImages": string; + "highlightSensitiveMedia": string; "verificationEmailSent": string; "notSet": string; "emailVerified": string; @@ -1023,7 +1030,7 @@ export interface Locale { "enableChartsForRemoteUser": string; "enableChartsForFederatedInstances": string; "showClipButtonInNoteFooter": string; - "largeNoteReactions": string; + "reactionsDisplaySize": string; "noteIdOrUrl": string; "video": string; "videos": string; @@ -1107,6 +1114,18 @@ export interface Locale { "currentAnnouncements": string; "pastAnnouncements": string; "youHaveUnreadAnnouncements": string; + "useSecurityKey": string; + "replies": string; + "renotes": string; + "loadReplies": string; + "loadConversation": string; + "pinnedList": string; + "keepScreenOn": string; + "verifiedLink": string; + "notifyNotes": string; + "unnotifyNotes": string; + "authentication": string; + "authenticationRequiredToContinue": string; "_announcement": { "forExistingUsers": string; "forExistingUsersDescription": string; @@ -1136,6 +1155,16 @@ export interface Locale { "_serverRules": { "description": string; }; + "_serverSettings": { + "iconUrl": string; + "appIconDescription": string; + "appIconUsageExample": string; + "appIconStyleRecommendation": string; + "appIconResolutionMustBe": string; + "manifestJsonOverride": string; + "shortName": string; + "shortNameDescription": string; + }; "_accountMigration": { "moveFrom": string; "moveFromSub": string; @@ -1465,6 +1494,10 @@ export interface Locale { "description": string; "flavor": string; }; + "_smashTestNotificationButton": { + "title": string; + "description": string; + }; }; }; "_role": { @@ -1608,6 +1641,7 @@ export interface Locale { "install": string; "installWarn": string; "manage": string; + "viewSource": string; }; "_preferencesBackups": { "list": string; @@ -1812,16 +1846,14 @@ export interface Locale { "_2fa": { "alreadyRegistered": string; "registerTOTP": string; - "passwordToTOTP": string; "step1": string; "step2": string; "step2Click": string; - "step2Url": string; + "step2Uri": string; "step3Title": string; "step3": string; + "setupCompleted": string; "step4": string; - "twoFactorBackupSecretWarning": string; - "twoFactorBackupSecretExhausted": string; "securityKeyNotSupported": string; "registerTOTPBeforeKey": string; "securityKeyInfo": string; @@ -1835,6 +1867,11 @@ export interface Locale { "renewTOTPConfirm": string; "renewTOTPOk": string; "renewTOTPCancel": string; + "checkBackupCodesBeforeCloseThisWizard": string; + "backupCodes": string; + "backupCodesDescription": string; + "backupCodeUsedWarning": string; + "backupCodesExhaustedWarning": string; }; "_permissions": { "read:account": string; @@ -1869,6 +1906,10 @@ export interface Locale { "write:gallery": string; "read:gallery-likes": string; "write:gallery-likes": string; + "read:flash": string; + "write:flash": string; + "read:flash-likes": string; + "write:flash-likes": string; }; "_auth": { "shareAccessTitle": string; @@ -1886,6 +1927,7 @@ export interface Locale { "homeTimeline": string; "users": string; "userList": string; + "userBlacklist": string; }; "_weekday": { "sunday": string; @@ -1994,6 +2036,7 @@ export interface Locale { "metadataContent": string; "changeAvatar": string; "changeBanner": string; + "verifiedLinkDescription": string; }; "_exportOrImport": { "allNotes": string; @@ -2123,11 +2166,17 @@ export interface Locale { "youReceivedFollowRequest": string; "yourFollowRequestAccepted": string; "pollEnded": string; + "newNote": string; "unreadAntennaNote": string; "emptyPushNotificationMessage": string; "achievementEarned": string; + "testNotification": string; + "checkNotificationBehavior": string; + "sendTestNotification": string; + "notificationWillBeDisplayedLikeThis": string; "_types": { "all": string; + "note": string; "follow": string; "mention": string; "reply": string; @@ -2164,6 +2213,8 @@ export interface Locale { "introduction2": string; "widgetsIntroduction": string; "useSimpleUiForNonRootPages": string; + "usedAsMinWidthWhenFlexible": string; + "flexible": string; "_columns": { "main": string; "widgets": string; @@ -2224,6 +2275,31 @@ export interface Locale { "list": string; "resolver": string; }; + "_moderationLogTypes": { + "assignRole": string; + "unassignRole": string; + "updateRole": string; + "suspend": string; + "unsuspend": string; + "addCustomEmoji": string; + "updateCustomEmoji": string; + "deleteCustomEmoji": string; + "updateServerSettings": string; + "updateUserNote": string; + "deleteDriveFile": string; + "deleteNote": string; + "createGlobalAnnouncement": string; + "createUserAnnouncement": string; + "updateGlobalAnnouncement": string; + "updateUserAnnouncement": string; + "deleteGlobalAnnouncement": string; + "deleteUserAnnouncement": string; + "resetPassword": string; + "suspendRemoteInstance": string; + "unsuspendRemoteInstance": string; + "markSensitiveDriveFile": string; + "unmarkSensitiveDriveFile": string; + }; } declare const locales: { [lang: string]: Locale; diff --git a/locales/it-IT.yml b/locales/it-IT.yml index ee98106bcf..7b07b1097b 100644 --- a/locales/it-IT.yml +++ b/locales/it-IT.yml @@ -21,7 +21,7 @@ noNotifications: "Nessuna notifica" instance: "Istanza" settings: "Impostazioni" notificationSettings: "Preferenze di notifica" -basicSettings: "Impostazioni generali" +basicSettings: "Impostazioni base" otherSettings: "Altre impostazioni" openInWindow: "Apri in una finestra" profile: "Profilo" @@ -45,6 +45,7 @@ pin: "Fissa sul profilo" unpin: "Non fissare sul profilo" copyContent: "Copia il contenuto" copyLink: "Copia il link" +copyLinkRenote: "Copia collegamento alla Rinota" delete: "Elimina" deleteAndEdit: "Elimina e modifica" deleteAndEditConfirm: "Vuoi davvero cancellare questa nota e scriverla di nuovo? Verranno eliminate anche tutte le reazioni, rinote e risposte collegate." @@ -63,9 +64,9 @@ reply: "Rispondi" loadMore: "Mostra di più" showMore: "Espandi" showLess: "Comprimi" -youGotNewFollower: "Ha iniziato a seguirti" +youGotNewFollower: "Ti sta seguendo" receiveFollowRequest: "Hai ricevuto una richiesta di follow" -followRequestAccepted: "Richiesta di follow accettata" +followRequestAccepted: "Ha accettato la tua richiesta di follow" mention: "Menzioni" mentions: "Menzioni" directNotes: "Note dirette" @@ -74,8 +75,8 @@ import: "Importa" export: "Esporta" files: "Allegati" download: "Scarica" -driveFileDeleteConfirm: "Vuoi davvero eliminare il file \"{name}\"? Anche gli allegati verranno eliminati." -unfollowConfirm: "Vuoi smettere di seguire {name}?" +driveFileDeleteConfirm: "Vuoi davvero eliminare il file \"{name}\", e le Note a cui è stato allegato?" +unfollowConfirm: "Vuoi davvero smettere di seguire {name}?" exportRequested: "Hai richiesto un'esportazione, e potrebbe volerci tempo. Quando sarà compiuta, il file verrà aggiunto direttamente al Drive." importRequested: "Hai richiesto un'importazione. Può volerci tempo. " lists: "Liste" @@ -84,7 +85,7 @@ note: "Nota" notes: "Note" following: "Follow" followers: "Follower" -followsYou: "Ti segue" +followsYou: "Segue" createList: "Aggiungi una nuova lista" manageLists: "Gestisci liste" error: "Errore" @@ -105,7 +106,7 @@ unfollow: "Non seguire" followRequestPending: "Richiesta in approvazione" enterEmoji: "Inserisci emoji" renote: "Rinota" -unrenote: "Annulla rinota" +unrenote: "Elimina la Rinota" renoted: "Rinotato!" cantRenote: "È impossibile rinotare questa nota." cantReRenote: "È impossibile rinotare una Rinota." @@ -116,7 +117,7 @@ pinnedNote: "Nota fissata" pinned: "Fissa sul profilo" you: "Tu" clickToShow: "Clicca per visualizzare" -sensitive: "Contenuto sensibile" +sensitive: "Esplicito" add: "Aggiungi" reaction: "Reazioni" reactions: "Reazioni" @@ -124,8 +125,8 @@ reactionSetting: "Reazioni visualizzate sul pannello" reactionSettingDescription2: "Trascina per riorganizzare, clicca per cancellare, usa il pulsante \"+\" per aggiungere." rememberNoteVisibility: "Ricordare le impostazioni di visibilità delle note" attachCancel: "Rimuovi allegato" -markAsSensitive: "Segna come sensibile" -unmarkAsSensitive: "Segna come non sensibile" +markAsSensitive: "Segna come esplicito" +unmarkAsSensitive: "Non segnare come esplicito " enterFileName: "Nome del file" mute: "Silenzia" unmute: "Riattiva l'audio" @@ -133,11 +134,11 @@ renoteMute: "Silenzia i Rinota" renoteUnmute: "Non silenziare i Rinota" block: "Blocca" unblock: "Sblocca" -suspend: "Sospendi" +suspend: "Sospensione" unsuspend: "Revoca la sospensione" blockConfirm: "Vuoi davvero bloccare il profilo?" unblockConfirm: "Vuoi davvero sbloccare il profilo?" -suspendConfirm: "Vuoi sospendere questo profilo?" +suspendConfirm: "Vuoi davvero sospendere questo profilo?" unsuspendConfirm: "Vuoi revocare la sospensione si questo profilo?" selectList: "Seleziona una lista" editList: "Modifica Lista" @@ -147,7 +148,7 @@ editAntenna: "Modifica Antenna" selectWidget: "Seleziona il riquadro" editWidgets: "Modifica i riquadri" editWidgetsExit: "Conferma le modifiche" -customEmojis: "Emoji personalizzati" +customEmojis: "Emoji personalizzate" emoji: "Emoji" emojis: "Emoji" emojiName: "Nome dell'emoji" @@ -156,15 +157,16 @@ addEmoji: "Aggiungi un emoji" settingGuide: "Configurazione suggerita" cacheRemoteFiles: "Memorizza i file remoti nella cache" cacheRemoteFilesDescription: "Disabilitando questa opzione, i file remoti verranno linkati direttamente senza essere memorizzati nella cache. Sarà possibile risparmiare spazio di archiviazione sul server, ma il traffico aumenterà in quanto non verranno generate anteprime." -cacheRemoteSensitiveFiles: "Memorizza nella cache i file sensibili remoti" -cacheRemoteSensitiveFilesDescription: "Disattivando questa opzione, i file sensibili verranno caricati direttamente dall'istanza remota senza essere salvati dal server." +youCanCleanRemoteFilesCache: "Puoi svuotare tutta la cache cliccando il bottone 🗑️ nella gestione file" +cacheRemoteSensitiveFiles: "Copia nella cache locale i file espliciti remoti" +cacheRemoteSensitiveFilesDescription: "Disattivando questa opzione, i file espliciti verranno richiesti direttamente all'istanza remota senza essere salvati nel server locale." flagAsBot: "Io sono un robot" flagAsBotDescription: "Attiva questo campo se il profilo esegue principalmente operazioni automatiche. L'attivazione segnala agli altri sviluppatori come comportarsi per evitare catene d’interazione infinite con altri bot. I sistemi interni di Misskey si adegueranno al fine di trattare questo profilo come bot." flagAsCat: "Sono un gatto" flagAsCatDescription: "La modalità \"sono un gatto\" aggiunge le orecchie al tuo profilo" flagShowTimelineReplies: "Mostra le risposte alle note sulla timeline." flagShowTimelineRepliesDescription: "Attivando, la timeline mostra le Note del profilo ed anche le risposte ad altre Note" -autoAcceptFollowed: "Accetta automaticamente le richieste di follow da utenti che già segui" +autoAcceptFollowed: "Accetta automaticamente le richieste di follow da profili che già segui" addAccount: "Aggiungi profilo" reloadAccountsList: "Ricarica l'elenco dei profili" loginFailed: "Accesso non riuscito" @@ -178,7 +180,7 @@ youHaveNoLists: "Non hai ancora creato nessuna lista" followConfirm: "Vuoi seguire {name}?" proxyAccount: "Profilo proxy" proxyAccountDescription: "Un profilo proxy funziona come follower per i profili remoti, sotto certe condizioni. Ad esempio, quando un profilo locale ne inserisce uno remoto in una lista (senza seguirlo), se nessun altro segue quel profilo remoto, le attività non possono essere distribuite. Dunque, il profilo proxy le seguirà per tutti." -host: "Server remoto" +host: "Host" selectUser: "Seleziona profilo" recipient: "Destinatario" annotation: "Annotazione preventiva" @@ -254,7 +256,7 @@ imageUrl: "URL dell'immagine" remove: "Elimina" removed: "Eliminato con successo" removeAreYouSure: "Vuoi davvero eliminare \"{x}\"?" -deleteAreYouSure: "Eliminare \"{x}\"?" +deleteAreYouSure: "Vuoi davvero eliminare \"{x}\"?" resetAreYouSure: "Ripristinare?" saved: "Salvato" messaging: "Messaggi" @@ -273,10 +275,10 @@ noMoreHistory: "Non c'è più cronologia da visualizzare" startMessaging: "Nuovo messaggio" nUsersRead: "Letto da {n} persone" agreeTo: "Sono d'accordo con {0}" -agree: "D'accordo" +agree: "Accetto" agreeBelow: "Accetto quanto riportato sotto" basicNotesBeforeCreateAccount: "Note importanti" -termsOfService: "Informativa Privacy" +termsOfService: "Informativa ai sensi degli artt. 13 e 14 del Regolamento UE 2016/679 per la protezione dei dati personali (GDPR)" start: "Inizia!" home: "Home" remoteUserCaution: "Le informazioni potrebbero essere incomplete poiché questo profilo remoto potrebbe non essere completamente federato." @@ -285,7 +287,7 @@ images: "Immagini" image: "Immagini" birthday: "Compleanno" yearsOld: "{age} anni" -registeredDate: "Iscrizione a.." +registeredDate: "Data iscrizione" location: "Posizione" theme: "Tema" themeForLightMode: "Tema da utilizzare per il modo chiaro" @@ -319,7 +321,7 @@ copyUrl: "Copia URL" rename: "Modifica nome" avatar: "Foto del profilo" banner: "Intestazione" -displayOfSensitiveMedia: "Visibilità dei media sensibili" +displayOfSensitiveMedia: "Visibilità dei media espliciti" whenServerDisconnected: "Quando la connessione col server è persa" disconnectedFromServer: "Il server si è disconnesso" reload: "Ricarica" @@ -354,7 +356,6 @@ invite: "Invita" driveCapacityPerLocalAccount: "Capienza del Drive per profilo locale" driveCapacityPerRemoteAccount: "Capienza del Drive per profilo remoto" inMb: "in Megabytes" -iconUrl: "URL di icona (favicon, ecc.)" bannerUrl: "URL dell'immagine d'intestazione" backgroundImageUrl: "URL dello sfondo" basicInfo: "Informazioni fondamentali" @@ -394,9 +395,9 @@ connectedTo: "Connessione ai seguenti profili:" notesAndReplies: "Note e risposte" withFiles: "Con file in allegato" silence: "Silenzia" -silenceConfirm: "Vuoi davvero silenziare l'utente?" +silenceConfirm: "Vuoi davvero silenziare questo profilo?" unsilence: "Riattiva" -unsilenceConfirm: "Vuoi davvero riattivare l'utente?" +unsilenceConfirm: "Vuoi davvero riattivare questo profilo?" popularUsers: "Utenti popolari" recentlyUpdatedUsers: "Utenti attivi di recente" recentlyRegisteredUsers: "Utenti registrati di recente" @@ -410,10 +411,14 @@ aboutMisskey: "Informazioni di Misskey" administrator: "Amministratore" token: "Token" 2fa: "Autenticazione a due fattori" +setupOf2fa: "Impostare l'autenticazione a due fattori" totp: "App di autenticazione" totpDescription: "Inserisci un codice OTP tramite un'app di autenticazione" moderator: "Moderatore" moderation: "moderazione" +moderationNote: "Promemoria di moderazione" +addModerationNote: "Aggiungi promemoria di moderazione" +moderationLogs: "Cronologia di moderazione" nUsersMentioned: "{n} profili menzionati" securityKeyAndPasskey: "Chiave di sicurezza e accesso" securityKey: "Chiave di sicurezza" @@ -492,7 +497,7 @@ noFollowRequests: "Non hai alcuna richiesta di follow" openImageInNewTab: "Apri le immagini in un nuovo tab" dashboard: "Pannello di controllo" local: "Locale" -remote: "Remoto" +remote: "Remota" total: "Totale" weekOverWeekChanges: "Settimanale" dayOverDayChanges: "Giornaliero" @@ -526,9 +531,9 @@ serverLogs: "Log del server" deleteAll: "Cancella cronologia" showFixedPostForm: "Visualizzare la finestra di pubblicazione in cima alla timeline" showFixedPostFormInChannel: "Per i canali, mostra il modulo di pubblicazione in cima alla timeline" -newNoteRecived: "Vedi le nuove note" +newNoteRecived: "Nuove note da leggere" sounds: "Impostazioni suoni" -sound: "Impostazioni suoni" +sound: "Suono" listen: "Ascolta" none: "Nessuno" showInPage: "Visualizza in pagina" @@ -547,8 +552,8 @@ installedDate: "Data installazione" lastUsedDate: "Data di ultimo uso" state: "Stato" sort: "Ordina per" -ascendingOrder: "Ascendente" -descendingOrder: "Discendente" +ascendingOrder: "Aumenta" +descendingOrder: "Diminuisce" scratchpad: "ScratchPad" scratchpadDescription: "Lo Scratchpad offre un ambiente per esperimenti di AiScript. È possibile scrivere, eseguire e confermare i risultati dell'interazione del codice con Misskey." output: "Uscita" @@ -557,7 +562,7 @@ disablePagesScript: "Disabilita AiScript nelle pagine" updateRemoteUser: "Aggiornare le informazioni di utente remot@" deleteAllFiles: "Elimina tutti i file" deleteAllFilesConfirm: "Vuoi davvero eliminare tutti i file?" -removeAllFollowing: "Cancella tutti i follows" +removeAllFollowing: "Annulla tutti i follow" removeAllFollowingDescription: "Cancella tutti i follows del server {host}. Per favore, esegui se, ad esempio, l'istanza non esiste più." userSuspended: "L'utente è in sospensione" userSilenced: "L'utente è silenziat@." @@ -617,7 +622,7 @@ emailConfigInfo: "Utilizzato per verificare il tuo indirizzo di posta elettronic email: "Email" emailAddress: "Indirizzo di posta elettronica" smtpConfig: "Impostazioni del server SMTP" -smtpHost: "Server remoto" +smtpHost: "Host SMTP" smtpPort: "Porta" smtpUser: "Nome utente" smtpPass: "Password" @@ -652,9 +657,10 @@ fileIdOrUrl: "ID o URL del file" behavior: "Comportamento" sample: "Esempio" abuseReports: "Segnalazioni" -reportAbuse: "Segnalazioni" +reportAbuse: "Segnala" +reportAbuseRenote: "Segnala la Rinota" reportAbuseOf: "Segnala {name}" -fillAbuseReportDescription: "Si prega di spiegare il motivo della segnalazione. Se riguarda una nota precisa, si prega di collegare anche l'URL della nota." +fillAbuseReportDescription: "Per favore, spiegaci il motivo della segnalazione. Se riguarda una Nota precisa, indica anche l'indirizzo URL." abuseReported: "La segnalazione è stata inviata. Grazie." reporter: "il corrispondente" reporteeOrigin: "Origine del segnalato" @@ -680,6 +686,7 @@ createNewClip: "Crea una Clip" unclip: "Togli Nota dalla Clip" confirmToUnclipAlreadyClippedNote: "Questa nota è già inclusa in \"{name}\". Si desidera escludere la nota?" public: "Pubblica" +private: "Privato" i18nInfo: "Misskey è tradotto in diverse lingue da volontari. Anche tu puoi contribuire su {link}." manageAccessTokens: "Gestisci token di accesso" accountInfo: "Informazioni profilo" @@ -701,9 +708,10 @@ driveUsage: "Utilizzazione del Drive" noCrawle: "Rifiuta l'indicizzazione dai robot." noCrawleDescription: "Richiedi che i motori di ricerca non indicizzino la tua pagina di profilo, le tue note, pagine, ecc." lockedAccountInfo: "A meno che non imposti la visibilità delle tue note su \"Solo ai follower\", le tue note sono visibili da tutti, anche se hai configurato l'account per confermare manualmente le richieste di follow." -alwaysMarkSensitive: "Segnare i media come sensibili per impostazione predefinita" +alwaysMarkSensitive: "Segnare gli allegati come espliciti come opzione predefinita" loadRawImages: "Visualizza le intere immagini allegate invece delle miniature." disableShowingAnimatedImages: "Disabilita le immagini animate" +highlightSensitiveMedia: "Evidenzia i media espliciti" verificationEmailSent: "Una mail di verifica è stata inviata. Si prega di accedere al collegamento per compiere la verifica." notSet: "Non impostato" emailVerified: "Il tuo indirizzo email è stato verificato" @@ -760,7 +768,7 @@ editCode: "Modifica codice" apply: "Applica" receiveAnnouncementFromInstance: "Ricevi i messaggi informativi dall'istanza" emailNotification: "Eventi per notifiche via mail" -publish: "Pubblico" +publish: "Pubblicare" inChannelSearch: "Cerca in canale" useReactionPickerForContextMenu: "Cliccare sul tasto destro per aprire il pannello di reazioni" typingUsers: "{users} sta(nno) scrivendo" @@ -819,8 +827,8 @@ previewNoteText: "Anteprima del testo" customCss: "CSS personalizzato" customCssWarn: "Questa impostazione deve essere eseguita da una persona esperta. Una configurazione errata può impedire al client di utilizzare correttamente il sistema." global: "Federata" -squareAvatars: "Mostra l'immagine del profilo come quadrato" -sent: "Inviare" +squareAvatars: "Foto profilo squadrate" +sent: "Inviato" received: "Ricevuto" searchResult: "Risultati della Ricerca" hashtags: "Hashtag" @@ -829,8 +837,8 @@ useBlurEffect: "Utilizza effetto sfocatura" learnMore: "Più dettagli" misskeyUpdated: "Misskey è stato aggiornato!" whatIsNew: "Visualizza le informazioni sull'aggiornamento" -translate: "Traduzione" -translatedFrom: "Tradotto da {x}" +translate: "Traduci" +translatedFrom: "Traduzione da {x}" accountDeletionInProgress: "È in corso l'eliminazione del profilo" usernameInfo: "Un nome per identificare univocamente il tuo profilo sull'istanza. Puoi utilizzare caratteri alfanumerici maiuscoli, minuscoli e il trattino basso (_). Non potrai cambiare nome utente in seguito." aiChanMode: "Modalità Ai" @@ -840,8 +848,8 @@ pubSub: "Publish/Subscribe del profilo" lastCommunication: "La comunicazione più recente" resolved: "Risolto" unresolved: "Non risolto" -breakFollow: "Non seguire" -breakFollowConfirm: "Vuoi davvero togliere follower?" +breakFollow: "Non farti più seguire" +breakFollowConfirm: "Vuoi davvero smettere di seguire questo profilo?" itsOn: "Abilitato" itsOff: "Disabilitato" on: "Acceso" @@ -854,11 +862,11 @@ manageAccounts: "Gestisci i profili" makeReactionsPublic: "Pubblicare la lista delle reazioni." makeReactionsPublicDescription: "La lista delle reazioni che avete fatto è a disposizione di tutti." classic: "Classico" -muteThread: "Silenzia la conversazione" +muteThread: "Silenzia conversazione" unmuteThread: "Riattiva la conversazione" ffVisibility: "Visibilità delle connessioni" ffVisibilityDescription: "Puoi scegliere a chi mostrare le tue relazioni con altri profili nel fediverso." -continueThread: "Altri thread." +continueThread: "Altre conversazioni" deleteAccountConfirm: "Così verrà eliminato il profilo. Vuoi procedere?" incorrectPassword: "La password è errata." voteConfirm: "Votare per「{choice}」?" @@ -920,7 +928,7 @@ type: "Tipo" speed: "Velocità" slow: "Lento" fast: "Veloce" -sensitiveMediaDetection: "Rilevamento dei contenuti sensibili." +sensitiveMediaDetection: "Rilevamento dei contenuti espliciti" localOnly: "Soltanto locale" remoteOnly: "Solo remoto" failedToUpload: "errore di caricamento" @@ -1000,11 +1008,11 @@ cannotBeChangedLater: "Non sarà più modificabile" reactionAcceptance: "Reazioni consentite" likeOnly: "Solo i Like" likeOnlyForRemote: "Solo Like remoti" -nonSensitiveOnly: "Solamente non sensibili" -nonSensitiveOnlyForLocalLikeOnlyForRemote: "Solamente non sensibili (solo Mi piace remoti)" +nonSensitiveOnly: "Soltanto non espliciti" +nonSensitiveOnlyForLocalLikeOnlyForRemote: "Soltanto non espliciti (reazioni remote)" rolesAssignedToMe: "I miei ruoli" resetPasswordConfirm: "Vuoi davvero ripristinare la password?" -sensitiveWords: "Parole sensibili" +sensitiveWords: "Parole esplicite" sensitiveWordsDescription: "Imposta automaticamente \"Home\" alla visibilità delle Note che contengono una qualsiasi parola tra queste configurate. Puoi separarle per riga." sensitiveWordsDescription2: "Gli spazi creano la relazione \"E\" tra parole (questo E quello). Racchiudere una parola nelle slash \"/\" la trasforma in Espressione Regolare." notesSearchNotAvailable: "Non è possibile cercare tra le Note." @@ -1018,7 +1026,7 @@ retryAllQueuesConfirmText: "Potrebbe sovraccaricare il server temporaneamente." enableChartsForRemoteUser: "Abilita i grafici per i profili remoti" enableChartsForFederatedInstances: "Abilita i grafici per le istanze federate" showClipButtonInNoteFooter: "Aggiungi il bottone Clip tra le azioni delle Note" -largeNoteReactions: "Ingrandisci le reazioni" +reactionsDisplaySize: "Grandezza delle reazioni" noteIdOrUrl: "ID della Nota o URL" video: "Video" videos: "Video" @@ -1030,8 +1038,8 @@ operationForbidden: "Operazione non consentita" forceShowAds: "Mostra sempre i banner" addMemo: "Aggiungi Memo" editMemo: "Modifica Memo" -reactionsList: "Elenco delle reazioni" -renotesList: "Elenco di Rinota" +reactionsList: "Chi ha reagito?" +renotesList: "Chi ha Rinotato?" notificationDisplay: "Stile delle notifiche" leftTop: "In alto a sinistra" rightTop: "In alto a destra" @@ -1042,8 +1050,8 @@ vertical: "Verticale" horizontal: "Laterale" position: "Posizione" serverRules: "Regolamento" -pleaseConfirmBelowBeforeSignup: "Ai sensi del regolamento EU 679/2016 GDPR, autorizzo il trattamento dati personali come descritto nella informativa Privacy." -pleaseAgreeAllToContinue: "Per continuare, occorre selezionare ed essere d'accordo su tutto." +pleaseConfirmBelowBeforeSignup: "Per iscriversi, occorre essere d'accordo con le seguenti condizioni." +pleaseAgreeAllToContinue: "Occorre accettare tutte le condizioni prima di continuare." continue: "Continua" preservedUsernames: "Nomi utente riservati" preservedUsernamesDescription: "Elenca, uno per linea, i nomi utente che non possono essere registrati durante la creazione del profilo. La restrizione non si applica agli amministratori. Inoltre, i profili già registrati sono esenti." @@ -1082,7 +1090,7 @@ inviteLimitExceeded: "Hai raggiunto il numero massimo di codici invito generabil createLimitRemaining: "Inviti generabili: {limit} rimanenti" inviteLimitResetCycle: "Alle {time}, il limite verrà ripristinato a {limit}" expirationDate: "Scadenza" -noExpirationDate: "Perpetuo" +noExpirationDate: "Senza scadenza" inviteCodeUsedAt: "Codice di invito usato alle" registeredUserUsingInviteCode: "Codice di invito usato da" waitingForMailAuth: "In attesa della verifica email" @@ -1091,9 +1099,36 @@ usedAt: "Usato alle" unused: "Inutilizzato" used: "Utilizzato" expired: "Scaduto" -doYouAgree: "Sei d'accordo?" +doYouAgree: "Accetti le condizioni?" beSureToReadThisAsItIsImportant: "Si prega di leggere attentamente perché è importante." -iHaveReadXCarefullyAndAgree: "Ho letto accuratamente \"{x}\" e sono d'accordo." +iHaveReadXCarefullyAndAgree: "Dichiaro di aver letto attentamente \"{x}\" e accettarne le condizioni." +dialog: "Dialogo" +icon: "Ritratto" +forYou: "Per te" +currentAnnouncements: "Annunci attuali" +pastAnnouncements: "Annunci precedenti" +youHaveUnreadAnnouncements: "Ci sono Annunci non letti" +useSecurityKey: "Per utilizzare la chiave di sicurezza o la passkey, segui le indicazioni del dispositivo" +replies: "Rispondi" +renotes: "Rinota" +loadReplies: "Leggi le risposte" +loadConversation: "Leggi la conversazione" +pinnedList: "Elenco in primo piano" +keepScreenOn: "Mantieni lo schermo acceso" +verifiedLink: "Abbiamo confermato la validità di questo collegamento" +notifyNotes: "Notifica nuove Note" +unnotifyNotes: "Interrompi le notifiche di nuove Note" +authentication: "Autenticazione" +authenticationRequiredToContinue: "Per procedere, è richiesta l'autenticazione" +_announcement: + forExistingUsers: "Solo ai profili attuali" + forExistingUsersDescription: "L'annuncio sarà visibile solo ai profili esistenti in questo momento. Se disabilitato, sarà visibile anche ai profili che verranno creati dopo la pubblicazione di questo annuncio." + needConfirmationToRead: "Richiede la conferma di lettura" + needConfirmationToReadDescription: "Sarà visualizzata una finestra di dialogo che richiede la conferma di lettura. Inoltre, non è soggetto a conferme di lettura massicce." + end: "Archivia l'annuncio" + tooManyActiveAnnouncementDescription: "L'esperienza delle persone può peggiorare se ci sono troppi annunci attivi. Considera anche l'archiviazione degli annunci conclusi." + readConfirmTitle: "Segnare come già letto?" + readConfirmText: "Hai già letto \"{title}˝?" _initialAccountSetting: accountCreated: "Il tuo profilo è stato creato!" letsStartAccountSetup: "Per iniziare, impostiamo il tuo profilo." @@ -1111,6 +1146,15 @@ _initialAccountSetting: laterAreYouSure: "Vuoi davvero rimandare la configurazione iniziale?" _serverRules: description: "In Europa è necessario mostrare l'informativa sul trattamento dei dati personali, prima della registrazione al servizio." +_serverSettings: + iconUrl: "URL dell'icona" + appIconDescription: "Indicare l'icona da usare quando {host} viene salvata come App." + appIconUsageExample: "Ad esempio quando si aggiunge il segnalibro alla PWA (Progressive Web App), oppure alla schermata iniziale del dispositivo mobile " + appIconStyleRecommendation: "Poiché l'icona potrebbe essere ritagliata in un quadrato o in un cerchio, si raccomanda che abbia un margine colorato." + appIconResolutionMustBe: "La risoluzione minima è {resolution}" + manifestJsonOverride: "Sostituire il file manifest.json" + shortName: "Abbreviazione" + shortNameDescription: "Un'abbreviazione o un nome comune che può essere visualizzato al posto del nome ufficiale lungo del server." _accountMigration: moveFrom: "Migra un altro profilo dentro a questo" moveFromSub: "Crea un alias verso un altro profilo remoto" @@ -1365,6 +1409,9 @@ _achievements: title: "Brain Diver" description: "Pubblica un link a Brain Diver" flavor: "Sulle note di Brain Diver" + _smashTestNotificationButton: + title: "Prove eccessive" + description: "Hai provato le notifiche consecutivamente in un periodo di tempo molto breve" _role: new: "Nuovo ruolo" edit: "Modifica ruolo" @@ -1425,10 +1472,10 @@ _role: _condition: isLocal: "Profilo locale" isRemote: "Profilo remoto" - createdLessThan: "Creato meno di" - createdMoreThan: "Creato più di" - followersLessThanOrEq: "Ha meno di N follower" - followersMoreThanOrEq: "Ha più di N follower" + createdLessThan: "Profilo creato da meno di N" + createdMoreThan: "Profilo creato da più di N" + followersLessThanOrEq: "Profilo con N follower o meno" + followersMoreThanOrEq: "Profilo con N follower o più" followingLessThanOrEq: "Segue N profili o meno" followingMoreThanOrEq: "Segue N profili o più" notesLessThanOrEq: "Conteggio Note inferiore o uguale a" @@ -1437,9 +1484,9 @@ _role: or: "O" not: "NON" _sensitiveMediaDetection: - description: "L'apprendimento automatico può essere utilizzato per individuare automaticamente i media sensibili da moderare. Il carico del server aumenta leggermente." - sensitivity: "Sensibilità di rilevamento" - sensitivityDescription: "Una minore sensibilità riduce i falsi positivi (false positività). Una maggiore sensibilità riduce le omissioni (falsi negativi)." + description: "Utilizzare l'apprendimento automatico (machine learning) per riconoscere media espliciti e sottoporli alla moderazione. Aumenterà lievemente il carico del server." + sensitivity: "Sensibilità del rilevamento" + sensitivityDescription: "Abbassando la sensibilità si riducono i falsi positivi (rilevazioni errate). Aumentando la sensibilità si riduce il numero di rilevazioni mancate. (rilevazioni ignorate)." setSensitiveFlagAutomatically: "Impostare il flag NSFW." setSensitiveFlagAutomaticallyDescription: "Anche se questa impostazione è disattivata, il risultato della decisione viene conservato internamente." analyzeVideos: "Abilitazione dell'analisi video." @@ -1451,7 +1498,7 @@ _emailUnavailable: mx: "Server email non corretto" smtp: "Il server email non risponde" _ffVisibility: - public: "Pubblico" + public: "Pubblica" followers: "Mostra solo ai follower" private: "Invisibile" _signup: @@ -1488,12 +1535,13 @@ _plugin: install: "Installa estensioni" installWarn: "Si prega di installare soltanto estensioni che provengono da fonti affidabili." manage: "Gestisci estensioni" + viewSource: "Visualizza sorgente" _preferencesBackups: - list: "I backup creati." + list: "Elenco di impostazioni salvate in precedenza" saveNew: "Nuovo salvataggio" - loadFile: "Importa file" + loadFile: "Carica da file" apply: "Applicabile a questo dispositivo" - save: "Sovrascrivi il file di salvataggio" + save: "Sovrascrivi il backup" inputName: "Inserire il nome del backup." cannotSave: "Impossibile salvare." nameAlreadyExists: "Il nome del backup \"{name}\" esiste già. Si prega di specificare un nome diverso." @@ -1522,8 +1570,8 @@ _aboutMisskey: morePatrons: "Apprezziamo sinceramente il supporto di tante altre persone. Grazie mille! 🥰" patrons: "Sostenitori" _displayOfSensitiveMedia: - respect: "Nascondere i media sensibili" - ignore: "Non nascondere i media sensibili" + respect: "Nascondere i media espliciti" + ignore: "Non nascondere i media espliciti" force: "Nascondi tutti i media" _instanceTicker: none: "Nascondi" @@ -1675,13 +1723,13 @@ _timelineTutorial: _2fa: alreadyRegistered: "La configurazione è stata già completata." registerTOTP: "Registra un'app di autenticazione" - passwordToTOTP: "Inserire la password" step1: "Innanzitutto, installare sul dispositivo un'applicazione di autenticazione come {a} o {b}." step2: "Quindi, scansionare il codice QR visualizzato con l'app." step2Click: "Cliccando sul codice QR, puoi registrarlo con l'app di autenticazione o il portachiavi installato sul tuo dispositivo." - step2Url: "Nell'applicazione desktop inserire il seguente URL: " + step2Uri: "Inserisci il seguente URL se desideri utilizzare una App per PC" step3Title: "Inserisci il codice di verifica" step3: "Inserite il token visualizzato nell'app e il gioco è fatto." + setupCompleted: "Impostazione completata" step4: "D'ora in poi, quando si accede, si inserisce il token nello stesso modo.\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" securityKeyNotSupported: "Il tuo browser non supporta le chiavi di sicurezza." registerTOTPBeforeKey: "Ti occorre un'app di autenticazione con OTP, prima di registrare la chiave di sicurezza." @@ -1696,6 +1744,11 @@ _2fa: renewTOTPConfirm: "I codici di verifica nelle app di autenticazione esistenti smetteranno di funzionare" renewTOTPOk: "Ripristina" renewTOTPCancel: "No grazie" + checkBackupCodesBeforeCloseThisWizard: "Prima di chiudere questa procedura guidata, salva i tuoi codici usa-e-getta in un posto sicuro." + backupCodes: "Codici usa-e-getta" + backupCodesDescription: "Puoi usare questi codici usa-e-getta per ottenere l'accesso al tuo profilo in caso sia impossibile usare l'App col codice OTP. Salvali in un posto sicuro." + backupCodeUsedWarning: "È stato usato un codice usa-e-getta. Per favore, riconfigura l'autenticazione a due fattori il prima possibile, nel caso la configurazione precedente abbia smesso di funzionare." + backupCodesExhaustedWarning: "Hai esaurito i codici usa-e-getta. Se l'App che genera il codice OTP non è più disponibile, non potrai più accedere al tuo profilo. Ripeti la configurazione per l'autenticazione a due fattori." _permissions: "read:account": "Visualizza le informazioni sul profilo" "write:account": "Modifica le informazioni sul profilo" @@ -1729,6 +1782,10 @@ _permissions: "write:gallery": "Gestione della galleria" "read:gallery-likes": "Visualizza i contenuti della galleria." "write:gallery-likes": "Manipolazione dei \"Mi piace\" della galleria." + "read:flash": "Visualizza Play" + "write:flash": "Modifica Play" + "read:flash-likes": "Visualizza lista di Play piaciuti" + "write:flash-likes": "Modifica lista di Play piaciuti" _auth: shareAccessTitle: "Permessi dell'applicazione" shareAccess: "Vuoi autorizzare {name} ad accedere al tuo profilo?" @@ -1744,6 +1801,7 @@ _antennaSources: homeTimeline: "Note dagli utenti che segui" users: "Note dagli utenti selezionati" userList: "Note dagli utenti della lista selezionata" + userBlacklist: "Tutte le Note tranne quelle di uno o più profili specificati" _weekday: sunday: "Domenica" monday: "Lunedì" @@ -1843,6 +1901,7 @@ _profile: metadataContent: "Contenuto" changeAvatar: "Modifica immagine profilo" changeBanner: "Cambia intestazione" + verifiedLinkDescription: "Puoi verificare il tuo profilo mostrando una icona. Devi inserire la URL alla pagina che contiene un link al tuo profilo." _exportOrImport: allNotes: "Tutte le note" favoritedNotes: "Note preferite" @@ -1961,11 +2020,17 @@ _notification: youReceivedFollowRequest: "Hai ricevuto una richiesta di follow" yourFollowRequestAccepted: "La tua richiesta di follow è stata accettata" pollEnded: "Risultati del sondaggio." + newNote: "Nuove Note" unreadAntennaNote: "Antenna {name}" emptyPushNotificationMessage: "Le notifiche push sono state aggiornate." achievementEarned: "Obiettivo raggiunto" + testNotification: "Prova la notifica" + checkNotificationBehavior: "Prova il comportamento della notifica" + sendTestNotification: "Spedisci una notifica di prova" + notificationWillBeDisplayedLikeThis: "La notifica apparirà così" _types: all: "Tutto" + note: "Nuove Note" follow: "Novità follower" mention: "Menzioni" reply: "Risposte" @@ -1985,7 +2050,7 @@ _deck: alwaysShowMainColumn: "Mostra sempre la colonna principale" columnAlign: "Allineare colonne" addColumn: "Aggiungi colonna" - configureColumn: "Impostazioni della colonna." + configureColumn: "Impostazioni colonna" swapLeft: "Sposta a sinistra" swapRight: "Sposta a destra" swapUp: "Sposta in alto" @@ -1999,6 +2064,8 @@ _deck: introduction2: "È possibile aggiungere colonne in qualsiasi momento premendo + sulla destra dello schermo." widgetsIntroduction: "Dal menu della colonna, selezionare \"Modifica i riquadri\" per aggiungere un un riquadro con funzionalità" useSimpleUiForNonRootPages: "Visualizza sotto pagine con interfaccia web semplice" + usedAsMinWidthWhenFlexible: "Se \"larghezza flessibile\" è abilitato, questa diventa la larghezza minima" + flexible: "Larghezza flessibile" _columns: main: "Principale" widgets: "Riquadri" @@ -2033,3 +2100,19 @@ _webhookSettings: renote: "Quando la Nota è Rinotata" reaction: "Quando ricevo una reazione" mention: "Quando mi menzionano" +_moderationLogTypes: + assignRole: "Assegna un ruolo" + unassignRole: "Disassegna un ruolo" + updateRole: "Aggiorna un ruolo" + suspend: "Sospensione" + unsuspend: "Toglie la sospensione" + addCustomEmoji: "Aggiunge una emoji personalizzata" + updateServerSettings: "Aggiorna le impostazioni del server" + updateUserNote: "Aggiorna il promemoria di moderazione" + deleteDriveFile: "Elimina file da Drive" + deleteNote: "Elimina la Nota" + createGlobalAnnouncement: "Crea un annuncio globale" + createUserAnnouncement: "Crea un annuncio ai profili iscritti" + resetPassword: "Ripristina la password" + suspendRemoteInstance: "Sospendi istanza remota" + unsuspendRemoteInstance: "Riattiva istanza remota" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 96b56e28ed..6d3b36ad22 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -15,7 +15,7 @@ gotIt: "わかった" cancel: "キャンセル" noThankYou: "やめておく" enterUsername: "ユーザー名を入力" -renotedBy: "{user}がRenote" +renotedBy: "{user}がリノート" noNotes: "ノートはありません" noNotifications: "通知はありません" instance: "サーバー" @@ -45,9 +45,10 @@ pin: "ピン留め" unpin: "ピン留め解除" copyContent: "内容をコピー" copyLink: "リンクをコピー" +copyLinkRenote: "リノートのリンクをコピー" delete: "削除" deleteAndEdit: "削除して編集" -deleteAndEditConfirm: "このノートを削除してもう一度編集しますか?このノートへのリアクション、Renote、返信も全て削除されます。" +deleteAndEditConfirm: "このノートを削除してもう一度編集しますか?このノートへのリアクション、リノート、返信も全て削除されます。" addToList: "リストに追加" addToAntenna: "アンテナに追加" sendMessage: "メッセージを送信" @@ -74,7 +75,7 @@ import: "インポート" export: "エクスポート" files: "ファイル" download: "ダウンロード" -driveFileDeleteConfirm: "ファイル「{name}」を削除しますか?このファイルを使用した全てのコンテンツからも削除されます。" +driveFileDeleteConfirm: "ファイル「{name}」を削除しますか?このファイルを使用した一部のコンテンツも削除されます。" unfollowConfirm: "{name}のフォローを解除しますか?" exportRequested: "エクスポートをリクエストしました。これには時間がかかる場合があります。エクスポートが終わると、「ドライブ」に追加されます。" importRequested: "インポートをリクエストしました。これには時間がかかる場合があります。" @@ -104,13 +105,13 @@ followRequests: "フォロー申請" unfollow: "フォロー解除" followRequestPending: "フォロー許可待ち" enterEmoji: "絵文字を入力" -renote: "Renote" -unrenote: "Renote解除" -renoted: "Renoteしました。" -cantRenote: "この投稿はRenoteできません。" -cantReRenote: "RenoteをRenoteすることはできません。" +renote: "リノート" +unrenote: "リノート解除" +renoted: "リノートしました。" +cantRenote: "この投稿はリノートできません。" +cantReRenote: "リノートをリノートすることはできません。" quote: "引用" -inChannelRenote: "チャンネル内Renote" +inChannelRenote: "チャンネル内リノート" inChannelQuote: "チャンネル内引用" pinnedNote: "ピン留めされたノート" pinned: "ピン留め" @@ -155,7 +156,8 @@ emojiUrl: "絵文字画像URL" addEmoji: "絵文字を追加" settingGuide: "おすすめ設定" cacheRemoteFiles: "リモートのファイルをキャッシュする" -cacheRemoteFilesDescription: "この設定を無効にすると、リモートファイルをキャッシュせず直リンクするようになります。サーバーのストレージを節約できますが、サムネイルが生成されないので通信量が増加します。" +cacheRemoteFilesDescription: "この設定を有効にすると、リモートファイルをこのサーバーのストレージにキャッシュするようになります。画像の表示が高速になりますが、サーバーのストレージを多く消費します。リモートユーザーがどれほどキャッシュを保持するかは、ロールによるドライブ容量制限によって決定されます。この制限を超えた場合、古いファイルからキャッシュが削除されリンクになります。この設定が無効の場合、リモートのファイルを最初からリンクとして保持しますが、画像のサムネイル生成やユーザーのプライバシー保護のために、default.ymlでproxyRemoteFilesをtrueにすることをお勧めします。" +youCanCleanRemoteFilesCache: "ファイル管理の🗑️ボタンで全てのキャッシュを削除できます。" cacheRemoteSensitiveFiles: "リモートのセンシティブなファイルをキャッシュする" cacheRemoteSensitiveFilesDescription: "この設定を無効にすると、リモートのセンシティブなファイルはキャッシュせず直リンクするようになります。" flagAsBot: "Botとして設定" @@ -355,7 +357,6 @@ invite: "招待" driveCapacityPerLocalAccount: "ローカルユーザーひとりあたりのドライブ容量" driveCapacityPerRemoteAccount: "リモートユーザーひとりあたりのドライブ容量" inMb: "メガバイト単位" -iconUrl: "アイコン画像のURL (faviconなど)" bannerUrl: "バナー画像のURL" backgroundImageUrl: "背景画像のURL" basicInfo: "基本情報" @@ -411,11 +412,14 @@ aboutMisskey: "Misskeyについて" administrator: "管理者" token: "確認コード" 2fa: "二要素認証" +setupOf2fa: "二要素認証のセットアップ" totp: "認証アプリ" totpDescription: "認証アプリを使ってワンタイムパスワードを入力" -useSecurityKey: "ブラウザまたはデバイスの指示に従って、セキュリティキーまたはパスキーを使用してください。" moderator: "モデレーター" moderation: "モデレーション" +moderationNote: "モデレーションノート" +addModerationNote: "モデレーションノートを追加する" +moderationLogs: "モデログ" nUsersMentioned: "{n}人が投稿" securityKeyAndPasskey: "セキュリティキー・パスキー" securityKey: "セキュリティキー" @@ -655,6 +659,7 @@ behavior: "動作" sample: "サンプル" abuseReports: "通報" reportAbuse: "通報" +reportAbuseRenote: "リノートを通報" reportAbuseOf: "{name}を通報する" fillAbuseReportDescription: "通報理由の詳細を記入してください。対象のノートがある場合はそのURLも記入してください。" abuseReported: "内容が送信されました。ご報告ありがとうございました。" @@ -682,14 +687,15 @@ createNewClip: "新しいクリップを作成" unclip: "クリップ解除" confirmToUnclipAlreadyClippedNote: "このノートはすでにクリップ「{name}」に含まれています。ノートをこのクリップから除外しますか?" public: "パブリック" +private: "非公開" i18nInfo: "Misskeyは有志によって様々な言語に翻訳されています。{link}で翻訳に協力できます。" manageAccessTokens: "アクセストークンの管理" accountInfo: "アカウント情報" notesCount: "ノートの数" repliesCount: "返信した数" -renotesCount: "Renoteした数" +renotesCount: "リノートした数" repliedCount: "返信された数" -renotedCount: "Renoteされた数" +renotedCount: "リノートされた数" followingCount: "フォロー数" followersCount: "フォロワー数" sentReactionsCount: "リアクションした数" @@ -706,6 +712,7 @@ lockedAccountInfo: "フォローを承認制にしても、ノートの公開範 alwaysMarkSensitive: "デフォルトでメディアをセンシティブ設定にする" loadRawImages: "添付画像のサムネイルをオリジナル画質にする" disableShowingAnimatedImages: "アニメーション画像を再生しない" +highlightSensitiveMedia: "メディアがセンシティブであることを分かりやすく表示" verificationEmailSent: "確認のメールを送信しました。メールに記載されたリンクにアクセスして、設定を完了してください。" notSet: "未設定" emailVerified: "メールアドレスが確認されました" @@ -985,7 +992,7 @@ thisPostMayBeAnnoying: "この投稿は迷惑になる可能性があります thisPostMayBeAnnoyingHome: "ホームに投稿" thisPostMayBeAnnoyingCancel: "やめる" thisPostMayBeAnnoyingIgnore: "このまま投稿" -collapseRenotes: "見たことのあるRenoteを省略して表示" +collapseRenotes: "見たことのあるリノートを省略して表示" internalServerError: "サーバー内部エラー" internalServerErrorDescription: "サーバー内部で予期しないエラーが発生しました。" copyErrorInfo: "エラー情報をコピー" @@ -1020,7 +1027,7 @@ retryAllQueuesConfirmText: "一時的にサーバーの負荷が増大するこ enableChartsForRemoteUser: "リモートユーザーのチャートを生成" enableChartsForFederatedInstances: "リモートサーバーのチャートを生成" showClipButtonInNoteFooter: "ノートのアクションにクリップを追加" -largeNoteReactions: "ノートのリアクションを大きく表示" +reactionsDisplaySize: "リアクションの表示サイズ" noteIdOrUrl: "ノートIDまたはURL" video: "動画" videos: "動画" @@ -1033,7 +1040,7 @@ forceShowAds: "常に広告を表示する" addMemo: "メモを追加" editMemo: "メモを編集" reactionsList: "リアクション一覧" -renotesList: "Renote一覧" +renotesList: "リノート一覧" notificationDisplay: "通知の表示" leftTop: "左上" rightTop: "右上" @@ -1104,6 +1111,18 @@ forYou: "あなたへ" currentAnnouncements: "現在のお知らせ" pastAnnouncements: "過去のお知らせ" youHaveUnreadAnnouncements: "未読のお知らせがあります。" +useSecurityKey: "ブラウザまたはデバイスの指示に従って、セキュリティキーまたはパスキーを使用してください。" +replies: "返信" +renotes: "リノート" +loadReplies: "返信を見る" +loadConversation: "会話を見る" +pinnedList: "ピン留めされたリスト" +keepScreenOn: "デバイスの画面を常にオンにする" +verifiedLink: "このリンク先の所有者であることが確認されました" +notifyNotes: "投稿を通知" +unnotifyNotes: "投稿の通知を解除" +authentication: "認証" +authenticationRequiredToContinue: "続けるには認証を行ってください" _announcement: forExistingUsers: "既存ユーザーのみ" @@ -1134,6 +1153,16 @@ _initialAccountSetting: _serverRules: description: "新規登録前に表示する、サーバーの簡潔なルールを設定します。内容は利用規約の要約とすることを推奨します。" +_serverSettings: + iconUrl: "アイコン画像のURL" + appIconDescription: "{host}がアプリとして表示される際のアイコンを指定します。" + appIconUsageExample: "例: PWAや、スマートフォンのホーム画面にブックマークとして追加された時など" + appIconStyleRecommendation: "円形もしくは角丸にクロップされる場合があるため、塗り潰された余白のある背景を持つことが推奨されます。" + appIconResolutionMustBe: "解像度は必ず{resolution}である必要があります。" + manifestJsonOverride: "manifest.jsonのオーバーライド" + shortName: "略称" + shortNameDescription: "サーバーの正式名称が長い場合に、代わりに表示することのできる略称や通称。" + _accountMigration: moveFrom: "別のアカウントからこのアカウントに移行" moveFromSub: "別のアカウントへエイリアスを作成" @@ -1389,6 +1418,9 @@ _achievements: title: "Brain Diver" description: "Brain Diverへのリンクを投稿した" flavor: "Misskey-Misskey La-Tu-Ma" + _smashTestNotificationButton: + title: "テスト過剰" + description: "通知のテストをごく短時間のうちに連続して行った" _role: new: "ロールの作成" @@ -1526,6 +1558,7 @@ _plugin: install: "プラグインのインストール" installWarn: "信頼できないプラグインはインストールしないでください。" manage: "プラグインの管理" + viewSource: "ソースを表示" _preferencesBackups: list: "作成したバックアップ" @@ -1730,16 +1763,14 @@ _timelineTutorial: _2fa: alreadyRegistered: "既に設定は完了しています。" registerTOTP: "認証アプリの設定を開始" - passwordToTOTP: "パスワードを入力してください" step1: "まず、{a}や{b}などの認証アプリをお使いのデバイスにインストールします。" step2: "次に、表示されているQRコードをアプリでスキャンします。" step2Click: "QRコードをクリックすると、お使いの端末にインストールされている認証アプリやキーリングに登録できます。" - step2Url: "デスクトップアプリでは次のURIを入力します:" + step2Uri: "デスクトップアプリを使用する場合は次のURIを入力します" step3Title: "確認コードを入力" - step3: "アプリに表示されている確認コード(トークン)を入力して完了です。" + step3: "アプリに表示されている確認コード(トークン)を入力します。" + setupCompleted: "設定が完了しました" step4: "これからログインするときも、同じように確認コードを入力します。\n\n認証アプリが使えなくなった時、アカウントへの緊急アクセスのためのバックアップコードを作成しました。\n紛失防止のため、必ず安全な場所に保管してください。\nこれらのコードはそれぞれ1回だけ使用することができます。\nもし全てのコードを使い切ってしまうとアカウントにアクセスすることができなくなってしまうので、出来るだけ早く認証アプリを再設定してください。\n\nバックアップコード:\n\n{codes}" - twoFactorBackupSecretWarning: "バックアップコードが使用されました。認証アプリが使えなくなっている場合、なるべく早く認証アプリを再設定してください。" - twoFactorBackupSecretExhausted: "バックアップコードが全て使用されました。認証アプリを利用できない場合、これ以上アカウントにアクセスできなくなります。できるだけ早く認証アプリを再登録してください。" securityKeyNotSupported: "お使いのブラウザはセキュリティキーに対応していません。" registerTOTPBeforeKey: "セキュリティキー・パスキーを登録するには、まず認証アプリの設定を行なってください。" securityKeyInfo: "FIDO2をサポートするハードウェアセキュリティキー、端末の生体認証やPINロック、パスキーといった、WebAuthn由来の鍵を登録します。" @@ -1750,9 +1781,14 @@ _2fa: removeKeyConfirm: "{name}を削除しますか?" whyTOTPOnlyRenew: "セキュリティキーが登録されている場合、認証アプリの設定は解除できません。" renewTOTP: "認証アプリを再設定" - renewTOTPConfirm: "今までの認証アプリの確認コードとバックアップコードは使用できなくなります" + renewTOTPConfirm: "今までの認証アプリの確認コードおよびバックアップコードは使用できなくなります" renewTOTPOk: "再設定する" renewTOTPCancel: "やめておく" + checkBackupCodesBeforeCloseThisWizard: "このウィザードを閉じる前に、以下のバックアップコードを確認してください。" + backupCodes: "バックアップコード" + backupCodesDescription: "認証アプリが使用できなくなった場合、以下のバックアップコードを使ってアカウントにアクセスできます。これらのコードは必ず安全な場所に保管してください。各コードは一回だけ使用できます。" + backupCodeUsedWarning: "バックアップコードが使用されました。認証アプリが使えなくなっている場合、なるべく早く認証アプリを再設定してください。" + backupCodesExhaustedWarning: "バックアップコードが全て使用されました。認証アプリを利用できない場合、これ以上アカウントにアクセスできなくなります。認証アプリを再登録してください。" _permissions: "read:account": "アカウントの情報を見る" @@ -1787,6 +1823,10 @@ _permissions: "write:gallery": "ギャラリーを操作する" "read:gallery-likes": "ギャラリーのいいねを見る" "write:gallery-likes": "ギャラリーのいいねを操作する" + "read:flash": "Playを見る" + "write:flash": "Playを操作する" + "read:flash-likes": "Playのいいねを見る" + "write:flash-likes": "Playのいいねを操作する" _auth: shareAccessTitle: "アプリへのアクセス許可" @@ -1804,6 +1844,7 @@ _antennaSources: homeTimeline: "フォローしているユーザーのノート" users: "指定した一人または複数のユーザーのノート" userList: "指定したリストのユーザーのノート" + userBlacklist: "指定した一人または複数のユーザーを除いた全てのノート" _weekday: sunday: "日曜日" @@ -1910,6 +1951,7 @@ _profile: metadataContent: "内容" changeAvatar: "アイコン画像を変更" changeBanner: "バナー画像を変更" + verifiedLinkDescription: "内容にURLを設定すると、リンク先のWebサイトに自分のプロフィールへのリンクが含まれている場合に所有者確認済みアイコンを表示させることができます。" _exportOrImport: allNotes: "全てのノート" @@ -2038,12 +2080,18 @@ _notification: youReceivedFollowRequest: "フォローリクエストが来ました" yourFollowRequestAccepted: "フォローリクエストが承認されました" pollEnded: "アンケートの結果が出ました" + newNote: "新しい投稿" unreadAntennaNote: "アンテナ {name}" emptyPushNotificationMessage: "プッシュ通知の更新をしました" achievementEarned: "実績を獲得" + testNotification: "通知テスト" + checkNotificationBehavior: "通知の表示を確かめる" + sendTestNotification: "テスト通知を送信する" + notificationWillBeDisplayedLikeThis: "通知はこのように表示されます" _types: all: "すべて" + note: "ユーザーの新規投稿" follow: "フォロー" mention: "メンション" reply: "リプライ" @@ -2079,6 +2127,8 @@ _deck: introduction2: "画面の右にある + を押して、いつでもカラムを追加できます。" widgetsIntroduction: "カラムのメニューから、「ウィジェットの編集」を選択してウィジェットを追加してください" useSimpleUiForNonRootPages: "非ルートページは簡易UIで表示" + usedAsMinWidthWhenFlexible: "「幅を自動調整」が有効の場合、これが幅の最小値となります" + flexible: "幅を自動調整" _columns: main: "メイン" @@ -2136,3 +2186,28 @@ _abuse: reportContentPattern: "通報内容のパターン" list: "一覧" resolver: "リソルバー" + +_moderationLogTypes: + assignRole: "ロールへアサイン" + unassignRole: "ロールのアサイン解除" + updateRole: "ロール設定更新" + suspend: "凍結" + unsuspend: "凍結解除" + addCustomEmoji: "カスタム絵文字追加" + updateCustomEmoji: "カスタム絵文字更新" + deleteCustomEmoji: "カスタム絵文字削除" + updateServerSettings: "サーバー設定更新" + updateUserNote: "モデレーションノート更新" + deleteDriveFile: "ファイルを削除" + deleteNote: "ノートを削除" + createGlobalAnnouncement: "全体のお知らせを作成" + createUserAnnouncement: "ユーザーへお知らせを作成" + updateGlobalAnnouncement: "全体のお知らせを更新" + updateUserAnnouncement: "ユーザーのお知らせを更新" + deleteGlobalAnnouncement: "全体のお知らせを削除" + deleteUserAnnouncement: "ユーザーのお知らせを削除" + resetPassword: "パスワードをリセット" + suspendRemoteInstance: "リモートサーバーを停止" + unsuspendRemoteInstance: "リモートサーバーを再開" + markSensitiveDriveFile: "ファイルをセンシティブ付与" + unmarkSensitiveDriveFile: "ファイルをセンシティブ解除" diff --git a/locales/ja-KS.yml b/locales/ja-KS.yml index 638cb507d1..6380925c36 100644 --- a/locales/ja-KS.yml +++ b/locales/ja-KS.yml @@ -76,7 +76,7 @@ files: "ファイル" download: "ダウンロード" driveFileDeleteConfirm: "ファイル「{name}」をほかしてええか?このファイルを添付したノートも消えてまうで。" unfollowConfirm: "{name}のフォローを解除してもええんか?" -exportRequested: "エクスポートしてな、ってリクエストしたけど、これ多分めっちゃ時間かかるで。エクスポート終わったら「ドライブ」に突っ込んどくで。" +exportRequested: "エクスポートしてな、って言うたけど、これ多分めっちゃ時間かかるで。エクスポート終わったら「ドライブ」に突っ込んどくで。" importRequested: "インポートしてな、ってリクエストしたけど、これ多分めっちゃ時間かかるで。" lists: "リスト" noLists: "リストなんてあらへんで" @@ -156,6 +156,7 @@ addEmoji: "絵文字を追加" settingGuide: "ええ感じの設定" cacheRemoteFiles: "リモートのファイルをキャッシュする" cacheRemoteFilesDescription: "この設定を切っとったら、リモートファイルをキャッシュせんと直リンクするようになるで。サーバーの容量は節約できるけど、サムネイルを作らんなるから通信量が増えるで。" +youCanCleanRemoteFilesCache: "ファイル管理にある🗑️ボタンでキャッシュ全部ほかすで。" cacheRemoteSensitiveFiles: "リモートのセンシティブなファイルをキャッシュする" cacheRemoteSensitiveFilesDescription: "この設定を無効にすると、リモートのセンシティブなファイルはキャッシュせず直リンクするようになるで。" flagAsBot: "Botにするで" @@ -354,7 +355,6 @@ invite: "来てや" driveCapacityPerLocalAccount: "ローカルユーザーはんひとりあたりのドライブ容量" driveCapacityPerRemoteAccount: "リモートユーザーはんひとりあたりのドライブ容量" inMb: "メガバイト単位" -iconUrl: "アイコン画像のURL" bannerUrl: "バナー画像のURL" backgroundImageUrl: "背景画像のURL" basicInfo: "基本情報" @@ -414,6 +414,8 @@ totp: "認証アプリ" totpDescription: "認証アプリ使うてワンタイムパスワードを入れる" moderator: "モデレーター" moderation: "モデレーション" +moderationNote: "モデレーションノート" +addModerationNote: "モデレーションノートを追加するで" nUsersMentioned: "{n}人が投稿" securityKeyAndPasskey: "セキュリティキー・パスキー" securityKey: "セキュリティキー" @@ -680,6 +682,7 @@ createNewClip: "新しいクリップを作るで" unclip: "クリップ解除するで" confirmToUnclipAlreadyClippedNote: "このノートはすでにクリップ「{name}」に含まれとるで。ノートをこのクリップから除外しよか?" public: "パブリック" +private: "非公開" i18nInfo: "Misskeyは有志によっていろんな言語に翻訳されとるで。{link}で翻訳に協力したってやー。" manageAccessTokens: "アクセストークンの管理" accountInfo: "アカウント情報" @@ -699,7 +702,7 @@ no: "あかん" driveFilesCount: "ドライブのファイル数" driveUsage: "ドライブ使用量やで" noCrawle: "クローラーによるインデックスを拒否するで" -noCrawleDescription: "検索エンジンにあんたのユーザーページ、ノート、Pagesとかのコンテンツを登録(インデックス)せぇへんように頼むで。" +noCrawleDescription: "検索エンジンにあんたのユーザーページ、ノート、Pagesとかのコンテンツを登録(インデックス)せんように頼むで。邪魔すんねんやったら帰って〜。" lockedAccountInfo: "フォローを承認制にしとっても、ノートの公開範囲を「フォロワー」にせぇへん限り、誰でもあんたのノートを見れるで。" alwaysMarkSensitive: "デフォルトでメディアを閲覧注意にするで" loadRawImages: "添付画像のサムネイルをオリジナル画質にするで" @@ -745,7 +748,7 @@ value: "値" createdAt: "作成した日" updatedAt: "更新日時" saveConfirm: "保存するで?" -deleteConfirm: "ホンマに削除するで?" +deleteConfirm: "ホンマにほかすで?" invalidValue: "有効な値じゃないみたいやで。" registry: "レジストリ" closeAccount: "アカウントを閉鎖する" @@ -1018,7 +1021,6 @@ retryAllQueuesConfirmText: "一時的にサーバー重なるかもしれへん enableChartsForRemoteUser: "リモートユーザーのチャートを作る" enableChartsForFederatedInstances: "リモートサーバーのチャートを作る" showClipButtonInNoteFooter: "ノートのアクションにクリップを追加" -largeNoteReactions: "ノートのツッコミを大きする" noteIdOrUrl: "ノートIDかURL" video: "動画" videos: "動画" @@ -1070,7 +1072,7 @@ later: "あとで" goToMisskey: "Misskeyへ" additionalEmojiDictionary: "絵文字の追加辞書" installed: "インストール済み" -branding: "あ" +branding: "ブランディング" enableServerMachineStats: "サーバーのマシン情報見せびらかすで" enableIdenticonGeneration: "ユーザーごとのIdenticon生成を有効にする" turnOffToImprovePerformance: "オフにしたらえらい軽うなるで。" @@ -1094,6 +1096,24 @@ expired: "期限切れ" doYouAgree: "同意するんか?" beSureToReadThisAsItIsImportant: "重要やから絶対読んでや。" iHaveReadXCarefullyAndAgree: "「{x}」の内容をよう読んで、同意するで。" +dialog: "ダイアログ" +icon: "アイコン" +forYou: "あんたへ" +currentAnnouncements: "現在のお知らせやで" +pastAnnouncements: "過去のお知らせやで" +youHaveUnreadAnnouncements: "あんたまだこのお知らせ読んどらんやろ。" +useSecurityKey: "ブラウザまたはデバイスの言う通りに、セキュリティキーまたはパスキーを使ってや。" +replies: "返事" +renotes: "Renote" +_announcement: + forExistingUsers: "もうおるユーザーのみ" + forExistingUsersDescription: "有効にすると、このお知らせ作成時点でおるユーザーにのみお知らせが表示されます。無効にすると、このお知らせ作成後にアカウントを作成したユーザーにもお知らせが表示されます。" + needConfirmationToRead: "既読にするのに確認が必要やで" + needConfirmationToReadDescription: "有効にすると、このお知らせを既読にする際に確認ダイアログが表示されます。また、一括既読操作の対象にもなりません。" + end: "お知らせを終了" + tooManyActiveAnnouncementDescription: "アクティブなお知らせが多いため、UXが低下する可能性があります。終了したお知らせはアーカイブすることを検討した方がええよ。" + readConfirmTitle: "既読にしてええんやな?" + readConfirmText: "「{title}」の内容を読み、既読にします。" _initialAccountSetting: accountCreated: "アカウント作り終わったで。" letsStartAccountSetup: "アカウントの初期設定をしよか。" @@ -1111,6 +1131,8 @@ _initialAccountSetting: laterAreYouSure: "初期設定あとでやり直すん?" _serverRules: description: "新規登録前に見せる、サーバーの簡潔なルールを設定すんで。内容は使うための決め事の要約とすることを推奨するわ。" +_serverSettings: + iconUrl: "アイコン画像のURL" _accountMigration: moveFrom: "別のアカウントからこのアカウントに引っ越す" moveFromSub: "別のアカウントへエイリアスを作る" @@ -1488,6 +1510,7 @@ _plugin: install: "プラグインのインストール" installWarn: "信頼できへんプラグインはインストールせんとってな" manage: "プラグインの管理" + viewSource: "ソースを表示" _preferencesBackups: list: "作ったバックアップ" saveNew: "新しく保存" @@ -1675,11 +1698,9 @@ _timelineTutorial: _2fa: alreadyRegistered: "もう設定終わっとるわ。" registerTOTP: "認証アプリの設定はじめる" - passwordToTOTP: "パスワードを入れてーや" step1: "ほんなら、{a}や{b}とかの認証アプリを使っとるデバイスにインストールしてな。" step2: "次に、ここにあるQRコードをアプリでスキャンしてな~。" step2Click: "QRコードをクリックすると、今使とる端末に入っとる認証アプリとかキーリングに登録できるで。" - step2Url: "デスクトップアプリやったら次のURLを入力してや:" step3Title: "確認コードを入れてーや" step3: "アプリに表示されているトークンを入力して終わりや。" step4: "これからログインするときも、同じようにトークンを入力するんやで\n\n認証アプリが使えなくなった時、アカウントへの緊急アクセスのためのバックアップコードを作成しました。\n紛失防止のため、必ず安全な場所に保管してください。\nこれらのコードはそれぞれ1回だけ使用することができます。\nもし全てのコードを使い切ってしまうとアカウントにアクセスすることができなくなってしまうので、出来るだけ早く認証アプリを再設定してください。\n\nバックアップコード:\n\n{codes}" @@ -1693,7 +1714,7 @@ _2fa: removeKeyConfirm: "{name}を消すん?" whyTOTPOnlyRenew: "セキュリティキーが登録されとったら、認証アプリの設定は解除できへんで。" renewTOTP: "認証アプリをもっかい設定" - renewTOTPConfirm: "今までの人称アプリの確認コードとバックアップコードは使えんくなるけどええか?" + renewTOTPConfirm: "今までの認証アプリの確認コードは使えんくなるけどええか?" renewTOTPOk: "もっかい設定する" renewTOTPCancel: "やめとく" _permissions: @@ -1729,6 +1750,10 @@ _permissions: "write:gallery": "ギャラリーを操作するで" "read:gallery-likes": "ギャラリーのいいねを見るで" "write:gallery-likes": "ギャラリーのいいねを操作するで" + "read:flash": "Playを見る" + "write:flash": "Playを操作する" + "read:flash-likes": "Playのええやん!を見る" + "write:flash-likes": "Playのええやん!を見る" _auth: shareAccessTitle: "アプリへのアクセス許してやったらどうや" shareAccess: "「{name}」がアカウントにアクセスすることを許可してええか?" @@ -2033,3 +2058,6 @@ _webhookSettings: renote: "Renoteされるとき~!" reaction: "ツッコミがあるとき~!" mention: "メンションがあるとき~!" +_moderationLogTypes: + suspend: "凍結" + resetPassword: "パスワードをリセット" diff --git a/locales/jbo-EN.yml b/locales/jbo-EN.yml index ed97d539c0..d4fea291d7 100644 --- a/locales/jbo-EN.yml +++ b/locales/jbo-EN.yml @@ -1 +1,3 @@ --- +_lang_: "la .lojban." +headlineMisskey: "lo se tcana noi jorne fi loi notci" diff --git a/locales/kab-KAB.yml b/locales/kab-KAB.yml index 18fd8f5a58..22e24d3baa 100644 --- a/locales/kab-KAB.yml +++ b/locales/kab-KAB.yml @@ -56,6 +56,7 @@ accounts: "Imiḍan" searchByGoogle: "Nadi" file: "Ifuyla" account: "Imiḍan" +replies: "Err" _email: _follow: title: "Yeṭṭafaṛ-ik·em-id" diff --git a/locales/kn-IN.yml b/locales/kn-IN.yml index ef66f3fbd2..b3ad46f2b1 100644 --- a/locales/kn-IN.yml +++ b/locales/kn-IN.yml @@ -61,6 +61,7 @@ smtpPass: "ಗುಪ್ತಪದ" user: "ಬಳಕೆದಾರ" searchByGoogle: "ಹುಡುಕು" file: "ಕಡತಗಳು" +replies: "ಉತ್ತರಿಸು" _email: _follow: title: "ಹಿಂಬಾಲಿಸಿದರು" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 2a4011300f..4ab0c49b81 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -2,20 +2,20 @@ _lang_: "한국어" headlineMisskey: "노트로 연결되는 네트워크" introMisskey: "환영합니다! Misskey는 오픈 소스 분산형 마이크로 블로그 서비스입니다.\n'노트'를 작성해서 지금 일어나고 있는 일을 공유하거나, 당신만의 이야기를 모두에게 발신하세요📡\n'리액션' 기능으로 친구의 노트에 총알같이 반응을 추가할 수도 있습니다👍\n새로운 세계를 탐험해 보세요🚀" -poweredByMisskeyDescription: "{name}은(는) 오픈소스 플랫폼 Misskey를 사용한 서버 가운데 하나입니다." +poweredByMisskeyDescription: "{name}은(는) 오픈소스 플랫폼Misskey를 사용한 서비스(Misskey 인스턴스라고 불립니다) 중 하나입니다." monthAndDay: "{month}월 {day}일" search: "검색" notifications: "알림" username: "유저명" password: "비밀번호" forgotPassword: "비밀번호 재설정" -fetchingAsApObject: "연합에서 조회 중" +fetchingAsApObject: "연합에 조회 중" ok: "확인" gotIt: "알겠어요" cancel: "취소" noThankYou: "나중에" enterUsername: "유저명 입력" -renotedBy: "{user}님의 리노트" +renotedBy: "{user}님이 리노트" noNotes: "노트가 없습니다" noNotifications: "표시할 알림이 없습니다" instance: "서버" @@ -45,6 +45,7 @@ pin: "프로필에 고정" unpin: "프로필에서 고정 해제" copyContent: "내용 복사" copyLink: "링크 복사" +copyLinkRenote: "Renote 링크 복사" delete: "삭제" deleteAndEdit: "삭제 후 편집" deleteAndEditConfirm: "이 노트를 삭제한 뒤 다시 편집하시겠습니까? 이 노트에 대한 리액션, 리노트, 답글 또한 모두 삭제됩니다." @@ -155,7 +156,8 @@ emojiUrl: "이모지 URL" addEmoji: "이모지 추가" settingGuide: "추천 설정" cacheRemoteFiles: "리모트 파일을 캐시" -cacheRemoteFilesDescription: "이 설정을 해지하면 리모트 파일을 캐시하지 않고 해당 파일을 직접 링크하게 됩니다. 그에 따라 서버의 저장 공간을 절약할 수 있지만, 썸네일이 생성되지 않기 때문에 통신량이 증가합니다." +cacheRemoteFilesDescription: "이 설정을 활성화하면 리모트 파일을 이 서버의 스토리지에 캐시합니다. 미디어의 표시가 빨라지지만, 서버의 저장 용량을 크게 소모합니다. 리모트 유저의 미디어를 얼마나 보관할 지는 역할의 드라이브 용량 제한에 따라 결정되며, 정해진 용량을 넘길 경우 오래된 파일부터 차례대로 삭제한 뒤 링크로 전환합니다. \n비활성화하면 리모트 파일을 직접 링크하며, 이 경우 이미지 썸네일 생성 및 유저 프라이버시 보호를 위해 default.yml에서 proxyRemoteFiles를 true로 설정하는 것을 권장합니다." +youCanCleanRemoteFilesCache: "파일 관리 화면의 🗑️ 버튼을 눌러 모든 캐시를 삭제할 수 있습니다." cacheRemoteSensitiveFiles: "리모트의 민감한 파일을 캐시" cacheRemoteSensitiveFilesDescription: "이 설정을 비활성화하면 리모트의 민감한 파일은 캐시하지 않고 리모트에서 직접 가져오도록 합니다." flagAsBot: "나는 봇입니다" @@ -329,7 +331,7 @@ watch: "지켜보기" unwatch: "지켜보기 해제" accept: "허가" reject: "거부" -normal: "정상" +normal: "일반" instanceName: "서버 이름" instanceDescription: "서버 소개" maintainerName: "관리자 이름" @@ -354,7 +356,6 @@ invite: "초대" driveCapacityPerLocalAccount: "로컬 유저 한 명당 드라이브 용량" driveCapacityPerRemoteAccount: "리모트 유저 한 명당 드라이브 용량" inMb: "메가바이트 단위" -iconUrl: "아이콘 URL" bannerUrl: "배너 이미지 URL" backgroundImageUrl: "배경 이미지 URL" basicInfo: "기본 정보" @@ -410,9 +411,9 @@ aboutMisskey: "Misskey에 대하여" administrator: "관리자" token: "토큰" 2fa: "2단계 인증" +setupOf2fa: "2단계 인증 설정" totp: "인증 앱" totpDescription: "인증 앱을 사용하여 일회성 비밀번호 입력" -useSecurityKey: "브라우저 또는 장치의 안내에 따라 보안 키 또는 패스키를 사용해 주세요." moderator: "모더레이터" moderation: "모더레이션" nUsersMentioned: "{n}명이 언급함" @@ -654,6 +655,7 @@ behavior: "동작" sample: "예시" abuseReports: "신고" reportAbuse: "신고" +reportAbuseRenote: "Renote를 신고" reportAbuseOf: "{name}을 신고하기" fillAbuseReportDescription: "신고하려는 이유를 자세히 알려주세요. 특정 게시물을 신고할 때에는 게시물의 URL도 포함해 주세요." abuseReported: "신고를 보냈습니다. 신고해 주셔서 감사합니다." @@ -681,6 +683,7 @@ createNewClip: "새 클립 만들기" unclip: "클립 해제" confirmToUnclipAlreadyClippedNote: "이 노트는 이미 \"{name}\" 클립에 포함되어 있습니다. 클립을 해제하시겠습니까?" public: "공개" +private: "비공개" i18nInfo: "Misskey는 자원봉사자들에 의해 다양한 언어로 번역되고 있습니다. {link}에서 번역에 참가할 수 있습니다." manageAccessTokens: "액세스 토큰 관리" accountInfo: "계정 정보" @@ -877,7 +880,7 @@ numberOfColumn: "한 줄에 보일 리액션의 수" searchByGoogle: "검색" instanceDefaultLightTheme: "서버 기본 라이트 테마" instanceDefaultDarkTheme: "서버 기본 다크 테마" -instanceDefaultThemeDescription: "객체 형식의 테마 코드를 입력해 주세요." +instanceDefaultThemeDescription: "객체 형식({}로 감싼 형태)의 테마 코드를 입력해 주세요." mutePeriod: "뮤트할 기간" period: "기간" indefinitely: "무기한" @@ -1019,7 +1022,7 @@ retryAllQueuesConfirmText: "일시적으로 서버의 부하가 증가할 수 enableChartsForRemoteUser: "리모트 유저의 차트를 생성" enableChartsForFederatedInstances: "리모트 서버의 차트를 생성" showClipButtonInNoteFooter: "노트 동작에 클립을 추가" -largeNoteReactions: "노트의 리액션을 크게 표시" +reactionsDisplaySize: "리액션 표시 크기" noteIdOrUrl: "노트 ID 및 URL" video: "동영상" videos: "동영상" @@ -1092,6 +1095,27 @@ usedAt: "사용 시각" unused: "사용되지 않음" used: "사용됨" expired: "만료됨" +doYouAgree: "동의하십니까?" +beSureToReadThisAsItIsImportant: "중요하므로 반드시 읽어주십시오." +iHaveReadXCarefullyAndAgree: "\"{x}\"의 내용을 읽고 동의합니다." +dialog: "다이얼로그" +icon: "아바타" +forYou: "당신에게" +currentAnnouncements: "현재 공지사항" +pastAnnouncements: "과거 공지사항" +youHaveUnreadAnnouncements: "읽지 않은 공지사항이 있습니다." +useSecurityKey: "브라우저 또는 기기의 안내에 따라 보안 키 또는 패스키를 사용해 주십시오." +replies: "답글" +renotes: "리노트" +_announcement: + forExistingUsers: "기존 유저에게만 알림" + forExistingUsersDescription: "활성화하면 이 공지사항을 게시한 시점에서 이미 가입한 유저에게만 표시합니다. 비활성화하면 게시 후에 가입한 유저에게도 표시합니다." + needConfirmationToRead: "읽음으로 표시하기 전에 확인하기" + needConfirmationToReadDescription: "활성화하면 이 공지사항을 읽음으로 표시하기 전에 확인 알림창을 띄웁니다. '모두 읽음'의 대상에서도 제외됩니다." + end: "공지에서 내리기" + tooManyActiveAnnouncementDescription: "공지사항이 너무 많을 경우, 사용자 경험에 영향을 끼칠 가능성이 있습니다. 오래된 공지사항은 아카이브하시는 것을 권장드립니다." + readConfirmTitle: "읽음으로 표시합니까?" + readConfirmText: "\"{title}\"을(를) 읽음으로 표시합니다." _initialAccountSetting: accountCreated: "계정 생성이 완료되었습니다!" letsStartAccountSetup: "계정의 초기 설정을 진행합니다." @@ -1109,6 +1133,8 @@ _initialAccountSetting: laterAreYouSure: "초기 설정을 나중에 진행하시겠습니까?" _serverRules: description: "회원 가입 이전에 간단하게 표시할 서버 규칙입니다. 이용 약관의 요약으로 구성하는 것을 추천합니다." +_serverSettings: + iconUrl: "아이콘 URL" _accountMigration: moveFrom: "다른 계정에서 이 계정으로 이사" moveFromSub: "다른 계정에 대한 별칭을 생성" @@ -1486,6 +1512,7 @@ _plugin: install: "플러그인 설치" installWarn: "신뢰할 수 없는 플러그인은 설치하지 않는 것이 좋습니다." manage: "플러그인 관리" + viewSource: "소스 보기" _preferencesBackups: list: "생성한 백업" saveNew: "새 백업 만들기" @@ -1673,16 +1700,14 @@ _timelineTutorial: _2fa: alreadyRegistered: "이미 설정이 완료되었습니다." registerTOTP: "인증 앱 설정 시작" - passwordToTOTP: "비밀번호를 입력하세요." step1: "먼저, {a}나 {b}등의 인증 앱을 사용 중인 디바이스에 설치합니다." step2: "그 후, 표시되어 있는 QR코드를 앱으로 스캔합니다." step2Click: "QR 코드를 클릭하면 기기에 설치된 인증 앱에 등록할 수 있습니다." - step2Url: "데스크톱 앱에서는 다음 URL을 입력하세요:" + step2Uri: "데스크톱 앱을 사용하려면 다음 URI를 입력하십시오" step3Title: "인증 코드 입력" step3: "앱에 표시된 토큰을 입력하시면 완료됩니다." + setupCompleted: "설정 완료했습니다" step4: "다음 로그인부터는 토큰을 입력해야 합니다.\n\n인증 앱이 사용할 수 없게 되었을 때, 계정에 응급 접근할 수 있는 백업 코드를 생성했습니다.\n코드를 잃어버리지 않도록 안전한 곳에 보관해 두세요.\n코드는 각각 1번씩만 사용할 수 있습니다.\n만일 모든 코드를 사용해버렸다면 더이상 계정에 접근할 수 없게 되므로, 가능한 한 빨리 인증 앱을 다시 등록해 주세요.\n\n백업 코드:\n\n{code}" - twoFactorBackupSecretWarning: "백업 코드가 사용되었습니다. 인증 앱을 사용할 수 없는 경우, 가능한 한 빨리 인증 앱을 다시 등록해 주세요." - twoFactorBackupSecretExhausted: "백업 코드가 모두 사용되었습니다. 인증 앱을 사용할 수 없는 경우, 더이상 계정에 접근할 수 없게 됩니다. 가능한 한 빨리 인증 앱을 다시 등록해 주세요." securityKeyNotSupported: "이 브라우저는 보안 키를 지원하지 않습니다." registerTOTPBeforeKey: "보안 키 또는 패스키를 등록하려면 인증 앱을 등록하십시오." securityKeyInfo: "FIDO2를 지원하는 하드웨어 보안 키 혹은 디바이스의 지문인식이나 화면잠금 PIN을 이용해서 로그인하도록 설정할 수 있습니다." @@ -1696,6 +1721,11 @@ _2fa: renewTOTPConfirm: "기존에 등록되어 있던 인증 키와 백업 코드는 사용하지 못하게 됩니다." renewTOTPOk: "재설정" renewTOTPCancel: "취소" + checkBackupCodesBeforeCloseThisWizard: "이 위자드를 닫기 전에 아래 백업 코드를 확인하십시오" + backupCodes: "백업 코드" + backupCodesDescription: "인증 앱을 사용할 수 없게 된 경우 아래 백업 코드를 사용하여 계정에 액세스 할 수 있습니다.이 코드들은 반드시 안전한 장소에 보관하십시오.각 코드는 한 번만 사용할 수 있습니다." + backupCodeUsedWarning: "백업 코드가 사용되었습니다.인증 앱을 사용할 수 없게 된 경우, 조속히 인증 앱을 다시 설정해 주십시오." + backupCodesExhaustedWarning: "백업 코드가 모두 사용되었습니다.인증 앱을 사용할 수 없는 경우 더 이상 계정에 액세스하는 것이 불가능합니다.인증 앱을 다시 등록해 주세요." _permissions: "read:account": "계정의 정보를 봅니다" "write:account": "계정의 정보를 변경합니다" @@ -1729,6 +1759,10 @@ _permissions: "write:gallery": "갤러리를 추가하거나 삭제합니다" "read:gallery-likes": "갤러리의 좋아요를 확인합니다" "write:gallery-likes": "갤러리에 좋아요를 추가하거나 취소합니다" + "read:flash": "Play를 봅니다" + "write:flash": "Play를 조작합니다" + "read:flash-likes": "Play의 좋아요를 봅니다" + "write:flash-likes": "Play의 좋아요를 조작합니다" _auth: shareAccessTitle: "어플리케이션의 접근 허가" shareAccess: "\"{name}\" 이 계정에 접근하는 것을 허용하시겠습니까?" @@ -1964,6 +1998,10 @@ _notification: unreadAntennaNote: "안테나 {name}" emptyPushNotificationMessage: "푸시 알림이 갱신되었습니다" achievementEarned: "도전 과제를 달성했습니다" + testNotification: "알림 테스트" + checkNotificationBehavior: "알림 표시를 체크하기" + sendTestNotification: "테스트 알림 보내기" + notificationWillBeDisplayedLikeThis: "알림이 이렇게 표시됩니다" _types: all: "전부" follow: "팔로잉" @@ -1999,6 +2037,8 @@ _deck: introduction2: "나중에라도 화면 우측의 + 버튼을 눌러 새 칼럼을 추가할 수 있습니다." widgetsIntroduction: "칼럼 메뉴의 \"위젯 편집\"에서 위젯을 추가해 주세요" useSimpleUiForNonRootPages: "루트 이외의 페이지로 접속한 경우 UI 간략화하기" + usedAsMinWidthWhenFlexible: "'폭 자동 조정'이 활성화된 경우 최소 폭으로 사용됩니다" + flexible: "폭 자동 조정" _columns: main: "메인" widgets: "위젯" @@ -2033,3 +2073,6 @@ _webhookSettings: renote: "누군가 내 글을 Renote했을 때" reaction: "누군가 내 노트에 리액션했을 때" mention: "누군가 나를 멘션했을 때" +_moderationLogTypes: + suspend: "정지" + resetPassword: "비밀번호 재설정" diff --git a/locales/lo-LA.yml b/locales/lo-LA.yml index 4f73b70550..22cb5857f9 100644 --- a/locales/lo-LA.yml +++ b/locales/lo-LA.yml @@ -107,7 +107,11 @@ enterEmoji: "ປ້ອນອີໂມຈິ" renote: "Renote" unrenote: "ເລີກ Renote" renoted: "ເກັບບັນທຶກໄວ້" +cantRenote: "ໂພສນີ້ບໍ່ສາມາດຖືກບັນທຶກໄວ້ຄືນໃໝ່ໄດ້" +cantReRenote: "ບໍ່ສາມາດບັນທຶກຄືນໃໝ່ໄດ້" quote: "ລວມຂໍ້ຄວາມອ້າງອີງ" +inChannelRenote: "ຊ່ອງພຽງແຕ່ Renote" +inChannelQuote: "ຊ່ອງເທົ່ານັ້ນ Quote" pinnedNote: "ບັນທຶກທີ່ປັກໝຸດໄວ້" pinned: "ປັກໝຸດໄປຫາໂປຣໄຟລ໌" you: "ເຈົ້າ" @@ -226,9 +230,12 @@ fromUrl: "ຈາກ URL" uploadFromUrl: "ອັບໂຫຼດຈາກ URL" uploadFromUrlDescription: "URL ຂອງໄຟລ໌ທີ່ທ່ານຕ້ອງການອັບໂຫລດ" uploadFromUrlRequested: "ຮ້ອງຂໍການອັບໂຫລດ" +explore: "ສຳຫຼວດ" messageRead: "ອ່ານແລ້ວ" startMessaging: "ເລີ່ມການສົນທະນາໃໝ່" nUsersRead: "ອ່ານໂດຍ {n}" +agree: "ຍອມຮັບ" +termsOfService: "ເງື່ອນໄຂການບໍລິການ" start: "ເລີ່ມຕົ້ນນຳໃຊ້ເລີຍ" home: "ໜ້າຫຼັກ" activity: "ກິດຈະກຳ" @@ -266,6 +273,7 @@ inputNewDescription: "ໃສ່ຄຳບັນຍາຍໃໝ່" inputNewFolderName: "ໃສ່ຊື່ໂຟນເດີໃໝ່" circularReferenceFolder: "ໂຟນເດີປາຍທາງແມ່ນໂຟນເດີຍ່ອຍຂອງໂຟນເດີທີ່ທ່ານຕ້ອງການຍ້າຍ" rename: "ປ່ຽນຊື່" +doNothing: "ບໍ່ສົນໃຈ" watch: "ເບິ່ງ" unwatch: "ຢຸດເບິ່ງ" accept: "ອະນຸຍາດ" @@ -294,7 +302,14 @@ enableRegistration: "ເປີດໃຊ້ການລົງທະບຽນຜ invite: "ເຊີນ" driveCapacityPerLocalAccount: "ຄວາມອາດສາມາດຂັບຕໍ່ຜູ້ໃຊ້ທ້ອງຖິ່ນ" driveCapacityPerRemoteAccount: "ໄດຣຟ໌ຄວາມອາດສາມາດຕໍ່ຜູ້ໃຊ້ທາງໄກ" +basicInfo: "ຂໍ້ມຸນເບື້ອງຕົ້ນ" pinnedNotes: "ບັນທຶກທີ່ປັກໝຸດໄວ້" +hcaptchaSiteKey: "ກະແຈໄຊທ໌" +hcaptchaSecretKey: "ກະແຈລັບ" +recaptcha: "reCAPTCHA" +enableRecaptcha: "ເປີດໃຊ້ງານລີແຄ໋ບຈາ" +recaptchaSiteKey: "ກະແຈໄຊທ໌" +recaptchaSecretKey: "ກະແຈລັບ" turnstileSiteKey: "ກະແຈໄຊທ໌" turnstileSecretKey: "ກະແຈລັບ" name: "ຊື່" @@ -302,24 +317,41 @@ userList: "ລາຍການ" about: "ກ່ຽວກັບ" aboutMisskey: "ກ່ຽວກັບ Misskey" administrator: "ຜູ້ບໍລິຫານ" +token: "ໂທເຄັນ" share: "ແບ່ງປັນ" notFound: "ບໍ່ພົບ" cacheClear: "ລຶບລ້າງແຄສ" +help: "ຊ່ວຍເຫຼືອ" +close: "ປິດ" invites: "ເຊີນ" +members: "ສະມາຊິກ" +transfer: "ໂອນຍ້າຍ" title: "ຫົວຂໍ້" text: "ຂໍ້ຄວາມ" enable: "ເປີດໃຊ້" next: "ຕໍ່ໄປ" +retype: "ເຂົ້າໄປອີກຄັ້ງ" +quoteAttached: "ວົງຢືມ" invitations: "ເຊີນ" +unavailable: "ບໍ່​ສາ​ມາດ​ໃຊ້​ໄດ້" language: "ພາສາ" +aboutX: "ກ່ຽວກັບ {x}" +emojiStyle: "ຮູບແບບອີໂມຈິ" native: "ພາ​ສາ​ແມ່" +noHistory: "​ບໍ່​ມີ​ລາຍ​ການ​ຢູ່​ບ່ອນ​ນີ້" +doing: "ກຳລັງປະມວນຜົນ..." category: "ຫມວດຫມູ່" tags: "ແທ໋ກ" createAccount: "ສ້າງບັນຊີ" existingAccount: "ທີ່ມີຢູ່" dashboard: "ໜ້າປັດ" local: "ທ້ອງຖິ່ນ" +numberOfDays: "ຈຳນວນມື້" +objectStorageBucket: "Bucket" +objectStoragePrefix: "Prefix" +objectStorageEndpoint: "Endpoint" objectStorageRegion: "ພາກ​ພື້ນ" +deleteAll: "ລຶບທັງໝົດ" sounds: "ສຽງ" sound: "ສຽງ" none: "ບໍ່ມີ" @@ -333,18 +365,42 @@ ascendingOrder: "ນ້ອຍໄປຫາໃຫຍ່" descendingOrder: "ໃຫຍ່ຫານ້ອຍ" output: "ຜົນຜະລິດ" script: "ບົດ​ຄວາມ" +menu: "ເມນູ" +rearrange: "ຈັດລຽງຄືນ" +poll: "ການພູນ" +description: "ລາຍລະອຽດ" +author: "ຜູ້ຂຽນ" +manage: "ການຈັດການ" +plugins: "ປລັ໋ກອີນ" +width: "ກວ້າງ" +height: "ຄວາມສູງ" +large: "ໃຫຍ່." +medium: "ປານກາງ" +small: "ເລັກ" +permission: "ການອະນຸຍາດ" +notificationType: "​ປະເພດການ​ແຈ້ງ​ເຕືອນ" +edit: "ແກ້ໄຂ" +email: "ອີເມວ" smtpHost: "ໂຮດສ" smtpUser: "ຊື່ຜູ້ໃຊ້" smtpPass: "ລະຫັດຜ່ານ" clearCache: "ລຶບລ້າງແຄສ" info: "ກ່ຽວກັບ" user: "ຜູ້ໃຊ້ຕ່າງໆ" +administration: "ການຈັດການ" +middle: "ປານກາງ" searchByGoogle: "ຄົ້ນຫາ" file: "ໄຟລ໌" +replies: "ຕອບ​ໄປ​ທີ" +renotes: "Renote" +_role: + _priority: + middle: "ປານກາງ" _email: _follow: title: "ໄດ້ຕິດຕາມທ່ານ" _theme: + description: "ລາຍລະອຽດ" keys: mention: "ໄດ້ກ່າວມາ" renote: "Renote" @@ -383,6 +439,7 @@ _timelines: home: "ໜ້າຫຼັກ" _play: script: "ບົດ​ຄວາມ" + summary: "ລາຍລະອຽດ" _pages: blocks: image: "ຮູບພາບ" @@ -406,3 +463,5 @@ _deck: mentions: "ກ່າວເຖິງ" _webhookSettings: name: "ຊື່" +_moderationLogTypes: + suspend: "ລະງັບ" diff --git a/locales/nl-NL.yml b/locales/nl-NL.yml index ae2881a7d4..fd9ffa33f2 100644 --- a/locales/nl-NL.yml +++ b/locales/nl-NL.yml @@ -338,7 +338,6 @@ invite: "Uitnodigen" driveCapacityPerLocalAccount: "Opslagruimte per lokale gebruiker" driveCapacityPerRemoteAccount: "Opslagruimte per externe gebruiker" inMb: "in megabytes" -iconUrl: "Pictogram URL" bannerUrl: "Banner URL" backgroundImageUrl: "URL afbeelding" basicInfo: "Basisinformatie" @@ -426,6 +425,9 @@ pushNotificationAlreadySubscribed: "Pushberichtrn al ingeschakeld" windowMaximize: "Maximaliseren" windowRestore: "Herstellen" loggedInAsBot: "Momenteel als bot ingelogd" +icon: "Avatar" +replies: "Antwoord" +renotes: "Herdelen" _email: _follow: title: "volgde jou" @@ -492,3 +494,6 @@ _deck: mentions: "Vermeldingen" _webhookSettings: name: "Naam" +_moderationLogTypes: + suspend: "Opschorten" + resetPassword: "Wachtwoord terugzetten" diff --git a/locales/no-NO.yml b/locales/no-NO.yml index ec2900527b..00f22c0c4f 100644 --- a/locales/no-NO.yml +++ b/locales/no-NO.yml @@ -461,6 +461,9 @@ videos: "Videoer" continue: "Fortsett" youFollowing: "Følger" options: "Alternativ" +icon: "Avatar" +replies: "Svar" +renotes: "Renote" _initialAccountSetting: theseSettingsCanEditLater: "Du kan endre disse innstillingene senere." _achievements: @@ -722,3 +725,5 @@ _deck: direct: "Direkte" _webhookSettings: name: "Navn" +_moderationLogTypes: + suspend: "Suspender" diff --git a/locales/pl-PL.yml b/locales/pl-PL.yml index d902d609be..a53376b6e9 100644 --- a/locales/pl-PL.yml +++ b/locales/pl-PL.yml @@ -333,7 +333,6 @@ invite: "Zaproś" driveCapacityPerLocalAccount: "Powierzchnia dyskowa na lokalnego użytkownika" driveCapacityPerRemoteAccount: "Powierzchnia dyskowa na zdalnego użytkownika" inMb: "W megabajtach" -iconUrl: "Adres URL ikony" bannerUrl: "Adres URL banera" backgroundImageUrl: "Adres URL tła" basicInfo: "Podstawowe informacje" @@ -644,6 +643,7 @@ createNewClip: "Utwórz nowy klip" unclip: "Odczep" confirmToUnclipAlreadyClippedNote: "Ten wpis jest już częścią klipu \"{name}\". Czy chcesz ją usunąć z tego klipu?" public: "Publiczny" +private: "Prywatne" i18nInfo: "Misskey jest tłumaczone na wiele języków przez wolontariuszy. Możesz pomóc na {link}." manageAccessTokens: "Zarządzaj tokenami dostępu" accountInfo: "Informacje o koncie" @@ -870,6 +870,9 @@ like: "Polub" show: "Wyświetlanie" color: "Kolor" youFollowing: "Śledzeni" +icon: "Awatar" +replies: "Odpowiedz" +renotes: "Udostępnij" _role: priority: "Priorytet" _priority: @@ -922,6 +925,7 @@ _plugin: install: "Zainstaluj wtyczki" installWarn: "Nie instaluj niezaufanych wtyczek." manage: "Zarządzanie wtyczkami" + viewSource: "Zobacz źródło" _preferencesBackups: list: "Utworzone kopie zapasowe" saveNew: "Zapisz nową kopię zapasową" @@ -1089,6 +1093,8 @@ _2fa: step3: "Wprowadź token podany w aplikacji, aby ukończyć konfigurację." step4: "Od teraz, przy każdej próbie logowania otrzymasz prośbę o token logowania.\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" removeKeyConfirm: "Usunąć kopię zapasową {name}?" + renewTOTPConfirm: "Spowoduje to, że kody weryfikacyjne z poprzedniej aplikacji przestaną działać" + renewTOTPOk: "Rekonfiguruj" renewTOTPCancel: "Nie teraz" _permissions: "read:account": "Wyświetl informacje o swoim koncie" @@ -1102,8 +1108,10 @@ _permissions: "read:following": "Wyświetlanie informacji o obserwowanych" "write:following": "Obserwowanie lub cofanie obserwacji innych kont" "read:messaging": "Zobacz swoje czaty" + "write:messaging": "Tworzenie lub usuwanie wiadomości czatu" "read:mutes": "Wyświetlanie listy osób, które wyciszyłeś(-aś)" "write:mutes": "Edycja listy osób, które wyciszyłeś(-aś)" + "write:notes": "Tworzenie lub usuwanie wpisów" "read:notifications": "Wyświetlanie powiadomień" "write:notifications": "Działanie na powiadomieniach" "read:reactions": "Wyświetlanie reakcji" @@ -1119,9 +1127,23 @@ _permissions: "write:channels": "Edytuj swoje kanały" "read:gallery": "Zobacz swoją galerię" "write:gallery": "Edytuj swoją galerię" + "read:gallery-likes": "Wyświetlanie listy polubionych postów w galerii" + "write:gallery-likes": "Edytowanie listy polubionych postów w galerii" _auth: + shareAccessTitle: "Przyznawanie uprawnień aplikacji" shareAccess: "Czy chcesz autoryzować „{name}” do dostępu do tego konta?" + shareAccessAsk: "Czy na pewno chcesz zezwolić tej aplikacji na dostęp do Twojego konta?" + permission: "{name} żąda następujących uprawnień" permissionAsk: "Ta aplikacja wymaga następujących uprawnień:" + pleaseGoBack: "Proszę, wróć do aplikacji" + callback: "Powracanie do aplikacji" + denied: "Odmowa dostępu" + pleaseLogin: "Zaloguj się, aby autoryzować aplikacje." +_antennaSources: + all: "Wszystkie wpisy" + homeTimeline: "Wpisy obserwowanych użytkowników" + users: "Wpisy określonych użytkowników" + userList: "Wpisy z określonej listy użytkowników" _weekday: sunday: "Niedziela" monday: "Poniedziałek" @@ -1154,8 +1176,10 @@ _widgets: serverMetric: "Metryka serwera" aiscript: "Konsola AiScript" aichan: "Ai" + userList: "Lista użytkowników" _userList: chooseList: "Wybierz listę" + clicker: "Clicker" _cw: hide: "Ukryj" show: "Załaduj więcej" @@ -1187,10 +1211,16 @@ _visibility: public: "Publiczny" publicDescription: "Twój wpis pojawi się w publicznych osiach czasu" home: "Strona główna" + homeDescription: "Publikuj tylko na głównej osi czasu" followers: "Obserwujący" + followersDescription: "Widoczne tylko dla obserwujących" specified: "Bezpośredni" specifiedDescription: "Napisz tylko określonym użytkownikom" + disableFederationDescription: "Nie przesyłaj do innych instancji" _postForm: + replyPlaceholder: "Odpowiedz na ten wpis..." + quotePlaceholder: "Zacytuj ten wpis…" + channelPlaceholder: "Publikuj na kanale..." _placeholders: a: "Co się dzieje?" b: "Co się wydarzyło?" @@ -1212,17 +1242,29 @@ _profile: changeBanner: "Zmień baner" _exportOrImport: allNotes: "Wszystkie wpisy" + favoritedNotes: "Ulubione wpisy" followingList: "Obserwowani" muteList: "Wycisz" blockingList: "Zablokuj" userLists: "Listy" + excludeMutingUsers: "Wyklucz wyciszonych użytkowników" + excludeInactiveUsers: "Wyklucz nieaktywnych użytkowników" _charts: federation: "Federacja" apRequest: "Żądania" + usersIncDec: "Różnica w liczbie użytkowników" usersTotal: "Łącznie # użytkowników" activeUsers: "Aktywni użytkownicy" + notesIncDec: "Różnica w liczbie wpisów" + notesTotal: "Całkowita liczba wpisów" + filesIncDec: "Różnica w liczbie plików" + filesTotal: "Całkowita liczba plików" + storageUsageIncDec: "Różnica w wykorzystaniu pamięci" + storageUsageTotal: "Całkowite wykorzystanie pamięci" _instanceCharts: requests: "Żądania" + users: "Różnica w liczbie użytkowników" + notes: "Różnica w liczbie wpisów" notesTotal: "Łącznie # wpisów" ff: "Różnica w # obserwujących" ffTotal: "Łączna liczba # obserwujących" @@ -1347,5 +1389,19 @@ _deck: mentions: "Wspomnienia" direct: "Bezpośredni" _webhookSettings: + createWebhook: "Stwórz Webhook" name: "Nazwa" + secret: "Sekret" + events: "Uruchomienie Webhooka" active: "Właczono" + _events: + follow: "Po zaobserwowaniu użytkownika" + followed: "Po zostaniu zaobserwowanym" + note: "Po opublikowaniu wpisu" + reply: "Po otrzymaniu odpowiedzi" + renote: "Po udostępnieniu wpisu" + reaction: "Po otrzymaniu reakcji" + mention: "Po zostaniu wspomnianym" +_moderationLogTypes: + suspend: "Zawieś" + resetPassword: "Zresetuj hasło" diff --git a/locales/pt-PT.yml b/locales/pt-PT.yml index 18fe955eae..f9e777bc75 100644 --- a/locales/pt-PT.yml +++ b/locales/pt-PT.yml @@ -4,7 +4,7 @@ headlineMisskey: "Uma rede ligada por notas" introMisskey: "Bem-vindo! O Misskey é um serviço de microblog descentralizado de código aberto.\nCrie \"notas\" para compartilhar o que está acontecendo agora ou para se expressar com todos à sua volta 📡\nVocê também pode adicionar rapidamente reações às notas de outras pessoas usando a função \"Reações\" 👍\nVamos explorar um novo mundo 🚀" poweredByMisskeyDescription: "{name} é um dos servidores da plataforma de código aberto Misskey." monthAndDay: "{day}/{month}" -search: "Buscar" +search: "Pesquisar" notifications: "Notificações" username: "Nome de usuário" password: "Senha" @@ -25,36 +25,37 @@ basicSettings: "Configurações básicas" otherSettings: "Outras configurações" openInWindow: "Abrir em um janela" profile: "Perfil" -timeline: "Timeline" +timeline: "Linha do tempo" noAccountDescription: "Este usuário não tem uma descrição." login: "Iniciar sessão" loggingIn: "Iniciando sessão…" logout: "Sair" signup: "Registrar-se" uploading: "Enviando…" -save: "Guardar" +save: "Salvar" users: "Usuários" addUser: "Adicionar usuário" favorite: "Adicionar aos favoritos" -favorites: "Adicionar aos favoritos" +favorites: "Favoritos" unfavorite: "Remover dos favoritos" favorited: "Adicionado aos favoritos." alreadyFavorited: "Já adicionado aos favoritos." cantFavorite: "Não foi possível adicionar aos favoritos." -pin: "Afixar no perfil" +pin: "Fixar no perfil" unpin: "Desafixar do perfil" copyContent: "Copiar conteúdos" copyLink: "Copiar link" +copyLinkRenote: "Copiar o link da repostagem" delete: "Excluir" deleteAndEdit: "Excluir e editar" deleteAndEditConfirm: "Deseja excluir esta nota e editá-la novamente? Todas as reações, compartilhamentos e respostas a esta nota também serão excluídas." addToList: "Adicionar a lista" addToAntenna: "Adicionar à antena" -sendMessage: "Enviar uma mensagem" +sendMessage: "Enviar mensagem" copyRSS: "Copiar RSS" copyUsername: "Copiar nome de utilizador" -copyUserId: "Copiar o ID do utilizador" -copyNoteId: "Copiar o ID da publicação" +copyUserId: "Copiar ID do utilizador" +copyNoteId: "Copiar ID da publicação" copyFileId: "Copiar o ID do arquivo" copyFolderId: "Copiar o ID da pasta" copyProfileUrl: "Copiar a URL do perfil" @@ -89,7 +90,7 @@ createList: "Criar lista" manageLists: "Gerenciar listas" error: "Erro" somethingHappened: "Ocorreu um erro" -retry: "Tentar novamente" +retry: "Tente novamente" pageLoadError: "Ocorreu um erro ao carregar a página." pageLoadErrorDescription: "Isso geralmente acontece devido ao cache do navegador ou da rede. Tente limpar o cache ou aguarde um pouco antes de tentar novamente." serverIsDead: "Não há resposta do servidor. Aguarde um momento e tente novamente." @@ -156,6 +157,7 @@ addEmoji: "Adicionar um Emoji" settingGuide: "Guia de configuração" cacheRemoteFiles: "Cache de arquivos remotos" cacheRemoteFilesDescription: "Ao desativar esta configuração, os arquivos remotos não serão mais armazenados em cache e serão vinculados diretamente. Isso economizará espaço de armazenamento no servidor, mas os thumbnails não serão gerados, o que pode aumentar o tráfego de dados." +youCanCleanRemoteFilesCache: "Pode excluir todos os caches com o botão 🗑️ de gestão de arquivos." cacheRemoteSensitiveFiles: "Fazer cache de arquivos remotos sensíveis" cacheRemoteSensitiveFilesDescription: "Desativar essa configuração faz com que arquivos remotos sensíveis sejam vinculados diretamente em vez de armazenados em cache." flagAsBot: "Marcar conta como robô" @@ -231,7 +233,7 @@ federating: "Federando" blocked: "Bloqueado" suspended: "Suspenso" all: "Todos" -subscribing: "Subscrito" +subscribing: "Inscrito" publishing: "Publicando" notResponding: "Sem resposta" instanceFollowing: "Seguir a instância" @@ -278,15 +280,15 @@ agreeBelow: "Eu concordo com o seguinte" basicNotesBeforeCreateAccount: "Observações importantes" termsOfService: "Termos de Uso" start: "começar" -home: "casa" +home: "Início" remoteUserCaution: "As informações estão incompletas porque é um utilizador remoto." activity: "atividade" images: "imagem" image: "imagem" -birthday: "aniversário" +birthday: "Aniversário" yearsOld: "{age} anos" registeredDate: "Data de registro" -location: "Lugar, colocar" +location: "Localização" theme: "tema" themeForLightMode: "Temas usados ​​no modo de luz" themeForDarkMode: "Temas usados ​​no modo escuro" @@ -295,7 +297,7 @@ dark: "Escuro" lightThemes: "Tema claro" darkThemes: "Tema escuro" syncDeviceDarkMode: "Sincronize com o modo escuro do dispositivo" -drive: "Unidades" +drive: "Drive" fileName: "Nome do Ficheiro" selectFile: "Selecione os arquivos" selectFiles: "Selecione os arquivos" @@ -354,7 +356,6 @@ invite: "Convidar" driveCapacityPerLocalAccount: "Capacidade do drive por usuário local" driveCapacityPerRemoteAccount: "Capacidade do drive por usuário remoto" inMb: "Em ‘megabytes’" -iconUrl: "URL da imagem do ícone (favicon, etc.)" bannerUrl: "URL da imagem do ‘banner’" backgroundImageUrl: "URL da imagem de fundo" basicInfo: "Informações básicas" @@ -410,6 +411,7 @@ aboutMisskey: "Sobre Misskey" administrator: "Administrador" token: "Símbolo" 2fa: "Autenticação de dois fatores" +setupOf2fa: "Configuração de autenticação de dois fatores" totp: "Aplicativo Autenticador" totpDescription: "Digite a senha de uso único informado pelo aplicativo autenticador" moderator: "Moderador" @@ -428,7 +430,7 @@ reduceUiAnimation: "Reduzir a animação da ‘interface’ do utilizador" share: "Compartilhar" notFound: "Não encontrado" notFoundDescription: "Não havia página correspondente ao URL especificado." -uploadFolder: "Destino de ‘upload’ padrão" +uploadFolder: "Destino de upload padrão" cacheClear: "Excluir memória transitória" markAsReadAllNotifications: "Marcar todas as notificações como lidas" markAsReadAllUnreadNotes: "Marcar todas as postagens como lidas" @@ -489,7 +491,7 @@ fontSize: "Tamanho do texto" mediaListWithOneImageAppearance: "Altura da lista de mídias com apenas uma imagem" limitTo: "Até {x}" noFollowRequests: "Não há pedidos de seguidor pendentes" -openImageInNewTab: "Abrir a imagem numa nova aba" +openImageInNewTab: "Abrir a imagem em uma nova aba" dashboard: "Painel de controle" local: "Local" remote: "Remoto" @@ -601,7 +603,7 @@ useFullReactionPicker: "Usar o seletor de reações completo" width: "Largura" height: "Altura" large: "Grande" -medium: "Média" +medium: "Médio" small: "Pequeno" generateAccessToken: "Gerar token de acesso" permission: "Permissões" @@ -653,6 +655,7 @@ behavior: "Comportamento" sample: "Exemplo" abuseReports: "Denúncias" reportAbuse: "Denúncias" +reportAbuseRenote: "Reportar repostagem" reportAbuseOf: "Denunciar {name}" fillAbuseReportDescription: "Por favor, forneça detalhes sobre o motivo da denúncia. Se houver uma nota específica envolvida, inclua também a URL dela." abuseReported: "Denúncia enviada. Obrigado por sua ajuda." @@ -680,6 +683,7 @@ createNewClip: "Criar novo clipe" unclip: "Remover do clipe" confirmToUnclipAlreadyClippedNote: "Esta nota já está incluída no clipe \"{name}\". Você deseja remover a nota deste clipe?" public: "Público" +private: "Privado" i18nInfo: "Misskey é traduzido para várias línguas por voluntários. Você pode ajudar com as traduções em {link}." manageAccessTokens: "Gerenciar tokens de acesso" accountInfo: "Informações da conta" @@ -715,63 +719,264 @@ useSystemFont: "Utilizar a fonte padrão do sistema" clips: "Clipe" experimentalFeatures: "Funcionalidades Experimentais" experimental: "Experimental" +thisIsExperimentalFeature: "Este é um recurso experimental. As funções podem mudar ou pode não funcionar corretamente." +developer: "Programador" +makeExplorable: "Deixe a sua conta mais fácil de encontrar." +makeExplorableDescription: "Se você desativá-lo, outros usuários não poderão encontrar a sua conta na aba Descoberta." +showGapBetweenNotesInTimeline: "Mostrar um espaço entre as notas na linha de tempo" duplicate: "Duplicar" left: "Esquerda" +center: "Centralizar" wide: "Largo" narrow: "Estreito" +reloadToApplySetting: "As configurações serão refletidas após recarregar a página. Deseja recarregar agora?" +needReloadToApply: "É necessário recarregar a página para refletir as alterações." showTitlebar: "Exibir barra de título" clearCache: "Limpar o cache" +onlineUsersCount: "Pessoas Online" +nUsers: "Usuários" +nNotes: "Notas" +sendErrorReports: "Enviar relatórios de erro" sendErrorReportsDescription: "Ao ativar essa opção, informações detalhadas de erro serão compartilhadas com o Misskey em caso de problemas, o que pode ajudar a melhorar a qualidade do software. As informações de erro podem incluir a versão do sistema operacional, o tipo de navegador e o sua atividade no Misskey." +myTheme: "Meu tema" backgroundColor: "Cor de fundo" +accentColor: "Cor de destaque" +textColor: "Cor do texto" +saveAs: "Salvar como" advanced: "Avançado" +advancedSettings: "Configurações avançadas" value: "Valor" +createdAt: "Data de criação" +updatedAt: "Última atualização" +saveConfirm: "Deseja salvá-lo?" deleteConfirm: "Confirma a exclusão?" +invalidValue: "Valor inválido" +registry: "Registo" +closeAccount: "Encerrar conta" +currentVersion: "Versão Atual" +latestVersion: "Última versão" +youAreRunningUpToDateClient: "Você está usando a última versão do cliente" +newVersionOfClientAvailable: "Nova versão do cliente disponível" +usageAmount: "Quantidade utilizada" capacity: "Capacidade" +inUse: "Em uso" +editCode: "Editar código" apply: "Aplicar" +receiveAnnouncementFromInstance: "Receba as notificações da instância" emailNotification: "Notificações por e-mail" publish: "Publicar" +inChannelSearch: "Pesquisar no canal" +useReactionPickerForContextMenu: "Clique com o botão direito do mouse para abrir o seletor de reações." +typingUsers: "digitando" +jumpToSpecifiedDate: "Pular para uma data específica" +showingPastTimeline: "Visualizar linha de tempo anterior" +clear: "Limpar" +markAllAsRead: "Marcar todas como lidas" goBack: "Voltar" unlikeConfirm: "Deseja realmente deixar de curtir?" +fullView: "Visão completa" +quitFullView: "Sair da visualização completa" +addDescription: "Adicionar descrição" +userPagePinTip: "Notas podem ser mostradas aqui ao clicar em \"Fixar no Perfil\" no menu de notas individuais." +notSpecifiedMentionWarning: "Esta nota menciona usuários que não foram incluídos como recipientes." info: "Informações" +userInfo: "Informações do Usuário" unknown: "Desconhecido" +onlineStatus: "On-line" +hideOnlineStatus: "Ocultar o status on-line." +hideOnlineStatusDescription: "Esconder que está Ativo reduzirá a utilidade de certas funções (como, por exemplo, a Pesquisa)." +online: "Online" +active: "Ativo" +offline: "Inativo" +notRecommended: "Não recomendado" +botProtection: "Proteção contra Bot" +instanceBlocking: "Instâncias bloqueadas" +selectAccount: "Selecionar conta" +switchAccount: "Trocar conta" enabled: "Ativado" disabled: "Desativado" +quickAction: "Ações rápidas" user: "Usuários" administration: "Administrar" +accounts: "Contas" +switch: "Trocar" +noMaintainerInformationWarning: "A informação de administrador não foi configurada." +noBotProtectionWarning: "A proteção contra bots não foi configurada." +configure: "Configurar" +postToGallery: "Criar publicação em galeria" +postToHashtag: "Publicar nesta Hashtag" +gallery: "Galeria" +recentPosts: "Notas recentes" +popularPosts: "Notas populares" +shareWithNote: "Compartilhar em Notas" ads: "Anúncios" +expiration: "Data limite" +startingperiod: "Data de início" +memo: "Nota" +priority: "Prioridade" +high: "Alto" middle: "Meio" +low: "Baixo" emailNotConfiguredWarning: "Endereço de e-mail não configurado. " +ratio: "Ratio" +previewNoteText: "Visualizar Nota" +customCss: "CSS Personalizado" +customCssWarn: "Esta configuração só deve ser usada se souber o que está fazendo. Valores impróprios podem causar erros no funcionamento do cliente." +global: "Global" +squareAvatars: "Exibir ícones quadrados" sent: "Enviar" +received: "Recebido" +searchResult: "Pesquisar" +hashtags: "Hashtags" +troubleshooting: "Resolução de problemas" +useBlurEffect: "Usar efeito de desfoque na UI" +learnMore: "Saiba mais" +misskeyUpdated: "Misskey foi atualizado!" +whatIsNew: "Ver atualizações" translate: "Traduzir" +translatedFrom: "Traduzido de" +accountDeletionInProgress: "Encerramento de conta em andamento" usernameInfo: "O nome para identificar exclusivamente a sua conta no servidor. Pode conter letras (az, AZ), números (0~9) e sublinhados (_). O nome de usuário não pode ser alterado posteriormente." +aiChanMode: "Modo AI-chan" +devMode: "Modo de Desenvolvedor" +keepCw: "Manter aviso de conteúdo" +pubSub: "Publicar/Inscrever no perfil" +lastCommunication: "Ultima atualização" +resolved: "Resolvido" +unresolved: "Não resolvido" breakFollow: "Remover seguidor" breakFollowConfirm: "Deseja realmente deixar de seguir?" +itsOn: "Ativado" +itsOff: "Desativado" on: "Ligado" off: "Desligado" emailRequiredForSignup: "Tornar o endereço de e-mail obrigatório durante o cadastro" unread: "Não lido" +filter: "Filtrar" +controlPanel: "Painel de controle" +manageAccounts: "Gerenciar contas" +makeReactionsPublic: "Deixar o histórico de reações em Público" +makeReactionsPublicDescription: "Isto vai deixar o histórico de todas as suas reações visíveis para qualquer um ver." +classic: "Clássico" +muteThread: "Silenciar esta conversa" +unmuteThread: "Desativar silêncio desta conversa" +ffVisibility: "Visibilidade de Seguidos/Seguidores" +ffVisibilityDescription: "Permite configurar quem pode ver quem lhe segue e quem você está seguindo." +continueThread: "Ver mais desta conversa" deleteAccountConfirm: "Deseja realmente excluir a conta?" +incorrectPassword: "Senha inválida." +voteConfirm: "Deseja confirmar o seu voto em \"{choice}\"?" hide: "Ocultar" useDrawerReactionPickerForMobile: "Mostrar em formato de gaveta" +welcomeBackWithName: "Bem-vindo de volta, {name}" clickToFinishEmailVerification: "Clique em [{ok}] para completar a validação do endereço de e-mail." +overridedDeviceKind: "Sobrepor dispositivo" +smartphone: "Celular" +tablet: "Tablet" auto: "Automático" -searchByGoogle: "Buscar" +themeColor: "Cor do tema" +size: "Tamanho" +numberOfColumn: "Número da coluna" +searchByGoogle: "Pesquisar" +instanceDefaultLightTheme: "Tema diurno padrão para toda a instância" +instanceDefaultDarkTheme: "Tema noturno para toda a instância" +instanceDefaultThemeDescription: "Insira o código do tema em formato de objeto." +mutePeriod: "Duração de silenciamento" +period: "Data limite" +indefinitely: "Indefinitivamente" +tenMinutes: "10 minutos" +oneHour: "1 hora" +oneDay: "1 dia" +oneWeek: "1 semana" +oneMonth: "1 mês" +reflectMayTakeTime: "As mudanças podem demorar a aparecer." +failedToFetchAccountInformation: "Não foi possível obter informações da conta" +rateLimitExceeded: "Taxa limite excedido" +cropImage: "Recortar imagem" +cropImageAsk: "Deseja recortar esta imagem?" +cropYes: "Recortar" +cropNo: "Manter deste jeito" file: "Ficheiros" +recentNHours: "Últimas {n} horas" +recentNDays: "Últimos {n} dias" noEmailServerWarning: "Servidor de e-mail não configurado." +thereIsUnresolvedAbuseReportWarning: "Existem denúncias não resolvidas." +recommended: "Recomendado" +check: "Verificar" driveCapOverrideLabel: "Altere a capacidade do drive para este usuário" driveCapOverrideCaption: "Altere a capacidade para o valor padrão informando o valor 0 ou inferior." +requireAdminForView: "Para visualizar, é necessário acessar com uma conta de administrador." +isSystemAccount: "É uma conta criada e gerenciada automaticamente pelo sistema." +typeToConfirm: "Para realizar essa operação, digite {x}." deleteAccount: "Excluir conta" +document: "Documentação" +numberOfPageCache: "Número de cache de página" +numberOfPageCacheDescription: "Aumentar isso melhora a conveniência, mas também resulta em maior carga e uso de memória." +logoutConfirm: "Gostaria de encerrar a sessão?" +lastActiveDate: "Última data de uso" +statusbar: "Barra de status" +pleaseSelect: "Por favor, selecione." +reverse: "Inversão" +colored: "Colorido" +refreshInterval: "Intervalo de atualização" +label: "Etiqueta" +type: "Tipo" +speed: "Velocidade" +slow: "Lento" +fast: "Rápido" +sensitiveMediaDetection: "Detecção de conteúdo sensível" +localOnly: "Apenas local" +remoteOnly: "Apenas remoto" +cannotUploadBecauseExceedsFileSizeLimit: "Não é possível realizar o upload deste arquivo porque ele excede o tamanho máximo permitido." +beta: "Beta" +enableAutoSensitive: "Marcar automaticamente como conteúdo sensível" enableAutoSensitiveDescription: "Quando disponível, a marcação de mídia sensível será automaticamente atribuído ao conteúdo de mídia usando aprendizado de máquina. Mesmo que você desative essa função, em alguns servidores, isso pode ser configurado automaticamente." activeEmailValidationDescription: "A validação do endereço de e-mail do usuário será realizada de forma mais rigorosa, considerando se é um endereço descartável ou se é possível realizar comunicação efetiva. Se desativado, apenas a validade do formato do endereço será verificada como uma sequência de caracteres." +shuffle: "Aleatório" +account: "Contas" +move: "Mover" +pushNotification: "Notificações Push" +subscribePushNotification: "Ativar notificações push" +unsubscribePushNotification: "Desativar notificações push" +windowMinimize: "Minimizar" +windowRestore: "Restaurar" +caption: "legenda" +tools: "Ferramentas" like: "Curtir" unlike: "Remover curtida" numberOfLikes: "Número de curtidas" show: "Visualizar" +neverShow: "Não exibir novamente" +remindMeLater: "Lembrar mais tarde" didYouLikeMisskey: "Você gostou do Misskey?" pleaseDonate: "O Misskey é um software gratuito utilizado por {host}. Para que possamos continuar o desenvolvimento, pedimos que considerem fazer doações. A sua contribuição é muito importante!" roles: "Cargos" role: "Cargo" noRole: "Nenhum cargo" +normalUser: "Usuários padrão" +undefined: "Indefinido" +assign: "Atribuir" +unassign: "Remover" +color: "Cor" +manageCustomEmojis: "Gerenciar Emojis customizados" +youCannotCreateAnymore: "Você atingiu o limite de criação." +cannotPerformTemporary: "Ação temporariamente indisponível" +cannotPerformTemporaryDescription: "Esta ação não pôde ser concluída devido ao excesso de pedidos em sucessão. Tente novamente em alguns momentos." +invalidParamError: "Parâmetros inválidos" +invalidParamErrorDescription: "Parâmetros requisitados inválidos. Isto normalmente acontece devido a um erro, mas também pode ocorrer devido à entrada de valores além do limite ou algo semelhante." +permissionDeniedError: "Operação recusada" +permissionDeniedErrorDescription: "Esta conta não tem permissão para executar esta ação." +preset: "Predefinições" +selectFromPresets: "Escolher de predefinições" +achievements: "Conquistas" +gotInvalidResponseError: "Resposta do servidor inválida" +gotInvalidResponseErrorDescription: "Servidor fora do ar ou em manutenção. Favor tentar mais tarde." +thisPostMayBeAnnoying: "Esta nota pode incomodar outras pessoas." +thisPostMayBeAnnoyingHome: "Postar na linha do tempo inicial" +thisPostMayBeAnnoyingCancel: "Cancelar" +thisPostMayBeAnnoyingIgnore: "Postar mesmo assim" +collapseRenotes: "Ocultar repostagens já visualizadas" +internalServerError: "Erro interno de servidor" emailNotSupported: "O envio de e-mails não é suportado nesta instância" likeOnly: "Apenas curtidas" likeOnlyForRemote: "Tudo (somente curtidas remotas)" @@ -780,7 +985,20 @@ rolesAssignedToMe: "Cargos atribuídos a mim" unfavoriteConfirm: "Deseja realmente remover dos favoritos?" drivecleaner: "Limpeza do drive" retryAllQueuesConfirmTitle: "Gostaria de tentar novamente agora?" +reactionsDisplaySize: "Tamanho de exibição das reações" +reactionsList: "Reações" +renotesList: "Repostagens" +leftTop: "Superior esquerdo" +rightTop: "Superior direito" +leftBottom: "Inferior esquerdo" +rightBottom: "Inferior direito" +vertical: "Vertical" +horizontal: "Exibir painel lateral inteiro" +position: "Posição" +serverRules: "Regras do servidor" +continue: "Continuar" preservedUsernamesDescription: "Liste os nomes de usuário que deseja reservar, separando-os por quebras de linha. Os nomes de usuário especificados aqui não poderão ser utilizados durante a criação de contas. No entanto, esta restrição não se aplica quando a conta é criada por um administrador. Além disso, as contas que já existem não serão afetadas." +archive: "Arquivo" channelArchiveConfirmTitle: "Deseja realmente arquivar {name}?" youFollowing: "Seguindo" preventAiLearningDescription: "Solicita-se que o conteúdo de notas e imagens enviadas não seja usado como objeto de aprendizado por sistemas externos de geração de texto ou imagens. Isso é alcançado incluindo a flag 'noai' na resposta HTML. No entanto, o cumprimento dessa solicitação depende do próprio sistema de IA, portanto, não é garantia total de prevenção de aprendizado." @@ -789,8 +1007,14 @@ rolesThatCanBeUsedThisEmojiAsReaction: "Cargos que podem utilizar este emoji com rolesThatCanBeUsedThisEmojiAsReactionEmptyDescription: "Se nenhum cargo for especificado, qualquer pessoa pode usar este emoji como reação." rolesThatCanBeUsedThisEmojiAsReactionPublicRoleWarn: "Estes cargos devem ser públicos." waitingForMailAuth: "Verificação de e-mail pendente " +icon: "Avatar" +replies: "Responder" +renotes: "Repostar" +keepScreenOn: "Manter a tela do dispositivo sempre ligada" _initialAccountSetting: followUsers: "Siga usuários que lhe interessam para criar a sua linha do tempo." +_serverSettings: + iconUrl: "URL do ícone" _accountMigration: moveFromDescription: "Se você deseja migrar de outra conta para esta, é necessário criar um alias aqui. Por favor, insira a conta de origem da migração no seguinte formato: @username@server.example.com. Para excluir o alias, deixe o campo em branco e clique em salvar (não recomendado)." moveAccountDescription: "Você está migrando para uma nova conta.\n ・Seus seguidores irão automaticamente seguir a nova conta.\n ・Todas as suas conexões de seguidores nesta conta serão removidas.\n ・Você não poderá mais criar novas notas nesta conta.\n\nA migração dos seguidores é automática, mas a migração das pessoas que você segue deve ser feita manualmente. Antes de migrar, exporte quem você está seguindo nesta conta e, assim que migrar, importe essa lista na nova conta.\nO mesmo se aplica para listas, silenciamentos e bloqueios, que também devem ser migrados manualmente.\n\n(Esta descrição se refere ao comportamento do servidor Misskey v13.12.0 ou posterior. Outros softwares ActivityPub, como Mastodon, podem ter comportamentos diferentes.)" @@ -989,7 +1213,7 @@ _role: priority: "Prioridade" _priority: low: "Baixa" - middle: "Média" + middle: "Médio" high: "Alta" _options: gtlAvailable: "Visualizar Linha do Tempo Global" @@ -1038,9 +1262,11 @@ _emailUnavailable: mx: "O servidor de informado é inválido" smtp: "O servidor de e-mail não está respondendo" _ffVisibility: - public: "Publicar" + public: "Público" followers: "Visível apenas para seguidores" + private: "Privado" _signup: + almostThere: "Quase pronto" emailAddressInfo: "Por favor, insira o seu endereço de e-mail. Ele não será divulgado." emailSent: "Um e-mail de confirmação foi enviado para o endereço de e-mail fornecido ({email}). Acesse o link fornecido no e-mail para concluir a criação de sua conta." _accountDelete: @@ -1052,6 +1278,8 @@ _accountDelete: inProgress: "A exclusão está em andamento" _ad: back: "Voltar" + reduceFrequencyOfThisAd: "Diminuir frequência deste anúncio" + hide: "Não exibir anúncios" _forgotPassword: enterEmail: "Por favor, insira o endereço de e-mail usado no cadastro de sua conta. Um link para redefinição de senha será enviado para esse endereço." ifNoEmail: "Caso você não tenha registrado um endereço de e-mail, por favor, entre em contato com o administrador." @@ -1072,8 +1300,18 @@ _preferencesBackups: _channel: featured: "Destaques" following: "Seguindo" + usersCount: "usuários ativos" + notesCount: "notas" + nameAndDescription: "Nome e descrição" +_menuDisplay: + sideFull: "Exibir painel lateral inteiro" + top: "Exibir barra superior" + hide: "Ocultar" +_instanceMute: + instanceMuteDescription: "Todas as notas e repostagens do servidor configurado serão silenciados, incluindo respostas aos usuários do servidor mutado." _theme: description: "Descrição" + alpha: "Opacidade" deleteConstantConfirm: "Confirma a exclusão da constante {const}?" keys: mention: "Menção" @@ -1160,7 +1398,7 @@ _poll: canMultipleVote: "Permitir múltipla seleção" vote: "Votar em enquetes" _visibility: - home: "casa" + home: "Início" followers: "Seguidores" followersDescription: "Tornar visível apenas para os meus seguidores" _profile: @@ -1175,7 +1413,7 @@ _exportOrImport: _charts: federation: "União" _timelines: - home: "casa" + home: "Início" _play: new: "Criar Play" edit: "Editar Play" @@ -1205,13 +1443,14 @@ _notification: youGotMention: "{name} te mencionou" youGotReply: "{name} te respondeu" youGotQuote: "{name} te citou" + youRenoted: "Repostagens de {name}" youWereFollowed: "Você tem um novo seguidor" youReceivedFollowRequest: "Você recebeu um pedido de seguidor" yourFollowRequestAccepted: "Seu pedido de seguidor foi aceito" pollEnded: "Os resultados da enquete agora estão disponíveis" emptyPushNotificationMessage: "As notificações de alerta foram atualizadas" _types: - all: "Todos" + all: "Todas" follow: "Seguindo" mention: "Menção" reply: "Respostas" @@ -1257,3 +1496,7 @@ _webhookSettings: _events: follow: "Quando seguindo um usuário" followed: "Quando sendo seguido" + renote: "Quando repostado" +_moderationLogTypes: + suspend: "Suspender" + resetPassword: "Redefinir senha" diff --git a/locales/ro-RO.yml b/locales/ro-RO.yml index 2d3099858d..51c33085af 100644 --- a/locales/ro-RO.yml +++ b/locales/ro-RO.yml @@ -328,7 +328,6 @@ invite: "Invită" driveCapacityPerLocalAccount: "Capacitatea Drive-ului per utilizator local" driveCapacityPerRemoteAccount: "Capacitatea Drive-ului per utilizator extern" inMb: "În megabytes" -iconUrl: "URL-ul iconiței" bannerUrl: "URL-ul imaginii de banner" backgroundImageUrl: "URL-ul imaginii de fundal" basicInfo: "Informații de bază" @@ -630,6 +629,9 @@ sent: "Trimite" searchByGoogle: "Caută" file: "Fișiere" show: "Arată" +icon: "Avatar" +replies: "Răspunde" +renotes: "Re-notează" _role: _priority: middle: "Mediu" @@ -702,3 +704,6 @@ _deck: mentions: "Mențiuni" _webhookSettings: name: "Nume" +_moderationLogTypes: + suspend: "Suspendă" + resetPassword: "Resetează parola" diff --git a/locales/ru-RU.yml b/locales/ru-RU.yml index 7d511f889b..e82beb85b4 100644 --- a/locales/ru-RU.yml +++ b/locales/ru-RU.yml @@ -354,7 +354,6 @@ invite: "Пригласить" driveCapacityPerLocalAccount: "Объём диска на одного локального пользователя" driveCapacityPerRemoteAccount: "Объём диска на одного пользователя с другого сайта" inMb: "В мегабайтах" -iconUrl: "Ссылка на аватар" bannerUrl: "Ссылка на изображение в шапке" backgroundImageUrl: "Ссылка на фоновое изображение" basicInfo: "Общая информация" @@ -680,6 +679,7 @@ createNewClip: "Новая подборка" unclip: "Убрать из подборки" confirmToUnclipAlreadyClippedNote: "Эта заметка уже есть в подборке «{name}». Удалить из этой подборки?" public: "Общедоступно" +private: "Показываются только вам" i18nInfo: "Misskey переводят на разные языки добровольцы со всего света. Ваша помощь тоже пригодится здесь: {link}." manageAccessTokens: "Управление токенами доступа" accountInfo: "Сведения об учётной записи" @@ -1016,23 +1016,66 @@ retryAllQueuesConfirmTitle: "Хотите попробовать ещё раз?" retryAllQueuesConfirmText: "Нагрузка на сервер может увеличиться" enableChartsForRemoteUser: "Создание диаграмм для удалённых пользователей" enableChartsForFederatedInstances: "Создание диаграмм для удалённых серверов" -largeNoteReactions: "Показывать большие реакции на заметки" noteIdOrUrl: "ID или ссылка на заметку" video: "Видео" videos: "Видео" dataSaver: "Экономия трафика" accountMigration: "Перенести учётную запись" accountMoved: "Учетная запись перенесена" +accountMovedShort: "Эта учётная запись перемещена" operationForbidden: "Эта операция невозможна." +forceShowAds: "Всегда отображать рекламу" addMemo: "Добавить заметку" editMemo: "Редактировать заметку" reactionsList: "Реакции" renotesList: "Репосты" notificationDisplay: "Отображение уведомления" leftTop: "Верхний левый угол" +rightTop: "Сверху справа" +leftBottom: "Снизу слева" +rightBottom: "Снизу справа" +vertical: "Вертикальная" horizontal: "Сбоку" +position: "Позиция" +serverRules: "Правила сервера" +pleaseConfirmBelowBeforeSignup: "Для регистрации на данном сервере, необходимо согласится с нижеследующими положениями." +pleaseAgreeAllToContinue: "Чтобы продолжить, необходимо поставить отметки во всех полях \"согласен\"." +continue: "Продолжить" +preservedUsernames: "Зарезервированные имена пользователей" +preservedUsernamesDescription: "Перечислите зарезервированные имена пользователей, отделяя их строками. Они станут недоступны при создании учётной записи. Это ограничение не применяется при создании учётной записи администраторами. Также, уже существующие учётные записи останутся без изменений." +createNoteFromTheFile: "Создать заметку из этого файла" +archive: "Архив" +channelArchiveConfirmTitle: "Переместить {name} в архив?" +channelArchiveConfirmDescription: "Архивированные каналы перестанут отображаться в списке каналов или результатах поиска. В них также нельзя будет добавлять новые записи." +displayOfNote: "Отображение заметок" +initialAccountSetting: "Настройка профиля" youFollowing: "Подписки" +preventAiLearning: "Отказаться от использования в машинном обучении (Генеративный ИИ)" options: "Настройки ролей" +specifyUser: "Указанный пользователь" +failedToPreviewUrl: "Предварительный просмотр недоступен" +update: "Обновить" +later: "Позже" +goToMisskey: "К Misskey" +additionalEmojiDictionary: "Дополнительные словари эмодзи" +installed: "Установлено" +branding: "Бренд" +expirationDate: "Дата истечения" +unused: "Неиспользуемый" +expired: "Срок действия приглашения истёк" +doYouAgree: "Согласны?" +icon: "Аватар" +replies: "Ответить" +renotes: "Репост" +_initialAccountSetting: + accountCreated: "Аккаунт успешно создан!" + letsStartAccountSetup: "Давайте настроим вашу учётную запись." + profileSetting: "Настройки профиля" + privacySetting: "Настройки конфиденциальности" + initialAccountSettingCompleted: "Первоначальная настройка успешно завершена!" + skipAreYouSure: "Пропустить настройку?" +_serverSettings: + iconUrl: "Адрес на иконку роли" _achievements: earnedAt: "Разблокировано в" _types: @@ -1384,6 +1427,7 @@ _plugin: install: "Установка расширений" installWarn: "Пожалуйста, не устанавливайте расширения, которым не доверяете." manage: "Управление расширениями" + viewSource: "Просмотр исходника" _preferencesBackups: list: "Существующие резервные копии" saveNew: "Создать резервную копию" @@ -1565,11 +1609,9 @@ _timelineTutorial: _2fa: alreadyRegistered: "Двухфакторная аутентификация уже настроена." registerTOTP: "Начните настраивать приложение-аутентификатор" - passwordToTOTP: "Пожалуйста, введите свой пароль" step1: "Прежде всего, установите на устройство приложение для аутентификации, например, {a} или {b}." step2: "Далее отсканируйте отображаемый QR-код при помощи приложения." step2Click: "Нажав на QR-код, вы можете зарегистрироваться с помощью приложения для аутентификации или брелка для ключей, установленного на вашем устройстве." - step2Url: "Если пользуетесь приложением на компьютере, можете ввести в него эту строку (URL):" step3Title: "Введите проверочный код" step3: "И наконец, введите код, который покажет приложение." step4: "Теперь при каждом входе на сайт вам нужно будет вводить код из приложения аналогичным образом.\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" @@ -1898,6 +1940,7 @@ _deck: channel: "Каналы" mentions: "Упоминания" direct: "Личное" + roleTimeline: "История Ролей" _dialog: charactersExceeded: "Превышено максимальное количество символов! У вас {current} / из {max}" charactersBelow: "Это ниже минимального количества символов! У вас {current} / из {min}" @@ -1905,5 +1948,9 @@ _disabledTimeline: title: "Лента отключена" description: "Ваша текущая роль не позволяет пользоваться этой лентой." _webhookSettings: + createWebhook: "Создать вебхук" name: "Название" active: "Вкл." +_moderationLogTypes: + suspend: "Заморозить" + resetPassword: "Сброс пароля:" diff --git a/locales/sk-SK.yml b/locales/sk-SK.yml index 2da7e4255e..cfd2ed86de 100644 --- a/locales/sk-SK.yml +++ b/locales/sk-SK.yml @@ -337,7 +337,6 @@ invite: "Pozvať" driveCapacityPerLocalAccount: "Kapacita disku pre používateľa" driveCapacityPerRemoteAccount: "Kapacita disku pre vzdialeného používateľa" inMb: "V megabajtoch" -iconUrl: "Favicon URL" bannerUrl: "URL obrázku bannera" backgroundImageUrl: "URL obrázku pozadia" basicInfo: "Základné informácie" @@ -654,6 +653,7 @@ createNewClip: "Vytvoriť nový klip" unclip: "Odopnúť" confirmToUnclipAlreadyClippedNote: "Táto poznámka je už pripnutá ako \"{name}\". Naozaj ju chcete odopnúť?" public: "Verejné" +private: "Súkromné" i18nInfo: "Misskey je prekladaný do rôznych jazykov dobrovoľníkmi. Pomôcť môžete na {link}." manageAccessTokens: "Spravovať prístupové tokeny" accountInfo: "Informácie o účte" @@ -918,6 +918,9 @@ pleaseDonate: "Misskey je bezplatný softvér, ktorý používa {host}. Prosím, color: "Farba" horizontal: "Strana" youFollowing: "Sledované" +icon: "Avatar" +replies: "Odpovedať" +renotes: "Preposlať" _role: priority: "Priorita" _priority: @@ -975,6 +978,7 @@ _plugin: install: "Inštalova pluginy" installWarn: "Prosím neinštalujte nedôveryhodné pluginy." manage: "Spravovanie pluginov" + viewSource: "Ukázať zdroj" _preferencesBackups: list: "Vytvorené zálohy" saveNew: "Uložiť novú" @@ -1147,7 +1151,6 @@ _2fa: alreadyRegistered: "Už ste zaregistrovali 2-faktorové autentifikačné zariadenie." step1: "Najprv si nainštalujte autentifikačnú aplikáciu (napríklad {a} alebo {b}) na svoje zariadenie." step2: "Potom, naskenujte QR kód zobrazený na obrazovke." - step2Url: "Do aplikácie zadajte nasledujúcu URL adresu:" step3: "Nastavenie dokončíte zadaním tokenu z vašej aplikácie." step4: "Od teraz, všetky ďalšie prihlásenia budú vyžadovať prihlasovací token.\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" securityKeyInfo: "Okrem odtlačku prsta alebo PIN autentifikácie si môžete nastaviť autentifikáciu cez hardvérový bezpečnostný kľúč podporujúci FIDO2 a tak ešte viac zabezpečiť svoj účet." @@ -1448,3 +1451,6 @@ _deck: _webhookSettings: name: "Názov" active: "Zapnuté" +_moderationLogTypes: + suspend: "Zmraziť" + resetPassword: "Resetovať heslo" diff --git a/locales/sv-SE.yml b/locales/sv-SE.yml index 07f43afe2e..62e7d412ab 100644 --- a/locales/sv-SE.yml +++ b/locales/sv-SE.yml @@ -337,7 +337,6 @@ registration: "Registrera" enableRegistration: "Aktivera registrering av nya användare" invite: "Inbjudan" inMb: "I megabyte" -iconUrl: "URL till profilbilden" bannerUrl: "URL till banner-bilden" basicInfo: "Grundläggande info" pinnedUsers: "Fästa användare" @@ -485,6 +484,9 @@ windowRestore: "Återställ" pleaseDonate: "Misskey är en gratis programvara som används på {host}. Donera gärna för att göra utvecklingen ständigt, tack!" resetPasswordConfirm: "Återställ verkligen ditt lösenord?" dataSaver: "Databesparing" +icon: "Profilbild" +replies: "Svara" +renotes: "Omnotera" _achievements: _types: _open3windows: @@ -508,7 +510,6 @@ _sfx: chat: "Chatt" antenna: "Antenner" _2fa: - passwordToTOTP: "Skriv in ditt lösenord" renewTOTPCancel: "Nej tack" _antennaSources: all: "Alla noter" @@ -572,3 +573,6 @@ _deck: _webhookSettings: name: "Namn" active: "Aktiverad" +_moderationLogTypes: + suspend: "Suspendera" + resetPassword: "Återställ Lösenord" diff --git a/locales/th-TH.yml b/locales/th-TH.yml index 943d878e04..eb006f7309 100644 --- a/locales/th-TH.yml +++ b/locales/th-TH.yml @@ -45,6 +45,7 @@ pin: "ปักหมุดไปยังโปรไฟล์" unpin: "เลิกปักหมุดจากโปรไฟล์" copyContent: "คัดลอกเนื้อหา" copyLink: "คัดลอกลิงก์" +copyLinkRenote: "คัดลอกลิงก์รีโน้ต" delete: "ลบ" deleteAndEdit: "ลบและแก้ไข" deleteAndEditConfirm: "นายแน่ใจแล้วเหรอ? ว่าต้องการลบโน้ตนี้และแก้ไข คุณอาจจะสูญเสียการโต้ตอบ, โน้ต, และการตอบกลับทั้งหมดได้นะ" @@ -74,7 +75,7 @@ import: "นำเข้า" export: "นำออก" files: "ไฟล์" download: "ดาวน์โหลด" -driveFileDeleteConfirm: "นายแน่ใจแล้วหรอ? ว่าต้องการลบไฟล์ \"{name}\" โน้ตย่อที่แนบมากับไฟล์นี้ก็จะถูกลบด้วยนะ" +driveFileDeleteConfirm: "คุณต้องการลบไฟล์ \"{name}\" ใช่หรือไม่? โน้ตย่อที่แนบมากับไฟล์นี้ก็จะถูกลบไปด้วย" unfollowConfirm: "นายแน่ใจแล้วหรอว่าต้องการเลิกติดตาม {name}?" exportRequested: "เมื่อคุณได้ร้องขอการส่งออก อาจจะต้องใช้เวลาสักครู่ และจะถูกเพิ่มในไดรฟ์ของคุณเมื่อเสร็จสิ้นแล้ว" importRequested: "เมื่อคุณได้ร้องขอการนำเข้า อาจจะต้องใช้เวลาสักครู่นะ" @@ -92,8 +93,8 @@ somethingHappened: "อุ๊ย ! มีอะไรบางอย่างผ retry: "ลองใหม่อีกครั้ง" pageLoadError: "เกิดข้อผิดพลาดในการโหลดหน้านี้" pageLoadErrorDescription: "โดยปกติแล้วมักจะเกิดจากข้อผิดพลาดของเครือข่ายหรือแคชของเบราว์เซอร์ ลองล้างแคชแล้วลองใหม่อีกครั้งหลังจากรอสักครู่ " -serverIsDead: "เซิร์ฟเวอร์นี้ไม่มีการตอบสนอง ได้โปรดกรุณารอสักครู่แล้วลองใหม่อีกครั้งนะ" -youShouldUpgradeClient: "หากต้องการดูหน้านี้ได้โปรดกรุณา รีเซ็ตเพื่ออัปเดตไคลเอ็นต์ของคุณนะ" +serverIsDead: "เซิร์ฟเวอร์นี้ไม่มีการตอบสนอง โปรดกรุณารอสักครู่แล้วลองใหม่อีกครั้ง" +youShouldUpgradeClient: "หากต้องการดูหน้านี้ กรุณาโหลดหน้าใหม่เพื่ออัปเดตไคลเอ็นต์ของคุณ" enterListName: "ใส่ชื่อสำหรับรายการลิสต์" privacy: "ความเป็นส่วนตัว" makeFollowManuallyApprove: "ติดตามคำขอที่ต้องได้รับการอนุมัติ" @@ -109,7 +110,7 @@ unrenote: "เลิกรีโน้ต" renoted: "รีโน้ตแล้ว" cantRenote: "โพสต์นี้ไม่สามารถรีโน้ตไว้ใหม่ได้นะ" cantReRenote: "ไม่สามารถรีโน้ตเอาไว้ใหม่ได้นะ" -quote: "อ้างคำพูด" +quote: "อ้างอิง" inChannelRenote: "รีโน้ตช่องแชลแนลเท่านั้น" inChannelQuote: "อ้างช่องเท่านั้น" pinnedNote: "โน้ตที่ปักหมุดเอาไว้" @@ -137,7 +138,7 @@ suspend: "ถูกระงับ" unsuspend: "ยกเลิกระงับ" blockConfirm: "คุณแน่ใจแล้วเหรอ? ว่าต้องการบล็อกบัญชีนี้" unblockConfirm: "คุณแน่ใจแล้วเหรอ? ว่าต้องการปลดบล็อคบัญชีนี้" -suspendConfirm: "นายแน่ใจแล้วเหรอว่าต้องการระงับบัญชีนี้อ่ะ?" +suspendConfirm: "แน่ใจว่าคุณต้องการระงับบัญชีนี้?" unsuspendConfirm: "นายแน่ใจแล้วหรอ? ว่าต้องการยกเลิกการระงับบัญชีนี้" selectList: "เลือกรายการ" editList: "แก้ไขรายการ" @@ -156,6 +157,7 @@ addEmoji: "แทรกอีโมจิ" settingGuide: "การตั้งค่าที่แนะนำ" cacheRemoteFiles: "แคชไฟล์ระยะไกล" cacheRemoteFilesDescription: "เมื่อปิดใช้งานการตั้งค่านี้ ไฟล์ระยะไกลนั้นจะถูกโหลดโดยตรงจากอินสแตนซ์ระยะไกล แต่กรณีการปิดใช้งานนี้จะช่วยลดปริมาณการใช้พื้นที่จัดเก็บข้อมูล แต่เพิ่มปริมาณการใช้งาน เพราะเนื่องจากจะไม่มีการสร้างภาพขนาดย่อ" +youCanCleanRemoteFilesCache: "คุณสามารถล้างแคชได้โดยคลิกที่ปุ่ม 🗑️ ในมุมมองการจัดการไฟล์" cacheRemoteSensitiveFiles: "ไฟล์ระยะไกลที่มีความละเอียดอ่อนแคช" cacheRemoteSensitiveFilesDescription: "เมื่อปิดการใช้งานแล้วการตั้งค่านี้ ไฟล์รีโมตที่มีความละเอียดอ่อนนั้นจะถูกโหลดโดยตรงจากอินสแตนซ์ระยะไกลโดยที่ไม่มีการแคช" flagAsBot: "ทำเครื่องหมายบอกว่าบัญชีนี้เป็นบอท" @@ -254,7 +256,7 @@ imageUrl: "url รูปภาพ" remove: "ลบ" removed: "ถูกลบไปแล้ว" removeAreYouSure: "นายแน่ใจจริงหรอว่าต้องการที่จะลบออก \"{x}\"" -deleteAreYouSure: "นายแน่ใจจริงหรอว่าต้องการที่จะลบออก \"{x}\"" +deleteAreYouSure: "ต้องการลบ {x} หรือไม่คะ?" resetAreYouSure: "รีเซ็ตเลยไหม" saved: "บันทึกแล้ว" messaging: "แชท" @@ -308,8 +310,8 @@ renameFolder: "เปลี่ยนชื่อโฟลเดอร์" deleteFolder: "ลบโฟลเดอร์" addFile: "เพิ่มไฟล์" emptyDrive: "ไดรฟ์ของคุณว่างเปล่านะ" -emptyFolder: "โฟลเดอร์นี้น่าจะว่างเปล่านะ" -unableToDelete: "ไม่สามารถลบออกได้นะ" +emptyFolder: "โฟลเดอร์นี้ว่างเปล่า" +unableToDelete: "ไม่สามารถลบออกได้" inputNewFileName: "ป้อนชื่อไฟล์ใหม่นะ" inputNewDescription: "กรุณาใส่แคปชั่นใหม่" inputNewFolderName: "กรุณาใส่ชื่อโฟลเดอร์ใหม่นะ\n" @@ -354,7 +356,6 @@ invite: "เชิญชวน" driveCapacityPerLocalAccount: "ความจุของไดรฟ์ต่อผู้ใช้ภายในเครื่อง" driveCapacityPerRemoteAccount: "ความจุของไดรฟ์ต่อผู้ใช้ระยะไกล" inMb: "เป็นเมกะไบต์" -iconUrl: "ไอคอน URL" bannerUrl: "URL รูปภาพแบนเนอร์" backgroundImageUrl: "URL ภาพพื้นหลัง" basicInfo: "ข้อมูลเบื้องต้น" @@ -363,7 +364,7 @@ pinnedUsersDescription: "ลิสต์ชื่อผู้ใช้โดย pinnedPages: "หน้าที่ปักหมุด" pinnedPagesDescription: "ป้อนเส้นทางของหน้าที่คุณต้องการตรึงไว้ที่หน้าแรกของอินสแตนซ์นี้ โดยคั่นด้วยตัวแบ่งบรรทัด" pinnedClipId: "ID ของคลิปที่จะปักหมุด" -pinnedNotes: "โน้ตที่ปักหมุดเอาไว้" +pinnedNotes: "โน้ตที่ปักหมุดไว้" hcaptcha: "hCaptcha" enableHcaptcha: "เปิดใช้ hCaptcha" hcaptchaSiteKey: "คีย์ไซต์" @@ -404,12 +405,13 @@ recentlyDiscoveredUsers: "ผู้ใช้ที่เพิ่งค้นพ exploreUsersCount: "มีผู้ใช้ {จำนวน} ราย" exploreFediverse: "สำรวจเฟดดิเวิร์ส" popularTags: "แท็กยอดนิยม" -userList: "รายการ" +userList: "ลิสต์" about: "เกี่ยวกับ" aboutMisskey: "เกี่ยวกับ Misskey" administrator: "ผู้ดูแลระบบ" token: "โทเค็น" 2fa: "การยืนยันตัวตนแบบสองชั้น" +setupOf2fa: "ตั้งค่าการยืนยันตัวตนแบบสองชั้น" totp: "แอป Authenticator" totpDescription: "ใช้แอปยืนยันตัวตนเพื่อป้อนรหัสผ่านแบบใช้ครั้งเดียว" moderator: "ผู้ควบคุม" @@ -444,7 +446,7 @@ text: "ข้อความ" enable: "เปิดใช้งาน" next: "ถัด​ไป" retype: "พิมพ์รหัสอีกครั้ง" -noteOf: "โน้ต โดย {ผู้ใช้งาน}" +noteOf: "โน้ต โดย {user}" quoteAttached: "อ้างอิง" quoteQuestion: "นายต้องการที่จะอ้างอิงหรอ?" noMessagesYet: "ยังไม่มีข้อความนะ" @@ -653,6 +655,7 @@ behavior: "พฤติกรรม" sample: "ตัวอย่าง" abuseReports: "รายงาน" reportAbuse: "รายงาน" +reportAbuseRenote: "รายงานรีโน้ต" reportAbuseOf: "รายงาน {ชื่อ}" fillAbuseReportDescription: "กรุณากรอกรายละเอียดเกี่ยวกับรายงานนี้ หากเป็นเรื่องเกี่ยวกับโน้ตโดยเฉพาะ ได้โปรดระบุ URL" abuseReported: "เราได้ส่งรายงานของคุณไปแล้ว ขอบคุณมากๆนะ" @@ -680,6 +683,7 @@ createNewClip: "สร้างคลิปใหม่" unclip: "ลบคลิป" confirmToUnclipAlreadyClippedNote: "โน้ตนี้เป็นส่วนหนึ่งของคลิป \"{name}\" แล้ว คุณต้องการลบออกจากคลิปนี้แทนอย่างงั้นหรอ?" public: "สาธารณะ" +private: "ส่วนตัว" i18nInfo: "Misskey กำลังได้รับการแปลเป็นภาษาต่างๆ โดยอาสาสมัคร คุณสามารถช่วยเหลือได้ที่ {link}" manageAccessTokens: "การจัดการโทเค็นการเข้าถึง" accountInfo: "ข้อมูลบัญชี" @@ -957,7 +961,7 @@ show: "แสดงผล" neverShow: "ไม่ต้องแสดงข้อความนี้อีก" remindMeLater: "ไว้ครั้งหน้าแล้วกัน" didYouLikeMisskey: "คุณเคยชอบ Misskey ไหม?" -pleaseDonate: "{host} ใช้ซอฟต์แวร์ฟรี Misskey เราขอขอบคุณการบริจาคของคุณอย่างสูงเพื่อให้การพัฒนา Misskey สามารถดำเนินต่อไปได้นะ!" +pleaseDonate: "Misskey เป็นซอฟต์แวร์ฟรีที่ใช้งานโดย {host} เราขอขอบคุณการสนับสนุนของคุณอย่างสูงเพื่อให้การพัฒนา Misskey สามารถดำเนินต่อไปได้!" roles: "บทบาท" role: "บทบาท" noRole: "ไม่พบบทบาท" @@ -1018,7 +1022,6 @@ retryAllQueuesConfirmText: "สิ่งนี้จะเพิ่มการ enableChartsForRemoteUser: "สร้างแผนภูมิข้อมูลผู้ใช้ระยะไกล" enableChartsForFederatedInstances: "สร้างแผนภูมิข้อมูลอินสแตนซ์ระยะไกล" showClipButtonInNoteFooter: "เพิ่ม \"คลิป\" เพื่อบันทึกเมนูการทำงาน" -largeNoteReactions: "ขยายรีแอคชั่นการแสดงผล" noteIdOrUrl: "โน้ต ID หรือ URL" video: "วีดีโอ" videos: "วีดีโอ" @@ -1094,6 +1097,20 @@ expired: "หมดอายุแล้ว" doYouAgree: "ยอมรับมั้ย?" beSureToReadThisAsItIsImportant: "กรุณาอ่านข้อมูลที่สำคัญอันนี้" iHaveReadXCarefullyAndAgree: "ฉันได้อ่านข้อความ \"{x}\" และยินยอม" +dialog: "ไดอะล็อก" +icon: "ไอคอน" +forYou: "สำหรับคุณ" +replies: "ตอบกลับ" +renotes: "รีโน้ต" +loadReplies: "แสดงการตอบกลับ" +loadConversation: "แสดงบทสนทนา" +_announcement: + forExistingUsersDescription: "การประกาศนี้จะแสดงต่อผู้ใช้ที่มีอยู่ ณ จุดที่เผยแพร่นั้นๆถ้าหากเปิดใช้งาน ถ้าหากปิดใช้งานผู้ที่กำลังสมัครใหม่หลังจากโพสต์แล้วนั้นก็จะเห็นเช่นกัน" + needConfirmationToReadDescription: "ข้อความแจ้งแยก ถ้าหากต้องการเพื่อยืนยันว่ากำลังทำเครื่องหมายประกาศนี้ว่าอ่านแล้วจะแสดงขึ้นถ้าหากเปิดใช้งาน การประกาศนั้นจะไม่รวมอยู่ในฟังก์ชั่นว่า \"ทำเครื่องหมายทั้งหมดว่าอ่านแล้ว\"" + end: "ประกาศเก็บถาวร" + tooManyActiveAnnouncementDescription: "การมีประกาศที่ใช้งานมากเกินไปนั้นอาจจะทำให้ประสบการณ์ของผู้ใช้งานนั้นดูแย่ลง โปรดกรุณาพิจารณาการเก็บประกาศที่ล้าสมัยด้วยนะค่ะ" + readConfirmTitle: "ทำเครื่องหมายบอกว่าอ่านแล้วเลยมั้ย?" + readConfirmText: "การดำเนินการนี้จะทำเครื่องหมายเนื้อหาของ \"{title}\" บอกว่าอ่านแล้วนะ" _initialAccountSetting: accountCreated: "คุณได้สร้างบัญชีของคุณสำเร็จเรียบร้อยแล้ว!" letsStartAccountSetup: "สำหรับผู้เริ่มต้นมาตั้งค่าโปรไฟล์ของคุณกันเถอะ" @@ -1105,12 +1122,14 @@ _initialAccountSetting: followUsers: "ลองติดตามผู้ใช้บางคนที่คุณอาจจะสนใจเพื่อสร้างไทม์ไลน์ของคุณสิ !" pushNotificationDescription: "กำลังเปิดใช้งานการแจ้งเตือนแบบพุชจะช่วยให้คุณได้รับการแจ้งเตือนจาก {name} โดยตรงบนอุปกรณ์ของคุณนะ" initialAccountSettingCompleted: "ตั้งค่าโปรไฟล์เสร็จสมบูรณ์แล้ว!" - haveFun: "สนุกกับ {name}!" + haveFun: "ขอให้สนุก {name}!" ifYouNeedLearnMore: "ถ้าหากคุณต้องการเรียนรู้เพิ่มเติมเกี่ยวกับวิธีใช้ {ชื่อ} (Misskey) กรุณาไปที่ {link}" skipAreYouSure: "ต้องการข้ามการตั้งค่าโปรไฟล์จริงๆแบบนั้นหรอ?" laterAreYouSure: "ต้องการตั้งค่าโปรไฟล์ในภายหลังจริงๆอย่างงั้นหรอ?" _serverRules: description: "ชุดของกฎที่จะแสดงก่อนการลงทะเบียนเราขอแนะนำให้ตั้งค่าสรุปข้อกำหนดในการให้บริการ" +_serverSettings: + iconUrl: "ไอคอน URL" _accountMigration: moveFrom: "ย้ายข้อมูลบัญชีอื่นไปยังอีกบัญชีนี้หนึ่ง" moveFromSub: "สร้างนามแฝงไปยังบัญชีอื่น" @@ -1130,8 +1149,8 @@ _achievements: earnedAt: "ได้รับเมื่อ" _types: _notes1: - title: "เพียงแค่ตั้งค่า msky ของฉัน" - description: "โพสต์โน้ตครั้งแรกของคุณ" + title: "just setting up my msky" + description: "โพสต์โน้ตแรกของคุณ" flavor: "ขอให้มีช่วงเวลาที่ดีกับ Misskey นะคะ!" _notes10: title: "โน้ตบางอย่าง" @@ -1290,7 +1309,7 @@ _achievements: _iLoveMisskey: title: "ฉันรัก Misskey" description: "โพสต์ \"I ❤ #Misskey\"" - flavor: "ทีมผู้พัฒนา Misskey ได้ขอบคุณสำหรับการสนับสนุนของคุณ!" + flavor: "ขอบคุณที่ใช้ Misskey! by ทีมผู้พัฒนา" _foundTreasure: title: "ล่าสมบัติ" description: "คุณพบสมบัติที่ซ่อนอยู่" @@ -1298,7 +1317,7 @@ _achievements: title: "พักผ่อนสักหน่อย" description: "ใช้เวลา 30 นาทีบน Misskey" _client60min: - title: "ไม่พบ \"Miss\" ใน Misskey " + title: "ไม่มี \"Miss\" ใน Misskey " description: "เปิด Misskey ค้างไว้แล้วอย่างน้อย 60 นาที" _noteDeletedWithin1min: title: "ไม่เป็นไร" @@ -1365,6 +1384,8 @@ _achievements: title: "Brain Diver" description: "โพสต์ลิงก์ไปยัง Brain Diver" flavor: "Misskey-Misskey La-Tu-Ma" + _smashTestNotificationButton: + title: "ทดสอบโอเวอร์โฟลว์" _role: new: "บทบาทใหม่" edit: "แก้ไขบทบาท" @@ -1447,7 +1468,7 @@ _sensitiveMediaDetection: _emailUnavailable: used: "ที่อยู่อีเมลนี้ได้ถูกใช้ไปแล้ว" format: "รูปแบบของที่อยู่อีเมลนี้ไม่ถูกต้อง" - disposable: "ที่อยู่อีเมลที่ใช้แล้วทิ้งนั้นไม่สามารถใช้ได้" + disposable: "ไม่สามารถใช้อีเมลชั่วคราวได้" mx: "เซิร์ฟเวอร์อีเมลนี้ไม่ถูกต้อง" smtp: "เซิร์ฟเวอร์อีเมลนี้ไม่มีการตอบสนอง" _ffVisibility: @@ -1488,6 +1509,7 @@ _plugin: install: "ติดตั้งปลั๊กอิน" installWarn: "กรุณาอย่าติดตั้งปลั๊กอินที่ไม่น่าเชื่อถือนะคะ" manage: "จัดการปลั๊กอิน" + viewSource: "ดูต้นฉบับ" _preferencesBackups: list: "สร้างการสำรองข้อมูล" saveNew: "บันทึกใหม่" @@ -1517,9 +1539,9 @@ _aboutMisskey: contributors: "ผู้สนับสนุนหลัก" allContributors: "ผู้มีส่วนร่วมทั้งหมด" source: "ซอร์สโค้ด" - translation: "รับแปลภาษา Misskey" + translation: "แปลภาษา Misskey" donate: "บริจาคให้กับ Misskey" - morePatrons: "เราขอขอบคุณสำหรับความช่วยเหลือจากผู้ช่วยอื่นๆ ที่ไม่ได้ระบุไว้ที่นี่นะ ขอขอบคุณ! 🥰" + morePatrons: " ขอบคุณทุกท่านที่ร่วมกันช่วยเหลือตลอดมานะคะ 🥰" patrons: "สมาชิกพันธมิตร" _displayOfSensitiveMedia: respect: "ซ่อนสื่อทำเครื่องหมายบอกว่าละเอียดอ่อน" @@ -1675,13 +1697,12 @@ _timelineTutorial: _2fa: alreadyRegistered: "คุณได้ลงทะเบียนอุปกรณ์ยืนยันตัวตนแบบ 2 ชั้นแล้ว" registerTOTP: "ลงทะเบียนแอพตัวตรวจสอบสิทธิ์" - passwordToTOTP: "กรอกรหัสผ่าน" step1: "ขั้นตอนแรก ติดตั้งแอปยืนยันตัวตน (เช่น {a} หรือ {b}) บนอุปกรณ์ของคุณ" step2: "จากนั้นสแกนรหัส QR ที่แสดงบนหน้าจอนี้" step2Click: "การคลิกที่รหัส QR นี้จะช่วยให้คุณนั้นสามารถลงทะเบียน 2FA กับคีย์ความปลอดภัยหรือแอปตรวจสอบความถูกต้องของโทรศัพท์ได้" - step2Url: "คุณยังสามารถป้อนบน URL นี้หากคุณใช้โปรแกรมเดสก์ท็อป:" step3Title: "ป้อนรหัสยืนยัน" step3: "ป้อนโทเค็นที่แอปของคุณให้มาเพื่อเสร็จสิ้นการตั้งค่า" + setupCompleted: "ตั้งค่าสำเร็จแล้ว" step4: "นับจากนี้เป็นต้นไปการพยายามเข้าสู่ระบบในอนาคตนั้น อาจจะต้องขอโทเค็นในการเข้าสู่ระบบดังกล่าว\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" securityKeyNotSupported: "เบราว์เซอร์ของคุณไม่รองรับคีย์ความปลอดภัยนะ" registerTOTPBeforeKey: "กรุณาตั้งค่าแอปยืนยันตัวตนเพื่อลงทะเบียนรหัสความปลอดภัยหรือรหัสผ่าน" @@ -1696,6 +1717,7 @@ _2fa: renewTOTPConfirm: "วิธีการแบบนี้จะทําให้รหัสยืนยันจากแอพก่อนหน้าของคุณหยุดทํางานเลยนะ" renewTOTPOk: "ตั้งค่าคอนฟิกใหม่" renewTOTPCancel: "ไม่เป็นไร" + backupCodes: "รหัสสำรองข้อมูล" _permissions: "read:account": "ดูข้อมูลบัญชีของคุณ" "write:account": "แก้ไขข้อมูลบัญชีของคุณ" @@ -1729,6 +1751,10 @@ _permissions: "write:gallery": "แก้ไขแกลเลอรี่ของคุณ" "read:gallery-likes": "ดูรายการโพสต์ในแกลเลอรีที่ชอบของคุณ" "write:gallery-likes": "แก้ไขรายการโพสต์ในแกลเลอรีที่ชอบของคุณ" + "read:flash": "วิว เพลย์" + "write:flash": "แก้ไขเพลย์" + "read:flash-likes": "ดูรายชื่อของไลค์ เพลย์" + "write:flash-likes": "แก้ไขรายชื่อของไลค์ เพลย์" _auth: shareAccessTitle: "การให้สิทธิ์แอปพลิเคชัน" shareAccess: "คุณต้องการอนุญาตให้ \"{name}\" เข้าถึงบัญชีนี้เลยมั้ย?" @@ -1767,7 +1793,7 @@ _widgets: photos: "รูปภาพ" digitalClock: "นาฬิกาดิจิตอล" unixClock: "นาฬิกา UNIX" - federation: "สหพันธ์" + federation: "Fediration" instanceCloud: "อินสแตนซ์คลาวด์" postForm: "แบบฟอร์มการโพสต์" slideshow: "แสดงภาพนิ่ง" @@ -1777,7 +1803,7 @@ _widgets: serverMetric: "ตัวชี้วัดเซิร์ฟเวอร์" aiscript: "AiScript คอนโซล" aiscriptApp: "AiScript แอพ" - aichan: "เอไอ" + aichan: "ไอ" userList: "รายชื่อผู้ใช้" _userList: chooseList: "เลือกรายการ" @@ -1964,6 +1990,10 @@ _notification: unreadAntennaNote: "เสาอากาศ {name}" emptyPushNotificationMessage: "การแจ้งเตือนแบบพุชได้รับการอัพเดทแล้ว" achievementEarned: "รับความสำเร็จ" + testNotification: "ทดสอบการแจ้งเตือน" + checkNotificationBehavior: "ตรวจสอบลักษณะที่ปรากฏการแจ้งเตือน" + sendTestNotification: "ส่งทดสอบการแจ้งเตือน" + notificationWillBeDisplayedLikeThis: "การแจ้งเตือนมีลักษณะแบบนี้" _types: all: "ทั้งหมด" follow: "กำลังติดตาม" @@ -1999,6 +2029,8 @@ _deck: introduction2: "คลิกที่เครื่องหมาย + ทางขวาของหน้าจอเพื่อเพิ่มคอลัมน์ใหม่ทุกครั้งที่คุณต้องการ" widgetsIntroduction: "กรุณาเลือก \"แก้ไขวิดเจ็ต\" ในเมนูคอลัมน์และเพิ่มวิดเจ็ต" useSimpleUiForNonRootPages: "แสดง UI ของ Root Page อย่างง่าย " + usedAsMinWidthWhenFlexible: "ความกว้างขั้นต่ำนั้นจะถูกใช้งานสำหรับสิ่งนี้เมื่อเปิดใช้งานตัวเลือก \"ปรับความกว้างอัตโนมัติ\" หากเลือกเปิดใช้งานแล้ว" + flexible: "ปรับความกว้างอัตโนมัติ" _columns: main: "หลัก" widgets: "วิดเจ็ต" @@ -2033,3 +2065,6 @@ _webhookSettings: renote: "รีโน้ตแล้วเมื่อ" reaction: "เมื่อได้รับรีแอคชั่น" mention: "เมื่อกำลังถูกกล่าวถึง" +_moderationLogTypes: + suspend: "ถูกระงับ" + resetPassword: "รีเซ็ตรหัสผ่าน" diff --git a/locales/tr-TR.yml b/locales/tr-TR.yml index 42cc7da3f8..1111c23091 100644 --- a/locales/tr-TR.yml +++ b/locales/tr-TR.yml @@ -259,6 +259,7 @@ messaging: "Mesajlar" upload: "Yükle" keepOriginalUploading: "Orijinal görseli koru" keepOriginalUploadingDescription: "Orijinal olarak yüklenen görüntüyü olduğu gibi kaydeder. Kapatılırsa, yükleme sırasında web'de görüntülenecek bir sürüm oluşturulur." +fromDrive: "Drive Dosyasından" fromUrl: "Bağlantıdan" uploadFromUrl: "Bağlantıdan yükle" uploadFromUrlDescription: "Yüklemek istediğiniz dosyanın bağlantısı" @@ -305,12 +306,42 @@ renameFolder: "Klasörü Yeniden Adlandır" deleteFolder: "Klasörü sil" addFile: "Dosya ekle" emptyDrive: "Sürücü boş" +emptyFolder: "Bu klasör boş" +unableToDelete: "Silme mümkün değil" +inputNewFileName: "Yeni dosya ismini girin" +inputNewDescription: "Yeni bir başlık gir" +inputNewFolderName: "Yeni klasör ismini girin" +circularReferenceFolder: "Hedef klasör taşınan klasörün bir alt klasörü." hasChildFilesOrFolders: "Klasör boş olmadığından silinemiyor" +copyUrl: "URL'yi kopyala" +rename: "Yeniden adlandır" +avatar: "Avatar" +banner: "Banner" +displayOfSensitiveMedia: "Hassas içerik gösterimi" +whenServerDisconnected: "Sunucu bağlantısı kesildiğinde" +disconnectedFromServer: "Sunucu bağlantısı koptu" +reload: "Yenile" doNothing: "Bir şey yapma" reloadConfirm: "Zaman akışı yenilensin mi?" +watch: "İzle" +unwatch: "İzlemeyi bırak" +accept: "Kabul et" +reject: "Reddet" +normal: "Normal" +instanceName: "Sunucu ismi" +instanceDescription: "Sunucu açıklaması" maintainerName: "Yönetici ismi" +maintainerEmail: "Yöneticinin e-postası" +tosUrl: "Hizmet Koşulları Bağlantısı" +thisYear: "Bu yıl" +thisMonth: "Bu ay" +today: "Bugün" monthX: "{month} ay" +pages: "Sayfalar" +integration: "Entegrasyon" enableRegistration: "Kayıtlara izin ver" +basicInfo: "Temel bilgiler" +pinnedUsers: "Sabitlenmiş kullanıcılar" pinnedNotes: "Sabitlenen" manageAntennas: "Anten ayarları" userList: "Listeler" @@ -322,6 +353,7 @@ smtpHost: "Sağlayıcı" smtpUser: "Kullanıcı Adı" smtpPass: "Şifre" notificationSetting: "Bildirim ayarları" +instanceTicker: "Notların sunucu bilgileri" noCrawleDescription: "Arama motorlarından profilinde, notlarında, sayfalarında vb. dolaşılmamasını ve dizine eklememesini talep et." clearCache: "Ön belleği temizle" onlineUsersCount: "{n} kullanıcı çevrim içi" @@ -338,6 +370,9 @@ pushNotificationNotSupported: "Push bildirimleri sunucu veya tarayıcı tarafın noRole: "Rol bulunamadı" color: "Renk" addMemo: "Kısa not ekle" +icon: "Avatar" +replies: "yanıt" +renotes: "vazgeçme" _accountDelete: started: "Silme işlemi başlatıldı" _email: @@ -413,3 +448,6 @@ _deck: tl: "Zaman çizelgesi" list: "Listeler" mentions: "Bahsetmeler" +_moderationLogTypes: + suspend: "askıya al" + resetPassword: "Şifre sıfırlama" diff --git a/locales/uk-UA.yml b/locales/uk-UA.yml index a57a463689..8997baeefd 100644 --- a/locales/uk-UA.yml +++ b/locales/uk-UA.yml @@ -20,6 +20,7 @@ noNotes: "Немає нотаток" noNotifications: "Немає сповіщень" instance: "Інстанс" settings: "Налаштування" +notificationSettings: "Параметри сповіщень" basicSettings: "Основні налаштування" otherSettings: "Інші налаштування" openInWindow: "Відкрити у вікні" @@ -48,9 +49,12 @@ delete: "Видалити" deleteAndEdit: "Видалити й редагувати" deleteAndEditConfirm: "Ви впевнені, що хочете видалити цю нотатку та відредагувати її? Ви втратите всі реакції, поширення та відповіді на неї." addToList: "Додати до списку" +addToAntenna: "Додати в антени" sendMessage: "Надіслати повідомлення" copyRSS: "Скопіювати RSS" copyUsername: "Скопіювати ім’я користувача" +copyUserId: "Копіювати ID користувача" +copyNoteId: "блокнот ID користувача" searchUser: "Пошук користувачів" reply: "Відповісти" loadMore: "Показати більше" @@ -334,7 +338,6 @@ invite: "Запросити" driveCapacityPerLocalAccount: "Об'єм диска на одного локального користувача" driveCapacityPerRemoteAccount: "Об'єм диска на одного віддаленого користувача" inMb: "В мегабайтах" -iconUrl: "URL аватара" bannerUrl: "URL банера" backgroundImageUrl: "URL-адреса фонового зображення" basicInfo: "Основна інформація" @@ -644,6 +647,7 @@ createNewClip: "Створити нотатку" unclip: "Незакріплений" confirmToUnclipAlreadyClippedNote: "Ця нотатка вже включена до кліпу \"{name}\". Ви хочете виключити нотатку з цього кліпу?" public: "Публічний" +private: "Приватне" i18nInfo: "Misskey перекладається на різні мови волонтерами. Ви можете допомогти: {link}" manageAccessTokens: "Керування токенами доступу" accountInfo: "Інформація про акаунт" @@ -900,6 +904,9 @@ exploreOtherServers: "Знайти інший сервер" letsLookAtTimeline: "Перегляд історії" horizontal: "Збоку" youFollowing: "Підписки" +icon: "Аватар" +replies: "Відповісти" +renotes: "Поширити" _achievements: earnedAt: "Відкрито" _types: @@ -1173,6 +1180,7 @@ _plugin: install: "Встановити плагін" installWarn: "Будь ласка, не встановлюйте плагінів, яким ви не довіряєте." manage: "Керування плагінами" + viewSource: "Переглянути вихідний код" _preferencesBackups: list: "Створені бекапи" saveNew: "Зберегти як новий" @@ -1331,7 +1339,6 @@ _2fa: alreadyRegistered: "Двофакторна автентифікація вже налаштована." step1: "Спершу встановіть на свій пристрій програму автентифікації (наприклад {a} або {b})." step2: "Потім відскануйте QR-код, який відображається на цьому екрані." - step2Url: "Ви також можете ввести цю URL-адресу, якщо використовуєте програму для ПК:" step3: "Щоб завершити налаштування, введіть токен, наданий вашою програмою." step4: "Відтепер будь-які майбутні спроби входу вимагатимуть такого токена.\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" renewTOTPCancel: "Не зараз" @@ -1613,3 +1620,6 @@ _deck: _webhookSettings: name: "Ім'я" active: "Увімкнено" +_moderationLogTypes: + suspend: "Призупинити" + resetPassword: "Скинути пароль" diff --git a/locales/uz-UZ.yml b/locales/uz-UZ.yml index 6eb5af78cf..726333958b 100644 --- a/locales/uz-UZ.yml +++ b/locales/uz-UZ.yml @@ -43,8 +43,8 @@ alreadyFavorited: "allaqachon sevimlilar orasida" cantFavorite: "sevimlilarga qo'shib bo'lmadi" pin: "Profilga qadab qo'yish" unpin: "Profildan olib tashlash" -copyContent: "kontentni nusxalash" -copyLink: "Havolani nuxalash" +copyContent: "Tarkibini nusxalash" +copyLink: "Havolani nusxalash" delete: "O'chirib tashlash" deleteAndEdit: "O'chirish va tahrirlash" deleteAndEditConfirm: "O'chirib, tahrirlamoqchiligingizga ishonchingiz komilmi? Siz bu qaydga tegishli barcha reaktsiyalar va javoblarni yo'qotasiz." @@ -156,6 +156,7 @@ addEmoji: "Emoji qo'shish" settingGuide: "Tavsiya qilingan sozlamalar" cacheRemoteFiles: "Tashqi fayllarni keshlash" cacheRemoteFilesDescription: "Ushbu sozlama o'chirilgan bo'lsa tashqi fayllar bevosita tashqi serverdan yuklanadi. Buni o'chirish ombor ishlatilishini kamaytiradi, lekin traffikni ko'paytiradi, chunki eskizlar generatsiya qilinmaydi." +youCanCleanRemoteFilesCache: "Fayl menejeridagi 🗑️ tugmasi yordamida barcha keshlarni oʻchirib tashlashingiz mumkin." cacheRemoteSensitiveFiles: "Tashqi fayllarni keshlash" cacheRemoteSensitiveFilesDescription: "Bu sozlama oʻchiq boʻlsa, \"barcha ko'rishi mumkin bo'lmagan\" fayllar keshlashsiz toʻgʻridan-toʻgʻri masofaviy serverdan yuklanadi." flagAsBot: "Ushbu akkauntni bot sifatida belgilash" @@ -246,6 +247,7 @@ newPasswordRetype: "Yangi parolni boshqatdan tering" attachFile: "Fayl biriktirish" more: "Ko'proq!" featured: "ta'kidlash" +usernameOrUserId: "Foydalanuvchi nomi yoki identifikatori" noSuchUser: "Foydalanuvchi topilmadi" lookup: "So'rov" announcements: "Bildirishnomalar" @@ -259,7 +261,10 @@ saved: "Saqlandi" messaging: "Suhbat" upload: "Yuklash" keepOriginalUploading: "Asl rasmni saqlang" +keepOriginalUploadingDescription: "Rasmlarni yuklashda asl nusxasini saqlaydi. Agar o'chirilgan bo'lsa, brauzer yuklangandan keyin nashr qilish uchun rasm yaratadi." +fromDrive: "Drive orqali" fromUrl: "URL dan" +uploadFromUrl: "URL orqali yuklash" uploadFromUrlDescription: "Yuklamoqchi bo'lgan faylingizga havola" uploadFromUrlRequested: "yuklab olish so'ralgan" uploadFromUrlMayTakeTime: "Yuklash tugallanishi uchun biroz vaqt ketishi mumkin." @@ -275,6 +280,7 @@ basicNotesBeforeCreateAccount: "Muhim qaydlar" termsOfService: "Foydalanish shartlari" start: "Boshlash" home: "Bosh sahifa" +remoteUserCaution: "Bu foydalanuvchi uzoqda bo'lganligi sababli, ko'rsatilgan ma'lumotlar to'liq bo'lmasligi mumkin." activity: "Faollik" images: "Rasmlar" image: "Rasm" @@ -308,11 +314,13 @@ unableToDelete: "O'chirilmadi" inputNewFileName: "Yangi fayl nomini kiriting" inputNewDescription: "Iltimos, yangi sarlavha kiriting." inputNewFolderName: "Yangi papka nomini kiriting" +circularReferenceFolder: "Belgilangan papka siz ko'chirmoqchi bo'lgan jildning pastki jildidir." hasChildFilesOrFolders: "Bu papka boʻsh emas va uni oʻchirib boʻlmaydi." copyUrl: "Bog'lamadan nusxa olish" rename: "Qayta nomlash" avatar: "Avatar" banner: "Banner" +displayOfSensitiveMedia: "Nozik kontentni ko'rish" whenServerDisconnected: "server bilan aloqa uzilganda" disconnectedFromServer: "Server bilan ulanish uzulib qoldi" reload: "Yangilash" @@ -340,15 +348,20 @@ connectService: "Ulash" disconnectService: "Uzish" enableLocalTimeline: "Mahalliy vaqt mintaqasini yoqing" enableGlobalTimeline: "Global vaqt mintaqasini yoqing" +disablingTimelinesInfo: "Administratorlar va Moderatorlar har doim barcha vaqt jadvallariga kirish huquqiga ega bo'ladilar, hatto ular yoqilmagan bo'lsa ham." registration: "Ro'yxatdan o'tish" enableRegistration: "Ro'yxatdan o'tishni yoqing" invite: "Taklif qilish" +driveCapacityPerLocalAccount: "Har bir mahalliy foydalanuvchi uchun disk maydoni" +driveCapacityPerRemoteAccount: "Har bir masofaviy foydalanuvchi uchun disk maydoni" inMb: "Megabaytlarda" -iconUrl: "Ikonkaning URL manzili (masalan: favicon)" +bannerUrl: "Banner URLi" backgroundImageUrl: "Fon rasmi URL manzili" basicInfo: "Asosiy ma'lumot" pinnedUsers: "Qadalgan foydalanuvchilar" +pinnedUsersDescription: "Har bir qatorga bitta foydalanuvchi nomini kiriting. Bu yerda sanab oʻtilgan foydalanuvchilar “Oʻrganish” yorligʻiga bogʻlanadi." pinnedPages: "Qadalgan Sahifalar" +pinnedClipId: "Qadalgan xabar IDsi" pinnedNotes: "Qadalgan qayd" hcaptcha: "hCaptcha" enableHcaptcha: "hCaptchani yoqish" @@ -358,19 +371,37 @@ recaptcha: "reCAPTCHA" enableRecaptcha: "reCAPTCHA ni yoqish" recaptchaSiteKey: "Sayt kaliti" recaptchaSecretKey: "Maxfiy kalit" +turnstile: "Turniket" +enableTurnstile: "Turniketni yoqish" turnstileSiteKey: "Sayt kaliti" turnstileSecretKey: "Maxfiy kalit" +avoidMultiCaptchaConfirm: "\nBir nechta Captcha tizimlaridan foydalanish ular o'rtasida noqulaylik olib kelishi mumkin. Hozirda faol bo'lgan boshqa Captcha tizimlarini o'chirib qo'ymoqchimisiz? Agar siz ularning faol bo'lishini istasangiz, bekor qilish tugmasini bosing." antennas: "Antennalar" manageAntennas: "Antennalarni boshqarish" name: "Ism" antennaSource: "Antenna manbai" antennaKeywords: "Kalit so'zni qabul qilish" +antennaExcludeKeywords: "Istisno qilingan kalit so'zlar" +antennaKeywordsDescription: "VA sharti uchun bo'shliqlar bilan yoki YOKI sharti uchun qator uzilishlari bilan ajrating." notifyAntenna: "Yangi qaydlar haqida menga xabar bering" +withFileAntenna: "Faqatgina fayli bor qaydlar" +enableServiceworker: "Bildirish nomalarni olish" +antennaUsersDescription: "Har bir foydalunvchi nomini alohida qatorga yozing" +caseSensitive: "Katta-kichik harfni farqlash" +withReplies: "Javob yo'llash" connectedTo: "Quyidagi akkountlarga ulangan" -silence: "Sukunat" +notesAndReplies: "Qaydlar va javoblar" +withFiles: "Fayllar" +silence: "Jim qilish" +silenceConfirm: "Rostdan ham ushbu foydalanuvchini jim qilmoqchimisiz?" +unsilence: "Jim qilishni bekor qilish" +unsilenceConfirm: "Rostdan ham ushbu foydalanuvchini ovozsiz \nqilmoqchimisiz?" popularUsers: "Mashhur foydalanuvchilar." +recentlyUpdatedUsers: "Yaqinda ro'yxatdan o'tgan foydalanuvchilar" recentlyRegisteredUsers: "Yaqinda ro'yxatdan o'tgan foydalanuvchilar" +recentlyDiscoveredUsers: "Yangi foydalanuvchilar" exploreUsersCount: "{count} ta foydalanuvchi bor" +exploreFediverse: "Fediversni ko'rib chiqing" popularTags: "Ommabop teglar" userList: "Ro'yxatlar" about: "Haqida" @@ -381,12 +412,25 @@ token: "Tasdiqlash" totp: "Autentifikatsiya ilovasi" totpDescription: "Bir martalik parollarni kiritish uchun autentifikatsiya ilovasidan foydalaning" moderator: "Moderator" +moderation: "Moderatsiya" nUsersMentioned: "{n} tomonidan chop etilgan" +securityKeyAndPasskey: "Xavfsizlik kaliti va maxfiy so'z" +securityKey: "Xavfsizlik kaliti" +lastUsed: "Oxirgi marta foydalanilgan" +lastUsedAt: "Oxirgi marta {t} da foydalanilgan" +unregister: "ro'yxatdan chiqarish" +passwordLessLogin: "Parolsiz kirshni sozlash" +passwordLessLoginDescription: "Parolsiz kirish" resetPassword: "Parolni tiklash" +newPasswordIs: "Yangi parolingiz {password}" +reduceUiAnimation: "Interfeysdagi animatsiyani kamaytirish" share: "Yuborish" notFound: "Topilmadi" +notFoundDescription: "Ushbu sahifa topilmadi" uploadFolder: "Jildni yuklash" cacheClear: "Keshni tozalash" +markAsReadAllNotifications: "Bildirishnomalarni o'qilgan deb belgilash" +markAsReadAllUnreadNotes: "Barch xabarlarni oq'ilgan deb belgilash" markAsReadAllTalkMessages: "Barcha suhbatlarni o'qilgan deb belgilang" help: "Yordam" inputMessageHere: "Xabar kiriting" @@ -399,6 +443,11 @@ text: "Matn" enable: "Yoqish" next: "Keyingisi" retype: "Qayta kiriting" +noteOf: "{user} tomonidan joylandi\n" +quoteAttached: "Iqtibos" +quoteQuestion: "Iqtibos sifatida qo'shilsinmi?" +noMessagesYet: "Bu yerda xabarlar yo'q" +newMessageExists: "Yangi xabarlar bor" onlyOneFileCanBeAttached: "Faqat bitta faylni biriktirish mumkin" signinRequired: "Davom etishdan oldin ro'yhatdan o'tishingiz yoki tizimga kirishingiz kerak" invitations: "Taklif qilish" @@ -418,10 +467,16 @@ signinWith: "{x} bilan tizimga kirish" signinFailed: "Tizimga kirishda xatolik yuz berdi. Iltimos, foydalanuvchi nomingiz va parolingizni tekshiring." or: "yoki" language: "til" +uiLanguage: "Interfeys tili" aboutX: "{x} haqida" +emojiStyle: "Emoji ko'rinishi" +native: "Mahalliy" +disableDrawer: "Slayd menyusidan foydalanmang" showNoteActionsOnlyHover: "Eslatma amallarini faqat sichqonchani olib borganda ko‘rsatish" noHistory: "Tarix yo'q" signinHistory: "kirish tarixi" +enableAdvancedMfm: "MFMni faollashtirish" +doing: "Bajarilmoqda..." category: "kategoriya" tags: "teg" docSource: "Ushbu hujjatning manbasi" @@ -431,8 +486,10 @@ regenerate: "regeneratsiya" fontSize: "shrift hajmi" limitTo: "{x} gacha" noFollowRequests: "obuna uchun so'rov yo'q" +openImageInNewTab: "Rasmni boshqa oynada ochish" dashboard: "Boshqaruv paneli" local: "Mahalliy" +remote: "masofaviy" total: "Jami" weekOverWeekChanges: "Oxirgi haftadagi o'zgarishlar" dayOverDayChanges: "Kecha bo'lgan o'zgarishlar" @@ -444,18 +501,56 @@ promote: "targ'ib qilish" numberOfDays: "kunlar soni" hideThisNote: "bu eslatmani yashiring" showFeaturedNotesInTimeline: "Tanlangan qaydlarni Timelineda ko'rsatish" +objectStorage: "ob'ektni saqlash" +useObjectStorage: "Ob'ektni saqlashdan foydalaning" objectStorageBaseUrl: "Asosiy URL" +objectStorageBaseUrlDesc: "Malumot va foydalanish uchun URL. Agar siz CDN yoki proksi-serverdan foydalanayotgan bo'lsangiz, URL manzili, S3: 'https://.s3.amazonaws.com', GCS va boshqalar: 'https://storage.googleapis.com/'." +objectStorageBucket: "Bucket" +objectStorageBucketDesc: "Iltimos, foydalaniladigan xizmatning bucket nomini belgilang." +objectStoragePrefix: "Prefix" +objectStorageEndpoint: "Endpoint" objectStorageRegion: "Mintaqa" +objectStorageRegionDesc: "'xx-east-1' kabi mintaqani belgilang. Agar xizmatingizda mintaqa tushunchasi bo'lmasa, `us-east-1` dan foydalaning. AWS konfiguratsiya fayllari yoki muhit oʻzgaruvchilariga havola qilishda boʻsh qoldiring." objectStorageUseSSL: "SSL dan foydalaning" +objectStorageUseSSLDesc: "API ulanishlari uchun https dan foydalanmasangiz, belgini olib tashlang" +objectStorageUseProxy: "Proksi-serverdan foydalaning" +objectStorageUseProxyDesc: "Proksi-serverdan foydalanishni xohlamasangiz, uni o'chiring" +objectStorageSetPublicRead: "Yuklashda \"public-read\" ni o'rnating" +serverLogs: "Server protokoli" +deleteAll: "Hammasini o'chirib tashlash" +showFixedPostForm: "Taqdim etish shaklini vaqt jadvalining yuqori qismida ko'rsating" +newNoteRecived: "Yangi qaydlar mavjud emas" sounds: "Tovushlar" sound: "ovoz" +listen: "Eshitish" none: "Hechnima" +showInPage: "Sahifada ko'rsatish" +popout: "Oching" volume: "Ovoz balandligi" details: "Batafsil" +chooseEmoji: "Emojini tanlang" +unableToProcess: "Opertsiya bajarilmadi" +recentUsed: "Oxirgi ishlatilganlar" +install: "O‘rnatish" +uninstall: "O‘chirib tashlash" +installedApps: "O'rnatilgan ilovalar" +nothing: "Hech narsa yo'q" +installedDate: "O'rnatish sanasi" +lastUsedDate: "Oxirgi marta ishlatilgan sana" +state: "Holat" +sort: "saralamoq" +ascendingOrder: "O'sish bo'yicha" +descendingOrder: "Kamayish bo'yicha" +scratchpad: "Qoralama" output: "Chiqish" +script: "Skript" +disablePagesScript: "AiScriptni sahifalardan o'chirish" +updateRemoteUser: "Masofaviy foydalanuvchi ma'lumotlarini yangilash" deleteAllFiles: "barcha fayllarni o'chirish" deleteAllFilesConfirm: "Barcha fayllar oʻchirilsinmi?" +removeAllFollowing: "Barcha obunalarni o'chirish" userSuspended: "Bu foydalanuvchi muzlatilgan." +userSilenced: "Ushbu foydalanuvchi jim qilingan" yourAccountSuspendedTitle: "akkaunt muzlatilgan" yourAccountSuspendedDescription: "Ushbu akkaunt serverning xizmat ko'rsatish shartlarini buzish kabi sabablarga ko'ra to'xtatilgan. Tafsilotlar uchun administratoringizga murojaat qiling. Iltimos, yangi akkaunt yaratmang." tokenRevoked: "token yaroqsiz" @@ -465,51 +560,305 @@ accountDeletedDescription: "Bu akkaunt oʻchirildi." menu: "Menyu" divider: "Ajratrmoq" addItem: "Element qo'shish" +rearrange: "Qayta saralash" +inboxUrl: "Qabul qilingan xabarlar URL manzili" serviceworkerInfo: "bildirishnomalar uchun yoqilgan bo'lishi kerak." deletedNote: "Oʻchirilgan post" +visibility: "Ko'rinishi" +poll: "So'ro'vnoma" +useCw: "Kontentni yashirish" +enablePlayer: "Video pleyerni ochish" +disablePlayer: "Video pleyerni yopish" +expandTweet: "Xabarni kengaytirish" themeEditor: "Rang sxemasi muharriri" +description: "tavsif" describeFile: "sarlavha qo'shing" enterFileDescription: "sarlavha kiriting" author: "muallif" leaveConfirm: "Sizda saqlanmagan oʻzgarishlar bor. Bekor qilinsinmi?" +manage: "Administratsiya" +plugins: "Kengaytmalar, plaginlar" +preferencesBackups: "Sozlamalarni zahiralash" useBlurEffectForModal: "Modal uchun xiralashtirish effektidan foydalaning" +useFullReactionPicker: "Katta oynada reaksiya tanlash" width: "kengligi" height: "balandligi" large: "Katta" +medium: "O'rta" small: "kichik" +generateAccessToken: "Kirish tokenini yaratish" +permission: "Ruxsatlar" enableAll: "Yoqish" disableAll: "hammasini o'chirib qo'ying" +tokenRequested: "Hisobga kirish" +pluginTokenRequestedDescription: "Bu plagin shu yerda belgilanganlarga qodir bo'ladi" +notificationType: "Bildirishnoma turi" edit: "Tahrirlash" +emailServer: "Email server" email: "Email" +emailAddress: "E-pochtangiz:" +smtpConfig: "SMTP server sozlamalari" smtpHost: "Host" +smtpPort: "Port" smtpUser: "Foydalanuvchi nomi" smtpPass: "Parol" +testEmail: "Email jo'natmani testlash" +userSaysSomething: "{name} nimadir dedi" +makeActive: "Faol" +display: "Displey" copy: "Nusxa olish" +metrics: "Metrikalar" +overview: "Umumiy ma'lumot" +logs: "Jurnallar" +delayed: "Kechiktirildi" +database: "Ma'lumotlar bazasi" +channel: "Kanallar" +create: "Yaratish" notificationSetting: "Bildirishnoma sozlamalari" +notificationSettingDesc: "Ko'rsatish uchun bildirishnoma turlarini tanlang." +useGlobalSetting: "Global sozlamalardan foydalanish" other: "Qo‘shimcha" +regenerateLoginToken: "Kirish tokenini qayta yaratish" +setMultipleBySeparatingWithSpace: "Bo'sh joy qoldirib, bir necha ma'lumot kiritish mumkin" +fileIdOrUrl: "Fayl ID'si yoki URL havolasi" behavior: "Hatti-harakatlar" sample: "Namuna" +abuseReports: "Shikoyatlar" +reportAbuse: "Shikoyat qilish" +reportAbuseOf: "{name} ustidan shikoyat qilish" +abuseReported: "Shikoyatingiz yetkazildi. Ma'lumot uchun rahmat." +reporter: "Shikoyat qiluvchi" +reporteeOrigin: "Xabarning kelib chiqishi" +reporterOrigin: "Xabarchining joylashuvi" +forwardReport: "Xabarni masofadagi serverga yuborish" +forwardReportIsAnonymous: "Sizning yuborayotgan xabaringiz o'z akkountingiz emas balki anonim tarzda qoladi" +send: "Yuborish" +abuseMarkAsResolved: "Yuborilgan xabarni hal qilingan deb belgilash" +openInNewTab: "Yangi tab da ochish" +openInSideView: "Yon panelda ochish" +defaultNavigationBehaviour: "Standart navigatsiya harakati" +editTheseSettingsMayBreakAccount: "Bu sozlamalarni o'zgartirish hisobingizga zarar yetkazishi mumkin." +waitingFor: "{x}ni kutayapman" +random: "Tasodifiy" +system: "Tizim" +switchUi: "Interfeysni almashtirish" +desktop: "Brauzer rejimi" +clip: "Klip" +createNew: "Yangi yaratish" +optional: "Ixtiyoriy" +createNewClip: "Yangi klip yaratish" +unclip: "qirqish\n" +confirmToUnclipAlreadyClippedNote: "Ushbu xat allaqachon \"{name}\" klipga tegishli. Uni ushbu klipdan olib tashlashni xohlaysizmi?" public: "Ommaviy" +i18nInfo: "Misskey bir qancha volontyorlar yordamida bir qancha tillarga tarjima qilingan. Ushbu {link} orqali ularga yordam berishingiz mumkin." +manageAccessTokens: "Kirish tokenlarini boshqarish" +accountInfo: "Akkount haqida ma'lumot" +notesCount: "Xatlar soni" +repliesCount: "Yuborilgan javoblar soni" +renotesCount: "Qayta yuborilgan xatlar soni" +repliedCount: "Qabul qilingan javoblar soni" +renotedCount: "Qayta yuborilgan xatlar soni" +followingCount: "Obuna bo'lingan akkountlar soni" +followersCount: "Obunachilar soni" +sentReactionsCount: "Yuborilgan reaksiyalar soni" +receivedReactionsCount: "Qabul qilingan reaksiyalar soni" +pollVotesCount: "Berilgan ovozlar soni" +pollVotedCount: "Qabul qilingan ovozlar soni" +yes: "Ha" +no: "Yo'q" +driveFilesCount: "Diskdagi fayllar soni" +driveUsage: "Ishlatilgan disk joyi" +noCrawleDescription: "Qidiruv tizimlari sizning profilingiz, sahifalaringiz, xatlaringiz va hokazolarni belgilamasligi uchun so'rov yuborish" +lockedAccountInfo: "Xatlaringizni faqatgina obunachilaringizga ko'rsatishni xohlasangiz unda \"Faqat Obunachilar uchun\" xususiyatini yoqishingiz lozim. Bo'lmasa sizning yozgan xatlaringiz hammaga ko'rinadi." +alwaysMarkSensitive: "Avvaldan ta'sirchan kontent deb belgilash" +loadRawImages: "Thumbnaillarsiz Original rasmni yuklash" +disableShowingAnimatedImages: "Animatsiyali rasmlarni ko'rsatmaslik" +verificationEmailSent: "Emailingizga tasdiqlash xabari yuborildi. Iltimos linkda ko'rsatilgan amallarga rioya qiling" +notSet: "Sozlanmagan" +emailVerified: "Elektron pochta manzili tasdiqlandi" +pageLikesCount: "Sahifadagi like'lar soni" +contact: "aloqa uchun manzil" +useSystemFont: "Tizimdagi standart shriftidan foydalaning" +clips: "Klip" +experimentalFeatures: "eksperimental xususiyatlar" +experimental: "eksperimental" +developer: "Dasturchi" +makeExplorable: "Akkauntingizni topishni osonlashtiring" +duplicate: "Dublikat" +left: "Chap(dagi)" +center: "Markaz" +wide: "Keng" +narrow: "Tor" +reloadToApplySetting: "Bu sozlamalar sahifa yangilangandagina kuchga kiradi. Hozir yangilashni istaysizmi?" +needReloadToApply: "Sahifani yangilash talab etiladi." clearCache: "Keshni tozalash" onlineUsersCount: "Faol userlar" +nUsers: "{n} ta foydalanuvchi" myTheme: "Mening rang sxemam" backgroundColor: "Fon" accentColor: "Urg'u" textColor: "Matn" +saveAs: "Boshqacha saqlash" +advanced: "Murakkab" +advancedSettings: "Qo'shimcha sozlashlar" +value: "Qiymati" +createdAt: "Yaratilish vaqti" +updatedAt: "yangilangan sana" +saveConfirm: "O'zgartirishni saqlash?" +deleteConfirm: "o'chirishni tasdiqlash" +invalidValue: "noto'g'ri qiymat" +registry: "ro'yhatga olish" +closeAccount: "hisobni yopish / profilni yopish" +currentVersion: "joriy versiya" +latestVersion: "so'ngi versiya" +youAreRunningUpToDateClient: "siz so'ngi versiyali ilovani ishlatyapsiz" +newVersionOfClientAvailable: "Mijozning yangi versiyasi mavjud." +usageAmount: "foydalanish miqdori" +capacity: "sig'im" +inUse: "allaqachon band" +editCode: "kodni tahrirlash" +apply: "Ilova" +receiveAnnouncementFromInstance: "Serverdan bildirishnomalarni oling" +emailNotification: "E-mail xabarlari" +publish: "Chiqarish" +inChannelSearch: "Kanal qidirish" +useReactionPickerForContextMenu: "kontekst menyusi uchun reaktsiya tanlash vositasidan foydalaning" +typingUsers: "{users} yozmoqda" +jumpToSpecifiedDate: "Muayyan sanaga o'tish" +showingPastTimeline: "O'tgan vaqt jadvallarini ko'rsatish" +clear: "aniq" +markAllAsRead: "hammasini o'qilgan deb belgilang" +goBack: "qaytish" +unlikeConfirm: "Un like qilishni xohlaysizmi?" +fullView: "to'liq ko'rish" +quitFullView: "Toʻliq koʻrishdan chiqish" +addDescription: "Tavsif qo'shing" info: "Haqida" +userInfo: "Foydalanuvchi ma'lumotlari" +unknown: "aniq emas" +onlineStatus: "onlayn holat" +hideOnlineStatus: "onlayn holatni yashirish" +hideOnlineStatusDescription: "Onlayn statusingizni yashirish, qidiruv kabi baʼzi funksiyalardan foydalanish imkoniyatini kamaytirishi mumkin." +online: "onlayn" +active: "Aktiv" +offline: "oflayn" +notRecommended: "tavsiya etilmaydi" +selectAccount: "Akkauntni tanlang" +switchAccount: "akkauntni almashtirish" +enabled: "yaroqli" +disabled: "yaroqsiz" +quickAction: "tezkor harakat" user: "Foydalanuvchilar" +administration: "Administratsiya" +accounts: "akkaunt" +switch: "almashtirish" +noBotProtectionWarning: "Bot himoyasi sozlanmagan." +configure: "sozlamoq" +postToGallery: "Yangi galleriya posti" +gallery: "Galereya" +recentPosts: "So'nggi postlar" +popularPosts: "Mashhur postlar" +shareWithNote: "Eslatmani ulashish" +ads: "Reklama" +startingperiod: "Boshlanish davri" +memo: "Eslatma" +priority: "Ustuvorlik" +high: "Yuqori" +middle: "O'rta" +low: "Quyi" +ratio: "nisbat" +previewNoteText: "Razm solish" +customCss: "Maxsus CSS" global: "Global" squareAvatars: "Kvadrat avatarkalar" +sent: "Yuborish" +received: "Qabul qilingan" +searchResult: "Qidiruv natijalari" +hashtags: "Hashteglar" +troubleshooting: "Muammolarni bartaraf qilish" +useBlurEffect: "Interfeysda xiralashtiruvchi effektlardan foydalanish" +learnMore: "Batafsilroq" +misskeyUpdated: "Misskey yangilandi!" +whatIsNew: "O'zgarishlarni ko'rish" +translate: "Tarjima qilish" +translatedFrom: "{x} tilidan tarjima qilindi" +devMode: "Dasturchi rejimi" +lastCommunication: "Oxirgi muloqot" +resolved: "Hal qilingan" +unresolved: "Hal qilinmagan" +breakFollow: "Obunachini o'chirish" +breakFollowConfirm: "Obunachini o'chirmoqchimisiz?" +itsOn: "Yoqilgan" +itsOff: "O'chirilgan" +on: "Yoqish" +off: "O'chirish" +emailRequiredForSignup: "Ro'yxatdan o'tish uchun email talab qilish" +unread: "Oʻqilmagan xabarlar" +filter: "Filter" +controlPanel: "Boshqaruv paneli" +manageAccounts: "Hisobni boshqarish" +classic: "Klassik" +hide: "Yashirish" searchByGoogle: "Izlash" indefinitely: "Hech qachon" file: "Fayllar" +recommended: "Tavsiya qilingan" +check: "Tekshirish" +requireAdminForView: "Ko'rish uchun adminstrator hisobi bilan tizimga kirgan bo'lishingiz kerak." +isSystemAccount: "Ushbu hisob tizim tomonidan avtomatik tarzda yaratilgan va boshqariladi." +typeToConfirm: "Ushbu amalni bajarish uchun {x}ni kiriting" +deleteAccount: "Hisobni o'chirish" +document: "hujjat" +numberOfPageCache: "Sahifa keshlar soni" +logoutConfirm: "Chiqishni xohlaysizmi?" +lastActiveDate: "oxirgi foydalanish sanasi" +statusbar: "Holat paneli" +pleaseSelect: "Iltimos tanlang" +reverse: "Teskari" +colored: "rangli" +refreshInterval: "yangilash oralig'i" label: "Yorliq" +type: "turi" +speed: "tezlik" +slow: "Sekin" +fast: "Tez" +localOnly: "Faqat mahalliy" +remoteOnly: "faqat masofadan turib" +failedToUpload: "yuklanmadi" +cannotUploadBecauseInappropriate: "Faylni yuklab bo'lmaydi, chunki unda nomaqbul kontent borligi aniqlangan." +cannotUploadBecauseNoFreeSpace: "Yuklab bo'lmadi, chunki diskda bo'sh joy yo'q." +cannotUploadBecauseExceedsFileSizeLimit: "Faylni yuklash mumkin emas, chunki u fayl hajmi chegarasidan oshib ketgan." +beta: "beta" +account: "akkaunt" +show: "Displey" color: "Rang" +disableFederationConfirm: "Federatsiyani o'chirmoqchimisiz?" +disableFederationOk: "O'chirish" +emailNotSupported: "Bu server E-pochtalar yuborishni qo'llab-quvvatlamaydi" +postToTheChannel: "Kanalga joylash" +cannotBeChangedLater: "Buni keyinchalik o'zgartirishni iloji yo'q" +likeOnly: "Faqat like'lar" +nonSensitiveOnly: "Xavfsiz rejim" +rolesAssignedToMe: "Mening rollarim" +resetPasswordConfirm: "Qayta parol o'rnatmoqchimisiz?" +sensitiveWords: "Ta'sirchan so'zlar" +icon: "Avatar" +replies: "Javob berish" +renotes: "Qayta qayd etish" _achievements: _types: _viewInstanceChart: title: "Tahlilchi" +_role: + priority: "Ustuvorlik" + _priority: + low: "Quyi" + middle: "O'rta" + high: "Yuqori" +_ffVisibility: + public: "Chiqarish" _ad: + back: "qaytish" hide: "Boshqa ko'rsatilmasin" _email: _follow: @@ -566,6 +915,7 @@ _ago: minutesAgo: "{n} daqiqa oldin" hoursAgo: "{n} soat oldin" daysAgo: "{n} kun oldin" + invalid: "Hech narsa yo'q" _2fa: renewTOTPCancel: "Hozir emas" _permissions: @@ -734,3 +1084,6 @@ _webhookSettings: _events: renote: "Qayta qayd qilinganda" mention: "Eslanganda" +_moderationLogTypes: + suspend: "To'xtatish" + resetPassword: "Parolni tiklash" diff --git a/locales/vi-VN.yml b/locales/vi-VN.yml index 35081148a2..7b41956e37 100644 --- a/locales/vi-VN.yml +++ b/locales/vi-VN.yml @@ -1,5 +1,5 @@ --- -_lang_: "Tiếng Việt" +_lang_: "Tiếng Nhật" headlineMisskey: "Mạng xã hội liên hợp" introMisskey: "Xin chào! Misskey là một nền tảng tiểu blog phi tập trung mã nguồn mở.\nViết \"tút\" để chia sẻ những suy nghĩ của bạn 📡\nBằng \"biểu cảm\", bạn có thể bày tỏ nhanh chóng cảm xúc của bạn với các tút 👍\nHãy khám phá một thế giới mới! 🚀" poweredByMisskeyDescription: "{name} là một trong những chủ máy của Misskey là nền tảng mã nguồn mở" @@ -20,6 +20,7 @@ noNotes: "Chưa có bài viết nào." noNotifications: "Chưa có thông báo" instance: "Máy chủ" settings: "Cài đặt" +notificationSettings: "Cài đặt thông báo" basicSettings: "Thiết lập chung" otherSettings: "Thiết lập khác" openInWindow: "Mở trong cửa sổ mới" @@ -44,13 +45,20 @@ pin: "Ghim" unpin: "Bỏ ghim" copyContent: "Chép nội dung" copyLink: "Chép liên kết" +copyLinkRenote: "Sao chép liên kết ghi chú" delete: "Xóa" deleteAndEdit: "Sửa" deleteAndEditConfirm: "Bạn có chắc muốn sửa tút này? Những biểu cảm, lượt trả lời và đăng lại sẽ bị mất." addToList: "Thêm vào danh sách" +addToAntenna: "Thêm vào Ăngten" sendMessage: "Gửi tin nhắn" copyRSS: "Sao chép RSS" copyUsername: "Chép tên người dùng" +copyUserId: "Sao chép ID người dùng" +copyNoteId: "Sao chép ID ghi chú" +copyFileId: "Sao chép ID tập tin" +copyFolderId: "Sao chép ID thư mục" +copyProfileUrl: "Sao chép URL hồ sơ" searchUser: "Tìm kiếm người dùng" reply: "Trả lời" loadMore: "Tải thêm" @@ -122,6 +130,8 @@ unmarkAsSensitive: "Bỏ đánh dấu nhạy cảm" enterFileName: "Nhập tên tập tin" mute: "Ẩn" unmute: "Bỏ ẩn" +renoteMute: "Mute Renotes" +renoteUnmute: "Unmute Renotes" block: "Chặn" unblock: "Bỏ chặn" suspend: "Vô hiệu hóa" @@ -131,8 +141,10 @@ unblockConfirm: "Bạn có chắc muốn bỏ chặn người này?" suspendConfirm: "Bạn có chắc muốn vô hiệu hóa người này?" unsuspendConfirm: "Bạn có chắc muốn bỏ vô hiệu hóa người này?" selectList: "Chọn danh sách" +editList: "Chỉnh sửa danh sách" selectChannel: "Lựa chọn kênh" selectAntenna: "Chọn một antenna" +editAntenna: "Chỉnh sửa Ăngten" selectWidget: "Chọn tiện ích" editWidgets: "Sửa tiện ích" editWidgetsExit: "Xong" @@ -145,6 +157,9 @@ addEmoji: "Thêm emoji" settingGuide: "Cài đặt đề xuất" cacheRemoteFiles: "Tập tin cache từ xa" cacheRemoteFilesDescription: "Khi tùy chọn này bị tắt, các tập tin từ xa sẽ được tải trực tiếp từ máy chủ khác. Điều này sẽ giúp giảm dung lượng lưu trữ nhưng lại tăng lưu lượng truy cập, vì hình thu nhỏ sẽ không được tạo." +youCanCleanRemoteFilesCache: "Bạn có thể xoá bộ nhớ đệm bằng cách nhấn vào nút🗑️ở trong phần quản lý tệp." +cacheRemoteSensitiveFiles: "Lưu các tập tin nhạy cảm vào bộ nhớ tạm từ xa" +cacheRemoteSensitiveFilesDescription: "Khi bạn tắt tính năng này, các tệp nhạy cảm sẽ được tải trực tiếp từ máy chủ và không được lưu vào bộ nhớ tạm" flagAsBot: "Đánh dấu đây là tài khoản bot" flagAsBotDescription: "Bật tùy chọn này nếu tài khoản này được kiểm soát bởi một chương trình. Nếu được bật, nó sẽ được đánh dấu để các nhà phát triển khác ngăn chặn chuỗi tương tác vô tận với các bot khác và điều chỉnh hệ thống nội bộ của Misskey để coi tài khoản này như một bot." flagAsCat: "Chế độ Mèeeeeeeeeeo!!" @@ -153,6 +168,7 @@ flagShowTimelineReplies: "Hiện lượt trả lời trong bảng tin" flagShowTimelineRepliesDescription: "Hiện lượt trả lời của người bạn theo dõi trên tút của những người khác." autoAcceptFollowed: "Tự động phê duyệt theo dõi từ những người mà bạn đang theo dõi" addAccount: "Thêm tài khoản" +reloadAccountsList: "Cập nhật danh sách tài khoản" loginFailed: "Đăng nhập không thành công" showOnRemote: "Truy cập trang của người này" general: "Tổng quan" @@ -259,8 +275,10 @@ noMoreHistory: "Không còn gì để đọc" startMessaging: "Bắt đầu trò chuyện" nUsersRead: "đọc bởi {n}" agreeTo: "Tôi đồng ý {0}" +agree: "Đồng ý" agreeBelow: "Đồng ý với nội dung dưới đây" basicNotesBeforeCreateAccount: "Những điều cơ bản cần chú ý " +termsOfService: "Điều khoản và Điều kiện" start: "Bắt đầu" home: "Trang chính" remoteUserCaution: "Vì người dùng này ở máy chủ khác, thông tin hiển thị có thể không đầy đủ." @@ -303,6 +321,7 @@ copyUrl: "Sao chép URL" rename: "Đổi tên" avatar: "Ảnh đại diện" banner: "Ảnh bìa" +displayOfSensitiveMedia: "Hiển thị nội dung nhạy cảm (NSFW)" whenServerDisconnected: "Khi mất kết nối tới máy chủ" disconnectedFromServer: "Mất kết nối tới máy chủ" reload: "Tải lại" @@ -337,7 +356,6 @@ invite: "Mời" driveCapacityPerLocalAccount: "Dung lượng ổ đĩa tối đa cho mỗi người dùng" driveCapacityPerRemoteAccount: "Dung lượng ổ đĩa tối đa cho mỗi người dùng từ xa" inMb: "Tính bằng MB" -iconUrl: "URL Icon" bannerUrl: "URL Ảnh bìa" backgroundImageUrl: "URL Ảnh nền" basicInfo: "Thông tin cơ bản" @@ -393,10 +411,13 @@ aboutMisskey: "Về Misskey" administrator: "Quản trị viên" token: "Token" 2fa: "Xác thực 2 yếu tố" +setupOf2fa: "Thiết lập xác thực 2 yếu tố" totp: "Ứng dụng xác thực" totpDescription: "Nhắn mã OTP bằng ứng dụng xác thực" moderator: "Kiểm duyệt viên" moderation: "Kiểm duyệt" +moderationNote: "Ghi chú kiểm duyệt" +addModerationNote: "Thêm ghi chú kiểm duyệt" nUsersMentioned: "Dùng bởi {n} người" securityKeyAndPasskey: "Mã bảo mật・Passkey" securityKey: "Khóa bảo mật" @@ -456,6 +477,7 @@ aboutX: "Giới thiệu {x}" emojiStyle: "Kiểu cách Emoji" native: "Bản xứ" disableDrawer: "Không dùng menu thanh bên" +showNoteActionsOnlyHover: "Chỉ hiển thị các hành động ghi chú khi di chuột" noHistory: "Không có dữ liệu" signinHistory: "Lịch sử đăng nhập" enableAdvancedMfm: "Xem bài MFM chất lượng cao." @@ -468,6 +490,7 @@ createAccount: "Tạo tài khoản" existingAccount: "Tài khoản hiện có" regenerate: "Tạo lại" fontSize: "Cỡ chữ" +limitTo: "Giới hạn tỷ lệ {x}" noFollowRequests: "Bạn không có yêu cầu theo dõi nào" openImageInNewTab: "Mở ảnh trong tab mới" dashboard: "Trang chính" @@ -504,6 +527,7 @@ objectStorageSetPublicRead: "Đặt \"public-read\" khi tải lên" serverLogs: "Nhật ký máy chủ" deleteAll: "Xóa tất cả" showFixedPostForm: "Hiện khung soạn tút ở phía trên bảng tin" +showFixedPostFormInChannel: "Hiển thị mẫu bài đăng ở phía trên bản tin" newNoteRecived: "Đã nhận tút mới" sounds: "Âm thanh" sound: "Âm thanh" @@ -541,9 +565,14 @@ userSuspended: "Người này đã bị vô hiệu hóa." userSilenced: "Người này đã bị ẩn" yourAccountSuspendedTitle: "Tài khoản bị vô hiệu hóa" yourAccountSuspendedDescription: "Tài khoản này đã bị vô hiệu hóa do vi phạm quy tắc máy chủ hoặc điều tương tự. Liên hệ với quản trị viên nếu bạn muốn biết lý do chi tiết hơn. Vui lòng không tạo tài khoản mới." +tokenRevoked: "Token đã bị từ chối" +tokenRevokedDescription: "Phiên đăng nhập đã hết hạn. Vui lòng đăng nhập lại." +accountDeleted: "Tài khoản đã bị xóa" +accountDeletedDescription: "Tài khoản này đã bị xóa." menu: "Menu" divider: "Phân chia" addItem: "Thêm mục" +rearrange: "Sắp xếp lại" relays: "Chuyển tiếp" addRelay: "Thêm chuyển tiếp" inboxUrl: "URL Hộp thư đến" @@ -653,6 +682,7 @@ createNewClip: "Tạo một ghim mới" unclip: "Bỏ ghim" confirmToUnclipAlreadyClippedNote: "Bài đăng này là một phần của \"{name}\" ghim. Bạn có muốn bỏ khỏi ghim?" public: "Công khai" +private: "Riêng tư" i18nInfo: "Misskey đang được các tình nguyện viên dịch sang nhiều thứ tiếng khác nhau. Bạn có thể hỗ trợ tại {link}." manageAccessTokens: "Tạo mã truy cập" accountInfo: "Thông tin tài khoản" @@ -687,6 +717,8 @@ contact: "Liên hệ" useSystemFont: "Dùng phông chữ mặc định của hệ thống" clips: "Lưu bài viết" experimentalFeatures: "Tính năng thử nghiệm" +experimental: "Thử nghiệm" +thisIsExperimentalFeature: "Tính năng này đang trong quá trình thử nghiệm. Tính năng có thể không hoạt động, hoặc đặc tính kỹ thuật có thể bị thay đổi sau này." developer: "Nhà phát triển" makeExplorable: "Không hiện tôi trong \"Khám phá\"" makeExplorableDescription: "Nếu bạn tắt, tài khoản của bạn sẽ không hiện trong mục \"Khám phá\"." @@ -771,6 +803,7 @@ noMaintainerInformationWarning: "Chưa thiết lập thông tin vận hành." noBotProtectionWarning: "Bảo vệ Bot chưa thiết lập." configure: "Thiết lập" postToGallery: "Tạo tút có ảnh" +postToHashtag: "Đăng bài với hashtag này" gallery: "Thư viện ảnh" recentPosts: "Tút gần đây" popularPosts: "Tút được xem nhiều nhất" @@ -804,6 +837,7 @@ translatedFrom: "Dịch từ {x}" accountDeletionInProgress: "Đang xử lý việc xóa tài khoản" usernameInfo: "Bạn có thể sử dụng chữ cái (a ~ z, A ~ Z), chữ số (0 ~ 9) hoặc dấu gạch dưới (_). Tên người dùng không thể thay đổi sau này." aiChanMode: "Chế độ Ai" +devMode: "Chế độ dành cho nhà phát triển" keepCw: "Giữ cảnh báo nội dung" pubSub: "Tài khoản Chính/Phụ" lastCommunication: "Lần giao tiếp cuối" @@ -813,6 +847,8 @@ breakFollow: "Xóa người theo dõi" breakFollowConfirm: "Bạn bỏ theo dõi tài khoản này không?" itsOn: "Đã bật" itsOff: "Đã tắt" +on: "Bật" +off: "Tắt" emailRequiredForSignup: "Yêu cầu địa chỉ email khi đăng ký" unread: "Chưa đọc" filter: "Bộ lọc" @@ -857,6 +893,7 @@ failedToFetchAccountInformation: "Không thể lấy thông tin tài khoản" rateLimitExceeded: "Giới hạn quá mức" cropImage: "Cắt hình ảnh" cropImageAsk: "Bạn có muốn cắt ảnh này?" +cropYes: "Cắt" cropNo: "Để nguyên" file: "Tập tin" recentNHours: "{n}h trước" @@ -892,6 +929,7 @@ remoteOnly: "Chỉ máy chủ từ xa" failedToUpload: "Tải lên thất bại" cannotUploadBecauseInappropriate: "Không thể tải lên tập tin này vì các phần của tập tin đã được phát hiện có khả năng là NSFW." cannotUploadBecauseNoFreeSpace: "Tải lên không thành công do thiếu dung lượng Drive." +cannotUploadBecauseExceedsFileSizeLimit: "Không thể tải lên tập tin vì kích thước quá lớn." beta: "Beta" enableAutoSensitive: "Tự động đánh dấu NSFW" enableAutoSensitiveDescription: "Cho phép tự động phát hiện và đánh dấu media NSFW thông qua học máy, nếu có thể. Ngay cả khi tùy chọn này bị tắt, nó vẫn có thể được bật trên toàn máy chủ." @@ -904,9 +942,11 @@ pushNotification: "Thông báo đẩy" subscribePushNotification: "Bật thông báo đẩy" unsubscribePushNotification: "Tắt thông báo đẩy" pushNotificationAlreadySubscribed: "Đang bật thông báo đẩy" +pushNotificationNotSupported: "Trình duyệt của bạn không hỗ trợ thông báo đẩy." sendPushNotificationReadMessage: "Xóa thông báo đẩy sau khi đọc thông báo hay tin nhắn" sendPushNotificationReadMessageCaption: "Thông báo như {emptyPushNotificationMessage} sẽ hiển thị trong giây phút. Tiêu tốn pin của máy bạn có thể tăng lên hơn nữa." windowMaximize: "Phóng to" +windowMinimize: "Thu nhỏ tối đa" windowRestore: "Khôi phục" caption: "Mô tả" loggedInAsBot: "Đang đăng nhập bằng tài khoản Bot" @@ -923,12 +963,22 @@ didYouLikeMisskey: "Bạn có ưa thích Mískey không?" pleaseDonate: "Misskey là phần mềm miễn phí mà {host} đang sử dụng. Xin mong bạn quyên góp cho chúng tôi để chúng tôi có thể tiếp tục phát triển dịch vụ này. Xin cảm ơn!!" roles: "Vai trò" role: "Vai trò" +noRole: "Bạn chưa được cấp quyền." normalUser: "Người dùng bình thường" undefined: "Chưa xác định" +assign: "Phân công" +unassign: "Hủy phân công" color: "Màu sắc" manageCustomEmojis: "Quản lý CustomEmoji" +youCannotCreateAnymore: "Bạn đã tới giới hạn tạo." cannotPerformTemporary: "Tạm thời không sử dụng được" cannotPerformTemporaryDescription: "Tạm thời không sử dụng được vì lần số điều kiện quá giới hạn. Thử lại sau mọt lát nữa." +invalidParamError: "Lỗi tham số" +invalidParamErrorDescription: "Có vấn đề với các tham số được request. Thông thường, đây là do bug, nhưng cũng có thể do bạn đã nhập vào quá nhiều ký tự." +permissionDeniedError: "Thao tác bị từ chối" +permissionDeniedErrorDescription: "Tài khoản này không có đủ quyền hạn để thực hiện thao tác này." +preset: "Mẫu thiết lập" +selectFromPresets: "Chọn từ mẫu" achievements: "Thành tích" gotInvalidResponseError: "Không nhận được trả lời chủ máy" gotInvalidResponseErrorDescription: "Chủ máy có lẻ ngừng hoạt động hoặc bảo trí. Thử lại sau một lát nữa. " @@ -943,8 +993,95 @@ copyErrorInfo: "Sao chép thông tin lỗi" joinThisServer: "Đăng ký trên chủ máy này" exploreOtherServers: "Tìm chủ máy khác" letsLookAtTimeline: "Thử xem Timeline" +emailNotSupported: "Máy chủ này không hỗ trợ gửi email" +postToTheChannel: "Đăng lên kênh" +cannotBeChangedLater: "Không thể thay đổi sau này." +rolesAssignedToMe: "Vai trò được giao cho tôi" +resetPasswordConfirm: "Bạn thực sự muốn đặt lại mật khẩu?" +sensitiveWords: "Các từ nhạy cảm" +license: "Giấy phép" +unfavoriteConfirm: "Bạn thực sự muốn xoá khỏi mục yêu thích?" +retryAllQueuesConfirmText: "Điều này sẽ tạm thời làm tăng mức độ tải của máy chủ." +enableChartsForRemoteUser: "Tạo biểu đồ người dùng từ xa" +video: "Video" +videos: "Các video" +dataSaver: "Tiết kiệm dung lượng" +accountMigration: "Chuyển tài khoản" +accountMoved: "Người dùng này đã chuyển sang một tài khoản mới:" +accountMovedShort: "Tài khoản này đã được chuyển" +operationForbidden: "Thao tác này không thể thực hiện" +forceShowAds: "Luôn hiện quảng cáo" +notificationDisplay: "Thông báo" +leftTop: "Phía trên bên tráí" +rightTop: "Phía trên bên phải" +leftBottom: "Phía dưới bên trái" +rightBottom: "Phía dưới bên phải" +stackAxis: "Hướng chồng" +vertical: "Dọc" horizontal: "Thanh bên" +position: "Vị trí" +serverRules: "Luật của máy chủ" youFollowing: "Đang theo dõi" +later: "Để sau" +goToMisskey: "Tới Misskey" +installed: "Đã tải xuống" +branding: "Thương hiệu" +turnOffToImprovePerformance: "Tắt mục này có thể cải thiện hiệu năng." +expirationDate: "Ngày hết hạn" +noExpirationDate: "Vô thời hạn" +waitingForMailAuth: "Đang chờ xác nhận email" +unused: "Chưa được sử dụng" +used: "Đã được sử dụng" +expired: "Đã hết hạn" +doYouAgree: "Đồng ý?" +iHaveReadXCarefullyAndAgree: "Tôi đã đọc và đồng ý với \"x\"." +dialog: "Hộp thoại" +icon: "Ảnh đại diện" +forYou: "Dành cho bạn" +currentAnnouncements: "Thông báo hiện tại" +pastAnnouncements: "Thông báo trước đó" +youHaveUnreadAnnouncements: "Có thông báo chưa đọc." +replies: "Trả lời" +renotes: "Đăng lại" +loadReplies: "Hiển thị các trả lời" +pinnedList: "Các mục đã được ghim" +keepScreenOn: "Giữ màn hình luôn bật" +verifiedLink: "Chúng tôi đã xác nhận bạn là chủ sở hữu của đường dẫn này" +_announcement: + forExistingUsers: "Chỉ những người dùng đã tồn tại" + forExistingUsersDescription: "Nếu được bật, thông báo này sẽ chỉ hiển thị với những người dùng đã tồn tại vào lúc thông báo được tạo. Nếu tắt đi, những tài khoản mới đăng ký sau khi thông báo được đăng lên cũng sẽ thấy nó." + end: "Lưu trữ thông báo" + tooManyActiveAnnouncementDescription: "Có quá nhiều thông báo sẽ làm trải nghiệm của người dùng tệ đi. Vui lòng lưu trữ những thông báo đã hết hiệu lực." + readConfirmTitle: "Đánh dấu là đã đọc?" + readConfirmText: "Điều này sẽ đánh dấu nội dung của \"{title}\" là đã đọc." +_initialAccountSetting: + accountCreated: "Tài khoản của bạn đã được tạo thành công!" + letsStartAccountSetup: "Để bắt đầu, hãy cùng thiết lập tài khoản nhé." + letsFillYourProfile: "Đầu tiên, hãy thiết lập hồ sơ của bạn." + profileSetting: "Thiết lập hồ sơ" + privacySetting: "Cài đặt quyền riêng tư" + theseSettingsCanEditLater: "Bạn vẫn có thể thay đổi những cài đặt này." + youCanEditMoreSettingsInSettingsPageLater: "Còn rất nhiều những cài đặt khác bạn có thể thay đổi ở trang \"Cài đặt\". Hãy nhớ ghé thăm trong lần sau nhé." + followUsers: "Thử theo dõi một vài người mà bạn có thể thích để xây dựng dòng thời gian của mình." + pushNotificationDescription: "Bật thông báo đẩy sẽ cho phép bạn nhận thông báo từ {name} trực tiếp từ thiết bị của bạn." + initialAccountSettingCompleted: "Thiết lập tài khoản thành công!" + haveFun: "Hãy tận hưởng {name} nhé!" + ifYouNeedLearnMore: "Nếu bạn muốn tìm hiểu thêm về cách sử dụng {name} (Misskey), hãy vào {link}." + skipAreYouSure: "Bạn thực sự muốn bỏ qua mục thiết lập tài khoản?" + laterAreYouSure: "Bạn thực sự muốn thiết lập tài khoản vào lúc khác?" +_serverSettings: + iconUrl: "Biểu tượng URL" + appIconResolutionMustBe: "Độ phân giải tối thiểu là {resolution}." + manifestJsonOverride: "Ghi đè manifest.json" +_accountMigration: + moveFrom: "Chuyển một tài khoản khác vào tài khoản này" + moveFromLabel: "Tài khoản gốc #{n}" + moveTo: "Chuyển tài khoản này vào một tài khoản khác" + moveCannotBeUndone: "Việc chuyển tài khoản không thể huỷ." + moveAccountDescription: "Điều này sẽ chuyển tài khoản này sang một tài khoản khác.\n ・Những người theo dõi sẽ tự động được chuyển sang tài khoản mới\n ・Tài khoản này sẽ tự bỏ theo dõi những người mà bạn đã theo dõi trước đây\n ・Bạn sẽ không thể đăng tút mới, v.v trên tài khoản này\n\nDù việc chuyển người theo dõi được diễn ra tự động, bạn vẫn phải tự chuẩn bị một vài bước để chuyển danh sách những người dùng bạn đang theo dõi. Để làm vậy, vui lòng thực hiện việc xuất dữ liệu những người dùng đã theo dõi mà sau này bạn sẽ dùng để nhập vào tài khoản mới ở menu Cài đặt. Hành động tương tự áp dụng với danh sách những người dùng bị chặn hoặc tắt tiếng.\n\n(Điều này áp dụng cho phiên bản Misskey v13.12.0 và sau này. Các phần mềm ActivityPub khác , ví dụ như Mastodon, sẽ có thể hoạt động khác đi.)" + startMigration: "Chuyển" + movedAndCannotBeUndone: "\nTài khoản này đã được chuyển đi.\nViệc di chuyển tài khoản không thể bị huỷ bỏ." + movedTo: "Tài khoản mới:" _achievements: earnedAt: "Ngày thu nhận" _types: @@ -983,6 +1120,8 @@ _achievements: title: "Hàng tinh đăng bài" description: "Đã đăng bài 50,000 lần rồi" _notes100000: + title: "ALL YOUR NOTE ARE BELONG TO US" + description: "Đăng 100,000 tút" flavor: "Liệu viết bài gì tầm này vậy? " _login3: title: "Sơ cấp I" @@ -1014,6 +1153,15 @@ _achievements: _login400: title: "Khách hàng thường xuyên cấp III" description: "Tổng số ngày đăng nhập đạt 400 ngày" + _login1000: + flavor: "Cảm ơn bạn đã sử dụng Misskey!" + _noteFavorited1: + title: "Nhà thiên văn học" + _myNoteFavorited1: + title: "Đi tìm những ngôi sao" + _profileFilled: + title: "Luôn sẵn sàng" + description: "Thiết lập tài khoản của bạn" _markedAsCat: title: "Tôi là một con mèo" description: "Bật chế độ mèo" @@ -1039,8 +1187,18 @@ _achievements: _followers10: title: "FOLLOW ME!!" description: "Người theo dõi bạn vượt lên 10 người" + _followers50: + title: "Từng chút một" + description: "Đạt được 50 lượt theo dõi" + _followers100: + title: "Người nổi tiếng" + description: "Đạt được 100 lượt theo dõi" + _followers300: + title: "Vui lòng xếp thành hàng nào" + description: "Đạt được 300 lượt theo dõi" _followers500: title: "Trạm phát sóng" + description: "Đạt được 500 lượt theo dõi" _followers1000: title: "Người có tầm ảnh hưởng" description: "Người theo dõi bạn vượt lên 1000 người" @@ -1059,11 +1217,15 @@ _achievements: description: "Tìm thấy được những kho báu cất giấu" _client30min: title: "Giải lao xỉu" + description: "Giữ Misskey mở trong ít nhất 30 phút" + _client60min: + description: "Giữ Misskey mở trong ít nhất 60 phút" _noteDeletedWithin1min: title: "Xem như không có gì đâu nha" _postedAtLateNight: title: "Loài ăn đêm" description: "Đăng bài trong đêm khuya " + flavor: "Đến giờ đi ngủ rồi." _postedAt0min0sec: title: "Tín hiệu báo giờ" description: "Đăng bài vào 0 phút 0 giây" @@ -1094,6 +1256,8 @@ _achievements: _setNameToSyuilo: title: "Ngưỡng mộ với vị thần" description: "Đạt tên là syuilo" + _passedSinceAccountCreated1: + title: "Kỷ niệm một năm" _loggedInOnBirthday: title: "Sinh nhật vủi vẻ" description: "Đăng nhập vào ngày sinh" @@ -1104,6 +1268,7 @@ _achievements: _cookieClicked: flavor: "Bạn nhầm phầm mềm chứ?" _role: + assignTarget: "Phân công" priority: "Ưu tiên" _priority: low: "Thấp" @@ -1178,6 +1343,7 @@ _plugin: install: "Cài đặt tiện ích" installWarn: "Vui lòng không cài đặt những tiện ích đáng ngờ." manage: "Quản lý plugin" + viewSource: "Xem mã nguồn" _preferencesBackups: list: "Tạo sao lưu" saveNew: "Lưu bản sao lưu" @@ -1346,15 +1512,24 @@ _time: minute: "phút" hour: "giờ" day: "ngày" +_timelineTutorial: + step4_1: "Bạn có thể thêm \"Reaction\" vào ghi chú" + step4_2: "Khi thêm biểu cảm hãy nhấn dấu \"+\"" _2fa: alreadyRegistered: "Bạn đã đăng ký thiết bị xác minh 2 bước." - passwordToTOTP: "Nhắn mật mã" + registerTOTP: "Đăng ký ứng dụng xác thực" step1: "Trước tiên, hãy cài đặt một ứng dụng xác minh (chẳng hạn như {a} hoặc {b}) trên thiết bị của bạn." step2: "Sau đó, quét mã QR hiển thị trên màn hình này." - step2Url: "Bạn cũng có thể nhập URL này nếu sử dụng một chương trình máy tính:" + step2Click: "Quét mã QR trên ứng dụng xác thực (Authy, Google authenticator, v.v.)" + step3Title: "Nhập mã xác thực" step3: "Nhập mã token do ứng dụng của bạn cung cấp để hoàn tất thiết lập." step4: "Kể từ bây giờ, những lần đăng nhập trong tương lai sẽ yêu cầu mã token đăng nhập đó.\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" + securityKeyNotSupported: "Trình duyệt của bạn không hỗ trợ khóa bảo mật" + registerTOTPBeforeKey: "Vui lòng thiết lập một ứng dụng xác thực để đăng ký khóa bảo mật hoặc mật khẩu." securityKeyInfo: "Bên cạnh xác minh bằng vân tay hoặc mã PIN, bạn cũng có thể thiết lập xác minh thông qua khóa bảo mật phần cứng hỗ trợ FIDO2 để bảo mật hơn nữa cho tài khoản của mình." + registerSecurityKey: "Tạo khóa bảo mật hoặc mã bảo mật" + securityKeyName: "Nhập tên khóa bảo mật" + tapSecurityKey: "Vui lòng làm theo hướng dẫn của trình duyệt để đăng ký mã bảo mật hoặc mã khóa" removeKey: "Xóa mã bảo mật" removeKeyConfirm: "Xóa bản sao lưu {name}?" renewTOTP: "Cài đặt lại ứng dụng xác thực" @@ -1677,5 +1852,14 @@ _dialog: charactersExceeded: "Bạn nhắn quá giới hạn ký tự!! Hiện nay {current} / giới hạn {max}" charactersBelow: "Bạn nhắn quá ít tối thiểu ký tự!! Hiện nay {current} / Tối thiểu {min}" _webhookSettings: + createWebhook: "Tạo Webhook" name: "Tên" + secret: "Mã bí mật" + events: "Sự kiện Webhook" active: "Đã bật" + _events: + reaction: "Khi nhận được sự kiện" + mention: "Khi có người nhắc tới bạn" +_moderationLogTypes: + suspend: "Vô hiệu hóa" + resetPassword: "Đặt lại mật khẩu" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index 9599e3d51e..cc858d3bcd 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -15,7 +15,7 @@ gotIt: "我明白了" cancel: "取消" noThankYou: "不用,谢谢" enterUsername: "输入用户名" -renotedBy: "由 {user} 转贴" +renotedBy: "{user} 转发了" noNotes: "没有帖文" noNotifications: "无通知" instance: "服务器" @@ -45,6 +45,7 @@ pin: "置顶" unpin: "取消置顶" copyContent: "复制内容" copyLink: "复制链接" +copyLinkRenote: "复制转帖链接" delete: "删除" deleteAndEdit: "删除并编辑" deleteAndEditConfirm: "要删除此帖并再次编辑吗?对此帖的所有回应、转发和回复也将被删除。" @@ -155,13 +156,14 @@ emojiUrl: "emoji 地址" addEmoji: "添加表情符号" settingGuide: "推荐配置" cacheRemoteFiles: "缓存远程文件" -cacheRemoteFilesDescription: "当禁用此设定时远程文件将直接从远程服务器载入。禁用后会减小储存空间需求,但是会增加流量,因为缩略图不会被生成。" +cacheRemoteFilesDescription: "启用此设定时,将在此服务器上缓存远程文件。虽然可以加快图片显示的速度,但是相对的会消耗大量的服务器存储空间。用户角色内的网盘容量决定了这个远程用户能在服务器上保留保留多少缓存。当超出了这个限制时,旧的文件将从缓存中被删除,成为链接。当禁用此设定时,则是从一开始就将远程文件保留为链接。此时推荐将 default.yml 的 proxyRemoteFiles 设置为 true 以优化缩略图生成及保护用户隐私。" +youCanCleanRemoteFilesCache: "可以使用文件管理的🗑️按钮来删除所有的缓存。" cacheRemoteSensitiveFiles: "缓存远程敏感媒体文件" cacheRemoteSensitiveFilesDescription: "如果禁用这项设定,远程服务器的敏感媒体将不会被缓存,而是直接链接。" flagAsBot: "这是一个机器人账号" flagAsBotDescription: "如果此账户由程序控制,请启用此项。启用后,此标志可以帮助其他开发人员防止机器人之间产生无限互动的行为,并让 Misskey 的内部系统将此账户识别为机器人。" -flagAsCat: "将这个账户设定为一只猫" -flagAsCatDescription: "如果您想表明此帐户是一只猫,请打开此标志。\n开启后,会在您的头像上出现猫耳朵,并将你的帖子中的「na」替换为「nya」,日文同理。" +flagAsCat: "喵!!!!!!!!!!!!" +flagAsCatDescription: "喵喵喵??" flagShowTimelineReplies: "在时间线上显示帖子的回复" flagShowTimelineRepliesDescription: "启用时,时间线除了显示用户的帖子外,还会显示其他用户对帖子的回复。" autoAcceptFollowed: "自动允许来自我关注的用户对我的关注请求" @@ -177,7 +179,7 @@ searchWith: "搜索:{q}" youHaveNoLists: "列表为空" followConfirm: "你确定要关注 {name} 吗?" proxyAccount: "代理账户" -proxyAccountDescription: "代理账户是在某些情况下充当用户的远程关注者的账户。 例如,当一个用户列出一个远程用户时,如果没有人跟随该列出的用户,则该活动将不会传递到该服务器,因此将代之以代理账户。" +proxyAccountDescription: "代理账户是在某些情况下替代用户进行远程关注用的账户。 例如说,当用户将一位远程用户放入一个列表中时,如果本地服务器上没有任何人关注这位远程用户,则这位远程用户的账户活动将不会被送到本地服务器上。作为替代,此时将使用代理账户进行关注。" host: "主机名" selectUser: "选择用户" recipient: "收件人" @@ -211,7 +213,7 @@ clearQueueConfirmText: "未送达的帖子将不会投递。 通常,您不需 clearCachedFiles: "清除缓存" clearCachedFilesConfirm: "确定要清除缓存文件?" blockedInstances: "被封锁的服务器" -blockedInstancesDescription: "设定要封锁的服务器,以换行来进行分割。被封锁的服务器将无法与本服务器进行交换通讯。" +blockedInstancesDescription: "设定要封锁的服务器,以换行来进行分割。被封锁的服务器将无法与本服务器进行交换通讯。子域名也同样会被封锁。" muteAndBlock: "屏蔽/拉黑" mutedUsers: "已屏蔽用户" blockedUsers: "已拉黑的用户" @@ -354,7 +356,6 @@ invite: "邀请" driveCapacityPerLocalAccount: "每个用户的网盘容量" driveCapacityPerRemoteAccount: "每个远程用户的网盘容量" inMb: "以兆字节(MegaByte)为单位" -iconUrl: "图标 URL" bannerUrl: "横幅 URL" backgroundImageUrl: "背景图 URL" basicInfo: "基本信息" @@ -410,10 +411,14 @@ aboutMisskey: "关于 Misskey" administrator: "管理员" token: "Token (令牌)" 2fa: "双因素认证" +setupOf2fa: "设置双因素认证" totp: "身份验证应用" totpDescription: "使用认证应用输入一次性密码。" moderator: "监察员" moderation: "管理" +moderationNote: "管理笔记" +addModerationNote: "添加管理笔记" +moderationLogs: "管理日志" nUsersMentioned: "{n} 被提到" securityKeyAndPasskey: "安全密钥或 Passkey" securityKey: "安全密钥" @@ -507,13 +512,13 @@ showFeaturedNotesInTimeline: "在时间线上显示热门推荐" objectStorage: "对象存储" useObjectStorage: "使用对象存储" objectStorageBaseUrl: "Base URL" -objectStorageBaseUrlDesc: "这里是用于引用的 URL,如果您正在使用 CDN 或反向代理,请指定其 URL,例如S3:“https://.s3.amazonaws.com”,GCS:“https://storage.googleapis.com/”" +objectStorageBaseUrlDesc: "这里是用于参考的 URL,如果您正在使用 CDN 或反向代理,请指定其 URL,例如 S3:“https://.s3.amazonaws.com”,GCS:“https://storage.googleapis.com/”" objectStorageBucket: "存储桶" objectStorageBucketDesc: "请指定使用的对象存储服务的存储桶名称。" objectStoragePrefix: "前缀" objectStoragePrefixDesc: "文件将存储在此前缀的目录下。" -objectStorageEndpoint: "Endpoint" -objectStorageEndpointDesc: "如果你使用 AWS S3 请留空。否则请根据你使用的服务商的说明来进行设置,指定 Endpoint 形式为“”或“:”。" +objectStorageEndpoint: "端点" +objectStorageEndpointDesc: "如果你使用 AWS S3 请留空。否则请根据你使用的服务商的说明来进行设置,指定端点形式为“”或“:”。" objectStorageRegion: "可用区" objectStorageRegionDesc: "指定一个可用区,例如“xx-east-1”。 如果您的对象存储服务没有可用区概念,请将其留空或填写“us-east-1”。如果引用 AWS 的配置文件或环境变量,则留空。" objectStorageUseSSL: "使用 SSL" @@ -653,6 +658,7 @@ behavior: "行为" sample: "示例" abuseReports: "举报" reportAbuse: "举报" +reportAbuseRenote: "举报转帖" reportAbuseOf: "举报 {name}" fillAbuseReportDescription: "请填写举报的详细原因。如果有对方发的帖子,请同时填写 URL 地址。" abuseReported: "内容已发送。感谢您提交信息。" @@ -680,6 +686,7 @@ createNewClip: "新建便签" unclip: "移除便签" confirmToUnclipAlreadyClippedNote: "本帖已包含在便签 \"{name}\" 里。您想要将本帖从该便签中移除吗?" public: "公开" +private: "私密" i18nInfo: "Misskey 已经被志愿者们翻译成了各种语言。如果你也有兴趣,可以通过 {link} 帮助翻译。" manageAccessTokens: "管理 Access Tokens" accountInfo: "账户信息" @@ -704,6 +711,7 @@ lockedAccountInfo: "即使启用该功能,只要您不将帖子可见范围设 alwaysMarkSensitive: "默认将媒体文件标记为敏感内容" loadRawImages: "添加附件图像的缩略图时使用原始图像质量" disableShowingAnimatedImages: "不播放动画" +highlightSensitiveMedia: "高亮显示敏感媒体" verificationEmailSent: "已发送确认电子邮件。请访问电子邮件中的链接以完成设置。" notSet: "未设置" emailVerified: "电子邮件地址已验证" @@ -1018,7 +1026,7 @@ retryAllQueuesConfirmText: "可能会使服务器负荷在一定时间内增加" enableChartsForRemoteUser: "生成远程用户的图表" enableChartsForFederatedInstances: "生成远程服务器的图表" showClipButtonInNoteFooter: "在贴文下方显示便签按钮" -largeNoteReactions: "使用大图标来显示回应" +reactionsDisplaySize: "回应显示大小" noteIdOrUrl: "帖子 ID 或 URL" video: "视频" videos: "视频" @@ -1094,6 +1102,33 @@ expired: "已过期" doYouAgree: "你同意吗?" beSureToReadThisAsItIsImportant: "请好好阅读,这真的很重要。" iHaveReadXCarefullyAndAgree: "我已经仔细阅读并同意了「{x}」的内容。" +dialog: "对话框" +icon: "头像" +forYou: "您的" +currentAnnouncements: "现在的公告" +pastAnnouncements: "过去的公告" +youHaveUnreadAnnouncements: "您有未读的公告" +useSecurityKey: "请根据浏览器或设备的提示,使用安全密钥或通行密钥。" +replies: "回复" +renotes: "转发" +loadReplies: "查看回复" +loadConversation: "查看对话" +pinnedList: "已置顶的列表" +keepScreenOn: "保持设备屏幕开启" +verifiedLink: "已验证的链接" +notifyNotes: "打开发帖通知" +unnotifyNotes: "关闭发帖通知" +authentication: "验证" +authenticationRequiredToContinue: "要继续,请先进行验证" +_announcement: + forExistingUsers: "仅限现有用户" + forExistingUsersDescription: "若启用,该公告将仅对创建此公告时存在的用户可见。 如果禁用,则在创建此公告后注册的用户也可以看到该公告。" + needConfirmationToRead: "需要确认才能标记为已读" + needConfirmationToReadDescription: "若启用,则会在标记已读时会显示确认对话框。此外,它也会不受批量已读操作的影响。" + end: "结束公告" + tooManyActiveAnnouncementDescription: "若有大量活动公告,可能会造成用户体验可能下降。请考虑归档已完成的公告。" + readConfirmTitle: "标记为已读?" + readConfirmText: "阅读“{title}”的内容并将其标记为已读。" _initialAccountSetting: accountCreated: "账户创建完成了!" letsStartAccountSetup: "来进行帐户的初始设置吧。" @@ -1111,6 +1146,15 @@ _initialAccountSetting: laterAreYouSure: "要稍后再进行初始设定吗?" _serverRules: description: "在新用户注册前显示服务器的简单规则。推荐显示服务条款的主要内容。" +_serverSettings: + iconUrl: "图标 URL" + appIconDescription: "指定当 {host} 显示为 app 时的图标。" + appIconUsageExample: "例如:作为书签添加到 PWA 或手机主屏幕的时候" + appIconStyleRecommendation: "因为有可能会被裁切为圆形或者圆角矩形,建议使用边缘带有留白背景的图标。" + appIconResolutionMustBe: "分辨率必须为 {resolution}。" + manifestJsonOverride: "覆盖 mainfest.json" + shortName: "简称" + shortNameDescription: "如果服务器的正式名称很长,可以用简称或者別名来替代。" _accountMigration: moveFrom: "从别的账号迁移到此账户" moveFromSub: "为另一个账户建立别名" @@ -1365,6 +1409,9 @@ _achievements: title: "Brain Diver" description: "发布了包含 Brain Diver 链接的帖子" flavor: "Misskey-Misskey La-Tu-Ma" + _smashTestNotificationButton: + title: "过度测试" + description: "短时间内连续测试通知" _role: new: "创建角色" edit: "编辑角色" @@ -1488,6 +1535,7 @@ _plugin: install: "安装插件" installWarn: "请不要安装不可信的插件。" manage: "管理插件..." + viewSource: "查看源代码" _preferencesBackups: list: "已创建的备份" saveNew: "另存为" @@ -1675,13 +1723,13 @@ _timelineTutorial: _2fa: alreadyRegistered: "此设备已被注册" registerTOTP: "开始设置认证应用" - passwordToTOTP: "请输入您的密码" step1: "首先,在您的设备上安装验证应用,例如 {a} 或 {b}。" step2: "然后,扫描屏幕上显示的二维码。" step2Click: "通过点击二维码,您可以使用设备上安装的身份验证器应用程序或密钥环进行注册" - step2Url: "在桌面应用程序中输入以下 URL:" + step2Uri: "如果使用桌面应用程序的话,请输入下面的 URI" step3Title: "输入验证码" step3: "输入您的应用提供的动态口令以完成设置。" + setupCompleted: "设置完成" step4: "从现在开始,任何登录操作都将要求您提供动态口令。\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" securityKeyNotSupported: "您的浏览器不支持安全密钥。" registerTOTPBeforeKey: "要注册安全密钥或 Passkey,请先设置验证器应用程序。" @@ -1696,6 +1744,11 @@ _2fa: renewTOTPConfirm: "当前验证器应用程序的验证码将不再有效" renewTOTPOk: "重新配置" renewTOTPCancel: "不用,谢谢" + checkBackupCodesBeforeCloseThisWizard: "在关闭此窗口前,请确认下面的备用代码" + backupCodes: "备用代码" + backupCodesDescription: "如果无法使用认证应用,可以使用以下的备用代码来访问账户。请务必将这些代码保存在安全的地方。每个代码仅可使用一次。" + backupCodeUsedWarning: "已使用备用代码。如果无法使用认证应用,请尽快重新设定。" + backupCodesExhaustedWarning: "已使用完所有的备用代码。如果无法使用认证应用,将无法再访问您的账户。请再次设定认证应用。" _permissions: "read:account": "查看账户信息" "write:account": "更改帐户信息" @@ -1729,6 +1782,10 @@ _permissions: "write:gallery": "操作图库" "read:gallery-likes": "读取喜欢的图片" "write:gallery-likes": "操作喜欢的图片" + "read:flash": "查看 Play" + "write:flash": "编辑 Play" + "read:flash-likes": "查看 Play 的点赞" + "write:flash-likes": "编辑 Play 的点赞列表" _auth: shareAccessTitle: "应用程序授权许可" shareAccess: "您要授权允许 “{name}” 访问您的帐户吗?" @@ -1744,6 +1801,7 @@ _antennaSources: homeTimeline: "已关注用户的帖子" users: "来自指定用户的帖子" userList: "来自指定列表中的帖子" + userBlacklist: "除掉已选择用户后所有的帖子" _weekday: sunday: "星期日" monday: "星期一" @@ -1843,6 +1901,7 @@ _profile: metadataContent: "内容" changeAvatar: "修改头像" changeBanner: "修改横幅" + verifiedLinkDescription: "如果将内容设置为 URL,当链接所指向的网页内包含自己的个人资料链接时,可以显示一个已验证图标。" _exportOrImport: allNotes: "所有帖子" favoritedNotes: "收藏的帖子" @@ -1961,11 +2020,17 @@ _notification: youReceivedFollowRequest: "您有新的关注请求" yourFollowRequestAccepted: "您的关注请求已通过" pollEnded: "问卷调查结果已生成。" + newNote: "新的帖子" unreadAntennaNote: "天线 {name}" emptyPushNotificationMessage: "推送通知已更新" achievementEarned: "获得成就" + testNotification: "测试通知" + checkNotificationBehavior: "检查通知显示" + sendTestNotification: "发送测试通知" + notificationWillBeDisplayedLikeThis: "通知将会这样表示" _types: all: "全部" + note: "用户的新帖子" follow: "关注中" mention: "提及" reply: "回复" @@ -1999,6 +2064,8 @@ _deck: introduction2: "您可以随时通过屏幕右侧的 + 来添加列" widgetsIntroduction: "从列菜单中,选择“小工具编辑”来添加小工具" useSimpleUiForNonRootPages: "用简易UI表示非根页面" + usedAsMinWidthWhenFlexible: "「自适应宽度」被启用的时候,这就是最小的宽度" + flexible: "自适应宽度" _columns: main: "主列" widgets: "小工具" @@ -2033,3 +2100,25 @@ _webhookSettings: renote: "被转发时" reaction: "被回应时" mention: "被提及时" +_moderationLogTypes: + assignRole: "分配角色" + unassignRole: "取消分配角色" + updateRole: "更新角色" + suspend: "冻结" + unsuspend: "解除冻结" + addCustomEmoji: "添加自定义表情符号" + updateCustomEmoji: "更新自定义表情符号" + deleteCustomEmoji: "删除自定义表情符号" + updateServerSettings: "更新服务器设置" + updateUserNote: "更新管理笔记" + deleteDriveFile: "删除文件" + deleteNote: "删除帖子" + createGlobalAnnouncement: "创建全体通知" + createUserAnnouncement: "创建用户通知" + updateGlobalAnnouncement: "更新全体通知" + updateUserAnnouncement: "更新用户通知" + deleteGlobalAnnouncement: "删除全体通知" + deleteUserAnnouncement: "删除用户通知" + resetPassword: "重置密码" + markSensitiveDriveFile: "标记网盘文件为敏感媒体" + unmarkSensitiveDriveFile: "取消标记网盘文件为敏感媒体" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index cbb2a1a34f..77c8da9b04 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -1,9 +1,9 @@ --- _lang_: "繁體中文" headlineMisskey: "貼文連繫網絡" -introMisskey: "歡迎!Misskey 是一個開源且去中心化的社群網路服務。\n發佈「貼文」向身邊的人分享您的想法!📡\n利用「反應」表達您對貼文的感覺!👍\n讓我們一起探索新的世界吧!🚀" -poweredByMisskeyDescription: "{name}是使用開放原始碼平台Misskey的服務之一(稱為 Misskey 伺服器)。\n" -monthAndDay: "{month}月 {day}日" +introMisskey: "歡迎!Misskey 是一個開放原始碼且去中心化的社群網路服務。\n發布「貼文」向身邊的人分享您的想法!📡\n利用「反應」表達您對貼文的感覺!👍\n讓我們一起探索新的世界吧!🚀" +poweredByMisskeyDescription: "{name}是開放原始碼平臺 Misskey 的伺服器之一。" +monthAndDay: "{month} 月 {day} 日" search: "搜尋" notifications: "通知" username: "使用者名稱" @@ -15,8 +15,8 @@ gotIt: "知道了" cancel: "取消" noThankYou: "現在不要" enterUsername: "輸入使用者名稱" -renotedBy: "{user} 轉發了" -noNotes: "無貼文。" +renotedBy: "{user} 轉發" +noNotes: "無貼文" noNotifications: "沒有通知" instance: "伺服器" settings: "設定" @@ -26,7 +26,7 @@ otherSettings: "其他設定" openInWindow: "在新視窗開啟" profile: "個人檔案" timeline: "時間軸" -noAccountDescription: "此用戶還沒有自我介紹" +noAccountDescription: "此使用者尚未自我介紹" login: "登入" loggingIn: "登入中" logout: "登出" @@ -45,6 +45,7 @@ pin: "置頂" unpin: "取消置頂" copyContent: "複製內容" copyLink: "複製連結" +copyLinkRenote: "複製轉貼連結" delete: "刪除" deleteAndEdit: "刪除並編輯" deleteAndEditConfirm: "要刪除並再次編輯嗎?此貼文的所有反應、轉發和回覆也將會消失。" @@ -135,8 +136,8 @@ block: "封鎖" unblock: "解除封鎖" suspend: "凍結" unsuspend: "解除凍結" -blockConfirm: "確定要封鎖此用戶?" -unblockConfirm: "確定解除封鎖此用戶?" +blockConfirm: "確定要封鎖此使用者嗎?" +unblockConfirm: "確定要解除封鎖此使用者嗎?" suspendConfirm: "確定凍結此帳戶?" unsuspendConfirm: "確定解凍此帳戶?" selectList: "選擇清單" @@ -155,15 +156,16 @@ emojiUrl: "表情符號URL" addEmoji: "新增表情符號" settingGuide: "推薦設定" cacheRemoteFiles: "快取遠端檔案" -cacheRemoteFilesDescription: "禁用此設定會停止遠端檔案的緩存,從而節省儲存空間,但資料會因直接連線從而產生額外連接數據。" +cacheRemoteFilesDescription: "禁用此設定會停止建立遠端檔案快取,從而節省伺服器儲存空間,但會因從遠端讀取資料而增加網路數據用量。" +youCanCleanRemoteFilesCache: "按檔案管理的🗑️按鈕,將快取全部刪除。" cacheRemoteSensitiveFiles: "快取遠端的敏感檔案" cacheRemoteSensitiveFilesDescription: "若停用這個設定,則不會快取遠端的敏感檔案,而是直接連結。" flagAsBot: "此使用者是機器人" -flagAsBotDescription: "如果本帳戶是由程式控制,請啟用此選項。啟用後,會作為標示幫助其他開發者防止機器人之間產生無限互動的行為,並會調整Misskey內部系統將本帳戶識別為機器人。" +flagAsBotDescription: "標記本帳戶由程式控制,防止其他程式與本帳戶產生無限互動的行為。" flagAsCat: "此帳戶是一隻貓,喵~~~!!!" flagAsCatDescription: "如果想將本帳戶標示為一隻貓,請開啟此標示" flagShowTimelineReplies: "在時間軸上顯示貼文的回覆" -flagShowTimelineRepliesDescription: "啟用時,時間線除了顯示用戶的貼文以外,還會顯示用戶對其他貼文的回覆。" +flagShowTimelineRepliesDescription: "啟用時,時間軸除了顯示使用者的貼文以外,還會顯示使用者對其他貼文的回覆。" autoAcceptFollowed: "自動允許來自追隨中使用者的追隨請求" addAccount: "新增帳戶" reloadAccountsList: "更新帳戶清單的資訊" @@ -177,12 +179,12 @@ searchWith: "搜尋: {q}" youHaveNoLists: "你沒有任何清單" followConfirm: "你真的要追隨{name}嗎?" proxyAccount: "代理帳戶" -proxyAccountDescription: "代理帳戶是在某些情況下充當其他伺服器用戶的帳戶。例如,當使用者將一個來自其他伺服器的帳戶放在列表中時,由於沒有其他使用者追隨該帳戶,該指令不會傳送到該伺服器上,因此會由代理帳戶追隨。" +proxyAccountDescription: "代理帳戶是在特定條件下充當遠端追隨者的帳戶。例如,當使用者新增遠端使用者至其列表時,若沒有本地使用者追隨該遠端使用者,則其活動將不會傳送至伺服器,此時便會由代理帳戶代為追隨以解決問題。" host: "主機" selectUser: "選取使用者" recipient: "收件人" annotation: "註解" -federation: "站台聯邦" +federation: "聯邦宇宙" instances: "伺服器" registeredAt: "初次觀測" latestRequestReceivedAt: "上次收到的請求" @@ -197,10 +199,10 @@ operations: "操作" software: "軟體" version: "版本" metadata: "元資料" -withNFiles: "{n}個檔案" +withNFiles: "{n} 個檔案" monitor: "監視器" jobQueue: "佇列" -cpuAndMemory: "CPU及記憶體用量" +cpuAndMemory: "CPU 及記憶體" network: "網路" disk: "硬碟" instanceInfo: "伺服器資訊" @@ -213,8 +215,8 @@ clearCachedFilesConfirm: "確定要清除所有遠端暫存資料嗎?" blockedInstances: "已封鎖的伺服器" blockedInstancesDescription: "請逐行輸入需要封鎖的伺服器。已封鎖的伺服器將無法與本伺服器進行通訊。" muteAndBlock: "靜音和封鎖" -mutedUsers: "已靜音用戶" -blockedUsers: "已封鎖用戶" +mutedUsers: "被靜音的使用者" +blockedUsers: "被封鎖的使用者" noUsers: "沒有任何使用者" editProfile: "編輯個人檔案" noteDeleteConfirm: "確定刪除此貼文嗎?" @@ -236,7 +238,7 @@ publishing: "直播中" notResponding: "沒有回應" instanceFollowing: "追隨的伺服器" instanceFollowers: "伺服器的追隨者" -instanceUsers: "用戶" +instanceUsers: "伺服器使用者" changePassword: "修改密碼" security: "安全性" retypedNotMatch: "兩次輸入不一致。" @@ -246,7 +248,7 @@ newPasswordRetype: "確認密碼" attachFile: "上傳附件" more: "更多!" featured: "精選" -usernameOrUserId: "使用者名稱或使用者ID" +usernameOrUserId: "使用者名稱或使用者 ID" noSuchUser: "使用者不存在" lookup: "查詢" announcements: "公告" @@ -262,16 +264,16 @@ upload: "上傳" keepOriginalUploading: "保留原圖" keepOriginalUploadingDescription: "上傳圖片時保留原始圖片。關閉時,瀏覽器會在上傳時生成適用於網路傳送的版本。" fromDrive: "從雲端空間" -fromUrl: "從URL" +fromUrl: "從 URL" uploadFromUrl: "從網址上傳" -uploadFromUrlDescription: "您要上傳的文件的URL" +uploadFromUrlDescription: "您要上傳的檔案網址" uploadFromUrlRequested: "已請求上傳" uploadFromUrlMayTakeTime: "還需要一些時間才能完成上傳。" explore: "探索" messageRead: "已讀" noMoreHistory: "沒有更多歷史紀錄" startMessaging: "開始聊天" -nUsersRead: "{n}人已讀" +nUsersRead: "{n} 人已讀" agreeTo: "我同意{0}" agree: "同意" agreeBelow: "同意以下內容" @@ -284,7 +286,7 @@ activity: "動態" images: "圖片" image: "圖片" birthday: "生日" -yearsOld: "{age}歲" +yearsOld: "{age} 歲" registeredDate: "註冊日期" location: "位置" theme: "外觀主題" @@ -292,8 +294,8 @@ themeForLightMode: "在淺色模式下使用的主題" themeForDarkMode: "在深色模式下使用的主題" light: "淺色" dark: "深色" -lightThemes: "明亮主題" -darkThemes: "黑暗主題" +lightThemes: "淺色主題" +darkThemes: "深色主題" syncDeviceDarkMode: "同步至此裝置的深色模式設定" drive: "雲端硬碟" fileName: "檔案名稱" @@ -319,7 +321,7 @@ copyUrl: "複製URL" rename: "重新命名" avatar: "大頭貼" banner: "橫幅" -displayOfSensitiveMedia: "顯示敏感媒體" +displayOfSensitiveMedia: "敏感檔案的顯示" whenServerDisconnected: "與伺服器的連接中斷時" disconnectedFromServer: "與伺服器中斷連線" reload: "重新整理" @@ -334,31 +336,30 @@ instanceName: "伺服器名稱" instanceDescription: "伺服器介紹" maintainerName: "管理員名稱" maintainerEmail: "管理員郵箱" -tosUrl: "服務條款URL" +tosUrl: "服務條款 URL" thisYear: "本年" thisMonth: "本月" today: "本日" -dayX: "{day}日" -monthX: "{month}月" -yearX: "{year}年" +dayX: "{day} 日" +monthX: "{month} 月" +yearX: "{year} 年" pages: "頁面" integration: "整合" connectService: "已連結" disconnectService: "已斷開 " enableLocalTimeline: "啟用本地時間軸" enableGlobalTimeline: "啟用全域時間軸" -disablingTimelinesInfo: "為了方便,即使您關閉了時間線功能,管理員和審查員仍可以繼續使用。" +disablingTimelinesInfo: "為了方便,即使您關閉了時間軸功能,管理員和審查員仍可以繼續使用。" registration: "註冊" enableRegistration: "開放新使用者註冊" invite: "邀請" -driveCapacityPerLocalAccount: "每個本地用戶的雲端空間大小" +driveCapacityPerLocalAccount: "每個本地使用者的雲端硬碟容量" driveCapacityPerRemoteAccount: "每個非本地用戶的雲端空間大小" inMb: "以Mbps為單位" -iconUrl: "圖標 URL(例如 favicon)" bannerUrl: "橫幅圖片URL" backgroundImageUrl: "背景圖片的來源網址 " basicInfo: "基本資訊" -pinnedUsers: "置頂用戶" +pinnedUsers: "置頂使用者" pinnedUsersDescription: "在「探索」頁面中使用換行標記想要置頂的使用者。" pinnedPages: "釘選頁面" pinnedPagesDescription: "輸入要固定至實例首頁的頁面路徑,以換行符分隔。" @@ -386,7 +387,7 @@ antennaExcludeKeywords: "排除關鍵字" antennaKeywordsDescription: "空格代表「以及」(AND),換行代表「或者」(OR)" notifyAntenna: "通知有新貼文" withFileAntenna: "僅帶有附件的貼文" -enableServiceworker: "啟用 ServiceWorker" +enableServiceworker: "啟用瀏覽器的推播通知" antennaUsersDescription: "填寫使用者名稱,以換行分隔" caseSensitive: "區分大小寫" withReplies: "包含回覆" @@ -394,7 +395,7 @@ connectedTo: "您的帳戶已連接到以下社交帳戶" notesAndReplies: "貼文與回覆" withFiles: "附件" silence: "禁言" -silenceConfirm: "確定要禁言此帳戶嗎?" +silenceConfirm: "確定要禁言此使用者嗎?" unsilence: "解除禁言" unsilenceConfirm: "確定要解除禁言嗎?" popularUsers: "熱門使用者" @@ -410,11 +411,15 @@ aboutMisskey: "關於 Misskey" administrator: "管理員" token: "權杖" 2fa: "雙重驗證" +setupOf2fa: "設定雙重驗證" totp: "驗證應用程式" totpDescription: "以驗證應用程式輸入一次性密碼" moderator: "審查員" moderation: "審查" -nUsersMentioned: "被提及到 {n} 次" +moderationNote: "管理筆記" +addModerationNote: "新增管理筆記" +moderationLogs: "管理日誌" +nUsersMentioned: "被 {n} 個人提及" securityKeyAndPasskey: "安全金鑰、Passkey" securityKey: "安全金鑰" lastUsed: "上次使用" @@ -426,8 +431,8 @@ resetPassword: "重設密碼" newPasswordIs: "新密碼為「{password}」" reduceUiAnimation: "減少介面的動態視覺" share: "分享" -notFound: "找不到" -notFoundDescription: "找不到該 URL 的頁面" +notFound: "查無項目" +notFoundDescription: "查無此頁" uploadFolder: "預設上傳資料夾" cacheClear: "清除快取" markAsReadAllNotifications: "標記所有通知為已讀" @@ -476,7 +481,7 @@ disableDrawer: "不顯示下拉式選單" showNoteActionsOnlyHover: "僅在游標停留時顯示貼文的操作選項" noHistory: "沒有歷史紀錄" signinHistory: "登入歷史" -enableAdvancedMfm: "啟用高級 MFM" +enableAdvancedMfm: "啟用進階 MFM" enableAnimatedMfm: "啟用 MFM 動畫" doing: "正在進行" category: "類別" @@ -486,8 +491,8 @@ createAccount: "建立帳戶" existingAccount: "現有帳戶" regenerate: "再次生成" fontSize: "字體大小" -mediaListWithOneImageAppearance: "只有一張圖片時的媒體列表高度" -limitTo: "上限為{x}" +mediaListWithOneImageAppearance: "只有一張圖片時的檔案列表高度" +limitTo: "上限為 {x}" noFollowRequests: "沒有追隨您的請求" openImageInNewTab: "於新分頁中開啟圖片" dashboard: "儀表板" @@ -504,10 +509,10 @@ promote: "推廣" numberOfDays: "有效天數" hideThisNote: "隱藏此貼文" showFeaturedNotesInTimeline: "在時間軸上顯示熱門推薦" -objectStorage: "Object Storage (物件儲存)" -useObjectStorage: "使用Object Storage" +objectStorage: "對象存儲" +useObjectStorage: "使用對象存儲" objectStorageBaseUrl: "Base URL" -objectStorageBaseUrlDesc: "引用時的 URL。如果您使用的是 CDN 或反向代理,請指定其 URL,例如 S3(https://.s3.amazonaws.com)、GCS(https://storage.googleapis.com/)。" +objectStorageBaseUrlDesc: "用於引用的 URL。如果您使用的是 CDN 或反向代理,請指定其 URL,例如 S3(https://.s3.amazonaws.com)、GCS(https://storage.googleapis.com/)。" objectStorageBucket: "儲存空間(Bucket)" objectStorageBucketDesc: "請填寫所用服務的儲存空間(Bucket)名稱。 " objectStoragePrefix: "前綴" @@ -532,7 +537,7 @@ sound: "音效" listen: "聆聽" none: "無" showInPage: "在頁面中顯示" -popout: "彈出型窗口" +popout: "彈出式視窗" volume: "音量" masterVolume: "主音量" details: "詳細資訊" @@ -542,7 +547,7 @@ recentUsed: "最近使用" install: "安裝" uninstall: "解除安裝" installedApps: "已授權的應用程式" -nothing: "未發現" +nothing: "查無項目" installedDate: "安裝時間" lastUsedDate: "最後上線日期" state: "狀態" @@ -550,7 +555,7 @@ sort: "排序" ascendingOrder: "昇冪" descendingOrder: "降冪" scratchpad: "暫存記憶體" -scratchpadDescription: "AiScript 控制台為 AiScript 的實驗環境。您可以在此編寫、執行和確認程式碼與 Misskey 互動的结果。" +scratchpadDescription: "AiScript 控制臺為 AiScript 的實驗環境。您可以在此編寫、執行和確認程式碼與 Misskey 互動的結果。" output: "輸出" script: "腳本" disablePagesScript: "停用頁面的 AiScript 腳本" @@ -559,8 +564,8 @@ deleteAllFiles: "刪除所有檔案" deleteAllFilesConfirm: "要刪除所有檔案嗎?" removeAllFollowing: "解除所有追隨" removeAllFollowingDescription: "解除{host}所有的追隨。在伺服器不再存在時執行。" -userSuspended: "該使用者已被停用" -userSilenced: "該用戶已被禁言。" +userSuspended: "該使用者已被停用。" +userSilenced: "該使用者已被禁言。" yourAccountSuspendedTitle: "帳戶已被凍結" yourAccountSuspendedDescription: "該帳戶已因違反伺服器服務條款或其他原因而被凍結。您可以向管理員查詢更多資訊。請不要建立新帳戶。" tokenRevoked: "權杖無效" @@ -653,6 +658,7 @@ behavior: "行為" sample: "範例" abuseReports: "檢舉" reportAbuse: "檢舉" +reportAbuseRenote: "檢舉轉發貼文" reportAbuseOf: "檢舉{name}" fillAbuseReportDescription: "請填寫檢舉的詳細理由。如有需要,請附上相關 URL。" abuseReported: "檢舉完成。感謝您的報告。" @@ -680,7 +686,8 @@ createNewClip: "建立新摘錄" unclip: "解除摘錄" confirmToUnclipAlreadyClippedNote: "此貼文已包含在摘錄「{name}」中。 你想將貼文從這個摘錄中排除嗎?" public: "公開" -i18nInfo: "Misskey 已被志願者們翻譯成各種語言版本。您可以瀏覽{link}幫助翻譯。" +private: "私密" +i18nInfo: "Misskey 已被志願者們翻譯成各種語言版本。您可以瀏覽 {link} 幫助翻譯。" manageAccessTokens: "管理存取權杖" accountInfo: "帳戶資訊" notesCount: "貼文數量" @@ -688,7 +695,7 @@ repliesCount: "回覆數量" renotesCount: "轉發數量" repliedCount: "回覆數量" renotedCount: "轉發次數" -followingCount: "正在追隨的用戶數量" +followingCount: "正在追隨的使用者數量" followersCount: "追隨者數量" sentReactionsCount: "反應發送次數" receivedReactionsCount: "收到反應次數" @@ -701,9 +708,10 @@ driveUsage: "雲端硬碟使用量" noCrawle: "拒絕搜尋引擎索引" noCrawleDescription: "要求網路搜尋引擎不要索引你的個人資料頁、貼文及頁面等。" lockedAccountInfo: "即使你通過了追隨者請求,除非你將貼文的可見性設定為 「追隨者」,否則任何人都能看見你的貼文。" -alwaysMarkSensitive: "預設將多媒體標記為敏感內容" +alwaysMarkSensitive: "預設標記檔案為敏感內容" loadRawImages: "以原始圖檔顯示附件圖檔的縮圖" disableShowingAnimatedImages: "不播放動態圖檔" +highlightSensitiveMedia: "強調敏感標記" verificationEmailSent: "已發送驗證電子郵件。請點擊進入電子郵件中的鏈接完成驗證。" notSet: "未設定" emailVerified: "已成功驗證您的電郵" @@ -719,7 +727,7 @@ thisIsExperimentalFeature: "這是實驗性的功能。可能會有變更規格 developer: "開發者" makeExplorable: "使自己的帳戶能夠在「探索」頁面中顯示" makeExplorableDescription: "如果關閉,帳戶將不會被顯示在「探索」頁面中。" -showGapBetweenNotesInTimeline: "分開顯示時間線上的貼文。" +showGapBetweenNotesInTimeline: "分開顯示時間軸上的貼文。" duplicate: "複製" left: "左" center: "置中" @@ -729,11 +737,11 @@ reloadToApplySetting: "設定將會在頁面重新載入之後生效。要現在 needReloadToApply: "必須重新載入才會生效。" showTitlebar: "顯示標題列" clearCache: "清除快取資料" -onlineUsersCount: "{n}人正在線上" -nUsers: "{n}用戶" -nNotes: "{n}貼文" +onlineUsersCount: "{n} 人上線" +nUsers: "{n} 使用者" +nNotes: "{n} 貼文" sendErrorReports: "傳送錯誤報告" -sendErrorReportsDescription: "啟用後,問題報告將傳送至開發者以提升軟體品質。問題報告可能包括OS版本,瀏覽器類型,行為歷史記錄等。" +sendErrorReportsDescription: "傳送問題報告至開發者以提升軟體品質。問題報告可能包括作業系統版本,瀏覽器類型,行為歷史記錄等。" myTheme: "我的佈景主題" backgroundColor: "背景" accentColor: "重點色彩" @@ -765,18 +773,18 @@ inChannelSearch: "頻道内搜尋" useReactionPickerForContextMenu: "點擊右鍵開啟反應工具欄" typingUsers: "{users}輸入中" jumpToSpecifiedDate: "跳轉到特定日期" -showingPastTimeline: "顯示過往的時間線" +showingPastTimeline: "顯示過往的時間軸" clear: "清除" markAllAsRead: "全部標示為已讀" goBack: "返回" unlikeConfirm: "要取消按讚嗎?" -fullView: "全熒幕顯示" +fullView: "全螢幕顯示" quitFullView: "退出全螢幕顯示" addDescription: "新增描述" -userPagePinTip: "在貼文的選單中選擇\"置頂\",即可置頂該貼文至您的個人檔案頁面。" +userPagePinTip: "在貼文的選單中選擇「置頂」,即可置頂該貼文至您的個人檔案頁面。" notSpecifiedMentionWarning: "此貼文有未指定的提及" info: "資訊" -userInfo: "用戶資料" +userInfo: "使用者資訊" unknown: "未知" onlineStatus: "上線狀態" hideOnlineStatus: "隱藏上線狀態" @@ -835,7 +843,7 @@ accountDeletionInProgress: "正在刪除帳戶" usernameInfo: "在伺服器上您的帳戶是唯一的識別名稱。您可以使用字母 (a ~ z, A ~ Z)、數字 (0 ~ 9) 和下底線 (_)。之後帳戶名是不能更改的。" aiChanMode: "小藍模式" devMode: "開發者模式" -keepCw: "保持 CW" +keepCw: "保持隱藏內容" pubSub: "Pub/Sub 帳戶" lastCommunication: "最近的通信" resolved: "已解決" @@ -849,7 +857,7 @@ off: "關閉" emailRequiredForSignup: "註冊帳戶需要電子郵件地址" unread: "未讀" filter: "篩選" -controlPanel: "控制台" +controlPanel: "控制臺" manageAccounts: "管理帳戶" makeReactionsPublic: "將反應設為公開" makeReactionsPublicDescription: "將您做過的反應設為公開可見。" @@ -893,8 +901,8 @@ cropImageAsk: "要剪裁圖片嗎?" cropYes: "裁剪" cropNo: "使用原圖" file: "檔案" -recentNHours: "過去{n}小時" -recentNDays: "過去{n}天" +recentNHours: "過去 {n} 小時" +recentNDays: "過去 {n} 天" noEmailServerWarning: "尚未設定電子郵件伺服器。" thereIsUnresolvedAbuseReportWarning: "有尚未處理的檢舉。" recommended: "推薦" @@ -920,7 +928,7 @@ type: "類型" speed: "速度" slow: "慢" fast: "快" -sensitiveMediaDetection: "敏感性媒體的檢測" +sensitiveMediaDetection: "敏感檔案的檢測" localOnly: "僅限本地" remoteOnly: "僅限遠端" failedToUpload: "上傳失敗" @@ -929,8 +937,8 @@ cannotUploadBecauseNoFreeSpace: "由於雲端硬碟沒有可用空間,因此 cannotUploadBecauseExceedsFileSizeLimit: "由於超過了檔案大小的限制,無法上傳。" beta: "測試版" enableAutoSensitive: "自動 NSFW 判定" -enableAutoSensitiveDescription: "如果可用,它將使用機器學習技術判斷多媒體內容是否需要標記 NSFW。即使關閉此功能,也可能會依實例規則而自動啟用。" -activeEmailValidationDescription: "積極驗證帳戶的電郵地址,以判斷它是否可以通訊。關閉此選項代表只會檢查地址是否符合格式。" +enableAutoSensitiveDescription: "如果可用,它將使用機器學習技術判斷檔案是否需要標記為敏感。即使關閉此功能,也可能會依實例規則而自動啟用。" +activeEmailValidationDescription: "積極驗證使用者的電郵地址,以判斷它是否可以通訊。關閉此選項代表只會檢查地址是否符合格式。" navbar: "導覽列" shuffle: "隨機" account: "帳戶" @@ -1015,10 +1023,10 @@ drivecleaner: "雲端硬碟清掃器" retryAllQueuesNow: "立刻重試所有佇列" retryAllQueuesConfirmTitle: "要現在重試嗎?" retryAllQueuesConfirmText: "伺服器的負荷可能會暫時增加。" -enableChartsForRemoteUser: "生成遠端用戶的圖表" +enableChartsForRemoteUser: "生成遠端使用者的圖表" enableChartsForFederatedInstances: "生成遠端伺服器的圖表" showClipButtonInNoteFooter: "新增摘錄至貼文" -largeNoteReactions: "放大顯示貼文反應" +reactionsDisplaySize: "表情回應的顯示尺寸" noteIdOrUrl: "貼文ID或URL" video: "影片" videos: "影片" @@ -1094,6 +1102,33 @@ expired: "過期" doYouAgree: "你同意嗎?" beSureToReadThisAsItIsImportant: "重要,請務必閱讀。" iHaveReadXCarefullyAndAgree: "我已仔細閱讀並同意「{x}」的内容。" +dialog: "對話方塊" +icon: "圖示" +forYou: "給您" +currentAnnouncements: "最新公告" +pastAnnouncements: "歷史公告" +youHaveUnreadAnnouncements: "有未讀的公告。" +useSecurityKey: "請按照瀏覽器或設備上的說明使用安全金鑰或 Passkey。" +replies: "回覆" +renotes: "轉發" +loadReplies: "閱覽回覆" +loadConversation: "閱覽對話" +pinnedList: "已置頂的清單" +keepScreenOn: "保持設備螢幕開啟" +verifiedLink: "已驗證連結" +notifyNotes: "開啟貼文通知" +unnotifyNotes: "關閉貼文通知" +authentication: "驗證" +authenticationRequiredToContinue: "請於繼續前完成驗證" +_announcement: + forExistingUsers: "僅限既有的使用者" + forExistingUsersDescription: "啟用代表僅向現存使用者顯示;停用代表張貼後註冊的新使用者也會看到。" + needConfirmationToRead: "必須確認才能標記為已讀" + needConfirmationToReadDescription: "啟用代表此公告將顯示對話方塊以確認是否標記為已讀,同時不會受「標記所有公告為已讀」功能影響。" + end: "結束公告" + tooManyActiveAnnouncementDescription: "有過多公告可能會影響使用者體驗。請考慮歸檔已結束的公告。" + readConfirmTitle: "標記為已讀嗎?" + readConfirmText: "閱讀「{title}」的內容並標記為已讀。" _initialAccountSetting: accountCreated: "帳戶已建立完成!" letsStartAccountSetup: "來進行帳戶的初始設定吧。" @@ -1106,11 +1141,20 @@ _initialAccountSetting: pushNotificationDescription: "啟用推送通知,就可以在設備上接收{name}的通知。" initialAccountSettingCompleted: "初始設定完成了!" haveFun: "盡情享受{name}吧!" - ifYouNeedLearnMore: "關於如何使用{name}(Misskey)的詳細資訊,請見{link}。" + ifYouNeedLearnMore: "請瀏覽{link}以更瞭解{name}(Misskey)的使用方法。" skipAreYouSure: "要略過初始設定嗎?" laterAreYouSure: "稍後再重新進行初始設定嗎?" _serverRules: description: "設定在註冊頁面顯示的伺服器簡要規則。建議是服務條款的摘要。" +_serverSettings: + iconUrl: "圖示的 URL" + appIconDescription: "指定顯示 {host} 為應用程式時的圖示。" + appIconUsageExample: "例如:漸進式網路應用程式(PWA)、於手機桌面新增書籤" + appIconStyleRecommendation: "因為可能會裁剪成圓形或圓角,所以建議用單色填滿邊框及背景。" + appIconResolutionMustBe: "解析度必須為 {resolution}。" + manifestJsonOverride: "覆寫 manifest.json" + shortName: "簡稱" + shortNameDescription: "如果伺服器的正式名稱很長,可用簡稱或通稱代替。" _accountMigration: moveFrom: "從其他帳戶遷移到這個帳戶" moveFromSub: "為另一個帳戶建立別名" @@ -1119,7 +1163,7 @@ _accountMigration: moveTo: "將這個帳戶遷移至新的帳戶" moveToLabel: "要遷移到的帳戶:" moveCannotBeUndone: "一旦遷移帳戶,就無法取消。" - moveAccountDescription: "這個操作不可撤銷。首先,請確認已在要遷移到的帳戶中為這個帳戶建立了一個別名。建立別名之後,像這樣輸入你要遷移到的帳戶:@person@instance.com" + moveAccountDescription: "遷移至新帳戶。\n ・此帳戶的追隨者將自動追隨新帳戶;\n ・此帳戶的所有追隨者將被取消追隨;\n ・此帳戶不能再發文。\n\n雖然會自動遷移您追隨者,但必須手動遷移您追隨的帳戶。請在遷移前匯出此帳戶的「追隨中」名單,並在遷移後自行匯入。\n列表名單、靜音名單及封鎖名單也必須如此處理。\n\n(此說明適用於本伺服器,以及運行 Misskey v13.12.0 或更新版本的其他伺服器;如 Mastodon 等使用 ActivityPub 協定的其他軟體或有不同的處理方式。)" moveAccountHowTo: "要遷移帳戶,首先要在目標帳戶中為此帳戶建立一個別名。\n 建立別名後,像這樣輸入目標帳戶:@username@server.example.com" startMigration: "遷移" migrationConfirm: "確定要將這個帳戶遷移至 {account} 嗎?一旦遷移就無法撤銷,也就無法以原來的狀態使用這個帳戶。\n另外,請確認在要遷移到的帳戶已經建立了一個別名。" @@ -1242,7 +1286,7 @@ _achievements: title: "有備而來" description: "設定了個人檔案" _markedAsCat: - title: "吾輩乃貓是也" + title: "我是貓" description: "已將帳戶設定為貓" flavor: "還沒有名字。" _following1: @@ -1264,7 +1308,7 @@ _achievements: title: "第一個追隨者" description: "第一次被追隨" _followers10: - title: "Follow me!" + title: "追隨我吧!" description: "追隨者超過10人了" _followers50: title: "成群結隊" @@ -1273,20 +1317,20 @@ _achievements: title: "熱門人物" description: "追隨者超過100人了" _followers300: - title: "請排成一排" + title: "請排隊" description: "追隨者超過300人了" _followers500: - title: "基地台" + title: "基地臺" description: "超過五百名追隨者了" _followers1000: - title: "影響者" + title: "星光熠熠" description: "超過一千名追隨者了" _collectAchievements30: title: "成就收藏家" description: "獲得三十個以上的成就" _viewAchievements3min: - title: "喜愛成就" - description: "看成就列表要花三分鐘以上" + title: "成就發燒友" + description: "看著成就列表超過三分鐘" _iLoveMisskey: title: "I Love Misskey" description: "發佈「I ❤ #Misskey」" @@ -1298,34 +1342,34 @@ _achievements: title: "休息一下" description: "客戶端啟動已超過30分鐘" _client60min: - title: "Misskey看太多" + title: "Misskey 看太多" description: "客戶端啟動已超過60分鐘" _noteDeletedWithin1min: - title: "現在沒有了" - description: "發文後1分鐘內刪文" + title: "欲言又止" + description: "發文後一分鐘內刪文" _postedAtLateNight: - title: "夜行性" + title: "夜貓子" description: "在深夜發佈貼文" flavor: "該去睡覺了。" _postedAt0min0sec: title: "報時" - description: "在0分0秒發佈貼文" - flavor: "啵.啵.啵.嗶ー" + description: "在零分零秒發佈貼文" + flavor: "啵、啵、啵、嗶ーー" _selfQuote: title: "自我引用" description: "引用了自己的貼文" _htl20npm: - title: "流動的TL" - description: "在首頁時間軸的流速超過20npm" + title: "源源不絕" + description: "首頁時間軸在一分鐘內出現超過二十篇貼文" _viewInstanceChart: title: "分析師" description: "顯示了實例的圖表" _outputHelloWorldOnScratchpad: - title: "Hello world!" - description: "在暫存記憶體輸出了 hello world" + title: "Hello, world!" + description: "在 AiScript 控制臺輸出了「hello world」" _open3windows: title: "多重視窗" - description: "開啟了3個以上的視窗" + description: "開啟過三個以上的視窗" _driveFolderCircularReference: title: "循環引用" description: "試圖遞迴套入雲端硬碟資料夾" @@ -1337,34 +1381,37 @@ _achievements: description: "已點擊這裡了" _justPlainLucky: title: "只是運氣好" - description: "每10秒有0.01%的機率獲得" + description: "每十秒有二萬分之一(0.005%)的機率獲得" _setNameToSyuilo: - title: "神的情結" + title: "神與您同在" description: "將名稱設定為 syuilo" _passedSinceAccountCreated1: - title: "一周年" - description: "自建立帳戶開始過了1年" + title: "一週年" + description: "帳戶加入時間已超過一年" _passedSinceAccountCreated2: - title: "二周年" - description: "自建立帳戶開始過了2年" + title: "二週年" + description: "帳戶加入時間已超過兩年" _passedSinceAccountCreated3: - title: "三周年" - description: "自建立帳戶開始過了3年" + title: "三週年" + description: "帳戶加入時間已超過三年" _loggedInOnBirthday: title: "生日快樂" description: "在生日當天登入了" _loggedInOnNewYearsDay: title: "新年快樂" description: "在元旦當天登入了" - flavor: "今年也請對敝實例多多指教" + flavor: "今年也請您多多指教!" _cookieClicked: title: "點擊餅乾的遊戲" description: "點擊了餅乾" flavor: "是不是軟體有問題?" _brainDiver: title: "Brain Driver" - description: "發佈了Brain Driver的連結" + description: "發佈一篇含歌曲《Brain Driver》連結的貼文" flavor: "Misskey-Misskey La-Tu-Ma" + _smashTestNotificationButton: + title: "過度測試" + description: "極短時間內連續測試通知" _role: new: "建立角色" edit: "編輯角色" @@ -1387,7 +1434,7 @@ _role: chooseRoleToAssign: "選擇要指派的角色" iconUrl: "圖示的URL" asBadge: "顯示為徽章" - descriptionOfAsBadge: "開啟的話,角色圖示會顯示在用戶名旁邊。" + descriptionOfAsBadge: "開啟的話,角色圖示會顯示在使用者名稱旁邊。" isExplorable: "讓使用者更容易找到您" descriptionOfIsExplorable: "若開啟則公開角色時間軸。若角色不是公開的,則無法公開時間軸。" displayOrder: "顯示順序" @@ -1425,8 +1472,8 @@ _role: _condition: isLocal: "本地使用者" isRemote: "遠端使用者" - createdLessThan: "自建立帳戶開始~以內" - createdMoreThan: "自建立帳戶開始~經過" + createdLessThan: "帳戶加入時間不超過" + createdMoreThan: "帳戶加入時間已超過" followersLessThanOrEq: "追隨者人數在~以下" followersMoreThanOrEq: "追隨者人數在~以上" followingLessThanOrEq: "追隨人數在~以下" @@ -1437,7 +1484,7 @@ _role: or: "~或~" not: "~否" _sensitiveMediaDetection: - description: "您可以使用機器學習自動檢測敏感媒體並將其用於審查。 伺服器的負荷會稍微增加。" + description: "您可以使用機器學習自動檢測敏感檔案以便審查。這會稍微增加伺服器負荷。" sensitivity: "檢測敏感度" sensitivityDescription: "敏感度低時,誤檢測(偽陽性)會減少。敏感度高時,漏檢(偽陰性)會減少。" setSensitiveFlagAutomatically: "設定 NSFW 標籤" @@ -1452,7 +1499,7 @@ _emailUnavailable: smtp: "郵件伺服器沒有應答" _ffVisibility: public: "公開" - followers: "只有關注你的用戶能看到" + followers: "只有關注您的使用者能看到" private: "私密" _signup: almostThere: "即將完成" @@ -1488,6 +1535,7 @@ _plugin: install: "安裝外掛組件" installWarn: "請不要安裝來源不明的外掛。" manage: "管理外掛" + viewSource: "檢視原始碼" _preferencesBackups: list: "已備份的設定檔" saveNew: "另存新檔" @@ -1513,7 +1561,7 @@ _registry: domain: "域" createKey: "新增機碼" _aboutMisskey: - about: "Misskey是由syuilo自2014年起開發的開源軟體。" + about: "Misskey 是由 syuilo 自 2014 年起開發的開放原始碼軟體。" contributors: "主要貢獻者" allContributors: "全體貢獻人員" source: "原始碼" @@ -1522,9 +1570,9 @@ _aboutMisskey: morePatrons: "還有許許多多幫助我們的其他人,非常感謝你們。 🥰" patrons: "贊助者" _displayOfSensitiveMedia: - respect: "隱藏被標記為敏感的多媒體內容" - ignore: "不隱藏被標記為敏感的多媒體內容" - force: "隱藏所有多媒體內容" + respect: "隱藏敏感檔案" + ignore: "顯示敏感檔案" + force: "隱藏所有檔案" _instanceTicker: none: "隱藏" remote: "向遠端使用者顯示" @@ -1541,8 +1589,8 @@ _channel: featured: "熱門貼文" owned: "管理中" following: "追隨中" - usersCount: "有{n}人參與" - notesCount: "有{n}個貼文" + usersCount: "有 {n} 人參與" + notesCount: "有 {n} 篇貼文" nameAndDescription: "名稱與說明" nameOnly: "僅名稱" _menuDisplay: @@ -1560,7 +1608,7 @@ _wordMute: hard: "硬性靜音" mutedNotes: "已靜音的貼文" _instanceMute: - instanceMuteDescription: "包括對被靜音實例上的用戶的回覆,被設定的實例上所有貼文及轉發都會被靜音。" + instanceMuteDescription: "包括對被靜音實例上的使用者的回覆,被設定的實例上所有貼文及轉發都會被靜音。" instanceMuteDescription2: "換行以分隔" title: "將隱藏被設定的實例貼文。" heading: "將實例靜音" @@ -1622,9 +1670,9 @@ _theme: infoFg: "資訊內容" infoWarnBg: "警告背景" infoWarnFg: "警告文字" - cwBg: "CW 按鈕背景" - cwFg: "CW 按鈕文字" - cwHoverBg: "CW 按鈕背景(懸浮)" + cwBg: "隱藏內容按鈕背景" + cwFg: "隱藏內容按鈕文字" + cwHoverBg: "隱藏內容按鈕背景(懸浮)" toastBg: "通知背景" toastFg: "通知文本" buttonBg: "按鈕背景" @@ -1649,14 +1697,14 @@ _sfx: _ago: future: "未來" justNow: "剛剛" - secondsAgo: "{n}秒前" - minutesAgo: "{n}分鐘前" - hoursAgo: "{n}小時前" - daysAgo: "{n}天前" - weeksAgo: "{n}週前" - monthsAgo: "{n}個月前" - yearsAgo: "{n}年前" - invalid: "未發現" + secondsAgo: "{n} 秒前" + minutesAgo: "{n} 分鐘前 " + hoursAgo: "{n} 小時前" + daysAgo: "{n} 天前" + weeksAgo: "{n} 週前" + monthsAgo: "{n} 個月前" + yearsAgo: "{n} 年前" + invalid: "無" _time: second: "秒" minute: "分鐘" @@ -1675,13 +1723,13 @@ _timelineTutorial: _2fa: alreadyRegistered: "此裝置已被註冊過了" registerTOTP: "開始設定驗證應用程式" - passwordToTOTP: "請輸入密碼" step1: "首先,在您的裝置上安裝驗證程式,例如 {a} 或 {b}。" step2: "然後,掃描螢幕上的 QR 碼。" step2Click: "您可以點擊 QR 碼,以使用裝置上的驗證應用程式或金鑰環註冊。" - step2Url: "請在桌面版應用程式中輸入以下的 URL:" + step2Uri: "使用桌面版應用程式時,請輸入以下的 URI" step3Title: "輸入驗證碼" step3: "輸入應用程式所提供的權杖以完成設定。" + setupCompleted: "設定完成" step4: "從現在開始,任何登入操作都將要求您提供權杖。\n\nWe've generated backup codes for emergency access to your account in case your authentication app becomes unavailable.\nPlease ensure these are stored in a safe place to prevent loss.\nEach of these codes can only be used once.\nIf you exhaust all the codes, you will not be able to access your account anymore, so please reconfigure your authentication app as soon as possible.\n\nBackup Codes:\n\n{codes}" securityKeyNotSupported: "您的瀏覽器不支援安全金鑰。" registerTOTPBeforeKey: "如要註冊安全金鑰或 Passkey,請先設定驗證應用程式。" @@ -1696,16 +1744,21 @@ _2fa: renewTOTPConfirm: "目前驗證應用程式的驗證碼將無法使用。" renewTOTPOk: "重設" renewTOTPCancel: "現在不要" + checkBackupCodesBeforeCloseThisWizard: "請先確認下列備用驗證碼,再關閉此精靈視窗。" + backupCodes: "備用驗證碼" + backupCodesDescription: "如果驗證應用程式不能用了,可以使用以下的備用驗證碼存取您的帳戶。請務必妥善保管這個驗證碼。每個驗證碼只能使用一次。" + backupCodeUsedWarning: "已使用備用驗證碼。如果無法使用驗證應用程式,請盡快重新設定。" + backupCodesExhaustedWarning: "已使用所有備用驗證碼。如果無法使用驗證應用程式,則將無法再存取您的帳戶。請重新設定您的驗證應用程式。" _permissions: "read:account": "查看我的帳戶資訊" "write:account": "更改我的帳戶資訊" - "read:blocks": "已封鎖用戶名單" - "write:blocks": "編輯已封鎖用戶名單" + "read:blocks": "查看封鎖名單" + "write:blocks": "編輯封鎖名單" "read:drive": "存取雲端硬碟" "write:drive": "編輯雲端硬碟的檔案" "read:favorites": "瀏覽我的最愛" "write:favorites": "編輯我的最愛列表" - "read:following": "查看追隨中的用戶資訊" + "read:following": "查看追隨中的使用者資訊" "write:following": "追隨/解除追隨" "read:messaging": "顯示訊息" "write:messaging": "撰寫或刪除訊息" @@ -1729,10 +1782,14 @@ _permissions: "write:gallery": "操作圖庫" "read:gallery-likes": "讀取喜歡的圖片" "write:gallery-likes": "操作喜歡的圖片" + "read:flash": "檢視 Play" + "write:flash": "編輯 Play" + "read:flash-likes": "檢視 Play 的讚" + "write:flash-likes": "編輯 Play 的讚" _auth: shareAccessTitle: "應用程式的存取權限" shareAccess: "要授權「“{name}”」存取您的帳戶嗎?" - shareAccessAsk: "您確定要授權這個應用程式使用您的帳戶嗎?" + shareAccessAsk: "您確定要授權這個應用程式存取您的帳戶嗎?" permission: "{name}要求以下的權限" permissionAsk: "此應用程式需要以下權限" pleaseGoBack: "請返回至應用程式" @@ -1744,6 +1801,7 @@ _antennaSources: homeTimeline: "來自已追隨使用者的貼文" users: "來自特定使用者的貼文" userList: "來自特定清單中的貼文" + userBlacklist: "除指定使用者外的所有貼文" _weekday: sunday: "週日" monday: "週一" @@ -1759,7 +1817,7 @@ _widgets: notifications: "通知" timeline: "時間軸" calendar: "行事曆" - trends: "發燒貼文" + trends: "熱門貼文" clock: "時鐘" rss: "RSS 閱讀器" rssTicker: "RSS 跑馬燈" @@ -1767,15 +1825,15 @@ _widgets: photos: "照片" digitalClock: "電子時鐘" unixClock: "UNIX 時間" - federation: "站台聯邦" + federation: "聯邦宇宙" instanceCloud: "實例雲" - postForm: "發佈窗口" + postForm: "發文視窗" slideshow: "幻燈片" button: "按鈕" - onlineUsers: "線上的用戶" + onlineUsers: "上線使用者" jobQueue: "佇列" serverMetric: "伺服器指標 " - aiscript: "AiScript 控制台" + aiscript: "AiScript 控制臺" aiscriptApp: "AiScript App" aichan: "小藍" userList: "使用者列表" @@ -1788,8 +1846,8 @@ _cw: chars: "{count} 個字元" files: "{count} 個檔案" _poll: - noOnlyOneChoice: "至少需要兩個選項。" - choiceN: "選擇 {n}" + noOnlyOneChoice: "需要至少兩個選項。" + choiceN: "選項 {n}" noMore: "沒辦法再添加選項了" canMultipleVote: "可以多次投票" expiration: "期限" @@ -1811,7 +1869,7 @@ _poll: remainingSeconds: "{s} 秒後截止" _visibility: public: "公開" - publicDescription: "發佈給所有帳戶" + publicDescription: "發佈給所有使用者" home: "首頁" homeDescription: "僅發布至首頁的時間軸" followers: "追隨者" @@ -1836,13 +1894,14 @@ _profile: username: "使用者名稱" description: "關於我" youCanIncludeHashtags: "你也可以在「關於我」中加上 #tag" - metadata: "進階資訊" - metadataEdit: "編輯進階資訊" + metadata: "附加資訊" + metadataEdit: "編輯附加資訊" metadataDescription: "可以在個人資料中以表格形式顯示其他資訊。" metadataLabel: "標籤" metadataContent: "内容" changeAvatar: "更換大頭貼" changeBanner: "變更橫幅圖像" + verifiedLinkDescription: "如果輸入包含您個人資料的網站 URL,欄位旁邊將出現驗證圖示。" _exportOrImport: allNotes: "所有貼文" favoritedNotes: "「我的最愛」貼文" @@ -1850,10 +1909,10 @@ _exportOrImport: muteList: "靜音" blockingList: "封鎖" userLists: "清單" - excludeMutingUsers: "排除被靜音的用戶" + excludeMutingUsers: "排除被靜音的使用者" excludeInactiveUsers: "排除不活躍帳戶" _charts: - federation: "站台聯邦" + federation: "聯邦宇宙" apRequest: "請求" usersIncDec: "使用者增減" usersTotal: "使用者合共" @@ -1894,7 +1953,7 @@ _play: viewSource: "檢視原始碼" my: "自己的 Play" liked: "按讚的 Play" - featured: "人氣" + featured: "熱門" title: "標題" script: "腳本" summary: "描述" @@ -1916,7 +1975,7 @@ _pages: unlike: "收回讚好" my: "我的頁面" liked: "已讚好的頁面" - featured: "人氣" + featured: "熱門" inspector: "面板檢查" contents: "內容" content: "頁面方塊" @@ -1961,11 +2020,17 @@ _notification: youReceivedFollowRequest: "您有新的追隨請求" yourFollowRequestAccepted: "您的追隨請求已通過" pollEnded: "問卷調查已產生結果" + newNote: "新的貼文" unreadAntennaNote: "天線 {name}" emptyPushNotificationMessage: "推送通知已更新" achievementEarned: "獲得成就" + testNotification: "通知測試" + checkNotificationBehavior: "確認通知的顯示行為" + sendTestNotification: "發送測試通知" + notificationWillBeDisplayedLikeThis: "通知會以這樣的方式顯示" _types: all: "全部 " + note: "使用者的最新貼文" follow: "追隨中" mention: "提及" reply: "回覆" @@ -1998,7 +2063,9 @@ _deck: introduction: "組合多個欄位,製作屬於自己的介面吧!" introduction2: "您可以隨時按畫面右方的「+」新增欄位。" widgetsIntroduction: "請從欄位選單中選擇「編輯小工具」新增小工具。" - useSimpleUiForNonRootPages: "用簡易 UI 顯示非根頁面" + useSimpleUiForNonRootPages: "用簡易介面顯示非根頁面" + usedAsMinWidthWhenFlexible: "如果啟用「自動調整寬度」,此為最小寬度" + flexible: "自動調整寬度" _columns: main: "主列" widgets: "小工具" @@ -2033,3 +2100,25 @@ _webhookSettings: renote: "當被轉發時" reaction: "當獲得反應時" mention: "當被提到時" +_moderationLogTypes: + assignRole: "指派角色" + unassignRole: "撤銷角色" + updateRole: "更新角色設定" + suspend: "凍結" + unsuspend: "解除凍結" + addCustomEmoji: "新增自訂表情符號" + updateCustomEmoji: "更新自訂表情符號" + deleteCustomEmoji: "刪除自訂表情符號" + updateServerSettings: "更新伺服器設定" + updateUserNote: "更新管理筆記" + deleteDriveFile: "刪除檔案" + deleteNote: "刪除貼文" + createGlobalAnnouncement: "建立全網通知" + createUserAnnouncement: "建立使用者通知" + updateGlobalAnnouncement: "更新全部的公告" + updateUserAnnouncement: "更新使用者的公告" + deleteGlobalAnnouncement: "刪除全部的公告" + deleteUserAnnouncement: "刪除使用者的公告" + resetPassword: "重設密碼" + suspendRemoteInstance: "封鎖遠端伺服器" + unsuspendRemoteInstance: "解除封鎖遠端伺服器" diff --git a/package.json b/package.json index 3d1de709ed..80d044a605 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "misskey", - "version": "13.14.2-io.7", + "version": "2023.9.0-io", "codename": "nasubi", "repository": { "type": "git", "url": "https://github.com/misskey-dev/misskey.git" }, - "packageManager": "pnpm@8.6.10", + "packageManager": "pnpm@8.7.6", "workspaces": [ "packages/frontend", "packages/backend", @@ -15,17 +15,17 @@ "private": true, "scripts": { "build-pre": "node ./scripts/build-pre.js", - "build": "pnpm build-pre && pnpm -r build && pnpm gulp", + "build-assets": "node ./scripts/build-assets.mjs", + "build": "pnpm build-pre && pnpm -r build && pnpm build-assets", "build-storybook": "pnpm --filter frontend build-storybook", - "start": "pnpm check:connect && cd packages/backend && node ./built/boot/index.js", - "start:docker": "pnpm check:connect && cd packages/backend && exec node ./built/boot/index.js", - "start:test": "cd packages/backend && cross-env NODE_ENV=test node ./built/boot/index.js", + "start": "pnpm check:connect && cd packages/backend && node ./built/boot/entry.js", + "start:docker": "pnpm check:connect && cd packages/backend && exec node ./built/boot/entry.js", + "start:test": "cd packages/backend && cross-env NODE_ENV=test node ./built/boot/entry.js", "init": "pnpm migrate", "migrate": "cd packages/backend && pnpm migrate", "check:connect": "cd packages/backend && pnpm check:connect", "migrateandstart": "pnpm migrate && pnpm start", "migrateandstart:docker": "pnpm migrate && exec pnpm start:docker", - "gulp": "pnpm exec gulp build", "watch": "pnpm dev", "dev": "node ./scripts/dev.mjs", "lint": "pnpm -r lint", @@ -36,7 +36,6 @@ "jest-and-coverage": "cd packages/backend && pnpm jest-and-coverage", "test": "pnpm -r test", "test-and-coverage": "pnpm -r test-and-coverage", - "format": "pnpm exec gulp format", "clean": "node ./scripts/clean.js", "clean-all": "node ./scripts/clean-all.js", "cleanall": "pnpm clean-all" @@ -46,24 +45,20 @@ "lodash": "4.17.21" }, "dependencies": { - "execa": "7.1.1", - "gulp": "4.0.2", - "gulp-cssnano": "2.1.3", - "gulp-rename": "2.0.0", - "gulp-replace": "1.1.4", - "gulp-terser": "2.1.0", + "execa": "8.0.1", + "cssnano": "6.0.1", "js-yaml": "4.1.0", - "typescript": "5.1.6" + "postcss": "8.4.30", + "terser": "5.20.0", + "typescript": "5.2.2" }, "devDependencies": { - "@types/gulp": "4.0.10", - "@types/gulp-rename": "2.0.1", - "@typescript-eslint/eslint-plugin": "5.61.0", - "@typescript-eslint/parser": "5.61.0", + "@typescript-eslint/eslint-plugin": "6.7.2", + "@typescript-eslint/parser": "6.7.2", "cross-env": "7.0.3", - "cypress": "12.17.1", - "eslint": "8.45.0", - "start-server-and-test": "2.0.0" + "cypress": "13.2.0", + "eslint": "8.50.0", + "start-server-and-test": "2.0.1" }, "optionalDependencies": { "@tensorflow/tfjs-core": "4.4.0" diff --git a/packages/backend/.swcrc b/packages/backend/.swcrc index 0504a2d389..d9f047b6ac 100644 --- a/packages/backend/.swcrc +++ b/packages/backend/.swcrc @@ -11,7 +11,7 @@ "decoratorMetadata": true }, "experimental": { - "keepImportAssertions": true + "keepImportAttributes": true }, "baseUrl": "src", "paths": { diff --git a/packages/backend/migration/1665091090561-add-renote-muting.js b/packages/backend/migration/1665091090561-add-renote-muting.js index 575a63703c..a22d7037f3 100644 --- a/packages/backend/migration/1665091090561-add-renote-muting.js +++ b/packages/backend/migration/1665091090561-add-renote-muting.js @@ -16,5 +16,9 @@ export class addRenoteMuting1665091090561 { } async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_renote_muting_muterId"`); + await queryRunner.query(`DROP INDEX "IDX_renote_muting_muteeId"`); + await queryRunner.query(`DROP INDEX "IDX_renote_muting_createdAt"`); + await queryRunner.query(`DROP TABLE "renote_muting"`); } } diff --git a/packages/backend/migration/1689325027964-UserBlacklistAnntena.js b/packages/backend/migration/1689325027964-UserBlacklistAnntena.js new file mode 100644 index 0000000000..ce246b20f8 --- /dev/null +++ b/packages/backend/migration/1689325027964-UserBlacklistAnntena.js @@ -0,0 +1,10 @@ +export class UserBlacklistAnntena1689325027964 { + name = 'UserBlacklistAnntena1689325027964' + + async up(queryRunner) { + await queryRunner.query(`ALTER TYPE "antenna_src_enum" ADD VALUE 'users_blacklist' AFTER 'list'`); + } + + async down(queryRunner) { + } +} diff --git a/packages/backend/migration/1690417561185-fix-renote-muting.js b/packages/backend/migration/1690417561185-fix-renote-muting.js new file mode 100644 index 0000000000..14150b0362 --- /dev/null +++ b/packages/backend/migration/1690417561185-fix-renote-muting.js @@ -0,0 +1,12 @@ +export class FixRenoteMuting1690417561185 { + name = 'FixRenoteMuting1690417561185' + + async up(queryRunner) { + await queryRunner.query(`DELETE FROM "renote_muting" WHERE "muteeId" NOT IN (SELECT "id" FROM "user")`); + await queryRunner.query(`DELETE FROM "renote_muting" WHERE "muterId" NOT IN (SELECT "id" FROM "user")`); + } + + async down(queryRunner) { + + } +} diff --git a/packages/backend/migration/1690417561186-ChangeCacheRemoteFilesDefault.js b/packages/backend/migration/1690417561186-ChangeCacheRemoteFilesDefault.js new file mode 100644 index 0000000000..7eda5debe5 --- /dev/null +++ b/packages/backend/migration/1690417561186-ChangeCacheRemoteFilesDefault.js @@ -0,0 +1,11 @@ +export class ChangeCacheRemoteFilesDefault1690417561186 { + name = 'ChangeCacheRemoteFilesDefault1690417561186' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "cacheRemoteFiles" SET DEFAULT false`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "cacheRemoteFiles" SET DEFAULT true`); + } +} diff --git a/packages/backend/migration/1690417561187-Fix.js b/packages/backend/migration/1690417561187-Fix.js new file mode 100644 index 0000000000..e780e66d7b --- /dev/null +++ b/packages/backend/migration/1690417561187-Fix.js @@ -0,0 +1,81 @@ +export class Fix1690417561187 { + name = 'Fix1690417561187' + + async up(queryRunner) { + await queryRunner.query(`DROP INDEX "public"."IDX_2cd3b2a6b4cf0b910b260afe08"`); + await queryRunner.query(`DROP INDEX "public"."IDX_renote_muting_createdAt"`); + await queryRunner.query(`DROP INDEX "public"."IDX_renote_muting_muteeId"`); + await queryRunner.query(`DROP INDEX "public"."IDX_renote_muting_muterId"`); + await queryRunner.query(`COMMENT ON COLUMN "user"."isRoot" IS 'Whether the User is the root.'`); + await queryRunner.query(`COMMENT ON COLUMN "ad"."startsAt" IS 'The expired date of the Ad.'`); + await queryRunner.query(`ALTER TABLE "antenna" ALTER COLUMN "lastUsedAt" DROP DEFAULT`); + await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "mascotImageUrl" DROP DEFAULT`); + await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "preservedUsernames" SET DEFAULT '{ "admin", "administrator", "root", "system", "maintainer", "host", "mod", "moderator", "owner", "superuser", "staff", "auth", "i", "me", "everyone", "all", "mention", "mentions", "example", "user", "users", "account", "accounts", "official", "help", "helps", "support", "supports", "info", "information", "informations", "announce", "announces", "announcement", "announcements", "notice", "notification", "notifications", "dev", "developer", "developers", "tech", "misskey" }'`); + await queryRunner.query(`COMMENT ON COLUMN "renote_muting"."createdAt" IS 'The created date of the Muting.'`); + await queryRunner.query(`COMMENT ON COLUMN "renote_muting"."muteeId" IS 'The mutee user ID.'`); + await queryRunner.query(`COMMENT ON COLUMN "renote_muting"."muterId" IS 'The muter user ID.'`); + await queryRunner.query(`ALTER TABLE "poll" DROP CONSTRAINT "FK_da851e06d0dfe2ef397d8b1bf1b"`); + await queryRunner.query(`ALTER TABLE "poll" DROP CONSTRAINT "UQ_da851e06d0dfe2ef397d8b1bf1b"`); + await queryRunner.query(`ALTER TABLE "promo_note" DROP CONSTRAINT "FK_e263909ca4fe5d57f8d4230dd5c"`); + await queryRunner.query(`ALTER TABLE "promo_note" DROP CONSTRAINT "UQ_e263909ca4fe5d57f8d4230dd5c"`); + await queryRunner.query(`ALTER TABLE "user_keypair" DROP CONSTRAINT "FK_f4853eb41ab722fe05f81cedeb6"`); + await queryRunner.query(`ALTER TABLE "user_keypair" DROP CONSTRAINT "UQ_f4853eb41ab722fe05f81cedeb6"`); + await queryRunner.query(`ALTER TABLE "user_profile" DROP CONSTRAINT "FK_51cb79b5555effaf7d69ba1cff9"`); + await queryRunner.query(`ALTER TABLE "user_profile" DROP CONSTRAINT "UQ_51cb79b5555effaf7d69ba1cff9"`); + await queryRunner.query(`ALTER TABLE "user_publickey" DROP CONSTRAINT "FK_10c146e4b39b443ede016f6736d"`); + await queryRunner.query(`ALTER TABLE "user_publickey" DROP CONSTRAINT "UQ_10c146e4b39b443ede016f6736d"`); + await queryRunner.query(`CREATE INDEX "IDX_3fcc2c589eaefc205e0714b99c" ON "ad" ("startsAt") `); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_c71faf11f0a28a5c0bb506203c" ON "channel_favorite" ("userId", "channelId") `); + await queryRunner.query(`CREATE INDEX "IDX_f7b9d338207e40e768e4a5265a" ON "instance" ("firstRetrievedAt") `); + await queryRunner.query(`CREATE INDEX "IDX_d1259a2c2b7bb413ff449e8711" ON "renote_muting" ("createdAt") `); + await queryRunner.query(`CREATE INDEX "IDX_7eac97594bcac5ffcf2068089b" ON "renote_muting" ("muteeId") `); + await queryRunner.query(`CREATE INDEX "IDX_7aa72a5fe76019bfe8e5e0e8b7" ON "renote_muting" ("muterId") `); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0d801c609cec4e9eb4b6b4490c" ON "renote_muting" ("muterId", "muteeId") `); + await queryRunner.query(`ALTER TABLE "renote_muting" ADD CONSTRAINT "FK_7eac97594bcac5ffcf2068089b6" FOREIGN KEY ("muteeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "renote_muting" ADD CONSTRAINT "FK_7aa72a5fe76019bfe8e5e0e8b7d" FOREIGN KEY ("muterId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "poll" ADD CONSTRAINT "FK_da851e06d0dfe2ef397d8b1bf1b" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "promo_note" ADD CONSTRAINT "FK_e263909ca4fe5d57f8d4230dd5c" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "user_keypair" ADD CONSTRAINT "FK_f4853eb41ab722fe05f81cedeb6" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "user_profile" ADD CONSTRAINT "FK_51cb79b5555effaf7d69ba1cff9" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "user_publickey" ADD CONSTRAINT "FK_10c146e4b39b443ede016f6736d" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_publickey" DROP CONSTRAINT "FK_10c146e4b39b443ede016f6736d"`); + await queryRunner.query(`ALTER TABLE "user_profile" DROP CONSTRAINT "FK_51cb79b5555effaf7d69ba1cff9"`); + await queryRunner.query(`ALTER TABLE "user_keypair" DROP CONSTRAINT "FK_f4853eb41ab722fe05f81cedeb6"`); + await queryRunner.query(`ALTER TABLE "promo_note" DROP CONSTRAINT "FK_e263909ca4fe5d57f8d4230dd5c"`); + await queryRunner.query(`ALTER TABLE "poll" DROP CONSTRAINT "FK_da851e06d0dfe2ef397d8b1bf1b"`); + await queryRunner.query(`ALTER TABLE "renote_muting" DROP CONSTRAINT "FK_7aa72a5fe76019bfe8e5e0e8b7d"`); + await queryRunner.query(`ALTER TABLE "renote_muting" DROP CONSTRAINT "FK_7eac97594bcac5ffcf2068089b6"`); + await queryRunner.query(`DROP INDEX "public"."IDX_0d801c609cec4e9eb4b6b4490c"`); + await queryRunner.query(`DROP INDEX "public"."IDX_7aa72a5fe76019bfe8e5e0e8b7"`); + await queryRunner.query(`DROP INDEX "public"."IDX_7eac97594bcac5ffcf2068089b"`); + await queryRunner.query(`DROP INDEX "public"."IDX_d1259a2c2b7bb413ff449e8711"`); + await queryRunner.query(`DROP INDEX "public"."IDX_f7b9d338207e40e768e4a5265a"`); + await queryRunner.query(`DROP INDEX "public"."IDX_c71faf11f0a28a5c0bb506203c"`); + await queryRunner.query(`DROP INDEX "public"."IDX_3fcc2c589eaefc205e0714b99c"`); + await queryRunner.query(`ALTER TABLE "user_publickey" ADD CONSTRAINT "UQ_10c146e4b39b443ede016f6736d" UNIQUE ("userId")`); + await queryRunner.query(`ALTER TABLE "user_publickey" ADD CONSTRAINT "FK_10c146e4b39b443ede016f6736d" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "user_profile" ADD CONSTRAINT "UQ_51cb79b5555effaf7d69ba1cff9" UNIQUE ("userId")`); + await queryRunner.query(`ALTER TABLE "user_profile" ADD CONSTRAINT "FK_51cb79b5555effaf7d69ba1cff9" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "user_keypair" ADD CONSTRAINT "UQ_f4853eb41ab722fe05f81cedeb6" UNIQUE ("userId")`); + await queryRunner.query(`ALTER TABLE "user_keypair" ADD CONSTRAINT "FK_f4853eb41ab722fe05f81cedeb6" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "promo_note" ADD CONSTRAINT "UQ_e263909ca4fe5d57f8d4230dd5c" UNIQUE ("noteId")`); + await queryRunner.query(`ALTER TABLE "promo_note" ADD CONSTRAINT "FK_e263909ca4fe5d57f8d4230dd5c" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "poll" ADD CONSTRAINT "UQ_da851e06d0dfe2ef397d8b1bf1b" UNIQUE ("noteId")`); + await queryRunner.query(`ALTER TABLE "poll" ADD CONSTRAINT "FK_da851e06d0dfe2ef397d8b1bf1b" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`COMMENT ON COLUMN "renote_muting"."muterId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "renote_muting"."muteeId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "renote_muting"."createdAt" IS NULL`); + await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "preservedUsernames" SET DEFAULT '{admin,administrator,root,system,maintainer,host,mod,moderator,owner,superuser,staff,auth,i,me,everyone,all,mention,mentions,example,user,users,account,accounts,official,help,helps,support,supports,info,information,informations,announce,announces,announcement,announcements,notice,notification,notifications,dev,developer,developers,tech,misskey}'`); + await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "mascotImageUrl" SET DEFAULT '/assets/ai.png'`); + await queryRunner.query(`ALTER TABLE "antenna" ALTER COLUMN "lastUsedAt" SET DEFAULT '2023-04-25 06:51:20.985478+00'`); + await queryRunner.query(`COMMENT ON COLUMN "ad"."startsAt" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."isRoot" IS 'Whether the User is the admin.'`); + await queryRunner.query(`CREATE INDEX "IDX_renote_muting_muterId" ON "muting" ("muterId") `); + await queryRunner.query(`CREATE INDEX "IDX_renote_muting_muteeId" ON "muting" ("muteeId") `); + await queryRunner.query(`CREATE INDEX "IDX_renote_muting_createdAt" ON "muting" ("createdAt") `); + await queryRunner.query(`CREATE INDEX "IDX_2cd3b2a6b4cf0b910b260afe08" ON "instance" ("firstRetrievedAt") `); + } +} diff --git a/packages/backend/migration/1690782653311-SensitiveChannel.js b/packages/backend/migration/1690782653311-SensitiveChannel.js new file mode 100644 index 0000000000..e76dda5180 --- /dev/null +++ b/packages/backend/migration/1690782653311-SensitiveChannel.js @@ -0,0 +1,17 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +export class SensitiveChannel1690782653311 { + name = 'SensitiveChannel1690782653311' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "channel" + ADD "isSensitive" boolean NOT NULL DEFAULT false`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "channel" DROP COLUMN "isSensitive"`); + } +} diff --git a/packages/backend/migration/1690796169261-play-visibility.js b/packages/backend/migration/1690796169261-play-visibility.js new file mode 100644 index 0000000000..c57fa7a109 --- /dev/null +++ b/packages/backend/migration/1690796169261-play-visibility.js @@ -0,0 +1,15 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +export class PlayVisibility1689102832143 { + name = 'PlayVisibility1690796169261' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "public"."flash" ADD "visibility" character varying(512) DEFAULT 'public'`, undefined); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "public"."flash" DROP COLUMN "visibility"`, undefined); + } +} diff --git a/packages/backend/migration/1691959191872-passkey-support.js b/packages/backend/migration/1691959191872-passkey-support.js index d9e808ba5f..55b571d60d 100644 --- a/packages/backend/migration/1691959191872-passkey-support.js +++ b/packages/backend/migration/1691959191872-passkey-support.js @@ -4,46 +4,46 @@ */ export class PasskeySupport1691959191872 { - name = 'PasskeySupport1691959191872' + name = 'PasskeySupport1691959191872' - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_security_key" ADD "counter" bigint NOT NULL DEFAULT '0'`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."counter" IS 'The number of times the UserSecurityKey was validated.'`); - await queryRunner.query(`ALTER TABLE "user_security_key" ADD "credentialDeviceType" character varying(32)`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."credentialDeviceType" IS 'The type of Backup Eligibility in authenticator data'`); - await queryRunner.query(`ALTER TABLE "user_security_key" ADD "credentialBackedUp" boolean`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."credentialBackedUp" IS 'Whether or not the credential has been backed up'`); - await queryRunner.query(`ALTER TABLE "user_security_key" ADD "transports" character varying(32) array`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."transports" IS 'The type of the credential returned by the browser'`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."publicKey" IS 'The public key of the UserSecurityKey, hex-encoded.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."lastUsed" IS 'Timestamp of the last time the UserSecurityKey was used.'`); - await queryRunner.query(`ALTER TABLE "user_security_key" ALTER COLUMN "lastUsed" SET DEFAULT now()`); - await queryRunner.query(`UPDATE "user_security_key" SET "id" = REPLACE(REPLACE(REPLACE(REPLACE(ENCODE(DECODE("id", 'hex'), 'base64'), E'\\n', ''), '+', '-'), '/', '_'), '=', ''), "publicKey" = REPLACE(REPLACE(REPLACE(REPLACE(ENCODE(DECODE("publicKey", 'hex'), 'base64'), E'\\n', ''), '+', '-'), '/', '_'), '=', '')`); - await queryRunner.query(`ALTER TABLE "attestation_challenge" DROP CONSTRAINT "FK_f1a461a618fa1755692d0e0d592"`); - await queryRunner.query(`DROP INDEX "IDX_47efb914aed1f72dd39a306c7b"`); - await queryRunner.query(`DROP INDEX "IDX_f1a461a618fa1755692d0e0d59"`); - await queryRunner.query(`DROP TABLE "attestation_challenge"`); - } + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_security_key" ADD "counter" bigint NOT NULL DEFAULT '0'`); + await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."counter" IS 'The number of times the UserSecurityKey was validated.'`); + await queryRunner.query(`ALTER TABLE "user_security_key" ADD "credentialDeviceType" character varying(32)`); + await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."credentialDeviceType" IS 'The type of Backup Eligibility in authenticator data'`); + await queryRunner.query(`ALTER TABLE "user_security_key" ADD "credentialBackedUp" boolean`); + await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."credentialBackedUp" IS 'Whether or not the credential has been backed up'`); + await queryRunner.query(`ALTER TABLE "user_security_key" ADD "transports" character varying(32) array`); + await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."transports" IS 'The type of the credential returned by the browser'`); + await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."publicKey" IS 'The public key of the UserSecurityKey, hex-encoded.'`); + await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."lastUsed" IS 'Timestamp of the last time the UserSecurityKey was used.'`); + await queryRunner.query(`ALTER TABLE "user_security_key" ALTER COLUMN "lastUsed" SET DEFAULT now()`); + await queryRunner.query(`UPDATE "user_security_key" SET "id" = REPLACE(REPLACE(REPLACE(REPLACE(ENCODE(DECODE("id", 'hex'), 'base64'), E'\\n', ''), '+', '-'), '/', '_'), '=', ''), "publicKey" = REPLACE(REPLACE(REPLACE(REPLACE(ENCODE(DECODE("publicKey", 'hex'), 'base64'), E'\\n', ''), '+', '-'), '/', '_'), '=', '')`); + await queryRunner.query(`ALTER TABLE "attestation_challenge" DROP CONSTRAINT "FK_f1a461a618fa1755692d0e0d592"`); + await queryRunner.query(`DROP INDEX "IDX_47efb914aed1f72dd39a306c7b"`); + await queryRunner.query(`DROP INDEX "IDX_f1a461a618fa1755692d0e0d59"`); + await queryRunner.query(`DROP TABLE "attestation_challenge"`); + } - async down(queryRunner) { - await queryRunner.query(`CREATE TABLE "attestation_challenge" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "challenge" character varying(64) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "registrationChallenge" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_d0ba6786e093f1bcb497572a6b5" PRIMARY KEY ("id", "userId"))`); - await queryRunner.query(`CREATE INDEX "IDX_f1a461a618fa1755692d0e0d59" ON "attestation_challenge" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_47efb914aed1f72dd39a306c7b" ON "attestation_challenge" ("challenge") `); - await queryRunner.query(`ALTER TABLE "attestation_challenge" ADD CONSTRAINT "FK_f1a461a618fa1755692d0e0d592" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`COMMENT ON COLUMN "attestation_challenge"."challenge" IS 'Hex-encoded sha256 hash of the challenge.'`); - await queryRunner.query(`COMMENT ON COLUMN "attestation_challenge"."createdAt" IS 'The date challenge was created for expiry purposes.'`); - await queryRunner.query(`COMMENT ON COLUMN "attestation_challenge"."registrationChallenge" IS 'Indicates that the challenge is only for registration purposes if true to prevent the challenge for being used as authentication.'`); - await queryRunner.query(`UPDATE "user_security_key" SET "id" = ENCODE(DECODE(REPLACE(REPLACE("id" || CASE WHEN LENGTH("id") % 4 = 2 THEN '==' WHEN LENGTH("id") % 4 = 3 THEN '=' ELSE '' END, '-', '+'), '_', '/'), 'base64'), 'hex'), "publicKey" = ENCODE(DECODE(REPLACE(REPLACE("publicKey" || CASE WHEN LENGTH("publicKey") % 4 = 2 THEN '==' WHEN LENGTH("publicKey") % 4 = 3 THEN '=' ELSE '' END, '-', '+'), '_', '/'), 'base64'), 'hex')`); - await queryRunner.query(`ALTER TABLE "user_security_key" ALTER COLUMN "lastUsed" DROP DEFAULT`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."lastUsed" IS 'The date of the last time the UserSecurityKey was successfully validated.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."publicKey" IS 'Variable-length public key used to verify attestations (hex-encoded).'`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."transports" IS 'The type of the credential returned by the browser'`); - await queryRunner.query(`ALTER TABLE "user_security_key" DROP COLUMN "transports"`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."credentialBackedUp" IS 'Whether or not the credential has been backed up'`); - await queryRunner.query(`ALTER TABLE "user_security_key" DROP COLUMN "credentialBackedUp"`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."credentialDeviceType" IS 'The type of Backup Eligibility in authenticator data'`); - await queryRunner.query(`ALTER TABLE "user_security_key" DROP COLUMN "credentialDeviceType"`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."counter" IS 'The number of times the UserSecurityKey was validated.'`); - await queryRunner.query(`ALTER TABLE "user_security_key" DROP COLUMN "counter"`); - } + async down(queryRunner) { + await queryRunner.query(`CREATE TABLE "attestation_challenge" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "challenge" character varying(64) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "registrationChallenge" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_d0ba6786e093f1bcb497572a6b5" PRIMARY KEY ("id", "userId"))`); + await queryRunner.query(`CREATE INDEX "IDX_f1a461a618fa1755692d0e0d59" ON "attestation_challenge" ("userId") `); + await queryRunner.query(`CREATE INDEX "IDX_47efb914aed1f72dd39a306c7b" ON "attestation_challenge" ("challenge") `); + await queryRunner.query(`ALTER TABLE "attestation_challenge" ADD CONSTRAINT "FK_f1a461a618fa1755692d0e0d592" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`COMMENT ON COLUMN "attestation_challenge"."challenge" IS 'Hex-encoded sha256 hash of the challenge.'`); + await queryRunner.query(`COMMENT ON COLUMN "attestation_challenge"."createdAt" IS 'The date challenge was created for expiry purposes.'`); + await queryRunner.query(`COMMENT ON COLUMN "attestation_challenge"."registrationChallenge" IS 'Indicates that the challenge is only for registration purposes if true to prevent the challenge for being used as authentication.'`); + await queryRunner.query(`UPDATE "user_security_key" SET "id" = ENCODE(DECODE(REPLACE(REPLACE("id" || CASE WHEN LENGTH("id") % 4 = 2 THEN '==' WHEN LENGTH("id") % 4 = 3 THEN '=' ELSE '' END, '-', '+'), '_', '/'), 'base64'), 'hex'), "publicKey" = ENCODE(DECODE(REPLACE(REPLACE("publicKey" || CASE WHEN LENGTH("publicKey") % 4 = 2 THEN '==' WHEN LENGTH("publicKey") % 4 = 3 THEN '=' ELSE '' END, '-', '+'), '_', '/'), 'base64'), 'hex')`); + await queryRunner.query(`ALTER TABLE "user_security_key" ALTER COLUMN "lastUsed" DROP DEFAULT`); + await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."lastUsed" IS 'The date of the last time the UserSecurityKey was successfully validated.'`); + await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."publicKey" IS 'Variable-length public key used to verify attestations (hex-encoded).'`); + await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."transports" IS 'The type of the credential returned by the browser'`); + await queryRunner.query(`ALTER TABLE "user_security_key" DROP COLUMN "transports"`); + await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."credentialBackedUp" IS 'Whether or not the credential has been backed up'`); + await queryRunner.query(`ALTER TABLE "user_security_key" DROP COLUMN "credentialBackedUp"`); + await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."credentialDeviceType" IS 'The type of Backup Eligibility in authenticator data'`); + await queryRunner.query(`ALTER TABLE "user_security_key" DROP COLUMN "credentialDeviceType"`); + await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."counter" IS 'The number of times the UserSecurityKey was validated.'`); + await queryRunner.query(`ALTER TABLE "user_security_key" DROP COLUMN "counter"`); + } } diff --git a/packages/backend/migration/1694850832075-server-icons-and-manifest.js b/packages/backend/migration/1694850832075-server-icons-and-manifest.js new file mode 100644 index 0000000000..1bd8979d9b --- /dev/null +++ b/packages/backend/migration/1694850832075-server-icons-and-manifest.js @@ -0,0 +1,20 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +export class ServerIconsAndManifest1694850832075 { + name = 'ServerIconsAndManifest1694850832075' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD "app192IconUrl" character varying(1024)`); + await queryRunner.query(`ALTER TABLE "meta" ADD "app512IconUrl" character varying(1024)`); + await queryRunner.query(`ALTER TABLE "meta" ADD "manifestJsonOverride" character varying(8192) NOT NULL DEFAULT '{}'`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "manifestJsonOverride"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "app512IconUrl"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "app192IconUrl"`); + } +} diff --git a/packages/backend/migration/1694915420864-clipped-count.js b/packages/backend/migration/1694915420864-clipped-count.js new file mode 100644 index 0000000000..1ad8e04ce0 --- /dev/null +++ b/packages/backend/migration/1694915420864-clipped-count.js @@ -0,0 +1,16 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +export class ClippedCount1694915420864 { + name = 'ClippedCount1694915420864' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "note" ADD "clippedCount" smallint NOT NULL DEFAULT '0'`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "clippedCount"`); + } +} diff --git a/packages/backend/migration/1695260774117-verified-links.js b/packages/backend/migration/1695260774117-verified-links.js new file mode 100644 index 0000000000..18e0571d81 --- /dev/null +++ b/packages/backend/migration/1695260774117-verified-links.js @@ -0,0 +1,11 @@ +export class VerifiedLinks1695260774117 { + name = 'VerifiedLinks1695260774117' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_profile" ADD "verifiedLinks" character varying array NOT NULL DEFAULT '{}'`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "verifiedLinks"`); + } +} diff --git a/packages/backend/migration/1695288787870-following-notify.js b/packages/backend/migration/1695288787870-following-notify.js new file mode 100644 index 0000000000..e7e2194b15 --- /dev/null +++ b/packages/backend/migration/1695288787870-following-notify.js @@ -0,0 +1,13 @@ +export class FollowingNotify1695288787870 { + name = 'FollowingNotify1695288787870' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "following" ADD "notify" character varying(32)`); + await queryRunner.query(`CREATE INDEX "IDX_5108098457488634a4768e1d12" ON "following" ("notify") `); + } + + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "public"."IDX_5108098457488634a4768e1d12"`); + await queryRunner.query(`ALTER TABLE "following" DROP COLUMN "notify"`); + } +} diff --git a/packages/backend/migration/1695440131671-short-name.js b/packages/backend/migration/1695440131671-short-name.js new file mode 100644 index 0000000000..2c37297fc1 --- /dev/null +++ b/packages/backend/migration/1695440131671-short-name.js @@ -0,0 +1,11 @@ +export class ShortName1695440131671 { + name = 'ShortName1695440131671' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD "shortName" character varying(64)`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "shortName"`); + } +} diff --git a/packages/backend/package.json b/packages/backend/package.json index b5748d909e..c26b1238db 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -56,37 +56,39 @@ "utf-8-validate": "^6.0.3" }, "dependencies": { - "@aws-sdk/client-s3": "3.367.0", - "@aws-sdk/lib-storage": "3.367.0", - "@aws-sdk/node-http-handler": "3.360.0", - "@bull-board/api": "5.6.1", - "@bull-board/fastify": "5.6.1", - "@bull-board/ui": "5.6.1", + "@aws-sdk/client-s3": "3.412.0", + "@aws-sdk/lib-storage": "3.412.0", + "@smithy/node-http-handler": "2.1.5", + "@bull-board/api": "5.8.4", + "@bull-board/fastify": "5.8.4", + "@bull-board/ui": "5.8.4", "@discordapp/twemoji": "14.1.2", "@fastify/accepts": "4.2.0", - "@fastify/cookie": "8.3.0", - "@fastify/cors": "8.3.0", + "@fastify/cookie": "9.1.0", + "@fastify/cors": "8.4.0", + "@fastify/express": "2.3.0", "@fastify/http-proxy": "9.2.1", - "@fastify/multipart": "7.7.1", - "@fastify/static": "6.10.2", - "@fastify/view": "8.0.0", - "@nestjs/common": "10.1.0", - "@nestjs/core": "10.1.0", - "@nestjs/testing": "10.1.0", + "@fastify/multipart": "7.7.3", + "@fastify/static": "6.11.2", + "@fastify/view": "8.2.0", + "@nestjs/common": "10.2.6", + "@nestjs/core": "10.2.6", + "@nestjs/testing": "10.2.6", "@peertube/http-signature": "1.7.0", - "@simplewebauthn/server": "^7.4.0", - "@sinonjs/fake-timers": "10.3.0", + "@simplewebauthn/server": "8.1.1", + "@sinonjs/fake-timers": "11.1.0", "@swc/cli": "0.1.62", - "@swc/core": "1.3.70", + "@swc/core": "1.3.87", "accepts": "1.3.8", "ajv": "8.12.0", - "archiver": "5.3.1", - "async-mutex": "^0.4.0", + "archiver": "6.0.1", + "async-mutex": "0.4.0", "bcryptjs": "2.4.3", "blurhash": "2.0.5", - "bullmq": "4.4.0", + "body-parser": "1.20.2", + "bullmq": "4.11.4", "cacheable-lookup": "7.0.0", - "cbor": "9.0.0", + "cbor": "9.0.1", "chalk": "5.3.0", "chalk-template": "1.1.0", "chokidar": "3.5.3", @@ -95,7 +97,7 @@ "content-disposition": "0.5.4", "date-fns": "2.30.0", "deep-email-validator": "0.1.21", - "fastify": "4.20.0", + "fastify": "4.23.2", "feed": "4.2.2", "file-type": "18.5.0", "fluent-ffmpeg": "2.1.2", @@ -103,6 +105,7 @@ "got": "13.0.0", "happy-dom": "10.0.3", "hpagent": "1.2.0", + "http-link-header": "1.1.1", "ioredis": "5.3.2", "ip-cidr": "3.1.0", "ipaddr.js": "2.1.0", @@ -110,22 +113,27 @@ "js-yaml": "4.1.0", "jsdom": "22.1.0", "json5": "2.2.3", - "jsonld": "8.2.0", + "jsonld": "8.3.1", "jsrsasign": "10.8.6", - "meilisearch": "0.33.0", + "meilisearch": "0.34.2", "mfm-js": "0.23.3", + "microformats-parser": "1.5.2", "mime-types": "2.1.35", "misskey-js": "workspace:*", "ms": "3.0.0-canary.1", + "nanoid": "5.0.1", "nested-property": "4.0.0", - "node-fetch": "3.3.1", - "nodemailer": "6.9.3", + "node-fetch": "3.3.2", + "nodemailer": "6.9.5", "nsfwjs": "2.4.2", "oauth": "0.10.0", + "oauth2orize": "1.11.1", + "oauth2orize-pkce": "0.1.2", "os-utils": "0.0.14", - "otpauth": "9.1.3", + "otpauth": "9.1.4", "parse5": "7.1.2", - "pg": "8.11.1", + "pg": "8.11.3", + "pkce-challenge": "4.0.1", "probe-image-size": "7.2.3", "promise-limit": "2.7.0", "pug": "3.0.2", @@ -134,80 +142,85 @@ "qrcode": "1.5.3", "random-seed": "0.3.0", "ratelimiter": "3.4.1", - "re2": "1.19.1", + "re2": "1.20.3", "redis-lock": "0.1.4", "reflect-metadata": "0.1.13", "rename": "1.0.4", "rss-parser": "3.13.0", "rxjs": "7.8.1", "sanitize-html": "2.11.0", - "semver": "7.5.4", "sharp": "0.32.6", "sharp-read-bmp": "github:misskey-dev/sharp-read-bmp", "slacc": "0.0.10", "strict-event-emitter-types": "2.0.0", "stringz": "2.1.0", "summaly": "github:misskey-dev/summaly", - "systeminformation": "5.18.7", + "systeminformation": "5.21.8", "tinycolor2": "1.6.0", "tmp": "0.2.1", - "tsc-alias": "1.8.7", + "tsc-alias": "1.8.8", "tsconfig-paths": "4.2.0", "twemoji-parser": "14.0.0", "typeorm": "0.3.17", - "typescript": "5.1.6", + "typescript": "5.2.2", "ulid": "2.3.0", "vary": "1.1.2", - "web-push": "3.6.3", - "ws": "8.13.0", + "web-push": "3.6.6", + "ws": "8.14.2", "xev": "3.0.2" }, "devDependencies": { - "@jest/globals": "29.6.1", - "@simplewebauthn/typescript-types": "^7.4.0", - "@swc/jest": "0.2.26", + "@jest/globals": "29.7.0", + "@simplewebauthn/typescript-types": "8.0.0", + "@swc/jest": "0.2.29", "@types/accepts": "1.3.5", - "@types/archiver": "5.3.2", - "@types/bcryptjs": "2.4.2", + "@types/archiver": "5.3.3", + "@types/bcryptjs": "2.4.4", + "@types/body-parser": "1.19.3", "@types/cbor": "6.0.0", - "@types/color-convert": "2.0.0", - "@types/content-disposition": "0.5.5", - "@types/fluent-ffmpeg": "2.1.21", - "@types/jest": "29.5.3", - "@types/js-yaml": "4.0.5", - "@types/jsdom": "21.1.1", - "@types/jsonld": "1.5.9", - "@types/jsrsasign": "10.5.8", + "@types/color-convert": "2.0.1", + "@types/content-disposition": "0.5.6", + "@types/fluent-ffmpeg": "2.1.22", + "@types/http-link-header": "1.0.3", + "@types/jest": "29.5.5", + "@types/js-yaml": "4.0.6", + "@types/jsdom": "21.1.3", + "@types/jsonld": "1.5.10", + "@types/jsrsasign": "10.5.9", "@types/mime-types": "2.1.1", - "@types/ms": "^0.7.31", - "@types/node": "20.4.2", + "@types/ms": "0.7.31", + "@types/node": "20.6.4", "@types/node-fetch": "3.0.3", - "@types/nodemailer": "6.4.8", - "@types/oauth": "0.9.1", + "@types/nodemailer": "6.4.11", + "@types/oauth": "0.9.2", + "@types/oauth2orize": "1.11.1", + "@types/oauth2orize-pkce": "0.1.0", "@types/pg": "8.10.2", "@types/pug": "2.0.6", "@types/punycode": "2.1.0", - "@types/qrcode": "1.5.1", + "@types/qrcode": "1.5.2", "@types/random-seed": "0.3.3", "@types/ratelimiter": "3.4.4", "@types/rename": "1.0.4", "@types/sanitize-html": "2.9.0", - "@types/semver": "7.5.0", + "@types/semver": "7.5.2", "@types/sharp": "0.32.0", + "@types/simple-oauth2": "5.0.4", "@types/sinonjs__fake-timers": "8.1.2", - "@types/tinycolor2": "1.4.3", - "@types/tmp": "0.2.3", + "@types/tinycolor2": "1.4.4", + "@types/tmp": "0.2.4", "@types/vary": "1.1.0", - "@types/web-push": "3.3.2", + "@types/web-push": "3.6.0", "@types/ws": "8.5.5", - "@typescript-eslint/eslint-plugin": "5.61.0", - "@typescript-eslint/parser": "5.61.0", + "@typescript-eslint/eslint-plugin": "6.7.2", + "@typescript-eslint/parser": "6.7.2", "aws-sdk-client-mock": "3.0.0", "cross-env": "7.0.3", - "eslint": "8.45.0", - "eslint-plugin-import": "2.27.5", - "execa": "7.1.1", - "jest": "29.6.1", - "jest-mock": "29.6.1" + "eslint": "8.50.0", + "eslint-plugin-import": "2.28.1", + "execa": "8.0.1", + "jest": "29.7.0", + "jest-mock": "29.7.0", + "simple-oauth2": "5.0.0" } } diff --git a/packages/backend/src/boot/index.ts b/packages/backend/src/boot/entry.ts similarity index 100% rename from packages/backend/src/boot/index.ts rename to packages/backend/src/boot/entry.ts diff --git a/packages/backend/src/boot/master.ts b/packages/backend/src/boot/master.ts index 5dd7d7baf1..a45ea2bb8f 100644 --- a/packages/backend/src/boot/master.ts +++ b/packages/backend/src/boot/master.ts @@ -10,7 +10,6 @@ import * as os from 'node:os'; import cluster from 'node:cluster'; import chalk from 'chalk'; import chalkTemplate from 'chalk-template'; -import semver from 'semver'; import Logger from '@/logger.js'; import { loadConfig } from '@/config.js'; import type { Config } from '@/config.js'; @@ -69,21 +68,34 @@ export async function masterMain() { process.exit(1); } - if (envOption.onlyServer) { - await server(); - } else if (envOption.onlyQueue) { - await jobQueue(); - } else { - await server(); - } - bootLogger.succ('Misskey initialized'); - if (!envOption.disableClustering) { + if (envOption.disableClustering) { + if (envOption.onlyServer) { + await server(); + } else if (envOption.onlyQueue) { + await jobQueue(); + } else { + await server(); + await jobQueue(); + } + } else { + if (envOption.onlyServer) { + // nop + } else if (envOption.onlyQueue) { + // nop + } else { + await server(); + } + await spawnWorkers(config.clusterLimit); } - bootLogger.succ(config.socket ? `Now listening on socket ${config.socket} on ${config.url}` : `Now listening on port ${config.port} on ${config.url}`, null, true); + if (envOption.onlyQueue) { + bootLogger.succ('Queue started', null, true); + } else { + bootLogger.succ(config.socket ? `Now listening on socket ${config.socket} on ${config.url}` : `Now listening on port ${config.port} on ${config.url}`, null, true); + } } function showEnvironment(): void { diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index 23ee3a91f5..98888a825b 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -3,10 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -/** - * Config loader - */ - import * as fs from 'node:fs'; import { fileURLToPath } from 'node:url'; import { dirname, resolve } from 'node:path'; @@ -23,11 +19,9 @@ type RedisOptionsSource = Partial & { }; /** - * ユーザーが設定する必要のある情報 + * 設定ファイルの型 */ -export type Source = { - repository_url?: string; - feedback_url?: string; +type Source = { url: string; port?: number; socket?: string; @@ -72,12 +66,11 @@ export type Source = { maxFileSize?: number; - accesslog?: string; - clusterLimit?: number; id: string; + outgoingAddress?: string; outgoingAddressFamily?: 'ipv4' | 'ipv6' | 'dual'; deliverJobConcurrency?: number; @@ -94,12 +87,64 @@ export type Source = { videoThumbnailGenerator?: string; signToActivityPubGet?: boolean; + + perChannelMaxNoteCacheCount?: number; + perUserNotificationsMaxCount?: number; + deactivateAntennaThreshold?: number; }; -/** - * Misskeyが自動的に(ユーザーが設定した情報から推論して)設定する情報 - */ -export type Mixin = { +export type Config = { + url: string; + port: number; + socket: string | undefined; + chmodSocket: string | undefined; + disableHsts: boolean | undefined; + db: { + host: string; + port: number; + db: string; + user: string; + pass: string; + disableCache?: boolean; + extra?: { [x: string]: string }; + }; + dbReplications: boolean | undefined; + dbSlaves: { + host: string; + port: number; + db: string; + user: string; + pass: string; + }[] | undefined; + meilisearch: { + host: string; + port: string; + apiKey: string; + ssl?: boolean; + index: string; + scope?: 'local' | 'global' | string[]; + } | undefined; + proxy: string | undefined; + proxySmtp: string | undefined; + proxyBypassHosts: string[] | undefined; + allowedPrivateNetworks: string[] | undefined; + contentSecurityPolicy: string | undefined; + maxFileSize: number | undefined; + clusterLimit: number | undefined; + id: string; + outgoingAddress: string | undefined; + outgoingAddressFamily: 'ipv4' | 'ipv6' | 'dual' | undefined; + deliverJobConcurrency: number | undefined; + inboxJobConcurrency: number | undefined; + relashionshipJobConcurrency: number | undefined; + deliverJobPerSec: number | undefined; + inboxJobPerSec: number | undefined; + relashionshipJobPerSec: number | undefined; + deliverJobMaxAttempts: number | undefined; + inboxJobMaxAttempts: number | undefined; + proxyRemoteFiles: boolean | undefined; + signToActivityPubGet: boolean | undefined; + version: string; host: string; hostname: string; @@ -118,10 +163,11 @@ export type Mixin = { redis: RedisOptions & RedisOptionsSource; redisForPubsub: RedisOptions & RedisOptionsSource; redisForJobQueue: RedisOptions & RedisOptionsSource; + perChannelMaxNoteCacheCount: number; + perUserNotificationsMaxCount: number; + deactivateAntennaThreshold: number; }; -export type Config = Source & Mixin; - const _filename = fileURLToPath(import.meta.url); const _dirname = dirname(_filename); @@ -139,7 +185,7 @@ const path = process.env.MISSKEY_CONFIG_YML ? resolve(dir, 'test.yml') : resolve(dir, 'default.yml'); -export function loadConfig() { +export function loadConfig(): Config { const meta = JSON.parse(fs.readFileSync(`${_dirname}/../../../built/meta.json`, 'utf-8')); const clientManifestExists = fs.existsSync(_dirname + '/../../../built/_vite_/manifest.json'); const clientManifest = clientManifestExists ? @@ -147,43 +193,73 @@ export function loadConfig() { : { 'src/_boot_.ts': { file: 'src/_boot_.ts' } }; const config = yaml.load(fs.readFileSync(path, 'utf-8')) as Source; - const mixin = {} as Mixin; - const url = tryCreateUrl(config.url); - - config.url = url.origin; - - config.port = config.port ?? parseInt(process.env.PORT ?? '', 10); - - mixin.version = meta.version; - mixin.host = url.host; - mixin.hostname = url.hostname; - mixin.scheme = url.protocol.replace(/:$/, ''); - mixin.wsScheme = mixin.scheme.replace('http', 'ws'); - mixin.wsUrl = `${mixin.wsScheme}://${mixin.host}`; - mixin.apiUrl = `${mixin.scheme}://${mixin.host}/api`; - mixin.authUrl = `${mixin.scheme}://${mixin.host}/auth`; - mixin.driveUrl = `${mixin.scheme}://${mixin.host}/files`; - mixin.userAgent = `Misskey/${meta.version} (${config.url})`; - mixin.clientEntry = clientManifest['src/_boot_.ts']; - mixin.clientManifestExists = clientManifestExists; + const version = meta.version; + const host = url.host; + const hostname = url.hostname; + const scheme = url.protocol.replace(/:$/, ''); + const wsScheme = scheme.replace('http', 'ws'); const externalMediaProxy = config.mediaProxy ? config.mediaProxy.endsWith('/') ? config.mediaProxy.substring(0, config.mediaProxy.length - 1) : config.mediaProxy : null; - const internalMediaProxy = `${mixin.scheme}://${mixin.host}/proxy`; - mixin.mediaProxy = externalMediaProxy ?? internalMediaProxy; - mixin.externalMediaProxyEnabled = externalMediaProxy !== null && externalMediaProxy !== internalMediaProxy; + const internalMediaProxy = `${scheme}://${host}/proxy`; + const redis = convertRedisOptions(config.redis, host); - mixin.videoThumbnailGenerator = config.videoThumbnailGenerator ? - config.videoThumbnailGenerator.endsWith('/') ? config.videoThumbnailGenerator.substring(0, config.videoThumbnailGenerator.length - 1) : config.videoThumbnailGenerator - : null; - - mixin.redis = convertRedisOptions(config.redis, mixin.host); - mixin.redisForPubsub = config.redisForPubsub ? convertRedisOptions(config.redisForPubsub, mixin.host) : mixin.redis; - mixin.redisForJobQueue = config.redisForJobQueue ? convertRedisOptions(config.redisForJobQueue, mixin.host) : mixin.redis; - - return Object.assign(config, mixin); + return { + version, + url: url.origin, + port: config.port ?? parseInt(process.env.PORT ?? '', 10), + socket: config.socket, + chmodSocket: config.chmodSocket, + disableHsts: config.disableHsts, + host, + hostname, + scheme, + wsScheme, + wsUrl: `${wsScheme}://${host}`, + apiUrl: `${scheme}://${host}/api`, + authUrl: `${scheme}://${host}/auth`, + driveUrl: `${scheme}://${host}/files`, + db: config.db, + dbReplications: config.dbReplications, + dbSlaves: config.dbSlaves, + meilisearch: config.meilisearch, + redis, + redisForPubsub: config.redisForPubsub ? convertRedisOptions(config.redisForPubsub, host) : redis, + redisForJobQueue: config.redisForJobQueue ? convertRedisOptions(config.redisForJobQueue, host) : redis, + id: config.id, + proxy: config.proxy, + proxySmtp: config.proxySmtp, + proxyBypassHosts: config.proxyBypassHosts, + allowedPrivateNetworks: config.allowedPrivateNetworks, + contentSecurityPolicy: config.contentSecurityPolicy, + maxFileSize: config.maxFileSize, + clusterLimit: config.clusterLimit, + outgoingAddress: config.outgoingAddress, + outgoingAddressFamily: config.outgoingAddressFamily, + deliverJobConcurrency: config.deliverJobConcurrency, + inboxJobConcurrency: config.inboxJobConcurrency, + relashionshipJobConcurrency: config.relashionshipJobConcurrency, + deliverJobPerSec: config.deliverJobPerSec, + inboxJobPerSec: config.inboxJobPerSec, + relashionshipJobPerSec: config.relashionshipJobPerSec, + deliverJobMaxAttempts: config.deliverJobMaxAttempts, + inboxJobMaxAttempts: config.inboxJobMaxAttempts, + proxyRemoteFiles: config.proxyRemoteFiles, + signToActivityPubGet: config.signToActivityPubGet, + mediaProxy: externalMediaProxy ?? internalMediaProxy, + externalMediaProxyEnabled: externalMediaProxy !== null && externalMediaProxy !== internalMediaProxy, + videoThumbnailGenerator: config.videoThumbnailGenerator ? + config.videoThumbnailGenerator.endsWith('/') ? config.videoThumbnailGenerator.substring(0, config.videoThumbnailGenerator.length - 1) : config.videoThumbnailGenerator + : null, + userAgent: `Misskey/${version} (${config.url})`, + clientEntry: clientManifest['src/_boot_.ts'], + clientManifestExists: clientManifestExists, + perChannelMaxNoteCacheCount: config.perChannelMaxNoteCacheCount ?? 1000, + perUserNotificationsMaxCount: config.perUserNotificationsMaxCount ?? 300, + deactivateAntennaThreshold: config.deactivateAntennaThreshold ?? (1000 * 60 * 60 * 24 * 7), + }; } function tryCreateUrl(url: string) { @@ -199,7 +275,7 @@ function convertRedisOptions(options: RedisOptionsSource, host: string): RedisOp ...options, password: options.pass, prefix: options.prefix ?? host, - family: options.family == null ? 0 : options.family, + family: options.family ?? 0, keyPrefix: `${options.prefix ?? host}:`, db: options.db ?? 0, }; diff --git a/packages/backend/src/core/AccountMoveService.ts b/packages/backend/src/core/AccountMoveService.ts index 07e7e98eb4..ad485ecad4 100644 --- a/packages/backend/src/core/AccountMoveService.ts +++ b/packages/backend/src/core/AccountMoveService.ts @@ -9,8 +9,8 @@ import { IsNull, In, MoreThan, Not } from 'typeorm'; import { bindThis } from '@/decorators.js'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; -import type { MiLocalUser, MiRemoteUser, MiUser } from '@/models/entities/User.js'; -import type { BlockingsRepository, FollowingsRepository, InstancesRepository, MiMuting, MutingsRepository, UserListJoiningsRepository, UsersRepository } from '@/models/index.js'; +import type { MiLocalUser, MiRemoteUser, MiUser } from '@/models/User.js'; +import type { BlockingsRepository, FollowingsRepository, InstancesRepository, MutingsRepository, UserListJoiningsRepository, UsersRepository } from '@/models/_.js'; import type { RelationshipJobData, ThinUser } from '@/queue/types.js'; import { IdService } from '@/core/IdService.js'; @@ -31,9 +31,6 @@ import PerUserFollowingChart from '@/core/chart/charts/per-user-following.js'; @Injectable() export class AccountMoveService { constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/core/AccountUpdateService.ts b/packages/backend/src/core/AccountUpdateService.ts index 5cd455fa77..664700ea6b 100644 --- a/packages/backend/src/core/AccountUpdateService.ts +++ b/packages/backend/src/core/AccountUpdateService.ts @@ -5,9 +5,8 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { UsersRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { UsersRepository } from '@/models/_.js'; +import type { MiUser } from '@/models/User.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; import { RelayService } from '@/core/RelayService.js'; import { ApDeliverManagerService } from '@/core/activitypub/ApDeliverManagerService.js'; @@ -17,9 +16,6 @@ import { bindThis } from '@/decorators.js'; @Injectable() export class AccountUpdateService { constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/core/AchievementService.ts b/packages/backend/src/core/AchievementService.ts index 8526e3f98b..1b8718335b 100644 --- a/packages/backend/src/core/AchievementService.ts +++ b/packages/backend/src/core/AchievementService.ts @@ -4,8 +4,8 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserProfilesRepository, UsersRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { UserProfilesRepository } from '@/models/_.js'; +import type { MiUser } from '@/models/User.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; import { NotificationService } from '@/core/NotificationService.js'; @@ -85,14 +85,12 @@ export const ACHIEVEMENT_TYPES = [ 'setNameToSyuilo', 'cookieClicked', 'brainDiver', + 'smashTestNotificationButton', ] as const; @Injectable() export class AchievementService { constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, diff --git a/packages/backend/src/core/AiService.ts b/packages/backend/src/core/AiService.ts index fc7b0226c0..4e876495a6 100644 --- a/packages/backend/src/core/AiService.ts +++ b/packages/backend/src/core/AiService.ts @@ -6,12 +6,10 @@ import * as fs from 'node:fs'; import { fileURLToPath } from 'node:url'; import { dirname } from 'node:path'; -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import * as nsfw from 'nsfwjs'; import si from 'systeminformation'; import { Mutex } from 'async-mutex'; -import type { Config } from '@/config.js'; -import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; const _filename = fileURLToPath(import.meta.url); @@ -26,8 +24,6 @@ export class AiService { private modelLoadMutex: Mutex = new Mutex(); constructor( - @Inject(DI.config) - private config: Config, ) { } diff --git a/packages/backend/src/core/AnnouncementService.ts b/packages/backend/src/core/AnnouncementService.ts index 49913be111..d49641f54a 100644 --- a/packages/backend/src/core/AnnouncementService.ts +++ b/packages/backend/src/core/AnnouncementService.ts @@ -5,15 +5,16 @@ import { Inject, Injectable } from '@nestjs/common'; import { Brackets, In } from 'typeorm'; -import type { AnnouncementReadsRepository, AnnouncementsRepository, UsersRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; -import { MiAnnouncement, MiAnnouncementRead } from '@/models/index.js'; -import { AnnouncementEntityService } from '@/core/entities/AnnouncementEntityService.js'; -import { bindThis } from '@/decorators.js'; import { DI } from '@/di-symbols.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; -import { IdService } from '@/core/IdService.js'; +import type { MiUser } from '@/models/User.js'; +import type { AnnouncementReadsRepository, AnnouncementsRepository, MiAnnouncement, UsersRepository } from '@/models/_.js'; +import { MiAnnouncementRead } from '@/models/_.js'; +import { bindThis } from '@/decorators.js'; import { Packed } from '@/misc/json-schema.js'; +import { IdService } from '@/core/IdService.js'; +import { GlobalEventService } from '@/core/GlobalEventService.js'; +import { ModerationLogService } from '@/core/ModerationLogService.js'; +import { AnnouncementEntityService } from '@/core/entities/AnnouncementEntityService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; @Injectable() @@ -32,175 +33,15 @@ export class AnnouncementService { private userEntityService: UserEntityService, private announcementEntityService: AnnouncementEntityService, private globalEventService: GlobalEventService, - ) {} - - @bindThis - public async create( - values: Partial, - ): Promise<{ raw: MiAnnouncement; packed: Packed<'Announcement'> }> { - const announcement = await this.announcementsRepository - .insert({ - id: this.idService.genId(), - createdAt: new Date(), - updatedAt: null, - title: values.title, - text: values.text, - imageUrl: values.imageUrl, - icon: values.icon, - display: values.display, - forExistingUsers: values.forExistingUsers, - needConfirmationToRead: values.needConfirmationToRead, - closeDuration: values.closeDuration, - displayOrder: values.displayOrder, - userId: values.userId, - }) - .then((x) => - this.announcementsRepository.findOneByOrFail(x.identifiers[0]), - ); - - const packed = await this.announcementEntityService.pack( - announcement, - null, - ); - - if (values.userId) { - this.globalEventService.publishMainStream( - values.userId, - 'announcementCreated', - { - announcement: packed, - }, - ); - } else { - this.globalEventService.publishBroadcastStream('announcementCreated', { - announcement: packed, - }); - } - - return { - raw: announcement, - packed: packed, - }; + private moderationLogService: ModerationLogService, + ) { } @bindThis - public async list( - userId: MiUser['id'] | null, - limit: number, - offset: number, - moderator: MiUser, - ): Promise<(MiAnnouncement & { userInfo: Packed<'UserLite'> | null, readCount: number })[]> { - const query = this.announcementsRepository.createQueryBuilder('announcement'); - if (userId) { - query.andWhere('announcement."userId" = :userId', { userId: userId }); - } else { - query.andWhere('announcement."userId" IS NULL'); - } - - query.orderBy({ - 'announcement."isActive"': 'DESC', - 'announcement."displayOrder"': 'DESC', - 'announcement."createdAt"': 'DESC', + public async getReads(userId: MiUser['id']): Promise { + return this.announcementReadsRepository.findBy({ + userId: userId, }); - - const announcements = await query - .limit(limit) - .offset(offset) - .getMany(); - - const reads = new Map(); - - for (const announcement of announcements) { - reads.set(announcement, await this.announcementReadsRepository.countBy({ - announcementId: announcement.id, - })); - } - - const users = await this.usersRepository.findBy({ - id: In(announcements.map(a => a.userId).filter(id => id != null)), - }); - const packedUsers = await this.userEntityService.packMany(users, moderator, { - detail: false, - }); - - return announcements.map(announcement => ({ - ...announcement, - userInfo: packedUsers.find(u => u.id === announcement.userId) ?? null, - readCount: reads.get(announcement) ?? 0, - })); - } - - @bindThis - public async update( - announcementId: MiAnnouncement['id'], - values: Partial, - ): Promise<{ raw: MiAnnouncement; packed: Packed<'Announcement'> }> { - const oldAnnouncement = await this.announcementsRepository.findOneByOrFail({ - id: announcementId, - }); - - if (oldAnnouncement.userId && oldAnnouncement.userId !== values.userId) { - await this.announcementReadsRepository.delete({ - announcementId: announcementId, - userId: oldAnnouncement.userId, - }); - } - - const announcement = await this.announcementsRepository - .update(announcementId, { - updatedAt: new Date(), - isActive: values.isActive, - title: values.title, - text: values.text, - imageUrl: values.imageUrl !== '' ? values.imageUrl : null, - icon: values.icon, - display: values.display, - forExistingUsers: values.forExistingUsers, - needConfirmationToRead: values.needConfirmationToRead, - closeDuration: values.closeDuration, - displayOrder: values.displayOrder, - userId: values.userId, - }) - .then(() => - this.announcementsRepository.findOneByOrFail({ id: announcementId }), - ); - - const packed = await this.announcementEntityService.pack( - announcement, - announcement.userId ? { id: announcement.userId } : null, - ); - - if (announcement.isActive) { - if (announcement.userId) { - this.globalEventService.publishMainStream( - announcement.userId, - 'announcementCreated', - { - announcement: packed, - }, - ); - } else { - this.globalEventService.publishBroadcastStream( - 'announcementCreated', - { - announcement: packed, - }, - ); - } - } - - return { - raw: announcement, - packed: packed, - }; - } - - @bindThis - public async delete(announcementId: MiAnnouncement['id']): Promise { - await this.announcementReadsRepository.delete({ - announcementId: announcementId, - }); - await this.announcementsRepository.delete({ id: announcementId }); } @bindThis @@ -268,93 +109,225 @@ export class AnnouncementService { } @bindThis - public async getUnreadAnnouncements(me: MiUser): Promise[]> { - const query = this.announcementsRepository.createQueryBuilder('announcement'); - query.leftJoinAndSelect( - MiAnnouncementRead, - 'read', - 'read."announcementId" = announcement.id AND read."userId" = :userId', - { userId: me.id }, - ); - query.andWhere('read.id IS NULL'); - query.andWhere('announcement."isActive" = true'); + public async getUnreadAnnouncements(user: MiUser): Promise { + const readsQuery = this.announcementReadsRepository.createQueryBuilder('read') + .select('read.announcementId') + .where('read.userId = :userId', { userId: user.id }); - query - .andWhere( - new Brackets((qb) => { - qb.orWhere('announcement."userId" = :userId', { userId: me.id }); - qb.orWhere('announcement."userId" IS NULL'); - }), - ) - .andWhere( - new Brackets((qb) => { - qb.orWhere('announcement."forExistingUsers" = false'); - qb.orWhere('announcement."createdAt" > :createdAt', { - createdAt: me.createdAt, - }); - }), - ); + const q = this.announcementsRepository.createQueryBuilder('announcement') + .where('announcement.isActive = true') + .andWhere(new Brackets(qb => { + qb.orWhere('announcement.userId = :userId', { userId: user.id }); + qb.orWhere('announcement.userId IS NULL'); + })) + .andWhere(new Brackets(qb => { + qb.orWhere('announcement.forExistingUsers = false'); + qb.orWhere('announcement.createdAt > :createdAt', { createdAt: user.createdAt }); + })) + .andWhere(`announcement.id NOT IN (${ readsQuery.getQuery() })`); - query.orderBy({ + q.setParameters(readsQuery.getParameters()); + q.orderBy({ + 'announcement."isActive"': 'DESC', 'announcement."displayOrder"': 'DESC', 'announcement."createdAt"': 'DESC', }); - return this.announcementEntityService.packMany( - await query.getMany(), - me, - ); + return q.getMany(); } @bindThis - public async countUnreadAnnouncements(me: MiUser): Promise { + public async create(values: Partial, moderator?: MiUser): Promise<{ raw: MiAnnouncement; packed: Packed<'Announcement'> }> { + const announcement = await this.announcementsRepository.insert({ + id: this.idService.genId(), + createdAt: new Date(), + updatedAt: null, + title: values.title, + text: values.text, + imageUrl: values.imageUrl, + icon: values.icon, + display: values.display, + forExistingUsers: values.forExistingUsers, + needConfirmationToRead: values.needConfirmationToRead, + closeDuration: values.closeDuration, + displayOrder: values.displayOrder, + userId: values.userId, + }).then(x => this.announcementsRepository.findOneByOrFail(x.identifiers[0])); + + const packed = (await this.packMany([announcement]))[0]; + + if (values.userId) { + this.globalEventService.publishMainStream(values.userId, 'announcementCreated', { + announcement: packed, + }); + + if (moderator) { + this.moderationLogService.log(moderator, 'createUserAnnouncement', { + announcementId: announcement.id, + announcement: announcement, + userId: values.userId, + }); + } + } else { + this.globalEventService.publishBroadcastStream('announcementCreated', { + announcement: packed, + }); + + if (moderator) { + this.moderationLogService.log(moderator, 'createGlobalAnnouncement', { + announcementId: announcement.id, + announcement: announcement, + }); + } + } + + return { + raw: announcement, + packed: packed, + }; + } + + @bindThis + public async list( + userId: MiUser['id'] | null, + limit: number, + offset: number, + moderator: MiUser, + ): Promise<(MiAnnouncement & { userInfo: Packed<'UserLite'> | null, readCount: number })[]> { const query = this.announcementsRepository.createQueryBuilder('announcement'); - query.leftJoinAndSelect( - MiAnnouncementRead, - 'read', - 'read."announcementId" = announcement.id AND read."userId" = :userId', - { userId: me.id }, - ); - query.andWhere('read.id IS NULL'); - query.andWhere('announcement."isActive" = true'); + if (userId) { + query.andWhere('announcement."userId" = :userId', { userId: userId }); + } else { + query.andWhere('announcement."userId" IS NULL'); + } - query - .andWhere( - new Brackets((qb) => { - qb.orWhere('announcement."userId" = :userId', { userId: me.id }); - qb.orWhere('announcement."userId" IS NULL'); - }), - ) - .andWhere( - new Brackets((qb) => { - qb.orWhere('announcement."forExistingUsers" = false'); - qb.orWhere('announcement."createdAt" > :createdAt', { - createdAt: me.createdAt, - }); - }), - ); + query.orderBy({ + 'announcement."isActive"': 'DESC', + 'announcement."displayOrder"': 'DESC', + 'announcement."createdAt"': 'DESC', + }); - return query.getCount(); + const announcements = await query + .limit(limit) + .offset(offset) + .getMany(); + + const reads = new Map(); + + for (const announcement of announcements) { + reads.set(announcement, await this.announcementReadsRepository.countBy({ + announcementId: announcement.id, + })); + } + + const users = await this.usersRepository.findBy({ + id: In(announcements.map(a => a.userId).filter(id => id != null)), + }); + const packedUsers = await this.userEntityService.packMany(users, moderator, { + detail: false, + }); + + return announcements.map(announcement => ({ + ...announcement, + userInfo: packedUsers.find(u => u.id === announcement.userId) ?? null, + readCount: reads.get(announcement) ?? 0, + })); } @bindThis - public async markAsRead( - me: MiUser, - announcementId: MiAnnouncement['id'], - ): Promise { + public async update(announcement: MiAnnouncement, values: Partial, moderator?: MiUser): Promise { + await this.announcementsRepository.update(announcement.id, { + updatedAt: new Date(), + title: values.title, + text: values.text, + /* eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- 空の文字列の場合、nullを渡すようにするため */ + imageUrl: values.imageUrl || null, + display: values.display, + icon: values.icon, + forExistingUsers: values.forExistingUsers, + needConfirmationToRead: values.needConfirmationToRead, + closeDuration: values.closeDuration, + displayOrder: values.displayOrder, + isActive: values.isActive, + }); + + const after = await this.announcementsRepository.findOneByOrFail({ id: announcement.id }); + + if (moderator) { + if (announcement.userId) { + this.moderationLogService.log(moderator, 'updateUserAnnouncement', { + announcementId: announcement.id, + before: announcement, + after: after, + }); + } else { + this.moderationLogService.log(moderator, 'updateGlobalAnnouncement', { + announcementId: announcement.id, + before: announcement, + after: after, + }); + } + } + } + + @bindThis + public async delete(announcement: MiAnnouncement, moderator?: MiUser): Promise { + await this.announcementsRepository.delete(announcement.id); + + if (moderator) { + if (announcement.userId) { + this.moderationLogService.log(moderator, 'deleteUserAnnouncement', { + announcementId: announcement.id, + announcement: announcement, + }); + } else { + this.moderationLogService.log(moderator, 'deleteGlobalAnnouncement', { + announcementId: announcement.id, + announcement: announcement, + }); + } + } + } + + @bindThis + public async read(user: MiUser, announcementId: MiAnnouncement['id']): Promise { try { await this.announcementReadsRepository.insert({ id: this.idService.genId(), createdAt: new Date(), announcementId: announcementId, - userId: me.id, + userId: user.id, }); } catch (e) { return; } - if ((await this.countUnreadAnnouncements(me)) === 0) { - this.globalEventService.publishMainStream(me.id, 'readAllAnnouncements'); + if ((await this.getUnreadAnnouncements(user)).length === 0) { + this.globalEventService.publishMainStream(user.id, 'readAllAnnouncements'); } } + + @bindThis + public async packMany( + announcements: MiAnnouncement[], + me?: { id: MiUser['id'] } | null | undefined, + options?: { + reads?: MiAnnouncementRead[]; + }, + ): Promise[]> { + const reads = me ? (options?.reads ?? await this.getReads(me.id)) : []; + return announcements.map(announcement => ({ + id: announcement.id, + createdAt: announcement.createdAt.toISOString(), + updatedAt: announcement.updatedAt?.toISOString() ?? null, + text: announcement.text, + title: announcement.title, + imageUrl: announcement.imageUrl, + icon: announcement.icon, + display: announcement.display, + needConfirmationToRead: announcement.needConfirmationToRead, + forYou: announcement.userId === me?.id, + isRead: reads.some(read => read.announcementId === announcement.id), + })); + } } diff --git a/packages/backend/src/core/AntennaService.ts b/packages/backend/src/core/AntennaService.ts index 769ab97694..841ce4b84a 100644 --- a/packages/backend/src/core/AntennaService.ts +++ b/packages/backend/src/core/AntennaService.ts @@ -5,19 +5,14 @@ import { Inject, Injectable } from '@nestjs/common'; import * as Redis from 'ioredis'; -import type { MiAntenna } from '@/models/entities/Antenna.js'; -import type { MiNote } from '@/models/entities/Note.js'; -import type { MiUser } from '@/models/entities/User.js'; -import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; -import { AntennaEntityService } from '@/core/entities/AntennaEntityService.js'; -import { IdService } from '@/core/IdService.js'; -import { isUserRelated } from '@/misc/is-user-related.js'; +import type { MiAntenna } from '@/models/Antenna.js'; +import type { MiNote } from '@/models/Note.js'; +import type { MiUser } from '@/models/User.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; -import { PushNotificationService } from '@/core/PushNotificationService.js'; import * as Acct from '@/misc/acct.js'; import type { Packed } from '@/misc/json-schema.js'; import { DI } from '@/di-symbols.js'; -import type { MutingsRepository, NotesRepository, AntennasRepository, UserListJoiningsRepository } from '@/models/index.js'; +import type { AntennasRepository, UserListJoiningsRepository } from '@/models/_.js'; import { UtilityService } from '@/core/UtilityService.js'; import { bindThis } from '@/decorators.js'; import { StreamMessages } from '@/server/api/stream/types.js'; @@ -35,12 +30,6 @@ export class AntennaService implements OnApplicationShutdown { @Inject(DI.redisForSub) private redisForSub: Redis.Redis, - @Inject(DI.mutingsRepository) - private mutingsRepository: MutingsRepository, - - @Inject(DI.notesRepository) - private notesRepository: NotesRepository, - @Inject(DI.antennasRepository) private antennasRepository: AntennasRepository, @@ -48,11 +37,7 @@ export class AntennaService implements OnApplicationShutdown { private userListJoiningsRepository: UserListJoiningsRepository, private utilityService: UtilityService, - private idService: IdService, private globalEventService: GlobalEventService, - private pushNotificationService: PushNotificationService, - private noteEntityService: NoteEntityService, - private antennaEntityService: AntennaEntityService, ) { this.antennasFetched = false; this.antennas = []; @@ -134,6 +119,12 @@ export class AntennaService implements OnApplicationShutdown { return this.utilityService.getFullApAccount(username, host).toLowerCase(); }); if (!accts.includes(this.utilityService.getFullApAccount(noteUser.username, noteUser.host).toLowerCase())) return false; + } else if (antenna.src === 'users_blacklist') { + const accts = antenna.users.map(x => { + const { username, host } = Acct.parse(x); + return this.utilityService.getFullApAccount(username, host).toLowerCase(); + }); + if (accts.includes(this.utilityService.getFullApAccount(noteUser.username, noteUser.host).toLowerCase())) return false; } const keywords = antenna.keywords diff --git a/packages/backend/src/core/CacheService.ts b/packages/backend/src/core/CacheService.ts index 15be5f398c..6ca684d53c 100644 --- a/packages/backend/src/core/CacheService.ts +++ b/packages/backend/src/core/CacheService.ts @@ -5,9 +5,9 @@ import { Inject, Injectable } from '@nestjs/common'; import * as Redis from 'ioredis'; -import type { BlockingsRepository, ChannelFollowingsRepository, FollowingsRepository, MutingsRepository, RenoteMutingsRepository, MiUserProfile, UserProfilesRepository, UsersRepository } from '@/models/index.js'; +import type { BlockingsRepository, ChannelFollowingsRepository, FollowingsRepository, MutingsRepository, RenoteMutingsRepository, MiUserProfile, UserProfilesRepository, UsersRepository } from '@/models/_.js'; import { MemoryKVCache, RedisKVCache } from '@/misc/cache.js'; -import type { MiLocalUser, MiUser } from '@/models/entities/User.js'; +import type { MiLocalUser, MiUser } from '@/models/User.js'; import { DI } from '@/di-symbols.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; diff --git a/packages/backend/src/core/ClipService.ts b/packages/backend/src/core/ClipService.ts new file mode 100644 index 0000000000..3d9982e80f --- /dev/null +++ b/packages/backend/src/core/ClipService.ts @@ -0,0 +1,159 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { Inject, Injectable } from '@nestjs/common'; +import { QueryFailedError } from 'typeorm'; +import { DI } from '@/di-symbols.js'; +import type { ClipsRepository, MiNote, MiClip, ClipNotesRepository, NotesRepository } from '@/models/_.js'; +import { bindThis } from '@/decorators.js'; +import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; +import { RoleService } from '@/core/RoleService.js'; +import { IdService } from '@/core/IdService.js'; +import type { MiLocalUser } from '@/models/User.js'; + +@Injectable() +export class ClipService { + public static NoSuchNoteError = class extends Error {}; + public static NoSuchClipError = class extends Error {}; + public static AlreadyAddedError = class extends Error {}; + public static TooManyClipNotesError = class extends Error {}; + public static TooManyClipsError = class extends Error {}; + + constructor( + @Inject(DI.clipsRepository) + private clipsRepository: ClipsRepository, + + @Inject(DI.clipNotesRepository) + private clipNotesRepository: ClipNotesRepository, + + @Inject(DI.notesRepository) + private notesRepository: NotesRepository, + + private roleService: RoleService, + private idService: IdService, + ) { + } + + @bindThis + public async create(me: MiLocalUser, name: string, isPublic: boolean, description: string | null): Promise { + const currentCount = await this.clipsRepository.countBy({ + userId: me.id, + }); + if (currentCount > (await this.roleService.getUserPolicies(me.id)).clipLimit) { + throw new ClipService.TooManyClipsError(); + } + + const clip = await this.clipsRepository.insert({ + id: this.idService.genId(), + createdAt: new Date(), + userId: me.id, + name: name, + isPublic: isPublic, + description: description, + }).then(x => this.clipsRepository.findOneByOrFail(x.identifiers[0])); + + return clip; + } + + @bindThis + public async update(me: MiLocalUser, clipId: MiClip['id'], name: string | undefined, isPublic: boolean | undefined, description: string | null | undefined): Promise { + const clip = await this.clipsRepository.findOneBy({ + id: clipId, + userId: me.id, + }); + + if (clip == null) { + throw new ClipService.NoSuchClipError(); + } + + await this.clipsRepository.update(clip.id, { + name: name, + description: description, + isPublic: isPublic, + }); + } + + @bindThis + public async delete(me: MiLocalUser, clipId: MiClip['id']): Promise { + const clip = await this.clipsRepository.findOneBy({ + id: clipId, + userId: me.id, + }); + + if (clip == null) { + throw new ClipService.NoSuchClipError(); + } + + await this.clipsRepository.delete(clip.id); + } + + @bindThis + public async addNote(me: MiLocalUser, clipId: MiClip['id'], noteId: MiNote['id']): Promise { + const clip = await this.clipsRepository.findOneBy({ + id: clipId, + userId: me.id, + }); + + if (clip == null) { + throw new ClipService.NoSuchClipError(); + } + + const currentCount = await this.clipNotesRepository.countBy({ + clipId: clip.id, + }); + if (currentCount > (await this.roleService.getUserPolicies(me.id)).noteEachClipsLimit) { + throw new ClipService.TooManyClipNotesError(); + } + + try { + await this.clipNotesRepository.insert({ + id: this.idService.genId(), + noteId: noteId, + clipId: clip.id, + }); + } catch (e: unknown) { + if (e instanceof QueryFailedError) { + if (isDuplicateKeyValueError(e)) { + throw new ClipService.AlreadyAddedError(); + } else if (e.driverError.detail.includes('is not present in table "note".')) { + throw new ClipService.NoSuchNoteError(); + } + } + + throw e; + } + + this.clipsRepository.update(clip.id, { + lastClippedAt: new Date(), + }); + + this.notesRepository.increment({ id: noteId }, 'clippedCount', 1); + } + + @bindThis + public async removeNote(me: MiLocalUser, clipId: MiClip['id'], noteId: MiNote['id']): Promise { + const clip = await this.clipsRepository.findOneBy({ + id: clipId, + userId: me.id, + }); + + if (clip == null) { + throw new ClipService.NoSuchClipError(); + } + + const note = await this.notesRepository.findOneBy({ id: noteId }); + + if (note == null) { + throw new ClipService.NoSuchNoteError(); + } + + await this.clipNotesRepository.delete({ + noteId: noteId, + clipId: clip.id, + }); + + this.notesRepository.decrement({ id: noteId }, 'clippedCount', 1); + } +} diff --git a/packages/backend/src/core/CoreModule.ts b/packages/backend/src/core/CoreModule.ts index baf31ddb35..c5b07f478a 100644 --- a/packages/backend/src/core/CoreModule.ts +++ b/packages/backend/src/core/CoreModule.ts @@ -43,6 +43,7 @@ import { RelayService } from './RelayService.js'; import { RoleService } from './RoleService.js'; import { S3Service } from './S3Service.js'; import { SignupService } from './SignupService.js'; +import { WebAuthnService } from './WebAuthnService.js'; import { UserBlockingService } from './UserBlockingService.js'; import { CacheService } from './CacheService.js'; import { UserFollowingService } from './UserFollowingService.js'; @@ -50,13 +51,14 @@ import { UserKeypairService } from './UserKeypairService.js'; import { UserListService } from './UserListService.js'; import { UserMutingService } from './UserMutingService.js'; import { UserSuspendService } from './UserSuspendService.js'; +import { UserAuthService } from './UserAuthService.js'; import { VideoProcessingService } from './VideoProcessingService.js'; -import { WebAuthnService } from './WebAuthnService.js'; import { WebhookService } from './WebhookService.js'; import { ProxyAccountService } from './ProxyAccountService.js'; import { UtilityService } from './UtilityService.js'; import { FileInfoService } from './FileInfoService.js'; import { SearchService } from './SearchService.js'; +import { ClipService } from './ClipService.js'; import { ChartLoggerService } from './chart/ChartLoggerService.js'; import FederationChart from './chart/charts/federation.js'; import NotesChart from './chart/charts/notes.js'; @@ -169,6 +171,7 @@ const $RelayService: Provider = { provide: 'RelayService', useExisting: RelaySer const $RoleService: Provider = { provide: 'RoleService', useExisting: RoleService }; const $S3Service: Provider = { provide: 'S3Service', useExisting: S3Service }; const $SignupService: Provider = { provide: 'SignupService', useExisting: SignupService }; +const $WebAuthnService: Provider = { provide: 'WebAuthnService', useExisting: WebAuthnService }; const $UserBlockingService: Provider = { provide: 'UserBlockingService', useExisting: UserBlockingService }; const $CacheService: Provider = { provide: 'CacheService', useExisting: CacheService }; const $UserFollowingService: Provider = { provide: 'UserFollowingService', useExisting: UserFollowingService }; @@ -176,12 +179,13 @@ const $UserKeypairService: Provider = { provide: 'UserKeypairService', useExisti const $UserListService: Provider = { provide: 'UserListService', useExisting: UserListService }; const $UserMutingService: Provider = { provide: 'UserMutingService', useExisting: UserMutingService }; const $UserSuspendService: Provider = { provide: 'UserSuspendService', useExisting: UserSuspendService }; +const $UserAuthService: Provider = { provide: 'UserAuthService', useExisting: UserAuthService }; const $VideoProcessingService: Provider = { provide: 'VideoProcessingService', useExisting: VideoProcessingService }; -const $WebAuthnService: Provider = { provide: 'WebAuthnService', useExisting: WebAuthnService }; const $WebhookService: Provider = { provide: 'WebhookService', useExisting: WebhookService }; const $UtilityService: Provider = { provide: 'UtilityService', useExisting: UtilityService }; const $FileInfoService: Provider = { provide: 'FileInfoService', useExisting: FileInfoService }; const $SearchService: Provider = { provide: 'SearchService', useExisting: SearchService }; +const $ClipService: Provider = { provide: 'ClipService', useExisting: ClipService }; const $ChartLoggerService: Provider = { provide: 'ChartLoggerService', useExisting: ChartLoggerService }; const $FederationChart: Provider = { provide: 'FederationChart', useExisting: FederationChart }; @@ -298,6 +302,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting RoleService, S3Service, SignupService, + WebAuthnService, UserBlockingService, CacheService, UserFollowingService, @@ -305,12 +310,13 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting UserListService, UserMutingService, UserSuspendService, + UserAuthService, VideoProcessingService, - WebAuthnService, WebhookService, UtilityService, FileInfoService, SearchService, + ClipService, ChartLoggerService, FederationChart, NotesChart, @@ -420,6 +426,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $RoleService, $S3Service, $SignupService, + $WebAuthnService, $UserBlockingService, $CacheService, $UserFollowingService, @@ -427,12 +434,13 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $UserListService, $UserMutingService, $UserSuspendService, + $UserAuthService, $VideoProcessingService, - $WebAuthnService, $WebhookService, $UtilityService, $FileInfoService, $SearchService, + $ClipService, $ChartLoggerService, $FederationChart, $NotesChart, @@ -543,6 +551,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting RoleService, S3Service, SignupService, + WebAuthnService, UserBlockingService, CacheService, UserFollowingService, @@ -550,12 +559,13 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting UserListService, UserMutingService, UserSuspendService, + UserAuthService, VideoProcessingService, - WebAuthnService, WebhookService, UtilityService, FileInfoService, SearchService, + ClipService, FederationChart, NotesChart, UsersChart, @@ -664,6 +674,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $RoleService, $S3Service, $SignupService, + $WebAuthnService, $UserBlockingService, $CacheService, $UserFollowingService, @@ -671,12 +682,13 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $UserListService, $UserMutingService, $UserSuspendService, + $UserAuthService, $VideoProcessingService, - $WebAuthnService, $WebhookService, $UtilityService, $FileInfoService, $SearchService, + $ClipService, $FederationChart, $NotesChart, $UsersChart, diff --git a/packages/backend/src/core/CreateSystemUserService.ts b/packages/backend/src/core/CreateSystemUserService.ts index 71c53735c1..10400402d6 100644 --- a/packages/backend/src/core/CreateSystemUserService.ts +++ b/packages/backend/src/core/CreateSystemUserService.ts @@ -8,11 +8,11 @@ import { Inject, Injectable } from '@nestjs/common'; import bcrypt from 'bcryptjs'; import { IsNull, DataSource } from 'typeorm'; import { genRsaKeyPair } from '@/misc/gen-key-pair.js'; -import { MiUser } from '@/models/entities/User.js'; -import { MiUserProfile } from '@/models/entities/UserProfile.js'; +import { MiUser } from '@/models/User.js'; +import { MiUserProfile } from '@/models/UserProfile.js'; import { IdService } from '@/core/IdService.js'; -import { MiUserKeypair } from '@/models/entities/UserKeypair.js'; -import { MiUsedUsername } from '@/models/entities/UsedUsername.js'; +import { MiUserKeypair } from '@/models/UserKeypair.js'; +import { MiUsedUsername } from '@/models/UsedUsername.js'; import { DI } from '@/di-symbols.js'; import generateNativeUserToken from '@/misc/generate-native-user-token.js'; import { bindThis } from '@/decorators.js'; diff --git a/packages/backend/src/core/CustomEmojiService.ts b/packages/backend/src/core/CustomEmojiService.ts index b3b08d7fac..92d40d2293 100644 --- a/packages/backend/src/core/CustomEmojiService.ts +++ b/packages/backend/src/core/CustomEmojiService.ts @@ -4,21 +4,21 @@ */ import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; -import { DataSource, In, IsNull } from 'typeorm'; +import { In, IsNull } from 'typeorm'; import * as Redis from 'ioredis'; import { DI } from '@/di-symbols.js'; import { IdService } from '@/core/IdService.js'; import { EmojiEntityService } from '@/core/entities/EmojiEntityService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; -import type { MiEmoji } from '@/models/entities/Emoji.js'; -import type { EmojisRepository, MiRole } from '@/models/index.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; +import type { MiEmoji } from '@/models/Emoji.js'; +import type { EmojisRepository, MiRole, MiUser } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; import { MemoryKVCache, RedisSingleCache } from '@/misc/cache.js'; import { UtilityService } from '@/core/UtilityService.js'; -import type { Config } from '@/config.js'; import { query } from '@/misc/prelude/url.js'; import type { Serialized } from '@/server/api/stream/types.js'; +import { ModerationLogService } from '@/core/ModerationLogService.js'; const parseEmojiStrRegexp = /^(\w+)(?:@([\w.-]+))?$/; @@ -31,18 +31,13 @@ export class CustomEmojiService implements OnApplicationShutdown { @Inject(DI.redis) private redisClient: Redis.Redis, - @Inject(DI.config) - private config: Config, - - @Inject(DI.db) - private db: DataSource, - @Inject(DI.emojisRepository) private emojisRepository: EmojisRepository, private utilityService: UtilityService, private idService: IdService, private emojiEntityService: EmojiEntityService, + private moderationLogService: ModerationLogService, private globalEventService: GlobalEventService, ) { this.cache = new MemoryKVCache(1000 * 60 * 60 * 12); @@ -74,7 +69,7 @@ export class CustomEmojiService implements OnApplicationShutdown { localOnly: boolean; roleIdsThatCanBeUsedThisEmojiAsReaction: MiRole['id'][]; roleIdsThatCanNotBeUsedThisEmojiAsReaction: MiRole['id'][]; - }): Promise { + }, moderator?: MiUser): Promise { const emoji = await this.emojisRepository.insert({ id: this.idService.genId(), updatedAt: new Date(), @@ -98,6 +93,13 @@ export class CustomEmojiService implements OnApplicationShutdown { this.globalEventService.publishBroadcastStream('emojiAdded', { emoji: await this.emojiEntityService.packDetailed(emoji.id), }); + + if (moderator) { + this.moderationLogService.log(moderator, 'addCustomEmoji', { + emojiId: emoji.id, + emoji: emoji, + }); + } } return emoji; @@ -114,7 +116,7 @@ export class CustomEmojiService implements OnApplicationShutdown { localOnly?: boolean; roleIdsThatCanBeUsedThisEmojiAsReaction?: MiRole['id'][]; roleIdsThatCanNotBeUsedThisEmojiAsReaction?: MiRole['id'][]; - }): Promise { + }, moderator?: MiUser): Promise { const emoji = await this.emojisRepository.findOneByOrFail({ id: id }); const sameNameEmoji = await this.emojisRepository.findOneBy({ name: data.name, host: IsNull() }); if (sameNameEmoji != null && sameNameEmoji.id !== id) throw new Error('name already exists'); @@ -151,6 +153,14 @@ export class CustomEmojiService implements OnApplicationShutdown { emoji: updated, }); } + + if (moderator) { + this.moderationLogService.log(moderator, 'updateCustomEmoji', { + emojiId: emoji.id, + before: emoji, + after: updated, + }); + } } @bindThis @@ -242,7 +252,7 @@ export class CustomEmojiService implements OnApplicationShutdown { } @bindThis - public async delete(id: MiEmoji['id']) { + public async delete(id: MiEmoji['id'], moderator?: MiUser) { const emoji = await this.emojisRepository.findOneByOrFail({ id: id }); await this.emojisRepository.delete(emoji.id); @@ -252,16 +262,30 @@ export class CustomEmojiService implements OnApplicationShutdown { this.globalEventService.publishBroadcastStream('emojiDeleted', { emojis: [await this.emojiEntityService.packDetailed(emoji)], }); + + if (moderator) { + this.moderationLogService.log(moderator, 'deleteCustomEmoji', { + emojiId: emoji.id, + emoji: emoji, + }); + } } @bindThis - public async deleteBulk(ids: MiEmoji['id'][]) { + public async deleteBulk(ids: MiEmoji['id'][], moderator?: MiUser) { const emojis = await this.emojisRepository.findBy({ id: In(ids), }); for (const emoji of emojis) { await this.emojisRepository.delete(emoji.id); + + if (moderator) { + this.moderationLogService.log(moderator, 'deleteCustomEmoji', { + emojiId: emoji.id, + emoji: emoji, + }); + } } this.localEmojisCache.refresh(); diff --git a/packages/backend/src/core/DeleteAccountService.ts b/packages/backend/src/core/DeleteAccountService.ts index 9ba260109f..570bd440e4 100644 --- a/packages/backend/src/core/DeleteAccountService.ts +++ b/packages/backend/src/core/DeleteAccountService.ts @@ -4,10 +4,9 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import { QueueService } from '@/core/QueueService.js'; import { UserSuspendService } from '@/core/UserSuspendService.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; @@ -19,7 +18,6 @@ export class DeleteAccountService { private userSuspendService: UserSuspendService, private queueService: QueueService, - private globalEventService: GlobalEventService, ) { } diff --git a/packages/backend/src/core/DriveService.ts b/packages/backend/src/core/DriveService.ts index fbf45fc950..7e90d9e1d3 100644 --- a/packages/backend/src/core/DriveService.ts +++ b/packages/backend/src/core/DriveService.ts @@ -11,12 +11,12 @@ import { sharpBmp } from 'sharp-read-bmp'; import { IsNull } from 'typeorm'; import { DeleteObjectCommandInput, PutObjectCommandInput, NoSuchKey } from '@aws-sdk/client-s3'; import { DI } from '@/di-symbols.js'; -import type { DriveFilesRepository, UsersRepository, DriveFoldersRepository, UserProfilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository, UsersRepository, DriveFoldersRepository, UserProfilesRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; import Logger from '@/logger.js'; -import type { MiRemoteUser, MiUser } from '@/models/entities/User.js'; +import type { MiRemoteUser, MiUser } from '@/models/User.js'; import { MetaService } from '@/core/MetaService.js'; -import { MiDriveFile } from '@/models/entities/DriveFile.js'; +import { MiDriveFile } from '@/models/DriveFile.js'; import { IdService } from '@/core/IdService.js'; import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; import { FILE_TYPE_BROWSERSAFE } from '@/const.js'; @@ -27,7 +27,7 @@ import { VideoProcessingService } from '@/core/VideoProcessingService.js'; import { ImageProcessingService } from '@/core/ImageProcessingService.js'; import type { IImage } from '@/core/ImageProcessingService.js'; import { QueueService } from '@/core/QueueService.js'; -import type { MiDriveFolder } from '@/models/entities/DriveFolder.js'; +import type { MiDriveFolder } from '@/models/DriveFolder.js'; import { createTemp } from '@/misc/create-temp.js'; import DriveChart from '@/core/chart/charts/drive.js'; import PerUserDriveChart from '@/core/chart/charts/per-user-drive.js'; @@ -42,6 +42,7 @@ import { bindThis } from '@/decorators.js'; import { RoleService } from '@/core/RoleService.js'; import { correctFilename } from '@/misc/correct-filename.js'; import { isMimeImage } from '@/misc/is-mime-image.js'; +import { ModerationLogService } from '@/core/ModerationLogService.js'; type AddFileArgs = { /** User who wish to add file */ @@ -86,6 +87,9 @@ type UploadFromUrlArgs = { @Injectable() export class DriveService { + public static NoSuchFolderError = class extends Error {}; + public static InvalidFileNameError = class extends Error {}; + public static CannotUnmarkSensitiveError = class extends Error {}; private registerLogger: Logger; private downloaderLogger: Logger; private deleteLogger: Logger; @@ -119,6 +123,7 @@ export class DriveService { private globalEventService: GlobalEventService, private queueService: QueueService, private roleService: RoleService, + private moderationLogService: ModerationLogService, private driveChart: DriveChart, private perUserDriveChart: PerUserDriveChart, private instanceChart: InstanceChart, @@ -332,7 +337,7 @@ export class DriveService { this.registerLogger.debug('web image not created (not an required image)'); } } catch (err) { - this.registerLogger.warn('web image not created (an error occured)', err as Error); + this.registerLogger.warn('web image not created (an error occurred)', err as Error); } } else { if (satisfyWebpublic) this.registerLogger.info('web image not created (original satisfies webpublic)'); @@ -351,7 +356,7 @@ export class DriveService { thumbnail = await this.imageProcessingService.convertSharpToWebp(img, 498, 422); } } catch (err) { - this.registerLogger.warn('thumbnail not created (an error occured)', err as Error); + this.registerLogger.warn('thumbnail not created (an error occurred)', err as Error); } // #endregion thumbnail @@ -574,9 +579,7 @@ export class DriveService { file.maybePorn = info.porn; file.isSensitive = user ? this.userEntityService.isLocalUser(user) && profile!.alwaysMarkNsfw ? true : - (sensitive !== null && sensitive !== undefined) - ? sensitive - : false + sensitive ?? false : false; if (info.sensitive && profile!.autoSensitive) file.isSensitive = true; @@ -650,7 +653,58 @@ export class DriveService { } @bindThis - public async deleteFile(file: MiDriveFile, isExpired = false) { + public async updateFile(file: MiDriveFile, values: Partial, updater: MiUser) { + const alwaysMarkNsfw = (await this.roleService.getUserPolicies(file.userId)).alwaysMarkNsfw; + + if (values.name && !this.driveFileEntityService.validateFileName(file.name)) { + throw new DriveService.InvalidFileNameError(); + } + + if (values.isSensitive !== undefined && values.isSensitive !== file.isSensitive && alwaysMarkNsfw && !values.isSensitive) { + throw new DriveService.CannotUnmarkSensitiveError(); + } + + if (values.folderId != null) { + const folder = await this.driveFoldersRepository.findOneBy({ + id: values.folderId, + userId: file.userId!, + }); + + if (folder == null) { + throw new DriveService.NoSuchFolderError(); + } + } + + await this.driveFilesRepository.update(file.id, values); + + const fileObj = await this.driveFileEntityService.pack(file.id, { self: true }); + + // Publish fileUpdated event + if (file.userId) { + this.globalEventService.publishDriveStream(file.userId, 'fileUpdated', fileObj); + } + + if (await this.roleService.isModerator(updater) && (file.userId !== updater.id)) { + if (values.isSensitive !== undefined && values.isSensitive !== file.isSensitive) { + if (values.isSensitive) { + this.moderationLogService.log(updater, 'markSensitiveDriveFile', { + fileId: file.id, + fileUserId: file.userId, + }); + } else { + this.moderationLogService.log(updater, 'unmarkSensitiveDriveFile', { + fileId: file.id, + fileUserId: file.userId, + }); + } + } + } + + return fileObj; + } + + @bindThis + public async deleteFile(file: MiDriveFile, isExpired = false, deleter?: MiUser) { if (file.storedInternal) { this.internalStorageService.del(file.accessKey!); @@ -673,11 +727,11 @@ export class DriveService { } } - this.deletePostProcess(file, isExpired); + this.deletePostProcess(file, isExpired, deleter); } @bindThis - public async deleteFileSync(file: MiDriveFile, isExpired = false) { + public async deleteFileSync(file: MiDriveFile, isExpired = false, deleter?: MiUser) { if (file.storedInternal) { this.internalStorageService.del(file.accessKey!); @@ -704,11 +758,11 @@ export class DriveService { await Promise.all(promises); } - this.deletePostProcess(file, isExpired); + this.deletePostProcess(file, isExpired, deleter); } @bindThis - private async deletePostProcess(file: MiDriveFile, isExpired = false) { + private async deletePostProcess(file: MiDriveFile, isExpired = false, deleter?: MiUser) { // リモートファイル期限切れ削除後は直リンクにする if (isExpired && file.userHost !== null && file.uri != null) { this.driveFilesRepository.update(file.id, { @@ -735,6 +789,17 @@ export class DriveService { this.instanceChart.updateDrive(file, false); } } + + if (file.userId) { + this.globalEventService.publishDriveStream(file.userId, 'fileDeleted', file.id); + } + + if (deleter && await this.roleService.isModerator(deleter) && (file.userId !== deleter.id)) { + this.moderationLogService.log(deleter, 'deleteDriveFile', { + fileId: file.id, + fileUserId: file.userId, + }); + } } @bindThis diff --git a/packages/backend/src/core/EmailService.ts b/packages/backend/src/core/EmailService.ts index 162634593e..c9da3f77c0 100644 --- a/packages/backend/src/core/EmailService.ts +++ b/packages/backend/src/core/EmailService.ts @@ -10,7 +10,7 @@ import { MetaService } from '@/core/MetaService.js'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import type Logger from '@/logger.js'; -import type { UserProfilesRepository } from '@/models/index.js'; +import type { UserProfilesRepository } from '@/models/_.js'; import { LoggerService } from '@/core/LoggerService.js'; import { bindThis } from '@/decorators.js'; diff --git a/packages/backend/src/core/FederatedInstanceService.ts b/packages/backend/src/core/FederatedInstanceService.ts index e7b85b750b..61806583c6 100644 --- a/packages/backend/src/core/FederatedInstanceService.ts +++ b/packages/backend/src/core/FederatedInstanceService.ts @@ -5,8 +5,8 @@ import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; import * as Redis from 'ioredis'; -import type { InstancesRepository } from '@/models/index.js'; -import type { MiInstance } from '@/models/entities/Instance.js'; +import type { InstancesRepository } from '@/models/_.js'; +import type { MiInstance } from '@/models/Instance.js'; import { MemoryKVCache, RedisKVCache } from '@/misc/cache.js'; import { IdService } from '@/core/IdService.js'; import { DI } from '@/di-symbols.js'; diff --git a/packages/backend/src/core/FetchInstanceMetadataService.ts b/packages/backend/src/core/FetchInstanceMetadataService.ts index 8495719e8a..682acef15b 100644 --- a/packages/backend/src/core/FetchInstanceMetadataService.ts +++ b/packages/backend/src/core/FetchInstanceMetadataService.ts @@ -8,7 +8,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { JSDOM } from 'jsdom'; import tinycolor from 'tinycolor2'; import * as Redis from 'ioredis'; -import type { MiInstance } from '@/models/entities/Instance.js'; +import type { MiInstance } from '@/models/Instance.js'; import type Logger from '@/logger.js'; import { DI } from '@/di-symbols.js'; import { LoggerService } from '@/core/LoggerService.js'; @@ -108,7 +108,7 @@ export class FetchInstanceMetadataService { if (name) updates.name = name; if (description) updates.description = description; - if (icon || favicon) updates.iconUrl = (icon && !icon.includes('data:image/png;base64')) ? icon : favicon; + if (icon ?? favicon) updates.iconUrl = (icon && !icon.includes('data:image/png;base64')) ? icon : favicon; if (favicon) updates.faviconUrl = favicon; if (themeColor) updates.themeColor = themeColor; @@ -142,10 +142,10 @@ export class FetchInstanceMetadataService { const links = wellknown.links as any[]; - const lnik1_0 = links.find(link => link.rel === 'http://nodeinfo.diaspora.software/ns/schema/1.0'); - const lnik2_0 = links.find(link => link.rel === 'http://nodeinfo.diaspora.software/ns/schema/2.0'); - const lnik2_1 = links.find(link => link.rel === 'http://nodeinfo.diaspora.software/ns/schema/2.1'); - const link = lnik2_1 ?? lnik2_0 ?? lnik1_0; + const link1_0 = links.find(link => link.rel === 'http://nodeinfo.diaspora.software/ns/schema/1.0'); + const link2_0 = links.find(link => link.rel === 'http://nodeinfo.diaspora.software/ns/schema/2.0'); + const link2_1 = links.find(link => link.rel === 'http://nodeinfo.diaspora.software/ns/schema/2.1'); + const link = link2_1 ?? link2_0 ?? link1_0; if (link == null) { throw new Error('No nodeinfo link provided'); diff --git a/packages/backend/src/core/GlobalEventService.ts b/packages/backend/src/core/GlobalEventService.ts index 224eb3c599..4bc4f54c21 100644 --- a/packages/backend/src/core/GlobalEventService.ts +++ b/packages/backend/src/core/GlobalEventService.ts @@ -5,10 +5,10 @@ import { Inject, Injectable } from '@nestjs/common'; import * as Redis from 'ioredis'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiNote } from '@/models/entities/Note.js'; -import type { MiUserList } from '@/models/entities/UserList.js'; -import type { MiAntenna } from '@/models/entities/Antenna.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiNote } from '@/models/Note.js'; +import type { MiUserList } from '@/models/UserList.js'; +import type { MiAntenna } from '@/models/Antenna.js'; import type { StreamChannels, AdminStreamTypes, @@ -25,7 +25,7 @@ import type { Packed } from '@/misc/json-schema.js'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import { bindThis } from '@/decorators.js'; -import { MiRole } from '@/models/index.js'; +import { MiRole } from '@/models/_.js'; @Injectable() export class GlobalEventService { diff --git a/packages/backend/src/core/HashtagService.ts b/packages/backend/src/core/HashtagService.ts index 24130b2ab7..c72c7460ff 100644 --- a/packages/backend/src/core/HashtagService.ts +++ b/packages/backend/src/core/HashtagService.ts @@ -5,20 +5,17 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import { normalizeForSearch } from '@/misc/normalize-for-search.js'; import { IdService } from '@/core/IdService.js'; -import type { MiHashtag } from '@/models/entities/Hashtag.js'; -import type { HashtagsRepository, UsersRepository } from '@/models/index.js'; +import type { MiHashtag } from '@/models/Hashtag.js'; +import type { HashtagsRepository } from '@/models/_.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; @Injectable() export class HashtagService { constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.hashtagsRepository) private hashtagsRepository: HashtagsRepository, diff --git a/packages/backend/src/core/HttpRequestService.ts b/packages/backend/src/core/HttpRequestService.ts index 47878ed694..73bb3dc7e9 100644 --- a/packages/backend/src/core/HttpRequestService.ts +++ b/packages/backend/src/core/HttpRequestService.ts @@ -53,12 +53,14 @@ export class HttpRequestService { keepAlive: true, keepAliveMsecs: 30 * 1000, lookup: cache.lookup as unknown as net.LookupFunction, + localAddress: config.outgoingAddress, }); this.https = new https.Agent({ keepAlive: true, keepAliveMsecs: 30 * 1000, lookup: cache.lookup as unknown as net.LookupFunction, + localAddress: config.outgoingAddress, }); const maxSockets = Math.max(256, config.deliverJobConcurrency ?? 128); @@ -71,6 +73,7 @@ export class HttpRequestService { maxFreeSockets: 256, scheduling: 'lifo', proxy: config.proxy, + localAddress: config.outgoingAddress, }) : this.http; @@ -82,6 +85,7 @@ export class HttpRequestService { maxFreeSockets: 256, scheduling: 'lifo', proxy: config.proxy, + localAddress: config.outgoingAddress, }) : this.https; } @@ -93,7 +97,7 @@ export class HttpRequestService { */ @bindThis public getAgentByUrl(url: URL, bypassProxy = false): http.Agent | https.Agent { - if (bypassProxy || (this.config.proxyBypassHosts || []).includes(url.hostname)) { + if (bypassProxy || (this.config.proxyBypassHosts ?? []).includes(url.hostname)) { return url.protocol === 'http:' ? this.http : this.https; } else { return url.protocol === 'http:' ? this.httpAgent : this.httpsAgent; diff --git a/packages/backend/src/core/IdService.ts b/packages/backend/src/core/IdService.ts index 186fd36b42..06c58ad8a1 100644 --- a/packages/backend/src/core/IdService.ts +++ b/packages/backend/src/core/IdService.ts @@ -8,6 +8,7 @@ import { ulid } from 'ulid'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import { genAid, parseAid } from '@/misc/id/aid.js'; +import { genAidx, parseAidx } from '@/misc/id/aidx.js'; import { genMeid, parseMeid } from '@/misc/id/meid.js'; import { genMeidg, parseMeidg } from '@/misc/id/meidg.js'; import { genObjectId, parseObjectId } from '@/misc/id/object-id.js'; @@ -31,6 +32,7 @@ export class IdService { switch (this.method) { case 'aid': return genAid(date); + case 'aidx': return genAidx(date); case 'meid': return genMeid(date); case 'meidg': return genMeidg(date); case 'ulid': return ulid(date.getTime()); @@ -43,6 +45,7 @@ export class IdService { public parse(id: string): { date: Date; } { switch (this.method) { case 'aid': return parseAid(id); + case 'aidx': return parseAidx(id); case 'objectid': return parseObjectId(id); case 'meid': return parseMeid(id); case 'meidg': return parseMeidg(id); diff --git a/packages/backend/src/core/ImageProcessingService.ts b/packages/backend/src/core/ImageProcessingService.ts index bbed29b7d0..8e800eb8f5 100644 --- a/packages/backend/src/core/ImageProcessingService.ts +++ b/packages/backend/src/core/ImageProcessingService.ts @@ -3,10 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import sharp from 'sharp'; -import { DI } from '@/di-symbols.js'; -import type { Config } from '@/config.js'; export type IImage = { data: Buffer; @@ -50,8 +48,6 @@ import { Readable } from 'node:stream'; @Injectable() export class ImageProcessingService { constructor( - @Inject(DI.config) - private config: Config, ) { } diff --git a/packages/backend/src/core/InstanceActorService.ts b/packages/backend/src/core/InstanceActorService.ts index 8e576774d4..b40fd46291 100644 --- a/packages/backend/src/core/InstanceActorService.ts +++ b/packages/backend/src/core/InstanceActorService.ts @@ -5,8 +5,8 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull } from 'typeorm'; -import type { MiLocalUser } from '@/models/entities/User.js'; -import type { UsersRepository } from '@/models/index.js'; +import type { MiLocalUser } from '@/models/User.js'; +import type { UsersRepository } from '@/models/_.js'; import { MemorySingleCache } from '@/misc/cache.js'; import { DI } from '@/di-symbols.js'; import { CreateSystemUserService } from '@/core/CreateSystemUserService.js'; diff --git a/packages/backend/src/core/LoggerService.ts b/packages/backend/src/core/LoggerService.ts index 6d3ed10961..46b000ee63 100644 --- a/packages/backend/src/core/LoggerService.ts +++ b/packages/backend/src/core/LoggerService.ts @@ -3,9 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; -import { DI } from '@/di-symbols.js'; -import type { Config } from '@/config.js'; +import { Injectable } from '@nestjs/common'; import Logger from '@/logger.js'; import { bindThis } from '@/decorators.js'; import type { KEYWORD } from 'color-convert/conversions.js'; @@ -13,8 +11,6 @@ import type { KEYWORD } from 'color-convert/conversions.js'; @Injectable() export class LoggerService { constructor( - @Inject(DI.config) - private config: Config, ) { } diff --git a/packages/backend/src/core/MetaService.ts b/packages/backend/src/core/MetaService.ts index f9619861bb..00e1e3c1fc 100644 --- a/packages/backend/src/core/MetaService.ts +++ b/packages/backend/src/core/MetaService.ts @@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { DataSource } from 'typeorm'; import * as Redis from 'ioredis'; import { DI } from '@/di-symbols.js'; -import { MiMeta } from '@/models/entities/Meta.js'; +import { MiMeta } from '@/models/Meta.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { bindThis } from '@/decorators.js'; import { StreamMessages } from '@/server/api/stream/types.js'; @@ -16,7 +16,7 @@ import type { OnApplicationShutdown } from '@nestjs/common'; @Injectable() export class MetaService implements OnApplicationShutdown { private cache: MiMeta | undefined; - private intervalId: NodeJS.Timer; + private intervalId: NodeJS.Timeout; constructor( @Inject(DI.redisForSub) diff --git a/packages/backend/src/core/MfmService.ts b/packages/backend/src/core/MfmService.ts index b6f84da475..b275d1b142 100644 --- a/packages/backend/src/core/MfmService.ts +++ b/packages/backend/src/core/MfmService.ts @@ -10,7 +10,7 @@ import { Window } from 'happy-dom'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import { intersperse } from '@/misc/prelude/array.js'; -import type { IMentionedRemoteUsers } from '@/models/entities/Note.js'; +import type { IMentionedRemoteUsers } from '@/models/Note.js'; import { bindThis } from '@/decorators.js'; import * as TreeAdapter from '../../node_modules/parse5/dist/tree-adapters/default.js'; import type * as mfm from 'mfm-js'; diff --git a/packages/backend/src/core/ModerationLogService.ts b/packages/backend/src/core/ModerationLogService.ts index be01fbf9fa..f7f9063d92 100644 --- a/packages/backend/src/core/ModerationLogService.ts +++ b/packages/backend/src/core/ModerationLogService.ts @@ -5,10 +5,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { ModerationLogsRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { ModerationLogsRepository } from '@/models/_.js'; +import type { MiUser } from '@/models/User.js'; import { IdService } from '@/core/IdService.js'; import { bindThis } from '@/decorators.js'; +import { ModerationLogPayloads, moderationLogTypes } from '@/types.js'; @Injectable() export class ModerationLogService { @@ -21,13 +22,13 @@ export class ModerationLogService { } @bindThis - public async insertModerationLog(moderator: { id: MiUser['id'] }, type: string, info?: Record) { + public async log(moderator: { id: MiUser['id'] }, type: T, info?: ModerationLogPayloads[T]) { await this.moderationLogsRepository.insert({ id: this.idService.genId(), createdAt: new Date(), userId: moderator.id, type: type, - info: info ?? {}, + info: (info as any) ?? {}, }); } } diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 11a52807b6..78de768d68 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -12,22 +12,22 @@ import RE2 from 're2'; import { extractMentions } from '@/misc/extract-mentions.js'; import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm.js'; import { extractHashtags } from '@/misc/extract-hashtags.js'; -import type { IMentionedRemoteUsers } from '@/models/entities/Note.js'; -import { MiNote } from '@/models/entities/Note.js'; -import type { ChannelFollowingsRepository, ChannelsRepository, InstancesRepository, MutedNotesRepository, MutingsRepository, NotesRepository, NoteThreadMutingsRepository, UserProfilesRepository, UsersRepository } from '@/models/index.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; -import type { MiApp } from '@/models/entities/App.js'; +import type { IMentionedRemoteUsers } from '@/models/Note.js'; +import { MiNote } from '@/models/Note.js'; +import type { ChannelsRepository, FollowingsRepository, InstancesRepository, MutedNotesRepository, MutingsRepository, NotesRepository, NoteThreadMutingsRepository, UserProfilesRepository, UsersRepository } from '@/models/_.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; +import type { MiApp } from '@/models/App.js'; import { concat } from '@/misc/prelude/array.js'; import { IdService } from '@/core/IdService.js'; -import type { MiUser, MiLocalUser, MiRemoteUser } from '@/models/entities/User.js'; -import type { IPoll } from '@/models/entities/Poll.js'; -import { MiPoll } from '@/models/entities/Poll.js'; +import type { MiUser, MiLocalUser, MiRemoteUser } from '@/models/User.js'; +import type { IPoll } from '@/models/Poll.js'; +import { MiPoll } from '@/models/Poll.js'; import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; import { checkWordMute } from '@/misc/check-word-mute.js'; -import type { MiChannel } from '@/models/entities/Channel.js'; +import type { MiChannel } from '@/models/Channel.js'; import { normalizeForSearch } from '@/misc/normalize-for-search.js'; import { MemorySingleCache } from '@/misc/cache.js'; -import type { MiUserProfile } from '@/models/entities/UserProfile.js'; +import type { MiUserProfile } from '@/models/UserProfile.js'; import { RelayService } from '@/core/RelayService.js'; import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; import { DI } from '@/di-symbols.js'; @@ -59,7 +59,7 @@ const mutedWordsCache = new MemorySingleCache<{ userId: MiUserProfile['userId']; type NotificationType = 'reply' | 'renote' | 'quote' | 'mention'; class NotificationManager { - private notifier: { id: MiUser['id'] }; + private notifier: { id: MiUser['id']; }; private note: MiNote; private queue: { target: MiLocalUser['id']; @@ -69,7 +69,7 @@ class NotificationManager { constructor( private mutingsRepository: MutingsRepository, private notificationService: NotificationService, - notifier: { id: MiUser['id'] }, + notifier: { id: MiUser['id']; }, note: MiNote, ) { this.notifier = notifier; @@ -182,12 +182,12 @@ export class NoteCreateService implements OnApplicationShutdown { @Inject(DI.channelsRepository) private channelsRepository: ChannelsRepository, - @Inject(DI.channelFollowingsRepository) - private channelFollowingsRepository: ChannelFollowingsRepository, - @Inject(DI.noteThreadMutingsRepository) private noteThreadMutingsRepository: NoteThreadMutingsRepository, + @Inject(DI.followingsRepository) + private followingsRepository: FollowingsRepository, + private userEntityService: UserEntityService, private noteEntityService: NoteEntityService, private idService: IdService, @@ -337,7 +337,7 @@ export class NoteCreateService implements OnApplicationShutdown { if (data.channel) { this.redisClient.xadd( `channelTimeline:${data.channel.id}`, - 'MAXLEN', '~', '1000', + 'MAXLEN', '~', this.config.perChannelMaxNoteCacheCount.toString(), '*', 'note', note.id); } @@ -367,7 +367,7 @@ export class NoteCreateService implements OnApplicationShutdown { name: data.name, text: data.text, hasPoll: data.poll != null, - cw: data.cw == null ? null : data.cw, + cw: data.cw ?? null, tags: tags.map(tag => normalizeForSearch(tag)), emojis, userId: user.id, @@ -402,7 +402,7 @@ export class NoteCreateService implements OnApplicationShutdown { const url = profile != null ? profile.url : null; return { uri: u.uri, - url: url == null ? undefined : url, + url: url ?? undefined, username: u.username, host: u.host, } as IMentionedRemoteUsers[0]; @@ -508,6 +508,20 @@ export class NoteCreateService implements OnApplicationShutdown { this.saveReply(data.reply, note); } + if (data.reply == null) { + this.followingsRepository.findBy({ + followeeId: user.id, + notify: 'normal', + }).then(followings => { + for (const following of followings) { + this.notificationService.createNotification(following.followerId, 'note', { + notifierId: user.id, + noteId: note.id, + }); + } + }); + } + // この投稿を除く指定したユーザーによる指定したノートのリノートが存在しないとき if (data.renote && (await this.noteEntityService.countSameRenotes(user.id, data.renote.id, note.id) === 0)) { if (!user.isBot) this.incRenoteCount(data.renote); @@ -772,7 +786,7 @@ export class NoteCreateService implements OnApplicationShutdown { } @bindThis - private incNotesCountOfUser(user: { id: MiUser['id'] }) { + private incNotesCountOfUser(user: { id: MiUser['id']; }) { this.usersRepository.createQueryBuilder().update() .set({ updatedAt: new Date(), diff --git a/packages/backend/src/core/NoteDeleteService.ts b/packages/backend/src/core/NoteDeleteService.ts index 07708bd028..c99f92b9cb 100644 --- a/packages/backend/src/core/NoteDeleteService.ts +++ b/packages/backend/src/core/NoteDeleteService.ts @@ -5,9 +5,9 @@ import { Brackets, In } from 'typeorm'; import { Injectable, Inject } from '@nestjs/common'; -import type { MiUser, MiLocalUser, MiRemoteUser } from '@/models/entities/User.js'; -import type { MiNote, IMentionedRemoteUsers } from '@/models/entities/Note.js'; -import type { InstancesRepository, NotesRepository, UsersRepository } from '@/models/index.js'; +import type { MiUser, MiLocalUser, MiRemoteUser } from '@/models/User.js'; +import type { MiNote, IMentionedRemoteUsers } from '@/models/Note.js'; +import type { InstancesRepository, NotesRepository, UsersRepository } from '@/models/_.js'; import { RelayService } from '@/core/RelayService.js'; import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; import { DI } from '@/di-symbols.js'; @@ -23,6 +23,7 @@ import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { bindThis } from '@/decorators.js'; import { MetaService } from '@/core/MetaService.js'; import { SearchService } from '@/core/SearchService.js'; +import { ModerationLogService } from '@/core/ModerationLogService.js'; @Injectable() export class NoteDeleteService { @@ -48,6 +49,7 @@ export class NoteDeleteService { private apDeliverManagerService: ApDeliverManagerService, private metaService: MetaService, private searchService: SearchService, + private moderationLogService: ModerationLogService, private notesChart: NotesChart, private perUserNotesChart: PerUserNotesChart, private instanceChart: InstanceChart, @@ -58,7 +60,7 @@ export class NoteDeleteService { * @param user 投稿者 * @param note 投稿 */ - async delete(user: { id: MiUser['id']; uri: MiUser['uri']; host: MiUser['host']; isBot: MiUser['isBot']; }, note: MiNote, quiet = false) { + async delete(user: { id: MiUser['id']; uri: MiUser['uri']; host: MiUser['host']; isBot: MiUser['isBot']; }, note: MiNote, quiet = false, deleter?: MiUser) { const deletedAt = new Date(); const cascadingNotes = await this.findCascadingNotes(note); @@ -131,6 +133,14 @@ export class NoteDeleteService { id: note.id, userId: user.id, }); + + if (deleter && (note.userId !== deleter.id)) { + this.moderationLogService.log(deleter, 'deleteNote', { + noteId: note.id, + noteUserId: note.userId, + note: note, + }); + } } @bindThis diff --git a/packages/backend/src/core/NotePiningService.ts b/packages/backend/src/core/NotePiningService.ts index 7f1381a41a..147554ee9a 100644 --- a/packages/backend/src/core/NotePiningService.ts +++ b/packages/backend/src/core/NotePiningService.ts @@ -5,12 +5,12 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { NotesRepository, UserNotePiningsRepository, UsersRepository } from '@/models/index.js'; +import type { NotesRepository, UserNotePiningsRepository, UsersRepository } from '@/models/_.js'; import { IdentifiableError } from '@/misc/identifiable-error.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiNote } from '@/models/Note.js'; import { IdService } from '@/core/IdService.js'; -import type { MiUserNotePining } from '@/models/entities/UserNotePining.js'; +import type { MiUserNotePining } from '@/models/UserNotePining.js'; import { RelayService } from '@/core/RelayService.js'; import type { Config } from '@/config.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; diff --git a/packages/backend/src/core/NoteReadService.ts b/packages/backend/src/core/NoteReadService.ts index 0197486263..422e0192cf 100644 --- a/packages/backend/src/core/NoteReadService.ts +++ b/packages/backend/src/core/NoteReadService.ts @@ -7,12 +7,12 @@ import { setTimeout } from 'node:timers/promises'; import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; import { In } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiNote } from '@/models/Note.js'; import { IdService } from '@/core/IdService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; -import type { NoteUnreadsRepository, MutingsRepository, NoteThreadMutingsRepository } from '@/models/index.js'; +import type { NoteUnreadsRepository, MutingsRepository, NoteThreadMutingsRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; @Injectable() diff --git a/packages/backend/src/core/NotificationService.ts b/packages/backend/src/core/NotificationService.ts index d9a0f9bf53..258ae44f7d 100644 --- a/packages/backend/src/core/NotificationService.ts +++ b/packages/backend/src/core/NotificationService.ts @@ -8,36 +8,32 @@ import * as Redis from 'ioredis'; import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; import { In } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { MutingsRepository, MiUserProfile, UserProfilesRepository, UsersRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiNotification } from '@/models/entities/Notification.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; +import type { UsersRepository } from '@/models/_.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiNotification } from '@/models/Notification.js'; import { bindThis } from '@/decorators.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { PushNotificationService } from '@/core/PushNotificationService.js'; import { NotificationEntityService } from '@/core/entities/NotificationEntityService.js'; import { IdService } from '@/core/IdService.js'; import { CacheService } from '@/core/CacheService.js'; +import type { Config } from '@/config.js'; @Injectable() export class NotificationService implements OnApplicationShutdown { #shutdownController = new AbortController(); constructor( + @Inject(DI.config) + private config: Config, + @Inject(DI.redis) private redisClient: Redis.Redis, @Inject(DI.usersRepository) private usersRepository: UsersRepository, - @Inject(DI.userProfilesRepository) - private userProfilesRepository: UserProfilesRepository, - - @Inject(DI.mutingsRepository) - private mutingsRepository: MutingsRepository, - private notificationEntityService: NotificationEntityService, - private userEntityService: UserEntityService, private idService: IdService, private globalEventService: GlobalEventService, private pushNotificationService: PushNotificationService, @@ -104,7 +100,7 @@ export class NotificationService implements OnApplicationShutdown { const redisIdPromise = this.redisClient.xadd( `notificationTimeline:${notifieeId}`, - 'MAXLEN', '~', '300', + 'MAXLEN', '~', this.config.perUserNotificationsMaxCount.toString(), '*', 'data', JSON.stringify(notification)); diff --git a/packages/backend/src/core/PollService.ts b/packages/backend/src/core/PollService.ts index 551c779769..940aa98347 100644 --- a/packages/backend/src/core/PollService.ts +++ b/packages/backend/src/core/PollService.ts @@ -5,8 +5,8 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { NotesRepository, UsersRepository, PollsRepository, PollVotesRepository, MiUser } from '@/models/index.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { NotesRepository, UsersRepository, PollsRepository, PollVotesRepository, MiUser } from '@/models/_.js'; +import type { MiNote } from '@/models/Note.js'; import { RelayService } from '@/core/RelayService.js'; import { IdService } from '@/core/IdService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; diff --git a/packages/backend/src/core/ProxyAccountService.ts b/packages/backend/src/core/ProxyAccountService.ts index 9fb0a45df9..b1bc60701b 100644 --- a/packages/backend/src/core/ProxyAccountService.ts +++ b/packages/backend/src/core/ProxyAccountService.ts @@ -4,8 +4,8 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository } from '@/models/index.js'; -import type { MiLocalUser } from '@/models/entities/User.js'; +import type { UsersRepository } from '@/models/_.js'; +import type { MiLocalUser } from '@/models/User.js'; import { DI } from '@/di-symbols.js'; import { MetaService } from '@/core/MetaService.js'; import { bindThis } from '@/decorators.js'; diff --git a/packages/backend/src/core/PushNotificationService.ts b/packages/backend/src/core/PushNotificationService.ts index 93928e3cd7..40d1deceeb 100644 --- a/packages/backend/src/core/PushNotificationService.ts +++ b/packages/backend/src/core/PushNotificationService.ts @@ -10,7 +10,7 @@ import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import type { Packed } from '@/misc/json-schema.js'; import { getNoteSummary } from '@/misc/get-note-summary.js'; -import type { MiSwSubscription, SwSubscriptionsRepository } from '@/models/index.js'; +import type { MiSwSubscription, SwSubscriptionsRepository } from '@/models/_.js'; import { MetaService } from '@/core/MetaService.js'; import { bindThis } from '@/decorators.js'; import { RedisKVCache } from '@/misc/cache.js'; diff --git a/packages/backend/src/core/QueryService.ts b/packages/backend/src/core/QueryService.ts index 191a06b353..9145726f86 100644 --- a/packages/backend/src/core/QueryService.ts +++ b/packages/backend/src/core/QueryService.ts @@ -6,8 +6,8 @@ import { Inject, Injectable } from '@nestjs/common'; import { Brackets, ObjectLiteral } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { UserProfilesRepository, FollowingsRepository, ChannelFollowingsRepository, MutedNotesRepository, BlockingsRepository, NoteThreadMutingsRepository, MutingsRepository, RenoteMutingsRepository } from '@/models/index.js'; +import type { MiUser } from '@/models/User.js'; +import type { UserProfilesRepository, FollowingsRepository, ChannelFollowingsRepository, MutedNotesRepository, BlockingsRepository, NoteThreadMutingsRepository, MutingsRepository, RenoteMutingsRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; import type { SelectQueryBuilder } from 'typeorm'; @@ -109,7 +109,7 @@ export class QueryService { } @bindThis - public generateChannelQuery(q: SelectQueryBuilder, me: { id: MiUser['id'] } | null): void { + public generateChannelQuery(q: SelectQueryBuilder, me?: { id: MiUser['id'] } | null): void { if (me == null) { q.andWhere('note.channelId IS NULL'); } else { @@ -213,7 +213,7 @@ export class QueryService { } @bindThis - public generateRepliesQuery(q: SelectQueryBuilder, withReplies: boolean, me: Pick | null): void { + public generateRepliesQuery(q: SelectQueryBuilder, withReplies: boolean, me?: Pick | null): void { if (me == null) { q.andWhere(new Brackets(qb => { qb .where('note.replyId IS NULL') // 返信ではない @@ -239,7 +239,7 @@ export class QueryService { } @bindThis - public generateVisibilityQuery(q: SelectQueryBuilder, me: { id: MiUser['id'] } | null): void { + public generateVisibilityQuery(q: SelectQueryBuilder, me?: { id: MiUser['id'] } | null): void { // This code must always be synchronized with the checks in Notes.isVisibleForMe. if (me == null) { q.andWhere(new Brackets(qb => { qb diff --git a/packages/backend/src/core/QueueService.ts b/packages/backend/src/core/QueueService.ts index 930ba0f94a..61691a6131 100644 --- a/packages/backend/src/core/QueueService.ts +++ b/packages/backend/src/core/QueueService.ts @@ -6,9 +6,9 @@ import { randomUUID } from 'node:crypto'; import { Inject, Injectable } from '@nestjs/common'; import type { IActivity } from '@/core/activitypub/type.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; -import type { MiAbuseUserReport } from '@/models/entities/AbuseUserReport.js'; -import type { MiWebhook, webhookEventTypes } from '@/models/entities/Webhook.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; +import type { MiAbuseUserReport } from '@/models/AbuseUserReport.js'; +import type { MiWebhook, webhookEventTypes } from '@/models/Webhook.js'; import type { Config } from '@/config.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; diff --git a/packages/backend/src/core/ReactionService.ts b/packages/backend/src/core/ReactionService.ts index ad87f4b421..e4512175a1 100644 --- a/packages/backend/src/core/ReactionService.ts +++ b/packages/backend/src/core/ReactionService.ts @@ -5,12 +5,12 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { EmojisRepository, NoteReactionsRepository, UsersRepository, NotesRepository } from '@/models/index.js'; +import type { EmojisRepository, NoteReactionsRepository, UsersRepository, NotesRepository } from '@/models/_.js'; import { IdentifiableError } from '@/misc/identifiable-error.js'; -import type { MiRemoteUser, MiUser } from '@/models/entities/User.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiRemoteUser, MiUser } from '@/models/User.js'; +import type { MiNote } from '@/models/Note.js'; import { IdService } from '@/core/IdService.js'; -import type { MiNoteReaction } from '@/models/entities/NoteReaction.js'; +import type { MiNoteReaction } from '@/models/NoteReaction.js'; import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { NotificationService } from '@/core/NotificationService.js'; diff --git a/packages/backend/src/core/RelayService.ts b/packages/backend/src/core/RelayService.ts index 89f245e86d..7171bf84c5 100644 --- a/packages/backend/src/core/RelayService.ts +++ b/packages/backend/src/core/RelayService.ts @@ -5,11 +5,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull } from 'typeorm'; -import type { MiLocalUser, MiUser } from '@/models/entities/User.js'; -import type { RelaysRepository, UsersRepository } from '@/models/index.js'; +import type { MiLocalUser, MiUser } from '@/models/User.js'; +import type { RelaysRepository, UsersRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { MemorySingleCache } from '@/misc/cache.js'; -import type { MiRelay } from '@/models/entities/Relay.js'; +import type { MiRelay } from '@/models/Relay.js'; import { QueueService } from '@/core/QueueService.js'; import { CreateSystemUserService } from '@/core/CreateSystemUserService.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; diff --git a/packages/backend/src/core/RemoteUserResolveService.ts b/packages/backend/src/core/RemoteUserResolveService.ts index ca538ed6cd..75c5f14aa4 100644 --- a/packages/backend/src/core/RemoteUserResolveService.ts +++ b/packages/backend/src/core/RemoteUserResolveService.ts @@ -8,8 +8,8 @@ import { Inject, Injectable } from '@nestjs/common'; import chalk from 'chalk'; import { IsNull } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { UsersRepository } from '@/models/index.js'; -import type { MiLocalUser, MiRemoteUser } from '@/models/entities/User.js'; +import type { UsersRepository } from '@/models/_.js'; +import type { MiLocalUser, MiRemoteUser } from '@/models/User.js'; import type { Config } from '@/config.js'; import type Logger from '@/logger.js'; import { UtilityService } from '@/core/UtilityService.js'; diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts index 0fc6883922..73de249637 100644 --- a/packages/backend/src/core/RoleService.ts +++ b/packages/backend/src/core/RoleService.ts @@ -6,18 +6,19 @@ import { Inject, Injectable } from '@nestjs/common'; import * as Redis from 'ioredis'; import { In } from 'typeorm'; -import type { MiRole, MiRoleAssignment, RoleAssignmentsRepository, RolesRepository, UsersRepository } from '@/models/index.js'; +import type { MiRole, MiRoleAssignment, RoleAssignmentsRepository, RolesRepository, UsersRepository } from '@/models/_.js'; import { MemoryKVCache, MemorySingleCache } from '@/misc/cache.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; import { MetaService } from '@/core/MetaService.js'; import { CacheService } from '@/core/CacheService.js'; -import type { RoleCondFormulaValue } from '@/models/entities/Role.js'; +import type { RoleCondFormulaValue } from '@/models/Role.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { StreamMessages } from '@/server/api/stream/types.js'; import { IdService } from '@/core/IdService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; +import { ModerationLogService } from '@/core/ModerationLogService.js'; import type { Packed } from '@/misc/json-schema.js'; import type { OnApplicationShutdown } from '@nestjs/common'; @@ -104,6 +105,7 @@ export class RoleService implements OnApplicationShutdown { private userEntityService: UserEntityService, private globalEventService: GlobalEventService, private idService: IdService, + private moderationLogService: ModerationLogService, ) { //this.onMessage = this.onMessage.bind(this); @@ -383,9 +385,11 @@ export class RoleService implements OnApplicationShutdown { } @bindThis - public async assign(userId: MiUser['id'], roleId: MiRole['id'], expiresAt: Date | null = null): Promise { + public async assign(userId: MiUser['id'], roleId: MiRole['id'], expiresAt: Date | null = null, moderator?: MiUser): Promise { const now = new Date(); + const role = await this.rolesRepository.findOneByOrFail({ id: roleId }); + const existing = await this.roleAssignmentsRepository.findOneBy({ roleId: roleId, userId: userId, @@ -415,10 +419,19 @@ export class RoleService implements OnApplicationShutdown { }); this.globalEventService.publishInternalEvent('userRoleAssigned', created); + + if (moderator) { + this.moderationLogService.log(moderator, 'assignRole', { + roleId: roleId, + roleName: role.name, + userId: userId, + expiresAt: expiresAt ? expiresAt.toISOString() : null, + }); + } } @bindThis - public async unassign(userId: MiUser['id'], roleId: MiRole['id']): Promise { + public async unassign(userId: MiUser['id'], roleId: MiRole['id'], moderator?: MiUser): Promise { const now = new Date(); const existing = await this.roleAssignmentsRepository.findOneBy({ roleId, userId }); @@ -439,6 +452,15 @@ export class RoleService implements OnApplicationShutdown { }); this.globalEventService.publishInternalEvent('userRoleUnassigned', existing); + + if (moderator) { + const role = await this.rolesRepository.findOneByOrFail({ id: roleId }); + this.moderationLogService.log(moderator, 'unassignRole', { + roleId: roleId, + roleName: role.name, + userId: userId, + }); + } } @bindThis @@ -460,6 +482,39 @@ export class RoleService implements OnApplicationShutdown { redisPipeline.exec(); } + @bindThis + public async update(role: MiRole, params: Partial, moderator?: MiUser): Promise { + const date = new Date(); + await this.rolesRepository.update(role.id, { + updatedAt: date, + ...params, + }); + + const updated = await this.rolesRepository.findOneByOrFail({ id: role.id }); + this.globalEventService.publishInternalEvent('roleUpdated', updated); + + if (moderator) { + this.moderationLogService.log(moderator, 'updateRole', { + roleId: role.id, + before: role, + after: updated, + }); + } + } + + @bindThis + public async delete(role: MiRole, moderator?: MiUser): Promise { + await this.rolesRepository.delete({ id: role.id }); + this.globalEventService.publishInternalEvent('roleDeleted', role); + + if (moderator) { + this.moderationLogService.log(moderator, 'deleteRole', { + roleId: role.id, + role: role, + }); + } + } + @bindThis public dispose(): void { this.redisForSub.off('message', this.onMessage); diff --git a/packages/backend/src/core/S3Service.ts b/packages/backend/src/core/S3Service.ts index 9f54e885a2..df0991539d 100644 --- a/packages/backend/src/core/S3Service.ts +++ b/packages/backend/src/core/S3Service.ts @@ -6,13 +6,11 @@ import { URL } from 'node:url'; import * as http from 'node:http'; import * as https from 'node:https'; -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { DeleteObjectCommand, S3Client } from '@aws-sdk/client-s3'; import { Upload } from '@aws-sdk/lib-storage'; -import { NodeHttpHandler, NodeHttpHandlerOptions } from '@aws-sdk/node-http-handler'; -import { DI } from '@/di-symbols.js'; -import type { Config } from '@/config.js'; -import type { MiMeta } from '@/models/entities/Meta.js'; +import { NodeHttpHandler, NodeHttpHandlerOptions } from '@smithy/node-http-handler'; +import type { MiMeta } from '@/models/Meta.js'; import { HttpRequestService } from '@/core/HttpRequestService.js'; import { bindThis } from '@/decorators.js'; import type { DeleteObjectCommandInput, PutObjectCommandInput } from '@aws-sdk/client-s3'; @@ -20,9 +18,6 @@ import type { DeleteObjectCommandInput, PutObjectCommandInput } from '@aws-sdk/c @Injectable() export class S3Service { constructor( - @Inject(DI.config) - private config: Config, - private httpRequestService: HttpRequestService, ) { } diff --git a/packages/backend/src/core/SearchService.ts b/packages/backend/src/core/SearchService.ts index 73d8ec8ffb..64f762c3d5 100644 --- a/packages/backend/src/core/SearchService.ts +++ b/packages/backend/src/core/SearchService.ts @@ -8,9 +8,9 @@ import { In } from 'typeorm'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import { bindThis } from '@/decorators.js'; -import { MiNote } from '@/models/entities/Note.js'; -import { MiUser } from '@/models/index.js'; -import type { NotesRepository } from '@/models/index.js'; +import { MiNote } from '@/models/Note.js'; +import { MiUser } from '@/models/_.js'; +import type { NotesRepository } from '@/models/_.js'; import { sqlLikeEscape } from '@/misc/sql-like-escape.js'; import { QueryService } from '@/core/QueryService.js'; import { IdService } from '@/core/IdService.js'; @@ -25,6 +25,8 @@ type Q = { op: '<', k: K, v: number } | { op: '>=', k: K, v: number } | { op: '<=', k: K, v: number } | + { op: 'is null', k: K} | + { op: 'is not null', k: K} | { op: 'and', qs: Q[] } | { op: 'or', qs: Q[] } | { op: 'not', q: Q }; @@ -50,6 +52,8 @@ function compileQuery(q: Q): string { case '<=': return `(${q.k} <= ${compileValue(q.v)})`; case 'and': return q.qs.length === 0 ? '' : `(${ q.qs.map(_q => compileQuery(_q)).join(' AND ') })`; case 'or': return q.qs.length === 0 ? '' : `(${ q.qs.map(_q => compileQuery(_q)).join(' OR ') })`; + case 'is null': return `(${q.k} IS NULL)`; + case 'is not null': return `(${q.k} IS NOT NULL)`; case 'not': return `(NOT ${compileQuery(q.q)})`; default: throw new Error('unrecognized query operator'); } @@ -170,7 +174,7 @@ export class SearchService { if (opts.channelId) filter.qs.push({ op: '=', k: 'channelId', v: opts.channelId }); if (opts.host) { if (opts.host === '.') { - // TODO: Meilisearchが2023/05/07現在値がNULLかどうかのクエリが書けない + filter.qs.push({ op: 'is null', k: 'userHost' }); } else { filter.qs.push({ op: '=', k: 'userHost', v: opts.host }); } @@ -204,6 +208,14 @@ export class SearchService { .leftJoinAndSelect('reply.user', 'replyUser') .leftJoinAndSelect('renote.user', 'renoteUser'); + if (opts.host) { + if (opts.host === '.') { + query.andWhere('user.host IS NULL'); + } else { + query.andWhere('user.host = :host', { host: opts.host }); + } + } + this.queryService.generateVisibilityQuery(query, me); if (me) this.queryService.generateMutedUserQuery(query, me); if (me) this.queryService.generateBlockedUserQuery(query, me); diff --git a/packages/backend/src/core/SignupService.ts b/packages/backend/src/core/SignupService.ts index d9c436744e..aa37933003 100644 --- a/packages/backend/src/core/SignupService.ts +++ b/packages/backend/src/core/SignupService.ts @@ -8,13 +8,12 @@ import { Inject, Injectable } from '@nestjs/common'; import bcrypt from 'bcryptjs'; import { DataSource, IsNull } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { UsedUsernamesRepository, UsersRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; -import { MiUser } from '@/models/entities/User.js'; -import { MiUserProfile } from '@/models/entities/UserProfile.js'; +import type { UsedUsernamesRepository, UsersRepository } from '@/models/_.js'; +import { MiUser } from '@/models/User.js'; +import { MiUserProfile } from '@/models/UserProfile.js'; import { IdService } from '@/core/IdService.js'; -import { MiUserKeypair } from '@/models/entities/UserKeypair.js'; -import { MiUsedUsername } from '@/models/entities/UsedUsername.js'; +import { MiUserKeypair } from '@/models/UserKeypair.js'; +import { MiUsedUsername } from '@/models/UsedUsername.js'; import generateUserToken from '@/misc/generate-native-user-token.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; @@ -28,9 +27,6 @@ export class SignupService { @Inject(DI.db) private db: DataSource, - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/core/UserAuthService.ts b/packages/backend/src/core/UserAuthService.ts new file mode 100644 index 0000000000..ccf4dfc6bd --- /dev/null +++ b/packages/backend/src/core/UserAuthService.ts @@ -0,0 +1,45 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { Inject, Injectable } from '@nestjs/common'; +import { QueryFailedError } from 'typeorm'; +import * as OTPAuth from 'otpauth'; +import { DI } from '@/di-symbols.js'; +import type { MiUserProfile, UserProfilesRepository, UsersRepository } from '@/models/_.js'; +import { bindThis } from '@/decorators.js'; +import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; +import type { MiLocalUser } from '@/models/User.js'; + +@Injectable() +export class UserAuthService { + constructor( + @Inject(DI.usersRepository) + private usersRepository: UsersRepository, + + @Inject(DI.userProfilesRepository) + private userProfilesRepository: UserProfilesRepository, + ) { + } + + @bindThis + public async twoFactorAuthenticate(profile: MiUserProfile, token: string): Promise { + if (profile.twoFactorBackupSecret?.includes(token)) { + await this.userProfilesRepository.update({ userId: profile.userId }, { + twoFactorBackupSecret: profile.twoFactorBackupSecret.filter((secret) => secret !== token), + }); + } else { + const delta = OTPAuth.TOTP.validate({ + secret: OTPAuth.Secret.fromBase32(profile.twoFactorSecret!), + digits: 6, + token, + window: 5, + }); + + if (delta === null) { + throw new Error('authentication failed'); + } + } + } +} diff --git a/packages/backend/src/core/UserBlockingService.ts b/packages/backend/src/core/UserBlockingService.ts index 44e2066a11..37031e341e 100644 --- a/packages/backend/src/core/UserBlockingService.ts +++ b/packages/backend/src/core/UserBlockingService.ts @@ -6,12 +6,12 @@ import { Inject, Injectable, OnModuleInit } from '@nestjs/common'; import { ModuleRef } from '@nestjs/core'; import { IdService } from '@/core/IdService.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiBlocking } from '@/models/entities/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiBlocking } from '@/models/Blocking.js'; import { QueueService } from '@/core/QueueService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; -import type { FollowRequestsRepository, BlockingsRepository, UserListsRepository, UserListJoiningsRepository } from '@/models/index.js'; +import type { FollowRequestsRepository, BlockingsRepository, UserListsRepository, UserListJoiningsRepository } from '@/models/_.js'; import Logger from '@/logger.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; diff --git a/packages/backend/src/core/UserFollowingService.ts b/packages/backend/src/core/UserFollowingService.ts index c99a3e6a11..5b2b0205d9 100644 --- a/packages/backend/src/core/UserFollowingService.ts +++ b/packages/backend/src/core/UserFollowingService.ts @@ -6,7 +6,7 @@ import { Inject, Injectable, OnModuleInit, forwardRef } from '@nestjs/common'; import { ModuleRef } from '@nestjs/core'; import { IsNull } from 'typeorm'; -import type { MiLocalUser, MiPartialLocalUser, MiPartialRemoteUser, MiRemoteUser, MiUser } from '@/models/entities/User.js'; +import type { MiLocalUser, MiPartialLocalUser, MiPartialRemoteUser, MiRemoteUser, MiUser } from '@/models/User.js'; import { IdentifiableError } from '@/misc/identifiable-error.js'; import { QueueService } from '@/core/QueueService.js'; import PerUserFollowingChart from '@/core/chart/charts/per-user-following.js'; @@ -19,7 +19,7 @@ import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; import { WebhookService } from '@/core/WebhookService.js'; import { NotificationService } from '@/core/NotificationService.js'; import { DI } from '@/di-symbols.js'; -import type { FollowingsRepository, FollowRequestsRepository, InstancesRepository, UserProfilesRepository, UsersRepository } from '@/models/index.js'; +import type { FollowingsRepository, FollowRequestsRepository, InstancesRepository, UserProfilesRepository, UsersRepository } from '@/models/_.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; import { bindThis } from '@/decorators.js'; diff --git a/packages/backend/src/core/UserKeypairService.ts b/packages/backend/src/core/UserKeypairService.ts index f321727601..425a97f3f1 100644 --- a/packages/backend/src/core/UserKeypairService.ts +++ b/packages/backend/src/core/UserKeypairService.ts @@ -5,10 +5,10 @@ import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; import * as Redis from 'ioredis'; -import type { MiUser } from '@/models/entities/User.js'; -import type { UserKeypairsRepository } from '@/models/index.js'; +import type { MiUser } from '@/models/User.js'; +import type { UserKeypairsRepository } from '@/models/_.js'; import { RedisKVCache } from '@/misc/cache.js'; -import type { MiUserKeypair } from '@/models/entities/UserKeypair.js'; +import type { MiUserKeypair } from '@/models/UserKeypair.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; diff --git a/packages/backend/src/core/UserListService.ts b/packages/backend/src/core/UserListService.ts index 7e9ec4657b..739ed05de3 100644 --- a/packages/backend/src/core/UserListService.ts +++ b/packages/backend/src/core/UserListService.ts @@ -4,12 +4,11 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserListJoiningsRepository, UsersRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiUserList } from '@/models/entities/UserList.js'; -import type { MiUserListJoining } from '@/models/entities/UserListJoining.js'; +import type { UserListJoiningsRepository } from '@/models/_.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiUserList } from '@/models/UserList.js'; +import type { MiUserListJoining } from '@/models/UserListJoining.js'; import { IdService } from '@/core/IdService.js'; -import { UserFollowingService } from '@/core/UserFollowingService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; @@ -23,15 +22,11 @@ export class UserListService { public static TooManyUsersError = class extends Error {}; constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.userListJoiningsRepository) private userListJoiningsRepository: UserListJoiningsRepository, private userEntityService: UserEntityService, private idService: IdService, - private userFollowingService: UserFollowingService, private roleService: RoleService, private globalEventService: GlobalEventService, private proxyAccountService: ProxyAccountService, diff --git a/packages/backend/src/core/UserMutingService.ts b/packages/backend/src/core/UserMutingService.ts index 1f0b2c215b..2387c9d648 100644 --- a/packages/backend/src/core/UserMutingService.ts +++ b/packages/backend/src/core/UserMutingService.ts @@ -5,9 +5,9 @@ import { Inject, Injectable } from '@nestjs/common'; import { In } from 'typeorm'; -import type { MutingsRepository, MiMuting } from '@/models/index.js'; +import type { MutingsRepository, MiMuting } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; import { CacheService } from '@/core/CacheService.js'; diff --git a/packages/backend/src/core/UserSuspendService.ts b/packages/backend/src/core/UserSuspendService.ts index 645be624c4..8940a142d1 100644 --- a/packages/backend/src/core/UserSuspendService.ts +++ b/packages/backend/src/core/UserSuspendService.ts @@ -5,12 +5,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { Not, IsNull } from 'typeorm'; -import type { FollowingsRepository, UsersRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { FollowingsRepository } from '@/models/_.js'; +import type { MiUser } from '@/models/User.js'; import { QueueService } from '@/core/QueueService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; -import type { Config } from '@/config.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; @@ -18,12 +17,6 @@ import { bindThis } from '@/decorators.js'; @Injectable() export class UserSuspendService { constructor( - @Inject(DI.config) - private config: Config, - - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.followingsRepository) private followingsRepository: FollowingsRepository, diff --git a/packages/backend/src/core/WebAuthnService.ts b/packages/backend/src/core/WebAuthnService.ts index d244f4511a..5945dc2919 100644 --- a/packages/backend/src/core/WebAuthnService.ts +++ b/packages/backend/src/core/WebAuthnService.ts @@ -12,11 +12,11 @@ import { } from '@simplewebauthn/server'; import { AttestationFormat, isoCBOR } from '@simplewebauthn/server/helpers'; import { DI } from '@/di-symbols.js'; -import type { UserSecurityKeysRepository } from '@/models/index.js'; +import type { UserSecurityKeysRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; import { bindThis } from '@/decorators.js'; import { MetaService } from '@/core/MetaService.js'; -import { MiUser } from '@/models/index.js'; +import { MiUser } from '@/models/_.js'; import { IdentifiableError } from '@/misc/identifiable-error.js'; import type { AuthenticationResponseJSON, @@ -33,8 +33,10 @@ export class WebAuthnService { constructor( @Inject(DI.redis) private redisClient: Redis.Redis, + @Inject(DI.config) private config: Config, + @Inject(DI.userSecurityKeysRepository) private userSecurityKeysRepository: UserSecurityKeysRepository, @@ -60,7 +62,7 @@ export class WebAuthnService { userId: userId, }); - const registrationOptions = generateRegistrationOptions({ + const registrationOptions = await generateRegistrationOptions({ rpName: relyingParty.rpName, rpID: relyingParty.rpId, userID: userId, @@ -150,7 +152,7 @@ export class WebAuthnService { throw new IdentifiableError('f27fd449-9af4-4841-9249-1f989b9fa4a4', 'no keys found'); } - const authenticationOptions = generateAuthenticationOptions({ + const authenticationOptions = await generateAuthenticationOptions({ allowCredentials: keys.map(key => ({ id: Buffer.from(key.id, 'base64url'), type: 'public-key', diff --git a/packages/backend/src/core/WebfingerService.ts b/packages/backend/src/core/WebfingerService.ts index e91ba29228..3d5747aebd 100644 --- a/packages/backend/src/core/WebfingerService.ts +++ b/packages/backend/src/core/WebfingerService.ts @@ -4,9 +4,7 @@ */ import { URL } from 'node:url'; -import { Inject, Injectable } from '@nestjs/common'; -import { DI } from '@/di-symbols.js'; -import type { Config } from '@/config.js'; +import { Injectable } from '@nestjs/common'; import { query as urlQuery } from '@/misc/prelude/url.js'; import { HttpRequestService } from '@/core/HttpRequestService.js'; import { bindThis } from '@/decorators.js'; @@ -27,9 +25,6 @@ const mRegex = /^([^@]+)@(.*)/; @Injectable() export class WebfingerService { constructor( - @Inject(DI.config) - private config: Config, - private httpRequestService: HttpRequestService, ) { } diff --git a/packages/backend/src/core/WebhookService.ts b/packages/backend/src/core/WebhookService.ts index 3b43c1224c..1344f0ac97 100644 --- a/packages/backend/src/core/WebhookService.ts +++ b/packages/backend/src/core/WebhookService.ts @@ -5,8 +5,8 @@ import { Inject, Injectable } from '@nestjs/common'; import * as Redis from 'ioredis'; -import type { WebhooksRepository } from '@/models/index.js'; -import type { MiWebhook } from '@/models/entities/Webhook.js'; +import type { WebhooksRepository } from '@/models/_.js'; +import type { MiWebhook } from '@/models/Webhook.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; import { StreamMessages } from '@/server/api/stream/types.js'; diff --git a/packages/backend/src/core/activitypub/ApAudienceService.ts b/packages/backend/src/core/activitypub/ApAudienceService.ts index f3432f8334..440852bdf3 100644 --- a/packages/backend/src/core/activitypub/ApAudienceService.ts +++ b/packages/backend/src/core/activitypub/ApAudienceService.ts @@ -5,7 +5,7 @@ import { Injectable } from '@nestjs/common'; import promiseLimit from 'promise-limit'; -import type { MiRemoteUser, MiUser } from '@/models/entities/User.js'; +import type { MiRemoteUser, MiUser } from '@/models/User.js'; import { concat, unique } from '@/misc/prelude/array.js'; import { bindThis } from '@/decorators.js'; import { getApIds } from './type.js'; diff --git a/packages/backend/src/core/activitypub/ApDbResolverService.ts b/packages/backend/src/core/activitypub/ApDbResolverService.ts index b691588320..995c5dcd5f 100644 --- a/packages/backend/src/core/activitypub/ApDbResolverService.ts +++ b/packages/backend/src/core/activitypub/ApDbResolverService.ts @@ -5,14 +5,14 @@ import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { NotesRepository, UserPublickeysRepository, UsersRepository } from '@/models/index.js'; +import type { NotesRepository, UserPublickeysRepository, UsersRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; import { MemoryKVCache } from '@/misc/cache.js'; -import type { MiUserPublickey } from '@/models/entities/UserPublickey.js'; +import type { MiUserPublickey } from '@/models/UserPublickey.js'; import { CacheService } from '@/core/CacheService.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiNote } from '@/models/Note.js'; import { bindThis } from '@/decorators.js'; -import { MiLocalUser, MiRemoteUser } from '@/models/entities/User.js'; +import { MiLocalUser, MiRemoteUser } from '@/models/User.js'; import { getApId } from './type.js'; import { ApPersonService } from './models/ApPersonService.js'; import type { IObject } from './type.js'; diff --git a/packages/backend/src/core/activitypub/ApDeliverManagerService.ts b/packages/backend/src/core/activitypub/ApDeliverManagerService.ts index 0da164a874..81003bcf1c 100644 --- a/packages/backend/src/core/activitypub/ApDeliverManagerService.ts +++ b/packages/backend/src/core/activitypub/ApDeliverManagerService.ts @@ -6,9 +6,8 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull, Not } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { FollowingsRepository, UsersRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; -import type { MiLocalUser, MiRemoteUser, MiUser } from '@/models/entities/User.js'; +import type { FollowingsRepository } from '@/models/_.js'; +import type { MiLocalUser, MiRemoteUser, MiUser } from '@/models/User.js'; import { QueueService } from '@/core/QueueService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; @@ -152,12 +151,6 @@ class DeliverManager { @Injectable() export class ApDeliverManagerService { constructor( - @Inject(DI.config) - private config: Config, - - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.followingsRepository) private followingsRepository: FollowingsRepository, diff --git a/packages/backend/src/core/activitypub/ApInboxService.ts b/packages/backend/src/core/activitypub/ApInboxService.ts index 76a00b8012..b2122cfe15 100644 --- a/packages/backend/src/core/activitypub/ApInboxService.ts +++ b/packages/backend/src/core/activitypub/ApInboxService.ts @@ -18,17 +18,15 @@ import { concat, toArray, toSingle, unique } from '@/misc/prelude/array.js'; import { AppLockService } from '@/core/AppLockService.js'; import type Logger from '@/logger.js'; import { MetaService } from '@/core/MetaService.js'; -import { AccountMoveService } from '@/core/AccountMoveService.js'; import { IdService } from '@/core/IdService.js'; import { StatusError } from '@/misc/status-error.js'; import { UtilityService } from '@/core/UtilityService.js'; -import { CacheService } from '@/core/CacheService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { QueueService } from '@/core/QueueService.js'; -import type { UsersRepository, NotesRepository, FollowingsRepository, AbuseUserReportsRepository, FollowRequestsRepository } from '@/models/index.js'; +import type { UsersRepository, NotesRepository, FollowingsRepository, AbuseUserReportsRepository, FollowRequestsRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; -import type { MiRemoteUser } from '@/models/entities/User.js'; +import type { MiRemoteUser } from '@/models/User.js'; import { getApHrefNullable, getApId, getApIds, getApType, isAccept, isActor, isAdd, isAnnounce, isBlock, isCollection, isCollectionOrOrderedCollection, isCreate, isDelete, isFlag, isFollow, isLike, isMove, isPost, isReject, isRemove, isTombstone, isUndo, isUpdate, validActor, validPost } from './type.js'; import { ApNoteService } from './models/ApNoteService.js'; import { ApLoggerService } from './ApLoggerService.js'; @@ -83,8 +81,6 @@ export class ApInboxService { private apNoteService: ApNoteService, private apPersonService: ApPersonService, private apQuestionService: ApQuestionService, - private accountMoveService: AccountMoveService, - private cacheService: CacheService, private queueService: QueueService, ) { this.logger = this.apLoggerService.logger; diff --git a/packages/backend/src/core/activitypub/ApMfmService.ts b/packages/backend/src/core/activitypub/ApMfmService.ts index fd83362243..60868627a2 100644 --- a/packages/backend/src/core/activitypub/ApMfmService.ts +++ b/packages/backend/src/core/activitypub/ApMfmService.ts @@ -3,12 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import * as mfm from 'mfm-js'; -import { DI } from '@/di-symbols.js'; -import type { Config } from '@/config.js'; import { MfmService } from '@/core/MfmService.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiNote } from '@/models/Note.js'; import { bindThis } from '@/decorators.js'; import { extractApHashtagObjects } from './models/tag.js'; import type { IObject } from './type.js'; @@ -16,9 +14,6 @@ import type { IObject } from './type.js'; @Injectable() export class ApMfmService { constructor( - @Inject(DI.config) - private config: Config, - private mfmService: MfmService, ) { } diff --git a/packages/backend/src/core/activitypub/ApRendererService.ts b/packages/backend/src/core/activitypub/ApRendererService.ts index 607ab293b3..7a9d2e21d8 100644 --- a/packages/backend/src/core/activitypub/ApRendererService.ts +++ b/packages/backend/src/core/activitypub/ApRendererService.ts @@ -9,21 +9,21 @@ import { In } from 'typeorm'; import * as mfm from 'mfm-js'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; -import type { MiPartialLocalUser, MiLocalUser, MiPartialRemoteUser, MiRemoteUser, MiUser } from '@/models/entities/User.js'; -import type { IMentionedRemoteUsers, MiNote } from '@/models/entities/Note.js'; -import type { MiBlocking } from '@/models/entities/Blocking.js'; -import type { MiRelay } from '@/models/entities/Relay.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; -import type { MiNoteReaction } from '@/models/entities/NoteReaction.js'; -import type { MiEmoji } from '@/models/entities/Emoji.js'; -import type { MiPoll } from '@/models/entities/Poll.js'; -import type { MiPollVote } from '@/models/entities/PollVote.js'; +import type { MiPartialLocalUser, MiLocalUser, MiPartialRemoteUser, MiRemoteUser, MiUser } from '@/models/User.js'; +import type { IMentionedRemoteUsers, MiNote } from '@/models/Note.js'; +import type { MiBlocking } from '@/models/Blocking.js'; +import type { MiRelay } from '@/models/Relay.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; +import type { MiNoteReaction } from '@/models/NoteReaction.js'; +import type { MiEmoji } from '@/models/Emoji.js'; +import type { MiPoll } from '@/models/Poll.js'; +import type { MiPollVote } from '@/models/PollVote.js'; import { UserKeypairService } from '@/core/UserKeypairService.js'; import { MfmService } from '@/core/MfmService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; -import type { MiUserKeypair } from '@/models/entities/UserKeypair.js'; -import type { UsersRepository, UserProfilesRepository, NotesRepository, DriveFilesRepository, EmojisRepository, PollsRepository } from '@/models/index.js'; +import type { MiUserKeypair } from '@/models/UserKeypair.js'; +import type { UsersRepository, UserProfilesRepository, NotesRepository, DriveFilesRepository, PollsRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js'; import { isNotNull } from '@/misc/is-not-null.js'; @@ -49,9 +49,6 @@ export class ApRendererService { @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, - @Inject(DI.emojisRepository) - private emojisRepository: EmojisRepository, - @Inject(DI.pollsRepository) private pollsRepository: PollsRepository, diff --git a/packages/backend/src/core/activitypub/ApRequestService.ts b/packages/backend/src/core/activitypub/ApRequestService.ts index fb44a55de2..b59ce5241f 100644 --- a/packages/backend/src/core/activitypub/ApRequestService.ts +++ b/packages/backend/src/core/activitypub/ApRequestService.ts @@ -8,7 +8,7 @@ import { URL } from 'node:url'; import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import { UserKeypairService } from '@/core/UserKeypairService.js'; import { HttpRequestService } from '@/core/HttpRequestService.js'; import { LoggerService } from '@/core/LoggerService.js'; diff --git a/packages/backend/src/core/activitypub/ApResolverService.ts b/packages/backend/src/core/activitypub/ApResolverService.ts index 34913fabe8..9ca63c9ec5 100644 --- a/packages/backend/src/core/activitypub/ApResolverService.ts +++ b/packages/backend/src/core/activitypub/ApResolverService.ts @@ -4,9 +4,10 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { MiLocalUser, MiRemoteUser } from '@/models/entities/User.js'; +import { IsNull, Not } from 'typeorm'; +import type { MiLocalUser, MiRemoteUser } from '@/models/User.js'; import { InstanceActorService } from '@/core/InstanceActorService.js'; -import type { NotesRepository, PollsRepository, NoteReactionsRepository, UsersRepository } from '@/models/index.js'; +import type { NotesRepository, PollsRepository, NoteReactionsRepository, UsersRepository, FollowRequestsRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; import { MetaService } from '@/core/MetaService.js'; import { HttpRequestService } from '@/core/HttpRequestService.js'; @@ -32,6 +33,7 @@ export class Resolver { private notesRepository: NotesRepository, private pollsRepository: PollsRepository, private noteReactionsRepository: NoteReactionsRepository, + private followRequestsRepository: FollowRequestsRepository, private utilityService: UtilityService, private instanceActorService: InstanceActorService, private metaService: MetaService, @@ -146,13 +148,24 @@ export class Resolver { return this.noteReactionsRepository.findOneByOrFail({ id: parsed.id }).then(async reaction => this.apRendererService.addContext(await this.apRendererService.renderLike(reaction, { uri: null }))); case 'follows': - // rest should be - if (parsed.rest == null || !/^\w+$/.test(parsed.rest)) throw new Error('resolveLocal: invalid follow URI'); - - return Promise.all( - [parsed.id, parsed.rest].map(id => this.usersRepository.findOneByOrFail({ id })), - ) - .then(([follower, followee]) => this.apRendererService.addContext(this.apRendererService.renderFollow(follower as MiLocalUser | MiRemoteUser, followee as MiLocalUser | MiRemoteUser, url))); + return this.followRequestsRepository.findOneBy({ id: parsed.id }) + .then(async followRequest => { + if (followRequest == null) throw new Error('resolveLocal: invalid follow request ID'); + const [follower, followee] = await Promise.all([ + this.usersRepository.findOneBy({ + id: followRequest.followerId, + host: IsNull(), + }), + this.usersRepository.findOneBy({ + id: followRequest.followeeId, + host: Not(IsNull()), + }), + ]); + if (follower == null || followee == null) { + throw new Error('resolveLocal: follower or followee does not exist'); + } + return this.apRendererService.addContext(this.apRendererService.renderFollow(follower as MiLocalUser | MiRemoteUser, followee as MiLocalUser | MiRemoteUser, url)); + }); default: throw new Error(`resolveLocal: type ${parsed.type} unhandled`); } @@ -177,6 +190,9 @@ export class ApResolverService { @Inject(DI.noteReactionsRepository) private noteReactionsRepository: NoteReactionsRepository, + @Inject(DI.followRequestsRepository) + private followRequestsRepository: FollowRequestsRepository, + private utilityService: UtilityService, private instanceActorService: InstanceActorService, private metaService: MetaService, @@ -196,6 +212,7 @@ export class ApResolverService { this.notesRepository, this.pollsRepository, this.noteReactionsRepository, + this.followRequestsRepository, this.utilityService, this.instanceActorService, this.metaService, diff --git a/packages/backend/src/core/activitypub/models/ApImageService.ts b/packages/backend/src/core/activitypub/models/ApImageService.ts index fa17a778bf..a4cd533892 100644 --- a/packages/backend/src/core/activitypub/models/ApImageService.ts +++ b/packages/backend/src/core/activitypub/models/ApImageService.ts @@ -5,9 +5,9 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { DriveFilesRepository } from '@/models/index.js'; -import type { MiRemoteUser } from '@/models/entities/User.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; +import type { DriveFilesRepository } from '@/models/_.js'; +import type { MiRemoteUser } from '@/models/User.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; import { MetaService } from '@/core/MetaService.js'; import { truncate } from '@/misc/truncate.js'; import { DB_MAX_IMAGE_COMMENT_LENGTH } from '@/const.js'; diff --git a/packages/backend/src/core/activitypub/models/ApMentionService.ts b/packages/backend/src/core/activitypub/models/ApMentionService.ts index 443c21cdd1..9aa8ba5ede 100644 --- a/packages/backend/src/core/activitypub/models/ApMentionService.ts +++ b/packages/backend/src/core/activitypub/models/ApMentionService.ts @@ -3,25 +3,19 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import promiseLimit from 'promise-limit'; -import { DI } from '@/di-symbols.js'; -import type { MiUser } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { MiUser } from '@/models/_.js'; import { toArray, unique } from '@/misc/prelude/array.js'; import { bindThis } from '@/decorators.js'; import { isMention } from '../type.js'; -import { ApResolverService, Resolver } from '../ApResolverService.js'; +import { Resolver } from '../ApResolverService.js'; import { ApPersonService } from './ApPersonService.js'; import type { IObject, IApMention } from '../type.js'; @Injectable() export class ApMentionService { constructor( - @Inject(DI.config) - private config: Config, - - private apResolverService: ApResolverService, private apPersonService: ApPersonService, ) { } diff --git a/packages/backend/src/core/activitypub/models/ApNoteService.ts b/packages/backend/src/core/activitypub/models/ApNoteService.ts index a5b300a1d2..573dff5b91 100644 --- a/packages/backend/src/core/activitypub/models/ApNoteService.ts +++ b/packages/backend/src/core/activitypub/models/ApNoteService.ts @@ -7,15 +7,15 @@ import { forwardRef, Inject, Injectable } from '@nestjs/common'; import promiseLimit from 'promise-limit'; import { In } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { PollsRepository, EmojisRepository } from '@/models/index.js'; +import type { PollsRepository, EmojisRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; -import type { MiRemoteUser } from '@/models/entities/User.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiRemoteUser } from '@/models/User.js'; +import type { MiNote } from '@/models/Note.js'; import { toArray, toSingle, unique } from '@/misc/prelude/array.js'; -import type { MiEmoji } from '@/models/entities/Emoji.js'; +import type { MiEmoji } from '@/models/Emoji.js'; import { MetaService } from '@/core/MetaService.js'; import { AppLockService } from '@/core/AppLockService.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; import { NoteCreateService } from '@/core/NoteCreateService.js'; import type Logger from '@/logger.js'; import { IdService } from '@/core/IdService.js'; @@ -131,13 +131,13 @@ export class ApNoteService { this.logger.debug(`Note fetched: ${JSON.stringify(note, null, 2)}`); if (note.id && !checkHttps(note.id)) { - throw new Error('unexpected shcema of note.id: ' + note.id); + throw new Error('unexpected schema of note.id: ' + note.id); } const url = getOneApHrefNullable(note.url); if (url && !checkHttps(url)) { - throw new Error('unexpected shcema of note url: ' + url); + throw new Error('unexpected schema of note url: ' + url); } this.logger.info(`Creating the Note: ${note.id}`); @@ -200,7 +200,7 @@ export class ApNoteService { // 引用 let quote: MiNote | undefined | null = null; - if (note._misskey_quote || note.quoteUrl) { + if (note._misskey_quote ?? note.quoteUrl) { const tryResolveNote = async (uri: string): Promise< | { status: 'ok'; res: MiNote } | { status: 'permerror' | 'temperror' } @@ -271,24 +271,36 @@ export class ApNoteService { const poll = await this.apQuestionService.extractPollFromQuestion(note, resolver).catch(() => undefined); - return await this.noteCreateService.create(actor, { - createdAt: note.published ? new Date(note.published) : null, - files, - reply, - renote: quote, - name: note.name, - cw, - text, - localOnly: false, - visibility, - visibleUsers, - apMentions, - apHashtags, - apEmojis, - poll, - uri: note.id, - url: url, - }, silent); + try { + return await this.noteCreateService.create(actor, { + createdAt: note.published ? new Date(note.published) : null, + files, + reply, + renote: quote, + name: note.name, + cw, + text, + localOnly: false, + visibility, + visibleUsers, + apMentions, + apHashtags, + apEmojis, + poll, + uri: note.id, + url: url, + }, silent); + } catch (err: any) { + if (err.name !== 'duplicated') { + throw err; + } + this.logger.info('The note is already inserted while creating itself, reading again'); + const duplicate = await this.fetchNote(value); + if (!duplicate) { + throw new Error('The note creation failed with duplication error even when there is no duplication'); + } + return duplicate; + } } /** diff --git a/packages/backend/src/core/activitypub/models/ApPersonService.ts b/packages/backend/src/core/activitypub/models/ApPersonService.ts index e133ce5d70..d407864b0d 100644 --- a/packages/backend/src/core/activitypub/models/ApPersonService.ts +++ b/packages/backend/src/core/activitypub/models/ApPersonService.ts @@ -8,28 +8,28 @@ import promiseLimit from 'promise-limit'; import { DataSource } from 'typeorm'; import { ModuleRef } from '@nestjs/core'; import { DI } from '@/di-symbols.js'; -import type { FollowingsRepository, InstancesRepository, UserProfilesRepository, UserPublickeysRepository, UsersRepository } from '@/models/index.js'; +import type { FollowingsRepository, InstancesRepository, UserProfilesRepository, UserPublickeysRepository, UsersRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; -import type { MiLocalUser, MiRemoteUser } from '@/models/entities/User.js'; -import { MiUser } from '@/models/entities/User.js'; +import type { MiLocalUser, MiRemoteUser } from '@/models/User.js'; +import { MiUser } from '@/models/User.js'; import { truncate } from '@/misc/truncate.js'; import type { CacheService } from '@/core/CacheService.js'; import { normalizeForSearch } from '@/misc/normalize-for-search.js'; import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; import type Logger from '@/logger.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiNote } from '@/models/Note.js'; import type { IdService } from '@/core/IdService.js'; import type { MfmService } from '@/core/MfmService.js'; import { toArray } from '@/misc/prelude/array.js'; import type { GlobalEventService } from '@/core/GlobalEventService.js'; import type { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; import type { FetchInstanceMetadataService } from '@/core/FetchInstanceMetadataService.js'; -import { MiUserProfile } from '@/models/entities/UserProfile.js'; -import { MiUserPublickey } from '@/models/entities/UserPublickey.js'; +import { MiUserProfile } from '@/models/UserProfile.js'; +import { MiUserPublickey } from '@/models/UserPublickey.js'; import type UsersChart from '@/core/chart/charts/users.js'; import type InstanceChart from '@/core/chart/charts/instance.js'; import type { HashtagService } from '@/core/HashtagService.js'; -import { MiUserNotePining } from '@/models/entities/UserNotePining.js'; +import { MiUserNotePining } from '@/models/UserNotePining.js'; import { StatusError } from '@/misc/status-error.js'; import type { UtilityService } from '@/core/UtilityService.js'; import type { UserEntityService } from '@/core/entities/UserEntityService.js'; @@ -301,7 +301,7 @@ export class ApPersonService implements OnModuleInit { const emojis = await this.apNoteService.extractEmojis(person.tag ?? [], host) .then(_emojis => _emojis.map(emoji => emoji.name)) .catch(err => { - this.logger.error('error occured while fetching user emojis', { stack: err }); + this.logger.error('error occurred while fetching user emojis', { stack: err }); return []; }); //#endregion @@ -395,7 +395,7 @@ export class ApPersonService implements OnModuleInit { // Register to the cache this.cacheService.uriPersonCache.set(user.uri, user); } catch (err) { - this.logger.error('error occured while fetching user avatar/banner', { stack: err }); + this.logger.error('error occurred while fetching user avatar/banner', { stack: err }); } //#endregion diff --git a/packages/backend/src/core/activitypub/models/ApQuestionService.ts b/packages/backend/src/core/activitypub/models/ApQuestionService.ts index 8d8c0a5811..27bd62268b 100644 --- a/packages/backend/src/core/activitypub/models/ApQuestionService.ts +++ b/packages/backend/src/core/activitypub/models/ApQuestionService.ts @@ -5,9 +5,9 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { NotesRepository, PollsRepository } from '@/models/index.js'; +import type { NotesRepository, PollsRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; -import type { IPoll } from '@/models/entities/Poll.js'; +import type { IPoll } from '@/models/Poll.js'; import type Logger from '@/logger.js'; import { bindThis } from '@/decorators.js'; import { isQuestion } from '../type.js'; diff --git a/packages/backend/src/core/chart/ChartManagementService.ts b/packages/backend/src/core/chart/ChartManagementService.ts index 6b626d3980..f751a68cb4 100644 --- a/packages/backend/src/core/chart/ChartManagementService.ts +++ b/packages/backend/src/core/chart/ChartManagementService.ts @@ -23,7 +23,7 @@ import type { OnApplicationShutdown } from '@nestjs/common'; @Injectable() export class ChartManagementService implements OnApplicationShutdown { private charts; - private saveIntervalId: NodeJS.Timer; + private saveIntervalId: NodeJS.Timeout; constructor( private federationChart: FederationChart, diff --git a/packages/backend/src/core/chart/charts/active-users.ts b/packages/backend/src/core/chart/charts/active-users.ts index 1493727290..55da1469e5 100644 --- a/packages/backend/src/core/chart/charts/active-users.ts +++ b/packages/backend/src/core/chart/charts/active-users.ts @@ -6,7 +6,7 @@ import { Injectable, Inject } from '@nestjs/common'; import { DataSource } from 'typeorm'; import { AppLockService } from '@/core/AppLockService.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; import Chart from '../core.js'; @@ -21,9 +21,8 @@ const year = 1000 * 60 * 60 * 24 * 365; /** * アクティブユーザーに関するチャート */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class ActiveUsersChart extends Chart { +export default class ActiveUsersChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/chart/charts/ap-request.ts b/packages/backend/src/core/chart/charts/ap-request.ts index 8bcbd97b48..03c9b42be1 100644 --- a/packages/backend/src/core/chart/charts/ap-request.ts +++ b/packages/backend/src/core/chart/charts/ap-request.ts @@ -16,9 +16,8 @@ import type { KVs } from '../core.js'; /** * Chart about ActivityPub requests */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class ApRequestChart extends Chart { +export default class ApRequestChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/chart/charts/drive.ts b/packages/backend/src/core/chart/charts/drive.ts index 9db93e7e5c..bbcbf1a955 100644 --- a/packages/backend/src/core/chart/charts/drive.ts +++ b/packages/backend/src/core/chart/charts/drive.ts @@ -5,7 +5,7 @@ import { Injectable, Inject } from '@nestjs/common'; import { DataSource } from 'typeorm'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; import { AppLockService } from '@/core/AppLockService.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; @@ -17,9 +17,8 @@ import type { KVs } from '../core.js'; /** * ドライブに関するチャート */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class DriveChart extends Chart { +export default class DriveChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/chart/charts/federation.ts b/packages/backend/src/core/chart/charts/federation.ts index 6d42dab9b4..fc474b002b 100644 --- a/packages/backend/src/core/chart/charts/federation.ts +++ b/packages/backend/src/core/chart/charts/federation.ts @@ -5,7 +5,7 @@ import { Injectable, Inject } from '@nestjs/common'; import { DataSource } from 'typeorm'; -import type { FollowingsRepository, InstancesRepository } from '@/models/index.js'; +import type { FollowingsRepository, InstancesRepository } from '@/models/_.js'; import { AppLockService } from '@/core/AppLockService.js'; import { DI } from '@/di-symbols.js'; import { MetaService } from '@/core/MetaService.js'; @@ -18,9 +18,8 @@ import type { KVs } from '../core.js'; /** * フェデレーションに関するチャート */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class FederationChart extends Chart { +export default class FederationChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/chart/charts/instance.ts b/packages/backend/src/core/chart/charts/instance.ts index a780e59eb9..9df0afb02e 100644 --- a/packages/backend/src/core/chart/charts/instance.ts +++ b/packages/backend/src/core/chart/charts/instance.ts @@ -5,9 +5,9 @@ import { Injectable, Inject } from '@nestjs/common'; import { DataSource } from 'typeorm'; -import type { DriveFilesRepository, FollowingsRepository, UsersRepository, NotesRepository } from '@/models/index.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { DriveFilesRepository, FollowingsRepository, UsersRepository, NotesRepository } from '@/models/_.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; +import type { MiNote } from '@/models/Note.js'; import { AppLockService } from '@/core/AppLockService.js'; import { DI } from '@/di-symbols.js'; import { UtilityService } from '@/core/UtilityService.js'; @@ -20,9 +20,8 @@ import type { KVs } from '../core.js'; /** * インスタンスごとのチャート */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class InstanceChart extends Chart { +export default class InstanceChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/chart/charts/notes.ts b/packages/backend/src/core/chart/charts/notes.ts index 5a4226911c..df3295dbac 100644 --- a/packages/backend/src/core/chart/charts/notes.ts +++ b/packages/backend/src/core/chart/charts/notes.ts @@ -5,8 +5,8 @@ import { Injectable, Inject } from '@nestjs/common'; import { Not, IsNull, DataSource } from 'typeorm'; -import type { NotesRepository } from '@/models/index.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { NotesRepository } from '@/models/_.js'; +import type { MiNote } from '@/models/Note.js'; import { AppLockService } from '@/core/AppLockService.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; @@ -18,9 +18,8 @@ import type { KVs } from '../core.js'; /** * ノートに関するチャート */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class NotesChart extends Chart { +export default class NotesChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/chart/charts/per-user-drive.ts b/packages/backend/src/core/chart/charts/per-user-drive.ts index 89822479c6..18354359c8 100644 --- a/packages/backend/src/core/chart/charts/per-user-drive.ts +++ b/packages/backend/src/core/chart/charts/per-user-drive.ts @@ -5,8 +5,8 @@ import { Injectable, Inject } from '@nestjs/common'; import { DataSource } from 'typeorm'; -import type { DriveFilesRepository } from '@/models/index.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; +import type { DriveFilesRepository } from '@/models/_.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; import { AppLockService } from '@/core/AppLockService.js'; import { DI } from '@/di-symbols.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; @@ -19,9 +19,8 @@ import type { KVs } from '../core.js'; /** * ユーザーごとのドライブに関するチャート */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class PerUserDriveChart extends Chart { +export default class PerUserDriveChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/chart/charts/per-user-following.ts b/packages/backend/src/core/chart/charts/per-user-following.ts index f195585b3c..79bff2cb66 100644 --- a/packages/backend/src/core/chart/charts/per-user-following.ts +++ b/packages/backend/src/core/chart/charts/per-user-following.ts @@ -5,11 +5,11 @@ import { Injectable, Inject } from '@nestjs/common'; import { Not, IsNull, DataSource } from 'typeorm'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import { AppLockService } from '@/core/AppLockService.js'; import { DI } from '@/di-symbols.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import type { FollowingsRepository } from '@/models/index.js'; +import type { FollowingsRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; import Chart from '../core.js'; import { ChartLoggerService } from '../ChartLoggerService.js'; @@ -19,9 +19,8 @@ import type { KVs } from '../core.js'; /** * ユーザーごとのフォローに関するチャート */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class PerUserFollowingChart extends Chart { +export default class PerUserFollowingChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/chart/charts/per-user-notes.ts b/packages/backend/src/core/chart/charts/per-user-notes.ts index 3ab72bc1d0..0db0e6f07f 100644 --- a/packages/backend/src/core/chart/charts/per-user-notes.ts +++ b/packages/backend/src/core/chart/charts/per-user-notes.ts @@ -5,11 +5,11 @@ import { Injectable, Inject } from '@nestjs/common'; import { DataSource } from 'typeorm'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiNote } from '@/models/Note.js'; import { AppLockService } from '@/core/AppLockService.js'; import { DI } from '@/di-symbols.js'; -import type { NotesRepository } from '@/models/index.js'; +import type { NotesRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; import Chart from '../core.js'; import { ChartLoggerService } from '../ChartLoggerService.js'; @@ -19,9 +19,8 @@ import type { KVs } from '../core.js'; /** * ユーザーごとのノートに関するチャート */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class PerUserNotesChart extends Chart { +export default class PerUserNotesChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/chart/charts/per-user-pv.ts b/packages/backend/src/core/chart/charts/per-user-pv.ts index bc5cb2e888..cf1b4c71f6 100644 --- a/packages/backend/src/core/chart/charts/per-user-pv.ts +++ b/packages/backend/src/core/chart/charts/per-user-pv.ts @@ -5,7 +5,7 @@ import { Injectable, Inject } from '@nestjs/common'; import { DataSource } from 'typeorm'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import { AppLockService } from '@/core/AppLockService.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; @@ -17,9 +17,8 @@ import type { KVs } from '../core.js'; /** * ユーザーごとのプロフィール被閲覧数に関するチャート */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class PerUserPvChart extends Chart { +export default class PerUserPvChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/chart/charts/per-user-reactions.ts b/packages/backend/src/core/chart/charts/per-user-reactions.ts index 7f8ae66f55..9f4f6e9651 100644 --- a/packages/backend/src/core/chart/charts/per-user-reactions.ts +++ b/packages/backend/src/core/chart/charts/per-user-reactions.ts @@ -5,8 +5,8 @@ import { Injectable, Inject } from '@nestjs/common'; import { DataSource } from 'typeorm'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiNote } from '@/models/Note.js'; import { AppLockService } from '@/core/AppLockService.js'; import { DI } from '@/di-symbols.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; @@ -19,9 +19,8 @@ import type { KVs } from '../core.js'; /** * ユーザーごとのリアクションに関するチャート */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class PerUserReactionsChart extends Chart { +export default class PerUserReactionsChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/chart/charts/test-grouped.ts b/packages/backend/src/core/chart/charts/test-grouped.ts index 452f54330e..00fb872237 100644 --- a/packages/backend/src/core/chart/charts/test-grouped.ts +++ b/packages/backend/src/core/chart/charts/test-grouped.ts @@ -16,9 +16,8 @@ import type { KVs } from '../core.js'; /** * For testing */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class TestGroupedChart extends Chart { +export default class TestGroupedChart extends Chart { // eslint-disable-line import/no-default-export private total = {} as Record; constructor( diff --git a/packages/backend/src/core/chart/charts/test-intersection.ts b/packages/backend/src/core/chart/charts/test-intersection.ts index 0898f28128..45a7e805c5 100644 --- a/packages/backend/src/core/chart/charts/test-intersection.ts +++ b/packages/backend/src/core/chart/charts/test-intersection.ts @@ -16,9 +16,8 @@ import type { KVs } from '../core.js'; /** * For testing */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class TestIntersectionChart extends Chart { +export default class TestIntersectionChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/chart/charts/test-unique.ts b/packages/backend/src/core/chart/charts/test-unique.ts index 96cc171945..e9d38eaf13 100644 --- a/packages/backend/src/core/chart/charts/test-unique.ts +++ b/packages/backend/src/core/chart/charts/test-unique.ts @@ -16,9 +16,8 @@ import type { KVs } from '../core.js'; /** * For testing */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class TestUniqueChart extends Chart { +export default class TestUniqueChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/chart/charts/test.ts b/packages/backend/src/core/chart/charts/test.ts index ce2eeb0d5a..4dd6063b5b 100644 --- a/packages/backend/src/core/chart/charts/test.ts +++ b/packages/backend/src/core/chart/charts/test.ts @@ -16,9 +16,8 @@ import type { KVs } from '../core.js'; /** * For testing */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class TestChart extends Chart { +export default class TestChart extends Chart { // eslint-disable-line import/no-default-export public total = 0; // publicにするのはテストのため constructor( diff --git a/packages/backend/src/core/chart/charts/users.ts b/packages/backend/src/core/chart/charts/users.ts index 86d530a7bb..c2026c2aea 100644 --- a/packages/backend/src/core/chart/charts/users.ts +++ b/packages/backend/src/core/chart/charts/users.ts @@ -5,11 +5,11 @@ import { Injectable, Inject } from '@nestjs/common'; import { Not, IsNull, DataSource } from 'typeorm'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import { AppLockService } from '@/core/AppLockService.js'; import { DI } from '@/di-symbols.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; import Chart from '../core.js'; import { ChartLoggerService } from '../ChartLoggerService.js'; @@ -19,9 +19,8 @@ import type { KVs } from '../core.js'; /** * ユーザー数に関するチャート */ -// eslint-disable-next-line import/no-default-export @Injectable() -export default class UsersChart extends Chart { +export default class UsersChart extends Chart { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/core/entities/AbuseUserReportEntityService.ts b/packages/backend/src/core/entities/AbuseUserReportEntityService.ts index 312c583156..6cc5e50e11 100644 --- a/packages/backend/src/core/entities/AbuseUserReportEntityService.ts +++ b/packages/backend/src/core/entities/AbuseUserReportEntityService.ts @@ -5,12 +5,12 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { AbuseUserReportsRepository } from '@/models/index.js'; +import type { AbuseUserReportsRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; -import type { MiAbuseUserReport } from '@/models/entities/AbuseUserReport.js'; +import type { MiAbuseUserReport } from '@/models/AbuseUserReport.js'; import { bindThis } from '@/decorators.js'; import { Packed } from '@/misc/json-schema.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import { UserEntityService } from './UserEntityService.js'; @Injectable() diff --git a/packages/backend/src/core/entities/AnnouncementEntityService.ts b/packages/backend/src/core/entities/AnnouncementEntityService.ts index 559a48a58f..476122c273 100644 --- a/packages/backend/src/core/entities/AnnouncementEntityService.ts +++ b/packages/backend/src/core/entities/AnnouncementEntityService.ts @@ -8,10 +8,11 @@ import { DI } from '@/di-symbols.js'; import type { AnnouncementReadsRepository, AnnouncementsRepository, -} from '@/models/index.js'; + MiAnnouncement, + MiUser, +} from '@/models/_.js'; import type { Packed } from '@/misc/json-schema.js'; import { bindThis } from '@/decorators.js'; -import { MiAnnouncement, MiUser } from '@/models/index.js'; @Injectable() export class AnnouncementEntityService { diff --git a/packages/backend/src/core/entities/AntennaEntityService.ts b/packages/backend/src/core/entities/AntennaEntityService.ts index 7826ca5d70..ed108f2ce5 100644 --- a/packages/backend/src/core/entities/AntennaEntityService.ts +++ b/packages/backend/src/core/entities/AntennaEntityService.ts @@ -5,9 +5,9 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { AntennasRepository } from '@/models/index.js'; +import type { AntennasRepository } from '@/models/_.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiAntenna } from '@/models/entities/Antenna.js'; +import type { MiAntenna } from '@/models/Antenna.js'; import { bindThis } from '@/decorators.js'; @Injectable() diff --git a/packages/backend/src/core/entities/AppEntityService.ts b/packages/backend/src/core/entities/AppEntityService.ts index 4ce47ce343..14a93cda5b 100644 --- a/packages/backend/src/core/entities/AppEntityService.ts +++ b/packages/backend/src/core/entities/AppEntityService.ts @@ -5,10 +5,10 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { AccessTokensRepository, AppsRepository } from '@/models/index.js'; +import type { AccessTokensRepository, AppsRepository } from '@/models/_.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiApp } from '@/models/entities/App.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiApp } from '@/models/App.js'; +import type { MiUser } from '@/models/User.js'; import { bindThis } from '@/decorators.js'; @Injectable() @@ -25,7 +25,7 @@ export class AppEntityService { @bindThis public async pack( src: MiApp['id'] | MiApp, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, options?: { detail?: boolean, includeSecret?: boolean, diff --git a/packages/backend/src/core/entities/AuthSessionEntityService.ts b/packages/backend/src/core/entities/AuthSessionEntityService.ts index 709e8bce3f..fd356cc89d 100644 --- a/packages/backend/src/core/entities/AuthSessionEntityService.ts +++ b/packages/backend/src/core/entities/AuthSessionEntityService.ts @@ -5,10 +5,10 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { AuthSessionsRepository } from '@/models/index.js'; +import type { AuthSessionsRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; -import type { MiAuthSession } from '@/models/entities/AuthSession.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiAuthSession } from '@/models/AuthSession.js'; +import type { MiUser } from '@/models/User.js'; import { bindThis } from '@/decorators.js'; import { AppEntityService } from './AppEntityService.js'; @@ -25,7 +25,7 @@ export class AuthSessionEntityService { @bindThis public async pack( src: MiAuthSession['id'] | MiAuthSession, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ) { const session = typeof src === 'object' ? src : await this.authSessionsRepository.findOneByOrFail({ id: src }); diff --git a/packages/backend/src/core/entities/BlockingEntityService.ts b/packages/backend/src/core/entities/BlockingEntityService.ts index a1516266fe..11bfd27505 100644 --- a/packages/backend/src/core/entities/BlockingEntityService.ts +++ b/packages/backend/src/core/entities/BlockingEntityService.ts @@ -5,11 +5,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { BlockingsRepository } from '@/models/index.js'; +import type { BlockingsRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiBlocking } from '@/models/entities/Blocking.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiBlocking } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; import { bindThis } from '@/decorators.js'; import { UserEntityService } from './UserEntityService.js'; @@ -26,7 +26,7 @@ export class BlockingEntityService { @bindThis public async pack( src: MiBlocking['id'] | MiBlocking, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ): Promise> { const blocking = typeof src === 'object' ? src : await this.blockingsRepository.findOneByOrFail({ id: src }); @@ -43,7 +43,7 @@ export class BlockingEntityService { @bindThis public async packMany( blockings: (MiBlocking['id'] | MiBlocking)[], - me: { id: MiUser['id'] } | null | undefined, + me: { id: MiUser['id'] }, ) : Promise[]> { return (await Promise.allSettled(blockings.map(x => this.pack(x, me)))) .filter(result => result.status === 'fulfilled') diff --git a/packages/backend/src/core/entities/ChannelEntityService.ts b/packages/backend/src/core/entities/ChannelEntityService.ts index c49cfa6fca..5224e9d76c 100644 --- a/packages/backend/src/core/entities/ChannelEntityService.ts +++ b/packages/backend/src/core/entities/ChannelEntityService.ts @@ -6,17 +6,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { In } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { - ChannelFavoritesRepository, - ChannelFollowingsRepository, - ChannelsRepository, - DriveFilesRepository, - NotesRepository, - NoteUnreadsRepository, -} from '@/models/index.js'; +import type { ChannelFavoritesRepository, ChannelFollowingsRepository, ChannelsRepository, DriveFilesRepository, NoteUnreadsRepository, NotesRepository } from '@/models/_.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiChannel } from '@/models/entities/Channel.js'; +import type { } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiChannel } from '@/models/Channel.js'; import { bindThis } from '@/decorators.js'; import { DriveFileEntityService } from './DriveFileEntityService.js'; import { NoteEntityService } from './NoteEntityService.js'; @@ -50,7 +44,7 @@ export class ChannelEntityService { @bindThis public async pack( src: MiChannel['id'] | MiChannel, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, detailed?: boolean, ): Promise> { const channel = typeof src === 'object' ? src : await this.channelsRepository.findOneByOrFail({ id: src }); @@ -98,6 +92,7 @@ export class ChannelEntityService { isArchived: channel.isArchived, usersCount: channel.usersCount, notesCount: channel.notesCount, + isSensitive: channel.isSensitive, ...(me ? { isFollowing, diff --git a/packages/backend/src/core/entities/ClipEntityService.ts b/packages/backend/src/core/entities/ClipEntityService.ts index 30327ee55d..e10c828a0a 100644 --- a/packages/backend/src/core/entities/ClipEntityService.ts +++ b/packages/backend/src/core/entities/ClipEntityService.ts @@ -5,10 +5,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { ClipFavoritesRepository, ClipsRepository, MiUser } from '@/models/index.js'; +import type { ClipFavoritesRepository, ClipsRepository, MiUser } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiClip } from '@/models/entities/Clip.js'; +import type { } from '@/models/Blocking.js'; +import type { MiClip } from '@/models/Clip.js'; import { bindThis } from '@/decorators.js'; import { UserEntityService } from './UserEntityService.js'; @@ -28,7 +29,7 @@ export class ClipEntityService { @bindThis public async pack( src: MiClip['id'] | MiClip, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ): Promise> { const meId = me ? me.id : null; const clip = typeof src === 'object' ? src : await this.clipsRepository.findOneByOrFail({ id: src }); @@ -50,7 +51,7 @@ export class ClipEntityService { @bindThis public async packMany( clips: (MiClip['id'] | MiClip)[], - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ) : Promise[]> { return (await Promise.allSettled(clips.map(x => this.pack(x, me)))) .filter(result => result.status === 'fulfilled') diff --git a/packages/backend/src/core/entities/DriveFileEntityService.ts b/packages/backend/src/core/entities/DriveFileEntityService.ts index 1506fce58d..3e274bb7c0 100644 --- a/packages/backend/src/core/entities/DriveFileEntityService.ts +++ b/packages/backend/src/core/entities/DriveFileEntityService.ts @@ -4,14 +4,14 @@ */ import { forwardRef, Inject, Injectable } from '@nestjs/common'; -import { DataSource, In } from 'typeorm'; +import { In } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { DriveFilesRepository, NotesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; import type { Packed } from '@/misc/json-schema.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; import { appendQuery, query } from '@/misc/prelude/url.js'; import { deepClone } from '@/misc/clone.js'; import { bindThis } from '@/decorators.js'; @@ -34,12 +34,6 @@ export class DriveFileEntityService { @Inject(DI.config) private config: Config, - @Inject(DI.db) - private db: DataSource, - - @Inject(DI.notesRepository) - private notesRepository: NotesRepository, - @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/core/entities/DriveFolderEntityService.ts b/packages/backend/src/core/entities/DriveFolderEntityService.ts index a052d34ff6..55014284bd 100644 --- a/packages/backend/src/core/entities/DriveFolderEntityService.ts +++ b/packages/backend/src/core/entities/DriveFolderEntityService.ts @@ -5,10 +5,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { DriveFilesRepository, DriveFoldersRepository } from '@/models/index.js'; +import type { DriveFilesRepository, DriveFoldersRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiDriveFolder } from '@/models/entities/DriveFolder.js'; +import type { } from '@/models/Blocking.js'; +import type { MiDriveFolder } from '@/models/DriveFolder.js'; import { bindThis } from '@/decorators.js'; @Injectable() diff --git a/packages/backend/src/core/entities/EmojiEntityService.ts b/packages/backend/src/core/entities/EmojiEntityService.ts index 4e83970696..57b9b3a6c6 100644 --- a/packages/backend/src/core/entities/EmojiEntityService.ts +++ b/packages/backend/src/core/entities/EmojiEntityService.ts @@ -5,9 +5,10 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { EmojisRepository } from '@/models/index.js'; +import type { EmojisRepository } from '@/models/_.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiEmoji } from '@/models/entities/Emoji.js'; +import type { } from '@/models/Blocking.js'; +import type { MiEmoji } from '@/models/Emoji.js'; import { bindThis } from '@/decorators.js'; @Injectable() diff --git a/packages/backend/src/core/entities/FlashEntityService.ts b/packages/backend/src/core/entities/FlashEntityService.ts index 49483f6ded..d321483232 100644 --- a/packages/backend/src/core/entities/FlashEntityService.ts +++ b/packages/backend/src/core/entities/FlashEntityService.ts @@ -5,11 +5,12 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { FlashLikesRepository, FlashsRepository } from '@/models/index.js'; +import type { FlashsRepository, FlashLikesRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiFlash } from '@/models/entities/Flash.js'; +import type { } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiFlash } from '@/models/Flash.js'; import { bindThis } from '@/decorators.js'; import { UserEntityService } from './UserEntityService.js'; @@ -29,7 +30,7 @@ export class FlashEntityService { @bindThis public async pack( src: MiFlash['id'] | MiFlash, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ): Promise> { const meId = me ? me.id : null; const flash = typeof src === 'object' ? src : await this.flashsRepository.findOneByOrFail({ id: src }); @@ -50,8 +51,8 @@ export class FlashEntityService { @bindThis public async packMany( - flashs: (MiFlash['id'] | MiFlash)[], - me: { id: MiUser['id'] } | null | undefined, + flashs: MiFlash[], + me?: { id: MiUser['id'] } | null | undefined, ) : Promise[]> { return (await Promise.allSettled(flashs.map(x => this.pack(x, me)))) .filter(result => result.status === 'fulfilled') diff --git a/packages/backend/src/core/entities/FlashLikeEntityService.ts b/packages/backend/src/core/entities/FlashLikeEntityService.ts index 35c98904d5..31807777a8 100644 --- a/packages/backend/src/core/entities/FlashLikeEntityService.ts +++ b/packages/backend/src/core/entities/FlashLikeEntityService.ts @@ -5,9 +5,10 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { FlashLikesRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiFlashLike } from '@/models/entities/FlashLike.js'; +import type { FlashLikesRepository } from '@/models/_.js'; +import type { } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiFlashLike } from '@/models/FlashLike.js'; import { bindThis } from '@/decorators.js'; import { Packed } from '@/misc/json-schema.js'; import { FlashEntityService } from './FlashEntityService.js'; @@ -25,7 +26,7 @@ export class FlashLikeEntityService { @bindThis public async pack( src: MiFlashLike['id'] | MiFlashLike, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ) : Promise> { const like = typeof src === 'object' ? src : await this.flashLikesRepository.findOneByOrFail({ id: src }); @@ -38,7 +39,7 @@ export class FlashLikeEntityService { @bindThis public async packMany( likes: (MiFlashLike['id'] | MiFlashLike)[], - me: { id: MiUser['id'] } | null | undefined, + me: { id: MiUser['id'] }, ) : Promise[]> { return (await Promise.allSettled(likes.map(x => this.pack(x, me)))) .filter(result => result.status === 'fulfilled') diff --git a/packages/backend/src/core/entities/FollowRequestEntityService.ts b/packages/backend/src/core/entities/FollowRequestEntityService.ts index 5cee20fb41..0153337ec1 100644 --- a/packages/backend/src/core/entities/FollowRequestEntityService.ts +++ b/packages/backend/src/core/entities/FollowRequestEntityService.ts @@ -5,9 +5,10 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { FollowRequestsRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiFollowRequest } from '@/models/entities/FollowRequest.js'; +import type { FollowRequestsRepository } from '@/models/_.js'; +import type { } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiFollowRequest } from '@/models/FollowRequest.js'; import { bindThis } from '@/decorators.js'; import { Packed } from '@/misc/json-schema.js'; import { UserEntityService } from './UserEntityService.js'; @@ -25,7 +26,7 @@ export class FollowRequestEntityService { @bindThis public async pack( src: MiFollowRequest['id'] | MiFollowRequest, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ) : Promise> { const request = typeof src === 'object' ? src : await this.followRequestsRepository.findOneByOrFail({ id: src }); diff --git a/packages/backend/src/core/entities/FollowingEntityService.ts b/packages/backend/src/core/entities/FollowingEntityService.ts index d23af7ae05..2ddcf73f56 100644 --- a/packages/backend/src/core/entities/FollowingEntityService.ts +++ b/packages/backend/src/core/entities/FollowingEntityService.ts @@ -5,11 +5,12 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { FollowingsRepository } from '@/models/index.js'; +import type { FollowingsRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiFollowing } from '@/models/entities/Following.js'; +import type { } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiFollowing } from '@/models/Following.js'; import { bindThis } from '@/decorators.js'; import { UserEntityService } from './UserEntityService.js'; @@ -70,7 +71,7 @@ export class FollowingEntityService { @bindThis public async pack( src: MiFollowing['id'] | MiFollowing, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, opts?: { populateFollowee?: boolean; populateFollower?: boolean; @@ -97,7 +98,7 @@ export class FollowingEntityService { @bindThis public async packMany( followings: (MiFollowing['id'] | MiFollowing)[], - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, opts?: { populateFollowee?: boolean; populateFollower?: boolean; diff --git a/packages/backend/src/core/entities/GalleryLikeEntityService.ts b/packages/backend/src/core/entities/GalleryLikeEntityService.ts index 6b41d981b5..51a25d3aae 100644 --- a/packages/backend/src/core/entities/GalleryLikeEntityService.ts +++ b/packages/backend/src/core/entities/GalleryLikeEntityService.ts @@ -5,11 +5,12 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { GalleryLikesRepository } from '@/models/index.js'; -import type { MiGalleryLike } from '@/models/entities/GalleryLike.js'; +import type { GalleryLikesRepository } from '@/models/_.js'; +import type { } from '@/models/Blocking.js'; +import type { MiGalleryLike } from '@/models/GalleryLike.js'; import { bindThis } from '@/decorators.js'; import { Packed } from '@/misc/json-schema.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import { GalleryPostEntityService } from './GalleryPostEntityService.js'; @Injectable() diff --git a/packages/backend/src/core/entities/GalleryPostEntityService.ts b/packages/backend/src/core/entities/GalleryPostEntityService.ts index 21b03faf76..b962268c14 100644 --- a/packages/backend/src/core/entities/GalleryPostEntityService.ts +++ b/packages/backend/src/core/entities/GalleryPostEntityService.ts @@ -5,11 +5,12 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { GalleryLikesRepository, GalleryPostsRepository } from '@/models/index.js'; +import type { GalleryLikesRepository, GalleryPostsRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiGalleryPost } from '@/models/entities/GalleryPost.js'; +import type { } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiGalleryPost } from '@/models/GalleryPost.js'; import { bindThis } from '@/decorators.js'; import { UserEntityService } from './UserEntityService.js'; import { DriveFileEntityService } from './DriveFileEntityService.js'; @@ -31,7 +32,7 @@ export class GalleryPostEntityService { @bindThis public async pack( src: MiGalleryPost['id'] | MiGalleryPost, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ): Promise> { const meId = me ? me.id : null; const post = typeof src === 'object' ? src : await this.galleryPostsRepository.findOneByOrFail({ id: src }); @@ -56,8 +57,8 @@ export class GalleryPostEntityService { @bindThis public async packMany( - posts: (MiGalleryPost['id'] | MiGalleryPost)[], - me: { id: MiUser['id'] } | null | undefined, + posts: MiGalleryPost[], + me?: { id: MiUser['id'] } | null | undefined, ) : Promise[]> { return (await Promise.allSettled(posts.map(x => this.pack(x, me)))) .filter(result => result.status === 'fulfilled') diff --git a/packages/backend/src/core/entities/HashtagEntityService.ts b/packages/backend/src/core/entities/HashtagEntityService.ts index 4bccec689f..d8cca2b2a2 100644 --- a/packages/backend/src/core/entities/HashtagEntityService.ts +++ b/packages/backend/src/core/entities/HashtagEntityService.ts @@ -3,21 +3,15 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; -import { DI } from '@/di-symbols.js'; -import type { HashtagsRepository } from '@/models/index.js'; +import { Injectable } from '@nestjs/common'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiHashtag } from '@/models/entities/Hashtag.js'; +import type { } from '@/models/Blocking.js'; +import type { MiHashtag } from '@/models/Hashtag.js'; import { bindThis } from '@/decorators.js'; -import { UserEntityService } from './UserEntityService.js'; @Injectable() export class HashtagEntityService { constructor( - @Inject(DI.hashtagsRepository) - private hashtagsRepository: HashtagsRepository, - - private userEntityService: UserEntityService, ) { } diff --git a/packages/backend/src/core/entities/InstanceEntityService.ts b/packages/backend/src/core/entities/InstanceEntityService.ts index f52b81967e..6f3191adea 100644 --- a/packages/backend/src/core/entities/InstanceEntityService.ts +++ b/packages/backend/src/core/entities/InstanceEntityService.ts @@ -3,11 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; -import { DI } from '@/di-symbols.js'; -import type { InstancesRepository } from '@/models/index.js'; +import { Injectable } from '@nestjs/common'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiInstance } from '@/models/entities/Instance.js'; +import type { } from '@/models/Blocking.js'; +import type { MiInstance } from '@/models/Instance.js'; import { MetaService } from '@/core/MetaService.js'; import { bindThis } from '@/decorators.js'; import { UtilityService } from '../UtilityService.js'; @@ -15,9 +14,6 @@ import { UtilityService } from '../UtilityService.js'; @Injectable() export class InstanceEntityService { constructor( - @Inject(DI.instancesRepository) - private instancesRepository: InstancesRepository, - private metaService: MetaService, private utilityService: UtilityService, diff --git a/packages/backend/src/core/entities/InviteCodeEntityService.ts b/packages/backend/src/core/entities/InviteCodeEntityService.ts index 453ea0311b..acc7aed91a 100644 --- a/packages/backend/src/core/entities/InviteCodeEntityService.ts +++ b/packages/backend/src/core/entities/InviteCodeEntityService.ts @@ -5,11 +5,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { RegistrationTicketsRepository } from '@/models/index.js'; +import type { RegistrationTicketsRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiRegistrationTicket } from '@/models/entities/RegistrationTicket.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiRegistrationTicket } from '@/models/RegistrationTicket.js'; import { bindThis } from '@/decorators.js'; import { UserEntityService } from './UserEntityService.js'; @@ -26,7 +26,7 @@ export class InviteCodeEntityService { @bindThis public async pack( src: MiRegistrationTicket['id'] | MiRegistrationTicket, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ): Promise> { const target = typeof src === 'object' ? src : await this.registrationTicketsRepository.findOneOrFail({ where: { @@ -50,7 +50,7 @@ export class InviteCodeEntityService { @bindThis public async packMany( targets: (MiRegistrationTicket['id'] | MiRegistrationTicket)[], - me: { id: MiUser['id'] } | null | undefined, + me: { id: MiUser['id'] }, ) : Promise[]> { return (await Promise.allSettled(targets.map(x => this.pack(x, me)))) .filter(result => result.status === 'fulfilled') diff --git a/packages/backend/src/core/entities/ModerationLogEntityService.ts b/packages/backend/src/core/entities/ModerationLogEntityService.ts index 9e2083ccce..f05d7b2fd7 100644 --- a/packages/backend/src/core/entities/ModerationLogEntityService.ts +++ b/packages/backend/src/core/entities/ModerationLogEntityService.ts @@ -5,10 +5,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { ModerationLogsRepository } from '@/models/index.js'; +import type { ModerationLogsRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiModerationLog } from '@/models/entities/ModerationLog.js'; +import type { } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiModerationLog } from '@/models/ModerationLog.js'; import { bindThis } from '@/decorators.js'; import { Packed } from '@/misc/json-schema.js'; import { UserEntityService } from './UserEntityService.js'; diff --git a/packages/backend/src/core/entities/MutingEntityService.ts b/packages/backend/src/core/entities/MutingEntityService.ts index cd94523f4c..2347b804e5 100644 --- a/packages/backend/src/core/entities/MutingEntityService.ts +++ b/packages/backend/src/core/entities/MutingEntityService.ts @@ -5,11 +5,12 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { MutingsRepository } from '@/models/index.js'; +import type { MutingsRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiMuting } from '@/models/entities/Muting.js'; +import type { } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiMuting } from '@/models/Muting.js'; import { bindThis } from '@/decorators.js'; import { UserEntityService } from './UserEntityService.js'; @@ -26,7 +27,7 @@ export class MutingEntityService { @bindThis public async pack( src: MiMuting['id'] | MiMuting, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ): Promise> { const muting = typeof src === 'object' ? src : await this.mutingsRepository.findOneByOrFail({ id: src }); @@ -44,7 +45,7 @@ export class MutingEntityService { @bindThis public async packMany( mutings: (MiMuting['id'] | MiMuting)[], - me: { id: MiUser['id'] } | null | undefined, + me: { id: MiUser['id'] }, ) : Promise[]> { return (await Promise.allSettled(mutings.map(x => this.pack(x, me)))) .filter(result => result.status === 'fulfilled') diff --git a/packages/backend/src/core/entities/NoteEntityService.ts b/packages/backend/src/core/entities/NoteEntityService.ts index cad850b860..0dd5e5f195 100644 --- a/packages/backend/src/core/entities/NoteEntityService.ts +++ b/packages/backend/src/core/entities/NoteEntityService.ts @@ -4,26 +4,17 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import { DataSource, In } from 'typeorm'; +import { In } from 'typeorm'; import * as mfm from 'mfm-js'; import { ModuleRef } from '@nestjs/core'; import { DI } from '@/di-symbols.js'; import type { Packed } from '@/misc/json-schema.js'; import { nyaize } from '@/misc/nyaize.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiNote } from '@/models/entities/Note.js'; -import type { MiNoteReaction } from '@/models/entities/NoteReaction.js'; -import type { - ChannelsRepository, - DriveFilesRepository, - FollowingsRepository, - NoteReactionsRepository, - NotesRepository, - PollsRepository, - PollVotesRepository, - UsersRepository, -} from '@/models/index.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiNote } from '@/models/Note.js'; +import type { MiNoteReaction } from '@/models/NoteReaction.js'; +import type { UsersRepository, NotesRepository, FollowingsRepository, PollsRepository, PollVotesRepository, NoteReactionsRepository, ChannelsRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; import { isNotNull } from '@/misc/is-not-null.js'; import type { OnModuleInit } from '@nestjs/common'; @@ -42,9 +33,6 @@ export class NoteEntityService implements OnModuleInit { constructor( private moduleRef: ModuleRef, - @Inject(DI.db) - private db: DataSource, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -66,9 +54,6 @@ export class NoteEntityService implements OnModuleInit { @Inject(DI.channelsRepository) private channelsRepository: ChannelsRepository, - @Inject(DI.driveFilesRepository) - private driveFilesRepository: DriveFilesRepository, - //private userEntityService: UserEntityService, //private driveFileEntityService: DriveFileEntityService, //private customEmojiService: CustomEmojiService, @@ -288,7 +273,7 @@ export class NoteEntityService implements OnModuleInit { @bindThis public async pack( src: MiNote['id'] | MiNote, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, options?: { detail?: boolean; skipHide?: boolean; @@ -352,12 +337,15 @@ export class NoteEntityService implements OnModuleInit { id: channel.id, name: channel.name, color: channel.color, + isSensitive: channel.isSensitive, } : undefined, mentions: note.mentions.length > 0 ? note.mentions : undefined, uri: note.uri ?? undefined, url: note.url ?? undefined, ...(opts.detail ? { + clippedCount: note.clippedCount, + reply: note.replyId ? this.pack(note.reply ?? note.replyId, me, { detail: false, _hint_: options?._hint_, @@ -405,7 +393,7 @@ export class NoteEntityService implements OnModuleInit { @bindThis public async packMany( notes: MiNote[], - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, options?: { detail?: boolean; skipHide?: boolean; diff --git a/packages/backend/src/core/entities/NoteFavoriteEntityService.ts b/packages/backend/src/core/entities/NoteFavoriteEntityService.ts index 51dd976ba0..0da756a6bf 100644 --- a/packages/backend/src/core/entities/NoteFavoriteEntityService.ts +++ b/packages/backend/src/core/entities/NoteFavoriteEntityService.ts @@ -5,9 +5,10 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { NoteFavoritesRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiNoteFavorite } from '@/models/entities/NoteFavorite.js'; +import type { NoteFavoritesRepository } from '@/models/_.js'; +import type { } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiNoteFavorite } from '@/models/NoteFavorite.js'; import { bindThis } from '@/decorators.js'; import { Packed } from '@/misc/json-schema.js'; import { NoteEntityService } from './NoteEntityService.js'; @@ -25,7 +26,7 @@ export class NoteFavoriteEntityService { @bindThis public async pack( src: MiNoteFavorite['id'] | MiNoteFavorite, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ) : Promise> { const favorite = typeof src === 'object' ? src : await this.noteFavoritesRepository.findOneByOrFail({ id: src }); @@ -40,7 +41,7 @@ export class NoteFavoriteEntityService { @bindThis public async packMany( favorites: (MiNoteFavorite['id'] | MiNoteFavorite)[], - me: { id: MiUser['id'] } | null | undefined, + me: { id: MiUser['id'] }, ) : Promise[]> { return (await Promise.allSettled(favorites.map(x => this.pack(x, me)))) .filter(result => result.status === 'fulfilled') diff --git a/packages/backend/src/core/entities/NoteReactionEntityService.ts b/packages/backend/src/core/entities/NoteReactionEntityService.ts index 838910df3b..577272296e 100644 --- a/packages/backend/src/core/entities/NoteReactionEntityService.ts +++ b/packages/backend/src/core/entities/NoteReactionEntityService.ts @@ -6,12 +6,13 @@ import { Inject, Injectable } from '@nestjs/common'; import { ModuleRef } from '@nestjs/core'; import { DI } from '@/di-symbols.js'; -import type { NoteReactionsRepository } from '@/models/index.js'; +import type { NoteReactionsRepository } from '@/models/_.js'; import type { Packed } from '@/misc/json-schema.js'; import { bindThis } from '@/decorators.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiNoteReaction } from '@/models/entities/NoteReaction.js'; import type { OnModuleInit } from '@nestjs/common'; +import type { } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiNoteReaction } from '@/models/NoteReaction.js'; import type { ReactionService } from '../ReactionService.js'; import type { UserEntityService } from './UserEntityService.js'; import type { NoteEntityService } from './NoteEntityService.js'; @@ -43,7 +44,7 @@ export class NoteReactionEntityService implements OnModuleInit { @bindThis public async pack( src: MiNoteReaction['id'] | MiNoteReaction, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, options?: { withNote: boolean; }, diff --git a/packages/backend/src/core/entities/NotificationEntityService.ts b/packages/backend/src/core/entities/NotificationEntityService.ts index 149d740ff5..73eb664b62 100644 --- a/packages/backend/src/core/entities/NotificationEntityService.ts +++ b/packages/backend/src/core/entities/NotificationEntityService.ts @@ -7,27 +7,20 @@ import { Inject, Injectable } from '@nestjs/common'; import { ModuleRef } from '@nestjs/core'; import { In } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { - AccessTokensRepository, - FollowRequestsRepository, - NoteReactionsRepository, - NotesRepository, - UsersRepository, -} from '@/models/index.js'; +import type { AccessTokensRepository, FollowRequestsRepository, NotesRepository, MiUser, UsersRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; -import type { MiNotification } from '@/models/entities/Notification.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiNotification } from '@/models/Notification.js'; +import type { MiNote } from '@/models/Note.js'; import type { Packed } from '@/misc/json-schema.js'; import { bindThis } from '@/decorators.js'; import { isNotNull } from '@/misc/is-not-null.js'; import { notificationTypes } from '@/types.js'; -import type { MiUser } from '@/models/entities/User.js'; import type { OnModuleInit } from '@nestjs/common'; import type { CustomEmojiService } from '../CustomEmojiService.js'; import type { UserEntityService } from './UserEntityService.js'; import type { NoteEntityService } from './NoteEntityService.js'; -const NOTE_REQUIRED_NOTIFICATION_TYPES = new Set(['mention', 'reply', 'renote', 'quote', 'reaction', 'pollEnded'] as (typeof notificationTypes[number])[]); +const NOTE_REQUIRED_NOTIFICATION_TYPES = new Set(['note', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollEnded'] as (typeof notificationTypes[number])[]); @Injectable() export class NotificationEntityService implements OnModuleInit { @@ -44,9 +37,6 @@ export class NotificationEntityService implements OnModuleInit { @Inject(DI.usersRepository) private usersRepository: UsersRepository, - @Inject(DI.noteReactionsRepository) - private noteReactionsRepository: NoteReactionsRepository, - @Inject(DI.followRequestsRepository) private followRequestsRepository: FollowRequestsRepository, diff --git a/packages/backend/src/core/entities/PageEntityService.ts b/packages/backend/src/core/entities/PageEntityService.ts index c92f0ec2ae..4e5b07adc3 100644 --- a/packages/backend/src/core/entities/PageEntityService.ts +++ b/packages/backend/src/core/entities/PageEntityService.ts @@ -5,12 +5,13 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { DriveFilesRepository, PageLikesRepository, PagesRepository } from '@/models/index.js'; +import type { DriveFilesRepository, PagesRepository, PageLikesRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiPage } from '@/models/entities/Page.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; +import type { } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiPage } from '@/models/Page.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; import { bindThis } from '@/decorators.js'; import { UserEntityService } from './UserEntityService.js'; import { DriveFileEntityService } from './DriveFileEntityService.js'; @@ -35,7 +36,7 @@ export class PageEntityService { @bindThis public async pack( src: MiPage['id'] | MiPage, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ): Promise> { const meId = me ? me.id : null; const page = typeof src === 'object' ? src : await this.pagesRepository.findOneByOrFail({ id: src }); @@ -108,7 +109,7 @@ export class PageEntityService { @bindThis public async packMany( pages: (MiPage['id'] | MiPage)[], - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ) : Promise[]> { return (await Promise.allSettled(pages.map(x => this.pack(x, me)))) .filter(result => result.status === 'fulfilled') diff --git a/packages/backend/src/core/entities/PageLikeEntityService.ts b/packages/backend/src/core/entities/PageLikeEntityService.ts index fefaf387a8..5210b34c13 100644 --- a/packages/backend/src/core/entities/PageLikeEntityService.ts +++ b/packages/backend/src/core/entities/PageLikeEntityService.ts @@ -5,9 +5,10 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { PageLikesRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiPageLike } from '@/models/entities/PageLike.js'; +import type { PageLikesRepository } from '@/models/_.js'; +import type { } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiPageLike } from '@/models/PageLike.js'; import { bindThis } from '@/decorators.js'; import { Packed } from '@/misc/json-schema.js'; import { PageEntityService } from './PageEntityService.js'; @@ -25,7 +26,7 @@ export class PageLikeEntityService { @bindThis public async pack( src: MiPageLike['id'] | MiPageLike, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ) : Promise> { const like = typeof src === 'object' ? src : await this.pageLikesRepository.findOneByOrFail({ id: src }); @@ -38,7 +39,7 @@ export class PageLikeEntityService { @bindThis public async packMany( likes: (MiPageLike['id'] | MiPageLike)[], - me: { id: MiUser['id'] } | null | undefined, + me: { id: MiUser['id'] }, ) : Promise[]> { return (await Promise.allSettled(likes.map(x => this.pack(x, me)))) .filter(result => result.status === 'fulfilled') diff --git a/packages/backend/src/core/entities/RenoteMutingEntityService.ts b/packages/backend/src/core/entities/RenoteMutingEntityService.ts index 9e47f3a36e..0707dfbb5c 100644 --- a/packages/backend/src/core/entities/RenoteMutingEntityService.ts +++ b/packages/backend/src/core/entities/RenoteMutingEntityService.ts @@ -5,11 +5,12 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { RenoteMutingsRepository } from '@/models/index.js'; +import type { RenoteMutingsRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiRenoteMuting } from '@/models/entities/RenoteMuting.js'; +import type { } from '@/models/Blocking.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiRenoteMuting } from '@/models/RenoteMuting.js'; import { bindThis } from '@/decorators.js'; import { UserEntityService } from './UserEntityService.js'; @@ -26,7 +27,7 @@ export class RenoteMutingEntityService { @bindThis public async pack( src: MiRenoteMuting['id'] | MiRenoteMuting, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ): Promise> { const muting = typeof src === 'object' ? src : await this.renoteMutingsRepository.findOneByOrFail({ id: src }); @@ -43,7 +44,7 @@ export class RenoteMutingEntityService { @bindThis public async packMany( mutings: (MiRenoteMuting['id'] | MiRenoteMuting)[], - me: { id: MiUser['id'] } | null | undefined, + me: { id: MiUser['id'] }, ) : Promise[]> { return (await Promise.allSettled(mutings.map(u => this.pack(u, me)))) .filter(result => result.status === 'fulfilled') diff --git a/packages/backend/src/core/entities/RoleEntityService.ts b/packages/backend/src/core/entities/RoleEntityService.ts index 10a02f9929..b76c71d303 100644 --- a/packages/backend/src/core/entities/RoleEntityService.ts +++ b/packages/backend/src/core/entities/RoleEntityService.ts @@ -6,14 +6,13 @@ import { Inject, Injectable } from '@nestjs/common'; import { Brackets } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { RoleAssignmentsRepository, RolesRepository } from '@/models/index.js'; +import type { RoleAssignmentsRepository, RolesRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiRole } from '@/models/entities/Role.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiRole } from '@/models/Role.js'; import { bindThis } from '@/decorators.js'; import { DEFAULT_POLICIES } from '@/core/RoleService.js'; import { Packed } from '@/misc/json-schema.js'; -import { UserEntityService } from './UserEntityService.js'; @Injectable() export class RoleEntityService { @@ -23,15 +22,13 @@ export class RoleEntityService { @Inject(DI.roleAssignmentsRepository) private roleAssignmentsRepository: RoleAssignmentsRepository, - - private userEntityService: UserEntityService, ) { } @bindThis public async pack( src: MiRole['id'] | MiRole, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, ) : Promise> { const role = typeof src === 'object' ? src : await this.rolesRepository.findOneByOrFail({ id: src }); @@ -77,7 +74,7 @@ export class RoleEntityService { @bindThis public async packMany( roles: (MiRole['id'] | MiRole)[], - me: { id: MiUser['id'] } | null | undefined, + me: { id: MiUser['id'] }, ) : Promise[]> { return (await Promise.allSettled(roles.map(x => this.pack(x, me)))) .filter(result => result.status === 'fulfilled') diff --git a/packages/backend/src/core/entities/SigninEntityService.ts b/packages/backend/src/core/entities/SigninEntityService.ts index 12562ff874..8c88e8560a 100644 --- a/packages/backend/src/core/entities/SigninEntityService.ts +++ b/packages/backend/src/core/entities/SigninEntityService.ts @@ -3,20 +3,14 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; -import { DI } from '@/di-symbols.js'; -import type { SigninsRepository } from '@/models/index.js'; -import type { MiSignin } from '@/models/entities/Signin.js'; +import { Injectable } from '@nestjs/common'; +import type { } from '@/models/Blocking.js'; +import type { MiSignin } from '@/models/Signin.js'; import { bindThis } from '@/decorators.js'; -import { UserEntityService } from './UserEntityService.js'; @Injectable() export class SigninEntityService { constructor( - @Inject(DI.signinsRepository) - private signinsRepository: SigninsRepository, - - private userEntityService: UserEntityService, ) { } diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts index dad17a830a..3741fa4ca6 100644 --- a/packages/backend/src/core/entities/UserEntityService.ts +++ b/packages/backend/src/core/entities/UserEntityService.ts @@ -13,35 +13,9 @@ import type { Packed } from '@/misc/json-schema.js'; import type { Promiseable } from '@/misc/prelude/await-all.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from '@/const.js'; -import type { MiLocalUser, MiPartialLocalUser, MiPartialRemoteUser, MiRemoteUser, MiUser } from '@/models/entities/User.js'; -import { - birthdaySchema, - descriptionSchema, - localUsernameSchema, - locationSchema, - nameSchema, - passwordSchema, -} from '@/models/entities/User.js'; -import type { - AnnouncementReadsRepository, - AnnouncementsRepository, - BlockingsRepository, - ChannelFollowingsRepository, - DriveFilesRepository, - FollowingsRepository, - FollowRequestsRepository, - InstancesRepository, - MutingsRepository, - NoteUnreadsRepository, - PagesRepository, - RenoteMutingsRepository, - UserMemoRepository, - UserNotePiningsRepository, - MiUserProfile, - UserProfilesRepository, - UserSecurityKeysRepository, - UsersRepository, -} from '@/models/index.js'; +import type { MiLocalUser, MiPartialLocalUser, MiPartialRemoteUser, MiRemoteUser, MiUser } from '@/models/User.js'; +import { birthdaySchema, descriptionSchema, localUsernameSchema, locationSchema, nameSchema, passwordSchema } from '@/models/User.js'; +import type { UsersRepository, UserSecurityKeysRepository, FollowingsRepository, FollowRequestsRepository, BlockingsRepository, MutingsRepository, DriveFilesRepository, NoteUnreadsRepository, UserNotePiningsRepository, UserProfilesRepository, AnnouncementReadsRepository, AnnouncementsRepository, MiUserProfile, RenoteMutingsRepository, UserMemoRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; import { RoleService } from '@/core/RoleService.js'; import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js'; @@ -124,27 +98,18 @@ export class UserEntityService implements OnModuleInit { @Inject(DI.noteUnreadsRepository) private noteUnreadsRepository: NoteUnreadsRepository, - @Inject(DI.channelFollowingsRepository) - private channelFollowingsRepository: ChannelFollowingsRepository, - @Inject(DI.userNotePiningsRepository) private userNotePiningsRepository: UserNotePiningsRepository, @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, - @Inject(DI.instancesRepository) - private instancesRepository: InstancesRepository, - @Inject(DI.announcementReadsRepository) private announcementReadsRepository: AnnouncementReadsRepository, @Inject(DI.announcementsRepository) private announcementsRepository: AnnouncementsRepository, - @Inject(DI.pagesRepository) - private pagesRepository: PagesRepository, - @Inject(DI.userMemosRepository) private userMemosRepository: UserMemoRepository, @@ -182,15 +147,14 @@ export class UserEntityService implements OnModuleInit { @bindThis public async getRelation(me: MiUser['id'], target: MiUser['id']) { + const following = await this.followingsRepository.findOneBy({ + followerId: me, + followeeId: target, + }); return awaitAll({ id: target, - isFollowing: this.followingsRepository.count({ - where: { - followerId: me, - followeeId: target, - }, - take: 1, - }).then(n => n > 0), + following, + isFollowing: following != null, isFollowed: this.followingsRepository.count({ where: { followerId: target, @@ -313,7 +277,7 @@ export class UserEntityService implements OnModuleInit { public async pack( src: MiUser['id'] | MiUser, - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id']; } | null | undefined, options?: { detail?: D, includeSecrets?: boolean, @@ -423,6 +387,7 @@ export class UserEntityService implements OnModuleInit { birthday: profile!.birthday, lang: profile!.lang, fields: profile!.fields, + verifiedLinks: profile!.verifiedLinks, followersCount: followersCount ?? 0, followingCount: followingCount ?? 0, notesCount: user.notesCount, @@ -473,7 +438,7 @@ export class UserEntityService implements OnModuleInit { preventAiLearning: profile!.preventAiLearning, isExplorable: user.isExplorable, isDeleted: user.isDeleted, - twoFactorBackupCodes: profile?.twoFactorBackupSecret?.length === 20 ? 'full' : (profile?.twoFactorBackupSecret?.length ?? 0) > 0 ? 'partial' : 'none', + twoFactorBackupCodesStock: profile?.twoFactorBackupSecret?.length === 20 ? 'full' : (profile?.twoFactorBackupSecret?.length ?? 0) > 0 ? 'partial' : 'none', hideOnlineStatus: user.hideOnlineStatus, hasUnreadSpecifiedNotes: this.noteUnreadsRepository.count({ where: { userId: user.id, isSpecified: true }, @@ -524,6 +489,7 @@ export class UserEntityService implements OnModuleInit { isBlocked: relation.isBlocked, isMuted: relation.isMuted, isRenoteMuted: relation.isRenoteMuted, + notify: relation.following?.notify ?? 'none', } : {}), } as Promiseable> as Promiseable>; @@ -532,7 +498,7 @@ export class UserEntityService implements OnModuleInit { public async packMany( users: (MiUser['id'] | MiUser)[], - me: { id: MiUser['id'] } | null | undefined, + me?: { id: MiUser['id'] } | null | undefined, options?: { detail?: D, includeSecrets?: boolean, diff --git a/packages/backend/src/core/entities/UserListEntityService.ts b/packages/backend/src/core/entities/UserListEntityService.ts index 7797ec5d39..a7f2885194 100644 --- a/packages/backend/src/core/entities/UserListEntityService.ts +++ b/packages/backend/src/core/entities/UserListEntityService.ts @@ -5,11 +5,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { UserListJoiningsRepository, UserListsRepository } from '@/models/index.js'; +import type { UserListJoiningsRepository, UserListsRepository } from '@/models/_.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiUserList } from '@/models/entities/UserList.js'; +import type { } from '@/models/Blocking.js'; +import type { MiUserList } from '@/models/UserList.js'; import { bindThis } from '@/decorators.js'; -import { UserEntityService } from './UserEntityService.js'; @Injectable() export class UserListEntityService { @@ -19,8 +19,6 @@ export class UserListEntityService { @Inject(DI.userListJoiningsRepository) private userListJoiningsRepository: UserListJoiningsRepository, - - private userEntityService: UserEntityService, ) { } diff --git a/packages/backend/src/daemons/QueueStatsService.ts b/packages/backend/src/daemons/QueueStatsService.ts index dc9482f022..5edc0f45ab 100644 --- a/packages/backend/src/daemons/QueueStatsService.ts +++ b/packages/backend/src/daemons/QueueStatsService.ts @@ -19,7 +19,7 @@ const interval = 10000; @Injectable() export class QueueStatsService implements OnApplicationShutdown { - private intervalId: NodeJS.Timer; + private intervalId: NodeJS.Timeout; constructor( @Inject(DI.config) diff --git a/packages/backend/src/daemons/ServerStatsService.ts b/packages/backend/src/daemons/ServerStatsService.ts index 95026099e8..d294628740 100644 --- a/packages/backend/src/daemons/ServerStatsService.ts +++ b/packages/backend/src/daemons/ServerStatsService.ts @@ -20,7 +20,7 @@ const round = (num: number) => Math.round(num * 10) / 10; @Injectable() export class ServerStatsService implements OnApplicationShutdown { - private intervalId: NodeJS.Timer | null = null; + private intervalId: NodeJS.Timeout | null = null; constructor( private metaService: MetaService, diff --git a/packages/backend/src/logger.ts b/packages/backend/src/logger.ts index 92ea3d13a1..5c10559ec6 100644 --- a/packages/backend/src/logger.ts +++ b/packages/backend/src/logger.ts @@ -18,6 +18,7 @@ type Context = { type Level = 'error' | 'success' | 'warning' | 'debug' | 'info'; +// eslint-disable-next-line import/no-default-export export default class Logger { private context: Context; private parentLogger: Logger | null = null; diff --git a/packages/backend/src/misc/cache.ts b/packages/backend/src/misc/cache.ts index 046d4d6c2f..c235871931 100644 --- a/packages/backend/src/misc/cache.ts +++ b/packages/backend/src/misc/cache.ts @@ -193,7 +193,7 @@ function nothingToDo(value: T): V { export class MemoryKVCache { public cache: Map; private lifetime: number; - private gcIntervalHandle: NodeJS.Timer; + private gcIntervalHandle: NodeJS.Timeout; private toMapConverter: (value: T) => V; private fromMapConverter: (cached: V) => T | undefined; diff --git a/packages/backend/src/misc/check-word-mute.ts b/packages/backend/src/misc/check-word-mute.ts index a7a60c20e9..cef5595451 100644 --- a/packages/backend/src/misc/check-word-mute.ts +++ b/packages/backend/src/misc/check-word-mute.ts @@ -5,8 +5,8 @@ import { AhoCorasick } from 'slacc'; import RE2 from 're2'; -import type { MiNote } from '@/models/entities/Note.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiNote } from '@/models/Note.js'; +import type { MiUser } from '@/models/User.js'; type NoteLike = { userId: MiNote['userId']; diff --git a/packages/backend/src/misc/correct-filename.ts b/packages/backend/src/misc/correct-filename.ts index a702f0be0d..9130af44c3 100644 --- a/packages/backend/src/misc/correct-filename.ts +++ b/packages/backend/src/misc/correct-filename.ts @@ -3,18 +3,56 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -// 与えられた拡張子とファイル名が一致しているかどうかを確認し、 -// 一致していない場合は拡張子を付与して返す +/** + * Array.includes()よりSet.has()の方が高速 + */ +const targetExtsToSkip = new Set([ + '.gz', + '.tar', + '.tgz', + '.bz2', + '.xz', + '.zip', + '.7z', +]); + +const extRegExp = /\.[0-9a-zA-Z]+$/i; + +/** + * 与えられた拡張子とファイル名が一致しているかどうかを確認し、 + * 一致していない場合は拡張子を付与して返す + * + * extはfile-typeのextを想定 + */ export function correctFilename(filename: string, ext: string | null) { - const dotExt = ext ? ext.startsWith('.') ? ext : `.${ext}` : '.unknown'; - if (filename.endsWith(dotExt)) { - return filename; - } - if (ext === 'jpg' && filename.endsWith('.jpeg')) { - return filename; - } - if (ext === 'tif' && filename.endsWith('.tiff')) { + const dotExt = ext ? ext[0] === '.' ? ext : `.${ext}` : '.unknown'; + + const match = extRegExp.exec(filename); + if (!match || !match[0]) { + // filenameが拡張子を持っていない場合は拡張子をつける + return `${filename}${dotExt}`; + } + + const filenameExt = match[0].toLowerCase(); + if ( + // 未知のファイル形式かつ拡張子がある場合は何もしない + ext === null || + // 拡張子が一致している場合は何もしない + filenameExt === dotExt || + + // jpeg, tiffを同一視 + dotExt === '.jpg' && filenameExt === '.jpeg' || + dotExt === '.tif' && filenameExt === '.tiff' || + // dllもexeもportable executableなので判定が正しく行われない + dotExt === '.exe' && filenameExt === '.dll' || + + // 圧縮形式っぽければ下手に拡張子を変えない + // https://github.com/misskey-dev/misskey/issues/11482 + targetExtsToSkip.has(dotExt) + ) { return filename; } + + // 拡張子があるが一致していないなどの場合は拡張子を付け足す return `${filename}${dotExt}`; } diff --git a/packages/backend/src/misc/generate-native-user-token.ts b/packages/backend/src/misc/generate-native-user-token.ts index bfde2bc489..094c625120 100644 --- a/packages/backend/src/misc/generate-native-user-token.ts +++ b/packages/backend/src/misc/generate-native-user-token.ts @@ -5,4 +5,5 @@ import { secureRndstr } from '@/misc/secure-rndstr.js'; +// eslint-disable-next-line import/no-default-export export default () => secureRndstr(16); diff --git a/packages/backend/src/misc/get-reaction-emoji.ts b/packages/backend/src/misc/get-reaction-emoji.ts index eac6630968..80ef7ff7bc 100644 --- a/packages/backend/src/misc/get-reaction-emoji.ts +++ b/packages/backend/src/misc/get-reaction-emoji.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +// eslint-disable-next-line import/no-default-export export default function(reaction: string): string { switch (reaction) { case 'like': return '👍'; diff --git a/packages/backend/src/misc/id/aidx.ts b/packages/backend/src/misc/id/aidx.ts new file mode 100644 index 0000000000..5b031ea4c0 --- /dev/null +++ b/packages/backend/src/misc/id/aidx.ts @@ -0,0 +1,44 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +// AIDX +// 長さ8の[2000年1月1日からの経過ミリ秒をbase36でエンコードしたもの] + 長さ4の[個体ID] + 長さ4の[カウンタ] +// (c) mei23 +// https://misskey.m544.net/notes/71899acdcc9859ec5708ac24 + +import { customAlphabet } from 'nanoid'; + +export const aidxRegExp = /^[0-9a-z]{16}$/; + +const TIME2000 = 946684800000; +const TIME_LENGTH = 8; +const NODE_LENGTH = 4; +const NOISE_LENGTH = 4; + +const nodeId = customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', NODE_LENGTH)(); +let counter = 0; + +function getTime(time: number): string { + time = time - TIME2000; + if (time < 0) time = 0; + + return time.toString(36).padStart(TIME_LENGTH, '0').slice(-TIME_LENGTH); +} + +function getNoise(): string { + return counter.toString(36).padStart(NOISE_LENGTH, '0').slice(-NOISE_LENGTH); +} + +export function genAidx(date: Date): string { + const t = date.getTime(); + if (isNaN(t)) throw new Error('Failed to create AIDX: Invalid Date'); + counter++; + return getTime(t) + nodeId + getNoise(); +} + +export function parseAidx(id: string): { date: Date; } { + const time = parseInt(id.slice(0, TIME_LENGTH), 36) + TIME2000; + return { date: new Date(time) }; +} diff --git a/packages/backend/src/misc/is-native-token.ts b/packages/backend/src/misc/is-native-token.ts index 3046e72a34..618e60b7d8 100644 --- a/packages/backend/src/misc/is-native-token.ts +++ b/packages/backend/src/misc/is-native-token.ts @@ -3,4 +3,5 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +// eslint-disable-next-line import/no-default-export export default (token: string) => token.length === 16; diff --git a/packages/backend/src/misc/is-quote.ts b/packages/backend/src/misc/is-quote.ts index 34c7477bc5..059f6a4b5f 100644 --- a/packages/backend/src/misc/is-quote.ts +++ b/packages/backend/src/misc/is-quote.ts @@ -3,8 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiNote } from '@/models/Note.js'; +// eslint-disable-next-line import/no-default-export export default function(note: MiNote): boolean { return note.renoteId != null && (note.text != null || note.hasPoll || (note.fileIds != null && note.fileIds.length > 0)); } diff --git a/packages/backend/src/misc/json-schema.ts b/packages/backend/src/misc/json-schema.ts index 4cc53cf547..0d62694670 100644 --- a/packages/backend/src/misc/json-schema.ts +++ b/packages/backend/src/misc/json-schema.ts @@ -20,9 +20,8 @@ import { packedChannelSchema } from '@/models/json-schema/channel.js'; import { packedClipSchema } from '@/models/json-schema/clip.js'; import { packedDriveFileSchema } from '@/models/json-schema/drive-file.js'; import { packedDriveFolderSchema } from '@/models/json-schema/drive-folder.js'; -import { packedEmojiDetailedSchema, packedEmojiSimpleSchema } from '@/models/json-schema/emoji.js'; import { packedFederationInstanceSchema } from '@/models/json-schema/federation-instance.js'; -import { packedFlashLikeSchema, packedFlashSchema } from '@/models/json-schema/flash.js'; +import { packedFlashLikeSchema } from '@/models/json-schema/flash.js'; import { packedFollowRequestSchema, packedFollowingSchema } from '@/models/json-schema/following.js'; import { packedGalleryLikeSchema, packedGalleryPostSchema } from '@/models/json-schema/gallery.js'; import { packedHashtagSchema } from '@/models/json-schema/hashtag.js'; @@ -35,6 +34,8 @@ import { packedNoteSchema } from '@/models/json-schema/note.js'; import { packedNotificationSchema } from '@/models/json-schema/notification.js'; import { packedPageLikeSchema, packedPageSchema } from '@/models/json-schema/page.js'; import { packedQueueCountSchema } from '@/models/json-schema/queue.js'; +import { packedEmojiDetailedSchema, packedEmojiSimpleSchema } from '@/models/json-schema/emoji.js'; +import { packedFlashSchema } from '@/models/json-schema/flash.js'; import { packedRenoteMutingSchema } from '@/models/json-schema/renote-muting.js'; import { packedRoleSchema } from '@/models/json-schema/role.js'; import { packedUserListSchema } from '@/models/json-schema/user-list.js'; diff --git a/packages/backend/src/models/entities/AbuseReportResolver.ts b/packages/backend/src/models/AbuseReportResolver.ts similarity index 97% rename from packages/backend/src/models/entities/AbuseReportResolver.ts rename to packages/backend/src/models/AbuseReportResolver.ts index 409b74050b..47dc4f1e5c 100644 --- a/packages/backend/src/models/entities/AbuseReportResolver.ts +++ b/packages/backend/src/models/AbuseReportResolver.ts @@ -4,7 +4,7 @@ */ import { Column, Entity, PrimaryColumn, Index } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; @Entity('abuse_report_resolver') export class MiAbuseReportResolver { diff --git a/packages/backend/src/models/entities/AbuseUserReport.ts b/packages/backend/src/models/AbuseUserReport.ts similarity index 97% rename from packages/backend/src/models/entities/AbuseUserReport.ts rename to packages/backend/src/models/AbuseUserReport.ts index 522cc502cc..2551af7cb6 100644 --- a/packages/backend/src/models/entities/AbuseUserReport.ts +++ b/packages/backend/src/models/AbuseUserReport.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('abuse_user_report') diff --git a/packages/backend/src/models/entities/AccessToken.ts b/packages/backend/src/models/AccessToken.ts similarity index 97% rename from packages/backend/src/models/entities/AccessToken.ts rename to packages/backend/src/models/AccessToken.ts index 08bd2483ee..5a6269a729 100644 --- a/packages/backend/src/models/entities/AccessToken.ts +++ b/packages/backend/src/models/AccessToken.ts @@ -4,7 +4,7 @@ */ import { Entity, PrimaryColumn, Index, Column, ManyToOne, JoinColumn } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiApp } from './App.js'; diff --git a/packages/backend/src/models/entities/Ad.ts b/packages/backend/src/models/Ad.ts similarity index 97% rename from packages/backend/src/models/entities/Ad.ts rename to packages/backend/src/models/Ad.ts index 2f84e7144e..6dfc9cb30e 100644 --- a/packages/backend/src/models/entities/Ad.ts +++ b/packages/backend/src/models/Ad.ts @@ -4,7 +4,7 @@ */ import { Entity, Index, Column, PrimaryColumn } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; @Entity('ad') export class MiAd { diff --git a/packages/backend/src/models/entities/Announcement.ts b/packages/backend/src/models/Announcement.ts similarity index 98% rename from packages/backend/src/models/entities/Announcement.ts rename to packages/backend/src/models/Announcement.ts index f84619fe3f..4c64f8d988 100644 --- a/packages/backend/src/models/entities/Announcement.ts +++ b/packages/backend/src/models/Announcement.ts @@ -4,7 +4,7 @@ */ import { Entity, Index, Column, PrimaryColumn, ManyToOne, JoinColumn } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('announcement') diff --git a/packages/backend/src/models/entities/AnnouncementRead.ts b/packages/backend/src/models/AnnouncementRead.ts similarity index 96% rename from packages/backend/src/models/entities/AnnouncementRead.ts rename to packages/backend/src/models/AnnouncementRead.ts index 89dadaab37..3d6ec5652c 100644 --- a/packages/backend/src/models/entities/AnnouncementRead.ts +++ b/packages/backend/src/models/AnnouncementRead.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiAnnouncement } from './Announcement.js'; diff --git a/packages/backend/src/models/entities/Antenna.ts b/packages/backend/src/models/Antenna.ts similarity index 90% rename from packages/backend/src/models/entities/Antenna.ts rename to packages/backend/src/models/Antenna.ts index e73a4d55c6..dc398b6dd2 100644 --- a/packages/backend/src/models/entities/Antenna.ts +++ b/packages/backend/src/models/Antenna.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiUserList } from './UserList.js'; @@ -41,8 +41,8 @@ export class MiAntenna { }) public name: string; - @Column('enum', { enum: ['home', 'all', 'users', 'list'] }) - public src: 'home' | 'all' | 'users' | 'list'; + @Column('enum', { enum: ['home', 'all', 'users', 'list', 'users_blacklist'] }) + public src: 'home' | 'all' | 'users' | 'list' | 'users_blacklist'; @Column({ ...id(), diff --git a/packages/backend/src/models/entities/App.ts b/packages/backend/src/models/App.ts similarity index 97% rename from packages/backend/src/models/entities/App.ts rename to packages/backend/src/models/App.ts index 99c41a2035..c599ef8be0 100644 --- a/packages/backend/src/models/entities/App.ts +++ b/packages/backend/src/models/App.ts @@ -4,7 +4,7 @@ */ import { Entity, PrimaryColumn, Column, Index, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('app') diff --git a/packages/backend/src/models/entities/AuthSession.ts b/packages/backend/src/models/AuthSession.ts similarity index 96% rename from packages/backend/src/models/entities/AuthSession.ts rename to packages/backend/src/models/AuthSession.ts index 1aabf836db..d9de6b6979 100644 --- a/packages/backend/src/models/entities/AuthSession.ts +++ b/packages/backend/src/models/AuthSession.ts @@ -4,7 +4,7 @@ */ import { Entity, PrimaryColumn, Index, Column, ManyToOne, JoinColumn } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiApp } from './App.js'; diff --git a/packages/backend/src/models/entities/Blocking.ts b/packages/backend/src/models/Blocking.ts similarity index 96% rename from packages/backend/src/models/entities/Blocking.ts rename to packages/backend/src/models/Blocking.ts index 8bedb4395c..1e3dd3a644 100644 --- a/packages/backend/src/models/entities/Blocking.ts +++ b/packages/backend/src/models/Blocking.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('blocking') diff --git a/packages/backend/src/models/entities/Channel.ts b/packages/backend/src/models/Channel.ts similarity index 94% rename from packages/backend/src/models/entities/Channel.ts rename to packages/backend/src/models/Channel.ts index be0b3f8746..ae3886a657 100644 --- a/packages/backend/src/models/entities/Channel.ts +++ b/packages/backend/src/models/Channel.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiDriveFile } from './DriveFile.js'; @@ -94,4 +94,9 @@ export class MiChannel { comment: 'The count of users.', }) public usersCount: number; + + @Column('boolean', { + default: false, + }) + public isSensitive: boolean; } diff --git a/packages/backend/src/models/entities/ChannelFavorite.ts b/packages/backend/src/models/ChannelFavorite.ts similarity index 96% rename from packages/backend/src/models/entities/ChannelFavorite.ts rename to packages/backend/src/models/ChannelFavorite.ts index c2be68ab7d..ab74aa5530 100644 --- a/packages/backend/src/models/entities/ChannelFavorite.ts +++ b/packages/backend/src/models/ChannelFavorite.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiChannel } from './Channel.js'; diff --git a/packages/backend/src/models/entities/ChannelFollowing.ts b/packages/backend/src/models/ChannelFollowing.ts similarity index 96% rename from packages/backend/src/models/entities/ChannelFollowing.ts rename to packages/backend/src/models/ChannelFollowing.ts index dc33eb144b..c62a95332a 100644 --- a/packages/backend/src/models/entities/ChannelFollowing.ts +++ b/packages/backend/src/models/ChannelFollowing.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiChannel } from './Channel.js'; diff --git a/packages/backend/src/models/entities/Clip.ts b/packages/backend/src/models/Clip.ts similarity index 96% rename from packages/backend/src/models/entities/Clip.ts rename to packages/backend/src/models/Clip.ts index f8bc2f2173..c60b2964e0 100644 --- a/packages/backend/src/models/entities/Clip.ts +++ b/packages/backend/src/models/Clip.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('clip') diff --git a/packages/backend/src/models/entities/ClipFavorite.ts b/packages/backend/src/models/ClipFavorite.ts similarity index 95% rename from packages/backend/src/models/entities/ClipFavorite.ts rename to packages/backend/src/models/ClipFavorite.ts index 74d765411d..054764389b 100644 --- a/packages/backend/src/models/entities/ClipFavorite.ts +++ b/packages/backend/src/models/ClipFavorite.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiClip } from './Clip.js'; diff --git a/packages/backend/src/models/entities/ClipNote.ts b/packages/backend/src/models/ClipNote.ts similarity index 95% rename from packages/backend/src/models/entities/ClipNote.ts rename to packages/backend/src/models/ClipNote.ts index ed5458864f..b7cc5ee39b 100644 --- a/packages/backend/src/models/entities/ClipNote.ts +++ b/packages/backend/src/models/ClipNote.ts @@ -4,7 +4,7 @@ */ import { Entity, Index, JoinColumn, Column, ManyToOne, PrimaryColumn } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiNote } from './Note.js'; import { MiClip } from './Clip.js'; diff --git a/packages/backend/src/models/entities/DriveFile.ts b/packages/backend/src/models/DriveFile.ts similarity index 99% rename from packages/backend/src/models/entities/DriveFile.ts rename to packages/backend/src/models/DriveFile.ts index 55d6a9826c..c12f0e0f02 100644 --- a/packages/backend/src/models/entities/DriveFile.ts +++ b/packages/backend/src/models/DriveFile.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiDriveFolder } from './DriveFolder.js'; diff --git a/packages/backend/src/models/entities/DriveFolder.ts b/packages/backend/src/models/DriveFolder.ts similarity index 96% rename from packages/backend/src/models/entities/DriveFolder.ts rename to packages/backend/src/models/DriveFolder.ts index 614974af13..3e049136bd 100644 --- a/packages/backend/src/models/entities/DriveFolder.ts +++ b/packages/backend/src/models/DriveFolder.ts @@ -4,7 +4,7 @@ */ import { JoinColumn, ManyToOne, Entity, PrimaryColumn, Index, Column } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('drive_folder') diff --git a/packages/backend/src/models/entities/Emoji.ts b/packages/backend/src/models/Emoji.ts similarity index 98% rename from packages/backend/src/models/entities/Emoji.ts rename to packages/backend/src/models/Emoji.ts index 901363fc38..f05121317e 100644 --- a/packages/backend/src/models/entities/Emoji.ts +++ b/packages/backend/src/models/Emoji.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, Column } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; @Entity('emoji') @Index(['name', 'host'], { unique: true }) diff --git a/packages/backend/src/models/entities/Flash.ts b/packages/backend/src/models/Flash.ts similarity index 83% rename from packages/backend/src/models/entities/Flash.ts rename to packages/backend/src/models/Flash.ts index af4553ee9b..185063029d 100644 --- a/packages/backend/src/models/entities/Flash.ts +++ b/packages/backend/src/models/Flash.ts @@ -4,7 +4,7 @@ */ import { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('flash') @@ -61,4 +61,13 @@ export class MiFlash { default: 0, }) public likedCount: number; + + /** + * public ... 公開 + * private ... プロフィールには表示しない + */ + @Column('varchar', { + length: 512, default: 'public', + }) + public visibility: 'public' | 'private'; } diff --git a/packages/backend/src/models/entities/FlashLike.ts b/packages/backend/src/models/FlashLike.ts similarity index 95% rename from packages/backend/src/models/entities/FlashLike.ts rename to packages/backend/src/models/FlashLike.ts index 9486be3ea6..7c66010ae6 100644 --- a/packages/backend/src/models/entities/FlashLike.ts +++ b/packages/backend/src/models/FlashLike.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiFlash } from './Flash.js'; diff --git a/packages/backend/src/models/entities/FollowRequest.ts b/packages/backend/src/models/FollowRequest.ts similarity index 98% rename from packages/backend/src/models/entities/FollowRequest.ts rename to packages/backend/src/models/FollowRequest.ts index 28385931b7..769b9a6cb5 100644 --- a/packages/backend/src/models/entities/FollowRequest.ts +++ b/packages/backend/src/models/FollowRequest.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('follow_request') diff --git a/packages/backend/src/models/entities/Following.ts b/packages/backend/src/models/Following.ts similarity index 92% rename from packages/backend/src/models/entities/Following.ts rename to packages/backend/src/models/Following.ts index df509cf944..8c9f965fad 100644 --- a/packages/backend/src/models/entities/Following.ts +++ b/packages/backend/src/models/Following.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('following') @@ -45,6 +45,13 @@ export class MiFollowing { @JoinColumn() public follower: MiUser | null; + @Index() + @Column('varchar', { + length: 32, + nullable: true, + }) + public notify: 'normal' | null; + //#region Denormalized fields @Index() @Column('varchar', { diff --git a/packages/backend/src/models/entities/GalleryLike.ts b/packages/backend/src/models/GalleryLike.ts similarity index 95% rename from packages/backend/src/models/entities/GalleryLike.ts rename to packages/backend/src/models/GalleryLike.ts index 40aeeaad0c..b5f71764aa 100644 --- a/packages/backend/src/models/entities/GalleryLike.ts +++ b/packages/backend/src/models/GalleryLike.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiGalleryPost } from './GalleryPost.js'; diff --git a/packages/backend/src/models/entities/GalleryPost.ts b/packages/backend/src/models/GalleryPost.ts similarity index 97% rename from packages/backend/src/models/entities/GalleryPost.ts rename to packages/backend/src/models/GalleryPost.ts index 777fe942e1..4c6063f32b 100644 --- a/packages/backend/src/models/entities/GalleryPost.ts +++ b/packages/backend/src/models/GalleryPost.ts @@ -4,7 +4,7 @@ */ import { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import type { MiDriveFile } from './DriveFile.js'; diff --git a/packages/backend/src/models/entities/Hashtag.ts b/packages/backend/src/models/Hashtag.ts similarity index 97% rename from packages/backend/src/models/entities/Hashtag.ts rename to packages/backend/src/models/Hashtag.ts index 30fea91b7d..1493774752 100644 --- a/packages/backend/src/models/entities/Hashtag.ts +++ b/packages/backend/src/models/Hashtag.ts @@ -4,7 +4,7 @@ */ import { Entity, PrimaryColumn, Index, Column } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import type { MiUser } from './User.js'; @Entity('hashtag') diff --git a/packages/backend/src/models/entities/Instance.ts b/packages/backend/src/models/Instance.ts similarity index 98% rename from packages/backend/src/models/entities/Instance.ts rename to packages/backend/src/models/Instance.ts index 8c562ffa80..b225d918d6 100644 --- a/packages/backend/src/models/entities/Instance.ts +++ b/packages/backend/src/models/Instance.ts @@ -4,7 +4,7 @@ */ import { Entity, PrimaryColumn, Index, Column } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; @Entity('instance') export class MiInstance { diff --git a/packages/backend/src/models/entities/Meta.ts b/packages/backend/src/models/Meta.ts similarity index 95% rename from packages/backend/src/models/entities/Meta.ts rename to packages/backend/src/models/Meta.ts index 5f850a81e6..e69bef8e98 100644 --- a/packages/backend/src/models/entities/Meta.ts +++ b/packages/backend/src/models/Meta.ts @@ -4,7 +4,7 @@ */ import { Entity, Column, PrimaryColumn, ManyToOne, JoinColumn } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('meta') @@ -20,6 +20,11 @@ export class MiMeta { }) public name: string | null; + @Column('varchar', { + length: 64, nullable: true, + }) + public shortName: string | null; + @Column('varchar', { length: 1024, nullable: true, }) @@ -107,6 +112,18 @@ export class MiMeta { }) public iconUrl: string | null; + @Column('varchar', { + length: 1024, + nullable: true, + }) + public app192IconUrl: string | null; + + @Column('varchar', { + length: 1024, + nullable: true, + }) + public app512IconUrl: string | null; + @Column('varchar', { length: 1024, nullable: true, @@ -126,7 +143,7 @@ export class MiMeta { public infoImageUrl: string | null; @Column('boolean', { - default: true, + default: false, }) public cacheRemoteFiles: boolean; @@ -444,6 +461,12 @@ export class MiMeta { }) public serverRules: string[]; + @Column('varchar', { + length: 8192, + default: '{}', + }) + public manifestJsonOverride: string; + @Column('varchar', { length: 1024, array: true, default: '{ "admin", "administrator", "root", "system", "maintainer", "host", "mod", "moderator", "owner", "superuser", "staff", "auth", "i", "me", "everyone", "all", "mention", "mentions", "example", "user", "users", "account", "accounts", "official", "help", "helps", "support", "supports", "info", "information", "informations", "announce", "announces", "announcement", "announcements", "notice", "notification", "notifications", "dev", "developer", "developers", "tech", "misskey" }', }) diff --git a/packages/backend/src/models/entities/ModerationLog.ts b/packages/backend/src/models/ModerationLog.ts similarity index 95% rename from packages/backend/src/models/entities/ModerationLog.ts rename to packages/backend/src/models/ModerationLog.ts index 027645de6b..a12b6ab614 100644 --- a/packages/backend/src/models/entities/ModerationLog.ts +++ b/packages/backend/src/models/ModerationLog.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('moderation_log') diff --git a/packages/backend/src/models/entities/MutedNote.ts b/packages/backend/src/models/MutedNote.ts similarity index 96% rename from packages/backend/src/models/entities/MutedNote.ts rename to packages/backend/src/models/MutedNote.ts index a170bdf713..89a678a2a7 100644 --- a/packages/backend/src/models/entities/MutedNote.ts +++ b/packages/backend/src/models/MutedNote.ts @@ -5,7 +5,7 @@ import { Entity, Index, JoinColumn, Column, ManyToOne, PrimaryColumn } from 'typeorm'; import { mutedNoteReasons } from '@/types.js'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiNote } from './Note.js'; import { MiUser } from './User.js'; diff --git a/packages/backend/src/models/entities/Muting.ts b/packages/backend/src/models/Muting.ts similarity index 96% rename from packages/backend/src/models/entities/Muting.ts rename to packages/backend/src/models/Muting.ts index b1f12f0118..2f06ca8e5e 100644 --- a/packages/backend/src/models/entities/Muting.ts +++ b/packages/backend/src/models/Muting.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('muting') diff --git a/packages/backend/src/models/entities/Note.ts b/packages/backend/src/models/Note.ts similarity index 96% rename from packages/backend/src/models/entities/Note.ts rename to packages/backend/src/models/Note.ts index 42343f015b..ed86d4549e 100644 --- a/packages/backend/src/models/entities/Note.ts +++ b/packages/backend/src/models/Note.ts @@ -4,8 +4,8 @@ */ import { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; -import { noteVisibilities } from '../../types.js'; +import { noteVisibilities } from '@/types.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiChannel } from './Channel.js'; import type { MiDriveFile } from './DriveFile.js'; @@ -107,6 +107,11 @@ export class MiNote { }) public repliesCount: number; + @Column('smallint', { + default: 0, + }) + public clippedCount: number; + @Column('jsonb', { default: {}, }) diff --git a/packages/backend/src/models/entities/NoteFavorite.ts b/packages/backend/src/models/NoteFavorite.ts similarity index 96% rename from packages/backend/src/models/entities/NoteFavorite.ts rename to packages/backend/src/models/NoteFavorite.ts index 1b637e6b92..1171684bcf 100644 --- a/packages/backend/src/models/entities/NoteFavorite.ts +++ b/packages/backend/src/models/NoteFavorite.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiNote } from './Note.js'; import { MiUser } from './User.js'; diff --git a/packages/backend/src/models/entities/NoteReaction.ts b/packages/backend/src/models/NoteReaction.ts similarity index 96% rename from packages/backend/src/models/entities/NoteReaction.ts rename to packages/backend/src/models/NoteReaction.ts index 19511abd12..7c08d31c6d 100644 --- a/packages/backend/src/models/entities/NoteReaction.ts +++ b/packages/backend/src/models/NoteReaction.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiNote } from './Note.js'; diff --git a/packages/backend/src/models/entities/NoteThreadMuting.ts b/packages/backend/src/models/NoteThreadMuting.ts similarity index 95% rename from packages/backend/src/models/entities/NoteThreadMuting.ts rename to packages/backend/src/models/NoteThreadMuting.ts index d8ccbe0f74..2d120e4c25 100644 --- a/packages/backend/src/models/entities/NoteThreadMuting.ts +++ b/packages/backend/src/models/NoteThreadMuting.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('note_thread_muting') diff --git a/packages/backend/src/models/entities/NoteUnread.ts b/packages/backend/src/models/NoteUnread.ts similarity index 97% rename from packages/backend/src/models/entities/NoteUnread.ts rename to packages/backend/src/models/NoteUnread.ts index 0f111cc1b0..d86a474553 100644 --- a/packages/backend/src/models/entities/NoteUnread.ts +++ b/packages/backend/src/models/NoteUnread.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiNote } from './Note.js'; import type { MiChannel } from './Channel.js'; diff --git a/packages/backend/src/models/entities/Notification.ts b/packages/backend/src/models/Notification.ts similarity index 67% rename from packages/backend/src/models/entities/Notification.ts rename to packages/backend/src/models/Notification.ts index 94c7084cf0..c0a9df2e23 100644 --- a/packages/backend/src/models/entities/Notification.ts +++ b/packages/backend/src/models/Notification.ts @@ -22,17 +22,6 @@ export type MiNotification = { /** * 通知の種類。 - * follow - フォローされた - * mention - 投稿で自分が言及された - * reply - 投稿に返信された - * renote - 投稿がRenoteされた - * quote - 投稿が引用Renoteされた - * reaction - 投稿にリアクションされた - * pollEnded - 自分のアンケートもしくは自分が投票したアンケートが終了した - * receiveFollowRequest - フォローリクエストされた - * followRequestAccepted - 自分の送ったフォローリクエストが承認された - * achievementEarned - 実績を獲得 - * app - アプリ通知 */ type: typeof notificationTypes[number]; diff --git a/packages/backend/src/models/entities/Page.ts b/packages/backend/src/models/Page.ts similarity index 98% rename from packages/backend/src/models/entities/Page.ts rename to packages/backend/src/models/Page.ts index 30131af85c..3cb986f4ee 100644 --- a/packages/backend/src/models/entities/Page.ts +++ b/packages/backend/src/models/Page.ts @@ -4,7 +4,7 @@ */ import { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiDriveFile } from './DriveFile.js'; diff --git a/packages/backend/src/models/entities/PageLike.ts b/packages/backend/src/models/PageLike.ts similarity index 95% rename from packages/backend/src/models/entities/PageLike.ts rename to packages/backend/src/models/PageLike.ts index 36f5177cff..92adf9bcc2 100644 --- a/packages/backend/src/models/entities/PageLike.ts +++ b/packages/backend/src/models/PageLike.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiPage } from './Page.js'; diff --git a/packages/backend/src/models/entities/PasswordResetRequest.ts b/packages/backend/src/models/PasswordResetRequest.ts similarity index 95% rename from packages/backend/src/models/entities/PasswordResetRequest.ts rename to packages/backend/src/models/PasswordResetRequest.ts index 4c608d979c..79f2e984b8 100644 --- a/packages/backend/src/models/entities/PasswordResetRequest.ts +++ b/packages/backend/src/models/PasswordResetRequest.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, Column, ManyToOne, JoinColumn } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('password_reset_request') diff --git a/packages/backend/src/models/entities/Poll.ts b/packages/backend/src/models/Poll.ts similarity index 94% rename from packages/backend/src/models/entities/Poll.ts rename to packages/backend/src/models/Poll.ts index 557fd1be11..5ce0b9a2fc 100644 --- a/packages/backend/src/models/entities/Poll.ts +++ b/packages/backend/src/models/Poll.ts @@ -4,8 +4,8 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, OneToOne } from 'typeorm'; -import { id } from '../id.js'; -import { noteVisibilities } from '../../types.js'; +import { noteVisibilities } from '@/types.js'; +import { id } from './util/id.js'; import { MiNote } from './Note.js'; import type { MiUser } from './User.js'; diff --git a/packages/backend/src/models/entities/PollVote.ts b/packages/backend/src/models/PollVote.ts similarity index 96% rename from packages/backend/src/models/entities/PollVote.ts rename to packages/backend/src/models/PollVote.ts index 5070ab16c0..37cd55fc18 100644 --- a/packages/backend/src/models/entities/PollVote.ts +++ b/packages/backend/src/models/PollVote.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiNote } from './Note.js'; diff --git a/packages/backend/src/models/entities/PromoNote.ts b/packages/backend/src/models/PromoNote.ts similarity index 95% rename from packages/backend/src/models/entities/PromoNote.ts rename to packages/backend/src/models/PromoNote.ts index 9daf915b51..f4425fe88b 100644 --- a/packages/backend/src/models/entities/PromoNote.ts +++ b/packages/backend/src/models/PromoNote.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, OneToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiNote } from './Note.js'; import type { MiUser } from './User.js'; diff --git a/packages/backend/src/models/entities/PromoRead.ts b/packages/backend/src/models/PromoRead.ts similarity index 95% rename from packages/backend/src/models/entities/PromoRead.ts rename to packages/backend/src/models/PromoRead.ts index 83a12858e8..09ebfc8346 100644 --- a/packages/backend/src/models/entities/PromoRead.ts +++ b/packages/backend/src/models/PromoRead.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiNote } from './Note.js'; import { MiUser } from './User.js'; diff --git a/packages/backend/src/models/entities/RegistrationTicket.ts b/packages/backend/src/models/RegistrationTicket.ts similarity index 97% rename from packages/backend/src/models/entities/RegistrationTicket.ts rename to packages/backend/src/models/RegistrationTicket.ts index 2b1c541a28..d94f465916 100644 --- a/packages/backend/src/models/entities/RegistrationTicket.ts +++ b/packages/backend/src/models/RegistrationTicket.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, Column, ManyToOne, JoinColumn, OneToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('registration_ticket') diff --git a/packages/backend/src/models/entities/RegistryItem.ts b/packages/backend/src/models/RegistryItem.ts similarity index 97% rename from packages/backend/src/models/entities/RegistryItem.ts rename to packages/backend/src/models/RegistryItem.ts index fdfa4212d0..fdce57c467 100644 --- a/packages/backend/src/models/entities/RegistryItem.ts +++ b/packages/backend/src/models/RegistryItem.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; // TODO: 同じdomain、同じscope、同じkeyのレコードは二つ以上存在しないように制約付けたい diff --git a/packages/backend/src/models/entities/Relay.ts b/packages/backend/src/models/Relay.ts similarity index 93% rename from packages/backend/src/models/entities/Relay.ts rename to packages/backend/src/models/Relay.ts index f73ab193a6..293fccecfc 100644 --- a/packages/backend/src/models/entities/Relay.ts +++ b/packages/backend/src/models/Relay.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, Column } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; @Entity('relay') export class MiRelay { diff --git a/packages/backend/src/models/entities/RenoteMuting.ts b/packages/backend/src/models/RenoteMuting.ts similarity index 96% rename from packages/backend/src/models/entities/RenoteMuting.ts rename to packages/backend/src/models/RenoteMuting.ts index fc87b82b7d..d2a36249dc 100644 --- a/packages/backend/src/models/entities/RenoteMuting.ts +++ b/packages/backend/src/models/RenoteMuting.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('renote_muting') diff --git a/packages/backend/src/models/RepositoryModule.ts b/packages/backend/src/models/RepositoryModule.ts index 6d811b9c8f..927cf0db0c 100644 --- a/packages/backend/src/models/RepositoryModule.ts +++ b/packages/backend/src/models/RepositoryModule.ts @@ -5,7 +5,7 @@ import { Module } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import { MiUser, MiNote, MiAnnouncement, MiAnnouncementRead, MiApp, MiNoteFavorite, MiNoteThreadMuting, MiNoteReaction, MiNoteUnread, MiPoll, MiPollVote, MiUserProfile, MiUserKeypair, MiUserPending, MiUserSecurityKey, MiUserPublickey, MiUserList, MiUserListJoining, MiUserNotePining, MiUserIp, MiUsedUsername, MiFollowing, MiFollowRequest, MiInstance, MiEmoji, MiDriveFile, MiDriveFolder, MiMeta, MiMuting, MiRenoteMuting, MiBlocking, MiSwSubscription, MiHashtag, MiAbuseUserReport, MiRegistrationTicket, MiAuthSession, MiAccessToken, MiSignin, MiPage, MiPageLike, MiGalleryPost, MiGalleryLike, MiModerationLog, MiClip, MiClipNote, MiAntenna, MiPromoNote, MiPromoRead, MiRelay, MiMutedNote, MiChannel, MiChannelFollowing, MiChannelFavorite, MiRegistryItem, MiWebhook, MiAd, MiPasswordResetRequest, MiRetentionAggregation, MiFlashLike, MiFlash, MiRole, MiRoleAssignment, MiClipFavorite, MiUserMemo, MiUserListFavorite, MiAbuseReportResolver } from './index.js'; +import { MiAbuseReportResolver, MiAbuseUserReport, MiAccessToken, MiAd, MiAnnouncement, MiAnnouncementRead, MiAntenna, MiApp, MiAuthSession, MiBlocking, MiChannel, MiChannelFavorite, MiChannelFollowing, MiClip, MiClipFavorite, MiClipNote, MiDriveFile, MiDriveFolder, MiEmoji, MiFlash, MiFlashLike, MiFollowRequest, MiFollowing, MiGalleryLike, MiGalleryPost, MiHashtag, MiInstance, MiMeta, MiModerationLog, MiMutedNote, MiMuting, MiNote, MiNoteFavorite, MiNoteReaction, MiNoteThreadMuting, MiNoteUnread, MiPage, MiPageLike, MiPasswordResetRequest, MiPoll, MiPollVote, MiPromoNote, MiPromoRead, MiRegistrationTicket, MiRegistryItem, MiRelay, MiRenoteMuting, MiRetentionAggregation, MiRole, MiRoleAssignment, MiSignin, MiSwSubscription, MiUsedUsername, MiUser, MiUserIp, MiUserKeypair, MiUserList, MiUserListFavorite, MiUserListJoining, MiUserMemo, MiUserNotePining, MiUserPending, MiUserProfile, MiUserPublickey, MiUserSecurityKey, MiWebhook } from './_.js'; import type { DataSource } from 'typeorm'; import type { Provider } from '@nestjs/common'; diff --git a/packages/backend/src/models/entities/RetentionAggregation.ts b/packages/backend/src/models/RetentionAggregation.ts similarity index 96% rename from packages/backend/src/models/entities/RetentionAggregation.ts rename to packages/backend/src/models/RetentionAggregation.ts index 7d7874a601..9da401597c 100644 --- a/packages/backend/src/models/entities/RetentionAggregation.ts +++ b/packages/backend/src/models/RetentionAggregation.ts @@ -4,7 +4,7 @@ */ import { Entity, PrimaryColumn, Index, Column } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import type { MiUser } from './User.js'; @Entity('retention_aggregation') diff --git a/packages/backend/src/models/entities/Role.ts b/packages/backend/src/models/Role.ts similarity index 99% rename from packages/backend/src/models/entities/Role.ts rename to packages/backend/src/models/Role.ts index 52e1f0c347..df7541db3d 100644 --- a/packages/backend/src/models/entities/Role.ts +++ b/packages/backend/src/models/Role.ts @@ -4,7 +4,7 @@ */ import { Entity, Column, PrimaryColumn } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; type CondFormulaValueAnd = { type: 'and'; diff --git a/packages/backend/src/models/entities/RoleAssignment.ts b/packages/backend/src/models/RoleAssignment.ts similarity index 96% rename from packages/backend/src/models/entities/RoleAssignment.ts rename to packages/backend/src/models/RoleAssignment.ts index 5a2dacb91a..4e5322c60b 100644 --- a/packages/backend/src/models/entities/RoleAssignment.ts +++ b/packages/backend/src/models/RoleAssignment.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiRole } from './Role.js'; import { MiUser } from './User.js'; diff --git a/packages/backend/src/models/entities/Signin.ts b/packages/backend/src/models/Signin.ts similarity index 95% rename from packages/backend/src/models/entities/Signin.ts rename to packages/backend/src/models/Signin.ts index 709a998889..a8b1a45c53 100644 --- a/packages/backend/src/models/entities/Signin.ts +++ b/packages/backend/src/models/Signin.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('signin') diff --git a/packages/backend/src/models/entities/SwSubscription.ts b/packages/backend/src/models/SwSubscription.ts similarity index 96% rename from packages/backend/src/models/entities/SwSubscription.ts rename to packages/backend/src/models/SwSubscription.ts index 9c3f97cf99..be1e4e3687 100644 --- a/packages/backend/src/models/entities/SwSubscription.ts +++ b/packages/backend/src/models/SwSubscription.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('sw_subscription') diff --git a/packages/backend/src/models/entities/UsedUsername.ts b/packages/backend/src/models/UsedUsername.ts similarity index 100% rename from packages/backend/src/models/entities/UsedUsername.ts rename to packages/backend/src/models/UsedUsername.ts diff --git a/packages/backend/src/models/entities/User.ts b/packages/backend/src/models/User.ts similarity index 99% rename from packages/backend/src/models/entities/User.ts rename to packages/backend/src/models/User.ts index 9db141becf..b040d302ce 100644 --- a/packages/backend/src/models/entities/User.ts +++ b/packages/backend/src/models/User.ts @@ -4,7 +4,7 @@ */ import { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiDriveFile } from './DriveFile.js'; @Entity('user') diff --git a/packages/backend/src/models/entities/UserIp.ts b/packages/backend/src/models/UserIp.ts similarity index 94% rename from packages/backend/src/models/entities/UserIp.ts rename to packages/backend/src/models/UserIp.ts index 8384984e6b..60a7bc8b01 100644 --- a/packages/backend/src/models/entities/UserIp.ts +++ b/packages/backend/src/models/UserIp.ts @@ -4,7 +4,7 @@ */ import { Entity, Index, Column, PrimaryGeneratedColumn } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import type { MiUser } from './User.js'; @Entity('user_ip') diff --git a/packages/backend/src/models/entities/UserKeypair.ts b/packages/backend/src/models/UserKeypair.ts similarity index 95% rename from packages/backend/src/models/entities/UserKeypair.ts rename to packages/backend/src/models/UserKeypair.ts index c9ea7d11f8..a316dbaeb4 100644 --- a/packages/backend/src/models/entities/UserKeypair.ts +++ b/packages/backend/src/models/UserKeypair.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, JoinColumn, Column, OneToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('user_keypair') diff --git a/packages/backend/src/models/entities/UserList.ts b/packages/backend/src/models/UserList.ts similarity index 95% rename from packages/backend/src/models/entities/UserList.ts rename to packages/backend/src/models/UserList.ts index a6216b5670..9af85af97e 100644 --- a/packages/backend/src/models/entities/UserList.ts +++ b/packages/backend/src/models/UserList.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('user_list') diff --git a/packages/backend/src/models/entities/UserListFavorite.ts b/packages/backend/src/models/UserListFavorite.ts similarity index 95% rename from packages/backend/src/models/entities/UserListFavorite.ts rename to packages/backend/src/models/UserListFavorite.ts index f3c4c1a4d8..d0b054b932 100644 --- a/packages/backend/src/models/entities/UserListFavorite.ts +++ b/packages/backend/src/models/UserListFavorite.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiUserList } from './UserList.js'; diff --git a/packages/backend/src/models/entities/UserListJoining.ts b/packages/backend/src/models/UserListJoining.ts similarity index 96% rename from packages/backend/src/models/entities/UserListJoining.ts rename to packages/backend/src/models/UserListJoining.ts index e4912024c1..4918f2f700 100644 --- a/packages/backend/src/models/entities/UserListJoining.ts +++ b/packages/backend/src/models/UserListJoining.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiUserList } from './UserList.js'; diff --git a/packages/backend/src/models/entities/UserMemo.ts b/packages/backend/src/models/UserMemo.ts similarity index 96% rename from packages/backend/src/models/entities/UserMemo.ts rename to packages/backend/src/models/UserMemo.ts index 9b89080509..ab5e812c44 100644 --- a/packages/backend/src/models/entities/UserMemo.ts +++ b/packages/backend/src/models/UserMemo.ts @@ -4,7 +4,7 @@ */ import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryColumn } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('user_memo') diff --git a/packages/backend/src/models/entities/UserNotePining.ts b/packages/backend/src/models/UserNotePining.ts similarity index 96% rename from packages/backend/src/models/entities/UserNotePining.ts rename to packages/backend/src/models/UserNotePining.ts index 95bcb158b6..1d50a5068e 100644 --- a/packages/backend/src/models/entities/UserNotePining.ts +++ b/packages/backend/src/models/UserNotePining.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiNote } from './Note.js'; import { MiUser } from './User.js'; diff --git a/packages/backend/src/models/entities/UserPending.ts b/packages/backend/src/models/UserPending.ts similarity index 94% rename from packages/backend/src/models/entities/UserPending.ts rename to packages/backend/src/models/UserPending.ts index 8c9e01e59c..b15ededa14 100644 --- a/packages/backend/src/models/entities/UserPending.ts +++ b/packages/backend/src/models/UserPending.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, Column } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; @Entity('user_pending') export class MiUserPending { diff --git a/packages/backend/src/models/entities/UserProfile.ts b/packages/backend/src/models/UserProfile.ts similarity index 97% rename from packages/backend/src/models/entities/UserProfile.ts rename to packages/backend/src/models/UserProfile.ts index 40157da680..e4405c9da7 100644 --- a/packages/backend/src/models/entities/UserProfile.ts +++ b/packages/backend/src/models/UserProfile.ts @@ -5,7 +5,7 @@ import { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from 'typeorm'; import { obsoleteNotificationTypes, ffVisibility, notificationTypes } from '@/types.js'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; import { MiPage } from './Page.js'; @@ -48,6 +48,12 @@ export class MiUserProfile { value: string; }[]; + @Column('varchar', { + array: true, + default: '{}', + }) + public verifiedLinks: string[]; + @Column('varchar', { length: 32, nullable: true, }) @@ -96,16 +102,16 @@ export class MiUserProfile { }) public twoFactorTempSecret: string | null; - @Column('varchar', { - nullable: true, array: true, - }) - public twoFactorBackupSecret: string[] | null; - @Column('varchar', { length: 128, nullable: true, }) public twoFactorSecret: string | null; + @Column('varchar', { + nullable: true, array: true, + }) + public twoFactorBackupSecret: string[] | null; + @Column('boolean', { default: false, }) diff --git a/packages/backend/src/models/entities/UserPublickey.ts b/packages/backend/src/models/UserPublickey.ts similarity index 95% rename from packages/backend/src/models/entities/UserPublickey.ts rename to packages/backend/src/models/UserPublickey.ts index afa37cf7ea..33de73c636 100644 --- a/packages/backend/src/models/entities/UserPublickey.ts +++ b/packages/backend/src/models/UserPublickey.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, OneToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('user_publickey') diff --git a/packages/backend/src/models/entities/UserSecurityKey.ts b/packages/backend/src/models/UserSecurityKey.ts similarity index 91% rename from packages/backend/src/models/entities/UserSecurityKey.ts rename to packages/backend/src/models/UserSecurityKey.ts index c986ad620c..02c29bfbb5 100644 --- a/packages/backend/src/models/entities/UserSecurityKey.ts +++ b/packages/backend/src/models/UserSecurityKey.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, JoinColumn, Column, ManyToOne, Index } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; @Entity('user_security_key') @@ -52,19 +52,19 @@ export class MiUserSecurityKey { comment: 'The type of Backup Eligibility in authenticator data', length: 32, nullable: true, }) - public credentialDeviceType?: string; + public credentialDeviceType: string | null; @Column('boolean', { comment: 'Whether or not the credential has been backed up', nullable: true, }) - public credentialBackedUp?: boolean; + public credentialBackedUp: boolean | null; @Column('varchar', { comment: 'The type of the credential returned by the browser', length: 32, array: true, nullable: true, }) - public transports?: string[]; + public transports: string[] | null; constructor(data: Partial) { if (data == null) return; diff --git a/packages/backend/src/models/entities/Webhook.ts b/packages/backend/src/models/Webhook.ts similarity index 97% rename from packages/backend/src/models/entities/Webhook.ts rename to packages/backend/src/models/Webhook.ts index f08d15825a..5b009c18a6 100644 --- a/packages/backend/src/models/entities/Webhook.ts +++ b/packages/backend/src/models/Webhook.ts @@ -4,7 +4,7 @@ */ import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; +import { id } from './util/id.js'; import { MiUser } from './User.js'; export const webhookEventTypes = ['mention', 'unfollow', 'follow', 'followed', 'note', 'reply', 'renote', 'reaction'] as const; diff --git a/packages/backend/src/models/index.ts b/packages/backend/src/models/_.ts similarity index 55% rename from packages/backend/src/models/index.ts rename to packages/backend/src/models/_.ts index 0e27534df1..c76e9a8301 100644 --- a/packages/backend/src/models/index.ts +++ b/packages/backend/src/models/_.ts @@ -3,72 +3,72 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { MiAbuseReportResolver } from '@/models/entities/AbuseReportResolver.js'; -import { MiAbuseUserReport } from '@/models/entities/AbuseUserReport.js'; -import { MiAccessToken } from '@/models/entities/AccessToken.js'; -import { MiAd } from '@/models/entities/Ad.js'; -import { MiAnnouncement } from '@/models/entities/Announcement.js'; -import { MiAnnouncementRead } from '@/models/entities/AnnouncementRead.js'; -import { MiAntenna } from '@/models/entities/Antenna.js'; -import { MiApp } from '@/models/entities/App.js'; -import { MiAuthSession } from '@/models/entities/AuthSession.js'; -import { MiBlocking } from '@/models/entities/Blocking.js'; -import { MiChannelFollowing } from '@/models/entities/ChannelFollowing.js'; -import { MiChannelFavorite } from '@/models/entities/ChannelFavorite.js'; -import { MiClip } from '@/models/entities/Clip.js'; -import { MiClipNote } from '@/models/entities/ClipNote.js'; -import { MiClipFavorite } from '@/models/entities/ClipFavorite.js'; -import { MiDriveFile } from '@/models/entities/DriveFile.js'; -import { MiDriveFolder } from '@/models/entities/DriveFolder.js'; -import { MiEmoji } from '@/models/entities/Emoji.js'; -import { MiFollowing } from '@/models/entities/Following.js'; -import { MiFollowRequest } from '@/models/entities/FollowRequest.js'; -import { MiGalleryLike } from '@/models/entities/GalleryLike.js'; -import { MiGalleryPost } from '@/models/entities/GalleryPost.js'; -import { MiHashtag } from '@/models/entities/Hashtag.js'; -import { MiInstance } from '@/models/entities/Instance.js'; -import { MiMeta } from '@/models/entities/Meta.js'; -import { MiModerationLog } from '@/models/entities/ModerationLog.js'; -import { MiMutedNote } from '@/models/entities/MutedNote.js'; -import { MiMuting } from '@/models/entities/Muting.js'; -import { MiRenoteMuting } from '@/models/entities/RenoteMuting.js'; -import { MiNote } from '@/models/entities/Note.js'; -import { MiNoteFavorite } from '@/models/entities/NoteFavorite.js'; -import { MiNoteReaction } from '@/models/entities/NoteReaction.js'; -import { MiNoteThreadMuting } from '@/models/entities/NoteThreadMuting.js'; -import { MiNoteUnread } from '@/models/entities/NoteUnread.js'; -import { MiPage } from '@/models/entities/Page.js'; -import { MiPageLike } from '@/models/entities/PageLike.js'; -import { MiPasswordResetRequest } from '@/models/entities/PasswordResetRequest.js'; -import { MiPoll } from '@/models/entities/Poll.js'; -import { MiPollVote } from '@/models/entities/PollVote.js'; -import { MiPromoNote } from '@/models/entities/PromoNote.js'; -import { MiPromoRead } from '@/models/entities/PromoRead.js'; -import { MiRegistrationTicket } from '@/models/entities/RegistrationTicket.js'; -import { MiRegistryItem } from '@/models/entities/RegistryItem.js'; -import { MiRelay } from '@/models/entities/Relay.js'; -import { MiSignin } from '@/models/entities/Signin.js'; -import { MiSwSubscription } from '@/models/entities/SwSubscription.js'; -import { MiUsedUsername } from '@/models/entities/UsedUsername.js'; -import { MiUser } from '@/models/entities/User.js'; -import { MiUserIp } from '@/models/entities/UserIp.js'; -import { MiUserKeypair } from '@/models/entities/UserKeypair.js'; -import { MiUserList } from '@/models/entities/UserList.js'; -import { MiUserListJoining } from '@/models/entities/UserListJoining.js'; -import { MiUserNotePining } from '@/models/entities/UserNotePining.js'; -import { MiUserPending } from '@/models/entities/UserPending.js'; -import { MiUserProfile } from '@/models/entities/UserProfile.js'; -import { MiUserPublickey } from '@/models/entities/UserPublickey.js'; -import { MiUserSecurityKey } from '@/models/entities/UserSecurityKey.js'; -import { MiUserMemo } from '@/models/entities/UserMemo.js'; -import { MiWebhook } from '@/models/entities/Webhook.js'; -import { MiChannel } from '@/models/entities/Channel.js'; -import { MiRetentionAggregation } from '@/models/entities/RetentionAggregation.js'; -import { MiRole } from '@/models/entities/Role.js'; -import { MiRoleAssignment } from '@/models/entities/RoleAssignment.js'; -import { MiFlash } from '@/models/entities/Flash.js'; -import { MiFlashLike } from '@/models/entities/FlashLike.js'; -import { MiUserListFavorite } from './entities/UserListFavorite.js'; +import { MiAbuseReportResolver } from '@/models/AbuseReportResolver.js'; +import { MiAbuseUserReport } from '@/models/AbuseUserReport.js'; +import { MiAccessToken } from '@/models/AccessToken.js'; +import { MiAd } from '@/models/Ad.js'; +import { MiAnnouncement } from '@/models/Announcement.js'; +import { MiAnnouncementRead } from '@/models/AnnouncementRead.js'; +import { MiAntenna } from '@/models/Antenna.js'; +import { MiApp } from '@/models/App.js'; +import { MiAuthSession } from '@/models/AuthSession.js'; +import { MiBlocking } from '@/models/Blocking.js'; +import { MiChannelFollowing } from '@/models/ChannelFollowing.js'; +import { MiChannelFavorite } from '@/models/ChannelFavorite.js'; +import { MiClip } from '@/models/Clip.js'; +import { MiClipNote } from '@/models/ClipNote.js'; +import { MiClipFavorite } from '@/models/ClipFavorite.js'; +import { MiDriveFile } from '@/models/DriveFile.js'; +import { MiDriveFolder } from '@/models/DriveFolder.js'; +import { MiEmoji } from '@/models/Emoji.js'; +import { MiFollowing } from '@/models/Following.js'; +import { MiFollowRequest } from '@/models/FollowRequest.js'; +import { MiGalleryLike } from '@/models/GalleryLike.js'; +import { MiGalleryPost } from '@/models/GalleryPost.js'; +import { MiHashtag } from '@/models/Hashtag.js'; +import { MiInstance } from '@/models/Instance.js'; +import { MiMeta } from '@/models/Meta.js'; +import { MiModerationLog } from '@/models/ModerationLog.js'; +import { MiMutedNote } from '@/models/MutedNote.js'; +import { MiMuting } from '@/models/Muting.js'; +import { MiRenoteMuting } from '@/models/RenoteMuting.js'; +import { MiNote } from '@/models/Note.js'; +import { MiNoteFavorite } from '@/models/NoteFavorite.js'; +import { MiNoteReaction } from '@/models/NoteReaction.js'; +import { MiNoteThreadMuting } from '@/models/NoteThreadMuting.js'; +import { MiNoteUnread } from '@/models/NoteUnread.js'; +import { MiPage } from '@/models/Page.js'; +import { MiPageLike } from '@/models/PageLike.js'; +import { MiPasswordResetRequest } from '@/models/PasswordResetRequest.js'; +import { MiPoll } from '@/models/Poll.js'; +import { MiPollVote } from '@/models/PollVote.js'; +import { MiPromoNote } from '@/models/PromoNote.js'; +import { MiPromoRead } from '@/models/PromoRead.js'; +import { MiRegistrationTicket } from '@/models/RegistrationTicket.js'; +import { MiRegistryItem } from '@/models/RegistryItem.js'; +import { MiRelay } from '@/models/Relay.js'; +import { MiSignin } from '@/models/Signin.js'; +import { MiSwSubscription } from '@/models/SwSubscription.js'; +import { MiUsedUsername } from '@/models/UsedUsername.js'; +import { MiUser } from '@/models/User.js'; +import { MiUserIp } from '@/models/UserIp.js'; +import { MiUserKeypair } from '@/models/UserKeypair.js'; +import { MiUserList } from '@/models/UserList.js'; +import { MiUserListJoining } from '@/models/UserListJoining.js'; +import { MiUserNotePining } from '@/models/UserNotePining.js'; +import { MiUserPending } from '@/models/UserPending.js'; +import { MiUserProfile } from '@/models/UserProfile.js'; +import { MiUserPublickey } from '@/models/UserPublickey.js'; +import { MiUserSecurityKey } from '@/models/UserSecurityKey.js'; +import { MiUserMemo } from '@/models/UserMemo.js'; +import { MiWebhook } from '@/models/Webhook.js'; +import { MiChannel } from '@/models/Channel.js'; +import { MiRetentionAggregation } from '@/models/RetentionAggregation.js'; +import { MiRole } from '@/models/Role.js'; +import { MiRoleAssignment } from '@/models/RoleAssignment.js'; +import { MiFlash } from '@/models/Flash.js'; +import { MiFlashLike } from '@/models/FlashLike.js'; +import { MiUserListFavorite } from '@/models/UserListFavorite.js'; import type { Repository } from 'typeorm'; export { diff --git a/packages/backend/src/models/json-schema/antenna.ts b/packages/backend/src/models/json-schema/antenna.ts index 3f58cbee6c..7b6475919c 100644 --- a/packages/backend/src/models/json-schema/antenna.ts +++ b/packages/backend/src/models/json-schema/antenna.ts @@ -47,7 +47,7 @@ export const packedAntennaSchema = { src: { type: 'string', optional: false, nullable: false, - enum: ['home', 'all', 'users', 'list'], + enum: ['home', 'all', 'users', 'list', 'users_blacklist'], }, userListId: { type: 'string', diff --git a/packages/backend/src/models/json-schema/channel.ts b/packages/backend/src/models/json-schema/channel.ts index ec8bc32376..f1019d1461 100644 --- a/packages/backend/src/models/json-schema/channel.ts +++ b/packages/backend/src/models/json-schema/channel.ts @@ -72,5 +72,9 @@ export const packedChannelSchema = { type: 'string', optional: false, nullable: false, }, + isSensitive: { + type: 'boolean', + optional: false, nullable: false, + }, }, } as const; diff --git a/packages/backend/src/models/json-schema/note.ts b/packages/backend/src/models/json-schema/note.ts index dc7c0462fa..eb744aa109 100644 --- a/packages/backend/src/models/json-schema/note.ts +++ b/packages/backend/src/models/json-schema/note.ts @@ -139,6 +139,10 @@ export const packedNoteSchema = { type: 'string', optional: false, nullable: true, }, + isSensitive: { + type: 'boolean', + optional: true, nullable: false, + } }, }, }, diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts index 441c8364e5..f5859385d9 100644 --- a/packages/backend/src/models/json-schema/user.ts +++ b/packages/backend/src/models/json-schema/user.ts @@ -173,6 +173,15 @@ export const packedUserDetailedNotMeOnlySchema = { }, }, }, + verifiedLinks: { + type: 'array', + nullable: false, optional: false, + items: { + type: 'string', + nullable: false, optional: false, + format: 'url', + }, + }, followersCount: { type: 'number', nullable: false, optional: false, @@ -268,6 +277,10 @@ export const packedUserDetailedNotMeOnlySchema = { type: 'string', nullable: false, optional: true, }, + notify: { + type: 'string', + nullable: false, optional: true, + }, //#endregion }, } as const; @@ -325,7 +338,7 @@ export const packedMeDetailedOnlySchema = { type: 'boolean', nullable: false, optional: false, }, - twoFactorBackupCodes: { + twoFactorBackupCodesStock: { type: 'string', enum: ['full', 'partial', 'none'], nullable: false, optional: false, diff --git a/packages/backend/src/models/id.ts b/packages/backend/src/models/util/id.ts similarity index 100% rename from packages/backend/src/models/id.ts rename to packages/backend/src/models/util/id.ts diff --git a/packages/backend/src/postgres.ts b/packages/backend/src/postgres.ts index 6a2fae69a3..1c2a2ee3cb 100644 --- a/packages/backend/src/postgres.ts +++ b/packages/backend/src/postgres.ts @@ -11,72 +11,72 @@ import { DataSource, Logger } from 'typeorm'; import * as highlight from 'cli-highlight'; import { entities as charts } from '@/core/chart/entities.js'; -import { MiAbuseReportResolver } from '@/models/entities/AbuseReportResolver.js'; -import { MiAbuseUserReport } from '@/models/entities/AbuseUserReport.js'; -import { MiAccessToken } from '@/models/entities/AccessToken.js'; -import { MiAd } from '@/models/entities/Ad.js'; -import { MiAnnouncement } from '@/models/entities/Announcement.js'; -import { MiAnnouncementRead } from '@/models/entities/AnnouncementRead.js'; -import { MiAntenna } from '@/models/entities/Antenna.js'; -import { MiApp } from '@/models/entities/App.js'; -import { MiAuthSession } from '@/models/entities/AuthSession.js'; -import { MiBlocking } from '@/models/entities/Blocking.js'; -import { MiChannelFollowing } from '@/models/entities/ChannelFollowing.js'; -import { MiChannelFavorite } from '@/models/entities/ChannelFavorite.js'; -import { MiClip } from '@/models/entities/Clip.js'; -import { MiClipNote } from '@/models/entities/ClipNote.js'; -import { MiClipFavorite } from '@/models/entities/ClipFavorite.js'; -import { MiDriveFile } from '@/models/entities/DriveFile.js'; -import { MiDriveFolder } from '@/models/entities/DriveFolder.js'; -import { MiEmoji } from '@/models/entities/Emoji.js'; -import { MiFollowing } from '@/models/entities/Following.js'; -import { MiFollowRequest } from '@/models/entities/FollowRequest.js'; -import { MiGalleryLike } from '@/models/entities/GalleryLike.js'; -import { MiGalleryPost } from '@/models/entities/GalleryPost.js'; -import { MiHashtag } from '@/models/entities/Hashtag.js'; -import { MiInstance } from '@/models/entities/Instance.js'; -import { MiMeta } from '@/models/entities/Meta.js'; -import { MiModerationLog } from '@/models/entities/ModerationLog.js'; -import { MiMutedNote } from '@/models/entities/MutedNote.js'; -import { MiMuting } from '@/models/entities/Muting.js'; -import { MiRenoteMuting } from '@/models/entities/RenoteMuting.js'; -import { MiNote } from '@/models/entities/Note.js'; -import { MiNoteFavorite } from '@/models/entities/NoteFavorite.js'; -import { MiNoteReaction } from '@/models/entities/NoteReaction.js'; -import { MiNoteThreadMuting } from '@/models/entities/NoteThreadMuting.js'; -import { MiNoteUnread } from '@/models/entities/NoteUnread.js'; -import { MiPage } from '@/models/entities/Page.js'; -import { MiPageLike } from '@/models/entities/PageLike.js'; -import { MiPasswordResetRequest } from '@/models/entities/PasswordResetRequest.js'; -import { MiPoll } from '@/models/entities/Poll.js'; -import { MiPollVote } from '@/models/entities/PollVote.js'; -import { MiPromoNote } from '@/models/entities/PromoNote.js'; -import { MiPromoRead } from '@/models/entities/PromoRead.js'; -import { MiRegistrationTicket } from '@/models/entities/RegistrationTicket.js'; -import { MiRegistryItem } from '@/models/entities/RegistryItem.js'; -import { MiRelay } from '@/models/entities/Relay.js'; -import { MiSignin } from '@/models/entities/Signin.js'; -import { MiSwSubscription } from '@/models/entities/SwSubscription.js'; -import { MiUsedUsername } from '@/models/entities/UsedUsername.js'; -import { MiUser } from '@/models/entities/User.js'; -import { MiUserIp } from '@/models/entities/UserIp.js'; -import { MiUserKeypair } from '@/models/entities/UserKeypair.js'; -import { MiUserList } from '@/models/entities/UserList.js'; -import { MiUserListFavorite } from '@/models/entities/UserListFavorite.js'; -import { MiUserListJoining } from '@/models/entities/UserListJoining.js'; -import { MiUserNotePining } from '@/models/entities/UserNotePining.js'; -import { MiUserPending } from '@/models/entities/UserPending.js'; -import { MiUserProfile } from '@/models/entities/UserProfile.js'; -import { MiUserPublickey } from '@/models/entities/UserPublickey.js'; -import { MiUserSecurityKey } from '@/models/entities/UserSecurityKey.js'; -import { MiWebhook } from '@/models/entities/Webhook.js'; -import { MiChannel } from '@/models/entities/Channel.js'; -import { MiRetentionAggregation } from '@/models/entities/RetentionAggregation.js'; -import { MiRole } from '@/models/entities/Role.js'; -import { MiRoleAssignment } from '@/models/entities/RoleAssignment.js'; -import { MiFlash } from '@/models/entities/Flash.js'; -import { MiFlashLike } from '@/models/entities/FlashLike.js'; -import { MiUserMemo } from '@/models/entities/UserMemo.js'; +import { MiAbuseReportResolver } from '@/models/AbuseReportResolver.js'; +import { MiAbuseUserReport } from '@/models/AbuseUserReport.js'; +import { MiAccessToken } from '@/models/AccessToken.js'; +import { MiAd } from '@/models/Ad.js'; +import { MiAnnouncement } from '@/models/Announcement.js'; +import { MiAnnouncementRead } from '@/models/AnnouncementRead.js'; +import { MiAntenna } from '@/models/Antenna.js'; +import { MiApp } from '@/models/App.js'; +import { MiAuthSession } from '@/models/AuthSession.js'; +import { MiBlocking } from '@/models/Blocking.js'; +import { MiChannelFollowing } from '@/models/ChannelFollowing.js'; +import { MiChannelFavorite } from '@/models/ChannelFavorite.js'; +import { MiClip } from '@/models/Clip.js'; +import { MiClipNote } from '@/models/ClipNote.js'; +import { MiClipFavorite } from '@/models/ClipFavorite.js'; +import { MiDriveFile } from '@/models/DriveFile.js'; +import { MiDriveFolder } from '@/models/DriveFolder.js'; +import { MiEmoji } from '@/models/Emoji.js'; +import { MiFollowing } from '@/models/Following.js'; +import { MiFollowRequest } from '@/models/FollowRequest.js'; +import { MiGalleryLike } from '@/models/GalleryLike.js'; +import { MiGalleryPost } from '@/models/GalleryPost.js'; +import { MiHashtag } from '@/models/Hashtag.js'; +import { MiInstance } from '@/models/Instance.js'; +import { MiMeta } from '@/models/Meta.js'; +import { MiModerationLog } from '@/models/ModerationLog.js'; +import { MiMutedNote } from '@/models/MutedNote.js'; +import { MiMuting } from '@/models/Muting.js'; +import { MiRenoteMuting } from '@/models/RenoteMuting.js'; +import { MiNote } from '@/models/Note.js'; +import { MiNoteFavorite } from '@/models/NoteFavorite.js'; +import { MiNoteReaction } from '@/models/NoteReaction.js'; +import { MiNoteThreadMuting } from '@/models/NoteThreadMuting.js'; +import { MiNoteUnread } from '@/models/NoteUnread.js'; +import { MiPage } from '@/models/Page.js'; +import { MiPageLike } from '@/models/PageLike.js'; +import { MiPasswordResetRequest } from '@/models/PasswordResetRequest.js'; +import { MiPoll } from '@/models/Poll.js'; +import { MiPollVote } from '@/models/PollVote.js'; +import { MiPromoNote } from '@/models/PromoNote.js'; +import { MiPromoRead } from '@/models/PromoRead.js'; +import { MiRegistrationTicket } from '@/models/RegistrationTicket.js'; +import { MiRegistryItem } from '@/models/RegistryItem.js'; +import { MiRelay } from '@/models/Relay.js'; +import { MiSignin } from '@/models/Signin.js'; +import { MiSwSubscription } from '@/models/SwSubscription.js'; +import { MiUsedUsername } from '@/models/UsedUsername.js'; +import { MiUser } from '@/models/User.js'; +import { MiUserIp } from '@/models/UserIp.js'; +import { MiUserKeypair } from '@/models/UserKeypair.js'; +import { MiUserList } from '@/models/UserList.js'; +import { MiUserListFavorite } from '@/models/UserListFavorite.js'; +import { MiUserListJoining } from '@/models/UserListJoining.js'; +import { MiUserNotePining } from '@/models/UserNotePining.js'; +import { MiUserPending } from '@/models/UserPending.js'; +import { MiUserProfile } from '@/models/UserProfile.js'; +import { MiUserPublickey } from '@/models/UserPublickey.js'; +import { MiUserSecurityKey } from '@/models/UserSecurityKey.js'; +import { MiWebhook } from '@/models/Webhook.js'; +import { MiChannel } from '@/models/Channel.js'; +import { MiRetentionAggregation } from '@/models/RetentionAggregation.js'; +import { MiRole } from '@/models/Role.js'; +import { MiRoleAssignment } from '@/models/RoleAssignment.js'; +import { MiFlash } from '@/models/Flash.js'; +import { MiFlashLike } from '@/models/FlashLike.js'; +import { MiUserMemo } from '@/models/UserMemo.js'; import { Config } from '@/config.js'; import MisskeyLogger from '@/logger.js'; @@ -232,7 +232,7 @@ export function createPostgresDataSource(config: Config) { options: { host: config.redis.host, port: config.redis.port, - family: config.redis.family == null ? 0 : config.redis.family, + family: config.redis.family ?? 0, password: config.redis.pass, keyPrefix: `${config.redis.prefix}:query:`, db: config.redis.db ?? 0, diff --git a/packages/backend/src/queue/processors/AggregateRetentionProcessorService.ts b/packages/backend/src/queue/processors/AggregateRetentionProcessorService.ts index e753adcd40..5aac3f19e8 100644 --- a/packages/backend/src/queue/processors/AggregateRetentionProcessorService.ts +++ b/packages/backend/src/queue/processors/AggregateRetentionProcessorService.ts @@ -6,10 +6,9 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull, MoreThan } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { Config } from '@/config.js'; import type Logger from '@/logger.js'; import { bindThis } from '@/decorators.js'; -import type { RetentionAggregationsRepository, UsersRepository } from '@/models/index.js'; +import type { RetentionAggregationsRepository, UsersRepository } from '@/models/_.js'; import { deepClone } from '@/misc/clone.js'; import { IdService } from '@/core/IdService.js'; import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; @@ -21,9 +20,6 @@ export class AggregateRetentionProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/queue/processors/CheckExpiredMutingsProcessorService.ts b/packages/backend/src/queue/processors/CheckExpiredMutingsProcessorService.ts index ebfa87aeae..9b07389dc3 100644 --- a/packages/backend/src/queue/processors/CheckExpiredMutingsProcessorService.ts +++ b/packages/backend/src/queue/processors/CheckExpiredMutingsProcessorService.ts @@ -6,8 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { In } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { MutingsRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { MutingsRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import { bindThis } from '@/decorators.js'; import { UserMutingService } from '@/core/UserMutingService.js'; @@ -19,9 +18,6 @@ export class CheckExpiredMutingsProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.mutingsRepository) private mutingsRepository: MutingsRepository, diff --git a/packages/backend/src/queue/processors/CleanChartsProcessorService.ts b/packages/backend/src/queue/processors/CleanChartsProcessorService.ts index d019ee47df..55c444eee6 100644 --- a/packages/backend/src/queue/processors/CleanChartsProcessorService.ts +++ b/packages/backend/src/queue/processors/CleanChartsProcessorService.ts @@ -3,9 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; -import { DI } from '@/di-symbols.js'; -import type { Config } from '@/config.js'; +import { Injectable } from '@nestjs/common'; import type Logger from '@/logger.js'; import FederationChart from '@/core/chart/charts/federation.js'; import NotesChart from '@/core/chart/charts/notes.js'; @@ -28,9 +26,6 @@ export class CleanChartsProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - private federationChart: FederationChart, private notesChart: NotesChart, private usersChart: UsersChart, diff --git a/packages/backend/src/queue/processors/CleanProcessorService.ts b/packages/backend/src/queue/processors/CleanProcessorService.ts index 8d60358580..f0453f7054 100644 --- a/packages/backend/src/queue/processors/CleanProcessorService.ts +++ b/packages/backend/src/queue/processors/CleanProcessorService.ts @@ -6,11 +6,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { In, LessThan } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { AntennasRepository, MutedNotesRepository, RoleAssignmentsRepository, UserIpsRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { AntennasRepository, MutedNotesRepository, RoleAssignmentsRepository, UserIpsRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import { bindThis } from '@/decorators.js'; import { IdService } from '@/core/IdService.js'; +import type { Config } from '@/config.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type * as Bull from 'bullmq'; @@ -58,12 +58,14 @@ export class CleanProcessorService { reason: 'word', }); - // 7日以上使われてないアンテナを停止 - this.antennasRepository.update({ - lastUsedAt: LessThan(new Date(Date.now() - (1000 * 60 * 60 * 24 * 7))), - }, { - isActive: false, - }); + // 使われてないアンテナを停止 + if (this.config.deactivateAntennaThreshold > 0) { + this.antennasRepository.update({ + lastUsedAt: LessThan(new Date(Date.now() - this.config.deactivateAntennaThreshold)), + }, { + isActive: false, + }); + } const expiredRoleAssignments = await this.roleAssignmentsRepository.createQueryBuilder('assign') .where('assign.expiresAt IS NOT NULL') diff --git a/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts b/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts index b3ef238c04..613a1a304b 100644 --- a/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts +++ b/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts @@ -6,8 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull, MoreThan, Not } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { MiDriveFile, DriveFilesRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { MiDriveFile, DriveFilesRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { bindThis } from '@/decorators.js'; @@ -19,9 +18,6 @@ export class CleanRemoteFilesProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts b/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts index 0af578c133..2b9bd3f0b5 100644 --- a/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts +++ b/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts @@ -6,12 +6,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { MoreThan } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { DriveFilesRepository, NotesRepository, UserProfilesRepository, UsersRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { DriveFilesRepository, NotesRepository, UserProfilesRepository, UsersRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; +import type { MiNote } from '@/models/Note.js'; import { EmailService } from '@/core/EmailService.js'; import { bindThis } from '@/decorators.js'; import { SearchService } from '@/core/SearchService.js'; @@ -24,9 +23,6 @@ export class DeleteAccountProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/queue/processors/DeleteDriveFilesProcessorService.ts b/packages/backend/src/queue/processors/DeleteDriveFilesProcessorService.ts index 49f676f91a..ded1d8b1e4 100644 --- a/packages/backend/src/queue/processors/DeleteDriveFilesProcessorService.ts +++ b/packages/backend/src/queue/processors/DeleteDriveFilesProcessorService.ts @@ -6,8 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { MoreThan } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { UsersRepository, DriveFilesRepository, MiDriveFile } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { UsersRepository, DriveFilesRepository, MiDriveFile } from '@/models/_.js'; import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { bindThis } from '@/decorators.js'; @@ -20,9 +19,6 @@ export class DeleteDriveFilesProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/queue/processors/DeleteFileProcessorService.ts b/packages/backend/src/queue/processors/DeleteFileProcessorService.ts index 41cd7b5057..a4638bfaaf 100644 --- a/packages/backend/src/queue/processors/DeleteFileProcessorService.ts +++ b/packages/backend/src/queue/processors/DeleteFileProcessorService.ts @@ -3,9 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; -import { DI } from '@/di-symbols.js'; -import type { Config } from '@/config.js'; +import { Injectable } from '@nestjs/common'; import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { bindThis } from '@/decorators.js'; @@ -18,9 +16,6 @@ export class DeleteFileProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - private driveService: DriveService, private queueLoggerService: QueueLoggerService, ) { diff --git a/packages/backend/src/queue/processors/DeliverProcessorService.ts b/packages/backend/src/queue/processors/DeliverProcessorService.ts index da8a1acfd4..4a1d9f28b4 100644 --- a/packages/backend/src/queue/processors/DeliverProcessorService.ts +++ b/packages/backend/src/queue/processors/DeliverProcessorService.ts @@ -6,15 +6,14 @@ import { Inject, Injectable } from '@nestjs/common'; import * as Bull from 'bullmq'; import { DI } from '@/di-symbols.js'; -import type { DriveFilesRepository, InstancesRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { InstancesRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import { MetaService } from '@/core/MetaService.js'; import { ApRequestService } from '@/core/activitypub/ApRequestService.js'; import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; import { FetchInstanceMetadataService } from '@/core/FetchInstanceMetadataService.js'; import { MemorySingleCache } from '@/misc/cache.js'; -import type { MiInstance } from '@/models/entities/Instance.js'; +import type { MiInstance } from '@/models/Instance.js'; import InstanceChart from '@/core/chart/charts/instance.js'; import ApRequestChart from '@/core/chart/charts/ap-request.js'; import FederationChart from '@/core/chart/charts/federation.js'; @@ -31,15 +30,9 @@ export class DeliverProcessorService { private latest: string | null; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.instancesRepository) private instancesRepository: InstancesRepository, - @Inject(DI.driveFilesRepository) - private driveFilesRepository: DriveFilesRepository, - private metaService: MetaService, private utilityService: UtilityService, private federatedInstanceService: FederatedInstanceService, diff --git a/packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts b/packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts index a4ec317402..4a48084436 100644 --- a/packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts +++ b/packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts @@ -5,8 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { PollVotesRepository, NotesRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { PollVotesRepository, NotesRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import { NotificationService } from '@/core/NotificationService.js'; import { bindThis } from '@/decorators.js'; @@ -19,9 +18,6 @@ export class EndedPollNotificationProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/queue/processors/ExportAntennasProcessorService.ts b/packages/backend/src/queue/processors/ExportAntennasProcessorService.ts index 65a589b93c..f941fb6e85 100644 --- a/packages/backend/src/queue/processors/ExportAntennasProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportAntennasProcessorService.ts @@ -8,8 +8,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { format as DateFormat } from 'date-fns'; import { In } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { AntennasRepository, UsersRepository, UserListJoiningsRepository, MiUser } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { AntennasRepository, UsersRepository, UserListJoiningsRepository, MiUser } from '@/models/_.js'; import Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { bindThis } from '@/decorators.js'; @@ -24,9 +23,6 @@ export class ExportAntennasProcessorService { private logger: Logger; constructor ( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/queue/processors/ExportBlockingProcessorService.ts b/packages/backend/src/queue/processors/ExportBlockingProcessorService.ts index b2a30a23ae..5b134e0777 100644 --- a/packages/backend/src/queue/processors/ExportBlockingProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportBlockingProcessorService.ts @@ -8,8 +8,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { MoreThan } from 'typeorm'; import { format as dateFormat } from 'date-fns'; import { DI } from '@/di-symbols.js'; -import type { UsersRepository, BlockingsRepository, MiBlocking } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { UsersRepository, BlockingsRepository, MiBlocking } from '@/models/_.js'; import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { createTemp } from '@/misc/create-temp.js'; @@ -24,9 +23,6 @@ export class ExportBlockingProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/queue/processors/ExportCustomEmojisProcessorService.ts b/packages/backend/src/queue/processors/ExportCustomEmojisProcessorService.ts index 688a0a1ccd..d5387fe42e 100644 --- a/packages/backend/src/queue/processors/ExportCustomEmojisProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportCustomEmojisProcessorService.ts @@ -10,7 +10,7 @@ import { format as dateFormat } from 'date-fns'; import mime from 'mime-types'; import archiver from 'archiver'; import { DI } from '@/di-symbols.js'; -import type { EmojisRepository, UsersRepository } from '@/models/index.js'; +import type { EmojisRepository, UsersRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; diff --git a/packages/backend/src/queue/processors/ExportFavoritesProcessorService.ts b/packages/backend/src/queue/processors/ExportFavoritesProcessorService.ts index 9377d4638a..581218e946 100644 --- a/packages/backend/src/queue/processors/ExportFavoritesProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportFavoritesProcessorService.ts @@ -8,13 +8,12 @@ import { Inject, Injectable } from '@nestjs/common'; import { MoreThan } from 'typeorm'; import { format as dateFormat } from 'date-fns'; import { DI } from '@/di-symbols.js'; -import type { MiNoteFavorite, NoteFavoritesRepository, NotesRepository, PollsRepository, MiUser, UsersRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { MiNoteFavorite, NoteFavoritesRepository, PollsRepository, MiUser, UsersRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { createTemp } from '@/misc/create-temp.js'; -import type { MiPoll } from '@/models/entities/Poll.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiPoll } from '@/models/Poll.js'; +import type { MiNote } from '@/models/Note.js'; import { bindThis } from '@/decorators.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type * as Bull from 'bullmq'; @@ -25,18 +24,12 @@ export class ExportFavoritesProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @Inject(DI.pollsRepository) private pollsRepository: PollsRepository, - @Inject(DI.notesRepository) - private notesRepository: NotesRepository, - @Inject(DI.noteFavoritesRepository) private noteFavoritesRepository: NoteFavoritesRepository, diff --git a/packages/backend/src/queue/processors/ExportFollowingProcessorService.ts b/packages/backend/src/queue/processors/ExportFollowingProcessorService.ts index 28a25b8ccb..853d97bcc5 100644 --- a/packages/backend/src/queue/processors/ExportFollowingProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportFollowingProcessorService.ts @@ -8,12 +8,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { In, MoreThan, Not } from 'typeorm'; import { format as dateFormat } from 'date-fns'; import { DI } from '@/di-symbols.js'; -import type { UsersRepository, FollowingsRepository, MutingsRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { UsersRepository, FollowingsRepository, MutingsRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { createTemp } from '@/misc/create-temp.js'; -import type { MiFollowing } from '@/models/entities/Following.js'; +import type { MiFollowing } from '@/models/Following.js'; import { UtilityService } from '@/core/UtilityService.js'; import { bindThis } from '@/decorators.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; @@ -25,9 +24,6 @@ export class ExportFollowingProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/queue/processors/ExportMutingProcessorService.ts b/packages/backend/src/queue/processors/ExportMutingProcessorService.ts index 782bf00cf7..d1688349de 100644 --- a/packages/backend/src/queue/processors/ExportMutingProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportMutingProcessorService.ts @@ -8,8 +8,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull, MoreThan } from 'typeorm'; import { format as dateFormat } from 'date-fns'; import { DI } from '@/di-symbols.js'; -import type { MutingsRepository, UsersRepository, BlockingsRepository, MiMuting } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { MutingsRepository, UsersRepository, MiMuting } from '@/models/_.js'; import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { createTemp } from '@/misc/create-temp.js'; @@ -24,15 +23,9 @@ export class ExportMutingProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, - @Inject(DI.blockingsRepository) - private blockingsRepository: BlockingsRepository, - @Inject(DI.mutingsRepository) private mutingsRepository: MutingsRepository, diff --git a/packages/backend/src/queue/processors/ExportNotesProcessorService.ts b/packages/backend/src/queue/processors/ExportNotesProcessorService.ts index a77c9fc075..343d890ce8 100644 --- a/packages/backend/src/queue/processors/ExportNotesProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportNotesProcessorService.ts @@ -8,13 +8,12 @@ import { Inject, Injectable } from '@nestjs/common'; import { MoreThan } from 'typeorm'; import { format as dateFormat } from 'date-fns'; import { DI } from '@/di-symbols.js'; -import type { NotesRepository, PollsRepository, UsersRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { NotesRepository, PollsRepository, UsersRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { createTemp } from '@/misc/create-temp.js'; -import type { MiPoll } from '@/models/entities/Poll.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiPoll } from '@/models/Poll.js'; +import type { MiNote } from '@/models/Note.js'; import { bindThis } from '@/decorators.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; import { Packed } from '@/misc/json-schema.js'; @@ -27,9 +26,6 @@ export class ExportNotesProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/queue/processors/ExportUserListsProcessorService.ts b/packages/backend/src/queue/processors/ExportUserListsProcessorService.ts index e15e04c693..7baaa7081a 100644 --- a/packages/backend/src/queue/processors/ExportUserListsProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportUserListsProcessorService.ts @@ -8,8 +8,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { In } from 'typeorm'; import { format as dateFormat } from 'date-fns'; import { DI } from '@/di-symbols.js'; -import type { UserListJoiningsRepository, UserListsRepository, UsersRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { UserListJoiningsRepository, UserListsRepository, UsersRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { createTemp } from '@/misc/create-temp.js'; @@ -24,9 +23,6 @@ export class ExportUserListsProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/queue/processors/ImportAntennasProcessorService.ts b/packages/backend/src/queue/processors/ImportAntennasProcessorService.ts index 9ff9a8a528..7c95bccaff 100644 --- a/packages/backend/src/queue/processors/ImportAntennasProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportAntennasProcessorService.ts @@ -8,7 +8,7 @@ import _Ajv from 'ajv'; import { IdService } from '@/core/IdService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import Logger from '@/logger.js'; -import type { AntennasRepository } from '@/models/index.js'; +import type { AntennasRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; diff --git a/packages/backend/src/queue/processors/ImportBlockingProcessorService.ts b/packages/backend/src/queue/processors/ImportBlockingProcessorService.ts index 1d4c3d907e..64520b770b 100644 --- a/packages/backend/src/queue/processors/ImportBlockingProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportBlockingProcessorService.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { UsersRepository, DriveFilesRepository } from '@/models/index.js'; +import type { UsersRepository, DriveFilesRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import * as Acct from '@/misc/acct.js'; import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js'; diff --git a/packages/backend/src/queue/processors/ImportCustomEmojisProcessorService.ts b/packages/backend/src/queue/processors/ImportCustomEmojisProcessorService.ts index d3ae1212b7..0d9ffe1b01 100644 --- a/packages/backend/src/queue/processors/ImportCustomEmojisProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportCustomEmojisProcessorService.ts @@ -6,10 +6,8 @@ import * as fs from 'node:fs'; import { Inject, Injectable } from '@nestjs/common'; import { ZipReader } from 'slacc'; -import { DataSource } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { EmojisRepository, DriveFilesRepository, UsersRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { EmojisRepository, DriveFilesRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js'; import { createTempDir } from '@/misc/create-temp.js'; @@ -26,15 +24,6 @@ export class ImportCustomEmojisProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - - @Inject(DI.db) - private db: DataSource, - - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/queue/processors/ImportFollowingProcessorService.ts b/packages/backend/src/queue/processors/ImportFollowingProcessorService.ts index 585311982f..2b5e41a12d 100644 --- a/packages/backend/src/queue/processors/ImportFollowingProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportFollowingProcessorService.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { UsersRepository, DriveFilesRepository } from '@/models/index.js'; +import type { UsersRepository, DriveFilesRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import * as Acct from '@/misc/acct.js'; import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js'; diff --git a/packages/backend/src/queue/processors/ImportMutingProcessorService.ts b/packages/backend/src/queue/processors/ImportMutingProcessorService.ts index 5e0f7717cf..9db4e5d8e0 100644 --- a/packages/backend/src/queue/processors/ImportMutingProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportMutingProcessorService.ts @@ -6,8 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { UsersRepository, DriveFilesRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { UsersRepository, DriveFilesRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import * as Acct from '@/misc/acct.js'; import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js'; @@ -24,9 +23,6 @@ export class ImportMutingProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/queue/processors/ImportUserListsProcessorService.ts b/packages/backend/src/queue/processors/ImportUserListsProcessorService.ts index 9f81a3d010..54ca1a86df 100644 --- a/packages/backend/src/queue/processors/ImportUserListsProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportUserListsProcessorService.ts @@ -6,8 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { UsersRepository, DriveFilesRepository, UserListJoiningsRepository, UserListsRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { UsersRepository, DriveFilesRepository, UserListJoiningsRepository, UserListsRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import * as Acct from '@/misc/acct.js'; import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js'; @@ -25,9 +24,6 @@ export class ImportUserListsProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/queue/processors/InboxProcessorService.ts b/packages/backend/src/queue/processors/InboxProcessorService.ts index 3f9334a878..99e823f9fa 100644 --- a/packages/backend/src/queue/processors/InboxProcessorService.ts +++ b/packages/backend/src/queue/processors/InboxProcessorService.ts @@ -4,22 +4,19 @@ */ import { URL } from 'node:url'; -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import httpSignature from '@peertube/http-signature'; import * as Bull from 'bullmq'; -import { DI } from '@/di-symbols.js'; -import type { Config } from '@/config.js'; import type Logger from '@/logger.js'; import { MetaService } from '@/core/MetaService.js'; -import { ApRequestService } from '@/core/activitypub/ApRequestService.js'; import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; import { FetchInstanceMetadataService } from '@/core/FetchInstanceMetadataService.js'; import InstanceChart from '@/core/chart/charts/instance.js'; import ApRequestChart from '@/core/chart/charts/ap-request.js'; import FederationChart from '@/core/chart/charts/federation.js'; import { getApId } from '@/core/activitypub/type.js'; -import type { MiRemoteUser } from '@/models/entities/User.js'; -import type { MiUserPublickey } from '@/models/entities/UserPublickey.js'; +import type { MiRemoteUser } from '@/models/User.js'; +import type { MiUserPublickey } from '@/models/UserPublickey.js'; import { ApDbResolverService } from '@/core/activitypub/ApDbResolverService.js'; import { StatusError } from '@/misc/status-error.js'; import { UtilityService } from '@/core/UtilityService.js'; @@ -35,16 +32,12 @@ export class InboxProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - private utilityService: UtilityService, private metaService: MetaService, private apInboxService: ApInboxService, private federatedInstanceService: FederatedInstanceService, private fetchInstanceMetadataService: FetchInstanceMetadataService, private ldSignatureService: LdSignatureService, - private apRequestService: ApRequestService, private apPersonService: ApPersonService, private apDbResolverService: ApDbResolverService, private instanceChart: InstanceChart, diff --git a/packages/backend/src/queue/processors/RelationshipProcessorService.ts b/packages/backend/src/queue/processors/RelationshipProcessorService.ts index 67a50dc789..5b2d2ef313 100644 --- a/packages/backend/src/queue/processors/RelationshipProcessorService.ts +++ b/packages/backend/src/queue/processors/RelationshipProcessorService.ts @@ -10,9 +10,9 @@ import { UserBlockingService } from '@/core/UserBlockingService.js'; import { bindThis } from '@/decorators.js'; import type Logger from '@/logger.js'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; -import { MiLocalUser, MiRemoteUser } from '@/models/entities/User.js'; +import { MiLocalUser, MiRemoteUser } from '@/models/User.js'; import { RelationshipJobData } from '../types.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type * as Bull from 'bullmq'; diff --git a/packages/backend/src/queue/processors/ReportAbuseProcessorService.ts b/packages/backend/src/queue/processors/ReportAbuseProcessorService.ts index f83770c31c..90d3e588da 100644 --- a/packages/backend/src/queue/processors/ReportAbuseProcessorService.ts +++ b/packages/backend/src/queue/processors/ReportAbuseProcessorService.ts @@ -11,7 +11,7 @@ import type Logger from '@/logger.js'; import { RoleService } from '@/core/RoleService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { InstanceActorService } from '@/core/InstanceActorService.js'; -import type { AbuseReportResolversRepository, AbuseUserReportsRepository, UsersRepository } from '@/models/index.js'; +import type { AbuseReportResolversRepository, AbuseUserReportsRepository, UsersRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; import { QueueService } from '@/core/QueueService.js'; diff --git a/packages/backend/src/queue/processors/ResyncChartsProcessorService.ts b/packages/backend/src/queue/processors/ResyncChartsProcessorService.ts index c16d05afec..b3b055ef8c 100644 --- a/packages/backend/src/queue/processors/ResyncChartsProcessorService.ts +++ b/packages/backend/src/queue/processors/ResyncChartsProcessorService.ts @@ -3,21 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; -import { DI } from '@/di-symbols.js'; -import type { Config } from '@/config.js'; +import { Injectable } from '@nestjs/common'; import type Logger from '@/logger.js'; -import FederationChart from '@/core/chart/charts/federation.js'; import NotesChart from '@/core/chart/charts/notes.js'; import UsersChart from '@/core/chart/charts/users.js'; -import ActiveUsersChart from '@/core/chart/charts/active-users.js'; -import InstanceChart from '@/core/chart/charts/instance.js'; -import PerUserNotesChart from '@/core/chart/charts/per-user-notes.js'; import DriveChart from '@/core/chart/charts/drive.js'; -import PerUserReactionsChart from '@/core/chart/charts/per-user-reactions.js'; -import PerUserFollowingChart from '@/core/chart/charts/per-user-following.js'; -import PerUserDriveChart from '@/core/chart/charts/per-user-drive.js'; -import ApRequestChart from '@/core/chart/charts/ap-request.js'; import { bindThis } from '@/decorators.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type * as Bull from 'bullmq'; @@ -27,21 +17,9 @@ export class ResyncChartsProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - - private federationChart: FederationChart, private notesChart: NotesChart, private usersChart: UsersChart, - private activeUsersChart: ActiveUsersChart, - private instanceChart: InstanceChart, - private perUserNotesChart: PerUserNotesChart, private driveChart: DriveChart, - private perUserReactionsChart: PerUserReactionsChart, - private perUserFollowingChart: PerUserFollowingChart, - private perUserDriveChart: PerUserDriveChart, - private apRequestChart: ApRequestChart, - private queueLoggerService: QueueLoggerService, ) { this.logger = this.queueLoggerService.logger.createSubLogger('resync-charts'); diff --git a/packages/backend/src/queue/processors/TickChartsProcessorService.ts b/packages/backend/src/queue/processors/TickChartsProcessorService.ts index 218f5bf627..7b1efb71e0 100644 --- a/packages/backend/src/queue/processors/TickChartsProcessorService.ts +++ b/packages/backend/src/queue/processors/TickChartsProcessorService.ts @@ -3,9 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; -import { DI } from '@/di-symbols.js'; -import type { Config } from '@/config.js'; +import { Injectable } from '@nestjs/common'; import type Logger from '@/logger.js'; import FederationChart from '@/core/chart/charts/federation.js'; import NotesChart from '@/core/chart/charts/notes.js'; @@ -28,9 +26,6 @@ export class TickChartsProcessorService { private logger: Logger; constructor( - @Inject(DI.config) - private config: Config, - private federationChart: FederationChart, private notesChart: NotesChart, private usersChart: UsersChart, diff --git a/packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts b/packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts index 169df77924..a41f5565c8 100644 --- a/packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts +++ b/packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import * as Bull from 'bullmq'; import { DI } from '@/di-symbols.js'; -import type { WebhooksRepository } from '@/models/index.js'; +import type { WebhooksRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; import type Logger from '@/logger.js'; import { HttpRequestService } from '@/core/HttpRequestService.js'; @@ -47,6 +47,7 @@ export class WebhookDeliverProcessorService { 'Content-Type': 'application/json', }, body: JSON.stringify({ + server: this.config.url, hookId: job.data.webhookId, userId: job.data.userId, eventId: job.data.eventId, diff --git a/packages/backend/src/queue/types.ts b/packages/backend/src/queue/types.ts index fda3797c92..227c2b35b1 100644 --- a/packages/backend/src/queue/types.ts +++ b/packages/backend/src/queue/types.ts @@ -4,11 +4,11 @@ */ import type { Antenna } from '@/server/api/endpoints/i/import-antennas.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; -import type { MiNote } from '@/models/entities/Note.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiAbuseUserReport } from '@/models/entities/AbuseUserReport.js'; -import type { MiWebhook } from '@/models/entities/Webhook.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; +import type { MiNote } from '@/models/Note.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiAbuseUserReport } from '@/models/AbuseUserReport.js'; +import type { MiWebhook } from '@/models/Webhook.js'; import type { IActivity } from '@/core/activitypub/type.js'; import type httpSignature from '@peertube/http-signature'; diff --git a/packages/backend/src/server/ActivityPubServerService.ts b/packages/backend/src/server/ActivityPubServerService.ts index 546338daa0..44d8a9063b 100644 --- a/packages/backend/src/server/ActivityPubServerService.ts +++ b/packages/backend/src/server/ActivityPubServerService.ts @@ -11,16 +11,16 @@ import { Brackets, In, IsNull, LessThan, Not } from 'typeorm'; import accepts from 'accepts'; import vary from 'vary'; import { DI } from '@/di-symbols.js'; -import type { FollowingsRepository, NotesRepository, EmojisRepository, NoteReactionsRepository, UserProfilesRepository, UserNotePiningsRepository, UsersRepository, FollowRequestsRepository } from '@/models/index.js'; +import type { FollowingsRepository, NotesRepository, EmojisRepository, NoteReactionsRepository, UserProfilesRepository, UserNotePiningsRepository, UsersRepository, FollowRequestsRepository } from '@/models/_.js'; import * as url from '@/misc/prelude/url.js'; import type { Config } from '@/config.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; import { QueueService } from '@/core/QueueService.js'; -import type { MiLocalUser, MiRemoteUser, MiUser } from '@/models/entities/User.js'; +import type { MiLocalUser, MiRemoteUser, MiUser } from '@/models/User.js'; import { UserKeypairService } from '@/core/UserKeypairService.js'; -import type { MiFollowing } from '@/models/entities/Following.js'; +import type { MiFollowing } from '@/models/Following.js'; import { countIf } from '@/misc/prelude/array.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiNote } from '@/models/Note.js'; import { QueryService } from '@/core/QueryService.js'; import { UtilityService } from '@/core/UtilityService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; diff --git a/packages/backend/src/server/FileServerService.ts b/packages/backend/src/server/FileServerService.ts index 9df6ba2a76..11721263d3 100644 --- a/packages/backend/src/server/FileServerService.ts +++ b/packages/backend/src/server/FileServerService.ts @@ -11,7 +11,7 @@ import rename from 'rename'; import sharp from 'sharp'; import { sharpBmp } from 'sharp-read-bmp'; import type { Config } from '@/config.js'; -import type { MiDriveFile, DriveFilesRepository } from '@/models/index.js'; +import type { MiDriveFile, DriveFilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { createTemp } from '@/misc/create-temp.js'; import { FILE_TYPE_BROWSERSAFE } from '@/const.js'; diff --git a/packages/backend/src/server/NodeinfoServerService.ts b/packages/backend/src/server/NodeinfoServerService.ts index 6cd27fe16a..edb8931f43 100644 --- a/packages/backend/src/server/NodeinfoServerService.ts +++ b/packages/backend/src/server/NodeinfoServerService.ts @@ -5,7 +5,6 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { NotesRepository, UsersRepository } from '@/models/index.js'; import type { Config } from '@/config.js'; import { MetaService } from '@/core/MetaService.js'; import { MAX_NOTE_TEXT_LENGTH } from '@/const.js'; @@ -19,6 +18,7 @@ import type { FastifyInstance, FastifyPluginOptions } from 'fastify'; const nodeinfo2_1path = '/nodeinfo/2.1'; const nodeinfo2_0path = '/nodeinfo/2.0'; +const nodeinfo_homepage = 'https://misskey-hub.net'; @Injectable() export class NodeinfoServerService { @@ -26,12 +26,6 @@ export class NodeinfoServerService { @Inject(DI.config) private config: Config, - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - - @Inject(DI.notesRepository) - private notesRepository: NotesRepository, - private userEntityService: UserEntityService, private metaService: MetaService, private notesChart: NotesChart, @@ -42,10 +36,10 @@ export class NodeinfoServerService { @bindThis public getLinks() { - return [/* (awaiting release) { - rel: 'http://nodeinfo.diaspora.software/ns/schema/2.1', - href: config.url + nodeinfo2_1path - }, */{ + return [{ + rel: 'http://nodeinfo.diaspora.software/ns/schema/2.1', + href: this.config.url + nodeinfo2_1path + }, { rel: 'http://nodeinfo.diaspora.software/ns/schema/2.0', href: this.config.url + nodeinfo2_0path, }]; @@ -53,7 +47,7 @@ export class NodeinfoServerService { @bindThis public createServer(fastify: FastifyInstance, options: FastifyPluginOptions, done: (err?: Error) => void) { - const nodeinfo2 = async () => { + const nodeinfo2 = async (version: number) => { const now = Date.now(); const notesChart = await this.notesChart.getChart('hour', 1, null); @@ -80,10 +74,12 @@ export class NodeinfoServerService { const basePolicies = { ...DEFAULT_POLICIES, ...meta.policies }; - return { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const document: any = { software: { name: 'misskey', version: this.config.version, + homepage: nodeinfo_homepage, repository: meta.repositoryUrl, }, protocols: ['activitypub'], @@ -121,23 +117,36 @@ export class NodeinfoServerService { themeColor: meta.themeColor ?? '#86b300', }, }; + if (version >= 21) { + document.software.repository = meta.repositoryUrl; + document.software.homepage = meta.repositoryUrl; + } + return document; }; const cache = new MemorySingleCache>>(1000 * 60 * 10); fastify.get(nodeinfo2_1path, async (request, reply) => { - const base = await cache.fetch(() => nodeinfo2()); + const base = await cache.fetch(() => nodeinfo2(21)); - reply.header('Cache-Control', 'public, max-age=600'); + reply + .type( + 'application/json; profile="http://nodeinfo.diaspora.software/ns/schema/2.1#"', + ) + .header('Cache-Control', 'public, max-age=600'); return { version: '2.1', ...base }; }); fastify.get(nodeinfo2_0path, async (request, reply) => { - const base = await cache.fetch(() => nodeinfo2()); + const base = await cache.fetch(() => nodeinfo2(20)); delete (base as any).software.repository; - reply.header('Cache-Control', 'public, max-age=600'); + reply + .type( + 'application/json; profile="http://nodeinfo.diaspora.software/ns/schema/2.0#"', + ) + .header('Cache-Control', 'public, max-age=600'); return { version: '2.0', ...base }; }); diff --git a/packages/backend/src/server/ServerModule.ts b/packages/backend/src/server/ServerModule.ts index 715f02ea07..fa81380f01 100644 --- a/packages/backend/src/server/ServerModule.ts +++ b/packages/backend/src/server/ServerModule.ts @@ -41,6 +41,7 @@ import { UserListChannelService } from './api/stream/channels/user-list.js'; import { OpenApiServerService } from './api/openapi/OpenApiServerService.js'; import { ClientLoggerService } from './web/ClientLoggerService.js'; import { RoleTimelineChannelService } from './api/stream/channels/role-timeline.js'; +import { OAuth2ProviderService } from './oauth/OAuth2ProviderService.js'; @Module({ imports: [ @@ -83,6 +84,7 @@ import { RoleTimelineChannelService } from './api/stream/channels/role-timeline. ServerStatsChannelService, UserListChannelService, OpenApiServerService, + OAuth2ProviderService, ], exports: [ ServerService, diff --git a/packages/backend/src/server/ServerService.ts b/packages/backend/src/server/ServerService.ts index 5719189c6b..039d3b19ed 100644 --- a/packages/backend/src/server/ServerService.ts +++ b/packages/backend/src/server/ServerService.ts @@ -13,7 +13,7 @@ import fastifyStatic from '@fastify/static'; import { IsNull } from 'typeorm'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import type { Config } from '@/config.js'; -import type { EmojisRepository, UserProfilesRepository, UsersRepository } from '@/models/index.js'; +import type { EmojisRepository, UserProfilesRepository, UsersRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import type Logger from '@/logger.js'; import * as Acct from '@/misc/acct.js'; @@ -31,6 +31,7 @@ import { WellKnownServerService } from './WellKnownServerService.js'; import { FileServerService } from './FileServerService.js'; import { ClientServerService } from './web/ClientServerService.js'; import { OpenApiServerService } from './api/openapi/OpenApiServerService.js'; +import { OAuth2ProviderService } from './oauth/OAuth2ProviderService.js'; const _dirname = fileURLToPath(new URL('.', import.meta.url)); @@ -64,12 +65,13 @@ export class ServerService implements OnApplicationShutdown { private clientServerService: ClientServerService, private globalEventService: GlobalEventService, private loggerService: LoggerService, + private oauth2ProviderService: OAuth2ProviderService, ) { this.logger = this.loggerService.getLogger('server', 'gray', false); } @bindThis - public async launch() { + public async launch(): Promise { const fastify = Fastify({ trustProxy: true, logger: !['production', 'test'].includes(process.env.NODE_ENV ?? ''), @@ -104,6 +106,7 @@ export class ServerService implements OnApplicationShutdown { fastify.register(this.activityPubServerService.createServer); fastify.register(this.nodeinfoServerService.createServer); fastify.register(this.wellKnownServerService.createServer); + fastify.register(this.oauth2ProviderService.createServer); fastify.get<{ Params: { path: string }; Querystring: { static?: any; badge?: any; }; }>('/emoji/:path(.*)', async (request, reply) => { const path = request.params.path; diff --git a/packages/backend/src/server/WellKnownServerService.ts b/packages/backend/src/server/WellKnownServerService.ts index 43c8dcf2c1..8fc3c96de6 100644 --- a/packages/backend/src/server/WellKnownServerService.ts +++ b/packages/backend/src/server/WellKnownServerService.ts @@ -8,10 +8,10 @@ import { IsNull } from 'typeorm'; import vary from 'vary'; import fastifyAccepts from '@fastify/accepts'; import { DI } from '@/di-symbols.js'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; import { escapeAttribute, escapeValue } from '@/misc/prelude/xml.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import * as Acct from '@/misc/acct.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; @@ -73,7 +73,7 @@ export class WellKnownServerService { }); fastify.get('/.well-known/host-meta.json', async (request, reply) => { - reply.header('Content-Type', jrd); + reply.header('Content-Type', 'application/json'); return { links: [{ rel: 'lrdd', diff --git a/packages/backend/src/server/api/ApiCallService.ts b/packages/backend/src/server/api/ApiCallService.ts index 7a233abead..0aeb85199f 100644 --- a/packages/backend/src/server/api/ApiCallService.ts +++ b/packages/backend/src/server/api/ApiCallService.ts @@ -9,10 +9,10 @@ import * as stream from 'node:stream/promises'; import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; import { getIpHash } from '@/misc/get-ip-hash.js'; -import type { MiLocalUser, MiUser } from '@/models/entities/User.js'; -import type { MiAccessToken } from '@/models/entities/AccessToken.js'; +import type { MiLocalUser, MiUser } from '@/models/User.js'; +import type { MiAccessToken } from '@/models/AccessToken.js'; import type Logger from '@/logger.js'; -import type { UserIpsRepository } from '@/models/index.js'; +import type { UserIpsRepository } from '@/models/_.js'; import { MetaService } from '@/core/MetaService.js'; import { createTemp } from '@/misc/create-temp.js'; import { bindThis } from '@/decorators.js'; @@ -36,7 +36,7 @@ const accessDenied = { export class ApiCallService implements OnApplicationShutdown { private logger: Logger; private userIpHistories: Map>; - private userIpHistoriesClearIntervalId: NodeJS.Timer; + private userIpHistoriesClearIntervalId: NodeJS.Timeout; constructor( @Inject(DI.userIpsRepository) diff --git a/packages/backend/src/server/api/ApiServerService.ts b/packages/backend/src/server/api/ApiServerService.ts index ba8340b197..9d22a4f875 100644 --- a/packages/backend/src/server/api/ApiServerService.ts +++ b/packages/backend/src/server/api/ApiServerService.ts @@ -9,7 +9,7 @@ import multipart from '@fastify/multipart'; import fastifyCookie from '@fastify/cookie'; import { ModuleRef } from '@nestjs/core'; import type { Config } from '@/config.js'; -import type { UsersRepository, InstancesRepository, AccessTokensRepository } from '@/models/index.js'; +import type { InstancesRepository, AccessTokensRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; @@ -27,9 +27,6 @@ export class ApiServerService { @Inject(DI.config) private config: Config, - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.instancesRepository) private instancesRepository: InstancesRepository, diff --git a/packages/backend/src/server/api/AuthenticateService.ts b/packages/backend/src/server/api/AuthenticateService.ts index 8b031ab334..f075688194 100644 --- a/packages/backend/src/server/api/AuthenticateService.ts +++ b/packages/backend/src/server/api/AuthenticateService.ts @@ -5,11 +5,11 @@ import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { AccessTokensRepository, AppsRepository, UsersRepository } from '@/models/index.js'; -import type { MiLocalUser } from '@/models/entities/User.js'; -import type { MiAccessToken } from '@/models/entities/AccessToken.js'; +import type { AccessTokensRepository, AppsRepository, UsersRepository } from '@/models/_.js'; +import type { MiLocalUser } from '@/models/User.js'; +import type { MiAccessToken } from '@/models/AccessToken.js'; import { MemoryKVCache } from '@/misc/cache.js'; -import type { MiApp } from '@/models/entities/App.js'; +import type { MiApp } from '@/models/App.js'; import { CacheService } from '@/core/CacheService.js'; import isNativeToken from '@/misc/is-native-token.js'; import { bindThis } from '@/decorators.js'; diff --git a/packages/backend/src/server/api/EndpointsModule.ts b/packages/backend/src/server/api/EndpointsModule.ts index 17bec23c13..739d32ffa0 100644 --- a/packages/backend/src/server/api/EndpointsModule.ts +++ b/packages/backend/src/server/api/EndpointsModule.ts @@ -164,6 +164,7 @@ import * as ep___federation_users from './endpoints/federation/users.js'; import * as ep___federation_stats from './endpoints/federation/stats.js'; import * as ep___following_create from './endpoints/following/create.js'; import * as ep___following_delete from './endpoints/following/delete.js'; +import * as ep___following_update from './endpoints/following/update.js'; import * as ep___following_invalidate from './endpoints/following/invalidate.js'; import * as ep___following_requests_accept from './endpoints/following/requests/accept.js'; import * as ep___following_requests_cancel from './endpoints/following/requests/cancel.js'; @@ -287,6 +288,7 @@ import * as ep___notes_unrenote from './endpoints/notes/unrenote.js'; import * as ep___notes_userListTimeline from './endpoints/notes/user-list-timeline.js'; import * as ep___notifications_create from './endpoints/notifications/create.js'; import * as ep___notifications_markAllAsRead from './endpoints/notifications/mark-all-as-read.js'; +import * as ep___notifications_testNotification from './endpoints/notifications/test-notification.js'; import * as ep___pagePush from './endpoints/page-push.js'; import * as ep___pages_create from './endpoints/pages/create.js'; import * as ep___pages_delete from './endpoints/pages/delete.js'; @@ -340,6 +342,7 @@ import * as ep___users_lists_unfavorite from './endpoints/users/lists/unfavorite import * as ep___users_lists_create_from_public from './endpoints/users/lists/create-from-public.js'; import * as ep___users_notes from './endpoints/users/notes.js'; import * as ep___users_pages from './endpoints/users/pages.js'; +import * as ep___users_flashs from './endpoints/users/flashs.js'; import * as ep___users_reactions from './endpoints/users/reactions.js'; import * as ep___users_recommendation from './endpoints/users/recommendation.js'; import * as ep___users_relation from './endpoints/users/relation.js'; @@ -513,6 +516,7 @@ const $federation_users: Provider = { provide: 'ep:federation/users', useClass: const $federation_stats: Provider = { provide: 'ep:federation/stats', useClass: ep___federation_stats.default }; const $following_create: Provider = { provide: 'ep:following/create', useClass: ep___following_create.default }; const $following_delete: Provider = { provide: 'ep:following/delete', useClass: ep___following_delete.default }; +const $following_update: Provider = { provide: 'ep:following/update', useClass: ep___following_update.default }; const $following_invalidate: Provider = { provide: 'ep:following/invalidate', useClass: ep___following_invalidate.default }; const $following_requests_accept: Provider = { provide: 'ep:following/requests/accept', useClass: ep___following_requests_accept.default }; const $following_requests_cancel: Provider = { provide: 'ep:following/requests/cancel', useClass: ep___following_requests_cancel.default }; @@ -636,6 +640,7 @@ const $notes_unrenote: Provider = { provide: 'ep:notes/unrenote', useClass: ep__ const $notes_userListTimeline: Provider = { provide: 'ep:notes/user-list-timeline', useClass: ep___notes_userListTimeline.default }; const $notifications_create: Provider = { provide: 'ep:notifications/create', useClass: ep___notifications_create.default }; const $notifications_markAllAsRead: Provider = { provide: 'ep:notifications/mark-all-as-read', useClass: ep___notifications_markAllAsRead.default }; +const $notifications_testNotification: Provider = { provide: 'ep:notifications/test-notification', useClass: ep___notifications_testNotification.default }; const $pagePush: Provider = { provide: 'ep:page-push', useClass: ep___pagePush.default }; const $pages_create: Provider = { provide: 'ep:pages/create', useClass: ep___pages_create.default }; const $pages_delete: Provider = { provide: 'ep:pages/delete', useClass: ep___pages_delete.default }; @@ -689,6 +694,7 @@ const $users_lists_unfavorite: Provider = { provide: 'ep:users/lists/unfavorite' const $users_lists_create_from_public: Provider = { provide: 'ep:users/lists/create-from-public', useClass: ep___users_lists_create_from_public.default }; const $users_notes: Provider = { provide: 'ep:users/notes', useClass: ep___users_notes.default }; const $users_pages: Provider = { provide: 'ep:users/pages', useClass: ep___users_pages.default }; +const $users_flashs: Provider = { provide: 'ep:users/flashs', useClass: ep___users_flashs.default }; const $users_reactions: Provider = { provide: 'ep:users/reactions', useClass: ep___users_reactions.default }; const $users_recommendation: Provider = { provide: 'ep:users/recommendation', useClass: ep___users_recommendation.default }; const $users_relation: Provider = { provide: 'ep:users/relation', useClass: ep___users_relation.default }; @@ -866,6 +872,7 @@ const $retention: Provider = { provide: 'ep:retention', useClass: ep___retention $federation_stats, $following_create, $following_delete, + $following_update, $following_invalidate, $following_requests_accept, $following_requests_cancel, @@ -989,6 +996,7 @@ const $retention: Provider = { provide: 'ep:retention', useClass: ep___retention $notes_userListTimeline, $notifications_create, $notifications_markAllAsRead, + $notifications_testNotification, $pagePush, $pages_create, $pages_delete, @@ -1042,6 +1050,7 @@ const $retention: Provider = { provide: 'ep:retention', useClass: ep___retention $users_lists_create_from_public, $users_notes, $users_pages, + $users_flashs, $users_reactions, $users_recommendation, $users_relation, @@ -1213,6 +1222,7 @@ const $retention: Provider = { provide: 'ep:retention', useClass: ep___retention $federation_stats, $following_create, $following_delete, + $following_update, $following_invalidate, $following_requests_accept, $following_requests_cancel, @@ -1387,6 +1397,7 @@ const $retention: Provider = { provide: 'ep:retention', useClass: ep___retention $users_lists_create_from_public, $users_notes, $users_pages, + $users_flashs, $users_reactions, $users_recommendation, $users_relation, diff --git a/packages/backend/src/server/api/GetterService.ts b/packages/backend/src/server/api/GetterService.ts index 834a6ce4ca..e2b98c34e7 100644 --- a/packages/backend/src/server/api/GetterService.ts +++ b/packages/backend/src/server/api/GetterService.ts @@ -5,10 +5,10 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { NotesRepository, UsersRepository } from '@/models/index.js'; +import type { NotesRepository, UsersRepository } from '@/models/_.js'; import { IdentifiableError } from '@/misc/identifiable-error.js'; -import type { MiLocalUser, MiRemoteUser, MiUser } from '@/models/entities/User.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { MiLocalUser, MiRemoteUser, MiUser } from '@/models/User.js'; +import type { MiNote } from '@/models/Note.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; diff --git a/packages/backend/src/server/api/SigninApiService.ts b/packages/backend/src/server/api/SigninApiService.ts index ac8371d8d0..150f3f24d4 100644 --- a/packages/backend/src/server/api/SigninApiService.ts +++ b/packages/backend/src/server/api/SigninApiService.ts @@ -12,13 +12,14 @@ import type { SigninsRepository, UserProfilesRepository, UsersRepository, -} from '@/models/index.js'; +} from '@/models/_.js'; import type { Config } from '@/config.js'; import { getIpHash } from '@/misc/get-ip-hash.js'; -import type { MiLocalUser } from '@/models/entities/User.js'; +import type { MiLocalUser } from '@/models/User.js'; import { IdService } from '@/core/IdService.js'; import { bindThis } from '@/decorators.js'; import { WebAuthnService } from '@/core/WebAuthnService.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; import { RateLimiterService } from './RateLimiterService.js'; import { SigninService } from './SigninService.js'; import type { AuthenticationResponseJSON } from '@simplewebauthn/typescript-types'; @@ -42,6 +43,7 @@ export class SigninApiService { private idService: IdService, private rateLimiterService: RateLimiterService, private signinService: SigninService, + private userAuthService: UserAuthService, private webAuthnService: WebAuthnService, ) { } @@ -124,7 +126,7 @@ export class SigninApiService { const same = await bcrypt.compare(password, profile.password!); const fail = async (status?: number, failure?: { id: string }) => { - // Append signin history + // Append signin history await this.signinsRepository.insert({ id: this.idService.genId(), createdAt: new Date(), @@ -154,27 +156,15 @@ export class SigninApiService { }); } - if (profile.twoFactorBackupSecret?.includes(token)) { - await this.userProfilesRepository.update({ userId: profile.userId }, { - twoFactorBackupSecret: profile.twoFactorBackupSecret.filter((secret) => secret !== token), - }); - return this.signinService.signin(request, reply, user); - } - - const delta = OTPAuth.TOTP.validate({ - secret: OTPAuth.Secret.fromBase32(profile.twoFactorSecret!), - digits: 6, - token, - window: 1, - }); - - if (delta === null) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { return await fail(403, { id: 'cdf1235b-ac71-46d4-a3a6-84ccce48df6f', }); - } else { - return this.signinService.signin(request, reply, user); } + + return this.signinService.signin(request, reply, user); } else if (body.credential) { if (!same && !profile.usePasswordLessLogin) { return await fail(403, { @@ -203,6 +193,6 @@ export class SigninApiService { reply.code(200); return authRequest; } - // never get here + // never get here } } diff --git a/packages/backend/src/server/api/SigninService.ts b/packages/backend/src/server/api/SigninService.ts index 3a0fdd102a..cebba8c8ee 100644 --- a/packages/backend/src/server/api/SigninService.ts +++ b/packages/backend/src/server/api/SigninService.ts @@ -5,10 +5,9 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { SigninsRepository } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { SigninsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; -import type { MiLocalUser } from '@/models/entities/User.js'; +import type { MiLocalUser } from '@/models/User.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { SigninEntityService } from '@/core/entities/SigninEntityService.js'; import { bindThis } from '@/decorators.js'; @@ -17,9 +16,6 @@ import type { FastifyRequest, FastifyReply } from 'fastify'; @Injectable() export class SigninService { constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.signinsRepository) private signinsRepository: SigninsRepository, diff --git a/packages/backend/src/server/api/SignupApiService.ts b/packages/backend/src/server/api/SignupApiService.ts index 6e0351d298..431df581b5 100644 --- a/packages/backend/src/server/api/SignupApiService.ts +++ b/packages/backend/src/server/api/SignupApiService.ts @@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common'; import bcrypt from 'bcryptjs'; import { IsNull } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { RegistrationTicketsRepository, UsedUsernamesRepository, UserPendingsRepository, UserProfilesRepository, UsersRepository, MiRegistrationTicket } from '@/models/index.js'; +import type { RegistrationTicketsRepository, UsedUsernamesRepository, UserPendingsRepository, UserProfilesRepository, UsersRepository, MiRegistrationTicket } from '@/models/_.js'; import type { Config } from '@/config.js'; import { MetaService } from '@/core/MetaService.js'; import { CaptchaService } from '@/core/CaptchaService.js'; @@ -15,7 +15,7 @@ import { IdService } from '@/core/IdService.js'; import { SignupService } from '@/core/SignupService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { EmailService } from '@/core/EmailService.js'; -import { MiLocalUser } from '@/models/entities/User.js'; +import { MiLocalUser } from '@/models/User.js'; import { FastifyReplyError } from '@/misc/fastify-reply-error.js'; import { bindThis } from '@/decorators.js'; import { L_CHARS, secureRndstr } from '@/misc/secure-rndstr.js'; diff --git a/packages/backend/src/server/api/StreamingApiServerService.ts b/packages/backend/src/server/api/StreamingApiServerService.ts index 15f8a3a700..341eeca4e2 100644 --- a/packages/backend/src/server/api/StreamingApiServerService.ts +++ b/packages/backend/src/server/api/StreamingApiServerService.ts @@ -8,16 +8,14 @@ import { Inject, Injectable } from '@nestjs/common'; import * as Redis from 'ioredis'; import * as WebSocket from 'ws'; import { DI } from '@/di-symbols.js'; -import type { UsersRepository, MiAccessToken } from '@/models/index.js'; -import type { Config } from '@/config.js'; +import type { UsersRepository, MiAccessToken } from '@/models/_.js'; import { NoteReadService } from '@/core/NoteReadService.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; import { NotificationService } from '@/core/NotificationService.js'; import { bindThis } from '@/decorators.js'; import { CacheService } from '@/core/CacheService.js'; -import { MiLocalUser } from '@/models/entities/User.js'; +import { MiLocalUser } from '@/models/User.js'; import { AuthenticateService, AuthenticationError } from './AuthenticateService.js'; -import MainStreamConnection from './stream/index.js'; +import MainStreamConnection from './stream/Connection.js'; import { ChannelsService } from './stream/ChannelsService.js'; import type * as http from 'node:http'; @@ -28,9 +26,6 @@ export class StreamingApiServerService { #cleanConnectionsIntervalId: NodeJS.Timeout | null = null; constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.redisForSub) private redisForSub: Redis.Redis, diff --git a/packages/backend/src/server/api/endpoint-base.ts b/packages/backend/src/server/api/endpoint-base.ts index 531311e475..d5279faa1c 100644 --- a/packages/backend/src/server/api/endpoint-base.ts +++ b/packages/backend/src/server/api/endpoint-base.ts @@ -6,8 +6,8 @@ import * as fs from 'node:fs'; import _Ajv from 'ajv'; import type { Schema, SchemaType } from '@/misc/json-schema.js'; -import type { MiLocalUser } from '@/models/entities/User.js'; -import type { MiAccessToken } from '@/models/entities/AccessToken.js'; +import type { MiLocalUser } from '@/models/User.js'; +import type { MiAccessToken } from '@/models/AccessToken.js'; import { ApiError } from './error.js'; import type { IEndpointMeta } from './endpoints.js'; diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts index 8c5ab17d07..98f6604f02 100644 --- a/packages/backend/src/server/api/endpoints.ts +++ b/packages/backend/src/server/api/endpoints.ts @@ -164,6 +164,7 @@ import * as ep___federation_users from './endpoints/federation/users.js'; import * as ep___federation_stats from './endpoints/federation/stats.js'; import * as ep___following_create from './endpoints/following/create.js'; import * as ep___following_delete from './endpoints/following/delete.js'; +import * as ep___following_update from './endpoints/following/update.js'; import * as ep___following_invalidate from './endpoints/following/invalidate.js'; import * as ep___following_requests_accept from './endpoints/following/requests/accept.js'; import * as ep___following_requests_cancel from './endpoints/following/requests/cancel.js'; @@ -287,6 +288,7 @@ import * as ep___notes_unrenote from './endpoints/notes/unrenote.js'; import * as ep___notes_userListTimeline from './endpoints/notes/user-list-timeline.js'; import * as ep___notifications_create from './endpoints/notifications/create.js'; import * as ep___notifications_markAllAsRead from './endpoints/notifications/mark-all-as-read.js'; +import * as ep___notifications_testNotification from './endpoints/notifications/test-notification.js'; import * as ep___pagePush from './endpoints/page-push.js'; import * as ep___pages_create from './endpoints/pages/create.js'; import * as ep___pages_delete from './endpoints/pages/delete.js'; @@ -340,6 +342,7 @@ import * as ep___users_lists_create_from_public from './endpoints/users/lists/cr import * as ep___users_lists_update from './endpoints/users/lists/update.js'; import * as ep___users_notes from './endpoints/users/notes.js'; import * as ep___users_pages from './endpoints/users/pages.js'; +import * as ep___users_flashs from './endpoints/users/flashs.js'; import * as ep___users_reactions from './endpoints/users/reactions.js'; import * as ep___users_recommendation from './endpoints/users/recommendation.js'; import * as ep___users_relation from './endpoints/users/relation.js'; @@ -511,6 +514,7 @@ const eps = [ ['federation/stats', ep___federation_stats], ['following/create', ep___following_create], ['following/delete', ep___following_delete], + ['following/update', ep___following_update], ['following/invalidate', ep___following_invalidate], ['following/requests/accept', ep___following_requests_accept], ['following/requests/cancel', ep___following_requests_cancel], @@ -634,6 +638,7 @@ const eps = [ ['notes/user-list-timeline', ep___notes_userListTimeline], ['notifications/create', ep___notifications_create], ['notifications/mark-all-as-read', ep___notifications_markAllAsRead], + ['notifications/test-notification', ep___notifications_testNotification], ['page-push', ep___pagePush], ['pages/create', ep___pages_create], ['pages/delete', ep___pages_delete], @@ -687,6 +692,7 @@ const eps = [ ['users/lists/create-from-public', ep___users_lists_create_from_public], ['users/notes', ep___users_notes], ['users/pages', ep___users_pages], + ['users/flashs', ep___users_flashs], ['users/reactions', ep___users_reactions], ['users/recommendation', ep___users_recommendation], ['users/relation', ep___users_relation], @@ -813,4 +819,5 @@ const endpoints: IEndpoint[] = (eps as [string, any]).map(([name, ep]) => { }; }); +// eslint-disable-next-line import/no-default-export export default endpoints; diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/create.ts b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/create.ts index ad0b8d6bb2..7246b15cdd 100644 --- a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/create.ts @@ -9,7 +9,7 @@ import RE2 from 're2'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '@/server/api/error.js'; -import type { AbuseReportResolversRepository } from '@/models/index.js'; +import type { AbuseReportResolversRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/delete.ts b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/delete.ts index ba3c63cb93..312a8b4c4c 100644 --- a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/delete.ts @@ -6,7 +6,7 @@ import { Injectable, Inject } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; -import type { AbuseReportResolversRepository } from '@/models/index.js'; +import type { AbuseReportResolversRepository } from '@/models/_.js'; import { ApiError } from '../../../error.js'; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/list.ts b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/list.ts index 23e3641b5f..d806e73d92 100644 --- a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/list.ts @@ -8,7 +8,7 @@ import { Brackets } from 'typeorm'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { QueryService } from '@/core/QueryService.js'; -import type { AbuseReportResolversRepository } from '@/models/index.js'; +import type { AbuseReportResolversRepository } from '@/models/_.js'; export const meta = { requireCredential: true, diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/update.ts b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/update.ts index 1a7bad39a0..c15495fcd3 100644 --- a/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/abuse-report-resolver/update.ts @@ -8,7 +8,7 @@ import ms from 'ms'; import RE2 from 're2'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; -import type { AbuseReportResolversRepository, MiAbuseReportResolver } from '@/models/index.js'; +import type { AbuseReportResolversRepository, MiAbuseReportResolver } from '@/models/_.js'; import { ApiError } from '../../../error.js'; export const meta = { diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts b/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts index 30ee30952c..2ae3f28d18 100644 --- a/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts +++ b/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AbuseUserReportsRepository } from '@/models/index.js'; +import type { AbuseUserReportsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { DI } from '@/di-symbols.js'; import { AbuseUserReportEntityService } from '@/core/entities/AbuseUserReportEntityService.js'; @@ -92,9 +92,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.abuseUserReportsRepository) private abuseUserReportsRepository: AbuseUserReportsRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts index b9b5f82f2a..070e88f6f3 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts @@ -6,10 +6,10 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull } from 'typeorm'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import { SignupService } from '@/core/SignupService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import { localUsernameSchema, passwordSchema } from '@/models/entities/User.js'; +import { localUsernameSchema, passwordSchema } from '@/models/User.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -37,9 +37,8 @@ export const paramDef = { required: ['username', 'password'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts index af51134b1c..60e928ccbe 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts @@ -5,9 +5,8 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import { QueueService } from '@/core/QueueService.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; import { UserSuspendService } from '@/core/UserSuspendService.js'; import { DI } from '@/di-symbols.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; @@ -27,16 +26,14 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, private userEntityService: UserEntityService, private queueService: QueueService, - private globalEventService: GlobalEventService, private userSuspendService: UserSuspendService, ) { super(meta, paramDef, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/admin/ad/create.ts b/packages/backend/src/server/api/endpoints/admin/ad/create.ts index b0d6eae192..a13d08fd3a 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/create.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AdsRepository } from '@/models/index.js'; +import type { AdsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { DI } from '@/di-symbols.js'; @@ -32,9 +32,8 @@ export const paramDef = { required: ['url', 'memo', 'place', 'priority', 'ratio', 'expiresAt', 'startsAt', 'imageUrl', 'dayOfWeek'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.adsRepository) private adsRepository: AdsRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts b/packages/backend/src/server/api/endpoints/admin/ad/delete.ts index bebc07e0d6..d3c53d4f67 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/delete.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AdsRepository } from '@/models/index.js'; +import type { AdsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -32,9 +32,8 @@ export const paramDef = { required: ['id'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.adsRepository) private adsRepository: AdsRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/ad/list.ts b/packages/backend/src/server/api/endpoints/admin/ad/list.ts index b33d921c5f..adff3ed0ae 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/list.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AdsRepository } from '@/models/index.js'; +import type { AdsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { DI } from '@/di-symbols.js'; @@ -26,9 +26,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.adsRepository) private adsRepository: AdsRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/ad/update.ts b/packages/backend/src/server/api/endpoints/admin/ad/update.ts index ada17cf04d..5b77f67e10 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/update.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AdsRepository } from '@/models/index.js'; +import type { AdsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -41,9 +41,8 @@ export const paramDef = { required: ['id', 'memo', 'url', 'imageUrl', 'place', 'priority', 'ratio', 'expiresAt', 'startsAt', 'dayOfWeek'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.adsRepository) private adsRepository: AdsRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/create.ts b/packages/backend/src/server/api/endpoints/admin/announcements/create.ts index c60d0d1889..6b18b89baf 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/create.ts @@ -94,9 +94,8 @@ export const paramDef = { required: ['title', 'text', 'imageUrl'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private announcementService: AnnouncementService, ) { @@ -114,23 +113,9 @@ export default class extends Endpoint { closeDuration: ps.closeDuration, displayOrder: ps.displayOrder, userId: ps.userId, - }); + }, me); - return { - id: packed.id, - createdAt: packed.createdAt, - updatedAt: packed.updatedAt, - title: packed.title, - text: packed.text, - imageUrl: packed.imageUrl, - icon: packed.icon, - display: packed.display, - forExistingUsers: raw.forExistingUsers, - needConfirmationToRead: packed.needConfirmationToRead, - closeDuration: packed.closeDuration, - displayOrder: packed.displayOrder, - userId: raw.userId, - }; + return packed; }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts b/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts index 02dc7e7896..80ec281253 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts @@ -5,10 +5,10 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import { ApiError } from '@/server/api/error.js'; +import type { AnnouncementsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; -import type { AnnouncementsRepository } from '@/models/index.js'; import { AnnouncementService } from '@/core/AnnouncementService.js'; +import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], @@ -33,9 +33,8 @@ export const paramDef = { required: ['id'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.announcementsRepository) private announcementsRepository: AnnouncementsRepository, @@ -47,7 +46,7 @@ export default class extends Endpoint { if (announcement == null) throw new ApiError(meta.errors.noSuchAnnouncement); - await this.announcementService.delete(announcement.id); + await this.announcementService.delete(announcement, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/list.ts b/packages/backend/src/server/api/endpoints/admin/announcements/list.ts index 7dac500799..967be98d10 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/list.ts @@ -3,7 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Injectable } from '@nestjs/common'; +import { Inject, Injectable } from '@nestjs/common'; +import type { AnnouncementsRepository, AnnouncementReadsRepository } from '@/models/_.js'; +import type { MiAnnouncement } from '@/models/Announcement.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { AnnouncementService } from '@/core/AnnouncementService.js'; @@ -104,9 +106,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private announcementService: AnnouncementService, ) { @@ -117,12 +118,12 @@ export default class extends Endpoint { id: announcement.id, createdAt: announcement.createdAt.toISOString(), updatedAt: announcement.updatedAt?.toISOString() ?? null, - isActive: announcement.isActive, title: announcement.title, text: announcement.text, imageUrl: announcement.imageUrl, icon: announcement.icon, display: announcement.display, + isActive: announcement.isActive, forExistingUsers: announcement.forExistingUsers, needConfirmationToRead: announcement.needConfirmationToRead, closeDuration: announcement.closeDuration, diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts index a7fe791c20..ce4ad04e93 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts @@ -5,10 +5,10 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import { ApiError } from '@/server/api/error.js'; +import type { AnnouncementsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; -import type { AnnouncementsRepository } from '@/models/index.js'; import { AnnouncementService } from '@/core/AnnouncementService.js'; +import { ApiError } from '../../../error.js'; export const meta = { tags: ['admin'], @@ -43,9 +43,8 @@ export const paramDef = { required: ['id'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.announcementsRepository) private announcementsRepository: AnnouncementsRepository, @@ -57,7 +56,18 @@ export default class extends Endpoint { if (announcement == null) throw new ApiError(meta.errors.noSuchAnnouncement); - await this.announcementService.update(announcement.id, ps); + await this.announcementService.update(announcement, { + updatedAt: new Date(), + title: ps.title, + text: ps.text, + /* eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- 空の文字列の場合、nullを渡すようにするため */ + imageUrl: ps.imageUrl || null, + display: ps.display, + icon: ps.icon, + forExistingUsers: ps.forExistingUsers, + needConfirmationToRead: ps.needConfirmationToRead, + isActive: ps.isActive, + }, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/delete-account.ts b/packages/backend/src/server/api/endpoints/admin/delete-account.ts index 32c9174073..9ef09b172e 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-account.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-account.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DeleteAccountService } from '@/core/DeleteAccountService.js'; import { DI } from '@/di-symbols.js'; @@ -27,9 +27,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts b/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts index c88b5aad8e..e47ecd81cf 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DriveService } from '@/core/DriveService.js'; import { DI } from '@/di-symbols.js'; @@ -24,9 +24,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts b/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts index 3f55467de0..8af44029c5 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/clean-remote-files.ts @@ -20,9 +20,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private queueService: QueueService, ) { diff --git a/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts b/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts index 188de3f292..75d689966f 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts @@ -6,7 +6,7 @@ import { IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DriveService } from '@/core/DriveService.js'; import { DI } from '@/di-symbols.js'; @@ -23,9 +23,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/drive/files.ts b/packages/backend/src/server/api/endpoints/admin/drive/files.ts index 7541cccfaf..83c7256c26 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/files.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { DI } from '@/di-symbols.js'; @@ -46,9 +46,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts b/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts index 9cd0583049..7fb5342f8d 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { DriveFilesRepository, UsersRepository } from '@/models/index.js'; +import type { DriveFilesRepository, UsersRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; @@ -153,9 +153,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts index f0db9c063f..66ee4cab3b 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/add-aliases-bulk.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js'; @@ -27,9 +27,8 @@ export const paramDef = { required: ['ids', 'aliases'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private customEmojiService: CustomEmojiService, ) { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/add.ts b/packages/backend/src/server/api/endpoints/admin/emoji/add.ts index b47d6a0a1d..a62d7b1767 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/add.ts @@ -5,10 +5,9 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js'; -import { ModerationLogService } from '@/core/ModerationLogService.js'; import { EmojiEntityService } from '@/core/entities/EmojiEntityService.js'; import { ApiError } from '../../../error.js'; @@ -57,9 +56,8 @@ export const paramDef = { // TODO: ロジックをサービスに切り出す -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, @@ -67,7 +65,6 @@ export default class extends Endpoint { private customEmojiService: CustomEmojiService, private emojiEntityService: EmojiEntityService, - private moderationLogService: ModerationLogService, ) { super(meta, paramDef, async (ps, me) => { const driveFile = await this.driveFilesRepository.findOneBy({ id: ps.fileId }); @@ -84,11 +81,7 @@ export default class extends Endpoint { localOnly: ps.localOnly ?? false, roleIdsThatCanBeUsedThisEmojiAsReaction: ps.roleIdsThatCanBeUsedThisEmojiAsReaction ?? [], roleIdsThatCanNotBeUsedThisEmojiAsReaction: ps.roleIdsThatCanNotBeUsedThisEmojiAsReaction ?? [], - }); - - this.moderationLogService.insertModerationLog(me, 'addEmoji', { - emojiId: emoji.id, - }); + }, me); return this.emojiEntityService.packDetailed(emoji); }); diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts b/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts index 9e36a0a9af..c5f986ff02 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts @@ -4,11 +4,10 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import { DataSource } from 'typeorm'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { EmojisRepository } from '@/models/index.js'; +import type { EmojisRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; import { DI } from '@/di-symbols.js'; import { DriveService } from '@/core/DriveService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; @@ -52,13 +51,9 @@ export const paramDef = { // TODO: ロジックをサービスに切り出す -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.db) - private db: DataSource, - @Inject(DI.emojisRepository) private emojisRepository: EmojisRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts index 0d49567614..e6c1bf317f 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/delete-bulk.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js'; @@ -24,14 +24,13 @@ export const paramDef = { required: ['ids'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private customEmojiService: CustomEmojiService, ) { super(meta, paramDef, async (ps, me) => { - await this.customEmojiService.deleteBulk(ps.ids); + await this.customEmojiService.deleteBulk(ps.ids, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts b/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts index a4b27e2c8e..58aa0b9950 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js'; @@ -30,14 +30,13 @@ export const paramDef = { required: ['id'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private customEmojiService: CustomEmojiService, ) { super(meta, paramDef, async (ps, me) => { - await this.customEmojiService.delete(ps.id); + await this.customEmojiService.delete(ps.id, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts b/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts index 8d10578de0..208616c0ac 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/import-zip.ts @@ -21,9 +21,8 @@ export const paramDef = { required: ['fileId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private queueService: QueueService, ) { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts b/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts index 912229c1cc..855ab8cd24 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { EmojisRepository } from '@/models/index.js'; +import type { EmojisRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { UtilityService } from '@/core/UtilityService.js'; import { EmojiEntityService } from '@/core/entities/EmojiEntityService.js'; @@ -77,9 +77,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.emojisRepository) private emojisRepository: EmojisRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/list.ts b/packages/backend/src/server/api/endpoints/admin/emoji/list.ts index 5a3263045b..ab16d86a3d 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list.ts @@ -5,8 +5,8 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { EmojisRepository } from '@/models/index.js'; -import type { MiEmoji } from '@/models/entities/Emoji.js'; +import type { EmojisRepository } from '@/models/_.js'; +import type { MiEmoji } from '@/models/Emoji.js'; import { QueryService } from '@/core/QueryService.js'; import { DI } from '@/di-symbols.js'; import { EmojiEntityService } from '@/core/entities/EmojiEntityService.js'; @@ -71,9 +71,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.emojisRepository) private emojisRepository: EmojisRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts index 18bfbdc188..a5dd6d5e3a 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/remove-aliases-bulk.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js'; @@ -27,9 +27,8 @@ export const paramDef = { required: ['ids', 'aliases'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private customEmojiService: CustomEmojiService, ) { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts index 8c23b97e92..515053f57b 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/set-aliases-bulk.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js'; @@ -27,9 +27,8 @@ export const paramDef = { required: ['ids', 'aliases'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private customEmojiService: CustomEmojiService, ) { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts index 99ba88c5df..8e834ad1dd 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/set-category-bulk.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js'; @@ -29,9 +29,8 @@ export const paramDef = { required: ['ids'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private customEmojiService: CustomEmojiService, ) { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts b/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts index 999038b2d2..2dc9595a7e 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/set-license-bulk.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js'; @@ -29,9 +29,8 @@ export const paramDef = { required: ['ids'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private customEmojiService: CustomEmojiService, ) { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts index c99e62df2d..6ab38fe0b0 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -64,9 +64,8 @@ export const paramDef = { required: ['id', 'name', 'aliases'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, @@ -91,7 +90,7 @@ export default class extends Endpoint { localOnly: ps.localOnly, roleIdsThatCanBeUsedThisEmojiAsReaction: ps.roleIdsThatCanBeUsedThisEmojiAsReaction, roleIdsThatCanNotBeUsedThisEmojiAsReaction: ps.roleIdsThatCanNotBeUsedThisEmojiAsReaction, - }); + }, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts b/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts index 93a22a7dea..b63f01bec3 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DriveService } from '@/core/DriveService.js'; import { DI } from '@/di-symbols.js'; @@ -24,9 +24,8 @@ export const paramDef = { required: ['host'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts b/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts index 3bc2646370..6dbfe3c4f5 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { InstancesRepository } from '@/models/index.js'; +import type { InstancesRepository } from '@/models/_.js'; import { FetchInstanceMetadataService } from '@/core/FetchInstanceMetadataService.js'; import { UtilityService } from '@/core/UtilityService.js'; import { DI } from '@/di-symbols.js'; @@ -25,9 +25,8 @@ export const paramDef = { required: ['host'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.instancesRepository) private instancesRepository: InstancesRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts b/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts index ac60e3bcc9..36ea390e45 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { FollowingsRepository, UsersRepository } from '@/models/index.js'; +import type { FollowingsRepository, UsersRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { QueueService } from '@/core/QueueService.js'; @@ -24,9 +24,8 @@ export const paramDef = { required: ['host'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts b/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts index 3eb1fc90a9..357bf83e87 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts @@ -5,10 +5,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { InstancesRepository } from '@/models/index.js'; +import type { InstancesRepository } from '@/models/_.js'; import { UtilityService } from '@/core/UtilityService.js'; import { DI } from '@/di-symbols.js'; import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; +import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin'], @@ -26,15 +27,15 @@ export const paramDef = { required: ['host', 'isSuspended'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.instancesRepository) private instancesRepository: InstancesRepository, private utilityService: UtilityService, private federatedInstanceService: FederatedInstanceService, + private moderationLogService: ModerationLogService, ) { super(meta, paramDef, async (ps, me) => { const instance = await this.instancesRepository.findOneBy({ host: this.utilityService.toPuny(ps.host) }); @@ -43,9 +44,23 @@ export default class extends Endpoint { throw new Error('instance not found'); } - this.federatedInstanceService.update(instance.id, { + await this.federatedInstanceService.update(instance.id, { isSuspended: ps.isSuspended, }); + + if (instance.isSuspended !== ps.isSuspended) { + if (ps.isSuspended) { + this.moderationLogService.log(me, 'suspendRemoteInstance', { + id: instance.id, + host: instance.host, + }); + } else { + this.moderationLogService.log(me, 'unsuspendRemoteInstance', { + id: instance.id, + host: instance.host, + }); + } + } }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts b/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts index 11174958fa..4bd9e7de7f 100644 --- a/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts @@ -21,9 +21,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts b/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts index a5e1d002c0..f953b889a3 100644 --- a/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts @@ -32,9 +32,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts b/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts index 9e4d18e10f..cf94c998fa 100644 --- a/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts +++ b/packages/backend/src/server/api/endpoints/admin/get-user-ips.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserIpsRepository } from '@/models/index.js'; +import type { UserIpsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -23,9 +23,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userIpsRepository) private userIpsRepository: UserIpsRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/invite/create.ts b/packages/backend/src/server/api/endpoints/admin/invite/create.ts index 5bdca71142..7112e06bdc 100644 --- a/packages/backend/src/server/api/endpoints/admin/invite/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/invite/create.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistrationTicketsRepository } from '@/models/index.js'; +import type { RegistrationTicketsRepository } from '@/models/_.js'; import { InviteCodeEntityService } from '@/core/entities/InviteCodeEntityService.js'; import { IdService } from '@/core/IdService.js'; import { DI } from '@/di-symbols.js'; @@ -52,9 +52,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registrationTicketsRepository) private registrationTicketsRepository: RegistrationTicketsRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/invite/list.ts b/packages/backend/src/server/api/endpoints/admin/invite/list.ts index 6d2874fd1f..a20a51121a 100644 --- a/packages/backend/src/server/api/endpoints/admin/invite/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/invite/list.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistrationTicketsRepository } from '@/models/index.js'; +import type { RegistrationTicketsRepository } from '@/models/_.js'; import { InviteCodeEntityService } from '@/core/entities/InviteCodeEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -36,9 +36,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registrationTicketsRepository) private registrationTicketsRepository: RegistrationTicketsRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 93423a743d..c3ba07cdd0 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -85,6 +85,14 @@ export const meta = { type: 'string', optional: false, nullable: true, }, + app192IconUrl: { + type: 'string', + optional: false, nullable: true, + }, + app512IconUrl: { + type: 'string', + optional: false, nullable: true, + }, enableEmail: { type: 'boolean', optional: false, nullable: false, @@ -278,6 +286,10 @@ export const meta = { type: 'boolean', optional: false, nullable: false, }, + manifestJsonOverride: { + type: 'string', + optional: true, nullable: false, + }, policies: { type: 'object', optional: false, nullable: false, @@ -293,9 +305,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.config) private config: Config, @@ -310,6 +321,7 @@ export default class extends Endpoint { maintainerEmail: instance.maintainerEmail, version: this.config.version, name: instance.name, + shortName: instance.shortName, uri: this.config.url, description: instance.description, langs: instance.langs, @@ -332,6 +344,8 @@ export default class extends Endpoint { notFoundImageUrl: instance.notFoundImageUrl, infoImageUrl: instance.infoImageUrl, iconUrl: instance.iconUrl, + app192IconUrl: instance.app192IconUrl, + app512IconUrl: instance.app512IconUrl, backgroundImageUrl: instance.backgroundImageUrl, logoImageUrl: instance.logoImageUrl, defaultLightTheme: instance.defaultLightTheme, @@ -384,6 +398,7 @@ export default class extends Endpoint { enableServerMachineStats: instance.enableServerMachineStats, enableIdenticonGeneration: instance.enableIdenticonGeneration, policies: { ...DEFAULT_POLICIES, ...instance.policies }, + manifestJsonOverride: instance.manifestJsonOverride, }; }); } diff --git a/packages/backend/src/server/api/endpoints/admin/promo/create.ts b/packages/backend/src/server/api/endpoints/admin/promo/create.ts index ca7cecb08b..4061e1b5df 100644 --- a/packages/backend/src/server/api/endpoints/admin/promo/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/promo/create.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { PromoNotesRepository } from '@/models/index.js'; +import type { PromoNotesRepository } from '@/models/_.js'; import { GetterService } from '@/server/api/GetterService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -40,9 +40,8 @@ export const paramDef = { required: ['noteId', 'expiresAt'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.promoNotesRepository) private promoNotesRepository: PromoNotesRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/queue/clear.ts b/packages/backend/src/server/api/endpoints/admin/queue/clear.ts index d2e6fd6e20..c9142e9885 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/clear.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/clear.ts @@ -21,9 +21,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private moderationLogService: ModerationLogService, private queueService: QueueService, @@ -31,7 +30,7 @@ export default class extends Endpoint { super(meta, paramDef, async (ps, me) => { this.queueService.destroy(); - this.moderationLogService.insertModerationLog(me, 'clearQueue'); + this.moderationLogService.log(me, 'clearQueue'); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts b/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts index 9079f66c79..f5c13dc8ac 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts @@ -45,9 +45,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject('queue:deliver') public deliverQueue: DeliverQueue, diff --git a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts index f68fb83f11..580bbe3baf 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts @@ -45,9 +45,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject('queue:inbox') public inboxQueue: InboxQueue, diff --git a/packages/backend/src/server/api/endpoints/admin/queue/promote.ts b/packages/backend/src/server/api/endpoints/admin/queue/promote.ts index c4dea776f4..0cba5b4e25 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/promote.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/promote.ts @@ -23,9 +23,8 @@ export const paramDef = { required: ['type'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private moderationLogService: ModerationLogService, private queueService: QueueService, @@ -71,7 +70,7 @@ export default class extends Endpoint { break; } - this.moderationLogService.insertModerationLog(me, 'promoteQueue'); + this.moderationLogService.log(me, 'promoteQueue'); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/queue/stats.ts b/packages/backend/src/server/api/endpoints/admin/queue/stats.ts index 86ae094fc4..901195e9a5 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/stats.ts @@ -43,9 +43,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject('queue:system') public systemQueue: SystemQueue, @Inject('queue:endedPollNotification') public endedPollNotificationQueue: EndedPollNotificationQueue, diff --git a/packages/backend/src/server/api/endpoints/admin/relays/add.ts b/packages/backend/src/server/api/endpoints/admin/relays/add.ts index e420a42ab3..b675db2b89 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/add.ts @@ -59,9 +59,8 @@ export const paramDef = { required: ['inbox'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private relayService: RelayService, ) { diff --git a/packages/backend/src/server/api/endpoints/admin/relays/list.ts b/packages/backend/src/server/api/endpoints/admin/relays/list.ts index 7be4cfad83..0633c57ed5 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/list.ts @@ -51,9 +51,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private relayService: RelayService, ) { diff --git a/packages/backend/src/server/api/endpoints/admin/relays/remove.ts b/packages/backend/src/server/api/endpoints/admin/relays/remove.ts index 6454463f00..661b4243c4 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/remove.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/remove.ts @@ -22,9 +22,8 @@ export const paramDef = { required: ['inbox'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private relayService: RelayService, ) { diff --git a/packages/backend/src/server/api/endpoints/admin/reset-password.ts b/packages/backend/src/server/api/endpoints/admin/reset-password.ts index 6e4ba959a2..6ce7583276 100644 --- a/packages/backend/src/server/api/endpoints/admin/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/admin/reset-password.ts @@ -6,9 +6,10 @@ import { Inject, Injectable } from '@nestjs/common'; import bcrypt from 'bcryptjs'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository, UserProfilesRepository } from '@/models/index.js'; +import type { UsersRepository, UserProfilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { secureRndstr } from '@/misc/secure-rndstr.js'; +import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin'], @@ -38,17 +39,18 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, + + private moderationLogService: ModerationLogService, ) { - super(meta, paramDef, async (ps) => { + super(meta, paramDef, async (ps, me) => { const user = await this.usersRepository.findOneBy({ id: ps.userId }); if (user == null) { @@ -70,6 +72,10 @@ export default class extends Endpoint { password: hash, }); + this.moderationLogService.log(me, 'resetPassword', { + targetId: user.id, + }); + return { password: passwd, }; diff --git a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts index d37d46daa8..8667640a67 100644 --- a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts +++ b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository, AbuseUserReportsRepository } from '@/models/index.js'; +import type { UsersRepository, AbuseUserReportsRepository } from '@/models/_.js'; import { InstanceActorService } from '@/core/InstanceActorService.js'; import { QueueService } from '@/core/QueueService.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; @@ -29,9 +29,8 @@ export const paramDef = { // TODO: ロジックをサービスに切り出す -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/roles/assign.ts b/packages/backend/src/server/api/endpoints/admin/roles/assign.ts index 78ab13a773..a0f3edd867 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/assign.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/assign.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RolesRepository, UsersRepository } from '@/models/index.js'; +import type { RolesRepository, UsersRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '@/server/api/error.js'; import { RoleService } from '@/core/RoleService.js'; @@ -53,9 +53,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -84,7 +83,7 @@ export default class extends Endpoint { return; } - await this.roleService.assign(user.id, role.id, ps.expiresAt ? new Date(ps.expiresAt) : null); + await this.roleService.assign(user.id, role.id, ps.expiresAt ? new Date(ps.expiresAt) : null, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/roles/create.ts b/packages/backend/src/server/api/endpoints/admin/roles/create.ts index d4c3e4d789..f567b0d387 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/create.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RolesRepository } from '@/models/index.js'; +import type { RolesRepository } from '@/models/_.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { IdService } from '@/core/IdService.js'; @@ -55,9 +55,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.rolesRepository) private rolesRepository: RolesRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/roles/delete.ts b/packages/backend/src/server/api/endpoints/admin/roles/delete.ts index b57cd0d5c8..7b989050eb 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/delete.ts @@ -5,10 +5,10 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RolesRepository } from '@/models/index.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; +import type { RolesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '@/server/api/error.js'; +import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['admin', 'role'], @@ -35,24 +35,20 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.rolesRepository) private rolesRepository: RolesRepository, - private globalEventService: GlobalEventService, + private roleService: RoleService, ) { - super(meta, paramDef, async (ps) => { + super(meta, paramDef, async (ps, me) => { const role = await this.rolesRepository.findOneBy({ id: ps.roleId }); if (role == null) { throw new ApiError(meta.errors.noSuchRole); } - await this.rolesRepository.delete({ - id: ps.roleId, - }); - this.globalEventService.publishInternalEvent('roleDeleted', role); + await this.roleService.delete(role, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/roles/list.ts b/packages/backend/src/server/api/endpoints/admin/roles/list.ts index 363cac7f05..3ed4b324dc 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/list.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RolesRepository } from '@/models/index.js'; +import type { RolesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { RoleEntityService } from '@/core/entities/RoleEntityService.js'; @@ -24,9 +24,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.rolesRepository) private rolesRepository: RolesRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/roles/show.ts b/packages/backend/src/server/api/endpoints/admin/roles/show.ts index 189e40dd6f..5f0accab6f 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/show.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/show.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RolesRepository } from '@/models/index.js'; +import type { RolesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '@/server/api/error.js'; import { RoleEntityService } from '@/core/entities/RoleEntityService.js'; @@ -35,9 +35,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.rolesRepository) private rolesRepository: RolesRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/roles/unassign.ts b/packages/backend/src/server/api/endpoints/admin/roles/unassign.ts index 1b3c49571b..4c27583111 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/unassign.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/unassign.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RolesRepository, UsersRepository } from '@/models/index.js'; +import type { RolesRepository, UsersRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '@/server/api/error.js'; import { RoleService } from '@/core/RoleService.js'; @@ -55,9 +55,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -82,7 +81,7 @@ export default class extends Endpoint { throw new ApiError(meta.errors.noSuchUser); } - await this.roleService.unassign(user.id, role.id); + await this.roleService.unassign(user.id, role.id, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/roles/update-default-policies.ts b/packages/backend/src/server/api/endpoints/admin/roles/update-default-policies.ts index 85ddecf839..b4e7e29e90 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/update-default-policies.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/update-default-policies.ts @@ -27,9 +27,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private metaService: MetaService, private globalEventService: GlobalEventService, diff --git a/packages/backend/src/server/api/endpoints/admin/roles/update.ts b/packages/backend/src/server/api/endpoints/admin/roles/update.ts index f336a3f8e9..e4e59e487c 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/update.ts @@ -5,10 +5,11 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RolesRepository } from '@/models/index.js'; +import type { RolesRepository } from '@/models/_.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '@/server/api/error.js'; +import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['admin', 'role'], @@ -64,23 +65,22 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.rolesRepository) private rolesRepository: RolesRepository, - private globalEventService: GlobalEventService, + private roleService: RoleService, ) { - super(meta, paramDef, async (ps) => { - const roleExist = await this.rolesRepository.exist({ where: { id: ps.roleId } }); - if (!roleExist) { + super(meta, paramDef, async (ps, me) => { + const role = await this.rolesRepository.findOneBy({ id: ps.roleId }); + if (role == null) { throw new ApiError(meta.errors.noSuchRole); } const date = new Date(); - await this.rolesRepository.update(ps.roleId, { + await this.roleService.update(role, { updatedAt: date, name: ps.name, description: ps.description, @@ -96,9 +96,7 @@ export default class extends Endpoint { canEditMembersByModerator: ps.canEditMembersByModerator, displayOrder: ps.displayOrder, policies: ps.policies, - }); - const updated = await this.rolesRepository.findOneByOrFail({ id: ps.roleId }); - this.globalEventService.publishInternalEvent('roleUpdated', updated); + }, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/roles/users.ts b/packages/backend/src/server/api/endpoints/admin/roles/users.ts index 89f58d036e..b1772be777 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/users.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/users.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Brackets } from 'typeorm'; -import type { RoleAssignmentsRepository, RolesRepository } from '@/models/index.js'; +import type { RoleAssignmentsRepository, RolesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { DI } from '@/di-symbols.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: ['roleId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.rolesRepository) private rolesRepository: RolesRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/send-email.ts b/packages/backend/src/server/api/endpoints/admin/send-email.ts index 48e52ca75f..b9f2c6a6f1 100644 --- a/packages/backend/src/server/api/endpoints/admin/send-email.ts +++ b/packages/backend/src/server/api/endpoints/admin/send-email.ts @@ -24,9 +24,8 @@ export const paramDef = { required: ['to', 'subject', 'text'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private emailService: EmailService, ) { diff --git a/packages/backend/src/server/api/endpoints/admin/server-info.ts b/packages/backend/src/server/api/endpoints/admin/server-info.ts index c3446da3c0..3169373b0e 100644 --- a/packages/backend/src/server/api/endpoints/admin/server-info.ts +++ b/packages/backend/src/server/api/endpoints/admin/server-info.ts @@ -100,9 +100,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts index a71892de17..b904916ef0 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ModerationLogsRepository } from '@/models/index.js'; +import type { ModerationLogsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { DI } from '@/di-symbols.js'; import { ModerationLogEntityService } from '@/core/entities/ModerationLogEntityService.js'; @@ -62,13 +62,14 @@ export const paramDef = { limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, sinceId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' }, + type: { type: 'string', nullable: true }, + userId: { type: 'string', format: 'misskey:id', nullable: true }, }, required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.moderationLogsRepository) private moderationLogsRepository: ModerationLogsRepository, @@ -79,6 +80,14 @@ export default class extends Endpoint { super(meta, paramDef, async (ps, me) => { const query = this.queryService.makePaginationQuery(this.moderationLogsRepository.createQueryBuilder('report'), ps.sinceId, ps.untilId); + if (ps.type != null) { + query.andWhere('report.type = :type', { type: ps.type }); + } + + if (ps.userId != null) { + query.andWhere('report.userId = :userId', { userId: ps.userId }); + } + const reports = await query.limit(ps.limit).getMany(); return await this.moderationLogEntityService.packMany(reports, me); diff --git a/packages/backend/src/server/api/endpoints/admin/show-user.ts b/packages/backend/src/server/api/endpoints/admin/show-user.ts index f33b2a2c61..d66edfa8cd 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-user.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository, SigninsRepository, UserProfilesRepository } from '@/models/index.js'; +import type { UsersRepository, SigninsRepository, UserProfilesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; @@ -30,9 +30,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/show-users.ts b/packages/backend/src/server/api/endpoints/admin/show-users.ts index cc07e77f49..e89e1a1490 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-users.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-users.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; @@ -47,9 +47,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts index e133adcbd0..89199f8bff 100644 --- a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts @@ -6,8 +6,8 @@ import { IsNull, Not } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository, FollowingsRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { UsersRepository, FollowingsRepository } from '@/models/_.js'; +import type { MiUser } from '@/models/User.js'; import type { RelationshipJobData } from '@/queue/types.js'; import { ModerationLogService } from '@/core/ModerationLogService.js'; import { UserSuspendService } from '@/core/UserSuspendService.js'; @@ -31,9 +31,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -61,7 +60,7 @@ export default class extends Endpoint { isSuspended: true, }); - this.moderationLogService.insertModerationLog(me, 'suspend', { + this.moderationLogService.log(me, 'suspend', { targetId: user.id, }); diff --git a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts index 984e0ee074..a2779148ed 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import { ModerationLogService } from '@/core/ModerationLogService.js'; import { UserSuspendService } from '@/core/UserSuspendService.js'; import { DI } from '@/di-symbols.js'; @@ -25,9 +25,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -46,7 +45,7 @@ export default class extends Endpoint { isSuspended: false, }); - this.moderationLogService.insertModerationLog(me, 'unsuspend', { + this.moderationLogService.log(me, 'unsuspend', { targetId: user.id, }); diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index b2a66895db..ea6ebdd1fe 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -3,12 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; -import { DataSource } from 'typeorm'; -import type { MiMeta } from '@/models/entities/Meta.js'; +import { Injectable } from '@nestjs/common'; +import type { MiMeta } from '@/models/Meta.js'; import { ModerationLogService } from '@/core/ModerationLogService.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import { DI } from '@/di-symbols.js'; import { MetaService } from '@/core/MetaService.js'; export const meta = { @@ -41,9 +39,12 @@ export const paramDef = { infoImageUrl: { type: 'string', nullable: true }, notFoundImageUrl: { type: 'string', nullable: true }, iconUrl: { type: 'string', nullable: true }, + app192IconUrl: { type: 'string', nullable: true }, + app512IconUrl: { type: 'string', nullable: true }, backgroundImageUrl: { type: 'string', nullable: true }, logoImageUrl: { type: 'string', nullable: true }, name: { type: 'string', nullable: true }, + shortName: { type: 'string', nullable: true }, description: { type: 'string', nullable: true }, defaultLightTheme: { type: 'string', nullable: true }, defaultDarkTheme: { type: 'string', nullable: true }, @@ -106,17 +107,14 @@ export const paramDef = { enableIdenticonGeneration: { type: 'boolean' }, serverRules: { type: 'array', items: { type: 'string' } }, preservedUsernames: { type: 'array', items: { type: 'string' } }, + manifestJsonOverride: { type: 'string' }, }, required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.db) - private db: DataSource, - private metaService: MetaService, private moderationLogService: ModerationLogService, ) { @@ -159,6 +157,14 @@ export default class extends Endpoint { set.iconUrl = ps.iconUrl; } + if (ps.app192IconUrl !== undefined) { + set.app192IconUrl = ps.app192IconUrl; + } + + if (ps.app512IconUrl !== undefined) { + set.app512IconUrl = ps.app512IconUrl; + } + if (ps.serverErrorImageUrl !== undefined) { set.serverErrorImageUrl = ps.serverErrorImageUrl; } @@ -183,6 +189,10 @@ export default class extends Endpoint { set.name = ps.name; } + if (ps.shortName !== undefined) { + set.shortName = ps.shortName; + } + if (ps.description !== undefined) { set.description = ps.description; } @@ -427,8 +437,20 @@ export default class extends Endpoint { set.preservedUsernames = ps.preservedUsernames; } + if (ps.manifestJsonOverride !== undefined) { + set.manifestJsonOverride = ps.manifestJsonOverride; + } + + const before = await this.metaService.fetch(true); + await this.metaService.update(set); - this.moderationLogService.insertModerationLog(me, 'updateMeta'); + + const after = await this.metaService.fetch(true); + + this.moderationLogService.log(me, 'updateServerSettings', { + before, + after, + }); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/update-user-note.ts b/packages/backend/src/server/api/endpoints/admin/update-user-note.ts index 2cfd772635..2e9fd5ad29 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-user-note.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-user-note.ts @@ -4,9 +4,10 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserProfilesRepository, UsersRepository } from '@/models/index.js'; +import type { UserProfilesRepository, UsersRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; +import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin'], @@ -24,15 +25,16 @@ export const paramDef = { required: ['userId', 'text'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, + + private moderationLogService: ModerationLogService, ) { super(meta, paramDef, async (ps, me) => { const user = await this.usersRepository.findOneBy({ id: ps.userId }); @@ -41,9 +43,17 @@ export default class extends Endpoint { throw new Error('user not found'); } + const currentProfile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id }); + await this.userProfilesRepository.update({ userId: user.id }, { moderationNote: ps.text, }); + + this.moderationLogService.log(me, 'updateUserNote', { + userId: user.id, + before: currentProfile.moderationNote, + after: ps.text, + }); }); } } diff --git a/packages/backend/src/server/api/endpoints/announcements.ts b/packages/backend/src/server/api/endpoints/announcements.ts index 372c002f14..dd4f82bfea 100644 --- a/packages/backend/src/server/api/endpoints/announcements.ts +++ b/packages/backend/src/server/api/endpoints/announcements.ts @@ -9,7 +9,7 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { AnnouncementService } from '@/core/AnnouncementService.js'; import { DI } from '@/di-symbols.js'; -import type { AnnouncementReadsRepository, AnnouncementsRepository } from '@/models/index.js'; +import type { AnnouncementReadsRepository, AnnouncementsRepository } from '@/models/_.js'; export const meta = { tags: ['meta'], @@ -37,9 +37,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.announcementsRepository) private announcementsRepository: AnnouncementsRepository, diff --git a/packages/backend/src/server/api/endpoints/antennas/create.ts b/packages/backend/src/server/api/endpoints/antennas/create.ts index 885775fd80..f81328b0b4 100644 --- a/packages/backend/src/server/api/endpoints/antennas/create.ts +++ b/packages/backend/src/server/api/endpoints/antennas/create.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { IdService } from '@/core/IdService.js'; -import type { UserListsRepository, AntennasRepository } from '@/models/index.js'; +import type { UserListsRepository, AntennasRepository } from '@/models/_.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { AntennaEntityService } from '@/core/entities/AntennaEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -48,7 +48,7 @@ export const paramDef = { type: 'object', properties: { name: { type: 'string', minLength: 1, maxLength: 100 }, - src: { type: 'string', enum: ['home', 'all', 'users', 'list'] }, + src: { type: 'string', enum: ['home', 'all', 'users', 'list', 'users_blacklist'] }, userListId: { type: 'string', format: 'misskey:id', nullable: true }, keywords: { type: 'array', items: { type: 'array', items: { @@ -71,9 +71,8 @@ export const paramDef = { required: ['name', 'src', 'keywords', 'excludeKeywords', 'users', 'caseSensitive', 'withReplies', 'withFile', 'notify'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.antennasRepository) private antennasRepository: AntennasRepository, @@ -87,8 +86,8 @@ export default class extends Endpoint { private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { - if ((ps.keywords.length === 0) || ps.keywords[0].every(x => x === '')) { - throw new Error('invalid param'); + if (ps.keywords.flat().every(x => x === '') && ps.excludeKeywords.flat().every(x => x === '')) { + throw new Error('either keywords or excludeKeywords is required.'); } const currentAntennasCount = await this.antennasRepository.countBy({ diff --git a/packages/backend/src/server/api/endpoints/antennas/delete.ts b/packages/backend/src/server/api/endpoints/antennas/delete.ts index 512c95383c..c4ebbc7847 100644 --- a/packages/backend/src/server/api/endpoints/antennas/delete.ts +++ b/packages/backend/src/server/api/endpoints/antennas/delete.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AntennasRepository } from '@/models/index.js'; +import type { AntennasRepository } from '@/models/_.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -35,9 +35,8 @@ export const paramDef = { required: ['antennaId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.antennasRepository) private antennasRepository: AntennasRepository, diff --git a/packages/backend/src/server/api/endpoints/antennas/list.ts b/packages/backend/src/server/api/endpoints/antennas/list.ts index db5d65589d..3a9f969d24 100644 --- a/packages/backend/src/server/api/endpoints/antennas/list.ts +++ b/packages/backend/src/server/api/endpoints/antennas/list.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AntennasRepository } from '@/models/index.js'; +import type { AntennasRepository } from '@/models/_.js'; import { AntennaEntityService } from '@/core/entities/AntennaEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -33,9 +33,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.antennasRepository) private antennasRepository: AntennasRepository, diff --git a/packages/backend/src/server/api/endpoints/antennas/notes.ts b/packages/backend/src/server/api/endpoints/antennas/notes.ts index 145134dcf7..eaae7bff62 100644 --- a/packages/backend/src/server/api/endpoints/antennas/notes.ts +++ b/packages/backend/src/server/api/endpoints/antennas/notes.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import * as Redis from 'ioredis'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { NotesRepository, AntennasRepository } from '@/models/index.js'; +import type { NotesRepository, AntennasRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteReadService } from '@/core/NoteReadService.js'; import { DI } from '@/di-symbols.js'; @@ -53,9 +53,8 @@ export const paramDef = { required: ['antennaId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.redis) private redisClient: Redis.Redis, diff --git a/packages/backend/src/server/api/endpoints/antennas/show.ts b/packages/backend/src/server/api/endpoints/antennas/show.ts index 48012a11ec..77c9b31763 100644 --- a/packages/backend/src/server/api/endpoints/antennas/show.ts +++ b/packages/backend/src/server/api/endpoints/antennas/show.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AntennasRepository } from '@/models/index.js'; +import type { AntennasRepository } from '@/models/_.js'; import { AntennaEntityService } from '@/core/entities/AntennaEntityService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -40,9 +40,8 @@ export const paramDef = { required: ['antennaId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.antennasRepository) private antennasRepository: AntennasRepository, diff --git a/packages/backend/src/server/api/endpoints/antennas/update.ts b/packages/backend/src/server/api/endpoints/antennas/update.ts index b348501843..53e6d0abaa 100644 --- a/packages/backend/src/server/api/endpoints/antennas/update.ts +++ b/packages/backend/src/server/api/endpoints/antennas/update.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AntennasRepository, UserListsRepository } from '@/models/index.js'; +import type { AntennasRepository, UserListsRepository } from '@/models/_.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { AntennaEntityService } from '@/core/entities/AntennaEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -47,7 +47,7 @@ export const paramDef = { properties: { antennaId: { type: 'string', format: 'misskey:id' }, name: { type: 'string', minLength: 1, maxLength: 100 }, - src: { type: 'string', enum: ['home', 'all', 'users', 'list'] }, + src: { type: 'string', enum: ['home', 'all', 'users', 'list', 'users_blacklist'] }, userListId: { type: 'string', format: 'misskey:id', nullable: true }, keywords: { type: 'array', items: { type: 'array', items: { @@ -70,9 +70,8 @@ export const paramDef = { required: ['antennaId', 'name', 'src', 'keywords', 'excludeKeywords', 'users', 'caseSensitive', 'withReplies', 'withFile', 'notify'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.antennasRepository) private antennasRepository: AntennasRepository, @@ -84,6 +83,9 @@ export default class extends Endpoint { private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { + if (ps.keywords.flat().every(x => x === '') && ps.excludeKeywords.flat().every(x => x === '')) { + throw new Error('either keywords or excludeKeywords is required.'); + } // Fetch the antenna const antenna = await this.antennasRepository.findOneBy({ id: ps.antennaId, diff --git a/packages/backend/src/server/api/endpoints/ap/get.ts b/packages/backend/src/server/api/endpoints/ap/get.ts index b19a4d7eb3..a4a7fd2037 100644 --- a/packages/backend/src/server/api/endpoints/ap/get.ts +++ b/packages/backend/src/server/api/endpoints/ap/get.ts @@ -35,9 +35,8 @@ export const paramDef = { required: ['uri'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private apResolverService: ApResolverService, ) { diff --git a/packages/backend/src/server/api/endpoints/ap/show.ts b/packages/backend/src/server/api/endpoints/ap/show.ts index 454dfd80c4..f442fbdd2f 100644 --- a/packages/backend/src/server/api/endpoints/ap/show.ts +++ b/packages/backend/src/server/api/endpoints/ap/show.ts @@ -3,12 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import ms from 'ms'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository, NotesRepository } from '@/models/index.js'; -import type { MiNote } from '@/models/entities/Note.js'; -import type { MiLocalUser, MiUser } from '@/models/entities/User.js'; +import type { MiNote } from '@/models/Note.js'; +import type { MiLocalUser, MiUser } from '@/models/User.js'; import { isActor, isPost, getApId } from '@/core/activitypub/type.js'; import type { SchemaType } from '@/misc/json-schema.js'; import { ApResolverService } from '@/core/activitypub/ApResolverService.js'; @@ -19,7 +18,6 @@ import { ApNoteService } from '@/core/activitypub/models/ApNoteService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { UtilityService } from '@/core/UtilityService.js'; -import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; import { ApiError } from '../../error.js'; @@ -86,16 +84,9 @@ export const paramDef = { required: ['uri'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - - @Inject(DI.notesRepository) - private notesRepository: NotesRepository, - private utilityService: UtilityService, private userEntityService: UserEntityService, private noteEntityService: NoteEntityService, diff --git a/packages/backend/src/server/api/endpoints/app/create.ts b/packages/backend/src/server/api/endpoints/app/create.ts index f3e2c3884b..1b38b042d9 100644 --- a/packages/backend/src/server/api/endpoints/app/create.ts +++ b/packages/backend/src/server/api/endpoints/app/create.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AppsRepository } from '@/models/index.js'; +import type { AppsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { unique } from '@/misc/prelude/array.js'; import { secureRndstr } from '@/misc/secure-rndstr.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: ['name', 'description', 'permission'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.appsRepository) private appsRepository: AppsRepository, diff --git a/packages/backend/src/server/api/endpoints/app/show.ts b/packages/backend/src/server/api/endpoints/app/show.ts index 8878dc6412..cb968a1c65 100644 --- a/packages/backend/src/server/api/endpoints/app/show.ts +++ b/packages/backend/src/server/api/endpoints/app/show.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AppsRepository } from '@/models/index.js'; +import type { AppsRepository } from '@/models/_.js'; import { AppEntityService } from '@/core/entities/AppEntityService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -36,9 +36,8 @@ export const paramDef = { required: ['appId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.appsRepository) private appsRepository: AppsRepository, diff --git a/packages/backend/src/server/api/endpoints/auth/accept.ts b/packages/backend/src/server/api/endpoints/auth/accept.ts index 1070384ba3..1b1893fd94 100644 --- a/packages/backend/src/server/api/endpoints/auth/accept.ts +++ b/packages/backend/src/server/api/endpoints/auth/accept.ts @@ -6,7 +6,7 @@ import * as crypto from 'node:crypto'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AuthSessionsRepository, AppsRepository, AccessTokensRepository } from '@/models/index.js'; +import type { AuthSessionsRepository, AppsRepository, AccessTokensRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { secureRndstr } from '@/misc/secure-rndstr.js'; import { DI } from '@/di-symbols.js'; @@ -36,9 +36,8 @@ export const paramDef = { required: ['token'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.appsRepository) private appsRepository: AppsRepository, diff --git a/packages/backend/src/server/api/endpoints/auth/session/generate.ts b/packages/backend/src/server/api/endpoints/auth/session/generate.ts index 60eebecf36..8b6a2c213d 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/generate.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/generate.ts @@ -6,7 +6,7 @@ import { randomUUID } from 'node:crypto'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AppsRepository, AuthSessionsRepository } from '@/models/index.js'; +import type { AppsRepository, AuthSessionsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import type { Config } from '@/config.js'; import { DI } from '@/di-symbols.js'; @@ -50,9 +50,8 @@ export const paramDef = { required: ['appSecret'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.config) private config: Config, diff --git a/packages/backend/src/server/api/endpoints/auth/session/show.ts b/packages/backend/src/server/api/endpoints/auth/session/show.ts index 173f567225..0f5da0f252 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/show.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/show.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AuthSessionsRepository } from '@/models/index.js'; +import type { AuthSessionsRepository } from '@/models/_.js'; import { AuthSessionEntityService } from '@/core/entities/AuthSessionEntityService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -53,9 +53,8 @@ export const paramDef = { required: ['token'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.authSessionsRepository) private authSessionsRepository: AuthSessionsRepository, diff --git a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts index f257ba7e38..c82fa0ff10 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository, AppsRepository, AccessTokensRepository, AuthSessionsRepository } from '@/models/index.js'; +import type { AppsRepository, AccessTokensRepository, AuthSessionsRepository } from '@/models/_.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -62,13 +62,9 @@ export const paramDef = { required: ['appSecret', 'token'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.appsRepository) private appsRepository: AppsRepository, diff --git a/packages/backend/src/server/api/endpoints/blocking/create.ts b/packages/backend/src/server/api/endpoints/blocking/create.ts index 51394dea18..4f05ea1b39 100644 --- a/packages/backend/src/server/api/endpoints/blocking/create.ts +++ b/packages/backend/src/server/api/endpoints/blocking/create.ts @@ -6,7 +6,7 @@ import ms from 'ms'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository, BlockingsRepository } from '@/models/index.js'; +import type { UsersRepository, BlockingsRepository } from '@/models/_.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { UserBlockingService } from '@/core/UserBlockingService.js'; import { DI } from '@/di-symbols.js'; @@ -61,9 +61,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/blocking/delete.ts b/packages/backend/src/server/api/endpoints/blocking/delete.ts index 594174af61..ea2b87639a 100644 --- a/packages/backend/src/server/api/endpoints/blocking/delete.ts +++ b/packages/backend/src/server/api/endpoints/blocking/delete.ts @@ -6,7 +6,7 @@ import ms from 'ms'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository, BlockingsRepository } from '@/models/index.js'; +import type { UsersRepository, BlockingsRepository } from '@/models/_.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { UserBlockingService } from '@/core/UserBlockingService.js'; import { DI } from '@/di-symbols.js'; @@ -61,9 +61,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/blocking/list.ts b/packages/backend/src/server/api/endpoints/blocking/list.ts index 3d3e786cdb..58d24540d1 100644 --- a/packages/backend/src/server/api/endpoints/blocking/list.ts +++ b/packages/backend/src/server/api/endpoints/blocking/list.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { BlockingsRepository } from '@/models/index.js'; +import type { BlockingsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { BlockingEntityService } from '@/core/entities/BlockingEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.blockingsRepository) private blockingsRepository: BlockingsRepository, diff --git a/packages/backend/src/server/api/endpoints/channels/create.ts b/packages/backend/src/server/api/endpoints/channels/create.ts index 3587faeec9..278361601f 100644 --- a/packages/backend/src/server/api/endpoints/channels/create.ts +++ b/packages/backend/src/server/api/endpoints/channels/create.ts @@ -6,8 +6,8 @@ import { Inject, Injectable } from '@nestjs/common'; import ms from 'ms'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ChannelsRepository, DriveFilesRepository } from '@/models/index.js'; -import type { MiChannel } from '@/models/entities/Channel.js'; +import type { ChannelsRepository, DriveFilesRepository } from '@/models/_.js'; +import type { MiChannel } from '@/models/Channel.js'; import { IdService } from '@/core/IdService.js'; import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -50,13 +50,13 @@ export const paramDef = { description: { type: 'string', nullable: true, minLength: 1, maxLength: 2048 }, bannerId: { type: 'string', format: 'misskey:id', nullable: true }, color: { type: 'string', minLength: 1, maxLength: 16 }, + isSensitive: { type: 'boolean', nullable: true }, }, required: ['name'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, @@ -87,6 +87,7 @@ export default class extends Endpoint { name: ps.name, description: ps.description ?? null, bannerId: banner ? banner.id : null, + isSensitive: ps.isSensitive ?? false, ...(ps.color !== undefined ? { color: ps.color } : {}), } as MiChannel).then(x => this.channelsRepository.findOneByOrFail(x.identifiers[0])); diff --git a/packages/backend/src/server/api/endpoints/channels/favorite.ts b/packages/backend/src/server/api/endpoints/channels/favorite.ts index 5b467e1f16..52f0cef38d 100644 --- a/packages/backend/src/server/api/endpoints/channels/favorite.ts +++ b/packages/backend/src/server/api/endpoints/channels/favorite.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ChannelFavoritesRepository, ChannelsRepository } from '@/models/index.js'; +import type { ChannelFavoritesRepository, ChannelsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: ['channelId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.channelsRepository) private channelsRepository: ChannelsRepository, diff --git a/packages/backend/src/server/api/endpoints/channels/featured.ts b/packages/backend/src/server/api/endpoints/channels/featured.ts index 3e26c1fdbb..412ea1bb16 100644 --- a/packages/backend/src/server/api/endpoints/channels/featured.ts +++ b/packages/backend/src/server/api/endpoints/channels/featured.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ChannelsRepository } from '@/models/index.js'; +import type { ChannelsRepository } from '@/models/_.js'; import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -31,9 +31,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.channelsRepository) private channelsRepository: ChannelsRepository, diff --git a/packages/backend/src/server/api/endpoints/channels/follow.ts b/packages/backend/src/server/api/endpoints/channels/follow.ts index 2a3dd9e9eb..942c51dadd 100644 --- a/packages/backend/src/server/api/endpoints/channels/follow.ts +++ b/packages/backend/src/server/api/endpoints/channels/follow.ts @@ -5,9 +5,8 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ChannelFollowingsRepository, ChannelsRepository } from '@/models/index.js'; +import type { ChannelFollowingsRepository, ChannelsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -38,9 +37,8 @@ export const paramDef = { required: ['channelId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.channelsRepository) private channelsRepository: ChannelsRepository, diff --git a/packages/backend/src/server/api/endpoints/channels/followed.ts b/packages/backend/src/server/api/endpoints/channels/followed.ts index 6e4a13c1db..6514f1ea3c 100644 --- a/packages/backend/src/server/api/endpoints/channels/followed.ts +++ b/packages/backend/src/server/api/endpoints/channels/followed.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ChannelFollowingsRepository } from '@/models/index.js'; +import type { ChannelFollowingsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.channelFollowingsRepository) private channelFollowingsRepository: ChannelFollowingsRepository, diff --git a/packages/backend/src/server/api/endpoints/channels/my-favorites.ts b/packages/backend/src/server/api/endpoints/channels/my-favorites.ts index e7bf9caf75..057a438ac9 100644 --- a/packages/backend/src/server/api/endpoints/channels/my-favorites.ts +++ b/packages/backend/src/server/api/endpoints/channels/my-favorites.ts @@ -5,8 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ChannelFavoritesRepository } from '@/models/index.js'; -import { QueryService } from '@/core/QueryService.js'; +import type { ChannelFavoritesRepository } from '@/models/_.js'; import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -35,15 +34,13 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.channelFavoritesRepository) private channelFavoritesRepository: ChannelFavoritesRepository, private channelEntityService: ChannelEntityService, - private queryService: QueryService, ) { super(meta, paramDef, async (ps, me) => { const query = this.channelFavoritesRepository.createQueryBuilder('favorite') diff --git a/packages/backend/src/server/api/endpoints/channels/owned.ts b/packages/backend/src/server/api/endpoints/channels/owned.ts index 1b85b41543..b1dd693537 100644 --- a/packages/backend/src/server/api/endpoints/channels/owned.ts +++ b/packages/backend/src/server/api/endpoints/channels/owned.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ChannelsRepository } from '@/models/index.js'; +import type { ChannelsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.channelsRepository) private channelsRepository: ChannelsRepository, diff --git a/packages/backend/src/server/api/endpoints/channels/search.ts b/packages/backend/src/server/api/endpoints/channels/search.ts index b66245c48e..65df45706b 100644 --- a/packages/backend/src/server/api/endpoints/channels/search.ts +++ b/packages/backend/src/server/api/endpoints/channels/search.ts @@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Brackets } from 'typeorm'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; -import type { ChannelsRepository } from '@/models/index.js'; +import type { ChannelsRepository } from '@/models/_.js'; import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js'; import { DI } from '@/di-symbols.js'; import { sqlLikeEscape } from '@/misc/sql-like-escape.js'; @@ -40,9 +40,8 @@ export const paramDef = { required: ['query'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.channelsRepository) private channelsRepository: ChannelsRepository, diff --git a/packages/backend/src/server/api/endpoints/channels/show.ts b/packages/backend/src/server/api/endpoints/channels/show.ts index 1a3d95f7fd..3eaa83c7e8 100644 --- a/packages/backend/src/server/api/endpoints/channels/show.ts +++ b/packages/backend/src/server/api/endpoints/channels/show.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ChannelsRepository } from '@/models/index.js'; +import type { ChannelsRepository } from '@/models/_.js'; import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: ['channelId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.channelsRepository) private channelsRepository: ChannelsRepository, diff --git a/packages/backend/src/server/api/endpoints/channels/timeline.ts b/packages/backend/src/server/api/endpoints/channels/timeline.ts index 39420b806c..026b649537 100644 --- a/packages/backend/src/server/api/endpoints/channels/timeline.ts +++ b/packages/backend/src/server/api/endpoints/channels/timeline.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import * as Redis from 'ioredis'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ChannelsRepository, MiNote, NotesRepository } from '@/models/index.js'; +import type { ChannelsRepository, MiNote, NotesRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import ActiveUsersChart from '@/core/chart/charts/active-users.js'; @@ -51,9 +51,8 @@ export const paramDef = { required: ['channelId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.redis) private redisClient: Redis.Redis, diff --git a/packages/backend/src/server/api/endpoints/channels/unfavorite.ts b/packages/backend/src/server/api/endpoints/channels/unfavorite.ts index 832e00c8ae..7f50968cd2 100644 --- a/packages/backend/src/server/api/endpoints/channels/unfavorite.ts +++ b/packages/backend/src/server/api/endpoints/channels/unfavorite.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ChannelFavoritesRepository, ChannelsRepository } from '@/models/index.js'; +import type { ChannelFavoritesRepository, ChannelsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -36,9 +36,8 @@ export const paramDef = { required: ['channelId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.channelsRepository) private channelsRepository: ChannelsRepository, diff --git a/packages/backend/src/server/api/endpoints/channels/unfollow.ts b/packages/backend/src/server/api/endpoints/channels/unfollow.ts index 0c74be5741..23e512d192 100644 --- a/packages/backend/src/server/api/endpoints/channels/unfollow.ts +++ b/packages/backend/src/server/api/endpoints/channels/unfollow.ts @@ -5,8 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ChannelFollowingsRepository, ChannelsRepository } from '@/models/index.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; +import type { ChannelFollowingsRepository, ChannelsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -37,9 +36,8 @@ export const paramDef = { required: ['channelId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.channelsRepository) private channelsRepository: ChannelsRepository, diff --git a/packages/backend/src/server/api/endpoints/channels/update.ts b/packages/backend/src/server/api/endpoints/channels/update.ts index 0a668007ba..f30b2c7fbc 100644 --- a/packages/backend/src/server/api/endpoints/channels/update.ts +++ b/packages/backend/src/server/api/endpoints/channels/update.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFilesRepository, ChannelsRepository } from '@/models/index.js'; +import type { DriveFilesRepository, ChannelsRepository } from '@/models/_.js'; import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js'; import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; @@ -61,13 +61,13 @@ export const paramDef = { }, }, color: { type: 'string', minLength: 1, maxLength: 16 }, + isSensitive: { type: 'boolean', nullable: true }, }, required: ['channelId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.channelsRepository) private channelsRepository: ChannelsRepository, @@ -115,6 +115,7 @@ export default class extends Endpoint { ...(ps.color !== undefined ? { color: ps.color } : {}), ...(typeof ps.isArchived === 'boolean' ? { isArchived: ps.isArchived } : {}), ...(banner ? { bannerId: banner.id } : {}), + ...(typeof ps.isSensitive === 'boolean' ? { isSensitive: ps.isSensitive } : {}), }); return await this.channelEntityService.pack(channel.id, me); diff --git a/packages/backend/src/server/api/endpoints/charts/active-users.ts b/packages/backend/src/server/api/endpoints/charts/active-users.ts index a7dd9c23f3..e768923ce1 100644 --- a/packages/backend/src/server/api/endpoints/charts/active-users.ts +++ b/packages/backend/src/server/api/endpoints/charts/active-users.ts @@ -28,9 +28,8 @@ export const paramDef = { required: ['span'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private activeUsersChart: ActiveUsersChart, ) { diff --git a/packages/backend/src/server/api/endpoints/charts/ap-request.ts b/packages/backend/src/server/api/endpoints/charts/ap-request.ts index afa84e5a3d..f518ae41ca 100644 --- a/packages/backend/src/server/api/endpoints/charts/ap-request.ts +++ b/packages/backend/src/server/api/endpoints/charts/ap-request.ts @@ -28,9 +28,8 @@ export const paramDef = { required: ['span'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private apRequestChart: ApRequestChart, ) { diff --git a/packages/backend/src/server/api/endpoints/charts/drive.ts b/packages/backend/src/server/api/endpoints/charts/drive.ts index 0f2f8193e5..94afab113e 100644 --- a/packages/backend/src/server/api/endpoints/charts/drive.ts +++ b/packages/backend/src/server/api/endpoints/charts/drive.ts @@ -28,9 +28,8 @@ export const paramDef = { required: ['span'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private driveChart: DriveChart, ) { diff --git a/packages/backend/src/server/api/endpoints/charts/federation.ts b/packages/backend/src/server/api/endpoints/charts/federation.ts index 5a56e34123..bc33930ca4 100644 --- a/packages/backend/src/server/api/endpoints/charts/federation.ts +++ b/packages/backend/src/server/api/endpoints/charts/federation.ts @@ -28,9 +28,8 @@ export const paramDef = { required: ['span'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private federationChart: FederationChart, ) { diff --git a/packages/backend/src/server/api/endpoints/charts/instance.ts b/packages/backend/src/server/api/endpoints/charts/instance.ts index 7c9b265c7e..a432845b38 100644 --- a/packages/backend/src/server/api/endpoints/charts/instance.ts +++ b/packages/backend/src/server/api/endpoints/charts/instance.ts @@ -29,9 +29,8 @@ export const paramDef = { required: ['span', 'host'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private instanceChart: InstanceChart, ) { diff --git a/packages/backend/src/server/api/endpoints/charts/notes.ts b/packages/backend/src/server/api/endpoints/charts/notes.ts index 5b07418ccf..e1e9d06311 100644 --- a/packages/backend/src/server/api/endpoints/charts/notes.ts +++ b/packages/backend/src/server/api/endpoints/charts/notes.ts @@ -28,9 +28,8 @@ export const paramDef = { required: ['span'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private notesChart: NotesChart, ) { diff --git a/packages/backend/src/server/api/endpoints/charts/user/drive.ts b/packages/backend/src/server/api/endpoints/charts/user/drive.ts index 6a410bec3c..b4a58c9872 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/drive.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/drive.ts @@ -29,9 +29,8 @@ export const paramDef = { required: ['span', 'userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private perUserDriveChart: PerUserDriveChart, ) { diff --git a/packages/backend/src/server/api/endpoints/charts/user/following.ts b/packages/backend/src/server/api/endpoints/charts/user/following.ts index ecb9fb922e..c609c5a7fe 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/following.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/following.ts @@ -29,9 +29,8 @@ export const paramDef = { required: ['span', 'userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private perUserFollowingChart: PerUserFollowingChart, ) { diff --git a/packages/backend/src/server/api/endpoints/charts/user/notes.ts b/packages/backend/src/server/api/endpoints/charts/user/notes.ts index 42610b29e0..ad6a342fb7 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/notes.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/notes.ts @@ -29,9 +29,8 @@ export const paramDef = { required: ['span', 'userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private perUserNotesChart: PerUserNotesChart, ) { diff --git a/packages/backend/src/server/api/endpoints/charts/user/pv.ts b/packages/backend/src/server/api/endpoints/charts/user/pv.ts index 2ab77a6b4e..635a403d12 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/pv.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/pv.ts @@ -29,9 +29,8 @@ export const paramDef = { required: ['span', 'userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private perUserPvChart: PerUserPvChart, ) { diff --git a/packages/backend/src/server/api/endpoints/charts/user/reactions.ts b/packages/backend/src/server/api/endpoints/charts/user/reactions.ts index 39f1d6e28c..92bc7028ad 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/reactions.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/reactions.ts @@ -29,9 +29,8 @@ export const paramDef = { required: ['span', 'userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private perUserReactionsChart: PerUserReactionsChart, ) { diff --git a/packages/backend/src/server/api/endpoints/charts/users.ts b/packages/backend/src/server/api/endpoints/charts/users.ts index 24ba51ee8b..3be3721e3a 100644 --- a/packages/backend/src/server/api/endpoints/charts/users.ts +++ b/packages/backend/src/server/api/endpoints/charts/users.ts @@ -28,9 +28,8 @@ export const paramDef = { required: ['span'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private usersChart: UsersChart, ) { diff --git a/packages/backend/src/server/api/endpoints/clips/add-note.ts b/packages/backend/src/server/api/endpoints/clips/add-note.ts index 15a139264b..9e7fd8c45f 100644 --- a/packages/backend/src/server/api/endpoints/clips/add-note.ts +++ b/packages/backend/src/server/api/endpoints/clips/add-note.ts @@ -6,11 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import ms from 'ms'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import { IdService } from '@/core/IdService.js'; -import { DI } from '@/di-symbols.js'; -import type { ClipNotesRepository, ClipsRepository } from '@/models/index.js'; -import { GetterService } from '@/server/api/GetterService.js'; -import { RoleService } from '@/core/RoleService.js'; +import { ClipService } from '@/core/ClipService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -64,62 +60,27 @@ export const paramDef = { required: ['clipId', 'noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.clipsRepository) - private clipsRepository: ClipsRepository, - - @Inject(DI.clipNotesRepository) - private clipNotesRepository: ClipNotesRepository, - - private idService: IdService, - private roleService: RoleService, - private getterService: GetterService, + private clipService: ClipService, ) { super(meta, paramDef, async (ps, me) => { - const clip = await this.clipsRepository.findOneBy({ - id: ps.clipId, - userId: me.id, - }); - - if (clip == null) { - throw new ApiError(meta.errors.noSuchClip); + try { + await this.clipService.addNote(me, ps.clipId, ps.noteId); + } catch (e) { + if (e instanceof ClipService.NoSuchClipError) { + throw new ApiError(meta.errors.noSuchClip); + } else if (e instanceof ClipService.NoSuchNoteError) { + throw new ApiError(meta.errors.noSuchNote); + } else if (e instanceof ClipService.AlreadyAddedError) { + throw new ApiError(meta.errors.alreadyClipped); + } else if (e instanceof ClipService.TooManyClipNotesError) { + throw new ApiError(meta.errors.tooManyClipNotes); + } else { + throw e; + } } - - const note = await this.getterService.getNote(ps.noteId).catch(e => { - if (e.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote); - throw e; - }); - - const exist = await this.clipNotesRepository.exist({ - where: { - noteId: note.id, - clipId: clip.id, - }, - }); - - if (exist) { - throw new ApiError(meta.errors.alreadyClipped); - } - - const currentCount = await this.clipNotesRepository.countBy({ - clipId: clip.id, - }); - if (currentCount > (await this.roleService.getUserPolicies(me.id)).noteEachClipsLimit) { - throw new ApiError(meta.errors.tooManyClipNotes); - } - - await this.clipNotesRepository.insert({ - id: this.idService.genId(), - noteId: note.id, - clipId: clip.id, - }); - - await this.clipsRepository.update(clip.id, { - lastClippedAt: new Date(), - }); }); } } diff --git a/packages/backend/src/server/api/endpoints/clips/create.ts b/packages/backend/src/server/api/endpoints/clips/create.ts index 1742b7c921..c616faba0f 100644 --- a/packages/backend/src/server/api/endpoints/clips/create.ts +++ b/packages/backend/src/server/api/endpoints/clips/create.ts @@ -5,12 +5,10 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import { IdService } from '@/core/IdService.js'; -import type { ClipsRepository } from '@/models/index.js'; +import type { MiClip } from '@/models/_.js'; import { ClipEntityService } from '@/core/entities/ClipEntityService.js'; -import { DI } from '@/di-symbols.js'; -import { RoleService } from '@/core/RoleService.js'; import { ApiError } from '@/server/api/error.js'; +import { ClipService } from '@/core/ClipService.js'; export const meta = { tags: ['clips'], @@ -47,34 +45,22 @@ export const paramDef = { required: ['name'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.clipsRepository) - private clipsRepository: ClipsRepository, - private clipEntityService: ClipEntityService, - private roleService: RoleService, - private idService: IdService, + private clipService: ClipService, ) { super(meta, paramDef, async (ps, me) => { - const currentCount = await this.clipsRepository.countBy({ - userId: me.id, - }); - if (currentCount > (await this.roleService.getUserPolicies(me.id)).clipLimit) { - throw new ApiError(meta.errors.tooManyClips); + let clip: MiClip; + try { + clip = await this.clipService.create(me, ps.name, ps.isPublic, ps.description ?? null); + } catch (e) { + if (e instanceof ClipService.TooManyClipsError) { + throw new ApiError(meta.errors.tooManyClips); + } + throw e; } - - const clip = await this.clipsRepository.insert({ - id: this.idService.genId(), - createdAt: new Date(), - userId: me.id, - name: ps.name, - isPublic: ps.isPublic, - description: ps.description, - }).then(x => this.clipsRepository.findOneByOrFail(x.identifiers[0])); - return await this.clipEntityService.pack(clip, me); }); } diff --git a/packages/backend/src/server/api/endpoints/clips/delete.ts b/packages/backend/src/server/api/endpoints/clips/delete.ts index 16e8bff009..4a302b78a5 100644 --- a/packages/backend/src/server/api/endpoints/clips/delete.ts +++ b/packages/backend/src/server/api/endpoints/clips/delete.ts @@ -5,8 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ClipsRepository } from '@/models/index.js'; -import { DI } from '@/di-symbols.js'; +import { ClipService } from '@/core/ClipService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -34,24 +33,20 @@ export const paramDef = { required: ['clipId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.clipsRepository) - private clipsRepository: ClipsRepository, + private clipService: ClipService, ) { super(meta, paramDef, async (ps, me) => { - const clip = await this.clipsRepository.findOneBy({ - id: ps.clipId, - userId: me.id, - }); - - if (clip == null) { - throw new ApiError(meta.errors.noSuchClip); + try { + await this.clipService.delete(me, ps.clipId); + } catch (e) { + if (e instanceof ClipService.NoSuchClipError) { + throw new ApiError(meta.errors.noSuchClip); + } + throw e; } - - await this.clipsRepository.delete(clip.id); }); } } diff --git a/packages/backend/src/server/api/endpoints/clips/favorite.ts b/packages/backend/src/server/api/endpoints/clips/favorite.ts index 012543e675..6cd34f0a54 100644 --- a/packages/backend/src/server/api/endpoints/clips/favorite.ts +++ b/packages/backend/src/server/api/endpoints/clips/favorite.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { ClipsRepository, ClipFavoritesRepository } from '@/models/index.js'; +import type { ClipsRepository, ClipFavoritesRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -42,9 +42,8 @@ export const paramDef = { required: ['clipId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.clipsRepository) private clipsRepository: ClipsRepository, diff --git a/packages/backend/src/server/api/endpoints/clips/list.ts b/packages/backend/src/server/api/endpoints/clips/list.ts index 65289d33e6..c124762e33 100644 --- a/packages/backend/src/server/api/endpoints/clips/list.ts +++ b/packages/backend/src/server/api/endpoints/clips/list.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ClipsRepository } from '@/models/index.js'; +import type { ClipsRepository } from '@/models/_.js'; import { ClipEntityService } from '@/core/entities/ClipEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -33,9 +33,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.clipsRepository) private clipsRepository: ClipsRepository, diff --git a/packages/backend/src/server/api/endpoints/clips/my-favorites.ts b/packages/backend/src/server/api/endpoints/clips/my-favorites.ts index b5efa56b6a..c58c16e25f 100644 --- a/packages/backend/src/server/api/endpoints/clips/my-favorites.ts +++ b/packages/backend/src/server/api/endpoints/clips/my-favorites.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ClipFavoritesRepository } from '@/models/index.js'; +import type { ClipFavoritesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ClipEntityService } from '@/core/entities/ClipEntityService.js'; @@ -34,9 +34,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.clipFavoritesRepository) private clipFavoritesRepository: ClipFavoritesRepository, diff --git a/packages/backend/src/server/api/endpoints/clips/notes.ts b/packages/backend/src/server/api/endpoints/clips/notes.ts index 0a35691ec0..1427d8d0a7 100644 --- a/packages/backend/src/server/api/endpoints/clips/notes.ts +++ b/packages/backend/src/server/api/endpoints/clips/notes.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { NotesRepository, ClipsRepository, ClipNotesRepository } from '@/models/index.js'; +import type { NotesRepository, ClipsRepository, ClipNotesRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -48,9 +48,8 @@ export const paramDef = { required: ['clipId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.clipsRepository) private clipsRepository: ClipsRepository, diff --git a/packages/backend/src/server/api/endpoints/clips/remove-note.ts b/packages/backend/src/server/api/endpoints/clips/remove-note.ts index b24c9a4357..5507b0c037 100644 --- a/packages/backend/src/server/api/endpoints/clips/remove-note.ts +++ b/packages/backend/src/server/api/endpoints/clips/remove-note.ts @@ -5,9 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ClipNotesRepository, ClipsRepository } from '@/models/index.js'; -import { DI } from '@/di-symbols.js'; -import { GetterService } from '@/server/api/GetterService.js'; +import { ClipService } from '@/core/ClipService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -44,37 +42,22 @@ export const paramDef = { required: ['clipId', 'noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.clipsRepository) - private clipsRepository: ClipsRepository, - - @Inject(DI.clipNotesRepository) - private clipNotesRepository: ClipNotesRepository, - - private getterService: GetterService, + private clipService: ClipService, ) { super(meta, paramDef, async (ps, me) => { - const clip = await this.clipsRepository.findOneBy({ - id: ps.clipId, - userId: me.id, - }); - - if (clip == null) { - throw new ApiError(meta.errors.noSuchClip); + try { + await this.clipService.removeNote(me, ps.clipId, ps.noteId); + } catch (e) { + if (e instanceof ClipService.NoSuchClipError) { + throw new ApiError(meta.errors.noSuchClip); + } else if (e instanceof ClipService.NoSuchNoteError) { + throw new ApiError(meta.errors.noSuchNote); + } + throw e; } - - const note = await this.getterService.getNote(ps.noteId).catch(err => { - if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote); - throw err; - }); - - await this.clipNotesRepository.delete({ - noteId: note.id, - clipId: clip.id, - }); }); } } diff --git a/packages/backend/src/server/api/endpoints/clips/show.ts b/packages/backend/src/server/api/endpoints/clips/show.ts index 0e2485dec6..03b1e09dfb 100644 --- a/packages/backend/src/server/api/endpoints/clips/show.ts +++ b/packages/backend/src/server/api/endpoints/clips/show.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ClipsRepository } from '@/models/index.js'; +import type { ClipsRepository } from '@/models/_.js'; import { ClipEntityService } from '@/core/entities/ClipEntityService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -40,9 +40,8 @@ export const paramDef = { required: ['clipId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.clipsRepository) private clipsRepository: ClipsRepository, diff --git a/packages/backend/src/server/api/endpoints/clips/unfavorite.ts b/packages/backend/src/server/api/endpoints/clips/unfavorite.ts index 96ec315e98..0d6b96abbf 100644 --- a/packages/backend/src/server/api/endpoints/clips/unfavorite.ts +++ b/packages/backend/src/server/api/endpoints/clips/unfavorite.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { ClipsRepository, ClipFavoritesRepository } from '@/models/index.js'; +import type { ClipsRepository, ClipFavoritesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -42,9 +42,8 @@ export const paramDef = { required: ['clipId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.clipsRepository) private clipsRepository: ClipsRepository, diff --git a/packages/backend/src/server/api/endpoints/clips/update.ts b/packages/backend/src/server/api/endpoints/clips/update.ts index 2d161ddbc1..5e7043930e 100644 --- a/packages/backend/src/server/api/endpoints/clips/update.ts +++ b/packages/backend/src/server/api/endpoints/clips/update.ts @@ -5,9 +5,8 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ClipsRepository } from '@/models/index.js'; import { ClipEntityService } from '@/core/entities/ClipEntityService.js'; -import { DI } from '@/di-symbols.js'; +import { ClipService } from '@/core/ClipService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -46,33 +45,24 @@ export const paramDef = { required: ['clipId', 'name'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.clipsRepository) - private clipsRepository: ClipsRepository, + private clipService: ClipService, private clipEntityService: ClipEntityService, ) { super(meta, paramDef, async (ps, me) => { - // Fetch the clip - const clip = await this.clipsRepository.findOneBy({ - id: ps.clipId, - userId: me.id, - }); - - if (clip == null) { - throw new ApiError(meta.errors.noSuchClip); + try { + await this.clipService.update(me, ps.clipId, ps.name, ps.isPublic, ps.description); + } catch (e) { + if (e instanceof ClipService.NoSuchClipError) { + throw new ApiError(meta.errors.noSuchClip); + } + throw e; } - await this.clipsRepository.update(clip.id, { - name: ps.name, - description: ps.description, - isPublic: ps.isPublic, - }); - - return await this.clipEntityService.pack(clip.id, me); + return await this.clipEntityService.pack(ps.clipId, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/drive.ts b/packages/backend/src/server/api/endpoints/drive.ts index 8b4a9e5935..71d3ca5f14 100644 --- a/packages/backend/src/server/api/endpoints/drive.ts +++ b/packages/backend/src/server/api/endpoints/drive.ts @@ -38,9 +38,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private metaService: MetaService, private driveFileEntityService: DriveFileEntityService, diff --git a/packages/backend/src/server/api/endpoints/drive/files.ts b/packages/backend/src/server/api/endpoints/drive/files.ts index ac6c597ac9..fb00bc62ca 100644 --- a/packages/backend/src/server/api/endpoints/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/drive/files.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -41,9 +41,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts index 23929bcfa7..779231a856 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { NotesRepository, DriveFilesRepository } from '@/models/index.js'; +import type { NotesRepository, DriveFilesRepository } from '@/models/_.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -46,9 +46,8 @@ export const paramDef = { required: ['fileId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts b/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts index f780cf90da..85e6312b6a 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -31,9 +31,8 @@ export const paramDef = { required: ['md5'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/drive/files/create.ts b/packages/backend/src/server/api/endpoints/drive/files/create.ts index 0b6dd19834..bae62d264a 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/create.ts @@ -4,15 +4,13 @@ */ import ms from 'ms'; -import { Inject, Injectable } from '@nestjs/common'; -import type { DriveFilesRepository } from '@/models/index.js'; +import { Injectable } from '@nestjs/common'; import { DB_MAX_IMAGE_COMMENT_LENGTH } from '@/const.js'; import { IdentifiableError } from '@/misc/identifiable-error.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; import { MetaService } from '@/core/MetaService.js'; import { DriveService } from '@/core/DriveService.js'; -import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; export const meta = { @@ -73,13 +71,9 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.driveFilesRepository) - private driveFilesRepository: DriveFilesRepository, - private driveFileEntityService: DriveFileEntityService, private metaService: MetaService, private driveService: DriveService, diff --git a/packages/backend/src/server/api/endpoints/drive/files/delete.ts b/packages/backend/src/server/api/endpoints/drive/files/delete.ts index 867d6d2070..2178d95124 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/delete.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/delete.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DriveService } from '@/core/DriveService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; @@ -45,9 +45,8 @@ export const paramDef = { required: ['fileId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, @@ -67,11 +66,7 @@ export default class extends Endpoint { throw new ApiError(meta.errors.accessDenied); } - // Delete - await this.driveService.deleteFile(file); - - // Publish fileDeleted event - this.globalEventService.publishDriveStream(me.id, 'fileDeleted', file.id); + await this.driveService.deleteFile(file, false, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts b/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts index 15df30a271..6f5dc03c82 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: ['md5'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/drive/files/find.ts b/packages/backend/src/server/api/endpoints/drive/files/find.ts index f14eb23847..72b69c26a5 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/find.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull } from 'typeorm'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -39,9 +39,8 @@ export const paramDef = { required: ['name'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/drive/files/show.ts b/packages/backend/src/server/api/endpoints/drive/files/show.ts index 3ba43153f6..0299cda6cf 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/show.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/show.ts @@ -4,8 +4,8 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -54,9 +54,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/drive/files/update.ts b/packages/backend/src/server/api/endpoints/drive/files/update.ts index 34733198c9..fb56c48cd5 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/update.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/update.ts @@ -4,12 +4,11 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { DriveFilesRepository, DriveFoldersRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; +import { DriveService } from '@/core/DriveService.js'; import { ApiError } from '../../../error.js'; export const meta = { @@ -72,23 +71,17 @@ export const paramDef = { required: ['fileId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, - @Inject(DI.driveFoldersRepository) - private driveFoldersRepository: DriveFoldersRepository, - - private driveFileEntityService: DriveFileEntityService, + private driveService: DriveService, private roleService: RoleService, - private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { const file = await this.driveFilesRepository.findOneBy({ id: ps.fileId }); - const alwaysMarkNsfw = (await this.roleService.getUserPolicies(me.id)).alwaysMarkNsfw; if (file == null) { throw new ApiError(meta.errors.noSuchFile); } @@ -97,49 +90,28 @@ export default class extends Endpoint { throw new ApiError(meta.errors.accessDenied); } - if (ps.name) file.name = ps.name; - if (!this.driveFileEntityService.validateFileName(file.name)) { - throw new ApiError(meta.errors.invalidFileName); - } + let packedFile; - if (ps.comment !== undefined) file.comment = ps.comment; - - if (ps.isSensitive !== undefined && ps.isSensitive !== file.isSensitive && alwaysMarkNsfw && !ps.isSensitive) { - throw new ApiError(meta.errors.restrictedByRole); - } - - if (ps.isSensitive !== undefined) file.isSensitive = ps.isSensitive; - - if (ps.folderId !== undefined) { - if (ps.folderId === null) { - file.folderId = null; + try { + packedFile = await this.driveService.updateFile(file, { + folderId: ps.folderId, + name: ps.name, + isSensitive: ps.isSensitive, + comment: ps.comment, + }, me); + } catch (e) { + if (e instanceof DriveService.InvalidFileNameError) { + throw new ApiError(meta.errors.invalidFileName); + } else if (e instanceof DriveService.NoSuchFolderError) { + throw new ApiError(meta.errors.noSuchFolder); + } else if (e instanceof DriveService.CannotUnmarkSensitiveError) { + throw new ApiError(meta.errors.restrictedByRole); } else { - const folder = await this.driveFoldersRepository.findOneBy({ - id: ps.folderId, - userId: me.id, - }); - - if (folder == null) { - throw new ApiError(meta.errors.noSuchFolder); - } - - file.folderId = folder.id; + throw e; } } - await this.driveFilesRepository.update(file.id, { - name: file.name, - comment: file.comment, - folderId: file.folderId, - isSensitive: file.isSensitive, - }); - - const fileObj = await this.driveFileEntityService.pack(file, me, { self: true }); - - // Publish fileUpdated event - this.globalEventService.publishDriveStream(me.id, 'fileUpdated', fileObj); - - return fileObj; + return packedFile; }); } } diff --git a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts index a710e714ac..b438b1ef4e 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts @@ -4,13 +4,11 @@ */ import ms from 'ms'; -import { Inject, Injectable } from '@nestjs/common'; -import type { DriveFilesRepository } from '@/models/index.js'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; import { DriveService } from '@/core/DriveService.js'; -import { DI } from '@/di-symbols.js'; export const meta = { tags: ['drive'], @@ -43,13 +41,9 @@ export const paramDef = { required: ['url'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.driveFilesRepository) - private driveFilesRepository: DriveFilesRepository, - private driveFileEntityService: DriveFileEntityService, private driveService: DriveService, private globalEventService: GlobalEventService, diff --git a/packages/backend/src/server/api/endpoints/drive/folders.ts b/packages/backend/src/server/api/endpoints/drive/folders.ts index a1408fd213..3a09266591 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFoldersRepository } from '@/models/index.js'; +import type { DriveFoldersRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { DriveFolderEntityService } from '@/core/entities/DriveFolderEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -39,9 +39,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFoldersRepository) private driveFoldersRepository: DriveFoldersRepository, diff --git a/packages/backend/src/server/api/endpoints/drive/folders/create.ts b/packages/backend/src/server/api/endpoints/drive/folders/create.ts index eb6ed2a98c..c1082c3e2e 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/create.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import ms from 'ms'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFoldersRepository } from '@/models/index.js'; +import type { DriveFoldersRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { DriveFolderEntityService } from '@/core/entities/DriveFolderEntityService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; @@ -50,9 +50,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFoldersRepository) private driveFoldersRepository: DriveFoldersRepository, diff --git a/packages/backend/src/server/api/endpoints/drive/folders/delete.ts b/packages/backend/src/server/api/endpoints/drive/folders/delete.ts index a41d385079..cd7a008349 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/delete.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/delete.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFoldersRepository, DriveFilesRepository } from '@/models/index.js'; +import type { DriveFoldersRepository, DriveFilesRepository } from '@/models/_.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -41,9 +41,8 @@ export const paramDef = { required: ['folderId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/drive/folders/find.ts b/packages/backend/src/server/api/endpoints/drive/folders/find.ts index b8af55c103..2f5cdcc648 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/find.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull } from 'typeorm'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFoldersRepository } from '@/models/index.js'; +import type { DriveFoldersRepository } from '@/models/_.js'; import { DriveFolderEntityService } from '@/core/entities/DriveFolderEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: ['name'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFoldersRepository) private driveFoldersRepository: DriveFoldersRepository, diff --git a/packages/backend/src/server/api/endpoints/drive/folders/show.ts b/packages/backend/src/server/api/endpoints/drive/folders/show.ts index 041ed371a8..dd44fc46c9 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/show.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/show.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFoldersRepository } from '@/models/index.js'; +import type { DriveFoldersRepository } from '@/models/_.js'; import { DriveFolderEntityService } from '@/core/entities/DriveFolderEntityService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -40,9 +40,8 @@ export const paramDef = { required: ['folderId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFoldersRepository) private driveFoldersRepository: DriveFoldersRepository, diff --git a/packages/backend/src/server/api/endpoints/drive/folders/update.ts b/packages/backend/src/server/api/endpoints/drive/folders/update.ts index 09e5f3a48f..bc8824ef6d 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/update.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/update.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFoldersRepository } from '@/models/index.js'; +import type { DriveFoldersRepository } from '@/models/_.js'; import { DriveFolderEntityService } from '@/core/entities/DriveFolderEntityService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; @@ -56,9 +56,8 @@ export const paramDef = { required: ['folderId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFoldersRepository) private driveFoldersRepository: DriveFoldersRepository, diff --git a/packages/backend/src/server/api/endpoints/drive/stream.ts b/packages/backend/src/server/api/endpoints/drive/stream.ts index 12d9d7fe1c..ffbee679a1 100644 --- a/packages/backend/src/server/api/endpoints/drive/stream.ts +++ b/packages/backend/src/server/api/endpoints/drive/stream.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -39,9 +39,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/email-address/available.ts b/packages/backend/src/server/api/endpoints/email-address/available.ts index 55495fa3c9..787009f13c 100644 --- a/packages/backend/src/server/api/endpoints/email-address/available.ts +++ b/packages/backend/src/server/api/endpoints/email-address/available.ts @@ -36,9 +36,8 @@ export const paramDef = { required: ['emailAddress'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private emailService: EmailService, ) { diff --git a/packages/backend/src/server/api/endpoints/emoji.ts b/packages/backend/src/server/api/endpoints/emoji.ts index 07011faabc..ead8c9979e 100644 --- a/packages/backend/src/server/api/endpoints/emoji.ts +++ b/packages/backend/src/server/api/endpoints/emoji.ts @@ -5,10 +5,9 @@ import { IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { EmojisRepository } from '@/models/index.js'; +import type { EmojisRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { EmojiEntityService } from '@/core/entities/EmojiEntityService.js'; -import type { Config } from '@/config.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -35,13 +34,9 @@ export const paramDef = { required: ['name'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.emojisRepository) private emojisRepository: EmojisRepository, diff --git a/packages/backend/src/server/api/endpoints/emojis.ts b/packages/backend/src/server/api/endpoints/emojis.ts index b4c2d10ef8..2adf0a21b3 100644 --- a/packages/backend/src/server/api/endpoints/emojis.ts +++ b/packages/backend/src/server/api/endpoints/emojis.ts @@ -5,10 +5,9 @@ import { IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { EmojisRepository } from '@/models/index.js'; +import type { EmojisRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { EmojiEntityService } from '@/core/entities/EmojiEntityService.js'; -import type { Config } from '@/config.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -42,13 +41,9 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.emojisRepository) private emojisRepository: EmojisRepository, diff --git a/packages/backend/src/server/api/endpoints/endpoint.ts b/packages/backend/src/server/api/endpoints/endpoint.ts index b0272671e0..cecaded20a 100644 --- a/packages/backend/src/server/api/endpoints/endpoint.ts +++ b/packages/backend/src/server/api/endpoints/endpoint.ts @@ -21,9 +21,8 @@ export const paramDef = { required: ['endpoint'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( ) { super(meta, paramDef, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/endpoints.ts b/packages/backend/src/server/api/endpoints/endpoints.ts index 826fadf684..86def04aca 100644 --- a/packages/backend/src/server/api/endpoints/endpoints.ts +++ b/packages/backend/src/server/api/endpoints/endpoints.ts @@ -34,9 +34,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( ) { super(meta, paramDef, async () => { diff --git a/packages/backend/src/server/api/endpoints/export-custom-emojis.ts b/packages/backend/src/server/api/endpoints/export-custom-emojis.ts index 77b402c59e..7380c593e3 100644 --- a/packages/backend/src/server/api/endpoints/export-custom-emojis.ts +++ b/packages/backend/src/server/api/endpoints/export-custom-emojis.ts @@ -23,9 +23,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private queueService: QueueService, ) { diff --git a/packages/backend/src/server/api/endpoints/federation/followers.ts b/packages/backend/src/server/api/endpoints/federation/followers.ts index 9b18f9deb4..a92cf6a9d8 100644 --- a/packages/backend/src/server/api/endpoints/federation/followers.ts +++ b/packages/backend/src/server/api/endpoints/federation/followers.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { FollowingsRepository } from '@/models/index.js'; +import type { FollowingsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { FollowingEntityService } from '@/core/entities/FollowingEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: ['host'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.followingsRepository) private followingsRepository: FollowingsRepository, diff --git a/packages/backend/src/server/api/endpoints/federation/following.ts b/packages/backend/src/server/api/endpoints/federation/following.ts index 6e526996be..d72ceeeea2 100644 --- a/packages/backend/src/server/api/endpoints/federation/following.ts +++ b/packages/backend/src/server/api/endpoints/federation/following.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { FollowingsRepository } from '@/models/index.js'; +import type { FollowingsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { FollowingEntityService } from '@/core/entities/FollowingEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: ['host'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.followingsRepository) private followingsRepository: FollowingsRepository, diff --git a/packages/backend/src/server/api/endpoints/federation/instances.ts b/packages/backend/src/server/api/endpoints/federation/instances.ts index 96063403b2..be73e5dbb8 100644 --- a/packages/backend/src/server/api/endpoints/federation/instances.ts +++ b/packages/backend/src/server/api/endpoints/federation/instances.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { InstancesRepository } from '@/models/index.js'; +import type { InstancesRepository } from '@/models/_.js'; import { InstanceEntityService } from '@/core/entities/InstanceEntityService.js'; import { MetaService } from '@/core/MetaService.js'; import { DI } from '@/di-symbols.js'; @@ -46,9 +46,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.instancesRepository) private instancesRepository: InstancesRepository, diff --git a/packages/backend/src/server/api/endpoints/federation/show-instance.ts b/packages/backend/src/server/api/endpoints/federation/show-instance.ts index d76303ed45..71eec11235 100644 --- a/packages/backend/src/server/api/endpoints/federation/show-instance.ts +++ b/packages/backend/src/server/api/endpoints/federation/show-instance.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { InstancesRepository } from '@/models/index.js'; +import type { InstancesRepository } from '@/models/_.js'; import { InstanceEntityService } from '@/core/entities/InstanceEntityService.js'; import { UtilityService } from '@/core/UtilityService.js'; import { DI } from '@/di-symbols.js'; @@ -33,9 +33,8 @@ export const paramDef = { required: ['host'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.instancesRepository) private instancesRepository: InstancesRepository, diff --git a/packages/backend/src/server/api/endpoints/federation/stats.ts b/packages/backend/src/server/api/endpoints/federation/stats.ts index 048a7ff4e3..e3ffea7b7e 100644 --- a/packages/backend/src/server/api/endpoints/federation/stats.ts +++ b/packages/backend/src/server/api/endpoints/federation/stats.ts @@ -5,7 +5,7 @@ import { IsNull, MoreThan, Not } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { FollowingsRepository, InstancesRepository } from '@/models/index.js'; +import type { FollowingsRepository, InstancesRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { InstanceEntityService } from '@/core/entities/InstanceEntityService.js'; @@ -28,9 +28,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.instancesRepository) private instancesRepository: InstancesRepository, diff --git a/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts b/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts index 90ef86cf4b..c0aa882088 100644 --- a/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts +++ b/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts @@ -22,9 +22,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private getterService: GetterService, private apPersonService: ApPersonService, diff --git a/packages/backend/src/server/api/endpoints/federation/users.ts b/packages/backend/src/server/api/endpoints/federation/users.ts index f284b2175c..d97171865a 100644 --- a/packages/backend/src/server/api/endpoints/federation/users.ts +++ b/packages/backend/src/server/api/endpoints/federation/users.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: ['host'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/fetch-rss.ts b/packages/backend/src/server/api/endpoints/fetch-rss.ts index 6a76d9a7e8..37859d8330 100644 --- a/packages/backend/src/server/api/endpoints/fetch-rss.ts +++ b/packages/backend/src/server/api/endpoints/fetch-rss.ts @@ -4,10 +4,8 @@ */ import Parser from 'rss-parser'; -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { Config } from '@/config.js'; -import { DI } from '@/di-symbols.js'; import { HttpRequestService } from '@/core/HttpRequestService.js'; const rssParser = new Parser(); @@ -28,13 +26,9 @@ export const paramDef = { required: ['url'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.config) - private config: Config, - private httpRequestService: HttpRequestService, ) { super(meta, paramDef, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/flash/create.ts b/packages/backend/src/server/api/endpoints/flash/create.ts index c84d7f2632..6818adcfb5 100644 --- a/packages/backend/src/server/api/endpoints/flash/create.ts +++ b/packages/backend/src/server/api/endpoints/flash/create.ts @@ -5,7 +5,7 @@ import ms from 'ms'; import { Inject, Injectable } from '@nestjs/common'; -import type { FlashsRepository } from '@/models/index.js'; +import type { FlashsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -43,9 +43,8 @@ export const paramDef = { required: ['title', 'summary', 'script', 'permissions'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.flashsRepository) private flashsRepository: FlashsRepository, diff --git a/packages/backend/src/server/api/endpoints/flash/delete.ts b/packages/backend/src/server/api/endpoints/flash/delete.ts index 791e757024..06f56e82a9 100644 --- a/packages/backend/src/server/api/endpoints/flash/delete.ts +++ b/packages/backend/src/server/api/endpoints/flash/delete.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { FlashsRepository } from '@/models/index.js'; +import type { FlashsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -40,9 +40,8 @@ export const paramDef = { required: ['flashId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.flashsRepository) private flashsRepository: FlashsRepository, diff --git a/packages/backend/src/server/api/endpoints/flash/featured.ts b/packages/backend/src/server/api/endpoints/flash/featured.ts index a8f81fb380..1fa5612ac4 100644 --- a/packages/backend/src/server/api/endpoints/flash/featured.ts +++ b/packages/backend/src/server/api/endpoints/flash/featured.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { FlashsRepository } from '@/models/index.js'; +import type { FlashsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { FlashEntityService } from '@/core/entities/FlashEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -31,9 +31,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.flashsRepository) private flashsRepository: FlashsRepository, diff --git a/packages/backend/src/server/api/endpoints/flash/like.ts b/packages/backend/src/server/api/endpoints/flash/like.ts index 8528da5739..745719a4b4 100644 --- a/packages/backend/src/server/api/endpoints/flash/like.ts +++ b/packages/backend/src/server/api/endpoints/flash/like.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { FlashsRepository, FlashLikesRepository } from '@/models/index.js'; +import type { FlashsRepository, FlashLikesRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -49,9 +49,8 @@ export const paramDef = { required: ['flashId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.flashsRepository) private flashsRepository: FlashsRepository, diff --git a/packages/backend/src/server/api/endpoints/flash/my-likes.ts b/packages/backend/src/server/api/endpoints/flash/my-likes.ts index ed1ee0ffde..e328bdbee5 100644 --- a/packages/backend/src/server/api/endpoints/flash/my-likes.ts +++ b/packages/backend/src/server/api/endpoints/flash/my-likes.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { FlashLikesRepository } from '@/models/index.js'; +import type { FlashLikesRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { FlashLikeEntityService } from '@/core/entities/FlashLikeEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -48,9 +48,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.flashLikesRepository) private flashLikesRepository: FlashLikesRepository, diff --git a/packages/backend/src/server/api/endpoints/flash/my.ts b/packages/backend/src/server/api/endpoints/flash/my.ts index df02e10470..b478d8c772 100644 --- a/packages/backend/src/server/api/endpoints/flash/my.ts +++ b/packages/backend/src/server/api/endpoints/flash/my.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { FlashsRepository } from '@/models/index.js'; +import type { FlashsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { FlashEntityService } from '@/core/entities/FlashEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.flashsRepository) private flashsRepository: FlashsRepository, diff --git a/packages/backend/src/server/api/endpoints/flash/show.ts b/packages/backend/src/server/api/endpoints/flash/show.ts index 94c69e4e5e..c41a27c925 100644 --- a/packages/backend/src/server/api/endpoints/flash/show.ts +++ b/packages/backend/src/server/api/endpoints/flash/show.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository, FlashsRepository } from '@/models/index.js'; +import type { FlashsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { FlashEntityService } from '@/core/entities/FlashEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -38,13 +38,9 @@ export const paramDef = { required: ['flashId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.flashsRepository) private flashsRepository: FlashsRepository, diff --git a/packages/backend/src/server/api/endpoints/flash/unlike.ts b/packages/backend/src/server/api/endpoints/flash/unlike.ts index 2b156da914..2145d930c0 100644 --- a/packages/backend/src/server/api/endpoints/flash/unlike.ts +++ b/packages/backend/src/server/api/endpoints/flash/unlike.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { FlashsRepository, FlashLikesRepository } from '@/models/index.js'; +import type { FlashsRepository, FlashLikesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -42,9 +42,8 @@ export const paramDef = { required: ['flashId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.flashsRepository) private flashsRepository: FlashsRepository, diff --git a/packages/backend/src/server/api/endpoints/flash/update.ts b/packages/backend/src/server/api/endpoints/flash/update.ts index 497687cb9d..debef22a6e 100644 --- a/packages/backend/src/server/api/endpoints/flash/update.ts +++ b/packages/backend/src/server/api/endpoints/flash/update.ts @@ -5,7 +5,7 @@ import ms from 'ms'; import { Inject, Injectable } from '@nestjs/common'; -import type { FlashsRepository, DriveFilesRepository } from '@/models/index.js'; +import type { FlashsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -50,19 +50,16 @@ export const paramDef = { permissions: { type: 'array', items: { type: 'string', } }, + visibility: { type: 'string', enum: ['public', 'private'] }, }, required: ['flashId', 'title', 'summary', 'script', 'permissions'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.flashsRepository) private flashsRepository: FlashsRepository, - - @Inject(DI.driveFilesRepository) - private driveFilesRepository: DriveFilesRepository, ) { super(meta, paramDef, async (ps, me) => { const flash = await this.flashsRepository.findOneBy({ id: ps.flashId }); @@ -79,6 +76,7 @@ export default class extends Endpoint { summary: ps.summary, script: ps.script, permissions: ps.permissions, + visibility: ps.visibility, }); }); } diff --git a/packages/backend/src/server/api/endpoints/following/create.ts b/packages/backend/src/server/api/endpoints/following/create.ts index fc9009f19f..e0e7fed87a 100644 --- a/packages/backend/src/server/api/endpoints/following/create.ts +++ b/packages/backend/src/server/api/endpoints/following/create.ts @@ -6,7 +6,7 @@ import ms from 'ms'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository, FollowingsRepository } from '@/models/index.js'; +import type { FollowingsRepository } from '@/models/_.js'; import { IdentifiableError } from '@/misc/identifiable-error.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { UserFollowingService } from '@/core/UserFollowingService.js'; @@ -19,7 +19,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 50, + max: 100, }, requireCredential: true, @@ -75,13 +75,9 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.followingsRepository) private followingsRepository: FollowingsRepository, diff --git a/packages/backend/src/server/api/endpoints/following/delete.ts b/packages/backend/src/server/api/endpoints/following/delete.ts index 21d14028f2..f44692ba6d 100644 --- a/packages/backend/src/server/api/endpoints/following/delete.ts +++ b/packages/backend/src/server/api/endpoints/following/delete.ts @@ -6,7 +6,7 @@ import ms from 'ms'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository, FollowingsRepository } from '@/models/index.js'; +import type { FollowingsRepository } from '@/models/_.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { UserFollowingService } from '@/core/UserFollowingService.js'; import { DI } from '@/di-symbols.js'; @@ -60,13 +60,9 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.followingsRepository) private followingsRepository: FollowingsRepository, diff --git a/packages/backend/src/server/api/endpoints/following/invalidate.ts b/packages/backend/src/server/api/endpoints/following/invalidate.ts index d0e4b51d35..53ef925b2f 100644 --- a/packages/backend/src/server/api/endpoints/following/invalidate.ts +++ b/packages/backend/src/server/api/endpoints/following/invalidate.ts @@ -6,7 +6,7 @@ import ms from 'ms'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository, FollowingsRepository } from '@/models/index.js'; +import type { FollowingsRepository } from '@/models/_.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { UserFollowingService } from '@/core/UserFollowingService.js'; import { DI } from '@/di-symbols.js'; @@ -29,7 +29,7 @@ export const meta = { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '5b12c78d-2b28-4dca-99d2-f56139b42ff8', + id: 'b77e6ae6-a3e5-40da-9cc8-c240115479cc', }, followerIsYourself: { @@ -41,7 +41,7 @@ export const meta = { notFollowing: { message: 'The other use is not following you.', code: 'NOT_FOLLOWING', - id: '5dbf82f5-c92b-40b1-87d1-6c8c0741fd09', + id: '918faac3-074f-41ae-9c43-ed5d2946770d', }, }, @@ -60,13 +60,9 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.followingsRepository) private followingsRepository: FollowingsRepository, diff --git a/packages/backend/src/server/api/endpoints/following/requests/accept.ts b/packages/backend/src/server/api/endpoints/following/requests/accept.ts index 324dcec12a..91fe922200 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/accept.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/accept.ts @@ -38,9 +38,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private getterService: GetterService, private userFollowingService: UserFollowingService, diff --git a/packages/backend/src/server/api/endpoints/following/requests/cancel.ts b/packages/backend/src/server/api/endpoints/following/requests/cancel.ts index 3c952a9ba5..d9d5c7041b 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/cancel.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/cancel.ts @@ -3,14 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { FollowingsRepository } from '@/models/index.js'; import { IdentifiableError } from '@/misc/identifiable-error.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { GetterService } from '@/server/api/GetterService.js'; import { UserFollowingService } from '@/core/UserFollowingService.js'; -import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; export const meta = { @@ -49,13 +47,9 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.followingsRepository) - private followingsRepository: FollowingsRepository, - private userEntityService: UserEntityService, private getterService: GetterService, private userFollowingService: UserFollowingService, diff --git a/packages/backend/src/server/api/endpoints/following/requests/list.ts b/packages/backend/src/server/api/endpoints/following/requests/list.ts index 7137c6f080..7396826000 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/list.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/list.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; -import type { FollowRequestsRepository } from '@/models/index.js'; +import type { FollowRequestsRepository } from '@/models/_.js'; import { FollowRequestEntityService } from '@/core/entities/FollowRequestEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -54,9 +54,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.followRequestsRepository) private followRequestsRepository: FollowRequestsRepository, diff --git a/packages/backend/src/server/api/endpoints/following/requests/reject.ts b/packages/backend/src/server/api/endpoints/following/requests/reject.ts index a57cbb1848..35f047bcef 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/reject.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/reject.ts @@ -33,9 +33,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private getterService: GetterService, private userFollowingService: UserFollowingService, diff --git a/packages/backend/src/server/api/endpoints/following/update.ts b/packages/backend/src/server/api/endpoints/following/update.ts new file mode 100644 index 0000000000..25f393e517 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/following/update.ts @@ -0,0 +1,107 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import ms from 'ms'; +import { Inject, Injectable } from '@nestjs/common'; +import { Endpoint } from '@/server/api/endpoint-base.js'; +import type { FollowingsRepository } from '@/models/_.js'; +import { UserEntityService } from '@/core/entities/UserEntityService.js'; +import { UserFollowingService } from '@/core/UserFollowingService.js'; +import { DI } from '@/di-symbols.js'; +import { GetterService } from '@/server/api/GetterService.js'; +import { ApiError } from '../../error.js'; + +export const meta = { + tags: ['following', 'users'], + + limit: { + duration: ms('1hour'), + max: 100, + }, + + requireCredential: true, + + kind: 'write:following', + + errors: { + noSuchUser: { + message: 'No such user.', + code: 'NO_SUCH_USER', + id: '14318698-f67e-492a-99da-5353a5ac52be', + }, + + followeeIsYourself: { + message: 'Followee is yourself.', + code: 'FOLLOWEE_IS_YOURSELF', + id: '4c4cbaf9-962a-463b-8418-a5e365dbf2eb', + }, + + notFollowing: { + message: 'You are not following that user.', + code: 'NOT_FOLLOWING', + id: 'b8dc75cf-1cb5-46c9-b14b-5f1ffbd782c9', + }, + }, + + res: { + type: 'object', + optional: false, nullable: false, + ref: 'UserLite', + }, +} as const; + +export const paramDef = { + type: 'object', + properties: { + userId: { type: 'string', format: 'misskey:id' }, + notify: { type: 'string', enum: ['normal', 'none'] }, + }, + required: ['userId', 'notify'], +} as const; + +@Injectable() +export default class extends Endpoint { // eslint-disable-line import/no-default-export + constructor( + @Inject(DI.followingsRepository) + private followingsRepository: FollowingsRepository, + + private userEntityService: UserEntityService, + private getterService: GetterService, + private userFollowingService: UserFollowingService, + ) { + super(meta, paramDef, async (ps, me) => { + const follower = me; + + // Check if the follower is yourself + if (me.id === ps.userId) { + throw new ApiError(meta.errors.followeeIsYourself); + } + + // Get followee + const followee = await this.getterService.getUser(ps.userId).catch(err => { + if (err.id === '15348ddd-432d-49c2-8a5a-8069753becff') throw new ApiError(meta.errors.noSuchUser); + throw err; + }); + + // Check not following + const exist = await this.followingsRepository.findOneBy({ + followerId: follower.id, + followeeId: followee.id, + }); + + if (exist == null) { + throw new ApiError(meta.errors.notFollowing); + } + + await this.followingsRepository.update({ + id: exist.id, + }, { + notify: ps.notify === 'none' ? null : ps.notify, + }); + + return await this.userEntityService.pack(follower.id, me); + }); + } +} diff --git a/packages/backend/src/server/api/endpoints/gallery/featured.ts b/packages/backend/src/server/api/endpoints/gallery/featured.ts index 80cad0e5b0..cbab3a83a4 100644 --- a/packages/backend/src/server/api/endpoints/gallery/featured.ts +++ b/packages/backend/src/server/api/endpoints/gallery/featured.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { GalleryPostsRepository } from '@/models/index.js'; +import type { GalleryPostsRepository } from '@/models/_.js'; import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -31,9 +31,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.galleryPostsRepository) private galleryPostsRepository: GalleryPostsRepository, diff --git a/packages/backend/src/server/api/endpoints/gallery/popular.ts b/packages/backend/src/server/api/endpoints/gallery/popular.ts index ef1d54f82c..c5d06f67dd 100644 --- a/packages/backend/src/server/api/endpoints/gallery/popular.ts +++ b/packages/backend/src/server/api/endpoints/gallery/popular.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { GalleryPostsRepository } from '@/models/index.js'; +import type { GalleryPostsRepository } from '@/models/_.js'; import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -31,9 +31,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.galleryPostsRepository) private galleryPostsRepository: GalleryPostsRepository, diff --git a/packages/backend/src/server/api/endpoints/gallery/posts.ts b/packages/backend/src/server/api/endpoints/gallery/posts.ts index 42f35f418a..3ca5f4989a 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { GalleryPostsRepository } from '@/models/index.js'; +import type { GalleryPostsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -34,9 +34,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.galleryPostsRepository) private galleryPostsRepository: GalleryPostsRepository, diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts index c3b94e3b2d..5ac9d442e4 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts @@ -6,9 +6,9 @@ import ms from 'ms'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFilesRepository, GalleryPostsRepository } from '@/models/index.js'; -import { MiGalleryPost } from '@/models/entities/GalleryPost.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; +import type { DriveFilesRepository, GalleryPostsRepository } from '@/models/_.js'; +import { MiGalleryPost } from '@/models/GalleryPost.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; import { IdService } from '@/core/IdService.js'; import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -52,9 +52,8 @@ export const paramDef = { required: ['title', 'fileIds'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.galleryPostsRepository) private galleryPostsRepository: GalleryPostsRepository, diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts b/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts index e08643c8b1..8ada9a9949 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { GalleryPostsRepository } from '@/models/index.js'; +import type { GalleryPostsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -34,9 +34,8 @@ export const paramDef = { required: ['postId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.galleryPostsRepository) private galleryPostsRepository: GalleryPostsRepository, diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts index f40b3eb109..00e25b82cb 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { GalleryLikesRepository, GalleryPostsRepository } from '@/models/index.js'; +import type { GalleryLikesRepository, GalleryPostsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -49,9 +49,8 @@ export const paramDef = { required: ['postId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.galleryPostsRepository) private galleryPostsRepository: GalleryPostsRepository, diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/show.ts b/packages/backend/src/server/api/endpoints/gallery/posts/show.ts index a76e52bd89..b3eda1be52 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/show.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/show.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { GalleryPostsRepository } from '@/models/index.js'; +import type { GalleryPostsRepository } from '@/models/_.js'; import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: ['postId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.galleryPostsRepository) private galleryPostsRepository: GalleryPostsRepository, diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts b/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts index 40d5b599ef..faab1ece67 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { GalleryPostsRepository, GalleryLikesRepository } from '@/models/index.js'; +import type { GalleryPostsRepository, GalleryLikesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -42,9 +42,8 @@ export const paramDef = { required: ['postId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.galleryPostsRepository) private galleryPostsRepository: GalleryPostsRepository, diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/update.ts b/packages/backend/src/server/api/endpoints/gallery/posts/update.ts index f8eb0e4011..44275bbad4 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/update.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/update.ts @@ -6,8 +6,8 @@ import ms from 'ms'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { DriveFilesRepository, GalleryPostsRepository } from '@/models/index.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; +import type { DriveFilesRepository, GalleryPostsRepository } from '@/models/_.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -51,9 +51,8 @@ export const paramDef = { required: ['postId', 'title', 'fileIds'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.galleryPostsRepository) private galleryPostsRepository: GalleryPostsRepository, diff --git a/packages/backend/src/server/api/endpoints/get-online-users-count.ts b/packages/backend/src/server/api/endpoints/get-online-users-count.ts index 3c265185a9..8a61168f25 100644 --- a/packages/backend/src/server/api/endpoints/get-online-users-count.ts +++ b/packages/backend/src/server/api/endpoints/get-online-users-count.ts @@ -6,7 +6,7 @@ import { MoreThan } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; import { USER_ONLINE_THRESHOLD } from '@/const.js'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -24,9 +24,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/hashtags/list.ts b/packages/backend/src/server/api/endpoints/hashtags/list.ts index 71400f4a23..21d863107d 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/list.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/list.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { HashtagsRepository } from '@/models/index.js'; +import type { HashtagsRepository } from '@/models/_.js'; import { HashtagEntityService } from '@/core/entities/HashtagEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: ['sort'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.hashtagsRepository) private hashtagsRepository: HashtagsRepository, diff --git a/packages/backend/src/server/api/endpoints/hashtags/search.ts b/packages/backend/src/server/api/endpoints/hashtags/search.ts index e9508afd32..acfef16b11 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/search.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/search.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { HashtagsRepository } from '@/models/index.js'; +import type { HashtagsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { sqlLikeEscape } from '@/misc/sql-like-escape.js'; @@ -34,9 +34,8 @@ export const paramDef = { required: ['query'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.hashtagsRepository) private hashtagsRepository: HashtagsRepository, diff --git a/packages/backend/src/server/api/endpoints/hashtags/show.ts b/packages/backend/src/server/api/endpoints/hashtags/show.ts index 64a556a3c7..3ba16fdc85 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/show.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/show.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { HashtagsRepository } from '@/models/index.js'; +import type { HashtagsRepository } from '@/models/_.js'; import { normalizeForSearch } from '@/misc/normalize-for-search.js'; import { HashtagEntityService } from '@/core/entities/HashtagEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -39,9 +39,8 @@ export const paramDef = { required: ['tag'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.hashtagsRepository) private hashtagsRepository: HashtagsRepository, diff --git a/packages/backend/src/server/api/endpoints/hashtags/trend.ts b/packages/backend/src/server/api/endpoints/hashtags/trend.ts index b4c9565e0e..75d4fe3819 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/trend.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/trend.ts @@ -6,8 +6,8 @@ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { NotesRepository } from '@/models/index.js'; -import type { MiNote } from '@/models/entities/Note.js'; +import type { NotesRepository } from '@/models/_.js'; +import type { MiNote } from '@/models/Note.js'; import { safeForSql } from '@/misc/safe-for-sql.js'; import { normalizeForSearch } from '@/misc/normalize-for-search.js'; import { MetaService } from '@/core/MetaService.js'; @@ -68,9 +68,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/server/api/endpoints/hashtags/users.ts b/packages/backend/src/server/api/endpoints/hashtags/users.ts index 6a8c69351d..1cef76d3d2 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/users.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/users.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import { normalizeForSearch } from '@/misc/normalize-for-search.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: ['tag', 'sort'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/i.ts b/packages/backend/src/server/api/endpoints/i.ts index 7c59cee09d..c0530bf392 100644 --- a/packages/backend/src/server/api/endpoints/i.ts +++ b/packages/backend/src/server/api/endpoints/i.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserProfilesRepository, UsersRepository } from '@/models/index.js'; +import type { UserProfilesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -37,13 +37,9 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, diff --git a/packages/backend/src/server/api/endpoints/i/2fa/done.ts b/packages/backend/src/server/api/endpoints/i/2fa/done.ts index 5fb194dfc3..e32f97743e 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/done.ts @@ -7,9 +7,8 @@ import * as OTPAuth from 'otpauth'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import type { UserProfilesRepository } from '@/models/index.js'; +import type { UserProfilesRepository } from '@/models/_.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; -import type { Config } from '@/config.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -26,13 +25,9 @@ export const paramDef = { required: ['token'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, @@ -52,16 +47,14 @@ export default class extends Endpoint { secret: OTPAuth.Secret.fromBase32(profile.twoFactorTempSecret), digits: 6, token, - window: 1, + window: 5, }); if (delta === null) { throw new Error('not verified'); } - const backupCodes = Array.from({ length: 20 }, () => { - return new OTPAuth.Secret().base32; - }); + const backupCodes = Array.from({ length: 20 }, () => new OTPAuth.Secret().base32); await this.userProfilesRepository.update(me.id, { twoFactorSecret: profile.twoFactorTempSecret, diff --git a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts index 87a15da0c2..6d530aba3b 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts @@ -9,9 +9,10 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { DI } from '@/di-symbols.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; -import type { UserProfilesRepository, UserSecurityKeysRepository } from '@/models/index.js'; +import type { UserProfilesRepository, UserSecurityKeysRepository } from '@/models/_.js'; import { WebAuthnService } from '@/core/WebAuthnService.js'; import { ApiError } from '@/server/api/error.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -37,6 +38,7 @@ export const paramDef = { type: 'object', properties: { password: { type: 'string' }, + token: { type: 'string', nullable: true }, name: { type: 'string', minLength: 1, maxLength: 30 }, credential: { type: 'object' }, }, @@ -54,16 +56,28 @@ export default class extends Endpoint { private userSecurityKeysRepository: UserSecurityKeysRepository, private webAuthnService: WebAuthnService, + private userAuthService: UserAuthService, private userEntityService: UserEntityService, private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); - // Compare password - const same = await bcrypt.compare(ps.password, profile.password ?? ''); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.password, profile.password ?? ''); + if (!passwordMatched) { throw new ApiError(meta.errors.incorrectPassword); } diff --git a/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts b/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts index 4973b49c22..2ed701014d 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import type { UserProfilesRepository, UserSecurityKeysRepository } from '@/models/index.js'; +import type { UserProfilesRepository, UserSecurityKeysRepository } from '@/models/_.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -33,9 +33,8 @@ export const paramDef = { required: ['value'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, diff --git a/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts index cae4f5ab52..c39005f2dd 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts @@ -6,10 +6,11 @@ import bcrypt from 'bcryptjs'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UserProfilesRepository } from '@/models/index.js'; +import type { UserProfilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { WebAuthnService } from '@/core/WebAuthnService.js'; import { ApiError } from '@/server/api/error.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -41,6 +42,7 @@ export const paramDef = { type: 'object', properties: { password: { type: 'string' }, + token: { type: 'string', nullable: true }, }, required: ['password'], } as const; @@ -53,8 +55,10 @@ export default class extends Endpoint { private userProfilesRepository: UserProfilesRepository, private webAuthnService: WebAuthnService, + private userAuthService: UserAuthService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOne({ where: { userId: me.id, @@ -66,10 +70,20 @@ export default class extends Endpoint { throw new ApiError(meta.errors.userNotFound); } - // Compare password - const same = await bcrypt.compare(ps.password, profile.password ?? ''); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.password, profile.password ?? ''); + if (!passwordMatched) { throw new ApiError(meta.errors.incorrectPassword); } diff --git a/packages/backend/src/server/api/endpoints/i/2fa/register.ts b/packages/backend/src/server/api/endpoints/i/2fa/register.ts index 26849a3f85..b358c812ee 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register.ts @@ -7,11 +7,12 @@ import bcrypt from 'bcryptjs'; import * as OTPAuth from 'otpauth'; import * as QRCode from 'qrcode'; import { Inject, Injectable } from '@nestjs/common'; -import type { UserProfilesRepository } from '@/models/index.js'; +import type { UserProfilesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import { ApiError } from '@/server/api/error.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -31,27 +32,40 @@ export const paramDef = { type: 'object', properties: { password: { type: 'string' }, + token: { type: 'string', nullable: true }, }, required: ['password'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.config) private config: Config, @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, + + private userAuthService: UserAuthService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); - // Compare password - const same = await bcrypt.compare(ps.password, profile.password ?? ''); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.password, profile.password ?? ''); + if (!passwordMatched) { throw new ApiError(meta.errors.incorrectPassword); } diff --git a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts index 076426e836..da8ac98556 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts @@ -6,11 +6,12 @@ import bcrypt from 'bcryptjs'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UserProfilesRepository, UserSecurityKeysRepository } from '@/models/index.js'; +import type { UserProfilesRepository, UserSecurityKeysRepository } from '@/models/_.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '@/server/api/error.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -30,14 +31,14 @@ export const paramDef = { type: 'object', properties: { password: { type: 'string' }, + token: { type: 'string', nullable: true }, credentialId: { type: 'string' }, }, required: ['password', 'credentialId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userSecurityKeysRepository) private userSecurityKeysRepository: UserSecurityKeysRepository, @@ -46,15 +47,27 @@ export default class extends Endpoint { private userProfilesRepository: UserProfilesRepository, private userEntityService: UserEntityService, + private userAuthService: UserAuthService, private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); - // Compare password - const same = await bcrypt.compare(ps.password, profile.password ?? ''); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.password, profile.password ?? ''); + if (!passwordMatched) { throw new ApiError(meta.errors.incorrectPassword); } diff --git a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts index 51a0c12279..338f12c5cd 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts @@ -7,10 +7,11 @@ import bcrypt from 'bcryptjs'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import type { UserProfilesRepository } from '@/models/index.js'; +import type { UserProfilesRepository } from '@/models/_.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '@/server/api/error.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -30,27 +31,39 @@ export const paramDef = { type: 'object', properties: { password: { type: 'string' }, + token: { type: 'string', nullable: true }, }, required: ['password'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, private userEntityService: UserEntityService, + private userAuthService: UserAuthService, private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); - // Compare password - const same = await bcrypt.compare(ps.password, profile.password ?? ''); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.password, profile.password ?? ''); + if (!passwordMatched) { throw new ApiError(meta.errors.incorrectPassword); } diff --git a/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts index 8f3813bbb0..1a140c1d05 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/update-key.ts @@ -6,7 +6,7 @@ import bcrypt from 'bcryptjs'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UserSecurityKeysRepository } from '@/models/index.js'; +import type { UserSecurityKeysRepository } from '@/models/_.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; @@ -41,9 +41,8 @@ export const paramDef = { required: ['name', 'credentialId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userSecurityKeysRepository) private userSecurityKeysRepository: UserSecurityKeysRepository, diff --git a/packages/backend/src/server/api/endpoints/i/apps.ts b/packages/backend/src/server/api/endpoints/i/apps.ts index 24e80390c2..daa3e536a4 100644 --- a/packages/backend/src/server/api/endpoints/i/apps.ts +++ b/packages/backend/src/server/api/endpoints/i/apps.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AccessTokensRepository } from '@/models/index.js'; +import type { AccessTokensRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -22,9 +22,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.accessTokensRepository) private accessTokensRepository: AccessTokensRepository, diff --git a/packages/backend/src/server/api/endpoints/i/authorized-apps.ts b/packages/backend/src/server/api/endpoints/i/authorized-apps.ts index 1da5479c38..32061c2aa4 100644 --- a/packages/backend/src/server/api/endpoints/i/authorized-apps.ts +++ b/packages/backend/src/server/api/endpoints/i/authorized-apps.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull, Not } from 'typeorm'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AccessTokensRepository } from '@/models/index.js'; +import type { AccessTokensRepository } from '@/models/_.js'; import { AppEntityService } from '@/core/entities/AppEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -26,9 +26,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.accessTokensRepository) private accessTokensRepository: AccessTokensRepository, diff --git a/packages/backend/src/server/api/endpoints/i/change-password.ts b/packages/backend/src/server/api/endpoints/i/change-password.ts index 757a57caed..a3c37ffdb7 100644 --- a/packages/backend/src/server/api/endpoints/i/change-password.ts +++ b/packages/backend/src/server/api/endpoints/i/change-password.ts @@ -6,8 +6,9 @@ import bcrypt from 'bcryptjs'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UserProfilesRepository } from '@/models/index.js'; +import type { UserProfilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -20,24 +21,38 @@ export const paramDef = { properties: { currentPassword: { type: 'string' }, newPassword: { type: 'string', minLength: 1 }, + token: { type: 'string', nullable: true }, }, required: ['currentPassword', 'newPassword'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, + + private userAuthService: UserAuthService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); - // Compare password - const same = await bcrypt.compare(ps.currentPassword, profile.password!); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.currentPassword, profile.password!); + + if (!passwordMatched) { throw new Error('incorrect password'); } diff --git a/packages/backend/src/server/api/endpoints/i/claim-achievement.ts b/packages/backend/src/server/api/endpoints/i/claim-achievement.ts index b2a70f1681..b24b3438dc 100644 --- a/packages/backend/src/server/api/endpoints/i/claim-achievement.ts +++ b/packages/backend/src/server/api/endpoints/i/claim-achievement.ts @@ -20,9 +20,8 @@ export const paramDef = { required: ['name'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private achievementService: AchievementService, ) { diff --git a/packages/backend/src/server/api/endpoints/i/delete-account.ts b/packages/backend/src/server/api/endpoints/i/delete-account.ts index e6d70ff627..eb5379c171 100644 --- a/packages/backend/src/server/api/endpoints/i/delete-account.ts +++ b/packages/backend/src/server/api/endpoints/i/delete-account.ts @@ -5,10 +5,11 @@ import bcrypt from 'bcryptjs'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository, UserProfilesRepository } from '@/models/index.js'; +import type { UsersRepository, UserProfilesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DeleteAccountService } from '@/core/DeleteAccountService.js'; import { DI } from '@/di-symbols.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; export const meta = { requireCredential: true, @@ -21,13 +22,13 @@ export const paramDef = { type: 'object', properties: { password: { type: 'string' }, + token: { type: 'string', nullable: true }, }, required: ['password'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -35,19 +36,32 @@ export default class extends Endpoint { @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, + private userAuthService: UserAuthService, private deleteAccountService: DeleteAccountService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); + + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } + + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + const userDetailed = await this.usersRepository.findOneByOrFail({ id: me.id }); if (userDetailed.isDeleted) { return; } - // Compare password - const same = await bcrypt.compare(ps.password, profile.password!); - - if (!same) { + const passwordMatched = await bcrypt.compare(ps.password, profile.password!); + if (!passwordMatched) { throw new Error('incorrect password'); } diff --git a/packages/backend/src/server/api/endpoints/i/export-blocking.ts b/packages/backend/src/server/api/endpoints/i/export-blocking.ts index 8e6bfd4cdc..8068a3b305 100644 --- a/packages/backend/src/server/api/endpoints/i/export-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/export-blocking.ts @@ -23,9 +23,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private queueService: QueueService, ) { diff --git a/packages/backend/src/server/api/endpoints/i/export-favorites.ts b/packages/backend/src/server/api/endpoints/i/export-favorites.ts index 5c9f0953d3..c22905bc67 100644 --- a/packages/backend/src/server/api/endpoints/i/export-favorites.ts +++ b/packages/backend/src/server/api/endpoints/i/export-favorites.ts @@ -23,9 +23,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private queueService: QueueService, ) { diff --git a/packages/backend/src/server/api/endpoints/i/export-following.ts b/packages/backend/src/server/api/endpoints/i/export-following.ts index e3c33a9429..880833ab76 100644 --- a/packages/backend/src/server/api/endpoints/i/export-following.ts +++ b/packages/backend/src/server/api/endpoints/i/export-following.ts @@ -26,9 +26,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private queueService: QueueService, ) { diff --git a/packages/backend/src/server/api/endpoints/i/export-mute.ts b/packages/backend/src/server/api/endpoints/i/export-mute.ts index 5234d7d340..8eb70a387a 100644 --- a/packages/backend/src/server/api/endpoints/i/export-mute.ts +++ b/packages/backend/src/server/api/endpoints/i/export-mute.ts @@ -23,9 +23,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private queueService: QueueService, ) { diff --git a/packages/backend/src/server/api/endpoints/i/export-notes.ts b/packages/backend/src/server/api/endpoints/i/export-notes.ts index cca4a58e4a..791f637790 100644 --- a/packages/backend/src/server/api/endpoints/i/export-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/export-notes.ts @@ -23,9 +23,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private queueService: QueueService, ) { diff --git a/packages/backend/src/server/api/endpoints/i/export-user-lists.ts b/packages/backend/src/server/api/endpoints/i/export-user-lists.ts index 74b2c7c2c6..f387f6d016 100644 --- a/packages/backend/src/server/api/endpoints/i/export-user-lists.ts +++ b/packages/backend/src/server/api/endpoints/i/export-user-lists.ts @@ -23,9 +23,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private queueService: QueueService, ) { diff --git a/packages/backend/src/server/api/endpoints/i/favorites.ts b/packages/backend/src/server/api/endpoints/i/favorites.ts index d5b1959795..d6f13c535a 100644 --- a/packages/backend/src/server/api/endpoints/i/favorites.ts +++ b/packages/backend/src/server/api/endpoints/i/favorites.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { NoteFavoritesRepository } from '@/models/index.js'; +import type { NoteFavoritesRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteFavoriteEntityService } from '@/core/entities/NoteFavoriteEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.noteFavoritesRepository) private noteFavoritesRepository: NoteFavoritesRepository, diff --git a/packages/backend/src/server/api/endpoints/i/gallery/likes.ts b/packages/backend/src/server/api/endpoints/i/gallery/likes.ts index 5017d0695a..7e37adc4ac 100644 --- a/packages/backend/src/server/api/endpoints/i/gallery/likes.ts +++ b/packages/backend/src/server/api/endpoints/i/gallery/likes.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { GalleryLikesRepository } from '@/models/index.js'; +import type { GalleryLikesRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { GalleryLikeEntityService } from '@/core/entities/GalleryLikeEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -49,9 +49,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.galleryLikesRepository) private galleryLikesRepository: GalleryLikesRepository, diff --git a/packages/backend/src/server/api/endpoints/i/gallery/posts.ts b/packages/backend/src/server/api/endpoints/i/gallery/posts.ts index 4e846831bd..148d38aa54 100644 --- a/packages/backend/src/server/api/endpoints/i/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/i/gallery/posts.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { GalleryPostsRepository } from '@/models/index.js'; +import type { GalleryPostsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.galleryPostsRepository) private galleryPostsRepository: GalleryPostsRepository, diff --git a/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts b/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts index 4022933360..d62bfbb3ed 100644 --- a/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts +++ b/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { MutedNotesRepository } from '@/models/index.js'; +import type { MutedNotesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -33,9 +33,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.mutedNotesRepository) private mutedNotesRepository: MutedNotesRepository, diff --git a/packages/backend/src/server/api/endpoints/i/import-antennas.ts b/packages/backend/src/server/api/endpoints/i/import-antennas.ts index 5a42caa01a..26e672b7e7 100644 --- a/packages/backend/src/server/api/endpoints/i/import-antennas.ts +++ b/packages/backend/src/server/api/endpoints/i/import-antennas.ts @@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common'; import ms from 'ms'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueueService } from '@/core/QueueService.js'; -import type { AntennasRepository, DriveFilesRepository, UsersRepository, MiAntenna as _Antenna } from '@/models/index.js'; +import type { AntennasRepository, DriveFilesRepository, UsersRepository, MiAntenna as _Antenna } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; import { DownloadService } from '@/core/DownloadService.js'; diff --git a/packages/backend/src/server/api/endpoints/i/import-blocking.ts b/packages/backend/src/server/api/endpoints/i/import-blocking.ts index 8763807c10..69507a9201 100644 --- a/packages/backend/src/server/api/endpoints/i/import-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/import-blocking.ts @@ -8,7 +8,7 @@ import ms from 'ms'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueueService } from '@/core/QueueService.js'; import { AccountMoveService } from '@/core/AccountMoveService.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -59,9 +59,8 @@ export const paramDef = { required: ['fileId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/i/import-following.ts b/packages/backend/src/server/api/endpoints/i/import-following.ts index b29a361d0d..38c9283043 100644 --- a/packages/backend/src/server/api/endpoints/i/import-following.ts +++ b/packages/backend/src/server/api/endpoints/i/import-following.ts @@ -8,7 +8,7 @@ import ms from 'ms'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueueService } from '@/core/QueueService.js'; import { AccountMoveService } from '@/core/AccountMoveService.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -56,9 +56,8 @@ export const paramDef = { required: ['fileId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/i/import-muting.ts b/packages/backend/src/server/api/endpoints/i/import-muting.ts index 108c3a68d7..871bf8be07 100644 --- a/packages/backend/src/server/api/endpoints/i/import-muting.ts +++ b/packages/backend/src/server/api/endpoints/i/import-muting.ts @@ -8,7 +8,7 @@ import ms from 'ms'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueueService } from '@/core/QueueService.js'; import { AccountMoveService } from '@/core/AccountMoveService.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -59,9 +59,8 @@ export const paramDef = { required: ['fileId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/i/import-user-lists.ts b/packages/backend/src/server/api/endpoints/i/import-user-lists.ts index a99d7c1860..79f17b105a 100644 --- a/packages/backend/src/server/api/endpoints/i/import-user-lists.ts +++ b/packages/backend/src/server/api/endpoints/i/import-user-lists.ts @@ -8,7 +8,7 @@ import ms from 'ms'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueueService } from '@/core/QueueService.js'; import { AccountMoveService } from '@/core/AccountMoveService.js'; -import type { DriveFilesRepository } from '@/models/index.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -59,9 +59,8 @@ export const paramDef = { required: ['fileId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, diff --git a/packages/backend/src/server/api/endpoints/i/move.ts b/packages/backend/src/server/api/endpoints/i/move.ts index 106ea83c85..2bab70e6f7 100644 --- a/packages/backend/src/server/api/endpoints/i/move.ts +++ b/packages/backend/src/server/api/endpoints/i/move.ts @@ -3,16 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import ms from 'ms'; -import type { Config } from '@/config.js'; -import { DI } from '@/di-symbols.js'; - import { Endpoint } from '@/server/api/endpoint-base.js'; import { ApiError } from '@/server/api/error.js'; -import { MiLocalUser, MiRemoteUser } from '@/models/entities/User.js'; +import { MiLocalUser, MiRemoteUser } from '@/models/User.js'; import { AccountMoveService } from '@/core/AccountMoveService.js'; import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js'; @@ -80,13 +77,9 @@ export const paramDef = { required: ['moveToAccount'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.config) - private config: Config, - private remoteUserResolveService: RemoteUserResolveService, private apiLoggerService: ApiLoggerService, private accountMoveService: AccountMoveService, diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts index 1144073132..91dd72e805 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications.ts @@ -6,16 +6,15 @@ import { Brackets, In } from 'typeorm'; import * as Redis from 'ioredis'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository, FollowingsRepository, MutingsRepository, UserProfilesRepository, NotesRepository } from '@/models/index.js'; +import type { NotesRepository } from '@/models/_.js'; import { obsoleteNotificationTypes, notificationTypes } from '@/types.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import { QueryService } from '@/core/QueryService.js'; import { NoteReadService } from '@/core/NoteReadService.js'; import { NotificationEntityService } from '@/core/entities/NotificationEntityService.js'; import { NotificationService } from '@/core/NotificationService.js'; import { DI } from '@/di-symbols.js'; import { IdService } from '@/core/IdService.js'; -import { MiNotification } from '@/models/entities/Notification.js'; +import { MiNotification } from '@/models/Notification.js'; export const meta = { tags: ['account', 'notifications'], @@ -58,29 +57,18 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.redis) private redisClient: Redis.Redis, - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - - @Inject(DI.mutingsRepository) - private mutingsRepository: MutingsRepository, - - @Inject(DI.userProfilesRepository) - private userProfilesRepository: UserProfilesRepository, - @Inject(DI.notesRepository) private notesRepository: NotesRepository, private idService: IdService, private notificationEntityService: NotificationEntityService, private notificationService: NotificationService, - private queryService: QueryService, private noteReadService: NoteReadService, ) { super(meta, paramDef, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/i/page-likes.ts b/packages/backend/src/server/api/endpoints/i/page-likes.ts index 7510348260..6bf7e6aa9b 100644 --- a/packages/backend/src/server/api/endpoints/i/page-likes.ts +++ b/packages/backend/src/server/api/endpoints/i/page-likes.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { PageLikesRepository } from '@/models/index.js'; +import type { PageLikesRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { PageLikeEntityService } from '@/core/entities/PageLikeEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -48,9 +48,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.pageLikesRepository) private pageLikesRepository: PageLikesRepository, diff --git a/packages/backend/src/server/api/endpoints/i/pages.ts b/packages/backend/src/server/api/endpoints/i/pages.ts index 0f66a7c7f2..393030642a 100644 --- a/packages/backend/src/server/api/endpoints/i/pages.ts +++ b/packages/backend/src/server/api/endpoints/i/pages.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { PagesRepository } from '@/models/index.js'; +import type { PagesRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { PageEntityService } from '@/core/entities/PageEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.pagesRepository) private pagesRepository: PagesRepository, diff --git a/packages/backend/src/server/api/endpoints/i/pin.ts b/packages/backend/src/server/api/endpoints/i/pin.ts index 128e6dc8a7..566c573985 100644 --- a/packages/backend/src/server/api/endpoints/i/pin.ts +++ b/packages/backend/src/server/api/endpoints/i/pin.ts @@ -54,9 +54,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private userEntityService: UserEntityService, private notePiningService: NotePiningService, diff --git a/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts b/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts index d7ca50ebf6..e43ab7c15e 100644 --- a/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { NoteUnreadsRepository } from '@/models/index.js'; +import type { NoteUnreadsRepository } from '@/models/_.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; @@ -23,9 +23,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.noteUnreadsRepository) private noteUnreadsRepository: NoteUnreadsRepository, diff --git a/packages/backend/src/server/api/endpoints/i/read-announcement.ts b/packages/backend/src/server/api/endpoints/i/read-announcement.ts index ed26658d4f..ba7859d0d4 100644 --- a/packages/backend/src/server/api/endpoints/i/read-announcement.ts +++ b/packages/backend/src/server/api/endpoints/i/read-announcement.ts @@ -26,14 +26,13 @@ export const paramDef = { required: ['announcementId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private announcementService: AnnouncementService, ) { super(meta, paramDef, async (ps, me) => { - await this.announcementService.markAsRead(me, ps.announcementId); + await this.announcementService.read(me, ps.announcementId); }); } } diff --git a/packages/backend/src/server/api/endpoints/i/regenerate-token.ts b/packages/backend/src/server/api/endpoints/i/regenerate-token.ts index 190ce6e6ff..b70dcfbace 100644 --- a/packages/backend/src/server/api/endpoints/i/regenerate-token.ts +++ b/packages/backend/src/server/api/endpoints/i/regenerate-token.ts @@ -6,7 +6,7 @@ import bcrypt from 'bcryptjs'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository, UserProfilesRepository } from '@/models/index.js'; +import type { UsersRepository, UserProfilesRepository } from '@/models/_.js'; import generateUserToken from '@/misc/generate-native-user-token.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; @@ -25,9 +25,8 @@ export const paramDef = { required: ['password'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-all.ts b/packages/backend/src/server/api/endpoints/i/registry/get-all.ts index 293b67ae67..211e6637dc 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-all.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-all.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistryItemsRepository } from '@/models/index.js'; +import type { RegistryItemsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -24,9 +24,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registryItemsRepository) private registryItemsRepository: RegistryItemsRepository, diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts b/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts index 77cc7bab7c..9c6f2d6781 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistryItemsRepository } from '@/models/index.js'; +import type { RegistryItemsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -34,9 +34,8 @@ export const paramDef = { required: ['key'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registryItemsRepository) private registryItemsRepository: RegistryItemsRepository, diff --git a/packages/backend/src/server/api/endpoints/i/registry/get.ts b/packages/backend/src/server/api/endpoints/i/registry/get.ts index 9b9d943e63..729e729b8c 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistryItemsRepository } from '@/models/index.js'; +import type { RegistryItemsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -34,9 +34,8 @@ export const paramDef = { required: ['key'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registryItemsRepository) private registryItemsRepository: RegistryItemsRepository, diff --git a/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts b/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts index 39b34de108..ffd2860fde 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistryItemsRepository } from '@/models/index.js'; +import type { RegistryItemsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -24,9 +24,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registryItemsRepository) private registryItemsRepository: RegistryItemsRepository, diff --git a/packages/backend/src/server/api/endpoints/i/registry/keys.ts b/packages/backend/src/server/api/endpoints/i/registry/keys.ts index 2becd1040a..7239bb66e1 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistryItemsRepository } from '@/models/index.js'; +import type { RegistryItemsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -24,9 +24,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registryItemsRepository) private registryItemsRepository: RegistryItemsRepository, diff --git a/packages/backend/src/server/api/endpoints/i/registry/remove.ts b/packages/backend/src/server/api/endpoints/i/registry/remove.ts index 633d47eb21..ae687fefe9 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/remove.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/remove.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistryItemsRepository } from '@/models/index.js'; +import type { RegistryItemsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -34,9 +34,8 @@ export const paramDef = { required: ['key'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registryItemsRepository) private registryItemsRepository: RegistryItemsRepository, diff --git a/packages/backend/src/server/api/endpoints/i/registry/scopes.ts b/packages/backend/src/server/api/endpoints/i/registry/scopes.ts index 7cf95926fb..7637cdcf73 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/scopes.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/scopes.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistryItemsRepository } from '@/models/index.js'; +import type { RegistryItemsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -20,9 +20,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registryItemsRepository) private registryItemsRepository: RegistryItemsRepository, diff --git a/packages/backend/src/server/api/endpoints/i/registry/set.ts b/packages/backend/src/server/api/endpoints/i/registry/set.ts index ac51ab17f6..c074b152df 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/set.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/set.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistryItemsRepository } from '@/models/index.js'; +import type { RegistryItemsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; @@ -28,9 +28,8 @@ export const paramDef = { required: ['key', 'value'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registryItemsRepository) private registryItemsRepository: RegistryItemsRepository, diff --git a/packages/backend/src/server/api/endpoints/i/revoke-token.ts b/packages/backend/src/server/api/endpoints/i/revoke-token.ts index 91d95f3309..8e2f271005 100644 --- a/packages/backend/src/server/api/endpoints/i/revoke-token.ts +++ b/packages/backend/src/server/api/endpoints/i/revoke-token.ts @@ -5,8 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AccessTokensRepository } from '@/models/index.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; +import type { AccessTokensRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -23,14 +22,11 @@ export const paramDef = { required: ['tokenId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.accessTokensRepository) private accessTokensRepository: AccessTokensRepository, - - private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { const tokenExist = await this.accessTokensRepository.exist({ where: { id: ps.tokenId } }); diff --git a/packages/backend/src/server/api/endpoints/i/signin-history.ts b/packages/backend/src/server/api/endpoints/i/signin-history.ts index 55dca98ad8..139bede7bc 100644 --- a/packages/backend/src/server/api/endpoints/i/signin-history.ts +++ b/packages/backend/src/server/api/endpoints/i/signin-history.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { SigninsRepository } from '@/models/index.js'; +import type { SigninsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { SigninEntityService } from '@/core/entities/SigninEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -26,9 +26,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.signinsRepository) private signinsRepository: SigninsRepository, diff --git a/packages/backend/src/server/api/endpoints/i/unpin.ts b/packages/backend/src/server/api/endpoints/i/unpin.ts index 11e8326d40..a80dce0844 100644 --- a/packages/backend/src/server/api/endpoints/i/unpin.ts +++ b/packages/backend/src/server/api/endpoints/i/unpin.ts @@ -40,9 +40,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private userEntityService: UserEntityService, private notePiningService: NotePiningService, diff --git a/packages/backend/src/server/api/endpoints/i/update-email.ts b/packages/backend/src/server/api/endpoints/i/update-email.ts index 591204fa09..941f531f0a 100644 --- a/packages/backend/src/server/api/endpoints/i/update-email.ts +++ b/packages/backend/src/server/api/endpoints/i/update-email.ts @@ -7,13 +7,14 @@ import { Inject, Injectable } from '@nestjs/common'; import ms from 'ms'; import bcrypt from 'bcryptjs'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository, UserProfilesRepository } from '@/models/index.js'; +import type { UserProfilesRepository } from '@/models/_.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { EmailService } from '@/core/EmailService.js'; import type { Config } from '@/config.js'; import { DI } from '@/di-symbols.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { L_CHARS, secureRndstr } from '@/misc/secure-rndstr.js'; +import { UserAuthService } from '@/core/UserAuthService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -47,34 +48,43 @@ export const paramDef = { properties: { password: { type: 'string' }, email: { type: 'string', nullable: true }, + token: { type: 'string', nullable: true }, }, required: ['password'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.config) private config: Config, - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, private userEntityService: UserEntityService, private emailService: EmailService, + private userAuthService: UserAuthService, private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { + const token = ps.token; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: me.id }); - // Compare password - const same = await bcrypt.compare(ps.password, profile.password!); + if (profile.twoFactorEnabled) { + if (token == null) { + throw new Error('authentication failed'); + } - if (!same) { + try { + await this.userAuthService.twoFactorAuthenticate(profile, token); + } catch (e) { + throw new Error('authentication failed'); + } + } + + const passwordMatched = await bcrypt.compare(ps.password, profile.password!); + if (!passwordMatched) { throw new ApiError(meta.errors.incorrectPassword); } diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index fae658b5c4..b83f5fdb5a 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -6,13 +6,15 @@ import RE2 from 're2'; import * as mfm from 'mfm-js'; import { Inject, Injectable } from '@nestjs/common'; +import ms from 'ms'; +import { JSDOM } from 'jsdom'; import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm.js'; import { extractHashtags } from '@/misc/extract-hashtags.js'; import * as Acct from '@/misc/acct.js'; -import type { UsersRepository, DriveFilesRepository, UserProfilesRepository, PagesRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; -import { birthdaySchema, descriptionSchema, locationSchema, nameSchema } from '@/models/entities/User.js'; -import type { MiUserProfile } from '@/models/entities/UserProfile.js'; +import type { UsersRepository, DriveFilesRepository, UserProfilesRepository, PagesRepository } from '@/models/_.js'; +import type { MiLocalUser, MiUser } from '@/models/User.js'; +import { birthdaySchema, descriptionSchema, locationSchema, nameSchema } from '@/models/User.js'; +import type { MiUserProfile } from '@/models/UserProfile.js'; import { notificationTypes } from '@/types.js'; import { normalizeForSearch } from '@/misc/normalize-for-search.js'; import { langmap } from '@/misc/langmap.js'; @@ -25,9 +27,11 @@ import { HashtagService } from '@/core/HashtagService.js'; import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; import { CacheService } from '@/core/CacheService.js'; -import { AccountMoveService } from '@/core/AccountMoveService.js'; import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; +import { HttpRequestService } from '@/core/HttpRequestService.js'; +import type { Config } from '@/config.js'; +import { safeForSql } from '@/misc/safe-for-sql.js'; import { ApiLoggerService } from '../../ApiLoggerService.js'; import { ApiError } from '../../error.js'; @@ -39,6 +43,11 @@ export const meta = { kind: 'write:account', + limit: { + duration: ms('1hour'), + max: 10, + }, + errors: { noSuchAvatar: { message: 'No such avatar file.', @@ -172,10 +181,12 @@ export const paramDef = { }, } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( + @Inject(DI.config) + private config: Config, + @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -193,15 +204,15 @@ export default class extends Endpoint { private globalEventService: GlobalEventService, private userFollowingService: UserFollowingService, private accountUpdateService: AccountUpdateService, - private accountMoveService: AccountMoveService, private remoteUserResolveService: RemoteUserResolveService, private apiLoggerService: ApiLoggerService, private hashtagService: HashtagService, private roleService: RoleService, private cacheService: CacheService, + private httpRequestService: HttpRequestService, ) { super(meta, paramDef, async (ps, _user, token) => { - const user = await this.usersRepository.findOneByOrFail({ id: _user.id }); + const user = await this.usersRepository.findOneByOrFail({ id: _user.id }) as MiLocalUser; const isSecure = token == null; const updates = {} as Partial; @@ -300,9 +311,9 @@ export default class extends Endpoint { if (ps.fields) { profileUpdates.fields = ps.fields - .filter(x => typeof x.name === 'string' && x.name !== '' && typeof x.value === 'string' && x.value !== '') + .filter(x => typeof x.name === 'string' && x.name.trim() !== '' && typeof x.value === 'string' && x.value.trim() !== '') .map(x => { - return { name: x.name, value: x.value }; + return { name: x.name.trim(), value: x.value.trim() }; }); } @@ -368,7 +379,11 @@ export default class extends Endpoint { if (Object.keys(updates).includes('alsoKnownAs')) { this.cacheService.uriPersonCache.set(this.userEntityService.genLocalUserUri(user.id), { ...user, ...updates }); } - if (Object.keys(profileUpdates).length > 0) await this.userProfilesRepository.update(user.id, profileUpdates); + + await this.userProfilesRepository.update(user.id, { + ...profileUpdates, + verifiedLinks: [], + }); const iObj = await this.userEntityService.pack(user.id, user, { detail: true, @@ -390,7 +405,34 @@ export default class extends Endpoint { // フォロワーにUpdateを配信 this.accountUpdateService.publishToFollowers(user.id); + const urls = updatedProfile.fields.filter(x => x.value.startsWith('https://')); + for (const url of urls) { + this.verifyLink(url.value, user); + } + return iObj; }); } + + private async verifyLink(url: string, user: MiLocalUser) { + if (!safeForSql(url)) return; + + const html = await this.httpRequestService.getHtml(url); + + const { window } = new JSDOM(html); + const doc = window.document; + + const myLink = `${this.config.url}/@${user.username}`; + + const includesMyLink = Array.from(doc.getElementsByTagName('a')).some(a => a.href === myLink); + + if (includesMyLink) { + await this.userProfilesRepository.createQueryBuilder('profile').update() + .where('userId = :userId', { userId: user.id }) + .set({ + verifiedLinks: () => `array_append("verifiedLinks", '${url}')`, // ここでSQLインジェクションされそうなのでとりあえず safeForSql で弾いている + }) + .execute(); + } + } } diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/create.ts b/packages/backend/src/server/api/endpoints/i/webhooks/create.ts index 1eed84b7bf..9560054b41 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/create.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/create.ts @@ -6,8 +6,8 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { IdService } from '@/core/IdService.js'; -import type { WebhooksRepository } from '@/models/index.js'; -import { webhookEventTypes } from '@/models/entities/Webhook.js'; +import type { WebhooksRepository } from '@/models/_.js'; +import { webhookEventTypes } from '@/models/Webhook.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; @@ -35,19 +35,18 @@ export const paramDef = { properties: { name: { type: 'string', minLength: 1, maxLength: 100 }, url: { type: 'string', minLength: 1, maxLength: 1024 }, - secret: { type: 'string', minLength: 1, maxLength: 1024 }, + secret: { type: 'string', maxLength: 1024, default: '' }, on: { type: 'array', items: { type: 'string', enum: webhookEventTypes, } }, }, - required: ['name', 'url', 'secret', 'on'], + required: ['name', 'url', 'on'], } as const; // TODO: ロジックをサービスに切り出す -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.webhooksRepository) private webhooksRepository: WebhooksRepository, diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts b/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts index 32e38cd068..41cc675d0a 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { WebhooksRepository } from '@/models/index.js'; +import type { WebhooksRepository } from '@/models/_.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -37,9 +37,8 @@ export const paramDef = { // TODO: ロジックをサービスに切り出す -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.webhooksRepository) private webhooksRepository: WebhooksRepository, diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/list.ts b/packages/backend/src/server/api/endpoints/i/webhooks/list.ts index 7cf03bf25f..aa8921fe24 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/list.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/list.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { WebhooksRepository } from '@/models/index.js'; +import type { WebhooksRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -22,9 +22,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.webhooksRepository) private webhooksRepository: WebhooksRepository, diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/show.ts b/packages/backend/src/server/api/endpoints/i/webhooks/show.ts index fbeaa38f86..f1294bb5c8 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/show.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/show.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { WebhooksRepository } from '@/models/index.js'; +import type { WebhooksRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -33,9 +33,8 @@ export const paramDef = { required: ['webhookId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.webhooksRepository) private webhooksRepository: WebhooksRepository, diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/update.ts b/packages/backend/src/server/api/endpoints/i/webhooks/update.ts index 44df5f2da8..56418ceda4 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/update.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/update.ts @@ -5,8 +5,8 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { WebhooksRepository } from '@/models/index.js'; -import { webhookEventTypes } from '@/models/entities/Webhook.js'; +import type { WebhooksRepository } from '@/models/_.js'; +import { webhookEventTypes } from '@/models/Webhook.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -35,20 +35,19 @@ export const paramDef = { webhookId: { type: 'string', format: 'misskey:id' }, name: { type: 'string', minLength: 1, maxLength: 100 }, url: { type: 'string', minLength: 1, maxLength: 1024 }, - secret: { type: 'string', minLength: 1, maxLength: 1024 }, + secret: { type: 'string', maxLength: 1024, default: '' }, on: { type: 'array', items: { type: 'string', enum: webhookEventTypes, } }, active: { type: 'boolean' }, }, - required: ['webhookId', 'name', 'url', 'secret', 'on', 'active'], + required: ['webhookId', 'name', 'url', 'on', 'active'], } as const; // TODO: ロジックをサービスに切り出す -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.webhooksRepository) private webhooksRepository: WebhooksRepository, diff --git a/packages/backend/src/server/api/endpoints/invite/create.ts b/packages/backend/src/server/api/endpoints/invite/create.ts index eca3989ffc..7361ab616c 100644 --- a/packages/backend/src/server/api/endpoints/invite/create.ts +++ b/packages/backend/src/server/api/endpoints/invite/create.ts @@ -6,7 +6,7 @@ import { MoreThan } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistrationTicketsRepository } from '@/models/index.js'; +import type { RegistrationTicketsRepository } from '@/models/_.js'; import { InviteCodeEntityService } from '@/core/entities/InviteCodeEntityService.js'; import { IdService } from '@/core/IdService.js'; import { RoleService } from '@/core/RoleService.js'; @@ -47,9 +47,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registrationTicketsRepository) private registrationTicketsRepository: RegistrationTicketsRepository, diff --git a/packages/backend/src/server/api/endpoints/invite/delete.ts b/packages/backend/src/server/api/endpoints/invite/delete.ts index 901efd5237..3b57775739 100644 --- a/packages/backend/src/server/api/endpoints/invite/delete.ts +++ b/packages/backend/src/server/api/endpoints/invite/delete.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistrationTicketsRepository } from '@/models/index.js'; +import type { RegistrationTicketsRepository } from '@/models/_.js'; import { RoleService } from '@/core/RoleService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -45,9 +45,8 @@ export const paramDef = { required: ['inviteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registrationTicketsRepository) private registrationTicketsRepository: RegistrationTicketsRepository, diff --git a/packages/backend/src/server/api/endpoints/invite/limit.ts b/packages/backend/src/server/api/endpoints/invite/limit.ts index 87552ff5d3..43b94e4f06 100644 --- a/packages/backend/src/server/api/endpoints/invite/limit.ts +++ b/packages/backend/src/server/api/endpoints/invite/limit.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { MoreThan } from 'typeorm'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistrationTicketsRepository } from '@/models/index.js'; +import type { RegistrationTicketsRepository } from '@/models/_.js'; import { RoleService } from '@/core/RoleService.js'; import { DI } from '@/di-symbols.js'; @@ -34,9 +34,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registrationTicketsRepository) private registrationTicketsRepository: RegistrationTicketsRepository, diff --git a/packages/backend/src/server/api/endpoints/invite/list.ts b/packages/backend/src/server/api/endpoints/invite/list.ts index f4fa82bc83..06139b6806 100644 --- a/packages/backend/src/server/api/endpoints/invite/list.ts +++ b/packages/backend/src/server/api/endpoints/invite/list.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RegistrationTicketsRepository } from '@/models/index.js'; +import type { RegistrationTicketsRepository } from '@/models/_.js'; import { InviteCodeEntityService } from '@/core/entities/InviteCodeEntityService.js'; import { QueryService } from '@/core/QueryService.js'; import { DI } from '@/di-symbols.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.registrationTicketsRepository) private registrationTicketsRepository: RegistrationTicketsRepository, diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index f7d9194dc1..96c83c3926 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -6,7 +6,7 @@ import { IsNull, LessThanOrEqual, MoreThan, Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; import JSON5 from 'json5'; -import type { AdsRepository, UsersRepository } from '@/models/index.js'; +import type { AdsRepository, UsersRepository } from '@/models/_.js'; import { MAX_NOTE_TEXT_LENGTH } from '@/const.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; @@ -40,6 +40,10 @@ export const meta = { type: 'string', optional: false, nullable: false, }, + shortName: { + type: 'string', + optional: false, nullable: true, + }, uri: { type: 'string', optional: false, nullable: false, @@ -253,9 +257,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.config) private config: Config, @@ -289,6 +292,7 @@ export default class extends Endpoint { version: this.config.version, name: instance.name, + shortName: instance.shortName, uri: this.config.url, description: instance.description, langs: instance.langs, diff --git a/packages/backend/src/server/api/endpoints/miauth/gen-token.ts b/packages/backend/src/server/api/endpoints/miauth/gen-token.ts index a194b22fbf..e40656cb6d 100644 --- a/packages/backend/src/server/api/endpoints/miauth/gen-token.ts +++ b/packages/backend/src/server/api/endpoints/miauth/gen-token.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AccessTokensRepository } from '@/models/index.js'; +import type { AccessTokensRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { secureRndstr } from '@/misc/secure-rndstr.js'; import { DI } from '@/di-symbols.js'; @@ -43,9 +43,8 @@ export const paramDef = { required: ['session', 'permission'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.accessTokensRepository) private accessTokensRepository: AccessTokensRepository, diff --git a/packages/backend/src/server/api/endpoints/mute/create.ts b/packages/backend/src/server/api/endpoints/mute/create.ts index 351eb54bdd..f6a12de293 100644 --- a/packages/backend/src/server/api/endpoints/mute/create.ts +++ b/packages/backend/src/server/api/endpoints/mute/create.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import ms from 'ms'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { MutingsRepository } from '@/models/index.js'; +import type { MutingsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { GetterService } from '@/server/api/GetterService.js'; import { UserMutingService } from '@/core/UserMutingService.js'; @@ -61,9 +61,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.mutingsRepository) private mutingsRepository: MutingsRepository, diff --git a/packages/backend/src/server/api/endpoints/mute/delete.ts b/packages/backend/src/server/api/endpoints/mute/delete.ts index 7abbfd5011..e59332d940 100644 --- a/packages/backend/src/server/api/endpoints/mute/delete.ts +++ b/packages/backend/src/server/api/endpoints/mute/delete.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { MutingsRepository } from '@/models/index.js'; +import type { MutingsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { GetterService } from '@/server/api/GetterService.js'; import { UserMutingService } from '@/core/UserMutingService.js'; @@ -48,9 +48,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.mutingsRepository) private mutingsRepository: MutingsRepository, diff --git a/packages/backend/src/server/api/endpoints/mute/list.ts b/packages/backend/src/server/api/endpoints/mute/list.ts index b458c7fd70..2a41182ebc 100644 --- a/packages/backend/src/server/api/endpoints/mute/list.ts +++ b/packages/backend/src/server/api/endpoints/mute/list.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { MutingsRepository } from '@/models/index.js'; +import type { MutingsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { MutingEntityService } from '@/core/entities/MutingEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.mutingsRepository) private mutingsRepository: MutingsRepository, diff --git a/packages/backend/src/server/api/endpoints/my/apps.ts b/packages/backend/src/server/api/endpoints/my/apps.ts index 37562ab9ed..98c317346f 100644 --- a/packages/backend/src/server/api/endpoints/my/apps.ts +++ b/packages/backend/src/server/api/endpoints/my/apps.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AppsRepository } from '@/models/index.js'; +import type { AppsRepository } from '@/models/_.js'; import { AppEntityService } from '@/core/entities/AppEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -34,9 +34,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.appsRepository) private appsRepository: AppsRepository, diff --git a/packages/backend/src/server/api/endpoints/notes.ts b/packages/backend/src/server/api/endpoints/notes.ts index d40a3be7e8..497aa396ab 100644 --- a/packages/backend/src/server/api/endpoints/notes.ts +++ b/packages/backend/src/server/api/endpoints/notes.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository } from '@/models/index.js'; +import type { NotesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; @@ -39,9 +39,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/children.ts b/packages/backend/src/server/api/endpoints/notes/children.ts index c12af10a9d..1a82a4b5d7 100644 --- a/packages/backend/src/server/api/endpoints/notes/children.ts +++ b/packages/backend/src/server/api/endpoints/notes/children.ts @@ -5,7 +5,7 @@ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository } from '@/models/index.js'; +import type { NotesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/clips.ts b/packages/backend/src/server/api/endpoints/notes/clips.ts index de36180110..677c0ea307 100644 --- a/packages/backend/src/server/api/endpoints/notes/clips.ts +++ b/packages/backend/src/server/api/endpoints/notes/clips.ts @@ -5,7 +5,7 @@ import { In } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { ClipNotesRepository, ClipsRepository } from '@/models/index.js'; +import type { ClipNotesRepository, ClipsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { ClipEntityService } from '@/core/entities/ClipEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -44,9 +44,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.clipsRepository) private clipsRepository: ClipsRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/conversation.ts b/packages/backend/src/server/api/endpoints/notes/conversation.ts index 88bbf3a2ee..b94a019da4 100644 --- a/packages/backend/src/server/api/endpoints/notes/conversation.ts +++ b/packages/backend/src/server/api/endpoints/notes/conversation.ts @@ -4,8 +4,8 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { MiNote } from '@/models/entities/Note.js'; -import type { NotesRepository } from '@/models/index.js'; +import type { MiNote } from '@/models/Note.js'; +import type { NotesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -46,9 +46,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index 0ae22c6380..88ef5931cd 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -6,11 +6,11 @@ import ms from 'ms'; import { In } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { MiUser } from '@/models/entities/User.js'; -import type { UsersRepository, NotesRepository, BlockingsRepository, DriveFilesRepository, ChannelsRepository } from '@/models/index.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; -import type { MiNote } from '@/models/entities/Note.js'; -import type { MiChannel } from '@/models/entities/Channel.js'; +import type { MiUser } from '@/models/User.js'; +import type { UsersRepository, NotesRepository, BlockingsRepository, DriveFilesRepository, ChannelsRepository } from '@/models/_.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; +import type { MiNote } from '@/models/Note.js'; +import type { MiChannel } from '@/models/Channel.js'; import { MAX_NOTE_TEXT_LENGTH } from '@/const.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; @@ -163,9 +163,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -194,7 +193,7 @@ export default class extends Endpoint { } let files: MiDriveFile[] = []; - const fileIds = ps.fileIds != null ? ps.fileIds : ps.mediaIds != null ? ps.mediaIds : null; + const fileIds = ps.fileIds ?? ps.mediaIds ?? null; if (fileIds != null) { files = await this.driveFilesRepository.createQueryBuilder('file') .where('file.userId = :userId AND file.id IN (:...fileIds)', { diff --git a/packages/backend/src/server/api/endpoints/notes/delete.ts b/packages/backend/src/server/api/endpoints/notes/delete.ts index 55cc9ba0ab..f31a3c8808 100644 --- a/packages/backend/src/server/api/endpoints/notes/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/delete.ts @@ -5,7 +5,7 @@ import ms from 'ms'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteDeleteService } from '@/core/NoteDeleteService.js'; import { DI } from '@/di-symbols.js'; @@ -50,9 +50,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -72,7 +71,7 @@ export default class extends Endpoint { } // この操作を行うのが投稿者とは限らない(例えばモデレーター)ため - await this.noteDeleteService.delete(await this.usersRepository.findOneByOrFail({ id: note.userId }), note); + await this.noteDeleteService.delete(await this.usersRepository.findOneByOrFail({ id: note.userId }), note, false, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/notes/favorites/create.ts b/packages/backend/src/server/api/endpoints/notes/favorites/create.ts index 8eda9deb24..f5ca0a7061 100644 --- a/packages/backend/src/server/api/endpoints/notes/favorites/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/favorites/create.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import ms from 'ms'; -import type { NoteFavoritesRepository } from '@/models/index.js'; +import type { NoteFavoritesRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { GetterService } from '@/server/api/GetterService.js'; @@ -51,9 +51,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.noteFavoritesRepository) private noteFavoritesRepository: NoteFavoritesRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts b/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts index 6a55100fc6..758bcd51d0 100644 --- a/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts @@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { GetterService } from '@/server/api/GetterService.js'; import { DI } from '@/di-symbols.js'; -import type { NoteFavoritesRepository } from '@/models/index.js'; +import type { NoteFavoritesRepository } from '@/models/_.js'; import { ApiError } from '../../../error.js'; export const meta = { @@ -41,9 +41,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.noteFavoritesRepository) private noteFavoritesRepository: NoteFavoritesRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/featured.ts b/packages/backend/src/server/api/endpoints/notes/featured.ts index 5ff9c916dc..5283b0e0bc 100644 --- a/packages/backend/src/server/api/endpoints/notes/featured.ts +++ b/packages/backend/src/server/api/endpoints/notes/featured.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository } from '@/models/index.js'; +import type { NotesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts index 1a6465779f..0b3b5c902e 100644 --- a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts @@ -4,11 +4,10 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository } from '@/models/index.js'; +import type { NotesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; -import { MetaService } from '@/core/MetaService.js'; import ActiveUsersChart from '@/core/chart/charts/active-users.js'; import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; @@ -50,16 +49,14 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, private noteEntityService: NoteEntityService, private queryService: QueryService, - private metaService: MetaService, private roleService: RoleService, private activeUsersChart: ActiveUsersChart, ) { diff --git a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts index e121ac6bac..e9ae5dc755 100644 --- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -5,11 +5,10 @@ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository, FollowingsRepository } from '@/models/index.js'; +import type { NotesRepository, FollowingsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import ActiveUsersChart from '@/core/chart/charts/active-users.js'; -import { MetaService } from '@/core/MetaService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; @@ -57,9 +56,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, @@ -69,7 +67,6 @@ export default class extends Endpoint { private noteEntityService: NoteEntityService, private queryService: QueryService, - private metaService: MetaService, private roleService: RoleService, private activeUsersChart: ActiveUsersChart, private idService: IdService, diff --git a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts index d843334c3b..af1e0398dc 100644 --- a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts @@ -5,11 +5,10 @@ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository } from '@/models/index.js'; +import type { NotesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; -import { MetaService } from '@/core/MetaService.js'; import ActiveUsersChart from '@/core/chart/charts/active-users.js'; import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; @@ -56,16 +55,14 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, private noteEntityService: NoteEntityService, private queryService: QueryService, - private metaService: MetaService, private roleService: RoleService, private activeUsersChart: ActiveUsersChart, private idService: IdService, diff --git a/packages/backend/src/server/api/endpoints/notes/mentions.ts b/packages/backend/src/server/api/endpoints/notes/mentions.ts index 6c2900a706..65e7bd8cd5 100644 --- a/packages/backend/src/server/api/endpoints/notes/mentions.ts +++ b/packages/backend/src/server/api/endpoints/notes/mentions.ts @@ -5,7 +5,7 @@ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository, FollowingsRepository } from '@/models/index.js'; +import type { NotesRepository, FollowingsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; @@ -40,9 +40,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, @@ -64,6 +63,8 @@ export default class extends Endpoint { .where(`'{"${me.id}"}' <@ note.mentions`) .orWhere(`'{"${me.id}"}' <@ note.visibleUserIds`); })) + // Avoid scanning primary key index + .orderBy('CONCAT(note.id)', 'DESC') .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('note.reply', 'reply') .leftJoinAndSelect('note.renote', 'renote') diff --git a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts index 9802ae0cab..29190af62a 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts @@ -5,7 +5,7 @@ import { Brackets, In } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository, MutingsRepository, PollsRepository, PollVotesRepository } from '@/models/index.js'; +import type { NotesRepository, MutingsRepository, PollsRepository, PollVotesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -35,9 +35,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/polls/vote.ts b/packages/backend/src/server/api/endpoints/notes/polls/vote.ts index b576123f21..0fc7c2d0c4 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/vote.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/vote.ts @@ -4,8 +4,8 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository, PollsRepository, PollVotesRepository } from '@/models/index.js'; -import type { MiRemoteUser } from '@/models/entities/User.js'; +import type { UsersRepository, PollsRepository, PollVotesRepository } from '@/models/_.js'; +import type { MiRemoteUser } from '@/models/User.js'; import { IdService } from '@/core/IdService.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { GetterService } from '@/server/api/GetterService.js'; @@ -77,9 +77,8 @@ export const paramDef = { // TODO: ロジックをサービスに切り出す -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/reactions.ts b/packages/backend/src/server/api/endpoints/notes/reactions.ts index 1304fe638e..8e9ac6b786 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions.ts @@ -4,12 +4,13 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { NoteReactionsRepository } from '@/models/index.js'; -import type { MiNoteReaction } from '@/models/entities/NoteReaction.js'; +import { Brackets, type FindOptionsWhere } from 'typeorm'; +import type { NoteReactionsRepository } from '@/models/_.js'; +import type { MiNoteReaction } from '@/models/NoteReaction.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteReactionEntityService } from '@/core/entities/NoteReactionEntityService.js'; import { DI } from '@/di-symbols.js'; -import type { FindOptionsWhere } from 'typeorm'; +import { QueryService } from '@/core/QueryService.js'; export const meta = { tags: ['notes', 'reactions'], @@ -44,44 +45,36 @@ export const paramDef = { noteId: { type: 'string', format: 'misskey:id' }, type: { type: 'string', nullable: true }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, - offset: { type: 'integer', default: 0 }, sinceId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' }, }, required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.noteReactionsRepository) private noteReactionsRepository: NoteReactionsRepository, private noteReactionEntityService: NoteReactionEntityService, + private queryService: QueryService, ) { super(meta, paramDef, async (ps, me) => { - const query = { - noteId: ps.noteId, - } as FindOptionsWhere; + const query = this.queryService.makePaginationQuery(this.noteReactionsRepository.createQueryBuilder('reaction'), ps.sinceId, ps.untilId) + .andWhere('reaction.noteId = :noteId', { noteId: ps.noteId }) + .leftJoinAndSelect('reaction.user', 'user') + .leftJoinAndSelect('reaction.note', 'note'); if (ps.type) { // ローカルリアクションはホスト名が . とされているが // DB 上ではそうではないので、必要に応じて変換 const suffix = '@.:'; const type = ps.type.endsWith(suffix) ? ps.type.slice(0, ps.type.length - suffix.length) + ':' : ps.type; - query.reaction = type; + query.andWhere('reaction.reaction = :type', { type }); } - const reactions = await this.noteReactionsRepository.find({ - where: query, - take: ps.limit, - skip: ps.offset, - order: { - id: -1, - }, - relations: ['user', 'note'], - }); + const reactions = await query.limit(ps.limit).getMany(); return await this.noteReactionEntityService.packMany(reactions, me); }); diff --git a/packages/backend/src/server/api/endpoints/notes/reactions/create.ts b/packages/backend/src/server/api/endpoints/notes/reactions/create.ts index 9a947cf5b1..3179f90930 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/create.ts @@ -49,9 +49,8 @@ export const paramDef = { required: ['noteId', 'reaction'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private getterService: GetterService, private reactionService: ReactionService, diff --git a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts index 4761c01d6d..a3ee086a20 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts @@ -47,9 +47,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private getterService: GetterService, private reactionService: ReactionService, diff --git a/packages/backend/src/server/api/endpoints/notes/renotes.ts b/packages/backend/src/server/api/endpoints/notes/renotes.ts index c5c2bc227d..9f16181a30 100644 --- a/packages/backend/src/server/api/endpoints/notes/renotes.ts +++ b/packages/backend/src/server/api/endpoints/notes/renotes.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository } from '@/models/index.js'; +import type { NotesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; @@ -47,9 +47,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/replies.ts b/packages/backend/src/server/api/endpoints/notes/replies.ts index 706e65fc78..70142c9818 100644 --- a/packages/backend/src/server/api/endpoints/notes/replies.ts +++ b/packages/backend/src/server/api/endpoints/notes/replies.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository } from '@/models/index.js'; +import type { NotesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts index 94ab6a4f26..b00f5207d8 100644 --- a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts +++ b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts @@ -5,7 +5,7 @@ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository } from '@/models/index.js'; +import type { NotesRepository } from '@/models/_.js'; import { safeForSql } from '@/misc/safe-for-sql.js'; import { normalizeForSearch } from '@/misc/normalize-for-search.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; @@ -63,9 +63,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/search.ts b/packages/backend/src/server/api/endpoints/notes/search.ts index c7a36d8309..4425d4593c 100644 --- a/packages/backend/src/server/api/endpoints/notes/search.ts +++ b/packages/backend/src/server/api/endpoints/notes/search.ts @@ -3,13 +3,10 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository } from '@/models/index.js'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { SearchService } from '@/core/SearchService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; -import type { Config } from '@/config.js'; -import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; import { ApiError } from '../../error.js'; @@ -57,13 +54,9 @@ export const paramDef = { // TODO: ロジックをサービスに切り出す -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.config) - private config: Config, - private noteEntityService: NoteEntityService, private searchService: SearchService, private roleService: RoleService, diff --git a/packages/backend/src/server/api/endpoints/notes/show.ts b/packages/backend/src/server/api/endpoints/notes/show.ts index 0c3c4bf05d..5bb8196543 100644 --- a/packages/backend/src/server/api/endpoints/notes/show.ts +++ b/packages/backend/src/server/api/endpoints/notes/show.ts @@ -3,11 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository } from '@/models/index.js'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; -import { DI } from '@/di-symbols.js'; import { GetterService } from '@/server/api/GetterService.js'; import { ApiError } from '../../error.js'; @@ -39,13 +37,9 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.notesRepository) - private notesRepository: NotesRepository, - private noteEntityService: NoteEntityService, private getterService: GetterService, ) { diff --git a/packages/backend/src/server/api/endpoints/notes/state.ts b/packages/backend/src/server/api/endpoints/notes/state.ts index b95e966de4..b5fd47723c 100644 --- a/packages/backend/src/server/api/endpoints/notes/state.ts +++ b/packages/backend/src/server/api/endpoints/notes/state.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository, NoteThreadMutingsRepository, NoteFavoritesRepository } from '@/models/index.js'; +import type { NotesRepository, NoteThreadMutingsRepository, NoteFavoritesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts index 649a87cb0a..aa99a928c6 100644 --- a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import ms from 'ms'; -import type { NotesRepository, NoteThreadMutingsRepository } from '@/models/index.js'; +import type { NotesRepository, NoteThreadMutingsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { GetterService } from '@/server/api/GetterService.js'; @@ -43,9 +43,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts b/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts index 431a5e5c89..f1ec139cac 100644 --- a/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { NoteThreadMutingsRepository } from '@/models/index.js'; +import type { NoteThreadMutingsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { GetterService } from '@/server/api/GetterService.js'; import { DI } from '@/di-symbols.js'; @@ -35,9 +35,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.noteThreadMutingsRepository) private noteThreadMutingsRepository: NoteThreadMutingsRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index 0d61ef9813..042115ab84 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -5,7 +5,7 @@ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository, FollowingsRepository } from '@/models/index.js'; +import type { NotesRepository, FollowingsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import ActiveUsersChart from '@/core/chart/charts/active-users.js'; @@ -46,9 +46,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, @@ -70,7 +69,8 @@ export default class extends Endpoint { //#region Construct query const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere('note.id > :minId', { minId: this.idService.genId(new Date(Date.now() - (1000 * 60 * 60 * 24 * 10))) }) // 10日前まで + // パフォーマンス上の利点が無さそう? + //.andWhere('note.id > :minId', { minId: this.idService.genId(new Date(Date.now() - (1000 * 60 * 60 * 24 * 10))) }) // 10日前まで .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('note.reply', 'reply') .leftJoinAndSelect('note.renote', 'renote') diff --git a/packages/backend/src/server/api/endpoints/notes/translate.ts b/packages/backend/src/server/api/endpoints/notes/translate.ts index 14b917ab0b..00cb9a0a28 100644 --- a/packages/backend/src/server/api/endpoints/notes/translate.ts +++ b/packages/backend/src/server/api/endpoints/notes/translate.ts @@ -4,11 +4,8 @@ */ import { URLSearchParams } from 'node:url'; -import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository } from '@/models/index.js'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { Config } from '@/config.js'; -import { DI } from '@/di-symbols.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { MetaService } from '@/core/MetaService.js'; import { HttpRequestService } from '@/core/HttpRequestService.js'; @@ -43,16 +40,9 @@ export const paramDef = { required: ['noteId', 'targetLang'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.config) - private config: Config, - - @Inject(DI.notesRepository) - private notesRepository: NotesRepository, - private noteEntityService: NoteEntityService, private getterService: GetterService, private metaService: MetaService, diff --git a/packages/backend/src/server/api/endpoints/notes/unrenote.ts b/packages/backend/src/server/api/endpoints/notes/unrenote.ts index e26ff90ac6..3d10751781 100644 --- a/packages/backend/src/server/api/endpoints/notes/unrenote.ts +++ b/packages/backend/src/server/api/endpoints/notes/unrenote.ts @@ -5,7 +5,7 @@ import ms from 'ms'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository, NotesRepository } from '@/models/index.js'; +import type { UsersRepository, NotesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteDeleteService } from '@/core/NoteDeleteService.js'; import { DI } from '@/di-symbols.js'; @@ -43,9 +43,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts index d4ec328721..6932073791 100644 --- a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts @@ -5,7 +5,7 @@ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository, UserListsRepository, UserListJoiningsRepository } from '@/models/index.js'; +import type { NotesRepository, UserListsRepository, UserListJoiningsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; @@ -58,9 +58,8 @@ export const paramDef = { required: ['listId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/server/api/endpoints/notifications/create.ts b/packages/backend/src/server/api/endpoints/notifications/create.ts index 9c98bf5b88..268628cf76 100644 --- a/packages/backend/src/server/api/endpoints/notifications/create.ts +++ b/packages/backend/src/server/api/endpoints/notifications/create.ts @@ -14,6 +14,11 @@ export const meta = { kind: 'write:notifications', + limit: { + duration: 1000 * 60, + max: 10, + }, + errors: { }, } as const; @@ -28,9 +33,8 @@ export const paramDef = { required: ['body'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private notificationService: NotificationService, ) { diff --git a/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts b/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts index 46e3d40e9e..dc092c1f3a 100644 --- a/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts +++ b/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts @@ -3,9 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import { DI } from '@/di-symbols.js'; import { NotificationService } from '@/core/NotificationService.js'; export const meta = { @@ -22,9 +21,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private notificationService: NotificationService, ) { diff --git a/packages/backend/src/server/api/endpoints/notifications/test-notification.ts b/packages/backend/src/server/api/endpoints/notifications/test-notification.ts new file mode 100644 index 0000000000..8f5f8485c3 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/notifications/test-notification.ts @@ -0,0 +1,38 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { Injectable } from '@nestjs/common'; +import { Endpoint } from '@/server/api/endpoint-base.js'; +import { NotificationService } from '@/core/NotificationService.js'; + +export const meta = { + tags: ['notifications'], + + requireCredential: true, + + kind: 'write:notifications', + + limit: { + duration: 1000 * 60, + max: 10, + }, +} as const; + +export const paramDef = { + type: 'object', + properties: {}, + required: [], +} as const; + +@Injectable() +export default class extends Endpoint { // eslint-disable-line import/no-default-export + constructor( + private notificationService: NotificationService, + ) { + super(meta, paramDef, async (ps, user) => { + this.notificationService.createNotification(user.id, 'test', {}); + }); + } +} diff --git a/packages/backend/src/server/api/endpoints/page-push.ts b/packages/backend/src/server/api/endpoints/page-push.ts index cbb45ca60d..0a68516586 100644 --- a/packages/backend/src/server/api/endpoints/page-push.ts +++ b/packages/backend/src/server/api/endpoints/page-push.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { PagesRepository } from '@/models/index.js'; +import type { PagesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; @@ -34,9 +34,8 @@ export const paramDef = { required: ['pageId', 'event'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.pagesRepository) private pagesRepository: PagesRepository, diff --git a/packages/backend/src/server/api/endpoints/pages/create.ts b/packages/backend/src/server/api/endpoints/pages/create.ts index 6a5a760930..73e4fa338f 100644 --- a/packages/backend/src/server/api/endpoints/pages/create.ts +++ b/packages/backend/src/server/api/endpoints/pages/create.ts @@ -5,9 +5,9 @@ import ms from 'ms'; import { Inject, Injectable } from '@nestjs/common'; -import type { DriveFilesRepository, PagesRepository } from '@/models/index.js'; +import type { DriveFilesRepository, PagesRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; -import { MiPage } from '@/models/entities/Page.js'; +import { MiPage } from '@/models/Page.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { PageEntityService } from '@/core/entities/PageEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -69,9 +69,8 @@ export const paramDef = { required: ['title', 'name', 'content', 'variables', 'script'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.pagesRepository) private pagesRepository: PagesRepository, diff --git a/packages/backend/src/server/api/endpoints/pages/delete.ts b/packages/backend/src/server/api/endpoints/pages/delete.ts index 8030b2dd57..2d18e84fde 100644 --- a/packages/backend/src/server/api/endpoints/pages/delete.ts +++ b/packages/backend/src/server/api/endpoints/pages/delete.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { PagesRepository } from '@/models/index.js'; +import type { PagesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -40,9 +40,8 @@ export const paramDef = { required: ['pageId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.pagesRepository) private pagesRepository: PagesRepository, diff --git a/packages/backend/src/server/api/endpoints/pages/featured.ts b/packages/backend/src/server/api/endpoints/pages/featured.ts index 386fdc0d1a..1f43d6606c 100644 --- a/packages/backend/src/server/api/endpoints/pages/featured.ts +++ b/packages/backend/src/server/api/endpoints/pages/featured.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { PagesRepository } from '@/models/index.js'; +import type { PagesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { PageEntityService } from '@/core/entities/PageEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -31,9 +31,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.pagesRepository) private pagesRepository: PagesRepository, diff --git a/packages/backend/src/server/api/endpoints/pages/like.ts b/packages/backend/src/server/api/endpoints/pages/like.ts index 5a29491ae7..5ceb4c27d2 100644 --- a/packages/backend/src/server/api/endpoints/pages/like.ts +++ b/packages/backend/src/server/api/endpoints/pages/like.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { PagesRepository, PageLikesRepository } from '@/models/index.js'; +import type { PagesRepository, PageLikesRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -49,9 +49,8 @@ export const paramDef = { required: ['pageId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.pagesRepository) private pagesRepository: PagesRepository, diff --git a/packages/backend/src/server/api/endpoints/pages/show.ts b/packages/backend/src/server/api/endpoints/pages/show.ts index 652a4faef1..efb0bd0677 100644 --- a/packages/backend/src/server/api/endpoints/pages/show.ts +++ b/packages/backend/src/server/api/endpoints/pages/show.ts @@ -5,8 +5,8 @@ import { IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository, PagesRepository } from '@/models/index.js'; -import type { MiPage } from '@/models/entities/Page.js'; +import type { UsersRepository, PagesRepository } from '@/models/_.js'; +import type { MiPage } from '@/models/Page.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { PageEntityService } from '@/core/entities/PageEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -45,9 +45,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/pages/unlike.ts b/packages/backend/src/server/api/endpoints/pages/unlike.ts index eace5b1b83..d947cb3609 100644 --- a/packages/backend/src/server/api/endpoints/pages/unlike.ts +++ b/packages/backend/src/server/api/endpoints/pages/unlike.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { PagesRepository, PageLikesRepository } from '@/models/index.js'; +import type { PagesRepository, PageLikesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -42,9 +42,8 @@ export const paramDef = { required: ['pageId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.pagesRepository) private pagesRepository: PagesRepository, diff --git a/packages/backend/src/server/api/endpoints/pages/update.ts b/packages/backend/src/server/api/endpoints/pages/update.ts index a0d7f32acb..3e0131f85a 100644 --- a/packages/backend/src/server/api/endpoints/pages/update.ts +++ b/packages/backend/src/server/api/endpoints/pages/update.ts @@ -6,7 +6,7 @@ import ms from 'ms'; import { Not } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { PagesRepository, DriveFilesRepository } from '@/models/index.js'; +import type { PagesRepository, DriveFilesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -74,9 +74,8 @@ export const paramDef = { required: ['pageId', 'title', 'name', 'content', 'variables', 'script'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.pagesRepository) private pagesRepository: PagesRepository, @@ -118,13 +117,17 @@ export default class extends Endpoint { await this.pagesRepository.update(page.id, { updatedAt: new Date(), title: ps.title, + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing name: ps.name === undefined ? page.name : ps.name, summary: ps.summary === undefined ? page.summary : ps.summary, content: ps.content, variables: ps.variables, script: ps.script, + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing alignCenter: ps.alignCenter === undefined ? page.alignCenter : ps.alignCenter, + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing hideTitleWhenPinned: ps.hideTitleWhenPinned === undefined ? page.hideTitleWhenPinned : ps.hideTitleWhenPinned, + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing font: ps.font === undefined ? page.font : ps.font, eyeCatchingImageId: ps.eyeCatchingImageId === null ? null diff --git a/packages/backend/src/server/api/endpoints/ping.ts b/packages/backend/src/server/api/endpoints/ping.ts index 65f4d69a35..ee2fe48834 100644 --- a/packages/backend/src/server/api/endpoints/ping.ts +++ b/packages/backend/src/server/api/endpoints/ping.ts @@ -29,9 +29,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( ) { super(meta, paramDef, async () => { diff --git a/packages/backend/src/server/api/endpoints/pinned-users.ts b/packages/backend/src/server/api/endpoints/pinned-users.ts index 74ac6bbee4..390042c815 100644 --- a/packages/backend/src/server/api/endpoints/pinned-users.ts +++ b/packages/backend/src/server/api/endpoints/pinned-users.ts @@ -5,9 +5,9 @@ import { IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import * as Acct from '@/misc/acct.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { MetaService } from '@/core/MetaService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; @@ -35,9 +35,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/promo/read.ts b/packages/backend/src/server/api/endpoints/promo/read.ts index 4c99f14bd4..b197756acc 100644 --- a/packages/backend/src/server/api/endpoints/promo/read.ts +++ b/packages/backend/src/server/api/endpoints/promo/read.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { PromoReadsRepository } from '@/models/index.js'; +import type { PromoReadsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -33,9 +33,8 @@ export const paramDef = { required: ['noteId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.promoReadsRepository) private promoReadsRepository: PromoReadsRepository, diff --git a/packages/backend/src/server/api/endpoints/renote-mute/create.ts b/packages/backend/src/server/api/endpoints/renote-mute/create.ts index 554baafd18..e0d514b18a 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/create.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/create.ts @@ -7,9 +7,8 @@ import { Inject, Injectable } from '@nestjs/common'; import ms from 'ms'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { IdService } from '@/core/IdService.js'; -import type { RenoteMutingsRepository } from '@/models/index.js'; -import type { MiRenoteMuting } from '@/models/entities/RenoteMuting.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; +import type { RenoteMutingsRepository } from '@/models/_.js'; +import type { MiRenoteMuting } from '@/models/RenoteMuting.js'; import { DI } from '@/di-symbols.js'; import { GetterService } from '@/server/api/GetterService.js'; import { ApiError } from '../../error.js'; @@ -58,14 +57,12 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.renoteMutingsRepository) private renoteMutingsRepository: RenoteMutingsRepository, - private globalEventService: GlobalEventService, private getterService: GetterService, private idService: IdService, ) { diff --git a/packages/backend/src/server/api/endpoints/renote-mute/delete.ts b/packages/backend/src/server/api/endpoints/renote-mute/delete.ts index 197d210496..e0d7a8e35d 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/delete.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/delete.ts @@ -5,8 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RenoteMutingsRepository } from '@/models/index.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; +import type { RenoteMutingsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { GetterService } from '@/server/api/GetterService.js'; import { ApiError } from '../../error.js'; @@ -48,14 +47,12 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.renoteMutingsRepository) private renoteMutingsRepository: RenoteMutingsRepository, - private globalEventService: GlobalEventService, private getterService: GetterService, ) { super(meta, paramDef, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/renote-mute/list.ts b/packages/backend/src/server/api/endpoints/renote-mute/list.ts index c7da5479ed..493593ae2d 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/list.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/list.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RenoteMutingsRepository } from '@/models/index.js'; +import type { RenoteMutingsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { RenoteMutingEntityService } from '@/core/entities/RenoteMutingEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -38,9 +38,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.renoteMutingsRepository) private renoteMutingsRepository: RenoteMutingsRepository, diff --git a/packages/backend/src/server/api/endpoints/request-reset-password.ts b/packages/backend/src/server/api/endpoints/request-reset-password.ts index 2e1085f78e..adb160c58b 100644 --- a/packages/backend/src/server/api/endpoints/request-reset-password.ts +++ b/packages/backend/src/server/api/endpoints/request-reset-password.ts @@ -6,7 +6,7 @@ import ms from 'ms'; import { IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { PasswordResetRequestsRepository, UserProfilesRepository, UsersRepository } from '@/models/index.js'; +import type { PasswordResetRequestsRepository, UserProfilesRepository, UsersRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { IdService } from '@/core/IdService.js'; import type { Config } from '@/config.js'; @@ -40,9 +40,8 @@ export const paramDef = { required: ['username', 'email'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.config) private config: Config, diff --git a/packages/backend/src/server/api/endpoints/reset-db.ts b/packages/backend/src/server/api/endpoints/reset-db.ts index dcf3b8772a..0eeee81580 100644 --- a/packages/backend/src/server/api/endpoints/reset-db.ts +++ b/packages/backend/src/server/api/endpoints/reset-db.ts @@ -28,9 +28,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.db) private db: DataSource, diff --git a/packages/backend/src/server/api/endpoints/reset-password.ts b/packages/backend/src/server/api/endpoints/reset-password.ts index 4bbd3d0ef1..1858c922a0 100644 --- a/packages/backend/src/server/api/endpoints/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/reset-password.ts @@ -5,7 +5,7 @@ import bcrypt from 'bcryptjs'; import { Inject, Injectable } from '@nestjs/common'; -import type { UserProfilesRepository, PasswordResetRequestsRepository } from '@/models/index.js'; +import type { UserProfilesRepository, PasswordResetRequestsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -30,9 +30,8 @@ export const paramDef = { required: ['token', 'password'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.passwordResetRequestsRepository) private passwordResetRequestsRepository: PasswordResetRequestsRepository, diff --git a/packages/backend/src/server/api/endpoints/retention.ts b/packages/backend/src/server/api/endpoints/retention.ts index 34e584b985..dac6d65407 100644 --- a/packages/backend/src/server/api/endpoints/retention.ts +++ b/packages/backend/src/server/api/endpoints/retention.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { RetentionAggregationsRepository } from '@/models/index.js'; +import type { RetentionAggregationsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -26,9 +26,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.retentionAggregationsRepository) private retentionAggregationsRepository: RetentionAggregationsRepository, diff --git a/packages/backend/src/server/api/endpoints/roles/list.ts b/packages/backend/src/server/api/endpoints/roles/list.ts index ee17b46a2a..d1de73ad32 100644 --- a/packages/backend/src/server/api/endpoints/roles/list.ts +++ b/packages/backend/src/server/api/endpoints/roles/list.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RolesRepository } from '@/models/index.js'; +import type { RolesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { RoleEntityService } from '@/core/entities/RoleEntityService.js'; @@ -23,9 +23,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.rolesRepository) private rolesRepository: RolesRepository, diff --git a/packages/backend/src/server/api/endpoints/roles/notes.ts b/packages/backend/src/server/api/endpoints/roles/notes.ts index fe0354d545..6dc35907e1 100644 --- a/packages/backend/src/server/api/endpoints/roles/notes.ts +++ b/packages/backend/src/server/api/endpoints/roles/notes.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import * as Redis from 'ioredis'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { NotesRepository, RolesRepository } from '@/models/index.js'; +import type { NotesRepository, RolesRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { DI } from '@/di-symbols.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; @@ -50,9 +50,8 @@ export const paramDef = { required: ['roleId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.redis) private redisClient: Redis.Redis, diff --git a/packages/backend/src/server/api/endpoints/roles/show.ts b/packages/backend/src/server/api/endpoints/roles/show.ts index 742c6f950d..2afa0e7b7f 100644 --- a/packages/backend/src/server/api/endpoints/roles/show.ts +++ b/packages/backend/src/server/api/endpoints/roles/show.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { RolesRepository } from '@/models/index.js'; +import type { RolesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { RoleEntityService } from '@/core/entities/RoleEntityService.js'; @@ -32,9 +32,8 @@ export const paramDef = { required: ['roleId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.rolesRepository) private rolesRepository: RolesRepository, diff --git a/packages/backend/src/server/api/endpoints/roles/users.ts b/packages/backend/src/server/api/endpoints/roles/users.ts index 4bb962c4a6..37aac908b5 100644 --- a/packages/backend/src/server/api/endpoints/roles/users.ts +++ b/packages/backend/src/server/api/endpoints/roles/users.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Brackets } from 'typeorm'; -import type { RoleAssignmentsRepository, RolesRepository } from '@/models/index.js'; +import type { RoleAssignmentsRepository, RolesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { DI } from '@/di-symbols.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: ['roleId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.rolesRepository) private rolesRepository: RolesRepository, diff --git a/packages/backend/src/server/api/endpoints/server-info.ts b/packages/backend/src/server/api/endpoints/server-info.ts index 4c1e781513..c8cb63e6b3 100644 --- a/packages/backend/src/server/api/endpoints/server-info.ts +++ b/packages/backend/src/server/api/endpoints/server-info.ts @@ -23,9 +23,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private metaService: MetaService, ) { diff --git a/packages/backend/src/server/api/endpoints/stats.ts b/packages/backend/src/server/api/endpoints/stats.ts index 3c79f21e24..05468240d3 100644 --- a/packages/backend/src/server/api/endpoints/stats.ts +++ b/packages/backend/src/server/api/endpoints/stats.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { InstancesRepository, NoteReactionsRepository, NotesRepository, UsersRepository } from '@/models/index.js'; +import type { InstancesRepository, NoteReactionsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import NotesChart from '@/core/chart/charts/notes.js'; @@ -57,16 +57,9 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - - @Inject(DI.notesRepository) - private notesRepository: NotesRepository, - @Inject(DI.instancesRepository) private instancesRepository: InstancesRepository, diff --git a/packages/backend/src/server/api/endpoints/sw/register.ts b/packages/backend/src/server/api/endpoints/sw/register.ts index 7a979ea306..5cfbeab73f 100644 --- a/packages/backend/src/server/api/endpoints/sw/register.ts +++ b/packages/backend/src/server/api/endpoints/sw/register.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { IdService } from '@/core/IdService.js'; -import type { SwSubscriptionsRepository } from '@/models/index.js'; +import type { SwSubscriptionsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { MetaService } from '@/core/MetaService.js'; import { DI } from '@/di-symbols.js'; @@ -57,9 +57,8 @@ export const paramDef = { required: ['endpoint', 'auth', 'publickey'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.swSubscriptionsRepository) private swSubscriptionsRepository: SwSubscriptionsRepository, diff --git a/packages/backend/src/server/api/endpoints/sw/show-registration.ts b/packages/backend/src/server/api/endpoints/sw/show-registration.ts index 90800f4b64..126299e3f7 100644 --- a/packages/backend/src/server/api/endpoints/sw/show-registration.ts +++ b/packages/backend/src/server/api/endpoints/sw/show-registration.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { SwSubscriptionsRepository } from '@/models/index.js'; +import type { SwSubscriptionsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -43,9 +43,8 @@ export const paramDef = { required: ['endpoint'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.swSubscriptionsRepository) private swSubscriptionsRepository: SwSubscriptionsRepository, diff --git a/packages/backend/src/server/api/endpoints/sw/unregister.ts b/packages/backend/src/server/api/endpoints/sw/unregister.ts index 7b948988a6..f00fdd6697 100644 --- a/packages/backend/src/server/api/endpoints/sw/unregister.ts +++ b/packages/backend/src/server/api/endpoints/sw/unregister.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { SwSubscriptionsRepository } from '@/models/index.js'; +import type { SwSubscriptionsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -24,9 +24,8 @@ export const paramDef = { required: ['endpoint'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.swSubscriptionsRepository) private swSubscriptionsRepository: SwSubscriptionsRepository, diff --git a/packages/backend/src/server/api/endpoints/sw/update-registration.ts b/packages/backend/src/server/api/endpoints/sw/update-registration.ts index 061d180f57..a1a97df0be 100644 --- a/packages/backend/src/server/api/endpoints/sw/update-registration.ts +++ b/packages/backend/src/server/api/endpoints/sw/update-registration.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { SwSubscriptionsRepository } from '@/models/index.js'; +import type { SwSubscriptionsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../error.js'; @@ -52,9 +52,8 @@ export const paramDef = { required: ['endpoint'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.swSubscriptionsRepository) private swSubscriptionsRepository: SwSubscriptionsRepository, diff --git a/packages/backend/src/server/api/endpoints/test.ts b/packages/backend/src/server/api/endpoints/test.ts index c8d6cfecba..6d6d44f752 100644 --- a/packages/backend/src/server/api/endpoints/test.ts +++ b/packages/backend/src/server/api/endpoints/test.ts @@ -26,9 +26,8 @@ export const paramDef = { required: ['required'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( ) { super(meta, paramDef, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/username/available.ts b/packages/backend/src/server/api/endpoints/username/available.ts index 38036a3244..e37df62c0c 100644 --- a/packages/backend/src/server/api/endpoints/username/available.ts +++ b/packages/backend/src/server/api/endpoints/username/available.ts @@ -5,9 +5,9 @@ import { IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsedUsernamesRepository, UsersRepository } from '@/models/index.js'; +import type { UsedUsernamesRepository, UsersRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import { localUsernameSchema } from '@/models/entities/User.js'; +import { localUsernameSchema } from '@/models/User.js'; import { DI } from '@/di-symbols.js'; import { MetaService } from '@/core/MetaService.js'; @@ -36,9 +36,8 @@ export const paramDef = { required: ['username'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/users.ts b/packages/backend/src/server/api/endpoints/users.ts index 95ff7c9759..21c585f1ad 100644 --- a/packages/backend/src/server/api/endpoints/users.ts +++ b/packages/backend/src/server/api/endpoints/users.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository } from '@/models/index.js'; +import type { UsersRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; @@ -44,9 +44,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/users/achievements.ts b/packages/backend/src/server/api/endpoints/users/achievements.ts index 0eaff724b1..e4845d57bf 100644 --- a/packages/backend/src/server/api/endpoints/users/achievements.ts +++ b/packages/backend/src/server/api/endpoints/users/achievements.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UserProfilesRepository } from '@/models/index.js'; +import type { UserProfilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -20,9 +20,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, diff --git a/packages/backend/src/server/api/endpoints/users/clips.ts b/packages/backend/src/server/api/endpoints/users/clips.ts index 747f15f394..725e07db39 100644 --- a/packages/backend/src/server/api/endpoints/users/clips.ts +++ b/packages/backend/src/server/api/endpoints/users/clips.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { ClipsRepository } from '@/models/index.js'; +import type { ClipsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { ClipEntityService } from '@/core/entities/ClipEntityService.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.clipsRepository) private clipsRepository: ClipsRepository, diff --git a/packages/backend/src/server/api/endpoints/users/flashs.ts b/packages/backend/src/server/api/endpoints/users/flashs.ts new file mode 100644 index 0000000000..18026dcefb --- /dev/null +++ b/packages/backend/src/server/api/endpoints/users/flashs.ts @@ -0,0 +1,62 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { Inject, Injectable } from '@nestjs/common'; +import { Endpoint } from '@/server/api/endpoint-base.js'; +import { QueryService } from '@/core/QueryService.js'; +import { FlashEntityService } from '@/core/entities/FlashEntityService.js'; +import type { FlashsRepository } from '@/models/_.js'; +import { DI } from '@/di-symbols.js'; + +export const meta = { + tags: ['users', 'flashs'], + + description: 'Show all flashs this user created.', + + res: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'object', + optional: false, nullable: false, + ref: 'Flash', + }, + }, +} as const; + +export const paramDef = { + type: 'object', + properties: { + userId: { type: 'string', format: 'misskey:id' }, + limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, + sinceId: { type: 'string', format: 'misskey:id' }, + untilId: { type: 'string', format: 'misskey:id' }, + }, + required: ['userId'], +} as const; + +// eslint-disable-next-line import/no-default-export +@Injectable() +export default class extends Endpoint { + constructor( + @Inject(DI.flashsRepository) + private flashsRepository: FlashsRepository, + + private flashEntityService: FlashEntityService, + private queryService: QueryService, + ) { + super(meta, paramDef, async (ps, me) => { + const query = this.queryService.makePaginationQuery(this.flashsRepository.createQueryBuilder('flash'), ps.sinceId, ps.untilId) + .andWhere('flash.userId = :userId', { userId: ps.userId }) + .andWhere('flash.visibility = \'public\''); + + const flashs = await query + .limit(ps.limit) + .getMany(); + + return await this.flashEntityService.packMany(flashs); + }); + } +} diff --git a/packages/backend/src/server/api/endpoints/users/followers.ts b/packages/backend/src/server/api/endpoints/users/followers.ts index 2684446fc9..b22fd2ff7a 100644 --- a/packages/backend/src/server/api/endpoints/users/followers.ts +++ b/packages/backend/src/server/api/endpoints/users/followers.ts @@ -5,7 +5,7 @@ import { IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository, FollowingsRepository, UserProfilesRepository } from '@/models/index.js'; +import type { UsersRepository, FollowingsRepository, UserProfilesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { FollowingEntityService } from '@/core/entities/FollowingEntityService.js'; @@ -66,9 +66,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/users/following.ts b/packages/backend/src/server/api/endpoints/users/following.ts index 926aacdb98..03487275a3 100644 --- a/packages/backend/src/server/api/endpoints/users/following.ts +++ b/packages/backend/src/server/api/endpoints/users/following.ts @@ -5,7 +5,7 @@ import { IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository, FollowingsRepository, UserProfilesRepository } from '@/models/index.js'; +import type { UsersRepository, FollowingsRepository, UserProfilesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { FollowingEntityService } from '@/core/entities/FollowingEntityService.js'; @@ -66,9 +66,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/users/gallery/posts.ts b/packages/backend/src/server/api/endpoints/users/gallery/posts.ts index 2aa14ed25d..757af98e00 100644 --- a/packages/backend/src/server/api/endpoints/users/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/users/gallery/posts.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { GalleryPostsRepository } from '@/models/index.js'; +import type { GalleryPostsRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -37,9 +37,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.galleryPostsRepository) private galleryPostsRepository: GalleryPostsRepository, diff --git a/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts b/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts index dd60e16448..d6fb65cecb 100644 --- a/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts +++ b/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts @@ -6,7 +6,7 @@ import { Not, In, IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; import { maximum } from '@/misc/prelude/array.js'; -import type { NotesRepository, UsersRepository } from '@/models/index.js'; +import type { NotesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -58,13 +58,9 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.notesRepository) private notesRepository: NotesRepository, diff --git a/packages/backend/src/server/api/endpoints/users/lists/create-from-public.ts b/packages/backend/src/server/api/endpoints/users/lists/create-from-public.ts index fb0e9f8e49..9e94fae456 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/create-from-public.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/create-from-public.ts @@ -4,9 +4,9 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserListsRepository, UserListJoiningsRepository, BlockingsRepository } from '@/models/index.js'; +import type { UserListsRepository, UserListJoiningsRepository, BlockingsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; -import type { MiUserList } from '@/models/entities/UserList.js'; +import type { MiUserList } from '@/models/UserList.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { GetterService } from '@/server/api/GetterService.js'; import { UserListEntityService } from '@/core/entities/UserListEntityService.js'; @@ -74,7 +74,7 @@ export const paramDef = { } as const; @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userListsRepository) private userListsRepository: UserListsRepository, diff --git a/packages/backend/src/server/api/endpoints/users/lists/create.ts b/packages/backend/src/server/api/endpoints/users/lists/create.ts index 93dac28fb0..b4cb167ea9 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/create.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/create.ts @@ -4,9 +4,9 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserListsRepository } from '@/models/index.js'; +import type { UserListsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; -import type { MiUserList } from '@/models/entities/UserList.js'; +import type { MiUserList } from '@/models/UserList.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserListEntityService } from '@/core/entities/UserListEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -48,9 +48,8 @@ export const paramDef = { required: ['name'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userListsRepository) private userListsRepository: UserListsRepository, diff --git a/packages/backend/src/server/api/endpoints/users/lists/delete.ts b/packages/backend/src/server/api/endpoints/users/lists/delete.ts index 449f75ce33..781fcde38e 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/delete.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/delete.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserListsRepository } from '@/models/index.js'; +import type { UserListsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -36,9 +36,8 @@ export const paramDef = { required: ['listId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userListsRepository) private userListsRepository: UserListsRepository, diff --git a/packages/backend/src/server/api/endpoints/users/lists/favorite.ts b/packages/backend/src/server/api/endpoints/users/lists/favorite.ts index d5a27035b7..4e2d51e661 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/favorite.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/favorite.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UserListFavoritesRepository, UserListsRepository } from '@/models/index.js'; +import type { UserListFavoritesRepository, UserListsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { ApiError } from '@/server/api/error.js'; import { DI } from '@/di-symbols.js'; diff --git a/packages/backend/src/server/api/endpoints/users/lists/list.ts b/packages/backend/src/server/api/endpoints/users/lists/list.ts index db481fc2e4..0e86dd3a68 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/list.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/list.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserListsRepository, UsersRepository } from '@/models/index.js'; +import type { UserListsRepository, UsersRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserListEntityService } from '@/core/entities/UserListEntityService.js'; import { ApiError } from '@/server/api/error.js'; diff --git a/packages/backend/src/server/api/endpoints/users/lists/pull.ts b/packages/backend/src/server/api/endpoints/users/lists/pull.ts index 44726949d9..fb34ac1257 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/pull.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/pull.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserListsRepository, UserListJoiningsRepository } from '@/models/index.js'; +import type { UserListsRepository, UserListJoiningsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { GetterService } from '@/server/api/GetterService.js'; @@ -48,9 +48,8 @@ export const paramDef = { required: ['listId', 'userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userListsRepository) private userListsRepository: UserListsRepository, diff --git a/packages/backend/src/server/api/endpoints/users/lists/push.ts b/packages/backend/src/server/api/endpoints/users/lists/push.ts index 872a279d2e..2f54daff99 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/push.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/push.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import ms from 'ms'; -import type { UserListsRepository, UserListJoiningsRepository, BlockingsRepository } from '@/models/index.js'; +import type { UserListsRepository, UserListJoiningsRepository, BlockingsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { GetterService } from '@/server/api/GetterService.js'; import { UserListService } from '@/core/UserListService.js'; @@ -71,9 +71,8 @@ export const paramDef = { required: ['listId', 'userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userListsRepository) private userListsRepository: UserListsRepository, diff --git a/packages/backend/src/server/api/endpoints/users/lists/show.ts b/packages/backend/src/server/api/endpoints/users/lists/show.ts index cb86e25d92..df44870b04 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/show.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/show.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserListsRepository, UserListFavoritesRepository } from '@/models/index.js'; +import type { UserListsRepository, UserListFavoritesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserListEntityService } from '@/core/entities/UserListEntityService.js'; import { DI } from '@/di-symbols.js'; diff --git a/packages/backend/src/server/api/endpoints/users/lists/unfavorite.ts b/packages/backend/src/server/api/endpoints/users/lists/unfavorite.ts index 226f51fda9..760182760f 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/unfavorite.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/unfavorite.ts @@ -5,7 +5,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UserListFavoritesRepository, UserListsRepository } from '@/models/index.js'; +import type { UserListFavoritesRepository, UserListsRepository } from '@/models/_.js'; import { ApiError } from '@/server/api/error.js'; import { DI } from '@/di-symbols.js'; diff --git a/packages/backend/src/server/api/endpoints/users/lists/update.ts b/packages/backend/src/server/api/endpoints/users/lists/update.ts index bffe674ca3..a7fe4a469a 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/update.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/update.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserListsRepository } from '@/models/index.js'; +import type { UserListsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserListEntityService } from '@/core/entities/UserListEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -45,9 +45,8 @@ export const paramDef = { required: ['listId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userListsRepository) private userListsRepository: UserListsRepository, diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index 1bd849284a..5934baef47 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -5,7 +5,7 @@ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository } from '@/models/index.js'; +import type { NotesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; @@ -57,9 +57,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.notesRepository) private notesRepository: NotesRepository, @@ -81,9 +80,15 @@ export default class extends Endpoint { .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('note.reply', 'reply') .leftJoinAndSelect('note.renote', 'renote') + .leftJoinAndSelect('note.channel', 'channel') .leftJoinAndSelect('reply.user', 'replyUser') .leftJoinAndSelect('renote.user', 'renoteUser'); + query.andWhere(new Brackets(qb => { + qb.orWhere('note.channelId IS NULL'); + qb.orWhere('channel.isSensitive = false'); + })); + this.queryService.generateVisibilityQuery(query, me); if (me) { this.queryService.generateMutedUserQuery(query, me, user); diff --git a/packages/backend/src/server/api/endpoints/users/pages.ts b/packages/backend/src/server/api/endpoints/users/pages.ts index 6ebc78ced2..3e74f50d3e 100644 --- a/packages/backend/src/server/api/endpoints/users/pages.ts +++ b/packages/backend/src/server/api/endpoints/users/pages.ts @@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { PageEntityService } from '@/core/entities/PageEntityService.js'; -import type { PagesRepository } from '@/models/index.js'; +import type { PagesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; export const meta = { @@ -37,9 +37,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.pagesRepository) private pagesRepository: PagesRepository, diff --git a/packages/backend/src/server/api/endpoints/users/reactions.ts b/packages/backend/src/server/api/endpoints/users/reactions.ts index 0dd19c2276..8ad99b8dc0 100644 --- a/packages/backend/src/server/api/endpoints/users/reactions.ts +++ b/packages/backend/src/server/api/endpoints/users/reactions.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserProfilesRepository, NoteReactionsRepository } from '@/models/index.js'; +import type { UserProfilesRepository, NoteReactionsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteReactionEntityService } from '@/core/entities/NoteReactionEntityService.js'; @@ -50,9 +50,8 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, diff --git a/packages/backend/src/server/api/endpoints/users/recommendation.ts b/packages/backend/src/server/api/endpoints/users/recommendation.ts index 1988d9795d..1b30e99b15 100644 --- a/packages/backend/src/server/api/endpoints/users/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/users/recommendation.ts @@ -5,7 +5,7 @@ import ms from 'ms'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository, FollowingsRepository } from '@/models/index.js'; +import type { UsersRepository, FollowingsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; @@ -40,9 +40,8 @@ export const paramDef = { required: [], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/users/relation.ts b/packages/backend/src/server/api/endpoints/users/relation.ts index cce80774a6..326042ed3d 100644 --- a/packages/backend/src/server/api/endpoints/users/relation.ts +++ b/packages/backend/src/server/api/endpoints/users/relation.ts @@ -3,11 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository } from '@/models/index.js'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import { DI } from '@/di-symbols.js'; export const meta = { tags: ['users'], @@ -127,13 +125,9 @@ export const paramDef = { required: ['userId'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - private userEntityService: UserEntityService, ) { super(meta, paramDef, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/users/report-abuse.ts b/packages/backend/src/server/api/endpoints/users/report-abuse.ts index 5ae9b67b39..30008ed506 100644 --- a/packages/backend/src/server/api/endpoints/users/report-abuse.ts +++ b/packages/backend/src/server/api/endpoints/users/report-abuse.ts @@ -3,8 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import sanitizeHtml from 'sanitize-html'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository, AbuseUserReportsRepository } from '@/models/index.js'; +import type { AbuseUserReportsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -50,13 +51,9 @@ export const paramDef = { required: ['userId', 'comment'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.abuseUserReportsRepository) private abuseUserReportsRepository: AbuseUserReportsRepository, diff --git a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts index ee35d298a4..74408cc64a 100644 --- a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts +++ b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts @@ -5,9 +5,9 @@ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository, FollowingsRepository } from '@/models/index.js'; +import type { UsersRepository, FollowingsRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -46,9 +46,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.config) private config: Config, diff --git a/packages/backend/src/server/api/endpoints/users/search.ts b/packages/backend/src/server/api/endpoints/users/search.ts index 3d6aa1ac9e..aff5b98779 100644 --- a/packages/backend/src/server/api/endpoints/users/search.ts +++ b/packages/backend/src/server/api/endpoints/users/search.ts @@ -5,8 +5,8 @@ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository, UserProfilesRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { UsersRepository, UserProfilesRepository } from '@/models/_.js'; +import type { MiUser } from '@/models/User.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -42,9 +42,8 @@ export const paramDef = { required: ['query'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/users/show.ts b/packages/backend/src/server/api/endpoints/users/show.ts index 75f99b16a4..3c94b38910 100644 --- a/packages/backend/src/server/api/endpoints/users/show.ts +++ b/packages/backend/src/server/api/endpoints/users/show.ts @@ -5,8 +5,8 @@ import { In, IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { UsersRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { UsersRepository } from '@/models/_.js'; +import type { MiUser } from '@/models/User.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js'; @@ -79,9 +79,8 @@ export const paramDef = { ], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, diff --git a/packages/backend/src/server/api/endpoints/users/update-memo.ts b/packages/backend/src/server/api/endpoints/users/update-memo.ts index 7c9dded346..9f6600ac6d 100644 --- a/packages/backend/src/server/api/endpoints/users/update-memo.ts +++ b/packages/backend/src/server/api/endpoints/users/update-memo.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { IdService } from '@/core/IdService.js'; -import type { UserMemoRepository } from '@/models/index.js'; +import type { UserMemoRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { GetterService } from '@/server/api/GetterService.js'; import { ApiError } from '../../error.js'; @@ -41,9 +41,8 @@ export const paramDef = { required: ['userId', 'memo'], } as const; -// eslint-disable-next-line import/no-default-export @Injectable() -export default class extends Endpoint { +export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( @Inject(DI.userMemosRepository) private userMemosRepository: UserMemoRepository, diff --git a/packages/backend/src/server/api/stream/index.ts b/packages/backend/src/server/api/stream/Connection.ts similarity index 96% rename from packages/backend/src/server/api/stream/index.ts rename to packages/backend/src/server/api/stream/Connection.ts index 2991691151..fd91681fc1 100644 --- a/packages/backend/src/server/api/stream/index.ts +++ b/packages/backend/src/server/api/stream/Connection.ts @@ -4,14 +4,14 @@ */ import * as WebSocket from 'ws'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiAccessToken } from '@/models/entities/AccessToken.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiAccessToken } from '@/models/AccessToken.js'; import type { Packed } from '@/misc/json-schema.js'; import type { NoteReadService } from '@/core/NoteReadService.js'; import type { NotificationService } from '@/core/NotificationService.js'; import { bindThis } from '@/decorators.js'; import { CacheService } from '@/core/CacheService.js'; -import { MiUserProfile } from '@/models/index.js'; +import { MiUserProfile } from '@/models/_.js'; import type { ChannelsService } from './ChannelsService.js'; import type { EventEmitter } from 'events'; import type Channel from './channel.js'; @@ -20,6 +20,7 @@ import type { StreamEventEmitter, StreamMessages } from './types.js'; /** * Main stream connection */ +// eslint-disable-next-line import/no-default-export export default class Connection { public user?: MiUser; public token?: MiAccessToken; @@ -34,7 +35,7 @@ export default class Connection { public userIdsWhoMeMuting: Set = new Set(); public userIdsWhoBlockingMe: Set = new Set(); public userIdsWhoMeMutingRenotes: Set = new Set(); - private fetchIntervalId: NodeJS.Timer | null = null; + private fetchIntervalId: NodeJS.Timeout | null = null; constructor( private channelsService: ChannelsService, diff --git a/packages/backend/src/server/api/stream/channel.ts b/packages/backend/src/server/api/stream/channel.ts index d31891687d..ad32d08fee 100644 --- a/packages/backend/src/server/api/stream/channel.ts +++ b/packages/backend/src/server/api/stream/channel.ts @@ -4,11 +4,12 @@ */ import { bindThis } from '@/decorators.js'; -import type Connection from './index.js'; +import type Connection from './Connection.js'; /** * Stream channel */ +// eslint-disable-next-line import/no-default-export export default abstract class Channel { protected connection: Connection; public id: string; diff --git a/packages/backend/src/server/api/stream/channels/user-list.ts b/packages/backend/src/server/api/stream/channels/user-list.ts index 557b934722..8bbba0b6db 100644 --- a/packages/backend/src/server/api/stream/channels/user-list.ts +++ b/packages/backend/src/server/api/stream/channels/user-list.ts @@ -4,8 +4,8 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import type { UserListJoiningsRepository, UserListsRepository } from '@/models/index.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { UserListJoiningsRepository, UserListsRepository } from '@/models/_.js'; +import type { MiUser } from '@/models/User.js'; import { isUserRelated } from '@/misc/is-user-related.js'; import type { Packed } from '@/misc/json-schema.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; @@ -19,7 +19,7 @@ class UserListChannel extends Channel { public static requireCredential = false; private listId: string; public listUsers: MiUser['id'][] = []; - private listUsersClock: NodeJS.Timer; + private listUsersClock: NodeJS.Timeout; constructor( private userListsRepository: UserListsRepository, diff --git a/packages/backend/src/server/api/stream/types.ts b/packages/backend/src/server/api/stream/types.ts index 531c00bdf6..90e0a61f26 100644 --- a/packages/backend/src/server/api/stream/types.ts +++ b/packages/backend/src/server/api/stream/types.ts @@ -3,21 +3,21 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import type { MiChannel } from '@/models/entities/Channel.js'; -import type { MiUser } from '@/models/entities/User.js'; -import type { MiUserProfile } from '@/models/entities/UserProfile.js'; -import type { MiNote } from '@/models/entities/Note.js'; -import type { MiAntenna } from '@/models/entities/Antenna.js'; -import type { MiDriveFile } from '@/models/entities/DriveFile.js'; -import type { MiDriveFolder } from '@/models/entities/DriveFolder.js'; -import type { MiUserList } from '@/models/entities/UserList.js'; -import type { MiAbuseUserReport } from '@/models/entities/AbuseUserReport.js'; -import type { MiSignin } from '@/models/entities/Signin.js'; -import type { MiPage } from '@/models/entities/Page.js'; +import type { MiChannel } from '@/models/Channel.js'; +import type { MiUser } from '@/models/User.js'; +import type { MiUserProfile } from '@/models/UserProfile.js'; +import type { MiNote } from '@/models/Note.js'; +import type { MiAntenna } from '@/models/Antenna.js'; +import type { MiDriveFile } from '@/models/DriveFile.js'; +import type { MiDriveFolder } from '@/models/DriveFolder.js'; +import type { MiUserList } from '@/models/UserList.js'; +import type { MiAbuseUserReport } from '@/models/AbuseUserReport.js'; +import type { MiSignin } from '@/models/Signin.js'; +import type { MiPage } from '@/models/Page.js'; import type { Packed } from '@/misc/json-schema.js'; -import type { MiWebhook } from '@/models/entities/Webhook.js'; -import type { MiMeta } from '@/models/entities/Meta.js'; -import { MiRole, MiRoleAssignment } from '@/models/index.js'; +import type { MiWebhook } from '@/models/Webhook.js'; +import type { MiMeta } from '@/models/Meta.js'; +import { MiRole, MiRoleAssignment } from '@/models/_.js'; import type Emitter from 'strict-event-emitter-types'; import type { EventEmitter } from 'events'; diff --git a/packages/backend/src/server/oauth/OAuth2ProviderService.ts b/packages/backend/src/server/oauth/OAuth2ProviderService.ts new file mode 100644 index 0000000000..c3a78561c2 --- /dev/null +++ b/packages/backend/src/server/oauth/OAuth2ProviderService.ts @@ -0,0 +1,487 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import dns from 'node:dns/promises'; +import { fileURLToPath } from 'node:url'; +import { Inject, Injectable } from '@nestjs/common'; +import { JSDOM } from 'jsdom'; +import httpLinkHeader from 'http-link-header'; +import ipaddr from 'ipaddr.js'; +import oauth2orize, { type OAuth2, AuthorizationError, ValidateFunctionArity2, OAuth2Req, MiddlewareRequest } from 'oauth2orize'; +import oauth2Pkce from 'oauth2orize-pkce'; +import fastifyView from '@fastify/view'; +import pug from 'pug'; +import bodyParser from 'body-parser'; +import fastifyExpress from '@fastify/express'; +import { verifyChallenge } from 'pkce-challenge'; +import { mf2 } from 'microformats-parser'; +import { secureRndstr } from '@/misc/secure-rndstr.js'; +import { HttpRequestService } from '@/core/HttpRequestService.js'; +import { kinds } from '@/misc/api-permissions.js'; +import type { Config } from '@/config.js'; +import { DI } from '@/di-symbols.js'; +import { bindThis } from '@/decorators.js'; +import type { AccessTokensRepository, UsersRepository } from '@/models/_.js'; +import { IdService } from '@/core/IdService.js'; +import { CacheService } from '@/core/CacheService.js'; +import type { MiLocalUser } from '@/models/User.js'; +import { MemoryKVCache } from '@/misc/cache.js'; +import { LoggerService } from '@/core/LoggerService.js'; +import Logger from '@/logger.js'; +import { StatusError } from '@/misc/status-error.js'; +import type { ServerResponse } from 'node:http'; +import type { FastifyInstance } from 'fastify'; + +// TODO: Consider migrating to @node-oauth/oauth2-server once +// https://github.com/node-oauth/node-oauth2-server/issues/180 is figured out. +// Upstream the various validations and RFC9207 implementation in that case. + +// Follows https://indieauth.spec.indieweb.org/#client-identifier +// This is also mostly similar to https://developers.google.com/identity/protocols/oauth2/web-server#uri-validation +// although Google has stricter rule. +function validateClientId(raw: string): URL { + // "Clients are identified by a [URL]." + const url = ((): URL => { + try { + return new URL(raw); + } catch { throw new AuthorizationError('client_id must be a valid URL', 'invalid_request'); } + })(); + + // "Client identifier URLs MUST have either an https or http scheme" + // But then again: + // https://datatracker.ietf.org/doc/html/rfc6749.html#section-3.1.2.1 + // 'The redirection endpoint SHOULD require the use of TLS as described + // in Section 1.6 when the requested response type is "code" or "token"' + const allowedProtocols = process.env.NODE_ENV === 'test' ? ['http:', 'https:'] : ['https:']; + if (!allowedProtocols.includes(url.protocol)) { + throw new AuthorizationError('client_id must be a valid HTTPS URL', 'invalid_request'); + } + + // "MUST contain a path component (new URL() implicitly adds one)" + + // "MUST NOT contain single-dot or double-dot path segments," + const segments = url.pathname.split('/'); + if (segments.includes('.') || segments.includes('..')) { + throw new AuthorizationError('client_id must not contain dot path segments', 'invalid_request'); + } + + // ("MAY contain a query string component") + + // "MUST NOT contain a fragment component" + if (url.hash) { + throw new AuthorizationError('client_id must not contain a fragment component', 'invalid_request'); + } + + // "MUST NOT contain a username or password component" + if (url.username || url.password) { + throw new AuthorizationError('client_id must not contain a username or a password', 'invalid_request'); + } + + // ("MAY contain a port") + + // "host names MUST be domain names or a loopback interface and MUST NOT be + // IPv4 or IPv6 addresses except for IPv4 127.0.0.1 or IPv6 [::1]." + if (!url.hostname.match(/\.\w+$/) && !['localhost', '127.0.0.1', '[::1]'].includes(url.hostname)) { + throw new AuthorizationError('client_id must have a domain name as a host name', 'invalid_request'); + } + + return url; +} + +interface ClientInformation { + id: string; + redirectUris: string[]; + name: string; +} + +// https://indieauth.spec.indieweb.org/#client-information-discovery +// "Authorization servers SHOULD support parsing the [h-app] Microformat from the client_id, +// and if there is an [h-app] with a url property matching the client_id URL, +// then it should use the name and icon and display them on the authorization prompt." +// (But we don't display any icon for now) +// https://indieauth.spec.indieweb.org/#redirect-url +// "The client SHOULD publish one or more tags or Link HTTP headers with a rel attribute +// of redirect_uri at the client_id URL. +// Authorization endpoints verifying that a redirect_uri is allowed for use by a client MUST +// look for an exact match of the given redirect_uri in the request against the list of +// redirect_uris discovered after resolving any relative URLs." +async function discoverClientInformation(logger: Logger, httpRequestService: HttpRequestService, id: string): Promise { + try { + const res = await httpRequestService.send(id); + const redirectUris: string[] = []; + + const linkHeader = res.headers.get('link'); + if (linkHeader) { + redirectUris.push(...httpLinkHeader.parse(linkHeader).get('rel', 'redirect_uri').map(r => r.uri)); + } + + const text = await res.text(); + const fragment = JSDOM.fragment(text); + + redirectUris.push(...[...fragment.querySelectorAll('link[rel=redirect_uri][href]')].map(el => el.href)); + + let name = id; + if (text) { + const microformats = mf2(text, { baseUrl: res.url }); + const nameProperty = microformats.items.find(item => item.type?.includes('h-app') && item.properties.url.includes(id))?.properties.name[0]; + if (typeof nameProperty === 'string') { + name = nameProperty; + } + } + + return { + id, + redirectUris: redirectUris.map(uri => new URL(uri, res.url).toString()), + name: typeof name === 'string' ? name : id, + }; + } catch (err) { + console.error(err); + logger.error('Error while fetching client information', { err }); + if (err instanceof StatusError) { + throw new AuthorizationError('Failed to fetch client information', 'invalid_request'); + } else { + throw new AuthorizationError('Failed to parse client information', 'server_error'); + } + } +} + +type OmitFirstElement = T extends [unknown, ...(infer R)] + ? R + : []; + +interface OAuthParsedRequest extends OAuth2Req { + codeChallenge: string; + codeChallengeMethod: string; +} + +interface OAuthHttpResponse extends ServerResponse { + redirect(location: string): void; +} + +interface OAuth2DecisionRequest extends MiddlewareRequest { + body: { + transaction_id: string; + cancel: boolean; + login_token: string; + } +} + +function getQueryMode(issuerUrl: string): oauth2orize.grant.Options['modes'] { + return { + query: (txn, res, params): void => { + // https://datatracker.ietf.org/doc/html/rfc9207#name-response-parameter-iss + // "In authorization responses to the client, including error responses, + // an authorization server supporting this specification MUST indicate its + // identity by including the iss parameter in the response." + params.iss = issuerUrl; + + const parsed = new URL(txn.redirectURI); + for (const [key, value] of Object.entries(params)) { + parsed.searchParams.append(key, value as string); + } + + return (res as OAuthHttpResponse).redirect(parsed.toString()); + }, + }; +} + +/** + * Maps the transaction ID and the oauth/authorize parameters. + * + * Flow: + * 1. oauth/authorize endpoint will call store() to store the parameters + * and puts the generated transaction ID to the dialog page + * 2. oauth/decision will call load() to retrieve the parameters and then remove() + */ +class OAuth2Store { + #cache = new MemoryKVCache(1000 * 60 * 5); // expires after 5min + + load(req: OAuth2DecisionRequest, cb: (err: Error | null, txn?: OAuth2) => void): void { + const { transaction_id } = req.body; + if (!transaction_id) { + cb(new AuthorizationError('Missing transaction ID', 'invalid_request')); + return; + } + const loaded = this.#cache.get(transaction_id); + if (!loaded) { + cb(new AuthorizationError('Invalid or expired transaction ID', 'access_denied')); + return; + } + cb(null, loaded); + } + + store(req: OAuth2DecisionRequest, oauth2: OAuth2, cb: (err: Error | null, transactionID?: string) => void): void { + const transactionId = secureRndstr(128); + this.#cache.set(transactionId, oauth2); + cb(null, transactionId); + } + + remove(req: OAuth2DecisionRequest, tid: string, cb: () => void): void { + this.#cache.delete(tid); + cb(); + } +} + +@Injectable() +export class OAuth2ProviderService { + #server = oauth2orize.createServer({ + store: new OAuth2Store(), + }); + #logger: Logger; + + constructor( + @Inject(DI.config) + private config: Config, + private httpRequestService: HttpRequestService, + @Inject(DI.accessTokensRepository) + accessTokensRepository: AccessTokensRepository, + idService: IdService, + @Inject(DI.usersRepository) + private usersRepository: UsersRepository, + private cacheService: CacheService, + loggerService: LoggerService, + ) { + this.#logger = loggerService.getLogger('oauth'); + + const grantCodeCache = new MemoryKVCache<{ + clientId: string, + userId: string, + redirectUri: string, + codeChallenge: string, + scopes: string[], + + // fields to prevent multiple code use + grantedToken?: string, + revoked?: boolean, + used?: boolean, + }>(1000 * 60 * 5); // expires after 5m + + // https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics + // "Authorization servers MUST support PKCE [RFC7636]." + this.#server.grant(oauth2Pkce.extensions()); + this.#server.grant(oauth2orize.grant.code({ + modes: getQueryMode(config.url), + }, (client, redirectUri, token, ares, areq, locals, done) => { + (async (): Promise>> => { + this.#logger.info(`Checking the user before sending authorization code to ${client.id}`); + + if (!token) { + throw new AuthorizationError('No user', 'invalid_request'); + } + const user = await this.cacheService.localUserByNativeTokenCache.fetch(token, + () => this.usersRepository.findOneBy({ token }) as Promise); + if (!user) { + throw new AuthorizationError('No such user', 'invalid_request'); + } + + this.#logger.info(`Sending authorization code on behalf of user ${user.id} to ${client.id} through ${redirectUri}, with scope: [${areq.scope}]`); + + const code = secureRndstr(128); + grantCodeCache.set(code, { + clientId: client.id, + userId: user.id, + redirectUri, + codeChallenge: (areq as OAuthParsedRequest).codeChallenge, + scopes: areq.scope, + }); + return [code]; + })().then(args => done(null, ...args), err => done(err)); + })); + this.#server.exchange(oauth2orize.exchange.authorizationCode((client, code, redirectUri, body, authInfo, done) => { + (async (): Promise> | undefined> => { + this.#logger.info('Checking the received authorization code for the exchange'); + const granted = grantCodeCache.get(code); + if (!granted) { + return; + } + + // https://datatracker.ietf.org/doc/html/rfc6749.html#section-4.1.2 + // "If an authorization code is used more than once, the authorization server + // MUST deny the request and SHOULD revoke (when possible) all tokens + // previously issued based on that authorization code." + if (granted.used) { + this.#logger.info(`Detected multiple code use from ${granted.clientId} for user ${granted.userId}. Revoking the code.`); + grantCodeCache.delete(code); + granted.revoked = true; + if (granted.grantedToken) { + await accessTokensRepository.delete({ token: granted.grantedToken }); + } + return; + } + granted.used = true; + + // https://datatracker.ietf.org/doc/html/rfc6749.html#section-4.1.3 + if (body.client_id !== granted.clientId) return; + if (redirectUri !== granted.redirectUri) return; + + // https://datatracker.ietf.org/doc/html/rfc7636.html#section-4.6 + if (!body.code_verifier) return; + if (!(await verifyChallenge(body.code_verifier as string, granted.codeChallenge))) return; + + const accessToken = secureRndstr(128); + const now = new Date(); + + // NOTE: we don't have a setup for automatic token expiration + await accessTokensRepository.insert({ + id: idService.genId(), + createdAt: now, + lastUsedAt: now, + userId: granted.userId, + token: accessToken, + hash: accessToken, + name: granted.clientId, + permission: granted.scopes, + }); + + if (granted.revoked) { + this.#logger.info('Canceling the token as the authorization code was revoked in parallel during the process.'); + await accessTokensRepository.delete({ token: accessToken }); + return; + } + + granted.grantedToken = accessToken; + this.#logger.info(`Generated access token for ${granted.clientId} for user ${granted.userId}, with scope: [${granted.scopes}]`); + + return [accessToken, undefined, { scope: granted.scopes.join(' ') }]; + })().then(args => done(null, ...args ?? []), err => done(err)); + })); + } + + @bindThis + public async createServer(fastify: FastifyInstance): Promise { + // https://datatracker.ietf.org/doc/html/rfc8414.html + // https://indieauth.spec.indieweb.org/#indieauth-server-metadata + fastify.get('/.well-known/oauth-authorization-server', async (_request, reply) => { + reply.send({ + issuer: this.config.url, + authorization_endpoint: new URL('/oauth/authorize', this.config.url), + token_endpoint: new URL('/oauth/token', this.config.url), + scopes_supported: kinds, + response_types_supported: ['code'], + grant_types_supported: ['authorization_code'], + service_documentation: 'https://misskey-hub.net', + code_challenge_methods_supported: ['S256'], + authorization_response_iss_parameter_supported: true, + }); + }); + + fastify.get('/oauth/authorize', async (request, reply) => { + const oauth2 = (request.raw as MiddlewareRequest).oauth2; + if (!oauth2) { + throw new Error('Unexpected lack of authorization information'); + } + + this.#logger.info(`Rendering authorization page for "${oauth2.client.name}"`); + + reply.header('Cache-Control', 'no-store'); + return await reply.view('oauth', { + transactionId: oauth2.transactionID, + clientName: oauth2.client.name, + scope: oauth2.req.scope.join(' '), + }); + }); + fastify.post('/oauth/decision', async () => { }); + fastify.post('/oauth/token', async () => { }); + + fastify.register(fastifyView, { + root: fileURLToPath(new URL('../web/views', import.meta.url)), + engine: { pug }, + defaultContext: { + version: this.config.version, + config: this.config, + }, + }); + + await fastify.register(fastifyExpress); + fastify.use('/oauth/authorize', this.#server.authorize(((areq, done) => { + (async (): Promise> => { + // This should return client/redirectURI AND the error, or + // the handler can't send error to the redirection URI + + const { codeChallenge, codeChallengeMethod, clientID, redirectURI, scope } = areq as OAuthParsedRequest; + + this.#logger.info(`Validating authorization parameters, with client_id: ${clientID}, redirect_uri: ${redirectURI}, scope: ${scope}`); + + const clientUrl = validateClientId(clientID); + + // https://indieauth.spec.indieweb.org/#client-information-discovery + // "the server may want to resolve the domain name first and avoid fetching the document + // if the IP address is within the loopback range defined by [RFC5735] + // or any other implementation-specific internal IP address." + if (process.env.NODE_ENV !== 'test' || process.env.MISSKEY_TEST_CHECK_IP_RANGE === '1') { + const lookup = await dns.lookup(clientUrl.hostname); + if (ipaddr.parse(lookup.address).range() !== 'unicast') { + throw new AuthorizationError('client_id resolves to disallowed IP range.', 'invalid_request'); + } + } + + // Find client information from the remote. + const clientInfo = await discoverClientInformation(this.#logger, this.httpRequestService, clientUrl.href); + + // Require the redirect URI to be included in an explicit list, per + // https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics#section-4.1.3 + if (!clientInfo.redirectUris.includes(redirectURI)) { + throw new AuthorizationError('Invalid redirect_uri', 'invalid_request'); + } + + try { + const scopes = [...new Set(scope)].filter(s => kinds.includes(s)); + if (!scopes.length) { + throw new AuthorizationError('`scope` parameter has no known scope', 'invalid_scope'); + } + areq.scope = scopes; + + // Require PKCE parameters. + // Recommended by https://indieauth.spec.indieweb.org/#authorization-request, but also prevents downgrade attack: + // https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics#name-pkce-downgrade-attack + if (typeof codeChallenge !== 'string') { + throw new AuthorizationError('`code_challenge` parameter is required', 'invalid_request'); + } + if (codeChallengeMethod !== 'S256') { + throw new AuthorizationError('`code_challenge_method` parameter must be set as S256', 'invalid_request'); + } + } catch (err) { + return [err as Error, clientInfo, redirectURI]; + } + + return [null, clientInfo, redirectURI]; + })().then(args => done(...args), err => done(err)); + }) as ValidateFunctionArity2)); + fastify.use('/oauth/authorize', this.#server.errorHandler({ + mode: 'indirect', + modes: getQueryMode(this.config.url), + })); + fastify.use('/oauth/authorize', this.#server.errorHandler()); + + fastify.use('/oauth/decision', bodyParser.urlencoded({ extended: false })); + fastify.use('/oauth/decision', this.#server.decision((req, done) => { + const { body } = req as OAuth2DecisionRequest; + this.#logger.info(`Received the decision. Cancel: ${!!body.cancel}`); + req.user = body.login_token; + done(null, undefined); + })); + fastify.use('/oauth/decision', this.#server.errorHandler()); + + // Clients may use JSON or urlencoded + fastify.use('/oauth/token', bodyParser.urlencoded({ extended: false })); + fastify.use('/oauth/token', bodyParser.json({ strict: true })); + fastify.use('/oauth/token', this.#server.token()); + fastify.use('/oauth/token', this.#server.errorHandler()); + + // Return 404 for any unknown paths under /oauth so that clients can know + // whether a certain endpoint is supported or not. + fastify.all('/oauth/*', async (_request, reply) => { + reply.code(404); + reply.send({ + error: { + message: 'Unknown OAuth endpoint.', + code: 'UNKNOWN_OAUTH_ENDPOINT', + id: 'aa49e620-26cb-4e28-aad6-8cbcb58db147', + kind: 'client', + }, + }); + }); + } +} diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index e3f35df194..984b5c149e 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -31,14 +31,13 @@ import { PageEntityService } from '@/core/entities/PageEntityService.js'; import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js'; import { ClipEntityService } from '@/core/entities/ClipEntityService.js'; import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js'; -import type { ChannelsRepository, ClipsRepository, FlashsRepository, GalleryPostsRepository, MiMeta, NotesRepository, PagesRepository, UserProfilesRepository, UsersRepository } from '@/models/index.js'; +import type { ChannelsRepository, ClipsRepository, FlashsRepository, GalleryPostsRepository, MiMeta, NotesRepository, PagesRepository, UserProfilesRepository, UsersRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import { deepClone } from '@/misc/clone.js'; import { bindThis } from '@/decorators.js'; import { FlashEntityService } from '@/core/entities/FlashEntityService.js'; import { RoleService } from '@/core/RoleService.js'; import { IdentifiableError } from '@/misc/identifiable-error.js'; -import manifest from './manifest.json' assert { type: 'json' }; import { FeedService } from './FeedService.js'; import { UrlPreviewService } from './UrlPreviewService.js'; import { ClientLoggerService } from './ClientLoggerService.js'; @@ -111,16 +110,60 @@ export class ClientServerService { @bindThis private async manifestHandler(reply: FastifyReply) { - const res = deepClone(manifest); - const instance = await this.metaService.fetch(true); - res.short_name = instance.name ?? 'Misskey'; - res.name = instance.name ?? 'Misskey'; - if (instance.themeColor) res.theme_color = instance.themeColor; + let manifest = { + // 空文字列の場合右辺を使いたいため + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + 'short_name': instance.shortName || instance.name || this.config.host, + // 空文字列の場合右辺を使いたいため + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + 'name': instance.name || this.config.host, + 'start_url': '/', + 'display': 'standalone', + 'background_color': '#313a42', + // 空文字列の場合右辺を使いたいため + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + 'theme_color': instance.themeColor || '#86b300', + 'icons': [{ + // 空文字列の場合右辺を使いたいため + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + 'src': instance.app192IconUrl || '/static-assets/icons/192.png', + 'sizes': '192x192', + 'type': 'image/png', + 'purpose': 'maskable', + }, { + // 空文字列の場合右辺を使いたいため + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + 'src': instance.app512IconUrl || '/static-assets/icons/512.png', + 'sizes': '512x512', + 'type': 'image/png', + 'purpose': 'maskable', + }, { + 'src': '/static-assets/splash.png', + 'sizes': '300x300', + 'type': 'image/png', + 'purpose': 'any', + }], + 'share_target': { + 'action': '/share/', + 'method': 'GET', + 'enctype': 'application/x-www-form-urlencoded', + 'params': { + 'title': 'title', + 'text': 'text', + 'url': 'url', + }, + }, + }; + + manifest = { + ...manifest, + ...JSON.parse(instance.manifestJsonOverride === '' ? '{}' : instance.manifestJsonOverride), + }; reply.header('Cache-Control', 'max-age=300'); - return (res); + return (manifest); } @bindThis @@ -128,6 +171,7 @@ export class ClientServerService { return { instanceName: meta.name ?? 'Misskey', icon: meta.iconUrl, + appleTouchIcon: meta.app512IconUrl, themeColor: meta.themeColor, serverErrorImageUrl: meta.serverErrorImageUrl ?? 'https://xn--931a.moe/assets/error.jpg', infoImageUrl: meta.infoImageUrl ?? 'https://xn--931a.moe/assets/info.jpg', @@ -144,21 +188,23 @@ export class ClientServerService { // Authenticate fastify.addHook('onRequest', async (request, reply) => { - if (request.url === bullBoardPath || request.url.startsWith(bullBoardPath + '/')) { + // %71ueueとかでリクエストされたら困るため + const url = decodeURI(request.url); + if (url === bullBoardPath || url.startsWith(bullBoardPath + '/')) { const token = request.cookies.token; if (token == null) { - reply.code(401); - throw new Error('login required'); + reply.code(401).send('Login required'); + return; } const user = await this.usersRepository.findOneBy({ token }); if (user == null) { - reply.code(403); - throw new Error('no such user'); + reply.code(403).send('No such user'); + return; } const isAdministrator = await this.roleService.isAdministrator(user); if (!isAdministrator) { - reply.code(403); - throw new Error('access denied'); + reply.code(403).send('Access denied'); + return; } } }); @@ -731,7 +777,7 @@ export class ClientServerService { fastify.setErrorHandler(async (error, request, reply) => { const errId = randomUUID(); - this.clientLoggerService.logger.error(`Internal error occured in ${request.routerPath}: ${error.message}`, { + this.clientLoggerService.logger.error(`Internal error occurred in ${request.routerPath}: ${error.message}`, { path: request.routerPath, params: request.params, query: request.query, diff --git a/packages/backend/src/server/web/FeedService.ts b/packages/backend/src/server/web/FeedService.ts index a6b1e331c4..78551e800b 100644 --- a/packages/backend/src/server/web/FeedService.ts +++ b/packages/backend/src/server/web/FeedService.ts @@ -7,9 +7,9 @@ import { Inject, Injectable } from '@nestjs/common'; import { In, IsNull } from 'typeorm'; import { Feed } from 'feed'; import { DI } from '@/di-symbols.js'; -import type { DriveFilesRepository, NotesRepository, UserProfilesRepository, UsersRepository } from '@/models/index.js'; +import type { DriveFilesRepository, NotesRepository, UserProfilesRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; -import type { MiUser } from '@/models/entities/User.js'; +import type { MiUser } from '@/models/User.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; import { bindThis } from '@/decorators.js'; @@ -20,9 +20,6 @@ export class FeedService { @Inject(DI.config) private config: Config, - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index 2cfdb2a1cf..04e5f6e736 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -7,15 +7,15 @@ doctype html // - - _____ _ _ - | |_|___ ___| |_ ___ _ _ + _____ _ _ + | |_|___ ___| |_ ___ _ _ | | | | |_ -|_ -| '_| -_| | | |_|_|_|_|___|___|_,_|___|_ | |___| Thank you for using Misskey! If you are reading this message... how about joining the development? https://github.com/misskey-dev/misskey - + html @@ -28,14 +28,14 @@ html meta(property='og:site_name' content= instanceName || 'Misskey') meta(name='viewport' content='width=device-width, initial-scale=1') link(rel='icon' href= icon || '/favicon.ico') - link(rel='apple-touch-icon' href= icon || '/apple-touch-icon.png') + link(rel='apple-touch-icon' href= appleTouchIcon || '/apple-touch-icon.png') link(rel='manifest' href='/manifest.json') link(rel='search' type='application/opensearchdescription+xml' title=(title || "Misskey") href=`${url}/opensearch.xml`) link(rel='prefetch' href=serverErrorImageUrl) link(rel='prefetch' href=infoImageUrl) link(rel='prefetch' href=notFoundImageUrl) //- https://github.com/misskey-dev/misskey/issues/9842 - link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.min.css?v2.25.0') + link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.min.css?v2.35.0') link(rel='modulepreload' href=`/vite/${clientEntry.file}`) if !config.clientManifestExists diff --git a/packages/backend/src/server/web/views/oauth.pug b/packages/backend/src/server/web/views/oauth.pug new file mode 100644 index 0000000000..1470dbfbdf --- /dev/null +++ b/packages/backend/src/server/web/views/oauth.pug @@ -0,0 +1,9 @@ +extends ./base + +block meta + //- Should be removed by the page when it loads, so that it won't needlessly + //- stay when user navigates away via the navigation bar + //- XXX: Remove navigation bar in auth page? + meta(name='misskey:oauth:transaction-id' content=transactionId) + meta(name='misskey:oauth:client-name' content=clientName) + meta(name='misskey:oauth:scope' content=scope) diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts index a3a8e77cd0..16654edd88 100644 --- a/packages/backend/src/types.ts +++ b/packages/backend/src/types.ts @@ -3,7 +3,22 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -export const notificationTypes = ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app'] as const; +/** + * note - 通知オンにしているユーザーが投稿した + * follow - フォローされた + * mention - 投稿で自分が言及された + * reply - 投稿に返信された + * renote - 投稿がRenoteされた + * quote - 投稿が引用Renoteされた + * reaction - 投稿にリアクションされた + * pollEnded - 自分のアンケートもしくは自分が投票したアンケートが終了した + * receiveFollowRequest - フォローリクエストされた + * followRequestAccepted - 自分の送ったフォローリクエストが承認された + * achievementEarned - 実績を獲得 + * app - アプリ通知 + * test - テスト通知(サーバー側) + */ +export const notificationTypes = ['note', 'follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app', 'test'] as const; export const obsoleteNotificationTypes = ['pollVote', 'groupInvited'] as const; export const noteVisibilities = ['public', 'home', 'followers', 'specified'] as const; @@ -11,3 +26,140 @@ export const noteVisibilities = ['public', 'home', 'followers', 'specified'] as export const mutedNoteReasons = ['word', 'manual', 'spam', 'other'] as const; export const ffVisibility = ['public', 'followers', 'private'] as const; + +export const moderationLogTypes = [ + 'updateServerSettings', + 'suspend', + 'unsuspend', + 'updateUserNote', + 'addCustomEmoji', + 'updateCustomEmoji', + 'deleteCustomEmoji', + 'assignRole', + 'unassignRole', + 'updateRole', + 'deleteRole', + 'clearQueue', + 'promoteQueue', + 'deleteDriveFile', + 'deleteNote', + 'createGlobalAnnouncement', + 'createUserAnnouncement', + 'updateGlobalAnnouncement', + 'updateUserAnnouncement', + 'deleteGlobalAnnouncement', + 'deleteUserAnnouncement', + 'resetPassword', + 'suspendRemoteInstance', + 'unsuspendRemoteInstance', + 'markSensitiveDriveFile', + 'unmarkSensitiveDriveFile', +] as const; + +export type ModerationLogPayloads = { + updateServerSettings: { + before: any | null; + after: any | null; + }; + suspend: { + targetId: string; + }; + unsuspend: { + targetId: string; + }; + updateUserNote: { + userId: string; + before: string | null; + after: string | null; + }; + addCustomEmoji: { + emojiId: string; + emoji: any; + }; + updateCustomEmoji: { + emojiId: string; + before: any; + after: any; + }; + deleteCustomEmoji: { + emojiId: string; + emoji: any; + }; + assignRole: { + userId: string; + roleId: string; + roleName: string; + expiresAt: string | null; + }; + unassignRole: { + userId: string; + roleId: string; + roleName: string; + }; + updateRole: { + roleId: string; + before: any; + after: any; + }; + deleteRole: { + roleId: string; + role: any; + }; + clearQueue: Record; + promoteQueue: Record; + deleteDriveFile: { + fileId: string; + fileUserId: string | null; + }; + deleteNote: { + noteId: string; + noteUserId: string; + note: any; + }; + createGlobalAnnouncement: { + announcementId: string; + announcement: any; + }; + createUserAnnouncement: { + announcementId: string; + announcement: any; + userId: string; + }; + updateGlobalAnnouncement: { + announcementId: string; + before: any; + after: any; + }; + updateUserAnnouncement: { + announcementId: string; + before: any; + after: any; + }; + deleteGlobalAnnouncement: { + announcementId: string; + announcement: any; + }; + deleteUserAnnouncement: { + announcementId: string; + announcement: any; + }; + resetPassword: { + targetId: string; + }; + suspendRemoteInstance: { + id: string; + host: string; + }; + unsuspendRemoteInstance: { + id: string; + host: string; + }; + markSensitiveDriveFile: { + fileId: string; + fileUserId: string | null; + }; + unmarkSensitiveDriveFile: { + fileId: string; + fileUserId: string | null; + }; +}; diff --git a/packages/backend/test/e2e/2fa.ts b/packages/backend/test/e2e/2fa.ts index 80d2e9d353..ed967d2620 100644 --- a/packages/backend/test/e2e/2fa.ts +++ b/packages/backend/test/e2e/2fa.ts @@ -60,10 +60,12 @@ describe('2要素認証', () => { }; const keyDoneParam = (param: { + token: string, keyName: string, credentialId: Buffer, creationOptions: PublicKeyCredentialCreationOptionsJSON, }): { + token: string, password: string, name: string, credential: RegistrationResponseJSON, @@ -94,6 +96,7 @@ describe('2要素認証', () => { return { password, + token: param.token, name: param.keyName, credential: { id: param.credentialId.toString('base64url'), @@ -218,6 +221,12 @@ describe('2要素認証', () => { }); assert.strictEqual(signinResponse.status, 200); assert.notEqual(signinResponse.body.i, undefined); + + // 後片付け + await api('/i/2fa/unregister', { + password, + token: otpToken(registerResponse.body.secret), + }, alice); }); test('が設定でき、セキュリティキーでログインできる。', async () => { @@ -233,6 +242,7 @@ describe('2要素認証', () => { const registerKeyResponse = await api('/i/2fa/register-key', { password, + token: otpToken(registerResponse.body.secret), }, alice); assert.strictEqual(registerKeyResponse.status, 200); assert.notEqual(registerKeyResponse.body.rp, undefined); @@ -241,6 +251,7 @@ describe('2要素認証', () => { const keyName = 'example-key'; const credentialId = crypto.randomBytes(0x41); const keyDoneResponse = await api('/i/2fa/key-done', keyDoneParam({ + token: otpToken(registerResponse.body.secret), keyName, credentialId, creationOptions: registerKeyResponse.body, @@ -271,6 +282,12 @@ describe('2要素認証', () => { })); assert.strictEqual(signinResponse2.status, 200); assert.notEqual(signinResponse2.body.i, undefined); + + // 後片付け + await api('/i/2fa/unregister', { + password, + token: otpToken(registerResponse.body.secret), + }, alice); }); test('が設定でき、セキュリティキーでパスワードレスログインできる。', async () => { @@ -285,6 +302,7 @@ describe('2要素認証', () => { assert.strictEqual(doneResponse.status, 200); const registerKeyResponse = await api('/i/2fa/register-key', { + token: otpToken(registerResponse.body.secret), password, }, alice); assert.strictEqual(registerKeyResponse.status, 200); @@ -292,6 +310,7 @@ describe('2要素認証', () => { const keyName = 'example-key'; const credentialId = crypto.randomBytes(0x41); const keyDoneResponse = await api('/i/2fa/key-done', keyDoneParam({ + token: otpToken(registerResponse.body.secret), keyName, credentialId, creationOptions: registerKeyResponse.body, @@ -326,6 +345,12 @@ describe('2要素認証', () => { }); assert.strictEqual(signinResponse2.status, 200); assert.notEqual(signinResponse2.body.i, undefined); + + // 後片付け + await api('/i/2fa/unregister', { + password, + token: otpToken(registerResponse.body.secret), + }, alice); }); test('が設定でき、設定したセキュリティキーの名前を変更できる。', async () => { @@ -340,6 +365,7 @@ describe('2要素認証', () => { assert.strictEqual(doneResponse.status, 200); const registerKeyResponse = await api('/i/2fa/register-key', { + token: otpToken(registerResponse.body.secret), password, }, alice); assert.strictEqual(registerKeyResponse.status, 200); @@ -347,6 +373,7 @@ describe('2要素認証', () => { const keyName = 'example-key'; const credentialId = crypto.randomBytes(0x41); const keyDoneResponse = await api('/i/2fa/key-done', keyDoneParam({ + token: otpToken(registerResponse.body.secret), keyName, credentialId, creationOptions: registerKeyResponse.body, @@ -367,6 +394,12 @@ describe('2要素認証', () => { assert.strictEqual(securityKeys.length, 1); assert.strictEqual(securityKeys[0].name, renamedKey); assert.notEqual(securityKeys[0].lastUsed, undefined); + + // 後片付け + await api('/i/2fa/unregister', { + password, + token: otpToken(registerResponse.body.secret), + }, alice); }); test('が設定でき、設定したセキュリティキーを削除できる。', async () => { @@ -381,6 +414,7 @@ describe('2要素認証', () => { assert.strictEqual(doneResponse.status, 200); const registerKeyResponse = await api('/i/2fa/register-key', { + token: otpToken(registerResponse.body.secret), password, }, alice); assert.strictEqual(registerKeyResponse.status, 200); @@ -388,6 +422,7 @@ describe('2要素認証', () => { const keyName = 'example-key'; const credentialId = crypto.randomBytes(0x41); const keyDoneResponse = await api('/i/2fa/key-done', keyDoneParam({ + token: otpToken(registerResponse.body.secret), keyName, credentialId, creationOptions: registerKeyResponse.body, @@ -400,6 +435,7 @@ describe('2要素認証', () => { assert.strictEqual(iResponse.status, 200); for (const key of iResponse.body.securityKeysList) { const removeKeyResponse = await api('/i/2fa/remove-key', { + token: otpToken(registerResponse.body.secret), password, credentialId: key.id, }, alice); @@ -418,6 +454,12 @@ describe('2要素認証', () => { }); assert.strictEqual(signinResponse.status, 200); assert.notEqual(signinResponse.body.i, undefined); + + // 後片付け + await api('/i/2fa/unregister', { + password, + token: otpToken(registerResponse.body.secret), + }, alice); }); test('が設定でき、設定解除できる。(パスワードのみでログインできる。)', async () => { @@ -438,6 +480,7 @@ describe('2要素認証', () => { assert.strictEqual(usersShowResponse.body.twoFactorEnabled, true); const unregisterResponse = await api('/i/2fa/unregister', { + token: otpToken(registerResponse.body.secret), password, }, alice); assert.strictEqual(unregisterResponse.status, 204); @@ -447,5 +490,11 @@ describe('2要素認証', () => { }); assert.strictEqual(signinResponse.status, 200); assert.notEqual(signinResponse.body.i, undefined); + + // 後片付け + await api('/i/2fa/unregister', { + password, + token: otpToken(registerResponse.body.secret), + }, alice); }); }); diff --git a/packages/backend/test/e2e/api.ts b/packages/backend/test/e2e/api.ts index def90ddc72..15da74931d 100644 --- a/packages/backend/test/e2e/api.ts +++ b/packages/backend/test/e2e/api.ts @@ -7,7 +7,7 @@ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; import { IncomingMessage } from 'http'; -import { signup, api, startServer, successfulApiCall, failedApiCall, uploadFile, waitFire, connectStream } from '../utils.js'; +import { signup, api, startServer, successfulApiCall, failedApiCall, uploadFile, waitFire, connectStream, relativeFetch } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; @@ -223,6 +223,42 @@ describe('API', () => { assert.ok(result.headers.get('WWW-Authenticate')?.startsWith('Bearer realm="Misskey", error="invalid_request", error_description')); }); - // TODO: insufficient_scope test (authテストが全然なくて書けない) + describe('invalid bearer format', () => { + test('No preceding bearer', async () => { + const result = await relativeFetch('api/notes/create', { + method: 'POST', + headers: { + Authorization: alice.token, + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ text: 'test' }), + }); + assert.strictEqual(result.status, 401); + }); + + test('Lowercase bearer', async () => { + const result = await relativeFetch('api/notes/create', { + method: 'POST', + headers: { + Authorization: `bearer ${alice.token}`, + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ text: 'test' }), + }); + assert.strictEqual(result.status, 401); + }); + + test('No space after bearer', async () => { + const result = await relativeFetch('api/notes/create', { + method: 'POST', + headers: { + Authorization: `Bearer${alice.token}`, + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ text: 'test' }), + }); + assert.strictEqual(result.status, 401); + }); + }); }); }); diff --git a/packages/backend/test/e2e/clips.ts b/packages/backend/test/e2e/clips.ts index 833b48f731..dfdc044caa 100644 --- a/packages/backend/test/e2e/clips.ts +++ b/packages/backend/test/e2e/clips.ts @@ -721,7 +721,7 @@ describe('クリップ', () => { await addNote({ clipId: aliceClip.id, noteId: aliceNote.id }); const res = await show({ clipId: aliceClip.id }); assert.strictEqual(res.lastClippedAt, new Date(res.lastClippedAt ?? '').toISOString()); - assert.deepStrictEqual(await notes({ clipId: aliceClip.id }), [aliceNote]); + assert.deepStrictEqual((await notes({ clipId: aliceClip.id })).map(x => x.id), [aliceNote.id]); // 他人の非公開ノートも突っ込める await addNote({ clipId: aliceClip.id, noteId: bobHomeNote.id }); @@ -861,8 +861,8 @@ describe('クリップ', () => { bobNote, bobHomeNote, ]; assert.deepStrictEqual( - res.sort(compareBy(s => s.id)), - expects.sort(compareBy(s => s.id))); + res.sort(compareBy(s => s.id)).map(x => x.id), + expects.sort(compareBy(s => s.id)).map(x => x.id)); }); test('を始端IDとlimitで取得できる。', async () => { @@ -881,8 +881,8 @@ describe('クリップ', () => { // Promise.allで返ってくる配列はID順で並んでないのでソートして厳密比較 const expects = [noteList[3], noteList[4], noteList[5]]; assert.deepStrictEqual( - res.sort(compareBy(s => s.id)), - expects.sort(compareBy(s => s.id))); + res.sort(compareBy(s => s.id)).map(x => x.id), + expects.sort(compareBy(s => s.id)).map(x => x.id)); }); test('をID範囲指定で取得できる。', async () => { @@ -901,8 +901,8 @@ describe('クリップ', () => { // Promise.allで返ってくる配列はID順で並んでないのでソートして厳密比較 const expects = [noteList[2], noteList[3]]; assert.deepStrictEqual( - res.sort(compareBy(s => s.id)), - expects.sort(compareBy(s => s.id))); + res.sort(compareBy(s => s.id)).map(x => x.id), + expects.sort(compareBy(s => s.id)).map(x => x.id)); }); test.todo('Remoteのノートもクリップできる。どうテストしよう?'); @@ -911,7 +911,7 @@ describe('クリップ', () => { const bobClip = await create({ isPublic: true }, { user: bob } ); await addNote({ clipId: bobClip.id, noteId: aliceNote.id }, { user: bob }); const res = await notes({ clipId: bobClip.id }); - assert.deepStrictEqual(res, [aliceNote]); + assert.deepStrictEqual(res.map(x => x.id), [aliceNote.id]); }); test('はPublicなクリップなら認証なしでも取得できる。(非公開ノートはhideされて返ってくる)', async () => { @@ -928,8 +928,8 @@ describe('クリップ', () => { hiddenNote(aliceFollowersNote), hiddenNote(aliceSpecifiedNote), ]; assert.deepStrictEqual( - res.sort(compareBy(s => s.id)), - expects.sort(compareBy(s => s.id))); + res.sort(compareBy(s => s.id)).map(x => x.id), + expects.sort(compareBy(s => s.id)).map(x => x.id)); }); test.todo('ブロック、ミュートされたユーザーからの設定&取得etc.'); diff --git a/packages/backend/test/e2e/endpoints.ts b/packages/backend/test/e2e/endpoints.ts index 6e91786413..2ef3434bca 100644 --- a/packages/backend/test/e2e/endpoints.ts +++ b/packages/backend/test/e2e/endpoints.ts @@ -9,7 +9,7 @@ import * as assert from 'assert'; // node-fetch only supports it's own Blob yet // https://github.com/node-fetch/node-fetch/pull/1664 import { Blob } from 'node-fetch'; -import { MiUser } from '@/models/index.js'; +import { MiUser } from '@/models/_.js'; import { startServer, signup, post, api, uploadFile, simpleGet, initTestDb } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; diff --git a/packages/backend/test/e2e/fetch-resource.ts b/packages/backend/test/e2e/fetch-resource.ts index 96683ce594..1cbfec3e5f 100644 --- a/packages/backend/test/e2e/fetch-resource.ts +++ b/packages/backend/test/e2e/fetch-resource.ts @@ -34,6 +34,8 @@ describe('Webリソース', () => { let aliceGalleryPost: any; let aliceChannel: any; + let bob: misskey.entities.MeSignup; + type Request = { path: string, accept?: string, @@ -90,6 +92,8 @@ describe('Webリソース', () => { fileIds: [aliceUploadedFile.body.id], }); aliceChannel = await channel(alice, {}); + + bob = await signup({ username: 'alice' }); }, 1000 * 60 * 2); afterAll(async () => { @@ -163,9 +167,15 @@ describe('Webリソース', () => { }); describe.each([{ path: '/queue' }])('$path', ({ path }) => { + test('はログインしないとGETできない。', async () => await notOk({ + path, + status: 401, + })); + test('はadminでなければGETできない。', async () => await notOk({ path, - status: 500, // FIXME? 403ではない。 + cookie: cookie(bob), + status: 403, })); test('はadminならGETできる。', async () => await ok({ diff --git a/packages/backend/test/e2e/move.ts b/packages/backend/test/e2e/move.ts index 24c9473ae8..3f158f9f13 100644 --- a/packages/backend/test/e2e/move.ts +++ b/packages/backend/test/e2e/move.ts @@ -7,7 +7,7 @@ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; import { loadConfig } from '@/config.js'; -import { MiUser, UsersRepository } from '@/models/index.js'; +import { MiUser, UsersRepository } from '@/models/_.js'; import { jobQueue } from '@/boot/common.js'; import { secureRndstr } from '@/misc/secure-rndstr.js'; import { uploadFile, signup, startServer, initTestDb, api, sleep, successfulApiCall } from '../utils.js'; diff --git a/packages/backend/test/e2e/note.ts b/packages/backend/test/e2e/note.ts index 20208c4571..961df99cc2 100644 --- a/packages/backend/test/e2e/note.ts +++ b/packages/backend/test/e2e/note.ts @@ -6,7 +6,7 @@ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; -import { MiNote } from '@/models/entities/Note.js'; +import { MiNote } from '@/models/Note.js'; import { MAX_NOTE_TEXT_LENGTH } from '@/const.js'; import { signup, post, uploadUrl, startServer, initTestDb, api, uploadFile } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; diff --git a/packages/backend/test/e2e/oauth.ts b/packages/backend/test/e2e/oauth.ts new file mode 100644 index 0000000000..a029a0d4be --- /dev/null +++ b/packages/backend/test/e2e/oauth.ts @@ -0,0 +1,944 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +/** + * Basic OAuth tests to make sure the library is correctly integrated to Misskey + * and not regressed by version updates or potential migration to another library. + */ + +process.env.NODE_ENV = 'test'; + +import * as assert from 'assert'; +import { AuthorizationCode, ResourceOwnerPassword, type AuthorizationTokenConfig, ClientCredentials, ModuleOptions } from 'simple-oauth2'; +import pkceChallenge from 'pkce-challenge'; +import { JSDOM } from 'jsdom'; +import Fastify, { type FastifyReply, type FastifyInstance } from 'fastify'; +import { api, port, signup, startServer } from '../utils.js'; +import type * as misskey from 'misskey-js'; +import type { INestApplicationContext } from '@nestjs/common'; + +const host = `http://127.0.0.1:${port}`; + +const clientPort = port + 1; +const redirect_uri = `http://127.0.0.1:${clientPort}/redirect`; + +const basicAuthParams: AuthorizationParamsExtended = { + redirect_uri, + scope: 'write:notes', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', +}; + +interface AuthorizationParamsExtended { + redirect_uri: string; + scope: string | string[]; + state: string; + code_challenge?: string; + code_challenge_method?: string; +} + +interface AuthorizationTokenConfigExtended extends AuthorizationTokenConfig { + code_verifier: string | undefined; +} + +interface GetTokenError { + data: { + payload: { + error: string; + } + } +} + +const clientConfig: ModuleOptions<'client_id'> = { + client: { + id: `http://127.0.0.1:${clientPort}/`, + secret: '', + }, + auth: { + tokenHost: host, + tokenPath: '/oauth/token', + authorizePath: '/oauth/authorize', + }, + options: { + authorizationMethod: 'body', + }, +}; + +function getMeta(html: string): { transactionId: string | undefined, clientName: string | undefined } { + const fragment = JSDOM.fragment(html); + return { + transactionId: fragment.querySelector('meta[name="misskey:oauth:transaction-id"]')?.content, + clientName: fragment.querySelector('meta[name="misskey:oauth:client-name"]')?.content, + }; +} + +function fetchDecision(transactionId: string, user: misskey.entities.MeSignup, { cancel }: { cancel?: boolean } = {}): Promise { + return fetch(new URL('/oauth/decision', host), { + method: 'post', + body: new URLSearchParams({ + transaction_id: transactionId, + login_token: user.token, + cancel: cancel ? 'cancel' : '', + }), + redirect: 'manual', + headers: { + 'content-type': 'application/x-www-form-urlencoded', + }, + }); +} + +async function fetchDecisionFromResponse(response: Response, user: misskey.entities.MeSignup, { cancel }: { cancel?: boolean } = {}): Promise { + const { transactionId } = getMeta(await response.text()); + assert.ok(transactionId); + + return await fetchDecision(transactionId, user, { cancel }); +} + +async function fetchAuthorizationCode(user: misskey.entities.MeSignup, scope: string, code_challenge: string): Promise<{ client: AuthorizationCode, code: string }> { + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + redirect_uri, + scope, + state: 'state', + code_challenge, + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + assert.strictEqual(response.status, 200); + + const decisionResponse = await fetchDecisionFromResponse(response, user); + assert.strictEqual(decisionResponse.status, 302); + + const locationHeader = decisionResponse.headers.get('location'); + assert.ok(locationHeader); + + const location = new URL(locationHeader); + assert.ok(location.searchParams.has('code')); + + const code = new URL(location).searchParams.get('code'); + assert.ok(code); + + return { client, code }; +} + +function assertIndirectError(response: Response, error: string): void { + assert.strictEqual(response.status, 302); + + const locationHeader = response.headers.get('location'); + assert.ok(locationHeader); + + const location = new URL(locationHeader); + assert.strictEqual(location.searchParams.get('error'), error); + + // https://datatracker.ietf.org/doc/html/rfc9207#name-response-parameter-iss + assert.strictEqual(location.searchParams.get('iss'), 'http://misskey.local'); + // https://datatracker.ietf.org/doc/html/rfc6749.html#section-4.1.2.1 + assert.ok(location.searchParams.has('state')); +} + +async function assertDirectError(response: Response, status: number, error: string): Promise { + assert.strictEqual(response.status, status); + + const data = await response.json(); + assert.strictEqual(data.error, error); +} + +describe('OAuth', () => { + let app: INestApplicationContext; + let fastify: FastifyInstance; + + let alice: misskey.entities.MeSignup; + let bob: misskey.entities.MeSignup; + + let sender: (reply: FastifyReply) => void; + + beforeAll(async () => { + app = await startServer(); + alice = await signup({ username: 'alice' }); + bob = await signup({ username: 'bob' }); + + fastify = Fastify(); + fastify.get('/', async (request, reply) => { + sender(reply); + }); + await fastify.listen({ port: clientPort }); + }, 1000 * 60 * 2); + + beforeEach(async () => { + process.env.MISSKEY_TEST_CHECK_IP_RANGE = ''; + sender = (reply): void => { + reply.send(` + + +
Misklient + `); + }; + }); + + afterAll(async () => { + await fastify.close(); + await app.close(); + }); + + test('Full flow', async () => { + const { code_challenge, code_verifier } = await pkceChallenge(128); + + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes', + state: 'state', + code_challenge, + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + assert.strictEqual(response.status, 200); + + const meta = getMeta(await response.text()); + assert.strictEqual(typeof meta.transactionId, 'string'); + assert.ok(meta.transactionId); + assert.strictEqual(meta.clientName, 'Misklient'); + + const decisionResponse = await fetchDecision(meta.transactionId, alice); + assert.strictEqual(decisionResponse.status, 302); + assert.ok(decisionResponse.headers.has('location')); + + const locationHeader = decisionResponse.headers.get('location'); + assert.ok(locationHeader); + + const location = new URL(locationHeader); + assert.strictEqual(location.origin + location.pathname, redirect_uri); + assert.ok(location.searchParams.has('code')); + assert.strictEqual(location.searchParams.get('state'), 'state'); + // https://datatracker.ietf.org/doc/html/rfc9207#name-response-parameter-iss + assert.strictEqual(location.searchParams.get('iss'), 'http://misskey.local'); + + const code = new URL(location).searchParams.get('code'); + assert.ok(code); + + const token = await client.getToken({ + code, + redirect_uri, + code_verifier, + } as AuthorizationTokenConfigExtended); + assert.strictEqual(typeof token.token.access_token, 'string'); + assert.strictEqual(token.token.token_type, 'Bearer'); + assert.strictEqual(token.token.scope, 'write:notes'); + + const createResult = await api('notes/create', { text: 'test' }, { + token: token.token.access_token as string, + bearer: true, + }); + assert.strictEqual(createResult.status, 200); + + const createResultBody = createResult.body as misskey.Endpoints['notes/create']['res']; + assert.strictEqual(createResultBody.createdNote.text, 'test'); + }); + + test('Two concurrent flows', async () => { + const client = new AuthorizationCode(clientConfig); + + const pkceAlice = await pkceChallenge(128); + const pkceBob = await pkceChallenge(128); + + const responseAlice = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes', + state: 'state', + code_challenge: pkceAlice.code_challenge, + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + assert.strictEqual(responseAlice.status, 200); + + const responseBob = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes', + state: 'state', + code_challenge: pkceBob.code_challenge, + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + assert.strictEqual(responseBob.status, 200); + + const decisionResponseAlice = await fetchDecisionFromResponse(responseAlice, alice); + assert.strictEqual(decisionResponseAlice.status, 302); + + const decisionResponseBob = await fetchDecisionFromResponse(responseBob, bob); + assert.strictEqual(decisionResponseBob.status, 302); + + const locationHeaderAlice = decisionResponseAlice.headers.get('location'); + assert.ok(locationHeaderAlice); + const locationAlice = new URL(locationHeaderAlice); + + const locationHeaderBob = decisionResponseBob.headers.get('location'); + assert.ok(locationHeaderBob); + const locationBob = new URL(locationHeaderBob); + + const codeAlice = locationAlice.searchParams.get('code'); + assert.ok(codeAlice); + const codeBob = locationBob.searchParams.get('code'); + assert.ok(codeBob); + + const tokenAlice = await client.getToken({ + code: codeAlice, + redirect_uri, + code_verifier: pkceAlice.code_verifier, + } as AuthorizationTokenConfigExtended); + + const tokenBob = await client.getToken({ + code: codeBob, + redirect_uri, + code_verifier: pkceBob.code_verifier, + } as AuthorizationTokenConfigExtended); + + const createResultAlice = await api('notes/create', { text: 'test' }, { + token: tokenAlice.token.access_token as string, + bearer: true, + }); + assert.strictEqual(createResultAlice.status, 200); + + const createResultBob = await api('notes/create', { text: 'test' }, { + token: tokenBob.token.access_token as string, + bearer: true, + }); + assert.strictEqual(createResultAlice.status, 200); + + const createResultBodyAlice = await createResultAlice.body as misskey.Endpoints['notes/create']['res']; + assert.strictEqual(createResultBodyAlice.createdNote.user.username, 'alice'); + + const createResultBodyBob = await createResultBob.body as misskey.Endpoints['notes/create']['res']; + assert.strictEqual(createResultBodyBob.createdNote.user.username, 'bob'); + }); + + // https://datatracker.ietf.org/doc/html/rfc7636.html + describe('PKCE', () => { + // https://datatracker.ietf.org/doc/html/rfc7636.html#section-4.4.1 + // '... the authorization endpoint MUST return the authorization + // error response with the "error" value set to "invalid_request".' + test('Require PKCE', async () => { + const client = new AuthorizationCode(clientConfig); + + // Pattern 1: No PKCE fields at all + let response = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes', + state: 'state', + }), { redirect: 'manual' }); + assertIndirectError(response, 'invalid_request'); + + // Pattern 2: Only code_challenge + response = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes', + state: 'state', + code_challenge: 'code', + } as AuthorizationParamsExtended), { redirect: 'manual' }); + assertIndirectError(response, 'invalid_request'); + + // Pattern 3: Only code_challenge_method + response = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes', + state: 'state', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended), { redirect: 'manual' }); + assertIndirectError(response, 'invalid_request'); + + // Pattern 4: Unsupported code_challenge_method + response = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'SSSS', + } as AuthorizationParamsExtended), { redirect: 'manual' }); + assertIndirectError(response, 'invalid_request'); + }); + + // Use precomputed challenge/verifier set here for deterministic test + const code_challenge = '4w2GDuvaxXlw2l46k5PFIoIcTGHdzw2i3hrn-C_Q6f7u0-nTYKd-beVEYy9XinYsGtAix.Nnvr.GByD3lAii2ibPRsSDrZgIN0YQb.kfevcfR9aDKoTLyOUm4hW4ABhs'; + const code_verifier = 'Ew8VSBiH59JirLlg7ocFpLQ6NXuFC1W_rn8gmRzBKc8'; + + const tests: Record = { + 'Code followed by some junk code': code_verifier + 'x', + 'Clipped code': code_verifier.slice(0, 80), + 'Some part of code is replaced': code_verifier.slice(0, -10) + 'x'.repeat(10), + 'No verifier': undefined, + }; + + describe('Verify PKCE', () => { + for (const [title, wrong_verifier] of Object.entries(tests)) { + test(title, async () => { + const { client, code } = await fetchAuthorizationCode(alice, 'write:notes', code_challenge); + + await assert.rejects(client.getToken({ + code, + redirect_uri, + code_verifier: wrong_verifier, + } as AuthorizationTokenConfigExtended), (err: GetTokenError) => { + assert.strictEqual(err.data.payload.error, 'invalid_grant'); + return true; + }); + }); + } + }); + }); + + // https://datatracker.ietf.org/doc/html/rfc6749.html#section-4.1.2 + // "If an authorization code is used more than once, the authorization server + // MUST deny the request and SHOULD revoke (when possible) all tokens + // previously issued based on that authorization code." + describe('Revoking authorization code', () => { + test('On success', async () => { + const { code_challenge, code_verifier } = await pkceChallenge(128); + const { client, code } = await fetchAuthorizationCode(alice, 'write:notes', code_challenge); + + await client.getToken({ + code, + redirect_uri, + code_verifier, + } as AuthorizationTokenConfigExtended); + + await assert.rejects(client.getToken({ + code, + redirect_uri, + code_verifier, + } as AuthorizationTokenConfigExtended), (err: GetTokenError) => { + assert.strictEqual(err.data.payload.error, 'invalid_grant'); + return true; + }); + }); + + test('On failure', async () => { + const { code_challenge, code_verifier } = await pkceChallenge(128); + const { client, code } = await fetchAuthorizationCode(alice, 'write:notes', code_challenge); + + await assert.rejects(client.getToken({ code, redirect_uri }), (err: GetTokenError) => { + assert.strictEqual(err.data.payload.error, 'invalid_grant'); + return true; + }); + + await assert.rejects(client.getToken({ + code, + redirect_uri, + code_verifier, + } as AuthorizationTokenConfigExtended), (err: GetTokenError) => { + assert.strictEqual(err.data.payload.error, 'invalid_grant'); + return true; + }); + }); + + test('Revoke the already granted access token', async () => { + const { code_challenge, code_verifier } = await pkceChallenge(128); + const { client, code } = await fetchAuthorizationCode(alice, 'write:notes', code_challenge); + + const token = await client.getToken({ + code, + redirect_uri, + code_verifier, + } as AuthorizationTokenConfigExtended); + + const createResult = await api('notes/create', { text: 'test' }, { + token: token.token.access_token as string, + bearer: true, + }); + assert.strictEqual(createResult.status, 200); + + await assert.rejects(client.getToken({ + code, + redirect_uri, + code_verifier, + } as AuthorizationTokenConfigExtended), (err: GetTokenError) => { + assert.strictEqual(err.data.payload.error, 'invalid_grant'); + return true; + }); + + const createResult2 = await api('notes/create', { text: 'test' }, { + token: token.token.access_token as string, + bearer: true, + }); + assert.strictEqual(createResult2.status, 401); + }); + }); + + test('Cancellation', async () => { + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + assert.strictEqual(response.status, 200); + + const decisionResponse = await fetchDecisionFromResponse(response, alice, { cancel: true }); + assert.strictEqual(decisionResponse.status, 302); + + const locationHeader = decisionResponse.headers.get('location'); + assert.ok(locationHeader); + + const location = new URL(locationHeader); + assert.ok(!location.searchParams.has('code')); + assert.ok(location.searchParams.has('error')); + }); + + // https://datatracker.ietf.org/doc/html/rfc6749.html#section-3.3 + describe('Scope', () => { + // "If the client omits the scope parameter when requesting + // authorization, the authorization server MUST either process the + // request using a pre-defined default value or fail the request + // indicating an invalid scope." + // (And Misskey does the latter) + test('Missing scope', async () => { + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + redirect_uri, + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended), { redirect: 'manual' }); + assertIndirectError(response, 'invalid_scope'); + }); + + test('Empty scope', async () => { + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + redirect_uri, + scope: '', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended), { redirect: 'manual' }); + assertIndirectError(response, 'invalid_scope'); + }); + + test('Unknown scopes', async () => { + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'test:unknown test:unknown2', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended), { redirect: 'manual' }); + assertIndirectError(response, 'invalid_scope'); + }); + + // "If the issued access token scope + // is different from the one requested by the client, the authorization + // server MUST include the "scope" response parameter to inform the + // client of the actual scope granted." + // (Although Misskey always return scope, which is also fine) + test('Partially known scopes', async () => { + const { code_challenge, code_verifier } = await pkceChallenge(128); + + // Just get the known scope for this case for backward compatibility + const { client, code } = await fetchAuthorizationCode( + alice, + 'write:notes test:unknown test:unknown2', + code_challenge, + ); + + const token = await client.getToken({ + code, + redirect_uri, + code_verifier, + } as AuthorizationTokenConfigExtended); + + assert.strictEqual(token.token.scope, 'write:notes'); + }); + + test('Known scopes', async () => { + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes read:account', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + + assert.strictEqual(response.status, 200); + }); + + test('Duplicated scopes', async () => { + const { code_challenge, code_verifier } = await pkceChallenge(128); + + const { client, code } = await fetchAuthorizationCode( + alice, + 'write:notes write:notes read:account read:account', + code_challenge, + ); + + const token = await client.getToken({ + code, + redirect_uri, + code_verifier, + } as AuthorizationTokenConfigExtended); + assert.strictEqual(token.token.scope, 'write:notes read:account'); + }); + + test('Scope check by API', async () => { + const { code_challenge, code_verifier } = await pkceChallenge(128); + + const { client, code } = await fetchAuthorizationCode(alice, 'read:account', code_challenge); + + const token = await client.getToken({ + code, + redirect_uri, + code_verifier, + } as AuthorizationTokenConfigExtended); + assert.strictEqual(typeof token.token.access_token, 'string'); + + const createResult = await api('notes/create', { text: 'test' }, { + token: token.token.access_token as string, + bearer: true, + }); + assert.strictEqual(createResult.status, 403); + assert.ok(createResult.headers.get('WWW-Authenticate')?.startsWith('Bearer realm="Misskey", error="insufficient_scope", error_description')); + }); + }); + + // https://datatracker.ietf.org/doc/html/rfc6749.html#section-3.1.2.4 + // "If an authorization request fails validation due to a missing, + // invalid, or mismatching redirection URI, the authorization server + // SHOULD inform the resource owner of the error and MUST NOT + // automatically redirect the user-agent to the invalid redirection URI." + describe('Redirection', () => { + test('Invalid redirect_uri at authorization endpoint', async () => { + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + redirect_uri: 'http://127.0.0.2/', + scope: 'write:notes', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + await assertDirectError(response, 400, 'invalid_request'); + }); + + test('Invalid redirect_uri including the valid one at authorization endpoint', async () => { + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + redirect_uri: 'http://127.0.0.1/redirection', + scope: 'write:notes', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + await assertDirectError(response, 400, 'invalid_request'); + }); + + test('No redirect_uri at authorization endpoint', async () => { + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + scope: 'write:notes', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + await assertDirectError(response, 400, 'invalid_request'); + }); + + test('Invalid redirect_uri at token endpoint', async () => { + const { code_challenge, code_verifier } = await pkceChallenge(128); + + const { client, code } = await fetchAuthorizationCode(alice, 'write:notes', code_challenge); + + await assert.rejects(client.getToken({ + code, + redirect_uri: 'http://127.0.0.2/', + code_verifier, + } as AuthorizationTokenConfigExtended), (err: GetTokenError) => { + assert.strictEqual(err.data.payload.error, 'invalid_grant'); + return true; + }); + }); + + test('Invalid redirect_uri including the valid one at token endpoint', async () => { + const { code_challenge, code_verifier } = await pkceChallenge(128); + + const { client, code } = await fetchAuthorizationCode(alice, 'write:notes', code_challenge); + + await assert.rejects(client.getToken({ + code, + redirect_uri: 'http://127.0.0.1/redirection', + code_verifier, + } as AuthorizationTokenConfigExtended), (err: GetTokenError) => { + assert.strictEqual(err.data.payload.error, 'invalid_grant'); + return true; + }); + }); + + test('No redirect_uri at token endpoint', async () => { + const { code_challenge, code_verifier } = await pkceChallenge(128); + + const { client, code } = await fetchAuthorizationCode(alice, 'write:notes', code_challenge); + + await assert.rejects(client.getToken({ + code, + code_verifier, + } as AuthorizationTokenConfigExtended), (err: GetTokenError) => { + assert.strictEqual(err.data.payload.error, 'invalid_grant'); + return true; + }); + }); + }); + + // https://datatracker.ietf.org/doc/html/rfc8414 + test('Server metadata', async () => { + const response = await fetch(new URL('.well-known/oauth-authorization-server', host)); + assert.strictEqual(response.status, 200); + + const body = await response.json(); + assert.strictEqual(body.issuer, 'http://misskey.local'); + assert.ok(body.scopes_supported.includes('write:notes')); + }); + + // Any error on decision endpoint is solely on Misskey side and nothing to do with the client. + // Do not use indirect error here. + describe('Decision endpoint', () => { + test('No login token', async () => { + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL(basicAuthParams)); + assert.strictEqual(response.status, 200); + + const { transactionId } = getMeta(await response.text()); + assert.ok(transactionId); + + const decisionResponse = await fetch(new URL('/oauth/decision', host), { + method: 'post', + body: new URLSearchParams({ + transaction_id: transactionId, + }), + redirect: 'manual', + headers: { + 'content-type': 'application/x-www-form-urlencoded', + }, + }); + await assertDirectError(decisionResponse, 400, 'invalid_request'); + }); + + test('No transaction ID', async () => { + const decisionResponse = await fetch(new URL('/oauth/decision', host), { + method: 'post', + body: new URLSearchParams({ + login_token: alice.token, + }), + redirect: 'manual', + headers: { + 'content-type': 'application/x-www-form-urlencoded', + }, + }); + await assertDirectError(decisionResponse, 400, 'invalid_request'); + }); + + test('Invalid transaction ID', async () => { + const decisionResponse = await fetch(new URL('/oauth/decision', host), { + method: 'post', + body: new URLSearchParams({ + login_token: alice.token, + transaction_id: 'invalid_id', + }), + redirect: 'manual', + headers: { + 'content-type': 'application/x-www-form-urlencoded', + }, + }); + await assertDirectError(decisionResponse, 403, 'access_denied'); + }); + }); + + // Only authorization code grant is supported + describe('Grant type', () => { + test('Implicit grant is not supported', async () => { + const url = new URL('/oauth/authorize', host); + url.searchParams.append('response_type', 'token'); + const response = await fetch(url); + assertDirectError(response, 501, 'unsupported_response_type'); + }); + + test('Resource owner grant is not supported', async () => { + const client = new ResourceOwnerPassword({ + ...clientConfig, + auth: { + tokenHost: host, + tokenPath: '/oauth/token', + }, + }); + + await assert.rejects(client.getToken({ + username: 'alice', + password: 'test', + }), (err: GetTokenError) => { + assert.strictEqual(err.data.payload.error, 'unsupported_grant_type'); + return true; + }); + }); + + test('Client credential grant is not supported', async () => { + const client = new ClientCredentials({ + ...clientConfig, + auth: { + tokenHost: host, + tokenPath: '/oauth/token', + }, + }); + + await assert.rejects(client.getToken({}), (err: GetTokenError) => { + assert.strictEqual(err.data.payload.error, 'unsupported_grant_type'); + return true; + }); + }); + }); + + // https://indieauth.spec.indieweb.org/#client-information-discovery + describe('Client Information Discovery', () => { + describe('Redirection', () => { + const tests: Record void> = { + 'Read HTTP header': reply => { + reply.header('Link', '; rel="redirect_uri"'); + reply.send(` + +
Misklient + `); + }, + 'Mixed links': reply => { + reply.header('Link', '; rel="redirect_uri"'); + reply.send(` + + +
Misklient + `); + }, + 'Multiple items in Link header': reply => { + reply.header('Link', '; rel="redirect_uri",; rel="redirect_uri"'); + reply.send(` + +
Misklient + `); + }, + 'Multiple items in HTML': reply => { + reply.send(` + + + +
Misklient + `); + }, + }; + + for (const [title, replyFunc] of Object.entries(tests)) { + test(title, async () => { + sender = replyFunc; + + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + assert.strictEqual(response.status, 200); + }); + } + + test('No item', async () => { + sender = (reply): void => { + reply.send(` + +
Misklient + `); + }; + + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + + // direct error because there's no redirect URI to ping + await assertDirectError(response, 400, 'invalid_request'); + }); + }); + + test('Disallow loopback', async () => { + process.env.MISSKEY_TEST_CHECK_IP_RANGE = '1'; + + const client = new AuthorizationCode(clientConfig); + const response = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + await assertDirectError(response, 400, 'invalid_request'); + }); + + test('Missing name', async () => { + sender = (reply): void => { + reply.header('Link', '; rel="redirect_uri"'); + reply.send(); + }; + + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + assert.strictEqual(response.status, 200); + assert.strictEqual(getMeta(await response.text()).clientName, `http://127.0.0.1:${clientPort}/`); + }); + + test('Mismatching URL in h-app', async () => { + sender = (reply): void => { + reply.header('Link', '; rel="redirect_uri"'); + reply.send(` + +
Misklient + `); + reply.send(); + }; + + const client = new AuthorizationCode(clientConfig); + + const response = await fetch(client.authorizeURL({ + redirect_uri, + scope: 'write:notes', + state: 'state', + code_challenge: 'code', + code_challenge_method: 'S256', + } as AuthorizationParamsExtended)); + assert.strictEqual(response.status, 200); + assert.strictEqual(getMeta(await response.text()).clientName, `http://127.0.0.1:${clientPort}/`); + }); + }); + + test('Unknown OAuth endpoint', async () => { + const response = await fetch(new URL('/oauth/foo', host)); + assert.strictEqual(response.status, 404); + }); +}); diff --git a/packages/backend/test/e2e/streaming.ts b/packages/backend/test/e2e/streaming.ts index 0dd97069a0..77de144882 100644 --- a/packages/backend/test/e2e/streaming.ts +++ b/packages/backend/test/e2e/streaming.ts @@ -6,7 +6,7 @@ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; -import { MiFollowing } from '@/models/entities/Following.js'; +import { MiFollowing } from '@/models/Following.js'; import { connectStream, signup, api, post, startServer, initTestDb, waitFire } from '../utils.js'; import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; diff --git a/packages/backend/test/e2e/users.ts b/packages/backend/test/e2e/users.ts index 72f8034b61..ae71ff0f5a 100644 --- a/packages/backend/test/e2e/users.ts +++ b/packages/backend/test/e2e/users.ts @@ -103,6 +103,7 @@ describe('ユーザー', () => { birthday: user.birthday, lang: user.lang, fields: user.fields, + verifiedLinks: user.verifiedLinks, followersCount: user.followersCount, followingCount: user.followingCount, notesCount: user.notesCount, @@ -132,6 +133,7 @@ describe('ユーザー', () => { isBlocked: user.isBlocked ?? false, isMuted: user.isMuted ?? false, isRenoteMuted: user.isRenoteMuted ?? false, + notify: user.notify ?? 'none', }); }; @@ -153,7 +155,7 @@ describe('ユーザー', () => { preventAiLearning: user.preventAiLearning, isExplorable: user.isExplorable, isDeleted: user.isDeleted, - twoFactorBackupCodes: user.twoFactorBackupCodes, + twoFactorBackupCodesStock: user.twoFactorBackupCodesStock, hideOnlineStatus: user.hideOnlineStatus, hasUnreadSpecifiedNotes: user.hasUnreadSpecifiedNotes, hasUnreadMentions: user.hasUnreadMentions, @@ -371,6 +373,7 @@ describe('ユーザー', () => { assert.strictEqual(response.birthday, null); assert.strictEqual(response.lang, null); assert.deepStrictEqual(response.fields, []); + assert.deepStrictEqual(response.verifiedLinks, []); assert.strictEqual(response.followersCount, 0); assert.strictEqual(response.followingCount, 0); assert.strictEqual(response.notesCount, 0); @@ -401,7 +404,7 @@ describe('ユーザー', () => { assert.strictEqual(response.preventAiLearning, true); assert.strictEqual(response.isExplorable, true); assert.strictEqual(response.isDeleted, false); - assert.strictEqual(response.twoFactorBackupCodes, 'none'); + assert.strictEqual(response.twoFactorBackupCodesStock, 'none'); assert.strictEqual(response.hideOnlineStatus, false); assert.strictEqual(response.hasUnreadSpecifiedNotes, false); assert.strictEqual(response.hasUnreadMentions, false); @@ -494,7 +497,7 @@ describe('ユーザー', () => { { parameters: (): object => ({ mutedWords: [] }) }, { parameters: (): object => ({ mutedInstances: ['xxxx.xxxxx'] }) }, { parameters: (): object => ({ mutedInstances: [] }) }, - { parameters: (): object => ({ mutingNotificationTypes: ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app'] }) }, + { parameters: (): object => ({ mutingNotificationTypes: ['note', 'follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app'] }) }, { parameters: (): object => ({ mutingNotificationTypes: [] }) }, { parameters: (): object => ({ emailNotificationTypes: ['mention', 'reply', 'quote', 'follow', 'receiveFollowRequest'] }) }, { parameters: (): object => ({ emailNotificationTypes: [] }) }, diff --git a/packages/backend/test/misc/mock-resolver.ts b/packages/backend/test/misc/mock-resolver.ts index 257a9c859f..7cba7a2aa8 100644 --- a/packages/backend/test/misc/mock-resolver.ts +++ b/packages/backend/test/misc/mock-resolver.ts @@ -15,7 +15,7 @@ import type { LoggerService } from '@/core/LoggerService.js'; import type { MetaService } from '@/core/MetaService.js'; import type { UtilityService } from '@/core/UtilityService.js'; import { bindThis } from '@/decorators.js'; -import type { NoteReactionsRepository, NotesRepository, PollsRepository, UsersRepository } from '@/models/index.js'; +import type { NoteReactionsRepository, NotesRepository, PollsRepository, UsersRepository, FollowRequestsRepository } from '@/models/_.js'; type MockResponse = { type: string; @@ -33,6 +33,7 @@ export class MockResolver extends Resolver { {} as NotesRepository, {} as PollsRepository, {} as NoteReactionsRepository, + {} as FollowRequestsRepository, {} as UtilityService, {} as InstanceActorService, {} as MetaService, diff --git a/packages/backend/test/tsconfig.json b/packages/backend/test/tsconfig.json index 21afe1aaf3..4597ff8780 100644 --- a/packages/backend/test/tsconfig.json +++ b/packages/backend/test/tsconfig.json @@ -10,8 +10,8 @@ "declaration": false, "sourceMap": true, "target": "ES2022", - "module": "es2020", - "moduleResolution": "node16", + "module": "nodenext", + "moduleResolution": "nodenext", "allowSyntheticDefaultImports": true, "removeComments": false, "noLib": false, diff --git a/packages/backend/test/unit/AnnouncementService.ts b/packages/backend/test/unit/AnnouncementService.ts index 90554e4117..8f61d91ba9 100644 --- a/packages/backend/test/unit/AnnouncementService.ts +++ b/packages/backend/test/unit/AnnouncementService.ts @@ -5,19 +5,19 @@ process.env.NODE_ENV = 'test'; +import { jest } from '@jest/globals'; import { ModuleMocker } from 'jest-mock'; import { Test } from '@nestjs/testing'; -import { jest } from '@jest/globals'; -import type { MiAnnouncement, AnnouncementsRepository, AnnouncementReadsRepository, UsersRepository, MiUser } from '@/models/index.js'; -import { secureRndstr } from '@/misc/secure-rndstr.js'; import { GlobalModule } from '@/GlobalModule.js'; -import { IdService } from '@/core/IdService.js'; -import { AnnouncementEntityService } from '@/core/entities/AnnouncementEntityService.js'; import { AnnouncementService } from '@/core/AnnouncementService.js'; +import type { MiAnnouncement, AnnouncementsRepository, AnnouncementReadsRepository, UsersRepository, MiUser } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; +import { genAidx } from '@/misc/id/aidx.js'; import { CacheService } from '@/core/CacheService.js'; -import { genAid } from '@/misc/id/aid.js'; +import { IdService } from '@/core/IdService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; +import { ModerationLogService } from '@/core/ModerationLogService.js'; +import { secureRndstr } from '@/misc/secure-rndstr.js'; import type { TestingModule } from '@nestjs/testing'; import type { MockFunctionMetadata } from 'jest-mock'; @@ -30,11 +30,12 @@ describe('AnnouncementService', () => { let announcementsRepository: AnnouncementsRepository; let announcementReadsRepository: AnnouncementReadsRepository; let globalEventService: jest.Mocked; + let moderationLogService: jest.Mocked; function createUser(data: Partial = {}) { const un = secureRndstr(16); return usersRepository.insert({ - id: genAid(new Date()), + id: genAidx(new Date()), createdAt: new Date(), username: un, usernameLower: un, @@ -45,7 +46,7 @@ describe('AnnouncementService', () => { function createAnnouncement(data: Partial = {}) { return announcementsRepository.insert({ - id: genAid(new Date()), + id: genAidx(new Date()), createdAt: new Date(), updatedAt: null, title: 'Title', @@ -61,7 +62,6 @@ describe('AnnouncementService', () => { GlobalModule, ], providers: [ - AnnouncementEntityService, AnnouncementService, CacheService, IdService, @@ -73,8 +73,11 @@ describe('AnnouncementService', () => { publishMainStream: jest.fn(), publishBroadcastStream: jest.fn(), }; - } - if (typeof token === 'function') { + } else if (token === ModerationLogService) { + return { + log: jest.fn(), + }; + } else if (typeof token === 'function') { const mockMetadata = moduleMocker.getMetadata(token) as MockFunctionMetadata; const Mock = moduleMocker.generateFromMetadata(mockMetadata); return new Mock(); @@ -89,6 +92,7 @@ describe('AnnouncementService', () => { announcementsRepository = app.get(DI.announcementsRepository); announcementReadsRepository = app.get(DI.announcementReadsRepository); globalEventService = app.get(GlobalEventService) as jest.Mocked; + moderationLogService = app.get(ModerationLogService) as jest.Mocked; }); afterEach(async () => { @@ -157,10 +161,11 @@ describe('AnnouncementService', () => { describe('create', () => { test('通常', async () => { + const me = await createUser(); const result = await announcementService.create({ title: 'Title', text: 'Text', - }); + }, me); expect(result.raw.title).toBe('Title'); expect(result.packed.title).toBe('Title'); @@ -168,15 +173,17 @@ describe('AnnouncementService', () => { expect(globalEventService.publishBroadcastStream).toHaveBeenCalled(); expect(globalEventService.publishBroadcastStream.mock.lastCall![0]).toBe('announcementCreated'); expect((globalEventService.publishBroadcastStream.mock.lastCall![1] as any).announcement).toBe(result.packed); + expect(moderationLogService.log).toHaveBeenCalled(); }); test('ユーザー指定', async () => { + const me = await createUser(); const user = await createUser(); const result = await announcementService.create({ title: 'Title', text: 'Text', userId: user.id, - }); + }, me); expect(result.raw.title).toBe('Title'); expect(result.packed.title).toBe('Title'); @@ -186,6 +193,7 @@ describe('AnnouncementService', () => { expect(globalEventService.publishMainStream.mock.lastCall![0]).toBe(user.id); expect(globalEventService.publishMainStream.mock.lastCall![1]).toBe('announcementCreated'); expect((globalEventService.publishMainStream.mock.lastCall![2] as any).announcement).toBe(result.packed); + expect(moderationLogService.log).toHaveBeenCalled(); }); }); diff --git a/packages/backend/test/unit/FetchInstanceMetadataService.ts b/packages/backend/test/unit/FetchInstanceMetadataService.ts index 22ce023216..34200899d4 100644 --- a/packages/backend/test/unit/FetchInstanceMetadataService.ts +++ b/packages/backend/test/unit/FetchInstanceMetadataService.ts @@ -6,7 +6,6 @@ process.env.NODE_ENV = 'test'; import { jest } from '@jest/globals'; -import { ModuleMocker } from 'jest-mock'; import { Test } from '@nestjs/testing'; import { Redis } from 'ioredis'; import { GlobalModule } from '@/GlobalModule.js'; @@ -18,7 +17,6 @@ import { UtilityService } from '@/core/UtilityService.js'; import { IdService } from '@/core/IdService.js'; import { DI } from '@/di-symbols.js'; import type { TestingModule } from '@nestjs/testing'; -import type { MockFunctionMetadata } from 'jest-mock'; function mockRedis() { const hash = {}; @@ -35,9 +33,9 @@ describe('FetchInstanceMetadataService', () => { let fetchInstanceMetadataService: jest.Mocked; let federatedInstanceService: jest.Mocked; let httpRequestService: jest.Mocked; - let redisClient: jest.Mocked; + let redisClient: jest.Mocked; - beforeAll(async () => { + beforeEach(async () => { app = await Test .createTestingModule({ imports: [ @@ -64,11 +62,11 @@ describe('FetchInstanceMetadataService', () => { fetchInstanceMetadataService = app.get(FetchInstanceMetadataService); federatedInstanceService = app.get(FederatedInstanceService) as jest.Mocked; - redisClient = app.get(DI.redis) as jest.Mocked; + redisClient = app.get(DI.redis) as jest.Mocked; httpRequestService = app.get(HttpRequestService) as jest.Mocked; }); - afterAll(async () => { + afterEach(async () => { await app.close(); }); @@ -85,6 +83,7 @@ describe('FetchInstanceMetadataService', () => { expect(federatedInstanceService.fetch).toHaveBeenCalledTimes(1); expect(httpRequestService.getJson).toHaveBeenCalled(); }); + test('Lock and don\'t update', async () => { redisClient.set = mockRedis(); const now = Date.now(); @@ -98,6 +97,7 @@ describe('FetchInstanceMetadataService', () => { expect(federatedInstanceService.fetch).toHaveBeenCalledTimes(1); expect(httpRequestService.getJson).toHaveBeenCalledTimes(0); }); + test('Do nothing when lock not acquired', async () => { redisClient.set = mockRedis(); federatedInstanceService.fetch.mockReturnValue({ infoUpdatedAt: { getTime: () => now - 10 * 1000 * 60 * 60 * 24 } }); diff --git a/packages/backend/test/unit/MetaService.ts b/packages/backend/test/unit/MetaService.ts index 2b6e52914e..ab30f48283 100644 --- a/packages/backend/test/unit/MetaService.ts +++ b/packages/backend/test/unit/MetaService.ts @@ -9,7 +9,7 @@ import { jest } from '@jest/globals'; import { ModuleMocker } from 'jest-mock'; import { Test } from '@nestjs/testing'; import { GlobalModule } from '@/GlobalModule.js'; -import type { MetasRepository } from '@/models/index.js'; +import type { MetasRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { MetaService } from '@/core/MetaService.js'; import { CoreModule } from '@/core/CoreModule.js'; diff --git a/packages/backend/test/unit/RelayService.ts b/packages/backend/test/unit/RelayService.ts index ae20acd060..f780a25388 100644 --- a/packages/backend/test/unit/RelayService.ts +++ b/packages/backend/test/unit/RelayService.ts @@ -15,7 +15,7 @@ import { CreateSystemUserService } from '@/core/CreateSystemUserService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { QueueService } from '@/core/QueueService.js'; import { IdService } from '@/core/IdService.js'; -import type { RelaysRepository } from '@/models/index.js'; +import type { RelaysRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import type { TestingModule } from '@nestjs/testing'; import type { MockFunctionMetadata } from 'jest-mock'; diff --git a/packages/backend/test/unit/RoleService.ts b/packages/backend/test/unit/RoleService.ts index 22ec5e95e6..c6a14702ae 100644 --- a/packages/backend/test/unit/RoleService.ts +++ b/packages/backend/test/unit/RoleService.ts @@ -11,10 +11,10 @@ import { Test } from '@nestjs/testing'; import * as lolex from '@sinonjs/fake-timers'; import { GlobalModule } from '@/GlobalModule.js'; import { RoleService } from '@/core/RoleService.js'; -import type { MiRole, RolesRepository, RoleAssignmentsRepository, UsersRepository, MiUser } from '@/models/index.js'; +import type { MiRole, RolesRepository, RoleAssignmentsRepository, UsersRepository, MiUser } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { MetaService } from '@/core/MetaService.js'; -import { genAid } from '@/misc/id/aid.js'; +import { genAidx } from '@/misc/id/aidx.js'; import { CacheService } from '@/core/CacheService.js'; import { IdService } from '@/core/IdService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; @@ -37,7 +37,7 @@ describe('RoleService', () => { function createUser(data: Partial = {}) { const un = secureRndstr(16); return usersRepository.insert({ - id: genAid(new Date()), + id: genAidx(new Date()), createdAt: new Date(), username: un, usernameLower: un, @@ -48,7 +48,7 @@ describe('RoleService', () => { function createRole(data: Partial = {}) { return rolesRepository.insert({ - id: genAid(new Date()), + id: genAidx(new Date()), createdAt: new Date(), updatedAt: new Date(), lastUsedAt: new Date(), @@ -204,7 +204,7 @@ describe('RoleService', () => { createdAt: new Date(Date.now() - (1000 * 60 * 60 * 24 * 365)), followersCount: 10, }); - const role = await createRole({ + await createRole({ name: 'a', policies: { canManageCustomEmojis: { diff --git a/packages/backend/test/unit/S3Service.ts b/packages/backend/test/unit/S3Service.ts index e3e429e8d5..c1eafc96b7 100644 --- a/packages/backend/test/unit/S3Service.ts +++ b/packages/backend/test/unit/S3Service.ts @@ -10,8 +10,8 @@ import { UploadPartCommand, CompleteMultipartUploadCommand, CreateMultipartUploa import { mockClient } from 'aws-sdk-client-mock'; import { GlobalModule } from '@/GlobalModule.js'; import { CoreModule } from '@/core/CoreModule.js'; -import { S3Service } from '@/core/S3Service'; -import { MiMeta } from '@/models'; +import { S3Service } from '@/core/S3Service.js'; +import { MiMeta } from '@/models/_.js'; import type { TestingModule } from '@nestjs/testing'; describe('S3Service', () => { diff --git a/packages/backend/test/unit/activitypub.ts b/packages/backend/test/unit/activitypub.ts index 0a8c99e0ba..dbc446d12d 100644 --- a/packages/backend/test/unit/activitypub.ts +++ b/packages/backend/test/unit/activitypub.ts @@ -18,11 +18,11 @@ import { CoreModule } from '@/core/CoreModule.js'; import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; import { LoggerService } from '@/core/LoggerService.js'; import type { IActor, IApDocument, ICollection, IPost } from '@/core/activitypub/type.js'; -import { MiMeta, MiNote } from '@/models/index.js'; +import { MiMeta, MiNote } from '@/models/_.js'; import { secureRndstr } from '@/misc/secure-rndstr.js'; import { DownloadService } from '@/core/DownloadService.js'; import { MetaService } from '@/core/MetaService.js'; -import type { MiRemoteUser } from '@/models/entities/User.js'; +import type { MiRemoteUser } from '@/models/User.js'; import { MockResolver } from '../misc/mock-resolver.js'; const host = 'https://host1.test'; @@ -259,6 +259,21 @@ describe('ActivityPub', () => { assert.strictEqual(note.text, 'test test foo'); assert.strictEqual(note.uri, actor2Note.id); }); + + test('Fetch a note that is a featured note of the attributed actor', async () => { + const actor = createRandomActor(); + actor.featured = `${actor.id}/collections/featured`; + + const featured = createRandomFeaturedCollection(actor, 5); + const firstNote = (featured.items as NonTransientIPost[])[0]; + + resolver.register(actor.id, actor); + resolver.register(actor.featured, featured); + resolver.register(firstNote.id, firstNote); + + const note = await noteService.createNote(firstNote.id as string, resolver); + assert.strictEqual(note?.uri, firstNote.id); + }); }); describe('Images', () => { diff --git a/packages/backend/test/unit/chart.ts b/packages/backend/test/unit/chart.ts index a419083e7d..036e73fd5e 100644 --- a/packages/backend/test/unit/chart.ts +++ b/packages/backend/test/unit/chart.ts @@ -18,7 +18,7 @@ import { entity as TestGroupedChartEntity } from '@/core/chart/charts/entities/t import { entity as TestUniqueChartEntity } from '@/core/chart/charts/entities/test-unique.js'; import { entity as TestIntersectionChartEntity } from '@/core/chart/charts/entities/test-intersection.js'; import { loadConfig } from '@/config.js'; -import type { AppLockService } from '@/core/AppLockService'; +import type { AppLockService } from '@/core/AppLockService.js'; import Logger from '@/logger.js'; describe('Chart', () => { diff --git a/packages/backend/test/unit/misc/correct-filename.ts b/packages/backend/test/unit/misc/correct-filename.ts new file mode 100644 index 0000000000..0c4482e0bf --- /dev/null +++ b/packages/backend/test/unit/misc/correct-filename.ts @@ -0,0 +1,48 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { correctFilename } from '@/misc/correct-filename.js'; + +describe(correctFilename, () => { + it('no ext to null', () => { + expect(correctFilename('test', null)).toBe('test.unknown'); + }); + it('no ext to jpg', () => { + expect(correctFilename('test', 'jpg')).toBe('test.jpg'); + }); + it('jpg to webp', () => { + expect(correctFilename('test.jpg', 'webp')).toBe('test.jpg.webp'); + }); + it('jpg to .webp', () => { + expect(correctFilename('test.jpg', '.webp')).toBe('test.jpg.webp'); + }); + it('jpeg to jpg', () => { + expect(correctFilename('test.jpeg', 'jpg')).toBe('test.jpeg'); + }); + it('JPEG to jpg', () => { + expect(correctFilename('test.JPEG', 'jpg')).toBe('test.JPEG'); + }); + it('jpg to jpg', () => { + expect(correctFilename('test.jpg', 'jpg')).toBe('test.jpg'); + }); + it('JPG to jpg', () => { + expect(correctFilename('test.JPG', 'jpg')).toBe('test.JPG'); + }); + it('tiff to tif', () => { + expect(correctFilename('test.tiff', 'tif')).toBe('test.tiff'); + }); + it('skip gz', () => { + expect(correctFilename('test.unitypackage', 'gz')).toBe('test.unitypackage'); + }); + it('skip text file', () => { + expect(correctFilename('test.txt', null)).toBe('test.txt'); + }); + it('unknown', () => { + expect(correctFilename('test.hoge', null)).toBe('test.hoge'); + }); + test('non ascii with space', () => { + expect(correctFilename('ファイル 名前', 'jpg')).toBe('ファイル 名前.jpg'); + }); +}); diff --git a/packages/backend/test/unit/misc/id.ts b/packages/backend/test/unit/misc/id.ts index 8cc2ea425f..57b4ea9947 100644 --- a/packages/backend/test/unit/misc/id.ts +++ b/packages/backend/test/unit/misc/id.ts @@ -6,6 +6,7 @@ import { ulid } from 'ulid'; import { describe, test, expect } from '@jest/globals'; import { aidRegExp, genAid, parseAid } from '@/misc/id/aid.js'; +import { aidxRegExp, genAidx, parseAidx } from '@/misc/id/aidx.js'; import { genMeid, meidRegExp, parseMeid } from '@/misc/id/meid.js'; import { genMeidg, meidgRegExp, parseMeidg } from '@/misc/id/meidg.js'; import { genObjectId, objectIdRegExp, parseObjectId } from '@/misc/id/object-id.js'; @@ -19,6 +20,13 @@ describe('misc:id', () => { expect(parseAid(gotAid).date.getTime()).toBe(date.getTime()); }); + test('aidx', () => { + const date = new Date(); + const gotAidx = genAidx(date); + expect(gotAidx).toMatch(aidxRegExp); + expect(parseAidx(gotAidx).date.getTime()).toBe(date.getTime()); + }); + test('meid', () => { const date = new Date(); const gotMeid = genMeid(date); diff --git a/packages/backend/test/unit/misc/others.ts b/packages/backend/test/unit/misc/others.ts index e2e484dfd7..b16d26d866 100644 --- a/packages/backend/test/unit/misc/others.ts +++ b/packages/backend/test/unit/misc/others.ts @@ -5,7 +5,6 @@ import { describe, test, expect } from '@jest/globals'; import { contentDisposition } from '@/misc/content-disposition.js'; -import { correctFilename } from '@/misc/correct-filename.js'; describe('misc:content-disposition', () => { test('inline', () => { @@ -18,30 +17,3 @@ describe('misc:content-disposition', () => { expect(contentDisposition('attachment', 'ファイル名')).toBe('attachment; filename=\"_____\"; filename*=UTF-8\'\'%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%90%8D'); }); }); - -describe('misc:correct-filename', () => { - test('simple', () => { - expect(correctFilename('filename', 'jpg')).toBe('filename.jpg'); - }); - test('with same ext', () => { - expect(correctFilename('filename.jpg', 'jpg')).toBe('filename.jpg'); - }); - test('.ext', () => { - expect(correctFilename('filename.jpg', '.jpg')).toBe('filename.jpg'); - }); - test('with different ext', () => { - expect(correctFilename('filename.webp', 'jpg')).toBe('filename.webp.jpg'); - }); - test('non ascii with space', () => { - expect(correctFilename('ファイル 名前', 'jpg')).toBe('ファイル 名前.jpg'); - }); - test('jpeg', () => { - expect(correctFilename('filename.jpeg', 'jpg')).toBe('filename.jpeg'); - }); - test('tiff', () => { - expect(correctFilename('filename.tiff', 'tif')).toBe('filename.tiff'); - }); - test('null ext', () => { - expect(correctFilename('filename', null)).toBe('filename.unknown'); - }); -}); diff --git a/packages/backend/test/utils.ts b/packages/backend/test/utils.ts index 8f78a4d833..2811bbce30 100644 --- a/packages/backend/test/utils.ts +++ b/packages/backend/test/utils.ts @@ -8,7 +8,7 @@ import { readFile } from 'node:fs/promises'; import { isAbsolute, basename } from 'node:path'; import { inspect } from 'node:util'; import WebSocket, { ClientOptions } from 'ws'; -import fetch, { Blob, File, RequestInit } from 'node-fetch'; +import fetch, { File, RequestInit } from 'node-fetch'; import { DataSource } from 'typeorm'; import { JSDOM } from 'jsdom'; import { DEFAULT_POLICIES } from '@/core/RoleService.js'; @@ -95,7 +95,7 @@ const request = async (path: string, params: any, me?: UserToken): Promise<{ sta }; }; -const relativeFetch = async (path: string, init?: RequestInit | undefined) => { +export const relativeFetch = async (path: string, init?: RequestInit | undefined) => { return await fetch(new URL(path, `http://127.0.0.1:${port}/`).toString(), init); }; diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json index 9e24ec2433..2b15a5cc7a 100644 --- a/packages/backend/tsconfig.json +++ b/packages/backend/tsconfig.json @@ -10,8 +10,8 @@ "declaration": false, "sourceMap": false, "target": "ES2022", - "module": "ESNext", - "moduleResolution": "node16", + "module": "nodenext", + "moduleResolution": "nodenext", "allowSyntheticDefaultImports": true, "removeComments": false, "noLib": false, @@ -35,7 +35,7 @@ "typeRoots": [ "./src/@types", "./node_modules/@types", - "./node_modules", + "./node_modules" ], "lib": [ "esnext" diff --git a/packages/frontend/.eslintrc.js b/packages/frontend/.eslintrc.cjs similarity index 97% rename from packages/frontend/.eslintrc.js rename to packages/frontend/.eslintrc.cjs index 24c3ad4b83..77038f0dfa 100644 --- a/packages/frontend/.eslintrc.js +++ b/packages/frontend/.eslintrc.cjs @@ -21,9 +21,6 @@ module.exports = { 'allowSingleExtends': true, }, ], - '@typescript-eslint/prefer-nullish-coalescing': [ - 'error', - ], // window の禁止理由: グローバルスコープと衝突し、予期せぬ結果を招くため // e の禁止理由: error や event など、複数のキーワードの頭文字であり分かりにくいため 'id-denylist': ['error', 'window', 'e'], diff --git a/packages/frontend/.storybook/changes.ts b/packages/frontend/.storybook/changes.ts index a1275132be..0cc648fbae 100644 --- a/packages/frontend/.storybook/changes.ts +++ b/packages/frontend/.storybook/changes.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import fs from 'node:fs/promises'; import { fileURLToPath } from 'node:url'; import path from 'node:path'; diff --git a/packages/frontend/.storybook/fakes.ts b/packages/frontend/.storybook/fakes.ts index 4ad5debeca..d4b509298c 100644 --- a/packages/frontend/.storybook/fakes.ts +++ b/packages/frontend/.storybook/fakes.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import type { entities } from 'misskey-js' export function abuseUserReport() { @@ -84,6 +89,7 @@ export function userDetailed(id = 'someuserid', username = 'miskist', host = 'mi value: 'https://misskey-hub.net', }, ], + verifiedLinks: [], followersCount: 1024, followingCount: 16, hasPendingFollowRequestFromYou: false, @@ -111,10 +117,11 @@ export function userDetailed(id = 'someuserid', username = 'miskist', host = 'mi publicReactions: false, securityKeys: false, twoFactorEnabled: false, - twoFactorBackupCodes: 'none', + twoFactorBackupCodesStock: 'none', updatedAt: null, uri: null, url: null, + notify: 'none', }; } diff --git a/packages/frontend/.storybook/generate.tsx b/packages/frontend/.storybook/generate.tsx index d47d8672c7..d61df9e7be 100644 --- a/packages/frontend/.storybook/generate.tsx +++ b/packages/frontend/.storybook/generate.tsx @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { existsSync, readFileSync } from 'node:fs'; import { writeFile } from 'node:fs/promises'; import { basename, dirname } from 'node:path/posix'; diff --git a/packages/frontend/.storybook/main.ts b/packages/frontend/.storybook/main.ts index b64979980a..a450f8b46b 100644 --- a/packages/frontend/.storybook/main.ts +++ b/packages/frontend/.storybook/main.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; import type { StorybookConfig } from '@storybook/vue3-vite'; diff --git a/packages/frontend/.storybook/manager.ts b/packages/frontend/.storybook/manager.ts index 5653deee84..8f501111d0 100644 --- a/packages/frontend/.storybook/manager.ts +++ b/packages/frontend/.storybook/manager.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { addons } from '@storybook/manager-api'; import { create } from '@storybook/theming/create'; diff --git a/packages/frontend/.storybook/mocks.ts b/packages/frontend/.storybook/mocks.ts index 4091e39686..b60755feea 100644 --- a/packages/frontend/.storybook/mocks.ts +++ b/packages/frontend/.storybook/mocks.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { type SharedOptions, rest } from 'msw'; export const onUnhandledRequest = ((req, print) => { diff --git a/packages/frontend/.storybook/preload-locale.ts b/packages/frontend/.storybook/preload-locale.ts index 2b7362b88d..349cc13508 100644 --- a/packages/frontend/.storybook/preload-locale.ts +++ b/packages/frontend/.storybook/preload-locale.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { writeFile } from 'node:fs/promises'; import locales from '../../../locales/index.js'; diff --git a/packages/frontend/.storybook/preload-theme.ts b/packages/frontend/.storybook/preload-theme.ts index 42fbeff738..ad2cf18a35 100644 --- a/packages/frontend/.storybook/preload-theme.ts +++ b/packages/frontend/.storybook/preload-theme.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { readFile, writeFile } from 'node:fs/promises'; import JSON5 from 'json5'; diff --git a/packages/frontend/.storybook/preview-head.html b/packages/frontend/.storybook/preview-head.html index f6a9a4875d..ed38e49647 100644 --- a/packages/frontend/.storybook/preview-head.html +++ b/packages/frontend/.storybook/preview-head.html @@ -1,6 +1,6 @@ - + diff --git a/packages/frontend/src/components/MkAutocomplete.stories.impl.ts b/packages/frontend/src/components/MkAutocomplete.stories.impl.ts index e363859301..8232759ba0 100644 --- a/packages/frontend/src/components/MkAutocomplete.stories.impl.ts +++ b/packages/frontend/src/components/MkAutocomplete.stories.impl.ts @@ -13,7 +13,7 @@ import { userDetailed } from '../../.storybook/fakes'; import { commonHandlers } from '../../.storybook/mocks'; import MkAutocomplete from './MkAutocomplete.vue'; import MkInput from './MkInput.vue'; -import { tick } from '@/scripts/test-utils'; +import { tick } from '@/scripts/test-utils.js'; const common = { render(args) { return { diff --git a/packages/frontend/src/components/MkAutocomplete.vue b/packages/frontend/src/components/MkAutocomplete.vue index 0b9f93c6ee..7c4f910559 100644 --- a/packages/frontend/src/components/MkAutocomplete.vue +++ b/packages/frontend/src/components/MkAutocomplete.vue @@ -41,16 +41,16 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkButton.vue b/packages/frontend/src/components/MkButton.vue index 80d3292cbc..bcd58ae516 100644 --- a/packages/frontend/src/components/MkButton.vue +++ b/packages/frontend/src/components/MkButton.vue @@ -9,6 +9,8 @@ SPDX-License-Identifier: AGPL-3.0-only ref="el" class="_button" :class="[$style.root, { [$style.inline]: inline, [$style.primary]: primary, [$style.gradate]: gradate, [$style.danger]: danger, [$style.rounded]: rounded, [$style.full]: full, [$style.small]: small, [$style.large]: large, [$style.transparent]: transparent, [$style.asLike]: asLike }]" :type="type" + :name="name" + :value="value" @click="emit('click', $event)" @mousedown="onMousedown" > @@ -49,6 +51,8 @@ const props = defineProps<{ large?: boolean; transparent?: boolean; asLike?: boolean; + name?: string; + value?: string; }>(); const emit = defineEmits<{ diff --git a/packages/frontend/src/components/MkCaptcha.vue b/packages/frontend/src/components/MkCaptcha.vue index d28b37121d..14e59acad2 100644 --- a/packages/frontend/src/components/MkCaptcha.vue +++ b/packages/frontend/src/components/MkCaptcha.vue @@ -12,8 +12,8 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkFoldableSection.vue b/packages/frontend/src/components/MkFoldableSection.vue index da58586e24..ed3cb0868b 100644 --- a/packages/frontend/src/components/MkFoldableSection.vue +++ b/packages/frontend/src/components/MkFoldableSection.vue @@ -30,8 +30,8 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index 0ebdfc46d4..06663d0477 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -11,7 +11,12 @@ SPDX-License-Identifier: AGPL-3.0-only v-hotkey="keymap" :class="$style.root" > - +
+
+ {{ i18n.ts.loadConversation }} +
+ +
@@ -125,7 +130,47 @@ SPDX-License-Identifier: AGPL-3.0-only - +
+ + + +
+
+
+
+ {{ i18n.ts.loadReplies }} +
+ +
+
+ + + +
+
+
+ +
+ + + +
+
@@ -141,7 +186,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkNotePreview.vue b/packages/frontend/src/components/MkNotePreview.vue index 3cc84283c0..fc6ea89085 100644 --- a/packages/frontend/src/components/MkNotePreview.vue +++ b/packages/frontend/src/components/MkNotePreview.vue @@ -21,7 +21,7 @@ SPDX-License-Identifier: AGPL-3.0-only + + diff --git a/packages/frontend/src/components/MkReactionEffect.vue b/packages/frontend/src/components/MkReactionEffect.vue index f373d179e8..88e262d880 100644 --- a/packages/frontend/src/components/MkReactionEffect.vue +++ b/packages/frontend/src/components/MkReactionEffect.vue @@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only - - diff --git a/packages/frontend/src/components/MkRetentionHeatmap.vue b/packages/frontend/src/components/MkRetentionHeatmap.vue index 737ddff6ad..3dc9a94ae2 100644 --- a/packages/frontend/src/components/MkRetentionHeatmap.vue +++ b/packages/frontend/src/components/MkRetentionHeatmap.vue @@ -15,11 +15,11 @@ SPDX-License-Identifier: AGPL-3.0-only + + diff --git a/packages/frontend/src/components/MkSwitch.vue b/packages/frontend/src/components/MkSwitch.vue index 42823b88f0..8e946e7437 100644 --- a/packages/frontend/src/components/MkSwitch.vue +++ b/packages/frontend/src/components/MkSwitch.vue @@ -12,9 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only :class="$style.input" @keydown.enter="toggle" > - -
-
+ @@ -30,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkUserCardMini.vue b/packages/frontend/src/components/MkUserCardMini.vue index 25b3a6f834..2daf04baad 100644 --- a/packages/frontend/src/components/MkUserCardMini.vue +++ b/packages/frontend/src/components/MkUserCardMini.vue @@ -15,14 +15,14 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkUserList.vue b/packages/frontend/src/components/MkUserList.vue index 1cd491a9d5..56a61dce23 100644 --- a/packages/frontend/src/components/MkUserList.vue +++ b/packages/frontend/src/components/MkUserList.vue @@ -23,8 +23,8 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/page/page.note.vue b/packages/frontend/src/components/page/page.note.vue index 82ffcfc867..d052ce2c1f 100644 --- a/packages/frontend/src/components/page/page.note.vue +++ b/packages/frontend/src/components/page/page.note.vue @@ -16,7 +16,7 @@ import * as Misskey from 'misskey-js'; import { NoteBlock } from './block.type'; import MkNote from '@/components/MkNote.vue'; import MkNoteDetailed from '@/components/MkNoteDetailed.vue'; -import * as os from '@/os'; +import * as os from '@/os.js'; const props = defineProps<{ block: NoteBlock, diff --git a/packages/frontend/src/components/page/page.text.vue b/packages/frontend/src/components/page/page.text.vue index 9cb32acb81..35021be95e 100644 --- a/packages/frontend/src/components/page/page.text.vue +++ b/packages/frontend/src/components/page/page.text.vue @@ -15,8 +15,8 @@ import { defineAsyncComponent } from 'vue'; import * as mfm from 'mfm-js'; import * as Misskey from 'misskey-js'; import { TextBlock } from './block.type'; -import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm'; -import { $i } from '@/account'; +import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js'; +import { $i } from '@/account.js'; const MkUrlPreview = defineAsyncComponent(() => import('@/components/MkUrlPreview.vue')); diff --git a/packages/frontend/src/components/page/page.vue b/packages/frontend/src/components/page/page.vue index 265ee7146d..ab37ca69ad 100644 --- a/packages/frontend/src/components/page/page.vue +++ b/packages/frontend/src/components/page/page.vue @@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only --> diff --git a/packages/frontend/src/config.ts b/packages/frontend/src/config.ts index 9ce3f8fa15..60fc8c9d34 100644 --- a/packages/frontend/src/config.ts +++ b/packages/frontend/src/config.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { miLocalStorage } from './local-storage'; +import { miLocalStorage } from '@/local-storage.js'; const address = new URL(location.href); const siteName = document.querySelector('meta[property="og:site_name"]')?.content; diff --git a/packages/frontend/src/const.ts b/packages/frontend/src/const.ts index b3c4e9f888..b238d3e3f8 100644 --- a/packages/frontend/src/const.ts +++ b/packages/frontend/src/const.ts @@ -54,7 +54,7 @@ https://github.com/sindresorhus/file-type/blob/main/core.js https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers */ -export const notificationTypes = ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app'] as const; +export const notificationTypes = ['note', 'follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app'] as const; export const obsoleteNotificationTypes = ['pollVote', 'groupInvited'] as const; export const ROLE_POLICIES = [ diff --git a/packages/frontend/src/custom-emojis.ts b/packages/frontend/src/custom-emojis.ts index d08b8814e8..f2a4ac0098 100644 --- a/packages/frontend/src/custom-emojis.ts +++ b/packages/frontend/src/custom-emojis.ts @@ -5,9 +5,9 @@ import { shallowRef, computed, markRaw, watch } from 'vue'; import * as Misskey from 'misskey-js'; -import { api, apiGet } from './os'; -import { useStream } from '@/stream'; -import { get, set, exist } from '@/scripts/idb-proxy'; +import { api, apiGet } from '@/os.js'; +import { useStream } from '@/stream.js'; +import { get, set, exist } from '@/scripts/idb-proxy.js'; const storageCache = await get('emojis'); export const customEmojis = shallowRef(Array.isArray(storageCache) ? storageCache : []); diff --git a/packages/frontend/src/directives/click-anime.ts b/packages/frontend/src/directives/click-anime.ts index f9c1fb4d21..2b3cdb27a5 100644 --- a/packages/frontend/src/directives/click-anime.ts +++ b/packages/frontend/src/directives/click-anime.ts @@ -4,7 +4,7 @@ */ import { Directive } from 'vue'; -import { defaultStore } from '@/store'; +import { defaultStore } from '@/store.js'; export default { mounted(el: HTMLElement, binding, vn) { diff --git a/packages/frontend/src/directives/follow-append.ts b/packages/frontend/src/directives/follow-append.ts index 1da28c718f..ae3e31e291 100644 --- a/packages/frontend/src/directives/follow-append.ts +++ b/packages/frontend/src/directives/follow-append.ts @@ -4,7 +4,7 @@ */ import { Directive } from 'vue'; -import { getScrollContainer, getScrollPosition } from '@/scripts/scroll'; +import { getScrollContainer, getScrollPosition } from '@/scripts/scroll.js'; export default { mounted(src, binding, vn) { diff --git a/packages/frontend/src/directives/ripple.ts b/packages/frontend/src/directives/ripple.ts index 4a11fbd406..cabd155c87 100644 --- a/packages/frontend/src/directives/ripple.ts +++ b/packages/frontend/src/directives/ripple.ts @@ -4,7 +4,7 @@ */ import MkRippleEffect from '@/components/MkRippleEffect.vue'; -import { popup } from '@/os'; +import { popup } from '@/os.js'; export default { mounted(el, binding, vn) { diff --git a/packages/frontend/src/directives/tooltip.ts b/packages/frontend/src/directives/tooltip.ts index f0e3cdabe4..5d6ec2928b 100644 --- a/packages/frontend/src/directives/tooltip.ts +++ b/packages/frontend/src/directives/tooltip.ts @@ -7,8 +7,8 @@ // ただディレクティブ内でonUnmountedなどのcomposition api使えるのか不明 import { defineAsyncComponent, Directive, ref } from 'vue'; -import { isTouchUsing } from '@/scripts/touch'; -import { popup, alert } from '@/os'; +import { isTouchUsing } from '@/scripts/touch.js'; +import { popup, alert } from '@/os.js'; const start = isTouchUsing ? 'touchstart' : 'mouseenter'; const end = isTouchUsing ? 'touchend' : 'mouseleave'; diff --git a/packages/frontend/src/directives/user-preview.ts b/packages/frontend/src/directives/user-preview.ts index 5fd65b0587..e0fd10047a 100644 --- a/packages/frontend/src/directives/user-preview.ts +++ b/packages/frontend/src/directives/user-preview.ts @@ -4,7 +4,7 @@ */ import { defineAsyncComponent, Directive, ref } from 'vue'; -import { popup } from '@/os'; +import { popup } from '@/os.js'; export class UserPreview { private el; diff --git a/packages/frontend/src/filters/date.ts b/packages/frontend/src/filters/date.ts index 1d878e2970..23541f1094 100644 --- a/packages/frontend/src/filters/date.ts +++ b/packages/frontend/src/filters/date.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { dateTimeFormat } from '@/scripts/intl-const'; +import { dateTimeFormat } from '@/scripts/intl-const.js'; export default (d: Date | number | undefined) => dateTimeFormat.format(d); export const dateString = (d: string) => dateTimeFormat.format(new Date(d)); diff --git a/packages/frontend/src/filters/number.ts b/packages/frontend/src/filters/number.ts index 6e0fde15b0..d0e4f4991f 100644 --- a/packages/frontend/src/filters/number.ts +++ b/packages/frontend/src/filters/number.ts @@ -3,6 +3,6 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { numberFormat } from '@/scripts/intl-const'; +import { numberFormat } from '@/scripts/intl-const.js'; export default n => n == null ? 'N/A' : numberFormat.format(n); diff --git a/packages/frontend/src/filters/user.ts b/packages/frontend/src/filters/user.ts index e0f1d3b783..8d20603725 100644 --- a/packages/frontend/src/filters/user.ts +++ b/packages/frontend/src/filters/user.ts @@ -3,15 +3,14 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import * as misskey from 'misskey-js'; -import * as Acct from 'misskey-js/built/acct'; -import { url } from '@/config'; +import * as Misskey from 'misskey-js'; +import { url } from '@/config.js'; export const acct = (user: misskey.Acct) => { - return Acct.toString(user); + return Misskey.acct.toString(user); }; -export const userName = (user: misskey.entities.User) => { +export const userName = (user: Misskey.entities.User) => { return user.name || user.username; }; diff --git a/packages/frontend/src/i18n.ts b/packages/frontend/src/i18n.ts index 995171b10c..858db74dac 100644 --- a/packages/frontend/src/i18n.ts +++ b/packages/frontend/src/i18n.ts @@ -4,9 +4,9 @@ */ import { markRaw } from 'vue'; -import type { Locale } from '../../../locales'; -import { locale } from '@/config'; -import { I18n } from '@/scripts/i18n'; +import type { Locale } from '../../../locales/index.js'; +import { locale } from '@/config.js'; +import { I18n } from '@/scripts/i18n.js'; export const i18n = markRaw(new I18n(locale)); diff --git a/packages/frontend/src/instance.ts b/packages/frontend/src/instance.ts index 83ec917594..cbfd95951c 100644 --- a/packages/frontend/src/instance.ts +++ b/packages/frontend/src/instance.ts @@ -5,9 +5,9 @@ import { computed, reactive } from 'vue'; import * as Misskey from 'misskey-js'; -import { api } from './os'; -import { miLocalStorage } from './local-storage'; -import { DEFAULT_INFO_IMAGE_URL, DEFAULT_NOT_FOUND_IMAGE_URL, DEFAULT_SERVER_ERROR_IMAGE_URL } from '@/const'; +import { api } from '@/os.js'; +import { miLocalStorage } from '@/local-storage.js'; +import { DEFAULT_INFO_IMAGE_URL, DEFAULT_NOT_FOUND_IMAGE_URL, DEFAULT_SERVER_ERROR_IMAGE_URL } from '@/const.js'; // TODO: 他のタブと永続化されたstateを同期 diff --git a/packages/frontend/src/local-storage.ts b/packages/frontend/src/local-storage.ts index d9dce28599..0d73885b68 100644 --- a/packages/frontend/src/local-storage.ts +++ b/packages/frontend/src/local-storage.ts @@ -41,4 +41,12 @@ export const miLocalStorage = { getItem: (key: Keys): string | null => window.localStorage.getItem(key), setItem: (key: Keys, value: string): void => window.localStorage.setItem(key, value), removeItem: (key: Keys): void => window.localStorage.removeItem(key), + getItemAsJson: (key: Keys): any | undefined => { + const item = miLocalStorage.getItem(key); + if (item === null) { + return undefined; + } + return JSON.parse(item); + }, + setItemAsJson: (key: Keys, value: any): void => window.localStorage.setItem(key, JSON.stringify(value)), }; diff --git a/packages/frontend/src/navbar.ts b/packages/frontend/src/navbar.ts index 4719678fcc..7f182a98f7 100644 --- a/packages/frontend/src/navbar.ts +++ b/packages/frontend/src/navbar.ts @@ -4,14 +4,14 @@ */ import { computed, reactive } from 'vue'; -import { $i } from './account'; -import { miLocalStorage } from './local-storage'; -import { openInstanceMenu } from './ui/_common_/common'; -import { lookup } from './scripts/lookup'; -import * as os from '@/os'; -import { i18n } from '@/i18n'; -import { ui } from '@/config'; -import { unisonReload } from '@/scripts/unison-reload'; +import { $i } from '@/account.js'; +import { miLocalStorage } from '@/local-storage.js'; +import { openInstanceMenu } from '@/ui/_common_/common.js'; +import { lookup } from '@/scripts/lookup.js'; +import * as os from '@/os.js'; +import { i18n } from '@/i18n.js'; +import { ui } from '@/config.js'; +import { unisonReload } from '@/scripts/unison-reload.js'; export const navbarItemDef = reactive({ notifications: { diff --git a/packages/frontend/src/nirax.ts b/packages/frontend/src/nirax.ts index 66ae39fa56..9755bdcb18 100644 --- a/packages/frontend/src/nirax.ts +++ b/packages/frontend/src/nirax.ts @@ -7,7 +7,7 @@ import { EventEmitter } from 'eventemitter3'; import { Component, onMounted, shallowRef, ShallowRef } from 'vue'; -import { safeURIDecode } from '@/scripts/safe-uri-decode'; +import { safeURIDecode } from '@/scripts/safe-uri-decode.js'; type RouteDef = { path: string; diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 2e80e3d8df..8aed5797e1 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -5,26 +5,26 @@ // TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する -import { pendingApiRequestsCount, api, apiGet } from '@/scripts/api'; +import { pendingApiRequestsCount, api, apiGet } from '@/scripts/api.js'; export { pendingApiRequestsCount, api, apiGet }; import { Component, markRaw, Ref, ref, defineAsyncComponent } from 'vue'; import { EventEmitter } from 'eventemitter3'; import insertTextAtCursor from 'insert-text-at-cursor'; import * as Misskey from 'misskey-js'; -import { i18n } from './i18n'; +import { i18n } from '@/i18n.js'; import MkPostFormDialog from '@/components/MkPostFormDialog.vue'; import MkWaitingDialog from '@/components/MkWaitingDialog.vue'; import MkPageWindow from '@/components/MkPageWindow.vue'; import MkToast from '@/components/MkToast.vue'; import MkDialog from '@/components/MkDialog.vue'; +import MkPasswordDialog from '@/components/MkPasswordDialog.vue'; import MkEmojiPickerDialog from '@/components/MkEmojiPickerDialog.vue'; import MkEmojiPickerWindow from '@/components/MkEmojiPickerWindow.vue'; import MkPopupMenu from '@/components/MkPopupMenu.vue'; import MkContextMenu from '@/components/MkContextMenu.vue'; -import { MenuItem } from '@/types/menu'; -import copyToClipboard from './scripts/copy-to-clipboard'; -import { showMovedDialog } from './scripts/show-moved-dialog'; -import { DriveFile } from 'misskey-js/built/entities'; +import { MenuItem } from '@/types/menu.js'; +import copyToClipboard from '@/scripts/copy-to-clipboard.js'; +import { showMovedDialog } from '@/scripts/show-moved-dialog.js'; export const openingWindowsCount = ref(0); @@ -334,6 +334,18 @@ export function inputDate(props: { }); } +export function authenticateDialog(): Promise<{ canceled: true; result: undefined; } | { + canceled: false; result: { password: string; token: string | null; }; +}> { + return new Promise((resolve, reject) => { + popup(MkPasswordDialog, {}, { + done: result => { + resolve(result ? { canceled: false, result } : { canceled: true, result: undefined }); + }, + }, 'closed'); + }); +} + export function select(props: { title?: string | null; text?: string | null; @@ -420,7 +432,7 @@ export async function selectUser(opts: { includeSelf?: boolean } = {}) { }); } -export async function selectDriveFile(multiple: boolean): Promise { +export async function selectDriveFile(multiple: boolean): Promise { return new Promise((resolve, reject) => { popup(defineAsyncComponent(() => import('@/components/MkDriveSelectDialog.vue')), { type: 'file', diff --git a/packages/frontend/src/pages/_error_.vue b/packages/frontend/src/pages/_error_.vue index 3031fb2357..7a3e2f444b 100644 --- a/packages/frontend/src/pages/_error_.vue +++ b/packages/frontend/src/pages/_error_.vue @@ -9,16 +9,16 @@ SPDX-License-Identifier: AGPL-3.0-only
-

{{ i18n.ts.pageLoadError }}

-

{{ i18n.ts.pageLoadErrorDescription }}

-

{{ i18n.ts.serverIsDead }}

+
{{ i18n.ts.pageLoadError }}
+
{{ i18n.ts.pageLoadErrorDescription }}
+
{{ i18n.ts.serverIsDead }}
-

{{ i18n.ts.troubleshooting }}

-

ERROR: {{ error }}

+
{{ i18n.ts.troubleshooting }}
+
ERROR: {{ error }}
@@ -26,16 +26,16 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/pages/admin/RolesEditorFormula.vue b/packages/frontend/src/pages/admin/RolesEditorFormula.vue index 87d0d276ee..0112c9eb7f 100644 --- a/packages/frontend/src/pages/admin/RolesEditorFormula.vue +++ b/packages/frontend/src/pages/admin/RolesEditorFormula.vue @@ -60,8 +60,8 @@ import { v4 as uuid } from 'uuid'; import MkInput from '@/components/MkInput.vue'; import MkSelect from '@/components/MkSelect.vue'; import MkButton from '@/components/MkButton.vue'; -import { i18n } from '@/i18n'; -import { deepClone } from '@/scripts/clone'; +import { i18n } from '@/i18n.js'; +import { deepClone } from '@/scripts/clone.js'; const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default)); diff --git a/packages/frontend/src/pages/admin/_header_.vue b/packages/frontend/src/pages/admin/_header_.vue index 93aead5484..503fb2af9c 100644 --- a/packages/frontend/src/pages/admin/_header_.vue +++ b/packages/frontend/src/pages/admin/_header_.vue @@ -35,11 +35,11 @@ SPDX-License-Identifier: AGPL-3.0-only + + diff --git a/packages/frontend/src/pages/admin/modlog.vue b/packages/frontend/src/pages/admin/modlog.vue new file mode 100644 index 0000000000..4b5ef5f771 --- /dev/null +++ b/packages/frontend/src/pages/admin/modlog.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/packages/frontend/src/pages/admin/object-storage.vue b/packages/frontend/src/pages/admin/object-storage.vue index 6ebf3f738f..dbcf135c80 100644 --- a/packages/frontend/src/pages/admin/object-storage.vue +++ b/packages/frontend/src/pages/admin/object-storage.vue @@ -89,10 +89,10 @@ import MkSwitch from '@/components/MkSwitch.vue'; import MkInput from '@/components/MkInput.vue'; import FormSuspense from '@/components/form/suspense.vue'; import FormSplit from '@/components/form/split.vue'; -import * as os from '@/os'; -import { fetchInstance } from '@/instance'; -import { i18n } from '@/i18n'; -import { definePageMetadata } from '@/scripts/page-metadata'; +import * as os from '@/os.js'; +import { fetchInstance } from '@/instance.js'; +import { i18n } from '@/i18n.js'; +import { definePageMetadata } from '@/scripts/page-metadata.js'; import MkButton from '@/components/MkButton.vue'; let useObjectStorage: boolean = $ref(false); diff --git a/packages/frontend/src/pages/admin/other-settings.vue b/packages/frontend/src/pages/admin/other-settings.vue index 7a4d3831a0..7574c9d7d9 100644 --- a/packages/frontend/src/pages/admin/other-settings.vue +++ b/packages/frontend/src/pages/admin/other-settings.vue @@ -46,10 +46,10 @@ SPDX-License-Identifier: AGPL-3.0-only import { } from 'vue'; import XHeader from './_header_.vue'; import FormSuspense from '@/components/form/suspense.vue'; -import * as os from '@/os'; -import { fetchInstance } from '@/instance'; -import { i18n } from '@/i18n'; -import { definePageMetadata } from '@/scripts/page-metadata'; +import * as os from '@/os.js'; +import { fetchInstance } from '@/instance.js'; +import { i18n } from '@/i18n.js'; +import { definePageMetadata } from '@/scripts/page-metadata.js'; import MkSwitch from '@/components/MkSwitch.vue'; let enableServerMachineStats: boolean = $ref(false); diff --git a/packages/frontend/src/pages/admin/overview.active-users.vue b/packages/frontend/src/pages/admin/overview.active-users.vue index d15e4651d7..8426c463d2 100644 --- a/packages/frontend/src/pages/admin/overview.active-users.vue +++ b/packages/frontend/src/pages/admin/overview.active-users.vue @@ -16,11 +16,11 @@ SPDX-License-Identifier: AGPL-3.0-only import { onMounted } from 'vue'; import { Chart } from 'chart.js'; import gradient from 'chartjs-plugin-gradient'; -import * as os from '@/os'; -import { defaultStore } from '@/store'; -import { useChartTooltip } from '@/scripts/use-chart-tooltip'; -import { chartVLine } from '@/scripts/chart-vline'; -import { initChart } from '@/scripts/init-chart'; +import * as os from '@/os.js'; +import { defaultStore } from '@/store.js'; +import { useChartTooltip } from '@/scripts/use-chart-tooltip.js'; +import { chartVLine } from '@/scripts/chart-vline.js'; +import { initChart } from '@/scripts/init-chart.js'; initChart(); diff --git a/packages/frontend/src/pages/admin/overview.ap-requests.vue b/packages/frontend/src/pages/admin/overview.ap-requests.vue index d3e0267094..cd54041c34 100644 --- a/packages/frontend/src/pages/admin/overview.ap-requests.vue +++ b/packages/frontend/src/pages/admin/overview.ap-requests.vue @@ -23,12 +23,12 @@ SPDX-License-Identifier: AGPL-3.0-only import { onMounted } from 'vue'; import { Chart } from 'chart.js'; import gradient from 'chartjs-plugin-gradient'; -import * as os from '@/os'; -import { useChartTooltip } from '@/scripts/use-chart-tooltip'; -import { chartVLine } from '@/scripts/chart-vline'; -import { defaultStore } from '@/store'; -import { alpha } from '@/scripts/color'; -import { initChart } from '@/scripts/init-chart'; +import * as os from '@/os.js'; +import { useChartTooltip } from '@/scripts/use-chart-tooltip.js'; +import { chartVLine } from '@/scripts/chart-vline.js'; +import { defaultStore } from '@/store.js'; +import { alpha } from '@/scripts/color.js'; +import { initChart } from '@/scripts/init-chart.js'; initChart(); diff --git a/packages/frontend/src/pages/admin/overview.federation.vue b/packages/frontend/src/pages/admin/overview.federation.vue index afb4b7f873..346a9c0258 100644 --- a/packages/frontend/src/pages/admin/overview.federation.vue +++ b/packages/frontend/src/pages/admin/overview.federation.vue @@ -48,11 +48,11 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/pages/channels.vue b/packages/frontend/src/pages/channels.vue index 8523cacebe..8219a947f2 100644 --- a/packages/frontend/src/pages/channels.vue +++ b/packages/frontend/src/pages/channels.vue @@ -58,9 +58,9 @@ import MkInput from '@/components/MkInput.vue'; import MkRadios from '@/components/MkRadios.vue'; import MkButton from '@/components/MkButton.vue'; import MkFoldableSection from '@/components/MkFoldableSection.vue'; -import { useRouter } from '@/router'; -import { definePageMetadata } from '@/scripts/page-metadata'; -import { i18n } from '@/i18n'; +import { useRouter } from '@/router.js'; +import { definePageMetadata } from '@/scripts/page-metadata.js'; +import { i18n } from '@/i18n.js'; const router = useRouter(); diff --git a/packages/frontend/src/pages/clicker.vue b/packages/frontend/src/pages/clicker.vue index 9f9e021e6e..5b194881d1 100644 --- a/packages/frontend/src/pages/clicker.vue +++ b/packages/frontend/src/pages/clicker.vue @@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/pages/my-clips/index.vue b/packages/frontend/src/pages/my-clips/index.vue index 5e7b1ac8a3..8289d65a4b 100644 --- a/packages/frontend/src/pages/my-clips/index.vue +++ b/packages/frontend/src/pages/my-clips/index.vue @@ -30,9 +30,9 @@ import { watch } from 'vue'; import MkPagination from '@/components/MkPagination.vue'; import MkButton from '@/components/MkButton.vue'; import MkClipPreview from '@/components/MkClipPreview.vue'; -import * as os from '@/os'; -import { i18n } from '@/i18n'; -import { definePageMetadata } from '@/scripts/page-metadata'; +import * as os from '@/os.js'; +import { i18n } from '@/i18n.js'; +import { definePageMetadata } from '@/scripts/page-metadata.js'; import { clipsCache } from '@/cache'; const pagination = { diff --git a/packages/frontend/src/pages/my-lists/index.vue b/packages/frontend/src/pages/my-lists/index.vue index edfff8b05e..3e7efb5a7c 100644 --- a/packages/frontend/src/pages/my-lists/index.vue +++ b/packages/frontend/src/pages/my-lists/index.vue @@ -32,17 +32,17 @@ SPDX-License-Identifier: AGPL-3.0-only import { onActivated } from 'vue'; import MkButton from '@/components/MkButton.vue'; import MkAvatars from '@/components/MkAvatars.vue'; -import * as os from '@/os'; -import { i18n } from '@/i18n'; -import { definePageMetadata } from '@/scripts/page-metadata'; +import * as os from '@/os.js'; +import { i18n } from '@/i18n.js'; +import { definePageMetadata } from '@/scripts/page-metadata.js'; import { userListsCache } from '@/cache'; -import { infoImageUrl } from '@/instance'; -import { $i } from '@/account'; +import { infoImageUrl } from '@/instance.js'; +import { $i } from '@/account.js'; const items = $computed(() => userListsCache.value.value ?? []); function fetch() { - userListsCache.fetch(() => os.api('users/lists/list')); + userListsCache.fetch(); } fetch(); diff --git a/packages/frontend/src/pages/my-lists/list.vue b/packages/frontend/src/pages/my-lists/list.vue index bc80994b42..df13998f6b 100644 --- a/packages/frontend/src/pages/my-lists/list.vue +++ b/packages/frontend/src/pages/my-lists/list.vue @@ -48,20 +48,20 @@ SPDX-License-Identifier: AGPL-3.0-only + + diff --git a/packages/frontend/src/pages/page-editor/els/page-editor.el.image.vue b/packages/frontend/src/pages/page-editor/els/page-editor.el.image.vue index 50d728d62c..4fffd311b2 100644 --- a/packages/frontend/src/pages/page-editor/els/page-editor.el.image.vue +++ b/packages/frontend/src/pages/page-editor/els/page-editor.el.image.vue @@ -24,8 +24,8 @@ SPDX-License-Identifier: AGPL-3.0-only import { onMounted } from 'vue'; import XContainer from '../page-editor.container.vue'; import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue'; -import * as os from '@/os'; -import { i18n } from '@/i18n'; +import * as os from '@/os.js'; +import { i18n } from '@/i18n.js'; const props = defineProps<{ modelValue: any diff --git a/packages/frontend/src/pages/page-editor/els/page-editor.el.note.vue b/packages/frontend/src/pages/page-editor/els/page-editor.el.note.vue index 18316acaf8..fc436aad75 100644 --- a/packages/frontend/src/pages/page-editor/els/page-editor.el.note.vue +++ b/packages/frontend/src/pages/page-editor/els/page-editor.el.note.vue @@ -29,8 +29,8 @@ import MkInput from '@/components/MkInput.vue'; import MkSwitch from '@/components/MkSwitch.vue'; import MkNote from '@/components/MkNote.vue'; import MkNoteDetailed from '@/components/MkNoteDetailed.vue'; -import * as os from '@/os'; -import { i18n } from '@/i18n'; +import * as os from '@/os.js'; +import { i18n } from '@/i18n.js'; const props = defineProps<{ modelValue: any diff --git a/packages/frontend/src/pages/page-editor/els/page-editor.el.section.vue b/packages/frontend/src/pages/page-editor/els/page-editor.el.section.vue index 044be39072..31c2c96d7c 100644 --- a/packages/frontend/src/pages/page-editor/els/page-editor.el.section.vue +++ b/packages/frontend/src/pages/page-editor/els/page-editor.el.section.vue @@ -25,9 +25,9 @@ SPDX-License-Identifier: AGPL-3.0-only import { defineAsyncComponent, inject, onMounted, watch } from 'vue'; import { v4 as uuid } from 'uuid'; import XContainer from '../page-editor.container.vue'; -import * as os from '@/os'; -import { i18n } from '@/i18n'; -import { deepClone } from '@/scripts/clone'; +import * as os from '@/os.js'; +import { i18n } from '@/i18n.js'; +import { deepClone } from '@/scripts/clone.js'; import MkButton from '@/components/MkButton.vue'; const XBlocks = defineAsyncComponent(() => import('../page-editor.blocks.vue')); diff --git a/packages/frontend/src/pages/page-editor/els/page-editor.el.text.vue b/packages/frontend/src/pages/page-editor/els/page-editor.el.text.vue index 0d18b0d565..2ecf5790b8 100644 --- a/packages/frontend/src/pages/page-editor/els/page-editor.el.text.vue +++ b/packages/frontend/src/pages/page-editor/els/page-editor.el.text.vue @@ -18,7 +18,7 @@ SPDX-License-Identifier: AGPL-3.0-only /* eslint-disable vue/no-mutating-props */ import { watch } from 'vue'; import XContainer from '../page-editor.container.vue'; -import { i18n } from '@/i18n'; +import { i18n } from '@/i18n.js'; const props = defineProps<{ modelValue: any diff --git a/packages/frontend/src/pages/page-editor/page-editor.container.vue b/packages/frontend/src/pages/page-editor/page-editor.container.vue index 29c7235b99..c1bc0c61c9 100644 --- a/packages/frontend/src/pages/page-editor/page-editor.container.vue +++ b/packages/frontend/src/pages/page-editor/page-editor.container.vue @@ -29,7 +29,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/pages/search.user.vue b/packages/frontend/src/pages/search.user.vue index 8a71ed00b7..1a7501adc6 100644 --- a/packages/frontend/src/pages/search.user.vue +++ b/packages/frontend/src/pages/search.user.vue @@ -30,13 +30,13 @@ import MkUserList from '@/components/MkUserList.vue'; import MkInput from '@/components/MkInput.vue'; import MkRadios from '@/components/MkRadios.vue'; import MkButton from '@/components/MkButton.vue'; -import { i18n } from '@/i18n'; -import * as os from '@/os'; +import { i18n } from '@/i18n.js'; +import * as os from '@/os.js'; import MkFoldableSection from '@/components/MkFoldableSection.vue'; -import { $i } from '@/account'; -import { instance } from '@/instance'; +import { $i } from '@/account.js'; +import { instance } from '@/instance.js'; import MkInfo from '@/components/MkInfo.vue'; -import { useRouter } from '@/router'; +import { useRouter } from '@/router.js'; const router = useRouter(); diff --git a/packages/frontend/src/pages/search.vue b/packages/frontend/src/pages/search.vue index ab04120bbe..e205fe850f 100644 --- a/packages/frontend/src/pages/search.vue +++ b/packages/frontend/src/pages/search.vue @@ -24,11 +24,11 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/pages/settings/2fa.vue b/packages/frontend/src/pages/settings/2fa.vue index 3606632b2d..1f3eb8dc25 100644 --- a/packages/frontend/src/pages/settings/2fa.vue +++ b/packages/frontend/src/pages/settings/2fa.vue @@ -8,40 +8,44 @@ SPDX-License-Identifier: AGPL-3.0-only
- - {{ i18n.ts._2fa.twoFactorBackupSecretWarning }} + + {{ i18n.ts._2fa.backupCodeUsedWarning }} - - {{ i18n.ts._2fa.twoFactorBackupSecretExhausted }} + + {{ i18n.ts._2fa.backupCodesExhaustedWarning }} - + + +
- {{ i18n.ts.unregister }} + {{ i18n.ts.unregister }}
- {{ i18n.ts._2fa.registerTOTP }} + {{ i18n.ts._2fa.registerTOTP }}
- {{ i18n.ts._2fa.securityKeyInfo }} + + {{ i18n.ts._2fa.securityKeyInfo }} + - + {{ i18n.ts._2fa.securityKeyNotSupported }} - + {{ i18n.ts._2fa.registerTOTPBeforeKey }} @@ -68,16 +72,16 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/pages/user/clips.vue b/packages/frontend/src/pages/user/clips.vue index 753662843e..eaae472516 100644 --- a/packages/frontend/src/pages/user/clips.vue +++ b/packages/frontend/src/pages/user/clips.vue @@ -18,11 +18,11 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/pages/user/follow-list.vue b/packages/frontend/src/pages/user/follow-list.vue index f8b9d70e8e..19b7290353 100644 --- a/packages/frontend/src/pages/user/follow-list.vue +++ b/packages/frontend/src/pages/user/follow-list.vue @@ -15,12 +15,12 @@ SPDX-License-Identifier: AGPL-3.0-only