diff --git a/.config/cypress-devcontainer.yml b/.config/cypress-devcontainer.yml deleted file mode 100644 index 3907615f73..0000000000 --- a/.config/cypress-devcontainer.yml +++ /dev/null @@ -1,224 +0,0 @@ -#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -# Misskey configuration -#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - -# ┌────────────────────────┐ -#───┘ Initial Setup Password └───────────────────────────────────────────────────── - -# Password to initiate setting up admin account. -# It will not be used after the initial setup is complete. -# -# Be sure to change this when you set up Misskey via the Internet. -# -# The provider of the service who sets up Misskey on behalf of the customer should -# set this value to something unique when generating the Misskey config file, -# and provide it to the customer. -setupPassword: example_password_please_change_this_or_you_will_get_hacked - -# ┌─────┐ -#───┘ URL └───────────────────────────────────────────────────── - -# Final accessible URL seen by a user. -url: 'http://misskey.local' - -# ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE -# URL SETTINGS AFTER THAT! - -# ┌───────────────────────┐ -#───┘ Port and TLS settings └─────────────────────────────────── - -# -# Misskey requires a reverse proxy to support HTTPS connections. -# -# +----- https://example.tld/ ------------+ -# +------+ |+-------------+ +----------------+| -# | User | ---> || Proxy (443) | ---> | Misskey (3000) || -# +------+ |+-------------+ +----------------+| -# +---------------------------------------+ -# -# You need to set up a reverse proxy. (e.g. nginx) -# An encrypted connection with HTTPS is highly recommended -# because tokens may be transferred in GET requests. - -# The port that your Misskey server should listen on. -port: 61812 - -# ┌──────────────────────────┐ -#───┘ PostgreSQL configuration └──────────────────────────────── - -db: - host: db - port: 5432 - - # Database name - db: misskey - - # Auth - user: postgres - pass: postgres - - # Whether disable Caching queries - #disableCache: true - - # Extra Connection options - #extra: - # ssl: true - -dbReplications: false - -# You can configure any number of replicas here -#dbSlaves: -# - -# host: -# port: -# db: -# user: -# pass: -# - -# host: -# port: -# db: -# user: -# pass: - -# ┌─────────────────────┐ -#───┘ Redis configuration └───────────────────────────────────── - -redis: - host: redis - port: 6379 - #family: 0 # 0=Both, 4=IPv4, 6=IPv6 - #pass: example-pass - #prefix: example-prefix - #db: 1 - -#redisForPubsub: -# host: redis -# port: 6379 -# #family: 0 # 0=Both, 4=IPv4, 6=IPv6 -# #pass: example-pass -# #prefix: example-prefix -# #db: 1 - -#redisForJobQueue: -# host: redis -# port: 6379 -# #family: 0 # 0=Both, 4=IPv4, 6=IPv6 -# #pass: example-pass -# #prefix: example-prefix -# #db: 1 - -#redisForTimelines: -# host: redis -# port: 6379 -# #family: 0 # 0=Both, 4=IPv4, 6=IPv6 -# #pass: example-pass -# #prefix: example-prefix -# #db: 1 - -#redisForReactions: -# host: redis -# port: 6379 -# #family: 0 # 0=Both, 4=IPv4, 6=IPv6 -# #pass: example-pass -# #prefix: example-prefix -# #db: 1 - -# ┌───────────────────────────┐ -#───┘ MeiliSearch configuration └───────────────────────────── - -#meilisearch: -# host: meilisearch -# port: 7700 -# apiKey: '' -# ssl: true -# index: '' - -# ┌───────────────┐ -#───┘ ID generation └─────────────────────────────────────────── - -# You can select the ID generation method. -# You don't usually need to change this setting, but you can -# change it according to your preferences. - -# 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 - -# ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE -# ID SETTINGS AFTER THAT! - -id: 'aidx' - -# ┌────────────────┐ -#───┘ Error tracking └────────────────────────────────────────── - -# Sentry is available for error tracking. -# See the Sentry documentation for more details on options. - -#sentryForBackend: -# enableNodeProfiling: true -# options: -# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0' - -#sentryForFrontend: -# options: -# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0' - -# ┌─────────────────────┐ -#───┘ Other configuration └───────────────────────────────────── - -# Whether disable HSTS -#disableHsts: true - -# Number of worker processes -#clusterLimit: 1 - -# Job concurrency per worker -# deliverJobConcurrency: 128 -# inboxJobConcurrency: 16 - -# Job rate limiter -# deliverJobPerSec: 128 -# inboxJobPerSec: 32 - -# Job attempts -# deliverJobMaxAttempts: 12 -# inboxJobMaxAttempts: 8 - -# IP address family used for outgoing request (ipv4, ipv6 or dual) -#outgoingAddressFamily: ipv4 - -# Proxy for HTTP/HTTPS -#proxy: http://127.0.0.1:3128 - -proxyBypassHosts: - - api.deepl.com - - api-free.deepl.com - - www.recaptcha.net - - hcaptcha.com - - challenges.cloudflare.com - -# Proxy for SMTP/SMTPS -#proxySmtp: http://127.0.0.1:3128 # use HTTP/1.1 CONNECT -#proxySmtp: socks4://127.0.0.1:1080 # use SOCKS4 -#proxySmtp: socks5://127.0.0.1:1080 # use SOCKS5 - -# Media Proxy -#mediaProxy: https://example.com/proxy - -# Proxy remote files (default: true) -proxyRemoteFiles: true - -# Sign to ActivityPub GET request (default: true) -signToActivityPubGet: true - -allowedPrivateNetworks: [ - '127.0.0.1/32' -] - -# Upload or download file size limits (bytes) -#maxFileSize: 262144000 diff --git a/.config/docker_example.env b/.config/docker_example.env index c61248da2e..7a0261524b 100644 --- a/.config/docker_example.env +++ b/.config/docker_example.env @@ -1,11 +1,4 @@ -# misskey settings -# MISSKEY_URL=https://example.tld/ - # db settings POSTGRES_PASSWORD=example-misskey-pass -# DATABASE_PASSWORD=${POSTGRES_PASSWORD} POSTGRES_USER=example-misskey-user -# DATABASE_USER=${POSTGRES_USER} POSTGRES_DB=misskey -# DATABASE_DB=${POSTGRES_DB} -DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}" diff --git a/.config/docker_example.yml b/.config/docker_example.yml index 3f8e5734ce..acd169bf43 100644 --- a/.config/docker_example.yml +++ b/.config/docker_example.yml @@ -6,7 +6,6 @@ #───┘ URL └───────────────────────────────────────────────────── # Final accessible URL seen by a user. -# You can set url from an environment variable instead. url: https://example.tld/ # ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE @@ -39,11 +38,9 @@ db: port: 5432 # Database name - # You can set db from an environment variable instead. db: misskey # Auth - # You can set user and pass from environment variables instead. user: example-misskey-user pass: example-misskey-pass @@ -106,18 +103,10 @@ redis: # #prefix: example-prefix # #db: 1 -#redisForReactions: -# host: redis -# port: 6379 -# #family: 0 # 0=Both, 4=IPv4, 6=IPv6 -# #pass: example-pass -# #prefix: example-prefix -# #db: 1 - # ┌───────────────────────────┐ #───┘ MeiliSearch configuration └───────────────────────────── -# You can set scope to local (default value) or global +# You can set scope to local (default value) or global # (include notes from remote). #meilisearch: @@ -147,21 +136,6 @@ redis: id: 'aidx' -# ┌────────────────┐ -#───┘ Error tracking └────────────────────────────────────────── - -# Sentry is available for error tracking. -# See the Sentry documentation for more details on options. - -#sentryForBackend: -# enableNodeProfiling: true -# options: -# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0' - -#sentryForFrontend: -# options: -# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0' - # ┌─────────────────────┐ #───┘ Other configuration └───────────────────────────────────── @@ -211,7 +185,7 @@ proxyRemoteFiles: true signToActivityPubGet: true # For security reasons, uploading attachments from the intranet is prohibited, -# but exceptions can be made from the following settings. Default value is "undefined". +# but exceptions can be made from the following settings. Default value is "undefined". # Read changelog to learn more (Improvements of 12.90.0 (2021/09/04)). #allowedPrivateNetworks: [ # '127.0.0.1/32' diff --git a/.config/example.yml b/.config/example.yml index 60a6a0aa71..df423c2c83 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -2,77 +2,6 @@ # Misskey configuration #━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -# ┌──────────────────────────────┐ -#───┘ a boring but important thing └──────────────────────────── - -# -# First of all, let me tell you a story that may possibly be -# boring to you and possibly important to you. -# -# Misskey is licensed under the AGPLv3 license. This license is -# known to be often misunderstood. Please read the following -# instructions carefully and select the appropriate option so -# that you do not negligently cause a license violation. -# - -# -------- -# Option 1: If you host Misskey AS-IS (without any changes to -# the source code. forks are not included). -# -# Step 1: Congratulations! You don't need to do anything. - -# -------- -# Option 2: If you have made changes to the source code (forks -# are included) and publish a Git repository of source -# code. There should be no access restrictions on -# this repository. Strictly speaking, it doesn't have -# to be a Git repository, but you'll probably use Git! -# -# Step 1: Build and run the Misskey server first. -# Step 2: Open in -# your browser with the administrator account. -# Step 3: Enter the URL of your Git repository in the -# "Repository URL" field. - -# -------- -# Option 3: If neither of the above applies to you. -# (In this case, the source code should be published -# on the Misskey interface. IT IS NOT ENOUGH TO -# DISCLOSE THE SOURCE CODE WHEN A USER REQUESTS IT BY -# E-MAIL OR OTHER MEANS. If you are not satisfied -# with this, it is recommended that you read the -# license again carefully. Anyway, enabling this -# option will automatically generate and publish a -# tarball at build time, protecting you from -# inadvertent license violations. (There is no legal -# guarantee, of course.) The tarball will generated -# from the root directory of your codebase. So it is -# also recommended to check directory -# once after building and before activating the server -# to avoid ACCIDENTAL LEAKING OF SENSITIVE INFORMATION. -# To prevent certain files from being included in the -# tarball, add a glob pattern after line 15 in -# . DO NOT FORGET TO BUILD AFTER -# ENABLING THIS OPTION!) -# -# Step 1: Uncomment the following line. -# -# publishTarballInsteadOfProvideRepositoryUrl: true - -# ┌────────────────────────┐ -#───┘ Initial Setup Password └───────────────────────────────────────────────────── - -# Password to initiate setting up admin account. -# It will not be used after the initial setup is complete. -# -# Be sure to change this when you set up Misskey via the Internet. -# -# The provider of the service who sets up Misskey on behalf of the customer should -# set this value to something unique when generating the Misskey config file, -# and provide it to the customer. -# -# setupPassword: example_password_please_change_this_or_you_will_get_hacked - # ┌─────┐ #───┘ URL └───────────────────────────────────────────────────── @@ -186,20 +115,10 @@ redis: # # You can specify more ioredis options... # #username: example-username -#redisForReactions: -# host: localhost -# port: 6379 -# #family: 0 # 0=Both, 4=IPv4, 6=IPv6 -# #pass: example-pass -# #prefix: example-prefix -# #db: 1 -# # You can specify more ioredis options... -# #username: example-username - # ┌───────────────────────────┐ #───┘ MeiliSearch configuration └───────────────────────────── -# You can set scope to local (default value) or global +# You can set scope to local (default value) or global # (include notes from remote). #meilisearch: @@ -229,21 +148,6 @@ redis: id: 'aidx' -# ┌────────────────┐ -#───┘ Error tracking └────────────────────────────────────────── - -# Sentry is available for error tracking. -# See the Sentry documentation for more details on options. - -#sentryForBackend: -# enableNodeProfiling: true -# options: -# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0' - -#sentryForFrontend: -# options: -# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0' - # ┌─────────────────────┐ #───┘ Other configuration └───────────────────────────────────── @@ -256,14 +160,14 @@ id: 'aidx' # Job concurrency per worker #deliverJobConcurrency: 128 #inboxJobConcurrency: 16 -#relationshipJobConcurrency: 16 -# What's relationshipJob?: +#relashionshipJobConcurrency: 16 +# What's relashionshipJob?: # Follow, unfollow, block and unblock(ings) while following-imports, etc. or account migrations. # Job rate limiter #deliverJobPerSec: 128 #inboxJobPerSec: 32 -#relationshipJobPerSec: 64 +#relashionshipJobPerSec: 64 # Job attempts #deliverJobMaxAttempts: 12 @@ -310,7 +214,7 @@ proxyRemoteFiles: true signToActivityPubGet: true # For security reasons, uploading attachments from the intranet is prohibited, -# but exceptions can be made from the following settings. Default value is "undefined". +# but exceptions can be made from the following settings. Default value is "undefined". # Read changelog to learn more (Improvements of 12.90.0 (2021/09/04)). #allowedPrivateNetworks: [ # '127.0.0.1/32' diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fbf959d449..e409adf644 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,22 +1,25 @@ { "name": "Misskey", - "dockerComposeFile": "compose.yml", + "dockerComposeFile": "docker-compose.yml", "service": "app", "workspaceFolder": "/workspace", "features": { - "ghcr.io/devcontainers/features/node:1": { - "version": "20.16.0" + "ghcr.io/devcontainers-contrib/features/pnpm:2": { + "version": "8.9.2" }, - "ghcr.io/devcontainers-contrib/features/corepack:1": {} + "ghcr.io/devcontainers/features/node:1": { + "version": "20.10.0" + } }, "forwardPorts": [3000], - "postCreateCommand": "/bin/bash .devcontainer/init.sh", + "postCreateCommand": "sudo chmod 755 .devcontainer/init.sh && .devcontainer/init.sh", "customizations": { "vscode": { "extensions": [ "editorconfig.editorconfig", "dbaeumer.vscode-eslint", "Vue.volar", + "Vue.vscode-typescript-vue-plugin", "Orta.vscode-jest", "dbaeumer.vscode-eslint", "mrmlnc.vscode-json5" diff --git a/.devcontainer/devcontainer.yml b/.devcontainer/devcontainer.yml index 3eb4fc2879..7ea0929469 100644 --- a/.devcontainer/devcontainer.yml +++ b/.devcontainer/devcontainer.yml @@ -103,14 +103,6 @@ redis: # #prefix: example-prefix # #db: 1 -#redisForReactions: -# host: redis -# port: 6379 -# #family: 0 # 0=Both, 4=IPv4, 6=IPv6 -# #pass: example-pass -# #prefix: example-prefix -# #db: 1 - # ┌───────────────────────────┐ #───┘ MeiliSearch configuration └───────────────────────────── @@ -140,21 +132,6 @@ redis: id: 'aidx' -# ┌────────────────┐ -#───┘ Error tracking └────────────────────────────────────────── - -# Sentry is available for error tracking. -# See the Sentry documentation for more details on options. - -#sentryForBackend: -# enableNodeProfiling: true -# options: -# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0' - -#sentryForFrontend: -# options: -# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0' - # ┌─────────────────────┐ #───┘ Other configuration └───────────────────────────────────── diff --git a/.devcontainer/compose.yml b/.devcontainer/docker-compose.yml similarity index 93% rename from .devcontainer/compose.yml rename to .devcontainer/docker-compose.yml index d02d2a8f4a..2809cd2ca4 100644 --- a/.devcontainer/compose.yml +++ b/.devcontainer/docker-compose.yml @@ -1,3 +1,5 @@ +version: '3.8' + services: app: build: @@ -6,7 +8,6 @@ services: volumes: - ../:/workspace:cached - - node_modules:/workspace/node_modules command: sleep infinity @@ -45,7 +46,6 @@ services: volumes: postgres-data: redis-data: - node_modules: networks: internal_network: diff --git a/.devcontainer/init.sh b/.devcontainer/init.sh index e02a533c15..bcad3e6d85 100755 --- a/.devcontainer/init.sh +++ b/.devcontainer/init.sh @@ -2,16 +2,10 @@ set -xe -sudo chown node node_modules -sudo apt-get update -sudo apt-get -y install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb -git config --global --add safe.directory /workspace +sudo chown -R node /workspace git submodule update --init -corepack install -corepack enable pnpm config set store-dir /home/node/.local/share/pnpm/store pnpm install --frozen-lockfile cp .devcontainer/devcontainer.yml .config/default.yml pnpm build pnpm migrate -pnpm exec cypress install diff --git a/.dockerignore b/.dockerignore index f204349160..1de0c7982b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,11 +7,12 @@ Dockerfile build/ built/ db/ -.devcontainer/compose.yml +docker-compose.yml node_modules/ packages/*/node_modules redis/ files/ +misskey-assets/ fluent-emojis/ .pnp.* @@ -27,4 +28,4 @@ fluent-emojis/ .idea/ packages/*/.vscode/ -packages/backend/test/compose.yml +packages/backend/test/docker-compose.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000000..c6b2a1611c --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +patreon: syuilo diff --git a/.github/ISSUE_TEMPLATE/01_bug-report.yml b/.github/ISSUE_TEMPLATE/01_bug-report.yml index 315e712c30..ac2b39cc12 100644 --- a/.github/ISSUE_TEMPLATE/01_bug-report.yml +++ b/.github/ISSUE_TEMPLATE/01_bug-report.yml @@ -53,8 +53,8 @@ body: Examples: * Model and OS of the device(s): MacBook Pro (14inch, 2021), macOS Ventura 13.4 * Browser: Chrome 113.0.5672.126 - * Server URL: misskey.example.com - * Misskey: 2024.x.x + * Server URL: misskey.io + * Misskey: 13.x.x value: | * Model and OS of the device(s): * Browser: @@ -74,11 +74,11 @@ body: Examples: * Installation Method or Hosting Service: docker compose, k8s/docker, systemd, "Misskey install shell script", development environment - * Misskey: 2024.x.x + * Misskey: 13.x.x * Node: 20.x.x * PostgreSQL: 15.x.x * Redis: 7.x.x - * OS and Architecture: Ubuntu 24.04.2 LTS aarch64 + * OS and Architecture: Ubuntu 22.04.2 LTS aarch64 value: | * Installation Method or Hosting Service: * Misskey: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 5acad83336..e8b65dc3b9 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,7 +2,3 @@ contact_links: - name: 💬 Misskey official Discord url: https://discord.gg/Wp8gVStHW3 about: Chat freely about Misskey - # 仮 - - name: 💬 Start discussion - url: https://github.com/misskey-dev/misskey/discussions - about: The official forum to join conversation and ask question diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d4678ec5e0..5955f6b5d9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -17,32 +17,16 @@ updates: directory: "/" schedule: interval: daily - open-pull-requests-limit: 10 - # List dependencies required to be updated together, sharing the same version numbers. - # Those who simply have the common owner (e.g. @fastify) don't need to be listed. + # 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 groups: - aws-sdk: + swc: patterns: - - "@aws-sdk/*" - bull-board: - patterns: - - "@bull-board/*" - nestjs: - patterns: - - "@nestjs/*" - slacc: - patterns: - - "slacc-*" + - "@swc/*" storybook: patterns: - "storybook*" - "@storybook/*" - swc-core: - patterns: - - "@swc/core*" - typescript-eslint: - patterns: - - "@typescript-eslint/*" - tensorflow: - patterns: - - "@tensorflow/*" diff --git a/.github/labeler.yml b/.github/labeler.yml index b64d726d65..a77f73706b 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -6,7 +6,7 @@ 'packages/backend:test': - any: - changed-files: - - any-glob-to-any-file: ['packages/backend/test/**/*', 'packages/backend/test-federation/**/*'] + - any-glob-to-any-file: ['packages/backend/test/**/*'] 'packages/frontend': - any: diff --git a/.github/misskey/test.yml b/.github/misskey/test.yml index 3c807e8b9e..7a4aa4ae6c 100644 --- a/.github/misskey/test.yml +++ b/.github/misskey/test.yml @@ -1,7 +1,5 @@ url: 'http://misskey.local' -setupPassword: example_password_please_change_this_or_you_will_get_hacked - # ローカルでテストするときにポートを被らないようにするためデフォルトのものとは変える(以下同じ) port: 61812 diff --git a/.github/workflows/api-misskey-js.yml b/.github/workflows/api-misskey-js.yml index 8380a3bb23..5cffbd81bc 100644 --- a/.github/workflows/api-misskey-js.yml +++ b/.github/workflows/api-misskey-js.yml @@ -1,14 +1,7 @@ name: API report (misskey.js) -on: - push: - paths: - - packages/misskey-js/** - - .github/workflows/api-misskey-js.yml - pull_request: - paths: - - packages/misskey-js/** - - .github/workflows/api-misskey-js.yml +on: [push, pull_request] + jobs: report: @@ -21,7 +14,7 @@ jobs: - run: corepack enable - name: Setup Node.js - uses: actions/setup-node@v4.0.4 + uses: actions/setup-node@v4.0.1 with: node-version-file: '.node-version' cache: 'pnpm' diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml deleted file mode 100644 index 44cc1a04f2..0000000000 --- a/.github/workflows/changelog-check.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Check the description in CHANGELOG.md - -on: - pull_request: - branches: - - master - - develop - -jobs: - check-changelog: - runs-on: ubuntu-latest - - steps: - - name: Checkout head - uses: actions/checkout@v4.1.1 - - name: Setup Node.js - uses: actions/setup-node@v4.0.4 - with: - node-version-file: '.node-version' - - - name: Checkout base - run: | - mkdir _base - cp -r .git _base/.git - cd _base - git fetch --depth 1 origin ${{ github.base_ref }} - git checkout origin/${{ github.base_ref }} CHANGELOG.md - - - name: Copy to Checker directory for CHANGELOG-base.md - run: cp _base/CHANGELOG.md scripts/changelog-checker/CHANGELOG-base.md - - name: Copy to Checker directory for CHANGELOG-head.md - run: cp CHANGELOG.md scripts/changelog-checker/CHANGELOG-head.md - - name: diff - continue-on-error: true - run: diff -u CHANGELOG-base.md CHANGELOG-head.md - working-directory: scripts/changelog-checker - - - name: Setup Checker - run: npm install - working-directory: scripts/changelog-checker - - name: Run Checker - run: npm run run - working-directory: scripts/changelog-checker diff --git a/.github/workflows/check-misskey-js-autogen.yml b/.github/workflows/check-misskey-js-autogen.yml deleted file mode 100644 index f26c9a4d45..0000000000 --- a/.github/workflows/check-misskey-js-autogen.yml +++ /dev/null @@ -1,139 +0,0 @@ -name: Check Misskey JS autogen - -on: - pull_request_target: - branches: - - master - - develop - - improve-misskey-js-autogen-check - paths: - - packages/backend/** - -jobs: - # pull_request_target safety: permissions: read-all, and there are no secrets used in this job - generate-misskey-js: - runs-on: ubuntu-latest - permissions: - contents: read - if: ${{ github.event.pull_request.mergeable == null || github.event.pull_request.mergeable == true }} - steps: - - name: checkout - uses: actions/checkout@v4.1.1 - with: - submodules: true - persist-credentials: false - ref: refs/pull/${{ github.event.pull_request.number }}/merge - - - name: setup pnpm - uses: pnpm/action-setup@v4 - - - name: setup node - id: setup-node - uses: actions/setup-node@v4.0.4 - with: - node-version-file: '.node-version' - cache: pnpm - - - name: install dependencies - run: pnpm i --frozen-lockfile - - # generate api.json - - name: Copy Config - run: cp .config/example.yml .config/default.yml - - name: Build - run: pnpm build - - name: Generate API JSON - run: pnpm --filter backend generate-api-json - - # build misskey js - - name: Build misskey-js - run: |- - cp packages/backend/built/api.json packages/misskey-js/generator/api.json - pnpm run --filter misskey-js-type-generator generate - - # packages/misskey-js/generator/built/autogen - - name: Upload Generated - uses: actions/upload-artifact@v4 - with: - name: generated-misskey-js - path: packages/misskey-js/generator/built/autogen - - # pull_request_target safety: permissions: read-all, and no user codes are executed - get-actual-misskey-js: - runs-on: ubuntu-latest - permissions: - contents: read - if: ${{ github.event.pull_request.mergeable == null || github.event.pull_request.mergeable == true }} - steps: - - name: checkout - uses: actions/checkout@v4.1.1 - with: - submodules: true - persist-credentials: false - ref: refs/pull/${{ github.event.pull_request.number }}/merge - - - name: Upload From Merged - uses: actions/upload-artifact@v4 - with: - name: actual-misskey-js - path: packages/misskey-js/src/autogen - - # pull_request_target safety: nothing is cloned from repository - comment-misskey-js-autogen: - runs-on: ubuntu-latest - needs: [generate-misskey-js, get-actual-misskey-js] - permissions: - pull-requests: write - steps: - - name: download generated-misskey-js - uses: actions/download-artifact@v4 - with: - name: generated-misskey-js - path: misskey-js-generated - - - name: download actual-misskey-js - uses: actions/download-artifact@v4 - with: - name: actual-misskey-js - path: misskey-js-actual - - - name: check misskey-js changes - id: check-changes - run: | - diff -r -u --label=generated --label=on-tree ./misskey-js-generated ./misskey-js-actual > misskey-js.diff || true - - if [ -s misskey-js.diff ]; then - echo "changes=true" >> $GITHUB_OUTPUT - else - echo "changes=false" >> $GITHUB_OUTPUT - fi - - - name: Print full diff - run: cat ./misskey-js.diff - - - name: send message - if: steps.check-changes.outputs.changes == 'true' - uses: thollander/actions-comment-pull-request@v2 - with: - comment_tag: check-misskey-js-autogen - message: |- - Thank you for sending us a great Pull Request! 👍 - Please regenerate misskey-js type definitions! 🙏 - - example: - ```sh - pnpm run build-misskey-js-with-types - ``` - - - name: send message - if: steps.check-changes.outputs.changes == 'false' - uses: thollander/actions-comment-pull-request@v2 - with: - comment_tag: check-misskey-js-autogen - mode: delete - message: "Thank you!" - create_if_not_exists: false - - - name: Make failure if changes are detected - if: steps.check-changes.outputs.changes == 'true' - run: exit 1 diff --git a/.github/workflows/check-misskey-js-version.yml b/.github/workflows/check-misskey-js-version.yml deleted file mode 100644 index 99c29ac974..0000000000 --- a/.github/workflows/check-misskey-js-version.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Check Misskey JS version - -on: - push: - branches: [ develop ] - paths: - - packages/misskey-js/package.json - - package.json - - .github/workflows/check-misskey-js-version.yml - pull_request: - branches: [ develop ] - paths: - - packages/misskey-js/package.json - - package.json - - .github/workflows/check-misskey-js-version.yml -jobs: - check-version: - # ルートの package.json と packages/misskey-js/package.json のバージョンが一致しているかを確認する - name: Check version - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4.1.1 - - name: Check version - run: | - if [ "$(jq -r '.version' package.json)" != "$(jq -r '.version' packages/misskey-js/package.json)" ]; then - echo "Version mismatch!" - exit 1 - fi diff --git a/.github/workflows/check-spdx-license-id.yml b/.github/workflows/check-spdx-license-id.yml deleted file mode 100644 index 05582008b5..0000000000 --- a/.github/workflows/check-spdx-license-id.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: Check SPDX-License-Identifier - -on: - push: - branches: - - master - - develop - pull_request: - -jobs: - check-spdx-license-id: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4.1.1 - - name: Check - run: | - counter=0 - - search() { - local directory="$1" - find "$directory" -type f \ - '(' \ - -name "*.cjs" -and -not -name '*.config.cjs' -o \ - -name "*.html" -o \ - -name "*.js" -and -not -name '*.config.js' -o \ - -name "*.mjs" -and -not -name '*.config.mjs' -o \ - -name "*.scss" -o \ - -name "*.ts" -and -not -name '*.config.ts' -o \ - -name "*.vue" \ - ')' -and \ - -not -name '*eslint*' - } - - check() { - local file="$1" - if ! ( - grep -q "SPDX-FileCopyrightText: syuilo and misskey-project" "$file" || - grep -q "SPDX-License-Identifier: AGPL-3.0-only" "$file" - ); then - echo "Missing: $file" - ((counter++)) - fi - } - - directories=( - "cypress/e2e" - "packages/backend/migration" - "packages/backend/src" - "packages/backend/test" - "packages/frontend-shared/@types" - "packages/frontend-shared/js" - "packages/frontend/.storybook" - "packages/frontend/@types" - "packages/frontend/lib" - "packages/frontend/public" - "packages/frontend/src" - "packages/frontend/test" - "packages/frontend-embed/@types" - "packages/frontend-embed/src" - "packages/misskey-bubble-game/src" - "packages/misskey-reversi/src" - "packages/sw/src" - "scripts" - ) - - for directory in "${directories[@]}"; do - for file in $(search $directory); do - check "$file" - done - done - - if [ $counter -gt 0 ]; then - echo "SPDX-License-Identifier is missing in $counter files." - exit 1 - else - echo "SPDX-License-Identifier is certainly described in all target files!" - exit 0 - fi diff --git a/.github/workflows/deploy-test-environment.yml b/.github/workflows/deploy-test-environment.yml deleted file mode 100644 index 66b15beb91..0000000000 --- a/.github/workflows/deploy-test-environment.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: deploy-test-environment - -on: - issue_comment: - types: [created] - workflow_dispatch: - inputs: - repository: - description: 'Repository to deploy (optional, use the repository where this workflow is stored by default)' - required: false - default: '' - branch_or_hash: - description: 'Branch or Commit hash to deploy (optional, use the branch where this workflow is stored by default)' - required: false - default: '' - wait_time: - description: 'Time to wait in seconds (optional, 1800 seconds by default)' - required: false - default: '' - -jobs: - get-pr-ref: - runs-on: ubuntu-latest - if: github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/preview') - outputs: - is-allowed-user: ${{ steps.check-allowed-users.outputs.is-allowed-user }} - pr-ref: ${{ steps.get-ref.outputs.pr-ref }} - wait_time: ${{ steps.get-wait-time.outputs.wait_time }} - steps: - - name: Checkout - uses: actions/checkout@v4.1.1 - - - name: Check allowed users - id: check-allowed-users - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ORG_ID: ${{ github.repository_owner_id }} - COMMENT_AUTHOR: ${{ github.event.comment.user.login }} - run: | - MEMBERSHIP_STATUS=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "https://api.github.com/organizations/$ORG_ID/public_members/$COMMENT_AUTHOR" \ - -o /dev/null -w '%{http_code}\n' -s) - if [ "$MEMBERSHIP_STATUS" -eq 204 ]; then - echo "is-allowed-user=true" > $GITHUB_OUTPUT - else - echo "is-allowed-user=false" > $GITHUB_OUTPUT - fi - - - name: Get PR ref - id: get-ref - run: | - PR_REF="refs/pull/${{ github.event.issue.number }}/head" - echo "pr-ref=$PR_REF" >> $GITHUB_OUTPUT - - - name: Extract wait time - id: get-wait-time - env: - COMMENT_BODY: ${{ github.event.comment.body }} - run: | - WAIT_TIME=$(echo "$COMMENT_BODY" | grep -oP '(?<=/preview\s)\d+' || echo "1800") - echo "wait_time=$WAIT_TIME" > $GITHUB_OUTPUT - - deploy-test-environment-pr-comment: - needs: get-pr-ref - if: needs.get-pr-ref.outputs.is-allowed-user == 'true' - uses: joinmisskey/misskey-tga/.github/workflows/deploy-test-environment.yml@main - with: - repository: ${{ github.repository }} - branch_or_hash: ${{ needs.get-pr-ref.outputs.pr-ref }} - wait_time: ${{ needs.get-pr-ref.outputs.wait_time }} - secrets: - DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} - - deploy-test-environment-wd: - if: github.event_name == 'workflow_dispatch' - uses: joinmisskey/misskey-tga/.github/workflows/deploy-test-environment.yml@main - with: - repository: ${{ inputs.repository || github.repository }} - branch_or_hash: ${{ inputs.branch_or_hash || github.ref_name }} - wait_time: ${{ inputs.wait_time || '1800' }} - secrets: - DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} diff --git a/.github/workflows/docker-develop.yml b/.github/workflows/docker-develop.yml index ac2b1b4d35..a43789b754 100644 --- a/.github/workflows/docker-develop.yml +++ b/.github/workflows/docker-develop.yml @@ -6,83 +6,38 @@ on: - develop workflow_dispatch: -env: - REGISTRY_IMAGE: misskey/misskey - jobs: - # see https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners - build: - name: Build + push_to_registry: + name: Push Docker image to Docker Hub runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - platform: - - linux/amd64 - - linux/arm64 if: github.repository == 'misskey-dev/misskey' steps: - - name: Prepare - run: | - platform=${{ matrix.platform }} - echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Check out the repo uses: actions/checkout@v4.1.1 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + id: buildx + uses: docker/setup-buildx-action@v3.0.0 + with: + platforms: linux/amd64,linux/arm64 + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: misskey/misskey - name: Log in to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build and push by digest - id: build - uses: docker/build-push-action@v6 + - name: Build and Push to Docker Hub + uses: docker/build-push-action@v5 with: + builder: ${{ steps.buildx.outputs.name }} context: . push: true - platforms: ${{ matrix.platform }} + platforms: ${{ steps.buildx.outputs.platforms }} provenance: false + tags: misskey/misskey:develop labels: develop cache-from: type=gha cache-to: type=gha,mode=max - outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true - - name: Export digest - run: | - mkdir -p /tmp/digests - digest="${{ steps.build.outputs.digest }}" - touch "/tmp/digests/${digest#sha256:}" - - name: Upload digest - uses: actions/upload-artifact@v4 - with: - name: digests-${{ env.PLATFORM_PAIR }} - path: /tmp/digests/* - if-no-files-found: error - retention-days: 1 - - merge: - runs-on: ubuntu-latest - needs: - - build - steps: - - name: Download digests - uses: actions/download-artifact@v4 - with: - path: /tmp/digests - pattern: digests-* - merge-multiple: true - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Create manifest list and push - working-directory: /tmp/digests - run: | - docker buildx imagetools create --tag ${{ env.REGISTRY_IMAGE }}:develop \ - $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) - - name: Inspect image - run: | - docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:develop diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index db899ba386..08cb91c2d0 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -5,101 +5,45 @@ on: types: [published] workflow_dispatch: -env: - REGISTRY_IMAGE: misskey/misskey - TAGS: | - type=edge - type=ref,event=pr - type=ref,event=branch - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - jobs: - # see https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners - build: - name: Build + push_to_registry: + name: Push Docker image to Docker Hub runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - platform: - - linux/amd64 - - linux/arm64 + steps: - - name: Prepare - run: | - platform=${{ matrix.platform }} - echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Check out the repo uses: actions/checkout@v4.1.1 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + id: buildx + uses: docker/setup-buildx-action@v3.0.0 + with: + platforms: linux/amd64,linux/arm64 - name: Docker meta id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY_IMAGE }} - tags: ${{ env.TAGS }} + images: misskey/misskey + tags: | + type=edge + type=ref,event=pr + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} - name: Log in to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and Push to Docker Hub - id: build - uses: docker/build-push-action@v6 + uses: docker/build-push-action@v5 with: + builder: ${{ steps.buildx.outputs.name }} context: . push: true - platforms: ${{ matrix.platform }} + platforms: ${{ steps.buildx.outputs.platforms }} provenance: false + tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max - outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true - - name: Export digest - run: | - mkdir -p /tmp/digests - digest="${{ steps.build.outputs.digest }}" - touch "/tmp/digests/${digest#sha256:}" - - name: Upload digest - uses: actions/upload-artifact@v4 - with: - name: digests-${{ env.PLATFORM_PAIR }} - path: /tmp/digests/* - if-no-files-found: error - retention-days: 1 - - merge: - runs-on: ubuntu-latest - needs: - - build - steps: - - name: Download digests - uses: actions/download-artifact@v4 - with: - path: /tmp/digests - pattern: digests-* - merge-multiple: true - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY_IMAGE }} - tags: ${{ env.TAGS }} - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Create manifest list and push - working-directory: /tmp/digests - run: | - docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) - - name: Inspect image - run: | - docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/dockle.yml b/.github/workflows/dockle.yml index c3dba4213d..eee7a78fed 100644 --- a/.github/workflows/dockle.yml +++ b/.github/workflows/dockle.yml @@ -13,16 +13,14 @@ jobs: runs-on: ubuntu-latest env: DOCKER_CONTENT_TRUST: 1 - DOCKLE_VERSION: 0.4.14 steps: - uses: actions/checkout@v4.1.1 - - name: Download and install dockle v${{ env.DOCKLE_VERSION }} - run: | - curl -L -o dockle.deb "https://github.com/goodwithtech/dockle/releases/download/v${DOCKLE_VERSION}/dockle_${DOCKLE_VERSION}_Linux-64bit.deb" + - 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 - run: | cp .config/docker_example.env .config/docker.env - cp ./compose_example.yml ./compose.yml + cp ./docker-compose_example.yml ./docker-compose.yml - run: | docker compose up -d web docker tag "$(docker compose images web | awk 'OFS=":" {print $4}' | tail -n +2)" misskey-web:latest diff --git a/.github/workflows/get-api-diff.yml b/.github/workflows/get-api-diff.yml index 1bcaa0d9c4..bf92e701b2 100644 --- a/.github/workflows/get-api-diff.yml +++ b/.github/workflows/get-api-diff.yml @@ -9,6 +9,7 @@ on: paths: - packages/backend/** - .github/workflows/get-api-diff.yml + jobs: get-from-misskey: runs-on: ubuntu-latest @@ -17,7 +18,7 @@ jobs: strategy: matrix: - node-version: [20.16.0] + node-version: [20.10.0] api-json-name: [api-base.json, api-head.json] include: - api-json-name: api-base.json @@ -31,9 +32,12 @@ jobs: ref: ${{ matrix.ref }} submodules: true - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.4 + uses: actions/setup-node@v4.0.1 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 90eb268dda..f3074ab0a4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,29 +5,8 @@ on: branches: - master - develop - paths: - - packages/backend/** - - packages/frontend/** - - packages/frontend-shared/** - - packages/frontend-embed/** - - packages/sw/** - - packages/misskey-js/** - - packages/misskey-bubble-game/** - - packages/misskey-reversi/** - - packages/shared/eslint.config.js - - .github/workflows/lint.yml pull_request: - paths: - - packages/backend/** - - packages/frontend/** - - packages/frontend-shared/** - - packages/frontend-embed/** - - packages/sw/** - - packages/misskey-js/** - - packages/misskey-bubble-game/** - - packages/misskey-reversi/** - - packages/shared/eslint.config.js - - .github/workflows/lint.yml + jobs: pnpm_install: runs-on: ubuntu-latest @@ -36,8 +15,11 @@ jobs: with: fetch-depth: 0 submodules: true - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4.0.4 + - uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false + - uses: actions/setup-node@v4.0.1 with: node-version-file: '.node-version' cache: 'pnpm' @@ -53,34 +35,24 @@ jobs: workspace: - backend - frontend - - frontend-shared - - frontend-embed - sw - misskey-js - - misskey-bubble-game - - misskey-reversi - env: - eslint-cache-version: v1 - eslint-cache-path: ${{ github.workspace }}/node_modules/.cache/eslint-${{ matrix.workspace }} steps: - uses: actions/checkout@v4.1.1 with: fetch-depth: 0 submodules: true - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4.0.4 + - uses: pnpm/action-setup@v2 + with: + version: 7 + run_install: false + - uses: actions/setup-node@v4.0.1 with: node-version-file: '.node-version' cache: 'pnpm' - run: corepack enable - run: pnpm i --frozen-lockfile - - name: Restore eslint cache - uses: actions/cache@v4.1.0 - with: - path: ${{ env.eslint-cache-path }} - key: eslint-${{ env.eslint-cache-version }}-${{ matrix.workspace }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.ref_name }}-${{ github.sha }} - restore-keys: eslint-${{ env.eslint-cache-version }}-${{ matrix.workspace }}-${{ hashFiles('**/pnpm-lock.yaml') }}- - - run: pnpm --filter ${{ matrix.workspace }} run eslint --cache --cache-location ${{ env.eslint-cache-path }} --cache-strategy content + - run: pnpm --filter ${{ matrix.workspace }} run eslint typecheck: needs: [pnpm_install] @@ -90,22 +62,22 @@ jobs: matrix: workspace: - backend - - sw - misskey-js steps: - uses: actions/checkout@v4.1.1 with: fetch-depth: 0 submodules: true - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4.0.4 + - uses: pnpm/action-setup@v2 + with: + version: 7 + run_install: false + - uses: actions/setup-node@v4.0.1 with: node-version-file: '.node-version' cache: 'pnpm' - run: corepack enable - run: pnpm i --frozen-lockfile - run: pnpm --filter misskey-js run build - if: ${{ matrix.workspace == 'backend' || matrix.workspace == 'sw' }} - - run: pnpm --filter misskey-reversi run build if: ${{ matrix.workspace == 'backend' }} - run: pnpm --filter ${{ matrix.workspace }} run typecheck diff --git a/.github/workflows/locale.yml b/.github/workflows/locale.yml deleted file mode 100644 index 6bc8860a11..0000000000 --- a/.github/workflows/locale.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Lint - -on: - push: - paths: - - locales/** - - .github/workflows/locale.yml - pull_request: - paths: - - locales/** - - .github/workflows/locale.yml -jobs: - locale_verify: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v4.1.1 - with: - fetch-depth: 0 - submodules: true - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4.0.4 - with: - node-version-file: '.node-version' - cache: 'pnpm' - - run: corepack enable - - run: pnpm i --frozen-lockfile - - run: cd locales && node verify.js diff --git a/.github/workflows/ok-to-test.yml b/.github/workflows/ok-to-test.yml index 8362c006eb..c02b980e4d 100644 --- a/.github/workflows/ok-to-test.yml +++ b/.github/workflows/ok-to-test.yml @@ -23,7 +23,7 @@ jobs: private_key: ${{ secrets.DEPLOYBOT_PRIVATE_KEY }} - name: Slash Command Dispatch - uses: peter-evans/slash-command-dispatch@v4 + uses: peter-evans/slash-command-dispatch@v3 env: TOKEN: ${{ steps.generate_token.outputs.token }} with: diff --git a/.github/workflows/on-release-created.yml b/.github/workflows/on-release-created.yml deleted file mode 100644 index ffaf7bc038..0000000000 --- a/.github/workflows/on-release-created.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: On Release Created (Publish misskey-js) - -on: - release: - types: [created] - - workflow_dispatch: - -jobs: - publish-misskey-js: - name: Publish misskey-js - runs-on: ubuntu-latest - - permissions: - contents: read - id-token: write - - strategy: - matrix: - node-version: [20.16.0] - - steps: - - uses: actions/checkout@v4.1.1 - with: - submodules: true - - name: Install pnpm - uses: pnpm/action-setup@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.4 - with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - registry-url: 'https://registry.npmjs.org' - - name: Publish package - run: | - corepack enable - pnpm i --frozen-lockfile - pnpm build - pnpm --filter misskey-js publish --access public --no-git-checks --provenance - env: - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} - NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} diff --git a/.github/workflows/pr-preview-deploy.yml b/.github/workflows/pr-preview-deploy.yml index 964d24c3d7..cb9a4ebfc8 100644 --- a/.github/workflows/pr-preview-deploy.yml +++ b/.github/workflows/pr-preview-deploy.yml @@ -13,7 +13,7 @@ jobs: github.event.client_payload.slash_command.sha != '' && contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.sha) steps: - - uses: actions/github-script@v7.0.1 + - uses: actions/github-script@v7 id: check-id env: number: ${{ github.event.client_payload.pull_request.number }} @@ -37,7 +37,7 @@ jobs: return check[0].id; - - uses: actions/github-script@v7.0.1 + - uses: actions/github-script@v7 env: check_id: ${{ steps.check-id.outputs.result }} details_url: ${{ github.server_url }}/${{ github.repository }}/runs/${{ github.run_id }} @@ -72,7 +72,7 @@ jobs: timeout: 15m # Update check run called "integration-fork" - - uses: actions/github-script@v7.0.1 + - uses: actions/github-script@v7 id: update-check-run if: ${{ always() }} env: diff --git a/.github/workflows/pr-preview-destroy.yml b/.github/workflows/pr-preview-destroy.yml index 8967eb2f94..47d9eb313a 100644 --- a/.github/workflows/pr-preview-destroy.yml +++ b/.github/workflows/pr-preview-destroy.yml @@ -10,7 +10,7 @@ jobs: destroy-preview-environment: runs-on: ubuntu-latest steps: - - uses: actions/github-script@v7.0.1 + - uses: actions/github-script@v7 id: check-conclusion env: number: ${{ github.event.number }} diff --git a/.github/workflows/release-edit-with-push.yml b/.github/workflows/release-edit-with-push.yml deleted file mode 100644 index 57657a4ba7..0000000000 --- a/.github/workflows/release-edit-with-push.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: "Release Manager: sync changelog with PR" - -on: - push: - branches: - - develop - paths: - - 'CHANGELOG.md' - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -permissions: - contents: write - issues: write - pull-requests: write - -jobs: - edit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # headが$GITHUB_REF_NAME, baseが$STABLE_BRANCHかつopenのPRを1つ取得 - - name: Get PR - run: | - echo "pr_number=$(gh pr list --limit 1 --search "head:$GITHUB_REF_NAME base:$STABLE_BRANCH is:open" --json number --jq '.[] | .number')" >> $GITHUB_OUTPUT - id: get_pr - env: - STABLE_BRANCH: ${{ vars.STABLE_BRANCH }} - - name: Get target version - if: steps.get_pr.outputs.pr_number != '' - uses: misskey-dev/release-manager-actions/.github/actions/get-target-version@v2 - id: v - # CHANGELOG.mdの内容を取得 - - name: Get changelog - if: steps.get_pr.outputs.pr_number != '' - uses: misskey-dev/release-manager-actions/.github/actions/get-changelog@v2 - with: - version: ${{ steps.v.outputs.target_version }} - id: changelog - # PRのnotesを更新 - - name: Update PR - if: steps.get_pr.outputs.pr_number != '' - run: | - gh pr edit "$PR_NUMBER" --body "$CHANGELOG" - env: - PR_NUMBER: ${{ steps.get_pr.outputs.pr_number }} - CHANGELOG: ${{ steps.changelog.outputs.changelog }} diff --git a/.github/workflows/release-with-dispatch.yml b/.github/workflows/release-with-dispatch.yml deleted file mode 100644 index ed2f822269..0000000000 --- a/.github/workflows/release-with-dispatch.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: "Release Manager [Dispatch]" - -on: - workflow_dispatch: - inputs: - ## Specify the type of the next release. - #version_increment_type: - # type: choice - # description: 'VERSION INCREMENT TYPE' - # default: 'patch' - # required: false - # options: - # - 'major' - # - 'minor' - # - 'patch' - merge: - type: boolean - description: 'MERGE RELEASE BRANCH TO MAIN' - default: false - start-rc: - type: boolean - description: 'Start Release Candidate' - default: false - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -permissions: - contents: write - issues: write - pull-requests: write - -jobs: - get-pr: - runs-on: ubuntu-latest - outputs: - pr_number: ${{ steps.get_pr.outputs.pr_number }} - steps: - - uses: actions/checkout@v4 - # headが$GITHUB_REF_NAME, baseが$STABLE_BRANCHかつopenのPRを1つ取得 - - name: Get PRs - run: | - echo "pr_number=$(gh pr list --limit 1 --search "head:$GITHUB_REF_NAME base:$STABLE_BRANCH is:open" --json number --jq '.[] | .number')" >> $GITHUB_OUTPUT - id: get_pr - env: - STABLE_BRANCH: ${{ vars.STABLE_BRANCH }} - - merge: - uses: misskey-dev/release-manager-actions/.github/workflows/merge.yml@v2 - needs: get-pr - if: ${{ needs.get-pr.outputs.pr_number != '' && inputs.merge == true }} - with: - pr_number: ${{ needs.get-pr.outputs.pr_number }} - user: 'github-actions[bot]' - package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }} - # Text to prepend to the changelog - # The first line must be `## Unreleased` - changes_template: | - ## Unreleased - - ### General - - - - ### Client - - - - ### Server - - - - use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }} - indent: ${{ vars.INDENT }} - secrets: - RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }} - RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} - - create-prerelease: - uses: misskey-dev/release-manager-actions/.github/workflows/create-prerelease.yml@v2 - needs: get-pr - if: ${{ needs.get-pr.outputs.pr_number != '' && inputs.merge != true }} - with: - pr_number: ${{ needs.get-pr.outputs.pr_number }} - user: 'github-actions[bot]' - package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }} - use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }} - indent: ${{ vars.INDENT }} - draft_prerelease_channel: alpha - ready_start_prerelease_channel: beta - prerelease_channel: ${{ inputs.start-rc && 'rc' || '' }} - secrets: - RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }} - RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} - - create-target: - uses: misskey-dev/release-manager-actions/.github/workflows/create-target.yml@v2 - needs: get-pr - if: ${{ needs.get-pr.outputs.pr_number == '' }} - with: - user: 'github-actions[bot]' - # The script for version increment. - # process.env.CURRENT_VERSION: The current version. - # - # Misskey calender versioning (yyyy.MM.patch) example - version_increment_script: | - const now = new Date(); - const year = now.toLocaleDateString('en-US', { year: 'numeric', timeZone: 'Asia/Tokyo' }); - const month = now.toLocaleDateString('en-US', { month: 'numeric', timeZone: 'Asia/Tokyo' }); - const [major, minor, _patch] = process.env.CURRENT_VERSION.split('.'); - const patch = Number(_patch.split('-')[0]); - if (Number.isNaN(patch)) { - console.error('Invalid patch version', year, month, process.env.CURRENT_VERSION, major, minor, _patch); - throw new Error('Invalid patch version'); - } - if (year !== major || month !== minor) { - return `${year}.${month}.0`; - } else { - return `${major}.${minor}.${patch + 1}`; - } - ##Semver example - #version_increment_script: | - # const [major, minor, patch] = process.env.CURRENT_VERSION.split('.'); - # if ("${{ inputs.version_increment_type }}" === "major") { - # return `${Number(major) + 1}.0.0`; - # } else if ("${{ inputs.version_increment_type }}" === "minor") { - # return `${major}.${Number(minor) + 1}.0`; - # } else { - # return `${major}.${minor}.${Number(patch) + 1}`; - # } - package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }} - use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }} - indent: ${{ vars.INDENT }} - stable_branch: ${{ vars.STABLE_BRANCH }} - draft_prerelease_channel: alpha - secrets: - RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }} - RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} diff --git a/.github/workflows/release-with-ready.yml b/.github/workflows/release-with-ready.yml deleted file mode 100644 index e863b5e2e8..0000000000 --- a/.github/workflows/release-with-ready.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: "Release Manager: release RC when ready for review" - -on: - pull_request: - types: [ready_for_review] - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -permissions: - contents: write - issues: write - pull-requests: write - -jobs: - check: - runs-on: ubuntu-latest - outputs: - head: ${{ steps.get_pr.outputs.head }} - base: ${{ steps.get_pr.outputs.base }} - steps: - - uses: actions/checkout@v4 - # PR情報を取得 - - name: Get PR - run: | - pr_json=$(gh pr view "$PR_NUMBER" --json isDraft,headRefName,baseRefName) - echo "head=$(echo $pr_json | jq -r '.headRefName')" >> $GITHUB_OUTPUT - echo "base=$(echo $pr_json | jq -r '.baseRefName')" >> $GITHUB_OUTPUT - id: get_pr - env: - PR_NUMBER: ${{ github.event.pull_request.number }} - release: - uses: misskey-dev/release-manager-actions/.github/workflows/create-prerelease.yml@v2 - needs: check - if: needs.check.outputs.head == github.event.repository.default_branch && needs.check.outputs.base == vars.STABLE_BRANCH - with: - pr_number: ${{ github.event.pull_request.number }} - user: 'github-actions[bot]' - package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }} - use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }} - indent: ${{ vars.INDENT }} - draft_prerelease_channel: alpha - ready_start_prerelease_channel: beta - secrets: - RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }} - RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} diff --git a/.github/workflows/report-api-diff.yml b/.github/workflows/report-api-diff.yml index 1170f898ce..54da8b4a83 100644 --- a/.github/workflows/report-api-diff.yml +++ b/.github/workflows/report-api-diff.yml @@ -16,7 +16,7 @@ jobs: # api-artifact steps: - name: Download artifact - uses: actions/github-script@v7.0.1 + uses: actions/github-script@v7 with: script: | const fs = require('fs'); @@ -70,25 +70,18 @@ jobs: - id: out-diff name: Build diff Comment run: | - HEADER="このPRによるapi.jsonの差分" - FOOTER="[Get diff files from Workflow Page](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})" - DIFF_BYTES="$(stat ./api.json.diff -c '%s' | tr -d '\n')" - - echo "$HEADER" > ./output.md - - if (( "$DIFF_BYTES" <= 1 )); then - echo '差分はありません。' >> ./output.md - else - echo '
' >> ./output.md - echo '差分はこちら' >> ./output.md - echo >> ./output.md - echo '```diff' >> ./output.md - cat ./api.json.diff >> ./output.md - echo '```' >> ./output.md - echo '
' >> .output.md - fi - - echo "$FOOTER" >> ./output.md + cat <<- EOF > ./output.md + このPRによるapi.jsonの差分 +
+ 差分はこちら + + \`\`\`diff + $(cat ./api.json.diff) + \`\`\` +
+ + [Get diff files from Workflow Page](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}) + EOF - uses: thollander/actions-comment-pull-request@v2 with: pr_number: ${{ steps.load-pr-num.outputs.pr-number }} diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml deleted file mode 100644 index c02f38ee0b..0000000000 --- a/.github/workflows/storybook.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: Storybook - -on: - push: - branches: - - master - - develop - - dev/storybook8 # for testing - pull_request_target: - branches-ignore: - # Since pull requests targets master mostly is the "develop" branch. - # Storybook CI is checked on the "push" event of "develop" branch so it would cause a duplicate build. - # This is a waste of chromatic build quota, so we don't run storybook CI on pull requests targets master. - - master - -jobs: - build: - runs-on: ubuntu-latest - - env: - NODE_OPTIONS: "--max_old_space_size=7168" - - steps: - - uses: actions/checkout@v4.1.1 - if: github.event_name != 'pull_request_target' - with: - fetch-depth: 0 - submodules: true - - uses: actions/checkout@v4.1.1 - if: github.event_name == 'pull_request_target' - with: - fetch-depth: 0 - submodules: true - ref: "refs/pull/${{ github.event.number }}/merge" - - name: Checkout actual HEAD - if: github.event_name == 'pull_request_target' - id: rev - run: | - echo "base=$(git rev-list --parents -n1 HEAD | cut -d" " -f2)" >> $GITHUB_OUTPUT - git checkout $(git rev-list --parents -n1 HEAD | cut -d" " -f3) - - name: Install pnpm - uses: pnpm/action-setup@v4 - - name: Use Node.js 20.x - uses: actions/setup-node@v4.0.4 - with: - node-version-file: '.node-version' - cache: 'pnpm' - - run: corepack enable - - run: pnpm i --frozen-lockfile - - name: Check pnpm-lock.yaml - run: git diff --exit-code pnpm-lock.yaml - - name: Build misskey-js - run: pnpm --filter misskey-js build - - name: Build storybook - run: pnpm --filter frontend build-storybook - - name: Publish to Chromatic - if: github.event_name != 'pull_request_target' && github.ref == 'refs/heads/master' - run: pnpm --filter frontend chromatic --exit-once-uploaded -d storybook-static - env: - CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - - name: Publish to Chromatic - if: github.event_name != 'pull_request_target' && github.ref != 'refs/heads/master' - id: chromatic_push - run: | - DIFF="${{ github.event.before }} HEAD" - if [ "$DIFF" = "0000000000000000000000000000000000000000 HEAD" ]; then - DIFF="HEAD" - fi - CHROMATIC_PARAMETER="$(node packages/frontend/.storybook/changes.js $(git diff-tree --no-commit-id --name-only -r $(echo "$DIFF") | xargs))" - if [ "$CHROMATIC_PARAMETER" = " --skip" ]; then - echo "skip=true" >> $GITHUB_OUTPUT - fi - if pnpm --filter frontend chromatic -d storybook-static $(echo "$CHROMATIC_PARAMETER"); then - echo "success=true" >> $GITHUB_OUTPUT - else - echo "success=false" >> $GITHUB_OUTPUT - fi - env: - CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - - name: Publish to Chromatic - if: github.event_name == 'pull_request_target' - id: chromatic_pull_request - run: | - DIFF="${{ steps.rev.outputs.base }} HEAD" - if [ "$DIFF" = "0000000000000000000000000000000000000000 HEAD" ]; then - DIFF="HEAD" - fi - CHROMATIC_PARAMETER="$(node packages/frontend/.storybook/changes.js $(git diff-tree --no-commit-id --name-only -r $(echo "$DIFF") | xargs))" - if [ "$CHROMATIC_PARAMETER" = " --skip" ]; then - echo "skip=true" >> $GITHUB_OUTPUT - fi - BRANCH="${{ github.event.pull_request.head.user.login }}:$HEAD_REF" - if [ "$BRANCH" = "misskey-dev:$HEAD_REF" ]; then - BRANCH="$HEAD_REF" - fi - pnpm --filter frontend chromatic --exit-once-uploaded -d storybook-static --branch-name "$BRANCH" $(echo "$CHROMATIC_PARAMETER") - env: - HEAD_REF: ${{ github.event.pull_request.head.ref }} - CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - - name: Notify that Chromatic detects changes - uses: actions/github-script@v7.0.1 - if: github.event_name != 'pull_request_target' && steps.chromatic_push.outputs.success == 'false' - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - github.rest.repos.createCommitComment({ - owner: context.repo.owner, - repo: context.repo.repo, - commit_sha: context.sha, - body: 'Chromatic detects changes. Please [review the changes on Chromatic](https://www.chromatic.com/builds?appId=6428f7d7b962f0b79f97d6e4).' - }) - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: storybook - path: packages/frontend/storybook-static diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml index d95d6676f9..9681cbec59 100644 --- a/.github/workflows/test-backend.yml +++ b/.github/workflows/test-backend.yml @@ -5,24 +5,15 @@ on: branches: - master - develop - paths: - - packages/backend/** - # for permissions - - packages/misskey-js/** - - .github/workflows/test-backend.yml pull_request: - paths: - - packages/backend/** - # for permissions - - packages/misskey-js/** - - .github/workflows/test-backend.yml + jobs: - unit: + jest: runs-on: ubuntu-latest strategy: matrix: - node-version: [20.16.0] + node-version: [20.10.0] services: postgres: @@ -42,11 +33,12 @@ jobs: with: submodules: true - name: Install pnpm - uses: pnpm/action-setup@v4 - - name: Install FFmpeg - uses: FedericoCarboni/setup-ffmpeg@v3 + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.4 + uses: actions/setup-node@v4.0.1 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' @@ -59,56 +51,9 @@ jobs: - name: Build run: pnpm build - name: Test - run: pnpm --filter backend test-and-coverage - - name: Upload to Codecov - uses: codecov/codecov-action@v4 + run: pnpm jest-and-coverage + - name: Upload Coverage + uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./packages/backend/coverage/coverage-final.json - - e2e: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [20.16.0] - - services: - postgres: - image: postgres:15 - ports: - - 54312:5432 - env: - POSTGRES_DB: test-misskey - POSTGRES_HOST_AUTH_METHOD: trust - redis: - image: redis:7 - ports: - - 56312:6379 - - steps: - - uses: actions/checkout@v4.1.1 - with: - submodules: true - - name: Install pnpm - uses: pnpm/action-setup@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.4 - with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - - run: corepack enable - - run: pnpm i --frozen-lockfile - - name: Check pnpm-lock.yaml - run: git diff --exit-code pnpm-lock.yaml - - name: Copy Configure - run: cp .github/misskey/test.yml .config - - name: Build - run: pnpm build - - name: Test - run: pnpm --filter backend test-and-coverage:e2e - - name: Upload to Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./packages/backend/coverage/coverage-final.json diff --git a/.github/workflows/test-federation.yml b/.github/workflows/test-federation.yml deleted file mode 100644 index 183ddb6f34..0000000000 --- a/.github/workflows/test-federation.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Test (federation) - -on: - push: - branches: - - master - - develop - paths: - - packages/backend/** - - packages/misskey-js/** - - .github/workflows/test-federation.yml - pull_request: - paths: - - packages/backend/** - - packages/misskey-js/** - - .github/workflows/test-federation.yml - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20.16.0] - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install pnpm - uses: pnpm/action-setup@v4 - - name: Install FFmpeg - uses: FedericoCarboni/setup-ffmpeg@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.3 - with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - - name: Build Misskey - run: | - corepack enable && corepack prepare - pnpm i --frozen-lockfile - pnpm build - - name: Setup - run: | - cd packages/backend/test-federation - bash ./setup.sh - sudo chmod 644 ./certificates/*.test.key - - name: Start servers - # https://github.com/docker/compose/issues/1294#issuecomment-374847206 - run: | - cd packages/backend/test-federation - docker compose up -d --scale tester=0 - - name: Test - run: | - cd packages/backend/test-federation - docker compose run --no-deps tester - - name: Stop servers - run: | - cd packages/backend/test-federation - docker compose down diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml index c68e1a8ef1..83740bf156 100644 --- a/.github/workflows/test-frontend.yml +++ b/.github/workflows/test-frontend.yml @@ -5,37 +5,27 @@ on: branches: - master - develop - paths: - - packages/frontend/** - # for permissions - - packages/misskey-js/** - # for e2e - - packages/backend/** - - .github/workflows/test-frontend.yml pull_request: - paths: - - packages/frontend/** - # for permissions - - packages/misskey-js/** - # for e2e - - packages/backend/** - - .github/workflows/test-frontend.yml + jobs: vitest: runs-on: ubuntu-latest strategy: matrix: - node-version: [20.16.0] + node-version: [20.10.0] steps: - uses: actions/checkout@v4.1.1 with: submodules: true - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.4 + uses: actions/setup-node@v4.0.1 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' @@ -50,7 +40,7 @@ jobs: - name: Test run: pnpm --filter frontend test-and-coverage - name: Upload Coverage - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./packages/frontend/coverage/coverage-final.json @@ -61,7 +51,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [20.16.0] + node-version: [20.10.0] browser: [chrome] services: @@ -88,9 +78,12 @@ jobs: #- uses: browser-actions/setup-firefox@latest # if: ${{ matrix.browser == 'firefox' }} - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@v2 + with: + version: 7 + run_install: false - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.4 + uses: actions/setup-node@v4.0.1 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' @@ -109,7 +102,6 @@ jobs: run: pnpm exec cypress install - name: Cypress run uses: cypress-io/github-action@v6 - timeout-minutes: 15 with: install: false start: pnpm start:test diff --git a/.github/workflows/test-misskey-js.yml b/.github/workflows/test-misskey-js.yml index 63e81f8c92..055152f321 100644 --- a/.github/workflows/test-misskey-js.yml +++ b/.github/workflows/test-misskey-js.yml @@ -6,14 +6,9 @@ name: Test (misskey.js) on: push: branches: [ develop ] - paths: - - packages/misskey-js/** - - .github/workflows/test-misskey-js.yml pull_request: branches: [ develop ] - paths: - - packages/misskey-js/** - - .github/workflows/test-misskey-js.yml + jobs: test: @@ -21,7 +16,7 @@ jobs: strategy: matrix: - node-version: [20.16.0] + node-version: [20.10.0] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: @@ -31,7 +26,7 @@ jobs: - run: corepack enable - name: Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.4 + uses: actions/setup-node@v4.0.1 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' @@ -51,7 +46,7 @@ jobs: CI: true - name: Upload Coverage - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./packages/misskey-js/coverage/coverage-final.json diff --git a/.github/workflows/test-production.yml b/.github/workflows/test-production.yml index 0abc09c5a6..9e02c0d8f8 100644 --- a/.github/workflows/test-production.yml +++ b/.github/workflows/test-production.yml @@ -16,16 +16,19 @@ jobs: strategy: matrix: - node-version: [20.16.0] + node-version: [20.10.0] steps: - uses: actions/checkout@v4.1.1 with: submodules: true - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: false - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.4 + uses: actions/setup-node@v4.0.1 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' diff --git a/.github/workflows/validate-api-json.yml b/.github/workflows/validate-api-json.yml deleted file mode 100644 index f809af1063..0000000000 --- a/.github/workflows/validate-api-json.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Test (backend) - -on: - push: - branches: - - master - - develop - paths: - - packages/backend/** - - .github/workflows/validate-api-json.yml - pull_request: - paths: - - packages/backend/** - - .github/workflows/validate-api-json.yml -jobs: - validate-api-json: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [20.16.0] - - steps: - - uses: actions/checkout@v4.1.1 - with: - submodules: true - - name: Install pnpm - uses: pnpm/action-setup@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4.0.4 - with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - - name: Install Redocly CLI - run: npm i -g @redocly/cli - - run: corepack enable - - run: pnpm i --frozen-lockfile - - name: Check pnpm-lock.yaml - run: git diff --exit-code pnpm-lock.yaml - - name: Copy Configure - run: cp .config/example.yml .config/default.yml - - name: Build and generate - run: pnpm build && pnpm --filter backend generate-api-json - - name: Validation - run: npx @redocly/cli lint --extends=minimal ./packages/backend/built/api.json diff --git a/.gitignore b/.gitignore index 5b8a798ba6..a66e527db0 100644 --- a/.gitignore +++ b/.gitignore @@ -35,17 +35,12 @@ coverage !/.config/example.yml !/.config/docker_example.yml !/.config/docker_example.env -!/.config/cypress-devcontainer.yml docker-compose.yml -./compose.yml -.devcontainer/compose.yml -!/.devcontainer/compose.yml +!/.devcontainer/docker-compose.yml # misskey /build built -built-test -js-built /data /.cache-loader /db @@ -62,12 +57,6 @@ api-docs.json ormconfig.json temp /packages/frontend/src/**/*.stories.ts -tsdoc-metadata.json -misskey-assets - -# Vite temporary files -vite.config.js.timestamp-* -vite.config.ts.timestamp-* # blender backups *.blend1 diff --git a/.gitmodules b/.gitmodules index 3218575273..225a69a652 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ +[submodule "misskey-assets"] + path = misskey-assets + url = https://github.com/misskey-dev/assets.git [submodule "fluent-emojis"] path = fluent-emojis url = https://github.com/misskey-dev/emojis.git diff --git a/.node-version b/.node-version index 8ce7030825..d5a159609d 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -20.16.0 +20.10.0 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 3cdf81e339..baca8db246 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,7 +3,9 @@ "editorconfig.editorconfig", "dbaeumer.vscode-eslint", "Vue.volar", + "Vue.vscode-typescript-vue-plugin", "Orta.vscode-jest", + "dbaeumer.vscode-eslint", "mrmlnc.vscode-json5" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 0ceec23acd..e2a82b1ffe 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,7 +7,7 @@ "*.test.ts": "typescript" }, "jest.jestCommandLine": "pnpm run jest", - "jest.runMode": "on-demand", + "jest.autoRun": "off", "editor.codeActionsOnSave": { "source.fixAll": "explicit" }, diff --git a/CHANGELOG.md b/CHANGELOG.md index c92b8c06a1..35168dd4a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,570 +1,22 @@ -## 2024.11.0 - -### General -- Feat: コンテンツの表示にログインを必須にできるように -- Feat: 過去のノートを非公開化/フォロワーのみ表示可能にできるように -- Enhance: 依存関係の更新 -- Enhance: l10nの更新 - -### Client -- Enhance: Bull DashboardでRelationship Queueの状態も確認できるように - (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/751) -- Enhance: ドライブでソートができるように -- Enhance: アイコンデコレーション管理画面の改善 -- Enhance: 「単なるラッキー」の取得条件を変更 -- Enhance: 投稿フォームでEscキーを押したときIME入力中ならフォームを閉じないように( #10866 ) -- Enhance: MiAuth, OAuthの認可画面の改善 - - どのアカウントで認証しようとしているのかがわかるように - - 認証するアカウントを切り替えられるように -- Enhance: Self-XSS防止用の警告を追加 -- Enhance: カタルーニャ語 (ca-ES) に対応 -- Enhance: 個別お知らせページではMetaタグを出力するように -- Fix: 通知の範囲指定の設定項目が必要ない通知設定でも範囲指定の設定がでている問題を修正 -- Fix: Turnstileが失敗・期限切れした際にも成功扱いとなってしまう問題を修正 - (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/768) -- Fix: デッキのタイムラインカラムで「センシティブなファイルを含むノートを表示」設定が使用できなかった問題を修正 -- Fix: Encode RSS urls with escape sequences before fetching allowing query parameters to be used -- Fix: リンク切れを修正 -= Fix: ノート投稿ボタンにホバー時のスタイルが適用されていないのを修正 - (Cherry-picked from https://github.com/taiyme/misskey/pull/305) -- Fix: メールアドレス登録有効化時の「完了」ダイアログボックスの表示条件を修正 - -### Server -- Enhance: 起動前の疎通チェックで、DBとメイン以外のRedisの疎通確認も行うように - (Based on https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/588) - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/715) -- Enhance: リモートユーザーの照会をオリジナルにリダイレクトするように -- Fix: フォロワーへのメッセージの絵文字をemojisに含めるように -- Fix: Nested proxy requestsを検出した際にブロックするように - [ghsa-gq5q-c77c-v236](https://github.com/misskey-dev/misskey/security/advisories/ghsa-gq5q-c77c-v236) -- Fix: 招待コードの発行可能な残り数算出に使用すべきロールポリシーの値が違う問題を修正 - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/706) -- Fix: 連合への配信時に、acctの大小文字が区別されてしまい正しくメンションが処理されないことがある問題を修正 - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/711) -- Fix: ローカルユーザーへのメンションを含むノートが連合される際に正しいURLに変換されないことがある問題を修正 - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/712) -- Fix: FTT無効時にユーザーリストタイムラインが使用できない問題を修正 - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/709) -- Fix: User Webhookテスト機能のMock Payloadを修正 - -### Misskey.js -- Fix: Stream初期化時、別途WebSocketを指定する場合の型定義を修正 - -## 2024.10.1 - -### Note -- スパム対策として、モデレータ権限を持つユーザのアクティビティが7日以上確認できない場合は自動的に招待制へと切り替え(コントロールパネル -> モデレーション -> "誰でも新規登録できるようにする"をオフに変更)るようになりました。 ( #13437 ) - - 切り替わった際はモデレーターへお知らせとして通知されます。登録をオープンな状態で継続したい場合は、コントロールパネルから再度設定を行ってください。 - -### General -- Feat: ユーザーの名前に禁止ワードを設定できるように - -### Client -- Enhance: タイムライン表示時のパフォーマンスを向上 -- Enhance: アーカイブした個人宛のお知らせを表示・編集できるように -- Enhance: l10nの更新 -- Fix: メールアドレス不要でCaptchaが有効な場合にアカウント登録完了後自動でのログインに失敗する問題を修正 - -### Server -- Feat: モデレータ権限を持つユーザが全員7日間活動しなかった場合は自動的に招待制へと切り替えるように ( #13437 ) -- Enhance: 個人宛のお知らせは「わかった」を押すと自動的にアーカイブされるように -- Fix: `admin/emoji/update`エンドポイントのidのみ指定した時不正なエラーが発生するバグを修正 -- Fix: RBT有効時、リノートのリアクションが反映されない問題を修正 -- Fix: キューのエラーログを簡略化するように - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/649) - -## 2024.10.0 - -### Note -- セキュリティ向上のため、サーバー初期設定時に使用する初期パスワードを設定できるようになりました。今後Misskeyサーバーを新たに設置する際には、初回の起動前にコンフィグファイルの`setupPassword`をコメントアウトし、初期パスワードを設定することをおすすめします。(すでに初期設定を完了しているサーバーについては、この変更に伴い対応する必要はありません) - - ホスティングサービスを運営している場合は、コンフィグファイルを構築する際に`setupPassword`をランダムな値に設定し、ユーザーに通知するようにシステムを更新することをおすすめします。 - - なお、初期パスワードが設定されていない場合でも初期設定を行うことが可能です(UI上で初期パスワードの入力欄を空欄にすると続行できます)。 -- ユーザーデータを読み込む際の型が一部変更されました。 - - `twoFactorEnabled`, `usePasswordLessLogin`, `securityKeys`: 自分とモデレーター以外のユーザーからは取得できなくなりました - -### General -- Feat: サーバー初期設定時に初期パスワードを設定できるように -- Feat: 通報にモデレーションノートを残せるように -- Feat: 通報の解決種別を設定できるように -- Enhance: 通報の解決と転送を個別に行えるように -- Enhance: セキュリティ向上のため、サインイン時もCAPTCHAを求めるようになりました -- Enhance: 依存関係の更新 -- Enhance: l10nの更新 -- Enhance: Playの「人気」タブで10件以上表示可能に #14399 -- Fix: 連合のホワイトリストが正常に登録されない問題を修正 - -### Client -- Enhance: デザインの調整 -- Enhance: ログイン画面の認証フローを改善 -- Fix: クライアント上での時間ベースの実績獲得動作が実績獲得後も発動していた問題を修正 - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/657) - -### Server -- Enhance: セキュリティ向上のため、ログイン時にメール通知を行うように -- Enhance: 自分とモデレーター以外のユーザーから二要素認証関連のデータが取得できないように -- Enhance: 通報および通報解決時に送出されるSystemWebhookにユーザ情報を含めるように ( #14697 ) -- Fix: `admin/abuse-user-reports`エンドポイントのスキーマが間違っていた問題を修正 - -## 2024.9.0 - -### General -- Feat: ノート単体・ユーザーのノート・クリップのノートの埋め込み機能 - - 埋め込みコードやウェブサイトへの実装方法の詳細は https://misskey-hub.net/docs/for-users/features/embed/ をご覧ください -- Feat: パスキーでログインボタンを実装 (#14574) -- Feat: フォローされた際のメッセージを設定できるように -- Feat: 連合をホワイトリスト制にできるように -- Feat: UserWebhookとSystemWebhookのテスト送信機能を追加 (#14445) -- Feat: モデレーターはユーザーにかかわらずファイルが添付されているノートを検索できるように - (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/680) -- Feat: データエクスポートが完了した際に通知を発行するように -- Enhance: ユーザーによるコンテンツインポートの可否をロールポリシーで制御できるように -- Enhance: 依存関係の更新 -- Enhance: l10nの更新 - -### Client -- Enhance: サイズ制限を超過するファイルをアップロードしようとした際にエラーを出すように -- Enhance: アイコンデコレーション管理画面にプレビューを追加 -- Enhance: コントロールパネル内のファイル一覧でセンシティブなファイルを区別しやすく -- Enhance: ScratchpadにUIインスペクターを追加 -- Enhance: Play編集画面の項目の並びを少しリデザイン -- Enhance: 各種メニューをドロワー表示するかどうか設定可能に -- Enhance: AiScriptのMk:C:containerのオプションに`borderStyle`と`borderRadius`を追加 -- Enhance: CWでも絵文字をクリックしてメニューを表示できるように -- Fix: サーバーメトリクスが2つ以上あるとリロード直後の表示がおかしくなる問題を修正 -- Fix: コントロールパネル内のAp requests内のチャートの表示がおかしかった問題を修正 -- Fix: 月の違う同じ日はセパレータが表示されないのを修正 -- Fix: タッチ画面でレンジスライダーを操作するとツールチップが複数表示される問題を修正 - (Cherry-picked from https://github.com/taiyme/misskey/pull/265) -- Fix: 縦横比が極端なカスタム絵文字を表示する際にレイアウトが崩れる箇所があるのを修正 - (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/725) -- Fix: 設定変更時のリロード確認ダイアログが複数個表示されることがある問題を修正 -- Fix: ファイルの詳細ページのファイルの説明で改行が正しく表示されない問題を修正 - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/commit/bde6bb0bd2e8b0d027e724d2acdb8ae0585a8110) -- Fix: 一部画面のページネーションが動作しにくくなっていたのを修正 ( #12766 , #11449 ) - -### Server -- Feat: Misskey® Reactions Boost Technology™ (RBT)により、リアクションの作成負荷を低減することが可能に -- Fix: アンテナの書き込み時にキーワードが与えられなかった場合のエラーをApiErrorとして投げるように - - この変更により、公式フロントエンドでは入力の不備が内部エラーとして報告される代わりに一般的なエラーダイアログで報告されます -- Fix: ファイルがサイズの制限を超えてアップロードされた際にエラーを返さなかった問題を修正 -- Fix: 外部ページを解析する際に、ページに紐づけられた関連リソースも読み込まれてしまう問題を修正 - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/commit/26e0412fbb91447c37e8fb06ffb0487346063bb8) -- Fix: Continue importing from file if single emoji import fails -- Fix: `Retry-After`ヘッダーが送信されなかった問題を修正 - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/commit/8a982c61c01909e7540ff1be9f019df07c3f0624) -- Fix: サーバーサイドのDOM解析完了時にリソースを開放するように - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/634) -- Fix: ``を追って照会するのはOKレスポンスが返却された場合のみに - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/633) -- Fix: メールにスタイルが適用されていなかった問題を修正 - -## 2024.8.0 - -### General -- Enhance: モデレーターはすべてのユーザーのフォロー・フォロワーの一覧を見られるように -- Enhance: アカウントの削除のモデレーションログを残すように -- Enhance: 不適切なページ、ギャラリー、Playを管理者権限で削除できるように -- Fix: リモートユーザのフォロー・フォロワーの一覧が非公開設定の場合も表示できてしまう問題を修正 - -### Client -- Enhance: 「自分のPlay」ページにおいてPlayが非公開かどうかが一目でわかるように -- Enhance: 不適切なページ、ギャラリー、Playを通報できるように -- Fix: Play編集時に公開範囲が「パブリック」にリセットされる問題を修正 -- Fix: ページ遷移に失敗することがある問題を修正 -- Fix: iOSでユーザー名などがリンクとして誤検知される現象を抑制 -- Fix: mCaptchaを使用していてもbotプロテクションに関する警告が消えないのを修正 -- Fix: ユーザーのモデレーションページにおいてユーザー名にドットが入っているとシステムアカウントとして表示されてしまう問題を修正 -- Fix: 特定の条件下でノートの削除ボタンが出ないのを修正 - -### Server -- Enhance: 照会時にURLがhtmlかつheadタグ内に`rel="alternate"`, `type="application/activity+json"`の`link`タグがある場合に追ってリンク先を照会できるように -- Enhance: 凍結されたアカウントのフォローリクエストを表示しないように -- Fix: WSの`readAllNotifications` メッセージが `body` を持たない場合に動作しない問題 #14374 - - 通知ページや通知カラム(デッキ)を開いている状態において、新たに発生した通知が既読されない問題が修正されます。 - - これにより、プッシュ通知が有効な同条件下の環境において、プッシュ通知が常に発生してしまう問題も修正されます。 -- Fix: Play各種エンドポイントの返り値に`visibility`が含まれていない問題を修正 -- Fix: サーバー情報取得の際にモデレーター限定の情報が取得できないことがあるのを修正 - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/582) -- Fix: 公開範囲がダイレクトのノートをユーザーアクティビティのチャート生成に使用しないように - (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/679) -- Fix: ActivityPubのエンティティタイプ判定で不明なタイプを受け取った場合でも処理を継続するように - - キュー処理のつまりが改善される可能性があります -- Fix: リバーシの対局設定の変更が反映されないのを修正 -- Fix: 無制限にストリーミングのチャンネルに接続できる問題を修正 -- Fix: ベースロールのポリシーを変更した際にモデログに記録されないのを修正 - (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/700) -- Fix: Prevent memory leak from memory caches (#14310) -- Fix: More reliable memory cache eviction (#14311) - -## 2024.7.0 - -### Note -- デッキUIの新着ノートをサウンドで通知する機能の追加(v2024.5.0)に伴い、以前から動作しなくなっていたクライアント設定内の「アンテナ受信」「チャンネル通知」サウンドを削除しました。 -- Streaming APIにて入力が不正な場合にはそのメッセージを無視するようになりました。 #14251 - -### General -- Feat: 通報を受けた際、または解決した際に、予め登録した宛先に通知を飛ばせるように(mail or webhook) #13705 -- Feat: ユーザーのアイコン/バナーの変更可否をロールで設定可能に - - 変更不可となっていても、設定済みのものを解除してデフォルト画像に戻すことは出来ます -- Feat: ユーザ作成時にSystemWebhookを送信可能に #14281 -- Feat: メディアサイレンスを実装 #13842 - - メディアサイレンスされたサーバーに所属するアカウントによるファイルはすべてセンシティブとして扱われ、カスタム絵文字が使用できないようになります。 -- Enhance: 管理画面でアーカイブにしたお知らせを表示・編集できるように -- Fix: 配信停止したインスタンス一覧が見れなくなる問題を修正 -- Fix: Dockerコンテナの立ち上げ時に`pnpm`のインストールで固まることがある問題 -- Fix: デフォルトテーマに無効なテーマコードを入力するとUIが使用できなくなる問題を修正 -- 翻訳の更新 -- 依存関係の更新 - -### Client -- Feat: ユーザーページから「このユーザーのノートを検索」できるように (#14128) -- Feat: 検索ページはクエリを受け付けるようになりました (#14128) -- Enhance: 検索ページのUI改善 (#14128) -- Enhance: 内蔵APIドキュメントのデザイン・パフォーマンスを改善 -- Enhance: 非ログイン時に他サーバーに遷移するアクションを追加 -- Enhance: 非ログイン時のハイライトTLのデザインを改善 -- Enhance: フロントエンドのアクセシビリティ改善 - (Based on https://github.com/taiyme/misskey/pull/226) -- Enhance: サーバー情報ページ・お問い合わせページを改善 - (Cherry-picked from https://github.com/taiyme/misskey/pull/238) -- Enhance: AiScriptを0.19.0にアップデート -- Enhance: Allow negative delay for MFM animation elements (`tada`, `jelly`, `twitch`, `shake`, `spin`, `jump`, `bounce`, `rainbow`) -- Enhance: センシティブなメディアを開く際に確認ダイアログを出せるように -- Enhance: 検索(ノート/ユーザー)で `#` から始まる文字列を入力すると、そのハッシュタグのノート/ユーザー一覧ページが表示できるように -- Enhance: 検索(ノート/ユーザー)において、入力に空白が含まれている場合は照会を行わないように -- Enhance: 検索(ノート/ユーザー)において、照会を行うかどうか、ハッシュタグのノート/ユーザー一覧ページを表示するかどうかの確認ダイアログを出すように -- Enhance: 検索(ノート/ユーザー)で `@` から始まる文字列(`@user@host`など)を入力すると、そのユーザーを照会できるように -- Enhance: ドライブのファイル・フォルダをドラッグしなくても移動できるように - (Cherry-picked from https://github.com/nafu-at/misskey/commit/b89c2af6945c6a9f9f10e83f54d2bcf0f240b0b4, https://github.com/nafu-at/misskey/commit/8a7d710c6acb83f50c83f050bd1423c764d60a99) -- Enhance: デッキのアンテナ・リスト選択画面からそれぞれを新規作成できるように -- Enhance: ブラウザのコンテキストメニューを使用できるように -- Enhance: 連合の「連合中」,「購読中」,「配信中」に対してブロックしているサーバー、配信停止しているサーバーを含めないように -- Fix: `/about#federation` ページなどで各インスタンスのチャートが表示されなくなっていた問題を修正 -- Fix: ユーザーページの追加情報のラベルを投稿者のサーバーの絵文字で表示する (#13968) -- Fix: リバーシの対局を正しく共有できないことがある問題を修正 -- Fix: コントロールパネルでベースロールのポリシーを編集してもUI上では変更が反映されない問題を修正 -- Fix: アンテナの編集画面のボタンに隙間を追加 -- Fix: テーマプレビューが見れない問題を修正 -- Fix: ショートカットキーが連打できる問題を修正 - (Cherry-picked from https://github.com/taiyme/misskey/pull/234) -- Fix: MkSignin.vueのcredentialRequestからReactivityを削除(ProxyがPasskey認証処理に渡ることを避けるため) -- Fix: 「アニメーション画像を再生しない」がオンのときでもサーバーのバナー画像・背景画像がアニメーションしてしまう問題を修正 - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/574) -- Fix: Twitchの埋め込みが開けない問題を修正 -- Fix: 子メニューの高さがウィンドウからはみ出ることがある問題を修正 -- Fix: 個人宛てのダイアログ形式のお知らせが即時表示されない問題を修正 -- Fix: 一部の画像がセンシティブ指定されているときに画面に何も表示されないことがあるのを修正 -- Fix: リアクションしたユーザー一覧のユーザー名がはみ出る問題を修正 - (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/672) -- Fix: `/share`ページにおいて絵文字ピッカーを開くことができない問題を修正 -- Fix: deck uiの通知音が重なる問題 (#14029) -- Fix: ダイレクト投稿の"削除して編集"において、宛先が保持されていなかった問題を修正 -- Fix: 投稿フォームへのURL貼り付けによる引用が下書きに保存されていなかった問題を修正 -- Fix: "削除して編集"や下書きにおいて、リアクションの受け入れ設定が保持/保存されていなかった問題を修正 -- Fix: 照会に `#` から始まる文字列を入力してそのハッシュタグのページを表示する際、入力が `#` のみの場合に「指定されたURLに該当するページはありませんでした。」が表示されてしまう問題を修正 -- Fix: 照会に `@` から始まる文字列を入力してユーザーを照会する際、入力が `@` のみの場合に「問題が発生しました」が表示されてしまう問題を修正 -- Fix: 投稿フォームにノートのURLを貼り付けて"引用として添付"した場合、投稿文を空にすることによるRenote化が出来なかった問題を修正 -- Fix: フォロー中のユーザーに関する"TLに他の人への返信を含める"の設定が分かりづらい問題を修正 -- Fix: タイムラインページを開いた時、`TLに他の人への返信を含める`がオフのときに`ファイル付きのみ`をオンにできない問題を修正 -- Fix: deck uiでタイムラインを切り替えた際にTLの設定項目が更新されず、`TLに他の人への返信を含める`のトグルが表示されない問題を修正 -- Fix: ウィジェットのタイムライン選択欄に無効化されたタイムラインが表示される問題を修正 -- Fix: サウンドにドライブの音声を使用している際にドライブの音声が再生できなくなると設定が変更できなくなる問題を修正 - -### Server -- Feat: レートリミット制限に引っかかったときに`Retry-After`ヘッダーを返すように (#13949) -- Enhance: エンドポイント`clips/update`の必須項目を`clipId`のみに -- Enhance: エンドポイント`admin/roles/update`の必須項目を`roleId`のみに -- Enhance: エンドポイント`pages/update`の必須項目を`pageId`のみに -- Enhance: エンドポイント`gallery/posts/update`の必須項目を`postId`のみに -- Enhance: エンドポイント`i/webhook/update`の必須項目を`webhookId`のみに -- Enhance: エンドポイント`admin/ad/update`の必須項目を`id`のみに -- Enhance: `default.yml`内の`url`, `db.db`, `db.user`, `db.pass`を環境変数から読み込めるように -- Enhance: エンドポイント`api/meta`にプロパティ`noteSearchableScope`が増え、`string`値`local`または`global`を返却します -- Fix: チャート生成時にinstance.suspensionStateに置き換えられたinstance.isSuspendedが参照されてしまう問題を修正 -- Fix: ユーザーのフィードページのMFMをHTMLに展開するように (#14006) -- Fix: アンテナ・クリップ・リスト・ウェブフックがロールポリシーの上限より一つ多く作れてしまうのを修正 (#14036) -- Fix: notRespondingSinceが実装される前に不通になったインスタンスが自動的に配信停止にならない (#14059) -- Fix: FTT有効時、タイムライン用エンドポイントで`sinceId`にキャッシュ内最古のものより古いものを指定した場合に正しく結果が返ってこない問題を修正 -- Fix: 自分以外のクリップ内のノート個数が見えることがあるのを修正 -- Fix: 空文字列のリアクションはフォールバックされるように -- Fix: リノートにリアクションできないように -- Fix: ユーザー名の前後に空白文字列がある場合は省略するように -- Fix: プロフィール編集時に名前を空白文字列のみにできる問題を修正 -- Fix: ユーザ名のサジェスト時に表示される内容と順番を調整(以下の順番になります) #14149 - 1. フォロー中かつアクティブなユーザ - 2. フォロー中かつ非アクティブなユーザ - 3. フォローしていないアクティブなユーザ - 4. フォローしていない非アクティブなユーザ - - また、自分自身のアカウントもサジェストされるようになりました。 -- Fix: 一般ユーザーから見たユーザーのバッジの一覧に公開されていないものが含まれることがある問題を修正 - (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/652) -- Fix: ユーザーのリアクション一覧でミュート/ブロックが機能していなかった問題を修正 -- Fix: FTT有効時にリモートユーザーのノートがHTLにキャッシュされる問題を修正 -- Fix: 一部の通知がローカル上のリモートユーザーに対して行われていた問題を修正 -- Fix: エラーメッセージの誤字を修正 (#14213) -- Fix: ソーシャルタイムラインにローカルタイムラインに表示される自分へのリプライが表示されない問題を修正 -- Fix: リノートのミュートが適用されるまでに時間がかかることがある問題を修正 - (Cherry-picked from https://github.com/Type4ny-Project/Type4ny/commit/e9601029b52e0ad43d9131b555b614e56c84ebc1) -- Fix: Steaming APIが不正なデータを受けた場合の動作が不安定である問題 #14251 -- Fix: `users/search`において `@` から始まる文字列が与えられた際の処理が正しくなかった問題を修正 - - 名前や自己紹介に `@` から始まる文言が含まれるユーザーも検索できるようになります -- Fix: 一部のMisskey以外のソフトウェアからファイルを受け取れない問題 - (Cherry-picked from https://github.com/Secineralyr/misskey.dream/pull/73/commits/652eaff1e8aa00b890d71d2e1e52c263c1e67c76) - - NOTE: `drive_file`の`url`, `uri`, `src`の上限が512から1024に変更されます - Migrationではカラム定義の変更のみが行われます。 - サーバー管理者は各サーバーの必要に応じ`drive_file` `("uri")`に対するインデックスを張りなおすことでより安定しDBの探索が行われる可能性があります。詳細 は [GitHub](https://github.com/misskey-dev/misskey/pull/14323#issuecomment-2257562228)で確認可能です -- Fix: 自分のフォロワー限定投稿に対するリプライがホームタイムラインで見えないことが有る問題を修正 -- Fix: フォローしていないユーザによるフォロワー限定投稿に対するリプライがソーシャルタイムラインで表示されることがある問題を修正 - -### Misskey.js -- Feat: `/drive/files/create` のリクエストに対応(`multipart/form-data`に対応) -- Feat: `/admin/role/create` のロールポリシーの型を修正 - -## 2024.5.0 - -### Note -- コントロールパネル内にあるサマリープロキシの設定個所がセキュリティから全般へ変更となります。 -- 悪意のある第三者がリモートユーザーになりすましたアクティビティを受け取れてしまう問題を修正しました。詳しくは[GitHub security advisory](https://github.com/misskey-dev/misskey/security/advisories/GHSA-2vxv-pv3m-3wvj)をご覧ください。 -- 管理者向け権限 `read:admin:show-users` は `read:admin:show-user` に統合されました。必要に応じてAPIトークンを再発行してください。 - -### General -- Feat: エラートラッキングにSentryを使用できるようになりました -- Enhance: URLプレビューの有効化・無効化を設定できるように #13569 -- Enhance: アンテナでBotによるノートを除外できるように - (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/545) -- Enhance: クリップのノート数を表示するように -- Enhance: コンディショナルロールの条件として以下を新たに追加 (#13667) - - 猫ユーザーか - - botユーザーか - - サスペンド済みユーザーか - - 鍵アカウントユーザーか - - 「アカウントを見つけやすくする」が有効なユーザーか -- Enhance: Goneを出さずに終了したサーバーへの配信停止を自動的に行うように - - もしそのようなサーバーからから配信が届いた場合には自動的に配信を再開します -- Enhance: 配信停止の理由を表示するように -- Enhance: サーバーのお問い合わせ先URLを設定できるようになりました -- Fix: Play作成時に設定した公開範囲が機能していない問題を修正 -- Fix: 正規化されていない状態のhashtagが連合されてきたhtmlに含まれているとhashtagが正しくhashtagに復元されない問題を修正 -- Fix: みつけるのアンケート欄にてチャンネルのアンケートが含まれてしまう問題を修正 - -### Client -- Feat: アップロードするファイルの名前をランダム文字列にできるように -- Feat: 個別のお知らせにリンクで飛べるように - (Based on https://github.com/MisskeyIO/misskey/pull/639) -- Enhance: 自分のノートの添付ファイルから直接ファイルの詳細ページに飛べるように -- Enhance: 広告がMisskeyと同一ドメインの場合はRouterで遷移するように -- Enhance: リアクション・いいねの総数を表示するように -- Enhance: リアクション受け入れが「いいねのみ」の場合はリアクション絵文字一覧を表示しないように -- Enhance: 設定>プラグインのページからプラグインの簡易的なログやエラーを見られるように - - 実装の都合により、プラグインは1つエラーを起こした時に即時停止するようになりました -- Enhance: ページのデザインを変更 -- Enhance: 2要素認証(ワンタイムパスワード)の入力欄を改善 -- Enhance: 「今日誕生日のフォロー中ユーザー」ウィジェットを手動でリロードできるように -- Enhance: 映像・音声の再生にブラウザのネイティブプレイヤーを使用できるように -- Enhance: 映像・音声の再生メニューに「再生速度」「ループ再生」「ピクチャインピクチャ」を追加 -- Enhance: 映像・音声の再生にキーボードショートカットが使えるように -- Enhance: ノートについているリアクションの「もっと!」から、リアクションの一覧を表示できるように -- Enhance: リプライにて引用がある場合テキストが空でもノートできるように - - 引用したいノートのURLをコピーしリプライ投稿画面にペーストして添付することで達成できます -- Enhance: フォローするかどうかの確認ダイアログを出せるように -- Enhance: Playを手動でリロードできるように -- Enhance: 通報のコメント内のリンクをクリックした際、ウィンドウで開くように -- Enhance: `Ui:C:postForm` および `Ui:C:postFormButton` に `localOnly` と `visibility` を設定できるように -- Enhance: AiScriptを0.18.0にバージョンアップ -- Enhance: 通常のノートでも、お気に入りに登録したチャンネルにリノートできるように -- Enhance: 長いテキストをペーストした際にテキストファイルとして添付するかどうかを選択できるように -- Enhance: 新着ノートをサウンドで通知する機能をdeck UIに追加しました -- Enhance: コントロールパネルのクイックアクションからファイルを照会できるように -- Enhance: コントロールパネルのクイックアクションから通常の照会を行えるように -- Fix: 一部のページ内リンクが正しく動作しない問題を修正 -- Fix: 周年の実績が閏年を考慮しない問題を修正 -- Fix: ローカルURLのプレビューポップアップが左上に表示される -- Fix: WebGL2をサポートしないブラウザで「季節に応じた画面の演出」が有効になっているとき、Misskeyが起動できなくなる問題を修正 - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/459) -- Fix: ページタイトルでローカルユーザーとリモートユーザーの区別がつかない問題を修正 - (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/528) -- Fix: コードブロックのシンタックスハイライトで使用される定義ファイルをCDNから取得するように #13177 - - CDNから取得せずMisskey本体にバンドルする場合は`pacakges/frontend/vite.config.ts`を修正してください。 -- Fix: タイムゾーンによっては、「今日誕生日のフォロー中ユーザー」ウィジェットが正しく動作しない問題を修正 -- Fix: CWのみの引用リノートが詳細ページで純粋なリノートとして誤って扱われてしまう問題を修正 -- Fix: ノート詳細ページにおいてCW付き引用リノートのCWボタンのラベルに「引用」が含まれていない問題を修正 -- Fix: ダイアログの入力で字数制限に違反していてもEnterキーが押せてしまう問題を修正 -- Fix: ダイレクト投稿の宛先が保存されない問題を修正 -- Fix: Playのページを離れたときに、Playが正常に初期化されない問題を修正 -- Fix: ページのOGP URLが間違っているのを修正 -- Fix: リバーシの対局を正しく共有できないことがある問題を修正 -- Fix: 通知をグループ化している際に、人数が正常に表示されないことがある問題を修正 -- Fix: 連合なしの状態の読み書きができない問題を修正 -- Fix: `/share` で日本語等を含むurlがurlエンコードされない問題を修正 -- Fix: ファイルを5つ以上添付してもテキストがないとノートが折りたたまれない問題を修正 - -### Server -- Enhance: エンドポイント`antennas/update`の必須項目を`antennaId`のみに -- Enhance: misskey-dev/summaly@5.1.0の取り込み(プレビュー生成処理の効率化) -- Enhance: ドライブのファイルがNSFWかどうか個別に連合されるように (#13756) - - 可能な場合、ノートの添付ファイルのセンシティブ判定がファイル単位になります -- Fix: リモートから配送されたアクティビティにJSON-LD compactionをかける -- Fix: フォローリクエストを作成する際に既存のものは削除するように - (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/440) -- Fix: エンドポイント`notes/translate`のエラーを改善 -- Fix: CleanRemoteFilesProcessorService report progress from 100% (#13632) -- Fix: 一部の音声ファイルが映像ファイルとして扱われる問題を修正 -- Fix: リプライのみの引用リノートと、CWのみの引用リノートが純粋なリノートとして誤って扱われてしまう問題を修正 -- Fix: 登録にメール認証が必須になっている場合、登録されているメールアドレスを削除できないように - (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/606) -- Fix: Add Cache-Control to Bull Board -- Fix: nginx経由で/files/にRangeリクエストされた場合に正しく応答できないのを修正 -- Fix: 一部のタイムラインのストリーミングでインスタンスミュートが効かない問題を修正 -- Fix: グローバルタイムラインで返信が表示されないことがある問題を修正 -- Fix: リノートをミュートしたユーザの投稿のリノートがミュートされる問題を修正 -- Fix: AP Link等は添付ファイル扱いしないようになど (#13754) -- Fix: FTTが有効かつsinceIdのみを指定した場合に帰って来るレスポンスが逆順である問題を修正 -- Fix: `/i/notifications`に `includeTypes`か`excludeTypes`を指定しているとき、通知が存在するのに空配列を返すことがある問題を修正 -- Fix: 複数idを指定する`users/show`が関係ないユーザを返すことがある問題を修正 -- Fix: `/tags` と `/user-tags` が検索エンジンにインデックスされないように -- Fix: もともとセンシティブではないと連合されていたファイルがセンシティブとして連合された場合にセンシティブとしてそのファイルを扱うように - - センシティブとして連合したファイルは非センシティブとして連合されてもセンシティブとして扱われます - -## 2024.3.1 + -### General -- Enhance: 投稿者のロールに応じて、一つのノートに含むことのできるメンションとダイレクト投稿の宛先の人数に上限を設定できるように - * デフォルトのメンション上限は20アカウントに設定されます。(管理者はベースロールの設定で変更可能です。) - * 連合の問い合わせに応答しないサーバーのリモートユーザーへのメンションは、上限の人数に含めない実装になっています。 -- Enhance: 通知がミュート、凍結を考慮するようになりました -- Enhance: サーバーごとにモデレーションノートを残せるように -- Enhance: コンディショナルロールの条件に「マニュアルロールへのアサイン」を追加 -- Enhance: 通知の受信設定に「フォロー中またはフォロワー」を追加 -- Enhance: 通知の履歴をリセットできるように -- Fix: ダイレクトなノートに対してはダイレクトでしか返信できないように +## 202x.x.x (Unreleased) ### Client -- Enhance: ノート作成画面のファイル添付メニューの区切り線の位置を調整 -- Fix: syuilo/misskeyの時代からあるインスタンスが改変されたバージョンであると誤認識される問題 -- Fix: MFMのオートコンプリートが出るべき状況で出ないことがある問題を修正 -- Fix: チャートのラベルが消えている問題を修正 -- Fix: 画面表示後最初の音声再生が爆音になることがある問題を修正 -- Fix: 設定のバックアップ作成時に名前を入力しなかった場合、ローカライゼーションがおかしくなる問題を修正 -- Fix: ページ`/admin/emojis`の絵文字編集ダイアログで「リアクションとして使えるロール」を追加する際に何も選択せずOKを押下すると画面が固まる問題を修正 -- Fix: 絵文字サジェストの順位で、絵文字自体の名前が同じものよりもタグで一致しているものが優先されてしまう問題を修正 -- Fix: ユーザの情報のポップアップが消えなくなることがある問題を修正 - -### Server -- Enhance: エンドポイント`flash/update`の`flashId`以外のパラメータは必須ではなくなりました -- Fix: nodeinfoにenableMcaptchaとenableTurnstileが無いのを修正 -- Fix: 破損した通知をクライアントに送信しないように - * 通知欄が無限にリロードされる問題が改善する可能性があります -- Fix: 禁止キーワードを含むノートがDelayed Queueに追加されて再処理される問題を修正 -- Fix: 自分がフォローしていないアカウントのフォロワー限定ノートが閲覧できることがある問題を修正 -- Fix: タイムラインのオプションで「リノートを表示」を無効にしている際、投票のみの引用リノートが流れてこない問題を修正 -- Fix: エンドポイント`admin/emoji/update`の各種修正 - - 必須パラメータを`id`または`name`のいずれかのみに - - `id`の代わりに`name`で絵文字を指定可能に(`id`・`name`両指定時は従来通り`name`を変更する挙動) - - `category`および`licence`が指定なしの時勝手にnullに上書きされる挙動を修正 -- Fix: 通知の受信設定で「相互フォロー」が正しく動作しない問題を修正 - -## 2024.2.0 - -### Note -- 外部サイトからプラグインをインストールする場合のパスが`/install-extentions`から`/install-extensions`に変わります。以前のパスからは自動でリダイレクトされるようになっていますが、新しいパスに変更することをお勧めします。 - -### General -- Feat: [mCaptcha](https://github.com/mCaptcha/mCaptcha)のサポートを追加 -- Feat: Add support for TrueMail -- Feat: AGPLv3ライセンスに誤って違反するのを防止する機能を追加 - - 管理者がrepositoryUrlを変更したり、またはソースコードを直接頒布することを選択できるようになります - - 本体のソースコードに改変を加えた際に、ライセンスに基づく適切な案内を表示します -- Enhance: モデレーターはすべてのユーザーのリアクション一覧を見られるように -- Fix: リストライムラインの「リノートを表示」が正しく機能しない問題を修正 -- Fix: リモートユーザーのリアクション一覧がすべて見えてしまうのを修正 - * すべてのリモートユーザーのリアクション一覧を見えないようにします -- Fix: 特定のキーワード及び正規表現にマッチする文字列を含むノートが投稿された際、エラーに出来るような設定項目を追加 #13207 - * デフォルトは空欄なので適用前と同等の動作になります - -### Client -- Feat: 新しいゲームを追加 -- Feat: 音声・映像プレイヤーを追加 -- Feat: 絵文字の詳細ダイアログを追加 -- Feat: 枠線をつけるMFM`$[border.width=1,style=solid,color=fff,radius=0 ...]`を追加 - - デフォルトで枠線からはみ出る部分が隠されるようにしました。初期と同じ挙動にするには`$[border.noclip`が必要です -- Feat: スワイプでタブを切り替えられるように -- Enhance: MFM等のコードブロックに全文コピー用のボタンを追加 - Enhance: ハッシュタグ入力時に、本文の末尾の行に何も書かれていない場合は新たにスペースを追加しないように -- Enhance: チャンネルノートのピン留めをノートのメニューからできるように -- Enhance: 管理者の場合はAPI tokenの発行画面で管理機能に関する権限を付与できるように -- Enhance: AiScriptを0.17.0に更新 [CHANGELOG](https://github.com/aiscript-dev/aiscript/blob/bb89d132b633a622d3cb0eff0d0cc7e476c0cfdd/CHANGELOG.md) - - 配列の範囲外・非整数のインデックスへの代入が完全禁止になるので注意 -- Enhance: 絵文字ピッカー・オートコンプリートで、完全一致した絵文字を優先的に表示するように -- Enhance: Playの説明欄にMFMを使えるように -- Enhance: チャンネルノートの場合は詳細ページからその前後のノートを見れるように -- Enhance: 季節に応じた画面の演出を南半球でも利用できるように -- Enhance: タイムラインフィルターの設定をすべて保持できるように - - 今までの「TLに他の人への返信を含める」設定は一旦リセットされます -- Enhance: タイムラインフィルターに「センシティブなファイルを含むノートを表示」を追加 -- Enhance: ノート作成画面のファイル添付メニューから直接ファイルを削除できるように -- Enhance: MFMの属性でオートコンプリートが使用できるように #12735 -- Enhance: 絵文字編集ダイアログをモーダルではなくウィンドウで表示するように -- Enhance: リモートのユーザーはメニューから直接リモートで表示できるように -- Enhance: リモートへの引用リノートと同一のリンクにはリンクプレビューを表示しないように -- Enhance: コードのシンタックスハイライトにテーマを適用できるように -- Enhance: リアクション権限がない場合、ハートにフォールバックするのではなくリアクションピッカーなどから打てないように - - リモートのユーザーにローカルのみのカスタム絵文字をリアクションしようとした場合 - - センシティブなリアクションを認めていないユーザーにセンシティブなカスタム絵文字をリアクションしようとした場合 - - ロールが必要な絵文字をリアクションしようとした場合 -- Enhance: ページ遷移時にPlayerを閉じるように -- Enhance: 通報ページのユーザをクリックした際にユーザをウィンドウで開くように -- Enhance: ノートの通報時にリモートのノートであっても自インスタンスにおけるノートのリンクを含むように -- Enhance: オフライン表示のデザインを改善・多言語対応 -- Fix: ネイティブモードの絵文字がモノクロにならないように -- Fix: v2023.12.0で追加された「モデレーターがユーザーのアイコンもしくはバナー画像を未設定状態にできる機能」が管理画面上で正しく表示されていない問題を修正 -- Fix: AiScriptの`readline`関数が不正な値を返すことがある問題のv2023.12.0時点での修正がPlay以外に適用されていないのを修正 -- Fix: v2023.12.1で追加された`$[clickable ...]`および`onClickEv`が正しく機能していないのを修正 -- Fix: Renoteのキーボードショートカットが機能していなかった問題を修正 -- Fix: 投稿フォームでアンケートの日時指定をした状態で再読み込みをすると期日が復元されない問題を修正 -- Fix: アンケートを設定したノートを「削除して編集」をするとアンケートの期日が引き継がれず、リセットされてしまう問題を修正 -- Fix: デッキのプロファイル作成時に名前を空にできる問題を修正 -- Fix: テーマ作成時に名称が空欄でも作成できてしまう問題を修正 -- Fix: プラグインで`Plugin:register_note_post_interruptor`を使用すると、ノートが投稿できなくなる問題を修正 -- Fix: iOSで大きな画像を変換してアップロードできない問題を修正 -- Fix: 「アニメーション画像を再生しない」もしくは「データセーバー(アイコン)」を有効にしていても、アイコンデコレーションのアニメーションが停止されない問題を修正 -- Fix: 画像をクロップするとクロップ後の解像度が異様に低くなる問題の修正 -- Fix: 画像をクロップ時、正常に完了できない問題の修正 -- Fix: キャプションが空の画像をクロップするとキャプションにnullという文字列が入ってしまう問題の修正 -- Fix: プロフィールを編集してもリロードするまで反映されない問題を修正 -- Fix: エラー画像URLを設定した後解除すると,デフォルトの画像が表示されない問題の修正 -- Fix: MkCodeEditorで行がずれていってしまう問題の修正 -- Fix: Summaly proxy利用時にプレイヤーが動作しないことがあるのを修正 #13196 - -### Server -- Enhance: 連合先のレートリミットを超過した際にリトライするようになりました -- Enhance: ActivityPub Deliver queueでBodyを事前処理するように (#12916) -- Enhance: クリップをエクスポートできるように -- Enhance: `/files`のファイルに対してHTTP Rangeリクエストを行えるように -- Enhance: `api.json`のOpenAPI Specificationを3.1.0に更新 -- Enhance: 連合向けのノート配信を軽量化 #13192 -- Fix: `drive/files/update`でファイル名のバリデーションが機能していない問題を修正 -- Fix: `notes/create`で、`text`が空白文字のみで構成されているか`null`であって、かつ`text`だけであるリクエストに対するレスポンスが400になるように変更 -- Fix: `notes/create`で、`text`が空白文字のみで構成されていてかつリノート、ファイルまたは投票を含んでいるリクエストに対するレスポンスの`text`が`""`から`null`になるように変更 -- Fix: ipv4とipv6の両方が利用可能な環境でallowedPrivateNetworksが設定されていた場合プライベートipの検証ができていなかった問題を修正 -- Fix: properly handle cc followers -- Fix: ジョブに関する設定の名前を修正 relashionshipJobPerSec -> relationshipJobPerSec -- Fix: コントロールパネル->モデレーション->「誰でも新規登録できるようにする」の初期値をONからOFFに変更 #13122 -- Fix: リモートユーザーが復活してもキャッシュにより該当ユーザーのActivityが受け入れられないのを修正 #13273 +- Enhance: ActivityPubをサポートしているウェブリンクを展開できるように ## 2023.12.2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f8af6b3df0..7f6c1f4f82 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ # Contribution guide We're glad you're interested in contributing Misskey! In this document you will find the information you need to contribute to the project. -> [!NOTE] +> **Note** > This project uses Japanese as its major language, **but you do not need to translate and write the Issues/PRs in Japanese.** > Also, you might receive comments on your Issue/PR in Japanese, but you do not need to reply to them in Japanese as well.\ > The accuracy of machine translation into Japanese is not high, so it will be easier for us to understand if you write it in the original language. @@ -17,31 +17,16 @@ Before creating an issue, please check the following: - Issues should only be used to feature requests, suggestions, and bug tracking. - Please ask questions or troubleshooting in [GitHub Discussions](https://github.com/misskey-dev/misskey/discussions) or [Discord](https://discord.gg/Wp8gVStHW3). -> [!WARNING] +> **Warning** > Do not close issues that are about to be resolved. It should remain open until a commit that actually resolves it is merged. -### Recommended discussing before implementation -We welcome your proposal. - +## Before implementation When you want to add a feature or fix a bug, **first have the design and policy reviewed in an Issue** (if it is not there, please make one). Without this step, there is a high possibility that the PR will not be merged even if it is implemented. At this point, you also need to clarify the goals of the PR you will create, and make sure that the other members of the team are aware of them. PRs that do not have a clear set of do's and don'ts tend to be bloated and difficult to review. -Also, when you start implementation, assign yourself to the Issue (if you cannot do it yourself, ask Committer to assign you). -By expressing your intention to work on the Issue, you can prevent conflicts in the work. - -To the Committers: you should not assign someone on it before the Final Decision. - -### How issues are triaged - -The Committers may: -* close an issue that is not reproducible on latest stable release, -* merge an issue into another issue, -* split an issue into multiple issues, -* or re-open that has been closed for some reason which is not applicable anymore. - -@syuilo reserves the Final Decision rights including whether the project will implement feature and how to implement, these rights are not always exercised. +Also, when you start implementation, assign yourself to the Issue (if you cannot do it yourself, ask another member to assign you). By expressing your intention to work the Issue, you can prevent conflicts in the work. ## Well-known branches - **`master`** branch is tracking the latest release and used for production purposes. @@ -52,45 +37,25 @@ The Committers may: ## Creating a PR Thank you for your PR! Before creating a PR, please check the following: - If possible, prefix the title with a keyword that identifies the type of this PR, as shown below. - - `fix` / `refactor` / `feat` / `enhance` / `perf` / `chore` etc - - Also, make sure that the granularity of this PR is appropriate. Please do not include more than one type of change or interest in a single PR. + - `fix` / `refactor` / `feat` / `enhance` / `perf` / `chore` etc + - Also, make sure that the granularity of this PR is appropriate. Please do not include more than one type of change or interest in a single PR. - If there is an Issue which will be resolved by this PR, please include a reference to the Issue in the text. - Please add the summary of the changes to [`CHANGELOG.md`](/CHANGELOG.md). However, this is not necessary for changes that do not affect the users, such as refactoring. - Check if there are any documents that need to be created or updated due to this change. - If you have added a feature or fixed a bug, please add a test case if possible. - Please make sure that tests and Lint are passed in advance. - - You can run it with `pnpm test` and `pnpm lint`. [See more info](#testing) + - You can run it with `pnpm test` and `pnpm lint`. [See more info](#testing) - If this PR includes UI changes, please attach a screenshot in the text. Thanks for your cooperation 🤗 -### Additional things for ActivityPub payload changes -*This section is specific to misskey-dev implementation. Other fork or implementation may take different way. A significant difference is that non-"misskey-dev" extension is not described in the misskey-hub's document.* - -If PR includes changes to ActivityPub payload, please reflect it in [misskey-hub's document](https://github.com/misskey-dev/misskey-hub-next/blob/master/content/ns.md) by sending PR. - -The name of purporsed extension property (referred as "extended property" in later) to ActivityPub shall be prefixed by `_misskey_`. (i.e. `_misskey_quote`) - -The extended property in `packages/backend/src/core/activitypub/type.ts` **must** be declared as optional because ActivityPub payloads that comes from older Misskey or other implementation may not contain it. - -The extended property must be included in the context definition. Context is defined in `packages/backend/src/core/activitypub/misc/contexts.ts`. -The key shall be same as the name of extended property, and the value shall be same as "short IRI". - -"Short IRI" is defined in misskey-hub's document, but usually takes form of `misskey:`. (i.e. `misskey:_misskey_quote`) - -One should not add property that has defined before by other implementation, or add custom variant value to "well-known" property. - ## Reviewers guide Be willing to comment on the good points and not just the things you want fixed 💯 -読んでおくといいやつ -- https://blog.lacolaco.net/posts/1e2cf439b3c2/ -- https://konifar-zatsu.hatenadiary.jp/entry/2024/11/05/192421 - ### Review perspective - Scope - - Are the goals of the PR clear? - - Is the granularity of the PR appropriate? + - Are the goals of the PR clear? + - Is the granularity of the PR appropriate? - Security - Does merging this PR create a vulnerability? - Performance @@ -112,7 +77,7 @@ An actual domain will be assigned so you can test the federation. ## Release ### Release Instructions -1. Commit version changes in the `develop` branch ([package.json](package.json)) +1. Commit version changes in the `develop` branch ([package.json](https://github.com/misskey-dev/misskey/blob/develop/package.json)) 2. Create a release PR. - Into `master` from `develop` branch. - The title must be in the format `Release: x.y.z`. @@ -123,7 +88,7 @@ An actual domain will be assigned so you can test the federation. - The target branch must be `master` - The tag name must be the version -> [!NOTE] +> **Note** > Why this instruction is necessary: > - To perform final QA checks > - To distribute responsibility @@ -136,30 +101,30 @@ You can improve our translations with your Crowdin account. Your changes in Crowdin are automatically submitted as a PR (with the title "New Crowdin translations") to the repository. The owner [@syuilo](https://github.com/syuilo) merges the PR into the develop branch before the next release. -If your language is not listed in Crowdin, please open an issue. We will add it to Crowdin. -For newly added languages, once the translation progress per language exceeds 70%, it will be officially introduced into Misskey and made available to users. +If your language is not listed in Crowdin, please open an issue. ![Crowdin](https://d322cqt584bo4o.cloudfront.net/misskey/localized.svg) ## Development -### Setup -Before developing, you have to set up environment. Misskey requires Redis, PostgreSQL, and FFmpeg. +During development, it is useful to use the -You would want to install Meilisearch to experiment related features. Technically, meilisearch is not strict requirement, but some features and tests require it. +``` +pnpm dev +``` -There are a few ways to proceed. +command. -#### Use system-wide software -You could install them in system-wide (such as from package manager). - -#### Use `docker compose` -You could obtain middleware container by typing `docker compose -f $PROJECT_ROOT/compose.local-db.yml up -d`. - -#### Use Devcontainer -Devcontainer also has necessary setting. This method can be done by connecting from VSCode. +- Server-side source files and automatically builds them if they are modified. Automatically start the server process(es). +- Vite HMR (just the `vite` command) is available. The behavior may be different from production. +- Service Worker is watched by esbuild. +- The front end can be viewed by accessing `http://localhost:5173`. +- The backend listens on the port configured with `port` in .config/default.yml. +If you have not changed it from the default, it will be "http://localhost:3000". +If "port" in .config/default.yml is set to something other than 3000, you need to change the proxy settings in packages/frontend/vite.config.local-dev.ts. +### Dev Container Instead of running `pnpm` locally, you can use Dev Container to set up your development environment. -To use Dev Container, open the project directory on VSCode with Dev Containers installed. +To use Dev Container, open the project directory on VSCode with Dev Containers installed. **Note:** If you are using Windows, please clone the repository with WSL. Using Git for Windows will result in broken files due to the difference in how newlines are handled. It will run the following command automatically inside the container. @@ -171,76 +136,38 @@ pnpm build pnpm migrate ``` -After finishing the migration, you can proceed. +After finishing the migration, run the `pnpm dev` command to start the development server. -### Start developing -During development, it is useful to use the -``` +``` bash pnpm dev ``` -command. - -- Server-side source files and automatically builds them if they are modified. Automatically start the server process(es). -- Vite HMR (just the `vite` command) is available. The behavior may be different from production. -- Service Worker is watched by esbuild. -- The front end can be viewed by accessing `http://localhost:5173`. -- The backend listens on the port configured with `port` in .config/default.yml. -If you have not changed it from the default, it will be "http://localhost:3000". -If "port" in .config/default.yml is set to something other than 3000, you need to change the proxy settings in packages/frontend/vite.config.local-dev.ts. - -### `MK_DEV_PREFER=backend pnpm dev` -pnpm dev has another mode with `MK_DEV_PREFER=backend`. - -``` -MK_DEV_PREFER=backend pnpm dev -``` - -- This mode is closer to the production environment than the default mode. -- Vite runs behind the backend (the backend will proxy Vite at /vite). -- You can see Misskey by accessing `http://localhost:3000` (Replace `3000` with the port configured with `port` in .config/default.yml). -- To change the port of Vite, specify with `VITE_PORT` environment variable. -- HMR may not work in some environments such as Windows. ## Testing -You can run non-backend tests by executing following commands: -```sh -pnpm --filter frontend test -pnpm --filter misskey-js test +- Test codes are located in [`/packages/backend/test`](/packages/backend/test). + +### Run test +Create a config file. ``` - -Backend tests require manual preparation of servers. See the next section for more on this. - -### Backend -There are three types of test codes for the backend: -- Unit tests: [`/packages/backend/test/unit`](/packages/backend/test/unit) -- Single-server E2E tests: [`/packages/backend/test/e2e`](/packages/backend/test/e2e) -- Multiple-server E2E tests: [`/packages/backend/test-federation`](/packages/backend/test-federation) - -#### Running Unit Tests or Single-server E2E Tests -1. Create a config file: -```sh cp .github/misskey/test.yml .config/ ``` - -2. Start DB and Redis servers for testing: -```sh -docker compose -f packages/backend/test/compose.yml up +Prepare DB/Redis for testing. ``` -Instead, you can prepare an empty (data can be erased) DB and edit `.config/test.yml` appropriately. - -3. Run all tests: -```sh -pnpm --filter backend test # unit tests -pnpm --filter backend test:e2e # single-server E2E tests +docker compose -f packages/backend/test/docker-compose.yml up ``` -If you want to run a specific test, run as a following command: -```sh -pnpm --filter backend test -- packages/backend/test/unit/activitypub.ts -pnpm --filter backend test:e2e -- packages/backend/test/e2e/nodeinfo.ts +Alternatively, prepare an empty (data can be erased) DB and edit `.config/test.yml`. + +Run all test. +``` +pnpm test ``` -#### Running Multiple-server E2E Tests -See [`/packages/backend/test-federation/README.md`](/packages/backend/test-federation/README.md). +#### Run specify test +``` +pnpm jest -- foo.ts +``` + +### e2e tests +TODO ## Environment Variable @@ -264,7 +191,7 @@ niraxは、Misskeyで使用しているオリジナルのフロントエンド ### ルート定義 ルート定義は、以下の形式のオブジェクトの配列です。 -```ts +``` ts { name?: string; path: string; @@ -277,7 +204,7 @@ niraxは、Misskeyで使用しているオリジナルのフロントエンド } ``` -> [!WARNING] +> **Warning** > 現状、ルートは定義された順に評価されます。 > たとえば、`/foo/:id`ルート定義の次に`/foo/bar`ルート定義がされていた場合、後者がマッチすることはありません。 @@ -339,7 +266,7 @@ export const Default = { parameters: { layout: 'centered', }, -} satisfies StoryObj; +} satisfies StoryObj; ``` If you want to opt-out from the automatic generation, create a `MyComponent.stories.impl.ts` file and add the following line to the file. @@ -359,115 +286,24 @@ export const argTypes = { min: 1, max: 4, }, - }, }; ``` Also, you can use msw to mock API requests in the storybook. Creating a `MyComponent.stories.msw.ts` file to define the mock handlers. ```ts -import { HttpResponse, http } from 'msw'; +import { rest } from 'msw'; export const handlers = [ - http.post('/api/notes/timeline', ({ request }) => { - return HttpResponse.json([]); + rest.post('/api/notes/timeline', (req, res, ctx) => { + return res( + ctx.json([]), + ); }), ]; ``` Don't forget to re-run the `.storybook/generate.js` script after adding, editing, or removing the above files. -## Nest - -### Nest Service Circular dependency / Nestでサービスの循環参照でエラーが起きた場合 - -#### forwardRef -まずは簡単に`forwardRef`を試してみる - -```typescript -export class FooService { - constructor( - @Inject(forwardRef(() => BarService)) - private barService: BarService - ) { - } -} -``` - -#### OnModuleInit -できなければ`OnModuleInit`を使う - -```typescript -import { Injectable, OnModuleInit } from '@nestjs/common'; -import { ModuleRef } from '@nestjs/core'; -import { BarService } from '@/core/BarService'; - -@Injectable() -export class FooService implements OnModuleInit { - private barService: BarService // constructorから移動してくる - - constructor( - private moduleRef: ModuleRef, - ) { - } - - async onModuleInit() { - this.barService = this.moduleRef.get(BarService.name); - } - - public async niceMethod() { - return await this.barService.incredibleMethod({ hoge: 'fuga' }); - } -} -``` - -##### Service Unit Test -テストで`onModuleInit`を呼び出す必要がある - -```typescript -// import ... - -describe('test', () => { - let app: TestingModule; - let fooService: FooService; // for test case - let barService: BarService; // for test case - - beforeEach(async () => { - app = await Test.createTestingModule({ - imports: ..., - providers: [ - FooService, - { // mockする (mockは必須ではないかもしれない) - provide: BarService, - useFactory: () => ({ - incredibleMethod: jest.fn(), - }), - }, - { // Provideにする - provide: BarService.name, - useExisting: BarService, - }, - ], - }) - .useMocker(... - .compile(); - - fooService = app.get(FooService); - barService = app.get(BarService) as jest.Mocked; - - // onModuleInitを実行する - await fooService.onModuleInit(); - }); - - test('nice', () => { - await fooService.niceMethod(); - - expect(barService.incredibleMethod).toHaveBeenCalled(); - expect(barService.incredibleMethod.mock.lastCall![0]) - .toEqual({ hoge: 'fuga' }); - }); -}) -``` - ## Notes ### Misskeyのドメイン固有の概念は`Mi`をprefixする @@ -571,13 +407,13 @@ pnpm dlx typeorm migration:generate -d ormconfig.js -o - 作成されたスクリプトは不必要な変更を含むため除去してください ### JSON SchemaのobjectでanyOfを使うとき -JSON Schemaで、objectに対してanyOfを使う場合、anyOfの中でpropertiesを定義しないこと。 -バリデーションが効かないため。(SchemaTypeもそのように作られており、objectのanyOf内のpropertiesは捨てられます) +JSON Schemaで、objectに対してanyOfを使う場合、anyOfの中でpropertiesを定義しないこと。 +バリデーションが効かないため。(SchemaTypeもそのように作られており、objectのanyOf内のpropertiesは捨てられます) https://github.com/misskey-dev/misskey/pull/10082 テキストhogeおよびfugaについて、片方を必須としつつ両方の指定もありうる場合: -```ts +``` export const paramDef = { type: 'object', properties: { @@ -607,24 +443,3 @@ marginはそのコンポーネントを使う側が設定する ### indexというファイル名を使うな ESMではディレクトリインポートは廃止されているのと、ディレクトリインポートせずともファイル名が index だと何故か一部のライブラリ?でディレクトリインポートだと見做されてエラーになる - -## CSS Recipe - -### Lighten CSS vars - -``` css -color: hsl(from var(--MI_THEME-accent) h s calc(l + 10)); -``` - -### Darken CSS vars - -``` css -color: hsl(from var(--MI_THEME-accent) h s calc(l - 10)); -``` - -### Add alpha to CSS vars - -``` css -color: color(from var(--MI_THEME-accent) srgb r g b / 0.5); -``` - diff --git a/COPYING b/COPYING index 6a5f3ca1d5..905d3e1236 100644 --- a/COPYING +++ b/COPYING @@ -1,5 +1,5 @@ Unless otherwise stated this repository is -Copyright © 2014-2024 syuilo and contributors +Copyright © 2014-2023 syuilo and contributors And is distributed under The GNU Affero General Public License Version 3, you should have received a copy of the license file as LICENSE. diff --git a/Dockerfile b/Dockerfile index e21b2a31fc..922ce4dca3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax = docker/dockerfile:1.4 -ARG NODE_VERSION=20.16.0-bullseye +ARG NODE_VERSION=20.10.0-bullseye # build assets & compile TypeScript @@ -21,21 +21,17 @@ WORKDIR /misskey COPY --link ["pnpm-lock.yaml", "pnpm-workspace.yaml", "package.json", "./"] COPY --link ["scripts", "./scripts"] COPY --link ["packages/backend/package.json", "./packages/backend/"] -COPY --link ["packages/frontend-shared/package.json", "./packages/frontend-shared/"] COPY --link ["packages/frontend/package.json", "./packages/frontend/"] -COPY --link ["packages/frontend-embed/package.json", "./packages/frontend-embed/"] COPY --link ["packages/sw/package.json", "./packages/sw/"] COPY --link ["packages/misskey-js/package.json", "./packages/misskey-js/"] -COPY --link ["packages/misskey-reversi/package.json", "./packages/misskey-reversi/"] -COPY --link ["packages/misskey-bubble-game/package.json", "./packages/misskey-bubble-game/"] - -ARG NODE_ENV=production RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \ pnpm i --frozen-lockfile --aggregate-output COPY --link . ./ +ARG NODE_ENV=production + RUN git submodule update --init RUN pnpm build RUN rm -rf .git/ @@ -56,10 +52,6 @@ COPY --link ["pnpm-lock.yaml", "pnpm-workspace.yaml", "package.json", "./"] COPY --link ["scripts", "./scripts"] COPY --link ["packages/backend/package.json", "./packages/backend/"] COPY --link ["packages/misskey-js/package.json", "./packages/misskey-js/"] -COPY --link ["packages/misskey-reversi/package.json", "./packages/misskey-reversi/"] -COPY --link ["packages/misskey-bubble-game/package.json", "./packages/misskey-bubble-game/"] - -ARG NODE_ENV=production RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \ pnpm i --frozen-lockfile --aggregate-output @@ -84,19 +76,11 @@ RUN apt-get update \ USER misskey WORKDIR /misskey -# add package.json to add pnpm -COPY --chown=misskey:misskey ./package.json ./package.json -RUN corepack install - COPY --chown=misskey:misskey --from=target-builder /misskey/node_modules ./node_modules COPY --chown=misskey:misskey --from=target-builder /misskey/packages/backend/node_modules ./packages/backend/node_modules COPY --chown=misskey:misskey --from=target-builder /misskey/packages/misskey-js/node_modules ./packages/misskey-js/node_modules -COPY --chown=misskey:misskey --from=target-builder /misskey/packages/misskey-reversi/node_modules ./packages/misskey-reversi/node_modules -COPY --chown=misskey:misskey --from=target-builder /misskey/packages/misskey-bubble-game/node_modules ./packages/misskey-bubble-game/node_modules COPY --chown=misskey:misskey --from=native-builder /misskey/built ./built COPY --chown=misskey:misskey --from=native-builder /misskey/packages/misskey-js/built ./packages/misskey-js/built -COPY --chown=misskey:misskey --from=native-builder /misskey/packages/misskey-reversi/built ./packages/misskey-reversi/built -COPY --chown=misskey:misskey --from=native-builder /misskey/packages/misskey-bubble-game/built ./packages/misskey-bubble-game/built COPY --chown=misskey:misskey --from=native-builder /misskey/packages/backend/built ./packages/backend/built COPY --chown=misskey:misskey --from=native-builder /misskey/fluent-emojis /misskey/fluent-emojis COPY --chown=misskey:misskey . ./ diff --git a/README.md b/README.md index 92e8fef639..6fa804f1fa 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@
- Misskey logo + Misskey logo -**🌎 **Misskey** is an open source, federated social media platform that's free forever! 🚀** - -[Learn more](https://misskey-hub.net/) +**🌎 **[Misskey](https://misskey-hub.net/)** is an open source, decentralized social media platform that's free forever! 🚀** --- @@ -24,14 +22,45 @@ become a patron +--- + +[![codecov](https://codecov.io/gh/misskey-dev/misskey/branch/develop/graph/badge.svg?token=R6IQZ3QJOL)](https://codecov.io/gh/misskey-dev/misskey) + +
+ +
+ + + +## ✨ Features +- **ActivityPub support**\ +Not on Misskey? No problem! Not only can Misskey instances talk to each other, but you can make friends with people on other networks like Mastodon and Pixelfed! +- **Reactions**\ +You can add emoji reactions to any post! No longer are you bound by a like button, show everyone exactly how you feel with the tap of a button. +- **Drive**\ +With Misskey's built in drive, you get cloud storage right in your social media, where you can upload any files, make folders, and find media from posts you've made! +- **Rich Web UI**\ + Misskey has a rich and easy to use Web UI! + It is highly customizable, from changing the layout and adding widgets to making custom themes. + Furthermore, plugins can be created using AiScript, an original programming language. +- And much more... + +
+ +
+ +## Documentation + +Misskey Documentation can be found at [Misskey Hub](https://misskey-hub.net/docs/), some of the links and graphics above also lead to specific portions of it. + +## Sponsors + +
+ RSS3
## Thanks -Sentry - -Thanks to [Sentry](https://sentry.io/) for providing the error tracking platform that helps us catch unexpected errors. - Chromatic Thanks to [Chromatic](https://www.chromatic.com/) for providing the visual testing platform that helps us review UI changes and catch visual regressions. diff --git a/ROADMAP.md b/ROADMAP.md index 509ecb9fe7..3077c41e73 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -6,7 +6,6 @@ Also, the later tasks are more indefinite and are subject to change as developme This is the phase we are at now. We need to make a high-maintenance environment that can withstand future development. - ~~Make the number of type errors zero (backend)~~ → Done ✔️ -- Make the number of type errors zero (frontend) - Improve CI - ~~Fix tests~~ → Done ✔️ - Fix random test failures - https://github.com/misskey-dev/misskey/issues/7985 and https://github.com/misskey-dev/misskey/issues/7986 diff --git a/chart/files/default.yml b/chart/files/default.yml index 4d17131c25..4cc291e80a 100644 --- a/chart/files/default.yml +++ b/chart/files/default.yml @@ -124,14 +124,6 @@ redis: # #prefix: example-prefix # #db: 1 -#redisForReactions: -# host: redis -# port: 6379 -# #family: 0 # 0=Both, 4=IPv4, 6=IPv6 -# #pass: example-pass -# #prefix: example-prefix -# #db: 1 - # ┌───────────────────────────┐ #───┘ MeiliSearch configuration └───────────────────────────── @@ -160,22 +152,6 @@ redis: # ID SETTINGS AFTER THAT! id: "aidx" - -# ┌────────────────┐ -#───┘ Error tracking └────────────────────────────────────────── - -# Sentry is available for error tracking. -# See the Sentry documentation for more details on options. - -#sentryForBackend: -# enableNodeProfiling: true -# options: -# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0' - -#sentryForFrontend: -# options: -# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0' - # ┌─────────────────────┐ #───┘ Other configuration └───────────────────────────────────── diff --git a/cypress/e2e/basic.cy.ts b/cypress/e2e/basic.cy.js similarity index 86% rename from cypress/e2e/basic.cy.ts rename to cypress/e2e/basic.cy.js index d2efbf709c..5ab07c7480 100644 --- a/cypress/e2e/basic.cy.ts +++ b/cypress/e2e/basic.cy.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - describe('Before setup instance', () => { beforeEach(() => { cy.resetState(); @@ -23,7 +18,6 @@ describe('Before setup instance', () => { cy.intercept('POST', '/api/admin/accounts/create').as('signup'); - cy.get('[data-cy-admin-initial-password] input').type('example_password_please_change_this_or_you_will_get_hacked'); cy.get('[data-cy-admin-username] input').type('admin'); cy.get('[data-cy-admin-password] input').type('admin1234'); cy.get('[data-cy-admin-ok]').click(); @@ -120,16 +114,11 @@ describe('After user signup', () => { it('signin', () => { cy.visitHome(); - cy.intercept('POST', '/api/signin-flow').as('signin'); + cy.intercept('POST', '/api/signin').as('signin'); cy.get('[data-cy-signin]').click(); - - cy.get('[data-cy-signin-page-input]').should('be.visible', { timeout: 1000 }); - // Enterキーで続行できるかの確認も兼ねる - cy.get('[data-cy-signin-username] input').type('alice{enter}'); - - cy.get('[data-cy-signin-page-password]').should('be.visible', { timeout: 10000 }); - // Enterキーで続行できるかの確認も兼ねる + cy.get('[data-cy-signin-username] input').type('alice'); + // Enterキーでサインインできるかの確認も兼ねる cy.get('[data-cy-signin-password] input').type('alice1234{enter}'); cy.wait('@signin'); @@ -144,9 +133,8 @@ describe('After user signup', () => { cy.visitHome(); cy.get('[data-cy-signin]').click(); - - cy.get('[data-cy-signin-page-input]').should('be.visible', { timeout: 1000 }); - cy.get('[data-cy-signin-username] input').type('alice{enter}'); + cy.get('[data-cy-signin-username] input').type('alice'); + cy.get('[data-cy-signin-password] input').type('alice1234{enter}'); // TODO: cypressにブラウザの言語指定できる機能が実装され次第英語のみテストするようにする cy.contains(/アカウントが凍結されています|This account has been suspended due to/gi); @@ -173,13 +161,11 @@ describe('After user signed in', () => { }); it('successfully loads', () => { - // 表示に時間がかかるのでデフォルト秒数だとタイムアウトする - cy.get('[data-cy-user-setup-continue]', { timeout: 30000 }).should('be.visible'); + cy.get('[data-cy-user-setup-continue]').should('be.visible'); }); it('account setup wizard', () => { - // 表示に時間がかかるのでデフォルト秒数だとタイムアウトする - cy.get('[data-cy-user-setup-continue]', { timeout: 30000 }).click(); + cy.get('[data-cy-user-setup-continue]').click(); cy.get('[data-cy-user-setup-user-name] input').type('ありす'); cy.get('[data-cy-user-setup-user-description] textarea').type('ほげ'); @@ -216,8 +202,7 @@ describe('After user setup', () => { cy.login('alice', 'alice1234'); // アカウント初期設定ウィザード - // 表示に時間がかかるのでデフォルト秒数だとタイムアウトする - cy.get('[data-cy-user-setup] [data-cy-modal-window-close]', { timeout: 30000 }).click(); + cy.get('[data-cy-user-setup] [data-cy-modal-window-close]').click(); cy.get('[data-cy-modal-dialog-ok]').click(); }); diff --git a/cypress/e2e/router.cy.ts b/cypress/e2e/router.cy.ts deleted file mode 100644 index 8d8fb3af31..0000000000 --- a/cypress/e2e/router.cy.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -describe('Router transition', () => { - describe('Redirect', () => { - // サーバの初期化。ルートのテストに関しては各describeごとに1度だけ実行で十分だと思う(使いまわした方が早い) - before(() => { - cy.resetState(); - - // インスタンス初期セットアップ - cy.registerUser('admin', 'pass', true); - - // ユーザー作成 - cy.registerUser('alice', 'alice1234'); - - cy.login('alice', 'alice1234'); - - // アカウント初期設定ウィザード - // 表示に時間がかかるのでデフォルト秒数だとタイムアウトする - cy.get('[data-cy-user-setup] [data-cy-modal-window-close]', { timeout: 30000 }).click(); - cy.wait(500); - cy.get('[data-cy-modal-dialog-ok]').click(); - }); - - it('redirect to user profile', () => { - // テストのためだけに用意されたリダイレクト用ルートに飛ぶ - cy.visit('/redirect-test'); - - // プロフィールページのURLであることを確認する - cy.url().should('include', '/@alice') - }); - }); -}); diff --git a/cypress/e2e/widgets.cy.ts b/cypress/e2e/widgets.cy.js similarity index 95% rename from cypress/e2e/widgets.cy.ts rename to cypress/e2e/widgets.cy.js index 847801a69f..df6ec8357d 100644 --- a/cypress/e2e/widgets.cy.ts +++ b/cypress/e2e/widgets.cy.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - /* flaky describe('After user signed in', () => { beforeEach(() => { diff --git a/cypress/support/commands.ts b/cypress/support/commands.js similarity index 71% rename from cypress/support/commands.ts rename to cypress/support/commands.js index 197ff963ac..91a4d7abe6 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.js @@ -30,13 +30,9 @@ Cypress.Commands.add('visitHome', () => { }) Cypress.Commands.add('resetState', () => { - // iframe.contentWindow.indexedDB.deleteDatabase() がchromeのバグで使用できないため、indexedDBを無効化している。 - // see https://github.com/misskey-dev/misskey/issues/13605#issuecomment-2053652123 - /* - cy.window().then(win => { + cy.window(win => { win.indexedDB.deleteDatabase('keyval-store'); }); - */ cy.request('POST', '/api/reset-db', {}).as('reset'); cy.get('@reset').its('status').should('equal', 204); cy.reload(true); @@ -48,19 +44,16 @@ Cypress.Commands.add('registerUser', (username, password, isAdmin = false) => { cy.request('POST', route, { username: username, password: password, - ...(isAdmin ? { setupPassword: 'example_password_please_change_this_or_you_will_get_hacked' } : {}), }).its('body').as(username); }); Cypress.Commands.add('login', (username, password) => { cy.visitHome(); - cy.intercept('POST', '/api/signin-flow').as('signin'); + cy.intercept('POST', '/api/signin').as('signin'); cy.get('[data-cy-signin]').click(); - cy.get('[data-cy-signin-page-input]').should('be.visible', { timeout: 1000 }); - cy.get('[data-cy-signin-username] input').type(`${username}{enter}`); - cy.get('[data-cy-signin-page-password]').should('be.visible', { timeout: 10000 }); + cy.get('[data-cy-signin-username] input').type(username); cy.get('[data-cy-signin-password] input').type(`${password}{enter}`); cy.wait('@signin').as('signedIn'); diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.js similarity index 100% rename from cypress/support/e2e.ts rename to cypress/support/e2e.js diff --git a/cypress/support/index.ts b/cypress/support/index.ts deleted file mode 100644 index c1bed21979..0000000000 --- a/cypress/support/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -declare global { - namespace Cypress { - interface Chainable { - login(username: string, password: string): Chainable; - - registerUser( - username: string, - password: string, - isAdmin?: boolean - ): Chainable; - - resetState(): Chainable; - - visitHome(): Chainable; - } - } -} - -export {} diff --git a/cypress/tsconfig.json b/cypress/tsconfig.json deleted file mode 100644 index 6fe7f32cc4..0000000000 --- a/cypress/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "lib": ["dom", "es5"], - "target": "es5", - "types": ["cypress", "node"] - }, - "include": ["./**/*.ts"] -} diff --git a/compose.local-db.yml b/docker-compose.local-db.yml similarity index 98% rename from compose.local-db.yml rename to docker-compose.local-db.yml index 3835cb23db..16ba4b49e1 100644 --- a/compose.local-db.yml +++ b/docker-compose.local-db.yml @@ -1,3 +1,5 @@ +version: "3" + # このconfigは、 dockerでMisskey本体を起動せず、 redisとpostgresql などだけを起動します services: diff --git a/compose_example.yml b/docker-compose_example.yml similarity index 64% rename from compose_example.yml rename to docker-compose_example.yml index 336bd814a7..60ba4dc8ca 100644 --- a/compose_example.yml +++ b/docker-compose_example.yml @@ -1,3 +1,5 @@ +version: "3" + services: web: build: . @@ -5,7 +7,6 @@ services: links: - db - redis -# - mcaptcha # - meilisearch depends_on: db: @@ -17,8 +18,6 @@ services: networks: - internal_network - external_network - # env_file: - # - .config/docker.env volumes: - ./files:/misskey/files - ./.config:/misskey/.config:ro @@ -49,36 +48,6 @@ services: interval: 5s retries: 20 -# mcaptcha: -# restart: always -# image: mcaptcha/mcaptcha:latest -# networks: -# internal_network: -# external_network: -# aliases: -# - localhost -# ports: -# - 7493:7493 -# env_file: -# - .config/docker.env -# environment: -# PORT: 7493 -# MCAPTCHA_redis_URL: "redis://mcaptcha_redis/" -# depends_on: -# db: -# condition: service_healthy -# mcaptcha_redis: -# condition: service_healthy -# -# mcaptcha_redis: -# image: mcaptcha/cache:latest -# networks: -# - internal_network -# healthcheck: -# test: "redis-cli ping" -# interval: 5s -# retries: 20 - # meilisearch: # restart: always # image: getmeili/meilisearch:v1.3.4 diff --git a/healthcheck.sh b/healthcheck.sh index dcfcf76786..0a36394836 100644 --- a/healthcheck.sh +++ b/healthcheck.sh @@ -1,7 +1,7 @@ #!/bin/bash -# SPDX-FileCopyrightText: syuilo and misskey-project +# SPDX-FileCopyrightText: syuilo and other misskey contributors # SPDX-License-Identifier: AGPL-3.0-only PORT=$(grep '^port:' /misskey/.config/default.yml | awk 'NR==1{print $2; exit}') -curl -Sfso/dev/null "http://localhost:${PORT}/healthz" +curl -s -S -o /dev/null "http://localhost:${PORT}" diff --git a/idea/MkDisableSection.vue b/idea/MkDisableSection.vue deleted file mode 100644 index 360705071b..0000000000 --- a/idea/MkDisableSection.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - diff --git a/idea/README.md b/idea/README.md deleted file mode 100644 index f64d16800a..0000000000 --- a/idea/README.md +++ /dev/null @@ -1 +0,0 @@ -使われなくなったけど消すのは勿体ない(将来使えるかもしれない)コードを入れておくとこ diff --git a/locales/ar-SA.yml b/locales/ar-SA.yml index de24ad4bb9..0a7d86cc89 100644 --- a/locales/ar-SA.yml +++ b/locales/ar-SA.yml @@ -123,7 +123,6 @@ reactions: "التفاعلات" reactionSettingDescription2: "اسحب لترتيب ، انقر للحذف ، استخدم \"+\" للإضافة." rememberNoteVisibility: "تذكر إعدادت مدى رؤية الملاحظات" attachCancel: "أزل المرفق" -deleteFile: "حُذف الملف" markAsSensitive: "علّمه كمحتوى حساس" unmarkAsSensitive: "ألغ تعيينه كمحتوى حساس" enterFileName: "ادخل اسم الملف" @@ -361,8 +360,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "فعّل hCaptcha" hcaptchaSiteKey: "مفتاح الموقع" hcaptchaSecretKey: "المفتاح السري" -mcaptchaSiteKey: "مفتاح الموقع" -mcaptchaSecretKey: "المفتاح السري" recaptcha: "reCAPTCHA" enableRecaptcha: "تمكين reCAPTCHA" recaptchaSiteKey: "مفتاح الموقع" @@ -626,7 +623,10 @@ abuseReported: "أُرسل البلاغ، شكرًا لك" reporter: "المُبلّغ" reporteeOrigin: "أصل البلاغ" reporterOrigin: "أصل المُبلّغ" +forwardReport: "وجّه البلاغ إلى المثيل البعيد" +forwardReportIsAnonymous: "في المثيل البعيد سيظهر المبلّغ كحساب مجهول." send: "أرسل" +abuseMarkAsResolved: "علّم البلاغ كمحلول" openInNewTab: "افتح في لسان جديد" defaultNavigationBehaviour: "سلوك الملاحة الافتراضي" editTheseSettingsMayBreakAccount: "تعديل هذه الإعدادات قد يسبب عطبًا لحسابك" @@ -1009,12 +1009,7 @@ expired: "منتهية صلاحيته" icon: "الصورة الرمزية" replies: "رد" renotes: "أعد النشر" -sourceCode: "الشفرة المصدرية" flip: "اقلب" -lastNDays: "آخر {n} أيام" -surrender: "ألغِ" -_delivery: - stop: "مُعلّق" _initialAccountSetting: accountCreated: "نجح إنشاء حسابك!" letsStartAccountSetup: "إذا كنت جديدًا لنعدّ حسابك الشخصي." @@ -1252,12 +1247,15 @@ _theme: buttonBg: "خلفية الأزرار" buttonHoverBg: "خلفية الأزرار (عند التمرير فوقها)" inputBorder: "حواف حقل الإدخال" + listItemHoverBg: "خلفية عناصر القائمة (عند التمرير فوقها)" driveFolderBg: "خلفية مجلد قرص التخزين" messageBg: "خلفية المحادثة" _sfx: note: "الملاحظات" noteMy: "ملاحظتي" notification: "الإشعارات" + antenna: "الهوائيات" + channel: "إشعارات القنات" _ago: future: "المستقبَل" justNow: "اللحظة" @@ -1416,7 +1414,6 @@ _profile: _exportOrImport: allNotes: "كل الملاحظات" favoritedNotes: " الملاحظات المفضلة" - clips: "مِشبك" followingList: "المتابَعون" muteList: "المستخدمون المكتومون" blockingList: "المستخدمون المحجوبون" @@ -1529,7 +1526,6 @@ _notification: reaction: "التفاعل" receiveFollowRequest: "طلبات المتابعة" followRequestAccepted: "طلبات المتابعة المقبولة" - login: "لِج" app: "إشعارات التطبيقات المرتبطة" _actions: followBack: "تابعك بالمثل" @@ -1561,27 +1557,7 @@ _webhookSettings: active: "مُفعّل" _events: reaction: "عند التفاعل" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "البريد الإلكتروني " _moderationLogTypes: suspend: "علِق" - deleteDriveFile: "حُذف الملف" - deleteNote: "حُذفت الملاحظة" - createGlobalAnnouncement: "أُنشئ إعلان عام" - createUserAnnouncement: "أُنشئ إعلان مستخدم" - updateGlobalAnnouncement: "حُدث إعلان عام" - updateUserAnnouncement: "حُدث إعلان مستخدم" resetPassword: "أعد تعيين كلمتك السرية" createInvitation: "ولِّد دعوة" -_reversi: - total: "المجموع" - lookingForPlayer: "يبحث عن خصم..." - gameCanceled: "أُلغيت اللعبة." - opponentHasSettingsChanged: "غيَر الخصم إعدادته." - showBoardLabels: "اعرض ترقيم الصفوف والأعمدة على اللوح" - useAvatarAsStone: "حوَل الحجارة إلى صور مستخدمين" -_offlineScreen: - title: "غير متصل - يتعذر الاتصال بالخادم" - header: "يتعذر الاتصال بالخادم" diff --git a/locales/bn-BD.yml b/locales/bn-BD.yml index 0e761b0743..77ba3f0306 100644 --- a/locales/bn-BD.yml +++ b/locales/bn-BD.yml @@ -357,8 +357,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "hCaptcha চালু করুন" hcaptchaSiteKey: "সাইট কী" hcaptchaSecretKey: "সিক্রেট কী" -mcaptchaSiteKey: "সাইট কী" -mcaptchaSecretKey: "সিক্রেট কী" recaptcha: "reCAPTCHA" enableRecaptcha: "reCAPTCHA চালু করুন" recaptchaSiteKey: "সাইট কী" @@ -451,6 +449,7 @@ or: "অথবা" language: "ভাষা" uiLanguage: "UI এর ভাষা" aboutX: "{x} সম্পর্কে" +disableDrawer: "ড্রয়ার মেনু প্রদর্শন করবেন না" noHistory: "কোনো ইতিহাস নেই" signinHistory: "প্রবেশ করার ইতিহাস" doing: "প্রক্রিয়া করছে..." @@ -624,7 +623,10 @@ abuseReported: "আপনার অভিযোগটি দাখিল কর reporter: "অভিযোগকারী" reporteeOrigin: "অভিযোগটির উৎস" reporterOrigin: "অভিযোগকারীর উৎস" +forwardReport: "রিমোট ইন্সত্যান্সে অভিযোগটি পাঠান" +forwardReportIsAnonymous: "আপনার তথ্য রিমোট ইন্সত্যান্সে পাঠানো হবে না এবং একটি বেনামী সিস্টেম অ্যাকাউন্ট হিসাবে প্রদর্শিত হবে।" send: "পাঠান" +abuseMarkAsResolved: "অভিযোগটিকে সমাধাকৃত হিসাবে চিহ্নিত করুন" openInNewTab: "নতুন ট্যাবে খুলুন" openInSideView: "সাইড ভিউতে খুলুন" defaultNavigationBehaviour: "ডিফল্ট নেভিগেশন" @@ -851,12 +853,7 @@ youFollowing: "অনুসরণ করা হচ্ছে" icon: "প্রোফাইল ছবি" replies: "জবাব" renotes: "রিনোট" -sourceCode: "সোর্স কোড" flip: "উল্টান" -_delivery: - stop: "স্থগিত করা হয়েছে" - _type: - none: "প্রকাশ করা হচ্ছে" _role: priority: "অগ্রাধিকার" _priority: @@ -1017,6 +1014,7 @@ _theme: buttonBg: "বাটনের পটভূমি" buttonHoverBg: "বাটনের পটভূমি (হভার)" inputBorder: "ইনপুট ফিল্ডের বর্ডার" + listItemHoverBg: "লিস্ট আইটেমের পটভূমি (হোভার)" driveFolderBg: "ড্রাইভ ফোল্ডারের পটভূমি" wallpaperOverlay: "ওয়ালপেপার ওভারলে" badge: "ব্যাজ" @@ -1028,6 +1026,8 @@ _sfx: note: "নোটগুলি" noteMy: "নোট (আপনার)" notification: "বিজ্ঞপ্তি" + antenna: "অ্যান্টেনাগুলি" + channel: "চ্যানেলের বিজ্ঞপ্তি" _ago: future: "ভবিষ্যৎ" justNow: "এইমাত্র" @@ -1190,7 +1190,6 @@ _profile: changeBanner: "ব্যানার পরিবর্তন করুন" _exportOrImport: allNotes: "সকল নোট" - clips: "ক্লিপ" followingList: "অনুসরণ করা হচ্ছে" muteList: "মিউট" blockingList: "ব্লক" @@ -1309,7 +1308,6 @@ _notification: pollEnded: "পোল শেষ" receiveFollowRequest: "প্রাপ্ত অনুসরণের অনুরোধসমূহ" followRequestAccepted: "গৃহীত অনুসরণের অনুরোধসমূহ" - login: "প্রবেশ করুন" app: "লিঙ্ক করা অ্যাপ থেকে বিজ্ঞপ্তি" _actions: followBack: "ফলো ব্যাক করেছে" @@ -1340,12 +1338,6 @@ _deck: _webhookSettings: name: "নাম" active: "চালু" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "ইমেইল" _moderationLogTypes: suspend: "স্থগিত করা" resetPassword: "পাসওয়ার্ড রিসেট করুন" -_reversi: - total: "মোট" diff --git a/locales/ca-ES.yml b/locales/ca-ES.yml index 748f6f03c0..727e473cf3 100644 --- a/locales/ca-ES.yml +++ b/locales/ca-ES.yml @@ -2,15 +2,12 @@ _lang_: "Català" headlineMisskey: "Una xarxa connectada per notes" introMisskey: "Benvingut! Misskey és un servei de microblogging descentralitzat de codi obert.\nCrea \"notes\" per compartir els teus pensaments amb tots els que t'envolten. 📡\nAmb \"reaccions\", també pots expressar ràpidament els teus sentiments sobre les notes de tothom. 👍\nExplorem un món nou! 🚀" -poweredByMisskeyDescription: "{name} És un dels serveis (anomenats instàncies de Misskey) que utilitzen la plataforma de codi obert Misskey." +poweredByMisskeyDescription: "{name} És un del serveis (anomenats instàncies de Misskey) que utilitzen la plataforma de codi obert Misskey." monthAndDay: "{day}/{month}" search: "Cercar" notifications: "Notificacions" username: "Nom d'usuari" password: "Contrasenya" -initialPasswordForSetup: "Contrasenya inicial per la configuració inicial" -initialPasswordIsIncorrect: "La contrasenya no és correcta." -initialPasswordForSetupDescription: "Fes servir la contrasenya que has fet servir al fitxer de configuració, si tu mateix has instal·lat Misskey.\nSi fas servir una empresa d'allotjament de Misskey, fes servir la contrasenya que t'han donat.\nSi no has posat cap contrasenya deixar l'espai en blanc." forgotPassword: "Contrasenya oblidada" fetchingAsApObject: "Cercant en el Fediverse..." ok: "OK" @@ -18,7 +15,7 @@ gotIt: "Ho he entès!" cancel: "Cancel·lar" noThankYou: "No, gràcies" enterUsername: "Introdueix el teu nom d'usuari" -renotedBy: "Impulsat per {user}" +renotedBy: "Impulsat per {usuari}" noNotes: "Cap nota" noNotifications: "Cap notificació" instance: "Servidor" @@ -63,7 +60,6 @@ copyFileId: "Copiar ID d'arxiu" copyFolderId: "Copiar ID de carpeta" copyProfileUrl: "Copiar URL del perfil" searchUser: "Cercar un usuari" -searchThisUsersNotes: "Cerca les publicacions de l'usuari" reply: "Respondre" loadMore: "Carregar més" showMore: "Veure més" @@ -112,14 +108,11 @@ enterEmoji: "Introduir un emoji" renote: "Impulsa" unrenote: "Anul·la l'impuls" renoted: "S'ha impulsat" -renotedToX: "Impulsat per {name}." cantRenote: "No es pot impulsar aquesta publicació" cantReRenote: "No es pot impulsar l'impuls." quote: "Cita" inChannelRenote: "Renotar només al Canal" inChannelQuote: "Citar només al Canal" -renoteToChannel: "Impulsa a un canal" -renoteToOtherChannel: "Impulsa a un altre canal" pinnedNote: "Nota fixada" pinned: "Fixar al perfil" you: "Tu" @@ -137,7 +130,6 @@ overwriteFromPinnedEmojis: "Sobreescriu des dels emojis fixats" reactionSettingDescription2: "Arrossega per reordenar, fes clic per suprimir, prem \"+\" per afegir." rememberNoteVisibility: "Recorda la configuració de visibilitat de les notes" attachCancel: "Eliminar el fitxer adjunt" -deleteFile: "Esborrar l'arxiu " markAsSensitive: "Marcar com a NSFW" unmarkAsSensitive: "Deixar de marcar com a sensible" enterFileName: "Defineix nom del fitxer" @@ -158,7 +150,6 @@ editList: "Editar llista" selectChannel: "Selecciona un canal" selectAntenna: "Tria una antena" editAntenna: "Modificar antena" -createAntenna: "Crea una antena" selectWidget: "Triar un giny" editWidgets: "Editar ginys" editWidgetsExit: "Fet" @@ -185,10 +176,6 @@ addAccount: "Afegeix un compte" reloadAccountsList: "Recarregar la llista de contactes" loginFailed: "S'ha produït un error al accedir." showOnRemote: "Navega més en el perfil original" -continueOnRemote: "Veure perfil original" -chooseServerOnMisskeyHub: "Escull un servidor des del Hub de Misskey" -specifyServerHost: "Especifica un servidor directament" -inputHostName: "Introdueix el domini" general: "General" wallpaper: "Fons de Pantalla" setWallpaper: "Defineix el fons de pantalla" @@ -199,7 +186,6 @@ followConfirm: "Estàs segur que vols deixar de seguir {name}?" proxyAccount: "Compte de proxy" proxyAccountDescription: "Un compte proxy és un compte que actua com a seguidor remot per als usuaris en determinades condicions. Per exemple, quan un usuari afegeix un usuari remot a la llista, l'activitat de l'usuari remot no es lliurarà al servidor si cap usuari local segueix aquest usuari, de manera que el compte proxy el seguirà." host: "Amfitrió" -selectSelf: "Escollir manualment" selectUser: "Selecciona usuari/a" recipient: "Destinatari" annotation: "Comentaris" @@ -215,7 +201,6 @@ perDay: "Per dia" stopActivityDelivery: "Deixa d'enviar activitats" blockThisInstance: "Deixa d'enviar activitats" silenceThisInstance: "Silencia aquesta instància " -mediaSilenceThisInstance: "Silenciar els arxius d'aquesta instància " operations: "Accions" software: "Programari" version: "Versió" @@ -237,10 +222,6 @@ blockedInstances: "Instàncies bloquejades" blockedInstancesDescription: "Llista els enllaços d'amfitrió de les instàncies que vols bloquejar separades per un salt de pàgina. Les instàncies llistades no podran comunicar-se amb aquesta instància." silencedInstances: "Instàncies silenciades" silencedInstancesDescription: "Llista els enllaços d'amfitrió de les instàncies que vols silenciar. Tots els comptes de les instàncies llistades s'establiran com silenciades i només podran fer sol·licitacions de seguiment, i no podran mencionar als comptes locals si no els segueixen. Això no afectarà les instàncies bloquejades." -mediaSilencedInstances: "Instàncies amb els arxius silenciats" -mediaSilencedInstancesDescription: "Llista els noms dels servidors que vulguis silenciar els arxius, un servidor per línia. Tots els comptes que pertanyin als servidors llistats seran tractats com sensibles i no podran fer servir emojis personalitzats. Això no tindrà efecte sobre els servidors blocats." -federationAllowedHosts: "Llista de servidors federats" -federationAllowedHostsDescription: "Llista dels servidors amb els quals es federa." muteAndBlock: "Silencia i bloca" mutedUsers: "Usuaris silenciats" blockedUsers: "Usuaris bloquejats" @@ -331,7 +312,6 @@ selectFile: "Selecciona fitxers" selectFiles: "Selecciona fitxers" selectFolder: "Selecció de carpeta" selectFolders: "Selecció de carpeta" -fileNotSelected: "Cap fitxer seleccionat" renameFile: "Canvia el nom del fitxer" folderName: "Nom de la carpeta" createFolder: "Crea una carpeta" @@ -339,7 +319,6 @@ renameFolder: "Canvia el nom de la carpeta" deleteFolder: "Elimina la carpeta" folder: "Carpeta " addFile: "Afegeix un fitxer" -showFile: "Mostrar fitxer" emptyDrive: "La teva unitat és buida" emptyFolder: "La carpeta està buida" unableToDelete: "No es pot eliminar" @@ -357,12 +336,8 @@ whenServerDisconnected: "Quan es perdi la connexió al servidor" disconnectedFromServer: "Desconnectat pel servidor" reload: "Actualitza" doNothing: "Ignora" -reloadConfirm: "Vols recarregar?" -watch: "Veure" -unwatch: "Deixar de veure" -accept: "Acceptar" -reject: "Denegar" -normal: "Normal" +accept: "Accepta" +normal: "Nomal" instanceName: "Nom del servidor" instanceDescription: "Descripció del servidor" maintainerName: "Nom de l'administrador" @@ -380,57 +355,25 @@ connectService: "Connecta" disconnectService: "Desconnecta" enableLocalTimeline: "Activa la línia de temps local" enableGlobalTimeline: "Activa la línia de temps global" -disablingTimelinesInfo: "Fins i tot si aquestes línies de temps són desactivades, els administradors i els moderadors poden continuar visualitzant per conveniència." registration: "Registre" -enableRegistration: "Permet els registres d'usuaris" invite: "Convida" -driveCapacityPerLocalAccount: "Capacitat del disc per usuaris locals" -driveCapacityPerRemoteAccount: "Capacitat del disc per usuaris remots" -inMb: "En megabytes" -bannerUrl: "Adreça URL del bàner" -backgroundImageUrl: "Adreça URL de la imatge de fons" basicInfo: "Informació bàsica" pinnedUsers: "Usuaris fixats" -pinnedUsersDescription: "Llista d'usuaris, separats per salts de línia, que seran fixats a la pestanya \"Explorar\"." -pinnedPages: "Pàgines fixades" -pinnedPagesDescription: "Escriu els camins de les pàgines que vols fixar a la pàgina d'inici d'aquesta instància. Separades per salts de línia." -pinnedClipId: "ID del retall fixat" pinnedNotes: "Nota fixada" -hcaptcha: "hCaptcha" -enableHcaptcha: "Activar hCaptcha" -hcaptchaSiteKey: "Clau del lloc" -hcaptchaSecretKey: "Clau secreta" -mcaptcha: "mCaptcha" -enableMcaptcha: "Activar mCaptcha" -mcaptchaSiteKey: "Clau del lloc" -mcaptchaSecretKey: "Clau secreta" -mcaptchaInstanceUrl: "Adreça URL del servidor mCaptcha" -recaptcha: "reCAPTCHA" -enableRecaptcha: "Activar reCAPTCHA" -recaptchaSiteKey: "Clau del lloc" -recaptchaSecretKey: "Clau secreta" turnstile: "Turnstile" enableTurnstile: "Activar Turnstile" turnstileSiteKey: "Clau del lloc" turnstileSecretKey: "Clau secreta" -avoidMultiCaptchaConfirm: "Fer servir diferents sistemes de Captcha a la vegada pot causar problemes entre ells. Vols desactivar els altres sistemes de Captcha activats? Si els vols mantenir actius fes clic a cancel·lar." antennas: "Antena" manageAntennas: "Gestiona les antenes" -name: "Nom" antennaSource: "Font de l'antena" antennaKeywords: "Paraules clau a seguir" antennaExcludeKeywords: "Paraules clau a excloure" -antennaExcludeBots: "Exclou els bots" 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" -enableServiceworker: "Activar les notificacions al navegador" antennaUsersDescription: "Llistar un nom d'usuari per línia" -caseSensitive: "Sensible a majúscules i minúscules " -withReplies: "Inclou respostes" -connectedTo: "Aquests comptes hi són connectats" notesAndReplies: "Amb respostes" -withFiles: "Incloure arxius" silence: "Silencia" silenceConfirm: "Segur que vols silenciar aquest usuari?" unsilence: "Deixa de silenciar" @@ -446,41 +389,20 @@ userList: "Llistes" about: "Informació" aboutMisskey: "Quant a Misskey" administrator: "Administrador/a" -token: "Codi de verificació" -2fa: "Autenticació de doble factor" -setupOf2fa: "Configurar l'autenticació de doble factor" -totp: "Aplicació d'autenticació" -totpDescription: "Escriu una contrasenya d'un sol us fent servir l'aplicació d'autenticació" moderator: "Moderador/a" moderation: "Moderació" -moderationNote: "Nota de moderació " -moderationNoteDescription: "Pots escriure notes que es compartiran entre els moderadors." -addModerationNote: "Afegir una nota de moderació " -moderationLogs: "Registre de moderació " nUsersMentioned: "{n} usuaris mencionats" -securityKeyAndPasskey: "Clau de seguretat / Clau de pas" securityKey: "Clau de seguretat" -lastUsed: "Fet servir per última vegada" -lastUsedAt: "Fet servir per última vegada: {t}" unregister: "Cancel·la el registre" passwordLessLogin: "Inici de sessió sense contrasenya" -passwordLessLoginDescription: "Permet l'inici de sessió sense contrasenya fent servir només una Clau de seguretat/Clau de pas" resetPassword: "Restableix la contrasenya" newPasswordIs: "La contrasenya nova és «{password}»" reduceUiAnimation: "Redueix les animacions de la interfície" share: "Comparteix" notFound: "No s'ha trobat" -notFoundDescription: "No es troba cap pàgina que correspongui a aquesta adreça" -uploadFolder: "Carpeta per defecte per pujades" -markAsReadAllNotifications: "Marca totes les notificacions com a llegides" markAsReadAllUnreadNotes: "Marca-ho tot com a llegit" -markAsReadAllTalkMessages: "Marcar tots els missatges com llegits" help: "Ajuda" -inputMessageHere: "Escriu aquí el teu missatge " -close: "Tancar" invites: "Convida" -members: "Membres" -transfer: "Transferir" title: "Títol" text: "Text" enable: "Habilita" @@ -489,12 +411,10 @@ retype: "Torneu a introduir-la" noteOf: "Publicació de: {user}" quoteAttached: "Frase adjunta" quoteQuestion: "Vols annexar-la com a cita?" -attachAsFileQuestion: "El text copiat és massa llarg. Vols adjuntar-lo com un fitxer de text?" noMessagesYet: "Encara no hi ha missatges" newMessageExists: "Has rebut un nou missatge" onlyOneFileCanBeAttached: "Només pots adjuntar un fitxer a un missatge" signinRequired: "Si us plau, Registra't o inicia la sessió abans de continuar" -signinOrContinueOnRemote: "Per continuar necessites moure el teu servidor o registrar-te / iniciar sessió en aquest servidor." invitations: "Convida" invitationCode: "Codi d'invitació" checking: "Comprovació en curs..." @@ -516,12 +436,8 @@ uiLanguage: "Idioma de l'interfície" aboutX: "Respecte a {x}" emojiStyle: "Estil d'emoji" native: "Nadiu" -menuStyle: "Estil de menú" -style: "Estil" -drawer: "Calaix" -popup: "Emergent" +disableDrawer: "No mostrar els menús en calaixos" showNoteActionsOnlyHover: "Només mostra accions de la nota en passar amb el cursor" -showReactionsCount: "Mostra el nombre de reaccions a les publicacions" noHistory: "No hi ha un registre previ" signinHistory: "Historial d'autenticacions" enableAdvancedMfm: "Habilitar l'MFM avançat" @@ -556,64 +472,12 @@ objectStorage: "Emmagatzematge d'objectes\n" useObjectStorage: "Utilitzar l'emmagatzematge d'objectes" objectStorageBaseUrl: "Base d'enllaç" objectStorageBaseUrlDesc: "Prefix d'enllaç utilitzat per a fer referencia als fitxers. Especifica l'enllaç del teu CDN o Proxy si n'estàs utilitzant qualsevol, en cas contrari, especifica l'enllaç al que es pot accedir públicament segons la guia de servei que vosté utilitza.\nPer l'ús d'S3 utilitza 'https://.s3.amazonaws.com' I per a GCS o serveis equivalents utilitza 'https://storage.googleapis.com/'." -objectStorageBucket: "Dipòsit " -objectStorageBucketDesc: "Escriu el nom del dipòsit que fas servir al teu proveïdor d'emmagatzematge " -objectStoragePrefix: "Prefix" -objectStoragePrefixDesc: "Els fitxers es deixaren a directoris amb aquest prefix" -objectStorageEndpoint: "Endpoint" -objectStorageEndpointDesc: "Deixa'l buit si fas servir AWS S3, si no és així específica un punt d'entrada com '' o ':', depenent del servei que facis servir." -objectStorageRegion: "Regió " -objectStorageRegionDesc: "Especifica una regió com 'xx-east-1'. Si el teu servei no diferència regions has de posar 'us-east-1'. Deixa'l buit si fas servir variables d'entorn o un arxiu de configuració d'AWS." -objectStorageUseSSL: "Fes servir SSL" -objectStorageUseSSLDesc: "Desactiva'l si no tens pensat fer servir HTTPS per les connexions de l'API" -objectStorageUseProxy: "Connectar-se mitjançant un Proxy" -objectStorageUseProxyDesc: "Desactiva'l si no faràs servir un Proxy per les connexions de l'API" -objectStorageSetPublicRead: "Configurar les pujades com públiques " -s3ForcePathStyleDesc: "Si s3ForcePathStyle es troba activat el nom del cubell s'haurà d'especificar com a part de l'adreça URL en comptes del nom del servidor. Podria ser que necessitis activar aquesta opció quan facis servir serveis com ara l'allotjament a un servidor propi." -serverLogs: "Registres del servidor" -deleteAll: "Elimina-ho tot" -showFixedPostForm: "Mostrar el formulari per escriure a l'inici de la línia de temps" -showFixedPostFormInChannel: "Mostrar el formulari d'escriptura al principi de la línia de temps (Canals)" -withRepliesByDefaultForNewlyFollowed: "Inclou les respostes d'usuaris nous seguits a la línia de temps per defecte." newNoteRecived: "Hi ha publicacions noves" -sounds: "Sons" -sound: "So" -listen: "Escoltar" -none: "Res" -showInPage: "Mostrar a la pàgina " -popout: "Finestra emergent" -volume: "Volum" -masterVolume: "Volum principal" -notUseSound: "Sense so" -useSoundOnlyWhenActive: "Reproduir sons només quan Misskey estigui actiu" -details: "Detalls" -chooseEmoji: "Tria un emoji" -unableToProcess: "L'operació no pot ser completada " -recentUsed: "Utilitzat recentment" -install: "Instal·lació " -uninstall: "Desinstal·lar " -installedApps: "Aplicacions autoritzades " -nothing: "No hi ha res per veure aquí " installedDate: "Data d'instal·lació" -lastUsedDate: "Utilitzat per última vegada" state: "Estat" sort: "Ordena" ascendingOrder: "Ascendent" descendingOrder: "Descendent" -scratchpad: "Bloc de proves" -scratchpadDescription: "El bloc de proves proporciona un entorn experimental per AiScript. Pot escriure i verificar els resultats que interactuen amb Misskey." -uiInspector: "Inspector de la interfície" -uiInspectorDescription: "Podeu visualitzar una llista d'elements UI presents en la memòria. Els components de la interfície d'usuari són generats per les funcions Ui:C:." -output: "Sortida" -script: "Script" -disablePagesScript: "Desactivar AiScript a les pàgines " -updateRemoteUser: "Actualitzar la informació de l'usuari remot" -unsetUserAvatar: "Desactivar l'avatar " -unsetUserAvatarConfirm: "Segur que vols desactivar l'avatar?" -unsetUserBanner: "Desactivar el bàner " -unsetUserBannerConfirm: "Segur que vols desactivar el bàner?" -deleteAllFiles: "Esborrar tots els arxius" -deleteAllFilesConfirm: "Segur que vols esborrar tots els arxius?" removeAllFollowing: "Deixar de seguir tots els usuaris seguits" removeAllFollowingDescription: "El fet d'executar això, et farà deixar de seguir a tots els usuaris de {host}. Si us plau, executa això si l'amfitrió, per exemple, ja no existeix." userSuspended: "Aquest usuari ha sigut suspès" @@ -662,1818 +526,118 @@ medium: "Mitjà" small: "Petit" generateAccessToken: "Genera codi d'accés" permission: "Permisos" -adminPermission: "Permisos d'administrador " enableAll: "Habilita tot" disableAll: "Deshabilita tot" tokenRequested: "Donar accés al compte" -pluginTokenRequestedDescription: "Aquest connector podrà fer servir tots els permisos configurats aquí." -notificationType: "Tipus de notificació " -edit: "Editar" -emailServer: "Servidor de correu electrònic " -enableEmail: "Activar l'enviament de correus electrònics " -emailConfigInfo: "Es fa servir per confirmar el teu correu quan et registres o oblides la contrasenya " -email: "Correu electrònic" -emailAddress: "Adreça de correu electrònic" -smtpConfig: "Configuració del servidor SMTP" smtpHost: "Amfitrió" -smtpPort: "Port" smtpUser: "Nom d'usuari" smtpPass: "Contrasenya" -emptyToDisableSmtpAuth: "No omplis el nom d'usuari i la contrasenya si vols deshabilitar l'autenticació SMTP" -smtpSecure: "Fes servir SSL/TLS per connexions SMTP" -smtpSecureInfo: "Desactiva això quan facis servir connexions STARTTLS" -testEmail: "Prova l'enviament de correu " -wordMute: "Silenciar paraules " -hardWordMute: "Silenciar paraules fortes" -regexpError: "Error de l'expressió regular " -regexpErrorDescription: "S'ha produït un error a l'expressió regular a la línia {line} de les paraules silenciades {tab}:" -instanceMute: "Silenciar servidor" -userSaysSomething: "{name} n'ha dit alguna cosa" -makeActive: "Activar" -display: "Veure" -copy: "Copiar" -metrics: "Mètriques" -overview: "Visió General" -logs: "Registres" -delayed: "Endarrerits " -database: "Bases de dades" -channel: "Canals" -create: "Crear" -notificationSetting: "Paràmetres de notificacions" -notificationSettingDesc: "Selecciona els tipus de notificacions que es mostraran" -useGlobalSetting: "Fer servir la configuració global" -useGlobalSettingDesc: "Si s'activa, es farà servir la configuració de notificacions del teu comte. Si no s'activa es poden fer configuracions individuals." -other: "Altre" -regenerateLoginToken: "Regenerar clau de seguretat d'inici de sessió" -regenerateLoginTokenDescription: "Regenera la clau de seguretat que es fa servir internament durant l'inici de sessió. Normalment aquesta acció no és necessària. Si es regenera es tancarà la sessió a tots els dispositius amb una sessió activa." -theKeywordWhenSearchingForCustomEmoji: "Cercar un emoji personalitzat " -setMultipleBySeparatingWithSpace: "Separa múltiples entrades amb un espai" -fileIdOrUrl: "ID de l'arxiu o URL" -behavior: "Comportament" -sample: "Mostrar" -abuseReports: "Denúncies " -reportAbuse: "Denuncia un abús " -reportAbuseRenote: "Denuncia una renota" -reportAbuseOf: "Denuncia a {name}" -fillAbuseReportDescription: "Omple els detalls sobre aquesta denúncia. Si la denúncia és sobre una nota en concret inclou l'adreça URL." -abuseReported: "La teva denúncia s'ha enviat. Moltes gràcies." -reporter: "Denunciant " -reporteeOrigin: "Origen de la denúncia " -reporterOrigin: "Origen del denunciant" -send: "Envia" -openInNewTab: "Obre a una pestanya nova" -openInSideView: "Obre a una vista lateral" -defaultNavigationBehaviour: "Navegació per defecte" -editTheseSettingsMayBreakAccount: "Editar aquestes opcions pot deixar inoperatiu el teu compte" -instanceTicker: "Informació de notes de la instància " -waitingFor: "Esperant {x}" -random: "Aleatori " -system: "Sistema" -switchUi: "Canviar interfície d'usuari " -desktop: "Escriptori" -clip: "Retalls" -createNew: "Crear" -optional: "Opcional" -createNewClip: "Crear un nou Retall" -unclip: "Treure Retall" -confirmToUnclipAlreadyClippedNote: "Aquesta nota ja és inclosa al Retall \"{name}\". Vols treure-la d'aquest retall?" -public: "Públic " -private: "Privat" -i18nInfo: "Misskey està sent traduït a diferents idiomes per voluntaris. Pots ajudar aquí {link}." -manageAccessTokens: "Administrar claus de seguretat d'accés " -accountInfo: "Informació del compte" -notesCount: "Comptador de notes" -repliesCount: "Nombre de respostes" renotesCount: "Impulsos fets" -repliedCount: "Nombre de respostes rebudes" renotedCount: "Impulsos rebuts" -followingCount: "Nombre de comptes seguits" -followersCount: "Nombre de seguidors" -sentReactionsCount: "Nombre de reaccions enviades" -receivedReactionsCount: "Nombre de reaccions rebudes" -pollVotesCount: "Nombre de vots enviats a enquestes" -pollVotedCount: "Nombre de vots rebuts a les enquestes" -yes: "Sí " -no: "No" -driveFilesCount: "Nombre de fitxers al Disc" -driveUsage: "Utilització de l'espai del Disc" -noCrawle: "Rebutjar la indexació dels buscadors" -noCrawleDescription: "No permetis que els buscadors indexin el teu perfil, notes, pàgines, etc." -lockedAccountInfo: "Tret que establiu la visibilitat de la nota a \"Només seguidors\", les vostres notes seran visibles per qualsevol persona, fins i tot si heu d'aprovar els seguidors manualment" -alwaysMarkSensitive: "Marcar com a sensible per defecte" -loadRawImages: "Carregar les imatges originals en comptes de miniatures " -disableShowingAnimatedImages: "No reproduir imatges animades" -highlightSensitiveMedia: "Ressalta els medis marcats com a sensibles" -verificationEmailSent: "S'ha enviat un correu electrònic de verificació. Fes clic a l'enllaç per completar la verificació." -notSet: "Sense definir" -emailVerified: "El correu electrònic s'ha verificat" -noteFavoritesCount: "Nombre de notes favorites " -pageLikesCount: "Nombre de Pàgines que t'agraden " -pageLikedCount: "Nombre d'agraïments rebuts a les Pàgines " -contact: "Contacte" -useSystemFont: "Fes servir la font per defecte del sistema" -clips: "Retalls" -experimentalFeatures: "Característiques experimentals" -experimental: "Experimental" -thisIsExperimentalFeature: "Aquesta és una característica experimental. La seva funcionalitat pot canviar, i pot ser que no funcioni degudament." -developer: "Programador" -makeExplorable: "Fes que el compte sigui visible a la secció \"Explorar\"" -makeExplorableDescription: "Si desactives aquesta opció, el teu compte no sortirà a la secció \"Explorar\"" -showGapBetweenNotesInTimeline: "Mostra una separació entre els articles a la línia de temps" -duplicate: "Duplicat" -left: "Esquerra" -center: "Centre" -wide: "Gran" -narrow: "Estret" -reloadToApplySetting: "Aquest ajust només s'aplicarà després de recarregar la pàgina. Vols fer-ho ara?" -needReloadToApply: "Es requereix recarregar per reflectir aquesta opció " -showTitlebar: "Mostra la barra del títol " clearCache: "Esborra la memòria cau" -onlineUsersCount: "{n} Usuaris es troben en línia " -nUsers: "{n} Usuaris" -nNotes: "{n} Notes" -sendErrorReports: "Enviar informes d'error " -sendErrorReportsDescription: "Quan s'activa, es compartirà amb Misskey informació detallada de l'error quan es trobi un problema això farà pujar la qualitat de Misskey.\nAixò inclourà informació com la versió del SO que fas servir, el navegador web que fas servir, la teva activitat a Misskey, etc." -myTheme: "El meu tema" -backgroundColor: "Color de fons" -accentColor: "Color principal" -textColor: "Color del text" -saveAs: "Desar com..." -advanced: "Avançat" -advancedSettings: "Configuració avançada" -value: "Valor" -createdAt: "Creat el" -updatedAt: "Actualitzat el" -saveConfirm: "Desar canvis?" -deleteConfirm: "Segur que vols esborrar?" -invalidValue: "Valor invàlid." -registry: "Registre " -closeAccount: "Tancar el compte" -currentVersion: "Versió actual" -latestVersion: "Versió nova" -youAreRunningUpToDateClient: "Ja estàs fent servir la versió més recent del client." -newVersionOfClientAvailable: "Tens disponible una versió del client més recent." -usageAmount: "Ús " -capacity: "Capacitat" -inUse: "Fet servir" -editCode: "Editar el codi" -apply: "Aplicar" -receiveAnnouncementFromInstance: "Rep notificacions d'aquesta instància " -emailNotification: "Notificacions per correu electrònic " -publish: "Publicar" -inChannelSearch: "Cerca al canal" -useReactionPickerForContextMenu: "Fes clic al botó dret del ratolí per obrir el menú de reaccions" -typingUsers: "{users} està/estàn Escrivint " -jumpToSpecifiedDate: "Ves a una data concreta" showingPastTimeline: "Estàs veient una línia de temps antiga" -clear: "Tornar" -markAllAsRead: "Marcar tot com llegit" -goBack: "Tornar" -unlikeConfirm: "Vols esborrar el teu m'agrada?" -fullView: "Vista completa." -quitFullView: "Sortir de la vista completa" -addDescription: "Afegeix una descripció " -userPagePinTip: "Podeu seleccionar \"Fixar al perfil\" del menú de notes individuals per mostrar les notes aquí." -notSpecifiedMentionWarning: "Aquesta nota esmenta usuaris que no es troben com a destinataris" info: "Informació" -userInfo: "Informació de l'usuari" -unknown: "Desconegut" -onlineStatus: "Connectat" -hideOnlineStatus: "Ocultar l'estat de connexió" -hideOnlineStatusDescription: "Ocultant el teu estat de connexió redueix les funcionalitats d'algunes funcions com la cerca." -online: "Connectat" -active: "Actiu" -offline: "Desconnectat" -notRecommended: "No recomanat" -botProtection: "Protecció contra bots" -instanceBlocking: "Instàncies blocades/silenciades" -selectAccount: "Seleccionar un compte" -switchAccount: "Canviar de compte" -enabled: "Activat" -disabled: "Desactivat" -quickAction: "Accions ràpides" user: "Usuaris" administration: "Administració" -accounts: "Comptes" -switch: "Canvia" -noMaintainerInformationWarning: "La informació de l'administrador no s'ha configurat" -noInquiryUrlWarning: "No s'ha desat l'URL de consulta." -noBotProtectionWarning: "La protecció contra bots no s'ha configurat." -configure: "Configurar" -postToGallery: "Crear una nova publicació a la galeria" -postToHashtag: "Pública a aquesta etiqueta" -gallery: "Galeria" -recentPosts: "Articles recents" -popularPosts: "Articles populars" -shareWithNote: "Comparteix amb una nota" -ads: "Anuncis" -expiration: "" -startingperiod: "Inici" -memo: "Recordatori" -priority: "Prioritat" -high: "Alta" middle: "Mitjà" -low: "Baixa" -emailNotConfiguredWarning: "Adreça de correu electrònic" -ratio: "Proporció" -previewNoteText: "Mostrar vista prèvia" -customCss: "CSS personalitzat" -customCssWarn: "Aquesta configuració només hauries de configurar-la si saps que fas. Si poses valors inadequats pots fer que el client deixi de funcionar correctament." global: "Global" -squareAvatars: "Mostrar avatars quadrats" -sent: "Envia" -received: "Rebut" -searchResult: "Resultats de la cerca" -hashtags: "Etiquetes" -troubleshooting: "Solucionar problemes" -useBlurEffect: "Fes servir efectes de desenfocament a la interfície" -learnMore: "Saber més " -misskeyUpdated: "Misskey s'ha actualitzat " -whatIsNew: "Mostra canvis" -translate: "Traduir " -translatedFrom: "Traduït del {x}" -accountDeletionInProgress: "S'està produint l'eliminació del compte" -usernameInfo: "Un nom que identifiqui el teu compte d'altres en aquest servidor. Pots fer servir lletres (a~z, A~Z), números (0~9) i guions baixos (_). Els noms d'usuari no es poden canviar després." -aiChanMode: "Mode IA" -devMode: "Mode desenvolupador" -keepCw: "Mantenir els avisos de contingut" -pubSub: "Comptes Pub/Sub" -lastCommunication: "Última comunicació " -resolved: "Resolt" -unresolved: "Sense resoldre" -breakFollow: "Deixar de seguir" -breakFollowConfirm: "Vols deixar de seguir?" -itsOn: "Activat" -itsOff: "Desactivat" -on: "Activar" -off: "Desactivar" -emailRequiredForSignup: "Demanar correu electrònic per registrar-se " -unread: "Sense llegir" -filter: "Filtrar" -controlPanel: "Panel de control" -manageAccounts: "Gestionar comptes" -makeReactionsPublic: "Reaccions públiques " -makeReactionsPublicDescription: "Això fa que totes les teves reaccions siguin visibles públicament " -classic: "Clàssic " -muteThread: "Silenciar el fil" -unmuteThread: "Deixar de silenciar el fil" -followingVisibility: "Visibilitat dels seguiments" -followersVisibility: "Visibilitat dels seguidors" -continueThread: "Veure la continuació del fil" -deleteAccountConfirm: "Això eliminarà el teu compte irreversiblement. Procedir?" -incorrectPassword: "Contrasenya incorrecta." -incorrectTotp: "La contrasenya no és correcta, o ha caducat." -voteConfirm: "Confirma el teu vot \"{choice}\"" -hide: "Amagar" -useDrawerReactionPickerForMobile: "Mostrar el selector de reaccions com un calaix al mòbil " -welcomeBackWithName: "Benvingut de nou, {name}" -clickToFinishEmailVerification: "Si us plau, fes clic a [{ok}] per completar la verificació per correu electrònic " -overridedDeviceKind: "Tipus de dispositiu" -smartphone: "Telèfon intel·ligent" -tablet: "Tauleta" -auto: "Automàtic " -themeColor: "Color del tema" -size: "Mida" -numberOfColumn: "Nombre de columnes" searchByGoogle: "Cercar" -instanceDefaultLightTheme: "Tema clar per defecte de tota la instància " -instanceDefaultDarkTheme: "Tema fosc per defecte de tota la instància " -instanceDefaultThemeDescription: "Introdueix el codi del tema en format d'objecte" -mutePeriod: "Duració del silenci" -period: "Límit de temps" -indefinitely: "Permanent" -tenMinutes: "10 minuts" -oneHour: "1 hora" -oneDay: "Un dia" -oneWeek: "Una setmana" -oneMonth: "Un mes" -threeMonths: "3 mesos" -oneYear: "1 any" -threeDays: "3 dies" -reflectMayTakeTime: "Això pot trigar una estona a tenir efecte" -failedToFetchAccountInformation: "No es pot obtenir la informació del compte" -rateLimitExceeded: "S'ha arribat al màxim de peticions" -cropImage: "Retalla la imatge" -cropImageAsk: "Vols retallar la imatge?" -cropYes: "Retallar" -cropNo: "Fer servir tal qual" file: "Fitxers" -recentNHours: "Últimes {n} hores" -recentNDays: "Últims {n} dies" -noEmailServerWarning: "Correu electrònic del servidor sense configurar" -thereIsUnresolvedAbuseReportWarning: "Hi ha informes sense solucionar." -recommended: "Recomanat" -check: "Verificar" -driveCapOverrideLabel: "Canvia la capacitat del Disc per aquest usuari" -driveCapOverrideCaption: "Restableix la mida original posant un valor de 0 o menys." -requireAdminForView: "Has de ser administrador per poder veure això." -isSystemAccount: "Un compte creat i operat automàticament pel sistema." -typeToConfirm: "Si us plau, escriu {x} per confirmar" -deleteAccount: "Esborrar el compte" -document: "Documentació" -numberOfPageCache: "Nombre de pàgines a la memòria cau" -numberOfPageCacheDescription: "Incrementant aquest nombre farà que millori l'experiència de l'usuari, però es farà servir més memòria al dispositiu de l'usuari." -logoutConfirm: "Vols sortir?" -lastActiveDate: "Fet servir per última vegada" -statusbar: "Barra d'estat" -pleaseSelect: "Selecciona una opció" -reverse: "Invertir" -colored: "Colorit" -refreshInterval: "Interval d'actualització " -label: "Etiqueta" -type: "Tipus" -speed: "Velocitat" -slow: "Lent" -fast: "Ràpid " -sensitiveMediaDetection: "Detecció de contingut sensible" -localOnly: "Només local" -remoteOnly: "Només remot" -failedToUpload: "Ha fallat la pujada" -cannotUploadBecauseInappropriate: "Aquest fitxer no es pot pujar perquè s'ha trobat que algunes parts són inapropiades." -cannotUploadBecauseNoFreeSpace: "Ha fallat la pujada del fitxer perquè no hi ha capacitat al Disc." -cannotUploadBecauseExceedsFileSizeLimit: "Aquest fitxer no es pot pujar perquè supera la mida permesa." -beta: "Proves" -enableAutoSensitive: "Marcar com a sensible automàticament " -enableAutoSensitiveDescription: "Permet la detecció i el marcat automàtic dels mitjans sensibles fent servir aprenentatge automàtic quan sigui possible. Si aquesta opció es troba desactivada potser que estigui activada per a tota la instància. " -activeEmailValidationDescription: "Activa la validació estricta de comptes de correu electrònic, inclou la validació d'adreces d'un sol ús i si es possible comunicar-se amb aquestes. Quan es troba desactivada només es vàlida el format del correu electrònic." -navbar: "Barra de navegació " -shuffle: "Aleatori" -account: "Compte" -move: "Mou" -pushNotification: "Enviament de notificacions" -subscribePushNotification: "Activar l'enviament de notificacions" -unsubscribePushNotification: "Desactivar l'enviament de notificacions" -pushNotificationAlreadySubscribed: "L'enviament de notificacions ja és activat" -pushNotificationNotSupported: "El teu navegador o la teva instància no suporta l'enviament de notificacions " -sendPushNotificationReadMessage: "Esborrar les notificacions enviades quan s'hagin llegit" -sendPushNotificationReadMessageCaption: "Això pot fer que el teu dispositiu consumeixi més bateria" -windowMaximize: "Maximitzar " -windowMinimize: "Minimitzar" -windowRestore: "Restaurar" -caption: "Llegenda" -loggedInAsBot: "Identificat com a bot" -tools: "Eines" -cannotLoad: "No es pot carregar" -numberOfProfileView: "Visualitzacions del perfil" -like: "M'agrada " -unlike: "Treure m'agrada " -numberOfLikes: "M'agraden " -show: "Veure" -neverShow: "No mostrar més " -remindMeLater: "Recorda-m'ho més tard" -didYouLikeMisskey: "T'està agradant Misskey?" -pleaseDonate: "A {host} fem servir el software lliure Misskey. Considera fer un donatiu a Misskey perquè pugui continuar el seu desenvolupament!" -correspondingSourceIsAvailable: "El codi font corresponent està disponible a {anchor}." -roles: "Rols" -role: "Rols" -noRole: "No s'han trobat rols" -normalUser: "Usuari normal" -undefined: "Sense definir" -assign: "Assignar " -unassign: "Treure" -color: "Color" -manageCustomEmojis: "Gestiona els emojis personalitzats" -manageAvatarDecorations: "Gestiona les decoracions dels avatars " -youCannotCreateAnymore: "Has arribat al màxim de creacions" -cannotPerformTemporary: "Temporalment no disponible" -cannotPerformTemporaryDescription: "Aquesta acció no es pot dur a terme temporalment per arribar al seu límit d'execució. Pots esperar una mica i tornar-ho a intentar." -invalidParamError: "Paràmetres incorrectes " -invalidParamErrorDescription: "Els paràmetres demanats no són correctes. Normalment això es deu a un error, però també pot ser a alguna entrada excedint els límits o similar." -permissionDeniedError: "Operació no permesa " -permissionDeniedErrorDescription: "Aquest compte no té suficients permisos per dur a terme aquesta acció " -preset: "Predefinit" -selectFromPresets: "Escull des dels predefinits" -achievements: "Assoliments" -gotInvalidResponseError: "Resposta del servidor invàlida " -gotInvalidResponseErrorDescription: "No es pot contactar amb el servidor o potser es troba fora de línia per manteniment. Provar-ho de nou més tard." -thisPostMayBeAnnoying: "Aquesta nota pot ser molesta per algú." -thisPostMayBeAnnoyingHome: "Publicar a la línia de temps d'Inici" -thisPostMayBeAnnoyingCancel: "Cancel·lar " -thisPostMayBeAnnoyingIgnore: "Publicar de totes maneres" -collapseRenotes: "Col·lapsar les renotes que ja has vist" -collapseRenotesDescription: "Col·lapse les notes a les quals ja has reaccionat o que ja has renotat" -internalServerError: "Error intern del servidor" -internalServerErrorDescription: "El servidor ha fallat de manera inexplicable." -copyErrorInfo: "Copiar la informació de l'error " -joinThisServer: "Registra't en aquesta instància " -exploreOtherServers: "Cerca una altra instància " -letsLookAtTimeline: "Dona una ullada a la línia de temps" -disableFederationConfirm: "Vols treure la federació?" -disableFederationConfirmWarn: "Fins i tot traient la federació, les publicacions continuaren sent públiques, a no ser que es digui el contrari. Normalment no has de tocar això." -disableFederationOk: "Desactivar" -invitationRequiredToRegister: "Aquesta instància només permet el registre per invitació. Per registrar-te has d'introduir el codi d'invitació." -emailNotSupported: "Aquesta instància no suporta l'enviament de correus electrònics " -postToTheChannel: "Publicar a un Canal" -cannotBeChangedLater: "Això ja no es podrà canviar." -reactionAcceptance: "Acceptació de reaccions " -likeOnly: "Només m'agraden " -likeOnlyForRemote: "Tot (només m'agraden d'instàncies remotes)" -nonSensitiveOnly: "Només sense contingut sensible" -nonSensitiveOnlyForLocalLikeOnlyForRemote: "Només contingut no sensible (Només m'agraden d'instàncies remotes)" -rolesAssignedToMe: "Rols assignats " -resetPasswordConfirm: "Vols canviar la teva contrasenya?" -sensitiveWords: "Paraules sensibles" -sensitiveWordsDescription: "La visibilitat de totes les notes que continguin qualsevol de les paraules configurades seran, automàticament, afegides a \"Inici\". Pots llistar diferents paraules separant les per línies noves." -sensitiveWordsDescription2: "Fent servir espais crearà expressions AND si l'expressió s'envolta amb barres inclinades es converteix en una expressió regular." -prohibitedWords: "Paraules prohibides" -prohibitedWordsDescription: "Quan intenteu publicar una Nota que conté una paraula prohibida, feu que es converteixi en un error. Es poden dividir i establir múltiples línies." -prohibitedWordsDescription2: "Fent servir espais crearà expressions AND si l'expressió s'envolta amb barres inclinades es converteix en una expressió regular." -hiddenTags: "Etiquetes ocultes" -hiddenTagsDescription: "La visibilitat de totes les notes que continguin qualsevol de les paraules configurades seran, automàticament, afegides a \"Inici\". Pots llistar diferents paraules separant les per línies noves." -notesSearchNotAvailable: "La cerca de notes no es troba disponible." -license: "Llicència" -unfavoriteConfirm: "Esborrar dels favorits?" -myClips: "Els meus retalls" -drivecleaner: "Netejador de Disc" -retryAllQueuesNow: "Prova de nou d'executar totes les cues" -retryAllQueuesConfirmTitle: "Tornar a intentar-ho tot?" -retryAllQueuesConfirmText: "Això farà que la càrrega del servidor augmenti temporalment." -enableChartsForRemoteUser: "Generar gràfiques d'usuaris remots" -enableChartsForFederatedInstances: "Generar gràfiques d'instàncies remotes" -enableStatsForFederatedInstances: "Activa les estadístiques de les instàncies remotes federades" -showClipButtonInNoteFooter: "Afegir \"Retall\" al menú d'acció de la nota" -reactionsDisplaySize: "Mida de les reaccions" -limitWidthOfReaction: "Limitar l'amplada màxima de la reacció i mostrar-les en una mida reduïda " -noteIdOrUrl: "ID o URL de la nota" -video: "Vídeo" -videos: "Vídeos " -audio: "So" -audioFiles: "So" -dataSaver: "Economitzador de dades" -accountMigration: "Migració del compte" -accountMoved: "Aquest usuari té un compte nou:" -accountMovedShort: "Aquest compte ha sigut migrat" -operationForbidden: "Operació no permesa " -forceShowAds: "Mostra els anuncis sempre " -addMemo: "Afegir recordatori" -editMemo: "Editar recordatori" -reactionsList: "Reaccions" -renotesList: "Impulsos" -notificationDisplay: "Notificacions" -leftTop: "Dalt a l'esquerra " -rightTop: "Dalt a la dreta " -leftBottom: "A baix a l'esquerra" -rightBottom: "A baix a la dreta" -stackAxis: "Apilar en direcció " -vertical: "Vertical" -horizontal: "Horitzontal " -position: "Posició " -serverRules: "Regles del servidor" -pleaseConfirmBelowBeforeSignup: "Per obrir un compte en aquest servidor, has de llegir i acceptar el següent." -pleaseAgreeAllToContinue: "Has d'acceptar tots els camps de dalt per poder continuar." -continue: "Continuar" -preservedUsernames: "Noms d'usuaris reservats" -preservedUsernamesDescription: "Llistat de noms d'usuaris que no es poden fer servir separats per salts de linia. Aquests noms d'usuaris no estaran disponibles quan es creï un compte d'usuari normal, però els administradors els poden fer servir per crear comptes manualment. Per altre banda els comptes ja creats amb aquests noms d'usuari no es veure'n afectats." -createNoteFromTheFile: "Compon una nota des d'aquest fitxer" -archive: "Arxiu" -archived: "Arxivat" -unarchive: "Desarxivar" -channelArchiveConfirmTitle: "Vols arxivar {name}?" -channelArchiveConfirmDescription: "Un Canal arxivat no apareixerà a la llista de canals o als resultats de cerca. Tampoc es poden afegir noves entrades." -thisChannelArchived: "Aquest Canal ha sigut arxivat." -displayOfNote: "Mostrar notes" -initialAccountSetting: "Configuració del perfil" -youFollowing: "Seguit" -preventAiLearning: "Descartar l'ús d'aprenentatge automàtic (IA Generativa)" -preventAiLearningDescription: "Demanar els indexadors no fer servir els texts, imatges, etc. en cap conjunt de dades per alimentar l'aprenentatge automàtic (IA Predictiva/ Generativa). Això s'aconsegueix afegint la etiqueta \"noai\" com a resposta HTML al contingut corresponent. Prevenir aquest ús totalment pot ser que no sigui aconseguit, ja que molts indexadors poden obviar aquesta etiqueta." -options: "Opcions" -specifyUser: "Especificar usuari" -lookupConfirm: "Vols fer una cerca?" -openTagPageConfirm: "Vols obrir una pàgina d'etiquetes?" -specifyHost: "Especifica un servidor" -failedToPreviewUrl: "Vista prèvia no disponible" -update: "Actualitzar" -rolesThatCanBeUsedThisEmojiAsReaction: "Rols que poden fer servir aquest emoji com a reacció " -rolesThatCanBeUsedThisEmojiAsReactionEmptyDescription: "Si cap rol es especificat tothom ho pot fer servir" -rolesThatCanBeUsedThisEmojiAsReactionPublicRoleWarn: "Aquests rols han de ser públics " -cancelReactionConfirm: "Vols esborrar la teva reacció?" -changeReactionConfirm: "Vols canviar la teva reacció?" -later: "Més tard" -goToMisskey: "Ves a Misskey" -additionalEmojiDictionary: "Diccionari d'emojis adicionals" -installed: "Instal·lats " -branding: "Marca" -enableServerMachineStats: "Publicar estadístiques del maquinari del servidor" -enableIdenticonGeneration: "Activar la generació d'icones d'identificació " -turnOffToImprovePerformance: "Desactivant aquesta opció es pot millorar el rendiment." -createInviteCode: "Crear codi d'invitació " -createWithOptions: "Crear invitació amb opcions" -createCount: "Comptador d'invitacions " -inviteCodeCreated: "Invitació creada" -inviteLimitExceeded: "Has sobrepassat el límit d'invitacions que pots crear." -createLimitRemaining: "Et queden {limit} invitacions restants" -inviteLimitResetCycle: "Cada {time} {limit} invitacions." -expirationDate: "Data de venciment" -noExpirationDate: "Sense data de venciment" -inviteCodeUsedAt: "Codi d'invitació fet servir el" -registeredUserUsingInviteCode: "Codi d'invitació fet servir per l'usuari " -waitingForMailAuth: "Esperant la verificació per correu electrònic " -inviteCodeCreator: "Invitació creada per" -usedAt: "Utilitzada el" -unused: "Sense utilitzar" -used: "Utilitzada" -expired: "Caducat" -doYouAgree: "Estàs d'acord?" -beSureToReadThisAsItIsImportant: "Llegeix això perquè és molt important." -iHaveReadXCarefullyAndAgree: "He llegit {x} i estic d'acord." -dialog: "Diàleg " icon: "Icona" -forYou: "Per a tu" -currentAnnouncements: "Informes actuals" -pastAnnouncements: "Informes passats" -youHaveUnreadAnnouncements: "Tens informes per llegir." -useSecurityKey: "Segueix les instruccions del teu navegador O dispositiu per fer servir el teu passkey." replies: "Respondre" renotes: "Impulsa" -loadReplies: "Mostrar les respostes" -loadConversation: "Mostrar la conversació " -pinnedList: "Llista fixada" -keepScreenOn: "Mantenir la pantalla encesa" -verifiedLink: "La propietat de l'enllaç ha sigut verificada" -notifyNotes: "Notificar quan hi hagi notes noves" -unnotifyNotes: "Deixar de notificar quan hi hagi notes noves" -authentication: "Autenticació " -authenticationRequiredToContinue: "Si us plau autentificat per continuar" -dateAndTime: "Data i hora" -showRenotes: "Mostrar impulsos" -edited: "Editat" -notificationRecieveConfig: "Paràmetres de notificacions" -mutualFollow: "Seguidor mutu" -followingOrFollower: "Seguit o seguidor" -fileAttachedOnly: "Només notes amb adjunts" -showRepliesToOthersInTimeline: "Mostrar les respostes a altres a la línia de temps" -hideRepliesToOthersInTimeline: "Amagar les respostes a altres a la línia de temps" -showRepliesToOthersInTimelineAll: "Mostrar les respostes a altres a usuaris que segueixes a la línia de temps" -hideRepliesToOthersInTimelineAll: "Ocultar les teves respostes a tots els usuaris que segueixes a la línia de temps" -confirmShowRepliesAll: "Aquesta opció no té marxa enrere. Vols mostrar les teves respostes a tots els que segueixes a la teva línia de temps?" -confirmHideRepliesAll: "Aquesta opció no té marxa enrere. Vols ocultar les teves respostes a tots els usuaris que segueixes a la línia de temps?" -externalServices: "Serveis externs" -sourceCode: "Codi font" -sourceCodeIsNotYetProvided: "El codi font encara no es troba disponible. Contacta amb l'administrador per solucionar aquest problema." -repositoryUrl: "URL del repositori" -repositoryUrlDescription: "Si estàs fent servir Misskey tal com és (sense cap canvi al codi font), introdueix https://github.com/misskey-dev/misskey" -repositoryUrlOrTarballRequired: "Si no ofereixes cap repositori, publica un fitxer tarball. Dona una ullada a .config/example.yml per a més informació." -feedback: "Opinió" -feedbackUrl: "URL per a opinar" -impressum: "Impressum" -impressumUrl: "Adreça URL impressum" -impressumDescription: "A països, com Alemanya, la inclusió de la informació de contacte de l'operador (un Impressum) és requereix de manera legal per llocs comercials." -privacyPolicy: "Política de privacitat" -privacyPolicyUrl: "Adreça URL de la política de privacitat" -tosAndPrivacyPolicy: "Termes d'ús i política de privacitat" -avatarDecorations: "Decoracions dels avatars" -attach: "Adjuntar" -detach: "Eliminar" -detachAll: "Treure tot" -angle: "Angle" -flip: "Girar" -showAvatarDecorations: "Mostrar les decoracions dels avatars" -releaseToRefresh: "Deixar anar per actualitzar" -refreshing: "Recarregant..." -pullDownToRefresh: "Llisca cap a baix per recarregar" -disableStreamingTimeline: "Desactivar l'actualització en temps real de les línies de temps" -useGroupedNotifications: "Mostrar les notificacions agrupades " -signupPendingError: "Hi ha hagut un problema verificant l'adreça de correu electrònic. L'enllaç pot haver caducat." -cwNotationRequired: "Si està activat \"Amagar contingut\" s'ha d'escriure una descripció " -doReaction: "Afegeix una reacció " -code: "Codi" -reloadRequiredToApplySettings: "És necessari recarregar la pàgina per aplicar els canvis." -remainingN: "Queden: {n}" -overwriteContentConfirm: "Vols substituir el contingut actual?" -seasonalScreenEffect: "Efectes de pantalla segons les estacions" -decorate: "Decorar" -addMfmFunction: "Afegeix funcions MFM" -enableQuickAddMfmFunction: "Activar accés ràpid per afegir funcions MFM" -bubbleGame: "Bubble Game" -sfx: "Efectes de so" -soundWillBePlayed: "Es reproduiran efectes de so" -showReplay: "Veure reproducció" -replay: "Reproduir" -replaying: "Reproduint" -endReplay: "Tanca la redifusió" -copyReplayData: "Copia les dades de la resposta" -ranking: "Classificació" -lastNDays: "Últims {n} dies" -backToTitle: "Torna al títol" -hemisphere: "Geolocalització" -withSensitive: "Incloure notes amb fitxers sensibles" -userSaysSomethingSensitive: "La publicació de {name} conte material sensible" -enableHorizontalSwipe: "Lliscar per canviar de pestanya" -loading: "S’està carregant" -surrender: "Cancel·lar " -gameRetry: "Torna a provar" -notUsePleaseLeaveBlank: "Si no voleu usar-ho, deixeu-ho en blanc" -useTotp: "Usa una contrasenya d'un sol ús" -useBackupCode: "Usa un codi de recuperació" -launchApp: "Inicia l'aplicació " -useNativeUIForVideoAudioPlayer: "Fes servir la UI del navegador quan reprodueixis vídeo i àudio " -keepOriginalFilename: "Desa el nom del fitxer original" -keepOriginalFilenameDescription: "Si desactives aquesta opció els noms dels fitxers se substituiran per una cadena aleatòria quan carreguis nous fitxers de forma automàtica." -noDescription: "No hi ha una descripció " -alwaysConfirmFollow: "Confirma sempre els seguiments" -inquiry: "Contacte" -tryAgain: "Intenta-ho més tard." -confirmWhenRevealingSensitiveMedia: "Confirmació quan revelis contingut sensible " -sensitiveMediaRevealConfirm: "Aquest contingut potser sensible. Segur que ho vols revelar?" -createdLists: "Llistes creades " -createdAntennas: "Antenes creades" -fromX: "De {x}" -genEmbedCode: "Obtenir el codi per incrustar" -noteOfThisUser: "Notes d'aquest usuari" -clipNoteLimitExceeded: "No es poden afegir més notes a aquest clip." -performance: "Rendiment" -modified: "Modificat" -discard: "Descarta" -thereAreNChanges: "Hi ha(n) {n} canvi(s)" -signinWithPasskey: "Inicia sessió amb Passkey" -unknownWebAuthnKey: "Passkey desconeguda" -passkeyVerificationFailed: "La verificació a fallat" -passkeyVerificationSucceededButPasswordlessLoginDisabled: "La verificació de la passkey a estat correcta, però s'ha deshabilitat l'inici de sessió sense contrasenya." -messageToFollower: "Missatge als meus seguidors" -target: "Assumpte " -testCaptchaWarning: "És una característica dissenyada per a la prova de CAPTCHA. No l'utilitzes en l'entorn real." -prohibitedWordsForNameOfUser: "Noms prohibits per escollir noms d'usuari " -prohibitedWordsForNameOfUserDescription: "Si qualsevol d'aquestes paraules es troben a un nom d'usuari la creació de l'usuari no es durà a terme. Als moderadors no els afecta aquesta restricció." -yourNameContainsProhibitedWords: "El nom conté paraules prohibides " -yourNameContainsProhibitedWordsDescription: "Si de veritat vols fer servir aquest nom posat en contacte amb l'administrador." -thisContentsAreMarkedAsSigninRequiredByAuthor: "L'autor requereix l'inici de sessió per poder veure" -lockdown: "Bloquejat" -pleaseSelectAccount: "Seleccionar un compte" -_accountSettings: - requireSigninToViewContents: "És obligatori l'inici de sessió per poder veure el contingut" - requireSigninToViewContentsDescription1: "Es requereix l'inici de sessió per poder veure totes les notes i el contingut que has creat. Amb això esperem evitar que els rastrejadors recopilin informació." - requireSigninToViewContentsDescription2: "També es desactivaran les vistes prèvies d'URLS (OGP), la incrustació a pàgines web i la visualització des de servidors que no admetin la citació de notes." - requireSigninToViewContentsDescription3: "Aquestes restriccions pot ser que no s'apliquin als continguts federats en servidors remots." - makeNotesFollowersOnlyBefore: "Permetre que les notes antigues només es mostrin als seguidors." - makeNotesFollowersOnlyBeforeDescription: "Mentre aquesta funció estigui activada, les notes que hagin passat la data i hora fixada o hagi passat els temps establert seran visibles només per als teus seguidors. Quan es desactivi, també es restableix l'estat públic de la nota." - makeNotesHiddenBefore: "Fes que les notes antigues siguin privades" - makeNotesHiddenBeforeDescription: "Mentres aquesta funció estigui activada les notes que hagin superat una data i hora fixada o hagi passat el temps establert només seran visibles per a tu. Si la desactives es restablirà també l'estat públic de les notes." - mayNotEffectForFederatedNotes: "Això pot ser que no afecti les notes federades." - notesHavePassedSpecifiedPeriod: "Notes publicades durant un període de temps especificat." - notesOlderThanSpecifiedDateAndTime: "Notes més antigues de la data i temps especificat " -_abuseUserReport: - forward: "Reenviar " - forwardDescription: "Reenvia l'informe a una altra instància com un compte del sistema anònima." - resolve: "Solució " - accept: "Acceptar " - reject: "Rebutjar" - resolveTutorial: "Si l'informe és legítim selecciona \"Acceptar\" per resoldre'l positivament. Però si l'informe no és legítim selecciona \"Rebutjar\" per resoldre'l negativament." -_delivery: - status: "Estat d'entrega " - stop: "Suspés" - resume: "Torna a enviar" - _type: - none: "S'està publicant" - manuallySuspended: "Suspendre manualment" - goneSuspended: "Servidor suspès perquè el servidor s'ha esborrat" - autoSuspendedForNotResponding: "Servidor suspès perquè el servidor no respon" -_bubbleGame: - howToPlay: "Com es juga" - hold: "Mantenir" - _score: - score: "Puntuació " - scoreYen: "Diners guanyats" - highScore: "Millor puntuació " - maxChain: "Nombre màxim de combos" - yen: "{yen}Ien" - estimatedQty: "{qty}peces" - scoreSweets: "{onigiriQtyWithUnit}ongiris" - _howToPlay: - section1: "Ajusta la posició i deixa caure l'objecte dintre la caixa." - section2: "Quan dos objectes del mateix tipus es toquen, canviaran en un objecte diferent i guanyares punts." - section3: "El joc s'acabarà quan els objectes sobresurtin de la caixa. Intenta aconseguir la puntuació més gran possible fusionant objectes mentre impedeixes que sobresurtin de la caixa!" -_announcement: - forExistingUsers: "Anunci per usuaris registrats" - forExistingUsersDescription: "Aquest avís només es mostrarà als usuaris existents fins al moment de la publicació. Si no també es mostrarà als usuaris que es registrin després de la publicació." - needConfirmationToRead: "Es necessita confirmació de lectura de la notificació " - needConfirmationToReadDescription: "Si s'activa es mostrarà un diàleg per confirmar la lectura d'aquesta notificació. A més aquesta notificació serà exclosa de qualsevol funcionalitat com \"Marcar tot com a llegit\"." - end: "Final de la notificació " - tooManyActiveAnnouncementDescription: "Tenir massa notificacions actives pot empitjorar l'experiència de l'usuari. Considera finalitzar els anuncis que siguin antics." - readConfirmTitle: "Marcar com llegida?" - readConfirmText: "Això marcarà el contingut de \"{title}\" com llegit." - shouldNotBeUsedToPresentPermanentInfo: "Ja que l'ús de notificacions pot impactar l'experiència dels nous usuaris, és recomanable fer servir les notificacions amb el flux d'informació en comptes de fer-les servir en un únic bloc." - dialogAnnouncementUxWarn: "Tenir dues o més notificacions amb l'estil de finestres pot impactar l'experiència de l'usuari, és per això que és recomana fer-lo servir amb cura." - silence: "Sense notificacions" - silenceDescription: "Activant aquesta opció la notificació no es mostrarà ni l'usuari l'haurà de llegir." -_initialAccountSetting: - accountCreated: "S'ha completat la creació del compte!" - letsStartAccountSetup: "Posem ràpidament la configuració inicial del compte." - letsFillYourProfile: "Comencem establint el teu perfil." - profileSetting: "Configuració del perfil" - privacySetting: "Configuració de seguretat" - theseSettingsCanEditLater: "Aquests ajustos es poden canviar més tard." - youCanEditMoreSettingsInSettingsPageLater: "A més d'això, es poden fer diferents configuracions a través de la pàgina de configuració. Assegureu-vos de comprovar-ho més tard." - followUsers: "Prova de seguir usuaris que t'interessin per construir la teva línia de temps." - pushNotificationDescription: "Activant les notificacions emergents et permetrà rebre notificacions de {name} directament al teu dispositiu." - initialAccountSettingCompleted: "Configuració del perfil completada!" - haveFun: "Disfruta {name}!" - youCanContinueTutorial: "Pots continuar amb un tutorial per aprendre a Fer servir {name} (MissKey) o tu pots estalviar i començar a fer-lo servir ja." - startTutorial: "Començar el tutorial" - skipAreYouSure: "Et vols saltar la configuració del perfil?" - laterAreYouSure: "Vols continuar la configuració del perfil més tard?" -_initialTutorial: - launchTutorial: "Començar tutorial" - title: "Tutorial" - wellDone: "Ben fet!" - skipAreYouSure: "Sortir del tutorial?" - _landing: - title: "Benvingut al tutorial" - description: "Aquí aprendràs el bàsic per poder fer servir Misskey i les seves característiques." - _note: - title: "Què és una Nota?" - description: "Les publicacions a Misskey es diuen 'Notes'. Les Notes s'ordenen cronològicament a la línia de temps i s'actualitzen de forma automàtica." - reply: "Fes clic en aquest botó per contestar a un missatge. També és possible contestar a una contestació, continuant la conversació en forma de fil." - renote: "Pots compartir una Nota a la teva pròpia línia de temps. Inclús pots citar-les amb els teus comentaris." - reaction: "Pots afegir reaccions a les Notes. Entrarem més en detall a la pròxima pàgina." - menu: "Pots veure els detalls de les Notes, copiar enllaços i fer diferents accions." - _reaction: - title: "Què són les Reaccions?" - description: "Es poden reaccionar a les Notes amb diferents emoticones. Les reaccions et permeten expressar matisos que hi són més enllà d'un simple m'agrada." - letsTryReacting: "Es poden afegir reaccions fent clic al botó '+'. Prova reaccionant a aquesta nota!" - reactToContinue: "Afegeix una reacció per continuar." - reactNotification: "Rebràs notificacions en temps real quan un usuari reaccioni a les teves notes." - reactDone: "Pots desfer una reacció fent clic al botó '-'." - _timeline: - title: "El concepte de les línies de temps" - description1: "Misskey mostra diferents línies de temps basades en l'ús (algunes poden no estar disponibles depenent de la política del servidor)" - home: "Pots veure notes dels comptes que segueixes" - local: "Pots veure les notes dels usuaris del servidor." - social: "Es mostren les notes de les línies de temps d'Inici i Local." - global: "Pots veure les notes de tots els servidors connectats." - description2: "Pots canviar la línia de temps en qualsevol moment fent servir la barra de la pantalla superior." - description3: "A més hi ha línies de temps per llistes i per canals. Si vols saber més {link}." - _postNote: - title: "Configuració de la publicació de les notes" - description1: "Quan públiques una nota a Misskey hi ha diferents opcions disponibles. El formulari de publicació es veu així" - _visibility: - description: "Pots limitar qui pot veure les teves notes." - public: "La teva nota serà visible per a tots els usuaris." - home: "Publicar només a línia de temps d'Inici. La gent que visiti el teu perfil o mitjançant les remotes també la podran veure." - followers: "Només visible per a seguidors. Només els teus seguidors la podran veure i ningú més. Ningú més podrà fer renotes." - direct: "Només visible per a alguns seguidors, el destinatari rebre una notificació. Es pot fer servir com una alternativa als missatges directes." - doNotSendConfidencialOnDirect1: "Tingues cura quan enviïs informació sensible." - doNotSendConfidencialOnDirect2: "Els administradors del servidor poden veure tot el que escrius. Ves compte quan enviïs informació sensible en enviar notes directes a altres usuaris en servidors de poca confiança." - localOnly: "Publicar amb aquesta opció activada farà que la nota no federi amb altres servidors. Els usuaris d'altres servidors no podran veure la nota directament, sense importar les opcions de visualització." - _cw: - title: "Avís de Contingut (CW)" - description: "En comptes del cos de la nota es mostrarà el que s'escrigui al camp de 'comentaris'. Fent clic a 'Llegir més' es mostrarà el cos." - _exampleNote: - cw: "Això et farà venir gana!" - note: "Acabo de menjar-me un donut de xocolata 🍩😋" - useCases: "Això es fa servir per seguir normes del servidor sobre certes notes o per ocultar contingut sensible O revelador." - _howToMakeAttachmentsSensitive: - title: "Com marcar adjunts com a contingut sensible?" - description: "Per adjunts que sigui requerit per les normes del servidor o que puguin contenir material sensible, s'ha d'afegir l'opció 'sensible'." - tryThisFile: "Prova de marcar la imatge adjunta en aquest formulari com a sensible!" - _exampleNote: - note: "Oops! L'he fet bona en obrir la tapa de Nocilla..." - method: "Per marcar un adjunt com a sensible, fes clic a la miniatura de l'adjunt, obre el menú i fes clic a 'Marcar com a sensible'." - sensitiveSucceeded: "Quan adjuntis fitxers si us plau marca la sensibilitat seguint les normes del servidor." - doItToContinue: "Marca el fitxer adjunt com a sensible per poder continuar." - _done: - title: "Has completat el tutorial 🎉" - description: "Les funcions explicades aquí és una petita mostra. Per una explicació més detallada de com fer servir MissKey consulta {link}." -_timelineDescription: - home: "A la línia de temps d'Inici pots veure les notes dels usuaris que segueixes." - local: "A la línia de temps Local pots veure les notes de tots els usuaris d'aquest servidor." - social: "La línia de temps Social mostren les notes de les línies de temps d'Inici i Local." - global: "A la línia de temps Global pots veure les notes de tots els servidors connectats." -_serverRules: - description: "Un conjunt de regles que seran mostrades abans de registrar-se. Es recomanable configurar un resum dels termes d'ús." -_serverSettings: - iconUrl: "URL de la icona" - appIconDescription: "Especifica la icona que es mostrarà quan el {host} es mostri en una aplicació." - appIconUsageExample: "Per exemple com a PWA, o quan es mostri com un favorit a la pàgina d'inici del telèfon mòbil" - appIconStyleRecommendation: "Com la icona pot ser retallada com un cercle o un quadrat, es recomana fer servir una icona amb un marge acolorit que l'envolti." - appIconResolutionMustBe: "La resolució mínima és {resolution}." - manifestJsonOverride: "Sobreescriure manifest.json" - shortName: "Nom curt" - shortNameDescription: "Una abreviatura del nom de la instància que es poguí mostrar en cas que el nom oficial sigui massa llarg" - fanoutTimelineDescription: "Quan es troba activat millora bastant el rendiment quan es recuperen les línies de temps i redueix la carrega de la base de dades. Com a contrapunt, l'ús de memòria de Redis es veurà incrementada. Considera d'estabilitat aquesta opció en cas de tenir un servidor amb poca memòria o si tens problemes de inestabilitat." - fanoutTimelineDbFallback: "Carregar de la base de dades" - fanoutTimelineDbFallbackDescription: "Quan s'activa, la línia de temps fa servir la base de dades per consultes adicionals si la línia de temps no es troba a la memòria cau. Si és desactiva la càrrega del servidor és veure reduïda, però també és reduirà el nombre de línies de temps que és poden obtenir." - reactionsBufferingDescription: "Quan s'activa aquesta opció millora bastant el rendiment en recuperar les línies de temps reduint la càrrega de la base. Com a contrapunt, augmentarà l'ús de memòria de Redís. Desactiva aquesta opció en cas de tenir un servidor amb poca memòria o si tens problemes d'inestabilitat." - inquiryUrl: "URL de consulta " - inquiryUrlDescription: "Escriu adreça URL per al formulari de consulta per al mantenidor del servidor o una pàgina web amb el contacte d'informació." - thisSettingWillAutomaticallyOffWhenModeratorsInactive: "Si no es detecta activitat per part del moderador durant un període de temps, aquesta opció es desactiva automàticament per evitar el correu brossa." -_accountMigration: - moveFrom: "Migrar un altre compte a aquest" - moveFromSub: "Crear un àlies per un altre compte" - moveFromLabel: "Compte original #{n}" - moveFromDescription: "Has de crear un àlies del compte que vols migrar en aquest compte.\nFes servir aquest format per posar el compte que vols migrar: @nomusuari@servidor.exemple.com\nPer esborrar l'àlies deixa el camp en blanc (no és recomanable de fer)" - moveTo: "Migrar aquest compte a un altre" - moveToLabel: "Compte al qual es vol migrar:" - moveCannotBeUndone: "Les migracions dels comptes no es poden desfer." - moveAccountDescription: "Això migrarà la teva compte a un altre diferent.\n ・Els seguidors d'aquest compte és passaran al compte nou de forma automàtica\n ・Es deixaran de seguir a tots els usuaris que es segueixen actualment en aquest compte\n ・No es poden crear notes noves, etc. en aquest compte\n\nSi bé la migració de seguidors es automàtica, has de preparar alguns pasos manualment per migrar la llista d'usuaris que segueixes. Per fer això has d'exportar els seguidors que després importaraes al compte nou mitjançant el menú de configuració. El mateix procediment s'ha de seguir per less teves llistes i els teus usuaris silenciats i bloquejats.\n\n(Aquesta explicació s'aplica a Misskey v13.12.0 i posteriors. Altres aplicacions, com Mastodon, poden funcionar diferent.)" - moveAccountHowTo: "Per fer la migració, primer has de crear un àlies per aquest compte al compte al qual vols migrar.\nDesprés de crear l'àlies, introdueix el compte al qual vols migrar amb el format següent: @nomusuari@servidor.exemple.com" - startMigration: "Migrar" - migrationConfirm: "Vols migrar aquest compte a {account}? Una vegada comenci la migració no es podrà parar O fer marxa enrere i no podràs tornar a fer servir aquest compte mai més." - movedAndCannotBeUndone: "Aquest compte ha migrat.\nLes migracions no es poden desfer." - postMigrationNote: "Aquest compte deixarà de seguir tots els comptes que segueix 24 hores després de germinar la migració.\nEl nombre de seguidors i seguits passarà a ser de zero. Per evitar que els teus seguidors no puguin veure les publicacions marcades com a només seguidors continuaren seguint aquest compte." - movedTo: "Nou compte:" -_achievements: - earnedAt: "Desbloquejat el" - _types: - _notes1: - title: "Aquí, configurant el meu msky" - description: "Publica la teva primera Nota" - flavor: "Passa-t'ho bé fent servir Miskey!" - _notes10: - title: "Algunes notes" - description: "Publica 10 notes" - _notes100: - title: "Un piló de notes" - description: "Publica 100 notes" - _notes500: - title: "Cobert de notes" - description: "Publica 500 notes" - _notes1000: - title: "Un piló de notes" - description: "1 000 notes publicades" - _notes5000: - title: "Desbordament de notes" - description: "5 000 notes publicades" - _notes10000: - title: "Supernota" - description: "10 000 notes publicades" - _notes20000: - title: "Necessito... Més... Notes!" - description: "20 000 notes publicades" - _notes30000: - title: "Notes notes notes!" - description: "30 000 notes publicades" - _notes40000: - title: "Fàbrica de notes" - description: "40 000 notes publicades" - _notes50000: - title: "Planeta de notes" - description: "50 000 notes publicades" - _notes60000: - title: "Quàsar de notes" - description: "60 000 notes publicades" - _notes70000: - title: "Forat negre de notes" - description: "70 000 notes publicades" - _notes80000: - title: "Galàxia de notes" - description: "80 000 notes publicades" - _notes90000: - title: "Univers de notes" - description: "90 000 notes publicades" - _notes100000: - title: "ALL YOUR NOTE ARE BELONG TO US" - description: "100 000 notes publicades" - flavor: "Segur que tens moltes coses a dir?" - _login3: - title: "Principiant I" - description: "Vas iniciar sessió fa tres dies" - flavor: "Des d'avui diguem Misskist" - _login7: - title: "Principiant II" - description: "Vas iniciar sessió fa set dies" - flavor: "Ja saps com va funcionant tot?" - _login15: - title: "Principiant III" - description: "Vas iniciar sessió fa quinze dies" - _login30: - title: "Misskist I" - description: "Vas iniciar sessió fa trenta dies" - _login60: - title: "Misskist II" - description: "Vas iniciar sessió fa seixanta dies" - _login100: - title: "Misskist III" - description: "Vas iniciar sessió fa cent dies" - flavor: "Misskist violent" - _login200: - title: "Regular I" - description: "Vas iniciar sessió fa dos-cents dies" - _login300: - title: "Regular II" - description: "Vas iniciar sessió fa tres-cents dies" - _login400: - title: "Regular III" - description: "Vas iniciar sessió fa quatre-cents dies" - _login500: - title: "Expert I" - description: "Vas iniciar sessió fa cinc-cents dies" - flavor: "Amics, he dit massa vegades que soc un amant de les notes" - _login600: - title: "Expert II" - description: "Vas iniciar sessió fa sis-cents dies" - _login700: - title: "Expert III" - description: "Vas iniciar sessió fa set-cents dies" - _login800: - title: "Mestre de les Notes I" - description: "Vas iniciar sessió fa vuit-cents dies " - _login900: - title: "Mestre de les Notes II" - description: "Vas iniciar sessió fa nou-cents dies" - _login1000: - title: "Mestre de les Notes III" - description: "Vas iniciar sessió fa mil dies" - flavor: "Gràcies per fer servir MissKey!" - _noteClipped1: - title: "He de retallar-te!" - description: "Retalla la teva primera nota" - _noteFavorited1: - title: "Quan miro les estrelles" - description: "La primera vegada que vaig registrar el meu favorit" - _myNoteFavorited1: - title: "Vull una estrella" - description: "La meva nota va ser registrada com favorita per una de les altres persones" - _profileFilled: - title: "Estic a punt" - description: "Vaig fer la configuració de perfil" - _markedAsCat: - title: "Soc un gat" - description: "He establert el meu compte com si fos un Gat" - flavor: "Encara no tinc nom" - _following1: - title: "És el meu primer seguiment" - description: "És la primera vegada que et segueixo" - _following10: - title: "Segueix-me... Segueix-me..." - description: "Seguir 10 usuaris" - _following50: - title: "Molts amics" - description: "Seguir 50 comptes" - _following100: - title: "100 amics" - description: "Segueixes 100 comptes" - _following300: - title: "Sobrecàrrega d'amics" - description: "Segueixes 300 comptes" - _followers1: - title: "Primer seguidor" - description: "1 seguidor guanyat" - _followers10: - title: "Segueix-me!" - description: "10 seguidors guanyats" - _followers50: - title: "Venen en manada" - description: "50 seguidors guanyats" - _followers100: - title: "Popular" - description: "100 seguidors guanyats" - _followers300: - title: "Si us plau, d'un en un!" - description: "300 seguidors guanyats" - _followers500: - title: "Torre de ràdio" - description: "500 seguidors guanyats" - _followers1000: - title: "Influenciador" - description: "1 000 seguidors guanyats" - _collectAchievements30: - title: "Col·leccionista d'èxits " - description: "Desbloqueja 30 assoliments" - _viewAchievements3min: - title: "M'agraden els èxits " - description: "Mira la teva llista d'assoliments durant més de 3 minuts" - _iLoveMisskey: - title: "Estimo Misskey" - description: "Publica \"I ❤ #Misskey\"" - flavor: "L'equip de desenvolupament de Misskey agraeix el vostre suport!" - _foundTreasure: - title: "A la Recerca del Tresor" - description: "Has trobat el tresor amagat" - _client30min: - title: "Parem una estona" - description: "Mantingues obert Misskey per 30 minuts" - _client60min: - title: "A totes amb Misskey" - description: "Mantingues Misskey obert per 60 minuts" - _noteDeletedWithin1min: - title: "No et preocupis" - description: "Esborra una nota al minut de publicar-la" - _postedAtLateNight: - title: "Nocturn" - description: "Publica una nota a altes hores de la nit " - flavor: "És hora d'anar a dormir." - _postedAt0min0sec: - title: "Rellotge xerraire" - description: "Publica una nota a les 0:00" - flavor: "Tic tac, tic tac, tic tac, DING!" - _selfQuote: - title: "Autoreferència " - description: "Cita una nota teva" - _htl20npm: - title: "Línia de temps fluida" - description: "La teva línia de temps va a més de 20npm (notes per minut)" - _viewInstanceChart: - title: "Analista " - description: "Mira els gràfics de la teva instància " - _outputHelloWorldOnScratchpad: - title: "Hola, món!" - description: "Escriu \"hola, món\" al bloc de notes" - _open3windows: - title: "Multi finestres" - description: "I va obrir més de tres finestres" - _driveFolderCircularReference: - title: "Consulteu la secció de bucle" - description: "Intenta crear carpetes recursives al Disc" - _reactWithoutRead: - title: "De veritat has llegit això?" - description: "Reaccions a una nota de més de 100 caràcters publicada fa menys de 3 segons " - _clickedClickHere: - title: "Fer clic" - description: "Has fet clic aquí " - _justPlainLucky: - title: "Ha sigut sort" - description: "Oportunitat de guanyar-lo amb una probabilitat d'un 0.005% cada 10 segons" - _setNameToSyuilo: - title: "soc millor" - description: "Posat \"siuylo\" com a nom" - _passedSinceAccountCreated1: - title: "Primer aniversari" - description: "Ja ha passat un any d'ençà que vas crear el teu compte" - _passedSinceAccountCreated2: - title: "Segon aniversari" - description: "Ja han passat dos anys d'ençà que vas crear el teu compte" - _passedSinceAccountCreated3: - title: "Tres anys" - description: "Ja han passat tres anys d'ençà que vas crear el teu compte" - _loggedInOnBirthday: - title: "Felicitats!" - description: "T'has identificat el dia del teu aniversari" - _loggedInOnNewYearsDay: - title: "Bon any nou!" - description: "T'has identificat el primer dia de l'any " - flavor: "A per un altre any memorable a la teva instància " - _cookieClicked: - title: "Un joc en què fas clic a les galetes" - description: "Pica galetes" - flavor: "Espera, ets al lloc web correcte?" - _brainDiver: - title: "Busseja Ments" - description: "Publica un enllaç al Busseja Ments" - flavor: "Misskey-Misskey La-Tu-Ma" - _smashTestNotificationButton: - title: "Sobrecàrrega de proves" - description: "Envia moltes notificacions de prova en un període de temps molt curt" - _tutorialCompleted: - title: "Diploma del Curs Elemental de Misskey" - description: "Has completat el tutorial" - _bubbleGameExplodingHead: - title: "🤯" - description: "L'objecte més gran del joc de la bombolla " - _bubbleGameDoubleExplodingHead: - title: "Doble 🤯" - description: "Dos dels objectes més grans del joc de la bombolla al mateix temps" - flavor: "Pots emplenar una carmanyola com aquesta 🤯🤯 una mica" _role: - new: "Nou rol" - edit: "Editar el rol" - name: "Nom del rol" - description: "Descripció del rol" - permission: "Permisos de rol" - descriptionOfPermission: "Els Moderadors poden fer operacions bàsiques de moderació.\nEls Administradors poden canviar tots els ajustos del servidor." - assignTarget: "Assignar " - descriptionOfAssignTarget: "Manual per canviar manualment qui és part d'aquest rol i qui no.\nCondicional per afegir o eliminar de manera automàtica els usuaris d'aquest rol basat en una determinada condició." - manual: "Manual" - manualRoles: "Rols manuals" - conditional: "Condicional" - conditionalRoles: "Rols condicionals" - condition: "Condició" - isConditionalRole: "Aquest és un rol condicional" - isPublic: "Rol públic" - descriptionOfIsPublic: "Aquest rol es mostrarà al perfil dels usuaris al que se'ls assigni." - options: "Opcions" - policies: "Polítiques" - baseRole: "Plantilla de rols" - useBaseValue: "Fer servir els valors de la plantilla de rols" - chooseRoleToAssign: "Selecciona els rols a assignar" - iconUrl: "URL de la icona " - asBadge: "Mostrar com a insígnia " - descriptionOfAsBadge: "La icona d'aquest rol es mostrarà al costat dels noms d'usuaris que tinguin assignats aquest rol." - isExplorable: "Fer el rol explorable" - descriptionOfIsExplorable: "La línia de temps d'aquest rol i la llista d'usuaris seran públics si s'activa." - displayOrder: "Posició " - descriptionOfDisplayOrder: "Com més gran és el número, més dalt la seva posició a la interfície." - canEditMembersByModerator: "Permetre que els moderadors editin la llista d'usuaris en aquest rol" - descriptionOfCanEditMembersByModerator: "Quan s'activa, els moderadors, així com els administradors, podran afegir i treure usuaris d'aquest rol. Si es troba desactivat, només els administradors poden assignar usuaris." - priority: "Prioritat" _priority: - low: "Baixa" middle: "Mitjà" - high: "Alta" _options: - gtlAvailable: "Pot veure la línia de temps global" - ltlAvailable: "Pot veure la línia de temps local" - canPublicNote: "Pot enviar notes públiques" - mentionMax: "Nombre màxim de mencions a una nota" - canInvite: "Pot crear invitacions a la instància " - inviteLimit: "Límit d'invitacions " - inviteLimitCycle: "Temps de refresc de les invitacions" - inviteExpirationTime: "Interval de caducitat de les invitacions" - canManageCustomEmojis: "Gestiona els emojis personalitzats" - canManageAvatarDecorations: "Gestiona les decoracions dels avatars " - driveCapacity: "Capacitat del disc" - alwaysMarkNsfw: "Marca sempre els fitxers com a sensibles" - canUpdateBioMedia: "Permet l'edició d'una icona o un bàner" - pinMax: "Nombre màxim de notes fixades" antennaMax: "Nombre màxim d'antenes" - wordMuteMax: "Nombre màxim de caràcters permesos a les paraules silenciades" - webhookMax: "Nombre màxim de Webhooks" - clipMax: "Nombre màxim de clips" - noteEachClipsMax: "Nombre màxim de notes dintre d'un clip" - userListMax: "Nombre màxim de llistes d'usuaris " - userEachUserListsMax: "Nombre màxim d'usuaris dintre d'una llista d'usuaris " - rateLimitFactor: "Limitador" - descriptionOfRateLimitFactor: "Límits baixos són menys restrictius, límits alts són més restrictius." - canHideAds: "Pot amagar els anuncis" - canSearchNotes: "Pot cercar notes" - canUseTranslator: "Pot fer servir el traductor" - avatarDecorationLimit: "Nombre màxim de decoracions que es poden aplicar els avatars" - canImportAntennas: "Autoritza la importació d'antenes " - canImportBlocking: "Autoritza la importació de bloquejats" - canImportFollowing: "Autoritza la importació de seguidors" - canImportMuting: "Autoritza la importació de silenciats" - canImportUserLists: "Autoritza la importació de llistes d'usuaris " - _condition: - roleAssignedTo: "Assignat a rols manuals" - isLocal: "Usuari local" - isRemote: "Usuari remot" - isCat: "Usuaris gats" - isBot: "Usuaris bots" - isSuspended: "Usuari suspès" - isLocked: "Comptes privats" - isExplorable: "Fes que el compte aparegui a les cerques" - createdLessThan: "Han passat menys de X a passat des de la creació del compte" - createdMoreThan: "Han passat més de X des de la creació del compte" - followersLessThanOrEq: "Té menys de X seguidors" - followersMoreThanOrEq: "Té X o més seguidors" - followingLessThanOrEq: "Segueix X o menys comptes" - followingMoreThanOrEq: "Segueix a X o més comptes" - notesLessThanOrEq: "Les publicacions són menys o igual a " - notesMoreThanOrEq: "Les publicacions són més o igual a " - and: "AND condicional " - or: "OR condicional" - not: "NOT condicional" -_sensitiveMediaDetection: - description: "Redueix els esforços de moderació gràcies al reconeixement automàtic dels fitxers amb contingut sensible mitjançant Machine Learing. Això augmentarà la càrrega del servidor." - sensitivity: "Sensibilitat de la detecció " - sensitivityDescription: "Reduint la sensibilitat provocarà menys falsos positius. D'altra banda incrementant-ho generarà més falsos negatius." - setSensitiveFlagAutomatically: "Marcar com a sensible" - setSensitiveFlagAutomaticallyDescription: "Els resultats de la detecció interna seran desats, inclòs si aquesta opció es troba desactivada." - analyzeVideos: "Activar anàlisis de vídeos " - analyzeVideosDescription: "Analitzar els vídeos a més de les imatges. Això incrementarà lleugerament la càrrega del servidor." -_emailUnavailable: - used: "Aquest correu electrònic ja s'està fent servir" - format: "El format del correu electrònic és invàlid " - disposable: "No es poden fer servir adreces de correu electrònic d'un sol ús " - mx: "Aquest servidor de correu electrònic no és vàlid " - smtp: "Aquest servidor de correu electrònic no respon" - banned: "No pots registrar-te amb aquesta adreça de correu electrònic " -_ffVisibility: - public: "Publicar" - followers: "Visible només per a seguidors " - private: "Privat" -_signup: - almostThere: "Ja quasi estem" - emailAddressInfo: "Si us plau, escriu la teva adreça de correu electrònic. No es farà pública." - emailSent: "S'ha enviat un correu de confirmació a ({email}). Si us plau, fes clic a l'enllaç per completar el registre." -_accountDelete: - accountDelete: "Eliminar el compte" - mayTakeTime: "Com l'eliminació d'un compte consumeix bastants recursos, pot trigar un temps perquè es completi l'esborrat, depenent si tens molt contingut i la quantitat de fitxer que hagis pujat." - sendEmail: "Una vegada hagi finalitzat l'esborrat del compte rebràs un correu electrònic a l'adreça que tinguis registrada en aquest compte." - requestAccountDelete: "Demanar l'eliminació del compte" - started: "Ha començat l'esborrat del compte." - inProgress: "L'esborrat es troba en procés " -_ad: - back: "Tornar" - reduceFrequencyOfThisAd: "Mostrar menys aquest anunci" - hide: "No mostrar mai" - timezoneinfo: "El dia de la setmana ve determinat del fus horari del servidor." - adsSettings: "Configuració d'anuncis " - notesPerOneAd: "Interval d'emplaçament d'anuncis en temps real (Notes per anuncis)" - setZeroToDisable: "Ajusta aquest valor a 0 per deshabilitar l'actualització d'anuncis en temps real" - adsTooClose: "L'interval actual pot fer que l'experiència de l'usuari sigui dolenta perquè l'interval és molt baix." -_forgotPassword: - enterEmail: "Escriu l'adreça de correu electrònic amb la que et vas registrar. S'enviarà un correu electrònic amb un enllaç perquè puguis canviar-la." - ifNoEmail: "Si no vas fer servir una adreça de correu electrònic per registrar-te, si us plau posa't en contacte amb l'administrador." - contactAdmin: "Aquesta instància no suporta registrar-se amb correu electrònic. Si us plau, contacta amb l'administrador del servidor." -_gallery: - my: "La meva Galeria " - liked: "Publicacions que t'han agradat" - like: "M'agrada " - unlike: "Ja no m'agrada" _email: _follow: title: "t'ha seguit" - _receiveFollowRequest: - title: "Has rebut una sol·licitud de seguiment" -_plugin: - install: "Instal·lar un afegit " - installWarn: "Si us plau, no instal·lis afegits que no siguin de confiança." - manage: "Gestionar els afegits" - viewSource: "Veure l'origen " - viewLog: "Mostra el registre" -_preferencesBackups: - list: "Llista de còpies de seguretat" - saveNew: "Fer una còpia de seguretat nova" - loadFile: "Carregar des d'un fitxer" - apply: "Aplicar en aquest dispositiu" - save: "Desar els canvis" - inputName: "Escriu un nom per aquesta còpia de seguretat" - cannotSave: "No s'ha pogut desar" - nameAlreadyExists: "Ja existeix una còpia de seguretat anomenada \"{name}\". Escriu un nom diferent." - applyConfirm: "Vols aplicar la còpia de seguretat \"{name}\" a aquest dispositiu? La configuració actual del dispositiu serà esborrada." - saveConfirm: "Desar còpia de seguretat com {name}?" - deleteConfirm: "Esborrar la còpia de seguretat {name}?" - renameConfirm: "Vols canvia el nom de la còpia de seguretat de \"{old}\" a \"{new}\"?" - noBackups: "No hi ha còpies de seguretat. Pots fer una còpia de seguretat de la configuració d'aquest dispositiu al servidor fent servir \"Crear nova còpia de seguretat\"" - createdAt: "Creat el: {date} {time}" - updatedAt: "Actualitzat el: {date} {time}" - cannotLoad: "Hi ha hagut un error al carregar" - invalidFile: "Format del fitxer no vàlid " -_registry: - scope: "Àmbit " - key: "Clau" - keys: "Claus" - domain: "Domini" - createKey: "Crear una clau" -_aboutMisskey: - about: "Misskey és un programa de codi obert desenvolupar per syuilo des de 2014" - contributors: "Col·laboradors principals" - allContributors: "Tots els col·laboradors " - source: "Codi font" - original: "Original" - thisIsModifiedVersion: "En {name} fa servir una versió modificada de Misskey." - translation: "Tradueix Misskey" - donate: "Fes un donatiu a Misskey" - morePatrons: "També agraïm el suport d'altres col·laboradors que no surten en aquesta llista. Gràcies! 🥰" - patrons: "Patrocinadors" - projectMembers: "Membres del projecte" -_displayOfSensitiveMedia: - respect: "Ocultar imatges o vídeos marcats com a sensibles" - ignore: "Mostrar imatges o vídeos marcats com a sensibles" - force: "Ocultar totes les imatges o vídeos " -_instanceTicker: - none: "No mostrar mai" - remote: "Mostrar per usuaris remots" - always: "Mostrar sempre" -_serverDisconnectedBehavior: - reload: "Recarregar automàticament " - dialog: "Mostrar finestres de confirmació " - quiet: "Mostrar un avís que no molesti" -_channel: - create: "Crear un canal" - edit: "Editar canal" - setBanner: "Estableix el bàner " - removeBanner: "Eliminar el.bàner" - featured: "Popular" - owned: "Propietat" - following: "Seguin" - usersCount: "{n} Participants" - notesCount: "{n} Notes" - nameAndDescription: "Nom i descripció " - nameOnly: "Nom només " - allowRenoteToExternal: "Permet la citació i l'impuls fora del canal" -_menuDisplay: - sideFull: "Horitzontal " - sideIcon: "Horitzontal (icones)" - top: "A dalt" - hide: "Amagar" -_wordMute: - muteWords: "Paraules silenciades" - muteWordsDescription: "Separar amb espais per la condició AND o amb salts de línia per la condició OR." - muteWordsDescription2: "Envolta les paraules amb barres per fer servir expressions regulars." _instanceMute: instanceMuteDescription: "Silencia tots els impulsos dels servidors seleccionats, també els usuaris que responen a altres d'un servidor silenciat." - instanceMuteDescription2: "Separar amb salts de línia" - title: "Ocultar notes de les instàncies en la llista." - heading: "Llista d'instàncies a silenciar" _theme: - explore: "Explorar els temes " - install: "Instal·lar un tema" - manage: "Gestionar els temes " - code: "Codi del tema" description: "Descripció" - installed: "{name} Instal·lat " - installedThemes: "Temes instal·lats " - builtinThemes: "Temes integrats" - alreadyInstalled: "Aquest tema ja es troba instal·lat " - invalid: "El format d'aquest tema no és correcte" - make: "Crear un tema" - base: "Base" - addConstant: "Afegir constant " - constant: "Constant" - defaultValue: "Valor per defecte" - color: "Color" - refProp: "Referència a una propietat" - refConst: "Referència a una constant " - key: "Clau" - func: "Funcions" - funcKind: "Tipus de funció " - argument: "Argument" - basedProp: "Propietat referenciada" - alpha: "Opacitat" - darken: "Enfosquir " - lighten: "Brillantor" - inputConstantName: "Escriu un nom per aquesta constant" - importInfo: "Si escrius el codi del tema aquí, el podràs importar a l'editor del tema" - deleteConstantConfirm: "Vols esborrar la constant {const}?" keys: - accent: "Accent" - bg: "Fons" - fg: "Text" - focus: "Enfocament" - indicator: "Indicador" - panel: "Taulell " - shadow: "Ombra" - header: "Capçalera" - navBg: "Fons de la barra lateral" - navFg: "Text de la barra lateral" - navHoverFg: "Text barra lateral (en passar per sobre)" - navActive: "Text barra lateral (actiu)" - navIndicator: "Indicador barra lateral" - link: "Enllaç" - hashtag: "Etiqueta" mention: "Menció" - mentionMe: "Mencions (jo)" renote: "Renotar" - modalBg: "Fons del modal" divider: "Divisor" - scrollbarHandle: "Maneta de la barra de desplaçament" - scrollbarHandleHover: "Maneta de la barra de desplaçament (en passar-hi per sobre)" - dateLabelFg: "Text de l'etiqueta de la data" - infoBg: "Fons d'informació " - infoFg: "Text d'informació " - infoWarnBg: "Fons avís " - infoWarnFg: "Text avís " - toastBg: "Fons notificació " - toastFg: "Text notificació " - buttonBg: "Fons botó " - buttonHoverBg: "Fons botó (en passar-hi per sobre)" - inputBorder: "Contorn del cap d'introducció " - driveFolderBg: "Fons de la carpeta Disc" - wallpaperOverlay: "Superposició del fons de pantalla " - badge: "Insígnia " - messageBg: "Fons del xat" - accentDarken: "Accent (fosc)" - accentLighten: "Accent (clar)" - fgHighlighted: "Text ressaltat" _sfx: note: "Notes" - noteMy: "Nota (per mi)" notification: "Notificacions" - reaction: "Quan se selecciona una reacció " -_soundSettings: - driveFile: "Fer servir un fitxer d'àudio del disc" - driveFileWarn: "Seleccionar un fitxer d'àudio del disc" - driveFileTypeWarn: "Fitxer no suportat " - driveFileTypeWarnDescription: "Seleccionar un fitxer d'àudio " - driveFileDurationWarn: "L'àudio és massa llarg" - driveFileDurationWarnDescription: "Els àudios molt llargs pot interrompre l'ús de Misskey. Vols continuar?" - driveFileError: "El so no es pot carregar. Canvia la configuració" -_ago: - future: "Futur " - justNow: "Ara mateix" - secondsAgo: "Fa {n} segons" - minutesAgo: "Fa {n} minuts" - hoursAgo: "Fa {n} hores" - daysAgo: "Fa {n} dies" - weeksAgo: "Fa {n} setmanes" - monthsAgo: "Fa {n} mesos" - yearsAgo: "Fa {n} anys" - invalid: "Res" -_timeIn: - seconds: "En {n} segons" - minutes: "En {n} minuts" - hours: "En {n} hores" - days: "En {n} dies" - weeks: "En {n} setmanes" - months: "En {n} mesos" - years: "En {n} anys" -_time: - second: "Segon(s)" - minute: "Minut(s)" - hour: "Hor(a)(es)" - day: "Di(a)(es)" + antenna: "Antenes" _2fa: - alreadyRegistered: "J has registrat un dispositiu d'autenticació de doble factor." - registerTOTP: "Registrar una aplicació autenticadora" - step1: "Primer instal·la una aplicació autenticadora (com {a} o {b}) al teu dispositiu." - step2: "Després escaneja el codi QR que es mostra en aquesta pantalla." - step2Uri: "Escriu la següent URI si estàs fent servir una aplicació d'escriptori " - step3Title: "Escriu un codi d'autenticació" - step3: "Escriu el codi d'autenticació (token) que es mostra a la teva aplicació per finalitzar la configuració." - setupCompleted: "Configuració terminada" - step4: "D'ara endavant quan accedeixis se't demanarà el token que has introduït." - securityKeyNotSupported: "El teu navegador no suporta claus de seguretat" - registerTOTPBeforeKey: "Configura una aplicació d'autenticació per registrar una clau de seguretat o una clau de pas." - securityKeyInfo: "A més de l'empremta digital o PIN per autenticar-te, pots configurar autenticació mitjançant maquinari que suporti claus de seguretat FIDO2, per protegir encara més el teu compte." - registerSecurityKey: "Registrar una clau de seguretat o clau de pas" - securityKeyName: "Escriu un nom per la clau" - tapSecurityKey: "Seguiu les instruccions del navegador i registrar les claus de seguretat o la clau de pas" - removeKey: "Esborrar la clau de seguretat" - removeKeyConfirm: "Esborrar la còpia de seguretat {name}?" - whyTOTPOnlyRenew: "L'aplicació d'autenticació no es pot eliminar mentre hi hagi una clau de seguretat registrada." - renewTOTP: "Reconfigurar l'aplicació d'autenticació " - renewTOTPConfirm: "Això farà que els codis de validació de l'antiga aplicació deixin de funcionar" - renewTOTPOk: "Reconfigurar" renewTOTPCancel: "No, gràcies" - checkBackupCodesBeforeCloseThisWizard: "Abans de tancar aquesta finestra, comprova el següent codi de seguretat." - backupCodes: "Codi de seguretat." - backupCodesDescription: "Si l'aplicació d'autenticació no es pot utilitzar, es pot accedir al compte utilitzant els següents codis de còpia de seguretat. Assegura't de mantenir aquests codis en un lloc segur. Cada codi es pot utilitzar només una vegada." - backupCodeUsedWarning: "Es va utilitzar un codi de còpia de seguretat. Si l'aplicació de certificació està disponible, reconfigura l'aplicació d'autenticació tan aviat com sigui possible." - backupCodesExhaustedWarning: "Es van utilitzar tots els codis de còpia de seguretat. Si no es pot utilitzar l'aplicació d'autenticació, ja no es pot accedir al compte. Torna a registrar l'aplicació d'autenticació." - moreDetailedGuideHere: "Aquí tens una guia al detall" -_permissions: - "read:account": "Veure la informació del compte." - "write:account": "Editar la informació del compte." - "read:blocks": "Veure la llista d'usuaris bloquejats" - "write:blocks": "Editar la llista d'usuaris blocats" - "read:drive": "Accedeix als teus fitxers i carpetes del Disc" - "write:drive": "Editar o eliminar els teus fitxers i carpetes al Disc" - "read:favorites": "Veure la teva llista de favorits" - "write:favorites": "Editar la teva llista de favorits" - "read:following": "Veure informació de qui segueixes" - "write:following": "Segueix o deixa de seguir altres comptes" - "read:messaging": "Veure els teus xats" - "write:messaging": "Crear o esborrar missatges de xat" - "read:mutes": "Veure la teva llista d'usuaris silenciats" - "write:mutes": "Editar la teva llista d'usuaris silenciats" - "write:notes": "Crear o esborrar notes" - "read:notifications": "Veure les teves notificacions" - "write:notifications": "Gestionar les teves notificacions" - "read:reactions": "Veure les teves reaccions" - "write:reactions": "Editar les teves reaccions" - "write:votes": "Votar en una enquesta" - "read:pages": "Veure les teves pàgines " - "write:pages": "Editar o esborrar les teves pàgines " - "read:page-likes": "Veure la llista de les pàgines que t'han agradat" - "write:page-likes": "Editar la llista de les pàgines que t'han agradat" - "read:user-groups": "Veure els teus grups d'usuaris " - "write:user-groups": "Editar o esborrar els teus grups d'usuaris " - "read:channels": "Veure els teus canals" - "write:channels": "Editar els teus canals" - "read:gallery": "Veure la teva galeria " - "write:gallery": "Editar la teva galeria" - "read:gallery-likes": "Veure la llista de publicacions de galeries que t'han agradat" - "write:gallery-likes": "Editar la llista de publicacions de galeries que t'han agradat" - "read:flash": "Veure reproduccions" - "write:flash": "Editar reproduccions" - "read:flash-likes": "Veure la llista de reproduccions que t'han agradat" - "write:flash-likes": "Editar la llista de reproduccions que t'han agradat" - "read:admin:abuse-user-reports": "Veure informes d'usuaris " - "write:admin:delete-account": "Esborrar compte d'usuari " - "write:admin:delete-all-files-of-a-user": "Esborrar tots els fitxers d'un usuari" - "read:admin:index-stats": "Veure l'índex de la base de dades" - "read:admin:table-stats": "Veure la informació de les taules a la base de dades" - "read:admin:user-ips": "Veure adreça IP de l'usuari " - "read:admin:meta": "Veure meta-informació del servidor" - "write:admin:reset-password": "Reiniciar contrasenya d'usuari " - "write:admin:resolve-abuse-user-report": "Resoldre informes d'usuaris " - "write:admin:send-email": "Enviar correu electrònic " - "read:admin:server-info": "Veure informació del servidor" - "read:admin:show-moderation-log": "Veure registre de moderació " - "read:admin:show-user": "Veure informació privada de l'usuari " - "write:admin:suspend-user": "Suspendre usuari" - "write:admin:unset-user-avatar": "Esborrar avatar d'usuari " - "write:admin:unset-user-banner": "Esborrar bàner de l'usuari " - "write:admin:unsuspend-user": "Treure la suspensió d'un usuari" - "write:admin:meta": "Gestionar les metadades de la instància" - "write:admin:user-note": "Gestionar les notes de moderació " - "write:admin:roles": "Gestionar rols" - "read:admin:roles": "Veure rols" - "write:admin:relays": "Gestionar relé" - "read:admin:relays": "Veure relés" - "write:admin:invite-codes": "Gestionar codis d'invitació " - "read:admin:invite-codes": "Veure codis d'invitació " - "write:admin:announcements": "Gestionar anuncis" - "read:admin:announcements": "Veure anuncis" - "write:admin:avatar-decorations": "Gestionar la decoració dels avatars" - "read:admin:avatar-decorations": "Veure les decoracions dels avatars" - "write:admin:federation": "Gestionar la federació d'instàncies " - "write:admin:account": "Gestionar els comptes d'usuaris " - "read:admin:account": "Veure els comptes d'usuaris " - "write:admin:emoji": "Edició d'emojis" - "read:admin:emoji": "Veure emojis" - "write:admin:queue": "Gestionar la cua de feines" - "read:admin:queue": "Veure la cua de feines" - "write:admin:promo": "Gestiona les notes promocionals" - "write:admin:drive": "Gestiona el disc de l'usuari" - "read:admin:drive": "Veure la informació del disc de l'usuari" - "read:admin:stream": "Fes servir l'API sobre Websocket per l'administració" - "write:admin:ad": "Gestiona la publicitat" - "read:admin:ad": "Veure anuncis" - "write:invite-codes": "Crear codis d'invitació" - "read:invite-codes": "Obtenir codis d'invitació" - "write:clip-favorite": "Gestionar els clips favorits" - "read:clip-favorite": "Veure clips favorits" - "read:federation": "Veure dades de federació" - "write:report-abuse": "Informar d'un abús" -_auth: - shareAccessTitle: "Concedeix permisos a l'aplicació" - shareAccess: "Vols que {name} pugui accedir al vostre compte?" - shareAccessAsk: "Segur que vols que aquesta aplicació pugui accedir al vostre compte?" - permission: "{name} demana els següents permisos" - permissionAsk: "Aquesta aplicació demana els següents permisos" - pleaseGoBack: "Si us plau, torna a l'aplicació" - callback: "Tornant a l'aplicació" - accepted: "Accés garantit" - denied: "Accés denegat" - scopeUser: "Opera com si fossis aquest usuari" - pleaseLogin: "Si us plau, identificat per autoritzar l'aplicació." - byClickingYouWillBeRedirectedToThisUrl: "Si es garanteix l'accés, seràs redirigit automàticament a la següent adreça URL" _antennaSources: all: "Totes les publicacions" homeTimeline: "Publicacions dels usuaris seguits" users: "Publicacions d'usuaris específics" userList: "Publicacions d'una llista d'usuaris" - userBlacklist: "Totes les notes excepte les d'un o alguns usuaris especificats" -_weekday: - sunday: "Diumenge" - monday: "Dilluns" - tuesday: "Dimarts" - wednesday: "Dimecres" - thursday: "Dijous" - friday: "Divendres" - saturday: "Dissabte" _widgets: profile: "Perfil" instanceInfo: "Informació del fitxer d'instal·lació" - memo: "Notes adhesives" notifications: "Notificacions" timeline: "Línia de temps" - calendar: "Calendari" - trends: "Tendència" - clock: "Rellotge" - rss: "Lector RSS" - rssTicker: "RSS ticker" activity: "Activitat" - photos: "Fotografies" - digitalClock: "Rellotge digital" - unixClock: "Rellotge UNIX" federation: "Federació" - instanceCloud: "Núvol d'instàncies" - postForm: "Formulari de publicació" - slideshow: "Presentació" - button: "Botó " - onlineUsers: "Usuaris actius" jobQueue: "Cua de tasques" - serverMetric: "Mètriques del servidor" - aiscript: "Consola AiScript" - aiscriptApp: "Aplicació AiScript" - aichan: "Ai" - userList: "Llistat d'usuaris" _userList: chooseList: "Tria una llista" - clicker: "Clicker" - birthdayFollowings: "Usuaris que fan l'aniversari avui" _cw: - hide: "Amagar" show: "Carregar més" - chars: "{count} caràcters " - files: "{count} fitxer(s)" -_poll: - noOnlyOneChoice: "Es necessita escollir dues opcions com a mínim " - choiceN: "Opció {n}" - noMore: "No pots afegir més opcions" - canMultipleVote: "Permetre escollir diferents opcions" - expiration: "Finalitza el" - infinite: "Mai" - at: "Finalitza en..." - after: "Finalitza després..." - deadlineDate: "Data de finalització " - deadlineTime: "Hor(a)(es)" - duration: "Duració " - votesCount: "{n} vots" - totalVotes: "{n} vots en total" - vote: "Votar en una enquesta" - showResult: "Veure resultats" - voted: "Has votat" - closed: "Finalitzada" - remainingDays: "Queden {d} dies i {h} hores per finalitzar" - remainingHours: "Queden {h} hores i {m} minuts" - remainingMinutes: "Queden {m} minuts i {s} segons" - remainingSeconds: "Queden {s} segons" _visibility: - public: "Públic " - publicDescription: "La teva nota la podrà veure tothom " home: "Inici" - homeDescription: "Publicar només a la línia de temps d'Inici " followers: "Seguidors" - followersDescription: "Fes només visible per als teus seguidors" - specified: "Directe" - specifiedDescription: "Fer visible només per alguns usuaris" - disableFederation: "Sense federar" - disableFederationDescription: "No enviar a altres servidors" -_postForm: - replyPlaceholder: "Contestar..." - quotePlaceholder: "Citar..." - channelPlaceholder: "Publicar a un canal..." - _placeholders: - a: "Que vols dir?..." - b: "Alguna cosa interessant al teu voltant?..." - c: "Què et passa pel cap?..." - d: "Què vols dir?..." - e: "Escriu alguna cosa..." - f: "Esperant que escriguis qualsevol cosa..." _profile: - name: "Nom" username: "Nom d'usuari" - description: "Biografia " - youCanIncludeHashtags: "Pots posar etiquetes a la teva biografia " - metadata: "Informació adicional " - metadataEdit: "Editar la informació adicional " - metadataDescription: "Amb això podràs mostrar camps d'informació adicional al teu perfil." - metadataLabel: "Etiqueta " - metadataContent: "Contingut" - changeAvatar: "Canviar l'avatar " - changeBanner: "Canviar el bàner " - verifiedLinkDescription: "Escrivint una adreça URL que enllaci a aquest perfil, una icona de propietat verificada es mostrarà al costat del camp." - avatarDecorationMax: "Pot afegir un màxim de {max} decoracions." - followedMessage: "Missatge als nous seguidors" - followedMessageDescription: "Es pot configurar un missatge curt que es mostra a l'altra persona quan comença a seguir-te." - followedMessageDescriptionForLockedAccount: "Si comencen a seguir-te es mostra un missatge de quan es permet aquesta sol·licitud. " _exportOrImport: allNotes: "Totes les publicacions" - favoritedNotes: "Notes preferides" - clips: "Retalls" followingList: "Seguint" muteList: "Silencia" blockingList: "Bloqueja" userLists: "Llistes" - excludeMutingUsers: "Exclou usuaris silenciats" - excludeInactiveUsers: "Exclou usuaris inactius" - withReplies: "Inclou a la línia de temps les respostes d'usuaris importats" _charts: federation: "Federació" - apRequest: "Peticions" - usersIncDec: "Diferència entre el nombre d'usuaris" - usersTotal: "Nombre total d'usuaris" - activeUsers: "Usuaris actius" - notesIncDec: "Diferència entre el nombre de notes" - localNotesIncDec: "Diferencia en el nombre de notes locals" - remoteNotesIncDec: "Diferencia en el nombre de notes remotes" - notesTotal: "Nombre total de notes" - filesIncDec: "Diferencia en el nombre de fitxers" - filesTotal: "Nombre total de fitxers" - storageUsageIncDec: "Diferencia en l'emmagatzematge usat" - storageUsageTotal: "Emmagatzematge usat" -_instanceCharts: - requests: "Peticions" - users: "Diferència entre el nombre d'usuaris" - usersTotal: "Usuaris totals acumulats" - notes: "Diferència entre el nombre de notes" - notesTotal: "Notes totals acumulades" - ff: "Diferència en nombre d'usuaris seguits / seguidors" - ffTotal: "Nombre total acumulat d'usuaris seguits / seguidors" - cacheSize: "Diferència a la mida de la memòria cau" - cacheSizeTotal: "Total acumulat de la mida de la memòria cau" - files: "Diferència al nombre d'arxius" - filesTotal: "Nombre acumulatiu de fitxers" _timelines: home: "Inici" local: "Local" social: "Social" global: "Global" _play: - new: "Crear un guió" - edit: "Editar guió" - created: "Guió creat" - updated: "Guió editat" - deleted: "Guió esborrat" - pageSetting: "Configuració del guió" - editThisPage: "Edita aquest guió" - viewSource: "Veure l'origen " - my: "Els meus guions" - liked: "Guions que m'han agradat" - featured: "Popular" - title: "Títol " - script: "Script" summary: "Descripció" - visibilityDescription: "" _pages: - newPage: "pa" - editPage: "Editar la pàgina" - readPage: "Veure el codi font d'aquesta pàgina" - created: "La pàgina ha sigut creada correctament" - updated: "La pàgina s'ha editat correctament" - deleted: "La pàgina s'ha esborrat sense problemes" - pageSetting: "Configuració de la pàgina" - nameAlreadyExists: "L'adreça URL de la pàgina ja existeix" - invalidNameTitle: "L'adreça URL de la pàgina no és vàlida" - invalidNameText: "Assegurat que el títol de la pàgina no és buit" - editThisPage: "Editar la pàgina" - viewSource: "Veure l'origen " - viewPage: "Veure les teves pàgines " - like: "M'agrada " - unlike: "Treure m'agrada " - my: "Les meves pàgines " - liked: "Pàgines que m'agraden " - featured: "Popular" - inspector: "Inspeccionar" contents: "Contingut" - content: "Bloquejar la pàgina " - variables: "Variables" - title: "Títol " - url: "URL de la pàgina " - summary: "Resum de la pàgina " - alignCenter: "Centrar elements" - hideTitleWhenPinned: "Amagar el títol de la pàgina quan estigui fixada al perfil" - font: "Lletra tipogràfica" - fontSerif: "Serif" - fontSansSerif: "Sans Serif" - eyeCatchingImageSet: "Escull una miniatura" - eyeCatchingImageRemove: "Esborrar la miniatura" - chooseBlock: "Afegeix un bloc" - enterSectionTitle: "Escriu el títol de la secció" - selectType: "Seleccionar tipus" - contentBlocks: "Contingut" - inputBlocks: "Entrada " - specialBlocks: "Especial" blocks: - text: "Text" - textarea: "Àrea de text" - section: "Secció " image: "Imatges" - button: "Botó " - dynamic: "Blocs dinàmics" - dynamicDescription: "Aquest bloc és antic. Ara en endavant fes servir {play}" - note: "Incorporar una Nota" _note: id: "ID de la publicació" - idDescription: "Alternativament pots enganxar l'adreça URL de la nota aquí." detailed: "Mostra els detalls" -_relayStatus: - requesting: "Pendent" - accepted: "Acceptat" - rejected: "Rebutjat" _notification: - fileUploaded: "Fitxer pujat sense cap problema" - youGotMention: "{name} t'ha mencionat" - youGotReply: "{name} t'ha contestat" - youGotQuote: "{name} t'ha citat" youRenoted: "Impulsat per {name}" youWereFollowed: "t'ha seguit" - youReceivedFollowRequest: "Has rebut una petició de seguiment" - yourFollowRequestAccepted: "La teva petició de seguiment ha sigut acceptada" - pollEnded: "Ja pots veure els resultats de l'enquesta " - newNote: "Nota nova" unreadAntennaNote: "Antena {name}" - roleAssigned: "Rol assignat " - emptyPushNotificationMessage: "Les notificacions han sigut actualitzades" - achievementEarned: "Aconseguiment desblocat" - testNotification: "Notificació de prova" - checkNotificationBehavior: "Comprova el comportament de la notificació " - sendTestNotification: "Enviar notificació de prova" - notificationWillBeDisplayedLikeThis: "Les notificacions és veure'n així " - reactedBySomeUsers: "Han reaccionat {n} usuaris" - likedBySomeUsers: "A {n} usuaris els hi agrada la teva nota" - renotedBySomeUsers: "L'han impulsat {n} usuaris" - followedBySomeUsers: "Et segueixen {n} usuaris" - flushNotification: "Netejar notificacions" - exportOfXCompleted: "Completada l'exportació de {x}" - login: "Algú ha iniciat sessió " _types: all: "Tots" - note: "Notes noves" follow: "Seguint" mention: "Menció" - reply: "Respostes" renote: "Renotar" quote: "Citar" reaction: "Reaccions" - pollEnded: "Enquesta terminada" - receiveFollowRequest: "Rebuda una petició de seguiment" - followRequestAccepted: "Petició de seguiment acceptada" - roleAssigned: "Rol donat" - achievementEarned: "Assoliment desbloquejat" - exportCompleted: "Exportació completada" - login: "Iniciar sessió" - test: "Prova la notificació" - app: "Notificacions d'aplicacions" _actions: followBack: "t'ha seguit també" reply: "Respondre" renote: "Renotar" _deck: - alwaysShowMainColumn: "Mostrar sempre la columna principal" columnAlign: "Alinea les columnes" addColumn: "Afig una columna" - newNoteNotificationSettings: "Configuració de notificacions per a notes noves" - configureColumn: "Configuració de columnes" swapLeft: "Mou a l’esquerra" swapRight: "Mou a la dreta" swapUp: "Mou cap amunt" swapDown: "Mou cap avall" - stackLeft: "Pila a la columna esquerra" popRight: "Col·loca a la dreta" profile: "Perfil" newProfile: "Perfil nou" deleteProfile: "Elimina el perfil" - introduction: "Crea la interfície perfecta posant les columnes allà on vulguis!" - introduction2: "Fes clic al botó + de la dreta per afegir noves columnes sempre que vulguis." - widgetsIntroduction: "Selecciona \"Editar ginys\" a la columna del menú i afegeix un." - useSimpleUiForNonRootPages: "Usa una interfície senzilla per a les pàgines navegades" - usedAsMinWidthWhenFlexible: "L'amplada mínima es farà servir quan \"Ajust automàtic de l'amplada\" estigui activat" - flexible: "Ajust automàtic de l'amplada" _columns: main: "Principal" widgets: "Ginys" @@ -2481,259 +645,8 @@ _deck: tl: "Línia de temps" antenna: "Antena" list: "Llistes" - channel: "Canals" mentions: "Mencions" direct: "Publicacions directes" - roleTimeline: "Línia de temps dels rols" -_dialog: - charactersExceeded: "Has arribat al màxim de caràcters! Actualment és {current} de {max}" - charactersBelow: "Ets per sota del mínim de caràcters! Actualment és {current} de {min}" -_disabledTimeline: - title: "Línia de tems desactivada" - description: "No pots fer servir aquesta línia de temps amb els teus rols actuals." -_drivecleaner: - orderBySizeDesc: "Mida del fitxer descendent" - orderByCreatedAtAsc: "Data ascendent" -_webhookSettings: - createWebhook: "Crear un Webhook" - modifyWebhook: "Modificar un Webhook" - name: "Nom" - secret: "Secret" - trigger: "Activador" - active: "Activat" - _events: - follow: "Quan se segueix a un usuari" - followed: "Quan et segueixen" - note: "Quan es publica una nota" - reply: "Quan es rep una resposta" - renote: "Quan es renoti" - reaction: "Quan es rep una reacció " - mention: "Quan et mencionen" - _systemEvents: - abuseReport: "Quan reps un nou informe de moderació " - abuseReportResolved: "Quan resols un informe de moderació " - userCreated: "Quan es crea un usuari" - inactiveModeratorsWarning: "Quan el compte d'un moderador no té activitat durant un temps" - inactiveModeratorsInvitationOnlyChanged: "Quan el compte d'un moderador no té activitat durant un temps, i el servidor es canvia a registre per invitacions" - deleteConfirm: "Segur que vols esborrar el webhook?" - testRemarks: "Si feu clic al botó a la dreta de l'interruptor, podeu enviar un webhook de prova amb dades dummy." -_abuseReport: - _notificationRecipient: - createRecipient: "Afegeix un destinatari a l'informe de moderació " - modifyRecipient: "Editar un destinatari en l'informe de moderació " - recipientType: "Tipus de notificació " - _recipientType: - mail: "Correu electrònic" - webhook: "Webhook" - _captions: - mail: "Enviar un correu electrònic a tots els moderadors quan es rep un informe de moderació " - webhook: "Enviar una notificació al SystemWebhook quan es rebi o es resolgui un informe de moderació " - keywords: "Paraules clau" - notifiedUser: "Usuaris que s'han de notificar " - notifiedWebhook: "Webhook que s'ha de fer servir" - deleteConfirm: "Segur que vols esborrar el destinatari de l'informe de moderació?" _moderationLogTypes: - createRole: "Rol creat" - deleteRole: "Rol esborrat" - updateRole: "Rol actualitzat" - assignRole: "Assignat al rol" - unassignRole: "Esborrat del rol" suspend: "Suspèn" - unsuspend: "Suspensió treta" - addCustomEmoji: "Afegit emoji personalitzat" - updateCustomEmoji: "Actualitzat emoji personalitzat" - deleteCustomEmoji: "Esborrat emoji personalitzat" - updateServerSettings: "Configuració del servidor actualitzada" - updateUserNote: "Nota de moderació actualitzada" - deleteDriveFile: "Fitxer esborrat" - deleteNote: "Nota esborrada" - createGlobalAnnouncement: "Anunci global creat" - createUserAnnouncement: "Anunci individual creat" - updateGlobalAnnouncement: "Anunci global actualitzat" - updateUserAnnouncement: "Anunci individual actualitzat " - deleteGlobalAnnouncement: "Anunci global esborrat" - deleteUserAnnouncement: "Anunci individual esborrat " resetPassword: "Restableix la contrasenya" - suspendRemoteInstance: "Servidor remot suspès " - unsuspendRemoteInstance: "S'ha tret la suspensió del servidor remot" - updateRemoteInstanceNote: "Nota de moderació de la instància remota actualitzada" - markSensitiveDriveFile: "Fitxer marcat com a sensible" - unmarkSensitiveDriveFile: "S'ha tret la marca de sensible del fitxer" - resolveAbuseReport: "Informe resolt" - forwardAbuseReport: "Informe reenviat" - updateAbuseReportNote: "Nota de moderació d'un informe actualitzat" - createInvitation: "Crear codi d'invitació " - createAd: "Anunci creat" - deleteAd: "Anunci esborrat" - updateAd: "Anunci actualitzat" - createAvatarDecoration: "Decoració de l'avatar creada" - updateAvatarDecoration: "S'ha actualitzat la decoració de l'avatar " - deleteAvatarDecoration: "S'ha esborrat la decoració de l'avatar " - unsetUserAvatar: "Esborrar l'avatar d'aquest usuari" - unsetUserBanner: "Esborrar el bàner d'aquest usuari" - createSystemWebhook: "Crear un SystemWebhook" - updateSystemWebhook: "Actualitzar SystemWebhook" - deleteSystemWebhook: "Esborrar SystemWebhook" - createAbuseReportNotificationRecipient: "Crear un destinatari per l'informe de moderació " - updateAbuseReportNotificationRecipient: "Actualitzar destinatari per l'informe de moderació " - deleteAbuseReportNotificationRecipient: "Esborrar destinatari de l'informe de moderació " - deleteAccount: "Esborrar el compte " - deletePage: "Esborrar la pàgina" - deleteFlash: "Esborrar el guió" - deleteGalleryPost: "Esborrar la publicació de la galeria" -_fileViewer: - title: "Detall del fitxer" - type: "Tipus de fitxer" - size: "Mida" - url: "URL" - uploadedAt: "Pujat el" - attachedNotes: "Notes amb aquest fitxer" - thisPageCanBeSeenFromTheAuthor: "Aquesta pàgina només la pot veure l'usuari que ha pujat aquest fitxer." -_externalResourceInstaller: - title: "Instal·lar des d'un lloc extern" - checkVendorBeforeInstall: "Assegura't que qui distribueix aquest recurs és fiable abans d'instal·lar-ho." - _plugin: - title: "Vols instal·lar aquest afegit?" - metaTitle: "Informació de l'afegit " - _theme: - title: "Vols instal·lar aquest tema?" - metaTitle: "Informació del tema" - _meta: - base: "Paleta de colors base" - _vendorInfo: - title: "Informació del distribuïdor " - endpoint: "Punt final referenciat" - hashVerify: "Verificació d'integritat " - _errors: - _invalidParams: - title: "Paràmetres no vàlids " - description: "No hi ha suficient informació per carregar les dades del lloc extern. Confirma l'URL que hi ha escrita." - _resourceTypeNotSupported: - title: "El recurs extern no està suportat." - description: "Aquesta mena de recurs no està suportat. Contacta amb l'administrador." - _failedToFetch: - title: "Ha fallat l'obtenció de dades" - fetchErrorDescription: "Ha aparegut un error comunicant-se amb el lloc extern. Si després d'intentar-ho un altre cop no es resol, contacta amb l'administrador." - parseErrorDescription: "Ha aparegut un error processant les dades carregades del lloc extern. Contacta amb l'administrador." - _hashUnmatched: - title: "Ha fallat la verificació de les dades" - description: "Ha aparegut un error verificant les dades obtingudes. Com a mesura de seguretat la instal·lació no pot continuar. Contacta amb l'administrador." - _pluginParseFailed: - title: "Error d'AiScript" - description: "Les dades sol·licitades s'han obtingut correctament, però hem trobat un error durant el processament d'AiScript. Contacta amb l'autor de l'afegit. Detalls de l'error es pot veure a la consola JavaScript." - _pluginInstallFailed: - title: "La instal·lació de l'afegit a fallat" - description: "Ha aparegut un error durant la instal·lació de l'afegit. Intenta-ho una altra vegada. El detall de l'error es pot veure a la consola JavaScript." - _themeParseFailed: - title: "Ha fallat el processament del tema" - description: "Les dades sol·licitades s'han obtingut correctament, però hem trobat un error durant el processament del tema. Contacta amb l'autor de l'afegit. Detalls de l'error es pot veure a la consola JavaScript." - _themeInstallFailed: - title: "La instal·lació del tema a fallat" - description: "Ha aparegut un error durant la instal·lació del tema. Intenta-ho una altra vegada. El detall de l'error es pot veure a la consola JavaScript." -_dataSaver: - _media: - title: "Carregant multimèdia " - description: "Desactiva la càrrega automàtica d'imatges i vídeos. Les imatges i els vídeos amagats es carregaran quan es faci clic a sobre." - _avatar: - title: "Avatars animats" - description: "Detenir l'animació dels avatars animats. Les imatges animades solen tenir un pes més gran que les imatges normals, reduint el tràfic disponible." - _urlPreview: - title: "Miniatures vista prèvia de l'URL" - description: "Les imatges en miniatura que serveixen com a vista prèvia de les URLs no es tornaran a carregar." - _code: - title: "Ressaltat del codi " - description: "Quan s'utilitza codi MFM, no es llegeix fins que es copiï. En els punts destacats del codi s'han de llegir els fitxers definits per a cada llengua que resulti alt, però no es poden llegir automàticament, per la qual cosa es poden reduir les quantitats de comunicació." -_hemisphere: - N: "Hemisferi Nord " - S: "Hemisferi Sud" - caption: "El fan servir alguns clients per determinar l'estació de l'any." -_reversi: - reversi: "Reversi" - gameSettings: "Opcions del joc" - chooseBoard: "Escull un taulell" - blackOrWhite: "Negres/Blanques" - blackIs: "{name} juga amb negres " - rules: "Regles" - thisGameIsStartedSoon: "El joc començarà en breu" - waitingForOther: "Esperant la tirada de l'oponent " - waitingForMe: "Esperant el teu torn" - waitingBoth: "Prepara't " - ready: "Preparat " - cancelReady: " No preparat " - opponentTurn: "Torn de l'oponent " - myTurn: "El teu torn" - turnOf: "Li toca a {name}" - pastTurnOf: "Torn de {name}" - surrender: "Rendeix-te" - surrendered: "T'has rendit" - timeout: "Temps esgotat" - drawn: "Empat" - won: "{name} ha guanyat" - black: "Negres" - white: "Blanques" - total: "Total" - turnCount: "Torn {count}" - myGames: "Jugades" - allGames: "Totes les jugades" - ended: "Acabat" - playing: "Jugant" - isLlotheo: "Qui tingui menys pedres guanya (Llotheo)" - loopedMap: "Mapa de recursiu" - canPutEverywhere: "Les fitxes es poden posar a qualsevol lloc" - timeLimitForEachTurn: "Temps límit per jugada" - freeMatch: "Partida lliure" - lookingForPlayer: "Buscant contrincant..." - gameCanceled: "La partida s'ha cancel·lat " - shareToTlTheGameWhenStart: "Compartir la partida a la línia de temps quan comenci" - iStartedAGame: "La partida ha començat! #MisskeyReversi" - opponentHasSettingsChanged: "L'oponent h canviat la seva configuració " - allowIrregularRules: "Regles irregulars (totalment lliure)" - disallowIrregularRules: "Sense regles irregulars" - showBoardLabels: "Mostrar el número de línia i columna al tauler de joc" - useAvatarAsStone: "Fer servir els avatars dels usuaris com a fitxes" -_offlineScreen: - title: "Fora de línia - No es pot connectar amb el servidor" - header: "Impossible connectar amb el servidor" -_urlPreviewSetting: - title: "Configuració per a la previsualització de l'URL" - enable: "Activa la previsualització de l'URL" - timeout: "Temps màxim per carregar la previsualització de l'URL (ms)" - timeoutDescription: "Si l'obtenció de la previsualització triga més que el temps establert, no es generarà la vista prèvia." - maximumContentLength: "Longitud màxima del contingut (bytes)" - maximumContentLengthDescription: "Si la màxima longitud és més gran que aquest valor, la previsualització no es generarà." - requireContentLength: "Generar la previsualització només si es pot obtenir la longitud màxima " - requireContentLengthDescription: "Si l'altre servidor no proporciona la longitud màxima, la previsualització no es generarà." - userAgent: "User-Agent" - userAgentDescription: "Estableix l'User-Agent que és farà servir per a la recuperació de la vista prèvia. Si és deixa en blanc es farà servir l'User-Agent per defecte." - summaryProxy: "Proxy endpoints per generar vistes prèvies" - summaryProxyDescription: "La vista prèvia es genera fent servir Summaly proxy, no la genera el mateix Misskey." - summaryProxyDescription2: "Els següents paràmetres són passats al proxy com cadenes de consulta. Si el proxy no els admet, s'ignoren els valors configurats." -_mediaControls: - pip: "Imatge sobre impressionada " - playbackRate: "Velocitat de reproducció " - loop: "Reproducció en bucle" -_contextMenu: - title: "Menú contextual" - app: "Aplicació " - appWithShift: "Aplicació amb la tecla shift" - native: "Interfície del navegador" -_embedCodeGen: - title: "Personalitza el codi per incrustar" - header: "Mostrar la capçalera" - autoload: "Carregar automàticament (no recomanat)" - maxHeight: "Alçada màxima" - maxHeightDescription: "0 anul·la la configuració màxima. Per evitar que continuï creixent verticalment, especifiqui qualsevol valor." - maxHeightWarn: "El límit màxim d'alçada és nul (0). Si això no és un canvi previst, estableix el màxim d'alçada a un cert valor." - previewIsNotActual: "La visualització és diferent de la que es mostra quan s'implanta." - rounded: "Angle recte" - border: "Afegeix un marc al contenidor" - applyToPreview: "Aplica a la vista prèvia" - generateCode: "Crea el codi per incrustar" - codeGenerated: "Codi generat" - codeGeneratedDescription: "Si us plau, enganxeu el codi generat al lloc web." -_selfXssPrevention: - warning: "Advertència " - title: "\"Enganxa qualsevol cosa en aquesta finestra\" És tot un engany." - description1: "Si posa alguna cosa al seu compte, un usuari malintencionat podria segrestar-la o robar-li les dades." - description2: "Si no entens que estàs fent %cpara ara mateix i tanca la finestra." - description3: "Per obtenir més informació. {link}" diff --git a/locales/cs-CZ.yml b/locales/cs-CZ.yml index caf6d6e163..1e064c4911 100644 --- a/locales/cs-CZ.yml +++ b/locales/cs-CZ.yml @@ -366,8 +366,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Aktivovat hCaptchu" hcaptchaSiteKey: "Klíč stránky" hcaptchaSecretKey: "Tajný Klíč (Secret Key)" -mcaptchaSiteKey: "Klíč stránky" -mcaptchaSecretKey: "Tajný Klíč (Secret Key)" recaptcha: "reCAPTCHA" enableRecaptcha: "Zapnout ReCAPTCHu" recaptchaSiteKey: "Klíč stránky" @@ -471,6 +469,7 @@ uiLanguage: "Jazyk uživatelského rozhraní" aboutX: "O {x}" emojiStyle: "Styl emoji" native: "Výchozí" +disableDrawer: "Nepoužívat šuplíkové menu" showNoteActionsOnlyHover: "Zobrazit akce poznámky jenom při naběhnutí myši" noHistory: "Žádná historie" signinHistory: "Historie přihlášení" @@ -657,7 +656,10 @@ abuseReported: "Nahlášení bylo odesláno. Děkujeme převelice." 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" @@ -1001,7 +1003,6 @@ 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." -prohibitedWordsDescription2: "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?" @@ -1091,14 +1092,7 @@ iHaveReadXCarefullyAndAgree: "Přečetl jsem si text \"{x}\" a souhlasím s ním icon: "Avatar" replies: "Odpovědět" renotes: "Přeposlat" -sourceCode: "Zdrojový kód" flip: "Otočit" -lastNDays: "Posledních {n} dnů" -surrender: "Zrušit" -_delivery: - stop: "Suspendováno" - _type: - none: "Publikuji" _initialAccountSetting: accountCreated: "Váš účet byl úspěšně vytvořen!" letsStartAccountSetup: "Pro začátek si nastavte svůj profil." @@ -1629,6 +1623,7 @@ _theme: 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" @@ -1640,6 +1635,8 @@ _sfx: note: "Poznámky" noteMy: "Moje poznámka" notification: "Oznámení" + antenna: "Antény" + channel: "Oznámení kanálu" _ago: future: "Budoucí" justNow: "Teď" @@ -1661,6 +1658,7 @@ _2fa: 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." @@ -1714,7 +1712,7 @@ _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: "{name} požaduje tato oprávnění" + 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" @@ -1827,7 +1825,6 @@ _profile: _exportOrImport: allNotes: "Všechny poznámky" favoritedNotes: "Oblíbené poznámky" - clips: "Oříznout" followingList: "Sledovaní" muteList: "Ztlumit" blockingList: "Zablokovat" @@ -1938,7 +1935,7 @@ _notification: youGotMention: "{name} vás zmínil" youGotReply: "{name} vám odpověděl" youGotQuote: "{name} vás citoval" - youRenoted: "Poznámka od {name}" + 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" @@ -1958,7 +1955,6 @@ _notification: receiveFollowRequest: "Obdržené žádosti o sledování" followRequestAccepted: "Přijaté žádosti o sledování" achievementEarned: "Úspěch odemčen" - login: "Přihlásit se" app: "Oznámení z propojených aplikací" _actions: followBack: "vás začal sledovat zpět" @@ -2006,6 +2002,7 @@ _webhookSettings: createWebhook: "Vytvořit Webhook" name: "Jméno" secret: "Tajné" + events: "Události Webhook" active: "Zapnuto" _events: follow: "Při sledování uživatele" @@ -2015,13 +2012,7 @@ _webhookSettings: renote: "Při renotaci poznámky" reaction: "Při obdržení reakce" mention: "Při zmínce" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "Email" _moderationLogTypes: suspend: "Zmrazit" resetPassword: "Resetovat heslo" createInvitation: "Vygenerovat pozvánku" -_reversi: - total: "Celkem" diff --git a/locales/da-DK.yml b/locales/da-DK.yml index 5eb7a5a5f4..08c15ed092 100644 --- a/locales/da-DK.yml +++ b/locales/da-DK.yml @@ -1,4 +1,2 @@ --- _lang_: "Dansk" -headlineMisskey: "" -introMisskey: "ようこそ!Misskeyは、オープンソースの分散型マイクロブログサービスです。\n「ノート」を作成して、いま起こっていることを共有したり、あなたについて皆に発信しよう📡\n「リアクション」機能で、皆のノートに素早く反応を追加することもできます👍\n新しい世界を探検しよう🚀" diff --git a/locales/de-DE.yml b/locales/de-DE.yml index 4e2bd06934..4c32b3dda4 100644 --- a/locales/de-DE.yml +++ b/locales/de-DE.yml @@ -121,15 +121,9 @@ sensitive: "Sensibel" add: "Hinzufügen" reaction: "Reaktionen" reactions: "Reaktionen" -emojiPicker: "Emoji auswählen" -pinnedEmojisForReactionSettingDescription: "Lege Emojis fest, die angepinnt werden sollen, um sie beim Reagieren als Erstes anzuzeigen." -pinnedEmojisSettingDescription: "Lege Emojis fest, die angepinnt werden sollen, um sie in der Emoji-Auswahl als Erstes anzuzeigen" -overwriteFromPinnedEmojisForReaction: "Überschreiben mit den Reaktions-Einstellungen" -overwriteFromPinnedEmojis: "Überschreiben mit den allgemeinen Einstellungen" reactionSettingDescription2: "Ziehe um Anzuordnen, klicke um zu löschen, drücke „+“ um hinzuzufügen" rememberNoteVisibility: "Notizsichtbarkeit merken" attachCancel: "Anhang entfernen" -deleteFile: "Datei gelöscht" markAsSensitive: "Als sensibel markieren" unmarkAsSensitive: "Als nicht sensibel markieren" enterFileName: "Dateinamen eingeben" @@ -184,7 +178,7 @@ searchWith: "Suchen: {q}" youHaveNoLists: "Du hast keine Listen" followConfirm: "Möchtest du {name} wirklich folgen?" proxyAccount: "Proxy-Benutzerkonto" -proxyAccountDescription: "Ein Proxy-Konto ist ein Benutzerkonto, das unter bestimmten Bedingungen als Follower für Benutzer fremder Instanzen fungiert. Wenn zum Beispiel ein Benutzer einen Benutzer einer fremden Instanz zu einer Liste hinzufügt, werden die Aktivitäten des entfernten Benutzers nicht an die Instanz übermittelt, wenn kein lokaler Benutzer diesem Benutzer folgt; stattdessen folgt das Proxy-Konto." +proxyAccountDescription: "Ein Proxy-Benutzerkonto ist ein Benutzerkonto, das sich für Nutzer unter bestimmten Konditionen wie ein Follower aus einer fremden Instanz verhält. Zum Beispiel wird die Aktivität eines Nutzers aus einer fremden Instanz nicht an diese Instanz übermittelt, falls es keinen Benutzer dieser Instanz gibt, der diesem Nutzer aus fremder Instanz folgt. In diesem Fall folgt stattdessen das Proxy-Benutzerkonto." host: "Hostname" selectUser: "Benutzer auswählen" recipient: "Empfänger" @@ -266,7 +260,6 @@ removed: "Erfolgreich gelöscht" removeAreYouSure: "Möchtest du „{x}“ wirklich entfernen?" deleteAreYouSure: "Möchtest du „{x}“ wirklich löschen?" resetAreYouSure: "Wirklich zurücksetzen?" -areYouSure: "Bist du sicher?" saved: "Erfolgreich gespeichert" messaging: "Chat" upload: "Hochladen" @@ -361,7 +354,7 @@ enableLocalTimeline: "Lokale Chronik aktivieren" enableGlobalTimeline: "Globale Chronik aktivieren" disablingTimelinesInfo: "Administratoren und Moderatoren haben immer Zugriff auf alle Chroniken, auch wenn diese deaktiviert sind." registration: "Registrieren" -enableRegistration: "Registrierung neuer Benutzer erlauben" +enableRegistration: "Registration neuer Benutzer erlauben" invite: "Einladen" driveCapacityPerLocalAccount: "Drive-Kapazität pro lokalem Benutzerkonto" driveCapacityPerRemoteAccount: "Drive-Kapazität pro Benutzer fremder Instanzen" @@ -379,11 +372,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "hCaptcha aktivieren" hcaptchaSiteKey: "Site key" hcaptchaSecretKey: "Secret key" -mcaptcha: "mCaptcha" -enableMcaptcha: "mCaptcha aktivieren" -mcaptchaSiteKey: "Site key" -mcaptchaSecretKey: "Secret key" -mcaptchaInstanceUrl: "mCaptcha Instanz-URL" recaptcha: "reCAPTCHA" enableRecaptcha: "reCAPTCHA aktivieren" recaptchaSiteKey: "Site key" @@ -441,7 +429,7 @@ lastUsed: "Zuletzt benutzt" lastUsedAt: "Zuletzt verwendet: {t}" unregister: "Deaktivieren" passwordLessLogin: "Passwortloses Anmelden" -passwordLessLoginDescription: "Ermöglicht passwortloses Einloggen mit einem Security-Token oder Passkey" +passwordLessLoginDescription: "Ermöglicht passwortfreies Einloggen, nur via Security-Token oder Passkey" resetPassword: "Passwort zurücksetzen" newPasswordIs: "Das neue Passwort ist „{password}“" reduceUiAnimation: "Animationen der Benutzeroberfläche reduzieren" @@ -491,6 +479,7 @@ uiLanguage: "Sprache der Benutzeroberfläche" aboutX: "Über {x}" emojiStyle: "Emoji-Stil" native: "Nativ" +disableDrawer: "Keine ausfahrbaren Menüs verwenden" showNoteActionsOnlyHover: "Notizmenü nur bei Mouseover anzeigen" noHistory: "Kein Verlauf gefunden" signinHistory: "Anmeldungsverlauf" @@ -630,7 +619,6 @@ medium: "Mittel" small: "Klein" generateAccessToken: "Zugriffstoken generieren" permission: "Berechtigungen" -adminPermission: "Administratorberechtigung" enableAll: "Alle aktivieren" disableAll: "Alle deaktivieren" tokenRequested: "Zugriff zum Benutzerkonto gewähren" @@ -653,7 +641,7 @@ smtpSecureInfo: "Schalte dies aus, falls du STARTTLS verwendest." testEmail: "Emailversand testen" wordMute: "Wortstummschaltung" regexpError: "Fehler in einem regulären Ausdruck" -regexpErrorDescription: "Im regulären Ausdruck deiner in Zeile {line} von {tab}en Wortstummschaltungen ist ein Fehler aufgetreten:" +regexpErrorDescription: "Im regulären Ausdruck deiner {tab}en Wortstummschaltungen ist ein Fehler aufgetreten:" instanceMute: "Instanzstummschaltungen" userSaysSomething: "{name} hat etwas gesagt" makeActive: "Aktivieren" @@ -686,7 +674,10 @@ abuseReported: "Deine Meldung wurde versendet. Vielen Dank." reporter: "Melder" reporteeOrigin: "Herkunft des Gemeldeten" reporterOrigin: "Herkunft des Meldenden" +forwardReport: "Meldung an fremde Instanz weiterleiten" +forwardReportIsAnonymous: "Anstatt deines Benutzerkontos wird bei der fremden Instanz ein anonymes Systemkonto als Melder angezeigt." send: "Senden" +abuseMarkAsResolved: "Meldung als gelöst markieren" openInNewTab: "In neuem Tab öffnen" openInSideView: "In Seitenansicht öffnen" defaultNavigationBehaviour: "Standardnavigationsverhalten" @@ -1032,7 +1023,6 @@ resetPasswordConfirm: "Wirklich Passwort zurücksetzen?" sensitiveWords: "Sensible Wörter" sensitiveWordsDescription: "Die Notizsichtbarkeit aller Notizen, die diese Wörter enthalten, wird automatisch auf \"Startseite\" gesetzt. Durch Zeilenumbrüche können mehrere konfiguriert werden." sensitiveWordsDescription2: "Durch die Verwendung von Leerzeichen können AND-Verknüpfungen angegeben werden und durch das Umgeben von Schrägstrichen können reguläre Ausdrücke verwendet werden." -prohibitedWordsDescription2: "Durch die Verwendung von Leerzeichen können AND-Verknüpfungen angegeben werden und durch das Umgeben von Schrägstrichen können reguläre Ausdrücke verwendet werden." hiddenTags: "Ausgeblendete Hashtags" hiddenTagsDescription: "Die hier eingestellten Tags werden nicht mehr in den Trends angezeigt. Mit der Umschalttaste können mehrere ausgewählt werden." notesSearchNotAvailable: "Die Notizsuche ist nicht verfügbar." @@ -1154,7 +1144,6 @@ hideRepliesToOthersInTimelineAll: "Antworten von allen momentan gefolgten Benutz confirmShowRepliesAll: "Dies ist eine unwiderrufliche Aktion. Wirklich Antworten von allen momentan gefolgten Benutzern in der Chronik anzeigen?" confirmHideRepliesAll: "Dies ist eine unwiderrufliche Aktion. Wirklich Antworten von allen momentan gefolgten Benutzern nicht in der Chronik anzeigen?" externalServices: "Externe Dienste" -sourceCode: "Quellcode" impressum: "Impressum" impressumUrl: "Impressums-URL" impressumDescription: "In manchen Ländern, wie Deutschland und dessen Umgebung, ist die Angabe von Betreiberinformationen (ein Impressum) bei kommerziellem Betrieb zwingend." @@ -1176,15 +1165,6 @@ signupPendingError: "Beim Überprüfen der Mailadresse ist etwas schiefgelaufen. cwNotationRequired: "Ist \"Inhaltswarnung verwenden\" aktiviert, muss eine Beschreibung gegeben werden." doReaction: "Reagieren" code: "Code" -decorate: "Dekorieren" -addMfmFunction: "MFM hinzufügen" -sfx: "Soundeffekte" -lastNDays: "Letzten {n} Tage" -surrender: "Abbrechen" -_delivery: - stop: "Gesperrt" - _type: - none: "Wird veröffentlicht" _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." @@ -1194,7 +1174,6 @@ _announcement: 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." - shouldNotBeUsedToPresentPermanentInfo: "Es wird empfohlen, Ankündigungen für aktuelle und zeitlich begrenzte Neuigkeiten zu nutzen, statt für Informationen, die langfristig relevant sind." dialogAnnouncementUxWarn: "Bei der Verwendung von mehr als zwei Meldungen im Dialog-Format wird um Vorsicht geboten, da dies negative Auswirkungen auf die UX haben kann." silence: "Keine Benachrichtigung" silenceDescription: "Wenn aktiviert, gibt diese Meldung keine Nachricht aus und muss nicht als \"gelesen\" markiert werden." @@ -1224,24 +1203,6 @@ _initialTutorial: description: "Hier kannst du sehen, wie Misskey funktioniert" _note: title: "Was sind Notizen?" - description: "Beiträge auf Misskey heißen \"Notizen\". Notizen werden chronologisch in der Chronik angeordnet und in Echtzeit aktualisiert." - reply: "Klicke auf diesen Button, um auf eine Nachricht zu antworten. Es ist auch möglich, auf Antworten zu antworten und die Unterhaltung wie einen Thread fortzusetzen." - _reaction: - title: "Was sind Reaktionen?" - reactToContinue: "Füge eine Reaktion hinzu, um fortzufahren." - reactNotification: "Du erhältst Echtzeit-Benachrichtigungen, wenn jemand auf deine Notiz reagiert." - _postNote: - _visibility: - description: "Du kannst einschränken, wer deine Notiz sehen kann." - public: "Deine Notiz wird für alle Nutzer sichtbar sein." - doNotSendConfidencialOnDirect1: "Sei vorsichtig, wenn du sensible Informationen verschickst!" - _cw: - title: "Inhaltswarnung" - _done: - title: "Du hast das Tutorial abgeschlossen! 🎉" -_timelineDescription: - local: "In der lokalen Chronik siehst du Notizen von allen Benutzern auf diesem Server." - global: "In der globalen Chronik siehst du Notizen von allen föderierten Servern." _serverRules: description: "Eine Reihe von Regeln, die vor der Registrierung angezeigt werden. Eine Zusammenfassung der Nutzungsbedingungen anzuzeigen ist empfohlen." _serverSettings: @@ -1254,8 +1215,6 @@ _serverSettings: shortName: "Abkürzung" shortNameDescription: "Ein Kürzel für den Namen der Instanz, der angezeigt werden kann, falls der volle Instanzname lang ist." fanoutTimelineDescription: "Ist diese Option aktiviert, kann eine erhebliche Verbesserung im Abrufen von Chroniken und eine Reduzierung der Datenbankbelastung erzielt werden, im Gegenzug zu einer Steigerung in der Speichernutzung von Redis. Bei geringem Serverspeicher oder Serverinstabilität kann diese Option deaktiviert werden." - fanoutTimelineDbFallback: "Auf die Datenbank zurückfallen" - fanoutTimelineDbFallbackDescription: "Ist diese Option aktiviert, wird die Chronik auf zusätzliche Abfragen in der Datenbank zurückgreifen, wenn sich die Chronik nicht im Cache befindet. Eine Deaktivierung führt zu geringerer Serverlast, aber schränkt den Zeitraum der abrufbaren Chronik ein. " _accountMigration: moveFrom: "Von einem anderen Konto zu diesem migrieren" moveFromSub: "Alias für ein anderes Konto erstellen" @@ -1513,8 +1472,6 @@ _achievements: _smashTestNotificationButton: title: "Testüberfluss" description: "Betätige den Benachrichtigungstest mehrfach innerhalb einer extrem kurzen Zeitspanne" - _tutorialCompleted: - description: "Tutorial abgeschlossen" _role: new: "Rolle erstellen" edit: "Rolle bearbeiten" @@ -1525,9 +1482,7 @@ _role: assignTarget: "Zuweisungsart" descriptionOfAssignTarget: "Manuell bedeutet, dass die Liste der Benutzer einer Rolle manuell verwaltet wird.\nKonditional bedeutet, dass die Liste der Benutzer einer Rolle durch eine Bedingung automatisch verwaltet wird." manual: "Manuell" - manualRoles: "Manuelle Rollen" conditional: "Konditional" - conditionalRoles: "Bedingte Rolle" condition: "Bedingung" isConditionalRole: "Dies ist eine konditionale Rolle." isPublic: "Öffentliche Rolle" @@ -1569,14 +1524,13 @@ _role: webhookMax: "Maximale Anzahl an Webhooks" clipMax: "Maximale Anzahl an Clips" noteEachClipsMax: "Maximale Anzahl an Notizen innerhalb eines Clips" - userListMax: "Maximale Anzahl an Benutzerlisten" - userEachUserListsMax: "Maximale Anzahl an Benutzern in einer Benutzerliste" + userListMax: "Maximale Anzahl an Benutzern in einer Benutzerliste" + userEachUserListsMax: "Maximale Anzahl an Benutzerlisten" rateLimitFactor: "Versuchsanzahl" descriptionOfRateLimitFactor: "Je niedriger desto weniger restriktiv, je höher destro restriktiver." canHideAds: "Kann Werbung ausblenden" canSearchNotes: "Nutzung der Notizsuchfunktion" canUseTranslator: "Verwendung des Übersetzers" - avatarDecorationLimit: "Maximale Anzahl an Profilbilddekorationen, die angebracht werden können" _condition: isLocal: "Lokaler Benutzer" isRemote: "Benutzer fremder Instanz" @@ -1605,7 +1559,6 @@ _emailUnavailable: disposable: "Wegwerf-Email-Adressen können nicht verwendet werden" mx: "Dieser Email-Server ist ungültig" smtp: "Dieser Email-Server antwortet nicht" - banned: "Du kannst dich mit dieser E-Mail-Adresse nicht registrieren" _ffVisibility: public: "Öffentlich" followers: "Nur für Follower sichtbar" @@ -1784,6 +1737,7 @@ _theme: buttonBg: "Hintergrund von Schaltflächen" buttonHoverBg: "Hintergrund von Schaltflächen (Mouseover)" inputBorder: "Rahmen von Eingabefeldern" + listItemHoverBg: "Hintergrund von Listeneinträgen (Mouseover)" driveFolderBg: "Hintergrund von Drive-Ordnern" wallpaperOverlay: "Hintergrundbild-Overlay" badge: "Wappen" @@ -1795,6 +1749,8 @@ _sfx: note: "Notizen" noteMy: "Meine Notizen" notification: "Benachrichtigungen" + antenna: "Antennen" + channel: "Kanalbenachrichtigung" _ago: future: "Zukunft" justNow: "Gerade eben" @@ -1816,6 +1772,7 @@ _2fa: registerTOTP: "Authentifizierungs-App registrieren" 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." step2Uri: "Nutzt du ein Desktopprogramm, gib folgende URI eingeben" step3Title: "Authentifizierungsscode eingeben" step3: "Gib zum Abschluss den Code (Token) ein, der von deiner App angezeigt wird." @@ -1930,7 +1887,6 @@ _widgets: _userList: chooseList: "Liste auswählen" clicker: "Klickzähler" - birthdayFollowings: "Nutzer, die heute Geburtstag haben" _cw: hide: "Inhalt verbergen" show: "Inhalt anzeigen" @@ -1996,7 +1952,6 @@ _profile: _exportOrImport: allNotes: "Alle Notizen" favoritedNotes: "Als Favorit markierte Notizen" - clips: "Clip erstellen" followingList: "Gefolgte Benutzer" muteList: "Stummschaltungen" blockingList: "Blockierungen" @@ -2137,7 +2092,6 @@ _notification: receiveFollowRequest: "Erhaltene Follow-Anfragen" followRequestAccepted: "Akzeptierte Follow-Anfragen" achievementEarned: "Errungenschaft freigeschaltet" - login: "Anmelden" app: "Benachrichtigungen von Apps" _actions: followBack: "folgt dir nun auch" @@ -2187,6 +2141,7 @@ _webhookSettings: createWebhook: "Webhook erstellen" name: "Name" secret: "Secret" + events: "Webhook-Ereignisse" active: "Aktiviert" _events: follow: "Wenn du jemandem folgst" @@ -2196,10 +2151,6 @@ _webhookSettings: renote: "Wenn du ein Renote erhältst" reaction: "Wenn du eine Reaktion erhältst" mention: "Wenn du erwähnt wirst" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "Email" _moderationLogTypes: createRole: "Rolle erstellt" deleteRole: "Rolle gelöscht" @@ -2283,9 +2234,3 @@ _externalResourceInstaller: _themeInstallFailed: title: "Das Farbschema konnte nicht installiert werden" description: "Während der Installation des Farbschemas ist ein Problem aufgetreten. Bitte versuche es erneut. Detaillierte Fehlerinformationen können über die Javascript-Konsole abgerufen werden." -_reversi: - blackOrWhite: "Schwarz/Weiß" - rules: "Regeln" - black: "Schwarz" - white: "Weiß" - total: "Gesamt" diff --git a/locales/el-GR.yml b/locales/el-GR.yml index 4657842ca5..30a52b726e 100644 --- a/locales/el-GR.yml +++ b/locales/el-GR.yml @@ -301,6 +301,8 @@ _theme: _sfx: note: "Σημειώματα" notification: "Ειδοποιήσεις" + antenna: "Αντένες" + channel: "Ειδοποιήσεις καναλιών" _ago: future: "Μελλοντικό" justNow: "Μόλις τώρα" @@ -354,7 +356,6 @@ _profile: username: "Όνομα μέλους" _exportOrImport: allNotes: "Όλα τα σημειώματα" - clips: "Κλιπ" followingList: "Ακολουθεί" muteList: "Μέλη σε σίγαση" blockingList: "Μπλοκαρισμένα μέλη" @@ -378,7 +379,6 @@ _notification: renote: "Κοινοποίηση σημειώματος" quote: "Παράθεση" reaction: "Αντιδράσεις" - login: "Σύνδεση" _actions: reply: "Απάντηση" renote: "Κοινοποίηση σημειώματος" @@ -395,5 +395,3 @@ _webhookSettings: name: "Όνομα" _moderationLogTypes: suspend: "Αποβολή" -_reversi: - total: "Σύνολο" diff --git a/locales/en-US.yml b/locales/en-US.yml index 8570addfa2..ed71b5a190 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -8,9 +8,6 @@ search: "Search" notifications: "Notifications" username: "Username" password: "Password" -initialPasswordForSetup: "Initial password for setup" -initialPasswordIsIncorrect: "Initial password for setup is incorrect" -initialPasswordForSetupDescription: "Use the password you entered in the configuration file if you installed Misskey yourself.\n If you are using a Misskey hosting service, use the password provided.\n If you have not set a password, leave it blank to continue." forgotPassword: "Forgot password" fetchingAsApObject: "Fetching from the Fediverse..." ok: "OK" @@ -63,7 +60,6 @@ copyFileId: "Copy file ID" copyFolderId: "Copy folder ID" copyProfileUrl: "Copy profile URL" searchUser: "Search for a user" -searchThisUsersNotes: "Search this user’s notes" reply: "Reply" loadMore: "Load more" showMore: "Show more" @@ -112,14 +108,11 @@ enterEmoji: "Enter an emoji" renote: "Renote" unrenote: "Remove renote" renoted: "Renoted." -renotedToX: "Renoted to {name}." cantRenote: "This post can't be renoted." cantReRenote: "A renote can't be renoted." quote: "Quote" inChannelRenote: "Channel-only Renote" inChannelQuote: "Channel-only Quote" -renoteToChannel: "Renote to channel" -renoteToOtherChannel: "Renote to other channel" pinnedNote: "Pinned note" pinned: "Pin to profile" you: "You" @@ -129,15 +122,10 @@ add: "Add" reaction: "Reactions" reactions: "Reactions" emojiPicker: "Emoji picker" -pinnedEmojisForReactionSettingDescription: "Set the emojis to be pinned and displayed when reacting." -pinnedEmojisSettingDescription: "Set the emojis to be pinned and displayed when viewing emoji picker." emojiPickerDisplay: "Emoji picker display" -overwriteFromPinnedEmojisForReaction: "Override from reaction settings" -overwriteFromPinnedEmojis: "Override from general settings" reactionSettingDescription2: "Drag to reorder, click to delete, press \"+\" to add." rememberNoteVisibility: "Remember note visibility settings" attachCancel: "Remove attachment" -deleteFile: "Delete file" markAsSensitive: "Mark as sensitive" unmarkAsSensitive: "Unmark as sensitive" enterFileName: "Enter filename" @@ -158,7 +146,6 @@ editList: "Edit list" selectChannel: "Select a channel" selectAntenna: "Select an antenna" editAntenna: "Edit antenna" -createAntenna: "Create an antenna" selectWidget: "Select a widget" editWidgets: "Edit widgets" editWidgetsExit: "Done" @@ -170,7 +157,7 @@ emojiUrl: "Emoji URL" 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 servers. Disabling this will decrease storage usage, but increase traffic, as thumbnails will not be generated." +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." @@ -185,10 +172,6 @@ addAccount: "Add account" reloadAccountsList: "Reload account list" loginFailed: "Failed to sign in" showOnRemote: "View on remote instance" -continueOnRemote: "Continue on a remote server" -chooseServerOnMisskeyHub: "Choose a server from the Misskey Hub" -specifyServerHost: "Specify a server host directly" -inputHostName: "Enter the domain" general: "General" wallpaper: "Wallpaper" setWallpaper: "Set wallpaper" @@ -199,7 +182,6 @@ followConfirm: "Are you sure that you want to follow {name}?" proxyAccount: "Proxy account" proxyAccountDescription: "A proxy account is an account that acts as a remote follower for users under certain conditions. For example, when a user adds a remote user to the list, the remote user's activity will not be delivered to the instance if no local user is following that user, so the proxy account will follow instead." host: "Host" -selectSelf: "Select myself" selectUser: "Select a user" recipient: "Recipient" annotation: "Comments" @@ -215,7 +197,6 @@ perDay: "Per Day" stopActivityDelivery: "Stop sending activities" blockThisInstance: "Block this instance" silenceThisInstance: "Silence this instance" -mediaSilenceThisInstance: "Media-silence this server" operations: "Operations" software: "Software" version: "Version" @@ -236,11 +217,7 @@ clearCachedFilesConfirm: "Are you sure that you want to delete all cached remote blockedInstances: "Blocked Instances" blockedInstancesDescription: "List the hostnames of the instances you want to block separated by linebreaks. Listed instances will no longer be able to communicate with this instance." silencedInstances: "Silenced instances" -silencedInstancesDescription: "List the host names of the servers that you want to silence, separated by a new line. All accounts belonging to the listed servers will be treated as silenced, and can only make follow requests, and cannot mention local accounts if not followed. This will not affect the blocked servers." -mediaSilencedInstances: "Media-silenced servers" -mediaSilencedInstancesDescription: "List the host names of the servers that you want to media-silence, separated by a new line. All accounts belonging to the listed servers will be treated as sensitive, and can't use custom emojis. This will not affect the blocked servers." -federationAllowedHosts: "Federation allowed servers" -federationAllowedHostsDescription: "Specify the hostnames of the servers you want to allow federation separated by line breaks." +silencedInstancesDescription: "List the hostnames of the instances that you want to silence. All accounts of the listed instances will be treated as silenced, can only make follow requests, and cannot mention local accounts if not followed. This will not affect blocked instances." muteAndBlock: "Mutes and Blocks" mutedUsers: "Muted users" blockedUsers: "Blocked users" @@ -338,7 +315,6 @@ renameFolder: "Rename this folder" deleteFolder: "Delete this folder" folder: "Folder" addFile: "Add a file" -showFile: "Show files" emptyDrive: "Your Drive is empty" emptyFolder: "This folder is empty" unableToDelete: "Unable to delete" @@ -399,11 +375,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Enable hCaptcha" hcaptchaSiteKey: "Site key" hcaptchaSecretKey: "Secret key" -mcaptcha: "mCaptcha" -enableMcaptcha: "Enable mCaptcha" -mcaptchaSiteKey: "Site key" -mcaptchaSecretKey: "Secret key" -mcaptchaInstanceUrl: "mCaptcha server URL" recaptcha: "reCAPTCHA" enableRecaptcha: "Enable reCAPTCHA" recaptchaSiteKey: "Site key" @@ -419,7 +390,6 @@ name: "Name" antennaSource: "Antenna source" antennaKeywords: "Keywords to listen to" antennaExcludeKeywords: "Keywords to exclude" -antennaExcludeBots: "Exclude bot accounts" antennaKeywordsDescription: "Separate with spaces for an AND condition or with line breaks for an OR condition." notifyAntenna: "Notify about new notes" withFileAntenna: "Only notes with files" @@ -453,7 +423,6 @@ totpDescription: "Use an authenticator app to enter one-time passwords" moderator: "Moderator" moderation: "Moderation" moderationNote: "Moderation note" -moderationNoteDescription: "You can fill in notes that will be shared only among moderators." addModerationNote: "Add moderation note" moderationLogs: "Moderation logs" nUsersMentioned: "Mentioned by {n} users" @@ -488,12 +457,10 @@ retype: "Enter again" noteOf: "Note by {user}" quoteAttached: "Quote" quoteQuestion: "Append as quote?" -attachAsFileQuestion: "The text in clipboard is long. Would you want to attach it as text file?" noMessagesYet: "No messages yet" newMessageExists: "There are new messages" onlyOneFileCanBeAttached: "You can only attach one file to a message" signinRequired: "Please register or sign in before continuing" -signinOrContinueOnRemote: "To continue, you need to move your server or sign up / log in to this server." invitations: "Invites" invitationCode: "Invitation code" checking: "Checking..." @@ -515,12 +482,8 @@ uiLanguage: "User interface language" aboutX: "About {x}" emojiStyle: "Emoji style" native: "Native" -menuStyle: "Menu style" -style: "Style" -drawer: "Drawer" -popup: "Pop up" +disableDrawer: "Don't use drawer-style menus" showNoteActionsOnlyHover: "Only show note actions on hover" -showReactionsCount: "See the number of reactions in notes" noHistory: "No history available" signinHistory: "Login history" enableAdvancedMfm: "Enable advanced MFM" @@ -601,8 +564,6 @@ ascendingOrder: "Ascending" descendingOrder: "Descending" scratchpad: "Scratchpad" scratchpadDescription: "The Scratchpad provides an environment for AiScript experiments. You can write, execute, and check the results of it interacting with Misskey in it." -uiInspector: "UI inspector" -uiInspectorDescription: "You can see the UI component server list on memory. UI component will be generated by Ui:C: function." output: "Output" script: "Script" disablePagesScript: "Disable AiScript on Pages" @@ -661,7 +622,6 @@ medium: "Medium" small: "Small" generateAccessToken: "Generate access token" permission: "Permissions" -adminPermission: "Admin Permissions" enableAll: "Enable all" disableAll: "Disable all" tokenRequested: "Grant access to account" @@ -678,7 +638,7 @@ smtpHost: "Host" smtpPort: "Port" smtpUser: "Username" smtpPass: "Password" -emptyToDisableSmtpAuth: "Leave username and password empty to disable SMTP authentication" +emptyToDisableSmtpAuth: "Leave username and password empty to disable SMTP verification" smtpSecure: "Use implicit SSL/TLS for SMTP connections" smtpSecureInfo: "Turn this off when using STARTTLS" testEmail: "Test email delivery" @@ -705,7 +665,6 @@ useGlobalSettingDesc: "If turned on, your account's notification settings will b other: "Other" regenerateLoginToken: "Regenerate login token" regenerateLoginTokenDescription: "Regenerates the token used internally during login. Normally this action is not necessary. If regenerated, all devices will be logged out." -theKeywordWhenSearchingForCustomEmoji: "This is the keyword when searching for custom emojis." setMultipleBySeparatingWithSpace: "Separate multiple entries with spaces." fileIdOrUrl: "File ID or URL" behavior: "Behavior" @@ -719,7 +678,10 @@ abuseReported: "Your report has been sent. Thank you very much." reporter: "Reporter" reporteeOrigin: "Reportee Origin" reporterOrigin: "Reporter Origin" +forwardReport: "Forward report to remote instance" +forwardReportIsAnonymous: "Instead of your account, an anonymous system account will be displayed as reporter at the remote instance." send: "Send" +abuseMarkAsResolved: "Mark report as resolved" openInNewTab: "Open in new tab" openInSideView: "Open in side view" defaultNavigationBehaviour: "Default navigation behavior" @@ -856,7 +818,6 @@ administration: "Management" accounts: "Accounts" switch: "Switch" noMaintainerInformationWarning: "Maintainer information is not configured." -noInquiryUrlWarning: "Inquiry URL isn’t set" noBotProtectionWarning: "Bot protection is not configured." configure: "Configure" postToGallery: "Create new gallery post" @@ -921,7 +882,6 @@ followersVisibility: "Visibility of followers" continueThread: "View thread continuation" deleteAccountConfirm: "This will irreversibly delete your account. Proceed?" incorrectPassword: "Incorrect password." -incorrectTotp: "The one-time password is incorrect or has expired." voteConfirm: "Confirm your vote for \"{choice}\"?" hide: "Hide" useDrawerReactionPickerForMobile: "Display reaction picker as drawer on mobile" @@ -946,9 +906,6 @@ oneHour: "One hour" oneDay: "One day" oneWeek: "One week" oneMonth: "One month" -threeMonths: "3 months" -oneYear: "1 year" -threeDays: "3 days" reflectMayTakeTime: "It may take some time for this to be reflected." failedToFetchAccountInformation: "Could not fetch account information" rateLimitExceeded: "Rate limit exceeded" @@ -1022,7 +979,6 @@ neverShow: "Don't show again" remindMeLater: "Maybe later" didYouLikeMisskey: "Have you taken a liking to Misskey?" pleaseDonate: "{host} uses the free software, Misskey. We would highly appreciate your donations so development of Misskey can continue!" -correspondingSourceIsAvailable: "The corresponding source code is available at {anchor}" roles: "Roles" role: "Role" noRole: "Role not found" @@ -1050,7 +1006,6 @@ thisPostMayBeAnnoyingHome: "Post to home timeline" thisPostMayBeAnnoyingCancel: "Cancel" thisPostMayBeAnnoyingIgnore: "Post anyway" collapseRenotes: "Collapse renotes you've already seen" -collapseRenotesDescription: "Collapse notes that you've reacted to or renoted before." internalServerError: "Internal Server Error" internalServerErrorDescription: "The server has run into an unexpected error." copyErrorInfo: "Copy error details" @@ -1074,9 +1029,6 @@ resetPasswordConfirm: "Really reset your password?" sensitiveWords: "Sensitive words" sensitiveWordsDescription: "The visibility of all notes containing any of the configured words will be set to \"Home\" automatically. You can list multiple by separating them via line breaks." sensitiveWordsDescription2: "Using spaces will create AND expressions and surrounding keywords with slashes will turn them into a regular expression." -prohibitedWords: "Prohibited words" -prohibitedWordsDescription: "Enables an error when attempting to post a note containing the set word(s). Multiple words can be set, separated by a new line." -prohibitedWordsDescription2: "Using spaces will create AND expressions and surrounding keywords with slashes will turn them into a regular expression." hiddenTags: "Hidden hashtags" hiddenTagsDescription: "Select tags which will not shown on trend list.\nMultiple tags could be registered by lines." notesSearchNotAvailable: "Note search is unavailable." @@ -1089,15 +1041,12 @@ retryAllQueuesConfirmTitle: "Really retry all?" retryAllQueuesConfirmText: "This will temporarily increase the server load." enableChartsForRemoteUser: "Generate remote user data charts" enableChartsForFederatedInstances: "Generate remote instance data charts" -enableStatsForFederatedInstances: "Receive remote server stats" showClipButtonInNoteFooter: "Add \"Clip\" to note action menu" reactionsDisplaySize: "Reaction display size" -limitWidthOfReaction: "Limit the maximum width of reactions and display them in reduced size." +limitWidthOfReaction: "Limits the maximum width of reactions and display them in reduced size." noteIdOrUrl: "Note ID or URL" video: "Video" videos: "Videos" -audio: "Audio" -audioFiles: "Audio" dataSaver: "Data Saver" accountMigration: "Account Migration" accountMoved: "This user has moved to a new account:" @@ -1125,8 +1074,6 @@ preservedUsernames: "Reserved usernames" preservedUsernamesDescription: "List usernames to reserve separated by linebreaks. These will become unable during normal account creation, but can be used by administrators to manually create accounts. Already existing accounts using these usernames will not be affected." createNoteFromTheFile: "Compose note from this file" archive: "Archive" -archived: "Archived" -unarchive: "Unarchive" channelArchiveConfirmTitle: "Really archive {name}?" channelArchiveConfirmDescription: "An archived channel won't appear in the channel list or search results anymore. New posts can also not be added to it anymore." thisChannelArchived: "This channel has been archived." @@ -1137,9 +1084,6 @@ preventAiLearning: "Reject usage in Machine Learning (Generative AI)" preventAiLearningDescription: "Requests crawlers to not use posted text or image material etc. in machine learning (Predictive / Generative AI) data sets. This is achieved by adding a \"noai\" HTML-Response flag to the respective content. A complete prevention can however not be achieved through this flag, as it may simply be ignored." options: "Options" specifyUser: "Specific user" -lookupConfirm: "Do you want to look up?" -openTagPageConfirm: "Do you want to open a hashtag page?" -specifyHost: "Specific host" failedToPreviewUrl: "Could not preview" update: "Update" rolesThatCanBeUsedThisEmojiAsReaction: "Roles that can use this emoji as reaction" @@ -1198,7 +1142,6 @@ showRenotes: "Show renotes" edited: "Edited" notificationRecieveConfig: "Notification Settings" mutualFollow: "Mutual follow" -followingOrFollower: "Following or follower" fileAttachedOnly: "Only notes with files" showRepliesToOthersInTimeline: "Show replies to others in timeline" hideRepliesToOthersInTimeline: "Hide replies to others from timeline" @@ -1207,13 +1150,6 @@ hideRepliesToOthersInTimelineAll: "Hide replies to others from everyone you foll confirmShowRepliesAll: "This operation is irreversible. Would you really like to show replies to others from everyone you follow in your timeline?" confirmHideRepliesAll: "This operation is irreversible. Would you really like to hide replies to others from everyone you follow in your timeline?" externalServices: "External Services" -sourceCode: "Source code" -sourceCodeIsNotYetProvided: "Source code is not yet available. Contact the administrator to fix this problem." -repositoryUrl: "Repository URL" -repositoryUrlDescription: "If you are using Misskey as is (without any changes to the source code), enter https://github.com/misskey-dev/misskey" -repositoryUrlOrTarballRequired: "If you have not published a repository, you must provide a tarball instead. See .config/example.yml for more information." -feedback: "Feedback" -feedbackUrl: "Feedback URL" impressum: "Impressum" impressumUrl: "Impressum URL" impressumDescription: "In some countries, like germany, the inclusion of operator contact information (an Impressum) is legally required for commercial websites." @@ -1223,7 +1159,6 @@ tosAndPrivacyPolicy: "Terms of Service and Privacy Policy" avatarDecorations: "Avatar decorations" attach: "Attach" detach: "Remove" -detachAll: "Remove All" angle: "Angle" flip: "Flip" showAvatarDecorations: "Show avatar decorations" @@ -1237,110 +1172,7 @@ cwNotationRequired: "If \"Hide content\" is enabled, a description must be provi doReaction: "Add reaction" code: "Code" reloadRequiredToApplySettings: "Reloading is required to apply the settings." -remainingN: "Remaining: {n}" -overwriteContentConfirm: "Are you sure you want to overwrite the current content?" -seasonalScreenEffect: "Seasonal Screen Effect" decorate: "Decorate" -addMfmFunction: "Add MFM" -enableQuickAddMfmFunction: "Show advanced MFM picker" -bubbleGame: "Bubble Game" -sfx: "Sound Effects" -soundWillBePlayed: "Sound will be played" -showReplay: "View Replay" -replay: "Replay" -replaying: "Showing replay" -endReplay: "Exit Replay" -copyReplayData: "Copy replay data" -ranking: "Ranking" -lastNDays: "Last {n} days" -backToTitle: "Go back to title" -hemisphere: "Where are you located" -withSensitive: "Include notes with sensitive files" -userSaysSomethingSensitive: "Post by {name} contains sensitive content" -enableHorizontalSwipe: "Swipe to switch tabs" -loading: "Loading" -surrender: "Cancel" -gameRetry: "Retry" -notUsePleaseLeaveBlank: "Leave blank if not used" -useTotp: "Enter the One-Time Password" -useBackupCode: "Use the backup codes" -launchApp: "Launch the app" -useNativeUIForVideoAudioPlayer: "Use UI of browser when play video and audio" -keepOriginalFilename: "Keep original file name" -keepOriginalFilenameDescription: "If you turn off this setting, files names will be replaced with random string automatically when you upload files." -noDescription: "There is no explanation" -alwaysConfirmFollow: "Always confirm when following" -inquiry: "Contact" -tryAgain: "Please try again later" -confirmWhenRevealingSensitiveMedia: "Confirm when revealing sensitive media" -sensitiveMediaRevealConfirm: "This might be a sensitive media. Are you sure to reveal?" -createdLists: "Created lists" -createdAntennas: "Created antennas" -fromX: "From {x}" -genEmbedCode: "Generate embed code" -noteOfThisUser: "Notes by this user" -clipNoteLimitExceeded: "No more notes can be added to this clip." -performance: "Performance" -modified: "Modified" -discard: "Discard" -thereAreNChanges: "There are {n} change(s)" -signinWithPasskey: "Sign in with Passkey" -unknownWebAuthnKey: "Unknown Passkey" -passkeyVerificationFailed: "Passkey verification has failed." -passkeyVerificationSucceededButPasswordlessLoginDisabled: "Passkey verification has succeeded but password-less login is disabled." -messageToFollower: "Message to followers" -target: "Target" -testCaptchaWarning: "This function is intended for CAPTCHA testing purposes.\nDo not use in a production environment." -prohibitedWordsForNameOfUser: "Prohibited words for user names" -prohibitedWordsForNameOfUserDescription: "If any of the strings in this list are included in the user's name, the name will be denied. Users with moderator privileges are not affected by this restriction." -yourNameContainsProhibitedWords: "Your name contains prohibited words" -yourNameContainsProhibitedWordsDescription: "If you wish to use this name, please contact your server administrator." -thisContentsAreMarkedAsSigninRequiredByAuthor: "Set by the author to require login to view" -lockdown: "Lockdown" -pleaseSelectAccount: "Select an account" -_accountSettings: - requireSigninToViewContents: "Require sign-in to view contents" - requireSigninToViewContentsDescription1: "Require login to view all notes and other content you have created. This will have the effect of preventing crawlers from collecting your information." - requireSigninToViewContentsDescription2: "Content will not be displayed in URL previews (OGP), embedded in web pages, or on servers that don't support note quotes." - requireSigninToViewContentsDescription3: "These restrictions may not apply to federated content from other remote servers." - makeNotesFollowersOnlyBefore: "Make past notes to be displayed only to followers" - makeNotesFollowersOnlyBeforeDescription: "While this feature is enabled, only followers can see notes past the set date and time or have been visible for a set time. When it is deactivated, the note publication status will also be restored." - makeNotesHiddenBefore: "Make past notes private" - makeNotesHiddenBeforeDescription: "While this feature is enabled, notes that are past the set date and time or have been visible only to you. When it is deactivated, the note publication status will also be restored." - mayNotEffectForFederatedNotes: "Notes federated to a remote server may not be effective." - notesHavePassedSpecifiedPeriod: "Note that the specified time has passed" - notesOlderThanSpecifiedDateAndTime: "Notes before the specified date and time" -_abuseUserReport: - forward: "Forward" - forwardDescription: "Forward the report to a remote server as an anonymous system account." - resolve: "Resolve" - accept: "Accept" - reject: "Reject" - resolveTutorial: "If the report is legitimate in content, select \"Accept\" to mark the case as resolved in the affirmative.\nIf the content of the report is not legitimate, select \"Reject\" to mark the case as resolved in the negative." -_delivery: - status: "Delivery status" - stop: "Suspended" - resume: "Delivery resume" - _type: - none: "Publishing" - manuallySuspended: "Manually suspended" - goneSuspended: "Server is suspended due to server deletion" - autoSuspendedForNotResponding: "Server is suspended due to no responding" -_bubbleGame: - howToPlay: "How to play" - hold: "Hold" - _score: - score: "Score" - scoreYen: "Amount of money earned" - highScore: "High score" - maxChain: "Maximum number of chains" - yen: "{yen} Yen" - estimatedQty: "{qty} Pieces" - scoreSweets: "{onigiriQtyWithUnit} Onigiri" - _howToPlay: - section1: "Adjust the position and drop the object into the box." - section2: "When two objects of the same type touch each other, they will change into a different object and you score points." - section3: "The game is over when objects overflow from the box. Aim for a high score by fusing objects together while you avoid overflowing the box!" _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." @@ -1350,7 +1182,7 @@ _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." - shouldNotBeUsedToPresentPermanentInfo: "It's best to use announcements to publish fresh and time-bound information, not for information that will be relevant in the long term." + shouldNotBeUsedToPresentPermanentInfo: "As it may significantly impact the user experience for new users, it is recommended to use notifications in the flow information rather than stock information." dialogAnnouncementUxWarn: "Having two or more dialog-style notifications simultaneously can significantly impact the user experience, so please use them carefully." silence: "No notification" silenceDescription: "Turning this on will skip the notification of this announcement and the user won't need to read it." @@ -1419,7 +1251,7 @@ _initialTutorial: _exampleNote: cw: "This will surely make you hungry!" note: "Just had a chocolate-glazed donut 🍩😋" - useCases: "This is used when following the server guidelines, for necessary notes, or for self-restriction of spoiler or sensitive text." + useCases: "This is used when following the server guidelines for necessary notes or for self-restriction of spoiler or sensitive text." _howToMakeAttachmentsSensitive: title: "How to Mark Attachments as Sensitive?" description: "For attachments that are required by server guidelines or that should not be left intact, add a \"sensitive\" flag." @@ -1451,10 +1283,6 @@ _serverSettings: fanoutTimelineDescription: "Greatly increases performance of timeline retrieval and reduces load on the database when enabled. In exchange, memory usage of Redis will increase. Consider disabling this in case of low server memory or server instability." fanoutTimelineDbFallback: "Fallback to database" fanoutTimelineDbFallbackDescription: "When enabled, the timeline will fall back to the database for additional queries if the timeline is not cached. Disabling it further reduces the server load by eliminating the fallback process, but limits the range of timelines that can be retrieved." - reactionsBufferingDescription: "When enabled, performance during reaction creation will be greatly improved, reducing the load on the database. However, Redis memory usage will increase." - inquiryUrl: "Inquiry URL" - inquiryUrlDescription: "Specify a URL for the inquiry form to the server maintainer or a web page for the contact information." - thisSettingWillAutomaticallyOffWhenModeratorsInactive: "If no moderator activity is detected for a while, this setting will be automatically turned off to prevent spam." _accountMigration: moveFrom: "Migrate another account to this one" moveFromSub: "Create alias to another account" @@ -1715,13 +1543,6 @@ _achievements: _tutorialCompleted: title: "Misskey Elementary Course Diploma" description: "Tutorial completed" - _bubbleGameExplodingHead: - title: "🤯" - description: "The biggest object in the bubble game" - _bubbleGameDoubleExplodingHead: - title: "Double🤯" - description: "Two of the biggest objects in the bubble game at the same time" - flavor: "You can fill a lunch box like this 🤯 🤯 a bit." _role: new: "New role" edit: "Edit role" @@ -1762,7 +1583,6 @@ _role: gtlAvailable: "Can view the global timeline" ltlAvailable: "Can view the local timeline" canPublicNote: "Can send public notes" - mentionMax: "Maximum number of mentions in a note" canInvite: "Can create instance invite codes" inviteLimit: "Invite limit" inviteLimitCycle: "Invite limit cooldown" @@ -1771,7 +1591,6 @@ _role: canManageAvatarDecorations: "Manage avatar decorations" driveCapacity: "Drive capacity" alwaysMarkNsfw: "Always mark files as NSFW" - canUpdateBioMedia: "Can edit an icon or a banner image" pinMax: "Maximum number of pinned notes" antennaMax: "Maximum number of antennas" wordMuteMax: "Maximum number of characters allowed in word mutes" @@ -1785,21 +1604,9 @@ _role: canHideAds: "Can hide ads" canSearchNotes: "Usage of note search" canUseTranslator: "Translator usage" - avatarDecorationLimit: "Maximum number of avatar decorations that can be applied" - canImportAntennas: "Allow importing antennas" - canImportBlocking: "Allow importing blocking" - canImportFollowing: "Allow importing following" - canImportMuting: "Allow importing muting" - canImportUserLists: "Allow importing lists" _condition: - roleAssignedTo: "Assigned to manual roles" isLocal: "Local user" isRemote: "Remote user" - isCat: "Cat Users" - isBot: "Bot Users" - isSuspended: "Suspended user" - isLocked: "Private accounts" - isExplorable: "Effective user of \"make an account discoverable\"" createdLessThan: "Less than X has passed since account creation" createdMoreThan: "More than X has passed since account creation" followersLessThanOrEq: "Has X or fewer followers" @@ -1825,7 +1632,6 @@ _emailUnavailable: disposable: "Disposable email addresses may not be used" mx: "This email server is invalid" smtp: "This email server is not responding" - banned: "You cannot register with this email address" _ffVisibility: public: "Public" followers: "Visible to followers only" @@ -1869,7 +1675,6 @@ _plugin: installWarn: "Please do not install untrustworthy plugins." manage: "Manage plugins" viewSource: "View source" - viewLog: "Show log" _preferencesBackups: list: "Created backups" saveNew: "Save new backup" @@ -1899,8 +1704,6 @@ _aboutMisskey: contributors: "Main contributors" allContributors: "All contributors" source: "Source code" - original: "Original" - thisIsModifiedVersion: "{name} uses a modified version of the original Misskey." translation: "Translate Misskey" donate: "Donate to Misskey" morePatrons: "We also appreciate the support of many other helpers not listed here. Thank you! 🥰" @@ -2008,6 +1811,7 @@ _theme: buttonBg: "Button background" buttonHoverBg: "Button background (Hover)" inputBorder: "Input field border" + listItemHoverBg: "List item background (Hover)" driveFolderBg: "Drive folder background" wallpaperOverlay: "Wallpaper overlay" badge: "Badge" @@ -2019,6 +1823,8 @@ _sfx: note: "New note" noteMy: "Own note" notification: "Notifications" + antenna: "Antennas" + channel: "Channel notifications" reaction: "On choosing a reaction" _soundSettings: driveFile: "Use an audio file in Drive." @@ -2027,7 +1833,6 @@ _soundSettings: driveFileTypeWarnDescription: "Select an audio file" driveFileDurationWarn: "The audio is too long." driveFileDurationWarnDescription: "Long audio may disrupt using Misskey. Still continue?" - driveFileError: "It couldn't load the sound. Please change the setting." _ago: future: "Future" justNow: "Just now" @@ -2057,6 +1862,7 @@ _2fa: registerTOTP: "Register authenticator app" 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." step2Uri: "Enter the following URI if you are using a desktop program" step3Title: "Enter an authentication code" step3: "Enter the authentication code (token) provided by your app to finish setup." @@ -2080,7 +1886,6 @@ _2fa: 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." - moreDetailedGuideHere: "Here is detailed guide" _permissions: "read:account": "View your account information" "write:account": "Edit your account information" @@ -2118,54 +1923,6 @@ _permissions: "write:flash": "Edit Plays" "read:flash-likes": "View list of liked Plays" "write:flash-likes": "Edit list of liked Plays" - "read:admin:abuse-user-reports": "View user reports" - "write:admin:delete-account": "Delete user account" - "write:admin:delete-all-files-of-a-user": "Delete all files of a user" - "read:admin:index-stats": "View database index stats" - "read:admin:table-stats": "View database table stats" - "read:admin:user-ips": "View user IP addresses" - "read:admin:meta": "View instance metadata" - "write:admin:reset-password": "Reset user password" - "write:admin:resolve-abuse-user-report": "Resolve user report" - "write:admin:send-email": "Send email" - "read:admin:server-info": "View server info" - "read:admin:show-moderation-log": "View moderation log" - "read:admin:show-user": "View private user info" - "write:admin:suspend-user": "Suspend user" - "write:admin:unset-user-avatar": "Remove user avatar" - "write:admin:unset-user-banner": "Remove user banner" - "write:admin:unsuspend-user": "Unsuspend user" - "write:admin:meta": "Manage instance metadata" - "write:admin:user-note": "Manage moderation note" - "write:admin:roles": "Manage roles" - "read:admin:roles": "View roles" - "write:admin:relays": "Manage relays" - "read:admin:relays": "View relays" - "write:admin:invite-codes": "Manage invite codes" - "read:admin:invite-codes": "View invite codes" - "write:admin:announcements": "Manage announcements" - "read:admin:announcements": "View announcements" - "write:admin:avatar-decorations": "Can manage avatar decorations" - "read:admin:avatar-decorations": "View avatar decorations" - "write:admin:federation": "Manage federation data" - "write:admin:account": "Manage user account" - "read:admin:account": "View user account" - "write:admin:emoji": "Manage emoji" - "read:admin:emoji": "View emoji" - "write:admin:queue": "Manage job queue" - "read:admin:queue": "View job queue info" - "write:admin:promo": "Manage promotion notes" - "write:admin:drive": "Manage user drive" - "read:admin:drive": "View user drive info" - "read:admin:stream": "Use WebSocket API for Admin" - "write:admin:ad": "Manage ads" - "read:admin:ad": "View ads" - "write:invite-codes": "Create invite codes" - "read:invite-codes": "Get invite codes" - "write:clip-favorite": "Manage favorited clips" - "read:clip-favorite": "View favorited clips" - "read:federation": "Get federation data" - "write:report-abuse": "Report violation" _auth: shareAccessTitle: "Granting application permissions" shareAccess: "Would you like to authorize \"{name}\" to access this account?" @@ -2174,11 +1931,8 @@ _auth: permissionAsk: "This application requests the following permissions" pleaseGoBack: "Please go back to the application" callback: "Returning to the application" - accepted: "Access granted" denied: "Access denied" - scopeUser: "Operate as the following user" pleaseLogin: "Please log in to authorize applications." - byClickingYouWillBeRedirectedToThisUrl: "When access is granted, you will automatically be redirected to the following URL" _antennaSources: all: "All notes" homeTimeline: "Notes from followed users" @@ -2286,14 +2040,9 @@ _profile: 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." - avatarDecorationMax: "You can add up to {max} decorations." - followedMessage: "Message when you are followed" - followedMessageDescription: "You can set a short message to be displayed to the recipient when they follow you." - followedMessageDescriptionForLockedAccount: "If you have set up that follow requests require approval, this will be displayed when you grant a follow request." _exportOrImport: allNotes: "All notes" favoritedNotes: "Favorite notes" - clips: "Clip" followingList: "Followed users" muteList: "Muted users" blockingList: "Blocked users" @@ -2347,7 +2096,6 @@ _play: title: "Title" script: "Script" summary: "Description" - visibilityDescription: "Putting it private means it won't be visible on your profile, but anyone that has the URL can still access it." _pages: newPage: "Create a new Page" editPage: "Edit this Page" @@ -2382,7 +2130,6 @@ _pages: eyeCatchingImageSet: "Set thumbnail" eyeCatchingImageRemove: "Delete thumbnail" chooseBlock: "Add a block" - enterSectionTitle: "Enter a section title" selectType: "Select a type" contentBlocks: "Content" inputBlocks: "Input" @@ -2393,8 +2140,6 @@ _pages: section: "Section" image: "Images" button: "Button" - dynamic: "Dynamic Blocks" - dynamicDescription: "This block has been abolished. Please use {play} from now on." note: "Embedded note" _note: id: "Note ID" @@ -2424,12 +2169,8 @@ _notification: sendTestNotification: "Send test notification" notificationWillBeDisplayedLikeThis: "Notifications look like this" reactedBySomeUsers: "{n} users reacted" - likedBySomeUsers: "{n} users liked your note" renotedBySomeUsers: "Renote from {n} users" followedBySomeUsers: "Followed by {n} users" - flushNotification: "Clear notifications" - exportOfXCompleted: "Export of {x} has been completed" - login: "Someone logged in" _types: all: "All" note: "New notes" @@ -2444,9 +2185,6 @@ _notification: followRequestAccepted: "Accepted follow requests" roleAssigned: "Role given" achievementEarned: "Achievement unlocked" - exportCompleted: "The export has been completed" - login: "Sign In" - test: "Notification test" app: "Notifications from linked apps" _actions: followBack: "followed you back" @@ -2456,7 +2194,6 @@ _deck: alwaysShowMainColumn: "Always show main column" columnAlign: "Align columns" addColumn: "Add column" - newNoteNotificationSettings: "Notification setting for new notes" configureColumn: "Column settings" swapLeft: "Swap with the left column" swapRight: "Swap with the right column" @@ -2495,10 +2232,9 @@ _drivecleaner: orderByCreatedAtAsc: "Ascending Dates" _webhookSettings: createWebhook: "Create Webhook" - modifyWebhook: "Modify Webhook" name: "Name" secret: "Secret" - trigger: "Trigger" + events: "Webhook Events" active: "Enabled" _events: follow: "When following a user" @@ -2508,29 +2244,6 @@ _webhookSettings: renote: "When renoted" reaction: "When receiving a reaction" mention: "When being mentioned" - _systemEvents: - abuseReport: "When received a new report" - abuseReportResolved: "When resolved report" - userCreated: "When user is created" - inactiveModeratorsWarning: "When moderators have been inactive for a while" - inactiveModeratorsInvitationOnlyChanged: "When a moderator has been inactive for a while, and the server is changed to invitation-only" - deleteConfirm: "Are you sure you want to delete the Webhook?" - testRemarks: "Click the button to the right of the switch to send a test Webhook with dummy data." -_abuseReport: - _notificationRecipient: - createRecipient: "Add a recipient for reports" - modifyRecipient: "Edit a recipient for reports" - recipientType: "Notification type" - _recipientType: - mail: "Email" - webhook: "Webhook" - _captions: - mail: "Send the email to moderators' email addresses when you receive reports." - webhook: "Send a notification to System Webhook when you receive or resolve reports." - keywords: "Keywords" - notifiedUser: "Users to notify" - notifiedWebhook: "Webhook to use" - deleteConfirm: "Are you sure that you want to delete the notification recipient?" _moderationLogTypes: createRole: "Role created" deleteRole: "Role deleted" @@ -2555,12 +2268,9 @@ _moderationLogTypes: resetPassword: "Password reset" suspendRemoteInstance: "Remote instance suspended" unsuspendRemoteInstance: "Remote instance unsuspended" - updateRemoteInstanceNote: "Moderation note updated for remote instance." markSensitiveDriveFile: "File marked as sensitive" unmarkSensitiveDriveFile: "File unmarked as sensitive" resolveAbuseReport: "Report resolved" - forwardAbuseReport: "Report forwarded" - updateAbuseReportNote: "Moderation note of a report updated" createInvitation: "Invite generated" createAd: "Ad created" deleteAd: "Ad deleted" @@ -2568,18 +2278,8 @@ _moderationLogTypes: createAvatarDecoration: "Avatar decoration created" updateAvatarDecoration: "Avatar decoration updated" deleteAvatarDecoration: "Avatar decoration deleted" - unsetUserAvatar: "User avatar unset" - unsetUserBanner: "User banner unset" - createSystemWebhook: "System Webhook created" - updateSystemWebhook: "System Webhook updated" - deleteSystemWebhook: "System Webhook deleted" - createAbuseReportNotificationRecipient: "Recipient for reports created" - updateAbuseReportNotificationRecipient: "Recipient for reports updated" - deleteAbuseReportNotificationRecipient: "Recipient for reports deleted" - deleteAccount: "Account deleted" - deletePage: "Page deleted" - deleteFlash: "Play deleted" - deleteGalleryPost: "Gallery post deleted" + unsetUserAvatar: "Unset this user's avatar" + unsetUserBanner: "Unset this user's banner" _fileViewer: title: "File details" type: "File type" @@ -2632,101 +2332,11 @@ _externalResourceInstaller: _dataSaver: _media: title: "Loading Media" - description: "Prevents images/videos from being loaded automatically. Hidden images/videos will be loaded when tapped." _avatar: title: "Avatar image" description: "Stop avatar image animation. Animated images can be larger in file size than normal images, potentially leading to further reductions in data traffic." _urlPreview: title: "URL preview thumbnails" - description: "URL preview thumbnail images will no longer be loaded." _code: title: "Code highlighting" description: "If code highlighting notations are used in MFM, etc., they will not load until tapped. Syntax highlighting requires downloading the highlight definition files for each programming language. Therefore, disabling the automatic loading of these files is expected to reduce the amount of communication data." -_hemisphere: - N: "Northern Hemisphere" - S: "Southern Hemisphere" - caption: "Used in some client settings to determine season." -_reversi: - reversi: "Reversi" - gameSettings: "Game settings" - chooseBoard: "Choose a board" - blackOrWhite: "Black/White" - blackIs: "{name} is playing Black" - rules: "Rules" - thisGameIsStartedSoon: "The game will begin shortly" - waitingForOther: "Waiting for opponent's turn" - waitingForMe: "Waiting for your turn" - waitingBoth: "Get ready" - ready: "Ready" - cancelReady: "Not ready" - opponentTurn: "Opponent's turn" - myTurn: "Your turn" - turnOf: "It's {name}'s turn" - pastTurnOf: "{name}'s turn" - surrender: "Surrender" - surrendered: "Surrendered" - timeout: "Out of time" - drawn: "Draw" - won: "{name} wins" - black: "Black" - white: "White" - total: "Total" - turnCount: "Turn {count}" - myGames: "My rounds" - allGames: "All rounds" - ended: "Ended" - playing: "Currently playing" - isLlotheo: "The one with fewer stones wins (Llotheo)" - loopedMap: "Looping map" - canPutEverywhere: "Tiles are placeable everywhere" - timeLimitForEachTurn: "Time limit for turn" - freeMatch: "Free Match" - lookingForPlayer: "Finding opponent..." - gameCanceled: "The game has been cancelled." - shareToTlTheGameWhenStart: "Share Game to timeline when started" - iStartedAGame: "The game has begun! #MisskeyReversi" - opponentHasSettingsChanged: "The opponent has changed their settings." - allowIrregularRules: "Irregular rules (completely free)" - disallowIrregularRules: "No irregular rules" - showBoardLabels: "Display row and column numbering on the board" - useAvatarAsStone: "Turn stones into user avatars" -_offlineScreen: - title: "Offline - cannot connect to the server" - header: "Unable to connect to the server" -_urlPreviewSetting: - title: "URL preview settings" - enable: "Enable URL preview" - timeout: "Time out when getting preview (ms)" - timeoutDescription: "If it takes longer than this value to get the preview, the preview won’t be generated." - maximumContentLength: "Maximum Content-Length (bytes)" - maximumContentLengthDescription: "If Content-Length is higher than this value, the preview won't be generated." - requireContentLength: "Generate the preview only if you could get Content-Length" - requireContentLengthDescription: "If other server doesn't return Content-Length, the preview won't be generated." - userAgent: "User-Agent" - userAgentDescription: "Sets the User-Agent to be used when retrieving previews. If left blank, the default User-Agent will be used." - summaryProxy: "Proxy endpoints that generate previews" - summaryProxyDescription: "Not Misskey itself, but generate previews using Summaly Proxy." - summaryProxyDescription2: "The following parameters are linked to the proxy as a query string. If the proxy does not support them, the values are ignored." -_mediaControls: - pip: "Picture in Picture" - playbackRate: "Playback Speed" - loop: "Loop playback" -_contextMenu: - title: "Context menu" - app: "Application" - appWithShift: "Application with shift key" - native: "Native" -_embedCodeGen: - title: "Customize embed code" - header: "Show header" - autoload: "Automatically load more (deprecated)" - maxHeight: "Max height" - maxHeightDescription: "Setting it to 0 disables the max height setting. Specify some value to prevent the widget from continuing to expand vertically." - maxHeightWarn: "The max height limit is disabled (0). If this was not intended, set the max height to some value." - previewIsNotActual: "The display differs from the actual embedding because it exceeds the range displayed on the preview screen." - rounded: "Make it rounded" - border: "Add a border to the outer frame" - applyToPreview: "Apply to the preview" - generateCode: "Generate embed code" - codeGenerated: "The code has been generated" - codeGeneratedDescription: "Paste the generated code into your website to embed the content." diff --git a/locales/es-ES.yml b/locales/es-ES.yml index 7731598152..9aa7bc4e70 100644 --- a/locales/es-ES.yml +++ b/locales/es-ES.yml @@ -8,12 +8,10 @@ search: "Buscar" notifications: "Notificaciones" username: "Nombre de usuario" password: "Contraseña" -initialPasswordForSetup: "Contraseña para iniciar la inicialización" -initialPasswordIsIncorrect: "La contraseña para iniciar la configuración inicial es incorrecta." 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" @@ -62,7 +60,6 @@ copyFileId: "Copiar ID del archivo" copyFolderId: "Copiar ID de carpeta" copyProfileUrl: "Copiar la URL del perfil" searchUser: "Buscar un usuario" -searchThisUsersNotes: "" reply: "Responder" loadMore: "Ver más" showMore: "Ver más" @@ -111,14 +108,11 @@ enterEmoji: "Ingresar emojis" renote: "Renotar" unrenote: "Quitar renota" renoted: "Renotado" -renotedToX: "{name} usuarios han renotado。" cantRenote: "No se puede renotar este post" cantReRenote: "No se puede renotar una renota" quote: "Citar" inChannelRenote: "Renota sólo del canal" inChannelQuote: "Cita sólo del canal" -renoteToChannel: "Renotar a otro canal" -renoteToOtherChannel: "Renotar a otro canal" pinnedNote: "Nota fijada" pinned: "Fijar al perfil" you: "Tú" @@ -136,7 +130,6 @@ overwriteFromPinnedEmojis: "Sobreescribir los emojis fijados" reactionSettingDescription2: "Arrastre para reordenar, click para borrar, apriete la tecla + para añadir." rememberNoteVisibility: "Recordar visibilidad" attachCancel: "Quitar adjunto" -deleteFile: "Archivo eliminado" markAsSensitive: "Marcar como sensible" unmarkAsSensitive: "Desmarcar como sensible" enterFileName: "Ingrese el nombre del archivo" @@ -157,7 +150,6 @@ editList: "Editar lista" selectChannel: "Seleccionar canal" selectAntenna: "Seleccionar antena" editAntenna: "Editar antena" -createAntenna: "Crear una antena" selectWidget: "Seleccionar widget" editWidgets: "Editar widgets" editWidgetsExit: "Terminar edición" @@ -184,10 +176,6 @@ addAccount: "Agregar Cuenta" reloadAccountsList: "Recargar lista de cuentas" loginFailed: "Error al iniciar sesión." showOnRemote: "Ver en una instancia remota" -continueOnRemote: "Ver en una instancia remota" -chooseServerOnMisskeyHub: "Elegir un servidor en Misskey Hub" -specifyServerHost: "Especifica una instancia directamente" -inputHostName: "Introduzca el dominio" general: "General" wallpaper: "Fondo de pantalla" setWallpaper: "Establecer fondo de pantalla" @@ -246,7 +234,7 @@ done: "Terminado" processing: "Procesando" preview: "Vista previa" default: "Predeterminado" -defaultValueIs: "Por defecto: {value}" +defaultValueIs: "Predeterminado" noCustomEmojis: "No hay emojis personalizados" noJobs: "No hay trabajos" federating: "Federando" @@ -313,7 +301,7 @@ location: "Lugar" theme: "Tema" themeForLightMode: "Tema para usar en Modo Linterna" themeForDarkMode: "Tema para usar en Modo Oscuro" -light: "Claro" +light: "Linterna" dark: "Oscuro" lightThemes: "Tema claro" darkThemes: "Tema oscuro" @@ -391,11 +379,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Habilitar hCaptcha" hcaptchaSiteKey: "Clave del sitio" hcaptchaSecretKey: "Clave secreta" -mcaptcha: "mCaptcha" -enableMcaptcha: "Activar mCaptcha" -mcaptchaSiteKey: "Clave del sitio" -mcaptchaSecretKey: "Clave secreta" -mcaptchaInstanceUrl: "URL del servidor mCaptcha" recaptcha: "reCAPTCHA" enableRecaptcha: "activar reCAPTCHA" recaptchaSiteKey: "Clave del sitio" @@ -411,7 +394,6 @@ name: "Nombre" antennaSource: "Origen de la antena" antennaKeywords: "Palabras clave para recibir" antennaExcludeKeywords: "Palabras clave para excluir" -antennaExcludeBots: "Excluir bots" antennaKeywordsDescription: "Separar con espacios es una declaración AND, separar con una linea nueva es una declaración OR" notifyAntenna: "Notificar nueva nota" withFileAntenna: "Sólo notas con archivos adjuntados" @@ -504,10 +486,8 @@ uiLanguage: "Idioma de visualización de la interfaz" aboutX: "Acerca de {x}" emojiStyle: "Estilo de emoji" native: "Nativo" -menuStyle: "Diseño del menú" -style: "Diseño" +disableDrawer: "No mostrar los menús en cajones" showNoteActionsOnlyHover: "Mostrar acciones de la nota sólo al pasar el cursor" -showReactionsCount: "Mostrar el número de reacciones en las notas" noHistory: "No hay datos en el historial" signinHistory: "Historial de ingresos" enableAdvancedMfm: "Habilitar MFM avanzado" @@ -646,7 +626,6 @@ medium: "Mediano" small: "Pequeño" generateAccessToken: "Generar token de acceso" permission: "Permisos" -adminPermission: "Permiso de administrador" enableAll: "Activar todo" disableAll: "Desactivar todo" tokenRequested: "Permiso de acceso a la cuenta" @@ -690,7 +669,6 @@ useGlobalSettingDesc: "Al activarse, se usará la configuración de notificacion other: "Otro" regenerateLoginToken: "Regenerar token de login" regenerateLoginTokenDescription: "Regenerar el token usado internamente durante el login. No siempre es necesario hacerlo. Al hacerlo de nuevo, se deslogueará en todos los dispositivos." -theKeywordWhenSearchingForCustomEmoji: "Palabra clave para buscar el emoji personalizado." setMultipleBySeparatingWithSpace: "Puedes añadir mas de uno, separado por espacios." fileIdOrUrl: "Id del archivo o URL" behavior: "Comportamiento" @@ -704,7 +682,10 @@ abuseReported: "Se ha enviado el reporte. Muchas gracias." reporter: "Reportador" reporteeOrigin: "Reportar a" reporterOrigin: "Origen del reporte" +forwardReport: "Transferir un informe a una instancia remota" +forwardReportIsAnonymous: "No puede ver su información de la instancia remota y aparecerá como una cuenta anónima del sistema" send: "Enviar" +abuseMarkAsResolved: "Marcar reporte como resuelto" openInNewTab: "Abrir en una Nueva Pestaña" openInSideView: "Abrir en una vista al costado" defaultNavigationBehaviour: "Navegación por defecto" @@ -929,9 +910,6 @@ oneHour: "1 hora" oneDay: "1 día" oneWeek: "1 semana" oneMonth: "1 mes" -threeMonths: "Tres meses" -oneYear: "Un año" -threeDays: "Tres días" reflectMayTakeTime: "Puede pasar un tiempo hasta que se reflejen los cambios" failedToFetchAccountInformation: "No se pudo obtener información de la cuenta" rateLimitExceeded: "Se excedió el límite de peticiones" @@ -1005,7 +983,6 @@ neverShow: "No mostrar de nuevo" remindMeLater: "Recordar después" didYouLikeMisskey: "¿Te gusta Misskey?" pleaseDonate: "{host} usa el software gratuito Misskey. Por favor ¡Considera donar al proyecto principal para que podamos continuar!" -correspondingSourceIsAvailable: "El código fuente correspondiente se encuentra disponible en {anchor}" roles: "Roles" role: "Rol" noRole: "Rol no encontrado" @@ -1056,9 +1033,6 @@ resetPasswordConfirm: "¿Realmente quieres cambiar la contraseña?" sensitiveWords: "Palabras sensibles" sensitiveWordsDescription: "La visibilidad de todas las notas que contienen cualquiera de las palabras configuradas serán puestas en \"Inicio\" automáticamente. Puedes enumerás varias separándolas con saltos de línea" sensitiveWordsDescription2: "Si se usan espacios se crearán expresiones AND y las palabras subsecuentes con barras inclinadas se convertirán en expresiones regulares." -prohibitedWords: "Palabras explícitas" -prohibitedWordsDescription: "Activa un error cuando se intenta publicar una nota que contiene una o varias palabras prohibidas. Se pueden establecer varias palabras, una por línea." -prohibitedWordsDescription2: "Si se usan espacios se crearán expresiones AND y las palabras subsecuentes con barras inclinadas se convertirán en expresiones regulares." hiddenTags: "Hashtags ocultos" hiddenTagsDescription: "Selecciona las etiquetas que no se mostrarán en tendencias. Una etiqueta por línea." notesSearchNotAvailable: "No se puede buscar una nota" @@ -1077,8 +1051,6 @@ limitWidthOfReaction: "Limitar ancho de las reacciones" noteIdOrUrl: "ID o URL de la nota" video: "Video" videos: "Video" -audio: "Sonido" -audioFiles: "Sonido" dataSaver: "Ahorro de datos" accountMigration: "Migración de cuenta" accountMoved: "Este usuario se movió a una nueva cuenta:" @@ -1106,8 +1078,6 @@ preservedUsernames: "Nombre de usuario reservado" preservedUsernamesDescription: "La lista de nombres de usuario para reservar tienen que separarse con saltos de línea.\nEstos estarán indisponibles durante la creación de cuentas, pero pueden ser usados para que los administradores puedan crear esas cuentas manualmente. Las cuentas existentes con esos nombres de usuario no se verán afectadas." createNoteFromTheFile: "Componer una nota desde éste archivo" archive: "Archivo" -archived: "Archivado" -unarchive: "Desarchivar" channelArchiveConfirmTitle: "¿Seguro de archivar {name}?" channelArchiveConfirmDescription: "Un canal archivado no aparecerá en la lista de canales ni en los resultados. Las nuevas publicaciones tampoco serán añadidas." thisChannelArchived: "El canal ha sido archivado." @@ -1176,7 +1146,6 @@ showRenotes: "Mostrar renotas" edited: "Editado" notificationRecieveConfig: "Ajustes de Notificaciones" mutualFollow: "Os seguís mutuamente" -followingOrFollower: "Siguiendo o seguidor" fileAttachedOnly: "Solo notas con archivos" showRepliesToOthersInTimeline: "Mostrar respuestas a otros en la línea de tiempo" hideRepliesToOthersInTimeline: "Ocultar respuestas a otros en la línea de tiempo" @@ -1185,13 +1154,6 @@ hideRepliesToOthersInTimelineAll: "Ocultar tus respuestas a otros usuarios que s confirmShowRepliesAll: "Esta operación es irreversible. ¿Confirmas que quieres mostrar tus respuestas a otros usuarios que sigues en tu línea de tiempo?" confirmHideRepliesAll: "Esta operación es irreversible. ¿Confirmas que quieres ocultar tus respuestas a otros usuarios que sigues en tu línea de tiempo?" externalServices: "Servicios Externos" -sourceCode: "Código fuente" -sourceCodeIsNotYetProvided: "El código fuente aún no está disponible. Contacta con el administrador para solucionarlo." -repositoryUrl: "URL del repositorio" -repositoryUrlDescription: "Si estás usando Misskey tal cual (sin cambios en el código fuente), entra en https://github.com/misskey-dev/misskey" -repositoryUrlOrTarballRequired: "Si no has publicado un repositorio aún, deberás publicar un tarball en su lugar. Mira el archivo .config/example.yml para más información." -feedback: "Comentarios" -feedbackUrl: "URL de comentarios" impressum: "Impressum" impressumUrl: "Impressum URL" impressumDescription: "En algunos países, como Alemania, la inclusión del operador de datos (el Impressum) es requerido legalmente para sitios web comerciales." @@ -1219,61 +1181,6 @@ remainingN: "Faltan: {n}" overwriteContentConfirm: "¿Quieres sustituir todo el contenido actual?" seasonalScreenEffect: "Efectos de pantalla asociados a estaciones" decorate: "Decorar" -addMfmFunction: "Añadir función MFM" -enableQuickAddMfmFunction: "Activar acceso rápido para añadir funciones MFM" -bubbleGame: "Bubble Game" -sfx: "Efectos de sonido" -soundWillBePlayed: "Se reproducirán efectos sonoros" -showReplay: "Ver reproducción" -replay: "Reproducir" -replaying: "Reproduciendo" -endReplay: "Terminar reproducción" -copyReplayData: "Copiar datos de reproducción" -ranking: "Clasificación" -lastNDays: "Últimos {n} días" -backToTitle: "Regresar al inicio" -hemisphere: "Región" -withSensitive: "Mostrar notas que contengan material sensible" -userSaysSomethingSensitive: "La publicación de {name} contiene material sensible" -enableHorizontalSwipe: "Deslice para cambiar de pestaña" -loading: "Cargando" -surrender: "detener" -gameRetry: "Reintentar" -notUsePleaseLeaveBlank: "Dejar en blanco si no se usa" -useTotp: "Introduce la contraseña de un solo uso" -useBackupCode: "Usar códigos de respaldo" -launchApp: "Ejecutar la app" -useNativeUIForVideoAudioPlayer: "Usar la interfaz del navegador cuando se reproduce audio y vídeo" -keepOriginalFilename: "Mantener el nombre original del archivo" -noDescription: "No hay descripción" -alwaysConfirmFollow: "Confirmar siempre cuando se sigue a alguien" -inquiry: "Contacto" -tryAgain: "Por favor , inténtalo de nuevo" -performance: "Rendimiento" -unknownWebAuthnKey: "Esto no se ha registrado llave maestra." -messageToFollower: "Mensaje a seguidores" -_abuseUserReport: - accept: "Acepte" - reject: "repudio" -_delivery: - stop: "Suspendido" - _type: - none: "Publicando" -_bubbleGame: - howToPlay: "Cómo jugar" - hold: "Mantener" - _score: - score: "Puntos" - scoreYen: "Cantidad de dinero ganada" - highScore: "Puntuación más alta" - maxChain: "Número máximo de cadenas" - yen: "{yen} Yenes" - estimatedQty: "{qty} Piezas" - scoreSweets: "{onigiriQtyWithUnit} Onigiris" - _howToPlay: - section1: "Ajuste la posición y deje caer el objeto en la caja" - section2: "Cuando dos objetos del mismo tipo se tocan, cambian a otro tipo y consigues puntos" - section3: "El juego termina cuando la caja se desborda de objetos. ¡Intenta conseguir una puntuación alta al juntar objetos mientras evitas desbordar la caja!" _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." @@ -1387,7 +1294,7 @@ _serverSettings: _accountMigration: moveFrom: "Trasladar de otra cuenta a ésta" moveFromSub: "Crear un alias para otra cuenta." - moveFromLabel: "Cuenta desde la que se realiza el traslado #{n}" + moveFromLabel: "Cuenta desde la que se realiza el traslado:" moveFromDescription: "Si quieres transferir seguidores de otra cuenta a esta cuenta y trasladarlos, tendrás que crear un alias aquí. Asegúrate de crearlo antes de realizar el traslado. Introduce la cuenta desde la que estás moviendo los seguidores así: @person@instance.com" moveTo: "Mover esta cuenta a una nueva" moveToLabel: "Cuenta destino:" @@ -1644,13 +1551,6 @@ _achievements: _tutorialCompleted: title: "Diploma del Curso Básico de Misskey" description: "Tutorial completado" - _bubbleGameExplodingHead: - title: "🤯" - description: "El objeto más grande en el juego de burbujas" - _bubbleGameDoubleExplodingHead: - title: "Doble 🤯" - description: "Dos de los objetos más grandes en el juego de burbujas al mismo tiempo" - flavor: "Puedes llenar el bento un poco de esta forma 🤯 🤯." _role: new: "Crear rol" edit: "Editar rol" @@ -1691,7 +1591,6 @@ _role: gtlAvailable: "Explorar la línea de tiempo global" ltlAvailable: "Explorar la línea de tiempo local" canPublicNote: "Permitir la publicación" - mentionMax: "Número máximo de menciones en una nota" canInvite: "Puede crear códigos de invitación" inviteLimit: "Límite de invitaciones" inviteLimitCycle: "Enfriamiento del límite de invitaciones" @@ -1715,13 +1614,8 @@ _role: canUseTranslator: "Uso de traductor" avatarDecorationLimit: "Número máximo de decoraciones de avatar" _condition: - roleAssignedTo: "Asignado a roles manuales" isLocal: "Usuario local" isRemote: "Usuario remoto" - isCat: "Usuarios Gato" - isBot: "Usuarios Bot" - isSuspended: "Usuario suspendido" - isLocked: "Cuentas privadas" createdLessThan: "Menos de X han pasado desde la creación de la cuenta" createdMoreThan: "Más de X han pasado desde la creación de la cuenta" followersLessThanOrEq: "Tiene X o menos seguidores" @@ -1791,7 +1685,6 @@ _plugin: installWarn: "Por favor no instale plugins que no son de confianza" manage: "Gestionar plugins" viewSource: "Ver la fuente" - viewLog: "Ver log" _preferencesBackups: list: "Respaldos creados" saveNew: "Guardar nuevo respaldo" @@ -1821,8 +1714,6 @@ _aboutMisskey: contributors: "Principales colaboradores" allContributors: "Todos los colaboradores" source: "Código fuente" - original: "Original" - thisIsModifiedVersion: "{name} usa una versión modificada de Misskey." translation: "Traducir Misskey" donate: "Donar a Misskey" morePatrons: "Muchas más personas nos apoyan. Muchas gracias🥰" @@ -1930,6 +1821,7 @@ _theme: buttonBg: "Fondo de botón" buttonHoverBg: "Fondo de botón (hover)" inputBorder: "Borde de los campos de entrada" + listItemHoverBg: "Fondo de elemento de listas (hover)" driveFolderBg: "Fondo de capeta del drive" wallpaperOverlay: "Transparencia del fondo de pantalla" badge: "Medalla" @@ -1941,6 +1833,8 @@ _sfx: note: "Notas" noteMy: "Nota (a mí mismo)" notification: "Notificaciones" + antenna: "Antena receptora" + channel: "Notificaciones del canal" reaction: "Al seleccionar una reacción" _soundSettings: driveFile: "Usar un archivo de audio en Drive" @@ -1978,6 +1872,7 @@ _2fa: registerTOTP: "Registrar aplicación autenticadora" 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." 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." @@ -2001,7 +1896,6 @@ _2fa: 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." - moreDetailedGuideHere: "Guía detallada" _permissions: "read:account": "Ver información de la cuenta" "write:account": "Editar información de la cuenta" @@ -2039,54 +1933,6 @@ _permissions: "write:flash": "Editar Plays" "read:flash-likes": "Ver los Play que me gustan" "write:flash-likes": "Editar lista de Play que me gustan" - "read:admin:abuse-user-reports": "Ver reportes de usuarios" - "write:admin:delete-account": "Eliminar cuentas de usuario" - "write:admin:delete-all-files-of-a-user": "Eliminar todos los archivos de un usuario" - "read:admin:index-stats": "Ver datos indexados" - "read:admin:table-stats": "Ver estadísticas de las tablas de la base de datos" - "read:admin:user-ips": "Ver dirección IP de usuario" - "read:admin:meta": "Ver metadatos de la instancia" - "write:admin:reset-password": "Restablecer contraseñas de usuario" - "write:admin:resolve-abuse-user-report": "Resolución de reportes de usuario" - "write:admin:send-email": "Enviar email" - "read:admin:server-info": "Ver información del servidor" - "read:admin:show-moderation-log": "Ver log de moderación" - "read:admin:show-user": "Ver información privada de usuario" - "write:admin:suspend-user": "Suspender cuentas de usuario" - "write:admin:unset-user-avatar": "Quitar avatares de usuario" - "write:admin:unset-user-banner": "Quitar banner de usuarios" - "write:admin:unsuspend-user": "Quitar suspensión de cuentas de usuario" - "write:admin:meta": "Edición de metadatos de la instancia" - "write:admin:user-note": "Moderación de notas" - "write:admin:roles": "Edición de roles de usuario" - "read:admin:roles": "Ver roles de usuario" - "write:admin:relays": "Edición de relays" - "read:admin:relays": "Ver relays" - "write:admin:invite-codes": "Edición de códigos de invitación" - "read:admin:invite-codes": "Ver códigos de invitación" - "write:admin:announcements": "Edición de anuncios" - "read:admin:announcements": "Ver anuncios" - "write:admin:avatar-decorations": "Edición de decoración de avatares" - "read:admin:avatar-decorations": "Ver decoraciones de avatar" - "write:admin:federation": "Edición de federación de instancias" - "write:admin:account": "Edición de cuentas de usuario" - "read:admin:account": "Ver cuentas de usuario" - "write:admin:emoji": "Edición de emojis" - "read:admin:emoji": "Ver emojis" - "write:admin:queue": "Edición de cola de tareas" - "read:admin:queue": "Ver cola de tareas" - "write:admin:promo": "Edición de promociones" - "write:admin:drive": "Edición de Drive de usuarios" - "read:admin:drive": "Ver Drive de usuarios" - "read:admin:stream": "Usar la API de Websocket para administradores" - "write:admin:ad": "Edición de anuncios" - "read:admin:ad": "Ver anuncios" - "write:invite-codes": "Crear códigos de invitación" - "read:invite-codes": "Ver códigos de invitación" - "write:clip-favorite": "Marcar me gusta en clips" - "read:clip-favorite": "Ver los clips que me gustan" - "read:federation": "Ver instancias federadas" - "write:report-abuse": "Crear reportes de usuario" _auth: shareAccessTitle: "Permisos de la aplicación" shareAccess: "¿Desea permitir el acceso a la cuenta \"{name}\"?" @@ -2208,7 +2054,6 @@ _profile: _exportOrImport: allNotes: "Todas las notas" favoritedNotes: "Notas favoritas" - clips: "Clip" followingList: "Siguiendo" muteList: "Silenciados" blockingList: "Bloqueados" @@ -2262,7 +2107,6 @@ _play: title: "Título" script: "Script" summary: "Descripción" - visibilityDescription: "Poniéndola como privada significa que no será visible en tu perfil, pero cualquiera que tenga la URL aún podrá acceder a ella." _pages: newPage: "Crear página" editPage: "Editar página" @@ -2307,8 +2151,6 @@ _pages: section: "Sección" image: "Imagen" button: "Botón" - dynamic: "Bloques Dinámicos" - dynamicDescription: "Los bloques dinámicos están obsoletos. A partir de ahora, utiliza {play} por favor." note: "Nota embebida" _note: id: "Id de la nota" @@ -2354,8 +2196,6 @@ _notification: followRequestAccepted: "El seguimiento fue aceptado" roleAssigned: "Rol asignado" achievementEarned: "Logro desbloqueado" - login: "Iniciar sesión" - test: "Pruebas de nofiticaciones" app: "Notificaciones desde aplicaciones" _actions: followBack: "Te sigue de vuelta" @@ -2405,6 +2245,7 @@ _webhookSettings: createWebhook: "Crear Webhook" name: "Nombre" secret: "Secreto" + events: "Eventos de webhook" active: "Activado" _events: follow: "Cuando se sigue a alguien" @@ -2414,14 +2255,6 @@ _webhookSettings: renote: "Cuando reciba un \"re-note\"" reaction: "Cuando se recibe una reacción" mention: "Cuando hay una mención" - _systemEvents: - userCreated: "Cuando se crea el usuario." -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "Correo" - webhook: "Webhook" - keywords: "Palabras Clave" _moderationLogTypes: createRole: "Rol creado" deleteRole: "Rol eliminado" @@ -2520,19 +2353,3 @@ _dataSaver: _code: title: "Resaltar código" description: "Si se usa resaltado de código en MFM, etc., no se cargará hasta pulsar en ello. El resaltado de sintaxis requiere la descarga de archivos de definición para cada lenguaje de programación. Debido a esto, al deshabilitar la carga automática de estos archivos reducirás el consumo de datos." -_hemisphere: - N: "Hemisferio norte" - S: "Hemisferio sur" -_reversi: - reversi: "Reversi" - rules: "Reglas" - won: "{name} ha ganado" - total: "Total" -_urlPreviewSetting: - timeout: "Timeout de la carga de vista previa de las URLs (ms)" - maximumContentLength: "Content-Length Máximo (bytes)" - userAgent: "User-Agent" -_mediaControls: - pip: "Picture in Picture" - playbackRate: "Velocidad de reproducción" - loop: "Reproducción en bucle" diff --git a/locales/fr-FR.yml b/locales/fr-FR.yml index a7060c06fc..26e756e96e 100644 --- a/locales/fr-FR.yml +++ b/locales/fr-FR.yml @@ -2,7 +2,7 @@ _lang_: "Français" headlineMisskey: "Réseau relié par des notes" introMisskey: "Bienvenue ! Misskey est un service de microblogage décentralisé, libre et ouvert.\nÉcrivez des « notes » et partagez ce qui se passe à l’instant présent, autour de vous avec les autres 📡\nLa fonction « réactions », vous permet également d’ajouter une réaction rapide aux notes des autres utilisateur·rice·s 👍\nExplorons un nouveau monde 🚀" -poweredByMisskeyDescription: "{name} est l'un des services propulsés par la plateforme ouverte Misskey (appelée \"instance Misskey\")." +poweredByMisskeyDescription: "{nom} est l'un des services propulsés par la plateforme ouverte Misskey (appelée \"instance Misskey\")." monthAndDay: "{day}/{month}" search: "Rechercher" notifications: "Notifications" @@ -129,8 +129,7 @@ overwriteFromPinnedEmojisForReaction: "Remplacer par les émojis épinglés pour overwriteFromPinnedEmojis: "Remplacer par les émojis épinglés globalement" reactionSettingDescription2: "Déplacer pour réorganiser, cliquer pour effacer, utiliser « + » pour ajouter." rememberNoteVisibility: "Se souvenir de la visibilité des notes" -attachCancel: "Supprimer le fichier joint" -deleteFile: "Fichier supprimé" +attachCancel: "Supprimer le fichier attaché" markAsSensitive: "Marquer comme sensible" unmarkAsSensitive: "Supprimer le marquage comme sensible" enterFileName: "Entrer le nom du fichier" @@ -169,7 +168,7 @@ cacheRemoteSensitiveFilesDescription: "Si vous désactivez ce paramètre, les fi flagAsBot: "Ce compte est un robot" flagAsBotDescription: "Si ce compte est géré de manière automatisée, choisissez cette option. Si elle est activée, elle agira comme un marqueur pour les autres développeurs afin d'éviter des chaînes d'interaction sans fin avec d'autres robots et d'ajuster les systèmes internes de Misskey pour traiter ce compte comme un robot." flagAsCat: "Ce compte est un chat" -flagAsCatDescription: "Miaou miaou miaou ?" +flagAsCatDescription: "Activer l'option \" Je suis un chat \" pour ce compte." flagShowTimelineReplies: "Afficher les réponses dans le fil" flagShowTimelineRepliesDescription: "Affiche les réponses des utilisateurs aux notes des autres utilisateurs dans la timeline si cette option est activée." autoAcceptFollowed: "Accepter automatiquement les demandes d’abonnement venant d’utilisateur·rice·s que vous suivez" @@ -380,11 +379,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Activer hCaptcha" hcaptchaSiteKey: "Clé du site" hcaptchaSecretKey: "Clé secrète" -mcaptcha: "mCaptcha" -enableMcaptcha: "Activer mCaptcha" -mcaptchaSiteKey: "Clé du site" -mcaptchaSecretKey: "Clé secrète" -mcaptchaInstanceUrl: "URL de l'instance de mCaptcha" recaptcha: "reCAPTCHA" enableRecaptcha: "Activer reCAPTCHA" recaptchaSiteKey: "Clé du site" @@ -400,10 +394,9 @@ name: "Nom" antennaSource: "Source de l’antenne" antennaKeywords: "Mots clés à recevoir" antennaExcludeKeywords: "Mots clés à exclure" -antennaExcludeBots: "Exclure les comptes robot" antennaKeywordsDescription: "Séparer avec des espaces pour la condition AND. Séparer avec un saut de ligne pour une condition OR." notifyAntenna: "Me notifier pour les nouvelles notes" -withFileAntenna: "Notes ayant des fichiers joints uniquement" +withFileAntenna: "Notes ayant des attachements uniquement" enableServiceworker: "Activer ServiceWorker" antennaUsersDescription: "Saisissez un seul nom d’utilisateur·rice par ligne" caseSensitive: "Sensible à la casse" @@ -493,8 +486,8 @@ uiLanguage: "Langue d’affichage de l’interface" aboutX: "À propos de {x}" emojiStyle: "Style des émojis" native: "Natif" +disableDrawer: "Les menus ne s'affichent pas dans le tiroir" showNoteActionsOnlyHover: "Afficher les actions de note uniquement au survol" -showReactionsCount: "Afficher le nombre de réactions des notes" noHistory: "Pas d'historique" signinHistory: "Historique de connexion" enableAdvancedMfm: "Activer la MFM avancée" @@ -527,7 +520,7 @@ hideThisNote: "Masquer cette note" showFeaturedNotesInTimeline: "Afficher les notes des Tendances dans le fil d'actualité" objectStorage: "Stockage d'objets" useObjectStorage: "Utiliser le stockage d'objets" -objectStorageBaseUrl: "URL de base" +objectStorageBaseUrl: "Base URL" objectStorageBaseUrlDesc: "Préfixe d’URL utilisé pour construire l’URL vers le référencement d’objet (média). Spécifiez son URL si vous utilisez un CDN ou un proxy, sinon spécifiez l’adresse accessible au public selon le guide de service que vous allez utiliser. P.ex. 'https://.s3.amazonaws.com' pour AWS S3 et 'https://storage.googleapis.com/' pour GCS." objectStorageBucket: "Bucket" objectStorageBucketDesc: "Veuillez spécifier le nom du compartiment utilisé sur le service configuré." @@ -542,7 +535,6 @@ objectStorageUseSSLDesc: "Désactivez cette option si vous n'utilisez pas HTTPS objectStorageUseProxy: "Se connecter via proxy" objectStorageUseProxyDesc: "Désactivez cette option si vous n'utilisez pas de proxy pour la connexion API" objectStorageSetPublicRead: "Régler sur « public » lors de l'envoi" -s3ForcePathStyleDesc: "Si s3ForcePathStyle est activé, le nom du compartiment doit être spécifié comme une partie du chemin de l'URL plutôt que le nom d'hôte. Il faudra peut-être l'activer lors de l'utilisation d'une instance de Minio autohébergée, etc." serverLogs: "Journal du serveur" deleteAll: "Supprimer tout" showFixedPostForm: "Afficher le formulaire de publication en haut du fil d'actualité" @@ -633,7 +625,6 @@ medium: "Moyen" small: "Petit" generateAccessToken: "Générer un jeton d'accès" permission: "Autorisations " -adminPermission: "Droits de l'administrateur" enableAll: "Tout activer" disableAll: "Tout désactiver" tokenRequested: "Autoriser l'accès au compte" @@ -657,7 +648,7 @@ testEmail: "Tester la distribution de courriel" wordMute: "Filtre de mots" hardWordMute: "Filtre de mots dur" regexpError: "Erreur d’expression régulière" -regexpErrorDescription: "Une erreur s'est produite dans l'expression régulière sur la ligne {line} de votre mot muet {tab} :" +regexpErrorDescription: "Une erreur s'est produite dans l'expression régulière sur la ligne {ligne} de votre mot muet {tab} :" instanceMute: "Instance en sourdine" userSaysSomething: "{name} a dit quelque chose" makeActive: "Activer" @@ -677,7 +668,6 @@ useGlobalSettingDesc: "S'il est activé, les paramètres de notification de votr other: "Autre" regenerateLoginToken: "Régénérer le jeton de connexion" regenerateLoginTokenDescription: "Générer un nouveau jeton d'authentification. Cette opération ne devrait pas être nécessaire ; lors de la génération d'un nouveau jeton, tous les appareils seront déconnectés. " -theKeywordWhenSearchingForCustomEmoji: "Ce mot-clé est utilisé lors de la recherche des émojis personnalisés." setMultipleBySeparatingWithSpace: "Vous pouvez en définir plusieurs, en les séparant par des espaces." fileIdOrUrl: "ID du fichier ou URL" behavior: "Comportement" @@ -691,7 +681,10 @@ abuseReported: "Le rapport est envoyé. Merci." reporter: "Signalé par" reporteeOrigin: "Origine du signalement" reporterOrigin: "Signalé par" +forwardReport: "Transférer le signalement à l’instance distante" +forwardReportIsAnonymous: "L'instance distante ne sera pas en mesure de voir vos informations et apparaîtra comme un compte anonyme du système." send: "Envoyer" +abuseMarkAsResolved: "Marquer le signalement comme résolu" openInNewTab: "Ouvrir dans un nouvel onglet" openInSideView: "Ouvrir en vue latérale" defaultNavigationBehaviour: "Navigation par défaut" @@ -703,7 +696,7 @@ system: "Système" switchUi: "Modifier l'interface utilisateur" desktop: "Bureau" clip: "Clip" -createNew: "Créer" +createNew: "Créer nouveau" optional: "Facultatif" createNewClip: "Créer un nouveau clip" unclip: "Supprimer le clip" @@ -989,7 +982,6 @@ neverShow: "Ne plus afficher" remindMeLater: "Peut-être plus tard" didYouLikeMisskey: "Avez-vous aimé Misskey ?" pleaseDonate: "Misskey est le logiciel libre utilisé par {host}. Merci de faire un don pour que nous puissions continuer à le développer !" -correspondingSourceIsAvailable: "Le code source correspondant est disponible à {anchor}" roles: "Rôles" role: "Rôles" noRole: "Aucun rôle" @@ -1004,7 +996,6 @@ youCannotCreateAnymore: "Vous avez atteint la limite de création." cannotPerformTemporary: "Temporairement indisponible" cannotPerformTemporaryDescription: "Temporairement indisponible puisque le nombre d'opérations dépasse la limite. Veuillez patienter un peu, puis réessayer." invalidParamError: "Paramètres invalides" -invalidParamErrorDescription: "Les paramètres de la requête sont invalides. Il s'agit généralement d'un bogue, mais cela peut aussi être causé par un excès de caractères ou quelque chose de similaire." permissionDeniedError: "Opération refusée" permissionDeniedErrorDescription: "Ce compte n'a pas la permission d'effectuer cette opération." preset: "Préréglage" @@ -1018,7 +1009,6 @@ thisPostMayBeAnnoyingCancel: "Annuler" thisPostMayBeAnnoyingIgnore: "Publier quand-même" collapseRenotes: "Réduire les renotes déjà vues" internalServerError: "Erreur interne du serveur" -internalServerErrorDescription: "Une erreur inattendue s'est produite sur le serveur." copyErrorInfo: "Copier les détails de l’erreur" joinThisServer: "S'inscrire à cette instance" exploreOtherServers: "Trouver une autre instance" @@ -1038,20 +1028,12 @@ nonSensitiveOnlyForLocalLikeOnlyForRemote: "Non sensibles seulement (mentions j' rolesAssignedToMe: "Rôles attribués à moi" resetPasswordConfirm: "Souhaitez-vous réinitialiser votre mot de passe ?" sensitiveWords: "Mots sensibles" -sensitiveWordsDescription: "Définir la visibilité des notes contenant un mot défini ici au fil principal automatiquement. Vous pouvez définir plusieurs valeurs en les séparant par des sauts de ligne." -sensitiveWordsDescription2: "Séparer par une espace pour créer une expression AND ; entourer de barres obliques pour créer une expression régulière." -prohibitedWords: "Mots interdits" -prohibitedWordsDescription: "Publier une note contenant un mot défini ici produira une erreur. Vous pouvez définir plusieurs valeurs en les séparant par des sauts de ligne." -prohibitedWordsDescription2: "Séparer par une espace pour créer une expression AND ; entourer de barres obliques pour créer une expression régulière." hiddenTags: "Hashtags cachés" hiddenTagsDescription: "Les hashtags définis ne s'afficheront pas dans les tendances. Vous pouvez définir plusieurs hashtags en faisant un saut de ligne." notesSearchNotAvailable: "La recherche de notes n'est pas disponible." license: "Licence" -unfavoriteConfirm: "Vraiment supprimer des favoris ?" myClips: "Mes clips" drivecleaner: "Nettoyeur du Disque" -retryAllQueuesNow: "Réessayer tous les fils d'attente immédiatement" -retryAllQueuesConfirmTitle: "Vraiment réessayer ?" retryAllQueuesConfirmText: "Cela peut augmenter temporairement la charge du serveur." enableChartsForRemoteUser: "Générer les graphiques pour les utilisateurs distants" enableChartsForFederatedInstances: "Générer les graphiques pour les instances distantes" @@ -1061,8 +1043,6 @@ limitWidthOfReaction: "Limiter la largeur maximale des réactions et les affiche noteIdOrUrl: "Identifiant de la note ou URL" video: "Vidéo" videos: "Vidéos" -audio: "Audio" -audioFiles: "Fichiers audio" dataSaver: "Économiseur de données" accountMigration: "Migration de compte" accountMoved: "Cet·te utilisateur·rice a migré son compte vers :" @@ -1087,13 +1067,9 @@ pleaseConfirmBelowBeforeSignup: "Pour vous inscrire sur cette instance, vous dev pleaseAgreeAllToContinue: "Pour continuer, veuillez accepter tous les champs ci-dessus." continue: "Continuer" preservedUsernames: "Noms d'utilisateur·rice réservés" -preservedUsernamesDescription: "Énumérez les noms d'utilisateur à réserver, séparés par des nouvelles lignes. Les noms d'utilisateur spécifiés ici ne seront plus utilisables lors de la création d'un compte, sauf la création manuelle par un administrateur. De plus, les comptes existants ne seront pas affectés." createNoteFromTheFile: "Rédiger une note de ce fichier" archive: "Archive" -archived: "Archivé" -unarchive: "Annuler l'archivage" channelArchiveConfirmTitle: "Voulez-vous vraiment archiver {name} ?" -channelArchiveConfirmDescription: "Une fois archivé, le canal n'apparaîtra plus dans la liste des canaux ni dans les résultats de recherche, et la publication des nouvelles notes sera impossible." thisChannelArchived: "Ce canal a été archivé." displayOfNote: "Affichage de la note" initialAccountSetting: "Configuration initiale du profil" @@ -1105,29 +1081,12 @@ specifyUser: "Spécifier l'utilisateur·rice" failedToPreviewUrl: "Aperçu d'URL échoué" update: "Mettre à jour" rolesThatCanBeUsedThisEmojiAsReaction: "Rôles qui peuvent utiliser cet émoji comme réaction" -rolesThatCanBeUsedThisEmojiAsReactionEmptyDescription: "Si aucun rôle n'est spécifié, tout le monde peut utiliser cet émoji comme réaction." -rolesThatCanBeUsedThisEmojiAsReactionPublicRoleWarn: "Il faut un rôle public." -cancelReactionConfirm: "Supprimez la réaction ?" -changeReactionConfirm: "Changer la réaction ?" later: "Plus tard" goToMisskey: "Retour vers Misskey" additionalEmojiDictionary: "Dictionnaires d'émojis additionnels" installed: "Installé" branding: "Image de marque" -enableServerMachineStats: "Publier les statistiques du matériel du serveur" -enableIdenticonGeneration: "Générer les identicons des utilisateurs" -turnOffToImprovePerformance: "Désactiver peut améliorer la performance." -createInviteCode: "Créer un code d'invitation" -createWithOptions: "Options" -createCount: "Quantité à créer" -inviteCodeCreated: "Code d'invitation créé" -inviteLimitExceeded: "Vous avez atteint la limite de codes d'invitation que vous pouvez générer." -createLimitRemaining: "Codes d'invitation pouvant être créés : {limit} restants" -inviteLimitResetCycle: "Vous pouvez créer jusqu'à {limit} codes d'invitation en {time}." expirationDate: "Date d’expiration" -noExpirationDate: "Ne pas expirer" -inviteCodeUsedAt: "Code d'invitation utilisé à" -registeredUserUsingInviteCode: "Code d'invitation utilisé par" waitingForMailAuth: "En attente de la vérification de l'adresse courriel" inviteCodeCreator: "Créateur·rice de ce code d'invitation" usedAt: "Utilisé le" @@ -1136,23 +1095,17 @@ used: "Utilisé" expired: "Expiré" doYouAgree: "Êtes-vous d’accord ?" beSureToReadThisAsItIsImportant: "Assurez-vous de le lire ; c'est important." -iHaveReadXCarefullyAndAgree: "J'ai lu le contenu de « {x} » et donne mon accord." dialog: "Dialogue" icon: "Avatar" forYou: "Pour vous" currentAnnouncements: "Annonces actuelles" pastAnnouncements: "Annonces passées" -youHaveUnreadAnnouncements: "Il y a des annonces non lues." -useSecurityKey: "Suivez les instructions de votre navigateur ou de votre appareil pour utiliser une clé de sécurité ou une clé d'accès." -replies: "Réponses" -renotes: "Renotes" +replies: "Répondre" +renotes: "Renoter" loadReplies: "Inclure les réponses" loadConversation: "Afficher la conversation" pinnedList: "Liste épinglée" -keepScreenOn: "Garder l'écran toujours allumé" -verifiedLink: "Votre propriété de ce lien a été vérifiée" notifyNotes: "Notifier à propos des nouvelles notes" -unnotifyNotes: "Ne pas notifier pour la publication des notes" authentication: "Authentification" authenticationRequiredToContinue: "Veuillez vous authentifier pour continuer" dateAndTime: "Date et heure" @@ -1160,8 +1113,6 @@ showRenotes: "Afficher les renotes" edited: "Modifié" notificationRecieveConfig: "Paramètres des notifications" mutualFollow: "Abonnement mutuel" -followingOrFollower: "Abonnement ou abonné" -fileAttachedOnly: "Avec fichiers joints seulement" showRepliesToOthersInTimeline: "Afficher les réponses aux autres dans le fil" hideRepliesToOthersInTimeline: "Masquer les réponses aux autres dans le fil" showRepliesToOthersInTimelineAll: "Afficher les réponses de toutes les personnes que vous suivez dans le fil" @@ -1169,12 +1120,6 @@ hideRepliesToOthersInTimelineAll: "Masquer les réponses de toutes les personnes confirmShowRepliesAll: "Cette opération est irréversible. Voulez-vous vraiment afficher les réponses de toutes les personnes que vous suivez dans le fil ?" confirmHideRepliesAll: "Cette opération est irréversible. Voulez-vous vraiment masquer les réponses de toutes les personnes que vous suivez dans le fil ?" externalServices: "Services externes" -sourceCode: "Code source" -sourceCodeIsNotYetProvided: "Le code source n'est pas encore disponible. Veuillez signaler ce problème aux administrateurs." -repositoryUrl: "URL du dépôt" -repositoryUrlDescription: "Entrez l'URL du dépôt où se trouve le code source ici. Si vous utilisez Misskey tel quel (sans changer le code source), entrez https://github.com/misskey-dev/misskey" -feedback: "Commentaires" -feedbackUrl: "URL pour les commentaires" impressum: "Impressum" impressumUrl: "URL de l'impressum" impressumDescription: "Dans certains pays comme l'Allemagne, il est obligatoire d'afficher les informations sur l'opérateur d'un site (un impressum)." @@ -1202,63 +1147,17 @@ remainingN: "Restants : {n}" overwriteContentConfirm: "Voulez-vous remplacer le contenu actuel ?" seasonalScreenEffect: "Effet d'écran saisonnier" decorate: "Décorer" -addMfmFunction: "Insérer MFM" -enableQuickAddMfmFunction: "Afficher le sélecteur de MFM avancé" -bubbleGame: "Jeu de bulles" -sfx: "Effets sonores" -soundWillBePlayed: "Le son sera joué" -showReplay: "Voir le replay" -replay: "Rediffusion" -replaying: "En cours de rediffusion" -endReplay: "Arrêter la rediffusion" -copyReplayData: "Copier les données de la rediffusion" -ranking: "Classement" -lastNDays: "Derniers {n} jours" -backToTitle: "Retourner au titre" -hemisphere: "Votre région" -withSensitive: "Afficher les notes contenant des fichiers joints sensibles" -userSaysSomethingSensitive: "Note de {name} contenant des fichiers joints sensibles" -enableHorizontalSwipe: "Glisser pour changer d'onglet" -loading: "Chargement en cours" -surrender: "Annuler" -gameRetry: "Réessayer" -launchApp: "Lancer l'app" -inquiry: "Contact" -_delivery: - status: "Statut de la diffusion" - stop: "Suspendu·e" - _type: - none: "Publié" -_bubbleGame: - howToPlay: "Comment jouer" - hold: "Réserver" - _score: - score: "Score" - scoreYen: "Montant gagné" - highScore: "Meilleur score" - maxChain: "Nombre maximum de chaînes" - yen: "{yen} yens" - estimatedQty: "{qty} pièces" _announcement: - forExistingUsers: "Pour les utilisateurs existants seulement" - needConfirmationToRead: "Exiger la confirmation de la lecture" - needConfirmationToReadDescription: "Si activé, afficher un dialogue de confirmation quand l'annonce est marquée comme lue. Aussi, elle sera exclue de « marquer tout comme lu » ." - end: "Archiver l'annonce" - tooManyActiveAnnouncementDescription: "Un grand nombre d'annonces actives peut baisser l'expérience utilisateur. Considérez d'archiver les annonces obsolètes." readConfirmTitle: "Marquer comme lu ?" - readConfirmText: "Cela marquera le contenu de « {title} » comme lu." shouldNotBeUsedToPresentPermanentInfo: "Puisque cela pourrait nuire considérablement à l'expérience utilisateur pour les nouveaux utilisateurs, il est recommandé d'utiliser les annonces pour afficher des informations temporaires plutôt que des informations persistantes." dialogAnnouncementUxWarn: "Avoir deux ou plus annonces de style dialogue en même temps pourrait nuire considérablement à l'expérience utilisateur. Veuillez les utiliser avec caution." silence: "Ne pas me notifier" silenceDescription: "Si activée, vous ne recevrez pas de notifications sur les annonces et n'aurez pas besoin de les marquer comme lues." _initialAccountSetting: - accountCreated: "Votre compte a été créé avec succès !" - letsStartAccountSetup: "Procédons au réglage initial du compte." - letsFillYourProfile: "Commençons par configurer votre profil !" profileSetting: "Paramètres du profil" privacySetting: "Paramètres de confidentialité" initialAccountSettingCompleted: "Configuration du profil terminée avec succès !" - youCanContinueTutorial: "Vous pouvez procéder au tutoriel sur l'utilisation de {name}(Misskey) ou vous arrêter ici et commencer à l'utiliser immédiatement." + youCanContinueTutorial: "Vous pouvez procéder au tutoriel sur l'utilisation de {nom}(Misskey) ou vous arrêter ici et commencer à l'utiliser immédiatement." startTutorial: "Démarrer le tutoriel" skipAreYouSure: "Désirez-vous ignorer la configuration du profil ?" _initialTutorial: @@ -1322,7 +1221,7 @@ _initialTutorial: doItToContinue: "Marquez le fichier joint comme sensible pour procéder." _done: title: "Le tutoriel est terminé ! 🎉" - description: "Les fonctionnalités introduites ici ne sont que quelques-unes. Pour savoir plus sur l'utilisation de Misskey, veuillez consulter {link}." + description: "Les fonctionnalités introduites ici ne sont que quelques-unes. Pour savoir plus sur l'utilisation de Misskey, veuillez consulter {lien}." _timelineDescription: home: "Sur le fil principal, vous pouvez voir les notes des utilisateurs auxquels vous êtes abonné·e." local: "Sur le fil local, vous pouvez voir les notes de tous les utilisateurs sur cette instance." @@ -1343,7 +1242,6 @@ _accountMigration: startMigration: "Migrer" movedTo: "Compte vers lequel vous migrez :" _achievements: - earnedAt: "Date d'obtention" _types: _notes1: title: "Je viens tout juste de configurer mon msky" @@ -1384,13 +1282,10 @@ _achievements: title: "Régulier III" description: "Se connecter pour un total de 400 jours" _login500: - title: "Expert I" description: "Se connecter pour un total de 500 jours" _login600: - title: "Expert II" description: "Se connecter pour un total de 600 jours" _login700: - title: "Expert III" description: "Se connecter pour un total de 700 jours" _login800: description: "Se connecter pour un total de 800 jours" @@ -1483,14 +1378,11 @@ _role: edit: "Modifier le rôle" name: "Nom du rôle" description: "Description du rôle" - permission: "Autorisations du rôle" + permission: "Rôle et autorisations" assignTarget: "Attribuer" - manual: "Manuel" manualRoles: "Rôles manuels" - conditional: "Conditionnel" conditionalRoles: "Rôles conditionnels" condition: "Condition" - isConditionalRole: "Ceci est un rôle conditionnel." isPublic: "Rôle public" options: "Options" policies: "Stratégies" @@ -1701,6 +1593,7 @@ _theme: buttonBg: "Arrière-plan du bouton" buttonHoverBg: "Arrière-plan du bouton (survolé)" inputBorder: "Cadre de la zone de texte" + listItemHoverBg: "Arrière-plan d'item de liste (survolé)" driveFolderBg: "Arrière-plan du dossier de disque" wallpaperOverlay: "Superposition de fond d'écran" badge: "Badge" @@ -1712,6 +1605,8 @@ _sfx: note: "Nouvelle note" noteMy: "Ma note" notification: "Notifications" + antenna: "Réception de l’antenne" + channel: "Notifications de canal" reaction: "Lors de la sélection de la réaction" _soundSettings: driveFile: "Utiliser un effet sonore sur le Disque" @@ -1904,7 +1799,6 @@ _profile: avatarDecorationMax: "Vous pouvez mettre au plus {max} décorations d'avatar." _exportOrImport: allNotes: "Toutes les notes" - clips: "Clip" followingList: "Abonnements" muteList: "Comptes masqués" blockingList: "Comptes bloqués" @@ -2015,7 +1909,7 @@ _notification: unreadAntennaNote: "Antenne {name}" roleAssigned: "Rôle attribué" emptyPushNotificationMessage: "Les notifications push ont été mises à jour" - achievementEarned: "Accomplissement déverrouillé" + achievementEarned: "Accomplissement" testNotification: "Tester la notification" reactedBySomeUsers: "{n} utilisateur·rice·s ont réagi" renotedBySomeUsers: "{n} utilisateur·rice·s ont renoté" @@ -2032,8 +1926,7 @@ _notification: receiveFollowRequest: "Demande d'abonnement reçue" followRequestAccepted: "Demande d'abonnement acceptée" roleAssigned: "Rôle reçu" - achievementEarned: "Déverrouillage d'accomplissement" - login: "Se connecter" + achievementEarned: "Accomplissement" app: "Notifications provenant des apps" _actions: followBack: "Suivre" @@ -2072,10 +1965,6 @@ _drivecleaner: _webhookSettings: name: "Nom" active: "Activé" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "E-mail " _moderationLogTypes: createRole: "Rôle créé" deleteRole: "Rôle supprimé" @@ -2174,6 +2063,3 @@ _dataSaver: _code: title: "Mise en évidence du code" description: "Si la notation de mise en évidence du code est utilisée, par exemple dans la MFM, elle ne sera pas chargée tant qu'elle n'aura pas été tapée. La mise en évidence du code nécessite le chargement du fichier de définition de chaque langue à mettre en évidence, mais comme ces fichiers ne sont plus chargés automatiquement, on peut s'attendre à une réduction du trafic de données." -_reversi: - waitingBoth: "Préparez-vous" - total: "Total" diff --git a/locales/generateDTS.js b/locales/generateDTS.js index 49807144ec..d3afdd6e15 100644 --- a/locales/generateDTS.js +++ b/locales/generateDTS.js @@ -6,176 +6,54 @@ import ts from 'typescript'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); -const parameterRegExp = /\{(\w+)\}/g; - -function createMemberType(item) { - if (typeof item !== 'string') { - return ts.factory.createTypeLiteralNode(createMembers(item)); - } - const parameters = Array.from( - item.matchAll(parameterRegExp), - ([, parameter]) => parameter, - ); - return parameters.length - ? ts.factory.createTypeReferenceNode( - ts.factory.createIdentifier('ParameterizedString'), - [ - ts.factory.createUnionTypeNode( - parameters.map((parameter) => - ts.factory.createStringLiteral(parameter), - ), - ), - ], - ) - : ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword); -} function createMembers(record) { - return Object.entries(record).map(([k, v]) => { - const node = ts.factory.createPropertySignature( + return Object.entries(record) + .map(([k, v]) => ts.factory.createPropertySignature( undefined, ts.factory.createStringLiteral(k), undefined, - createMemberType(v), - ); - if (typeof v === 'string') { - ts.addSyntheticLeadingComment( - node, - ts.SyntaxKind.MultiLineCommentTrivia, - `* - * ${v.replace(/\n/g, '\n * ')} - `, - true, - ); - } - return node; - }); + typeof v === 'string' + ? ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword) + : ts.factory.createTypeLiteralNode(createMembers(v)), + )); } export default function generateDTS() { const locale = yaml.load(fs.readFileSync(`${__dirname}/ja-JP.yml`, 'utf-8')); const members = createMembers(locale); const elements = [ - ts.factory.createVariableStatement( - [ts.factory.createToken(ts.SyntaxKind.DeclareKeyword)], - ts.factory.createVariableDeclarationList( - [ - ts.factory.createVariableDeclaration( - ts.factory.createIdentifier('kParameters'), - undefined, - ts.factory.createTypeOperatorNode( - ts.SyntaxKind.UniqueKeyword, - ts.factory.createKeywordTypeNode(ts.SyntaxKind.SymbolKeyword), - ), - undefined, - ), - ], - ts.NodeFlags.Const, - ), - ), - ts.factory.createInterfaceDeclaration( - [ts.factory.createToken(ts.SyntaxKind.ExportKeyword)], - ts.factory.createIdentifier('ParameterizedString'), - [ - ts.factory.createTypeParameterDeclaration( - undefined, - ts.factory.createIdentifier('T'), - ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword), - ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword), - ), - ], - undefined, - [ - ts.factory.createPropertySignature( - undefined, - ts.factory.createComputedPropertyName( - ts.factory.createIdentifier('kParameters'), - ), - undefined, - ts.factory.createTypeReferenceNode( - ts.factory.createIdentifier('T'), - undefined, - ), - ), - ], - ), - ts.factory.createInterfaceDeclaration( - [ts.factory.createToken(ts.SyntaxKind.ExportKeyword)], - ts.factory.createIdentifier('ILocale'), - undefined, - undefined, - [ - ts.factory.createIndexSignature( - undefined, - [ - ts.factory.createParameterDeclaration( - undefined, - undefined, - ts.factory.createIdentifier('_'), - undefined, - ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword), - undefined, - ), - ], - ts.factory.createUnionTypeNode([ - ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword), - ts.factory.createTypeReferenceNode( - ts.factory.createIdentifier('ParameterizedString'), - ), - ts.factory.createTypeReferenceNode( - ts.factory.createIdentifier('ILocale'), - undefined, - ), - ]), - ), - ], - ), ts.factory.createInterfaceDeclaration( [ts.factory.createToken(ts.SyntaxKind.ExportKeyword)], ts.factory.createIdentifier('Locale'), undefined, - [ - ts.factory.createHeritageClause(ts.SyntaxKind.ExtendsKeyword, [ - ts.factory.createExpressionWithTypeArguments( - ts.factory.createIdentifier('ILocale'), - undefined, - ), - ]), - ], + undefined, members, ), ts.factory.createVariableStatement( [ts.factory.createToken(ts.SyntaxKind.DeclareKeyword)], ts.factory.createVariableDeclarationList( - [ - ts.factory.createVariableDeclaration( - ts.factory.createIdentifier('locales'), + [ts.factory.createVariableDeclaration( + ts.factory.createIdentifier('locales'), + undefined, + ts.factory.createTypeLiteralNode([ts.factory.createIndexSignature( undefined, - ts.factory.createTypeLiteralNode([ - ts.factory.createIndexSignature( - undefined, - [ - ts.factory.createParameterDeclaration( - undefined, - undefined, - ts.factory.createIdentifier('lang'), - undefined, - ts.factory.createKeywordTypeNode( - ts.SyntaxKind.StringKeyword, - ), - undefined, - ), - ], - ts.factory.createTypeReferenceNode( - ts.factory.createIdentifier('Locale'), - undefined, - ), - ), - ]), - undefined, - ), - ], - ts.NodeFlags.Const, + [ts.factory.createParameterDeclaration( + undefined, + undefined, + ts.factory.createIdentifier('lang'), + undefined, + ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword), + undefined, + )], + ts.factory.createTypeReferenceNode( + ts.factory.createIdentifier('Locale'), + undefined, + ), + )]), + undefined, + )], + ts.NodeFlags.Const | ts.NodeFlags.Ambient | ts.NodeFlags.ContextFlags, ), ), ts.factory.createFunctionDeclaration( @@ -192,39 +70,16 @@ export default function generateDTS() { ), ts.factory.createExportDefault(ts.factory.createIdentifier('locales')), ]; - ts.addSyntheticLeadingComment( - elements[0], - ts.SyntaxKind.MultiLineCommentTrivia, - ' eslint-disable ', - true, + const printed = ts.createPrinter({ + newLine: ts.NewLineKind.LineFeed, + }).printList( + ts.ListFormat.MultiLine, + ts.factory.createNodeArray(elements), + ts.createSourceFile('index.d.ts', '', ts.ScriptTarget.ESNext, true, ts.ScriptKind.TS), ); - ts.addSyntheticLeadingComment( - elements[0], - ts.SyntaxKind.SingleLineCommentTrivia, - ' This file is generated by locales/generateDTS.js', - true, - ); - ts.addSyntheticLeadingComment( - elements[0], - ts.SyntaxKind.SingleLineCommentTrivia, - ' Do not edit this file directly.', - true, - ); - const printed = ts - .createPrinter({ - newLine: ts.NewLineKind.LineFeed, - }) - .printList( - ts.ListFormat.MultiLine, - ts.factory.createNodeArray(elements), - ts.createSourceFile( - 'index.d.ts', - '', - ts.ScriptTarget.ESNext, - true, - ts.ScriptKind.TS, - ), - ); - fs.writeFileSync(`${__dirname}/index.d.ts`, printed, 'utf-8'); + fs.writeFileSync(`${__dirname}/index.d.ts`, `/* eslint-disable */ +// This file is generated by locales/generateDTS.js +// Do not edit this file directly. +${printed}`, 'utf-8'); } diff --git a/locales/hu-HU.yml b/locales/hu-HU.yml index d0fdc027e9..023a91494d 100644 --- a/locales/hu-HU.yml +++ b/locales/hu-HU.yml @@ -1,5 +1,5 @@ --- -_lang_: "Magyar" +_lang_: "Japán" monthAndDay: "{month}.{day}." search: "Keresés" notifications: "Értesítések" @@ -96,7 +96,6 @@ _notification: renote: "Renote" quote: "Idézet" reaction: "Reakciók" - login: "Bejelentkezés" _actions: renote: "Renote" _deck: diff --git a/locales/id-ID.yml b/locales/id-ID.yml index 5d51d2dc78..156af44d89 100644 --- a/locales/id-ID.yml +++ b/locales/id-ID.yml @@ -60,7 +60,6 @@ copyFileId: "Salin Berkas" copyFolderId: "Salin Folder" copyProfileUrl: "Salin Alamat Web Profil" searchUser: "Cari pengguna" -searchThisUsersNotes: "Mencari catatan pengguna" reply: "Balas" loadMore: "Selebihnya" showMore: "Selebihnya" @@ -82,7 +81,7 @@ exportRequested: "Kamu telah meminta ekspor. Ini akan memakan waktu sesaat. Sete importRequested: "Kamu telah meminta impor. Ini akan memakan waktu sesaat." lists: "Daftar" noLists: "Kamu tidak memiliki daftar apapun" -note: "Catatan" +note: "Catat" notes: "Catatan" following: "Ikuti" followers: "Pengikut" @@ -109,14 +108,11 @@ enterEmoji: "Masukkan emoji" renote: "Renote" unrenote: "Hapus renote" renoted: "Telah direnote" -renotedToX: "{name} telah merenote" cantRenote: "Postingan ini tidak dapat direnote" cantReRenote: "Renote tidak dapat direnote" quote: "Kutip" inChannelRenote: "Hanya renote dalam kanal" inChannelQuote: "Hanya kutip dalam kanal" -renoteToChannel: "Renote ke kanal" -renoteToOtherChannel: "Renote ke kanal lainnya" pinnedNote: "Catatan yang disematkan" pinned: "Sematkan ke profil" you: "Kamu" @@ -129,12 +125,9 @@ emojiPicker: "Emoji Picker" pinnedEmojisForReactionSettingDescription: "Atur sematan emoji pada reaksi" pinnedEmojisSettingDescription: "Atur sematan emoji pada masukan emoji" emojiPickerDisplay: "Tampilan Emoji Picker" -overwriteFromPinnedEmojisForReaction: "Timpa dari pengaturan reaksi" -overwriteFromPinnedEmojis: "Timpa dari pengaturan umum" reactionSettingDescription2: "Geser untuk memindah urutan emoji, klik untuk menghapus, tekan \"+\" untuk menambahkan" rememberNoteVisibility: "Ingat pengaturan visibilitas catatan" attachCancel: "Hapus lampiran" -deleteFile: "Berkas dihapus" markAsSensitive: "Tandai sebagai konten sensitif" unmarkAsSensitive: "Hapus tanda konten sensitif" enterFileName: "Masukkan nama berkas" @@ -155,7 +148,6 @@ editList: "Sunting daftar" selectChannel: "Pilih kanal" selectAntenna: "Pilih Antena" editAntenna: "Sunting antena" -createAntenna: "Membuat antena." selectWidget: "Pilih gawit" editWidgets: "Sunting gawit" editWidgetsExit: "Selesai" @@ -182,10 +174,6 @@ addAccount: "Tambahkan akun" reloadAccountsList: "Muat ulang daftar akun" loginFailed: "Gagal untuk masuk" showOnRemote: "Lihat profil asli" -continueOnRemote: "Lihat di peladen asal" -chooseServerOnMisskeyHub: "Pilih peladen dari Misskey Hub" -specifyServerHost: "Tentukan domain peladen" -inputHostName: "Masukkan nama domain" general: "Umum" wallpaper: "Wallpaper" setWallpaper: "Atur wallpaper" @@ -196,7 +184,6 @@ followConfirm: "Apakah kamu yakin ingin mengikuti {name}?" proxyAccount: "Akun proksi" proxyAccountDescription: "Akun proksi merupakan sebuah akun yang bertindak sebagai pengikut instansi luar untuk pengguna dalam kondisi tertentu. Sebagai contoh, ketika pengguna menambahkan seorang pengguna instansi luar ke dalam daftar, aktivitas dari pengguna instansi luar tidak akan disampaikan ke instansi apabila tidak ada pengguna lokal yang mengikuti pengguna tersebut, dengan begitu akun proksilah yang akan mengikutinya." host: "Host" -selectSelf: "Pilih diri sendiri" selectUser: "Pilih pengguna" recipient: "Penerima" annotation: "Keterangan konten" @@ -233,7 +220,6 @@ blockedInstances: "Instansi terblokir" blockedInstancesDescription: "Daftar nama host dari instansi yang diperlukan untuk diblokir. Instansi yang didaftarkan tidak akan dapat berkomunikasi dengan instansi ini." silencedInstances: "Instansi yang disenyapkan" silencedInstancesDescription: "Daftar nama host dari instansi yang ingin kamu senyapkan. Semua akun dari instansi yang terdaftar akan diperlakukan sebagai disenyapkan. Hal ini membuat akun hanya dapat membuat permintaan mengikuti, dan tidak dapat menyebutkan akun lokal apabila tidak mengikuti. Hal ini tidak akan mempengaruhi instansi yang diblokir." -federationAllowedHosts: "Server yang membolehkan federasi" muteAndBlock: "Bisukan / Blokir" mutedUsers: "Pengguna yang dibisukan" blockedUsers: "Pengguna yang diblokir" @@ -324,7 +310,6 @@ selectFile: "Pilih berkas" selectFiles: "Pilih berkas" selectFolder: "Pilih folder" selectFolders: "Pilih folder" -fileNotSelected: "Tidak ada file yang dipilih" renameFile: "Ubah nama berkas" folderName: "Nama folder" createFolder: "Buat folder" @@ -332,7 +317,6 @@ renameFolder: "Ubah nama folder" deleteFolder: "Hapus folder" folder: "Folder" addFile: "Tambahkan berkas" -showFile: "Tampilkan berkas" emptyDrive: "Drive kosong" emptyFolder: "Folder kosong" unableToDelete: "Tidak dapat menghapus" @@ -393,11 +377,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Nyalakan hCaptcha" hcaptchaSiteKey: "Site Key" hcaptchaSecretKey: "Secret Key" -mcaptcha: "mCaptcha" -enableMcaptcha: "Nyalakan mCaptcha" -mcaptchaSiteKey: "Site key" -mcaptchaSecretKey: "Secret Key" -mcaptchaInstanceUrl: "URL instansi mCaptcha" recaptcha: "reCAPTCHA" enableRecaptcha: "Nyalakan reCAPTCHA" recaptchaSiteKey: "Site key" @@ -413,7 +392,6 @@ name: "Nama" antennaSource: "Sumber Antenna" antennaKeywords: "Kata kunci yang diterima" antennaExcludeKeywords: "Kata kunci yang dikecualikan" -antennaExcludeBots: "Kecualikan akun bot" antennaKeywordsDescription: "Pisahkan dengan spasi untuk kondisi AND. Pisahkan dengan baris baru untuk kondisi OR." notifyAntenna: "Beritahu untuk catatan baru" withFileAntenna: "Hanya tampilkan catatan dengan berkas yang dilampirkan" @@ -481,7 +459,6 @@ retype: "Masukkan ulang" noteOf: "Catatan milik {user}" quoteAttached: "Dikutip" quoteQuestion: "Apakah kamu ingin menambahkan kutipan?" -attachAsFileQuestion: "Teks dalam papan klip terlalu panjang. Apakah kamu ingin melampirkannya sebagai berkas teks?" noMessagesYet: "Tidak ada pesan" newMessageExists: "Kamu mendapatkan pesan baru" onlyOneFileCanBeAttached: "Kamu hanya dapat melampirkan satu berkas ke dalam pesan" @@ -507,10 +484,8 @@ uiLanguage: "Bahasa antarmuka pengguna" aboutX: "Tentang {x}" emojiStyle: "Gaya emoji" native: "Native" -menuStyle: "Gaya menu" -style: "Gaya" +disableDrawer: "Jangan gunakan menu bergaya laci" showNoteActionsOnlyHover: "Hanya tampilkan aksi catatan saat ditunjuk" -showReactionsCount: "Lihat jumlah reaksi dalam catatan" noHistory: "Tidak ada riwayat" signinHistory: "Riwayat masuk" enableAdvancedMfm: "Nyalakan MFM tingkat lanjut" @@ -649,7 +624,6 @@ medium: "Sedang" small: "Kecil" generateAccessToken: "Buat token akses" permission: "Izin" -adminPermission: "Wewenang Izin Admin" enableAll: "Aktifkan semua" disableAll: "Nonaktifkan semua" tokenRequested: "Berikan ijin akses ke akun" @@ -693,7 +667,6 @@ useGlobalSettingDesc: "Jika dinyalakan, setelan notifikasi akun kamu akan diguna other: "Lainnya" regenerateLoginToken: "Perbarui token login" regenerateLoginTokenDescription: "Perbarui token yang digunakan secara internal saat login. Normalnya aksi ini tidak diperlukan. Jika diperbarui, semua perangkat akan dilogout." -theKeywordWhenSearchingForCustomEmoji: "Kata kunci ini digunakan untuk mencari emoji kustom yang dicari." setMultipleBySeparatingWithSpace: "Kamu dapat menyetel banyak dengan memisahkannya menggunakan spasi." fileIdOrUrl: "File-ID atau URL" behavior: "Perilaku" @@ -707,7 +680,10 @@ abuseReported: "Laporan kamu telah dikirimkan. Terima kasih." reporter: "Pelapor" reporteeOrigin: "Yang dilaporkan" reporterOrigin: "Pelapor" +forwardReport: "Teruskan laporan ke instansi luar" +forwardReportIsAnonymous: "Untuk melindungi privasi akun kamu, akun anonim dari sistem akan digunakan sebagai pelapor pada instansi luar." send: "Kirim" +abuseMarkAsResolved: "Tandai laporan sebagai selesai" openInNewTab: "Buka di tab baru" openInSideView: "Buka di tampilan samping" defaultNavigationBehaviour: "Navigasi bawaan" @@ -903,8 +879,6 @@ makeReactionsPublicDescription: "Pengaturan ini akan membuat daftar dari semua r classic: "Klasik" muteThread: "Bisukan thread" unmuteThread: "Suarakan thread" -followingVisibility: "Visibilitas mengikuti" -followersVisibility: "Visibilitas pengikut" continueThread: "Lihat lanjutan thread" deleteAccountConfirm: "Akun akan dihapus. Apakah kamu yakin?" incorrectPassword: "Kata sandi salah." @@ -932,9 +906,6 @@ oneHour: "1 Jam" oneDay: "1 Hari" oneWeek: "1 Bulan" oneMonth: "satu bulan" -threeMonths: "3 bulan" -oneYear: "1 tahun" -threeDays: "3 hari" reflectMayTakeTime: "Mungkin perlu beberapa saat untuk dicerminkan." failedToFetchAccountInformation: "Gagal untuk mendapatkan informasi akun" rateLimitExceeded: "Batas sudah terlampaui" @@ -1008,7 +979,6 @@ neverShow: "Jangan tampilkan lagi" remindMeLater: "Mungkin nanti" didYouLikeMisskey: "Apakah kamu mulai menyukai Misskey?" pleaseDonate: "{host} menggunakan perangkat lunak bebas yaitu Misskey. Kami sangat mengapresiasi sekali donasi dari kamu agar pengembangan Misskey tetap dapat berlanjut!" -correspondingSourceIsAvailable: "Sumber kode terkait tersedia di {anchor}" roles: "Peran" role: "Peran" noRole: "Peran tidak temukan" @@ -1059,9 +1029,6 @@ resetPasswordConfirm: "Yakin untuk mereset kata sandimu?" sensitiveWords: "Kata sensitif" sensitiveWordsDescription: "Visibilitas dari semua catatan mengandung kata yang telah diatur akan dijadikan \"Beranda\" secara otomatis. Kamu dapat mendaftarkan kata tersebut lebih dari satu dengan menuliskannya di baris baru." sensitiveWordsDescription2: "Menggunakan spasi akan membuat ekspresi AND dan kata kunci disekitarnya dengan garis miring akan mengubahnya menjadi ekspresi reguler." -prohibitedWords: "Kata yang dilarang" -prohibitedWordsDescription: "Menyalakan kesalahan ketika mencoba untuk memposting catatan dengan set kata-kata yang termasuk. Beberapa kata dapat diatur dan dipisahkan dengan baris baru." -prohibitedWordsDescription2: "Menggunakan spasi akan membuat ekspresi AND dan kata kunci disekitarnya dengan garis miring akan mengubahnya menjadi ekspresi reguler." hiddenTags: "Tagar tersembunyi" hiddenTagsDescription: "Pilih tanda yang mana akan tidak diperlihatkan dalam daftar tren.\nTanda lebih dari satu dapat didaftarkan dengan tiap baris." notesSearchNotAvailable: "Pencarian catatan tidak tersedia." @@ -1080,8 +1047,6 @@ limitWidthOfReaction: "Batasi lebar maksimum reaksi dan tampilkan dalam ukuran t noteIdOrUrl: "ID catatan atau URL" video: "Video" videos: "Video" -audio: "Suara" -audioFiles: "Berkas Suara" dataSaver: "Penghemat data" accountMigration: "Pemindahan akun" accountMoved: "Pengguna ini telah berpindah ke akun baru:" @@ -1109,7 +1074,6 @@ preservedUsernames: "Nama pengguna tercadangkan" preservedUsernamesDescription: "Daftar nama pengguna yang dicadangkan dipisah dengan baris baru. Nama pengguna berikut akan tidak dapat dipakai pada pembuatan akun normal, namun dapat digunakan oleh admin untuk membuat akun baru. Akun yang sudah ada dengan menggunakan nama pengguna ini tidak akan terpengaruh." createNoteFromTheFile: "Buat catatan dari berkas ini" archive: "Arsipkan" -archived: "Diarsipkan" channelArchiveConfirmTitle: "Yakin untuk mengarsipkan {name}?" channelArchiveConfirmDescription: "Kanal yang diarsipkan tidak akan muncul pada daftar kanal atau hasil pencarian. Postingan baru juga tidak dapat ditambahkan lagi." thisChannelArchived: "Kanal ini telah diarsipkan." @@ -1120,7 +1084,6 @@ preventAiLearning: "Tolak penggunaan Pembelajaran Mesin (AI Generatif)" preventAiLearningDescription: "Minta perayap web untuk tidak menggunakan materi teks atau gambar yang telah diposting ke dalam set data Pembelajaran Mesin (Prediktif / Generatif). Hal ini dicapai dengan menambahkan flag HTML-Response \"noai\" ke masing-masing konten. Pencegahan penuh mungkin tidak dapat dicapai dengan flag ini, karena juga dapat diabaikan begitu saja." options: "Opsi peran" specifyUser: "Pengguna spesifik" -openTagPageConfirm: "Apakah ingin membuka laman tagar?" failedToPreviewUrl: "Tidak dapat dipratinjau" update: "Perbarui" rolesThatCanBeUsedThisEmojiAsReaction: "Peran yang dapat menggunakan emoji ini sebagai reaksi" @@ -1179,7 +1142,6 @@ showRenotes: "Tampilkan renote" edited: "Telah disunting" notificationRecieveConfig: "Pengaturan notifikasi" mutualFollow: "Saling mengikuti" -followingOrFollower: "Mengikuti atau pengikut" fileAttachedOnly: "Hanya catatan dengan berkas" showRepliesToOthersInTimeline: "Tampilkan balasan ke pengguna lain dalam lini masa" hideRepliesToOthersInTimeline: "Sembunyikan balasan ke orang lain dari lini masa" @@ -1188,13 +1150,6 @@ hideRepliesToOthersInTimelineAll: "Sembuyikan balasan ke lainnya dari semua oran confirmShowRepliesAll: "Operasi ini tidak dapat diubah. Apakah kamu yakin untuk menampilkan balasan ke lainnya dari semua orang yang kamu ikuti di lini masa?" confirmHideRepliesAll: "Operasi ini tidak dapat diubah. Apakah kamu yakin untuk menyembunyikan balasan ke lainnya dari semua orang yang kamu ikuti di lini masa?" externalServices: "Layanan eksternal" -sourceCode: "Sumber kode" -sourceCodeIsNotYetProvided: "Sumber kode belum tersedia. Hubungi admin untuk memperbaiki masalah ini." -repositoryUrl: "URL Repositori" -repositoryUrlDescription: "Jika kamu menggunakan Misskey begitu saja (tanpa ada perubahan dalam kode sumber), masukkan https://github.com/misskey-dev/misskey" -repositoryUrlOrTarballRequired: "Apabila kamu masih mempublikasikan repositori, kamu setidaknya harus menyediakan berkas tarball. Lihat .config/example.yml untuk informasi lebih lanjut." -feedback: "Umpan balik" -feedbackUrl: "URL Umpan balik" impressum: "Impressum" impressumUrl: "Tautan Impressum" impressumDescription: "Pada beberapa negara seperti Jerman, inklusi dari informasi kontak operator (sebuah Impressum) diperlukan secara legal untuk situs web komersil." @@ -1219,76 +1174,7 @@ doReaction: "Tambahkan reaksi" code: "Kode" reloadRequiredToApplySettings: "Muat ulang diperlukan untuk menerapkan pengaturan." remainingN: "Sisa : {n}" -overwriteContentConfirm: "Apakah kamu yakin untuk menimpa konten saat ini?" -seasonalScreenEffect: "Efek layar musiman" decorate: "Dekor" -addMfmFunction: "Tambahkan dekorasi" -enableQuickAddMfmFunction: "Tampilkan pemilih MFM tingkat lanjut" -bubbleGame: "Bubble Game" -sfx: "Efek Suara" -soundWillBePlayed: "Suara yang akan dimainkan" -showReplay: "Lihat tayangan ulang" -replay: "Tayangan ulang" -replaying: "Menayangkan Ulang" -endReplay: "Keluat dari tayangan ulang" -copyReplayData: "Salin data tayangan ulang" -ranking: "Peringkat" -lastNDays: "{n} hari terakhir" -backToTitle: "Ke Judul" -hemisphere: "Letak kamu tinggal" -withSensitive: "Lampirkan catatan dengan berkas sensitif" -userSaysSomethingSensitive: "Postingan oleh {name} mengandung konten sensitif" -enableHorizontalSwipe: "Geser untuk mengganti tab" -loading: "Memuat..." -surrender: "Batalkan" -gameRetry: "Coba lagi" -notUsePleaseLeaveBlank: "Kosongi bila tidak digunakan" -useTotp: "Gunakan TOTP" -useBackupCode: "Gunakan kode cadangan" -launchApp: "Luncurkan Aplikasi" -useNativeUIForVideoAudioPlayer: "Gunakan antarmuka peramban ketika memainkan video dan audio" -keepOriginalFilename: "Simpan nama berkas asli" -keepOriginalFilenameDescription: "Apabila pengaturan ini dimatikan, nama berkas akan diganti dengan string acak secara otomatis ketika kamu mengunggah berkas." -noDescription: "Tidak ada deskripsi" -alwaysConfirmFollow: "Selalu konfirmasi ketika mengikuti" -inquiry: "Hubungi kami" -tryAgain: "Silahkan coba lagi." -createdLists: "Senarai yang dibuat" -createdAntennas: "Antena yang dibuat" -fromX: "Dari {x}" -noteOfThisUser: "Catatan oleh pengguna ini" -clipNoteLimitExceeded: "Klip ini tak bisa ditambahi lagi catatan." -performance: "Kinerja" -modified: "Diubah" -thereAreNChanges: "Ada {n} perubahan" -prohibitedWordsForNameOfUser: "Kata yang dilarang untuk nama pengguna" -_abuseUserReport: - accept: "Setuju" - reject: "Tolak" -_delivery: - status: "Status pengiriman" - stop: "Ditangguhkan" - resume: "Lanjutkan pengiriman" - _type: - none: "Sedang menyiarkan langsung" - manuallySuspended: "Ditangguhkan manual" - goneSuspended: "Sedang ditangguhkan untuk penghapusan peladen" - autoSuspendedForNotResponding: "Sedang ditangguhkan karena peladen tidak menjawab" -_bubbleGame: - howToPlay: "Cara bermain" - hold: "Tahan" - _score: - score: "Skor" - scoreYen: "Jumlah uang didapat" - highScore: "Skor tertinggi" - maxChain: "Jumlah skor berantai" - yen: "{yen} Yen" - estimatedQty: "{qty} buah" - scoreSweets: "{onigiriQtyWithUnit} onigiri" - _howToPlay: - section1: "Atur posisi dan jatuhkan obyek ke dalam kotak." - section2: "Ketika dua obyek menyentuh tipe yang sama satu sama lain, obyek tersebut akan berganti dan kamu mendapatkan poin skor." - section3: "Permainan berakhir jika obyek memenuhi kotak. Capai skor tertinggi dengan menggabungkan obyek bersama sambil menghindari obyek tersebut memenuhi kotak permainan!" _announcement: forExistingUsers: "Hanya pengguna yang telah ada" forExistingUsersDescription: "Pengumuman ini akan dimunculkan ke pengguna yang sudah ada dari titik waktu publikasi jika dinyalakan. Apabila dimatikan, mereka yang baru mendaftar setelah publikasi ini akan juga melihatnya." @@ -1298,10 +1184,7 @@ _announcement: tooManyActiveAnnouncementDescription: "Terlalu banyak pengumuman dapat memperburuk pengalaman pengguna. Mohon pertimbangkan untuk mengarsipkan pengumuman yang sudah usang/tidak relevan." readConfirmTitle: "Tandai telah dibaca?" readConfirmText: "Aksi ini akan menandai konten dari \"{title}\" telah dibaca." - shouldNotBeUsedToPresentPermanentInfo: "Karena dapat berdampak pada pengalaman pengguna untuk pengguna baru, sangat direkomendasikan untuk menggunakan notifikasi secara mengalir daripada tetap." - dialogAnnouncementUxWarn: "Memiliki dua atau lebih gaya dialog notifikasi secara bersamaan dapat berdampak signifikan pada pengalaman pengguna, mohon untuk menggunakannya dengan hati-hati." silence: "Tiada notifikasi" - silenceDescription: "Apabila diaktifkan, notifikasi dari pengumuman ini akan dilewatkan dan pengguna tidak perlu membacanya." _initialAccountSetting: accountCreated: "Akun kamu telah sukses dibuat!" letsStartAccountSetup: "Untuk pemula, ayo atur profilmu dulu." @@ -1314,7 +1197,6 @@ _initialAccountSetting: pushNotificationDescription: "Menyalakan notifikasi dorong akan membuatmu menerima notifikasi dari {name} secara langsung ke perangkatmu." initialAccountSettingCompleted: "Pengaturan profil selesai!" haveFun: "Selamat menikmati, {name}!" - youCanContinueTutorial: "Kamu dapat menjutkan ke tutorial dalam bagaimana menggunakan {name} (Misskey) atau kamu dapat keluar dari pemasangan ini dan langsung menggunakannya segera." startTutorial: "Mulai Tutorial" skipAreYouSure: "Yakin melewati atur profil?" laterAreYouSure: "Yakin banget untuk atur profil nanti?" @@ -1328,63 +1210,24 @@ _initialTutorial: description: "Di sini kamu dapat mempelajari dasar-dasar dari penggunaan Misskey dan fitur-fiturnya." _note: title: "Apa itu Catatan?" - description: "Postingan di Misskey disebut sebagai 'Catatan'. Catatan ditampilkan secara kronologis pada lini masa dan dimutakhirkan secara real-time." - reply: "Klik pada tombol ini untuk membalas ke sebuah pesan. Bisa juga untuk membalas ke sebuah balasan dan melanjutkannya seperti percakapan selayaknya utas." - renote: "Kamu dapat membagikan catatan ke lini masa milikmu. Kamu juga dapat mengutipnya dengan komentarmu." - reaction: "Kamu dapat menambahkan reaksi ke Catatan. Detil lebih lanjut akan dijelaskan di halaman berikutnya." - menu: "Kamu dapat melihat detil catatan, menyalin tautan, dan melakukan aksi lainnya." _reaction: title: "Apa itu Reaksi?" - description: "Catatan dapat direaksi dengan berbagai emoji. Reaksi memperbolehkan kamu untuk mengekspresikan nuansa yang tidak dapat disampaikan hanya dengan sebuah \"suka\"." - letsTryReacting: "Reaksi dapat ditambahkan dengan mengklik tombol '+' pada catatan. Coba lakukan mereaksi contoh catatan ini!" - reactToContinue: "Tambahkan reaksi untuk melanjutkan." - reactNotification: "Kamu akan menerima notifikasi real0time ketika seseorang mereaksi catatan kamu." - reactDone: "Kamu dapat mengurungkan reaksi dengan menekan tombol '-'." _timeline: title: "Konsep Lini Masa" - description1: "Misskey menyediakan berbagai lini masa sesuai dengan penggunaan (beberapa mungkin tidak tersedia karena bergantung dengan kebijakan peladen)." - home: "Kamu dapat melihat catatan dari akun yang kamu ikuti." - local: "Kamu dapat melihat catatan dari semua pengguna yang ada pada peladen ini." - social: "Catatan dari linimasa Beranda dan Lokal akan ditampilkan." - global: "Kamu dapat melihat catatan dari semua peladen yang terhubung." - description2: "Kamu dapat mengganti linimasa di bagian atas layar kamu kapan saja." - description3: "Sebagai tambahan, terdapat juga linimasa daftar dan linimasa kanal. Untuk detil lebih lanjut, silahkan melihat ke tautan berikut: {link}." _postNote: title: "Pengaturan posting Catatan" - description1: "Ketika memposting catatan ke Misskey, terdapat beberapa opsi yang tersedia. Form posting terlihat seperti ini." _visibility: - description: "Kamu dapat membatasi siapa yang dapat melihat catatan kamu." public: "Perlihatkan catatan ke semua pengguna." home: "Hanya publik ke lini masa Beranda. Pengguna yang mengunjungi profilmu melalui pengikut dan renote dapat melihatnya." followers: "Perlihatkan ke pengikut saja. Hanya pengikut yang dapat melihat postinganmu dan tidak dapat direnote oleh siapapun." direct: "Hanya perlihatkan ke pengguna spesifik dan penerima akan diberi tahu. Dapat juga digunakan sebagai alternatif dari pesan langsung." - doNotSendConfidencialOnDirect1: "Hati-hati ketika mengirim informasi yang sensitif!" - doNotSendConfidencialOnDirect2: "Admin dari peladen dapat melihat apa yang kamu tulis. Hati-hati dengan informasi sensitif ketika mengirimkan catatan langsung kepada pengguna pada peladen yang tidak dipercaya." - localOnly: "Memposting dengan opsi ini tidak akan memfederasi catatan ke peladen lain. Pengguna pada peladen lain tidak akan dapat melihat catatan ini secara langsung, meskipun dengan pengaturan visibilitas yang sudah diatur di atas." _cw: title: "Peringatan Konten (CW)" - description: "Alih-alih isinya, konten yang ditulis dalam kolom 'komentar' akan ditampilkan. Menekan 'Selebihnya' akan menampilkan isi konten." _exampleNote: cw: "Peringatan: Bikin Lapar!" note: "Baru aja makan donat berlapis coklat 🍩😋" - useCases: "Fungsi ini digunakan ketika mengikutik panduan peladen untuk catatan yang dibutuhkan atau untuk membatasi diri dari teks sensitif atau spoiler." _howToMakeAttachmentsSensitive: title: "Bagaimana menandai lampiran sebagai sensitif?" - description: "Fungsi ini digunakan untuk lampiran yang dibutuhkan oleh panduan peladen atau sesuatu yang seharusnya tidak boleh dibiarkan begitu saja dengan cara menambahkan penanda \"sensitif\"." - tryThisFile: "Coba tandai gambar yang dilampirkan pada form ini sebagai sensitif!" - _exampleNote: - note: "Ups, kesalahan banget buka penutup wadah natto..." - method: "Untuk menandai lampiran sebagai sensitif, klik gambar pada berkas, buka menu, lalu klik \"Tandai sebagai sensitif\"." - sensitiveSucceeded: "Ketika melampirkan berkas, mohon atur sensitifitas sesuai dengan panduan peladen." - doItToContinue: "Tandai berkas terlampir sebagai sensitif untuk melanjutkan." - _done: - title: "Kamu telah menyelesaikan tutorial! 🎉" - description: "Fungsi yang diperkenalkan di sini merupakan sebagian kecil dari fitur yang ada. Untuk pemahaman lebih detil dalam menggunakan Misskey, kamu dapat merujuk ke {link}." -_timelineDescription: - home: "Pada linimasa Beranda, kamu dapat melihat catatan dari akun yang kamu ikuti." - local: "Pada linimasa Lokal, kamu dapat melihat catatan dari semua pengguna yang ada pada peladen ini." - social: "Linimasa sosial menampilkan catatan dari kedua linimasa Beranda dan Lokal." - global: "Pada linimasa Global, kamu dapat melihat catatan dari semua peladen yang terhubung." _serverRules: description: "Daftar peraturan akan ditampilkan sebelum pendaftaran. Mengatur ringkasan dari Syarat dan Ketentuan sangat direkomendasikan." _serverSettings: @@ -1396,9 +1239,6 @@ _serverSettings: manifestJsonOverride: "Ambil alih manifest.json" shortName: "Nama pendek" shortNameDescription: "Inisial untuk nama instansi yang dapat ditampilkan apabila nama lengkap resmi terlalu panjang." - fanoutTimelineDescription: "Dapat meningkatkan performa dalam pengambilan data linimasa dan mengurangi beban pada database ketika dinyalakan. Sebagai gantinya, penggunaan memory pada Redis akan meningkan. Pertimbangkan untuk menonaktifkan fitur ini jika mengalami kekurangan memori pada server atau menyebabkan server tidak stabil." - fanoutTimelineDbFallback: "Fallback ke database" - fanoutTimelineDbFallbackDescription: "Ketika diaktifkan, lini masa akan fallback ke database untuk melakukan kueri tambahan apabila linimasa tidak disimpan dalam cache. Menonaktifkan ini dapat mengurangi beban server dengan mengeliminasi proses fallback, namun dapat berakibat membatasi jarak data dari lini masa yang dapat diambil." _accountMigration: moveFrom: "Pindahkan akun lain ke akun ini" moveFromSub: "Buat alias ke akun lain" @@ -1656,16 +1496,6 @@ _achievements: _smashTestNotificationButton: title: "Tes overflow" description: "Picu tes notifikasi secara berulang dalam waktu yang sangat pendek" - _tutorialCompleted: - title: "Ijazah Sekolah Dasar Misskey" - description: "Tutorial selesai" - _bubbleGameExplodingHead: - title: "🤯" - description: "Obyek paling terbesar di permainan gelembung" - _bubbleGameDoubleExplodingHead: - title: "Ganda 🤯" - description: "Dua dari obyek paling terbesar pada permainan gelembung di waktu yang sama" - flavor: "Kamu dapat mengisi kotak makan siang seperti ini 🤯 🤯." _role: new: "Buat peran" edit: "Sunting peran" @@ -1676,9 +1506,7 @@ _role: assignTarget: "Tipe tugas" descriptionOfAssignTarget: "Manual untuk mengganti secara manual siapa yang mendapatkan peran ini dan siapa yang tidak.\nKondisional untuk pengguna secara otomatis dimasukkan atau dihapus dari peran berdasarkan kondisi yang ditentukan." manual: "Manual" - manualRoles: "Peran manual" conditional: "Kondisional" - conditionalRoles: "Peran kondisional" condition: "Kondisi" isConditionalRole: "Ini adalah peran kondisional" isPublic: "Publikkan Peran" @@ -1706,7 +1534,6 @@ _role: gtlAvailable: "Dapat melihat lini masa global" ltlAvailable: "Dapat melihat lini masa lokal" canPublicNote: "Dapat mengirim catatan publik" - mentionMax: "Jumlah maksimum sebutan dalam sebuah catatan" canInvite: "Dapat membuat kode undangan instansi" inviteLimit: "Batas jumlah undangan" inviteLimitCycle: "Interval Penerbitan Kode Undangan" @@ -1728,18 +1555,9 @@ _role: canHideAds: "Dapat menyembunyikan iklan" canSearchNotes: "Penggunaan pencarian catatan" canUseTranslator: "Penggunaan penerjemah" - avatarDecorationLimit: "Jumlah maksimum dekorasi avatar yang dapat diterapkan" - canImportAntennas: "Izinkan mengimpor antena" - canImportUserLists: "Izinkan mengimpor senarai" _condition: - roleAssignedTo: "Ditugaskan ke peran manual" isLocal: "Pengguna lokal" isRemote: "Pengguna remote" - isCat: "Pengguna Kucing" - isBot: "Pengguna Bot" - isSuspended: "Pengguna yang ditangguhkan" - isLocked: "Akun privat" - isExplorable: "Pengguna efektif yang akunnya dapat dicari" createdLessThan: "Telah berlalu kurang dari X sejak pembuatan akun" createdMoreThan: "Telah berlalu lebih dari X sejak pembuatan akun" followersLessThanOrEq: "Memiliki pengikut X atau kurang dari tersebut" @@ -1765,9 +1583,8 @@ _emailUnavailable: disposable: "Alamat surel temporer tidak dapat digunakan" mx: "Peladen alamat surel ini tidak valid" smtp: "Peladen alamat surel ini tidak merespon" - banned: "Kamu tidak dapat mendaftar dengan alamat surel ini" _ffVisibility: - public: "Publik" + public: "Terbitkan" followers: "Tampil untuk pengikut saja" private: "Tersembunyi" _signup: @@ -1809,7 +1626,6 @@ _plugin: installWarn: "Mohon jangan memasang plugin yang tidak dapat dipercayai." manage: "Manajemen plugin" viewSource: "Lihat sumber" - viewLog: "Tampilkan log" _preferencesBackups: list: "Cadangan yang dibuat" saveNew: "Simpan cadangan baru" @@ -1839,13 +1655,10 @@ _aboutMisskey: contributors: "Kontributor utama" allContributors: "Seluruh kontributor" source: "Sumber kode" - original: "Asli" - thisIsModifiedVersion: "{name} menggunakan versi modifikasi dari Misskey yang asli." translation: "Terjemahkan Misskey" donate: "Donasi ke Misskey" morePatrons: "Kami sangat mengapresiasi dukungan dari banyak penolong lain yang tidak tercantum disini. Terima kasih! 🥰" patrons: "Pendukung" - projectMembers: "Anggota proyek" _displayOfSensitiveMedia: respect: "Sembunyikan media yang ditandai sensitif" ignore: "Tampilkan media yang ditandai sensitif" @@ -1870,7 +1683,6 @@ _channel: notesCount: "terdapat {n} catatan" nameAndDescription: "Nama dan deskripsi" nameOnly: "Hanya nama" - allowRenoteToExternal: "Perbolehkan catat ulang dan kutipan di luar dari kanal" _menuDisplay: sideFull: "Horisontal" sideIcon: "Horisontal (Ikon)" @@ -1948,6 +1760,7 @@ _theme: buttonBg: "Latar belakang tombol" buttonHoverBg: "Latar belakang tombol (Mengambang)" inputBorder: "Batas bidang masukan" + listItemHoverBg: "Latar belakang daftar item (Mengambang)" driveFolderBg: "Latar belakang folder drive" wallpaperOverlay: "Lapisan wallpaper" badge: "Lencana" @@ -1959,15 +1772,8 @@ _sfx: note: "Catatan" noteMy: "Catatan (Saya)" notification: "Notifikasi" - reaction: "Ketika memilih reaksi" -_soundSettings: - driveFile: "Menggunakan berkas audio dalam Drive" - driveFileWarn: "Pilih berkas audio dari Drive" - driveFileTypeWarn: "Berkas ini tidak didukung" - driveFileTypeWarnDescription: "Pilih berkas audio" - driveFileDurationWarn: "Audio ini terlalu panjang" - driveFileDurationWarnDescription: "Audio panjang dapat mengganggu penggunaan Misskey. Masih ingin melanjutkan?" - driveFileError: "Tak bisa memuat audio. Mohon ubah pengaturan" + antenna: "Penerimaan Antenna" + channel: "Notifikasi Kanal" _ago: future: "Masa depan" justNow: "Baru saja" @@ -1979,14 +1785,6 @@ _ago: monthsAgo: "{n} bulan lalu" yearsAgo: "{n} tahun lalu" invalid: "Tidak ada sama sekali disini" -_timeIn: - seconds: "dalam {n} detik" - minutes: "dalam {n} menit" - hours: "dalam {n} jam" - days: "dalam {n} hari" - weeks: "dalam {n} minggu" - months: "dalam {n} bulan" - years: "dalam {n} tahun" _time: second: "detik" minute: "menit" @@ -1997,6 +1795,7 @@ _2fa: registerTOTP: "Daftarkan aplikasi autentikator" step1: "Pertama, pasang aplikasi autentikasi (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." step2Uri: "Masukkan URI berikut jika kamu menggunakan program desktop" step3Title: "Masukkan kode autentikasi" step3: "Masukkan token yang telah disediakan oleh aplikasimu untuk menyelesaikan pemasangan." @@ -2020,7 +1819,6 @@ _2fa: backupCodesDescription: "Kamu dapat menggunakan kode ini untuk mendapatkan akses ke akun kamu apabila berada dalam situasi tidak dapat menggunakan aplikasi autentikasi 2-faktor yang kamu miliki. Setiap kode hanya dapat digunakan satu kali. Mohon simpan kode ini di tempat yang aman." backupCodeUsedWarning: "Kode cadangan telah digunakan. Mohon mengatur ulang autentikasi 2-faktor secepatnya apabila kamu sudah tidak dapat menggunakannya lagi." backupCodesExhaustedWarning: "Semua kode cadangan telah digunakan. Apabila kamu kehilangan akses pada aplikasi autentikasi 2-faktor milikmu, kamu tidak dapat mengakses akun ini lagi. Mohon atur ulang autentikasi 2-faktor kamu." - moreDetailedGuideHere: "Berikut panduan detilnya" _permissions: "read:account": "Lihat informasi akun" "write:account": "Sunting informasi akun" @@ -2058,54 +1856,6 @@ _permissions: "write:flash": "Sunting Play" "read:flash-likes": "Lihat daftar Play yang disukai" "write:flash-likes": "Sunting daftar Play yang disukai" - "read:admin:abuse-user-reports": "Lihat laporan pengguna" - "write:admin:delete-account": "Hapus akun pengguna" - "write:admin:delete-all-files-of-a-user": "Hapus semua berkas dari seorang pengguna" - "read:admin:index-stats": "Lihat statistik indeks basis data" - "read:admin:table-stats": "Lihat statistik tabel basis data" - "read:admin:user-ips": "Lihat alamat IP pengguna" - "read:admin:meta": "Lihat metadata instansi" - "write:admin:reset-password": "Atur ulang kata sandi pengguna" - "write:admin:resolve-abuse-user-report": "Selesaikan laporan pengguna" - "write:admin:send-email": "Mengirim surel" - "read:admin:server-info": "Lihat informasi peladen" - "read:admin:show-moderation-log": "Lihat log moderasi" - "read:admin:show-user": "Lihat informasi pengguna privat" - "write:admin:suspend-user": "Tangguhkan pengguna" - "write:admin:unset-user-avatar": "Hapus avatar pengguna" - "write:admin:unset-user-banner": "Hapus banner pengguna" - "write:admin:unsuspend-user": "Batalkan penangguhan pengguna" - "write:admin:meta": "Kelola metadata instansi" - "write:admin:user-note": "Kelola moderasi catatan" - "write:admin:roles": "Kelola peran" - "read:admin:roles": "Lihat peran" - "write:admin:relays": "Kelola relay" - "read:admin:relays": "Lihat relay" - "write:admin:invite-codes": "Kelola kode undangan" - "read:admin:invite-codes": "Lihat kode undangan" - "write:admin:announcements": "Kelola pengumuman" - "read:admin:announcements": "Lihat Pengumuman" - "write:admin:avatar-decorations": "Kelola dekorasi avatar" - "read:admin:avatar-decorations": "Lihat dekorasi avatar" - "write:admin:federation": "Kelola data federasi" - "write:admin:account": "Kelola akun pengguna" - "read:admin:account": "Lihat akun pengguna" - "write:admin:emoji": "Kelola emoji" - "read:admin:emoji": "Lihat emoji" - "write:admin:queue": "Kelola antrian kerja" - "read:admin:queue": "Lihat informasi antrian kerja" - "write:admin:promo": "Kelola catatan promosi" - "write:admin:drive": "Kelola drive pengguna" - "read:admin:drive": "Kelola informasi drive pengguna" - "read:admin:stream": "Gunakan API WebSocket untuk Admin" - "write:admin:ad": "Kelola iklan" - "read:admin:ad": "Lihat iklan" - "write:invite-codes": "Membuat kode undangan" - "read:invite-codes": "Mendapatkan kode undangan" - "write:clip-favorite": "Kelola klip yang difavoritkan" - "read:clip-favorite": "Lihat klip yang difavoritkan" - "read:federation": "Mendapatkan data federasi" - "write:report-abuse": "Melaporkan pelanggaran" _auth: shareAccessTitle: "Mendapatkan ijin akses aplikasi" shareAccess: "Apakah kamu ingin mengijinkan \"{name}\" untuk mengakses akun ini?" @@ -2160,7 +1910,6 @@ _widgets: _userList: chooseList: "Pilih daftar" clicker: "Pengeklik" - birthdayFollowings: "Pengguna yang merayakan hari ulang tahunnya hari ini" _cw: hide: "Sembunyikan" show: "Lihat konten" @@ -2223,11 +1972,9 @@ _profile: changeAvatar: "Ubah avatar" changeBanner: "Ubah header" verifiedLinkDescription: "Dengan memasukkan URL yang mengandung tautan ke profil kamu di sini, ikon verifikasi kepemilikan dapat ditampilkan di sebelah kolom ini." - avatarDecorationMax: "Dapat ditambahkan hingga {max} dekorasi." _exportOrImport: allNotes: "Semua catatan" favoritedNotes: "Catatan favorit" - clips: "Klip" followingList: "Ikuti" muteList: "Bisukan" blockingList: "Blokir" @@ -2281,7 +2028,6 @@ _play: title: "Judul" script: "Script" summary: "Deskripsi" - visibilityDescription: "Membuat catatan ini privat berarti tidak akan terlihat pada profil kamu, namun siapapun yang memiliki URL dari catatan ini akan dapat mengaksesnya." _pages: newPage: "Buat halaman baru" editPage: "Sunting halaman" @@ -2326,8 +2072,6 @@ _pages: section: "Bagian" image: "Gambar" button: "Tombol" - dynamic: "Blok Dinamis" - dynamicDescription: "Blok ini telah dihapus. Mohon gunakan {play} dari sekarang." note: "Catatan yang ditanam" _note: id: "ID Catatan" @@ -2349,18 +2093,12 @@ _notification: pollEnded: "Hasil Kuesioner telah keluar" newNote: "Catatan baru" unreadAntennaNote: "Antena {name}" - roleAssigned: "Peran Diberikan" emptyPushNotificationMessage: "Pembaruan notifikasi dorong" achievementEarned: "Pencapaian didapatkan" testNotification: "Tes notifikasi" checkNotificationBehavior: "Cek tampilan notifikasi" sendTestNotification: "Kirim tes notifikasi" notificationWillBeDisplayedLikeThis: "Notifikasi akan terlihat seperti ini" - reactedBySomeUsers: "{n} orang memberikan reaksi" - likedBySomeUsers: "{n} pengguna menyukai catatan kamu" - renotedBySomeUsers: "{n} orang telah merenote" - followedBySomeUsers: "{n} orang telah mengikuti" - flushNotification: "Bersihkan notifikasi" _types: all: "Semua" note: "Catatan baru" @@ -2373,9 +2111,7 @@ _notification: pollEnded: "Jajak pendapat berakhir" receiveFollowRequest: "Permintaan mengikuti diterima" followRequestAccepted: "Permintaan mengikuti disetujui" - roleAssigned: "Peran Diberikan" achievementEarned: "Pencapaian didapatkan" - login: "Masuk" app: "Notifikasi dari aplikasi tertaut" _actions: followBack: "Ikuti Kembali" @@ -2423,9 +2159,9 @@ _drivecleaner: orderByCreatedAtAsc: "Tanggal (Naik)" _webhookSettings: createWebhook: "Buat Webhook" - modifyWebhook: "Sunting Webhook" name: "Nama" secret: "Secret" + events: "Webhook Events" active: "Aktif" _events: follow: "Ketika mengikuti pengguna" @@ -2435,13 +2171,6 @@ _webhookSettings: renote: "Ketika direnote" reaction: "Ketika menerima reaksi" mention: "Ketika sedang disebut" - deleteConfirm: "Apakah kamu yakin ingin menghapus Webhook?" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "Surel" - webhook: "Webhook" - keywords: "Kata kunci" _moderationLogTypes: createRole: "Peran telah dibuat" deleteRole: "Peran telah dihapus" @@ -2466,7 +2195,6 @@ _moderationLogTypes: resetPassword: "Atur ulang kata sandi" suspendRemoteInstance: "Instansi luar telah ditangguhkan" unsuspendRemoteInstance: "Instansi luar batal ditangguhkan" - updateRemoteInstanceNote: "Catatan moderasi telah diperbaharui untuk peladen luar." markSensitiveDriveFile: "Berkas ditandai sensitif" unmarkSensitiveDriveFile: "Berkas batal ditandai sensitif" resolveAbuseReport: "Laporan terselesaikan" @@ -2474,12 +2202,6 @@ _moderationLogTypes: createAd: "Iklan telah dibuat" deleteAd: "Iklan telah dihapus" updateAd: "Iklan telah diperbaharui" - createAvatarDecoration: "Buat dekorasi avatar" - updateAvatarDecoration: "Perbarui dekorasi avatar" - deleteAvatarDecoration: "Hapus dekorasi avatar" - unsetUserAvatar: "Hapus avatar pengguna" - unsetUserBanner: "Hapus banner pengguna" - deleteAccount: "Akun dihapus" _fileViewer: title: "Rincian berkas" type: "Jenis berkas" @@ -2488,126 +2210,3 @@ _fileViewer: uploadedAt: "Diunggah pada" attachedNotes: "Catatan yang dilampirkan" thisPageCanBeSeenFromTheAuthor: "Halaman ini hanya dapat dilihat oleh pengguna yang mengunggah bekas ini." -_externalResourceInstaller: - title: "Pasang dari situs eksternal" - checkVendorBeforeInstall: "Pastikan sumber dari sumber daya ini terpercaya sebelum melakukan pemasangan." - _plugin: - title: "Apakah kamu ingin memasang plugin ini?" - metaTitle: "Informasi plugin" - _theme: - title: "Apakah kamu ingin memasang tema ini?" - metaTitle: "Informasi tema" - _meta: - base: "Skema warna dasar" - _vendorInfo: - title: "Informasi sumber" - endpoint: "Referensi Endpoint" - hashVerify: "Verifikasi hash" - _errors: - _invalidParams: - title: "Parameter tidak valid" - description: "Tidak cukup informasi untuk memuat data dari situs eksternal. Mohon konfirmasi kembali URL yang dimasukkan." - _resourceTypeNotSupported: - title: "Sumber daya eksternal ini tidak didukung" - description: "Tipe sumber daya eksternal ini tidak didukung. Mohon kontak administrator dari situs tersebut." - _failedToFetch: - title: "Gagal memuat data" - fetchErrorDescription: "Kesalahan terjadi ketika menghubungkan dengan situs eksternal. Jika percobaan kembali tidak dapat memperbaiki masalah ini, mohon hubungi administrator dari situs tersebut." - parseErrorDescription: "Kesalahan terjadi dalam memproses data yang dimuat dari situs eksternal. Mohon hubungi administrator dari situs tersebut." - _hashUnmatched: - title: "Verifikasi data gagal" - description: "Kesalahan terjadi dalam memverifikasi integritas data yang diambil. Sebagai pencegahan keamanan, pemasangan tidak dapat dilanjutkan. Mohon hubungi administrator dari situs tersebut." - _pluginParseFailed: - title: "Kesalahan AiScript" - description: "Data yang diminta telah diambil dengan sukses, namun kesalahan terjadi ketika AiScript melakukan parsing. Mohon hubungi pembuat plugin. Detil kesalahan dapat dilihat pada konsol Javascript." - _pluginInstallFailed: - title: "Pemasangan plugin gagal" - description: "Kesalahan terjadi ketika pemasangan plugin. Mohon coba lagi. Detil kesalahan dapat dilihat pada konsol Javascript." - _themeParseFailed: - title: "Parsing tema gagal" - description: "Data yang diminta telah diambil dengan sukses, namun kesalahan terjadi ketika tema melakukan parsing. Mohon hubungi pembuat tema. Detil kesalahan dapat dilihat pada konsol Javascript." - _themeInstallFailed: - title: "Pemasangan tema gagal" - description: "Kesalahan terjadi ketika pemasangan tema. Mohon coba lagi. Detil kesalahan dapat dilihat pada konsol Javascript." -_dataSaver: - _media: - title: "Memuat media" - description: "Mencegah gambar/video dimuat secara otomatis. Menyembunyikan gambar/video dan akan dimuat ketika diketuk." - _avatar: - title: "Gambar avatar" - description: "Hentikan animasi gambar avatar. Gambar animasi dapat berukuran lebih besar dari gambar biasa, berpotensi pada pengurangan lalu lintas data lebih jauh." - _urlPreview: - title: "Gambar kecil URL pratinjau" - description: "Gambar kecil URL pratinjau tidak akan dimuat lagi." - _code: - title: "Penyorotan kode" - description: "Jika notasi penyorotan kode digunakan di MFM, dll. Fungsi tersebut tidak akan dimuat apabila tidak diketuk. Penyorotan sintaks membutuhkan pengunduhan berkas definisi penyorotan untuk setiap bahasa pemrograman. Oleh sebab itu, menonaktifkan pemuatan otomatis dari berkas ini dilakukan untuk mengurangi jumlah komunikasi data." -_hemisphere: - N: "Bumi belahan utara" - S: "Bumi belahan selatan" - caption: "Digunakan dalam beberapa pengaturan klien untuk menentukan musim." -_reversi: - reversi: "Reversi" - gameSettings: "Pengaturan permainan" - chooseBoard: "Pilih papan" - blackOrWhite: "Hitam/Putih" - blackIs: "{name} bermain sebagai Hitam" - rules: "Aturan" - thisGameIsStartedSoon: "Permainan akan segera dimulai" - waitingForOther: "Menunggu langkah giliran dari lawan" - waitingForMe: "Menungguh langkah giliran dari kamu" - waitingBoth: "Bersiap" - ready: "Siap" - cancelReady: "Belum siap" - opponentTurn: "Giliran lawan" - myTurn: "Giliran kamu" - turnOf: "Giliran {name}" - pastTurnOf: "Giliran {name}" - surrender: "Menyerah" - surrendered: "Telah menyerah" - timeout: "Waktu habis" - drawn: "Seri" - won: "{name} menang" - black: "Hitam" - white: "Putih" - total: "Jumlah" - turnCount: "Langkah ke {count}" - myGames: "Rondeku" - allGames: "Semua ronde" - ended: "Selesai" - playing: "Sedang bermain" - isLlotheo: "Pemain dengan batu yang sedikit menang (Llotheo)" - loopedMap: "Peta melingkar" - canPutEverywhere: "Keping dapat ditaruh dimana saja" - timeLimitForEachTurn: "Batas waktu untuk gantian" - freeMatch: "Pertandingan bebas" - lookingForPlayer: "Mencari lawan..." - gameCanceled: "Permainan ini telah dibatalkan." - shareToTlTheGameWhenStart: "Bagikan permainan ke lini masa ketika dimulai" - iStartedAGame: "Permainan telah dimulai! #MisskeyReversi" - opponentHasSettingsChanged: "Lawan telah mengganti pengaturan mereka." - allowIrregularRules: "Aturan non-reguler (bebas sepenuhnya)" - disallowIrregularRules: "Tanpa aturan non-reguler" - showBoardLabels: "Tampilkan penomoran baris dan kolom pada papan" - useAvatarAsStone: "Ubah batu menjadi avatar pengguna" -_offlineScreen: - title: "Luring - tidak dapat terhubung ke peladen" - header: "Tidak dapat tersambung ke server" -_urlPreviewSetting: - title: "Pengaturan pratinjau URL" - enable: "Aktifkan pratinjau URL" - timeout: "Waktu timeout pratinjau URL (ms)" - timeoutDescription: "Apabila ini memakan waktu lama dari nilai yang ditentukan untuk mendapatkan pratinjau, pratinjau tidak akan dibuat." - maximumContentLength: "Content-Length Maksimum (bytes)" - maximumContentLengthDescription: "Apabila Content-Length lebih besar dari nilai ini, pratinjau tidak akan dibuat." - requireContentLength: "Buat pratinjau hanya ketika Content-Length dapat didapatkan" - requireContentLengthDescription: "Apabila peladen lain tidak memberika Content-Length, pratinjau tidak akan dibuat." - userAgent: "User-Agent" - userAgentDescription: "Atur User-Agent yang digunakan untuk mengambil pratinjau. Apabila dibiarkan kosong, User-Agent bawaan akan digunakan." - summaryProxy: "Titik akhir proksi yang membuat pratinjau" - summaryProxyDescription: "Bukan untuk Misskey, namun untuk menghasilkan pratinjau menggunakan Summaly Proxy." - summaryProxyDescription2: "Parameter berikut tertautkan dengan proksi sebagai string kueri. Apabila proksi tidak mendukung tersebut, nilai di dalamnya diabaikan." -_mediaControls: - pip: "Gambar dalam Gambar" - playbackRate: "Kecepatan Pemutaran" - loop: "Ulangi Pemutaran" diff --git a/locales/index.d.ts b/locales/index.d.ts index 440f24ac84..3e34c6a813 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1,10584 +1,2595 @@ /* eslint-disable */ // This file is generated by locales/generateDTS.js // Do not edit this file directly. -declare const kParameters: unique symbol; -export interface ParameterizedString { - [kParameters]: T; -} -export interface ILocale { - [_: string]: string | ParameterizedString | ILocale; -} -export interface Locale extends ILocale { - /** - * 日本語 - */ +export interface Locale { "_lang_": string; - /** - * ノートでつながるネットワーク - */ "headlineMisskey": string; - /** - * ようこそ!Misskeyは、オープンソースの分散型マイクロブログサービスです。 - * 「ノート」を作成して、いま起こっていることを共有したり、あなたについて皆に発信しよう📡 - * 「リアクション」機能で、皆のノートに素早く反応を追加することもできます👍 - * 新しい世界を探検しよう🚀 - */ "introMisskey": string; - /** - * {name}は、オープンソースのプラットフォームMisskeyのサーバーのひとつです。 - */ - "poweredByMisskeyDescription": ParameterizedString<"name">; - /** - * {month}月 {day}日 - */ - "monthAndDay": ParameterizedString<"month" | "day">; - /** - * 検索 - */ + "poweredByMisskeyDescription": string; + "monthAndDay": string; "search": string; - /** - * 通知 - */ "notifications": string; - /** - * ユーザー名 - */ "username": string; - /** - * パスワード - */ "password": string; - /** - * 初期設定開始用パスワード - */ - "initialPasswordForSetup": string; - /** - * 初期設定開始用のパスワードが違います。 - */ - "initialPasswordIsIncorrect": string; - /** - * Misskeyを自分でインストールした場合は、設定ファイルに入力したパスワードを使用してください。 - * Misskeyのホスティングサービスなどを使用している場合は、提供されたパスワードを使用してください。 - * パスワードを設定していない場合は、空欄にしたまま続行してください。 - */ - "initialPasswordForSetupDescription": string; - /** - * パスワードを忘れた - */ "forgotPassword": string; - /** - * 連合に照会中 - */ "fetchingAsApObject": string; - /** - * OK - */ "ok": string; - /** - * わかった - */ "gotIt": string; - /** - * キャンセル - */ "cancel": string; - /** - * やめておく - */ "noThankYou": string; - /** - * ユーザー名を入力 - */ "enterUsername": string; - /** - * {user}がリノート - */ - "renotedBy": ParameterizedString<"user">; - /** - * ノートはありません - */ + "renotedBy": string; "noNotes": string; - /** - * 通知はありません - */ "noNotifications": string; - /** - * サーバー - */ "instance": string; - /** - * 設定 - */ "settings": string; - /** - * 通知の設定 - */ "notificationSettings": string; - /** - * 基本設定 - */ "basicSettings": string; - /** - * その他の設定 - */ "otherSettings": string; - /** - * ウィンドウで開く - */ "openInWindow": string; - /** - * プロフィール - */ "profile": string; - /** - * タイムライン - */ "timeline": string; - /** - * 自己紹介はありません - */ "noAccountDescription": string; - /** - * ログイン - */ "login": string; - /** - * ログイン中 - */ "loggingIn": string; - /** - * ログアウト - */ "logout": string; - /** - * 新規登録 - */ "signup": string; - /** - * アップロード中 - */ "uploading": string; - /** - * 保存 - */ "save": string; - /** - * ユーザー - */ "users": string; - /** - * ユーザーを追加 - */ "addUser": string; - /** - * お気に入り - */ "favorite": string; - /** - * お気に入り - */ "favorites": string; - /** - * お気に入り解除 - */ "unfavorite": string; - /** - * お気に入りに登録しました。 - */ "favorited": string; - /** - * 既にお気に入りに登録されています。 - */ "alreadyFavorited": string; - /** - * お気に入りに登録できませんでした。 - */ "cantFavorite": string; - /** - * ピン留め - */ "pin": string; - /** - * ピン留め解除 - */ "unpin": string; - /** - * 内容をコピー - */ "copyContent": string; - /** - * リンクをコピー - */ "copyLink": string; - /** - * リノートのリンクをコピー - */ "copyLinkRenote": string; - /** - * 削除 - */ "delete": string; - /** - * 削除して編集 - */ "deleteAndEdit": string; - /** - * このノートを削除してもう一度編集しますか?このノートへのリアクション、リノート、返信も全て削除されます。 - */ "deleteAndEditConfirm": string; - /** - * リストに追加 - */ "addToList": string; - /** - * アンテナに追加 - */ "addToAntenna": string; - /** - * メッセージを送信 - */ "sendMessage": string; - /** - * RSSをコピー - */ "copyRSS": string; - /** - * ユーザー名をコピー - */ "copyUsername": string; - /** - * ユーザーIDをコピー - */ "copyUserId": string; - /** - * ノートIDをコピー - */ "copyNoteId": string; - /** - * ファイルIDをコピー - */ "copyFileId": string; - /** - * フォルダーIDをコピー - */ "copyFolderId": string; - /** - * プロフィールURLをコピー - */ "copyProfileUrl": string; - /** - * ユーザーを検索 - */ "searchUser": string; - /** - * ユーザーのノートを検索 - */ - "searchThisUsersNotes": string; - /** - * 返信 - */ "reply": string; - /** - * もっと見る - */ "loadMore": string; - /** - * もっと見る - */ "showMore": string; - /** - * 閉じる - */ "showLess": string; - /** - * フォローされました - */ "youGotNewFollower": string; - /** - * フォローリクエストされました - */ "receiveFollowRequest": string; - /** - * フォローが承認されました - */ "followRequestAccepted": string; - /** - * メンション - */ "mention": string; - /** - * あなた宛て - */ "mentions": string; - /** - * ダイレクト投稿 - */ "directNotes": string; - /** - * インポートとエクスポート - */ "importAndExport": string; - /** - * インポート - */ "import": string; - /** - * エクスポート - */ "export": string; - /** - * ファイル - */ "files": string; - /** - * ダウンロード - */ "download": string; - /** - * ファイル「{name}」を削除しますか?このファイルを使用した一部のコンテンツも削除されます。 - */ - "driveFileDeleteConfirm": ParameterizedString<"name">; - /** - * {name}のフォローを解除しますか? - */ - "unfollowConfirm": ParameterizedString<"name">; - /** - * エクスポートをリクエストしました。これには時間がかかる場合があります。エクスポートが終わると、「ドライブ」に追加されます。 - */ + "driveFileDeleteConfirm": string; + "unfollowConfirm": string; "exportRequested": string; - /** - * インポートをリクエストしました。これには時間がかかる場合があります。 - */ "importRequested": string; - /** - * リスト - */ "lists": string; - /** - * リストはありません - */ "noLists": string; - /** - * ノート - */ "note": string; - /** - * ノート - */ "notes": string; - /** - * フォロー - */ "following": string; - /** - * フォロワー - */ "followers": string; - /** - * フォローされています - */ "followsYou": string; - /** - * リスト作成 - */ "createList": string; - /** - * リストの管理 - */ "manageLists": string; - /** - * エラー - */ "error": string; - /** - * 問題が発生しました - */ "somethingHappened": string; - /** - * 再試行 - */ "retry": string; - /** - * ページの読み込みに失敗しました。 - */ "pageLoadError": string; - /** - * これは通常、ネットワークまたはブラウザキャッシュが原因です。キャッシュをクリアするか、しばらく待ってから再度試してください。 - */ "pageLoadErrorDescription": string; - /** - * サーバーの応答がありません。しばらく待ってから再度試してください。 - */ "serverIsDead": string; - /** - * このページを表示するためには、リロードして新しいバージョンのクライアントをご利用ください。 - */ "youShouldUpgradeClient": string; - /** - * リスト名を入力 - */ "enterListName": string; - /** - * プライバシー - */ "privacy": string; - /** - * フォローを承認制にする - */ "makeFollowManuallyApprove": string; - /** - * デフォルトの公開範囲 - */ "defaultNoteVisibility": string; - /** - * フォロー - */ "follow": string; - /** - * フォロー申請 - */ "followRequest": string; - /** - * フォロー申請 - */ "followRequests": string; - /** - * フォロー解除 - */ "unfollow": string; - /** - * フォロー許可待ち - */ "followRequestPending": string; - /** - * 絵文字を入力 - */ "enterEmoji": string; - /** - * リノート - */ "renote": string; - /** - * リノート解除 - */ "unrenote": string; - /** - * リノートしました。 - */ "renoted": string; - /** - * {name} にリノートしました。 - */ - "renotedToX": ParameterizedString<"name">; - /** - * この投稿はリノートできません。 - */ "cantRenote": string; - /** - * リノートをリノートすることはできません。 - */ "cantReRenote": string; - /** - * 引用 - */ "quote": string; - /** - * チャンネル内リノート - */ "inChannelRenote": string; - /** - * チャンネル内引用 - */ "inChannelQuote": string; - /** - * チャンネルにリノート - */ - "renoteToChannel": string; - /** - * 他のチャンネルにリノート - */ - "renoteToOtherChannel": string; - /** - * ピン留めされたノート - */ "pinnedNote": string; - /** - * ピン留め - */ "pinned": string; - /** - * あなた - */ "you": string; - /** - * クリックして表示 - */ "clickToShow": string; - /** - * センシティブ - */ "sensitive": string; - /** - * 追加 - */ "add": string; - /** - * リアクション - */ "reaction": string; - /** - * リアクション - */ "reactions": string; - /** - * 絵文字ピッカー - */ "emojiPicker": string; - /** - * リアクション時にピン留め表示する絵文字を設定できます - */ "pinnedEmojisForReactionSettingDescription": string; - /** - * 絵文字入力時にピン留め表示する絵文字を設定できます - */ "pinnedEmojisSettingDescription": string; - /** - * ピッカーの表示 - */ "emojiPickerDisplay": string; - /** - * リアクション設定から上書きする - */ "overwriteFromPinnedEmojisForReaction": string; - /** - * 全般設定から上書きする - */ "overwriteFromPinnedEmojis": string; - /** - * ドラッグして並び替え、クリックして削除、+を押して追加します。 - */ "reactionSettingDescription2": string; - /** - * 公開範囲を記憶する - */ "rememberNoteVisibility": string; - /** - * 添付取り消し - */ "attachCancel": string; - /** - * ファイルを削除 - */ - "deleteFile": string; - /** - * センシティブとして設定 - */ "markAsSensitive": string; - /** - * センシティブを解除する - */ "unmarkAsSensitive": string; - /** - * ファイル名を入力 - */ "enterFileName": string; - /** - * ミュート - */ "mute": string; - /** - * ミュート解除 - */ "unmute": string; - /** - * リノートをミュート - */ "renoteMute": string; - /** - * リノートのミュートを解除 - */ "renoteUnmute": string; - /** - * ブロック - */ "block": string; - /** - * ブロック解除 - */ "unblock": string; - /** - * 凍結 - */ "suspend": string; - /** - * 解凍 - */ "unsuspend": string; - /** - * ブロックしますか? - */ "blockConfirm": string; - /** - * ブロック解除しますか? - */ "unblockConfirm": string; - /** - * 凍結しますか? - */ "suspendConfirm": string; - /** - * 解凍しますか? - */ "unsuspendConfirm": string; - /** - * リストを選択 - */ "selectList": string; - /** - * リストを編集 - */ "editList": string; - /** - * チャンネルを選択 - */ "selectChannel": string; - /** - * アンテナを選択 - */ "selectAntenna": string; - /** - * アンテナを編集 - */ "editAntenna": string; - /** - * アンテナを作成 - */ - "createAntenna": string; - /** - * ウィジェットを選択 - */ "selectWidget": string; - /** - * ウィジェットを編集 - */ "editWidgets": string; - /** - * 編集を終了 - */ "editWidgetsExit": string; - /** - * カスタム絵文字 - */ "customEmojis": string; - /** - * 絵文字 - */ "emoji": string; - /** - * 絵文字 - */ "emojis": string; - /** - * 絵文字名 - */ "emojiName": string; - /** - * 絵文字画像URL - */ "emojiUrl": string; - /** - * 絵文字を追加 - */ "addEmoji": string; - /** - * おすすめ設定 - */ "settingGuide": string; - /** - * リモートのファイルをキャッシュする - */ "cacheRemoteFiles": string; - /** - * この設定を有効にすると、リモートファイルをこのサーバーのストレージにキャッシュするようになります。画像の表示が高速になりますが、サーバーのストレージを多く消費します。リモートユーザーがどれほどキャッシュを保持するかは、ロールによるドライブ容量制限によって決定されます。この制限を超えた場合、古いファイルからキャッシュが削除されリンクになります。この設定が無効の場合、リモートのファイルを最初からリンクとして保持しますが、画像のサムネイル生成やユーザーのプライバシー保護のために、default.ymlでproxyRemoteFilesをtrueにすることをお勧めします。 - */ "cacheRemoteFilesDescription": string; - /** - * ファイル管理の🗑️ボタンで全てのキャッシュを削除できます。 - */ "youCanCleanRemoteFilesCache": string; - /** - * リモートのセンシティブなファイルをキャッシュする - */ "cacheRemoteSensitiveFiles": string; - /** - * この設定を無効にすると、リモートのセンシティブなファイルはキャッシュせず直リンクするようになります。 - */ "cacheRemoteSensitiveFilesDescription": string; - /** - * Botとして設定 - */ "flagAsBot": string; - /** - * このアカウントがプログラムによって運用される場合は、このフラグをオンにします。オンにすると、反応の連鎖を防ぐためのフラグとして他の開発者に役立ったり、Misskeyのシステム上での扱いがBotに合ったものになります。 - */ "flagAsBotDescription": string; - /** - * にゃああああああああああああああ!!!!!!!!!!!! - */ "flagAsCat": string; - /** - * にゃにゃにゃ?? - */ "flagAsCatDescription": string; - /** - * タイムラインにノートへの返信を表示する - */ "flagShowTimelineReplies": string; - /** - * オンにすると、タイムラインにユーザーのノート以外にもそのユーザーの他のノートへの返信を表示します。 - */ "flagShowTimelineRepliesDescription": string; - /** - * フォロー中ユーザーからのフォロリクを自動承認 - */ "autoAcceptFollowed": string; - /** - * アカウントを追加 - */ "addAccount": string; - /** - * アカウントリストの情報を更新 - */ "reloadAccountsList": string; - /** - * ログインに失敗しました - */ "loginFailed": string; - /** - * リモートで表示 - */ "showOnRemote": string; - /** - * リモートで続行 - */ - "continueOnRemote": string; - /** - * Misskey Hubからサーバーを選択 - */ - "chooseServerOnMisskeyHub": string; - /** - * サーバーのドメインを直接指定 - */ - "specifyServerHost": string; - /** - * ドメインを入力してください - */ - "inputHostName": string; - /** - * 全般 - */ "general": string; - /** - * 壁紙 - */ "wallpaper": string; - /** - * 壁紙を設定 - */ "setWallpaper": string; - /** - * 壁紙を削除 - */ "removeWallpaper": string; - /** - * 検索: {q} - */ - "searchWith": ParameterizedString<"q">; - /** - * リストがありません - */ + "searchWith": string; "youHaveNoLists": string; - /** - * {name}をフォローしますか? - */ - "followConfirm": ParameterizedString<"name">; - /** - * プロキシアカウント - */ + "followConfirm": string; "proxyAccount": string; - /** - * プロキシアカウントは、特定の条件下でユーザーのリモートフォローを代行するアカウントです。例えば、ユーザーがリモートユーザーをリストに入れたとき、リストに入れられたユーザーを誰もフォローしていないとアクティビティがサーバーに配達されないため、代わりにプロキシアカウントがフォローするようにします。 - */ "proxyAccountDescription": string; - /** - * ホスト - */ "host": string; - /** - * 自分を選択 - */ - "selectSelf": string; - /** - * ユーザーを選択 - */ "selectUser": string; - /** - * 宛先 - */ "recipient": string; - /** - * 注釈 - */ "annotation": string; - /** - * 連合 - */ "federation": string; - /** - * サーバー - */ "instances": string; - /** - * 初観測 - */ "registeredAt": string; - /** - * 直近のリクエスト受信 - */ "latestRequestReceivedAt": string; - /** - * 直近のステータス - */ "latestStatus": string; - /** - * ストレージ使用量 - */ "storageUsage": string; - /** - * チャート - */ "charts": string; - /** - * 1時間ごと - */ "perHour": string; - /** - * 1日ごと - */ "perDay": string; - /** - * アクティビティの配送を停止 - */ "stopActivityDelivery": string; - /** - * このサーバーをブロック - */ "blockThisInstance": string; - /** - * サーバーをサイレンス - */ "silenceThisInstance": string; - /** - * サーバーをメディアサイレンス - */ - "mediaSilenceThisInstance": string; - /** - * 操作 - */ "operations": string; - /** - * ソフトウェア - */ "software": string; - /** - * バージョン - */ "version": string; - /** - * メタデータ - */ "metadata": string; - /** - * {n}つのファイル - */ - "withNFiles": ParameterizedString<"n">; - /** - * モニター - */ + "withNFiles": string; "monitor": string; - /** - * ジョブキュー - */ "jobQueue": string; - /** - * CPUとメモリ - */ "cpuAndMemory": string; - /** - * ネットワーク - */ "network": string; - /** - * ディスク - */ "disk": string; - /** - * サーバー情報 - */ "instanceInfo": string; - /** - * 統計 - */ "statistics": string; - /** - * キューをクリア - */ "clearQueue": string; - /** - * キューをクリアしますか? - */ "clearQueueConfirmTitle": string; - /** - * 未配達の投稿は配送されなくなります。通常この操作を行う必要はありません。 - */ "clearQueueConfirmText": string; - /** - * キャッシュをクリア - */ "clearCachedFiles": string; - /** - * キャッシュされたリモートファイルをすべて削除しますか? - */ "clearCachedFilesConfirm": string; - /** - * ブロックしたサーバー - */ "blockedInstances": string; - /** - * ブロックしたいサーバーのホストを改行で区切って設定します。ブロックされたサーバーは、このインスタンスとやり取りできなくなります。 - */ "blockedInstancesDescription": string; - /** - * サイレンスしたサーバー - */ "silencedInstances": string; - /** - * サイレンスしたいサーバーのホストを改行で区切って設定します。サイレンスされたサーバーに所属するアカウントはすべて「サイレンス」として扱われ、フォローがすべてリクエストになります。ブロックしたインスタンスには影響しません。 - */ "silencedInstancesDescription": string; - /** - * メディアサイレンスしたサーバー - */ - "mediaSilencedInstances": string; - /** - * メディアサイレンスしたいサーバーのホストを改行で区切って設定します。メディアサイレンスされたサーバーに所属するアカウントによるファイルはすべてセンシティブとして扱われ、カスタム絵文字が使用できないようになります。ブロックしたインスタンスには影響しません。 - */ - "mediaSilencedInstancesDescription": string; - /** - * 連合を許可するサーバー - */ - "federationAllowedHosts": string; - /** - * 連合を許可するサーバーのホストを改行で区切って設定します。 - */ - "federationAllowedHostsDescription": string; - /** - * ミュートとブロック - */ "muteAndBlock": string; - /** - * ミュートしたユーザー - */ "mutedUsers": string; - /** - * ブロックしたユーザー - */ "blockedUsers": string; - /** - * ユーザーはいません - */ "noUsers": string; - /** - * プロフィールを編集 - */ "editProfile": string; - /** - * このノートを削除しますか? - */ "noteDeleteConfirm": string; - /** - * これ以上ピン留めできません - */ "pinLimitExceeded": string; - /** - * Misskeyのインストールが完了しました!管理者アカウントを作成しましょう。 - */ "intro": string; - /** - * 完了 - */ "done": string; - /** - * 処理中 - */ "processing": string; - /** - * プレビュー - */ "preview": string; - /** - * デフォルト - */ "default": string; - /** - * デフォルト: {value} - */ - "defaultValueIs": ParameterizedString<"value">; - /** - * 絵文字はありません - */ + "defaultValueIs": string; "noCustomEmojis": string; - /** - * ジョブはありません - */ "noJobs": string; - /** - * 連合中 - */ "federating": string; - /** - * ブロック中 - */ "blocked": string; - /** - * 配信停止 - */ "suspended": string; - /** - * 全て - */ "all": string; - /** - * 購読中 - */ "subscribing": string; - /** - * 配信中 - */ "publishing": string; - /** - * 応答なし - */ "notResponding": string; - /** - * サーバーのフォロー - */ "instanceFollowing": string; - /** - * サーバーのフォロワー - */ "instanceFollowers": string; - /** - * サーバーのユーザー - */ "instanceUsers": string; - /** - * パスワードを変更 - */ "changePassword": string; - /** - * セキュリティ - */ "security": string; - /** - * 入力が一致しません。 - */ "retypedNotMatch": string; - /** - * 現在のパスワード - */ "currentPassword": string; - /** - * 新しいパスワード - */ "newPassword": string; - /** - * 新しいパスワード(再入力) - */ "newPasswordRetype": string; - /** - * ファイルを添付 - */ "attachFile": string; - /** - * もっと! - */ "more": string; - /** - * ハイライト - */ "featured": string; - /** - * ユーザー名かユーザーID - */ "usernameOrUserId": string; - /** - * ユーザーが見つかりません - */ "noSuchUser": string; - /** - * 照会 - */ "lookup": string; - /** - * お知らせ - */ "announcements": string; - /** - * 画像URL - */ "imageUrl": string; - /** - * 削除 - */ "remove": string; - /** - * 削除しました - */ "removed": string; - /** - * 「{x}」を削除しますか? - */ - "removeAreYouSure": ParameterizedString<"x">; - /** - * 「{x}」を削除しますか? - */ - "deleteAreYouSure": ParameterizedString<"x">; - /** - * リセットしますか? - */ + "removeAreYouSure": string; + "deleteAreYouSure": string; "resetAreYouSure": string; - /** - * よろしいですか? - */ "areYouSure": string; - /** - * 保存しました - */ "saved": string; - /** - * チャット - */ "messaging": string; - /** - * アップロード - */ "upload": string; - /** - * オリジナル画像を保持 - */ "keepOriginalUploading": string; - /** - * 画像をアップロードする時にオリジナル版を保持します。オフにするとアップロード時にブラウザでWeb公開用画像を生成します。 - */ "keepOriginalUploadingDescription": string; - /** - * ドライブから - */ "fromDrive": string; - /** - * URLから - */ "fromUrl": string; - /** - * URLアップロード - */ "uploadFromUrl": string; - /** - * アップロードしたいファイルのURL - */ "uploadFromUrlDescription": string; - /** - * アップロードをリクエストしました - */ "uploadFromUrlRequested": string; - /** - * アップロードが完了するまで時間がかかる場合があります。 - */ "uploadFromUrlMayTakeTime": string; - /** - * みつける - */ "explore": string; - /** - * 既読 - */ "messageRead": string; - /** - * これより過去の履歴はありません - */ "noMoreHistory": string; - /** - * チャットを開始 - */ "startMessaging": string; - /** - * {n}人が読みました - */ - "nUsersRead": ParameterizedString<"n">; - /** - * {0}に同意 - */ - "agreeTo": ParameterizedString<"0">; - /** - * 同意する - */ + "nUsersRead": string; + "agreeTo": string; "agree": string; - /** - * 下記に同意する - */ "agreeBelow": string; - /** - * 基本的な注意事項 - */ "basicNotesBeforeCreateAccount": string; - /** - * 利用規約 - */ "termsOfService": string; - /** - * 始める - */ "start": string; - /** - * ホーム - */ "home": string; - /** - * リモートユーザーのため、情報が不完全です。 - */ "remoteUserCaution": string; - /** - * アクティビティ - */ "activity": string; - /** - * 画像 - */ "images": string; - /** - * 画像 - */ "image": string; - /** - * 誕生日 - */ "birthday": string; - /** - * {age}歳 - */ - "yearsOld": ParameterizedString<"age">; - /** - * 登録日 - */ + "yearsOld": string; "registeredDate": string; - /** - * 場所 - */ "location": string; - /** - * テーマ - */ "theme": string; - /** - * ライトモードで使うテーマ - */ "themeForLightMode": string; - /** - * ダークモードで使うテーマ - */ "themeForDarkMode": string; - /** - * ライト - */ "light": string; - /** - * ダーク - */ "dark": string; - /** - * 明るいテーマ - */ "lightThemes": string; - /** - * 暗いテーマ - */ "darkThemes": string; - /** - * デバイスのダークモードと同期する - */ "syncDeviceDarkMode": string; - /** - * ドライブ - */ "drive": string; - /** - * ファイル名 - */ "fileName": string; - /** - * ファイルを選択 - */ "selectFile": string; - /** - * ファイルを選択 - */ "selectFiles": string; - /** - * フォルダーを選択 - */ "selectFolder": string; - /** - * フォルダーを選択 - */ "selectFolders": string; - /** - * ファイルが選択されていません - */ - "fileNotSelected": string; - /** - * ファイル名を変更 - */ "renameFile": string; - /** - * フォルダー名 - */ "folderName": string; - /** - * フォルダーを作成 - */ "createFolder": string; - /** - * フォルダー名を変更 - */ "renameFolder": string; - /** - * フォルダーを削除 - */ "deleteFolder": string; - /** - * フォルダー - */ "folder": string; - /** - * ファイルを追加 - */ "addFile": string; - /** - * ファイルを表示 - */ - "showFile": string; - /** - * ドライブは空です - */ "emptyDrive": string; - /** - * フォルダーは空です - */ "emptyFolder": string; - /** - * 削除できません - */ "unableToDelete": string; - /** - * 新しいファイル名を入力してください - */ "inputNewFileName": string; - /** - * 新しいキャプションを入力してください - */ "inputNewDescription": string; - /** - * 新しいフォルダ名を入力してください - */ "inputNewFolderName": string; - /** - * 移動先のフォルダーは、移動するフォルダーのサブフォルダーです。 - */ "circularReferenceFolder": string; - /** - * このフォルダは空でないため、削除できません。 - */ "hasChildFilesOrFolders": string; - /** - * URLをコピー - */ "copyUrl": string; - /** - * 名前を変更 - */ "rename": string; - /** - * アイコン - */ "avatar": string; - /** - * バナー - */ "banner": string; - /** - * センシティブなメディアの表示 - */ "displayOfSensitiveMedia": string; - /** - * サーバーとの接続が失われたとき - */ "whenServerDisconnected": string; - /** - * サーバーから切断されました - */ "disconnectedFromServer": string; - /** - * リロード - */ "reload": string; - /** - * なにもしない - */ "doNothing": string; - /** - * リロードしますか? - */ "reloadConfirm": string; - /** - * ウォッチ - */ "watch": string; - /** - * ウォッチ解除 - */ "unwatch": string; - /** - * 許可 - */ "accept": string; - /** - * 拒否 - */ "reject": string; - /** - * 通常 - */ "normal": string; - /** - * サーバー名 - */ "instanceName": string; - /** - * サーバーの紹介 - */ "instanceDescription": string; - /** - * 管理者の名前 - */ "maintainerName": string; - /** - * 管理者のメールアドレス - */ "maintainerEmail": string; - /** - * 利用規約URL - */ "tosUrl": string; - /** - * 今年 - */ "thisYear": string; - /** - * 今月 - */ "thisMonth": string; - /** - * 今日 - */ "today": string; - /** - * {day}日 - */ - "dayX": ParameterizedString<"day">; - /** - * {month}月 - */ - "monthX": ParameterizedString<"month">; - /** - * {year}年 - */ - "yearX": ParameterizedString<"year">; - /** - * ページ - */ + "dayX": string; + "monthX": string; + "yearX": string; "pages": string; - /** - * 連携 - */ "integration": string; - /** - * 接続する - */ "connectService": string; - /** - * 切断する - */ "disconnectService": string; - /** - * ローカルタイムラインを有効にする - */ "enableLocalTimeline": string; - /** - * グローバルタイムラインを有効にする - */ "enableGlobalTimeline": string; - /** - * これらのタイムラインを無効化しても、利便性のため管理者およびモデレーターは引き続き利用することができます。 - */ "disablingTimelinesInfo": string; - /** - * 登録 - */ "registration": string; - /** - * 誰でも新規登録できるようにする - */ "enableRegistration": string; - /** - * 招待 - */ "invite": string; - /** - * ローカルユーザーひとりあたりのドライブ容量 - */ "driveCapacityPerLocalAccount": string; - /** - * リモートユーザーひとりあたりのドライブ容量 - */ "driveCapacityPerRemoteAccount": string; - /** - * メガバイト単位 - */ "inMb": string; - /** - * バナー画像のURL - */ "bannerUrl": string; - /** - * 背景画像のURL - */ "backgroundImageUrl": string; - /** - * 基本情報 - */ "basicInfo": string; - /** - * ピン留めユーザー - */ "pinnedUsers": string; - /** - * 「みつける」ページなどにピン留めしたいユーザーを改行で区切って記述します。 - */ "pinnedUsersDescription": string; - /** - * ピン留めページ - */ "pinnedPages": string; - /** - * サーバーのトップページにピン留めしたいページのパスを改行で区切って記述します。 - */ "pinnedPagesDescription": string; - /** - * ピン留めするクリップのID - */ "pinnedClipId": string; - /** - * ピン留めされたノート - */ "pinnedNotes": string; - /** - * hCaptcha - */ "hcaptcha": string; - /** - * hCaptchaを有効にする - */ "enableHcaptcha": string; - /** - * サイトキー - */ "hcaptchaSiteKey": string; - /** - * シークレットキー - */ "hcaptchaSecretKey": string; - /** - * mCaptcha - */ - "mcaptcha": string; - /** - * mCaptchaを有効にする - */ - "enableMcaptcha": string; - /** - * サイトキー - */ - "mcaptchaSiteKey": string; - /** - * シークレットキー - */ - "mcaptchaSecretKey": string; - /** - * mCaptchaのインスタンスのURL - */ - "mcaptchaInstanceUrl": string; - /** - * reCAPTCHA - */ "recaptcha": string; - /** - * reCAPTCHAを有効にする - */ "enableRecaptcha": string; - /** - * サイトキー - */ "recaptchaSiteKey": string; - /** - * シークレットキー - */ "recaptchaSecretKey": string; - /** - * Turnstile - */ "turnstile": string; - /** - * Turnstileを有効にする - */ "enableTurnstile": string; - /** - * サイトキー - */ "turnstileSiteKey": string; - /** - * シークレットキー - */ "turnstileSecretKey": string; - /** - * 複数のCaptchaを使用すると干渉を起こす可能性があります。他のCaptchaを無効にしますか?キャンセルして複数のCaptchaを有効化したままにすることも可能です。 - */ "avoidMultiCaptchaConfirm": string; - /** - * アンテナ - */ "antennas": string; - /** - * アンテナの管理 - */ "manageAntennas": string; - /** - * 名前 - */ "name": string; - /** - * 受信ソース - */ "antennaSource": string; - /** - * 受信キーワード - */ "antennaKeywords": string; - /** - * 除外キーワード - */ "antennaExcludeKeywords": string; - /** - * Botアカウントを除外 - */ - "antennaExcludeBots": string; - /** - * スペースで区切るとAND指定になり、改行で区切るとOR指定になります - */ "antennaKeywordsDescription": string; - /** - * 新しいノートを通知する - */ "notifyAntenna": string; - /** - * ファイルが添付されたノートのみ - */ "withFileAntenna": string; - /** - * ブラウザへのプッシュ通知を有効にする - */ "enableServiceworker": string; - /** - * ユーザー名を改行で区切って指定します - */ "antennaUsersDescription": string; - /** - * 大文字小文字を区別する - */ "caseSensitive": string; - /** - * 返信を含む - */ "withReplies": string; - /** - * 次のアカウントに接続されています - */ "connectedTo": string; - /** - * 投稿と返信 - */ "notesAndReplies": string; - /** - * ファイル付き - */ "withFiles": string; - /** - * サイレンス - */ "silence": string; - /** - * サイレンスしますか? - */ "silenceConfirm": string; - /** - * サイレンス解除 - */ "unsilence": string; - /** - * サイレンス解除しますか? - */ "unsilenceConfirm": string; - /** - * 人気のユーザー - */ "popularUsers": string; - /** - * 最近投稿したユーザー - */ "recentlyUpdatedUsers": string; - /** - * 最近登録したユーザー - */ "recentlyRegisteredUsers": string; - /** - * 最近発見されたユーザー - */ "recentlyDiscoveredUsers": string; - /** - * {count}のユーザーがいます - */ - "exploreUsersCount": ParameterizedString<"count">; - /** - * Fediverseを探索 - */ + "exploreUsersCount": string; "exploreFediverse": string; - /** - * 人気のタグ - */ "popularTags": string; - /** - * リスト - */ "userList": string; - /** - * 情報 - */ "about": string; - /** - * Misskeyについて - */ "aboutMisskey": string; - /** - * 管理者 - */ "administrator": string; - /** - * 確認コード - */ "token": string; - /** - * 二要素認証 - */ "2fa": string; - /** - * 二要素認証のセットアップ - */ "setupOf2fa": string; - /** - * 認証アプリ - */ "totp": string; - /** - * 認証アプリを使ってワンタイムパスワードを入力 - */ "totpDescription": string; - /** - * モデレーター - */ "moderator": string; - /** - * モデレーション - */ "moderation": string; - /** - * モデレーションノート - */ "moderationNote": string; - /** - * モデレーター間でだけ共有されるメモを記入することができます。 - */ - "moderationNoteDescription": string; - /** - * モデレーションノートを追加する - */ "addModerationNote": string; - /** - * モデログ - */ "moderationLogs": string; - /** - * {n}人が投稿 - */ - "nUsersMentioned": ParameterizedString<"n">; - /** - * セキュリティキー・パスキー - */ + "nUsersMentioned": string; "securityKeyAndPasskey": string; - /** - * セキュリティキー - */ "securityKey": string; - /** - * 最後の使用 - */ "lastUsed": string; - /** - * 最後の使用: {t} - */ - "lastUsedAt": ParameterizedString<"t">; - /** - * 登録を解除 - */ + "lastUsedAt": string; "unregister": string; - /** - * パスワードレスログイン - */ "passwordLessLogin": string; - /** - * パスワードを使用せず、セキュリティキーやパスキーなどのみでログインします - */ "passwordLessLoginDescription": string; - /** - * パスワードをリセット - */ "resetPassword": string; - /** - * 新しいパスワードは「{password}」です - */ - "newPasswordIs": ParameterizedString<"password">; - /** - * UIのアニメーションを減らす - */ + "newPasswordIs": string; "reduceUiAnimation": string; - /** - * 共有 - */ "share": string; - /** - * 見つかりません - */ "notFound": string; - /** - * 指定されたURLに該当するページはありませんでした。 - */ "notFoundDescription": string; - /** - * 既定アップロード先 - */ "uploadFolder": string; - /** - * すべての通知を既読にする - */ "markAsReadAllNotifications": string; - /** - * すべての投稿を既読にする - */ "markAsReadAllUnreadNotes": string; - /** - * すべてのチャットを既読にする - */ "markAsReadAllTalkMessages": string; - /** - * ヘルプ - */ "help": string; - /** - * ここにメッセージを入力 - */ "inputMessageHere": string; - /** - * 閉じる - */ "close": string; - /** - * 招待 - */ "invites": string; - /** - * メンバー - */ "members": string; - /** - * 譲渡 - */ "transfer": string; - /** - * タイトル - */ "title": string; - /** - * テキスト - */ "text": string; - /** - * 有効にする - */ "enable": string; - /** - * 次 - */ "next": string; - /** - * 再入力 - */ "retype": string; - /** - * {user}のノート - */ - "noteOf": ParameterizedString<"user">; - /** - * 引用付き - */ + "noteOf": string; "quoteAttached": string; - /** - * 引用として添付しますか? - */ "quoteQuestion": string; - /** - * クリップボードのテキストが長いです。テキストファイルとして添付しますか? - */ - "attachAsFileQuestion": string; - /** - * まだチャットはありません - */ "noMessagesYet": string; - /** - * 新しいメッセージがあります - */ "newMessageExists": string; - /** - * メッセージに添付できるファイルはひとつです - */ "onlyOneFileCanBeAttached": string; - /** - * 続行する前に、登録またはログインが必要です - */ "signinRequired": string; - /** - * 続行するには、お使いのサーバーに移動するか、このサーバーに登録・ログインする必要があります - */ - "signinOrContinueOnRemote": string; - /** - * 招待 - */ "invitations": string; - /** - * 招待コード - */ "invitationCode": string; - /** - * 確認しています - */ "checking": string; - /** - * 利用できます - */ "available": string; - /** - * 利用できません - */ "unavailable": string; - /** - * a~z、A~Z、0~9、_が使えます - */ "usernameInvalidFormat": string; - /** - * 短すぎます - */ "tooShort": string; - /** - * 長すぎます - */ "tooLong": string; - /** - * 弱いパスワード - */ "weakPassword": string; - /** - * 普通のパスワード - */ "normalPassword": string; - /** - * 強いパスワード - */ "strongPassword": string; - /** - * 一致しました - */ "passwordMatched": string; - /** - * 一致していません - */ "passwordNotMatched": string; - /** - * {x}でログイン - */ - "signinWith": ParameterizedString<"x">; - /** - * ログインできませんでした。ユーザー名とパスワードを確認してください。 - */ + "signinWith": string; "signinFailed": string; - /** - * もしくは - */ "or": string; - /** - * 言語 - */ "language": string; - /** - * UIの表示言語 - */ "uiLanguage": string; - /** - * {x}について - */ - "aboutX": ParameterizedString<"x">; - /** - * 絵文字のスタイル - */ + "aboutX": string; "emojiStyle": string; - /** - * ネイティブ - */ "native": string; - /** - * メニューのスタイル - */ - "menuStyle": string; - /** - * スタイル - */ - "style": string; - /** - * ドロワー - */ - "drawer": string; - /** - * ポップアップ - */ - "popup": string; - /** - * ノートのアクションをホバー時のみ表示する - */ + "disableDrawer": string; "showNoteActionsOnlyHover": string; - /** - * ノートのリアクション数を表示する - */ - "showReactionsCount": string; - /** - * 履歴はありません - */ "noHistory": string; - /** - * ログイン履歴 - */ "signinHistory": string; - /** - * 高度なMFMを有効にする - */ "enableAdvancedMfm": string; - /** - * 動きのあるMFMを有効にする - */ "enableAnimatedMfm": string; - /** - * やっています - */ "doing": string; - /** - * カテゴリ - */ "category": string; - /** - * タグ - */ "tags": string; - /** - * このドキュメントのソース - */ "docSource": string; - /** - * アカウントを作成 - */ "createAccount": string; - /** - * 既存のアカウント - */ "existingAccount": string; - /** - * 再生成 - */ "regenerate": string; - /** - * フォントサイズ - */ "fontSize": string; - /** - * 画像が1枚のみのメディアリストの高さ - */ "mediaListWithOneImageAppearance": string; - /** - * {x}を上限に - */ - "limitTo": ParameterizedString<"x">; - /** - * フォロー申請はありません - */ + "limitTo": string; "noFollowRequests": string; - /** - * 画像を新しいタブで開く - */ "openImageInNewTab": string; - /** - * ダッシュボード - */ "dashboard": string; - /** - * ローカル - */ "local": string; - /** - * リモート - */ "remote": string; - /** - * 合計 - */ "total": string; - /** - * 前週比 - */ "weekOverWeekChanges": string; - /** - * 前日比 - */ "dayOverDayChanges": string; - /** - * アピアランス - */ "appearance": string; - /** - * クライアント設定 - */ "clientSettings": string; - /** - * アカウント設定 - */ "accountSettings": string; - /** - * プロモーション - */ "promotion": string; - /** - * プロモート - */ "promote": string; - /** - * 日数 - */ "numberOfDays": string; - /** - * このノートを非表示 - */ "hideThisNote": string; - /** - * タイムラインにおすすめのノートを表示する - */ "showFeaturedNotesInTimeline": string; - /** - * オブジェクトストレージ - */ "objectStorage": string; - /** - * オブジェクトストレージを使用 - */ "useObjectStorage": string; - /** - * Base URL - */ "objectStorageBaseUrl": string; - /** - * 参照に使用するURL。CDNやProxyを使用している場合はそのURL、S3: 'https://.s3.amazonaws.com'、GCS等: 'https://storage.googleapis.com/'。 - */ "objectStorageBaseUrlDesc": string; - /** - * Bucket - */ "objectStorageBucket": string; - /** - * 使用サービスのbucket名を指定してください。 - */ "objectStorageBucketDesc": string; - /** - * Prefix - */ "objectStoragePrefix": string; - /** - * このprefixのディレクトリ下に格納されます。 - */ "objectStoragePrefixDesc": string; - /** - * Endpoint - */ "objectStorageEndpoint": string; - /** - * S3の場合は空、それ以外の場合は各サービスのendpointを指定してください。''または':'のように指定します。 - */ "objectStorageEndpointDesc": string; - /** - * Region - */ "objectStorageRegion": string; - /** - * 'xx-east-1'のようなregionを指定してください。使用サービスにregionの概念がない場合は'us-east-1'にしてください。AWS設定ファイルまたは環境変数を参照する場合は空にしてください。 - */ "objectStorageRegionDesc": string; - /** - * SSLを使用する - */ "objectStorageUseSSL": string; - /** - * API接続にhttpsを使用しない場合はオフにしてください - */ "objectStorageUseSSLDesc": string; - /** - * Proxyを利用する - */ "objectStorageUseProxy": string; - /** - * API接続にproxyを利用しない場合はオフにしてください - */ "objectStorageUseProxyDesc": string; - /** - * アップロード時に'public-read'を設定する - */ "objectStorageSetPublicRead": string; - /** - * s3ForcePathStyleを有効にすると、バケット名をURLのホスト名ではなくパスの一部として指定することを強制します。セルフホストされたMinioなどの使用時に有効にする必要がある場合があります。 - */ "s3ForcePathStyleDesc": string; - /** - * サーバーログ - */ "serverLogs": string; - /** - * 全て削除 - */ "deleteAll": string; - /** - * タイムライン上部に投稿フォームを表示する - */ "showFixedPostForm": string; - /** - * タイムライン上部に投稿フォームを表示する(チャンネル) - */ "showFixedPostFormInChannel": string; - /** - * フォローする際、デフォルトで返信をTLに含むようにする - */ "withRepliesByDefaultForNewlyFollowed": string; - /** - * 新しいノートがあります - */ "newNoteRecived": string; - /** - * サウンド - */ "sounds": string; - /** - * サウンド - */ "sound": string; - /** - * 聴く - */ "listen": string; - /** - * なし - */ "none": string; - /** - * ページで表示 - */ "showInPage": string; - /** - * ポップアウト - */ "popout": string; - /** - * 音量 - */ "volume": string; - /** - * マスター音量 - */ "masterVolume": string; - /** - * サウンドを出力しない - */ "notUseSound": string; - /** - * Misskeyがアクティブな時のみサウンドを出力する - */ "useSoundOnlyWhenActive": string; - /** - * 詳細 - */ "details": string; - /** - * 絵文字を選択 - */ "chooseEmoji": string; - /** - * 操作を完了できません - */ "unableToProcess": string; - /** - * 最近使用 - */ "recentUsed": string; - /** - * インストール - */ "install": string; - /** - * アンインストール - */ "uninstall": string; - /** - * インストールされたアプリ - */ "installedApps": string; - /** - * ありません - */ "nothing": string; - /** - * インストール日時 - */ "installedDate": string; - /** - * 最終使用日時 - */ "lastUsedDate": string; - /** - * 状態 - */ "state": string; - /** - * ソート - */ "sort": string; - /** - * 昇順 - */ "ascendingOrder": string; - /** - * 降順 - */ "descendingOrder": string; - /** - * スクラッチパッド - */ "scratchpad": string; - /** - * スクラッチパッドは、AiScriptの実験環境を提供します。Misskeyと対話するコードの記述、実行、結果の確認ができます。 - */ "scratchpadDescription": string; - /** - * UIインスペクター - */ - "uiInspector": string; - /** - * メモリ上に存在しているUIコンポーネントのインスタンスの一覧を見ることができます。UIコンポーネントはUi:C:系関数により生成されます。 - */ - "uiInspectorDescription": string; - /** - * 出力 - */ "output": string; - /** - * スクリプト - */ "script": string; - /** - * Pagesのスクリプトを無効にする - */ "disablePagesScript": string; - /** - * リモートユーザー情報の更新 - */ "updateRemoteUser": string; - /** - * アイコンを解除 - */ "unsetUserAvatar": string; - /** - * アイコンを解除しますか? - */ "unsetUserAvatarConfirm": string; - /** - * バナーを解除 - */ "unsetUserBanner": string; - /** - * バナーを解除しますか? - */ "unsetUserBannerConfirm": string; - /** - * すべてのファイルを削除 - */ "deleteAllFiles": string; - /** - * すべてのファイルを削除しますか? - */ "deleteAllFilesConfirm": string; - /** - * フォローを全解除 - */ "removeAllFollowing": string; - /** - * {host}からのフォローをすべて解除します。そのサーバーがもう存在しなくなった場合などに実行してください。 - */ - "removeAllFollowingDescription": ParameterizedString<"host">; - /** - * このユーザーは凍結されています。 - */ + "removeAllFollowingDescription": string; "userSuspended": string; - /** - * このユーザーはサイレンスされています。 - */ "userSilenced": string; - /** - * アカウントが凍結されています - */ "yourAccountSuspendedTitle": string; - /** - * このアカウントは、サーバーの利用規約に違反したなどの理由により、凍結されています。詳細については管理者までお問い合わせください。新しいアカウントを作らないでください。 - */ "yourAccountSuspendedDescription": string; - /** - * トークンが無効です - */ "tokenRevoked": string; - /** - * ログイントークンが失効しています。ログインし直してください。 - */ "tokenRevokedDescription": string; - /** - * アカウントは削除されています - */ "accountDeleted": string; - /** - * このアカウントは削除されています。 - */ "accountDeletedDescription": string; - /** - * メニュー - */ "menu": string; - /** - * 分割線 - */ "divider": string; - /** - * 項目を追加 - */ "addItem": string; - /** - * 並び替え - */ "rearrange": string; - /** - * リレー - */ "relays": string; - /** - * リレーの追加 - */ "addRelay": string; - /** - * inboxのURL - */ "inboxUrl": string; - /** - * 追加済みのリレー - */ "addedRelays": string; - /** - * プッシュ通知を行うには有効にする必要があります。 - */ "serviceworkerInfo": string; - /** - * 削除された投稿 - */ "deletedNote": string; - /** - * 非公開の投稿 - */ "invisibleNote": string; - /** - * 自動でもっと見る - */ "enableInfiniteScroll": string; - /** - * 公開範囲 - */ "visibility": string; - /** - * アンケート - */ "poll": string; - /** - * 内容を隠す - */ "useCw": string; - /** - * プレイヤーを開く - */ "enablePlayer": string; - /** - * プレイヤーを閉じる - */ "disablePlayer": string; - /** - * ポストを展開する - */ "expandTweet": string; - /** - * テーマエディター - */ + "expandNote": string; "themeEditor": string; - /** - * 説明 - */ "description": string; - /** - * キャプションを付ける - */ "describeFile": string; - /** - * キャプションを入力 - */ "enterFileDescription": string; - /** - * 作者 - */ "author": string; - /** - * 未保存の変更があります。破棄しますか? - */ "leaveConfirm": string; - /** - * 管理 - */ "manage": string; - /** - * プラグイン - */ "plugins": string; - /** - * 設定のバックアップ - */ "preferencesBackups": string; - /** - * デッキ - */ "deck": string; - /** - * デッキ解除 - */ "undeck": string; - /** - * モーダルにぼかし効果を使用 - */ "useBlurEffectForModal": string; - /** - * フル機能リアクションピッカーを使用 - */ "useFullReactionPicker": string; - /** - * 幅 - */ "width": string; - /** - * 高さ - */ "height": string; - /** - * 大 - */ "large": string; - /** - * 中 - */ "medium": string; - /** - * 小 - */ "small": string; - /** - * アクセストークンの発行 - */ "generateAccessToken": string; - /** - * 権限 - */ "permission": string; - /** - * 管理者権限 - */ - "adminPermission": string; - /** - * 全て有効にする - */ "enableAll": string; - /** - * 全て無効にする - */ "disableAll": string; - /** - * アカウントへのアクセス許可 - */ "tokenRequested": string; - /** - * このプラグインはここで設定した権限を行使できるようになります。 - */ "pluginTokenRequestedDescription": string; - /** - * 通知の種類 - */ "notificationType": string; - /** - * 編集 - */ "edit": string; - /** - * メールサーバー - */ "emailServer": string; - /** - * メール配信機能を有効化する - */ "enableEmail": string; - /** - * メールアドレスの確認やパスワードリセットの際に使います - */ "emailConfigInfo": string; - /** - * メール - */ "email": string; - /** - * メールアドレス - */ "emailAddress": string; - /** - * SMTP サーバーの設定 - */ "smtpConfig": string; - /** - * ホスト - */ "smtpHost": string; - /** - * ポート - */ "smtpPort": string; - /** - * ユーザー名 - */ "smtpUser": string; - /** - * パスワード - */ "smtpPass": string; - /** - * ユーザー名とパスワードを空欄にすることで、SMTP認証を無効化出来ます - */ "emptyToDisableSmtpAuth": string; - /** - * SMTP 接続に暗黙的なSSL/TLSを使用する - */ "smtpSecure": string; - /** - * STARTTLS使用時はオフにします。 - */ "smtpSecureInfo": string; - /** - * 配信テスト - */ "testEmail": string; - /** - * ワードミュート - */ "wordMute": string; - /** - * ハードワードミュート - */ "hardWordMute": string; - /** - * 正規表現エラー - */ "regexpError": string; - /** - * {tab}ワードミュートの{line}行目の正規表現にエラーが発生しました: - */ - "regexpErrorDescription": ParameterizedString<"tab" | "line">; - /** - * サーバーミュート - */ + "regexpErrorDescription": string; "instanceMute": string; - /** - * {name}が何かを言いました - */ - "userSaysSomething": ParameterizedString<"name">; - /** - * アクティブにする - */ + "userSaysSomething": string; "makeActive": string; - /** - * 表示 - */ "display": string; - /** - * コピー - */ "copy": string; - /** - * メトリクス - */ "metrics": string; - /** - * 概要 - */ "overview": string; - /** - * ログ - */ "logs": string; - /** - * 遅延 - */ "delayed": string; - /** - * データベース - */ "database": string; - /** - * チャンネル - */ "channel": string; - /** - * 作成 - */ "create": string; - /** - * 通知設定 - */ "notificationSetting": string; - /** - * 表示する通知の種別を選択してください。 - */ "notificationSettingDesc": string; - /** - * グローバル設定を使う - */ "useGlobalSetting": string; - /** - * オンにすると、アカウントの通知設定が使用されます。オフにすると、個別に設定できるようになります。 - */ "useGlobalSettingDesc": string; - /** - * その他 - */ "other": string; - /** - * ログイントークンを再生成 - */ "regenerateLoginToken": string; - /** - * ログインに使用される内部トークンを再生成します。通常この操作を行う必要はありません。再生成すると、全てのデバイスでログアウトされます。 - */ "regenerateLoginTokenDescription": string; - /** - * カスタム絵文字を検索する時のキーワードになります。 - */ - "theKeywordWhenSearchingForCustomEmoji": string; - /** - * スペースで区切って複数設定できます。 - */ "setMultipleBySeparatingWithSpace": string; - /** - * ファイルIDまたはURL - */ "fileIdOrUrl": string; - /** - * 動作 - */ "behavior": string; - /** - * サンプル - */ "sample": string; - /** - * 通報 - */ "abuseReports": string; - /** - * 通報 - */ "reportAbuse": string; - /** - * リノートを通報 - */ "reportAbuseRenote": string; - /** - * {name}を通報する - */ - "reportAbuseOf": ParameterizedString<"name">; - /** - * 通報理由の詳細を記入してください。対象のノートやページなどがある場合はそのURLも記入してください。 - */ + "reportAbuseOf": string; "fillAbuseReportDescription": string; - /** - * 内容が送信されました。ご報告ありがとうございました。 - */ "abuseReported": string; - /** - * 通報者 - */ "reporter": string; - /** - * 通報先 - */ "reporteeOrigin": string; - /** - * 通報元 - */ "reporterOrigin": string; - /** - * 送信 - */ + "forwardReport": string; + "forwardReportIsAnonymous": string; "send": string; - /** - * 新しいタブで開く - */ + "abuseMarkAsResolved": string; "openInNewTab": string; - /** - * サイドビューで開く - */ "openInSideView": string; - /** - * デフォルトのナビゲーション - */ "defaultNavigationBehaviour": string; - /** - * これらの設定を編集するとアカウントが破損する可能性があります。 - */ "editTheseSettingsMayBreakAccount": string; - /** - * ノートのサーバー情報 - */ "instanceTicker": string; - /** - * {x}を待っています - */ - "waitingFor": ParameterizedString<"x">; - /** - * ランダム - */ + "waitingFor": string; "random": string; - /** - * システム - */ "system": string; - /** - * UI切り替え - */ "switchUi": string; - /** - * デスクトップ - */ "desktop": string; - /** - * クリップ - */ "clip": string; - /** - * 新規作成 - */ "createNew": string; - /** - * 任意 - */ "optional": string; - /** - * 新しいクリップを作成 - */ "createNewClip": string; - /** - * クリップ解除 - */ "unclip": string; - /** - * このノートはすでにクリップ「{name}」に含まれています。ノートをこのクリップから除外しますか? - */ - "confirmToUnclipAlreadyClippedNote": ParameterizedString<"name">; - /** - * パブリック - */ + "confirmToUnclipAlreadyClippedNote": string; "public": string; - /** - * 非公開 - */ "private": string; - /** - * Misskeyは有志によって様々な言語に翻訳されています。{link}で翻訳に協力できます。 - */ - "i18nInfo": ParameterizedString<"link">; - /** - * アクセストークンの管理 - */ + "i18nInfo": string; "manageAccessTokens": string; - /** - * アカウント情報 - */ "accountInfo": string; - /** - * ノートの数 - */ "notesCount": string; - /** - * 返信した数 - */ "repliesCount": string; - /** - * リノートした数 - */ "renotesCount": string; - /** - * 返信された数 - */ "repliedCount": string; - /** - * リノートされた数 - */ "renotedCount": string; - /** - * フォロー数 - */ "followingCount": string; - /** - * フォロワー数 - */ "followersCount": string; - /** - * リアクションした数 - */ "sentReactionsCount": string; - /** - * リアクションされた数 - */ "receivedReactionsCount": string; - /** - * アンケートに投票した数 - */ "pollVotesCount": string; - /** - * アンケートに投票された数 - */ "pollVotedCount": string; - /** - * はい - */ "yes": string; - /** - * いいえ - */ "no": string; - /** - * ドライブのファイル数 - */ "driveFilesCount": string; - /** - * ドライブ使用量 - */ "driveUsage": string; - /** - * クローラーによるインデックスを拒否 - */ "noCrawle": string; - /** - * 外部の検索エンジンにあなたのユーザーページ、ノート、Pagesなどのコンテンツを登録(インデックス)しないよう要求します。 - */ "noCrawleDescription": string; - /** - * フォローを承認制にしても、ノートの公開範囲を「フォロワー」にしない限り、誰でもあなたのノートを見ることができます。 - */ "lockedAccountInfo": string; - /** - * デフォルトでメディアをセンシティブ設定にする - */ "alwaysMarkSensitive": string; - /** - * 添付画像のサムネイルをオリジナル画質にする - */ "loadRawImages": string; - /** - * アニメーション画像を再生しない - */ "disableShowingAnimatedImages": string; - /** - * メディアがセンシティブであることを分かりやすく表示 - */ "highlightSensitiveMedia": string; - /** - * 確認のメールを送信しました。メールに記載されたリンクにアクセスして、設定を完了してください。 - */ "verificationEmailSent": string; - /** - * 未設定 - */ "notSet": string; - /** - * メールアドレスが確認されました - */ "emailVerified": string; - /** - * お気に入りノートの数 - */ "noteFavoritesCount": string; - /** - * Pageにいいねした数 - */ "pageLikesCount": string; - /** - * Pageにいいねされた数 - */ "pageLikedCount": string; - /** - * 連絡先 - */ "contact": string; - /** - * システムのデフォルトのフォントを使う - */ "useSystemFont": string; - /** - * クリップ - */ "clips": string; - /** - * 実験的機能 - */ "experimentalFeatures": string; - /** - * 実験的 - */ "experimental": string; - /** - * これは実験的な機能です。仕様が変更されたり、正常に動作しなかったりする可能性があります。 - */ "thisIsExperimentalFeature": string; - /** - * 開発者 - */ "developer": string; - /** - * アカウントを見つけやすくする - */ "makeExplorable": string; - /** - * オフにすると、「みつける」にアカウントが載らなくなります。 - */ "makeExplorableDescription": string; - /** - * タイムラインのノートを離して表示 - */ "showGapBetweenNotesInTimeline": string; - /** - * 複製 - */ "duplicate": string; - /** - * 左 - */ "left": string; - /** - * 中央 - */ "center": string; - /** - * 広い - */ "wide": string; - /** - * 狭い - */ "narrow": string; - /** - * 設定はページリロード後に反映されます。 - */ "reloadToApplySetting": string; - /** - * 反映には再起動が必要です。 - */ "needReloadToApply": string; - /** - * タイトルバーを表示する - */ "showTitlebar": string; - /** - * キャッシュをクリア - */ "clearCache": string; - /** - * {n}人がオンライン - */ - "onlineUsersCount": ParameterizedString<"n">; - /** - * {n}ユーザー - */ - "nUsers": ParameterizedString<"n">; - /** - * {n}ノート - */ - "nNotes": ParameterizedString<"n">; - /** - * エラーリポートを送信 - */ + "onlineUsersCount": string; + "nUsers": string; + "nNotes": string; "sendErrorReports": string; - /** - * オンにすると、問題が発生したときにエラーの詳細情報がMisskeyに共有され、ソフトウェアの品質向上に役立てることができます。エラー情報には、OSのバージョン、ブラウザの種類、行動履歴などが含まれます。 - */ "sendErrorReportsDescription": string; - /** - * マイテーマ - */ "myTheme": string; - /** - * 背景 - */ "backgroundColor": string; - /** - * アクセント - */ "accentColor": string; - /** - * 文字 - */ "textColor": string; - /** - * 名前を付けて保存 - */ "saveAs": string; - /** - * 高度 - */ "advanced": string; - /** - * 高度な設定 - */ "advancedSettings": string; - /** - * 値 - */ "value": string; - /** - * 作成日時 - */ "createdAt": string; - /** - * 更新日時 - */ "updatedAt": string; - /** - * 保存しますか? - */ "saveConfirm": string; - /** - * 削除しますか? - */ "deleteConfirm": string; - /** - * 有効な値ではありません。 - */ "invalidValue": string; - /** - * レジストリ - */ "registry": string; - /** - * アカウントを閉鎖する - */ "closeAccount": string; - /** - * 現在のバージョン - */ "currentVersion": string; - /** - * 最新のバージョン - */ "latestVersion": string; - /** - * お使いのクライアントは最新です。 - */ "youAreRunningUpToDateClient": string; - /** - * 新しいバージョンのクライアントが利用可能です。 - */ "newVersionOfClientAvailable": string; - /** - * 使用量 - */ "usageAmount": string; - /** - * 容量 - */ "capacity": string; - /** - * 使用中 - */ "inUse": string; - /** - * コードを編集 - */ "editCode": string; - /** - * 適用 - */ "apply": string; - /** - * サーバーからのお知らせを受け取る - */ "receiveAnnouncementFromInstance": string; - /** - * メール通知 - */ "emailNotification": string; - /** - * 公開 - */ "publish": string; - /** - * チャンネル内検索 - */ "inChannelSearch": string; - /** - * 右クリックでリアクションピッカーを開く - */ "useReactionPickerForContextMenu": string; - /** - * {users}が入力中 - */ - "typingUsers": ParameterizedString<"users">; - /** - * 特定の日付にジャンプ - */ + "typingUsers": string; "jumpToSpecifiedDate": string; - /** - * 過去のタイムラインを表示しています - */ "showingPastTimeline": string; - /** - * クリア - */ "clear": string; - /** - * 全て既読にする - */ "markAllAsRead": string; - /** - * 戻る - */ "goBack": string; - /** - * いいね解除しますか? - */ "unlikeConfirm": string; - /** - * フルビュー - */ "fullView": string; - /** - * フルビュー解除 - */ "quitFullView": string; - /** - * 説明を追加 - */ "addDescription": string; - /** - * 個々のノートのメニューから「ピン留め」を選択することで、ここにノートを表示しておくことができます。 - */ "userPagePinTip": string; - /** - * 宛先に含まれていないメンションがあります - */ "notSpecifiedMentionWarning": string; - /** - * 情報 - */ "info": string; - /** - * ユーザー情報 - */ "userInfo": string; - /** - * 不明 - */ "unknown": string; - /** - * オンライン状態 - */ "onlineStatus": string; - /** - * オンライン状態を隠す - */ "hideOnlineStatus": string; - /** - * オンライン状態を隠すと、検索などの一部機能において利便性が低下することがあります。 - */ "hideOnlineStatusDescription": string; - /** - * オンライン - */ "online": string; - /** - * アクティブ - */ "active": string; - /** - * オフライン - */ "offline": string; - /** - * 非推奨 - */ "notRecommended": string; - /** - * Botプロテクション - */ "botProtection": string; - /** - * サーバーブロック・サイレンス - */ "instanceBlocking": string; - /** - * アカウントを選択 - */ "selectAccount": string; - /** - * アカウントを切り替え - */ "switchAccount": string; - /** - * 有効 - */ "enabled": string; - /** - * 無効 - */ "disabled": string; - /** - * クイックアクション - */ "quickAction": string; - /** - * ユーザー - */ "user": string; - /** - * 管理 - */ "administration": string; - /** - * アカウント - */ "accounts": string; - /** - * 切り替え - */ "switch": string; - /** - * 管理者情報が設定されていません。 - */ "noMaintainerInformationWarning": string; - /** - * 問い合わせ先URLが設定されていません。 - */ - "noInquiryUrlWarning": string; - /** - * Botプロテクションが設定されていません。 - */ "noBotProtectionWarning": string; - /** - * 設定する - */ "configure": string; - /** - * ギャラリーへ投稿 - */ "postToGallery": string; - /** - * このハッシュタグで投稿 - */ "postToHashtag": string; - /** - * ギャラリー - */ "gallery": string; - /** - * 最近の投稿 - */ "recentPosts": string; - /** - * 人気の投稿 - */ "popularPosts": string; - /** - * ノートで共有 - */ "shareWithNote": string; - /** - * 広告 - */ "ads": string; - /** - * 期限 - */ "expiration": string; - /** - * 開始期間 - */ "startingperiod": string; - /** - * メモ - */ "memo": string; - /** - * 優先度 - */ "priority": string; - /** - * 高 - */ "high": string; - /** - * 中 - */ "middle": string; - /** - * 低 - */ "low": string; - /** - * メールアドレスの設定がされていません。 - */ "emailNotConfiguredWarning": string; - /** - * 比率 - */ "ratio": string; - /** - * 本文をプレビュー - */ "previewNoteText": string; - /** - * カスタムCSS - */ "customCss": string; - /** - * この設定は必ず知識のある方が行ってください。不適切な設定を行うとクライアントが正常に使用できなくなる恐れがあります。 - */ "customCssWarn": string; - /** - * グローバル - */ "global": string; - /** - * アイコンを四角形で表示 - */ "squareAvatars": string; - /** - * 送信 - */ "sent": string; - /** - * 受信 - */ "received": string; - /** - * 検索結果 - */ "searchResult": string; - /** - * ハッシュタグ - */ "hashtags": string; - /** - * トラブルシューティング - */ "troubleshooting": string; - /** - * UIにぼかし効果を使用 - */ "useBlurEffect": string; - /** - * 詳しく - */ "learnMore": string; - /** - * Misskeyが更新されました! - */ "misskeyUpdated": string; - /** - * 更新情報を見る - */ "whatIsNew": string; - /** - * 翻訳 - */ "translate": string; - /** - * {x}から翻訳 - */ - "translatedFrom": ParameterizedString<"x">; - /** - * アカウントの削除が進行中です - */ + "translatedFrom": string; "accountDeletionInProgress": string; - /** - * サーバー上であなたのアカウントを一意に識別するための名前。アルファベット(a~z, A~Z)、数字(0~9)、およびアンダーバー(_)が使用できます。ユーザー名は後から変更することは出来ません。 - */ "usernameInfo": string; - /** - * 藍モード - */ "aiChanMode": string; - /** - * 開発者モード - */ "devMode": string; - /** - * CWを維持する - */ "keepCw": string; - /** - * Pub/Subのアカウント - */ "pubSub": string; - /** - * 直近の通信 - */ "lastCommunication": string; - /** - * 解決済み - */ "resolved": string; - /** - * 未解決 - */ "unresolved": string; - /** - * フォロワーを解除 - */ "breakFollow": string; - /** - * フォロワー解除しますか? - */ "breakFollowConfirm": string; - /** - * オンになっています - */ "itsOn": string; - /** - * オフになっています - */ "itsOff": string; - /** - * オン - */ "on": string; - /** - * オフ - */ "off": string; - /** - * アカウント登録にメールアドレスを必須にする - */ "emailRequiredForSignup": string; - /** - * 未読 - */ "unread": string; - /** - * フィルタ - */ "filter": string; - /** - * コントロールパネル - */ "controlPanel": string; - /** - * アカウントを管理 - */ "manageAccounts": string; - /** - * リアクション一覧を公開する - */ "makeReactionsPublic": string; - /** - * あなたがしたリアクション一覧を誰でも見れるようにします。 - */ "makeReactionsPublicDescription": string; - /** - * クラシック - */ "classic": string; - /** - * スレッドをミュート - */ "muteThread": string; - /** - * スレッドのミュートを解除 - */ "unmuteThread": string; - /** - * フォローの公開範囲 - */ "followingVisibility": string; - /** - * フォロワーの公開範囲 - */ "followersVisibility": string; - /** - * さらにスレッドを見る - */ "continueThread": string; - /** - * アカウントが削除されます。よろしいですか? - */ "deleteAccountConfirm": string; - /** - * パスワードが間違っています。 - */ "incorrectPassword": string; - /** - * ワンタイムパスワードが間違っているか、期限切れになっています。 - */ - "incorrectTotp": string; - /** - * 「{choice}」に投票しますか? - */ - "voteConfirm": ParameterizedString<"choice">; - /** - * 隠す - */ + "voteConfirm": string; "hide": string; - /** - * モバイルデバイスのときドロワーで表示 - */ "useDrawerReactionPickerForMobile": string; - /** - * おかえりなさい、{name}さん - */ - "welcomeBackWithName": ParameterizedString<"name">; - /** - * [{ok}]を押して、メールアドレスの確認を完了してください。 - */ - "clickToFinishEmailVerification": ParameterizedString<"ok">; - /** - * デバイスタイプ - */ + "welcomeBackWithName": string; + "clickToFinishEmailVerification": string; "overridedDeviceKind": string; - /** - * スマートフォン - */ "smartphone": string; - /** - * タブレット - */ "tablet": string; - /** - * 自動 - */ "auto": string; - /** - * テーマカラー - */ "themeColor": string; - /** - * サイズ - */ "size": string; - /** - * 列の数 - */ "numberOfColumn": string; - /** - * 検索 - */ "searchByGoogle": string; - /** - * サーバーデフォルトのライトテーマ - */ "instanceDefaultLightTheme": string; - /** - * サーバーデフォルトのダークテーマ - */ "instanceDefaultDarkTheme": string; - /** - * オブジェクト形式のテーマコードを記入します。 - */ "instanceDefaultThemeDescription": string; - /** - * ミュートする期限 - */ "mutePeriod": string; - /** - * 期限 - */ "period": string; - /** - * 無期限 - */ "indefinitely": string; - /** - * 10分 - */ "tenMinutes": string; - /** - * 1時間 - */ "oneHour": string; - /** - * 1日 - */ "oneDay": string; - /** - * 1週間 - */ "oneWeek": string; - /** - * 1ヶ月 - */ "oneMonth": string; - /** - * 3ヶ月 - */ - "threeMonths": string; - /** - * 1年 - */ - "oneYear": string; - /** - * 3日 - */ - "threeDays": string; - /** - * 反映されるまで時間がかかる場合があります。 - */ "reflectMayTakeTime": string; - /** - * アカウント情報の取得に失敗しました - */ "failedToFetchAccountInformation": string; - /** - * レート制限を超えました - */ "rateLimitExceeded": string; - /** - * 画像のクロップ - */ "cropImage": string; - /** - * 画像をクロップしますか? - */ "cropImageAsk": string; - /** - * クロップする - */ "cropYes": string; - /** - * そのまま使う - */ "cropNo": string; - /** - * ファイル - */ "file": string; - /** - * 直近{n}時間 - */ - "recentNHours": ParameterizedString<"n">; - /** - * 直近{n}日 - */ - "recentNDays": ParameterizedString<"n">; - /** - * メールサーバーの設定がされていません。 - */ + "recentNHours": string; + "recentNDays": string; "noEmailServerWarning": string; - /** - * 未対応の通報があります。 - */ "thereIsUnresolvedAbuseReportWarning": string; - /** - * 推奨 - */ "recommended": string; - /** - * チェック - */ "check": string; - /** - * このユーザーのドライブ容量上限を変更 - */ "driveCapOverrideLabel": string; - /** - * 0以下を指定すると解除されます。 - */ "driveCapOverrideCaption": string; - /** - * 閲覧するには管理者アカウントでログインしている必要があります。 - */ "requireAdminForView": string; - /** - * システムにより自動で作成・管理されているアカウントです。 - */ "isSystemAccount": string; - /** - * この操作を行うには {x} と入力してください - */ - "typeToConfirm": ParameterizedString<"x">; - /** - * アカウント削除 - */ + "typeToConfirm": string; "deleteAccount": string; - /** - * ドキュメント - */ "document": string; - /** - * ページキャッシュ数 - */ "numberOfPageCache": string; - /** - * 多くすると利便性が向上しますが、負荷とメモリ使用量が増えます。 - */ "numberOfPageCacheDescription": string; - /** - * ログアウトしますか? - */ "logoutConfirm": string; - /** - * 最終利用日時 - */ "lastActiveDate": string; - /** - * ステータスバー - */ "statusbar": string; - /** - * 選択してください - */ "pleaseSelect": string; - /** - * 反転 - */ "reverse": string; - /** - * 色付き - */ "colored": string; - /** - * 更新間隔 - */ "refreshInterval": string; - /** - * ラベル - */ "label": string; - /** - * タイプ - */ "type": string; - /** - * 速度 - */ "speed": string; - /** - * 遅い - */ "slow": string; - /** - * 速い - */ "fast": string; - /** - * センシティブなメディアの検出 - */ "sensitiveMediaDetection": string; - /** - * ローカルのみ - */ "localOnly": string; - /** - * リモートのみ - */ "remoteOnly": string; - /** - * アップロード失敗 - */ "failedToUpload": string; - /** - * 不適切な内容を含む可能性があると判定されたためアップロードできません。 - */ "cannotUploadBecauseInappropriate": string; - /** - * ドライブの空き容量が無いためアップロードできません。 - */ "cannotUploadBecauseNoFreeSpace": string; - /** - * ファイルサイズの制限を超えているためアップロードできません。 - */ "cannotUploadBecauseExceedsFileSizeLimit": string; - /** - * ベータ - */ "beta": string; - /** - * 自動センシティブ判定 - */ "enableAutoSensitive": string; - /** - * 利用可能な場合は、機械学習を利用して自動でメディアにセンシティブフラグを設定します。この機能をオフにしても、サーバーによっては自動で設定されることがあります。 - */ "enableAutoSensitiveDescription": string; - /** - * ユーザーのメールアドレスのバリデーションを、捨てアドかどうかや実際に通信可能かどうかなどを判定しより積極的に行います。オフにすると単に文字列として正しいかどうかのみチェックされます。 - */ "activeEmailValidationDescription": string; - /** - * ナビゲーションバー - */ "navbar": string; - /** - * シャッフル - */ "shuffle": string; - /** - * アカウント - */ "account": string; - /** - * 移動 - */ "move": string; - /** - * プッシュ通知 - */ "pushNotification": string; - /** - * プッシュ通知を有効化 - */ "subscribePushNotification": string; - /** - * プッシュ通知を停止する - */ "unsubscribePushNotification": string; - /** - * プッシュ通知は有効です - */ "pushNotificationAlreadySubscribed": string; - /** - * ブラウザかサーバーがプッシュ通知に非対応 - */ "pushNotificationNotSupported": string; - /** - * 通知が既読になったらプッシュ通知を削除する - */ "sendPushNotificationReadMessage": string; - /** - * 端末の電池消費量が増加する可能性があります。 - */ "sendPushNotificationReadMessageCaption": string; - /** - * 最大化 - */ "windowMaximize": string; - /** - * 最小化 - */ "windowMinimize": string; - /** - * 元に戻す - */ "windowRestore": string; - /** - * キャプション - */ "caption": string; - /** - * Botアカウントでログイン中 - */ "loggedInAsBot": string; - /** - * ツール - */ "tools": string; - /** - * 読み込めません - */ "cannotLoad": string; - /** - * プロフィール表示回数 - */ "numberOfProfileView": string; - /** - * いいね! - */ "like": string; - /** - * いいねを解除 - */ "unlike": string; - /** - * いいね数 - */ "numberOfLikes": string; - /** - * 表示 - */ "show": string; - /** - * 今後表示しない - */ "neverShow": string; - /** - * また後で - */ "remindMeLater": string; - /** - * Misskeyを気に入っていただけましたか? - */ "didYouLikeMisskey": string; - /** - * Misskeyは{host}が使用している無料のソフトウェアです。これからも開発を続けられるように、ぜひ寄付をお願いします! - */ - "pleaseDonate": ParameterizedString<"host">; - /** - * 対応するソースコードは{anchor}から利用可能です。 - */ - "correspondingSourceIsAvailable": ParameterizedString<"anchor">; - /** - * ロール - */ + "pleaseDonate": string; "roles": string; - /** - * ロール - */ "role": string; - /** - * ロールはありません - */ "noRole": string; - /** - * 一般ユーザー - */ "normalUser": string; - /** - * 未定義 - */ "undefined": string; - /** - * アサイン - */ "assign": string; - /** - * アサインを解除 - */ "unassign": string; - /** - * 色 - */ "color": string; - /** - * カスタム絵文字の管理 - */ "manageCustomEmojis": string; - /** - * アバターデコレーションの管理 - */ "manageAvatarDecorations": string; - /** - * これ以上作成することはできません。 - */ "youCannotCreateAnymore": string; - /** - * 一時的に利用できません - */ "cannotPerformTemporary": string; - /** - * 操作回数が制限を超過するため一時的に利用できません。しばらく時間を置いてから再度お試しください。 - */ "cannotPerformTemporaryDescription": string; - /** - * パラメータエラー - */ "invalidParamError": string; - /** - * リクエストパラメータに問題があります。通常これはバグですが、入力した文字数が多すぎる等の可能性もあります。 - */ "invalidParamErrorDescription": string; - /** - * 操作が拒否されました - */ "permissionDeniedError": string; - /** - * このアカウントにはこの操作を行うための権限がありません。 - */ "permissionDeniedErrorDescription": string; - /** - * プリセット - */ "preset": string; - /** - * プリセットから選択 - */ "selectFromPresets": string; - /** - * 実績 - */ "achievements": string; - /** - * サーバーの応答が無効です - */ "gotInvalidResponseError": string; - /** - * サーバーがダウンまたはメンテナンスしている可能性があります。しばらくしてから再度お試しください。 - */ "gotInvalidResponseErrorDescription": string; - /** - * この投稿は迷惑になる可能性があります。 - */ "thisPostMayBeAnnoying": string; - /** - * ホームに投稿 - */ "thisPostMayBeAnnoyingHome": string; - /** - * やめる - */ "thisPostMayBeAnnoyingCancel": string; - /** - * このまま投稿 - */ "thisPostMayBeAnnoyingIgnore": string; - /** - * リノートのスマート省略 - */ "collapseRenotes": string; - /** - * リアクションやリノートをしたことがあるノートをたたんで表示します。 - */ - "collapseRenotesDescription": string; - /** - * サーバー内部エラー - */ "internalServerError": string; - /** - * サーバー内部で予期しないエラーが発生しました。 - */ "internalServerErrorDescription": string; - /** - * エラー情報をコピー - */ "copyErrorInfo": string; - /** - * このサーバーに登録する - */ "joinThisServer": string; - /** - * 他のサーバーを探す - */ "exploreOtherServers": string; - /** - * タイムラインを見てみる - */ "letsLookAtTimeline": string; - /** - * 連合なしにしますか? - */ "disableFederationConfirm": string; - /** - * 連合なしにしても投稿は非公開になりません。ほとんどの場合、連合なしにする必要はありません。 - */ "disableFederationConfirmWarn": string; - /** - * 連合なしにする - */ "disableFederationOk": string; - /** - * 現在このサーバーは招待制です。招待コードをお持ちの方のみ登録できます。 - */ "invitationRequiredToRegister": string; - /** - * このサーバーではメール配信はサポートされていません - */ "emailNotSupported": string; - /** - * チャンネルに投稿 - */ "postToTheChannel": string; - /** - * 後から変更できません。 - */ "cannotBeChangedLater": string; - /** - * リアクションの受け入れ - */ "reactionAcceptance": string; - /** - * いいねのみ - */ "likeOnly": string; - /** - * 全て (リモートはいいねのみ) - */ "likeOnlyForRemote": string; - /** - * 非センシティブのみ - */ "nonSensitiveOnly": string; - /** - * 非センシティブのみ (リモートはいいねのみ) - */ "nonSensitiveOnlyForLocalLikeOnlyForRemote": string; - /** - * 自分に割り当てられたロール - */ "rolesAssignedToMe": string; - /** - * パスワードリセットしますか? - */ "resetPasswordConfirm": string; - /** - * センシティブワード - */ "sensitiveWords": string; - /** - * 設定したワードが含まれるノートの公開範囲をホームにします。改行で区切って複数設定できます。 - */ "sensitiveWordsDescription": string; - /** - * スペースで区切るとAND指定になり、キーワードをスラッシュで囲むと正規表現になります。 - */ "sensitiveWordsDescription2": string; - /** - * 禁止ワード - */ - "prohibitedWords": string; - /** - * 設定したワードが含まれるノートを投稿しようとした際、エラーとなるようにします。改行で区切って複数設定できます。 - */ - "prohibitedWordsDescription": string; - /** - * スペースで区切るとAND指定になり、キーワードをスラッシュで囲むと正規表現になります。 - */ - "prohibitedWordsDescription2": string; - /** - * 非表示ハッシュタグ - */ "hiddenTags": string; - /** - * 設定したタグをトレンドに表示させないようにします。改行で区切って複数設定できます。 - */ "hiddenTagsDescription": string; - /** - * ノート検索は利用できません。 - */ "notesSearchNotAvailable": string; - /** - * ライセンス - */ "license": string; - /** - * お気に入り解除しますか? - */ "unfavoriteConfirm": string; - /** - * 自分のクリップ - */ "myClips": string; - /** - * ドライブクリーナー - */ "drivecleaner": string; - /** - * すべてのキューを今すぐ再試行 - */ "retryAllQueuesNow": string; - /** - * 今すぐ再試行しますか? - */ "retryAllQueuesConfirmTitle": string; - /** - * 一時的にサーバーの負荷が増大することがあります。 - */ "retryAllQueuesConfirmText": string; - /** - * リモートユーザーのチャートを生成 - */ "enableChartsForRemoteUser": string; - /** - * リモートサーバーのチャートを生成 - */ "enableChartsForFederatedInstances": string; - /** - * リモートサーバーの情報を取得 - */ - "enableStatsForFederatedInstances": string; - /** - * ノートのアクションにクリップを追加 - */ "showClipButtonInNoteFooter": string; - /** - * リアクションの表示サイズ - */ "reactionsDisplaySize": string; - /** - * リアクションの最大横幅を制限し、縮小して表示する - */ "limitWidthOfReaction": string; - /** - * ノートIDまたはURL - */ "noteIdOrUrl": string; - /** - * 動画 - */ "video": string; - /** - * 動画 - */ "videos": string; - /** - * 音声 - */ - "audio": string; - /** - * 音声 - */ - "audioFiles": string; - /** - * データセーバー - */ "dataSaver": string; - /** - * アカウントの移行 - */ "accountMigration": string; - /** - * このユーザーは新しいアカウントに移行しました: - */ "accountMoved": string; - /** - * このアカウントは移行されています - */ "accountMovedShort": string; - /** - * この操作はできません - */ "operationForbidden": string; - /** - * 常に広告を表示する - */ "forceShowAds": string; - /** - * メモを追加 - */ "addMemo": string; - /** - * メモを編集 - */ "editMemo": string; - /** - * リアクション一覧 - */ "reactionsList": string; - /** - * リノート一覧 - */ "renotesList": string; - /** - * 通知の表示 - */ "notificationDisplay": string; - /** - * 左上 - */ "leftTop": string; - /** - * 右上 - */ "rightTop": string; - /** - * 左下 - */ "leftBottom": string; - /** - * 右下 - */ "rightBottom": string; - /** - * スタック方向 - */ "stackAxis": string; - /** - * 縦 - */ "vertical": string; - /** - * 横 - */ "horizontal": string; - /** - * 位置 - */ "position": string; - /** - * サーバールール - */ "serverRules": string; - /** - * このサーバーに登録するには、以下の内容を確認し同意する必要があります。 - */ "pleaseConfirmBelowBeforeSignup": string; - /** - * 続けるには、全ての「同意する」にチェックが入っている必要があります。 - */ "pleaseAgreeAllToContinue": string; - /** - * 続ける - */ "continue": string; - /** - * 予約ユーザー名 - */ "preservedUsernames": string; - /** - * 予約するユーザー名を改行で列挙します。ここで指定されたユーザー名はアカウント作成時に使えなくなりますが、管理者によるアカウント作成時はこの制限を受けません。また、既に存在するアカウントも影響を受けません。 - */ "preservedUsernamesDescription": string; - /** - * このファイルからノートを作成 - */ "createNoteFromTheFile": string; - /** - * アーカイブ - */ "archive": string; - /** - * アーカイブ済み - */ - "archived": string; - /** - * アーカイブ解除 - */ - "unarchive": string; - /** - * {name}をアーカイブしますか? - */ - "channelArchiveConfirmTitle": ParameterizedString<"name">; - /** - * アーカイブすると、チャンネル一覧や検索結果に表示されなくなり、新たな書き込みもできなくなります。 - */ + "channelArchiveConfirmTitle": string; "channelArchiveConfirmDescription": string; - /** - * このチャンネルはアーカイブされています。 - */ "thisChannelArchived": string; - /** - * ノートの表示 - */ "displayOfNote": string; - /** - * 初期設定 - */ "initialAccountSetting": string; - /** - * フォロー中 - */ "youFollowing": string; - /** - * 生成AIによる学習を拒否 - */ "preventAiLearning": string; - /** - * 外部の文章生成AIや画像生成AIに対して、投稿したノートや画像などのコンテンツを学習の対象にしないように要求します。これはnoaiフラグをHTMLレスポンスに含めることによって実現されますが、この要求に従うかはそのAI次第であるため、学習を完全に防止するものではありません。 - */ "preventAiLearningDescription": string; - /** - * オプション - */ "options": string; - /** - * ユーザー指定 - */ "specifyUser": string; - /** - * 照会しますか? - */ - "lookupConfirm": string; - /** - * ハッシュタグのページを開きますか? - */ - "openTagPageConfirm": string; - /** - * ホスト指定 - */ - "specifyHost": string; - /** - * プレビューできません - */ "failedToPreviewUrl": string; - /** - * 更新 - */ "update": string; - /** - * リアクションとして使えるロール - */ "rolesThatCanBeUsedThisEmojiAsReaction": string; - /** - * ロールの指定が一つもない場合、誰でもリアクションとして使えます。 - */ "rolesThatCanBeUsedThisEmojiAsReactionEmptyDescription": string; - /** - * ロールは公開ロールである必要があります。 - */ "rolesThatCanBeUsedThisEmojiAsReactionPublicRoleWarn": string; - /** - * リアクションを取り消しますか? - */ "cancelReactionConfirm": string; - /** - * リアクションを変更しますか? - */ "changeReactionConfirm": string; - /** - * あとで - */ "later": string; - /** - * Misskeyへ - */ "goToMisskey": string; - /** - * 絵文字の追加辞書 - */ "additionalEmojiDictionary": string; - /** - * インストール済み - */ "installed": string; - /** - * ブランディング - */ "branding": string; - /** - * サーバーのマシン情報を公開する - */ "enableServerMachineStats": string; - /** - * ユーザーごとのIdenticon生成を有効にする - */ "enableIdenticonGeneration": string; - /** - * オフにするとパフォーマンスが向上します。 - */ "turnOffToImprovePerformance": string; - /** - * 招待コードを作成 - */ "createInviteCode": string; - /** - * オプションを指定して作成 - */ "createWithOptions": string; - /** - * 作成数 - */ "createCount": string; - /** - * 招待コードを作成しました - */ "inviteCodeCreated": string; - /** - * 作成できる招待コードの数が上限に達しています。 - */ "inviteLimitExceeded": string; - /** - * 作成できる招待コード: 残り {limit} 個 - */ - "createLimitRemaining": ParameterizedString<"limit">; - /** - * {time}で最大 {limit} 個の招待コードを作成できます。 - */ - "inviteLimitResetCycle": ParameterizedString<"time" | "limit">; - /** - * 有効期限 - */ + "createLimitRemaining": string; + "inviteLimitResetCycle": string; "expirationDate": string; - /** - * 有効期限を設けない - */ "noExpirationDate": string; - /** - * 招待コードが使用された日時 - */ "inviteCodeUsedAt": string; - /** - * 招待コードを使用したユーザー - */ "registeredUserUsingInviteCode": string; - /** - * メール認証待ち - */ "waitingForMailAuth": string; - /** - * 招待コードを作成したユーザー - */ "inviteCodeCreator": string; - /** - * 使用日時 - */ "usedAt": string; - /** - * 未使用 - */ "unused": string; - /** - * 使用済み - */ "used": string; - /** - * 期限切れ - */ "expired": string; - /** - * 同意しますか? - */ "doYouAgree": string; - /** - * 重要ですので必ずお読みください。 - */ "beSureToReadThisAsItIsImportant": string; - /** - * 「{x}」の内容をよく読み、同意します。 - */ - "iHaveReadXCarefullyAndAgree": ParameterizedString<"x">; - /** - * ダイアログ - */ + "iHaveReadXCarefullyAndAgree": string; "dialog": string; - /** - * アイコン - */ "icon": string; - /** - * あなたへ - */ "forYou": string; - /** - * 現在のお知らせ - */ "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; - /** - * 日時 - */ "dateAndTime": string; - /** - * リノートを表示 - */ "showRenotes": string; - /** - * 編集済み - */ "edited": string; - /** - * 通知の受信設定 - */ "notificationRecieveConfig": string; - /** - * 相互フォロー - */ "mutualFollow": string; - /** - * フォロー中またはフォロワー - */ - "followingOrFollower": string; - /** - * ファイル付きのみ - */ "fileAttachedOnly": string; - /** - * TLに他の人への返信を含める - */ "showRepliesToOthersInTimeline": string; - /** - * TLに他の人への返信を含めない - */ "hideRepliesToOthersInTimeline": string; - /** - * TLに現在フォロー中の人全員の返信を含めるようにする - */ "showRepliesToOthersInTimelineAll": string; - /** - * TLに現在フォロー中の人全員の返信を含めないようにする - */ "hideRepliesToOthersInTimelineAll": string; - /** - * この操作は元に戻せません。本当にTLに現在フォロー中の人全員の返信を含めるようにしますか? - */ "confirmShowRepliesAll": string; - /** - * この操作は元に戻せません。本当にTLに現在フォロー中の人全員の返信を含めないようにしますか? - */ "confirmHideRepliesAll": string; - /** - * 外部サービス - */ "externalServices": string; - /** - * ソースコード - */ - "sourceCode": string; - /** - * ソースコードはまだ提供されていません。この問題の修正について管理者に問い合わせてください。 - */ - "sourceCodeIsNotYetProvided": string; - /** - * リポジトリURL - */ - "repositoryUrl": string; - /** - * ソースコードが公開されているリポジトリがある場合、そのURLを記入します。Misskeyを現状のまま(ソースコードにいかなる変更も加えずに)使用している場合は https://github.com/misskey-dev/misskey と記入します。 - */ - "repositoryUrlDescription": string; - /** - * リポジトリを公開していない場合、代わりにtarballを提供する必要があります。詳細は.config/example.ymlを参照してください。 - */ - "repositoryUrlOrTarballRequired": string; - /** - * フィードバック - */ - "feedback": string; - /** - * フィードバックURL - */ - "feedbackUrl": string; - /** - * 運営者情報 - */ "impressum": string; - /** - * 運営者情報URL - */ "impressumUrl": string; - /** - * ドイツなどの一部の国と地域では表示が義務付けられています(Impressum)。 - */ "impressumDescription": string; - /** - * プライバシーポリシー - */ "privacyPolicy": string; - /** - * プライバシーポリシーURL - */ "privacyPolicyUrl": string; - /** - * 利用規約・プライバシーポリシー - */ "tosAndPrivacyPolicy": string; - /** - * アイコンデコレーション - */ "avatarDecorations": string; - /** - * 付ける - */ "attach": string; - /** - * 外す - */ "detach": string; - /** - * 全て外す - */ "detachAll": string; - /** - * 角度 - */ "angle": string; - /** - * 反転 - */ "flip": string; - /** - * アイコンのデコレーションを表示 - */ "showAvatarDecorations": string; - /** - * 離してリロード - */ "releaseToRefresh": string; - /** - * リロード中 - */ "refreshing": string; - /** - * 引っ張ってリロード - */ "pullDownToRefresh": string; - /** - * タイムラインのリアルタイム更新を無効にする - */ "disableStreamingTimeline": string; - /** - * 通知をグルーピングして表示する - */ "useGroupedNotifications": string; - /** - * メールアドレスの確認中に問題が発生しました。リンクの有効期限が切れている可能性があります。 - */ "signupPendingError": string; - /** - * 「内容を隠す」がオンの場合は注釈の記述が必要です。 - */ "cwNotationRequired": string; - /** - * リアクションする - */ "doReaction": string; - /** - * コード - */ "code": string; - /** - * 設定の反映にはリロードが必要です。 - */ "reloadRequiredToApplySettings": string; - /** - * 残り: {n} - */ - "remainingN": ParameterizedString<"n">; - /** - * 現在の内容に上書きされますがよろしいですか? - */ + "remainingN": string; "overwriteContentConfirm": string; - /** - * 季節に応じた画面の演出 - */ "seasonalScreenEffect": string; - /** - * デコる - */ "decorate": string; - /** - * 装飾を追加 - */ "addMfmFunction": string; - /** - * 高度なMFMのピッカーを表示する - */ "enableQuickAddMfmFunction": string; - /** - * バブルゲーム - */ - "bubbleGame": string; - /** - * 効果音 - */ - "sfx": string; - /** - * サウンドが再生されます - */ - "soundWillBePlayed": string; - /** - * リプレイを見る - */ - "showReplay": string; - /** - * リプレイ - */ - "replay": string; - /** - * リプレイ中 - */ - "replaying": string; - /** - * リプレイを終了 - */ - "endReplay": string; - /** - * リプレイデータをコピー - */ - "copyReplayData": string; - /** - * ランキング - */ - "ranking": string; - /** - * 直近{n}日 - */ - "lastNDays": ParameterizedString<"n">; - /** - * タイトルへ - */ - "backToTitle": string; - /** - * お住まいの地域 - */ - "hemisphere": string; - /** - * センシティブなファイルを含むノートを表示 - */ - "withSensitive": string; - /** - * {name}のセンシティブなファイルを含む投稿 - */ - "userSaysSomethingSensitive": ParameterizedString<"name">; - /** - * スワイプしてタブを切り替える - */ - "enableHorizontalSwipe": string; - /** - * 読み込み中 - */ - "loading": string; - /** - * やめる - */ - "surrender": string; - /** - * リトライ - */ - "gameRetry": string; - /** - * 使用しない場合は空欄にしてください - */ - "notUsePleaseLeaveBlank": string; - /** - * ワンタイムパスワードを使う - */ - "useTotp": string; - /** - * バックアップコードを使う - */ - "useBackupCode": string; - /** - * アプリを起動 - */ - "launchApp": string; - /** - * 動画・音声の再生にブラウザのUIを使用する - */ - "useNativeUIForVideoAudioPlayer": string; - /** - * オリジナルのファイル名を保持 - */ - "keepOriginalFilename": string; - /** - * この設定をオフにすると、アップロード時にファイル名が自動でランダム文字列に置き換えられます。 - */ - "keepOriginalFilenameDescription": string; - /** - * 説明文はありません - */ - "noDescription": string; - /** - * フォローの際常に確認する - */ - "alwaysConfirmFollow": string; - /** - * お問い合わせ - */ - "inquiry": string; - /** - * もう一度お試しください。 - */ - "tryAgain": string; - /** - * センシティブなメディアを表示するとき確認する - */ - "confirmWhenRevealingSensitiveMedia": string; - /** - * センシティブなメディアです。表示しますか? - */ - "sensitiveMediaRevealConfirm": string; - /** - * 作成したリスト - */ - "createdLists": string; - /** - * 作成したアンテナ - */ - "createdAntennas": string; - /** - * {x}から - */ - "fromX": ParameterizedString<"x">; - /** - * 埋め込みコードを生成 - */ - "genEmbedCode": string; - /** - * このユーザーのノート一覧 - */ - "noteOfThisUser": string; - /** - * これ以上このクリップにノートを追加できません。 - */ - "clipNoteLimitExceeded": string; - /** - * パフォーマンス - */ - "performance": string; - /** - * 変更あり - */ - "modified": string; - /** - * 破棄 - */ - "discard": string; - /** - * {n}件の変更があります - */ - "thereAreNChanges": ParameterizedString<"n">; - /** - * パスキーでログイン - */ - "signinWithPasskey": string; - /** - * 登録されていないパスキーです。 - */ - "unknownWebAuthnKey": string; - /** - * パスキーの検証に失敗しました。 - */ - "passkeyVerificationFailed": string; - /** - * パスキーの検証に成功しましたが、パスワードレスログインが無効になっています。 - */ - "passkeyVerificationSucceededButPasswordlessLoginDisabled": string; - /** - * フォロワーへのメッセージ - */ - "messageToFollower": string; - /** - * 対象 - */ - "target": string; - /** - * CAPTCHAのテストを目的とした機能です。本番環境で使用しないでください。 - */ - "testCaptchaWarning": string; - /** - * 禁止ワード(ユーザーの名前) - */ - "prohibitedWordsForNameOfUser": string; - /** - * このリストに含まれる文字列がユーザーの名前に含まれる場合、ユーザーの名前の変更を拒否します。モデレーター権限を持つユーザーはこの制限の影響を受けません。 - */ - "prohibitedWordsForNameOfUserDescription": string; - /** - * 変更しようとした名前に禁止された文字列が含まれています - */ - "yourNameContainsProhibitedWords": string; - /** - * 名前に禁止されている文字列が含まれています。この名前を使用したい場合は、サーバー管理者にお問い合わせください。 - */ - "yourNameContainsProhibitedWordsDescription": string; - /** - * 投稿者により、表示にはログインが必要と設定されています - */ - "thisContentsAreMarkedAsSigninRequiredByAuthor": string; - /** - * ロックダウン - */ - "lockdown": string; - /** - * アカウントを選択してください - */ - "pleaseSelectAccount": string; - /** - * 利用可能なロール - */ - "availableRoles": string; - "_accountSettings": { - /** - * コンテンツの表示にログインを必須にする - */ - "requireSigninToViewContents": string; - /** - * あなたが作成した全てのノートなどのコンテンツを表示するのにログインを必須にします。クローラーに情報が収集されるのを防ぐ効果が期待できます。 - */ - "requireSigninToViewContentsDescription1": string; - /** - * URLプレビュー(OGP)、Webページへの埋め込み、ノートの引用に対応していないサーバーからの表示も不可になります。 - */ - "requireSigninToViewContentsDescription2": string; - /** - * リモートサーバーに連合されたコンテンツでは、これらの制限が適用されない場合があります。 - */ - "requireSigninToViewContentsDescription3": string; - /** - * 過去のノートをフォロワーのみ表示可能にする - */ - "makeNotesFollowersOnlyBefore": string; - /** - * この機能が有効になっている間、設定された日時より過去、または設定された時間を経過しているノートがフォロワーのみ表示可能になります。無効に戻すと、ノートの公開状態も元に戻ります。 - */ - "makeNotesFollowersOnlyBeforeDescription": string; - /** - * 過去のノートを非公開化する - */ - "makeNotesHiddenBefore": string; - /** - * この機能が有効になっている間、設定された日時より過去、または設定された時間を経過しているノートが自分のみ表示可能(非公開化)になります。無効に戻すと、ノートの公開状態も元に戻ります。 - */ - "makeNotesHiddenBeforeDescription": string; - /** - * リモートサーバーに連合されたノートには効果が及ばない場合があります。 - */ - "mayNotEffectForFederatedNotes": string; - /** - * 指定した時間を経過しているノート - */ - "notesHavePassedSpecifiedPeriod": string; - /** - * 指定した日時より前のノート - */ - "notesOlderThanSpecifiedDateAndTime": string; - }; - "_abuseUserReport": { - /** - * 転送 - */ - "forward": string; - /** - * 匿名のシステムアカウントとして、リモートサーバーに通報を転送します。 - */ - "forwardDescription": string; - /** - * 解決 - */ - "resolve": string; - /** - * 是認 - */ - "accept": string; - /** - * 否認 - */ - "reject": string; - /** - * 内容が正当である通報に対応した場合は「是認」を選択し、肯定的にケースが解決されたことをマークします。 - * 内容が正当でない通報の場合は「否認」を選択し、否定的にケースが解決されたことをマークします。 - */ - "resolveTutorial": string; - }; - "_delivery": { - /** - * 配信状態 - */ - "status": string; - /** - * 配信停止 - */ - "stop": string; - /** - * 配信再開 - */ - "resume": string; - "_type": { - /** - * 配信中 - */ - "none": string; - /** - * 手動停止中 - */ - "manuallySuspended": string; - /** - * サーバー削除のため停止中 - */ - "goneSuspended": string; - /** - * サーバー応答なしのため停止中 - */ - "autoSuspendedForNotResponding": string; - }; - }; - "_bubbleGame": { - /** - * 遊び方 - */ - "howToPlay": string; - /** - * ホールド - */ - "hold": string; - "_score": { - /** - * スコア - */ - "score": string; - /** - * 稼いだ金額 - */ - "scoreYen": string; - /** - * ハイスコア - */ - "highScore": string; - /** - * 最大チェーン数 - */ - "maxChain": string; - /** - * {yen}円 - */ - "yen": ParameterizedString<"yen">; - /** - * {qty}個分 - */ - "estimatedQty": ParameterizedString<"qty">; - /** - * おにぎり {onigiriQtyWithUnit} - */ - "scoreSweets": ParameterizedString<"onigiriQtyWithUnit">; - }; - "_howToPlay": { - /** - * 位置を調整してハコにモノを落とします。 - */ - "section1": string; - /** - * 同じ種類のモノがくっつくと別のモノに変化して、スコアが得られます。 - */ - "section2": string; - /** - * モノがハコからあふれるとゲームオーバーです。ハコからあふれないようにしつつモノを融合させてハイスコアを目指そう! - */ - "section3": string; - }; - }; "_announcement": { - /** - * 既存ユーザーのみ - */ "forExistingUsers": string; - /** - * 有効にすると、このお知らせ作成時点で存在するユーザーにのみお知らせが表示されます。無効にすると、このお知らせ作成後にアカウントを作成したユーザーにもお知らせが表示されます。 - */ "forExistingUsersDescription": string; - /** - * 既読にするのに確認が必要 - */ "needConfirmationToRead": string; - /** - * 有効にすると、このお知らせを既読にする際に確認ダイアログが表示されます。また、一括既読操作の対象になりません。 - */ "needConfirmationToReadDescription": string; - /** - * お知らせを終了 - */ "end": string; - /** - * アクティブなお知らせが多いため、UXが低下する可能性があります。終了したお知らせはアーカイブすることを検討してください。 - */ "tooManyActiveAnnouncementDescription": string; - /** - * 既読にしますか? - */ "readConfirmTitle": string; - /** - * 「{title}」の内容を読み、既読にします。 - */ - "readConfirmText": ParameterizedString<"title">; - /** - * 特に新規ユーザーのUXを損ねる可能性が高いため、常時掲示するための情報ではなく、即時性が求められる情報の掲示のためにお知らせを使用することを推奨します。 - */ + "readConfirmText": string; "shouldNotBeUsedToPresentPermanentInfo": string; - /** - * ダイアログ形式のお知らせが同時に2つ以上ある場合、UXに悪影響を及ぼす可能性が非常に高いため、使用は慎重に行うことを推奨します。 - */ "dialogAnnouncementUxWarn": string; - /** - * 非通知 - */ "silence": string; - /** - * オンにすると、このお知らせは通知されず、既読にする必要もなくなります。 - */ "silenceDescription": string; }; "_initialAccountSetting": { - /** - * アカウントの作成が完了しました! - */ "accountCreated": string; - /** - * さっそくアカウントの初期設定を行いましょう。 - */ "letsStartAccountSetup": string; - /** - * まずはあなたのプロフィールを設定しましょう。 - */ "letsFillYourProfile": string; - /** - * プロフィール設定 - */ "profileSetting": string; - /** - * プライバシー設定 - */ "privacySetting": string; - /** - * これらの設定は後から変更できます。 - */ "theseSettingsCanEditLater": string; - /** - * この他にも様々な設定を「設定」ページから行えます。ぜひ後で確認してみてください。 - */ "youCanEditMoreSettingsInSettingsPageLater": string; - /** - * タイムラインを構築するため、気になるユーザーをフォローしてみましょう。 - */ "followUsers": string; - /** - * プッシュ通知を有効にすると{name}の通知をお使いのデバイスで受け取ることができます。 - */ - "pushNotificationDescription": ParameterizedString<"name">; - /** - * 初期設定が完了しました! - */ + "pushNotificationDescription": string; "initialAccountSettingCompleted": string; - /** - * {name}をお楽しみください! - */ - "haveFun": ParameterizedString<"name">; - /** - * このまま{name}(Misskey)の使い方についてのチュートリアルに進むこともできますが、ここで中断してすぐに使い始めることもできます。 - */ - "youCanContinueTutorial": ParameterizedString<"name">; - /** - * チュートリアルを開始 - */ + "haveFun": string; + "youCanContinueTutorial": string; "startTutorial": string; - /** - * 初期設定をスキップしますか? - */ "skipAreYouSure": string; - /** - * 初期設定をあとでやり直しますか? - */ "laterAreYouSure": string; }; "_initialTutorial": { - /** - * チュートリアルを見る - */ "launchTutorial": string; - /** - * チュートリアル - */ "title": string; - /** - * よくできました - */ "wellDone": string; - /** - * チュートリアルを終了しますか? - */ "skipAreYouSure": string; "_landing": { - /** - * チュートリアルへようこそ - */ "title": string; - /** - * ここでは、Misskeyの基本的な使い方や機能を確認できます。 - */ "description": string; }; "_note": { - /** - * ノートって何? - */ "title": string; - /** - * Misskeyでの投稿は「ノート」と呼びます。ノートはタイムラインに時系列で並んでいて、リアルタイムで更新されていきます。 - */ "description": string; - /** - * 返信することができます。返信に対しての返信も可能で、スレッドのように会話を続けることもできます。 - */ "reply": string; - /** - * そのノートを自分のタイムラインに流して共有することができます。テキストを追加して引用することも可能です。 - */ "renote": string; - /** - * リアクションをつけることができます。詳しくは次のページで解説します。 - */ "reaction": string; - /** - * ノートの詳細を表示したり、リンクをコピーしたりなどの様々な操作が行えます。 - */ "menu": string; }; "_reaction": { - /** - * リアクションって何? - */ "title": string; - /** - * ノートには「リアクション」をつけることができます。「いいね」では伝わらないニュアンスも、リアクションで簡単・気軽に表現できます。 - */ "description": string; - /** - * リアクションは、ノートの「+」ボタンをクリックするとつけられます。試しにこのサンプルのノートにリアクションをつけてみてください! - */ "letsTryReacting": string; - /** - * リアクションをつけると先に進めるようになります。 - */ "reactToContinue": string; - /** - * あなたのノートが誰かにリアクションされると、リアルタイムで通知を受け取ります。 - */ "reactNotification": string; - /** - * 「ー」ボタンを押すとリアクションを取り消すことができます。 - */ "reactDone": string; }; "_timeline": { - /** - * タイムラインのしくみ - */ "title": string; - /** - * Misskeyには、使い方に応じて複数のタイムラインが用意されています(サーバーによってはいずれかが無効になっていることがあります)。 - */ "description1": string; - /** - * あなたがフォローしているアカウントの投稿を見られます。 - */ "home": string; - /** - * このサーバーにいるユーザー全員の投稿を見られます。 - */ "local": string; - /** - * ホームタイムラインとローカルタイムラインの投稿が両方表示されます。 - */ "social": string; - /** - * 接続している他のすべてのサーバーからの投稿を見られます。 - */ "global": string; - /** - * それぞれのタイムラインは、画面上部でいつでも切り替えられます。 - */ "description2": string; - /** - * その他にも、リストタイムラインやチャンネルタイムラインなどがあります。詳しくは{link}をご覧ください。 - */ - "description3": ParameterizedString<"link">; + "description3": string; }; "_postNote": { - /** - * ノートの投稿設定 - */ "title": string; - /** - * Misskeyにノートを投稿する際には、様々なオプションの設定が可能です。投稿フォームはこのようになっています。 - */ "description1": string; "_visibility": { - /** - * ノートを表示できる相手を制限できます。 - */ "description": string; - /** - * すべてのユーザーに公開。 - */ "public": string; - /** - * ホームタイムラインのみに公開。フォロワー・プロフィールを見に来た人・リノートから、他のユーザーも見ることができます。 - */ "home": string; - /** - * フォロワーにのみ公開。本人以外がリノートすることはできず、またフォロワー以外は閲覧できません。 - */ "followers": string; - /** - * 指定したユーザーにのみ公開され、また相手に通知が入ります。ダイレクトメッセージのかわりにお使いいただけます。 - */ "direct": string; - /** - * 機密情報は送信する際は注意してください。 - */ "doNotSendConfidencialOnDirect1": string; - /** - * 送信先のサーバーの管理者は投稿内容を見ることが可能なので、信頼できないサーバーのユーザーにダイレクト投稿を送信する場合は、機密情報の扱いに注意が必要です。 - */ "doNotSendConfidencialOnDirect2": string; - /** - * 他のサーバーに投稿を連合しません。上記の公開範囲に関わらず、他のサーバーのユーザーは、この設定がついたノートを直接閲覧することができなくなります。 - */ "localOnly": string; }; "_cw": { - /** - * 内容を隠す(CW) - */ "title": string; - /** - * 本文のかわりに「注釈」に書いた内容が表示されます。「もっと見る」を押すと本文が表示されます。 - */ "description": string; "_exampleNote": { - /** - * 飯テロ注意 - */ "cw": string; - /** - * チョコのかかったドーナツを食べました🍩😋 - */ "note": string; }; - /** - * サーバーのガイドラインにより必要とされるノートに指定したり、ネタバレ投稿やセンシティブな文章を自主規制したりするときに使います。 - */ "useCases": string; }; }; "_howToMakeAttachmentsSensitive": { - /** - * 添付ファイルをセンシティブにするには? - */ "title": string; - /** - * サーバーのガイドラインにより必要とされる際や、そのまま見れる状態にしておくべきではない添付ファイルには、「センシティブ」設定を付けます。 - */ "description": string; - /** - * 試しに、このフォームに添付された画像をセンシティブにしてみてください! - */ "tryThisFile": string; "_exampleNote": { - /** - * 納豆のフタ開けるのミスったわね… - */ "note": string; }; - /** - * 添付ファイルをセンシティブにする際は、そのファイルをクリックしてメニューを開き、「センシティブとして設定」をクリックします。 - */ "method": string; - /** - * ファイルを添付する際は、サーバーのガイドラインに従ってセンシティブを適切に設定してください。 - */ "sensitiveSucceeded": string; - /** - * 画像をセンシティブに設定すると先に進めるようになります。 - */ "doItToContinue": string; }; "_done": { - /** - * チュートリアルは終了です🎉 - */ "title": string; - /** - * ここで紹介した機能はほんの一部にすぎません。Misskeyの使い方をより詳しく知るには、{link}をご覧ください。 - */ - "description": ParameterizedString<"link">; + "description": string; }; }; "_timelineDescription": { - /** - * ホームタイムラインでは、あなたがフォローしているアカウントの投稿を見られます。 - */ "home": string; - /** - * ローカルタイムラインでは、このサーバーにいるユーザー全員の投稿を見られます。 - */ "local": string; - /** - * ソーシャルタイムラインには、ホームタイムラインとローカルタイムラインの投稿が両方表示されます。 - */ "social": string; - /** - * グローバルタイムラインでは、接続している他のすべてのサーバーからの投稿を見られます。 - */ "global": string; }; "_serverRules": { - /** - * 新規登録前に表示する、サーバーの簡潔なルールを設定します。内容は利用規約の要約とすることを推奨します。 - */ "description": string; }; "_serverSettings": { - /** - * アイコン画像のURL - */ "iconUrl": string; - /** - * {host}がアプリとして表示される際のアイコンを指定します。 - */ - "appIconDescription": ParameterizedString<"host">; - /** - * 例: PWAや、スマートフォンのホーム画面にブックマークとして追加された時など - */ + "appIconDescription": string; "appIconUsageExample": string; - /** - * 円形もしくは角丸にクロップされる場合があるため、塗り潰された余白のある背景を持つことが推奨されます。 - */ "appIconStyleRecommendation": string; - /** - * 解像度は必ず{resolution}である必要があります。 - */ - "appIconResolutionMustBe": ParameterizedString<"resolution">; - /** - * manifest.jsonのオーバーライド - */ + "appIconResolutionMustBe": string; "manifestJsonOverride": string; - /** - * 略称 - */ "shortName": string; - /** - * サーバーの正式名称が長い場合に、代わりに表示することのできる略称や通称。 - */ "shortNameDescription": string; - /** - * 有効にすると、各種タイムラインを取得する際のパフォーマンスが大幅に向上し、データベースへの負荷を軽減することが可能です。ただし、Redisのメモリ使用量は増加します。サーバーのメモリ容量が少ない場合、または動作が不安定な場合は無効にすることができます。 - */ "fanoutTimelineDescription": string; - /** - * データベースへのフォールバック - */ "fanoutTimelineDbFallback": string; - /** - * 有効にすると、タイムラインがキャッシュされていない場合にDBへ追加で問い合わせを行うフォールバック処理を行います。無効にすると、フォールバック処理を行わないことでさらにサーバーの負荷を軽減することができますが、タイムラインが取得できる範囲に制限が生じます。 - */ "fanoutTimelineDbFallbackDescription": string; - /** - * 有効にすると、リアクション作成時のパフォーマンスが大幅に向上し、データベースへの負荷を軽減することが可能です。ただし、Redisのメモリ使用量は増加します。 - */ - "reactionsBufferingDescription": string; - /** - * 問い合わせ先URL - */ - "inquiryUrl": string; - /** - * サーバー運営者へのお問い合わせフォームのURLや、運営者の連絡先等が記載されたWebページのURLを指定します。 - */ - "inquiryUrlDescription": string; - /** - * 一定期間モデレーターのアクティビティが検出されなかった場合、スパム防止のためこの設定は自動でオフになります。 - */ - "thisSettingWillAutomaticallyOffWhenModeratorsInactive": string; }; "_accountMigration": { - /** - * 別のアカウントからこのアカウントに移行 - */ "moveFrom": string; - /** - * 別のアカウントへエイリアスを作成 - */ "moveFromSub": string; - /** - * 移行元のアカウント #{n} - */ - "moveFromLabel": ParameterizedString<"n">; - /** - * 別のアカウントからこのアカウントに移行したい場合、ここでエイリアスを作成しておく必要があります。 - * 移行元のアカウントをこのように入力してください: @username@server.example.com - * 削除するには、入力欄を空にして保存します(非推奨)。 - */ + "moveFromLabel": string; "moveFromDescription": string; - /** - * このアカウントを新しいアカウントへ移行 - */ "moveTo": string; - /** - * 移行先のアカウント: - */ "moveToLabel": string; - /** - * アカウントを移行すると、取り消すことはできません。 - */ "moveCannotBeUndone": string; - /** - * 新しいアカウントへ移行します。 - *  ・フォロワーが新しいアカウントを自動でフォローします - *  ・このアカウントからのフォローは全て解除されます - *  ・このアカウントではノートの作成などができなくなります - * - * フォロワーの移行は自動ですが、フォローの移行は手動で行う必要があります。移行前にこのアカウントでフォローエクスポートし、移行後すぐに移行先アカウントでインポートを行なってください。 - * リスト・ミュート・ブロックについても同様ですので、手動で移行する必要があります。 - * - * (この説明はこのサーバー(Misskey v13.12.0以降)の仕様です。Mastodonなどの他のActivityPubソフトウェアでは挙動が異なる場合があります。) - */ "moveAccountDescription": string; - /** - * アカウントの移行には、まずは移行先のアカウントでこのアカウントに対しエイリアスを作成します。 - * エイリアス作成後、移行先のアカウントを次のように入力してください: @username@server.example.com - */ "moveAccountHowTo": string; - /** - * 移行する - */ "startMigration": string; - /** - * 本当にこのアカウントを {account} に移行しますか?一度移行すると取り消せず、二度とこのアカウントを元の状態で使用できなくなります。 - */ - "migrationConfirm": ParameterizedString<"account">; - /** - * - * アカウントは移行されています。 - * 移行を取り消すことはできません。 - */ + "migrationConfirm": string; "movedAndCannotBeUndone": string; - /** - * このアカウントからのフォロー解除は移行操作から24時間後に実行されます。 - * このアカウントのフォロー・フォロワー数は0になっています。フォロワーの解除はされないため、あなたのフォロワーはこのアカウントのフォロワー向け投稿を引き続き閲覧できます。 - */ "postMigrationNote": string; - /** - * 移行先のアカウント: - */ "movedTo": string; }; "_achievements": { - /** - * 獲得日時 - */ "earnedAt": string; "_types": { "_notes1": { - /** - * just setting up my msky - */ "title": string; - /** - * 初めてノートを投稿した - */ "description": string; - /** - * 良いMisskeyライフを! - */ "flavor": string; }; "_notes10": { - /** - * いくつかのノート - */ "title": string; - /** - * ノートを10回投稿した - */ "description": string; }; "_notes100": { - /** - * たくさんのノート - */ "title": string; - /** - * ノートを100回投稿した - */ "description": string; }; "_notes500": { - /** - * ノートまみれ - */ "title": string; - /** - * ノートを500回投稿した - */ "description": string; }; "_notes1000": { - /** - * ノートの山 - */ "title": string; - /** - * ノートを1,000回投稿した - */ "description": string; }; "_notes5000": { - /** - * 湧き出るノート - */ "title": string; - /** - * ノートを5,000回投稿した - */ "description": string; }; "_notes10000": { - /** - * スーパーノート - */ "title": string; - /** - * ノートを10,000回投稿した - */ "description": string; }; "_notes20000": { - /** - * ニードモアノート - */ "title": string; - /** - * ノートを20,000回投稿した - */ "description": string; }; "_notes30000": { - /** - * ノートノートノート - */ "title": string; - /** - * ノートを30,000回投稿した - */ "description": string; }; "_notes40000": { - /** - * ノート工場 - */ "title": string; - /** - * ノートを40,000回投稿した - */ "description": string; }; "_notes50000": { - /** - * ノートの惑星 - */ "title": string; - /** - * ノートを50,000回投稿した - */ "description": string; }; "_notes60000": { - /** - * ノートクエーサー - */ "title": string; - /** - * ノートを60,000回投稿した - */ "description": string; }; "_notes70000": { - /** - * ブラックノートホール - */ "title": string; - /** - * ノートを70,000回投稿した - */ "description": string; }; "_notes80000": { - /** - * ノートギャラクシー - */ "title": string; - /** - * ノートを80,000回投稿した - */ "description": string; }; "_notes90000": { - /** - * ノートバース - */ "title": string; - /** - * ノートを90,000回投稿した - */ "description": string; }; "_notes100000": { - /** - * ALL YOUR NOTE ARE BELONG TO US - */ "title": string; - /** - * ノートを100,000回投稿した - */ "description": string; - /** - * そんなに書くことある? - */ "flavor": string; }; "_login3": { - /** - * ビギナーⅠ - */ "title": string; - /** - * 通算ログイン日数が3日 - */ "description": string; - /** - * 今日からね僕は ミスキストってことで - */ "flavor": string; }; "_login7": { - /** - * ビギナーⅡ - */ "title": string; - /** - * 通算ログイン日数が7日 - */ "description": string; - /** - * 慣れてきましたか? - */ "flavor": string; }; "_login15": { - /** - * ビギナーⅢ - */ "title": string; - /** - * 通算ログイン日数が15日 - */ "description": string; }; "_login30": { - /** - * ミスキストⅠ - */ "title": string; - /** - * 通算ログイン日数が30日 - */ "description": string; }; "_login60": { - /** - * ミスキストⅡ - */ "title": string; - /** - * 通算ログイン日数が60日 - */ "description": string; }; "_login100": { - /** - * ミスキストⅢ - */ "title": string; - /** - * 通算ログイン日数が100日 - */ "description": string; - /** - * そのユーザー、ミスキストにつき - */ "flavor": string; }; "_login200": { - /** - * 常連Ⅰ - */ "title": string; - /** - * 通算ログイン日数が200日 - */ "description": string; }; "_login300": { - /** - * 常連Ⅱ - */ "title": string; - /** - * 通算ログイン日数が300日 - */ "description": string; }; "_login400": { - /** - * 常連Ⅲ - */ "title": string; - /** - * 通算ログイン日数が400日 - */ "description": string; }; "_login500": { - /** - * ベテランⅠ - */ "title": string; - /** - * 通算ログイン日数が500日 - */ "description": string; - /** - * 諸君、私はノートが好きだ - */ "flavor": string; }; "_login600": { - /** - * ベテランⅡ - */ "title": string; - /** - * 通算ログイン日数が600日 - */ "description": string; }; "_login700": { - /** - * ベテランⅢ - */ "title": string; - /** - * 通算ログイン日数が700日 - */ "description": string; }; "_login800": { - /** - * ノートマスターⅠ - */ "title": string; - /** - * 通算ログイン日数が800日 - */ "description": string; }; "_login900": { - /** - * ノートマスターⅡ - */ "title": string; - /** - * 通算ログイン日数が900日 - */ "description": string; }; "_login1000": { - /** - * ノートマスターⅢ - */ "title": string; - /** - * 通算ログイン日数が1,000日 - */ "description": string; - /** - * Misskeyを使ってくれてありがとう! - */ "flavor": string; }; "_noteClipped1": { - /** - * クリップせずにはいられないな - */ "title": string; - /** - * 初めてノートをクリップした - */ "description": string; }; "_noteFavorited1": { - /** - * 星をみるひと - */ "title": string; - /** - * 初めてノートをお気に入りに登録した - */ "description": string; }; "_myNoteFavorited1": { - /** - * 星が欲しい - */ "title": string; - /** - * 自分のノートが他の人からお気に入りに登録された - */ "description": string; }; "_profileFilled": { - /** - * 準備万端 - */ "title": string; - /** - * プロフィール設定を行った - */ "description": string; }; "_markedAsCat": { - /** - * 吾輩は猫である - */ "title": string; - /** - * アカウントをCatとして設定した - */ "description": string; - /** - * 名前はまだない。 - */ "flavor": string; }; "_following1": { - /** - * はじめてのフォロー - */ "title": string; - /** - * 初めてフォローした - */ "description": string; }; "_following10": { - /** - * ついてく、ついてく - */ "title": string; - /** - * フォローが10人を超した - */ "description": string; }; "_following50": { - /** - * 友達たくさん - */ "title": string; - /** - * フォローが50人を超した - */ "description": string; }; "_following100": { - /** - * 友達100人 - */ "title": string; - /** - * フォローが100人を超した - */ "description": string; }; "_following300": { - /** - * 友達過多 - */ "title": string; - /** - * フォローが300人を超した - */ "description": string; }; "_followers1": { - /** - * はじめてのフォロワー - */ "title": string; - /** - * 初めてフォローされた - */ "description": string; }; "_followers10": { - /** - * フォローミー! - */ "title": string; - /** - * フォロワーが10人を超した - */ "description": string; }; "_followers50": { - /** - * ぞろぞろ - */ "title": string; - /** - * フォロワーが50人を超した - */ "description": string; }; "_followers100": { - /** - * 人気者 - */ "title": string; - /** - * フォロワーが100人を超した - */ "description": string; }; "_followers300": { - /** - * 一列でお並びください - */ "title": string; - /** - * フォロワーが300人を超した - */ "description": string; }; "_followers500": { - /** - * 基地局 - */ "title": string; - /** - * フォロワーが500人を超した - */ "description": string; }; "_followers1000": { - /** - * インフルエンサー - */ "title": string; - /** - * フォロワーが1,000人を超した - */ "description": string; }; "_collectAchievements30": { - /** - * 実績コレクター - */ "title": string; - /** - * 実績を30個以上獲得した - */ "description": string; }; "_viewAchievements3min": { - /** - * 実績好き - */ "title": string; - /** - * 実績一覧を3分以上眺め続けた - */ "description": string; }; "_iLoveMisskey": { - /** - * I Love Misskey - */ "title": string; - /** - * "I ❤ #Misskey"を投稿した - */ "description": string; - /** - * Misskeyを使ってくださりありがとうございます! by 開発チーム - */ "flavor": string; }; "_foundTreasure": { - /** - * 宝探し - */ "title": string; - /** - * 隠されたお宝を発見した - */ "description": string; }; "_client30min": { - /** - * ひとやすみ - */ "title": string; - /** - * クライアントを起動してから30分以上経過した - */ "description": string; }; "_client60min": { - /** - * Misskeyの見すぎ - */ "title": string; - /** - * クライアントを起動してから60分以上経過した - */ "description": string; }; "_noteDeletedWithin1min": { - /** - * いまのなし - */ "title": string; - /** - * 投稿してから1分以内にその投稿を削除した - */ "description": string; }; "_postedAtLateNight": { - /** - * 夜行性 - */ "title": string; - /** - * 深夜にノートを投稿した - */ "description": string; - /** - * そろそろ寝よう。 - */ "flavor": string; }; "_postedAt0min0sec": { - /** - * 時報 - */ "title": string; - /** - * 0分0秒にノートを投稿した - */ "description": string; - /** - * ポッ ポッ ポッ ピーン - */ "flavor": string; }; "_selfQuote": { - /** - * 自己言及 - */ "title": string; - /** - * 自分のノートを引用した - */ "description": string; }; "_htl20npm": { - /** - * 流れるTL - */ "title": string; - /** - * ホームタイムラインの流速が20npmを越す - */ "description": string; }; "_viewInstanceChart": { - /** - * アナリスト - */ "title": string; - /** - * サーバーのチャートを表示した - */ "description": string; }; "_outputHelloWorldOnScratchpad": { - /** - * Hello, world! - */ "title": string; - /** - * スクラッチパッドで hello world を出力した - */ "description": string; }; "_open3windows": { - /** - * マルチウィンドウ - */ "title": string; - /** - * ウィンドウを3つ以上開いた状態にした - */ "description": string; }; "_driveFolderCircularReference": { - /** - * 循環参照 - */ "title": string; - /** - * ドライブのフォルダを再帰的な入れ子にしようとした - */ "description": string; }; "_reactWithoutRead": { - /** - * ちゃんと読んだ? - */ "title": string; - /** - * 100文字以上のテキストを含むノートに投稿されてから3秒以内にリアクションした - */ "description": string; }; "_clickedClickHere": { - /** - * ここをクリック - */ "title": string; - /** - * ここをクリックした - */ "description": string; }; "_justPlainLucky": { - /** - * 単なるラッキー - */ "title": string; - /** - * 10秒ごとに0.005%の確率で獲得 - */ "description": string; }; "_setNameToSyuilo": { - /** - * 神様コンプレックス - */ "title": string; - /** - * 名前を syuilo に設定した - */ "description": string; }; "_passedSinceAccountCreated1": { - /** - * 一周年 - */ "title": string; - /** - * アカウント作成から1年経過した - */ "description": string; }; "_passedSinceAccountCreated2": { - /** - * 二周年 - */ "title": string; - /** - * アカウント作成から2年経過した - */ "description": string; }; "_passedSinceAccountCreated3": { - /** - * 三周年 - */ "title": string; - /** - * アカウント作成から3年経過した - */ "description": string; }; "_loggedInOnBirthday": { - /** - * ハッピーバースデー - */ "title": string; - /** - * 誕生日にログインした - */ "description": string; }; "_loggedInOnNewYearsDay": { - /** - * あけましておめでとうございます - */ "title": string; - /** - * 元日にログインした - */ "description": string; - /** - * 今年も弊サーバーをよろしくお願いします - */ "flavor": string; }; "_cookieClicked": { - /** - * クッキーをクリックするゲーム - */ "title": string; - /** - * クッキーをクリックした - */ "description": string; - /** - * ソフト間違ってない? - */ "flavor": string; }; "_brainDiver": { - /** - * Brain Diver - */ "title": string; - /** - * Brain Diverへのリンクを投稿した - */ "description": string; - /** - * Misskey-Misskey La-Tu-Ma - */ "flavor": string; }; "_smashTestNotificationButton": { - /** - * テスト過剰 - */ "title": string; - /** - * 通知のテストをごく短時間のうちに連続して行った - */ "description": string; }; "_tutorialCompleted": { - /** - * Misskey初心者講座 修了証 - */ "title": string; - /** - * チュートリアルを完了した - */ "description": string; }; - "_bubbleGameExplodingHead": { - /** - * 🤯 - */ - "title": string; - /** - * バブルゲームで最も大きいモノを出した - */ - "description": string; - }; - "_bubbleGameDoubleExplodingHead": { - /** - * ダブル🤯 - */ - "title": string; - /** - * バブルゲームで最も大きいモノを2つ同時に出した - */ - "description": string; - /** - * これくらいの おべんとばこに 🤯 🤯 ちょっとつめて - */ - "flavor": string; - }; }; }; "_role": { - /** - * ロールの作成 - */ "new": string; - /** - * ロールの編集 - */ "edit": string; - /** - * ロール名 - */ "name": string; - /** - * ロールの説明 - */ "description": string; - /** - * ロールの権限 - */ "permission": string; - /** - * モデレーターは基本的なモデレーションに関する操作を行えます。 - * 管理者はサーバーの全ての設定を変更できます。 - */ "descriptionOfPermission": string; - /** - * アサイン - */ "assignTarget": string; - /** - * マニュアルは誰がこのロールに含まれるかを手動で管理します。 - * コンディショナルは条件を設定し、それに合致するユーザーが自動で含まれるようになります。 - */ "descriptionOfAssignTarget": string; - /** - * マニュアル - */ "manual": string; - /** - * マニュアルロール - */ "manualRoles": string; - /** - * コンディショナル - */ "conditional": string; - /** - * コンディショナルロール - */ "conditionalRoles": string; - /** - * 条件 - */ "condition": string; - /** - * これはコンディショナルロールです。 - */ "isConditionalRole": string; - /** - * 公開ロール - */ "isPublic": string; - /** - * ユーザーのプロフィールでこのロールが表示されます。 - */ "descriptionOfIsPublic": string; - /** - * オプション - */ "options": string; - /** - * ポリシー - */ "policies": string; - /** - * ベースロール - */ "baseRole": string; - /** - * ベースロールの値を使用 - */ "useBaseValue": string; - /** - * アサインするロールを選択 - */ "chooseRoleToAssign": string; - /** - * アイコン画像のURL - */ "iconUrl": string; - /** - * バッジとして表示 - */ "asBadge": string; - /** - * オンにすると、ユーザー名の横にロールのアイコンが表示されます。 - */ "descriptionOfAsBadge": string; - /** - * ユーザーを見つけやすくする - */ "isExplorable": string; - /** - * オンにすると、「みつける」でメンバー一覧が公開されるほか、ロールのタイムラインが利用可能になります。 - */ "descriptionOfIsExplorable": string; - /** - * 表示順 - */ "displayOrder": string; - /** - * 数値が大きいほどUI上で先頭に表示されます。 - */ "descriptionOfDisplayOrder": string; - /** - * モデレーターのメンバー編集を許可 - */ "canEditMembersByModerator": string; - /** - * オンにすると、管理者に加えてモデレーターもこのロールへユーザーをアサイン/アサイン解除できるようになります。オフにすると管理者のみが行えます。 - */ "descriptionOfCanEditMembersByModerator": string; - /** - * 優先度 - */ "priority": string; "_priority": { - /** - * 低 - */ "low": string; - /** - * 中 - */ "middle": string; - /** - * 高 - */ "high": string; }; "_options": { - /** - * グローバルタイムラインの閲覧 - */ "gtlAvailable": string; - /** - * ローカルタイムラインの閲覧 - */ "ltlAvailable": string; - /** - * パブリック投稿の許可 - */ "canPublicNote": string; - /** - * ノート内の最大メンション数 - */ - "mentionMax": string; - /** - * サーバー招待コードの発行 - */ "canInvite": string; - /** - * 招待コードの作成可能数 - */ "inviteLimit": string; - /** - * 招待コードの発行間隔 - */ "inviteLimitCycle": string; - /** - * 招待コードの有効期限 - */ "inviteExpirationTime": string; - /** - * カスタム絵文字の管理 - */ "canManageCustomEmojis": string; - /** - * アバターデコレーションの管理 - */ "canManageAvatarDecorations": string; - /** - * ドライブ容量 - */ "driveCapacity": string; - /** - * ファイルにNSFWを常に付与 - */ "alwaysMarkNsfw": string; - /** - * アイコンとバナーの更新を許可 - */ - "canUpdateBioMedia": string; - /** - * ノートのピン留めの最大数 - */ "pinMax": string; - /** - * アンテナの作成可能数 - */ "antennaMax": string; - /** - * ワードミュートの最大文字数 - */ "wordMuteMax": string; - /** - * Webhookの作成可能数 - */ "webhookMax": string; - /** - * クリップの作成可能数 - */ "clipMax": string; - /** - * クリップ内のノートの最大数 - */ "noteEachClipsMax": string; - /** - * ユーザーリストの作成可能数 - */ "userListMax": string; - /** - * ユーザーリスト内のユーザーの最大数 - */ "userEachUserListsMax": string; - /** - * レートリミット - */ "rateLimitFactor": string; - /** - * 小さいほど制限が緩和され、大きいほど制限が強化されます。 - */ "descriptionOfRateLimitFactor": string; - /** - * 広告の非表示 - */ "canHideAds": string; - /** - * ノート検索の利用 - */ "canSearchNotes": string; - /** - * 翻訳機能の利用 - */ "canUseTranslator": string; - /** - * アイコンデコレーションの最大取付個数 - */ "avatarDecorationLimit": string; - /** - * アンテナのインポートを許可 - */ - "canImportAntennas": string; - /** - * ブロックのインポートを許可 - */ - "canImportBlocking": string; - /** - * フォローのインポートを許可 - */ - "canImportFollowing": string; - /** - * ミュートのインポートを許可 - */ - "canImportMuting": string; - /** - * リストのインポートを許可 - */ - "canImportUserLists": string; }; "_condition": { - /** - * マニュアルロールにアサイン済み - */ - "roleAssignedTo": string; - /** - * ローカルユーザー - */ "isLocal": string; - /** - * リモートユーザー - */ "isRemote": string; - /** - * 猫ユーザー - */ - "isCat": string; - /** - * botユーザー - */ - "isBot": string; - /** - * サスペンド済みユーザー - */ - "isSuspended": string; - /** - * 鍵アカウントユーザー - */ - "isLocked": string; - /** - * 「アカウントを見つけやすくする」が有効なユーザー - */ - "isExplorable": string; - /** - * アカウント作成から~以内 - */ "createdLessThan": string; - /** - * アカウント作成から~経過 - */ "createdMoreThan": string; - /** - * フォロワー数が~以下 - */ "followersLessThanOrEq": string; - /** - * フォロワー数が~以上 - */ "followersMoreThanOrEq": string; - /** - * フォロー数が~以下 - */ "followingLessThanOrEq": string; - /** - * フォロー数が~以上 - */ "followingMoreThanOrEq": string; - /** - * 投稿数が~以下 - */ "notesLessThanOrEq": string; - /** - * 投稿数が~以上 - */ "notesMoreThanOrEq": string; - /** - * ~かつ~ - */ "and": string; - /** - * ~または~ - */ "or": string; - /** - * ~ではない - */ "not": string; }; }; "_sensitiveMediaDetection": { - /** - * 機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てることができます。サーバーの負荷が少し増えます。 - */ "description": string; - /** - * 検出感度 - */ "sensitivity": string; - /** - * 感度を低くすると、誤検知(偽陽性)が減ります。感度を高くすると、検知漏れ(偽陰性)が減ります。 - */ "sensitivityDescription": string; - /** - * センシティブフラグを設定する - */ "setSensitiveFlagAutomatically": string; - /** - * この設定をオフにしても内部的に判定結果は保持されます。 - */ "setSensitiveFlagAutomaticallyDescription": string; - /** - * 動画の解析を有効化 - */ "analyzeVideos": string; - /** - * 静止画に加えて動画も解析するようにします。サーバーの負荷が少し増えます。 - */ "analyzeVideosDescription": string; }; "_emailUnavailable": { - /** - * 既に使用されています - */ "used": string; - /** - * 形式が正しくありません - */ "format": string; - /** - * 恒久的に使用可能なアドレスではありません - */ "disposable": string; - /** - * 正しいメールサーバーではありません - */ "mx": string; - /** - * メールサーバーが応答しません - */ "smtp": string; - /** - * このメールアドレスでは登録できません - */ "banned": string; }; "_ffVisibility": { - /** - * 公開 - */ "public": string; - /** - * フォロワーだけに公開 - */ "followers": string; - /** - * 非公開 - */ "private": string; }; "_signup": { - /** - * ほとんど完了です - */ "almostThere": string; - /** - * あなたが使っているメールアドレスを入力してください。メールアドレスが公開されることはありません。 - */ "emailAddressInfo": string; - /** - * 入力されたメールアドレス({email})宛に確認のメールが送信されました。メールに記載されたリンクにアクセスすると、アカウントの作成が完了します。メールに記載されているリンクの有効期限は30分です。 - */ - "emailSent": ParameterizedString<"email">; + "emailSent": string; }; "_accountDelete": { - /** - * アカウントの削除 - */ "accountDelete": string; - /** - * アカウントの削除は負荷のかかる処理であるため、作成したコンテンツの数やアップロードしたファイルの数が多いと完了までに時間がかかることがあります。 - */ "mayTakeTime": string; - /** - * アカウントの削除が完了する際は、登録してあったメールアドレス宛に通知を送信します。 - */ "sendEmail": string; - /** - * アカウント削除をリクエスト - */ "requestAccountDelete": string; - /** - * 削除処理が開始されました。 - */ "started": string; - /** - * 削除が進行中 - */ "inProgress": string; }; "_ad": { - /** - * 戻る - */ "back": string; - /** - * この広告の表示頻度を下げる - */ "reduceFrequencyOfThisAd": string; - /** - * 表示しない - */ "hide": string; - /** - * 曜日はサーバーのタイムゾーンを元に指定されます。 - */ "timezoneinfo": string; - /** - * 広告配信設定 - */ "adsSettings": string; - /** - * リアルタイム更新中に広告を配信する間隔(ノートの個数) - */ "notesPerOneAd": string; - /** - * 0でリアルタイム更新時の広告配信を無効 - */ "setZeroToDisable": string; - /** - * 広告の配信間隔が極めて短いため、ユーザー体験が著しく損われる可能性があります。 - */ "adsTooClose": string; }; "_forgotPassword": { - /** - * アカウントに登録したメールアドレスを入力してください。そのアドレス宛てに、パスワードリセット用のリンクが送信されます。 - */ "enterEmail": string; - /** - * メールアドレスを登録していない場合は、管理者までお問い合わせください。 - */ "ifNoEmail": string; - /** - * このサーバーではメールがサポートされていないため、パスワードリセットを行う場合は管理者までお問い合わせください。 - */ "contactAdmin": string; }; "_gallery": { - /** - * 自分の投稿 - */ "my": string; - /** - * いいねした投稿 - */ "liked": string; - /** - * いいね! - */ "like": string; - /** - * いいね解除 - */ "unlike": string; }; "_email": { "_follow": { - /** - * フォローされました - */ "title": string; }; "_receiveFollowRequest": { - /** - * フォローリクエストを受け取りました - */ "title": string; }; }; "_plugin": { - /** - * プラグインのインストール - */ "install": string; - /** - * 信頼できないプラグインはインストールしないでください。 - */ "installWarn": string; - /** - * プラグインの管理 - */ "manage": string; - /** - * ソースを表示 - */ "viewSource": string; - /** - * ログを表示 - */ - "viewLog": string; }; "_preferencesBackups": { - /** - * 作成したバックアップ - */ "list": string; - /** - * 新規保存 - */ "saveNew": string; - /** - * ファイルを読み込み - */ "loadFile": string; - /** - * このデバイスに適用 - */ "apply": string; - /** - * 上書き保存 - */ "save": string; - /** - * バックアップ名を入力 - */ "inputName": string; - /** - * 保存できません - */ "cannotSave": string; - /** - * バックアップ名「{name}」は既に存在します。違う名前を指定してください。 - */ - "nameAlreadyExists": ParameterizedString<"name">; - /** - * バックアップ「{name}」を現在のデバイスに適用しますか?現在のデバイス設定は失われます。 - */ - "applyConfirm": ParameterizedString<"name">; - /** - * {name}に上書き保存しますか? - */ - "saveConfirm": ParameterizedString<"name">; - /** - * {name}を削除しますか? - */ - "deleteConfirm": ParameterizedString<"name">; - /** - * 「{old}」を「{new}」に変更しますか? - */ - "renameConfirm": ParameterizedString<"old" | "new">; - /** - * バックアップはありません。「新規保存」で現在のクライアント設定をサーバーに保存できます。 - */ + "nameAlreadyExists": string; + "applyConfirm": string; + "saveConfirm": string; + "deleteConfirm": string; + "renameConfirm": string; "noBackups": string; - /** - * 作成日時: {date} {time} - */ - "createdAt": ParameterizedString<"date" | "time">; - /** - * 更新日時: {date} {time} - */ - "updatedAt": ParameterizedString<"date" | "time">; - /** - * 読み込みできません - */ + "createdAt": string; + "updatedAt": string; "cannotLoad": string; - /** - * ファイル形式が違います。 - */ "invalidFile": string; }; "_registry": { - /** - * スコープ - */ "scope": string; - /** - * キー - */ "key": string; - /** - * キー - */ "keys": string; - /** - * ドメイン - */ "domain": string; - /** - * キーを作成 - */ "createKey": string; }; "_aboutMisskey": { - /** - * Misskeyはsyuiloによって2014年から開発されている、オープンソースのソフトウェアです。 - */ "about": string; - /** - * コントリビューター - */ "contributors": string; - /** - * 全てのコントリビューター - */ "allContributors": string; - /** - * ソースコード - */ "source": string; - /** - * オリジナル - */ - "original": string; - /** - * {name}はオリジナルのMisskeyを改変したバージョンを使用しています。 - */ - "thisIsModifiedVersion": ParameterizedString<"name">; - /** - * Misskeyを翻訳 - */ "translation": string; - /** - * Misskeyに寄付 - */ "donate": string; - /** - * 他にも多くの方が支援してくれています。ありがとうございます🥰 - */ "morePatrons": string; - /** - * 支援者 - */ "patrons": string; - /** - * プロジェクトメンバー - */ "projectMembers": string; }; "_displayOfSensitiveMedia": { - /** - * センシティブ設定されたメディアを隠す - */ "respect": string; - /** - * センシティブ設定されたメディアを隠さない - */ "ignore": string; - /** - * 常にメディアを隠す - */ "force": string; }; "_instanceTicker": { - /** - * 表示しない - */ "none": string; - /** - * リモートユーザーに表示 - */ "remote": string; - /** - * 常に表示 - */ "always": string; }; "_serverDisconnectedBehavior": { - /** - * 自動でリロード - */ "reload": string; - /** - * ダイアログで警告 - */ "dialog": string; - /** - * 控えめに警告 - */ "quiet": string; }; "_channel": { - /** - * チャンネルを作成 - */ "create": string; - /** - * チャンネルを編集 - */ "edit": string; - /** - * バナーを設定 - */ "setBanner": string; - /** - * バナーを削除 - */ "removeBanner": string; - /** - * トレンド - */ "featured": string; - /** - * 管理中 - */ "owned": string; - /** - * フォロー中 - */ "following": string; - /** - * {n}人が参加中 - */ - "usersCount": ParameterizedString<"n">; - /** - * {n}投稿があります - */ - "notesCount": ParameterizedString<"n">; - /** - * 名前と説明 - */ + "usersCount": string; + "notesCount": string; "nameAndDescription": string; - /** - * 名前のみ - */ "nameOnly": string; - /** - * チャンネル外へのリノートと引用リノートを許可する - */ "allowRenoteToExternal": string; }; "_menuDisplay": { - /** - * 横 - */ "sideFull": string; - /** - * 横(アイコン) - */ "sideIcon": string; - /** - * 上部 - */ "top": string; - /** - * 隠す - */ "hide": string; }; "_wordMute": { - /** - * ミュートするワード - */ "muteWords": string; - /** - * スペースで区切るとAND指定になり、改行で区切るとOR指定になります。 - */ "muteWordsDescription": string; - /** - * キーワードをスラッシュで囲むと正規表現になります。 - */ "muteWordsDescription2": string; }; "_instanceMute": { - /** - * ミュートしたサーバーのユーザーへの返信を含めて、設定したサーバーの全てのノートとRenoteをミュートします。 - */ "instanceMuteDescription": string; - /** - * 改行で区切って設定します - */ "instanceMuteDescription2": string; - /** - * 設定したサーバーのノートを隠します。 - */ "title": string; - /** - * ミュートするサーバー - */ "heading": string; }; "_theme": { - /** - * テーマを探す - */ "explore": string; - /** - * テーマのインストール - */ "install": string; - /** - * テーマの管理 - */ "manage": string; - /** - * テーマコード - */ "code": string; - /** - * 説明 - */ "description": string; - /** - * {name}をインストールしました - */ - "installed": ParameterizedString<"name">; - /** - * インストールされたテーマ - */ + "installed": string; "installedThemes": string; - /** - * 標準のテーマ - */ "builtinThemes": string; - /** - * そのテーマは既にインストールされています - */ "alreadyInstalled": string; - /** - * テーマの形式が間違っています - */ "invalid": string; - /** - * テーマを作る - */ "make": string; - /** - * ベース - */ "base": string; - /** - * 定数を追加 - */ "addConstant": string; - /** - * 定数 - */ "constant": string; - /** - * デフォルト値 - */ "defaultValue": string; - /** - * 色 - */ "color": string; - /** - * プロパティを参照 - */ "refProp": string; - /** - * 定数を参照 - */ "refConst": string; - /** - * キー - */ "key": string; - /** - * 関数 - */ "func": string; - /** - * 関数の種類 - */ "funcKind": string; - /** - * 引数 - */ "argument": string; - /** - * 元にするプロパティの名前 - */ "basedProp": string; - /** - * 不透明度 - */ "alpha": string; - /** - * 暗さ - */ "darken": string; - /** - * 明るさ - */ "lighten": string; - /** - * 定数名を入力してください - */ "inputConstantName": string; - /** - * ここにテーマコードを貼り付けて、エディターにインポートできます - */ "importInfo": string; - /** - * 定数 {const} を削除しても良いですか? - */ - "deleteConstantConfirm": ParameterizedString<"const">; + "deleteConstantConfirm": string; "keys": { - /** - * アクセント - */ "accent": string; - /** - * 背景 - */ "bg": string; - /** - * 文字 - */ "fg": string; - /** - * フォーカス - */ "focus": string; - /** - * インジケーター - */ "indicator": string; - /** - * パネル - */ "panel": string; - /** - * 影 - */ "shadow": string; - /** - * ヘッダー - */ "header": string; - /** - * サイドバーの背景 - */ "navBg": string; - /** - * サイドバーの文字 - */ "navFg": string; - /** - * サイドバー文字(ホバー) - */ "navHoverFg": string; - /** - * サイドバー文字(アクティブ) - */ "navActive": string; - /** - * サイドバーのインジケーター - */ "navIndicator": string; - /** - * リンク - */ "link": string; - /** - * ハッシュタグ - */ "hashtag": string; - /** - * メンション - */ "mention": string; - /** - * あなた宛てメンション - */ "mentionMe": string; - /** - * Renote - */ "renote": string; - /** - * モーダルの背景 - */ "modalBg": string; - /** - * 分割線 - */ "divider": string; - /** - * スクロールバーの取っ手 - */ "scrollbarHandle": string; - /** - * スクロールバーの取っ手(ホバー) - */ "scrollbarHandleHover": string; - /** - * 日付ラベルの文字 - */ "dateLabelFg": string; - /** - * 情報の背景 - */ "infoBg": string; - /** - * 情報の文字 - */ "infoFg": string; - /** - * 警告の背景 - */ "infoWarnBg": string; - /** - * 警告の文字 - */ "infoWarnFg": string; - /** - * 通知トーストの背景 - */ "toastBg": string; - /** - * 通知トーストの文字 - */ "toastFg": string; - /** - * ボタンの背景 - */ "buttonBg": string; - /** - * ボタンの背景 (ホバー) - */ "buttonHoverBg": string; - /** - * 入力ボックスの縁取り - */ "inputBorder": string; - /** - * ドライブフォルダーの背景 - */ + "listItemHoverBg": string; "driveFolderBg": string; - /** - * 壁紙のオーバーレイ - */ "wallpaperOverlay": string; - /** - * バッジ - */ "badge": string; - /** - * チャットの背景 - */ "messageBg": string; - /** - * アクセント (暗め) - */ "accentDarken": string; - /** - * アクセント (明るめ) - */ "accentLighten": string; - /** - * 強調された文字 - */ "fgHighlighted": string; }; }; "_sfx": { - /** - * ノート - */ "note": string; - /** - * ノート(自分) - */ "noteMy": string; - /** - * 通知 - */ "notification": string; - /** - * リアクション選択時 - */ + "antenna": string; + "channel": string; "reaction": string; }; "_soundSettings": { - /** - * ドライブの音声を使用 - */ "driveFile": string; - /** - * ドライブのファイルを選択してください - */ "driveFileWarn": string; - /** - * このファイルは対応していません - */ "driveFileTypeWarn": string; - /** - * 音声ファイルを選択してください - */ "driveFileTypeWarnDescription": string; - /** - * 音声が長すぎます - */ "driveFileDurationWarn": string; - /** - * 長い音声を使用するとMisskeyの使用に支障をきたす可能性があります。それでも続行しますか? - */ "driveFileDurationWarnDescription": string; - /** - * 音声が読み込めませんでした。設定を変更してください - */ - "driveFileError": string; }; "_ago": { - /** - * 未来 - */ "future": string; - /** - * たった今 - */ "justNow": string; - /** - * {n}秒前 - */ - "secondsAgo": ParameterizedString<"n">; - /** - * {n}分前 - */ - "minutesAgo": ParameterizedString<"n">; - /** - * {n}時間前 - */ - "hoursAgo": ParameterizedString<"n">; - /** - * {n}日前 - */ - "daysAgo": ParameterizedString<"n">; - /** - * {n}週間前 - */ - "weeksAgo": ParameterizedString<"n">; - /** - * {n}ヶ月前 - */ - "monthsAgo": ParameterizedString<"n">; - /** - * {n}年前 - */ - "yearsAgo": ParameterizedString<"n">; - /** - * 日時の解析に失敗 - */ + "secondsAgo": string; + "minutesAgo": string; + "hoursAgo": string; + "daysAgo": string; + "weeksAgo": string; + "monthsAgo": string; + "yearsAgo": string; "invalid": string; }; "_timeIn": { - /** - * {n}秒後 - */ - "seconds": ParameterizedString<"n">; - /** - * {n}分後 - */ - "minutes": ParameterizedString<"n">; - /** - * {n}時間後 - */ - "hours": ParameterizedString<"n">; - /** - * {n}日後 - */ - "days": ParameterizedString<"n">; - /** - * {n}週間後 - */ - "weeks": ParameterizedString<"n">; - /** - * {n}ヶ月後 - */ - "months": ParameterizedString<"n">; - /** - * {n}年後 - */ - "years": ParameterizedString<"n">; + "seconds": string; + "minutes": string; + "hours": string; + "days": string; + "weeks": string; + "months": string; + "years": string; }; "_time": { - /** - * 秒 - */ "second": string; - /** - * 分 - */ "minute": string; - /** - * 時間 - */ "hour": string; - /** - * 日 - */ "day": string; }; "_2fa": { - /** - * 既に設定は完了しています。 - */ "alreadyRegistered": string; - /** - * 認証アプリの設定を開始 - */ "registerTOTP": string; - /** - * まず、{a}や{b}などの認証アプリをお使いのデバイスにインストールします。 - */ - "step1": ParameterizedString<"a" | "b">; - /** - * 次に、表示されているQRコードをアプリでスキャンするか、ボタンをクリックして端末上でアプリを開きます。 - */ + "step1": string; "step2": string; - /** - * デスクトップアプリを使用する場合は次のURIを入力します - */ + "step2Click": string; "step2Uri": string; - /** - * 確認コードを入力 - */ "step3Title": string; - /** - * アプリに表示されている確認コード(トークン)を入力します。 - */ "step3": string; - /** - * 設定が完了しました - */ "setupCompleted": string; - /** - * これからログインするときも、同じようにコードを入力します。 - */ "step4": string; - /** - * お使いのブラウザはセキュリティキーに対応していません。 - */ "securityKeyNotSupported": string; - /** - * セキュリティキー・パスキーを登録するには、まず認証アプリの設定を行なってください。 - */ "registerTOTPBeforeKey": string; - /** - * FIDO2をサポートするハードウェアセキュリティキー、端末の生体認証やPINロック、パスキーといった、WebAuthn由来の鍵を登録します。 - */ "securityKeyInfo": string; - /** - * セキュリティキー・パスキーを登録する - */ "registerSecurityKey": string; - /** - * キーの名前を入力 - */ "securityKeyName": string; - /** - * ブラウザの指示に従い、セキュリティキーやパスキーを登録してください - */ "tapSecurityKey": string; - /** - * セキュリティキーを削除 - */ "removeKey": string; - /** - * {name}を削除しますか? - */ - "removeKeyConfirm": ParameterizedString<"name">; - /** - * セキュリティキーが登録されている場合、認証アプリの設定は解除できません。 - */ + "removeKeyConfirm": string; "whyTOTPOnlyRenew": string; - /** - * 認証アプリを再設定 - */ "renewTOTP": string; - /** - * 今までの認証アプリの確認コードおよびバックアップコードは使用できなくなります - */ "renewTOTPConfirm": string; - /** - * 再設定する - */ "renewTOTPOk": string; - /** - * やめておく - */ "renewTOTPCancel": string; - /** - * このウィザードを閉じる前に、以下のバックアップコードを確認してください。 - */ "checkBackupCodesBeforeCloseThisWizard": string; - /** - * バックアップコード - */ "backupCodes": string; - /** - * 認証アプリが使用できなくなった場合、以下のバックアップコードを使ってアカウントにアクセスできます。これらのコードは必ず安全な場所に保管してください。各コードは一回だけ使用できます。 - */ "backupCodesDescription": string; - /** - * バックアップコードが使用されました。認証アプリが使えなくなっている場合、なるべく早く認証アプリを再設定してください。 - */ "backupCodeUsedWarning": string; - /** - * バックアップコードが全て使用されました。認証アプリを利用できない場合、これ以上アカウントにアクセスできなくなります。認証アプリを再登録してください。 - */ "backupCodesExhaustedWarning": string; - /** - * 詳細なガイドはこちら - */ - "moreDetailedGuideHere": string; }; "_permissions": { - /** - * アカウントの情報を見る - */ "read:account": string; - /** - * アカウントの情報を変更する - */ "write:account": string; - /** - * ブロックを見る - */ "read:blocks": string; - /** - * ブロックを操作する - */ "write:blocks": string; - /** - * ドライブを見る - */ "read:drive": string; - /** - * ドライブを操作する - */ "write:drive": string; - /** - * お気に入りを見る - */ "read:favorites": string; - /** - * お気に入りを操作する - */ "write:favorites": string; - /** - * フォローの情報を見る - */ "read:following": string; - /** - * フォロー・フォロー解除する - */ "write:following": string; - /** - * チャットを見る - */ "read:messaging": string; - /** - * チャットを操作する - */ "write:messaging": string; - /** - * ミュートを見る - */ "read:mutes": string; - /** - * ミュートを操作する - */ "write:mutes": string; - /** - * ノートを作成・削除する - */ "write:notes": string; - /** - * 通知を見る - */ "read:notifications": string; - /** - * 通知を操作する - */ "write:notifications": string; - /** - * リアクションを見る - */ "read:reactions": string; - /** - * リアクションを操作する - */ "write:reactions": string; - /** - * 投票する - */ "write:votes": string; - /** - * ページを見る - */ "read:pages": string; - /** - * ページを操作する - */ "write:pages": string; - /** - * ページのいいねを見る - */ "read:page-likes": string; - /** - * ページのいいねを操作する - */ "write:page-likes": string; - /** - * ユーザーグループを見る - */ "read:user-groups": string; - /** - * ユーザーグループを操作する - */ "write:user-groups": string; - /** - * チャンネルを見る - */ "read:channels": string; - /** - * チャンネルを操作する - */ "write:channels": string; - /** - * ギャラリーを見る - */ "read:gallery": string; - /** - * ギャラリーを操作する - */ "write:gallery": string; - /** - * ギャラリーのいいねを見る - */ "read:gallery-likes": string; - /** - * ギャラリーのいいねを操作する - */ "write:gallery-likes": string; - /** - * Playを見る - */ "read:flash": string; - /** - * Playを操作する - */ "write:flash": string; - /** - * Playのいいねを見る - */ "read:flash-likes": string; - /** - * Playのいいねを操作する - */ "write:flash-likes": string; - /** - * ユーザーからの通報を見る - */ "read:admin:abuse-user-reports": string; - /** - * ユーザーアカウントを削除する - */ "write:admin:delete-account": string; - /** - * ユーザーのすべてのファイルを削除する - */ "write:admin:delete-all-files-of-a-user": string; - /** - * データベースインデックスに関する情報を見る - */ "read:admin:index-stats": string; - /** - * データベーステーブルに関する情報を見る - */ "read:admin:table-stats": string; - /** - * ユーザーのIPアドレスを見る - */ "read:admin:user-ips": string; - /** - * インスタンスのメタデータを見る - */ "read:admin:meta": string; - /** - * ユーザーのパスワードをリセットする - */ "write:admin:reset-password": string; - /** - * ユーザーからの通報を解決する - */ "write:admin:resolve-abuse-user-report": string; - /** - * メールを送る - */ "write:admin:send-email": string; - /** - * サーバーの情報を見る - */ "read:admin:server-info": string; - /** - * モデレーションログを見る - */ "read:admin:show-moderation-log": string; - /** - * ユーザーのプライベートな情報を見る - */ "read:admin:show-user": string; - /** - * ユーザーを凍結する - */ + "read:admin:show-users": string; "write:admin:suspend-user": string; - /** - * ユーザーのアバターを削除する - */ "write:admin:unset-user-avatar": string; - /** - * ユーザーのバーナーを削除する - */ "write:admin:unset-user-banner": string; - /** - * ユーザーの凍結を解除する - */ "write:admin:unsuspend-user": string; - /** - * インスタンスのメタデータを操作する - */ "write:admin:meta": string; - /** - * モデレーションノートを操作する - */ "write:admin:user-note": string; - /** - * ロールを操作する - */ "write:admin:roles": string; - /** - * ロールを見る - */ "read:admin:roles": string; - /** - * リレーを操作する - */ "write:admin:relays": string; - /** - * リレーを見る - */ "read:admin:relays": string; - /** - * 招待コードを操作する - */ "write:admin:invite-codes": string; - /** - * 招待コードを見る - */ "read:admin:invite-codes": string; - /** - * お知らせを操作する - */ "write:admin:announcements": string; - /** - * お知らせを見る - */ "read:admin:announcements": string; - /** - * アバターデコレーションを操作する - */ "write:admin:avatar-decorations": string; - /** - * アバターデコレーションを見る - */ "read:admin:avatar-decorations": string; - /** - * 連合に関する情報を操作する - */ "write:admin:federation": string; - /** - * ユーザーアカウントを操作する - */ "write:admin:account": string; - /** - * ユーザーに関する情報を見る - */ "read:admin:account": string; - /** - * 絵文字を操作する - */ "write:admin:emoji": string; - /** - * 絵文字を見る - */ "read:admin:emoji": string; - /** - * ジョブキューを操作する - */ "write:admin:queue": string; - /** - * ジョブキューに関する情報を見る - */ "read:admin:queue": string; - /** - * プロモーションノートを操作する - */ "write:admin:promo": string; - /** - * ユーザーのドライブを操作する - */ "write:admin:drive": string; - /** - * ユーザーのドライブの関する情報を見る - */ "read:admin:drive": string; - /** - * 管理者用のWebsocket APIを使う - */ "read:admin:stream": string; - /** - * 広告を操作する - */ "write:admin:ad": string; - /** - * 広告を見る - */ "read:admin:ad": string; - /** - * 招待コードを作成する - */ "write:invite-codes": string; - /** - * 招待コードを取得する - */ "read:invite-codes": string; - /** - * クリップのいいねを操作する - */ "write:clip-favorite": string; - /** - * クリップのいいねを見る - */ "read:clip-favorite": string; - /** - * 連合に関する情報を取得する - */ "read:federation": string; - /** - * 違反を報告する - */ "write:report-abuse": string; }; "_auth": { - /** - * アプリへのアクセス許可 - */ "shareAccessTitle": string; - /** - * 「{name}」がアカウントにアクセスすることを許可しますか? - */ - "shareAccess": ParameterizedString<"name">; - /** - * アカウントへのアクセスを許可しますか? - */ + "shareAccess": string; "shareAccessAsk": string; - /** - * {name}は次の権限を要求しています - */ - "permission": ParameterizedString<"name">; - /** - * このアプリは次の権限を要求しています - */ + "permission": string; "permissionAsk": string; - /** - * アプリケーションに戻ってやっていってください - */ "pleaseGoBack": string; - /** - * アプリケーションに戻っています - */ "callback": string; - /** - * アクセスを許可しました - */ - "accepted": string; - /** - * アクセスを拒否しました - */ "denied": string; - /** - * 以下のユーザーとして操作しています - */ - "scopeUser": string; - /** - * アプリケーションにアクセス許可を与えるには、ログインが必要です。 - */ "pleaseLogin": string; - /** - * アクセスを許可すると、自動で以下のURLに遷移します - */ - "byClickingYouWillBeRedirectedToThisUrl": string; }; "_antennaSources": { - /** - * 全てのノート - */ "all": string; - /** - * フォローしているユーザーのノート - */ "homeTimeline": string; - /** - * 指定した一人または複数のユーザーのノート - */ "users": string; - /** - * 指定したリストのユーザーのノート - */ "userList": string; - /** - * 指定した一人または複数のユーザーを除いた全てのノート - */ "userBlacklist": string; }; "_weekday": { - /** - * 日曜日 - */ "sunday": string; - /** - * 月曜日 - */ "monday": string; - /** - * 火曜日 - */ "tuesday": string; - /** - * 水曜日 - */ "wednesday": string; - /** - * 木曜日 - */ "thursday": string; - /** - * 金曜日 - */ "friday": string; - /** - * 土曜日 - */ "saturday": string; }; "_widgets": { - /** - * プロフィール - */ "profile": string; - /** - * サーバー情報 - */ "instanceInfo": string; - /** - * 付箋 - */ "memo": string; - /** - * 通知 - */ "notifications": string; - /** - * タイムライン - */ "timeline": string; - /** - * カレンダー - */ "calendar": string; - /** - * トレンド - */ "trends": string; - /** - * 時計 - */ "clock": string; - /** - * RSSリーダー - */ "rss": string; - /** - * RSSティッカー - */ "rssTicker": string; - /** - * アクティビティ - */ "activity": string; - /** - * フォト - */ "photos": string; - /** - * デジタル時計 - */ "digitalClock": string; - /** - * UNIX時計 - */ "unixClock": string; - /** - * 連合 - */ "federation": string; - /** - * サーバークラウド - */ "instanceCloud": string; - /** - * 投稿フォーム - */ "postForm": string; - /** - * スライドショー - */ "slideshow": string; - /** - * ボタン - */ "button": string; - /** - * オンラインユーザー - */ "onlineUsers": string; - /** - * ジョブキュー - */ "jobQueue": string; - /** - * サーバーメトリクス - */ "serverMetric": string; - /** - * AiScriptコンソール - */ "aiscript": string; - /** - * AiScript App - */ "aiscriptApp": string; - /** - * 藍 - */ "aichan": string; - /** - * ユーザーリスト - */ "userList": string; "_userList": { - /** - * リストを選択 - */ "chooseList": string; }; - /** - * クリッカー - */ "clicker": string; - /** - * 今日誕生日のユーザー - */ "birthdayFollowings": string; }; "_cw": { - /** - * 隠す - */ "hide": string; - /** - * もっと見る - */ "show": string; - /** - * {count}文字 - */ - "chars": ParameterizedString<"count">; - /** - * {count}ファイル - */ - "files": ParameterizedString<"count">; + "chars": string; + "files": string; }; "_poll": { - /** - * 選択肢は最低2つ必要です - */ "noOnlyOneChoice": string; - /** - * 選択肢{n} - */ - "choiceN": ParameterizedString<"n">; - /** - * これ以上追加できません - */ + "choiceN": string; "noMore": string; - /** - * 複数回答可 - */ "canMultipleVote": string; - /** - * 期限 - */ "expiration": string; - /** - * 無期限 - */ "infinite": string; - /** - * 日時指定 - */ "at": string; - /** - * 経過指定 - */ "after": string; - /** - * 期日 - */ "deadlineDate": string; - /** - * 時間 - */ "deadlineTime": string; - /** - * 期間 - */ "duration": string; - /** - * {n}票 - */ - "votesCount": ParameterizedString<"n">; - /** - * 計{n}票 - */ - "totalVotes": ParameterizedString<"n">; - /** - * 投票する - */ + "votesCount": string; + "totalVotes": string; "vote": string; - /** - * 結果を見る - */ "showResult": string; - /** - * 投票済み - */ "voted": string; - /** - * 終了済み - */ "closed": string; - /** - * 終了まであと{d}日{h}時間 - */ - "remainingDays": ParameterizedString<"d" | "h">; - /** - * 終了まであと{h}時間{m}分 - */ - "remainingHours": ParameterizedString<"h" | "m">; - /** - * 終了まであと{m}分{s}秒 - */ - "remainingMinutes": ParameterizedString<"m" | "s">; - /** - * 終了まであと{s}秒 - */ - "remainingSeconds": ParameterizedString<"s">; + "remainingDays": string; + "remainingHours": string; + "remainingMinutes": string; + "remainingSeconds": string; }; "_visibility": { - /** - * パブリック - */ "public": string; - /** - * 全てのユーザーに公開 - */ "publicDescription": string; - /** - * ホーム - */ "home": string; - /** - * ホームタイムラインのみに公開 - */ "homeDescription": string; - /** - * フォロワー - */ "followers": string; - /** - * 自分のフォロワーのみに公開 - */ "followersDescription": string; - /** - * ダイレクト - */ "specified": string; - /** - * 指定したユーザーのみに公開 - */ "specifiedDescription": string; - /** - * 連合なし - */ "disableFederation": string; - /** - * 他サーバーへの配信を行いません - */ "disableFederationDescription": string; }; "_postForm": { - /** - * このノートに返信... - */ "replyPlaceholder": string; - /** - * このノートを引用... - */ "quotePlaceholder": string; - /** - * チャンネルに投稿... - */ "channelPlaceholder": string; "_placeholders": { - /** - * いまどうしてる? - */ "a": string; - /** - * 何かありましたか? - */ "b": string; - /** - * 何をお考えですか? - */ "c": string; - /** - * 言いたいことは? - */ "d": string; - /** - * ここに書いてください - */ "e": string; - /** - * あなたが書くのを待っています... - */ "f": string; }; }; "_profile": { - /** - * 名前 - */ "name": string; - /** - * ユーザー名 - */ "username": string; - /** - * 自己紹介 - */ "description": string; - /** - * ハッシュタグを含めることができます。 - */ "youCanIncludeHashtags": string; - /** - * 追加情報 - */ "metadata": string; - /** - * 追加情報を編集 - */ "metadataEdit": string; - /** - * プロフィールに表として追加情報を表示することができます。 - */ "metadataDescription": string; - /** - * ラベル - */ "metadataLabel": string; - /** - * 内容 - */ "metadataContent": string; - /** - * アイコン画像を変更 - */ "changeAvatar": string; - /** - * バナー画像を変更 - */ "changeBanner": string; - /** - * 内容にURLを設定すると、リンク先のWebサイトに自分のプロフィールへのリンクが含まれている場合に所有者確認済みアイコンを表示させることができます。 - */ "verifiedLinkDescription": string; - /** - * 最大{max}つまでデコレーションを付けられます。 - */ - "avatarDecorationMax": ParameterizedString<"max">; - /** - * フォローされた時のメッセージ - */ - "followedMessage": string; - /** - * フォローされた時に相手に表示する短いメッセージを設定できます。 - */ - "followedMessageDescription": string; - /** - * フォローを承認制にしている場合、フォローリクエストを許可した時に表示されます。 - */ - "followedMessageDescriptionForLockedAccount": string; + "avatarDecorationMax": string; }; "_exportOrImport": { - /** - * 全てのノート - */ "allNotes": string; - /** - * お気に入りにしたノート - */ "favoritedNotes": string; - /** - * クリップ - */ - "clips": string; - /** - * フォロー - */ "followingList": string; - /** - * ミュート - */ "muteList": string; - /** - * ブロック - */ "blockingList": string; - /** - * リスト - */ "userLists": string; - /** - * ミュートしているユーザーを除外 - */ "excludeMutingUsers": string; - /** - * 使われていないアカウントを除外 - */ "excludeInactiveUsers": string; - /** - * インポートした人による返信をTLに含むようにする - */ "withReplies": string; }; "_charts": { - /** - * 連合 - */ "federation": string; - /** - * リクエスト - */ "apRequest": string; - /** - * ユーザーの増減 - */ "usersIncDec": string; - /** - * ユーザーの合計 - */ "usersTotal": string; - /** - * アクティブユーザー数 - */ "activeUsers": string; - /** - * ノートの増減 - */ "notesIncDec": string; - /** - * ローカルのノートの増減 - */ "localNotesIncDec": string; - /** - * リモートのノートの増減 - */ "remoteNotesIncDec": string; - /** - * ノートの合計 - */ "notesTotal": string; - /** - * ファイルの増減 - */ "filesIncDec": string; - /** - * ファイルの合計 - */ "filesTotal": string; - /** - * ストレージ使用量の増減 - */ "storageUsageIncDec": string; - /** - * ストレージ使用量の合計 - */ "storageUsageTotal": string; }; "_instanceCharts": { - /** - * リクエスト - */ "requests": string; - /** - * ユーザーの増減 - */ "users": string; - /** - * ユーザーの累積 - */ "usersTotal": string; - /** - * ノートの増減 - */ "notes": string; - /** - * ノートの累積 - */ "notesTotal": string; - /** - * フォロー/フォロワーの増減 - */ "ff": string; - /** - * フォロー/フォロワーの累積 - */ "ffTotal": string; - /** - * キャッシュサイズの増減 - */ "cacheSize": string; - /** - * キャッシュサイズの累積 - */ "cacheSizeTotal": string; - /** - * ファイル数の増減 - */ "files": string; - /** - * ファイル数の累積 - */ "filesTotal": string; }; "_timelines": { - /** - * ホーム - */ "home": string; - /** - * ローカル - */ "local": string; - /** - * ソーシャル - */ "social": string; - /** - * グローバル - */ "global": string; }; "_play": { - /** - * Playの作成 - */ "new": string; - /** - * Playの編集 - */ "edit": string; - /** - * Playを作成しました - */ "created": string; - /** - * Playを更新しました - */ "updated": string; - /** - * Playを削除しました - */ "deleted": string; - /** - * Play設定 - */ "pageSetting": string; - /** - * このPlayを編集 - */ "editThisPage": string; - /** - * ソースを表示 - */ "viewSource": string; - /** - * 自分のPlay - */ "my": string; - /** - * いいねしたPlay - */ "liked": string; - /** - * 人気 - */ "featured": string; - /** - * タイトル - */ "title": string; - /** - * スクリプト - */ "script": string; - /** - * 説明 - */ "summary": string; - /** - * 非公開に設定するとプロフィールに表示されなくなりますが、URLを知っている人は引き続きアクセスできます。 - */ - "visibilityDescription": string; }; "_pages": { - /** - * ページの作成 - */ "newPage": string; - /** - * ページの編集 - */ "editPage": string; - /** - * ソースを表示中 - */ "readPage": string; - /** - * ページを作成しました - */ "created": string; - /** - * ページを更新しました - */ "updated": string; - /** - * ページを削除しました - */ "deleted": string; - /** - * ページ設定 - */ "pageSetting": string; - /** - * 指定されたページURLは既に存在しています - */ "nameAlreadyExists": string; - /** - * 不正なページURLです - */ "invalidNameTitle": string; - /** - * 空白でないか確認してください - */ "invalidNameText": string; - /** - * このページを編集 - */ "editThisPage": string; - /** - * ソースを表示 - */ "viewSource": string; - /** - * ページを見る - */ "viewPage": string; - /** - * いいね - */ "like": string; - /** - * いいね解除 - */ "unlike": string; - /** - * 自分のページ - */ "my": string; - /** - * いいねしたページ - */ "liked": string; - /** - * 人気 - */ "featured": string; - /** - * インスペクター - */ "inspector": string; - /** - * コンテンツ - */ "contents": string; - /** - * ページブロック - */ "content": string; - /** - * 変数 - */ "variables": string; - /** - * タイトル - */ "title": string; - /** - * ページURL - */ "url": string; - /** - * ページの要約 - */ "summary": string; - /** - * 中央寄せ - */ "alignCenter": string; - /** - * ピン留めされているときにタイトルを非表示 - */ "hideTitleWhenPinned": string; - /** - * フォント - */ "font": string; - /** - * セリフ - */ "fontSerif": string; - /** - * サンセリフ - */ "fontSansSerif": string; - /** - * アイキャッチ画像を設定 - */ "eyeCatchingImageSet": string; - /** - * アイキャッチ画像を削除 - */ "eyeCatchingImageRemove": string; - /** - * ブロックを追加 - */ "chooseBlock": string; - /** - * セクションタイトルを入力 - */ - "enterSectionTitle": string; - /** - * 種類を選択 - */ "selectType": string; - /** - * コンテンツ - */ "contentBlocks": string; - /** - * 入力 - */ "inputBlocks": string; - /** - * 特殊 - */ "specialBlocks": string; "blocks": { - /** - * テキスト - */ "text": string; - /** - * テキストエリア - */ "textarea": string; - /** - * セクション - */ "section": string; - /** - * 画像 - */ "image": string; - /** - * ボタン - */ "button": string; - /** - * 動的ブロック - */ - "dynamic": string; - /** - * このブロックは廃止されています。今後は{play}を利用してください。 - */ - "dynamicDescription": ParameterizedString<"play">; - /** - * ノート埋め込み - */ "note": string; "_note": { - /** - * ノートID - */ "id": string; - /** - * ノートURLをペーストして設定することもできます。 - */ "idDescription": string; - /** - * 詳細な表示 - */ "detailed": string; }; }; }; "_relayStatus": { - /** - * 承認待ち - */ "requesting": string; - /** - * 承認済み - */ "accepted": string; - /** - * 拒否済み - */ "rejected": string; }; "_notification": { - /** - * ファイルがアップロードされました - */ "fileUploaded": string; - /** - * {name}からのメンション - */ - "youGotMention": ParameterizedString<"name">; - /** - * {name}からのリプライ - */ - "youGotReply": ParameterizedString<"name">; - /** - * {name}による引用 - */ - "youGotQuote": ParameterizedString<"name">; - /** - * {name}がリノートしました - */ - "youRenoted": ParameterizedString<"name">; - /** - * フォローされました - */ + "youGotMention": string; + "youGotReply": string; + "youGotQuote": string; + "youRenoted": string; "youWereFollowed": string; - /** - * フォローリクエストが来ました - */ "youReceivedFollowRequest": string; - /** - * フォローリクエストが承認されました - */ "yourFollowRequestAccepted": string; - /** - * アンケートの結果が出ました - */ "pollEnded": string; - /** - * 新しい投稿 - */ "newNote": string; - /** - * アンテナ {name} - */ - "unreadAntennaNote": ParameterizedString<"name">; - /** - * ロールが付与されました - */ + "unreadAntennaNote": string; "roleAssigned": string; - /** - * プッシュ通知の更新をしました - */ "emptyPushNotificationMessage": string; - /** - * 実績を獲得 - */ "achievementEarned": string; - /** - * 通知テスト - */ "testNotification": string; - /** - * 通知の表示を確かめる - */ "checkNotificationBehavior": string; - /** - * テスト通知を送信する - */ "sendTestNotification": string; - /** - * 通知はこのように表示されます - */ "notificationWillBeDisplayedLikeThis": string; - /** - * {n}人がリアクションしました - */ - "reactedBySomeUsers": ParameterizedString<"n">; - /** - * {n}人がいいねしました - */ - "likedBySomeUsers": ParameterizedString<"n">; - /** - * {n}人がリノートしました - */ - "renotedBySomeUsers": ParameterizedString<"n">; - /** - * {n}人にフォローされました - */ - "followedBySomeUsers": ParameterizedString<"n">; - /** - * 通知の履歴をリセットする - */ - "flushNotification": string; - /** - * {x}のエクスポートが完了しました - */ - "exportOfXCompleted": ParameterizedString<"x">; - /** - * ログインがありました - */ - "login": string; + "reactedBySomeUsers": string; + "renotedBySomeUsers": string; + "followedBySomeUsers": string; "_types": { - /** - * すべて - */ "all": string; - /** - * ユーザーの新規投稿 - */ "note": string; - /** - * フォロー - */ "follow": string; - /** - * メンション - */ "mention": string; - /** - * リプライ - */ "reply": string; - /** - * リノート - */ "renote": string; - /** - * 引用 - */ "quote": string; - /** - * リアクション - */ "reaction": string; - /** - * アンケートが終了 - */ "pollEnded": string; - /** - * フォロー申請を受け取った - */ "receiveFollowRequest": string; - /** - * フォローが受理された - */ "followRequestAccepted": string; - /** - * ロールが付与された - */ "roleAssigned": string; - /** - * 実績の獲得 - */ "achievementEarned": string; - /** - * エクスポートが完了した - */ - "exportCompleted": string; - /** - * ログイン - */ - "login": string; - /** - * 通知のテスト - */ - "test": string; - /** - * 連携アプリからの通知 - */ "app": string; }; "_actions": { - /** - * フォローバック - */ "followBack": string; - /** - * 返信 - */ "reply": string; - /** - * リノート - */ "renote": string; }; }; "_deck": { - /** - * 常にメインカラムを表示 - */ "alwaysShowMainColumn": string; - /** - * カラムの寄せ - */ "columnAlign": string; - /** - * カラムを追加 - */ "addColumn": string; - /** - * 新着ノート通知の設定 - */ - "newNoteNotificationSettings": string; - /** - * カラムの設定 - */ "configureColumn": string; - /** - * 左に移動 - */ "swapLeft": string; - /** - * 右に移動 - */ "swapRight": string; - /** - * 上に移動 - */ "swapUp": string; - /** - * 下に移動 - */ "swapDown": string; - /** - * 左にスタック - */ "stackLeft": string; - /** - * 右に出す - */ "popRight": string; - /** - * プロファイル - */ "profile": string; - /** - * 新規プロファイル - */ "newProfile": string; - /** - * プロファイルを削除 - */ "deleteProfile": string; - /** - * カラムを組み合わせて自分だけのインターフェイスを作りましょう! - */ "introduction": string; - /** - * 画面の右にある + を押して、いつでもカラムを追加できます。 - */ "introduction2": string; - /** - * カラムのメニューから、「ウィジェットの編集」を選択してウィジェットを追加してください - */ "widgetsIntroduction": string; - /** - * 非ルートページは簡易UIで表示 - */ "useSimpleUiForNonRootPages": string; - /** - * 「幅を自動調整」が有効の場合、これが幅の最小値となります - */ "usedAsMinWidthWhenFlexible": string; - /** - * 幅を自動調整 - */ "flexible": string; "_columns": { - /** - * メイン - */ "main": string; - /** - * ウィジェット - */ "widgets": string; - /** - * 通知 - */ "notifications": string; - /** - * タイムライン - */ "tl": string; - /** - * アンテナ - */ "antenna": string; - /** - * リスト - */ "list": string; - /** - * チャンネル - */ "channel": string; - /** - * あなた宛て - */ "mentions": string; - /** - * ダイレクト - */ "direct": string; - /** - * ロールタイムライン - */ "roleTimeline": string; }; }; "_dialog": { - /** - * 最大文字数を超えています! 現在 {current} / 制限 {max} - */ - "charactersExceeded": ParameterizedString<"current" | "max">; - /** - * 最小文字数を下回っています! 現在 {current} / 制限 {min} - */ - "charactersBelow": ParameterizedString<"current" | "min">; + "charactersExceeded": string; + "charactersBelow": string; }; "_disabledTimeline": { - /** - * 無効化されたタイムライン - */ "title": string; - /** - * 現在のロールでは、このタイムラインを使用することはできません。 - */ "description": string; }; "_drivecleaner": { - /** - * サイズが大きい順 - */ "orderBySizeDesc": string; - /** - * 追加日が古い順 - */ "orderByCreatedAtAsc": string; }; "_webhookSettings": { - /** - * Webhookを作成 - */ "createWebhook": string; - /** - * Webhookを編集 - */ - "modifyWebhook": string; - /** - * 名前 - */ "name": string; - /** - * シークレット - */ "secret": string; - /** - * トリガー - */ - "trigger": string; - /** - * 有効 - */ + "events": string; "active": string; "_events": { - /** - * フォローしたとき - */ "follow": string; - /** - * フォローされたとき - */ "followed": string; - /** - * ノートを投稿したとき - */ "note": string; - /** - * 返信されたとき - */ "reply": string; - /** - * Renoteされたとき - */ "renote": string; - /** - * リアクションがあったとき - */ "reaction": string; - /** - * メンションされたとき - */ "mention": string; }; - "_systemEvents": { - /** - * ユーザーから通報があったとき - */ - "abuseReport": string; - /** - * ユーザーからの通報を処理したとき - */ - "abuseReportResolved": string; - /** - * ユーザーが作成されたとき - */ - "userCreated": string; - /** - * モデレーターが一定期間非アクティブになったとき - */ - "inactiveModeratorsWarning": string; - /** - * モデレーターが一定期間非アクティブだったため、システムにより招待制へと変更されたとき - */ - "inactiveModeratorsInvitationOnlyChanged": string; - }; - /** - * Webhookを削除しますか? - */ - "deleteConfirm": string; - /** - * スイッチの右にあるボタンをクリックするとダミーのデータを使用したテスト用Webhookを送信できます。 - */ - "testRemarks": string; - }; - "_abuseReport": { - "_notificationRecipient": { - /** - * 通報の通知先を追加 - */ - "createRecipient": string; - /** - * 通報の通知先を編集 - */ - "modifyRecipient": string; - /** - * 通知先の種類 - */ - "recipientType": string; - "_recipientType": { - /** - * メール - */ - "mail": string; - /** - * Webhook - */ - "webhook": string; - "_captions": { - /** - * モデレーター権限を持つユーザーのメールアドレスに通知を送ります(通報を受けた時のみ) - */ - "mail": string; - /** - * 指定したSystemWebhookに通知を送ります(通報を受けた時と通報を解決した時にそれぞれ発信) - */ - "webhook": string; - }; - }; - /** - * キーワード - */ - "keywords": string; - /** - * 通知先ユーザー - */ - "notifiedUser": string; - /** - * 使用するWebhook - */ - "notifiedWebhook": string; - /** - * 通知先を削除しますか? - */ - "deleteConfirm": string; - }; }; "_moderationLogTypes": { - /** - * ロールを作成 - */ "createRole": string; - /** - * ロールを削除 - */ "deleteRole": string; - /** - * ロールを更新 - */ "updateRole": string; - /** - * ロールへアサイン - */ "assignRole": string; - /** - * ロールのアサイン解除 - */ "unassignRole": 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; - /** - * リモートサーバーのモデレーションノート更新 - */ - "updateRemoteInstanceNote": string; - /** - * ファイルをセンシティブ付与 - */ "markSensitiveDriveFile": string; - /** - * ファイルをセンシティブ解除 - */ "unmarkSensitiveDriveFile": string; - /** - * 通報を解決 - */ "resolveAbuseReport": string; - /** - * 通報を転送 - */ - "forwardAbuseReport": string; - /** - * 通報のモデレーションノート更新 - */ - "updateAbuseReportNote": string; - /** - * 招待コードを作成 - */ "createInvitation": string; - /** - * 広告を作成 - */ "createAd": string; - /** - * 広告を削除 - */ "deleteAd": string; - /** - * 広告を更新 - */ "updateAd": string; - /** - * アイコンデコレーションを作成 - */ "createAvatarDecoration": string; - /** - * アイコンデコレーションを更新 - */ "updateAvatarDecoration": string; - /** - * アイコンデコレーションを削除 - */ "deleteAvatarDecoration": string; - /** - * ユーザーのアイコンを解除 - */ "unsetUserAvatar": string; - /** - * ユーザーのバナーを解除 - */ "unsetUserBanner": string; - /** - * SystemWebhookを作成 - */ - "createSystemWebhook": string; - /** - * SystemWebhookを更新 - */ - "updateSystemWebhook": string; - /** - * SystemWebhookを削除 - */ - "deleteSystemWebhook": string; - /** - * 通報の通知先を作成 - */ - "createAbuseReportNotificationRecipient": string; - /** - * 通報の通知先を更新 - */ - "updateAbuseReportNotificationRecipient": string; - /** - * 通報の通知先を削除 - */ - "deleteAbuseReportNotificationRecipient": string; - /** - * アカウントを削除 - */ - "deleteAccount": string; - /** - * ページを削除 - */ - "deletePage": string; - /** - * Playを削除 - */ - "deleteFlash": string; - /** - * ギャラリーの投稿を削除 - */ - "deleteGalleryPost": string; }; "_fileViewer": { - /** - * ファイルの詳細 - */ "title": string; - /** - * ファイルタイプ - */ "type": string; - /** - * ファイルサイズ - */ "size": string; - /** - * URL - */ "url": string; - /** - * 追加日 - */ "uploadedAt": string; - /** - * 添付されているノート - */ "attachedNotes": string; - /** - * このページは、このファイルをアップロードしたユーザーしか閲覧できません。 - */ "thisPageCanBeSeenFromTheAuthor": string; }; "_externalResourceInstaller": { - /** - * 外部サイトからインストール - */ "title": string; - /** - * 配布元が信頼できるかを確認した上でインストールしてください。 - */ "checkVendorBeforeInstall": string; "_plugin": { - /** - * このプラグインをインストールしますか? - */ "title": string; - /** - * プラグイン情報 - */ "metaTitle": string; }; "_theme": { - /** - * このテーマをインストールしますか? - */ "title": string; - /** - * テーマ情報 - */ "metaTitle": string; }; "_meta": { - /** - * 基本のカラースキーム - */ "base": string; }; "_vendorInfo": { - /** - * 配布元情報 - */ "title": string; - /** - * 参照したエンドポイント - */ "endpoint": string; - /** - * ファイル整合性の確認 - */ "hashVerify": string; }; "_errors": { "_invalidParams": { - /** - * パラメータが不足しています - */ "title": string; - /** - * 外部サイトからデータを取得するために必要な情報が不足しています。URLをお確かめください。 - */ "description": string; }; "_resourceTypeNotSupported": { - /** - * この外部リソースには対応していません - */ "title": string; - /** - * この外部サイトから取得したリソースの種別には対応していません。サイト管理者にお問い合わせください。 - */ "description": string; }; "_failedToFetch": { - /** - * データの取得に失敗しました - */ "title": string; - /** - * 外部サイトとの通信に失敗しました。もう一度試しても改善しない場合、サイト管理者にお問い合わせください。 - */ "fetchErrorDescription": string; - /** - * 外部サイトから取得したデータが読み取れませんでした。サイト管理者にお問い合わせください。 - */ "parseErrorDescription": string; }; "_hashUnmatched": { - /** - * 正しいデータが取得できませんでした - */ "title": string; - /** - * 提供されたデータの整合性の確認に失敗しました。セキュリティ上、インストールは続行できません。サイト管理者にお問い合わせください。 - */ "description": string; }; "_pluginParseFailed": { - /** - * AiScript エラー - */ "title": string; - /** - * データは取得できたものの、AiScriptの解析時にエラーがあったため読み込めませんでした。プラグインの作者にお問い合わせください。エラーの詳細はJavascriptコンソールをご確認ください。 - */ "description": string; }; "_pluginInstallFailed": { - /** - * プラグインのインストールに失敗しました - */ "title": string; - /** - * プラグインのインストール中に問題が発生しました。もう一度お試しください。エラーの詳細はJavascriptコンソールをご覧ください。 - */ "description": string; }; "_themeParseFailed": { - /** - * テーマ解析エラー - */ "title": string; - /** - * データは取得できたものの、テーマファイルの解析時にエラーがあったため読み込めませんでした。テーマの作者にお問い合わせください。エラーの詳細はJavascriptコンソールをご確認ください。 - */ "description": string; }; "_themeInstallFailed": { - /** - * テーマのインストールに失敗しました - */ "title": string; - /** - * テーマのインストール中に問題が発生しました。もう一度お試しください。エラーの詳細はJavascriptコンソールをご覧ください。 - */ "description": string; }; }; }; "_dataSaver": { "_media": { - /** - * メディアの読み込みを無効化 - */ "title": string; - /** - * 画像・動画が自動で読み込まれるのを防止します。隠れている画像・動画はタップすると読み込まれます。 - */ "description": string; }; "_avatar": { - /** - * アイコン画像のアニメーションを無効化 - */ "title": string; - /** - * アイコン画像のアニメーションが停止します。アニメーション画像は通常の画像よりファイルサイズが大きいことがあるので、データ通信量をさらに削減できます。 - */ "description": string; }; "_urlPreview": { - /** - * URLプレビューのサムネイルを非表示 - */ "title": string; - /** - * URLプレビューのサムネイル画像が読み込まれなくなります。 - */ "description": string; }; "_code": { - /** - * コードハイライトを非表示 - */ "title": string; - /** - * MFMなどでコードハイライト記法が使われている場合、タップするまで読み込まれなくなります。コードハイライトではハイライトする言語ごとにその定義ファイルを読み込む必要がありますが、それらが自動で読み込まれなくなるため、通信量の削減が見込めます。 - */ "description": string; }; }; - "_hemisphere": { - /** - * 北半球 - */ - "N": string; - /** - * 南半球 - */ - "S": string; - /** - * 一部のクライアント設定で、季節を判定するために使用します。 - */ - "caption": string; - }; - "_reversi": { - /** - * リバーシ - */ - "reversi": string; - /** - * 対局の設定 - */ - "gameSettings": string; - /** - * ボードを選択 - */ - "chooseBoard": string; - /** - * 先行/後攻 - */ - "blackOrWhite": string; - /** - * {name}が黒(先行) - */ - "blackIs": ParameterizedString<"name">; - /** - * ルール - */ - "rules": string; - /** - * 対局はまもなく開始されます - */ - "thisGameIsStartedSoon": string; - /** - * 相手の準備が完了するのを待っています - */ - "waitingForOther": string; - /** - * あなたの準備が完了するのを待っています - */ - "waitingForMe": string; - /** - * 準備してください - */ - "waitingBoth": string; - /** - * 準備完了 - */ - "ready": string; - /** - * 準備を再開 - */ - "cancelReady": string; - /** - * 相手のターンです - */ - "opponentTurn": string; - /** - * あなたのターンです - */ - "myTurn": string; - /** - * {name}のターンです - */ - "turnOf": ParameterizedString<"name">; - /** - * {name}のターン - */ - "pastTurnOf": ParameterizedString<"name">; - /** - * 投了 - */ - "surrender": string; - /** - * 投了により - */ - "surrendered": string; - /** - * 時間切れ - */ - "timeout": string; - /** - * 引き分け - */ - "drawn": string; - /** - * {name}の勝ち - */ - "won": ParameterizedString<"name">; - /** - * 黒 - */ - "black": string; - /** - * 白 - */ - "white": string; - /** - * 合計 - */ - "total": string; - /** - * {count}ターン目 - */ - "turnCount": ParameterizedString<"count">; - /** - * 自分の対局 - */ - "myGames": string; - /** - * みんなの対局 - */ - "allGames": string; - /** - * 終了 - */ - "ended": string; - /** - * 対局中 - */ - "playing": string; - /** - * 石の少ない方が勝ち(ロセオ) - */ - "isLlotheo": string; - /** - * ループマップ - */ - "loopedMap": string; - /** - * どこでも置けるモード - */ - "canPutEverywhere": string; - /** - * 1ターンの時間制限 - */ - "timeLimitForEachTurn": string; - /** - * フリーマッチ - */ - "freeMatch": string; - /** - * 対戦相手を探しています - */ - "lookingForPlayer": string; - /** - * 対局がキャンセルされました - */ - "gameCanceled": string; - /** - * 開始時に対局をタイムラインに投稿 - */ - "shareToTlTheGameWhenStart": string; - /** - * 対局を開始しました! #MisskeyReversi - */ - "iStartedAGame": string; - /** - * 相手が設定を変更しました - */ - "opponentHasSettingsChanged": string; - /** - * 変則許可 (完全フリー) - */ - "allowIrregularRules": string; - /** - * 変則なし - */ - "disallowIrregularRules": string; - /** - * 盤面に行・列番号を表示 - */ - "showBoardLabels": string; - /** - * 石をアイコンにする - */ - "useAvatarAsStone": string; - }; - "_offlineScreen": { - /** - * オフライン - サーバーに接続できません - */ - "title": string; - /** - * サーバーに接続できません - */ - "header": string; - }; - "_urlPreviewSetting": { - /** - * URLプレビューの設定 - */ - "title": string; - /** - * URLプレビューを有効にする - */ - "enable": string; - /** - * プレビュー取得時のタイムアウト(ms) - */ - "timeout": string; - /** - * プレビュー取得の所要時間がこの値を超えた場合、プレビューは生成されません。 - */ - "timeoutDescription": string; - /** - * Content-Lengthの最大値(byte) - */ - "maximumContentLength": string; - /** - * Content-Lengthがこの値を超えた場合、プレビューは生成されません。 - */ - "maximumContentLengthDescription": string; - /** - * Content-Lengthが取得できた場合のみプレビューを生成 - */ - "requireContentLength": string; - /** - * 相手サーバがContent-Lengthを返さない場合、プレビューは生成されません。 - */ - "requireContentLengthDescription": string; - /** - * User-Agent - */ - "userAgent": string; - /** - * プレビュー取得時に使用されるUser-Agentを設定します。空欄の場合、デフォルトのUser-Agentが使用されます。 - */ - "userAgentDescription": string; - /** - * プレビューを生成するプロキシのエンドポイント - */ - "summaryProxy": string; - /** - * Misskey本体ではなく、サマリープロキシを使用してプレビューを生成します。 - */ - "summaryProxyDescription": string; - /** - * プロキシには下記パラメータがクエリ文字列として連携されます。プロキシ側がこれらをサポートしない場合、設定値は無視されます。 - */ - "summaryProxyDescription2": string; - }; - "_mediaControls": { - /** - * ピクチャインピクチャ - */ - "pip": string; - /** - * 再生速度 - */ - "playbackRate": string; - /** - * ループ再生 - */ - "loop": string; - }; - "_contextMenu": { - /** - * コンテキストメニュー - */ - "title": string; - /** - * アプリケーション - */ - "app": string; - /** - * Shiftキーでアプリケーション - */ - "appWithShift": string; - /** - * ブラウザのUI - */ - "native": string; - }; - "_embedCodeGen": { - /** - * 埋め込みコードをカスタマイズ - */ - "title": string; - /** - * ヘッダーを表示 - */ - "header": string; - /** - * 自動で続きを読み込む(非推奨) - */ - "autoload": string; - /** - * 高さの最大値 - */ - "maxHeight": string; - /** - * 0で最大値の設定が無効になります。ウィジェットが縦に伸び続けるのを防ぐために、何らかの値に指定してください。 - */ - "maxHeightDescription": string; - /** - * 高さの最大値制限が無効(0)になっています。これが意図した変更ではない場合は、高さの最大値を何らかの値に設定してください。 - */ - "maxHeightWarn": string; - /** - * プレビュー画面で表示可能な範囲を超えたため、実際に埋め込んだ際とは表示が異なります。 - */ - "previewIsNotActual": string; - /** - * 角丸にする - */ - "rounded": string; - /** - * 外枠に枠線をつける - */ - "border": string; - /** - * プレビューに反映 - */ - "applyToPreview": string; - /** - * 埋め込みコードを作成 - */ - "generateCode": string; - /** - * コードが生成されました - */ - "codeGenerated": string; - /** - * 生成されたコードをウェブサイトに貼り付けてご利用ください。 - */ - "codeGeneratedDescription": string; - }; - "_selfXssPrevention": { - /** - * 警告 - */ - "warning": string; - /** - * 「この画面に何か貼り付けろ」はすべて詐欺です。 - */ - "title": string; - /** - * ここに何かを貼り付けると、悪意のあるユーザーにアカウントを乗っ取られたり、個人情報を盗まれたりする可能性があります。 - */ - "description1": string; - /** - * 貼り付けようとしているものが何なのかを正確に理解していない場合は、%c今すぐ作業を中止してこのウィンドウを閉じてください。 - */ - "description2": string; - /** - * 詳しくはこちらをご確認ください。 {link} - */ - "description3": ParameterizedString<"link">; - }; } declare const locales: { [lang: string]: Locale; diff --git a/locales/index.js b/locales/index.js index 091d216dee..650e552337 100644 --- a/locales/index.js +++ b/locales/index.js @@ -15,7 +15,6 @@ const merge = (...args) => args.reduce((a, c) => ({ const languages = [ 'ar-SA', - 'ca-ES', 'cs-CZ', 'da-DK', 'de-DE', @@ -53,11 +52,7 @@ const primaries = { const clean = (text) => text.replace(new RegExp(String.fromCodePoint(0x08), 'g'), ''); export function build() { - // vitestの挙動を調整するため、一度ローカル変数化する必要がある - // https://github.com/vitest-dev/vitest/issues/3988#issuecomment-1686599577 - // https://github.com/misskey-dev/misskey/pull/14057#issuecomment-2192833785 - const metaUrl = import.meta.url; - const locales = languages.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(new URL(`${c}.yml`, metaUrl), 'utf-8'))) || {}, a), {}); + const locales = languages.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(new URL(`${c}.yml`, import.meta.url), 'utf-8'))) || {}, a), {}); // 空文字列が入ることがあり、フォールバックが動作しなくなるのでプロパティごと消す const removeEmpty = (obj) => { diff --git a/locales/it-IT.yml b/locales/it-IT.yml index 8fb6dcd6f2..6ce6cd5604 100644 --- a/locales/it-IT.yml +++ b/locales/it-IT.yml @@ -1,6 +1,6 @@ --- _lang_: "Italiano" -headlineMisskey: "Rete collegata tramite Note" +headlineMisskey: "Rete collegata tramite note" introMisskey: "Eccoci! Misskey è un servizio di microblogging decentralizzato, libero e aperto. \n\n📡 Puoi pubblicare «Note» per condividere ciò che sta succedendo o per dire a tutti qualcosa su di te. \n\n👍 Puoi reagire inviando emoji rapidi alle «Note» provenienti da altri profili nel Fediverso.\n\n🚀 Esplora un nuovo mondo insieme a noi!" poweredByMisskeyDescription: "{name} è uno dei servizi (chiamati istanze) che utilizzano la piattaforma open source Misskey." monthAndDay: "{day}/{month}" @@ -8,9 +8,6 @@ search: "Cerca" notifications: "Notifiche" username: "Nome utente" password: "Password" -initialPasswordForSetup: "Password iniziale, per avviare le impostazioni" -initialPasswordIsIncorrect: "Password iniziale, sbagliata." -initialPasswordForSetupDescription: "Se hai installato Misskey di persona, usa la password che hai indicato nel file di configurazione.\nSe stai utilizzando un servizio di hosting Misskey, usa la password fornita dal gestore.\nSe non hai una password preimpostata, lascia il campo vuoto e continua." forgotPassword: "Hai dimenticato la password?" fetchingAsApObject: "Recuperando dal Fediverso..." ok: "OK" @@ -63,12 +60,11 @@ copyFileId: "Copia ID del file" copyFolderId: "Copia ID della cartella" copyProfileUrl: "Copia URL del profilo" searchUser: "Cerca profilo" -searchThisUsersNotes: "Cerca le sue Note" reply: "Rispondi" loadMore: "Mostra di più" showMore: "Espandi" showLess: "Comprimi" -youGotNewFollower: "Hai un nuovo Follower" +youGotNewFollower: "Adesso ti segue" receiveFollowRequest: "Hai ricevuto una richiesta di follow" followRequestAccepted: "Ha accettato la tua richiesta di follow" mention: "Menzioni" @@ -80,16 +76,16 @@ export: "Esporta" files: "Allegati" download: "Scarica" driveFileDeleteConfirm: "Vuoi davvero eliminare il file \"{name}\", e le Note a cui è stato allegato?" -unfollowConfirm: "Vuoi davvero togliere il Following a {name}?" +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. Potrebbe richiedere un po' di tempo." lists: "Liste" noLists: "Nessuna lista" note: "Nota" notes: "Note" -following: "Following" +following: "Follow" followers: "Follower" -followsYou: "Follower" +followsYou: "Segue" createList: "Aggiungi una nuova lista" manageLists: "Gestisci liste" error: "Errore" @@ -106,20 +102,17 @@ defaultNoteVisibility: "Privacy predefinita delle note" follow: "Segui" followRequest: "Richiesta di follow" followRequests: "Richieste di follow" -unfollow: "Togli Following" +unfollow: "Interrompi following" followRequestPending: "Richiesta in approvazione" enterEmoji: "Inserisci emoji" renote: "Rinota" unrenote: "Elimina la Rinota" renoted: "Rinotata!" -renotedToX: "Rinota da {name}." cantRenote: "È impossibile rinotare questa nota." cantReRenote: "È impossibile rinotare una Rinota." quote: "Citazione" inChannelRenote: "Rinota nel canale" inChannelQuote: "Cita nel canale" -renoteToChannel: "Rinota al canale" -renoteToOtherChannel: "Rinota a un altro canale" pinnedNote: "Nota in primo piano" pinned: "Fissa sul profilo" you: "Tu" @@ -137,16 +130,15 @@ overwriteFromPinnedEmojis: "Sovrascrivi con le impostazioni globali" reactionSettingDescription2: "Trascina per riorganizzare, clicca per cancellare, usa il pulsante \"+\" per aggiungere." rememberNoteVisibility: "Ricordare le impostazioni di visibilità delle note" attachCancel: "Rimuovi allegato" -deleteFile: "File da Drive eliminato" markAsSensitive: "Segna come esplicito" unmarkAsSensitive: "Non segnare come esplicito " enterFileName: "Nome del file" -mute: "Silenziare" +mute: "Silenzia" unmute: "Riattiva l'audio" -renoteMute: "Silenziare le Rinota" +renoteMute: "Silenzia le Rinota" renoteUnmute: "Non silenziare le Rinota" -block: "Bloccare" -unblock: "Sbloccare" +block: "Blocca" +unblock: "Sblocca" suspend: "Sospensione" unsuspend: "Revoca la sospensione" blockConfirm: "Vuoi davvero bloccare il profilo?" @@ -158,7 +150,6 @@ editList: "Modifica Lista" selectChannel: "Seleziona canale" selectAntenna: "Scegli un'antenna" editAntenna: "Modifica Antenna" -createAntenna: "Crea Antenna" selectWidget: "Seleziona il riquadro" editWidgets: "Modifica i riquadri" editWidgetsExit: "Conferma le modifiche" @@ -185,21 +176,16 @@ addAccount: "Aggiungi profilo" reloadAccountsList: "Ricarica l'elenco dei profili" loginFailed: "Accesso non riuscito" showOnRemote: "Leggi sull'istanza remota" -continueOnRemote: "Continua da remoto" -chooseServerOnMisskeyHub: "Scegli l'istanza sul sito Misskey Hub" -specifyServerHost: "Indica l'indirizzo dell'istanza" -inputHostName: "Digita il nome del dominio " general: "Generali" wallpaper: "Sfondo" setWallpaper: "Imposta sfondo" removeWallpaper: "Elimina lo sfondo" searchWith: "Cerca: {q}" youHaveNoLists: "Non hai ancora creato nessuna lista" -followConfirm: "Confermi il Following a {name}?" +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: "Host" -selectSelf: "Segli me" selectUser: "Seleziona profilo" recipient: "Destinatario" annotation: "Annotazione preventiva" @@ -213,9 +199,8 @@ charts: "Grafici" perHour: "orario" perDay: "giornaliero" stopActivityDelivery: "Interrompi la distribuzione di attività" -blockThisInstance: "Bloccare l'istanza" -silenceThisInstance: "Silenziare l'istanza" -mediaSilenceThisInstance: "Silenzia i media dell'istanza" +blockThisInstance: "Blocca questa istanza" +silenceThisInstance: "Silenzia l'istanza" operations: "Operazioni" software: "Software" version: "Versione" @@ -237,11 +222,7 @@ blockedInstances: "Istanze bloccate" blockedInstancesDescription: "Elenca le istanze che vuoi bloccare, una per riga. Esse non potranno più interagire con la tua istanza." silencedInstances: "Istanze silenziate" silencedInstancesDescription: "Elenca i nomi host delle istanze che vuoi silenziare. Tutti i profili nelle istanze silenziate vengono trattati come tali. Possono solo inviare richieste di follow e menzionare soltanto i profili locali che seguono. Le istanze bloccate non sono interessate." -mediaSilencedInstances: "Istanze coi media silenziati" -mediaSilencedInstancesDescription: "Elenca i nomi host delle istanze di cui vuoi silenziare i media, uno per riga. Tutti gli allegati dei profili nelle istanze silenziate per via degli allegati espliciti, verranno impostati come tali, le emoji personalizzate non saranno disponibili. Le istanze bloccate sono escluse." -federationAllowedHosts: "Server a cui consentire la federazione" -federationAllowedHostsDescription: "Indica gli host dei server a cui è consentita la federazione, uno per ogni linea." -muteAndBlock: "Silenziare e bloccare" +muteAndBlock: "Silenziati / Bloccati" mutedUsers: "Profili silenziati" blockedUsers: "Profili bloccati" noUsers: "Non ci sono profili" @@ -263,7 +244,7 @@ all: "Tutte" subscribing: "Iscrizione" publishing: "Pubblicazione" notResponding: "Nessuna risposta" -instanceFollowing: "Istanza Following" +instanceFollowing: "Seguiti dall'istanza" instanceFollowers: "Follower dell'istanza" instanceUsers: "Profili nell'istanza" changePassword: "Aggiorna Password" @@ -331,7 +312,6 @@ selectFile: "Scelta allegato" selectFiles: "Scelta allegato" selectFolder: "Seleziona cartella" selectFolders: "Seleziona cartella" -fileNotSelected: "Nessun file selezionato" renameFile: "Rinomina file" folderName: "Nome della cartella" createFolder: "Nuova cartella" @@ -339,7 +319,6 @@ renameFolder: "Rinomina cartella" deleteFolder: "Elimina cartella" folder: "Cartella" addFile: "Allega" -showFile: "Visualizza file" emptyDrive: "Il Drive è vuoto" emptyFolder: "La cartella è vuota" unableToDelete: "Eliminazione impossibile" @@ -400,11 +379,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Abilita hCaptcha" hcaptchaSiteKey: "Chiave del sito" hcaptchaSecretKey: "Chiave segreta" -mcaptcha: "mCaptcha" -enableMcaptcha: "Abilita hCaptcha" -mcaptchaSiteKey: "Chiave del sito" -mcaptchaSecretKey: "Chiave segreta" -mcaptchaInstanceUrl: "URL della istanza mCaptcha" recaptcha: "reCAPTCHA" enableRecaptcha: "Abilita reCAPTCHA" recaptchaSiteKey: "Chiave del sito" @@ -420,7 +394,6 @@ name: "Nome" antennaSource: "Fonte dell'antenna" antennaKeywords: "Parole chiavi da ricevere" antennaExcludeKeywords: "Parole chiavi da escludere" -antennaExcludeBots: "Escludere i Bot" antennaKeywordsDescription: "Sparando con uno spazio indichi la condizione E (and). Separando con un a capo, indichi la condizione O (or)." notifyAntenna: "Invia notifiche delle nuove note" withFileAntenna: "Solo note con file in allegato" @@ -431,7 +404,7 @@ withReplies: "Includere le risposte" connectedTo: "Connessione ai seguenti profili:" notesAndReplies: "Note e risposte" withFiles: "Con allegati" -silence: "Silenziare" +silence: "Silenzia" silenceConfirm: "Vuoi davvero silenziare questo profilo?" unsilence: "Riattiva" unsilenceConfirm: "Vuoi davvero riattivare questo profilo?" @@ -454,15 +427,14 @@ totpDescription: "Puoi autenticarti inserendo un codice OTP tramite la tua App d moderator: "Moderatore" moderation: "moderazione" moderationNote: "Promemoria di moderazione" -moderationNoteDescription: "Puoi scrivere promemoria condivisi solo tra moderatori." addModerationNote: "Aggiungi promemoria di moderazione" moderationLogs: "Cronologia di moderazione" -nUsersMentioned: "{n} profili ne parlano" +nUsersMentioned: "{n} profili menzionati" securityKeyAndPasskey: "Chiave di sicurezza e accesso" securityKey: "Chiave di sicurezza" lastUsed: "Ultima attività" lastUsedAt: "Uso più recente: {t}" -unregister: "Rimuovi autenticazione a due fattori (2FA/MFA)" +unregister: "Annulla l'iscrizione" passwordLessLogin: "Accedi senza password" passwordLessLoginDescription: "Accedi senza password, usando la chiave di sicurezza" resetPassword: "Ripristina la password" @@ -472,7 +444,7 @@ share: "Condividi" notFound: "Non trovato" notFoundDescription: "Nessuna pagina corrisponde all'URL indicata." uploadFolder: "Destinazione caricamento predefinita" -markAsReadAllNotifications: "Segnare tutte le notifiche come lette" +markAsReadAllNotifications: "Segna tutte le notifiche come lette" markAsReadAllUnreadNotes: "Segna tutte le note come lette" markAsReadAllTalkMessages: "Segna tutte le chat come lette" help: "Guida" @@ -489,12 +461,10 @@ retype: "Conferma" noteOf: "Note di {user}" quoteAttached: "Citazione allegata" quoteQuestion: "Vuoi aggiungere una citazione?" -attachAsFileQuestion: "Il testo copiato eccede le dimensioni, vuoi allegarlo?" noMessagesYet: "Ancora nessuna chat" newMessageExists: "Hai ricevuto un nuovo messaggio" onlyOneFileCanBeAttached: "È possibile allegare al messaggio soltanto uno file" signinRequired: "Occorre avere un profilo registrato su questa istanza" -signinOrContinueOnRemote: "Per continuare, devi accedere alla tua istanza o registrarti su questa e poi accedere" invitations: "Invita" invitationCode: "Codice di invito" checking: "Confermando" @@ -516,12 +486,8 @@ uiLanguage: "Lingua di visualizzazione dell'interfaccia" aboutX: "Informazioni su {x}" emojiStyle: "Stile emoji" native: "Nativo" -menuStyle: "Stile menu" -style: "Stile" -drawer: "Drawer" -popup: "Popup" +disableDrawer: "Non mostrare il menù sul drawer" showNoteActionsOnlyHover: "Mostra le azioni delle Note solo al passaggio del mouse" -showReactionsCount: "Visualizza il numero di reazioni su una nota" noHistory: "Nessuna cronologia" signinHistory: "Storico degli accessi al profilo" enableAdvancedMfm: "Attiva MFM avanzati" @@ -575,7 +541,7 @@ 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" withRepliesByDefaultForNewlyFollowed: "Quando segui nuovi profili, includi le risposte in TL come impostazione predefinita" -newNoteRecived: "Nuove Note da leggere" +newNoteRecived: "Nuove note da leggere" sounds: "Impostazioni suoni" sound: "Suono" listen: "Ascolta" @@ -602,12 +568,10 @@ 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." -uiInspector: "UI Inspector" -uiInspectorDescription: "Puoi visualizzare un elenco di elementi UI presenti in memoria. I componenti dell'interfaccia utente vengono generati dalle funzioni Ui:C:." output: "Uscita" script: "Script" disablePagesScript: "Disabilita AiScript nelle pagine" -updateRemoteUser: "Aggiorna dati dal profilo remoto" +updateRemoteUser: "Aggiorna le informazioni dal profilo remoto" unsetUserAvatar: "Rimozione foto profilo" unsetUserAvatarConfirm: "Vuoi davvero rimuovere la foto profilo?" unsetUserBanner: "Rimuovi intestazione profilo" @@ -615,9 +579,9 @@ unsetUserBannerConfirm: "Vuoi davvero rimuovere l'intestazione dal profilo?" deleteAllFiles: "Elimina tutti i file" deleteAllFilesConfirm: "Vuoi davvero eliminare tutti i file?" removeAllFollowing: "Annulla tutti i follow" -removeAllFollowingDescription: "Togli il Following a tutti i profili su {host}. Utile, ad esempio, quando l'istanza non esiste più." +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: "Profilo silenziato" +userSilenced: "Profilo silente." yourAccountSuspendedTitle: "Questo profilo è sospeso" yourAccountSuspendedDescription: "Questo profilo è stato sospeso a causa di una violazione del regolamento. Per informazioni, contattare l'amministrazione. Si prega di non creare un nuovo account." tokenRevoked: "Il token non è valido" @@ -662,7 +626,6 @@ medium: "Medio" small: "Piccolo" generateAccessToken: "Genera token di accesso" permission: "Autorizzazioni " -adminPermission: "Privilegi amministrativi" enableAll: "Abilita tutto" disableAll: "Disabilita tutto" tokenRequested: "Autorizza accesso al profilo" @@ -687,7 +650,7 @@ wordMute: "Filtri parole" hardWordMute: "Filtro parole forte" regexpError: "errore regex" regexpErrorDescription: "Si è verificato un errore nell'espressione regolare alla riga {line} della parola muta {tab}:" -instanceMute: "Silenziare l'istanza" +instanceMute: "Silenzia l'istanza" userSaysSomething: "{name} ha detto qualcosa" makeActive: "Attiva" display: "Visualizza" @@ -703,24 +666,26 @@ notificationSetting: "Impostazioni notifiche" notificationSettingDesc: "Seleziona il tipo di notifiche da visualizzare." useGlobalSetting: "Usa impostazioni generali" useGlobalSettingDesc: "Quando attiva, verranno utilizzate le impostazioni notifiche del profilo. Altrimenti si possono segliere impostazioni personalizzate." -other: "Eccetera" +other: "Ulteriori" regenerateLoginToken: "Genera di nuovo un token di connessione" regenerateLoginTokenDescription: "Genera un nuovo token di autenticazione. Solitamente questa operazione non è necessaria: quando si genera un nuovo token, tutti i dispositivi vanno disconnessi." -theKeywordWhenSearchingForCustomEmoji: "Questa sarà la parola chiave durante la ricerca di emoji personalizzate" setMultipleBySeparatingWithSpace: "È possibile creare multiple voci separate da spazi." fileIdOrUrl: "ID o URL del file" behavior: "Comportamento" sample: "Esempio" abuseReports: "Segnalazioni" -reportAbuse: "Segnalare" -reportAbuseRenote: "Segnalare la Rinota" -reportAbuseOf: "Segnalare {name}" +reportAbuse: "Segnala" +reportAbuseRenote: "Segnala la Rinota" +reportAbuseOf: "Segnala {name}" 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: "Segnalazione a" -reporterOrigin: "Segnalazione da" +reporteeOrigin: "Origine del segnalato" +reporterOrigin: "Origine del segnalatore" +forwardReport: "Inoltro di un report a un'istanza remota." +forwardReportIsAnonymous: "L'istanza remota non vedrà le tue informazioni, apparirai come profilo di sistema, anonimo." send: "Inviare" +abuseMarkAsResolved: "Contrassegna la segnalazione come risolta" openInNewTab: "Apri in una nuova scheda" openInSideView: "Apri in vista laterale" defaultNavigationBehaviour: "Navigazione preimpostata" @@ -747,7 +712,7 @@ repliesCount: "Numero di risposte inviate" renotesCount: "Numero di note che hai ricondiviso" repliedCount: "Numero di risposte ricevute" renotedCount: "Numero delle tue note ricondivise" -followingCount: "Numero di Following" +followingCount: "Numero di profili seguiti" followersCount: "Numero di profili che ti seguono" sentReactionsCount: "Numero di reazioni inviate" receivedReactionsCount: "Numero di reazioni ricevute" @@ -789,7 +754,7 @@ reloadToApplySetting: "Le tue preferenze verranno impostate dopo il ricaricament needReloadToApply: "È necessario riavviare per rendere effettive le modifiche." showTitlebar: "Visualizza la barra del titolo" clearCache: "Svuota la cache" -onlineUsersCount: "{n} persone attive adesso" +onlineUsersCount: "{n} persone online" nUsers: "{n} profili" nNotes: "{n}Note" sendErrorReports: "Invia segnalazioni di errori" @@ -842,7 +807,7 @@ onlineStatus: "Stato di connessione" hideOnlineStatus: "Modalità invisibile" hideOnlineStatusDescription: "Attivando questa opzione potresti ridurre l'usabilità di alcune funzioni, come la ricerca." online: "Online" -active: "Attivo" +active: "Attività" offline: "Offline" notRecommended: "Sconsigliato" botProtection: "Protezione contro i bot" @@ -857,7 +822,6 @@ administration: "Gestione" accounts: "Profilo" switch: "Cambia" noMaintainerInformationWarning: "Mancano le informazioni sull'amministratore." -noInquiryUrlWarning: "Non è stata impostata la URL di contatto" noBotProtectionWarning: "Non è stata impostata alcuna protezione dai Bot" configure: "Imposta" postToGallery: "Pubblicare nella galleria" @@ -889,7 +853,7 @@ troubleshooting: "Risoluzione problemi" useBlurEffect: "Utilizza effetto sfocatura" learnMore: "Più dettagli" misskeyUpdated: "Misskey è stato aggiornato!" -whatIsNew: "Informazioni sull'aggiornamento" +whatIsNew: "Visualizza le informazioni sull'aggiornamento" translate: "Traduci" translatedFrom: "Traduzione da {x}" accountDeletionInProgress: "È in corso l'eliminazione del profilo" @@ -901,8 +865,8 @@ pubSub: "Publish/Subscribe del profilo" lastCommunication: "La comunicazione più recente" resolved: "Risolto" unresolved: "Non risolto" -breakFollow: "Rimuovi Follower" -breakFollowConfirm: "Vuoi davvero togliere questo Follower?" +breakFollow: "Interrompi follow" +breakFollowConfirm: "Vuoi davvero che questo profilo smetta di seguirti?" itsOn: "Abilitato" itsOff: "Disabilitato" on: "Acceso" @@ -915,14 +879,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: "Silenziare conversazione" +muteThread: "Silenzia conversazione" unmuteThread: "Riattiva la conversazione" -followingVisibility: "Visibilità dei Following" -followersVisibility: "Visibilità dei profili che ti seguono" continueThread: "Altre conversazioni" deleteAccountConfirm: "Così verrà eliminato il profilo. Vuoi procedere?" incorrectPassword: "La password è errata." -incorrectTotp: "Il codice OTP è sbagliato, oppure scaduto." voteConfirm: "Votare per「{choice}」?" hide: "Nascondere" useDrawerReactionPickerForMobile: "Mostra sul drawer da dispositivo mobile" @@ -947,9 +908,6 @@ oneHour: "1 ora" oneDay: "1 giorno" oneWeek: "1 settimana" oneMonth: "Un mese" -threeMonths: "3 mesi" -oneYear: "1 anno" -threeDays: "3 giorni" reflectMayTakeTime: "Potrebbe essere necessario un po' di tempo perché ciò abbia effetto." failedToFetchAccountInformation: "Impossibile recuperare le informazioni sul profilo" rateLimitExceeded: "Superato il limite di richieste." @@ -968,7 +926,7 @@ driveCapOverrideLabel: "Modificare la capienza del Drive per questo profilo" driveCapOverrideCaption: "Se viene specificato meno di 0, viene annullato." requireAdminForView: "Per visualizzarli, è necessario aver effettuato l'accesso con un profilo amministratore." isSystemAccount: "Questi profili vengono creati e gestiti automaticamente dal sistema" -typeToConfirm: "Digita {x} per continuare" +typeToConfirm: "Per eseguire questa operazione, digitare {x}" deleteAccount: "Eliminazione profilo" document: "Documento" numberOfPageCache: "Numero di pagine cache" @@ -1001,11 +959,11 @@ shuffle: "Casuale" account: "Account" move: "Sposta" pushNotification: "Notifiche Push" -subscribePushNotification: "Attivare le notifiche push" -unsubscribePushNotification: "Disattivare le notifiche push" +subscribePushNotification: "Attiva le notifiche push" +unsubscribePushNotification: "Disattiva le notifiche push" pushNotificationAlreadySubscribed: "Le notifiche push sono già attivate" pushNotificationNotSupported: "Il client o il server non supporta le notifiche push" -sendPushNotificationReadMessage: "Eliminare le notifiche push dopo la relativa lettura" +sendPushNotificationReadMessage: "Elimina le notifiche push dopo la relativa lettura" sendPushNotificationReadMessageCaption: "Se possibile, verrà mostrata brevemente una notifica con il testo \"{emptyPushNotificationMessage}\". Potrebbe influire negativamente sulla durata della batteria." windowMaximize: "Ingrandisci" windowMinimize: "Contrai finestra" @@ -1023,7 +981,6 @@ neverShow: "Non mostrare più" remindMeLater: "Rimanda" didYouLikeMisskey: "Ti piace Misskey?" pleaseDonate: "Misskey è il software libero utilizzato su {host}. Offrendo una donazione è più facile continuare a svilupparlo!" -correspondingSourceIsAvailable: "Il codice sorgente corrispondente è disponibile su {anchor}." roles: "Ruoli" role: "Ruolo" noRole: "Ruolo non trovato" @@ -1051,7 +1008,6 @@ thisPostMayBeAnnoyingHome: "Pubblica sulla timeline principale" thisPostMayBeAnnoyingCancel: "Annulla" thisPostMayBeAnnoyingIgnore: "Pubblica lo stesso" collapseRenotes: "Comprimi le Rinota già viste" -collapseRenotesDescription: "Comprimi le Note con cui hai già interagito." internalServerError: "Errore interno del server" internalServerErrorDescription: "Si è verificato un errore imprevisto all'interno del server" copyErrorInfo: "Copia le informazioni sull'errore" @@ -1075,9 +1031,6 @@ resetPasswordConfirm: "Vuoi davvero ripristinare la password?" 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." -prohibitedWords: "Parole proibite" -prohibitedWordsDescription: "Verrà impedito di pubblicare Note che abbiano le parole indicate. Puoi impostare più parole, separatamente, su ogni riga." -prohibitedWordsDescription2: "Gli spazi creano la relazione \"E\" tra parole (questo E quello). Racchiudere una parola nelle slash \"/\" la trasforma in Espressione Regolare." hiddenTags: "Hashtag nascosti" hiddenTagsDescription: "Impedire la visualizzazione del tag impostato nei trend. Puoi impostare più valori, uno per riga." notesSearchNotAvailable: "Non è possibile cercare tra le Note." @@ -1090,15 +1043,12 @@ retryAllQueuesConfirmTitle: "Vuoi ritentare adesso?" retryAllQueuesConfirmText: "Potrebbe sovraccaricare il server temporaneamente." enableChartsForRemoteUser: "Abilita i grafici per i profili remoti" enableChartsForFederatedInstances: "Abilita i grafici per le istanze federate" -enableStatsForFederatedInstances: "Informazioni statistiche sui server federati" showClipButtonInNoteFooter: "Aggiungi il bottone Clip tra le azioni delle Note" reactionsDisplaySize: "Grandezza delle reazioni" limitWidthOfReaction: "Limita la larghezza delle reazioni e ridimensionale" noteIdOrUrl: "ID della Nota o URL" video: "Video" videos: "Video" -audio: "Audio" -audioFiles: "Audio" dataSaver: "Risparmia dati" accountMigration: "Migrazione del profilo" accountMoved: "Questo profilo ha migrato altrove:" @@ -1126,21 +1076,16 @@ 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." createNoteFromTheFile: "Crea Nota da questo file" archive: "Archivio" -archived: "Archiviato" -unarchive: "Annulla archiviazione" channelArchiveConfirmTitle: "Vuoi davvero archiviare {name}?" channelArchiveConfirmDescription: "Un canale archiviato non compare nell'elenco canali, nemmeno nei risultati di ricerca. Non può ricevere nemmeno nuove Note." thisChannelArchived: "Questo canale è stato archiviato." displayOfNote: "Visualizzazione delle Note" initialAccountSetting: "Impostazioni iniziali del profilo" -youFollowing: "Following" +youFollowing: "Seguiti" preventAiLearning: "Impedisci l'apprendimento della IA" preventAiLearningDescription: "Aggiungendo il campo \"noai\" alla risposta HTML, si indica ai Robot esterni di non usare testi e allegati per addestrare sistemi di Machine Learning (IA predittiva/generativa). Anche se è impossibile sapere se la richiesta venga onorata o semplicemente ignorata." options: "Opzioni del ruolo" specifyUser: "Profilo specifico" -lookupConfirm: "Vuoi davvero richiedere informazioni?" -openTagPageConfirm: "Vuoi davvero aprire la pagina dell'hashtag?" -specifyHost: "Specifica l'host" failedToPreviewUrl: "Anteprima non disponibile" update: "Aggiorna" rolesThatCanBeUsedThisEmojiAsReaction: "Ruoli che possono usare questa emoji come reazione" @@ -1199,7 +1144,6 @@ showRenotes: "Includi le Rinota" edited: "Modificato" notificationRecieveConfig: "Preferenze di notifica" mutualFollow: "Follow reciproco" -followingOrFollower: "Following o Follower" fileAttachedOnly: "Solo con allegati" showRepliesToOthersInTimeline: "Risposte altrui nella TL" hideRepliesToOthersInTimeline: "Nascondi Riposte altrui nella TL" @@ -1208,13 +1152,6 @@ hideRepliesToOthersInTimelineAll: "Nascondi le risposte dei tuoi follow nella TL confirmShowRepliesAll: "Questa è una attività irreversibile. Vuoi davvero includere tutte le risposte dei following in TL?" confirmHideRepliesAll: "Questa è una attività irreversibile. Vuoi davvero escludere tutte le risposte dei following in TL?" externalServices: "Servizi esterni" -sourceCode: "Codice sorgente" -sourceCodeIsNotYetProvided: "" -repositoryUrl: "URL della repository" -repositoryUrlDescription: "Se esiste un repository il cui il codice sorgente è disponibile pubblicamente, inserisci il suo URL. Se stai utilizzando Misskey così com'è (senza alcuna modifica al codice sorgente), inserisci https://github.com/misskey-dev/misskey." -repositoryUrlOrTarballRequired: "Se non disponi di un repository pubblico, dovrai fornire un file tarball (tar). Vedere .config/example.yml per i dettagli." -feedback: "Feedback" -feedbackUrl: "URL di feedback" impressum: "Dichiarazione di proprietà" impressumUrl: "URL della dichiarazione di proprietà" impressumDescription: "La dichiarazione di proprietà, è obbligatoria in alcuni paesi come la Germania (Impressum)." @@ -1242,119 +1179,19 @@ remainingN: "Rimangono: {n}" overwriteContentConfirm: "Vuoi davvero sostituire l'attuale contenuto?" seasonalScreenEffect: "Schermate in base alla stagione" decorate: "Decora" -addMfmFunction: "Aggiungi decorazioni" -enableQuickAddMfmFunction: "Attiva il selettore di funzioni MFM" -bubbleGame: "Bubble Game" -sfx: "Effetti sonori" -soundWillBePlayed: "Con musica ed effetti sonori" -showReplay: "Vedi i replay" -replay: "Replay" -replaying: "Replay in corso" -endReplay: "Termina replay" -copyReplayData: "Copia replay" -ranking: "Classifica" -lastNDays: "Ultimi {n} giorni" -backToTitle: "Torna al titolo" -hemisphere: "Geolocalizzazione" -withSensitive: "Mostra le Note con allegati espliciti" -userSaysSomethingSensitive: "Note da {name} con allegati espliciti" -enableHorizontalSwipe: "Trascina per invertire i tab" -loading: "Caricamento" -surrender: "Annulla" -gameRetry: "Riprova" -notUsePleaseLeaveBlank: "Lasciare vuoto, se non in uso" -useTotp: "Usare il codice OTP" -useBackupCode: "Usare il codice usa-e-getta" -launchApp: "Esegui l'App" -useNativeUIForVideoAudioPlayer: "Riprodurre audio/video usando le funzionalità del browser" -keepOriginalFilename: "Mantieni il nome file originale" -keepOriginalFilenameDescription: "Disattivandola, i file verranno caricati usando nomi casuali." -noDescription: "Manca la descrizione" -alwaysConfirmFollow: "Richiedi conferma per i Follow" -inquiry: "Contattaci" -tryAgain: "Per favore riprova" -confirmWhenRevealingSensitiveMedia: "Richiedi conferma prima di mostrare gli allegati espliciti" -sensitiveMediaRevealConfirm: "Questo allegato è esplicito, vuoi vederlo?" -createdLists: "Liste create" -createdAntennas: "Antenne create" -fromX: "Da {x}" -genEmbedCode: "Ottieni il codice di incorporamento" -noteOfThisUser: "Elenco di Note di questo profilo" -clipNoteLimitExceeded: "Non è possibile aggiungere ulteriori Note a questa Clip." -performance: "Prestazioni" -modified: "Modificato" -discard: "Scarta" -thereAreNChanges: "Ci sono {n} cambiamenti" -signinWithPasskey: "Accedi con passkey" -unknownWebAuthnKey: "Questa è una passkey sconosciuta." -passkeyVerificationFailed: "La verifica della passkey non è riuscita." -passkeyVerificationSucceededButPasswordlessLoginDisabled: "La verifica della passkey è riuscita, ma l'accesso senza password è disabilitato." -messageToFollower: "Messaggio ai follower" -target: "Riferimento" -testCaptchaWarning: "Questa funzione è destinata al test CAPTCHA. Da non utilizzare in ambiente di produzione." -prohibitedWordsForNameOfUser: "Parole proibite (nome utente)" -prohibitedWordsForNameOfUserDescription: "Il sistema rifiuta di rinominare un utente, se il nome contiene qualsiasi parola nell'elenco. Sono esenti i profili con privilegi di moderazione." -yourNameContainsProhibitedWords: "Il nome che hai scelto contiene una o più parole vietate" -yourNameContainsProhibitedWordsDescription: "Se desideri comunque utilizzare questo nome, contatta l''amministrazione." -thisContentsAreMarkedAsSigninRequiredByAuthor: "L'autore richiede di iscriversi per vedere il contenuto" -lockdown: "Isolamento" -pleaseSelectAccount: "Per favore, seleziona un profilo" -_accountSettings: - requireSigninToViewContents: "Per vedere il contenuto, è necessaria l'iscrizione" - requireSigninToViewContentsDescription1: "Richiedere l'iscrizione per visualizzare tutte le Note e gli altri contenuti che hai creato. Probabilmente l'effetto è impedire la raccolta di informazioni da parte dei bot crawler." - requireSigninToViewContentsDescription2: "La visualizzazione verrà disabilitata a server che non supportano l'anteprima URL (OGP), all'incorporamento nelle pagine Web e alla citazione delle Note." - requireSigninToViewContentsDescription3: "Queste restrizioni potrebbero non applicarsi al contenuto federato su server remoti." - makeNotesFollowersOnlyBefore: "Rendi visibili solo ai Follower le Note pubblicate in precedenza" - makeNotesFollowersOnlyBeforeDescription: "Mentre questa funzione è abilitata, le Note antecedenti al momento impostato, saranno visibili solo ai profili Follower. Disabilitandola nuovamente, verrà ripristinata anche la visibilità pubblica della Nota." - makeNotesHiddenBefore: "Nascondi le Note pubblicate in precedenza" - makeNotesHiddenBeforeDescription: "Mentre questa funzione è abilitata, le Note antecedenti al momento impostato, saranno visibili soltanto a te (private). Disabilitandola nuovamente, verrà ripristinata anche la visibilità pubblica della Nota." - mayNotEffectForFederatedNotes: "Le Note già federate su server remoti potrebbero non essere modificate." - notesHavePassedSpecifiedPeriod: "Note antecedenti al periodo specificato" - notesOlderThanSpecifiedDateAndTime: "Note antecedenti al momento specificato" -_abuseUserReport: - forward: "Inoltra" - forwardDescription: "Inoltra il report al server remoto, per mezzo di account di sistema, anonimo." - resolve: "Risolvi" - accept: "Approva" - reject: "Rifiuta" - resolveTutorial: "Se moderi una segnalazione legittima, scegli \"Approva\" per risolvere positivamente.\nSe la segnalazione non è legittima, seleziona \"Rifiuta\" per risolvere negativamente." -_delivery: - status: "Stato della consegna" - stop: "Sospensione" - resume: "Riprendi la consegna" - _type: - none: "Pubblicazione" - manuallySuspended: "Sospesa manualmente" - goneSuspended: "Sospensione server a causa dell'eliminazione" - autoSuspendedForNotResponding: "Sospensione del server a causa di mancata risposta" -_bubbleGame: - howToPlay: "Come giocare" - hold: "Tieni" - _score: - score: "Punteggio" - scoreYen: "Capitale" - highScore: "Punteggio migliore" - maxChain: "Miglior combo" - yen: "{yen}¥" - estimatedQty: "{qty} punti" - scoreSweets: "Onigiri {onigiriQtyWithUnit}" - _howToPlay: - section1: "Scegli la posizione e rilascia l'oggetto nel contenitore." - section2: "Se due oggetti dello stesso tipo si toccano, si trasformano in un oggetto diverso, aumentando il punteggio." - section3: "Se gli oggetti escono dal limite superiore del contenitore, il gioco finisce. Cerca di ottenere un punteggio elevato fondendo gli oggetti, evitando che escano dal contenitore!" _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: "Conferma di lettura obbligatoria" - needConfirmationToReadDescription: "I profili riceveranno una finestra di dialogo che richiede di accettare obbligatoriamente per procedere. Tale richiesta è esente da \"conferma tutte\"." + 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}˝?" shouldNotBeUsedToPresentPermanentInfo: "Ti consigliamo di utilizzare gli annunci per pubblicare informazioni tempestive e limitate nel tempo, anziché informazioni importanti a lungo andare nel tempo, poiché potrebbero risultare difficili da ritrovare e peggiorare la fruibilità del servizio, specialmente alle nuove persone iscritte." dialogAnnouncementUxWarn: "Ti consigliamo di usarli con cautela, poiché è molto probabile che avere più di un annuncio in stile \"finestra di dialogo\" peggiori sensibilmente la fruibilità del servizio, specialmente alle nuove persone iscritte." - silence: "Annuncio silenzioso" - silenceDescription: "Attivando questa opzione, non invierai la notifica, evitando che debba essere contrassegnata come già letta." + silence: "Silenzia gli annunci" + silenceDescription: "Se attivi questa opzione, non riceverai notifiche sugli annunci, evitando di contrassegnarle come già lette." _initialAccountSetting: accountCreated: "Il tuo profilo è stato creato!" letsStartAccountSetup: "Per iniziare, impostiamo il tuo profilo." @@ -1372,7 +1209,7 @@ _initialAccountSetting: skipAreYouSure: "Vuoi davvero saltare la configurazione iniziale?" laterAreYouSure: "Vuoi davvero rimandare la configurazione iniziale?" _initialTutorial: - launchTutorial: "Inizia il tutorial" + launchTutorial: "Guarda il tutorial" title: "Tutorial" wellDone: "Ottimo lavoro!" skipAreYouSure: "Vuoi davvero interrompere il tutorial?" @@ -1382,26 +1219,26 @@ _initialTutorial: _note: title: "Cosa sono le Note?" description: "Gli status su Misskey sono chiamati \"Note\". Le Note sono elencate in ordine cronologico nelle timeline e vengono aggiornate in tempo reale." - reply: "Puoi rispondere alle Note, alle altre risposte e dialogare in conversazioni." - renote: "Puoi ri-condividere le Note, ritorneranno sulla Timeline. Aggiungendo del testo, scriverai una Citazione." - reaction: "Puoi aggiungere una reazione. Nella pagina successiva ti spiego come." - menu: "Per altre attività, ad esempio, vedere i dettagli delle Note o copiare i collegamenti." + reply: "Puoi rispondere alle Note. Puoi anche rispondere alle risposte e continuare i dialoghi come un conversazioni." + renote: "Puoi ri-condividere le Note, facendole rifluire sulla Timeline. Puoi anche aggiungere testo e citare altri profili." + reaction: "Puoi aggiungere una reazione. Nella pagina successiva spiegheremo i dettagli." + menu: "Puoi svolgere varie attività, come visualizzare i dettagli delle Note o copiare i collegamenti." _reaction: title: "Cosa sono le Reazioni?" - description: "Reazioni alle Note. Le sensazioni che non si possono descrivere con \"Mi piace\" si esprimono facilmente con le reazioni." + description: "Puoi reagire alle Note. Le sensazioni che non si riescono a trasmettere con i \"Mi piace\" si possono esprimere facilmente inviando una reazione." letsTryReacting: "Puoi aggiungere una Reazione cliccando il bottone \"+\" (più) della relativa Nota. Prova ad aggiungerne una a questa Nota di esempio!" reactToContinue: "Aggiungere la Reazione ti consentirà di procedere col tutorial." reactNotification: "Quando qualcuno reagisce alle tue Note, ricevi una notifica in tempo reale." - reactDone: "Annulla la tua Reazione premendo il bottone \"ー\" (meno)" + reactDone: "Puoi annullare la tua Reazione premendo il bottone \"ー\" (meno)" _timeline: title: "Come funziona la Timeline" description1: "Misskey fornisce alcune Timeline (sequenze cronologiche di Note). Una di queste potrebbe essere stata disattivata dagli amministratori." - home: "le Note provenienti dai profili che segui (Following)." - local: "tutte le Note pubblicate dai profili di questa istanza." - social: "sia le Note della Timeline Home che quelle della Timeline Locale, insieme!" - global: "le Note da pubblicate da tutte le altre istanze federate con la nostra." + home: "Puoi vedere le Note provenienti dai profili che segui (follow)." + local: "Puoi vedere tutte le Note pubblicate dai profili di questa istanza." + social: "Puoi vedere sia le Note della Timeline Home che quelle della Timeline Locale, insieme!" + global: "Puoi vedere le Note da pubblicate da tutte le altre istanze federate con la nostra." description2: "Nella parte superiore dello schermo, puoi scegliere una Timeline o l'altra in qualsiasi momento." - description3: "Ci sono anche sequenze temporali di elenchi, sequenze temporali di canali, ecc. Per ulteriori dettagli, consultare la {link}.\nPuoi vedere anche Timeline delle liste di profili (se ne hai create), canali, ecc... Per i dettagli, c'è la {link}." + description3: "Ci sono anche sequenze temporali di elenchi, sequenze temporali di canali, ecc. Per ulteriori dettagli, consultare il {link}.\nPuoi vedere anche Timeline delle liste di profili (se ne hai create), canali, ecc... Per i dettagli, visita {link}." _postNote: title: "La Nota e le sue impostazioni" description1: "Quando scrivi una Nota su Misskey, hai a disposizione varie opzioni. Il modulo di invio è simile a questo." @@ -1423,18 +1260,18 @@ _initialTutorial: useCases: "Utilizzalo per chiarire il contenuto della Nota, prima che sia letta. Come richiesto dal regolamento del server o per autoregolamentare spoiler e testi troppo espliciti." _howToMakeAttachmentsSensitive: title: "Come indicare che gli allegati sono espliciti?" - description: "Si fa quando è richiesto dal regolamento del server o quando non devono essere visibili immediatamente." + description: "Contrassegnare gli allegati come espliciti, va fatto quando è richiesto dal regolamento del server o quando gli allegati non devono essere immediatamente visibili." tryThisFile: "Prova a rendere esplicite le immagini allegate a questo modulo!" _exampleNote: - note: "AAA! Ho rotto il coperchio del natto... (fagioli di soia fermentati)" - method: "Tocca il file, si aprirà il menu, scegli la voce \"Segna come esplicito\"" - sensitiveSucceeded: "Quando alleghi file, assicurati di indicare se è materiale esplicito in modo appropriato, decidi in base al regolamento dell'istanza." - doItToContinue: "Imposta l'immagine come esplicita per procedere col tutorial." + note: "Ho fatto un errore aprendo il coperchio del natto... (fagioli di soia fermentati, particolarmente appiccicosi)" + method: "Per indicare che un allegato è esplicito, tocca il file per aprirne il menu e scegliere la voce \"Segna come esplicito\"." + sensitiveSucceeded: "Quando alleghi file, assicurati di indicare se è materiale esplicito, in modo appropriato, in base al regolamento del tuo server." + doItToContinue: "Impostando l'immagine come esplicita, potrai procedere col tutorial." _done: title: "Il tutorial è finito! 🎉" description: "Queste sono solamente alcune delle funzionalità principali di Misskey. Per ulteriori informazioni, {link}." _timelineDescription: - home: "Nella Timeline Home, la tua cronologia principale, puoi vedere le Note provenienti dai profili che segui (Following)." + home: "Nella Timeline Home, la tua cronologia principale, puoi vedere le Note provenienti dai profili che segui (follow)." local: "La Timeline Locale, è una cronologia di Note pubblicate da tutti i profili iscritti su questo server." social: "La Timeline Sociale, unisce in ordine cronologico l'elenco di Note presenti nella Timeline Home e quella Locale." global: "La Timeline Federata ti consente di vedere le Note pubblicate dai profili di tutti gli altri server federati a questo." @@ -1452,15 +1289,11 @@ _serverSettings: fanoutTimelineDescription: "Attivando questa funzionalità migliori notevolmente la capacità delle Timeline di collezionare Note, riducendo il carico sul database. Tuttavia, aumenterà l'impiego di memoria RAM per Redis. Disattiva se il tuo server ha poca RAM o la funzionalità è irregolare." fanoutTimelineDbFallback: "Elaborazione dati alternativa" fanoutTimelineDbFallbackDescription: "Attivando l'elaborazione alternativa, verrà interrogato ulteriormente il database se la timeline non è nella cache. \nDisattivando, si può ridurre ulteriormente il carico del server, evitando l'elaborazione alternativa, ma limitando l'intervallo recuperabile delle timeline." - reactionsBufferingDescription: "Attivando questa opzione, puoi migliorare significativamente le prestazioni durante la creazione delle reazioni e ridurre il carico sul database. Tuttavia, aumenterà l'impiego di memoria Redis." - inquiryUrl: "URL di contatto" - inquiryUrlDescription: "Specificare l'URL al modulo di contatto, oppure le informazioni con i dati di contatto dell'amministrazione." - thisSettingWillAutomaticallyOffWhenModeratorsInactive: "Per prevenire SPAM, questa impostazione verrà disattivata automaticamente, se non si rileva alcuna attività di moderazione durante un certo periodo di tempo." _accountMigration: moveFrom: "Migra un altro profilo dentro a questo" moveFromSub: "Crea un alias verso un altro profilo remoto" - moveFromLabel: "Profilo da cui migrare #{n}" - moveFromDescription: "Se desideri spostare i Follower da un altro profilo a questo, devi prima creare un alias qui. Assicurati averlo creato PRIMA di eseguire l'attività! Inserisci l'indirizzo del profilo mittente in questo modo: @persona@istanza.it" + moveFromLabel: "Profilo da cui migrare:" + moveFromDescription: "Se desideri spostare i profili follower da un altro profilo a questo, devi prima creare un alias qui. Assicurati averlo creato PRIMA di eseguire l'attività! Inserisci l'indirizzo del profilo mittente in questo modo: @persona@istanza.it" moveTo: "Migrare questo profilo verso un un altro" moveToLabel: "Profilo verso cui migrare" moveCannotBeUndone: "La migrazione è irreversibile, non può essere interrotta o annullata." @@ -1469,7 +1302,7 @@ _accountMigration: startMigration: "Avvia la migrazione" migrationConfirm: "Vuoi davvero migrare questo profilo su {account}? L'azione è irreversibile e non potrai più utilizzare questo profilo nel suo stato originale.\nInoltre, assicurati di aver già creato un alias sull'account a cui ti stai trasferendo." movedAndCannotBeUndone: "Il tuo profilo è stato migrato.\nLa migrazione non può essere annullata." - postMigrationNote: "Questo profilo smetterà di seguire gli altri profili remoti a 24 ore dal termine della migrazione.\nSia i Following che i Follower scenderanno a zero. I tuoi Follower saranno comunque in grado di vedere le Note per soli Follower, poiché non smetteranno di seguirti." + postMigrationNote: "Questo profilo smetterà di seguire gli altri profili remoti a 24 ore dal termine della migrazione.\nSia i Follow che i Follower scenderanno a zero. I tuoi follower saranno comunque in grado di vedere le Note per soli follower, poiché non smetteranno di seguirti." movedTo: "Profilo verso cui migrare" _achievements: earnedAt: "Data di conseguimento" @@ -1716,13 +1549,6 @@ _achievements: _tutorialCompleted: title: "Attestato di partecipazione al corso per principianti di Misskey" description: "Ha completato il tutorial" - _bubbleGameExplodingHead: - title: "🤯" - description: "Estrai l'oggetto più grande dal Bubble Game" - _bubbleGameDoubleExplodingHead: - title: "Doppio 🤯" - description: "Due oggetti più grossi contemporaneamente nel Bubble Game" - flavor: "Ha le dimensioni di una bento-box 🤯 🤯" _role: new: "Nuovo ruolo" edit: "Modifica ruolo" @@ -1763,7 +1589,6 @@ _role: gtlAvailable: "Disponibilità della Timeline Federata" ltlAvailable: "Disponibilità della Timeline Locale" canPublicNote: "Scrivere Note con Visibilità Pubblica" - mentionMax: "Numero massimo di menzioni in una nota" canInvite: "Generare codici di invito all'istanza" inviteLimit: "Limite di codici invito" inviteLimitCycle: "Intervallo di emissione del codice di invito" @@ -1772,7 +1597,6 @@ _role: canManageAvatarDecorations: "Gestisce le decorazioni di immagini del profilo" driveCapacity: "Capienza del Drive" alwaysMarkNsfw: "Impostare sempre come esplicito (NSFW)" - canUpdateBioMedia: "Può aggiornare foto profilo e di testata" pinMax: "Quantità massima di Note in primo piano" antennaMax: "Quantità massima di Antenne" wordMuteMax: "Lunghezza massima del filtro parole" @@ -1787,20 +1611,9 @@ _role: canSearchNotes: "Ricercare nelle Note" canUseTranslator: "Tradurre le Note" avatarDecorationLimit: "Numero massimo di decorazioni foto profilo installabili" - canImportAntennas: "Può importare Antenne" - canImportBlocking: "Può importare Blocchi" - canImportFollowing: "Può importare Following" - canImportMuting: "Può importare Silenziati" - canImportUserLists: "Può importare liste di Profili" _condition: - roleAssignedTo: "Assegnato a ruoli manualmente" isLocal: "Profilo locale" isRemote: "Profilo remoto" - isCat: "È un gattino" - isBot: "È un bot" - isSuspended: "È sospeso" - isLocked: "È in stato privato" - isExplorable: "Autorizza la pubblicazione nei cataloghi" createdLessThan: "Profilo creato da meno di N" createdMoreThan: "Profilo creato da più di N" followersLessThanOrEq: "Profilo con N follower o meno" @@ -1826,7 +1639,6 @@ _emailUnavailable: disposable: "Indirizzo email non utilizzabile" mx: "Server email non corretto" smtp: "Il server email non risponde" - banned: "Non puoi registrarti con questo indirizzo email" _ffVisibility: public: "Pubblica" followers: "Mostra solo ai follower" @@ -1862,7 +1674,7 @@ _gallery: unlike: "Non mi piace più" _email: _follow: - title: "Follower aggiuntivo" + title: "Adesso ti segue" _receiveFollowRequest: title: "Hai ricevuto una richiesta di follow" _plugin: @@ -1870,7 +1682,6 @@ _plugin: installWarn: "Si prega di installare soltanto estensioni che provengono da fonti affidabili." manage: "Gestisci estensioni" viewSource: "Visualizza sorgente" - viewLog: "Mostra log" _preferencesBackups: list: "Elenco di impostazioni salvate in precedenza" saveNew: "Nuovo salvataggio" @@ -1900,8 +1711,6 @@ _aboutMisskey: contributors: "Principali sostenitori" allContributors: "Tutti i sostenitori" source: "Codice sorgente" - original: "Originale" - thisIsModifiedVersion: "{name} sta usando una versione modificata diversa da Misskey originale." translation: "Tradurre Misskey" donate: "Sostieni Misskey" morePatrons: "Apprezziamo sinceramente il supporto di tante altre persone. Grazie mille! 🥰" @@ -1926,7 +1735,7 @@ _channel: removeBanner: "Rimuovi intestazione" featured: "Di tendenza" owned: "I miei canali" - following: "Following" + following: "Seguiti" usersCount: "{n} partecipanti" notesCount: "{n} note" nameAndDescription: "Nome e descrizione" @@ -1945,7 +1754,7 @@ _instanceMute: instanceMuteDescription: "Disattiva tutte le note, le note di rinvio (condivisione) dell'istanza configurata, comprese le risposte agli utenti dell'istanza." instanceMuteDescription2: "Impostazione separata da una nuova riga" title: "Nasconde le note dell'istanza configurata." - heading: "Istanze da silenziare" + heading: "Istanze da silenziare." _theme: explore: "Esplora temi" install: "Installa un tema" @@ -2009,6 +1818,7 @@ _theme: buttonBg: "Sfondo del pulsante" buttonHoverBg: "Sfondo del pulsante (sorvolato)" inputBorder: "Inquadra casella di testo" + listItemHoverBg: "Sfondo della voce di elenco (sorvolato)" driveFolderBg: "Sfondo della cartella di disco" wallpaperOverlay: "Sovrapposizione dello sfondo" badge: "Distintivo" @@ -2020,6 +1830,8 @@ _sfx: note: "Nota" noteMy: "Mia nota" notification: "Notifiche" + antenna: "Ricezione dell'antenna" + channel: "Notifiche di canale" reaction: "Quando seleziono una reazione" _soundSettings: driveFile: "Suoni del Drive" @@ -2028,7 +1840,6 @@ _soundSettings: driveFileTypeWarnDescription: "Per favore, scegli un file di tipo audio" driveFileDurationWarn: "La durata dell'audio è troppo lunga" driveFileDurationWarnDescription: "Scegliere un audio lungo potrebbe interferire con l'uso di Misskey. Vuoi continuare lo stesso?" - driveFileError: "Impossibile caricare l'audio. Si prega di modificare le impostazioni" _ago: future: "Futuro" justNow: "Adesso" @@ -2058,6 +1869,7 @@ _2fa: registerTOTP: "Registra una App di autenticazione a due fattori (2FA/MFA)" step1: "Innanzitutto, installa sul dispositivo un'App di autenticazione come {a} o {b}." step2: "Quindi, tramite la App installata, scansiona questo codice QR." + step2Click: "Cliccando sul codice QR, puoi registrarlo con l'app di autenticazione o il portachiavi installato sul tuo dispositivo." 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." @@ -2081,7 +1893,6 @@ _2fa: 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." - moreDetailedGuideHere: "Informazioni dettagliate sull'autenticazione multi fattore (2FA/MFA)" _permissions: "read:account": "Visualizza le informazioni sul profilo" "write:account": "Modifica le informazioni sul profilo" @@ -2092,14 +1903,14 @@ _permissions: "read:favorites": "Visualizza i tuoi preferiti" "write:favorites": "Gestisci i tuoi preferiti" "read:following": "Vedi le informazioni di follow" - "write:following": "Aggiungere e togliere Following" + "write:following": "Following di altri profili" "read:messaging": "Visualizzare la chat" "write:messaging": "Gestire la chat" "read:mutes": "Vedi i profili silenziati" "write:mutes": "Gestisci i profili silenziati" "write:notes": "Creare / Eliminare note" - "read:notifications": "Visualizzare notifiche" - "write:notifications": "Gestire notifiche" + "read:notifications": "Visualizza notifiche" + "write:notifications": "Gerisci notifiche" "read:reactions": "Vedi reazioni" "write:reactions": "Gerisci reazioni" "write:votes": "Votare" @@ -2119,54 +1930,6 @@ _permissions: "write:flash": "Modifica Play" "read:flash-likes": "Visualizza lista di Play piaciuti" "write:flash-likes": "Modifica lista di Play piaciuti" - "read:admin:abuse-user-reports": "Mostra i report dai profili utente" - "write:admin:delete-account": "Elimina l'account utente" - "write:admin:delete-all-files-of-a-user": "Elimina i file dell'account utente" - "read:admin:index-stats": "Visualizza informazioni sugli indici del database" - "read:admin:table-stats": "Visualizza informazioni sulle tabelle del database" - "read:admin:user-ips": "Visualizza indirizzi IP degli account" - "read:admin:meta": "Visualizza i metadati dell'istanza" - "write:admin:reset-password": "Ripristina la password dell'account utente" - "write:admin:resolve-abuse-user-report": "Risolvere le segnalazioni dagli account utente" - "write:admin:send-email": "Spedire email" - "read:admin:server-info": "Vedere le informazioni sul server" - "read:admin:show-moderation-log": "Vedere lo storico di moderazione" - "read:admin:show-user": "Vedere le informazioni private degli account utente" - "write:admin:suspend-user": "Sospendere i profili" - "write:admin:unset-user-avatar": "Rimuovere la foto profilo dai profili" - "write:admin:unset-user-banner": "Rimuovere l'immagine testata dai profili" - "write:admin:unsuspend-user": "Togliere la sospensione ai profili" - "write:admin:meta": "Modificare i metadati dell'istanza" - "write:admin:user-note": "Scrivere annotazioni di moderazione" - "write:admin:roles": "Gestire i ruoli" - "read:admin:roles": "Vedere i ruoli" - "write:admin:relays": "Gestire i Relay" - "read:admin:relays": "Vedere i Relay" - "write:admin:invite-codes": "Gestire codici di invito" - "read:admin:invite-codes": "Vedere codici di invito" - "write:admin:announcements": "Gestire gli annunci" - "read:admin:announcements": "Leggere gli annunci" - "write:admin:avatar-decorations": "Gestire le decorazioni" - "read:admin:avatar-decorations": "Vedere le decorazioni" - "write:admin:federation": "Gestire la federazione" - "write:admin:account": "Vedere la federazione" - "read:admin:account": "Vedere le utenze" - "write:admin:emoji": "Gestire le emoji personalizzate" - "read:admin:emoji": "Vedere le emoji personalizzate" - "write:admin:queue": "Gestire la coda di attività" - "read:admin:queue": "Vedere la coda di attività" - "write:admin:promo": "Gestire le promozioni" - "write:admin:drive": "Gestire il Drive degli account" - "read:admin:drive": "Vedere il Drive degli account" - "read:admin:stream": "Usare le API Websocket" - "write:admin:ad": "Gestire i banner pubblicitari" - "read:admin:ad": "Vedere i banner pubblicitari" - "write:invite-codes": "Creare codici di invito" - "read:invite-codes": "Vedere i codici di invito" - "write:clip-favorite": "Impostare Clip preferite" - "read:clip-favorite": "Vedere Clip preferite" - "read:federation": "Vedere la federazione" - "write:report-abuse": "Inviare segnalazioni" _auth: shareAccessTitle: "Permessi dell'applicazione" shareAccess: "Vuoi autorizzare {name} ad accedere al tuo profilo?" @@ -2175,14 +1938,11 @@ _auth: permissionAsk: "Questa app richiede le seguenti autorizzazioni:" pleaseGoBack: "Si prega di ritornare sulla app" callback: "Ritornando sulla app" - accepted: "Accesso concesso" denied: "Accesso negato" - scopeUser: "Sto funzionando per il seguente profilo" pleaseLogin: "Per favore accedi al tuo account per cambiare i permessi dell'applicazione" - byClickingYouWillBeRedirectedToThisUrl: "Consentendo l'accesso, si verrà reindirizzati presso questo indirizzo URL" _antennaSources: all: "Tutte le note" - homeTimeline: "Note dai tuoi Following" + 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" @@ -2214,7 +1974,7 @@ _widgets: postForm: "Finestra di pubblicazione" slideshow: "Diapositive" button: "Pulsante" - onlineUsers: "Persone attive adesso" + onlineUsers: "Persone online" jobQueue: "Coda di lavoro" serverMetric: "Statistiche server" aiscript: "Console AiScript" @@ -2224,7 +1984,7 @@ _widgets: _userList: chooseList: "Seleziona una lista" clicker: "Cliccaggio" - birthdayFollowings: "Compleanni del giorno" + birthdayFollowings: "Chi nacque oggi" _cw: hide: "Nascondere" show: "Continua la lettura..." @@ -2288,14 +2048,10 @@ _profile: 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." avatarDecorationMax: "Puoi aggiungere fino a {max} decorazioni." - followedMessage: "Messaggio, quando qualcuno ti segue" - followedMessageDescription: "Puoi impostare un breve messaggio da mostrare agli altri profili quando ti seguono." - followedMessageDescriptionForLockedAccount: "Quando approvi una richiesta di follow, verrà visualizzato questo testo." _exportOrImport: allNotes: "Tutte le note" favoritedNotes: "Note preferite" - clips: "Clip" - followingList: "Following" + followingList: "Follow" muteList: "Elenco profili silenziati" blockingList: "Elenco profili bloccati" userLists: "Liste" @@ -2348,7 +2104,6 @@ _play: title: "Titolo" script: "Script" summary: "Descrizione" - visibilityDescription: "Impostarlo su privato significa che non verrà visualizzato sul tuo profilo, ma chiunque ha l'URL potrà comunque accedervi." _pages: newPage: "Crea pagina" editPage: "Modifica pagina" @@ -2383,7 +2138,6 @@ _pages: eyeCatchingImageSet: "Imposta un'immagine attraente" eyeCatchingImageRemove: "Elimina immagine attraente" chooseBlock: "Aggiungi blocco" - enterSectionTitle: "Inserisci il titolo della sezione" selectType: "Seleziona tipo" contentBlocks: "Contenuto" inputBlocks: "Blocchi di input" @@ -2394,8 +2148,6 @@ _pages: section: "Sezione" image: "Immagini" button: "Pulsante" - dynamic: "Riquadri dinamici" - dynamicDescription: "Questo riquadro è obsoleto. Utilizza {play} da ora in poi." note: "Nota integrata" _note: id: "ID nota" @@ -2411,30 +2163,25 @@ _notification: youGotReply: "{name} ti ha risposto" youGotQuote: "{name} ha citato la tua Nota e ha detto" youRenoted: "{name} ha rinotato" - youWereFollowed: "Follower aggiuntivo" + youWereFollowed: "Adesso ti segue" 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}" - roleAssigned: "Ruolo assegnato" emptyPushNotificationMessage: "Le notifiche push sono state aggiornate." achievementEarned: "Obiettivo raggiunto" - testNotification: "Provare la notifica" - checkNotificationBehavior: "Provare il comportamento della notifica" + testNotification: "Prova la notifica" + checkNotificationBehavior: "Prova il comportamento della notifica" sendTestNotification: "Spedisci una notifica di prova" notificationWillBeDisplayedLikeThis: "La notifica apparirà così" reactedBySomeUsers: "{n} reazioni" - likedBySomeUsers: "{n} apprezzamenti" renotedBySomeUsers: "{n} Rinota" - followedBySomeUsers: "{n} follower" - flushNotification: "Azzera le notifiche" - exportOfXCompleted: "Abbiamo completato l'esportazione di {x}" - login: "Autenticazione avvenuta" + followedBySomeUsers: "{n} nuovi follower" _types: all: "Tutto" note: "Nuove Note" - follow: "Follower" + follow: "Nuovi profili follower" mention: "Menzioni" reply: "Risposte" renote: "Rinota" @@ -2443,21 +2190,16 @@ _notification: pollEnded: "Sondaggio chiuso." receiveFollowRequest: "Richiesta di follow ricevuta" followRequestAccepted: "Richiesta di follow accettata" - roleAssigned: "Ruolo concesso" achievementEarned: "Risultato raggiunto" - exportCompleted: "Esportazione completata" - login: "Accedi" - test: "Prova la notifica" app: "Notifiche da applicazioni" _actions: - followBack: "Following ricambiato" + followBack: "Segui" reply: "Rispondi" renote: "Rinota" _deck: alwaysShowMainColumn: "Mostra sempre la colonna principale" columnAlign: "Allineare colonne" addColumn: "Aggiungi colonna" - newNoteNotificationSettings: "Preferenze per le notifiche di nuove Note" configureColumn: "Impostazioni colonna" swapLeft: "Sposta a sinistra" swapRight: "Sposta a destra" @@ -2486,8 +2228,8 @@ _deck: direct: "Note Dirette" roleTimeline: "Timeline Ruolo" _dialog: - charactersExceeded: "Hai superato il limite di {max} caratteri! ({current})" - charactersBelow: "Sei al di sotto del minimo di {min} caratteri! ({current})" + charactersExceeded: "Hai superato il limite di {max} caratteri! ({corrente})" + charactersBelow: "Sei al di sotto del minimo di {min} caratteri! ({corrente})" _disabledTimeline: title: "Timeline disabilitata" description: "Il ruolo in cui sei non ti permette di leggere questa timeline" @@ -2496,42 +2238,18 @@ _drivecleaner: orderByCreatedAtAsc: "Dal più vecchio al più recente" _webhookSettings: createWebhook: "Creazione Webhook" - modifyWebhook: "Modifica Webhook" name: "Nome" secret: "Segreto" - trigger: "Trigger" + events: "Quando eseguire il Webhook" active: "Attivo" _events: - follow: "Quando aggiungi Following" + follow: "Quando segui un profilo" followed: "Quando ti segue un profilo" note: "Quando pubblichi una Nota" reply: "Quando rispondono ad una Nota" renote: "Quando la Nota è Rinotata" reaction: "Quando ricevo una reazione" mention: "Quando mi menzionano" - _systemEvents: - abuseReport: "Quando arriva una segnalazione" - abuseReportResolved: "Quando una segnalazione è risolta" - userCreated: "Quando viene creato un profilo" - inactiveModeratorsWarning: "Quando un profilo moderatore rimane inattivo per un determinato periodo" - inactiveModeratorsInvitationOnlyChanged: "Quando la moderazione è rimasta inattiva per un determinato periodo e il sistema è cambiato in modalità \"solo inviti\"" - deleteConfirm: "Vuoi davvero eliminare il Webhook?" - testRemarks: "Clicca il bottone a destra dell'interruttore, per provare l'invio di un webhook con dati fittizi." -_abuseReport: - _notificationRecipient: - createRecipient: "Aggiungi destinatario della segnalazione" - modifyRecipient: "Modifica destinatario della segnalazione" - recipientType: "Tipo di notifica" - _recipientType: - mail: "Email" - webhook: "Webhook" - _captions: - mail: "Quando ricevi un abuso, notifica l'amministrazione via email" - webhook: "Spedire una notifica al SystemWebhook specificato (sia quando si riceve una segnalazione, che quando viene risolta)" - keywords: "Parole chiave" - notifiedUser: "Profili da notificare" - notifiedWebhook: "Webhook da usare" - deleteConfirm: "Vuoi davvero rimuovere il destinatario della notifica?" _moderationLogTypes: createRole: "Ruolo creato" deleteRole: "Ruolo eliminato" @@ -2556,12 +2274,9 @@ _moderationLogTypes: resetPassword: "Password azzerata" suspendRemoteInstance: "Istanza remota sospesa" unsuspendRemoteInstance: "Istanza remota riattivata" - updateRemoteInstanceNote: "Aggiornamento del promemoria di moderazione per il server remoto" markSensitiveDriveFile: "File nel Drive segnato come esplicito" unmarkSensitiveDriveFile: "File nel Drive segnato come non esplicito" resolveAbuseReport: "Segnalazione risolta" - forwardAbuseReport: "Segnalazione inoltrata" - updateAbuseReportNote: "Ha aggiornato la segnalazione" createInvitation: "Genera codice di invito" createAd: "Banner creato" deleteAd: "Banner eliminato" @@ -2571,16 +2286,6 @@ _moderationLogTypes: deleteAvatarDecoration: "Eliminazione decorazione della foto profilo" unsetUserAvatar: "Rimossa foto profilo" unsetUserBanner: "Rimossa intestazione profilo" - createSystemWebhook: "Crea un SystemWebhook" - updateSystemWebhook: "Modifica SystemWebhook" - deleteSystemWebhook: "Elimina SystemWebhook" - createAbuseReportNotificationRecipient: "Crea destinatario per le notifiche di segnalazioni" - updateAbuseReportNotificationRecipient: "Aggiorna destinatario notifiche di segnalazioni" - deleteAbuseReportNotificationRecipient: "Elimina destinatario notifiche di segnalazioni" - deleteAccount: "Quando viene eliminato un profilo" - deletePage: "Pagina eliminata" - deleteFlash: "Play eliminato" - deleteGalleryPost: "Eliminazione pubblicazione nella Galleria" _fileViewer: title: "Dettagli del file" type: "Tipo di file" @@ -2643,97 +2348,3 @@ _dataSaver: _code: title: "Codice evidenziato" description: "Impedire che il codice sorgente sia automaticamente evidenziato. Evidenziare il codice richiede il caricamento di un file per ogni linguaggio. Puoi evidenziare soltanto il codice che intendi leggere e ridurre il traffico inutilizzato." -_hemisphere: - N: "Emisfero boreale" - S: "Emisfero australe" - caption: "Utile per alcune impostazioni del client, per determinare la stagione." -_reversi: - reversi: "Reversi" - gameSettings: "Impostazioni di gioco" - chooseBoard: "Segli la tavola" - blackOrWhite: "Neri / Bianchi" - blackIs: "{name} muove i Neri" - rules: "Regole del gioco" - thisGameIsStartedSoon: "Il gioco sta per iniziare" - waitingForOther: "Attendere l'avversario" - waitingForMe: "Ti stanno aspettando" - waitingBoth: "Preparatevi" - ready: "Pronti" - cancelReady: "Riprendere la preparazione" - opponentTurn: "Turno avversario" - myTurn: "Tocca a te" - turnOf: "Tocca a {name}" - pastTurnOf: "Turno di {name}" - surrender: "Mi arrendo" - surrendered: "Ha ceduto" - timeout: "Tempo scaduto" - drawn: "Pareggio" - won: "Ha vinto {name}" - black: "Neri" - white: "Bianchi" - total: "Totale" - turnCount: "Turno N. {count}" - myGames: "Le mie sfide" - allGames: "Tutte le sfide" - ended: "Conclusione" - playing: "In gioco" - isLlotheo: "Vince chi ha meno pietre (Roseo)" - loopedMap: "Mappa ricorsiva" - canPutEverywhere: "Modalità che può essere posizionata ovunque" - timeLimitForEachTurn: "Tempo limite per turno" - freeMatch: "Sfida libera" - lookingForPlayer: "Alla ricerca di un avversario" - gameCanceled: "Sfida cancellata" - shareToTlTheGameWhenStart: "Pubblica l'inizio della partita sulla tua Timeline" - iStartedAGame: "Inizia la sfida! #MisskeyReversi" - opponentHasSettingsChanged: "L'avversario ha cambiato configurazione" - allowIrregularRules: "Regole inconsuete (completamente libere)" - disallowIrregularRules: "Impedire le regole inconsuete" - showBoardLabels: "Mostra le coordinate del gioco" - useAvatarAsStone: "Immagini profilo come pedine" -_offlineScreen: - title: "Scollegato. Impossibile connettersi al server" - header: "Impossibile connettersi al server" -_urlPreviewSetting: - title: "Impostazioni per l'anteprima delle URL" - enable: "Attiva l'anteprima delle URL" - timeout: "Timeout dell'anteprima in millisecondi" - timeoutDescription: "Impegna al massimo il tempo indicato, altrimenti ignora l'anteprima" - maximumContentLength: "Grandezza del contenuto (Content-Length in byte)" - maximumContentLengthDescription: "Se la grandezza supera il valore, l'anteprima verrà ignorata." - requireContentLength: "Genenerare l'anteprima solo quando è definito Content-Length" - requireContentLengthDescription: "In assenza di questo parametro dal server remoto, l'anteprima verrà ignorata." - userAgent: "User-Agent" - userAgentDescription: "Definire con quale User-Agent si intende identificarsi durante l'acquisizione di un'anteprima. Se è vuoto, useremo il valore predefinito." - summaryProxy: "Endpoint proxy che genera l'anteprima" - summaryProxyDescription: "Genera anteprime utilizzando un proxy Summaly anziché Misskey." - summaryProxyDescription2: "I parametri sono collegano al proxy come stringa query. Se il proxy non li supporta, verranno ignorati." -_mediaControls: - pip: "Sovraimpressione" - playbackRate: "Velocità di riproduzione" - loop: "Ripetizione infinita" -_contextMenu: - title: "Menu contestuale" - app: "Applicazione" - appWithShift: "Applicazione Shift+Tasto" - native: "Interfaccia utente del browser" -_embedCodeGen: - title: "Personalizza il codice di incorporamento" - header: "Mostra la testata" - autoload: "Carica automaticamente di più (sconsigliato)" - maxHeight: "Altezza massima" - maxHeightDescription: "Specifica un valore per evitare che continui a crescere verticalmente. Il valore 0 disabilita il limite d'altezza." - maxHeightWarn: "L'altezza massima è disabilitata (0). Se l'effetto è indesiderato, prova a impostare l'altezza massima a un valore specifico." - previewIsNotActual: "Poiché supera l'intervallo che può essere visualizzato in anteprima, la visualizzazione vera e propria sarà diversa quando effettivamente incorporata." - rounded: "Bordo arrotondato" - border: "Aggiungi un bordo al contenitore" - applyToPreview: "Applica all'anteprima" - generateCode: "Crea il codice di incorporamento" - codeGenerated: "Codice generato" - codeGeneratedDescription: "Incolla il codice appena generato sul tuo sito web." -_selfXssPrevention: - warning: "Avviso" - title: "\"Incolla qualcosa su questa schermata\" è tutta una truffa." - description1: "Incollando qualcosa qui, malintenzionati potrebbero prendere il controllo del tuo profilo o rubare i tuoi dati personali." - description2: "Se non sai esattamente cosa stai facendo, %c smetti subito e chiudi questa finestra." - description3: "Per favore, controlla questo collegamento per avere maggiori dettagli. {link}" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 5d8e1a5e72..b1838fa5ab 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -8,9 +8,6 @@ search: "検索" notifications: "通知" username: "ユーザー名" password: "パスワード" -initialPasswordForSetup: "初期設定開始用パスワード" -initialPasswordIsIncorrect: "初期設定開始用のパスワードが違います。" -initialPasswordForSetupDescription: "Misskeyを自分でインストールした場合は、設定ファイルに入力したパスワードを使用してください。\nMisskeyのホスティングサービスなどを使用している場合は、提供されたパスワードを使用してください。\nパスワードを設定していない場合は、空欄にしたまま続行してください。" forgotPassword: "パスワードを忘れた" fetchingAsApObject: "連合に照会中" ok: "OK" @@ -63,7 +60,6 @@ copyFileId: "ファイルIDをコピー" copyFolderId: "フォルダーIDをコピー" copyProfileUrl: "プロフィールURLをコピー" searchUser: "ユーザーを検索" -searchThisUsersNotes: "ユーザーのノートを検索" reply: "返信" loadMore: "もっと見る" showMore: "もっと見る" @@ -112,14 +108,11 @@ enterEmoji: "絵文字を入力" renote: "リノート" unrenote: "リノート解除" renoted: "リノートしました。" -renotedToX: "{name} にリノートしました。" cantRenote: "この投稿はリノートできません。" cantReRenote: "リノートをリノートすることはできません。" quote: "引用" inChannelRenote: "チャンネル内リノート" inChannelQuote: "チャンネル内引用" -renoteToChannel: "チャンネルにリノート" -renoteToOtherChannel: "他のチャンネルにリノート" pinnedNote: "ピン留めされたノート" pinned: "ピン留め" you: "あなた" @@ -137,7 +130,6 @@ overwriteFromPinnedEmojis: "全般設定から上書きする" reactionSettingDescription2: "ドラッグして並び替え、クリックして削除、+を押して追加します。" rememberNoteVisibility: "公開範囲を記憶する" attachCancel: "添付取り消し" -deleteFile: "ファイルを削除" markAsSensitive: "センシティブとして設定" unmarkAsSensitive: "センシティブを解除する" enterFileName: "ファイル名を入力" @@ -158,7 +150,6 @@ editList: "リストを編集" selectChannel: "チャンネルを選択" selectAntenna: "アンテナを選択" editAntenna: "アンテナを編集" -createAntenna: "アンテナを作成" selectWidget: "ウィジェットを選択" editWidgets: "ウィジェットを編集" editWidgetsExit: "編集を終了" @@ -185,10 +176,6 @@ addAccount: "アカウントを追加" reloadAccountsList: "アカウントリストの情報を更新" loginFailed: "ログインに失敗しました" showOnRemote: "リモートで表示" -continueOnRemote: "リモートで続行" -chooseServerOnMisskeyHub: "Misskey Hubからサーバーを選択" -specifyServerHost: "サーバーのドメインを直接指定" -inputHostName: "ドメインを入力してください" general: "全般" wallpaper: "壁紙" setWallpaper: "壁紙を設定" @@ -199,7 +186,6 @@ followConfirm: "{name}をフォローしますか?" proxyAccount: "プロキシアカウント" proxyAccountDescription: "プロキシアカウントは、特定の条件下でユーザーのリモートフォローを代行するアカウントです。例えば、ユーザーがリモートユーザーをリストに入れたとき、リストに入れられたユーザーを誰もフォローしていないとアクティビティがサーバーに配達されないため、代わりにプロキシアカウントがフォローするようにします。" host: "ホスト" -selectSelf: "自分を選択" selectUser: "ユーザーを選択" recipient: "宛先" annotation: "注釈" @@ -215,7 +201,6 @@ perDay: "1日ごと" stopActivityDelivery: "アクティビティの配送を停止" blockThisInstance: "このサーバーをブロック" silenceThisInstance: "サーバーをサイレンス" -mediaSilenceThisInstance: "サーバーをメディアサイレンス" operations: "操作" software: "ソフトウェア" version: "バージョン" @@ -236,11 +221,7 @@ clearCachedFilesConfirm: "キャッシュされたリモートファイルをす blockedInstances: "ブロックしたサーバー" blockedInstancesDescription: "ブロックしたいサーバーのホストを改行で区切って設定します。ブロックされたサーバーは、このインスタンスとやり取りできなくなります。" silencedInstances: "サイレンスしたサーバー" -silencedInstancesDescription: "サイレンスしたいサーバーのホストを改行で区切って設定します。サイレンスされたサーバーに所属するアカウントはすべて「サイレンス」として扱われ、フォローがすべてリクエストになります。ブロックしたインスタンスには影響しません。" -mediaSilencedInstances: "メディアサイレンスしたサーバー" -mediaSilencedInstancesDescription: "メディアサイレンスしたいサーバーのホストを改行で区切って設定します。メディアサイレンスされたサーバーに所属するアカウントによるファイルはすべてセンシティブとして扱われ、カスタム絵文字が使用できないようになります。ブロックしたインスタンスには影響しません。" -federationAllowedHosts: "連合を許可するサーバー" -federationAllowedHostsDescription: "連合を許可するサーバーのホストを改行で区切って設定します。" +silencedInstancesDescription: "サイレンスしたいサーバーのホストを改行で区切って設定します。サイレンスされたサーバーに所属するアカウントはすべて「サイレンス」として扱われ、フォローがすべてリクエストになり、フォロワーでないローカルアカウントにはメンションできなくなります。ブロックしたインスタンスには影響しません。" muteAndBlock: "ミュートとブロック" mutedUsers: "ミュートしたユーザー" blockedUsers: "ブロックしたユーザー" @@ -331,7 +312,6 @@ selectFile: "ファイルを選択" selectFiles: "ファイルを選択" selectFolder: "フォルダーを選択" selectFolders: "フォルダーを選択" -fileNotSelected: "ファイルが選択されていません" renameFile: "ファイル名を変更" folderName: "フォルダー名" createFolder: "フォルダーを作成" @@ -339,7 +319,6 @@ renameFolder: "フォルダー名を変更" deleteFolder: "フォルダーを削除" folder: "フォルダー" addFile: "ファイルを追加" -showFile: "ファイルを表示" emptyDrive: "ドライブは空です" emptyFolder: "フォルダーは空です" unableToDelete: "削除できません" @@ -400,11 +379,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "hCaptchaを有効にする" hcaptchaSiteKey: "サイトキー" hcaptchaSecretKey: "シークレットキー" -mcaptcha: "mCaptcha" -enableMcaptcha: "mCaptchaを有効にする" -mcaptchaSiteKey: "サイトキー" -mcaptchaSecretKey: "シークレットキー" -mcaptchaInstanceUrl: "mCaptchaのインスタンスのURL" recaptcha: "reCAPTCHA" enableRecaptcha: "reCAPTCHAを有効にする" recaptchaSiteKey: "サイトキー" @@ -420,7 +394,6 @@ name: "名前" antennaSource: "受信ソース" antennaKeywords: "受信キーワード" antennaExcludeKeywords: "除外キーワード" -antennaExcludeBots: "Botアカウントを除外" antennaKeywordsDescription: "スペースで区切るとAND指定になり、改行で区切るとOR指定になります" notifyAntenna: "新しいノートを通知する" withFileAntenna: "ファイルが添付されたノートのみ" @@ -454,7 +427,6 @@ totpDescription: "認証アプリを使ってワンタイムパスワードを moderator: "モデレーター" moderation: "モデレーション" moderationNote: "モデレーションノート" -moderationNoteDescription: "モデレーター間でだけ共有されるメモを記入することができます。" addModerationNote: "モデレーションノートを追加する" moderationLogs: "モデログ" nUsersMentioned: "{n}人が投稿" @@ -489,12 +461,10 @@ retype: "再入力" noteOf: "{user}のノート" quoteAttached: "引用付き" quoteQuestion: "引用として添付しますか?" -attachAsFileQuestion: "クリップボードのテキストが長いです。テキストファイルとして添付しますか?" noMessagesYet: "まだチャットはありません" newMessageExists: "新しいメッセージがあります" onlyOneFileCanBeAttached: "メッセージに添付できるファイルはひとつです" -signinRequired: "続行する前に、登録またはログインが必要です" -signinOrContinueOnRemote: "続行するには、お使いのサーバーに移動するか、このサーバーに登録・ログインする必要があります" +signinRequired: "続行する前に、サインアップまたはサインインが必要です" invitations: "招待" invitationCode: "招待コード" checking: "確認しています" @@ -516,12 +486,8 @@ uiLanguage: "UIの表示言語" aboutX: "{x}について" emojiStyle: "絵文字のスタイル" native: "ネイティブ" -menuStyle: "メニューのスタイル" -style: "スタイル" -drawer: "ドロワー" -popup: "ポップアップ" +disableDrawer: "メニューをドロワーで表示しない" showNoteActionsOnlyHover: "ノートのアクションをホバー時のみ表示する" -showReactionsCount: "ノートのリアクション数を表示する" noHistory: "履歴はありません" signinHistory: "ログイン履歴" enableAdvancedMfm: "高度なMFMを有効にする" @@ -602,8 +568,6 @@ ascendingOrder: "昇順" descendingOrder: "降順" scratchpad: "スクラッチパッド" scratchpadDescription: "スクラッチパッドは、AiScriptの実験環境を提供します。Misskeyと対話するコードの記述、実行、結果の確認ができます。" -uiInspector: "UIインスペクター" -uiInspectorDescription: "メモリ上に存在しているUIコンポーネントのインスタンスの一覧を見ることができます。UIコンポーネントはUi:C:系関数により生成されます。" output: "出力" script: "スクリプト" disablePagesScript: "Pagesのスクリプトを無効にする" @@ -642,6 +606,7 @@ useCw: "内容を隠す" enablePlayer: "プレイヤーを開く" disablePlayer: "プレイヤーを閉じる" expandTweet: "ポストを展開する" +expandNote: "ノートを展開する" themeEditor: "テーマエディター" description: "説明" describeFile: "キャプションを付ける" @@ -662,7 +627,6 @@ medium: "中" small: "小" generateAccessToken: "アクセストークンの発行" permission: "権限" -adminPermission: "管理者権限" enableAll: "全て有効にする" disableAll: "全て無効にする" tokenRequested: "アカウントへのアクセス許可" @@ -706,7 +670,6 @@ useGlobalSettingDesc: "オンにすると、アカウントの通知設定が使 other: "その他" regenerateLoginToken: "ログイントークンを再生成" regenerateLoginTokenDescription: "ログインに使用される内部トークンを再生成します。通常この操作を行う必要はありません。再生成すると、全てのデバイスでログアウトされます。" -theKeywordWhenSearchingForCustomEmoji: "カスタム絵文字を検索する時のキーワードになります。" setMultipleBySeparatingWithSpace: "スペースで区切って複数設定できます。" fileIdOrUrl: "ファイルIDまたはURL" behavior: "動作" @@ -715,12 +678,15 @@ abuseReports: "通報" reportAbuse: "通報" reportAbuseRenote: "リノートを通報" reportAbuseOf: "{name}を通報する" -fillAbuseReportDescription: "通報理由の詳細を記入してください。対象のノートやページなどがある場合はそのURLも記入してください。" +fillAbuseReportDescription: "通報理由の詳細を記入してください。対象のノートがある場合はそのURLも記入してください。" abuseReported: "内容が送信されました。ご報告ありがとうございました。" reporter: "通報者" reporteeOrigin: "通報先" reporterOrigin: "通報元" +forwardReport: "リモートサーバーに通報を転送する" +forwardReportIsAnonymous: "リモートサーバーからはあなたの情報は見れず、匿名のシステムアカウントとして表示されます。" send: "送信" +abuseMarkAsResolved: "対応済みにする" openInNewTab: "新しいタブで開く" openInSideView: "サイドビューで開く" defaultNavigationBehaviour: "デフォルトのナビゲーション" @@ -785,7 +751,7 @@ left: "左" center: "中央" wide: "広い" narrow: "狭い" -reloadToApplySetting: "設定はページリロード後に反映されます。" +reloadToApplySetting: "設定はページリロード後に反映されます。今すぐリロードしますか?" needReloadToApply: "反映には再起動が必要です。" showTitlebar: "タイトルバーを表示する" clearCache: "キャッシュをクリア" @@ -857,7 +823,6 @@ administration: "管理" accounts: "アカウント" switch: "切り替え" noMaintainerInformationWarning: "管理者情報が設定されていません。" -noInquiryUrlWarning: "問い合わせ先URLが設定されていません。" noBotProtectionWarning: "Botプロテクションが設定されていません。" configure: "設定する" postToGallery: "ギャラリーへ投稿" @@ -922,7 +887,6 @@ followersVisibility: "フォロワーの公開範囲" continueThread: "さらにスレッドを見る" deleteAccountConfirm: "アカウントが削除されます。よろしいですか?" incorrectPassword: "パスワードが間違っています。" -incorrectTotp: "ワンタイムパスワードが間違っているか、期限切れになっています。" voteConfirm: "「{choice}」に投票しますか?" hide: "隠す" useDrawerReactionPickerForMobile: "モバイルデバイスのときドロワーで表示" @@ -947,9 +911,6 @@ oneHour: "1時間" oneDay: "1日" oneWeek: "1週間" oneMonth: "1ヶ月" -threeMonths: "3ヶ月" -oneYear: "1年" -threeDays: "3日" reflectMayTakeTime: "反映されるまで時間がかかる場合があります。" failedToFetchAccountInformation: "アカウント情報の取得に失敗しました" rateLimitExceeded: "レート制限を超えました" @@ -1023,7 +984,6 @@ neverShow: "今後表示しない" remindMeLater: "また後で" didYouLikeMisskey: "Misskeyを気に入っていただけましたか?" pleaseDonate: "Misskeyは{host}が使用している無料のソフトウェアです。これからも開発を続けられるように、ぜひ寄付をお願いします!" -correspondingSourceIsAvailable: "対応するソースコードは{anchor}から利用可能です。" roles: "ロール" role: "ロール" noRole: "ロールはありません" @@ -1050,8 +1010,7 @@ thisPostMayBeAnnoying: "この投稿は迷惑になる可能性があります thisPostMayBeAnnoyingHome: "ホームに投稿" thisPostMayBeAnnoyingCancel: "やめる" thisPostMayBeAnnoyingIgnore: "このまま投稿" -collapseRenotes: "リノートのスマート省略" -collapseRenotesDescription: "リアクションやリノートをしたことがあるノートをたたんで表示します。" +collapseRenotes: "見たことのあるリノートを省略して表示" internalServerError: "サーバー内部エラー" internalServerErrorDescription: "サーバー内部で予期しないエラーが発生しました。" copyErrorInfo: "エラー情報をコピー" @@ -1075,9 +1034,6 @@ resetPasswordConfirm: "パスワードリセットしますか?" sensitiveWords: "センシティブワード" sensitiveWordsDescription: "設定したワードが含まれるノートの公開範囲をホームにします。改行で区切って複数設定できます。" sensitiveWordsDescription2: "スペースで区切るとAND指定になり、キーワードをスラッシュで囲むと正規表現になります。" -prohibitedWords: "禁止ワード" -prohibitedWordsDescription: "設定したワードが含まれるノートを投稿しようとした際、エラーとなるようにします。改行で区切って複数設定できます。" -prohibitedWordsDescription2: "スペースで区切るとAND指定になり、キーワードをスラッシュで囲むと正規表現になります。" hiddenTags: "非表示ハッシュタグ" hiddenTagsDescription: "設定したタグをトレンドに表示させないようにします。改行で区切って複数設定できます。" notesSearchNotAvailable: "ノート検索は利用できません。" @@ -1090,15 +1046,12 @@ retryAllQueuesConfirmTitle: "今すぐ再試行しますか?" retryAllQueuesConfirmText: "一時的にサーバーの負荷が増大することがあります。" enableChartsForRemoteUser: "リモートユーザーのチャートを生成" enableChartsForFederatedInstances: "リモートサーバーのチャートを生成" -enableStatsForFederatedInstances: "リモートサーバーの情報を取得" showClipButtonInNoteFooter: "ノートのアクションにクリップを追加" reactionsDisplaySize: "リアクションの表示サイズ" limitWidthOfReaction: "リアクションの最大横幅を制限し、縮小して表示する" noteIdOrUrl: "ノートIDまたはURL" video: "動画" videos: "動画" -audio: "音声" -audioFiles: "音声" dataSaver: "データセーバー" accountMigration: "アカウントの移行" accountMoved: "このユーザーは新しいアカウントに移行しました:" @@ -1126,8 +1079,6 @@ preservedUsernames: "予約ユーザー名" preservedUsernamesDescription: "予約するユーザー名を改行で列挙します。ここで指定されたユーザー名はアカウント作成時に使えなくなりますが、管理者によるアカウント作成時はこの制限を受けません。また、既に存在するアカウントも影響を受けません。" createNoteFromTheFile: "このファイルからノートを作成" archive: "アーカイブ" -archived: "アーカイブ済み" -unarchive: "アーカイブ解除" channelArchiveConfirmTitle: "{name}をアーカイブしますか?" channelArchiveConfirmDescription: "アーカイブすると、チャンネル一覧や検索結果に表示されなくなり、新たな書き込みもできなくなります。" thisChannelArchived: "このチャンネルはアーカイブされています。" @@ -1138,9 +1089,6 @@ preventAiLearning: "生成AIによる学習を拒否" preventAiLearningDescription: "外部の文章生成AIや画像生成AIに対して、投稿したノートや画像などのコンテンツを学習の対象にしないように要求します。これはnoaiフラグをHTMLレスポンスに含めることによって実現されますが、この要求に従うかはそのAI次第であるため、学習を完全に防止するものではありません。" options: "オプション" specifyUser: "ユーザー指定" -lookupConfirm: "照会しますか?" -openTagPageConfirm: "ハッシュタグのページを開きますか?" -specifyHost: "ホスト指定" failedToPreviewUrl: "プレビューできません" update: "更新" rolesThatCanBeUsedThisEmojiAsReaction: "リアクションとして使えるロール" @@ -1199,7 +1147,6 @@ showRenotes: "リノートを表示" edited: "編集済み" notificationRecieveConfig: "通知の受信設定" mutualFollow: "相互フォロー" -followingOrFollower: "フォロー中またはフォロワー" fileAttachedOnly: "ファイル付きのみ" showRepliesToOthersInTimeline: "TLに他の人への返信を含める" hideRepliesToOthersInTimeline: "TLに他の人への返信を含めない" @@ -1208,13 +1155,6 @@ hideRepliesToOthersInTimelineAll: "TLに現在フォロー中の人全員の返 confirmShowRepliesAll: "この操作は元に戻せません。本当にTLに現在フォロー中の人全員の返信を含めるようにしますか?" confirmHideRepliesAll: "この操作は元に戻せません。本当にTLに現在フォロー中の人全員の返信を含めないようにしますか?" externalServices: "外部サービス" -sourceCode: "ソースコード" -sourceCodeIsNotYetProvided: "ソースコードはまだ提供されていません。この問題の修正について管理者に問い合わせてください。" -repositoryUrl: "リポジトリURL" -repositoryUrlDescription: "ソースコードが公開されているリポジトリがある場合、そのURLを記入します。Misskeyを現状のまま(ソースコードにいかなる変更も加えずに)使用している場合は https://github.com/misskey-dev/misskey と記入します。" -repositoryUrlOrTarballRequired: "リポジトリを公開していない場合、代わりにtarballを提供する必要があります。詳細は.config/example.ymlを参照してください。" -feedback: "フィードバック" -feedbackUrl: "フィードバックURL" impressum: "運営者情報" impressumUrl: "運営者情報URL" impressumDescription: "ドイツなどの一部の国と地域では表示が義務付けられています(Impressum)。" @@ -1244,109 +1184,6 @@ seasonalScreenEffect: "季節に応じた画面の演出" decorate: "デコる" addMfmFunction: "装飾を追加" enableQuickAddMfmFunction: "高度なMFMのピッカーを表示する" -bubbleGame: "バブルゲーム" -sfx: "効果音" -soundWillBePlayed: "サウンドが再生されます" -showReplay: "リプレイを見る" -replay: "リプレイ" -replaying: "リプレイ中" -endReplay: "リプレイを終了" -copyReplayData: "リプレイデータをコピー" -ranking: "ランキング" -lastNDays: "直近{n}日" -backToTitle: "タイトルへ" -hemisphere: "お住まいの地域" -withSensitive: "センシティブなファイルを含むノートを表示" -userSaysSomethingSensitive: "{name}のセンシティブなファイルを含む投稿" -enableHorizontalSwipe: "スワイプしてタブを切り替える" -loading: "読み込み中" -surrender: "やめる" -gameRetry: "リトライ" -notUsePleaseLeaveBlank: "使用しない場合は空欄にしてください" -useTotp: "ワンタイムパスワードを使う" -useBackupCode: "バックアップコードを使う" -launchApp: "アプリを起動" -useNativeUIForVideoAudioPlayer: "動画・音声の再生にブラウザのUIを使用する" -keepOriginalFilename: "オリジナルのファイル名を保持" -keepOriginalFilenameDescription: "この設定をオフにすると、アップロード時にファイル名が自動でランダム文字列に置き換えられます。" -noDescription: "説明文はありません" -alwaysConfirmFollow: "フォローの際常に確認する" -inquiry: "お問い合わせ" -tryAgain: "もう一度お試しください。" -confirmWhenRevealingSensitiveMedia: "センシティブなメディアを表示するとき確認する" -sensitiveMediaRevealConfirm: "センシティブなメディアです。表示しますか?" -createdLists: "作成したリスト" -createdAntennas: "作成したアンテナ" -fromX: "{x}から" -genEmbedCode: "埋め込みコードを生成" -noteOfThisUser: "このユーザーのノート一覧" -clipNoteLimitExceeded: "これ以上このクリップにノートを追加できません。" -performance: "パフォーマンス" -modified: "変更あり" -discard: "破棄" -thereAreNChanges: "{n}件の変更があります" -signinWithPasskey: "パスキーでログイン" -unknownWebAuthnKey: "登録されていないパスキーです。" -passkeyVerificationFailed: "パスキーの検証に失敗しました。" -passkeyVerificationSucceededButPasswordlessLoginDisabled: "パスキーの検証に成功しましたが、パスワードレスログインが無効になっています。" -messageToFollower: "フォロワーへのメッセージ" -target: "対象" -testCaptchaWarning: "CAPTCHAのテストを目的とした機能です。本番環境で使用しないでください。" -prohibitedWordsForNameOfUser: "禁止ワード(ユーザーの名前)" -prohibitedWordsForNameOfUserDescription: "このリストに含まれる文字列がユーザーの名前に含まれる場合、ユーザーの名前の変更を拒否します。モデレーター権限を持つユーザーはこの制限の影響を受けません。" -yourNameContainsProhibitedWords: "変更しようとした名前に禁止された文字列が含まれています" -yourNameContainsProhibitedWordsDescription: "名前に禁止されている文字列が含まれています。この名前を使用したい場合は、サーバー管理者にお問い合わせください。" -thisContentsAreMarkedAsSigninRequiredByAuthor: "投稿者により、表示にはログインが必要と設定されています" -lockdown: "ロックダウン" -pleaseSelectAccount: "アカウントを選択してください" -availableRoles: "利用可能なロール" - -_accountSettings: - requireSigninToViewContents: "コンテンツの表示にログインを必須にする" - requireSigninToViewContentsDescription1: "あなたが作成した全てのノートなどのコンテンツを表示するのにログインを必須にします。クローラーに情報が収集されるのを防ぐ効果が期待できます。" - requireSigninToViewContentsDescription2: "URLプレビュー(OGP)、Webページへの埋め込み、ノートの引用に対応していないサーバーからの表示も不可になります。" - requireSigninToViewContentsDescription3: "リモートサーバーに連合されたコンテンツでは、これらの制限が適用されない場合があります。" - makeNotesFollowersOnlyBefore: "過去のノートをフォロワーのみ表示可能にする" - makeNotesFollowersOnlyBeforeDescription: "この機能が有効になっている間、設定された日時より過去、または設定された時間を経過しているノートがフォロワーのみ表示可能になります。無効に戻すと、ノートの公開状態も元に戻ります。" - makeNotesHiddenBefore: "過去のノートを非公開化する" - makeNotesHiddenBeforeDescription: "この機能が有効になっている間、設定された日時より過去、または設定された時間を経過しているノートが自分のみ表示可能(非公開化)になります。無効に戻すと、ノートの公開状態も元に戻ります。" - mayNotEffectForFederatedNotes: "リモートサーバーに連合されたノートには効果が及ばない場合があります。" - notesHavePassedSpecifiedPeriod: "指定した時間を経過しているノート" - notesOlderThanSpecifiedDateAndTime: "指定した日時より前のノート" - -_abuseUserReport: - forward: "転送" - forwardDescription: "匿名のシステムアカウントとして、リモートサーバーに通報を転送します。" - resolve: "解決" - accept: "是認" - reject: "否認" - resolveTutorial: "内容が正当である通報に対応した場合は「是認」を選択し、肯定的にケースが解決されたことをマークします。\n内容が正当でない通報の場合は「否認」を選択し、否定的にケースが解決されたことをマークします。" - -_delivery: - status: "配信状態" - stop: "配信停止" - resume: "配信再開" - _type: - none: "配信中" - manuallySuspended: "手動停止中" - goneSuspended: "サーバー削除のため停止中" - autoSuspendedForNotResponding: "サーバー応答なしのため停止中" - -_bubbleGame: - howToPlay: "遊び方" - hold: "ホールド" - _score: - score: "スコア" - scoreYen: "稼いだ金額" - highScore: "ハイスコア" - maxChain: "最大チェーン数" - yen: "{yen}円" - estimatedQty: "{qty}個分" - scoreSweets: "おにぎり {onigiriQtyWithUnit}" - _howToPlay: - section1: "位置を調整してハコにモノを落とします。" - section2: "同じ種類のモノがくっつくと別のモノに変化して、スコアが得られます。" - section3: "モノがハコからあふれるとゲームオーバーです。ハコからあふれないようにしつつモノを融合させてハイスコアを目指そう!" _announcement: forExistingUsers: "既存ユーザーのみ" @@ -1357,7 +1194,7 @@ _announcement: tooManyActiveAnnouncementDescription: "アクティブなお知らせが多いため、UXが低下する可能性があります。終了したお知らせはアーカイブすることを検討してください。" readConfirmTitle: "既読にしますか?" readConfirmText: "「{title}」の内容を読み、既読にします。" - shouldNotBeUsedToPresentPermanentInfo: "特に新規ユーザーのUXを損ねる可能性が高いため、常時掲示するための情報ではなく、即時性が求められる情報の掲示のためにお知らせを使用することを推奨します。" + shouldNotBeUsedToPresentPermanentInfo: "特に新規ユーザーのUXを損ねる可能性が高いため、ストック情報ではなくフロー情報の掲示にお知らせを使用することを推奨します。" dialogAnnouncementUxWarn: "ダイアログ形式のお知らせが同時に2つ以上ある場合、UXに悪影響を及ぼす可能性が非常に高いため、使用は慎重に行うことを推奨します。" silence: "非通知" silenceDescription: "オンにすると、このお知らせは通知されず、既読にする必要もなくなります。" @@ -1463,10 +1300,6 @@ _serverSettings: fanoutTimelineDescription: "有効にすると、各種タイムラインを取得する際のパフォーマンスが大幅に向上し、データベースへの負荷を軽減することが可能です。ただし、Redisのメモリ使用量は増加します。サーバーのメモリ容量が少ない場合、または動作が不安定な場合は無効にすることができます。" fanoutTimelineDbFallback: "データベースへのフォールバック" fanoutTimelineDbFallbackDescription: "有効にすると、タイムラインがキャッシュされていない場合にDBへ追加で問い合わせを行うフォールバック処理を行います。無効にすると、フォールバック処理を行わないことでさらにサーバーの負荷を軽減することができますが、タイムラインが取得できる範囲に制限が生じます。" - reactionsBufferingDescription: "有効にすると、リアクション作成時のパフォーマンスが大幅に向上し、データベースへの負荷を軽減することが可能です。ただし、Redisのメモリ使用量は増加します。" - inquiryUrl: "問い合わせ先URL" - inquiryUrlDescription: "サーバー運営者へのお問い合わせフォームのURLや、運営者の連絡先等が記載されたWebページのURLを指定します。" - thisSettingWillAutomaticallyOffWhenModeratorsInactive: "一定期間モデレーターのアクティビティが検出されなかった場合、スパム防止のためこの設定は自動でオフになります。" _accountMigration: moveFrom: "別のアカウントからこのアカウントに移行" @@ -1729,13 +1562,6 @@ _achievements: _tutorialCompleted: title: "Misskey初心者講座 修了証" description: "チュートリアルを完了した" - _bubbleGameExplodingHead: - title: "🤯" - description: "バブルゲームで最も大きいモノを出した" - _bubbleGameDoubleExplodingHead: - title: "ダブル🤯" - description: "バブルゲームで最も大きいモノを2つ同時に出した" - flavor: "これくらいの おべんとばこに 🤯 🤯 ちょっとつめて" _role: new: "ロールの作成" @@ -1777,7 +1603,6 @@ _role: gtlAvailable: "グローバルタイムラインの閲覧" ltlAvailable: "ローカルタイムラインの閲覧" canPublicNote: "パブリック投稿の許可" - mentionMax: "ノート内の最大メンション数" canInvite: "サーバー招待コードの発行" inviteLimit: "招待コードの作成可能数" inviteLimitCycle: "招待コードの発行間隔" @@ -1786,7 +1611,6 @@ _role: canManageAvatarDecorations: "アバターデコレーションの管理" driveCapacity: "ドライブ容量" alwaysMarkNsfw: "ファイルにNSFWを常に付与" - canUpdateBioMedia: "アイコンとバナーの更新を許可" pinMax: "ノートのピン留めの最大数" antennaMax: "アンテナの作成可能数" wordMuteMax: "ワードミュートの最大文字数" @@ -1801,20 +1625,9 @@ _role: canSearchNotes: "ノート検索の利用" canUseTranslator: "翻訳機能の利用" avatarDecorationLimit: "アイコンデコレーションの最大取付個数" - canImportAntennas: "アンテナのインポートを許可" - canImportBlocking: "ブロックのインポートを許可" - canImportFollowing: "フォローのインポートを許可" - canImportMuting: "ミュートのインポートを許可" - canImportUserLists: "リストのインポートを許可" _condition: - roleAssignedTo: "マニュアルロールにアサイン済み" isLocal: "ローカルユーザー" isRemote: "リモートユーザー" - isCat: "猫ユーザー" - isBot: "botユーザー" - isSuspended: "サスペンド済みユーザー" - isLocked: "鍵アカウントユーザー" - isExplorable: "「アカウントを見つけやすくする」が有効なユーザー" createdLessThan: "アカウント作成から~以内" createdMoreThan: "アカウント作成から~経過" followersLessThanOrEq: "フォロワー数が~以下" @@ -1894,7 +1707,6 @@ _plugin: installWarn: "信頼できないプラグインはインストールしないでください。" manage: "プラグインの管理" viewSource: "ソースを表示" - viewLog: "ログを表示" _preferencesBackups: list: "作成したバックアップ" @@ -1927,8 +1739,6 @@ _aboutMisskey: contributors: "コントリビューター" allContributors: "全てのコントリビューター" source: "ソースコード" - original: "オリジナル" - thisIsModifiedVersion: "{name}はオリジナルのMisskeyを改変したバージョンを使用しています。" translation: "Misskeyを翻訳" donate: "Misskeyに寄付" morePatrons: "他にも多くの方が支援してくれています。ありがとうございます🥰" @@ -2045,6 +1855,7 @@ _theme: buttonBg: "ボタンの背景" buttonHoverBg: "ボタンの背景 (ホバー)" inputBorder: "入力ボックスの縁取り" + listItemHoverBg: "リスト項目の背景 (ホバー)" driveFolderBg: "ドライブフォルダーの背景" wallpaperOverlay: "壁紙のオーバーレイ" badge: "バッジ" @@ -2057,6 +1868,8 @@ _sfx: note: "ノート" noteMy: "ノート(自分)" notification: "通知" + antenna: "アンテナ受信" + channel: "チャンネル通知" reaction: "リアクション選択時" _soundSettings: @@ -2066,7 +1879,6 @@ _soundSettings: driveFileTypeWarnDescription: "音声ファイルを選択してください" driveFileDurationWarn: "音声が長すぎます" driveFileDurationWarnDescription: "長い音声を使用するとMisskeyの使用に支障をきたす可能性があります。それでも続行しますか?" - driveFileError: "音声が読み込めませんでした。設定を変更してください" _ago: future: "未来" @@ -2099,7 +1911,8 @@ _2fa: alreadyRegistered: "既に設定は完了しています。" registerTOTP: "認証アプリの設定を開始" step1: "まず、{a}や{b}などの認証アプリをお使いのデバイスにインストールします。" - step2: "次に、表示されているQRコードをアプリでスキャンするか、ボタンをクリックして端末上でアプリを開きます。" + step2: "次に、表示されているQRコードをアプリでスキャンします。" + step2Click: "QRコードをクリックすると、お使いの端末にインストールされている認証アプリやキーリングに登録できます。" step2Uri: "デスクトップアプリを使用する場合は次のURIを入力します" step3Title: "確認コードを入力" step3: "アプリに表示されている確認コード(トークン)を入力します。" @@ -2123,7 +1936,6 @@ _2fa: backupCodesDescription: "認証アプリが使用できなくなった場合、以下のバックアップコードを使ってアカウントにアクセスできます。これらのコードは必ず安全な場所に保管してください。各コードは一回だけ使用できます。" backupCodeUsedWarning: "バックアップコードが使用されました。認証アプリが使えなくなっている場合、なるべく早く認証アプリを再設定してください。" backupCodesExhaustedWarning: "バックアップコードが全て使用されました。認証アプリを利用できない場合、これ以上アカウントにアクセスできなくなります。認証アプリを再登録してください。" - moreDetailedGuideHere: "詳細なガイドはこちら" _permissions: "read:account": "アカウントの情報を見る" @@ -2175,6 +1987,7 @@ _permissions: "read:admin:server-info": "サーバーの情報を見る" "read:admin:show-moderation-log": "モデレーションログを見る" "read:admin:show-user": "ユーザーのプライベートな情報を見る" + "read:admin:show-users": "ユーザーのプライベートな情報を見る" "write:admin:suspend-user": "ユーザーを凍結する" "write:admin:unset-user-avatar": "ユーザーのアバターを削除する" "write:admin:unset-user-banner": "ユーザーのバーナーを削除する" @@ -2219,11 +2032,8 @@ _auth: permissionAsk: "このアプリは次の権限を要求しています" pleaseGoBack: "アプリケーションに戻ってやっていってください" callback: "アプリケーションに戻っています" - accepted: "アクセスを許可しました" denied: "アクセスを拒否しました" - scopeUser: "以下のユーザーとして操作しています" pleaseLogin: "アプリケーションにアクセス許可を与えるには、ログインが必要です。" - byClickingYouWillBeRedirectedToThisUrl: "アクセスを許可すると、自動で以下のURLに遷移します" _antennaSources: all: "全てのノート" @@ -2340,14 +2150,10 @@ _profile: changeBanner: "バナー画像を変更" verifiedLinkDescription: "内容にURLを設定すると、リンク先のWebサイトに自分のプロフィールへのリンクが含まれている場合に所有者確認済みアイコンを表示させることができます。" avatarDecorationMax: "最大{max}つまでデコレーションを付けられます。" - followedMessage: "フォローされた時のメッセージ" - followedMessageDescription: "フォローされた時に相手に表示する短いメッセージを設定できます。" - followedMessageDescriptionForLockedAccount: "フォローを承認制にしている場合、フォローリクエストを許可した時に表示されます。" _exportOrImport: allNotes: "全てのノート" favoritedNotes: "お気に入りにしたノート" - clips: "クリップ" followingList: "フォロー" muteList: "ミュート" blockingList: "ブロック" @@ -2405,7 +2211,6 @@ _play: title: "タイトル" script: "スクリプト" summary: "説明" - visibilityDescription: "非公開に設定するとプロフィールに表示されなくなりますが、URLを知っている人は引き続きアクセスできます。" _pages: newPage: "ページの作成" @@ -2441,7 +2246,6 @@ _pages: eyeCatchingImageSet: "アイキャッチ画像を設定" eyeCatchingImageRemove: "アイキャッチ画像を削除" chooseBlock: "ブロックを追加" - enterSectionTitle: "セクションタイトルを入力" selectType: "種類を選択" contentBlocks: "コンテンツ" inputBlocks: "入力" @@ -2452,8 +2256,6 @@ _pages: section: "セクション" image: "画像" button: "ボタン" - dynamic: "動的ブロック" - dynamicDescription: "このブロックは廃止されています。今後は{play}を利用してください。" note: "ノート埋め込み" _note: @@ -2471,7 +2273,7 @@ _notification: youGotMention: "{name}からのメンション" youGotReply: "{name}からのリプライ" youGotQuote: "{name}による引用" - youRenoted: "{name}がリノートしました" + youRenoted: "{name}がRenoteしました" youWereFollowed: "フォローされました" youReceivedFollowRequest: "フォローリクエストが来ました" yourFollowRequestAccepted: "フォローリクエストが承認されました" @@ -2486,12 +2288,8 @@ _notification: sendTestNotification: "テスト通知を送信する" notificationWillBeDisplayedLikeThis: "通知はこのように表示されます" reactedBySomeUsers: "{n}人がリアクションしました" - likedBySomeUsers: "{n}人がいいねしました" renotedBySomeUsers: "{n}人がリノートしました" followedBySomeUsers: "{n}人にフォローされました" - flushNotification: "通知の履歴をリセットする" - exportOfXCompleted: "{x}のエクスポートが完了しました" - login: "ログインがありました" _types: all: "すべて" @@ -2499,7 +2297,7 @@ _notification: follow: "フォロー" mention: "メンション" reply: "リプライ" - renote: "リノート" + renote: "Renote" quote: "引用" reaction: "リアクション" pollEnded: "アンケートが終了" @@ -2507,21 +2305,17 @@ _notification: followRequestAccepted: "フォローが受理された" roleAssigned: "ロールが付与された" achievementEarned: "実績の獲得" - exportCompleted: "エクスポートが完了した" - login: "ログイン" - test: "通知のテスト" app: "連携アプリからの通知" _actions: followBack: "フォローバック" reply: "返信" - renote: "リノート" + renote: "Renote" _deck: alwaysShowMainColumn: "常にメインカラムを表示" columnAlign: "カラムの寄せ" addColumn: "カラムを追加" - newNoteNotificationSettings: "新着ノート通知の設定" configureColumn: "カラムの設定" swapLeft: "左に移動" swapRight: "右に移動" @@ -2565,10 +2359,9 @@ _drivecleaner: _webhookSettings: createWebhook: "Webhookを作成" - modifyWebhook: "Webhookを編集" name: "名前" secret: "シークレット" - trigger: "トリガー" + events: "Webhookを実行するタイミング" active: "有効" _events: follow: "フォローしたとき" @@ -2578,30 +2371,6 @@ _webhookSettings: renote: "Renoteされたとき" reaction: "リアクションがあったとき" mention: "メンションされたとき" - _systemEvents: - abuseReport: "ユーザーから通報があったとき" - abuseReportResolved: "ユーザーからの通報を処理したとき" - userCreated: "ユーザーが作成されたとき" - inactiveModeratorsWarning: "モデレーターが一定期間非アクティブになったとき" - inactiveModeratorsInvitationOnlyChanged: "モデレーターが一定期間非アクティブだったため、システムにより招待制へと変更されたとき" - deleteConfirm: "Webhookを削除しますか?" - testRemarks: "スイッチの右にあるボタンをクリックするとダミーのデータを使用したテスト用Webhookを送信できます。" - -_abuseReport: - _notificationRecipient: - createRecipient: "通報の通知先を追加" - modifyRecipient: "通報の通知先を編集" - recipientType: "通知先の種類" - _recipientType: - mail: "メール" - webhook: "Webhook" - _captions: - mail: "モデレーター権限を持つユーザーのメールアドレスに通知を送ります(通報を受けた時のみ)" - webhook: "指定したSystemWebhookに通知を送ります(通報を受けた時と通報を解決した時にそれぞれ発信)" - keywords: "キーワード" - notifiedUser: "通知先ユーザー" - notifiedWebhook: "使用するWebhook" - deleteConfirm: "通知先を削除しますか?" _moderationLogTypes: createRole: "ロールを作成" @@ -2615,7 +2384,7 @@ _moderationLogTypes: updateCustomEmoji: "カスタム絵文字更新" deleteCustomEmoji: "カスタム絵文字削除" updateServerSettings: "サーバー設定更新" - updateUserNote: "ユーザーのモデレーションノート更新" + updateUserNote: "モデレーションノート更新" deleteDriveFile: "ファイルを削除" deleteNote: "ノートを削除" createGlobalAnnouncement: "全体のお知らせを作成" @@ -2627,12 +2396,9 @@ _moderationLogTypes: resetPassword: "パスワードをリセット" suspendRemoteInstance: "リモートサーバーを停止" unsuspendRemoteInstance: "リモートサーバーを再開" - updateRemoteInstanceNote: "リモートサーバーのモデレーションノート更新" markSensitiveDriveFile: "ファイルをセンシティブ付与" unmarkSensitiveDriveFile: "ファイルをセンシティブ解除" resolveAbuseReport: "通報を解決" - forwardAbuseReport: "通報を転送" - updateAbuseReportNote: "通報のモデレーションノート更新" createInvitation: "招待コードを作成" createAd: "広告を作成" deleteAd: "広告を削除" @@ -2642,16 +2408,6 @@ _moderationLogTypes: deleteAvatarDecoration: "アイコンデコレーションを削除" unsetUserAvatar: "ユーザーのアイコンを解除" unsetUserBanner: "ユーザーのバナーを解除" - createSystemWebhook: "SystemWebhookを作成" - updateSystemWebhook: "SystemWebhookを更新" - deleteSystemWebhook: "SystemWebhookを削除" - createAbuseReportNotificationRecipient: "通報の通知先を作成" - updateAbuseReportNotificationRecipient: "通報の通知先を更新" - deleteAbuseReportNotificationRecipient: "通報の通知先を削除" - deleteAccount: "アカウントを削除" - deletePage: "ページを削除" - deleteFlash: "Playを削除" - deleteGalleryPost: "ギャラリーの投稿を削除" _fileViewer: title: "ファイルの詳細" @@ -2706,116 +2462,14 @@ _externalResourceInstaller: _dataSaver: _media: - title: "メディアの読み込みを無効化" + title: "メディアの読み込み" description: "画像・動画が自動で読み込まれるのを防止します。隠れている画像・動画はタップすると読み込まれます。" _avatar: - title: "アイコン画像のアニメーションを無効化" + title: "アイコン画像" description: "アイコン画像のアニメーションが停止します。アニメーション画像は通常の画像よりファイルサイズが大きいことがあるので、データ通信量をさらに削減できます。" _urlPreview: - title: "URLプレビューのサムネイルを非表示" + title: "URLプレビューのサムネイル" description: "URLプレビューのサムネイル画像が読み込まれなくなります。" _code: - title: "コードハイライトを非表示" + title: "コードハイライト" description: "MFMなどでコードハイライト記法が使われている場合、タップするまで読み込まれなくなります。コードハイライトではハイライトする言語ごとにその定義ファイルを読み込む必要がありますが、それらが自動で読み込まれなくなるため、通信量の削減が見込めます。" - -_hemisphere: - N: "北半球" - S: "南半球" - caption: "一部のクライアント設定で、季節を判定するために使用します。" - -_reversi: - reversi: "リバーシ" - gameSettings: "対局の設定" - chooseBoard: "ボードを選択" - blackOrWhite: "先行/後攻" - blackIs: "{name}が黒(先行)" - rules: "ルール" - thisGameIsStartedSoon: "対局はまもなく開始されます" - waitingForOther: "相手の準備が完了するのを待っています" - waitingForMe: "あなたの準備が完了するのを待っています" - waitingBoth: "準備してください" - ready: "準備完了" - cancelReady: "準備を再開" - opponentTurn: "相手のターンです" - myTurn: "あなたのターンです" - turnOf: "{name}のターンです" - pastTurnOf: "{name}のターン" - surrender: "投了" - surrendered: "投了により" - timeout: "時間切れ" - drawn: "引き分け" - won: "{name}の勝ち" - black: "黒" - white: "白" - total: "合計" - turnCount: "{count}ターン目" - myGames: "自分の対局" - allGames: "みんなの対局" - ended: "終了" - playing: "対局中" - isLlotheo: "石の少ない方が勝ち(ロセオ)" - loopedMap: "ループマップ" - canPutEverywhere: "どこでも置けるモード" - timeLimitForEachTurn: "1ターンの時間制限" - freeMatch: "フリーマッチ" - lookingForPlayer: "対戦相手を探しています" - gameCanceled: "対局がキャンセルされました" - shareToTlTheGameWhenStart: "開始時に対局をタイムラインに投稿" - iStartedAGame: "対局を開始しました! #MisskeyReversi" - opponentHasSettingsChanged: "相手が設定を変更しました" - allowIrregularRules: "変則許可 (完全フリー)" - disallowIrregularRules: "変則なし" - showBoardLabels: "盤面に行・列番号を表示" - useAvatarAsStone: "石をアイコンにする" - -_offlineScreen: - title: "オフライン - サーバーに接続できません" - header: "サーバーに接続できません" - -_urlPreviewSetting: - title: "URLプレビューの設定" - enable: "URLプレビューを有効にする" - timeout: "プレビュー取得時のタイムアウト(ms)" - timeoutDescription: "プレビュー取得の所要時間がこの値を超えた場合、プレビューは生成されません。" - maximumContentLength: "Content-Lengthの最大値(byte)" - maximumContentLengthDescription: "Content-Lengthがこの値を超えた場合、プレビューは生成されません。" - requireContentLength: "Content-Lengthが取得できた場合のみプレビューを生成" - requireContentLengthDescription: "相手サーバがContent-Lengthを返さない場合、プレビューは生成されません。" - userAgent: "User-Agent" - userAgentDescription: "プレビュー取得時に使用されるUser-Agentを設定します。空欄の場合、デフォルトのUser-Agentが使用されます。" - summaryProxy: "プレビューを生成するプロキシのエンドポイント" - summaryProxyDescription: "Misskey本体ではなく、サマリープロキシを使用してプレビューを生成します。" - summaryProxyDescription2: "プロキシには下記パラメータがクエリ文字列として連携されます。プロキシ側がこれらをサポートしない場合、設定値は無視されます。" - -_mediaControls: - pip: "ピクチャインピクチャ" - playbackRate: "再生速度" - loop: "ループ再生" - -_contextMenu: - title: "コンテキストメニュー" - app: "アプリケーション" - appWithShift: "Shiftキーでアプリケーション" - native: "ブラウザのUI" - -_embedCodeGen: - title: "埋め込みコードをカスタマイズ" - header: "ヘッダーを表示" - autoload: "自動で続きを読み込む(非推奨)" - maxHeight: "高さの最大値" - maxHeightDescription: "0で最大値の設定が無効になります。ウィジェットが縦に伸び続けるのを防ぐために、何らかの値に指定してください。" - maxHeightWarn: "高さの最大値制限が無効(0)になっています。これが意図した変更ではない場合は、高さの最大値を何らかの値に設定してください。" - previewIsNotActual: "プレビュー画面で表示可能な範囲を超えたため、実際に埋め込んだ際とは表示が異なります。" - rounded: "角丸にする" - border: "外枠に枠線をつける" - applyToPreview: "プレビューに反映" - generateCode: "埋め込みコードを作成" - codeGenerated: "コードが生成されました" - codeGeneratedDescription: "生成されたコードをウェブサイトに貼り付けてご利用ください。" - -_selfXssPrevention: - warning: "警告" - title: "「この画面に何か貼り付けろ」はすべて詐欺です。" - description1: "ここに何かを貼り付けると、悪意のあるユーザーにアカウントを乗っ取られたり、個人情報を盗まれたりする可能性があります。" - description2: "貼り付けようとしているものが何なのかを正確に理解していない場合は、%c今すぐ作業を中止してこのウィンドウを閉じてください。" - description3: "詳しくはこちらをご確認ください。 {link}" diff --git a/locales/ja-KS.yml b/locales/ja-KS.yml index 50132c0645..4bd44f56d9 100644 --- a/locales/ja-KS.yml +++ b/locales/ja-KS.yml @@ -8,9 +8,6 @@ search: "探す" notifications: "通知" username: "ユーザー名" password: "パスワード" -initialPasswordForSetup: "初期設定開始用パスワード" -initialPasswordIsIncorrect: "初期設定開始用のパスワードがちゃうで。" -initialPasswordForSetupDescription: "Miskkeyを自分でインストールしたんやったら、設定ファイルに入れたパスワードを使ってや。\nホスティングサービスを使っとるんやったら、サービスから言われたやつを使うんやで。\n別に何も設定しとらんのやったら、何も入れずに空けといてな。" forgotPassword: "パスワード忘れたん?" fetchingAsApObject: "今ちと連合に照会しとるで" ok: "ええで" @@ -63,7 +60,6 @@ copyFileId: "ファイルIDをコピー" copyFolderId: "フォルダーIDをコピー" copyProfileUrl: "プロフィールURLをコピー" searchUser: "ユーザーを探す" -searchThisUsersNotes: "ユーザーのノートを検索" reply: "返事" loadMore: "まだまだあるで!" showMore: "まだまだあるで!" @@ -112,14 +108,11 @@ enterEmoji: "絵文字を入れてや" renote: "リノート" unrenote: "リノートやめる" renoted: "リノートしたで。" -renotedToX: "{name}にリノートしたで" cantRenote: "この投稿はリノートできへんっぽい。" cantReRenote: "リノート自体はリノートできへんで。" quote: "引用" inChannelRenote: "チャンネルの中でリノート" inChannelQuote: "チャンネル内引用" -renoteToChannel: "チャンネルにリノート" -renoteToOtherChannel: "他のチャンネルにリノート" pinnedNote: "ピン留めされとるノート" pinned: "ピン留めしとく" you: "あんた" @@ -137,7 +130,6 @@ overwriteFromPinnedEmojis: "全般設定から上書きする" reactionSettingDescription2: "ドラッグで並び替え、クリックで削除、+を押して追加やで。" rememberNoteVisibility: "公開範囲覚えといて" attachCancel: "のっけるのやめる" -deleteFile: "ファイルをほかす" markAsSensitive: "ちょっとこれはアカン" unmarkAsSensitive: "そこまでアカンことないやろ" enterFileName: "ファイル名を入れてや" @@ -158,7 +150,6 @@ editList: "リストいじる" selectChannel: "チャンネルを選ぶ" selectAntenna: "アンテナを選ぶ" editAntenna: "アンテナいじる" -createAntenna: "アンテナを作成" selectWidget: "ウィジェットを選ぶ" editWidgets: "ウィジェットをいじる" editWidgetsExit: "いじるのをやめる" @@ -185,10 +176,6 @@ addAccount: "アカウントを追加" reloadAccountsList: "アカウントリストの情報を更新" loginFailed: "ログインに失敗してもうた…" showOnRemote: "リモートで見る" -continueOnRemote: "リモートで続行" -chooseServerOnMisskeyHub: "Misskey Hubからサーバーを選択" -specifyServerHost: "サーバーのドメインを直接指定" -inputHostName: "ドメインを入力せえや" general: "全般" wallpaper: "壁紙" setWallpaper: "壁紙を設定" @@ -199,7 +186,6 @@ followConfirm: "{name}をフォローしてええか?" proxyAccount: "プロキシアカウント" proxyAccountDescription: "プロキシアカウントは、代わりにフォローしてくれるアカウントや。例えば、551に豚まんが無いときやったり、ユーザーがリモートユーザーをアカウントに入れたとき、リストに入れられたユーザーが誰からもフォローされてないと寂しいやん。寂しいし、アクティビティも配達されへんから、プロキシアカウントがフォローしてくれるで。ええやつやん…" host: "ホスト" -selectSelf: "自分を選択" selectUser: "ユーザーを選ぶ" recipient: "宛先" annotation: "注釈" @@ -215,7 +201,6 @@ perDay: "1日ごと" stopActivityDelivery: "アクティビティの配送をやめる" blockThisInstance: "このサーバーをブロックすんで" silenceThisInstance: "サーバーサイレンスすんで?" -mediaSilenceThisInstance: "サーバーをメディアサイレンス" operations: "操作" software: "ソフトウェア" version: "バージョン" @@ -237,10 +222,6 @@ blockedInstances: "ブロックしたサーバー" blockedInstancesDescription: "ブロックしたいサーバーのホストを改行で区切って設定してな。ブロックされてもうたサーバーとはもう金輪際やり取りできひんくなるで。" silencedInstances: "サーバーサイレンスされてんねん" silencedInstancesDescription: "サイレンスしたいサーバーのホストを改行で区切って設定すんで。サイレンスされたサーバーに所属するアカウントはすべて「サイレンス」として扱われ、フォローがすべてリクエストになり、フォロワーでないローカルアカウントにはメンションできなくなんねん。ブロックしたインスタンスには影響せーへんで。" -mediaSilencedInstances: "メディアサイレンスしたサーバー" -mediaSilencedInstancesDescription: "メディアサイレンスしたいサーバーのホストを改行で区切って設定するで。メディアサイレンスされたサーバーに所属するアカウントによるファイルはすべてセンシティブとして扱われてな、カスタム絵文字が使えへんようになるで。ブロックしたインスタンスには影響せえへんで。" -federationAllowedHosts: "連合を許すサーバー" -federationAllowedHostsDescription: "連合してもいいサーバーのホストを行ごとに区切って設定してや。" muteAndBlock: "ミュートとブロック" mutedUsers: "ミュートしとるユーザー" blockedUsers: "ブロックしとるユーザー" @@ -331,7 +312,6 @@ selectFile: "ファイル選んでや" selectFiles: "ファイル選んでや" selectFolder: "フォルダ選んでや" selectFolders: "フォルダ選んでや" -fileNotSelected: "ファイルが選択されてへんで" renameFile: "ファイル名をいらう" folderName: "フォルダー名" createFolder: "フォルダー作る" @@ -339,7 +319,6 @@ renameFolder: "フォルダー名を変える" deleteFolder: "フォルダーをほかす" folder: "フォルダー" addFile: "ファイルを追加" -showFile: "ファイル出す" emptyDrive: "ドライブは空っぽや" emptyFolder: "このフォルダーは空や" unableToDelete: "消せんかったわ" @@ -400,11 +379,6 @@ hcaptcha: "hCaptcha(キャプチャ)" enableHcaptcha: "hCaptcha(キャプチャ)をつけとく" hcaptchaSiteKey: "サイトキー" hcaptchaSecretKey: "シークレットキー" -mcaptcha: "mCaptcha" -enableMcaptcha: "hCaptcha(キャプチャ)をつけとく" -mcaptchaSiteKey: "サイトキー" -mcaptchaSecretKey: "シークレットキー" -mcaptchaInstanceUrl: "mCaptchaのインスタンスのURL" recaptcha: "reCAPTCHA" enableRecaptcha: "reCAPTCHA(リキャプチャ)を有効にする" recaptchaSiteKey: "サイトキー" @@ -420,7 +394,6 @@ name: "名前" antennaSource: "受信ソース(このソースは食われへん)" antennaKeywords: "受信キーワード" antennaExcludeKeywords: "除外キーワード" -antennaExcludeBots: "Botアカウントを除外" antennaKeywordsDescription: "スペースで区切ったるとAND指定で、改行で区切ったるとOR指定や" notifyAntenna: "新しいノートを通知すんで" withFileAntenna: "なんか添付されたノートだけ" @@ -454,7 +427,6 @@ totpDescription: "認証アプリ使うてワンタイムパスワードを入 moderator: "モデレーター" moderation: "モデレーション" moderationNote: "モデレーションノート" -moderationNoteDescription: "モデレーターの中だけで共有するメモを入れれるで。" addModerationNote: "モデレーションノートを追加するで" moderationLogs: "モデログ" nUsersMentioned: "{n}人が投稿" @@ -489,12 +461,10 @@ retype: "もっかい入力" noteOf: "{user}はんのノート" quoteAttached: "引用付いとるで" quoteQuestion: "引用として添付してもええか?" -attachAsFileQuestion: "クリップボードのテキストが長すぎるからテキストファイルとして添付してもええか?" noMessagesYet: "まだチャットはあらへんで" newMessageExists: "新しいメッセージがきたで" onlyOneFileCanBeAttached: "ごめんな、メッセージに添付できるファイルはひとつだけなんよ。" signinRequired: "ログインしてくれへん?" -signinOrContinueOnRemote: "続行するには、お使いのサーバーに移動するか、このサーバーに登録・ログインする必要があるで" invitations: "来てや" invitationCode: "招待コード" checking: "確認しとるで" @@ -516,12 +486,8 @@ uiLanguage: "UIの表示言語" aboutX: "{x}について" emojiStyle: "絵文字のスタイル" native: "ネイティブ" -menuStyle: "メニューのスタイル" -style: "スタイル" -drawer: "ドロワー" -popup: "ポップアップ" +disableDrawer: "メニューをドロワーで表示せえへん" showNoteActionsOnlyHover: "ノートの操作部をホバー時のみ表示するで" -showReactionsCount: "ノートのリアクション数を表示する" noHistory: "履歴はないわ。" signinHistory: "ログイン履歴" enableAdvancedMfm: "ややこしいMFMもありにする" @@ -602,8 +568,6 @@ ascendingOrder: "小さい順" descendingOrder: "大きい順" scratchpad: "スクラッチパッド" scratchpadDescription: "スクラッチパッドではAiScriptを色々試すことができるんや。Misskeyに対して色々できるコードを書いて動かしてみたり、結果を見たりできるで。" -uiInspector: "UIインスペクター" -uiInspectorDescription: "メモリ上にあるUIコンポーネントのインスタンス一覧を見れるで。UIコンポーネントはUi:C:系関数で生成されるで。" output: "出力" script: "スクリプト" disablePagesScript: "Pagesのスクリプトを無効にしてや" @@ -662,7 +626,6 @@ medium: "中" small: "小" generateAccessToken: "アクセストークンの発行" permission: "権限" -adminPermission: "管理者権限" enableAll: "全部使えるようにする" disableAll: "全部使えへんようにする" tokenRequested: "アカウントへのアクセス許してやったらどうや" @@ -706,7 +669,6 @@ useGlobalSettingDesc: "オンにすると、アカウントの通知設定が使 other: "その他" regenerateLoginToken: "ログイントークンを再生成" regenerateLoginTokenDescription: "ログインに使われる内部トークンをもっかい作るで。いつもならこれをやる必要はないで。もっかい作ると、全部のデバイスでログアウトされるで気ぃつけてなー。" -theKeywordWhenSearchingForCustomEmoji: "カスタム絵文字を探すときのキーワードになるで。" setMultipleBySeparatingWithSpace: "スペースで区切って何個でも設定できるで。" fileIdOrUrl: "ファイルIDかURL" behavior: "動作" @@ -720,7 +682,10 @@ abuseReported: "無事内容が送信されたみたいやで。おおきに〜 reporter: "通報者" reporteeOrigin: "通報先" reporterOrigin: "通報元" +forwardReport: "リモートサーバーに通報を転送するで" +forwardReportIsAnonymous: "リモートサーバーからはあんたの情報は見えんなって、匿名のシステムアカウントとして表示されるで。" send: "送信" +abuseMarkAsResolved: "対応したで" openInNewTab: "新しいタブで開く" openInSideView: "サイドビューで開く" defaultNavigationBehaviour: "デフォルトのナビゲーション" @@ -857,7 +822,6 @@ administration: "管理" accounts: "アカウント" switch: "切り替え" noMaintainerInformationWarning: "管理者情報が設定されてへんで" -noInquiryUrlWarning: "問い合わせ先URLが設定されてへんで。" noBotProtectionWarning: "Botプロテクションが設定されてへんで。" configure: "設定する" postToGallery: "ギャラリーへ投稿" @@ -917,12 +881,9 @@ makeReactionsPublicDescription: "あんたがしたツッコミ一覧を誰で classic: "クラシック" muteThread: "スレッドをミュート" unmuteThread: "スレッドのミュートを解除" -followingVisibility: "フォローの公開範囲" -followersVisibility: "フォロワーの公開範囲" continueThread: "さらにスレッドを見るで" deleteAccountConfirm: "アカウントを消すで?ええんか?" incorrectPassword: "パスワードがちゃうわ。" -incorrectTotp: "ワンタイムパスワードが間違っとるか、期限が切れとるみたいやな。" voteConfirm: "「{choice}」に投票するんか?" hide: "隠す" useDrawerReactionPickerForMobile: "ケータイとかのときドロワーで表示するで" @@ -1020,7 +981,6 @@ neverShow: "今後表示しない" remindMeLater: "また後で" didYouLikeMisskey: "Misskey気に入ってくれた?" pleaseDonate: "Misskeyは{host}が使うとる無料のソフトウェアやで。これからも開発を続けれるように、寄付したってな~。" -correspondingSourceIsAvailable: "{anchor}" roles: "ロール" role: "ロール" noRole: "ロールはありまへん" @@ -1048,7 +1008,6 @@ thisPostMayBeAnnoyingHome: "ホームに投稿" thisPostMayBeAnnoyingCancel: "やめとく" thisPostMayBeAnnoyingIgnore: "このまま投稿" collapseRenotes: "見たことあるリノートは飛ばして表示するで" -collapseRenotesDescription: "リアクションやリノートをしたことがあるノートをたたんで表示するで。" internalServerError: "サーバー内部エラー" internalServerErrorDescription: "サーバーでなんか変なこと起こっとるわ。" copyErrorInfo: "エラー情報をコピるで" @@ -1072,9 +1031,6 @@ resetPasswordConfirm: "パスワード作り直すんでええな?" sensitiveWords: "けったいな単語" sensitiveWordsDescription: "設定した単語が入っとるノートの公開範囲をホームにしたるわ。改行で区切ったら複数設定できるで。" sensitiveWordsDescription2: "スペースで区切るとAND指定、キーワードをスラッシュで囲んだら正規表現や。" -prohibitedWords: "禁止ワード" -prohibitedWordsDescription: "設定した言葉が含まれるノートを投稿しようとしたら、エラーが出るようにするで。改行で区切って複数設定できるで。" -prohibitedWordsDescription2: "スペースで区切るとAND指定、キーワードをスラッシュで囲んだら正規表現や。" hiddenTags: "見えてへんハッシュタグ" hiddenTagsDescription: "設定したタグを最近流行りのとこに見えんようにすんで。複数設定するときは改行で区切ってな。" notesSearchNotAvailable: "なんかノート探せへん。" @@ -1087,15 +1043,12 @@ retryAllQueuesConfirmTitle: "もっかいやってみるか?" retryAllQueuesConfirmText: "一時的にサーバー重なるかもしれへんで。" enableChartsForRemoteUser: "リモートユーザーのチャートを作る" enableChartsForFederatedInstances: "リモートサーバーのチャートを作る" -enableStatsForFederatedInstances: "リモートサーバの情報を取得" showClipButtonInNoteFooter: "ノートのアクションにクリップを追加" reactionsDisplaySize: "ツッコミの表示のでかさ" limitWidthOfReaction: "ツッコミの最大横幅を制限して、ちっさく表示するで" noteIdOrUrl: "ノートIDかURL" video: "動画" videos: "動画" -audio: "音声" -audioFiles: "音声" dataSaver: "データケチケチ" accountMigration: "アカウントのお引っ越し" accountMoved: "このユーザーはさらのアカウントに引っ越したで:" @@ -1123,8 +1076,6 @@ preservedUsernames: "予約ユーザー名" preservedUsernamesDescription: "予約しとくユーザー名を行ごとに挙げるで。ここで指定されたユーザー名はアカウント作るときに使えへんくなるけど、管理者は例外や。あと、もうあるアカウントも例外やな。" createNoteFromTheFile: "このファイル使うてノート作るで" archive: "アーカイブ" -archived: "アーカイブ済み" -unarchive: "アーカイブ解除" channelArchiveConfirmTitle: "{name}をアーカイブしてええか?" channelArchiveConfirmDescription: "アーカイブしたら、チャンネル一覧とか検索結果からなくなるし、新しく書き込みもできへんなるで。" thisChannelArchived: "このチャンネル、アーカイブされとるで。" @@ -1135,9 +1086,6 @@ preventAiLearning: "生成AIの学習に使わんといて" preventAiLearningDescription: "他の文章生成AIとか画像生成AIに、投稿したノートとか画像なんかを勝手に使わんように頼むで。具体的にはnoaiフラグをHTMLレスポンスに含めるんやけど、これ聞いてくれるんはAIの気分次第やから、使われる可能性もちょっとはあるな。" options: "オプション" specifyUser: "ユーザー指定" -lookupConfirm: "照会するけどええか?" -openTagPageConfirm: "ハッシュタグのページを開くんか?" -specifyHost: "ホスト指定" failedToPreviewUrl: "プレビューできへん" update: "更新" rolesThatCanBeUsedThisEmojiAsReaction: "ツッコミとして使えるロール" @@ -1196,7 +1144,6 @@ showRenotes: "リノート出す" edited: "いじったやつ" notificationRecieveConfig: "通知もらうかの設定" mutualFollow: "お互いフォローしてんで" -followingOrFollower: "フォロー中またはフォロワー" fileAttachedOnly: "ファイルのっけてあるやつだけ" showRepliesToOthersInTimeline: "タイムラインに他の人への返信とかも入れるで" hideRepliesToOthersInTimeline: "タイムラインに他の人への返信とかは入れへん" @@ -1205,13 +1152,6 @@ hideRepliesToOthersInTimelineAll: "タイムラインに今フォローしとる confirmShowRepliesAll: "これは元に戻せへんから慎重に決めてや。本当にタイムラインに今フォローしとる全員の返信を入れるか?" confirmHideRepliesAll: "これは元に戻せへんから慎重に決めてや。本当にタイムラインに今フォローしとる全員の返信を入れへんのか?" externalServices: "他のサイトのサービス" -sourceCode: "ソースコード" -sourceCodeIsNotYetProvided: "ソースコードはまだ提供されてへんで。問題の修正について管理者に問い合わせてみ。" -repositoryUrl: "リポジトリURL" -repositoryUrlDescription: "ソースコードが公開されているリポジトリがある場合、そのURLを記入するで。Misskeyをそのまんま(ソースコードにいかなる変更も加えずに)使っとる場合は https://github.com/misskey-dev/misskey と記入するで。" -repositoryUrlOrTarballRequired: "リポジトリを公開してへんなら、代わりにtarballを提供する必要があるで。詳細は.config/example.ymlを参照してな。" -feedback: "フィードバック" -feedbackUrl: "フィードバックURL" impressum: "運営者の情報" impressumUrl: "運営者の情報URL" impressumDescription: "ドイツとかの一部んところではな、表示が義務付けられてんねん(Impressum)。" @@ -1239,91 +1179,6 @@ remainingN: "残り:{n}" overwriteContentConfirm: "今の内容に上書きされるけどいい?" seasonalScreenEffect: "季節にあった画面の動き" decorate: "デコる" -addMfmFunction: "装飾つける" -enableQuickAddMfmFunction: "ややこしいMFMのピッカーを出す" -bubbleGame: "バブルゲーム" -sfx: "効果音" -soundWillBePlayed: "サウンドが再生されるで" -showReplay: "リプレイ見る" -replay: "リプレイ" -replaying: "リプレイ中" -endReplay: "リプレイを終了" -copyReplayData: "リプレイデータをコピー" -ranking: "ランキング" -lastNDays: "直近{n}日" -backToTitle: "タイトルへ" -hemisphere: "住んでる地域" -withSensitive: "センシティブなファイルを含むノートを表示" -userSaysSomethingSensitive: "{name}のセンシティブなファイルを含む投稿" -enableHorizontalSwipe: "スワイプしてタブを切り替える" -loading: "読み込み中" -surrender: "やめとく" -gameRetry: "もういっちょ" -notUsePleaseLeaveBlank: "使用せえへん場合は空欄にしてや" -useTotp: "ワンタイムパスワードを使う" -useBackupCode: "バックアップコードを使う" -launchApp: "アプリを起動" -useNativeUIForVideoAudioPlayer: "動画・音声の再生にブラウザのUIを使用する" -keepOriginalFilename: "オリジナルのファイル名を保持" -keepOriginalFilenameDescription: "この設定をオフにすると、アップロード時にファイル名が自動でランダム文字列に置き換えられるで。" -noDescription: "説明文はあらへんで" -alwaysConfirmFollow: "フォローの際常に確認する" -inquiry: "問い合わせ" -tryAgain: "もう一度試しいや。" -confirmWhenRevealingSensitiveMedia: "センシティブなメディアを表示するとき確認する" -sensitiveMediaRevealConfirm: "センシティブなメディアやで。表示するんか?" -createdLists: "作成したリスト" -createdAntennas: "作成したアンテナ" -fromX: "{x}から" -genEmbedCode: "埋め込みコードを作る" -noteOfThisUser: "このユーザーのノート全部" -clipNoteLimitExceeded: "これ以上このクリップにノート追加でけへんわ。" -performance: "パフォーマンス" -modified: "変更あり" -discard: "やめる" -thereAreNChanges: "{n}個の変更があるみたいや" -signinWithPasskey: "パスキーでログイン" -unknownWebAuthnKey: "登録されてへんパスキーやな。" -passkeyVerificationFailed: "パスキーの検証に失敗したで。" -passkeyVerificationSucceededButPasswordlessLoginDisabled: "パスキーの検証は成功したんやけど、パスワードレスログインが無効になっとるわ。" -messageToFollower: "フォロワーへのメッセージ" -target: "対象" -testCaptchaWarning: "CAPTCHAのテストを目的としてるで。絶対に本番環境で使わんといてな。絶対やで。" -prohibitedWordsForNameOfUser: "禁止ワード(ユーザー名)" -prohibitedWordsForNameOfUserDescription: "このリストの中にある文字列がユーザー名に入っとったら、その名前に変更できひんようになるで。モデレーター権限があるユーザーは除外や。" -yourNameContainsProhibitedWords: "その名前は禁止した文字列が含まれとるで" -yourNameContainsProhibitedWordsDescription: "その名前は禁止した文字列が含まれとるわ。どうしてもって言うなら、サーバー管理者に言うしかないで。" -_abuseUserReport: - forward: "転送" - forwardDescription: "匿名のシステムアカウントってことにして、リモートサーバーに通報を転送するで。" - resolve: "解決" - accept: "ええよ" - reject: "あかんよ" - resolveTutorial: "内容がええなら「ええよ」を選ぶんや。肯定的に解決されたことにして記録するで。\n逆に、内容がだめなら「あかんよ」を選びいや。否定的に解決されたって記録しとくで。" -_delivery: - status: "配信状態" - stop: "配信せぇへん" - resume: "配信再開" - _type: - none: "配信しとる" - manuallySuspended: "手動停止中" - goneSuspended: "サーバー削除のため停止中" - autoSuspendedForNotResponding: "サーバー応答せえへんから停止中" -_bubbleGame: - howToPlay: "遊び方" - hold: "ホールド" - _score: - score: "スコア" - scoreYen: "稼いだ金額" - highScore: "ハイスコア" - maxChain: "最大チェーン数" - yen: "{yen}円" - estimatedQty: "{qty}個分" - scoreSweets: "おにぎり {onigiriQtyWithUnit}" - _howToPlay: - section1: "位置を調整してハコにモノを落とすで。" - section2: "同じもんがくっついたら別のやつになって、スコアがもらえるで。" - section3: "モノがハコからあふれたらゲームオーバーや。ハコからあふれんようにしながらモノを融合させてハイスコアを目指しいや!" _announcement: forExistingUsers: "もうおるユーザーのみ" forExistingUsersDescription: "オンにしたらこのお知らせができた時点でおる人らにだけお知らせが行くで。切ったらこの知らせが行ったあとにアカウント作った人にもちゃんとお知らせが行くで。" @@ -1434,10 +1289,6 @@ _serverSettings: fanoutTimelineDescription: "入れると、おのおのタイムラインを取得するときにめちゃめちゃ動きが良うなって、データベースが軽くなるわ。でも、Redisのメモリ使う量が増えるから注意な。サーバーのメモリが足りんときとか、動きが変なときは切れるで。" fanoutTimelineDbFallback: "データベースにフォールバックする" fanoutTimelineDbFallbackDescription: "有効にしたら、タイムラインがキャッシュん中に入ってないときにDBにもっかい問い合わせるフォールバック処理ってのをやっとくで。切ったらフォールバック処理をやらんからサーバーはもっと軽くなんねんけど、タイムラインの取得範囲がちょっと減るで。" - reactionsBufferingDescription: "有効にしたら、リアクション作るときのパフォーマンスがすっごい上がって、データベースへの負荷が減るで。代わりに、Redisのメモリ使用は増えるで。" - inquiryUrl: "問い合わせ先URL" - inquiryUrlDescription: "サーバー運営者へのお問い合わせフォームのURLや、運営者の連絡先等が記載されたWebページのURLを指定するで。" - thisSettingWillAutomaticallyOffWhenModeratorsInactive: "一定期間モデレーターがおらんかったら、スパムを防ぐためにこの設定は勝手に切られるで。" _accountMigration: moveFrom: "別のアカウントからこのアカウントに引っ越す" moveFromSub: "別のアカウントへエイリアスを作る" @@ -1698,13 +1549,6 @@ _achievements: _tutorialCompleted: title: "Misskeyひよっこ講座 修了証" description: "チュートリアル全部やった" - _bubbleGameExplodingHead: - title: "🤯" - description: "バブルゲームで最も大きいモノを出した" - _bubbleGameDoubleExplodingHead: - title: "ダブル🤯" - description: "バブルゲームで最も大きいモノを2つ同時に出した" - flavor: "これくらいの おべんとばこに 🤯 🤯 ちょっとつめて" _role: new: "ロールの作成" edit: "ロールの編集" @@ -1745,7 +1589,6 @@ _role: gtlAvailable: "グローバルタイムライン見る" ltlAvailable: "ローカルタイムライン見る" canPublicNote: "パブリック投稿できるか" - mentionMax: "ノート内の最大メンション数" canInvite: "サーバー招待コード作る" inviteLimit: "招待コード作れる数" inviteLimitCycle: "招待コードの作れる間隔" @@ -1754,7 +1597,6 @@ _role: canManageAvatarDecorations: "アバターを飾るモンの管理" driveCapacity: "ドライブ容量" alwaysMarkNsfw: "勝手にファイルにNSFWをくっつける" - canUpdateBioMedia: "アイコンとバナーの更新を許可" pinMax: "ノートピン留めできる数" antennaMax: "アンテナ作れる数" wordMuteMax: "ワードミュートの最大文字数" @@ -1769,20 +1611,9 @@ _role: canSearchNotes: "ノート探せるかどうか" canUseTranslator: "翻訳使えるかどうか" avatarDecorationLimit: "アイコンデコのいっちばんつけれる数" - canImportAntennas: "アンテナのインポートを許す" - canImportBlocking: "ブロックのインポートを許す" - canImportFollowing: "フォローのインポートを許す" - canImportMuting: "ミュートのインポートを許す" - canImportUserLists: "リストのインポートを許す" _condition: - roleAssignedTo: "マニュアルロールにアサイン済み" isLocal: "ローカルユーザー" isRemote: "リモートユーザー" - isCat: "猫ユーザー" - isBot: "botユーザー" - isSuspended: "サスペンド済みユーザー" - isLocked: "鍵アカウントユーザー" - isExplorable: "「アカウントを見つけやすくする」が有効なユーザー" createdLessThan: "アカウント作ってから~以内" createdMoreThan: "アカウント作ってから~経過" followersLessThanOrEq: "フォロワー数が~以下" @@ -1808,7 +1639,6 @@ _emailUnavailable: disposable: "ずーっと使えるアドレスじゃないみたいや" mx: "正しいメールサーバーじゃないっぽいわ" smtp: "メールサーバーがうんともすんとも言わへん" - banned: "このメールアドレスはあかん" _ffVisibility: public: "公開" followers: "フォロワーだけに公開" @@ -1852,7 +1682,6 @@ _plugin: installWarn: "信頼できへんプラグインはインストールせんとってな" manage: "プラグインの管理" viewSource: "ソース見る" - viewLog: "ログを表示" _preferencesBackups: list: "作ったバックアップ" saveNew: "新しく保存" @@ -1867,8 +1696,8 @@ _preferencesBackups: deleteConfirm: "{name}を消すん?" renameConfirm: "「{old}」を「{new}」に変えるん?" noBackups: "バックアップはないで。「新しく保存」ってとこでこのクライアント設定を鯖に保存できるで。" - createdAt: "作った日時: {date} {time}" - updatedAt: "更新日時: {date} {time}" + createdAt: "作った日時:{date}{time}" + updatedAt: "更新日時:{date}{time}" cannotLoad: "読み込みできへん..." invalidFile: "ファイル形式が違うで?" _registry: @@ -1882,8 +1711,6 @@ _aboutMisskey: contributors: "主な貢献者" allContributors: "全ての貢献者" source: "ソースコード" - original: "オリジナル" - thisIsModifiedVersion: "{name}はオリジナルのMisskeyをいじったバージョンをつこうてるで。" translation: "Misskeyを翻訳" donate: "Misskeyに寄付" morePatrons: "他にもぎょうさんの人からサポートしてもろてんねん。ほんまおおきに🥰" @@ -1991,6 +1818,7 @@ _theme: buttonBg: "ボタンの背景" buttonHoverBg: "ボタンの背景 (ホバー)" inputBorder: "入力ボックスの縁取り" + listItemHoverBg: "リスト項目の背景 (ホバー)" driveFolderBg: "ドライブフォルダーの背景" wallpaperOverlay: "壁紙のオーバーレイ" badge: "バッジ" @@ -2002,6 +1830,8 @@ _sfx: note: "ノート" noteMy: "ノート(自分)" notification: "通知" + antenna: "アンテナ受信" + channel: "チャンネル通知" reaction: "ツッコミ選んどるとき" _soundSettings: driveFile: "ドライブん中の音使う" @@ -2010,7 +1840,6 @@ _soundSettings: driveFileTypeWarnDescription: "音声ファイルを選びや" driveFileDurationWarn: "音が長すぎるわ" driveFileDurationWarnDescription: "長い音使うたらMisskey使うのに良うないかもしれへんで。それでもええか?" - driveFileError: "音声が読み込めへんかったで。設定を変更せえや" _ago: future: "未来" justNow: "ついさっき" @@ -2040,6 +1869,7 @@ _2fa: registerTOTP: "認証アプリの設定はじめる" step1: "ほんなら、{a}や{b}とかの認証アプリを使っとるデバイスにインストールしてな。" step2: "次に、ここにあるQRコードをアプリでスキャンしてな~。" + step2Click: "QRコード押したら、今使とる端末に入っとる認証アプリとかキーリングに登録できるで。" step2Uri: "デスクトップアプリを使う時は次のURIを入れるで" step3Title: "確認コードを入れてーや" step3: "アプリに映っとる確認コード(トークン)を入れて終わりや。" @@ -2063,7 +1893,6 @@ _2fa: backupCodesDescription: "認証アプリが使用できんなった場合、以下のバックアップコードを使ってアカウントにアクセスできるで。これらのコードは必ず安全な場所に置いときや。各コードは一回だけ使用できるで。" backupCodeUsedWarning: "バックアップコードが使用されたで。認証アプリが使えなくなってるん場合、なるべく早く認証アプリを再設定しや。" backupCodesExhaustedWarning: "バックアップコードが全て使用されたで。認証アプリを利用できん場合、これ以上アカウントにアクセスできなくなるで。認証アプリを再登録しや。" - moreDetailedGuideHere: "詳細なガイドはこちら" _permissions: "read:account": "アカウントの情報を見るで" "write:account": "アカウントの情報を変更するで" @@ -2101,54 +1930,6 @@ _permissions: "write:flash": "Playを操作する" "read:flash-likes": "Playのええやん!を見る" "write:flash-likes": "Playのええやん!を見る" - "read:admin:abuse-user-reports": "ユーザーからの通報を見る" - "write:admin:delete-account": "ユーザーアカウント消す" - "write:admin:delete-all-files-of-a-user": "ユーザーのファイル全部ほかす" - "read:admin:index-stats": "データベースインデックスの情報見る" - "read:admin:table-stats": "データベーステーブルの情報見る" - "read:admin:user-ips": "ユーザーのIPアドレスを見る" - "read:admin:meta": "インスタンスのメタデータ見る" - "write:admin:reset-password": "ユーザーのパスワードをリセット" - "write:admin:resolve-abuse-user-report": "ユーザーからの通報を解決する" - "write:admin:send-email": "メール送る" - "read:admin:server-info": "サーバーの情報見る" - "read:admin:show-moderation-log": "モデレーションログ見る" - "read:admin:show-user": "ユーザーのプライベートな情報見る" - "write:admin:suspend-user": "ユーザーを凍結" - "write:admin:unset-user-avatar": "ユーザーのアバターを削除" - "write:admin:unset-user-banner": "ユーザーのバナーを削除" - "write:admin:unsuspend-user": "ユーザーの凍結解除" - "write:admin:meta": "インスタンスのメタデータいじる" - "write:admin:user-note": "モデレーションノートいじる" - "write:admin:roles": "ロールをいじる" - "read:admin:roles": "ロール見る" - "write:admin:relays": "リレーいじる" - "read:admin:relays": "リレー見る" - "write:admin:invite-codes": "招待コードいじる" - "read:admin:invite-codes": "招待コード見る" - "write:admin:announcements": "お知らせいじる" - "read:admin:announcements": "お知らせ見る" - "write:admin:avatar-decorations": "アバターデコレーションをいじる" - "read:admin:avatar-decorations": "アバターデコレーション見る" - "write:admin:federation": "連合の情報いじる" - "write:admin:account": "ユーザーアカウントいじる" - "read:admin:account": "ユーザーの情報見る" - "write:admin:emoji": "絵文字いじる" - "read:admin:emoji": "絵文字見る" - "write:admin:queue": "ジョブキューいじる" - "read:admin:queue": "ジョブキューの情報見る" - "write:admin:promo": "プロモーションノートいじる" - "write:admin:drive": "ユーザーのドライブいじる" - "read:admin:drive": "ユーザーのドライブの情報見る" - "read:admin:stream": "管理者用のWebsocket API使う" - "write:admin:ad": "広告いじる" - "read:admin:ad": "広告見る" - "write:invite-codes": "招待コード作る" - "read:invite-codes": "招待コード取得" - "write:clip-favorite": "クリップのいいねいじる" - "read:clip-favorite": "クリップのいいね見る" - "read:federation": "連合の情報取得" - "write:report-abuse": "違反報告" _auth: shareAccessTitle: "アプリへのアクセス許してやったらどうや" shareAccess: "「{name}」がアカウントにアクセスすることを許可してええか?" @@ -2162,9 +1943,9 @@ _auth: _antennaSources: all: "みんなのノート" homeTimeline: "フォローしとるユーザーのノート" - users: "選んだ一人か複数のユーザーのノート" + users: "選らんだ一人か複数のユーザーのノート" userList: "選んだリストのユーザーのノート" - userBlacklist: "選んだ一人か複数のユーザーを除いた全てのノート" + userBlacklist: "選んだ1人か複数のユーザーのノート" _weekday: sunday: "日曜日" monday: "月曜日" @@ -2267,13 +2048,9 @@ _profile: changeBanner: "バナー画像を変更するで" verifiedLinkDescription: "内容をURLに設定すると、リンク先のwebサイトに自分のプロフのリンクが含まれてる場合に所有者確認済みアイコンを表示させることができるで。" avatarDecorationMax: "最大{max}つまでデコつけれんで" - followedMessage: "フォローされたら返すメッセージ" - followedMessageDescription: "フォローされたときに相手に返す短めのメッセージを決めれるで。" - followedMessageDescriptionForLockedAccount: "フォローが承認制なら、フォローリクエストをOKしたときに見せるで。" _exportOrImport: allNotes: "全てのノート" favoritedNotes: "お気に入りにしたノート" - clips: "クリップ" followingList: "フォロー" muteList: "ミュート" blockingList: "ブロック" @@ -2327,7 +2104,6 @@ _play: title: "タイトル" script: "スクリプト" summary: "説明" - visibilityDescription: "非公開に設定するとプロフィールに表示されへんくなるけど、URLを知っとる人は引き続きアクセスできるで。" _pages: newPage: "ページを作る" editPage: "ページの編集" @@ -2362,7 +2138,6 @@ _pages: eyeCatchingImageSet: "アイキャッチ画像を設定" eyeCatchingImageRemove: "アイキャッチ画像を削除" chooseBlock: "ブロックを追加" - enterSectionTitle: "セクションタイトルを入れる" selectType: "種類を選択" contentBlocks: "コンテンツ" inputBlocks: "入力" @@ -2373,8 +2148,6 @@ _pages: section: "セクション" image: "画像" button: "ボタン" - dynamic: "動的ブロック" - dynamicDescription: "このブロックは廃止されとるで。今後は{play}を利用してや。" note: "ノート埋め込み" _note: id: "ノートID" @@ -2396,7 +2169,6 @@ _notification: pollEnded: "アンケートの結果が出たみたいや" newNote: "さらの投稿" unreadAntennaNote: "アンテナ {name}" - roleAssigned: "ロールが付与されたで" emptyPushNotificationMessage: "プッシュ通知の更新をしといたで" achievementEarned: "実績を獲得しとるで" testNotification: "通知テスト" @@ -2404,39 +2176,30 @@ _notification: sendTestNotification: "テスト通知を送信するで" notificationWillBeDisplayedLikeThis: "通知はこのように表示されるで" reactedBySomeUsers: "{n}人がツッコんだで" - likedBySomeUsers: "{n}人がいいねしたで" renotedBySomeUsers: "{n}人がリノートしたで" followedBySomeUsers: "{n}人にフォローされたで" - flushNotification: "通知の履歴をリセットする" - exportOfXCompleted: "{x}のエクスポートが終わったわ" - login: "ログインしとったで" _types: all: "すべて" note: "あんたらの新規投稿" follow: "フォロー" mention: "メンション" reply: "リプライ" - renote: "リノート" + renote: "Renote" quote: "引用" reaction: "ツッコミ" pollEnded: "アンケートが終了したで" receiveFollowRequest: "フォロー許可してほしいみたいやで" followRequestAccepted: "フォローが受理されたで" - roleAssigned: "ロールが付与された" achievementEarned: "実績の獲得" - exportCompleted: "エクスポート終わった" - login: "ログイン" - test: "通知テスト" app: "連携アプリからの通知や" _actions: followBack: "フォローバック" reply: "返事" - renote: "リノート" + renote: "Renote" _deck: alwaysShowMainColumn: "いつもメインカラムを表示" columnAlign: "カラムの寄せ" addColumn: "カラムを追加" - newNoteNotificationSettings: "新着ノート通知の設定" configureColumn: "カラムの設定" swapLeft: "左に移動" swapRight: "右に移動" @@ -2475,10 +2238,9 @@ _drivecleaner: orderByCreatedAtAsc: "追加日の古い順" _webhookSettings: createWebhook: "Webhookをつくる" - modifyWebhook: "Webhookを編集" name: "名前" secret: "シークレット" - trigger: "トリガー" + events: "Webhookを投げるタイミング" active: "有効" _events: follow: "フォローしたとき~!" @@ -2488,29 +2250,6 @@ _webhookSettings: renote: "リノートされるとき~!" reaction: "ツッコまれたとき~!" mention: "メンションがあるとき~!" - _systemEvents: - abuseReport: "ユーザーから通報があったとき" - abuseReportResolved: "ユーザーからの通報を処理したとき" - userCreated: "ユーザーが作成されたとき" - inactiveModeratorsWarning: "モデレーターがしばらくおらんかったとき" - inactiveModeratorsInvitationOnlyChanged: "モデレーターがしばらくおらんかったから、システムが招待制に変えたとき" - deleteConfirm: "ほんまにWebhookをほかしてもええんか?" - testRemarks: "スイッチ右のボタンを押すとダミーデータを使ったテスト用Webhookを送れるで。" -_abuseReport: - _notificationRecipient: - createRecipient: "通報の通知先を追加" - modifyRecipient: "通報の通知先を編集" - recipientType: "通知先の種類" - _recipientType: - mail: "メール" - webhook: "Webhook" - _captions: - mail: "モデレーター権限を持つユーザーのメアドに通知を送るで(通報を受けた時のみ)" - webhook: "指定したSystemWebhookに通知を送るで(通報を受けた時と通報を解決した時にそれぞれ発信)" - keywords: "キーワード" - notifiedUser: "通知先ユーザー" - notifiedWebhook: "使用するWebhook" - deleteConfirm: "通知先を削除してもええか?" _moderationLogTypes: createRole: "ロールを追加すんで" deleteRole: "ロールほかす" @@ -2535,12 +2274,9 @@ _moderationLogTypes: resetPassword: "パスワードをリセット" suspendRemoteInstance: "リモートサーバーを止めんで" unsuspendRemoteInstance: "リモートサーバーを再開すんで" - updateRemoteInstanceNote: "リモートサーバーのモデレーションノート更新" markSensitiveDriveFile: "ファイルをセンシティブ付与" unmarkSensitiveDriveFile: "ファイルをセンシティブ解除" resolveAbuseReport: "苦情を解決" - forwardAbuseReport: "通報を転送" - updateAbuseReportNote: "通報のモデレーションノート更新" createInvitation: "招待コード作る" createAd: "広告を作んで" deleteAd: "広告ほかす" @@ -2550,16 +2286,6 @@ _moderationLogTypes: deleteAvatarDecoration: "アイコンデコレーションを削除" unsetUserAvatar: "この子のアイコン元に戻す" unsetUserBanner: "この子のバナー元に戻す" - createSystemWebhook: "SystemWebhookを作成" - updateSystemWebhook: "SystemWebhookを更新" - deleteSystemWebhook: "SystemWebhookを削除" - createAbuseReportNotificationRecipient: "通報の通知先作る" - updateAbuseReportNotificationRecipient: "通報の通知先更新" - deleteAbuseReportNotificationRecipient: "通報の通知先消す" - deleteAccount: "アカウント消す" - deletePage: "ページ消す" - deleteFlash: "Playをほかす" - deleteGalleryPost: "ギャラリーの投稿をほかす" _fileViewer: title: "ファイルの詳しい情報" type: "ファイルの種類" @@ -2622,91 +2348,3 @@ _dataSaver: _code: title: "コードハイライト" description: "MFMとかでコードハイライト記法が使われてるとき、タップするまで読み込まれへんくなるで。コードハイライトではハイライトする言語ごとにその決めてるファイルを読む必要はあんねんな。けどな、それは自動で読み込まれなくなるから、通信量を少なくできることができるねん。" -_hemisphere: - N: "北半球" - S: "南半球" - caption: "一部のクライアント設定で、季節を判定するのに使用するで。" -_reversi: - reversi: "リバーシ" - gameSettings: "対局の設定" - chooseBoard: "ボードを選択" - blackOrWhite: "先行/後攻" - blackIs: "{name}が黒(先行)" - rules: "ルール" - thisGameIsStartedSoon: "対局、そろそろ開始されるで。" - waitingForOther: "相手の準備が完了するのを待ってんで。" - waitingForMe: "あんさんの準備が完了すんのを待ってんで" - waitingBoth: "準備してなー" - ready: "準備完了" - cancelReady: "準備を再開" - opponentTurn: "相手のターンやで" - myTurn: "あんさんのターンや" - turnOf: "{name}のターンやで" - pastTurnOf: "{name}のターン" - surrender: "投了" - surrendered: "投了により" - timeout: "時間切れ" - drawn: "引き分け" - won: "{name}の勝ち" - black: "黒" - white: "白" - total: "合計" - turnCount: "{count}ターン目" - myGames: "自分の対局" - allGames: "みんなの対局" - ended: "終了" - playing: "対局中" - isLlotheo: "石の少ない方が勝ち(ロセオ)" - loopedMap: "ループマップ" - canPutEverywhere: "どこでも置けるモード" - timeLimitForEachTurn: "1ターンの時間制限" - freeMatch: "フリーマッチ" - lookingForPlayer: "対戦相手を探してるで" - gameCanceled: "対局がキャンセルされたわ" - shareToTlTheGameWhenStart: "初めの時に対局をタイムラインに投稿するで" - iStartedAGame: "対局し始めたで! #MisskeyReversi" - opponentHasSettingsChanged: "相手が設定変えたで" - allowIrregularRules: "変則許可 (完全フリー)" - disallowIrregularRules: "変則なし" - showBoardLabels: "盤面に行・列番号を表示" - useAvatarAsStone: "石をアイコンにする" -_offlineScreen: - title: "オフライン - サーバーに接続できひんで" - header: "サーバーに接続できへんわ" -_urlPreviewSetting: - title: "URLプレビューの設定" - enable: "URLプレビューを有効にする" - timeout: "プレビュー取得時のタイムアウト(ms)" - timeoutDescription: "プレビュー取得の所要時間がこの値を超えた場合、プレビューは生成されへんで。" - maximumContentLength: "Content-Lengthの最大値(byte)" - maximumContentLengthDescription: "Content-Lengthがこの値を超えた場合、プレビューは生成されへんで。" - requireContentLength: "Content-Lengthが取得できた場合のみプレビューを生成" - requireContentLengthDescription: "相手サーバがContent-Lengthを返さない場合、プレビューは生成されへんで。" - userAgent: "User-Agent" - userAgentDescription: "プレビュー取得時に使用されるUser-Agentを設定するで。空欄の場合、デフォルトのUser-Agentが使用されるで。" - summaryProxy: "プレビューを生成するプロキシのエンドポイント" - summaryProxyDescription: "Misskey本体やなく、サマリープロキシを使用してプレビューを生成するで。" - summaryProxyDescription2: "プロキシには下記パラメータがクエリ文字列として連携されるで。プロキシ側がこれらをサポートせえへんときは、設定値は無視されるで。" -_mediaControls: - pip: "ピクチャインピクチャ" - playbackRate: "再生速度" - loop: "ループ再生" -_contextMenu: - title: "コンテキストメニュー" - app: "アプリ" - appWithShift: "Shiftキーでアプリ" - native: "ブラウザのUI" -_embedCodeGen: - title: "埋め込みコードをカスタム" - header: "ヘッダー出す" - autoload: "勝手に続きを読み込む(非推奨)" - maxHeight: "高さの最大値" - maxHeightDescription: "0は最大値を指定せえへんけど、ウィジェットが伸び続けるから絶対1以上にしといてや。" - maxHeightWarn: "高さの最大値が無効になっとるで。意図してへん変更なら、普通の値に戻してや。" - previewIsNotActual: "プレビュー画面で出せる範囲をはみ出したから、ホンマの表示とはちゃうとおもうで。" - rounded: "角丸める" - border: "外枠に枠線つける" - applyToPreview: "プレビューに反映" - generateCode: "埋め込みコード作る" - codeGenerated: "コード作ったで" - codeGeneratedDescription: "作ったコードはウェブサイトに貼っつけて使ってや。" diff --git a/locales/kab-KAB.yml b/locales/kab-KAB.yml index d4aa36fa70..22e24d3baa 100644 --- a/locales/kab-KAB.yml +++ b/locales/kab-KAB.yml @@ -104,7 +104,3 @@ _deck: _columns: notifications: "Ilɣuyen" list: "Tibdarin" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "Imayl" diff --git a/locales/kn-IN.yml b/locales/kn-IN.yml index 222599572a..b3ad46f2b1 100644 --- a/locales/kn-IN.yml +++ b/locales/kn-IN.yml @@ -77,8 +77,6 @@ _profile: username: "ಬಳಕೆಹೆಸರು" _notification: youWereFollowed: "ಹಿಂಬಾಲಿಸಿದರು" - _types: - login: "ಪ್ರವೇಶ" _actions: reply: "ಉತ್ತರಿಸು" _deck: diff --git a/locales/ko-GS.yml b/locales/ko-GS.yml index 1f7faba23a..566667ba79 100644 --- a/locales/ko-GS.yml +++ b/locales/ko-GS.yml @@ -16,8 +16,8 @@ cancel: "아이예" noThankYou: "뎃어예" enterUsername: "사용자 이럼 서기" renotedBy: "{user}님이 리노트햇어예" -noNotes: "노트가 어ᇝ십니다" -noNotifications: "알림이 어ᇝ십니다" +noNotes: "노트가 없십니다" +noNotifications: "알림이 없십니다" instance: "서버" settings: "설정" notificationSettings: "알림 설정" @@ -26,7 +26,7 @@ otherSettings: "다린 설정" openInWindow: "창서 옐기" profile: "프로필" timeline: "타임라인" -noAccountDescription: "자기소개가 어ᇝ십니다" +noAccountDescription: "자기소개가 없십니다" login: "로그인" loggingIn: "로그인하고 잇어예" logout: "로그아웃" @@ -40,7 +40,7 @@ favorites: "질겨찾기" unfavorite: "질겨찾기서 어ᇝ애기" favorited: "질겨찾기에 담앗십니다." alreadyFavorited: "벌시로 질겨찾기에 담기 잇십니다." -cantFavorite: "질겨찾기에 몬 담앗십니다." +cantFavorite: "질겨찾기에 몬 담았십니다." pin: "프로필에 붙이기" unpin: "프로필서 띠기" copyContent: "내용 복사하기" @@ -80,7 +80,7 @@ unfollowConfirm: "{name}님얼 고마 팔로잉합니꺼?" exportRequested: "내가기 요청얼 햇십니다. 시간이 쪼매 걸릴 깁니다. 요청이 껕나모 ‘드라이브’에 옇십니다." importRequested: "가오기 요청얼 햇십니다. 시간이 쪼매 걸릴 깁니다." lists: "리스트" -noLists: "리스트가 어ᇝ십니다" +noLists: "리스트가 없십니다" note: "노트" notes: "노트" following: "팔로잉" @@ -124,7 +124,6 @@ reactions: "반엉" reactionSettingDescription2: "꺼시서 두고, 누질라서 뭉캐고, ‘+’럴 누질라서 옇십니다." rememberNoteVisibility: "공개 범위럴 기억하기" attachCancel: "붙임 빼기" -deleteFile: "파일 뭉캐기" markAsSensitive: "수ᇚ힘 설정" unmarkAsSensitive: "수ᇚ힘 무루기" enterFileName: "파일 이럼 서기" @@ -161,7 +160,7 @@ youCanCleanRemoteFilesCache: "파일 간리으 🗑️ 모냥얼 누질리모 cacheRemoteSensitiveFiles: "웬겍으 수ᇚ힌 파일얼 캐시하기" cacheRemoteSensitiveFilesDescription: "요 설정얼 꺼모 웬겍 수ᇚ힌 파일이 캐시하지 아이하고 바리 링크합니다." flagAsBot: "자동 게정입니다" -flagAsBotDescription: "요 게정얼 프로그램서 설라먼 키야 합니다. 키모 다런 개발자가 반엉얼 끋어ᇝ이 데풀이하지 몬 하게 도아 줄 수 잇고 Misskey으 시스템서 자동 게정이 뎁니다." +flagAsBotDescription: "요 게정얼 프로그램서 설라먼 키야 합니다. 키모 다런 개발자가 반엉얼 끋없이 데풀이하지 몬 하게 도아 줄 수 잇고 Misskey으 시스템서 자동 게정이 뎁니다." flagAsCat: "애웅애웅애웅애웅!" flagAsCatDescription: "애옹?" flagShowTimelineReplies: "타임라인서 노트으 답하기 보기" @@ -176,7 +175,7 @@ wallpaper: "벡지" setWallpaper: "벡지 설정" removeWallpaper: "벡지 뭉캐기" searchWith: "찾기: {q}" -youHaveNoLists: "리스트가 어ᇝ십니다" +youHaveNoLists: "리스트가 없십니다" followConfirm: "{name}님얼 팔로잉합니꺼?" proxyAccount: "프락시 게정" proxyAccountDescription: "프락시 게정언 턱벨한 조겐서 웬겍 팔로잉얼 하넌 게정입니다. 사용자가 웬겍 사용자럴 리스트에 옇얼 때 리스트에 옇언 사용자럴 누도 팔로잉 아이하모 할동이 서버로 아이 오니께 요 게정이 아인 프락시 게정얼 팔로잉하게 합니다." @@ -210,17 +209,17 @@ instanceInfo: "서버 정보" statistics: "통게" clearQueue: "대기옐 비우기" clearQueueConfirmTitle: "대기옐얼 비웁니꺼?" -clearQueueConfirmText: "대기옐에 잇넌 걸얼 아이 보냅니다. 흐이 요 동작언 할 필요가 어ᇝ십니다." +clearQueueConfirmText: "대기옐에 잇넌 걸얼 아이 보냅니다. 흐이 요 동작언 할 필요가 없십니다." clearCachedFiles: "캐시 비우기" clearCachedFilesConfirm: "캐시한 웬겍 파일얼 말캉 뭉캡니꺼?" blockedInstances: "차단한 서버" blockedInstancesDescription: "차단할라넌 서버으 호스트럴 줄 바꿈해서로 비이 줍니다. 차단한 서버넌 요 서버하고 교류 몬 합니다." silencedInstances: "수ᇚ훈 서버" -silencedInstancesDescription: "수ᇚ훌라넌 서버으 호스트럴 줄 바꿈해서로 비이 줍니다. 수ᇚ훈 서버으 게정언 말캉 ‘수ᇚ후기’가 데서 팔로잉 요청만 데고 팔로워가 아인 로컬 게정서 멘션얼 몬 합니다. 차단한 서버넌 상간 어ᇝ십니다." +silencedInstancesDescription: "수ᇚ훌라넌 서버으 호스트럴 줄 바꿈해서로 비이 줍니다. 수ᇚ훈 서버으 게정언 말캉 ‘수ᇚ후기’가 데서 팔로잉 요청만 데고 팔로워가 아인 로컬 게정서 멘션얼 몬 합니다. 차단한 서버넌 상간 없십니다." muteAndBlock: "수ᇚ훔하고 차단" mutedUsers: "수ᇚ훈 사용자" blockedUsers: "차단한 사용자" -noUsers: "사용자가 어ᇝ십니다" +noUsers: "사용자가 없십니다" editProfile: "프로필 적기" noteDeleteConfirm: "요 노트럴 뭉캡니꺼?" pinLimitExceeded: "더 몬 붙입니다" @@ -230,15 +229,15 @@ processing: "처리하고 잇어예" preview: "미리보기" default: "기본값" defaultValueIs: "기본값: {value}" -noCustomEmojis: "이모지가 어ᇝ십니다" -noJobs: "작업이 어ᇝ십니다" +noCustomEmojis: "이모지가 없십니다" +noJobs: "작업이 없십니다" federating: "옌합하고 잇어예" blocked: "차단햇어예" suspended: "고만 보내예" all: "말캉" subscribing: "구독하고 잇어예" publishing: "보내고 잇어예" -notResponding: "답이 어ᇝ어예" +notResponding: "답이 없어예" instanceFollowing: "서버으 팔로잉" instanceFollowers: "서버으 팔로워" instanceUsers: "서버으 사용자" @@ -275,7 +274,7 @@ uploadFromUrlRequested: "올리기럴 요청햇십니다" uploadFromUrlMayTakeTime: "올리기가 껕날라먼 시간이 쪼매 걸릴 깁니다." explore: "살펴보기" messageRead: "이럿어예" -noMoreHistory: "요카마 옛날 기록이 어ᇝ십니다" +noMoreHistory: "요카마 엣날 기록이 없십니다" startMessaging: "대화하기" nUsersRead: "{n}멩이 이럿십니다" agreeTo: "{0}에 동이하기" @@ -374,8 +373,6 @@ hcaptcha: "에이치캡차" enableHcaptcha: "에이치캡차 키기" hcaptchaSiteKey: "사이트키" hcaptchaSecretKey: "시크릿키" -mcaptchaSiteKey: "사이트키" -mcaptchaSecretKey: "시크릿키" recaptcha: "리캡차" enableRecaptcha: "리캡차 키기" recaptchaSiteKey: "사이트키" @@ -432,28 +429,28 @@ securityKey: "보안키" lastUsed: "마지막 쓰임" lastUsedAt: "마지막 쓰임: {t}" unregister: "맨걸기 무루기" -passwordLessLogin: "비밀번호 어ᇝ이 로그인" -passwordLessLoginDescription: "비밀번호 어ᇝ이 보안 키나 패스 키만 서서 로그인합니다." +passwordLessLogin: "비밀번호 없시 로그인" +passwordLessLoginDescription: "비밀번호 말고 보안키나 패스키 같은 것만 써 가 로그인합니다." resetPassword: "비밀번호 재설정" -newPasswordIs: "새 비밀번호넌 ‘{password}’입니다" +newPasswordIs: "새 비밀번호는 \"{password}\" 입니다" reduceUiAnimation: "화면 움직임 효과들을 수ᇚ후기" share: "노누기" notFound: "몬 찾앗십니다" -notFoundDescription: "선 주소에 맞넌 페이지가 어ᇝ십니다." -uploadFolder: "기본 올리기 위치" -markAsReadAllNotifications: "모던 알림얼 읽엄 포시" -markAsReadAllUnreadNotes: "모던 걸얼 읽엄 포시" -markAsReadAllTalkMessages: "모던 대화 읽엄 포시" +notFoundDescription: "고런 주소로 들어가는 하멘은 없십니다." +uploadFolder: "기본 업로드 위치" +markAsReadAllNotifications: "모든 알림 이럿다고 표시" +markAsReadAllUnreadNotes: "모든 글 이럿다고 표시" +markAsReadAllTalkMessages: "모든 대화 이럿다고 표시" help: "도움말" -inputMessageHere: "옇다 메시지럴 서이소" -close: "꺼기" +inputMessageHere: "여따가 메시지를 입력해주이소" +close: "닫기" invites: "초대하기" -members: "구성원" -transfer: "넘구기" +members: "멤버" +transfer: "양도" title: "제목" -text: "걸" +text: "글" enable: "키기" -next: "다엄" +next: "다음" retype: "다시 서기" noteOf: "{user}님으 노트" quoteAttached: "따옴" @@ -464,11 +461,8 @@ onlyOneFileCanBeAttached: "메시지엔 파일 하나까제밖에 몬 넣십니 invitations: "초대하기" invitationCode: "초대장" checking: "학인하고 잇십니다" -tooShort: "억수로 짜립니다" -tooLong: "억수로 집니다" passwordMatched: "맞십니다" passwordNotMatched: "안 맞십니다" -signinWith: "{x} 서 로그인" signinFailed: "로그인 몬 했십니다. 고 이름이랑 비밀번호 제대로 썼는가 확인해 주이소." or: "아니면" language: "언어" @@ -476,6 +470,7 @@ uiLanguage: "UI 표시 언어" aboutX: "{x}에 대해서" emojiStyle: "이모지 모양" native: "기본" +disableDrawer: "드로어 메뉴 쓰지 않기" showNoteActionsOnlyHover: "마우스 올맀을 때만 노트 액션 버턴 보이기" noHistory: "기록이 없십니다" signinHistory: "로그인 기록" @@ -512,13 +507,13 @@ useObjectStorage: "오브젝트 스토리지 키기" objectStorageBaseUrl: "Base URL" objectStorageBaseUrlDesc: "오브젝트 (미디어) 참조 링크 만들 때 쓰는 URL임다. CDN 내지 프락시를 쓴다 카멘은 그 URL을 갖다 늫고, 아이면 써먹을 서비스네 가이드를 봐봐가 공개적으로 접근할 수 있는 주소를 여 넣어 주이소. 그니께, 내가 AWS S3을 쓴다 카면은 'https://.s3.amazonaws.com', GCS를 쓴다 카면 'https://storage.googleapis.com/' 처럼 쓰믄 되입니더." objectStorageBucket: "Bucket" -objectStorageBucketDesc: "설 서비스으 버킷 이럼얼 서 주이소." +objectStorageBucketDesc: "써먹을 서비스의 바께쓰 이름을 여 써 주이소." objectStoragePrefix: "Prefix" objectStoragePrefixDesc: "요 Prefix 디렉토리 안에다가 파일이 들어감다." objectStorageEndpoint: "Endpoint" -objectStorageEndpointDesc: "AWS S3넌 비아 두고 다런 것언 거 서비스으 엔드포인트럴 서 주이소. ‘’나 ‘:’맨치로 섭니다." +objectStorageEndpointDesc: "AWS S3을 쓸라멘 요는 비워두고, 아이멘은 그 서비스 가이드에 맞게 endpoint를 넣어 주이소. '' 내지 ':'처럼 넣십니다." objectStorageRegion: "Region" -objectStorageRegionDesc: "‘xx-east-1’맨치로 리전 이럼얼 서 주이소. 설 서비스에 리전 개넴이 어ᇝ어먼 ‘us-east-1’라고 해 두이소. 에이더블유에스 설정 파일이나 환겡 벤수가 이ᇇ어면 비아 두이소." +objectStorageRegionDesc: "'xx-east-1' 같은 region 이름을 옇어 주이소. 써먹을 서비스에 region 개념 같은 게 읎다! 카면은 대신에 'us-east-1'을 옇어 놓으이소. AWS 설정 파일이나 환경 변수를 갖다 끌어다 쓸 거면은 요는 비워 두이소." objectStorageUseSSL: "SSL 쓰기" objectStorageUseSSLDesc: "API 호출할 때 HTTPS 안 쓸거면은 꺼 두이소" objectStorageUseProxy: "연결에 프락시 사용" @@ -534,21 +529,21 @@ newNoteRecived: "새 노트 있어예" sounds: "소리" sound: "소리" listen: "듣기" -none: "어ᇝ엄" +none: "없음" showInPage: "바닥서 보기" popout: "새 창 열기" volume: "음량" masterVolume: "대빵 음량" notUseSound: "음소거하기" useSoundOnlyWhenActive: "Misskey가 활성화되어 있을 때만 소리 내기" -details: "자세히" -chooseEmoji: "이모지 개리기" +details: "좀 더" +chooseEmoji: "이모지 선택" unableToProcess: "작업 다 몬 했십니다" recentUsed: "최근 쓴 놈" install: "설치" uninstall: "삭제" installedApps: "설치된 애플리케이션" -nothing: "어ᇝ어예" +nothing: "뭣도 없어예" installedDate: "설치한 날" lastUsedDate: "마지막 사용" state: "상태" @@ -574,17 +569,9 @@ userSilenced: "요 게정은... 수ᇚ혀 있십니다." relays: "릴레이" addRelay: "릴레이 옇기" addedRelays: "옇은 릴레이" -deletedNote: "뭉캔 걸" enableInfiniteScroll: "알아서 더 보기" -useCw: "내용 수ᇚ후기" -description: "설멩" -describeFile: "캡션 옇기" -enterFileDescription: "캡션 서기" author: "맨던 사람" manage: "간리" -large: "커게" -medium: "엔갆게" -small: "쪼맪게" emailServer: "전자우펜 서버" email: "전자우펜" emailAddress: "전자우펜 주소" @@ -601,7 +588,7 @@ reportAbuseOf: "{name}님얼 신고하기" reporter: "신고한 사람" reporteeOrigin: "신고덴 사람" reporterOrigin: "신고한 곳" -waitingFor: "{x}(얼)럴 지달리고 잇십니다" +forwardReport: "웬겍 서버에 신고 보내기" random: "무작이" system: "시스템" clip: "클립 맨걸기" @@ -611,21 +598,14 @@ renotesCount: "리노트한 수" renotedCount: "리노트덴 수" followingCount: "팔로우 수" followersCount: "팔로워 수" -noteFavoritesCount: "질겨찾기한 노트 수" clips: "클립 맨걸기" clearCache: "캐시 비우기" -nUsers: "{n} 사용자" -typingUsers: "{users} 님이 서고 잇어예" unlikeConfirm: "좋네예럴 무룹니꺼?" info: "정보" -selectAccount: "계정 개리기" user: "사용자" administration: "간리" -middle: "엔갆게" -translatedFrom: "{x}서 번옉" on: "킴" off: "껌" -hide: "수ᇚ후기" clickToFinishEmailVerification: "[{ok}]럴 누질라서 전자우펜 정멩얼 껕내이소." searchByGoogle: "찾기" tenMinutes: "십 분" @@ -634,9 +614,6 @@ oneDay: "하리" oneWeek: "한 주" oneMonth: "한 달" file: "파일" -typeToConfirm: "게속할라먼 {x}럴 누질라 주이소" -pleaseSelect: "개리 주이소" -remoteOnly: "웬겍만" tools: "도구" like: "좋네예!" unlike: "좋네예 무루기" @@ -644,22 +621,12 @@ numberOfLikes: "좋네예 수" show: "보기" roles: "옉할" role: "옉할" -noRole: "옉할이 어ᇝ십니다" +noRole: "옉할이 없십니다" thisPostMayBeAnnoyingCancel: "아이예" likeOnly: "좋네예마" -hiddenTags: "수ᇚ훈 해시태그" -myClips: "내 클립" -preservedUsernames: "예약 사용자 이럼" -specifyUser: "사용자 지정" icon: "아바타" replies: "답하기" renotes: "리노트" -attach: "옇기" -surrender: "아이예" -_delivery: - stop: "고만 보내예" - _type: - none: "보내고 잇어예" _initialAccountSetting: startTutorial: "길라잡이 하기" _initialTutorial: @@ -672,62 +639,9 @@ _initialTutorial: title: "길라잡이가 껕낫십니다!🎉" _achievements: _types: - _notes1: - description: "첫 노트럴 섯어예" - _notes10: - description: "노트럴 10번 섰어예" - _notes100: - description: "노트럴 100번 섰어예" - _notes500: - description: "노트럴 500번 섰어예" - _notes1000: - description: "노트럴 1,000번 섰어예" - _notes5000: - description: "노트럴 5,000번 섰어예" - _notes10000: - description: "노트럴 10,000번 섰어예" - _notes20000: - description: "노트럴 20,000번 섰어예" - _notes30000: - description: "노트럴 30,000번 섰어예" - _notes40000: - description: "노트럴 40,000번 섰어예" - _notes50000: - description: "노트럴 50,000번 섰어예" - _notes60000: - description: "노트럴 60,000번 섰어예" - _notes70000: - description: "노트럴 70,000번 섰어예" - _notes80000: - description: "노트럴 80,000번 섰어예" - _notes90000: - description: "노트럴 90,000번 섰어예" - _notes100000: - description: "노트럴 100,000번 섰어예" - _noteClipped1: - description: "첫 노트럴 클립햇어예" - _noteFavorited1: - description: "첫 노트럴 질겨찾기에 담앗어예" - _myNoteFavorited1: - description: "다런 사람이 내 노트럴 질겨찾기에 담앗십니다" - _iLoveMisskey: - description: "“I ❤ #Misskey”럴 섰어예" - _postedAt0min0sec: - description: "0분 0초에 노트를 섰어예" _tutorialCompleted: description: "길라잡이럴 껕냇십니다" -_role: - displayOrder: "보기 순서" - _priority: - middle: "엔갆게" - _options: - canHideAds: "강고 수ᇚ후기" - _condition: - isRemote: "웬겍 사용자" - isCat: "갱이 사용자" - isBot: "자동 사용자" _gallery: - my: "내 걸" liked: "좋네예한 걸" like: "좋네예!" unlike: "좋네예 무루기" @@ -738,24 +652,15 @@ _serverDisconnectedBehavior: reload: "알아서 새로곤침" _channel: removeBanner: "배너 뭉캐기" - usersCount: "{n}명 참여" - notesCount: "노트 {n}개" -_menuDisplay: - hide: "수ᇚ후기" _theme: - description: "설멩" keys: mention: "멘션" _sfx: note: "새 노트" notification: "알림" - reaction: "리액션 개리기" _2fa: step3Title: "학인 기호럴 서기" renewTOTPCancel: "뎃어예" -_permissions: - "read:favorites": "질겨찾기 보기" - "write:favorites": "질겨찾기 곤치기" _widgets: profile: "프로필" instanceInfo: "서버 정보" @@ -767,22 +672,14 @@ _widgets: _userList: chooseList: "리스트 개리기" _cw: - hide: "수ᇚ후기" show: "더 볼래예" - chars: "걸자 {count}개" - files: "파일 {count}개" _visibility: home: "덜머리" followers: "팔로워" -_postForm: - _placeholders: - e: "옇다 서 주이소" _profile: name: "이럼" username: "사용자 이럼" _exportOrImport: - favoritedNotes: "질겨찾기한 노트" - clips: "클립 맨걸기" followingList: "팔로잉" muteList: "수ᇚ후기" blockingList: "차단하기" @@ -792,30 +689,23 @@ _charts: _timelines: home: "덜머리" _play: - my: "내 플레이" script: "스크립트" - summary: "설멩" _pages: like: "좋네예" unlike: "좋네예 무루기" - my: "내 페이지" blocks: image: "이미지" _note: id: "노트 아이디" _notification: youWereFollowed: "새 팔로워가 잇십니다" - newNote: "새 걸" _types: follow: "팔로잉" mention: "멘션" - renote: "리노트" quote: "따오기" reaction: "반엉" - login: "로그인" _actions: reply: "답하기" - renote: "리노트" _deck: _columns: notifications: "알림" @@ -825,19 +715,9 @@ _deck: mentions: "받언 멘션" _webhookSettings: name: "이럼" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "전자우펜" _moderationLogTypes: suspend: "얼우기" deleteNote: "노트 뭉캐기" deleteUserAnnouncement: "사용자 공지 걸 뭉캐기" resetPassword: "비밀번호 재설정" resolveAbuseReport: "신고 해겔하기" -_reversi: - reversi: "리버시" - chooseBoard: "보드 개리기" - black: "꺼멍" - white: "허영" - total: "합게" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 414202adab..4a13012eed 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -8,9 +8,6 @@ search: "검색" notifications: "알림" username: "유저명" password: "비밀번호" -initialPasswordForSetup: "초기 설정용 비밀번호" -initialPasswordIsIncorrect: "초기 설정용 비밀번호가 올바르지 않습니다." -initialPasswordForSetupDescription: "Misskey를 직접 설치하는 경우, 설정 파일에 입력해둔 비밀번호를 사용하세요.\nMisskey 설치를 도와주는 호스팅 서비스 등을 사용하는 경우, 서비스 제공자로부터 받은 비밀번호를 사용하세요.\n비밀번호를 따로 설정하지 않은 경우, 아무것도 입력하지 않아도 됩니다." forgotPassword: "비밀번호 재설정" fetchingAsApObject: "연합에서 찾아보는 중" ok: "확인" @@ -41,9 +38,9 @@ addUser: "유저 추가" favorite: "즐겨찾기" favorites: "즐겨찾기" unfavorite: "즐겨찾기에서 제거" -favorited: "즐겨찾기에 등록했습니다." -alreadyFavorited: "이미 즐겨찾기에 등록했습니다." -cantFavorite: "즐겨찾기에 등록하지 못했습니다." +favorited: "즐겨찾기에 등록했습니다" +alreadyFavorited: "이미 즐겨찾기에 등록되어 있습니다" +cantFavorite: "즐겨찾기에 등록하지 못했습니다" pin: "프로필에 고정" unpin: "프로필에서 고정 해제" copyContent: "내용 복사" @@ -56,14 +53,13 @@ addToList: "리스트에 추가" addToAntenna: "안테나에 추가" sendMessage: "메시지 보내기" copyRSS: "RSS 복사" -copyUsername: "유저명 복사" -copyUserId: "유저 ID 복사" +copyUsername: "사용자 이름 복사" +copyUserId: "사용자 ID 복사" copyNoteId: "노트 ID 복사" copyFileId: "파일 ID 복사" copyFolderId: "폴더 ID 복사" copyProfileUrl: "프로필 URL 복사" searchUser: "사용자 검색" -searchThisUsersNotes: "사용자의 노트 검색" reply: "답글" loadMore: "더 보기" showMore: "더 보기" @@ -97,7 +93,7 @@ somethingHappened: "오류가 발생했습니다" retry: "다시 시도" pageLoadError: "페이지를 불러오지 못했습니다." pageLoadErrorDescription: "네트워크 연결 또는 브라우저 캐시로 인해 발생했을 가능성이 높습니다. 캐시를 삭제하거나, 잠시 후 다시 시도해 주세요." -serverIsDead: "서버가 응답하지 않습니다. 잠시 후 다시 시도해 주세요." +serverIsDead: "서버로부터 응답이 없습니다. 잠시 후 다시 시도해주세요." youShouldUpgradeClient: "이 페이지를 표시하려면 새로고침하여 새로운 버전의 클라이언트를 이용해 주십시오." enterListName: "리스트 이름을 입력" privacy: "프라이버시" @@ -112,14 +108,11 @@ enterEmoji: "이모지 입력" renote: "리노트" unrenote: "리노트 취소" renoted: "리노트했습니다" -renotedToX: "{name}명이 리노트했습니다." cantRenote: "이 게시물은 리노트 할 수 없습니다." -cantReRenote: "리노트를 리노트 할 수 없습니다." +cantReRenote: "리노트를 리노트할 수 없습니다." quote: "인용" inChannelRenote: "채널 내 리노트" inChannelQuote: "채널 내 인용" -renoteToChannel: "채널에 리노트" -renoteToOtherChannel: "다른 채널에 리노트" pinnedNote: "고정된 노트" pinned: "고정하기" you: "나" @@ -129,21 +122,20 @@ add: "추가" reaction: "리액션" reactions: "리액션" emojiPicker: "이모지 선택기" -pinnedEmojisForReactionSettingDescription: "리액션을 할 때 이모지 선택기 상단에 표시할 이모지를 설정할 수 있습니다." -pinnedEmojisSettingDescription: "이모지를 입력할 때 이모지 선택기 상단에 표시할 이모지를 설정할 수 있습니다." +pinnedEmojisForReactionSettingDescription: "리액션을 할 때 프로필에 고정하여 표시할 이모지를 설정할 수 있습니다" +pinnedEmojisSettingDescription: "이모지를 입력할 때 프로필에 고정하여 표시할 이모지를 설정할 수 있습니다" emojiPickerDisplay: "선택기 표시" overwriteFromPinnedEmojisForReaction: "리액션 설정을 덮어쓰기" overwriteFromPinnedEmojis: "일반 설정을 덮어쓰기" reactionSettingDescription2: "끌어서 순서 변경, 클릭해서 삭제, +를 눌러서 추가할 수 있습니다." rememberNoteVisibility: "공개 범위를 기억하기" attachCancel: "첨부 취소" -deleteFile: "파일 삭제" markAsSensitive: "열람주의로 설정" unmarkAsSensitive: "열람주의 해제" enterFileName: "파일명을 입력" mute: "뮤트" unmute: "뮤트 해제" -renoteMute: "리노트 뮤트" +renoteMute: "리노트 뮤트하기" renoteUnmute: "리노트 뮤트 해제" block: "차단" unblock: "차단 해제" @@ -158,7 +150,6 @@ editList: "리스트 편집" selectChannel: "채널 선택" selectAntenna: "안테나 선택" editAntenna: "안테나 편집" -createAntenna: "안테나 만들기" selectWidget: "위젯 선택" editWidgets: "위젯 편집" editWidgetsExit: "편집 종료" @@ -177,21 +168,17 @@ cacheRemoteSensitiveFilesDescription: "이 설정을 비활성화하면 리모 flagAsBot: "나는 봇입니다" flagAsBotDescription: "이 계정을 자동화된 수단으로 운용할 경우에 활성화해 주세요. 이 플래그를 활성화하면, 다른 봇이 이를 참고하여 봇 끼리의 무한 연쇄 반응을 회피하거나, 이 계정의 시스템 상에서의 취급이 Bot 운영에 최적화되는 등의 변화가 생깁니다." flagAsCat: "미야아아아오오오오오오오오오옹!!!!!!!" -flagAsCatDescription: "야옹?(이 계정이 고양이라면 눌러 주세요.)" +flagAsCatDescription: "야옹?" flagShowTimelineReplies: "타임라인에 노트의 답글을 표시하기" flagShowTimelineRepliesDescription: "이 설정을 활성화하면 타임라인에 다른 유저 간의 답글을 표시합니다." autoAcceptFollowed: "팔로우 중인 유저로부터의 팔로우 요청을 자동 수락" addAccount: "계정 추가" -reloadAccountsList: "계정 목록 새로고침" +reloadAccountsList: "계정 리스트 정보 갱신" loginFailed: "로그인에 실패했습니다" showOnRemote: "리모트에서 보기" -continueOnRemote: "리모트에서 계속" -chooseServerOnMisskeyHub: "Misskey Hub에서 서버 찾아보기" -specifyServerHost: "서버 도메인 직접 지정" -inputHostName: "도메인을 입력하세요" general: "일반" wallpaper: "배경" -setWallpaper: "배경 설정" +setWallpaper: "배경화면 설정" removeWallpaper: "배경 제거" searchWith: "검색: {q}" youHaveNoLists: "리스트가 없습니다" @@ -199,7 +186,6 @@ followConfirm: "{name}님을 팔로우 하시겠습니까?" proxyAccount: "프록시 계정" proxyAccountDescription: "프록시 계정은 특정 조건 하에서 유저의 리모트 팔로우를 대행하는 계정입니다. 예를 들면, 유저가 리모트 유저를 리스트에 넣었을 때, 리스트에 들어간 유저를 아무도 팔로우한 적이 없다면 액티비티가 서버로 배달되지 않기 때문에, 대신 프록시 계정이 해당 유저를 팔로우하도록 합니다." host: "호스트" -selectSelf: "본인을 선택" selectUser: "유저 선택" recipient: "수신인" annotation: "내용에 대한 주석" @@ -215,7 +201,6 @@ perDay: "1일마다" stopActivityDelivery: "액티비티 보내지 않기" blockThisInstance: "이 서버를 차단" silenceThisInstance: "서버를 사일런스" -mediaSilenceThisInstance: "서버의 미디어를 사일런스" operations: "작업" software: "소프트웨어" version: "버전" @@ -237,10 +222,6 @@ blockedInstances: "차단된 서버" blockedInstancesDescription: "차단하려는 서버의 호스트 이름을 줄바꿈으로 구분하여 설정합니다. 차단된 인스턴스는 이 인스턴스와 통신할 수 없게 됩니다." silencedInstances: "사일런스한 서버" silencedInstancesDescription: "사일런스하려는 서버의 호스트명을 한 줄에 하나씩 입력합니다. 사일런스된 서버에 소속된 유저는 모두 '사일런스'된 상태로 취급되며, 이 서버로부터의 팔로우가 프로필 설정과 무관하게 승인제로 변경되고, 팔로워가 아닌 로컬 유저에게는 멘션할 수 없게 됩니다. 정지된 서버에는 적용되지 않습니다." -mediaSilencedInstances: "미디어를 사일런스한 서버" -mediaSilencedInstancesDescription: "미디어를 사일런스 하려는 서버의 호스트를 한 줄에 하나씩 입력합니다. 미디어가 사일런스된 서버의 유저가 업로드한 파일은 모두 민감한 미디어로 처리되며, 커스텀 이모지를 사용할 수 없게 됩니다. 또한, 차단한 인스턴스에는 적용되지 않습니다." -federationAllowedHosts: "연합을 허가하는 서버" -federationAllowedHostsDescription: "연합을 허가하는 서버의 호스트를 엔터로 구분해서 설정합니다." muteAndBlock: "뮤트 및 차단" mutedUsers: "뮤트한 유저" blockedUsers: "차단한 유저" @@ -265,7 +246,7 @@ publishing: "배포 중" notResponding: "응답 없음" instanceFollowing: "서버의 팔로잉" instanceFollowers: "서버의 팔로워" -instanceUsers: "서버의 사용자" +instanceUsers: "서버의 유저" changePassword: "비밀번호 변경" security: "보안" retypedNotMatch: "입력이 일치하지 않습니다." @@ -281,12 +262,12 @@ lookup: "찾아보기" announcements: "공지사항" imageUrl: "이미지 URL" remove: "삭제" -removed: "삭제했습니다" +removed: "삭제하였습니다" removeAreYouSure: "\"{x}\" 을(를) 삭제하시겠습니까?" deleteAreYouSure: "\"{x}\" 을(를) 삭제하시겠습니까?" resetAreYouSure: "초기화 하시겠습니까?" areYouSure: "계속 진행하시겠습니까?" -saved: "저장했습니다" +saved: "저장하였습니다" messaging: "대화" upload: "업로드" keepOriginalUploading: "원본 이미지를 유지" @@ -297,7 +278,7 @@ uploadFromUrl: "URL 업로드" uploadFromUrlDescription: "업로드하려는 파일의 URL" uploadFromUrlRequested: "업로드를 요청했습니다" uploadFromUrlMayTakeTime: "업로드가 완료될 때까지 시간이 소요될 수 있습니다." -explore: "둘러보기" +explore: "발견하기" messageRead: "읽음" noMoreHistory: "이것보다 과거의 기록이 없습니다" startMessaging: "대화 시작하기" @@ -331,7 +312,6 @@ selectFile: "파일 선택" selectFiles: "파일 선택" selectFolder: "폴더 선택" selectFolders: "폴더 선택" -fileNotSelected: "파일을 선택하지 않았습니다" renameFile: "파일 이름 변경" folderName: "폴더 이름" createFolder: "폴더 만들기" @@ -339,7 +319,6 @@ renameFolder: "폴더 이름 바꾸기" deleteFolder: "폴더 삭제" folder: "폴더" addFile: "파일 추가" -showFile: "파일 표시하기" emptyDrive: "드라이브가 비어 있습니다" emptyFolder: "폴더가 비어 있습니다" unableToDelete: "삭제할 수 없습니다" @@ -385,12 +364,12 @@ registration: "등록" enableRegistration: "신규 회원가입을 활성화" invite: "초대" driveCapacityPerLocalAccount: "로컬 유저 한 명당 드라이브 용량" -driveCapacityPerRemoteAccount: "원격 사용자별 드라이브 용량" +driveCapacityPerRemoteAccount: "리모트 유저 한 명당 드라이브 용량" inMb: "메가바이트 단위" bannerUrl: "배너 이미지 URL" backgroundImageUrl: "배경 이미지 URL" basicInfo: "기본 정보" -pinnedUsers: "고정한 사용자" +pinnedUsers: "고정된 유저" pinnedUsersDescription: "\"발견하기\" 페이지 등에 고정하고 싶은 유저를 한 줄에 한 명씩 적습니다." pinnedPages: "고정한 페이지" pinnedPagesDescription: "서버의 대문에 고정하고 싶은 페이지의 경로를 한 줄에 하나씩 적습니다." @@ -400,11 +379,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "hCaptcha 활성화" hcaptchaSiteKey: "사이트 키" hcaptchaSecretKey: "시크릿 키" -mcaptcha: "mCaptcha" -enableMcaptcha: "mCaptcha 활성화" -mcaptchaSiteKey: "사이트 키" -mcaptchaSecretKey: "시크릿 키" -mcaptchaInstanceUrl: "mCaptcha 인스턴스 URL" recaptcha: "reCAPTCHA" enableRecaptcha: "reCAPTCHA 활성화" recaptchaSiteKey: "사이트 키" @@ -420,7 +394,6 @@ name: "이름" antennaSource: "받을 소스" antennaKeywords: "받을 검색어" antennaExcludeKeywords: "제외할 검색어" -antennaExcludeBots: "봇 계정 제외" antennaKeywordsDescription: "공백으로 구분하는 경우 AND, 줄바꿈으로 구분하는 경우 OR로 지정됩니다" notifyAntenna: "새로운 노트를 알림" withFileAntenna: "파일이 첨부된 노트만" @@ -435,11 +408,11 @@ silence: "사일런스" silenceConfirm: "이 계정을 사일런스로 설정하시겠습니까?" unsilence: "사일런스 해제" unsilenceConfirm: "이 계정의 사일런스를 해제하시겠습니까?" -popularUsers: "인기 사용자" -recentlyUpdatedUsers: "최근에 활동한 사용자" -recentlyRegisteredUsers: "최근에 가입한 사용자" -recentlyDiscoveredUsers: "최근에 발견한 사용자" -exploreUsersCount: "{count}명의 사용자가 있습니다" +popularUsers: "인기 유저" +recentlyUpdatedUsers: "최근 활동한 유저" +recentlyRegisteredUsers: "최근 가입한 유저" +recentlyDiscoveredUsers: "최근 발견한 유저" +exploreUsersCount: "{count}명의 유저가 있습니다" exploreFediverse: "연합우주를 탐색" popularTags: "인기 태그" userList: "리스트" @@ -454,17 +427,16 @@ totpDescription: "인증 앱을 사용하여 일회성 비밀번호 입력" moderator: "모더레이터" moderation: "조정" moderationNote: "조정 기록" -moderationNoteDescription: "모더레이터 역할을 가진 유저만 보이는 메모를 적을 수 있습니다." addModerationNote: "조정 기록 추가하기" moderationLogs: "모더레이션 로그" nUsersMentioned: "{n}명이 언급함" -securityKeyAndPasskey: "보안 키 또는 패스키" +securityKeyAndPasskey: "보안 키 또는 패스 키" securityKey: "보안 키" lastUsed: "마지막 사용" lastUsedAt: "마지막 사용: {t}" unregister: "등록 해제" passwordLessLogin: "비밀번호 없이 로그인" -passwordLessLoginDescription: "비밀번호 없이 보안 키 또는 패스키만 사용해서 로그인합니다." +passwordLessLoginDescription: "비밀번호를 사용하지 않고 보안 키 또는 패스 키 등으로만 로그인합니다." resetPassword: "비밀번호 재설정" newPasswordIs: "새로운 비밀번호는 \"{password}\" 입니다" reduceUiAnimation: "UI의 애니메이션을 줄이기" @@ -489,12 +461,10 @@ retype: "다시 입력" noteOf: "{user}의 노트" quoteAttached: "인용함" quoteQuestion: "인용해서 작성하시겠습니까?" -attachAsFileQuestion: "붙여넣으려는 글이 너무 깁니다. 텍스트 파일로 첨부하시겠습니까?" noMessagesYet: "아직 대화가 없습니다" newMessageExists: "새 메시지가 있습니다" onlyOneFileCanBeAttached: "메시지에 첨부할 수 있는 파일은 하나까지입니다" -signinRequired: "진행하기 전에 로그인을 해 주세요" -signinOrContinueOnRemote: "계속하려면 사용하는 서버로 이동하거나 이 서버에 로그인해야 합니다." +signinRequired: "로그인 해주세요" invitations: "초대" invitationCode: "초대 코드" checking: "확인하는 중입니다" @@ -509,19 +479,15 @@ strongPassword: "강한 비밀번호" passwordMatched: "일치합니다" passwordNotMatched: "일치하지 않습니다" signinWith: "{x}로 로그인" -signinFailed: "로그인할 수 없습니다. 사용자 이름과 비밀번호를 확인해 주십시오." +signinFailed: "로그인할 수 없습니다. 사용자명과 비밀번호를 확인하여 주십시오." or: "혹은" language: "언어" uiLanguage: "UI 표시 언어" aboutX: "{x}에 대하여" emojiStyle: "이모지 스타일" native: "기본" -menuStyle: "메뉴 스타일" -style: "스타일" -drawer: "서랍" -popup: "팝업" -showNoteActionsOnlyHover: "마우스가 올라간 때에만 노트 동작 버튼을 표시하기" -showReactionsCount: "노트의 반응 수를 표시하기" +disableDrawer: "드로어 메뉴를 사용하지 않기" +showNoteActionsOnlyHover: "노트 액션 버튼을 마우스를 올렸을 때에만 표시" noHistory: "기록이 없습니다" signinHistory: "로그인 기록" enableAdvancedMfm: "고급 MFM을 활성화" @@ -557,13 +523,13 @@ useObjectStorage: "오브젝트 스토리지를 사용" objectStorageBaseUrl: "Base URL" objectStorageBaseUrlDesc: "오브젝트 (미디어) 참조 URL 을 만들 때 사용되는 URL입니다. CDN 또는 프록시를 사용하는 경우 그 URL을 지정하고, 그 외의 경우 사용할 서비스의 가이드에 따라 공개적으로 액세스 할 수 있는 주소를 지정해 주세요. 예를 들어, AWS S3의 경우 'https://.s3.amazonaws.com', GCS등의 경우 'https://storage.googleapis.com/' 와 같이 지정합니다." objectStorageBucket: "Bucket" -objectStorageBucketDesc: "사용하는 서비스의 bucket 이름을 지정해 주세요." +objectStorageBucketDesc: "사용 서비스의 bucket명을 지정해주세요." objectStoragePrefix: "Prefix" objectStoragePrefixDesc: "이 Prefix 의 디렉토리 아래에 파일이 저장됩니다." objectStorageEndpoint: "Endpoint" -objectStorageEndpointDesc: "AWS S3는 비워 두고 다른 서비스는 각 서비스의 endpoint를 설정해 주세요. ‘’ 혹은 ‘:’처럼 지정합니다." +objectStorageEndpointDesc: "AWS S3의 경우 공란, 다른 서비스의 경우 각 서비스의 가이드에 맞게 endpoint를 설정해주세요. '' 혹은 ':' 와 같이 지정합니다." objectStorageRegion: "Region" -objectStorageRegionDesc: "‘xx-east-1’처럼 region을 지정해 주세요. 사용하는 서비스에 region 개념이 없으면 ‘us-east-1’처럼 설정해 주세요. AWS 설정 파일이나 환경 변수가 있으면 비워 주세요." +objectStorageRegionDesc: "'xx-east-1'와 같이 region을 지정해 주세요. 사용하는 서비스에 region 개념이 없는 경우 'us-east-1'으로 설정해 주세요. AWS 설정 파일 또는 환경 변수를 참조할 경우에는 비워주세요." objectStorageUseSSL: "SSL 사용" objectStorageUseSSLDesc: "API 호출시 HTTPS 를 사용하지 않는 경우 OFF 로 설정해 주세요" objectStorageUseProxy: "연결에 프록시를 사용" @@ -585,7 +551,7 @@ popout: "새 창으로 열기" volume: "음량" masterVolume: "마스터 볼륨" notUseSound: "음소거 하기" -useSoundOnlyWhenActive: "Misskey를 활성화한 때에만 소리를 출력하기" +useSoundOnlyWhenActive: "Misskey가 활성화 되어져 있을 때만 소리 출력하기" details: "자세히" chooseEmoji: "이모지 선택" unableToProcess: "작업을 완료할 수 없습니다" @@ -602,12 +568,10 @@ ascendingOrder: "오름차순" descendingOrder: "내림차순" scratchpad: "스크래치 패드" scratchpadDescription: "스크래치 패드는 AiScript 의 테스트 환경을 제공합니다. Misskey 와 상호 작용하는 코드를 작성, 실행 및 결과를 확인할 수 있습니다." -uiInspector: "UI 인스펙터" -uiInspectorDescription: "메모리에 있는 UI 컴포넌트의 인스턴트 목록을 볼 수 있습니다. UI 컴포넌트는 Ui:C: 계열 함수로 만들어집니다." output: "출력" script: "스크립트" disablePagesScript: "Pages 에서 AiScript 를 사용하지 않음" -updateRemoteUser: "원격 사용자 정보 갱신" +updateRemoteUser: "리모트 유저 정보 갱신" unsetUserAvatar: "아바타 제거" unsetUserAvatarConfirm: "아바타를 제거할까요?" unsetUserBanner: "배너 제거" @@ -616,7 +580,7 @@ deleteAllFiles: "모든 파일 삭제" deleteAllFilesConfirm: "모든 파일을 삭제하시겠습니까?" removeAllFollowing: "모든 팔로잉 해제" removeAllFollowingDescription: "{host} 서버의 모든 팔로잉을 해제합니다. 해당 서버가 더 이상 존재하지 않는 경우 등에 실행해 주세요." -userSuspended: "이 사용자는 정지되었습니다." +userSuspended: "이 계정은 정지된 상태입니다." userSilenced: "이 계정은 사일런스된 상태입니다." yourAccountSuspendedTitle: "계정이 정지되었습니다" yourAccountSuspendedDescription: "이 계정은 서버의 이용 약관을 위반하거나, 기타 다른 이유로 인해 정지되었습니다. 자세한 사항은 관리자에게 문의해 주십시오. 계정을 새로 생성하지 마십시오." @@ -662,7 +626,6 @@ medium: "보통" small: "작게" generateAccessToken: "액세스 토큰 생성" permission: "권한" -adminPermission: "관리자 권한" enableAll: "전체 선택" disableAll: "전체 해제" tokenRequested: "계정 접근 허용" @@ -690,7 +653,7 @@ regexpErrorDescription: "{tab}단어 뮤트 {line}행의 정규 표현식에 오 instanceMute: "서버 뮤트" userSaysSomething: "{name}님이 무언가를 말했습니다" makeActive: "활성화" -display: "보기" +display: "표시" copy: "복사" metrics: "통계" overview: "요약" @@ -706,7 +669,6 @@ useGlobalSettingDesc: "활성화하면 계정의 알림 설정이 적용됩니 other: "기타" regenerateLoginToken: "로그인 토큰을 재생성" regenerateLoginTokenDescription: "로그인할 때 사용되는 내부 토큰을 재생성합니다. 일반적으로 이 작업을 실행할 필요는 없습니다. 이 기능을 사용하면 이 계정으로 로그인한 모든 기기에서 로그아웃됩니다." -theKeywordWhenSearchingForCustomEmoji: "맞춤 이모티콘을 검색할 때 키워드가 됩니다." setMultipleBySeparatingWithSpace: "공백으로 구분하여 여러 개 설정할 수 있습니다." fileIdOrUrl: "파일 ID 또는 URL" behavior: "동작" @@ -714,13 +676,16 @@ sample: "예시" abuseReports: "신고" reportAbuse: "신고" reportAbuseRenote: "리노트 신고하기" -reportAbuseOf: "{name} 신고하기" +reportAbuseOf: "{name}을 신고하기" fillAbuseReportDescription: "신고하려는 이유를 자세히 알려주세요. 특정 게시물을 신고할 때에는 게시물의 URL도 포함해 주세요." abuseReported: "신고를 보냈습니다. 신고해 주셔서 감사합니다." reporter: "신고자" reporteeOrigin: "피신고자" reporterOrigin: "신고자" +forwardReport: "리모트 서버에도 신고 내용 보내기" +forwardReportIsAnonymous: "리모트 서버에서는 나의 정보를 볼 수 없으며, 익명의 시스템 계정으로 표시됩니다." send: "전송" +abuseMarkAsResolved: "해결됨으로 표시" openInNewTab: "새 탭에서 열기" openInSideView: "사이드뷰로 열기" defaultNavigationBehaviour: "기본 탐색 동작" @@ -736,7 +701,7 @@ createNew: "새로 만들기" optional: "옵션" createNewClip: "새 클립 만들기" unclip: "클립 해제" -confirmToUnclipAlreadyClippedNote: "이 노트는 ‘{name}’ 클립을 이미 포함합니다. 클립에서 제외하시겠습니까?" +confirmToUnclipAlreadyClippedNote: "이 노트는 이미 \"{name}\" 클립에 포함되어 있습니다. 클립을 해제하시겠습니까?" public: "공개" private: "비공개" i18nInfo: "Misskey는 자원봉사자들에 의해 다양한 언어로 번역되고 있습니다. {link}에서 번역에 참가할 수 있습니다." @@ -749,13 +714,13 @@ repliedCount: "받은 답글 수" renotedCount: "받은 리노트 수" followingCount: "팔로우 수" followersCount: "팔로워 수" -sentReactionsCount: "반응 수" -receivedReactionsCount: "받은 반응 수" -pollVotesCount: "투표 수" -pollVotedCount: "받은 투표 수" +sentReactionsCount: "보낸 리액션 수" +receivedReactionsCount: "받은 리액션 수" +pollVotesCount: "투표한 횟수" +pollVotedCount: "투표받은 횟수" yes: "예" no: "아니오" -driveFilesCount: "드라이브에 있는 파일 수" +driveFilesCount: "드라이브 파일 개수" driveUsage: "드라이브 사용량" noCrawle: "검색엔진의 인덱싱 거부" noCrawleDescription: "검색엔진에 사용자 페이지, 노트, 페이지 등의 콘텐츠를 인덱싱되지 않게 합니다." @@ -777,7 +742,7 @@ experimentalFeatures: "실험실" experimental: "실험실" thisIsExperimentalFeature: "이 기능은 실험적인 기능입니다. 사양이 변경되거나 정상적으로 동작하지 않을 가능성이 있습니다." developer: "개발자" -makeExplorable: "계정을 쉽게 발견하도록 하기" +makeExplorable: "\"발견하기\"에 내 계정 보이기" makeExplorableDescription: "비활성화하면 \"발견하기\"에 나의 계정을 표시하지 않습니다." showGapBetweenNotesInTimeline: "타임라인의 노트 사이를 띄워서 표시" duplicate: "복제" @@ -790,7 +755,7 @@ needReloadToApply: "변경 사항은 새로고침하면 적용됩니다." showTitlebar: "타이틀 바를 표시하기" clearCache: "캐시 비우기" onlineUsersCount: "{n}명이 접속 중" -nUsers: "{n} 사용자" +nUsers: "{n} 유저" nNotes: "{n} 노트" sendErrorReports: "오류 보고서 보내기" sendErrorReportsDescription: "이 설정을 활성화하면, 문제가 발생했을 때 오류에 대한 상세 정보를 Misskey에 보내어 더 나은 소프트웨어를 만드는 데에 도움을 줄 수 있습니다." @@ -823,7 +788,7 @@ emailNotification: "메일 알림" publish: "게시" inChannelSearch: "채널에서 검색" useReactionPickerForContextMenu: "우클릭하여 리액션 선택기 열기" -typingUsers: "{users}님이 입력 중" +typingUsers: "{users} 님이 입력하고 있어요.." jumpToSpecifiedDate: "특정 날짜로 이동" showingPastTimeline: "과거의 타임라인을 표시하고 있어요" clear: "지우기" @@ -836,7 +801,7 @@ addDescription: "설명 추가" userPagePinTip: "각 노트의 메뉴에서 「프로필에 고정」을 선택하는 것으로, 여기에 노트를 표시해 둘 수 있어요." notSpecifiedMentionWarning: "수신자가 선택되지 않은 멘션이 있어요" info: "정보" -userInfo: "사용자 정보" +userInfo: "유저 정보" unknown: "알 수 없음" onlineStatus: "온라인 상태" hideOnlineStatus: "온라인 상태 숨기기" @@ -857,7 +822,6 @@ administration: "관리" accounts: "계정" switch: "전환" noMaintainerInformationWarning: "관리자 정보가 설정되어 있지 않습니다." -noInquiryUrlWarning: "문의처 주소를 설정하지 않았습니다." noBotProtectionWarning: "Bot 방어가 설정되어 있지 않습니다." configure: "설정하기" postToGallery: "갤러리에 업로드" @@ -922,11 +886,10 @@ followersVisibility: "팔로워의 공개 범위" continueThread: "글타래 더 보기" deleteAccountConfirm: "계정이 삭제되고 되돌릴 수 없게 됩니다. 계속하시겠습니까? " incorrectPassword: "비밀번호가 올바르지 않습니다." -incorrectTotp: "OTP 번호가 틀렸거나 유효기간이 만료되어 있을 수 있습니다." voteConfirm: "\"{choice}\"에 투표하시겠습니까?" hide: "숨기기" useDrawerReactionPickerForMobile: "모바일에서 드로어 메뉴로 표시" -welcomeBackWithName: "{name}님, 환영합니다." +welcomeBackWithName: "환영합니다, {name}님" clickToFinishEmailVerification: "[{ok}]를 눌러 이메일 인증을 완료하세요." overridedDeviceKind: "장치 유형" smartphone: "스마트폰" @@ -1020,7 +983,6 @@ neverShow: "다시 보지 않기" remindMeLater: "나중에 알림" didYouLikeMisskey: "Misskey가 마음에 드시나요?" pleaseDonate: "Misskey는 {host} 서버의 무료 소프트웨어입니다. 앞으로도 개발을 이어 나가려면 후원이 절실히 필요합니다!" -correspondingSourceIsAvailable: "소스 코드는 {anchor}에서 받아보실 수 있습니다." roles: "역할" role: "역할" noRole: "역할이 없습니다" @@ -1048,12 +1010,11 @@ thisPostMayBeAnnoyingHome: "홈에 게시" thisPostMayBeAnnoyingCancel: "그만두기" thisPostMayBeAnnoyingIgnore: "이대로 게시" collapseRenotes: "이미 본 리노트를 간략화하기" -collapseRenotesDescription: "반응이나 리노트를 한 노트를 접어서 표시합니다." internalServerError: "내부 서버 오류" internalServerErrorDescription: "내부 서버에서 예기치 않은 오류가 발생했습니다." copyErrorInfo: "오류 정보 복사" joinThisServer: "이 서버에 가입" -exploreOtherServers: "다른 서버 찾기" +exploreOtherServers: "다른 서버 둘러보기" letsLookAtTimeline: "타임라인 구경하기" disableFederationConfirm: "정말로 연합을 끄시겠습니까?" disableFederationConfirmWarn: "연합을 끄더라도 게시물이 비공개로 전환되는 것은 아닙니다. 대부분의 경우 연합을 비활성화할 필요가 없습니다." @@ -1072,9 +1033,6 @@ resetPasswordConfirm: "비밀번호를 재설정하시겠습니까?" sensitiveWords: "민감한 단어" sensitiveWordsDescription: "설정한 단어가 포함된 노트의 공개 범위를 '홈'으로 강제합니다. 개행으로 구분하여 여러 개를 지정할 수 있습니다." sensitiveWordsDescription2: "공백으로 구분하면 AND 지정이 되며, 키워드를 슬래시로 둘러싸면 정규 표현식이 됩니다." -prohibitedWords: "금지 워드" -prohibitedWordsDescription: "설정된 워드가 포함되는 노트를 작성하려고 하면, 에러가 발생하도록 합니다. 줄바꿈으로 구분지어 복수 설정할 수 있습니다." -prohibitedWordsDescription2: "공백으로 구분하면 AND 지정이 되며, 키워드를 슬래시로 둘러싸면 정규 표현식이 됩니다." hiddenTags: "숨긴 해시태그" hiddenTagsDescription: "설정한 태그를 트렌드에 표시하지 않도록 합니다. 줄 바꿈으로 하나씩 나눠서 설정할 수 있습니다." notesSearchNotAvailable: "노트 검색을 이용하실 수 없습니다." @@ -1087,15 +1045,12 @@ retryAllQueuesConfirmTitle: "지금 다시 시도하시겠습니까?" retryAllQueuesConfirmText: "일시적으로 서버의 부하가 증가할 수 있습니다." enableChartsForRemoteUser: "리모트 유저의 차트를 생성" enableChartsForFederatedInstances: "리모트 서버의 차트를 생성" -enableStatsForFederatedInstances: "리모트 서버 정보 받아오기" showClipButtonInNoteFooter: "노트 동작에 클립을 추가" reactionsDisplaySize: "리액션 표시 크기" limitWidthOfReaction: "리액션의 최대 폭을 제한하고 작게 표시하기" noteIdOrUrl: "노트 ID 및 URL" video: "동영상" videos: "동영상" -audio: "소리" -audioFiles: "소리" dataSaver: "데이터 절약 모드" accountMigration: "계정 이동" accountMoved: "이 사용자는 다음 계정으로 이사했습니다:" @@ -1119,15 +1074,13 @@ serverRules: "서버 규칙" pleaseConfirmBelowBeforeSignup: "이 서버에 가입하기 전에 아래 사항을 확인하여 주십시오." pleaseAgreeAllToContinue: "계속하시려면 모든 항목에 동의하십시오." continue: "계속" -preservedUsernames: "예약한 사용자 이름" +preservedUsernames: "예약된 사용자명" preservedUsernamesDescription: "예약할 사용자명을 한 줄에 하나씩 입력합니다. 여기에서 지정한 사용자명으로는 계정을 생성할 수 없게 됩니다. 단, 관리자 권한으로 계정을 생성할 때에는 해당되지 않으며, 이미 존재하는 계정도 영향을 받지 않습니다." createNoteFromTheFile: "이 파일로 노트를 작성" archive: "아카이브" -archived: "아카이브 됨" -unarchive: "보관 취소" -channelArchiveConfirmTitle: "{name} 채널을 보존하시겠습니까?" -channelArchiveConfirmDescription: "보존한 채널은 채널 목록과 검색 결과에 표시되지 않으며 새로운 노트도 작성할 수 없습니다." -thisChannelArchived: "이 채널은 보존되었습니다." +channelArchiveConfirmTitle: "{name} 을(를) 아카이브하시겠습니까?" +channelArchiveConfirmDescription: "아카이브한 채널은 채널 목록과 검색 결과에 표시되지 않으며, 채널에 새로운 노트를 작성할 수 없게 됩니다." +thisChannelArchived: "이 채널은 아카이브되었습니다." displayOfNote: "노트 표시" initialAccountSetting: "초기 설정" youFollowing: "팔로잉" @@ -1135,9 +1088,6 @@ preventAiLearning: "기계학습(생성형 AI)으로의 사용을 거부" preventAiLearningDescription: "외부의 문장 생성 AI나 이미지 생성 AI에 대해 제출한 노트나 이미지 등의 콘텐츠를 학습의 대상으로 사용하지 않도록 요구합니다. 다만, 이 요구사항을 지킬 의무는 없기 때문에 학습을 완전히 방지하는 것은 아닙니다." options: "옵션" specifyUser: "사용자 지정" -lookupConfirm: "조회 할까요?" -openTagPageConfirm: "해시태그의 페이지를 열까요?" -specifyHost: "호스트 지정" failedToPreviewUrl: "미리 볼 수 없음" update: "업데이트" rolesThatCanBeUsedThisEmojiAsReaction: "이 이모지를 리액션으로 사용할 수 있는 역할" @@ -1192,26 +1142,18 @@ unnotifyNotes: "새 노트 알림 끄기" authentication: "인증" authenticationRequiredToContinue: "계속하려면 인증하십시오" dateAndTime: "일시" -showRenotes: "리노트 보기" +showRenotes: "리노트 표시" edited: "수정됨" notificationRecieveConfig: "알림 설정" mutualFollow: "맞팔로우" -followingOrFollower: "팔로 중이거나 팔로워" fileAttachedOnly: "미디어를 포함한 노트만" showRepliesToOthersInTimeline: "타임라인에 다른 사람에게 보내는 답글을 포함" hideRepliesToOthersInTimeline: "타임라인에 다른 사람에게 보내는 답글을 포함하지 않음" showRepliesToOthersInTimelineAll: "타임라인에 현재 팔로우 중인 사람 전원의 답글을 포함하게 하기" hideRepliesToOthersInTimelineAll: "타임라인에 현재 팔로우 중인 사람 전원의 답글이 나오지 않게 하기" -confirmShowRepliesAll: "이 조작은 되돌릴 수 없습니다. 정말로 타임라인에 현재 팔로우 중인 사람 전원의 답글이 나오게 하시겠습니까?" +confirmShowRepliesAll: "이 조작은 되돌릴 수 없습니다. 정말로 타임라인에 현재 팔로우 중인 사람 전원의 답글이 나오지 않게 하시겠습니까?" confirmHideRepliesAll: "이 조작은 되돌릴 수 없습니다. 정말로 타임라인에 현재 팔로우 중인 사람 전원의 답글이 나오지 않게 하시겠습니까?" externalServices: "외부 서비스" -sourceCode: "소스 코드" -sourceCodeIsNotYetProvided: "소스 코드를 아직 제공하지 않습니다. 이 문제를 해결하려면 관리자에게 문의해 주세요." -repositoryUrl: "저장소 URL" -repositoryUrlDescription: "소스 코드를 공개한 저장소가 있는 경우, 그 URL을 적습니다. Misskey를 원본 그대로 (소스 코드를 어떤 식으로도 변경하지 않고) 쓰고 있는 경우 https://github.com/misskey-dev/misskey 라고 적습니다." -repositoryUrlOrTarballRequired: "저장소를 공개하지 않은 경우 대신 tarball을 제공할 필요가 있습니다. 세부사항은 .config/example.yml을 참조해 주세요." -feedback: "피드백" -feedbackUrl: "피드백 URL" impressum: "운영자 정보" impressumUrl: "운영자 정보 URL" impressumDescription: "독일 등의 일부 나라와 지역에서는 꼭 표시해야 합니다(Impressum)." @@ -1241,89 +1183,6 @@ seasonalScreenEffect: "계절에 따른 효과 보이기" decorate: "장식하기" addMfmFunction: "장식 추가하기" enableQuickAddMfmFunction: "상급자용 MFM 선택기 표시하기" -bubbleGame: "버블 게임" -sfx: "효과음" -soundWillBePlayed: "소리가 재생됩니다" -showReplay: "리플레이 보기" -replay: "리플레이" -replaying: "리플레이 중" -endReplay: "리플레이 종료" -copyReplayData: "리플레이 데이터를 복사" -ranking: "랭킹" -lastNDays: "최근 {n}일" -backToTitle: "타이틀로 가기" -hemisphere: "거주 지역" -withSensitive: "민감한 파일이 포함된 노트 보기" -userSaysSomethingSensitive: "{name} 같은 민감한 파일이 포함된 글" -enableHorizontalSwipe: "스와이프하여 탭 전환" -loading: "불러오는 중" -surrender: "그만두기" -gameRetry: "다시 시도" -notUsePleaseLeaveBlank: "사용하지 않는 경우 비워두세요." -useTotp: "일회용 비밀번호 사용" -useBackupCode: "백업 코드 사용" -launchApp: "앱 실행" -useNativeUIForVideoAudioPlayer: "브라우저 UI에서 미디어 재생" -keepOriginalFilename: "원본 파일 이름을 유지" -keepOriginalFilenameDescription: "이 설정을 끄면 업로드를 할 때 파일 이름이 자동으로 무작위 문자열로 바뀝니다." -noDescription: "설명문이 없습니다" -alwaysConfirmFollow: "팔로우일 때 항상 확인하기" -inquiry: "문의하기" -tryAgain: "다시 시도해 주세요." -confirmWhenRevealingSensitiveMedia: "민감한 미디어를 열 때 두 번 확인" -sensitiveMediaRevealConfirm: "민감한 미디어입니다. 표시할까요?" -createdLists: "만든 리스트" -createdAntennas: "만든 안테나" -fromX: "{x}부터" -genEmbedCode: "임베디드 코드 만들기" -noteOfThisUser: "이 유저의 노트 목록" -clipNoteLimitExceeded: "더 이상 이 클립에 노트를 추가 할 수 없습니다." -performance: "퍼포먼스" -modified: "변경 있음" -discard: "파기" -thereAreNChanges: "{n}건 변경이 있습니다." -signinWithPasskey: "패스키로 로그인" -unknownWebAuthnKey: "등록되지 않은 패스키입니다." -passkeyVerificationFailed: "패스키 검증을 실패했습니다." -passkeyVerificationSucceededButPasswordlessLoginDisabled: "패스키를 검증했으나, 비밀번호 없이 로그인하기가 꺼져 있습니다." -messageToFollower: "팔로워에 보낼 메시지" -target: "대상" -testCaptchaWarning: "CAPTCHA를 테스트하기 위한 기능입니다. 실제 환경에서는 사용하지 마세요." -prohibitedWordsForNameOfUser: "금지 단어 (사용자 이름)" -prohibitedWordsForNameOfUserDescription: "이 목록에 포함되는 키워드가 사용자 이름에 있는 경우, 일반 사용자는 이름을 바꿀 수 없습니다. 모더레이터 권한을 가진 사용자는 제한 대상에서 제외됩니다." -yourNameContainsProhibitedWords: "바꾸려는 이름에 금지된 키워드가 포함되어 있습니다." -yourNameContainsProhibitedWordsDescription: "이름에 금지된 키워드가 있습니다. 이름을 사용해야 하는 경우, 서버 관리자에 문의하세요." -_abuseUserReport: - forward: "전달" - forwardDescription: "익명 시스템 계정을 사용하여 리모트 서버에 신고 내용을 전달할 수 있습니다." - resolve: "해결됨" - accept: "인용" - reject: "기각" - resolveTutorial: "적절한 신고 내용에 대응한 경우, \"인용\"을 선택하여 \"해결됨\"으로 기록합니다.\n적절하지 않은 신고를 받은 경우, \"기각\"을 선택하여 \"기각\"으로 기록합니다." -_delivery: - status: "전송 상태" - stop: "정지됨" - resume: "전송 다시 시작" - _type: - none: "배포 중" - manuallySuspended: "수동 정지 중" - goneSuspended: "서버 삭제를 이유로 정지 중" - autoSuspendedForNotResponding: "서버 응답 없음을 이유로 정지 중" -_bubbleGame: - howToPlay: "설명" - hold: "홀드" - _score: - score: "점수" - scoreYen: "번 돈" - highScore: "최고 점수" - maxChain: "최대 콤보 수" - yen: "{yen}엔" - estimatedQty: "{qty}개" - scoreSweets: "오니기리 {onigiriQtyWithUnit}" - _howToPlay: - section1: "위치를 조정하여 상자에 물건을 떨어뜨립니다." - section2: "같은 종류의 물건이 붙으면 다른 물건으로 바뀌면서 점수를 얻게 됩니다." - section3: "상자에서 물건이 넘치면 게임 오버입니다. 상자에서 물건이 넘치지 않도록 하면서 물건을 융합하여 높은 점수를 획득하세요!" _announcement: forExistingUsers: "기존 유저에게만 알림" forExistingUsersDescription: "활성화하면 이 공지사항을 게시한 시점에서 이미 가입한 유저에게만 표시합니다. 비활성화하면 게시 후에 가입한 유저에게도 표시합니다." @@ -1332,7 +1191,7 @@ _announcement: end: "공지에서 내리기" tooManyActiveAnnouncementDescription: "공지사항이 너무 많을 경우, 사용자 경험에 영향을 끼칠 가능성이 있습니다. 오래된 공지사항은 아카이브하시는 것을 권장드립니다." readConfirmTitle: "읽음으로 표시합니까?" - readConfirmText: "〈{title}〉의 내용을 읽음으로 표시합니다." + readConfirmText: "\"{title}\"을(를) 읽음으로 표시합니다." shouldNotBeUsedToPresentPermanentInfo: "신규 유저의 이용 경험에 악영향을 끼칠 수 있으므로, 일시적인 알림 수단으로만 사용하고 고정된 정보에는 사용을 지양하는 것을 추천합니다." dialogAnnouncementUxWarn: "다이얼로그 형태의 알림이 동시에 2개 이상 존재하는 경우, 사용자 경험에 악영향을 끼칠 수 있으므로 신중히 결정하십시오." silence: "조용히 알림" @@ -1434,10 +1293,6 @@ _serverSettings: fanoutTimelineDescription: "활성화하면 각종 타임라인을 가져올 때의 성능을 대폭 향상하며, 데이터베이스의 부하를 줄일 수 있습니다. 단, Redis의 메모리 사용량이 증가합니다. 서버의 메모리 용량이 작거나, 서비스가 불안정해지는 경우 비활성화할 수 있습니다." fanoutTimelineDbFallback: "데이터베이스를 예비로 사용하기" fanoutTimelineDbFallbackDescription: "활성화하면 타임라인의 캐시되어 있지 않은 부분에 대해 DB에 질의하여 정보를 가져옵니다. 비활성화하면 이를 실행하지 않음으로써 서버의 부하를 줄일 수 있지만, 타임라인에서 가져올 수 있는 게시물 범위가 한정됩니다." - reactionsBufferingDescription: "활성화 한 경우, 리액션 작성 퍼포먼스가 대폭 향상되어 DB의 부하를 줄일 수 있으나, Redis의 메모리 사용량이 많아집니다." - inquiryUrl: "문의처 URL" - inquiryUrlDescription: "서버 운영자에게 보내는 문의 양식의 URL이나 운영자의 연락처 등이 적힌 웹 페이지의 URL을 설정합니다." - thisSettingWillAutomaticallyOffWhenModeratorsInactive: "일정 기간동안 모더레이터의 활동이 감지되지 않는 경우, 스팸 방지를 위해 이 설정은 자동으로 꺼집니다." _accountMigration: moveFrom: "다른 계정에서 이 계정으로 이사" moveFromSub: "다른 계정에 대한 별칭을 생성" @@ -1617,7 +1472,7 @@ _achievements: _iLoveMisskey: title: "I Love Misskey" description: "\"I ❤ #Misskey\"를 포스트했습니다" - flavor: "Misskey를 이용해 주셔서 감사합니다! ― 개발 팀" + flavor: "Misskey를 이용해주셔서 감사합니다! - 개발팀 일동" _foundTreasure: title: "보물찾기" description: "숨겨진 보물을 발견했습니다" @@ -1655,10 +1510,10 @@ _achievements: description: "3개 이상의 창을 열었습니다" _driveFolderCircularReference: title: "순환 참조" - description: "드라이브 폴더에 스스로를 넣게 했습니다" + description: "드라이브 폴더를 자신을 가리키도록 만드려 시도했습니다" _reactWithoutRead: title: "읽고 답하긴 하시는 건가요?" - description: "100자가 넘는 노트를 작성한 지 3초 안에 반응했어요" + description: "100자가 넘는 노트가 작성되고 3초 안에 반응했습니다" _clickedClickHere: title: "여기를 누르세요" description: "여기를 눌렀습니다" @@ -1698,13 +1553,6 @@ _achievements: _tutorialCompleted: title: "Misskey 입문자 과정 수료증" description: "튜토리얼을 완료했습니다" - _bubbleGameExplodingHead: - title: "🤯" - description: "버블 게임에서 가장 큰 물건을 내놓았다" - _bubbleGameDoubleExplodingHead: - title: "더블 🤯" - description: "버블게임에서 가장 큰 물건 2개를 동시에 내놓았다." - flavor: "이 정도만 도시락통에 🤯 🤯 조금만 더" _role: new: "새 역할 생성" edit: "역할 수정" @@ -1745,7 +1593,6 @@ _role: gtlAvailable: "글로벌 타임라인 보이기" ltlAvailable: "로컬 타임라인 보이기" canPublicNote: "공개 노트 허용" - mentionMax: "노트에 넣을 수 있는 멘션 수" canInvite: "서버 초대 코드 발행" inviteLimit: "초대 한도" inviteLimitCycle: "초대 발급 간격" @@ -1754,43 +1601,31 @@ _role: canManageAvatarDecorations: "아바타 꾸미기 관리" driveCapacity: "드라이브 용량" alwaysMarkNsfw: "파일을 항상 NSFW로 지정" - canUpdateBioMedia: "아바타 및 배너 이미지 변경 허용" pinMax: "고정할 수 있는 노트 수" - antennaMax: "만들 수 있는 안테나 수" + antennaMax: "최대 안테나 생성 허용 수" wordMuteMax: "단어 뮤트할 수 있는 문자 수" - webhookMax: "만들 수 있는 Webhook 수" - clipMax: "만들 수 있는 클립 수" - noteEachClipsMax: "클립에 넣을 수 있는 노트 수" - userListMax: "만들 수 있는 사용자 리스트 수" - userEachUserListsMax: "사용자 리스트에 넣을 수 있는 사용자 수" + webhookMax: "생성할 수 있는 웹훅 수" + clipMax: "생성할 수 있는 클립 수" + noteEachClipsMax: "각 클립에 추가할 수 있는 노트 수" + userListMax: "생성할 수 있는 유저 리스트 수" + userEachUserListsMax: "유저 리스트당 최대 사용자 수" rateLimitFactor: "요청 빈도 제한" descriptionOfRateLimitFactor: "작을수록 제한이 완화되고, 클수록 제한이 강화됩니다." canHideAds: "광고 숨기기" canSearchNotes: "노트 검색 이용 가능 여부" canUseTranslator: "번역 기능의 사용" avatarDecorationLimit: "아바타 장식의 최대 붙임 개수" - canImportAntennas: "안테나 가져오기 허용" - canImportBlocking: "차단 목록 가져오기 허용" - canImportFollowing: "팔로우 가져오기 허용" - canImportMuting: "뮤트 목록 가져오기 허용" - canImportUserLists: "리스트 목록 가져오기 허용" _condition: - roleAssignedTo: "수동 역할에 이미 할당됨" isLocal: "로컬 사용자" - isRemote: "원격 사용자" - isCat: "고양이 사용자" - isBot: "봇 사용자" - isSuspended: "정지된 사용자" - isLocked: "잠금 계정 사용자" - isExplorable: "‘계정을 쉽게 발견하도록 하기’를 활성화한 사용자" + isRemote: "리모트 사용자" createdLessThan: "가입한 지 다음 일수 이내인 유저" createdMoreThan: "가입한 지 다음 일수 이상인 유저" followersLessThanOrEq: "팔로워 수가 다음 이하인 유저" - followersMoreThanOrEq: "팔로워 수가 다음보다 많은 사용자" + followersMoreThanOrEq: "팔로워 수가 다음 이상인 유저" followingLessThanOrEq: "팔로잉 수가 다음 이하인 유저" - followingMoreThanOrEq: "팔로잉 수가 다음보다 많은 사용자" + followingMoreThanOrEq: "팔로잉 수가 다음 이상인 유저" notesLessThanOrEq: "노트 수가 다음 이하인 유저" - notesMoreThanOrEq: "노트 수가 다음보다 많은 사용자" + notesMoreThanOrEq: "노트 수가 다음 이상인 유저" and: "다음을 모두 만족" or: "다음을 하나라도 만족" not: "다음을 만족하지 않음" @@ -1852,7 +1687,6 @@ _plugin: installWarn: "신뢰할 수 없는 플러그인은 설치하지 않는 것이 좋습니다." manage: "플러그인 관리" viewSource: "소스 보기" - viewLog: "로그 보기" _preferencesBackups: list: "생성한 백업" saveNew: "새 백업 만들기" @@ -1863,12 +1697,12 @@ _preferencesBackups: cannotSave: "저장하지 못했습니다" nameAlreadyExists: "\"{name}\" 백업이 이미 존재합니다. 다른 이름을 설정하여 주십시오." applyConfirm: "\"{name}\" 백업을 현재 기기에 적용하시겠습니까? 현재 설정은 덮어 씌워집니다." - saveConfirm: "{name} 백업을 덮어쓰시겠습니까?" - deleteConfirm: "{name} 백업을 삭제하시겠습니까?" - renameConfirm: "‘{old}’ 백업을 ‘{new}’ 백업으로 바꾸시겠습니까?" + saveConfirm: "{name} 을 덮어쓰시겠습니까?" + deleteConfirm: "{name} 을(를) 삭제하시겠습니까?" + renameConfirm: "\"{old}\" 백업을 \"{new}\"(으)로 바꾸시겠습니까?" noBackups: "저장된 백업이 없습니다. \"새 백업 만들기\"를 눌러 현재 클라이언트 설정을 서버에 백업할 수 있습니다." - createdAt: "만든 날짜: {date} {time}" - updatedAt: "고친 날짜: {date} {time}" + createdAt: "생성 날짜: {date} {time}" + updatedAt: "갱신 날짜: {date} {time}" cannotLoad: "가져오기에 실패했습니다" invalidFile: "파일 형식이 올바르지 않습니다." _registry: @@ -1882,8 +1716,6 @@ _aboutMisskey: contributors: "주요 기여자" allContributors: "모든 기여자" source: "소스 코드" - original: "원본" - thisIsModifiedVersion: "{name}에서는 원본 미스키를 수정한 버전을 사용하고 있습니다." translation: "Misskey를 번역하기" donate: "Misskey에 기부하기" morePatrons: "이 외에도 다른 많은 분들이 도움을 주시고 계십니다. 감사합니다🥰" @@ -1929,7 +1761,7 @@ _instanceMute: title: "지정한 서버의 노트를 숨깁니다." heading: "뮤트할 서버" _theme: - explore: "테마 둘러보기" + explore: "테마 찾아보기" install: "테마 설치" manage: "테마 관리" code: "테마 코드" @@ -1991,6 +1823,7 @@ _theme: buttonBg: "버튼 배경" buttonHoverBg: "버튼 배경 (호버)" inputBorder: "입력 필드 테두리" + listItemHoverBg: "리스트 항목 배경 (호버)" driveFolderBg: "드라이브 폴더 배경" wallpaperOverlay: "배경화면 오버레이" badge: "배지" @@ -2002,15 +1835,16 @@ _sfx: note: "새 노트" noteMy: "내 노트" notification: "알림" + antenna: "안테나 수신" + channel: "채널 알림" reaction: "리액션 선택" _soundSettings: driveFile: "드라이브에 있는 오디오를 사용" driveFileWarn: "드라이브에 있는 파일을 선택하세요." - driveFileTypeWarn: "이 파이" + driveFileTypeWarn: "이 파일은 지원되지 않습니다." driveFileTypeWarnDescription: "오디오 파일을 선택하세요." driveFileDurationWarn: "오디오가 너무 깁니다" driveFileDurationWarnDescription: "긴 오디오로 설정할 경우 미스키 사용에 지장이 갈 수도 있습니다. 그래도 괜찮습니까?" - driveFileError: "오디오를 불러올 수 없습니다. 설정을 바꿔주세요." _ago: future: "미래" justNow: "방금 전" @@ -2040,6 +1874,7 @@ _2fa: registerTOTP: "인증 앱 설정 시작" step1: "먼저, {a}나 {b}등의 인증 앱을 사용 중인 디바이스에 설치합니다." step2: "그 후, 표시되어 있는 QR코드를 앱으로 스캔합니다." + step2Click: "QR 코드를 클릭하면 기기에 설치된 인증 앱에 등록할 수 있습니다." step2Uri: "데스크톱 앱을 사용하려면 다음 URI를 입력하십시오" step3Title: "인증 코드 입력" step3: "앱에 표시된 토큰을 입력하시면 완료됩니다." @@ -2052,7 +1887,7 @@ _2fa: securityKeyName: "키 이름 입력" tapSecurityKey: "브라우저의 지시에 따라 보안 키 또는 패스키를 등록하여 주십시오" removeKey: "보안 키를 삭제" - removeKeyConfirm: "{name} 앱을 삭제하시겠습니까?" + removeKeyConfirm: "{name} 을(를) 삭제하시겠습니까?" whyTOTPOnlyRenew: "보안 키가 등록되어 있는 경우 인증 앱을 해제할 수 없습니다." renewTOTP: "인증 앱 재설정" renewTOTPConfirm: "기존에 등록되어 있던 인증 키는 사용하지 못하게 됩니다." @@ -2063,7 +1898,6 @@ _2fa: backupCodesDescription: "인증 앱을 사용할 수 없게 된 경우 아래 백업 코드를 사용하여 계정에 액세스 할 수 있습니다.이 코드들은 반드시 안전한 장소에 보관하십시오.각 코드는 한 번만 사용할 수 있습니다." backupCodeUsedWarning: "백업 코드가 사용되었습니다.인증 앱을 사용할 수 없게 된 경우, 조속히 인증 앱을 다시 설정해 주십시오." backupCodesExhaustedWarning: "백업 코드가 모두 사용되었습니다.인증 앱을 사용할 수 없는 경우 더 이상 계정에 액세스하는 것이 불가능합니다.인증 앱을 다시 등록해 주세요." - moreDetailedGuideHere: "여기에 자세한 설명이 있습니다" _permissions: "read:account": "계정의 정보를 봅니다" "write:account": "계정의 정보를 변경합니다" @@ -2114,6 +1948,7 @@ _permissions: "read:admin:server-info": "서버 정보 보기" "read:admin:show-moderation-log": "조정 기록 보기" "read:admin:show-user": "사용자 개인정보 보기" + "read:admin:show-users": "사용자 개인정보 보기" "write:admin:suspend-user": "사용자 정지하기" "write:admin:unset-user-avatar": "사용자 아바타 삭제하기" "write:admin:unset-user-banner": "사용자 배너 삭제하기" @@ -2151,7 +1986,7 @@ _permissions: "write:report-abuse": "위반 내용 신고하기" _auth: shareAccessTitle: "어플리케이션의 접근 허가" - shareAccess: "‘{name}’에서 계정에 접근하는 것을 허용하시겠습니까?" + shareAccess: "\"{name}\" 이 계정에 접근하는 것을 허용하시겠습니까?" shareAccessAsk: "이 애플리케이션이 계정에 접근하는 것을 허용하시겠습니까?" permission: "{name}에서 다음 권한을 요청하였습니다" permissionAsk: "이 앱은 다음의 권한을 요청합니다" @@ -2193,7 +2028,7 @@ _widgets: postForm: "글 입력란" slideshow: "슬라이드 쇼" button: "버튼" - onlineUsers: "온라인 사용자" + onlineUsers: "온라인 유저" jobQueue: "작업 대기열" serverMetric: "서버 통계" aiscript: "AiScript 콘솔" @@ -2255,7 +2090,7 @@ _postForm: f: "작성해주시길 기다리고 있어요..." _profile: name: "이름" - username: "사용자 이름" + username: "유저명" description: "자기소개" youCanIncludeHashtags: "해시 태그를 포함할 수 있습니다." metadata: "추가 정보" @@ -2267,13 +2102,9 @@ _profile: changeBanner: "배너 이미지 변경" verifiedLinkDescription: "내용에 자신의 프로필로 향하는 링크가 포함된 페이지의 URL을 삽입하면 소유자 인증 마크가 표시됩니다." avatarDecorationMax: "최대 {max}개까지 장식을 할 수 있습니다." - followedMessage: "팔로우 받았을 때 메시지" - followedMessageDescription: "팔로우 받았을 때 상대방에게 보여줄 단문 메시지를 설정할 수 있습니다." - followedMessageDescriptionForLockedAccount: "팔로우를 승인제로 한 경우, 팔로우 요청을 수락했을 때 보여줍니다." _exportOrImport: allNotes: "모든 노트" favoritedNotes: "즐겨찾기한 노트" - clips: "클립" followingList: "팔로잉" muteList: "뮤트" blockingList: "차단" @@ -2286,7 +2117,7 @@ _charts: apRequest: "요청" usersIncDec: "유저 수 증감" usersTotal: "유저 수 합계" - activeUsers: "활동 사용자 수" + activeUsers: "활성 유저 수" notesIncDec: "노트 수 증감" localNotesIncDec: "로컬 노트 수 증감" remoteNotesIncDec: "리모트 노트 수 증감" @@ -2297,8 +2128,8 @@ _charts: storageUsageTotal: "스토리지 사용량 합계" _instanceCharts: requests: "요청" - users: "사용자 수 차이" - usersTotal: "누적 사용자 수" + users: "유저 수 증감" + usersTotal: "누적 유저 수" notes: "노트 수 증감" notesTotal: "누적 노트 수" ff: "팔로잉/팔로워 증감" @@ -2327,7 +2158,6 @@ _play: title: "제목" script: "스크립트" summary: "설명" - visibilityDescription: "비공개로 설정하면 프로필에 표시하지 않지만 URL을 아는 사람은 계속해서 접속할 수 있습니다." _pages: newPage: "페이지 만들기" editPage: "페이지 수정" @@ -2338,7 +2168,7 @@ _pages: pageSetting: "페이지 설정" nameAlreadyExists: "지정한 페이지 URL이 이미 존재합니다" invalidNameTitle: "유효하지 않은 페이지 URL입니다" - invalidNameText: "비어있는지 확인해 주세요" + invalidNameText: "비어있지 않은지 확인해주세요" editThisPage: "이 페이지를 편집" viewSource: "소스 보기" viewPage: "페이지 보기" @@ -2362,7 +2192,6 @@ _pages: eyeCatchingImageSet: "아이캐치 이미지를 설정" eyeCatchingImageRemove: "아이캐치 이미지를 삭제" chooseBlock: "블록 추가" - enterSectionTitle: "섹션 타이틀을 입력하기" selectType: "종류 선택" contentBlocks: "콘텐츠" inputBlocks: "입력" @@ -2373,8 +2202,6 @@ _pages: section: "섹션" image: "이미지" button: "버튼" - dynamic: "동적 블록" - dynamicDescription: "이 블록은 폐지되었습니다. 이제부터 {play}에서 이용해 주세요." note: "노트필기" _note: id: "노트 ID" @@ -2404,29 +2231,22 @@ _notification: sendTestNotification: "테스트 알림 보내기" notificationWillBeDisplayedLikeThis: "알림이 이렇게 표시됩니다" reactedBySomeUsers: "{n}명이 반응했습니다" - likedBySomeUsers: "{n}명이 좋아요를 했습니다" renotedBySomeUsers: "{n}명이 리노트했습니다" followedBySomeUsers: "{n}명에게 팔로우됨" - flushNotification: "알림 이력을 초기화" - exportOfXCompleted: "{x} 추출에 성공했습니다." - login: "로그인 알림이 있습니다" _types: all: "전부" - note: "사용자의 새 글" + note: "유저의 새 게시물" follow: "팔로잉" mention: "멘션" reply: "답글" renote: "리노트" quote: "인용" - reaction: "반응" + reaction: "리액션" pollEnded: "투표가 종료됨" receiveFollowRequest: "팔로우 요청을 받았을 때" followRequestAccepted: "팔로우 요청이 승인되었을 때" roleAssigned: "역할이 부여 됨" achievementEarned: "도전 과제 획득" - exportCompleted: "추출을 성공함" - login: "로그인" - test: "알림 테스트" app: "연동된 앱을 통한 알림" _actions: followBack: "팔로우" @@ -2436,7 +2256,6 @@ _deck: alwaysShowMainColumn: "메인 칼럼 항상 표시" columnAlign: "칼럼 정렬" addColumn: "칼럼 추가" - newNoteNotificationSettings: "새 노트 알림 설정" configureColumn: "칼럼 설정" swapLeft: "왼쪽으로 이동" swapRight: "오른쪽으로 이동" @@ -2465,7 +2284,7 @@ _deck: direct: "다이렉트" roleTimeline: "역할 타임라인" _dialog: - charactersExceeded: "최대 글자수를 초과하였습니다! 현재 {current} / 최대 {max}" + charactersExceeded: "최대 글자수를 초과하였습니다! 현재 {current} / 최대 {min}" charactersBelow: "최소 글자수 미만입니다! 현재 {current} / 최소 {min}" _disabledTimeline: title: "비활성화된 타임라인" @@ -2475,10 +2294,9 @@ _drivecleaner: orderByCreatedAtAsc: "등록일이 오래된 순" _webhookSettings: createWebhook: "Webhook 생성" - modifyWebhook: "Webhook 수정" name: "이름" secret: "시크릿" - trigger: "트리거" + events: "Webhook을 실행할 타이밍" active: "활성화" _events: follow: "누군가를 팔로우했을 때" @@ -2488,29 +2306,6 @@ _webhookSettings: renote: "누군가 내 글을 리노트했을 때" reaction: "누군가 내 노트에 리액션했을 때" mention: "누군가 나를 멘션했을 때" - _systemEvents: - abuseReport: "유저롭" - abuseReportResolved: "받은 신고를 처리했을 때" - userCreated: "유저가 생성되었을 때" - inactiveModeratorsWarning: "모더레이터가 일정 기간동안 활동하지 않은 경우" - inactiveModeratorsInvitationOnlyChanged: "모더레이터가 일정 기간 활동하지 않아 시스템에 의해 초대제로 바뀐 경우" - deleteConfirm: "Webhook을 삭제할까요?" - testRemarks: "스위치 오른쪽에 있는 버튼을 클릭하여 더미 데이터를 사용한 테스트용 웹 훅을 보낼 수 있습니다." -_abuseReport: - _notificationRecipient: - createRecipient: "신고 수신자 추가" - modifyRecipient: "신고 수신자 편집" - recipientType: "알림 종류" - _recipientType: - mail: "이메일" - webhook: "Webhook" - _captions: - mail: "모더레이터 권한을 가진 사용자의 이메일 주소에 알림을 보냅니다 (신고를 받은 때에만)" - webhook: "지정한 SystemWebhook에 알림을 보냅니다 (신고를 받은 때와 해결했을 때에 송신)" - keywords: "키워드" - notifiedUser: "알릴 사용자" - notifiedWebhook: "사용할 Webhook" - deleteConfirm: "수신자를 삭제하시겠습니까?" _moderationLogTypes: createRole: "역할 생성" deleteRole: "역할 삭제" @@ -2526,7 +2321,7 @@ _moderationLogTypes: updateUserNote: "조정 기록 갱신" deleteDriveFile: "파일 삭제" deleteNote: "노트 삭제" - createGlobalAnnouncement: "전역 공지사항 생성" + createGlobalAnnouncement: "모든 공지사항 만들기" createUserAnnouncement: "사용자 공지사항 만들기" updateGlobalAnnouncement: "모든 공지사항 수정" updateUserAnnouncement: "사용자 공지사항 수정" @@ -2535,12 +2330,9 @@ _moderationLogTypes: resetPassword: "비밀번호 재설정" suspendRemoteInstance: "리모트 서버를 정지" unsuspendRemoteInstance: "리모트 서버의 정지를 해제" - updateRemoteInstanceNote: "리모트 서버의 조정 기록 갱신" markSensitiveDriveFile: "파일에 열람주의를 설정" unmarkSensitiveDriveFile: "파일에 열람주의를 해제" resolveAbuseReport: "신고 처리" - forwardAbuseReport: "신고 전달" - updateAbuseReportNote: "신고 조정 노트 갱신" createInvitation: "초대 코드 생성" createAd: "광고 생성" deleteAd: "광고 삭제" @@ -2550,16 +2342,6 @@ _moderationLogTypes: deleteAvatarDecoration: "아바타 장식 삭제" unsetUserAvatar: "유저 아바타 제거" unsetUserBanner: "유저 배너 제거" - createSystemWebhook: "SystemWebhook을 생성" - updateSystemWebhook: "SystemWebhook을 수정" - deleteSystemWebhook: "SystemWebhook을 삭제" - createAbuseReportNotificationRecipient: "신고 알림 수신자 생성" - updateAbuseReportNotificationRecipient: "신고 알림 수신자 편집" - deleteAbuseReportNotificationRecipient: "신고 알림 수신자 삭제" - deleteAccount: "계정을 삭제" - deletePage: "페이지를 삭제" - deleteFlash: "Play를 삭제" - deleteGalleryPost: "갤러리 포스트를 삭제" _fileViewer: title: "파일 상세" type: "파일 유형" @@ -2622,91 +2404,3 @@ _dataSaver: _code: title: "문자열 강조" description: "MFM 등으로 문자열 강조 기법을 사용할 때 누르기 전에는 불러오지 않습니다. 문자열 강조에서는 강조할 언어마다 그 정의 파일을 불러와야 하지만 이를 자동으로 불러오지 않으므로 데이터 사용량을 줄일 수 있습니다." -_hemisphere: - N: "북반구" - S: "남반구" - caption: "일부 클라이언트 설정에서 계절을 판단하려고 사용합니다." -_reversi: - reversi: "리버시" - gameSettings: "대국 설정" - chooseBoard: "보드 선택" - blackOrWhite: "선공/후공" - blackIs: "{name}님이 흑(선공)" - rules: "규칙" - thisGameIsStartedSoon: "대국을 곧 시작합니다" - waitingForOther: "상대의 준비가 끝나기를 기다리고 있습니다." - waitingForMe: "나의 준비가 끝나기를 기다리고 있습니다." - waitingBoth: "준비하세요" - ready: "준비 완료" - cancelReady: "준비되지 않음" - opponentTurn: "상대의 차례입니다" - myTurn: "나의 차례입니다" - turnOf: "{name}님의 차례입니다" - pastTurnOf: "{name}님의 차례" - surrender: "기권" - surrendered: "상대의 기권" - timeout: "시간 초과" - drawn: "무승부" - won: "{name}님의 승리" - black: "흑" - white: "백" - total: "합계" - turnCount: "{count}번째 수" - myGames: "내 대국" - allGames: "모든 대국" - ended: "종료" - playing: "대국 중" - isLlotheo: "돌이 적은 쪽이 승리(로세오)" - loopedMap: "순환 지도" - canPutEverywhere: "어디든 둘 수 있는 모드" - timeLimitForEachTurn: "각 수의 시간 제한" - freeMatch: "자유 대국" - lookingForPlayer: "대국 상대를 찾고 있습니다" - gameCanceled: "대국이 취소되었습니다" - shareToTlTheGameWhenStart: "대국이 시작할 때 타임라인에 공유" - iStartedAGame: "대국을 시작하였습니다! #MisskeyReversi" - opponentHasSettingsChanged: "상대가 설정을 변경했습니다" - allowIrregularRules: "규칙 변경 허용(완전 자유)" - disallowIrregularRules: "규칙 변경 없음" - showBoardLabels: "판에 행·열 번호 표시" - useAvatarAsStone: "돌을 아이콘으로 표시" -_offlineScreen: - title: "오프라인 - 서버에 접속할 수 없습니다" - header: "서버에 접속할 수 없습니다" -_urlPreviewSetting: - title: "URL 미리보기 설정" - enable: "URL 미리보기 활성화" - timeout: "미리보기를 불러올 때의 타임아웃 (ms)" - timeoutDescription: "미리보기를 로딩하는데 걸리는 시간이 정한 시간보다 오래 걸리는 경우, 미리보기를 생성하지 않습니다." - maximumContentLength: "Content-Length의 최대치 (byte)" - maximumContentLengthDescription: "Content-Length가 이 값을 넘어서면 미리보기를 생성하지 않습니다." - requireContentLength: "Content-Length를 받아온 경우에만 " - requireContentLengthDescription: "상대 서버가 Content-Length를 되돌려주지 않는다면 미리보기를 만들지 않습니다." - userAgent: "User-Agent" - userAgentDescription: "미리보기를 얻을 때 사용한 User-Agent를 설정합니다. 비어 있다면 기본값의 User-Agent를 사용합니다." - summaryProxy: "미리보기를 만든 프록시의 엔드포인트" - summaryProxyDescription: "Misskey 본체를 사용하지 않고 서머리 프록시로 미리보기를 만듭니다." - summaryProxyDescription2: "프록시는 아래의 파라미터를 쿼리 문자열로 연동합니다. 프록시 측이 이를 지원하지 않으면 설정값을 무시합니다." -_mediaControls: - pip: "화면 속 화면" - playbackRate: "재생 속도" - loop: "반복 재생" -_contextMenu: - title: "컨텍스트 메뉴" - app: "애플리케이션" - appWithShift: "Shift 키로 애플리케이션" - native: "브라우저의 UI" -_embedCodeGen: - title: "임베디드 코드를 커스터마이즈" - header: "해더를 표시" - autoload: "자동으로 다음 코드를 실행 (비권장)" - maxHeight: "최대 높이" - maxHeightDescription: "최대 값을 무시하려면 0을 입력하세요. 위젯이 상하로 길어지는 것을 방지하려면, 임의의 값을 입력해 주세요." - maxHeightWarn: "높이 최대 값이 설정되어져 있지 않습니다(0). 의도적으로 설정 하지 않았다면 임의의 값을 설정해주세요." - previewIsNotActual: "미리보기로 표시할 수 있는 크기보다 큽니다. 실제로 넣은 코드의 표시가 다른 경우가 있습니다." - rounded: "외곽선을 둥글게 하기" - border: "외곽선에 테두리를 씌우기" - applyToPreview: "미리보기에 반영" - generateCode: "임베디드 코드를 만들기" - codeGenerated: "코드를 만들었습니다." - codeGeneratedDescription: "만들어진 코드를 웹 사이트에 붙여서 사용하세요." diff --git a/locales/lo-LA.yml b/locales/lo-LA.yml index b100d0300f..c9e5aea1ed 100644 --- a/locales/lo-LA.yml +++ b/locales/lo-LA.yml @@ -1,9 +1,9 @@ --- _lang_: "ພາສາລາວ" -headlineMisskey: "ເຊື່ອມຕໍ່ເຄືອຂ່າຍໂດຍ note" -introMisskey: "ຍິນດີຕ້ອນຮັບ! Misskey ເປັນຊອຟແວopensource, ສຳລັບບໍລິການ microblogging ແບບ decentralized\nສ້າງ “note” ເພື່ອແບ່ງປັນຄວາມຄິດຂອງທ່ານກັບທຸກໆ ຄົນທີ່ຢູ່ອ້ອມຮອບທ່ານ 📡\nຢ່າລືມ “reaction” ໂນຕຂອງລາວເພື່ອສະແດງຄວາມຮູ້ສຶກ 👍\nມາສຳຫຼວດໂລກໃໝ່ແນ! 🚀" +headlineMisskey: "ເຊື່ອມຕໍ່ເຄືອຂ່າຍໂດຍຫມາຍເຫດ" +introMisskey: "ຍິນດີຕ້ອນຮັບ! Misskey ເປັນແຫຼ່ງເປີດ, ການບໍລິການ microblogging ກະຈາຍ\nສ້າງ \"ບັນທຶກ\" ເພື່ອແບ່ງປັນຄວາມຄິດຂອງທ່ານກັບທຸກໆຄົນທີ່ຢູ່ອ້ອມຮອບທ່ານ 📡\nດ້ວຍ \"ປະຕິກິລິຍາ\", ທ່ານຍັງສາມາດສະແດງຄວາມຮູ້ສຶກຂອງທ່ານຢ່າງໄວວາກ່ຽວກັບບັນທຶກຂອງທຸກໆຄົນ 👍\nມາສຳຫຼວດໂລກໃໝ່! 🚀" poweredByMisskeyDescription: "{name} ແມ່ນສ່ວນໜຶ່ງຂອງການບໍລິການທີ່ຂັບເຄື່ອນໂດຍແພລດຟອມ open source. Misskey (ເອີ້ນວ່າ \"Misskey instance\")" -monthAndDay: "ເດືອນ{month} / ວັນ{day}" +monthAndDay: "{ເດືອນ}/{ມື້}" search: "ຄົ້ນຫາ" notifications: "ການແຈ້ງເຕືອນ" username: "ຊື່ຜູ້ໃຊ້" @@ -15,79 +15,78 @@ gotIt: "ເຂົ້າໃຈແລ້ວ!" cancel: "ຍົກເລີກ" noThankYou: "ບໍ່​ແມ່ນ​ຕອນ​ນີ້" enterUsername: "ປ້ອນຊື່ຜູ້ໃຊ້" -renotedBy: "Renoted ໂດຍ {user}" -noNotes: "ບໍ່ມີ note" +renotedBy: "Renoted ໂດຍ {ຜູ້ໃຊ້}" +noNotes: "ບໍ່ມີຫມາຍເຫດ" noNotifications: "ບໍ່ມີການແຈ້ງເຕືອນ" -instance: "ເຊີຟເວີຣ໌" -settings: "ຕັ້ງຄ່າ" +instance: "ອີນສະແຕນ" +settings: "ກຳນົດຄ່າ" notificationSettings: "ຕັ້ງຄ່າການແຈ້ງເຕືອນ" basicSettings: "ການຕັ້ງຄ່າພື້ນຖານ" otherSettings: "ການຕັ້ງຄ່າອື່ນໆ" -openInWindow: "ເປີດໃນ window" -profile: "ໂປຣໄຟລ໌" -timeline: "ໄທມ໌ໄລນ໌" -noAccountDescription: "ຜູ້ໃຊ້ຄົນນີ້ຍັງບໍ່ໄດ້ຂຽນຄຳແນະນຳໂຕ" +openInWindow: "ເປີດຢູ່ໃນປ່ອງຢ້ຽມ" +profile: "ໂພຼຟາຍ" +timeline: "​ເສັ້ນກຳ​ນົດ​ເວ​ລາ​" +noAccountDescription: "ຜູ້ໃຊ້ນີ້ຍັງບໍ່ໄດ້ຂຽນໃນຊີວະປະຫວັດຂອງເຂົາເຈົ້າເທື່ອ" login: "ເຂົ້າ​ສູ່​ລະ​ບົບ" loggingIn: "ກຳລັງເຂົ້າສູ່ລະບົບ..." logout: "ອອກ​ຈາກ​ລະ​ບົບ" signup: "ລົງ​ທະ​ບຽນ" -uploading: "ກຳລັງອັບໂຫຼດ..." +uploading: "ການອັບໂຫຼດ..." save: "ບັນທຶກ" -users: "ຜູ້ໃຊ້" +users: "ຜູ້ໃຊ້ຕ່າງໆ" addUser: "ເພີ່ມຜູ້ໃຊ້" favorite: "ເພີ່ມໃສ່ລາຍການທີ່ມັກ" favorites: "ລາຍການທີ່ມັກ" -unfavorite: "ເອົາອອກຈາກລາຍການທີ່ມັກ" +unfavorite: "ລຶບອອກຈາກລາຍການທີ່ມັກ" favorited: "ເພີ່ມໃສ່ລາຍການທີ່ມັກແລ້ວ" alreadyFavorited: "ເພີ່ມເຂົ້າໃນລາຍການທີ່ມັກແລ້ວ." cantFavorite: "ບໍ່ສາມາດເພີ່ມໃສ່ລາຍການທີ່ມັກໄດ້." -pin: "ປັກໝຸດ" -unpin: "ຖອດປັກໝຸດອອກ" +pin: "ປັກໝຸດໄປຫາໂປຣໄຟລ໌" +unpin: "ຖອດປັກໝຸດອອກຈາກໂປຣໄຟລ໌" copyContent: "ຄັດລອກເນື້ອຫາ" -copyLink: "ຄັດລອກລິ້ງ" -copyLinkRenote: "ຄັດລອກລິ້ງຂອງ renote" +copyLink: "ສຳເນົາລິ້ງ" delete: "ລຶບ" -deleteAndEdit: "ລຶບ​ແລະ​ແກ້​ໄຂ​" -deleteAndEditConfirm: "ຕ້ອງການລຶບ note ນີ້ແລະແກ້ໄຂໃໝ່ແມ່ນບໍ່? reaction, renote ແລະການຕອບກັບຕໍ່ note ນີ້ ທັງເບິດຈະຖືກລຶບອອກ" +deleteAndEdit: "ລົບ​ແລະ​ແກ້​ໄຂ​" +deleteAndEditConfirm: "ເຈົ້າ​ແນ່​ໃຈ​ບໍ່? ທີ່ທ່ານຕ້ອງການທີ່ຈະລຶບບັນທຶກນີ້ແລະແກ້ໄຂມັນ ທ່ານອາດຈະສູນເສຍການໂຕ້ຕອບ, ບັນທຶກ, ແລະການຕອບກັບທັງໝົດ" addToList: "ເພີ່ມໃສ່ລາຍຊື່" addToAntenna: "ເພີ່ມໃສ່ເສົາອາກາດ" sendMessage: "ສົ່ງຂໍ້ຄວາມ" -copyRSS: "ຄັດລອກ RSS" -copyUsername: "ຄັດລອກຊື່ຜູ້ໃຊ້" -copyUserId: "ຄັດລອກ ID ຜູ້ໃຊ້" -copyNoteId: "ຄັດລອກ ID ຂອງ note" -copyFileId: "ຄັດລອກ ID ໄຟລ໌" -copyFolderId: "ຄັດລອກ ID ໂຟລ໌ເດີຣ໌" -copyProfileUrl: "ຄັດລອກ URL ໂປຣໄຟລ໌" +copyRSS: "ສຳເນົາ RSS" +copyUsername: "ສຳເນົາຊື່ຜູ້ໃຊ້" +copyUserId: "ສຳເນົາ ID ຜູ້ໃຊ້" +copyNoteId: "ສຳເນົາ ID ບັນທຶກ" +copyFileId: "ສຳເນົາ ID ໄຟລ໌" +copyFolderId: "ສຳເນົາ ID ໂຟນເດີ" +copyProfileUrl: "ສຳເນົາ URL ໂປຣໄຟລ໌" searchUser: "ຄົ້ນຫາຜູ້ໃຊ້" -reply: "ຕອບ​ກັບ" +reply: "ຕອບ​ໄປ​ທີ" loadMore: "ໂຫຼດເພີ່ມເຕີມ" showMore: "ໂຫຼດເພີ່ມເຕີມ" showLess: "ປິດ" -youGotNewFollower: "ໄດ້ຕິດຕາມເຈົ້າ" -receiveFollowRequest: "ມີຄຳຂໍຕິດຕາມສົ່ງມາ" -followRequestAccepted: "ການຕິດຕາມໄດ້ຮັບອນຸຍາດແລ້ວ" -mention: "ເວົ້າເຖີງ" -mentions: "ເວົ້າເຖີງເຈົ້າ" -directNotes: "ໂພສ Direct note" +youGotNewFollower: "ໄດ້ຕິດຕາມທ່ານ" +receiveFollowRequest: "ປະຕິບັດຕາມຄໍາຮ້ອງຂໍທີ່ໄດ້ຮັບ" +followRequestAccepted: "ຜູ້ຕິດຕາມໄດ້ຍອມຮັບຄໍາຮ້ອງຂໍຂອງທ່ານ" +mention: "ໄດ້ກ່າວມາ" +mentions: "ກ່າວເຖິງ" +directNotes: "ໂດຍກົງຫມາຍເຫດ" importAndExport: "ນໍາເຂົ້າ / ສົ່ງອອກ" import: "ນຳເຂົ້າ" -export: "ສົ່ງອອກ" +export: "ນຳອອກ" files: "ໄຟລ໌" download: "ດາວໂຫລດ" -driveFileDeleteConfirm: "ຕ້ອງການລຶບໄຟລ໌ “{name}” ແມ່ນບໍ່? Note ທີ່ແນບມາກັບໄຟລ໌ນີ້ຈະຖືກລຶບອອກ" -unfollowConfirm: "ຕ້ອງການເລີກຕິດຕາມ {name} ແມ່ນບໍ່?" -exportRequested: "ເຈົ້າໄດ້ຮ້ອງຂໍການສົ່ງອອກ ອາດໃຊ້ເວລາຈັກໜ່ອຍ ເມື່ອແລ້ວຈະຖືກເພີ່ມໃສ່ drive" -importRequested: "ເຈົ້າໄດ້ຮ້ອງຂໍການນຳເຂົ້າ ການດຳເນິນການນີ້ອາດໃຊ້ເວລາຈັກໜ່ອຍ" +driveFileDeleteConfirm: "ທ່ານແນ່ໃຈບໍ່ວ່າຕ້ອງການລຶບໄຟລ໌ \"{name}\"? ບັນທຶກທີ່ມີໄຟລ໌ແນບນີ້ຈະຖືກລຶບຖິ້ມ" +unfollowConfirm: "ທ່ານແນ່ໃຈບໍ່ວ່າຕ້ອງການເຊົາຕິດຕາມ {name}?" +exportRequested: "ໃນເວລາທີ່ທ່ານໄດ້ຮ້ອງຂໍການສົ່ງອອກ ມັນອາດຈະໃຊ້ເວລາບາງເວລາ ແລະມັນຈະຖືກເພີ່ມໃສ່ drive ຂອງທ່ານເມື່ອມັນສຳເລັດແລ້ວ" +importRequested: "ໃນເວລາທີ່ທ່ານໄດ້ຮ້ອງຂໍການນໍາເຂົ້າ ມັນອາດຈະໃຊ້ເວລາບາງເວລາ" lists: "ລາຍການ" -noLists: "ບໍ່​ມີ​ລາຍ​ການ​ໃດໆ​" -note: "Note" -notes: "Note" +noLists: "ທ່ານ​ບໍ່​ມີ​ລາຍ​ການ​ໃດໆ​" +note: "ບັນທຶກ" +notes: "ບັນທຶກ" following: "ກຳລັງຕິດຕາມ" followers: "ຜູ້ຕິດຕາມ" followsYou: "ຕິດ​ຕາມ​ເຈົ້າ" createList: "ສ້າງລາຍຊື່" -manageLists: "ຈັດການລາຍຊື່" +manageLists: "ການບໍລິຫານບັນຊີລາຍການ" error: "ຂໍ້ຜິດພາດ" somethingHappened: "​ອຸຍ, ມີ​ບາງ​ຢ່າງ​ຜິ​ດ​ພາດ" retry: "ລອງໃຫມ່" @@ -97,38 +96,38 @@ serverIsDead: "ເຊີບເວີນີ້ບໍ່ຕອບສະໜອງ youShouldUpgradeClient: "ເພື່ອເບິ່ງໜ້ານີ້, ກະລຸນາໂຫຼດຂໍ້ມູນຄືນໃໝ່ເພື່ອອັບເດດລູກຄ້າຂອງທ່ານ" enterListName: "ໃສ່ຊື່ສຳລັບລາຍຊື່" privacy: "ຄວາມເປັນສ່ວນຕົວ" -makeFollowManuallyApprove: "ຕິດຕາມຄຳຂໍທີ່ຕ້ອງໄດ້ຮັບການອະນຸມັດ" -defaultNoteVisibility: "ການເບິ່ງເຫັນທີ່ເປັນຄ່າເລີ່ມຕົ້ນ" +makeFollowManuallyApprove: "ປະຕິບັດຕາມການຮ້ອງຂໍຮຽກຮ້ອງໃຫ້ມີການອະນຸມັດ" +defaultNoteVisibility: "ເປັນຄ່າເລີ່ມຕົ້ນ" follow: "ກຳລັງຕິດຕາມ" -followRequest: "ສົ່ງ​ຄຳຂໍ​ຕິ​ດ​ຕາມ​" -followRequests: "ສົ່ງ​ຄຳຂໍ​ຕິ​ດ​ຕາມ​" +followRequest: "ສົ່ງ​ການ​ຮ້ອງ​ຂໍ​ປະ​ຕິ​ບ​ຕາມ​" +followRequests: "ປະຕິບັດຕາມຄໍາຮ້ອງຂໍ" unfollow: "ເຊົາຕິດຕາມ" -followRequestPending: "ລໍຖ້າການອະນຸມັດໃຫ້ຕິດຕາມ" -enterEmoji: "ປ້ອນເອໂມຈິ" +followRequestPending: "ປະຕິບັດຕາມຄໍາຮ້ອງຂໍທີ່ລໍຖ້າຢູ່" +enterEmoji: "ປ້ອນອີໂມຈິ" renote: "Renote" unrenote: "ເລີກ Renote" -renoted: "renote ແລ້ວ" -cantRenote: "ໂພສນີ້ບໍ່ສາມາດ renote ໃໝ່ໄດ້" +renoted: "ເກັບບັນທຶກໄວ້" +cantRenote: "ໂພສນີ້ບໍ່ສາມາດຖືກບັນທຶກໄວ້ຄືນໃໝ່ໄດ້" cantReRenote: "ບໍ່ສາມາດບັນທຶກຄືນໃໝ່ໄດ້" -quote: "ອ້າງອີງ" -inChannelRenote: "Renote ໃນ channel ເທົ່ານັ້ນ" -inChannelQuote: "ອ້າງອິງໃນ channel ເທົ່ານັ້ນ" -pinnedNote: "note ທີ່ປັກໝຸດໄວ້" -pinned: "ປັກໝຸດ" +quote: "ລວມຂໍ້ຄວາມອ້າງອີງ" +inChannelRenote: "ຊ່ອງພຽງແຕ່ Renote" +inChannelQuote: "ຊ່ອງເທົ່ານັ້ນ Quote" +pinnedNote: "ບັນທຶກທີ່ປັກໝຸດໄວ້" +pinned: "ປັກໝຸດໄປຫາໂປຣໄຟລ໌" you: "ເຈົ້າ" clickToShow: "ກົດເພື່ອສະແດງໃຫ້ເຫັນ" sensitive: "NSFW" add: "ເພີ່ມ" -reaction: "reaction" -reactions: "reaction" +reaction: "ປະຕິກິລິຍາ" +reactions: "ປະຕິກິລິຍາ" attachCancel: "ເອົາໄຟລ໌ແນບ" mute: "ປີດສຽງ" unmute: "ເປີດສຽງ" -block: "ບລັອກ" -unblock: "ເລີກບລັອກ" +block: "ບ໋ອກ" +unblock: "ຍົກເລີກກາຮົບລັອກ" suspend: "ລະງັບ" unsuspend: "ເຊົາ​ລະ​ງັບ" -selectList: "ເລືອກລາຍຊື່" +selectList: "ເລືອກບັນຊີລາຍການ" editList: "ແກ້ໄຂລາຍຊື່" selectChannel: "ເລືອກຊ່ອງ" selectAntenna: "ເລືອກເສົາອາກາດ" @@ -151,30 +150,30 @@ flagShowTimelineRepliesDescription: "ສະແດງການຕອບກັບ autoAcceptFollowed: "ອະນຸມັດອັດຕະໂນມັດຕາມຄຳຮ້ອງຂໍຈາກຜູ້ໃຊ້ທີ່ທ່ານກຳລັງຕິດຕາມຢູ່" addAccount: "ເພີ່ມບັນຊີ" loginFailed: "ການເຂົ້າສູ່ລະບົບບໍ່ສຳເລັດ" -showOnRemote: "ເບິ່ງໃນເຊີຟເວີຣ໌ໄລຍະໄກ" +showOnRemote: "ເບິ່ງຢູ່ໃນຕົວຢ່າງໄລຍະໄກ" general: "ທົ່ວໄປ" wallpaper: "ພາບພື້ນຫລັງ" setWallpaper: "ຕັ້ງເປັນພາບພື້ນຫຼັງ" removeWallpaper: "ລຶບຮູບວໍເປເປີອອກ" searchWith: "ຊອກຫາ: {q}" -youHaveNoLists: "ເຈົ້າບໍ່ມີລາຍຊື່ໃດໆ" +youHaveNoLists: "ທ່ານ​ບໍ່​ມີ​ລາຍ​ການ​ໃດໆ​" proxyAccount: "ບັນຊີພຣັອກຊີ" -host: "ໂຮສຕ໌" +host: "ໂຮດສ" selectUser: "ເລືອກຜູ້ໃຊ້" recipient: "ເຖິງ" annotation: "ຄຳເຫັນ" federation: "ສະຫະພັນ" -instances: "ເຊີຟເວີຣ໌" +instances: "ອີນສະແຕນ" registeredAt: "ລົງທະບຽນຢູ່" storageUsage: "ບ່ອນ​ຈັດ​ເກັບ​ຂໍ້​ມູນທີ່ໃຊ້" -charts: "ແຜນພູມ" +charts: "ອັນດັບເພງ" perHour: "ຕໍ່ຊົ່ວໂມງ" perDay: "ຕໍ່​ມື້" stopActivityDelivery: "ຢຸດເຊົາການສົ່ງກິດຈະກໍາ" blockThisInstance: "ຂັດຂວາງຕົວຢ່າງນີ້" operations: "ການດຳເນີນງານ" software: "ຊອບແວ" -version: "ເວີຣ໌ຊັນ" +version: "ສະບັບ" metadata: "Metadata" withNFiles: "{n} ໄຟລ໌(s)" monitor: "ຈໍພາບ" @@ -199,15 +198,15 @@ federating: "ສະຫະພັນ" blocked: "ບລັອກແລ້ວ " suspended: "ໂຈະ" all: "ທັງໝົດ" -subscribing: "ກຳລັງສະມັກສະມາຊິກ" -publishing: "ກຳລັງ​ເຜີຍ​ແພ່" +subscribing: "ສະໝັກສະມາຊິກແລັວ" +publishing: "ການ​ພິມ​ເຜີຍ​ແຜ່" notResponding: "ບໍ່ຕອບສະໜອງ" -instanceFollowing: "ກຳລັງຕິດຕາມບົນເຊີຟເວີຣ໌" -instanceFollowers: "ຜູ້ຕິດຕາມຂອງເຊີຟເວີຣ໌" -instanceUsers: "ຜູ້​ໃຊ້​ຂອງ​ເຊີຟເວີຣ໌ນີ້" +instanceFollowing: "ກຳລັງຕິດຕາມສຸດຕົວຢ່າງ" +instanceFollowers: "ຜູ້ຕິດຕາມຕົວຢ່າງ" +instanceUsers: "ຜູ້​ຊົມ​ໃຊ້​ຂອງ​ຕົວ​ຢ່າງ​ນີ້​" changePassword: "ປ່ຽນ​ລະ​ຫັດ​ຜ່ານ" security: "ຄວາມປອດໄພ" -retypedNotMatch: "ປ້ອນຂໍ້ມູນບໍ່ກົງກັນ" +retypedNotMatch: "ວັດສະດຸປ້ອນບໍ່ກົງກັນ" currentPassword: "ລະຫັດຜ່ານປະຈຸບັນ" newPassword: "ລະຫັດຜ່ານໃໝ່" newPasswordRetype: "ໃສ່ລະຫັດຜ່ານໃໝ່ອີກເທື່ອໜຶ່ງ" @@ -223,14 +222,14 @@ remove: "ລຶບ" removed: "ລຶບແລ້ວ" resetAreYouSure: "ຣີ​ເຊັດບໍ?" saved: "ບັນທຶກແລ້ວ" -messaging: "ແຊັຕ" +messaging: "ແຊ໋ດ" upload: "ອັບໂຫຼດ" keepOriginalUploading: "ຮັກສາຮູບພາບຕົ້ນສະບັບ" fromDrive: "ຈາກ Drive" fromUrl: "ຈາກ URL" uploadFromUrl: "ອັບໂຫຼດຈາກ URL" uploadFromUrlDescription: "URL ຂອງໄຟລ໌ທີ່ທ່ານຕ້ອງການອັບໂຫລດ" -uploadFromUrlRequested: "ຮ້ອງຂໍການອັບໂຫລດແລ້ວ" +uploadFromUrlRequested: "ຮ້ອງຂໍການອັບໂຫລດ" explore: "ສຳຫຼວດ" messageRead: "ອ່ານແລ້ວ" startMessaging: "ເລີ່ມການສົນທະນາໃໝ່" @@ -244,47 +243,47 @@ images: "ຮູບພາບ" image: "ຮູບພາບ" birthday: "ວັນເກີດ" yearsOld: "{age} ປີ" -registeredDate: "ວັນທີ່ລົງທະບຽນ" +registeredDate: "ວັນທີ່ເປັນສະມາຊິກ" location: "ທີ່ຕັ້ງ" -theme: "Theme" -themeForLightMode: "Theme ໃຊ້ໃນໂໝດສະຫວ່າງ" -themeForDarkMode: "Theme ໃຊ້ໃນໂໝດມືດ" +theme: "ແທ໋ມ" +themeForLightMode: "ຮູບແບບສີສັນເພື່ອໃຊ້ໃນໂໝດແສງ" +themeForDarkMode: "ຮູບແບບສີສັນທີ່ຈະໃຊ້ຢູ່ໃນໂໝດມືດ" light: "ສະຫວ່າງ" dark: "ມືດ" lightThemes: "ຊຸດຮູບແບບສະຫວ່າງ" darkThemes: "ຮູບແບບສີສັນມືດ" syncDeviceDarkMode: "ຊິງຄ໌ໂໝດມືດກັບການຕັ້ງຄ່າທົ່ວອຸປະກອນ" -drive: "Drive" +drive: "ຂັບ" fileName: "ຊື່ໄຟລ໌" selectFile: "ເລືອກໄຟລ໌" selectFiles: "ເລືອກໄຟລ໌" selectFolder: "ເລືອກໂຟລເດີ" selectFolders: "ເລືອກໂຟລເດີ" renameFile: "ປ່ຽນຊື່ໄຟລ໌" -folderName: "ຊື່ໂຟລເດີຣ໌" +folderName: "ຊື່ໂຟນເດີ" createFolder: "​ສ້າງ​ໂຟ​ລ​ເດີ" renameFolder: "ປ່ຽນຊື່ໂຟນເດີນີ້" deleteFolder: "ລົບໂຟ​ລ​ເດີ​" addFile: "ເພີ່ມໄຟລ໌" emptyDrive: "Drive ຂອງທ່ານຫວ່າງເປົ່າ" -emptyFolder: "ໂຟລເດີຣ໌ນີ້ວ່າງເປົ່າ" +emptyFolder: "ໂຟນເດີນີ້ເປົ່າຫວ່າງ" unableToDelete: "ບໍ່​ສາ​ມາດລົບໄດ້" inputNewFileName: "ໃສ່ຊື່ໄຟລ໌ໃໝ່" inputNewDescription: "ໃສ່ຄຳບັນຍາຍໃໝ່" inputNewFolderName: "ໃສ່ຊື່ໂຟນເດີໃໝ່" circularReferenceFolder: "ໂຟນເດີປາຍທາງແມ່ນໂຟນເດີຍ່ອຍຂອງໂຟນເດີທີ່ທ່ານຕ້ອງການຍ້າຍ" rename: "ປ່ຽນຊື່" -doNothing: "ຢ່າມັນ" -watch: "ເພັ່ງເລັງ" -unwatch: "ຢຸດເພັ່ງເລັງ" +doNothing: "ບໍ່ສົນໃຈ" +watch: "ເບິ່ງ" +unwatch: "ຢຸດເບິ່ງ" accept: "ອະນຸຍາດ" reject: "ປະຕິເສດ" normal: "ປົກກະຕິ" instanceName: "ຊື່ເຊີເວີ້" -instanceDescription: "ຄຳອະທິບາຍແນະນຳເຊີຟເວີຣ໌" +instanceDescription: "ຄໍາອະທິບາຍຕົວຢ່າງ" maintainerName: "ຜູ້ດູແລ" -maintainerEmail: "ອີເມລຜູ້ດູແລ" -tosUrl: " URL ເງື່ອນໄຂການໃຫ້ບໍລິການ" +maintainerEmail: "ອີເມວ admin" +tosUrl: "ເງື່ອນໄຂການໃຫ້ບໍລິການ URL" thisYear: "ປີນີ້" thisMonth: "ເດືອນນີ້" today: "ມື້ນີ້" @@ -292,34 +291,32 @@ dayX: "ວັນ {day}" monthX: "ເດືອນ {month}" yearX: "ປີ {year}" pages: "ໜ້າ" -integration: "ເຊື່ອມໂຍງ" +integration: "ຄວາມສຳພັນຂອງ" connectService: "ເຊື່ອມຕໍ່" disconnectService: "ຕັດການເຊື່ອມຕໍ່" enableLocalTimeline: "ເປີດໃຊ້ທາມລາຍທ້ອງຖິ່ນ" enableGlobalTimeline: "ເປີດໃຊ້ທາມລາຍທົ່ວໂລກ" -disablingTimelinesInfo: "ຜູ້ດູແລລະບບແລະຜູ້ຄວບຄຸມຈະສາມາດເຂົ້າເຖີງໄທມ໌ໄລນ໌ທັ້ງເບີດ ເຖີງວ່າຈະບໍ່ໄດ້ເປີດໃຊ້ງານກໍ່ຕາມ" +disablingTimelinesInfo: "ຜູ້ເບິ່ງແຍງລະບົບ ແລະຜູ້ຄວບຄຸມຈະມີການເຂົ້າເຖິງທຸກກຳນົດເວລາ, ເຖິງແມ່ນວ່າຈະບໍ່ໄດ້ເປີດໃຊ້ງານກໍຕາມ" registration: "ລົງທະບຽນ" enableRegistration: "ເປີດໃຊ້ການລົງທະບຽນຜູ້ໃຊ້ໃໝ່" invite: "ເຊີນ" -driveCapacityPerLocalAccount: "ຄວາມຈຸຂອງ drive ຕໍ່ຜູ້ໃຊ້ທ້ອງຖິ່ນ" -driveCapacityPerRemoteAccount: "ຄວາມຈຸຂອງ drive ຕໍ່ຜູ້ໃຊ້ໄລຍະໄກ" +driveCapacityPerLocalAccount: "ຄວາມອາດສາມາດຂັບຕໍ່ຜູ້ໃຊ້ທ້ອງຖິ່ນ" +driveCapacityPerRemoteAccount: "ໄດຣຟ໌ຄວາມອາດສາມາດຕໍ່ຜູ້ໃຊ້ທາງໄກ" basicInfo: "ຂໍ້ມຸນເບື້ອງຕົ້ນ" -pinnedNotes: "Note ທີ່ປັກໝຸດໄວ້" -hcaptchaSiteKey: "Site key" -hcaptchaSecretKey: "Secret key" -mcaptchaSiteKey: "Site key" -mcaptchaSecretKey: "Secret Key" +pinnedNotes: "ບັນທຶກທີ່ປັກໝຸດໄວ້" +hcaptchaSiteKey: "ກະແຈໄຊທ໌" +hcaptchaSecretKey: "ກະແຈລັບ" recaptcha: "reCAPTCHA" -enableRecaptcha: "ເປີດໃຊ້ງານ reCAPTCHA" -recaptchaSiteKey: "Site key" -recaptchaSecretKey: "Secret key" -turnstileSiteKey: "Site key" -turnstileSecretKey: "Secret key" +enableRecaptcha: "ເປີດໃຊ້ງານລີແຄ໋ບຈາ" +recaptchaSiteKey: "ກະແຈໄຊທ໌" +recaptchaSecretKey: "ກະແຈລັບ" +turnstileSiteKey: "ກະແຈໄຊທ໌" +turnstileSecretKey: "ກະແຈລັບ" name: "ຊື່" userList: "ລາຍການ" about: "ກ່ຽວກັບ" aboutMisskey: "ກ່ຽວກັບ Misskey" -administrator: "ຜູ້ດູແລ" +administrator: "ຜູ້ບໍລິຫານ" token: "ໂທເຄັນ" share: "ແບ່ງປັນ" notFound: "ບໍ່ພົບ" @@ -332,27 +329,27 @@ title: "ຫົວຂໍ້" text: "ຂໍ້ຄວາມ" enable: "ເປີດໃຊ້" next: "ຕໍ່ໄປ" -retype: "ລອງພິມລະຫັດອີກເທື່ອໜຶ່ງ" -quoteAttached: "ອ້າງອິງ" +retype: "ເຂົ້າໄປອີກຄັ້ງ" +quoteAttached: "ວົງຢືມ" invitations: "ເຊີນ" unavailable: "ບໍ່​ສາ​ມາດ​ໃຊ້​ໄດ້" language: "ພາສາ" aboutX: "ກ່ຽວກັບ {x}" emojiStyle: "ຮູບແບບອີໂມຈິ" native: "ພາ​ສາ​ແມ່" -noHistory: "​ບໍ່​ມີປະຫວັດ" +noHistory: "​ບໍ່​ມີ​ລາຍ​ການ​ຢູ່​ບ່ອນ​ນີ້" doing: "ກຳລັງປະມວນຜົນ..." category: "ຫມວດຫມູ່" -tags: "Aliases" +tags: "ແທ໋ກ" createAccount: "ສ້າງບັນຊີ" -existingAccount: "ບັນຊີທີ່ມີຢູ່ແລ້ວ" -dashboard: "Dashboard" +existingAccount: "ທີ່ມີຢູ່" +dashboard: "ໜ້າປັດ" local: "ທ້ອງຖິ່ນ" numberOfDays: "ຈຳນວນມື້" objectStorageBucket: "Bucket" objectStoragePrefix: "Prefix" objectStorageEndpoint: "Endpoint" -objectStorageRegion: "ພູມິພາກ" +objectStorageRegion: "ພາກ​ພື້ນ" deleteAll: "ລຶບທັງໝົດ" sounds: "ສຽງ" sound: "ສຽງ" @@ -365,11 +362,11 @@ state: "ສະຖານະ" sort: "ຈັດຮຽງໂດຍ" ascendingOrder: "ນ້ອຍໄປຫາໃຫຍ່" descendingOrder: "ໃຫຍ່ຫານ້ອຍ" -output: "Output" -script: "Script" +output: "ຜົນຜະລິດ" +script: "ບົດ​ຄວາມ" menu: "ເມນູ" -rearrange: "ຈັດລຽງໃໝ່" -poll: "Poll" +rearrange: "ຈັດລຽງຄືນ" +poll: "ການພູນ" description: "ລາຍລະອຽດ" author: "ຜູ້ຂຽນ" manage: "ການຈັດການ" @@ -383,7 +380,7 @@ permission: "ການອະນຸຍາດ" notificationType: "​ປະເພດການ​ແຈ້ງ​ເຕືອນ" edit: "ແກ້ໄຂ" email: "ອີເມວ" -smtpHost: "ໂຮສຕ໌" +smtpHost: "ໂຮດສ" smtpUser: "ຊື່ຜູ້ໃຊ້" smtpPass: "ລະຫັດຜ່ານ" clearCache: "ລຶບລ້າງແຄສ" @@ -393,12 +390,8 @@ administration: "ການຈັດການ" middle: "ປານກາງ" searchByGoogle: "ຄົ້ນຫາ" file: "ໄຟລ໌" -replies: "ຕອບ​ກັບ" +replies: "ຕອບ​ໄປ​ທີ" renotes: "Renote" -_delivery: - stop: "ໂຈະ" - _type: - none: "ກຳລັງ​ເຜີຍ​ແພ່" _role: _priority: middle: "ປານກາງ" @@ -416,8 +409,8 @@ _sfx: _2fa: renewTOTPCancel: "ບໍ່​ແມ່ນ​ຕອນ​ນີ້" _widgets: - profile: "ໂປຣໄຟລ໌" - instanceInfo: "ຂໍ້ມູລເຊີຟເວີຣ໌" + profile: "ໂພຼຟາຍ" + instanceInfo: "ອີນສະແຕນ" notifications: "ການແຈ້ງເຕືອນ" timeline: "​ເສັ້ນກຳ​ນົດ​ເວ​ລາ​" activity: "ກິດຈະກຳ" @@ -436,29 +429,28 @@ _profile: _exportOrImport: followingList: "ກຳລັງຕິດຕາມ" muteList: "ປີດສຽງ" - blockingList: "ບລັອກ" + blockingList: "ບ໋ອກ" userLists: "ລາຍການ" _charts: federation: "ສະຫະພັນ" _timelines: home: "ໜ້າຫຼັກ" _play: - script: "Script" + script: "ບົດ​ຄວາມ" summary: "ລາຍລະອຽດ" _pages: blocks: image: "ຮູບພາບ" _notification: - youWereFollowed: "ໄດ້ຕິດຕາມເຈົ້າ" + youWereFollowed: "ໄດ້ຕິດຕາມທ່ານ" _types: follow: "ກຳລັງຕິດຕາມ" - mention: "ໄດ້ກ່າວເຖິງ" + mention: "ໄດ້ກ່າວມາ" renote: "Renote" - quote: "ອ້າງອີງ" - reaction: "Reaction" - login: "ເຂົ້າ​ສູ່​ລະ​ບົບ" + quote: "ລວມຂໍ້ຄວາມອ້າງອີງ" + reaction: "ປະຕິກິລິຍາ" _actions: - reply: "ຕອບ​ກັບ" + reply: "ຕອບ​ໄປ​ທີ" renote: "Renote" _deck: _columns: @@ -466,12 +458,8 @@ _deck: tl: "​ເສັ້ນກຳ​ນົດ​ເວ​ລາ​" list: "ລາຍການ" channel: "ຊ່ອງ" - mentions: "ກ່າວເຖິງເຈົ້າ" + mentions: "ກ່າວເຖິງ" _webhookSettings: name: "ຊື່" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "ອີເມວ" _moderationLogTypes: suspend: "ລະງັບ" diff --git a/locales/nl-NL.yml b/locales/nl-NL.yml index dde3035357..98f1693129 100644 --- a/locales/nl-NL.yml +++ b/locales/nl-NL.yml @@ -348,8 +348,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Inschakelen hCaptcha" hcaptchaSiteKey: "Site sleutel" hcaptchaSecretKey: "Geheime sleutel" -mcaptchaSiteKey: "Site sleutel" -mcaptchaSecretKey: "Geheime sleutel" recaptcha: "reCAPTCHA" enableRecaptcha: "Inschakelen reCAPTCHA" recaptchaSiteKey: "Site sleutel" @@ -429,10 +427,6 @@ loggedInAsBot: "Momenteel als bot ingelogd" icon: "Avatar" replies: "Antwoord" renotes: "Herdelen" -_delivery: - stop: "Opgeschort" - _type: - none: "Publiceren" _email: _follow: title: "volgde jou" @@ -486,7 +480,6 @@ _notification: renote: "Herdelen" quote: "Quote" reaction: "Reacties" - login: "Inloggen" _actions: reply: "Antwoord" renote: "Herdelen" diff --git a/locales/no-NO.yml b/locales/no-NO.yml index c5f61db745..195b1d0717 100644 --- a/locales/no-NO.yml +++ b/locales/no-NO.yml @@ -463,9 +463,6 @@ options: "Alternativ" icon: "Avatar" replies: "Svar" renotes: "Renote" -surrender: "Avbryt" -_delivery: - stop: "Suspendert" _initialAccountSetting: theseSettingsCanEditLater: "Du kan endre disse innstillingene senere." _achievements: @@ -701,7 +698,6 @@ _notification: renote: "Renotes" quote: "Sitater" reaction: "Reaksjoner" - login: "Logg inn" _actions: reply: "Svar" renote: "Renote" @@ -722,9 +718,5 @@ _deck: direct: "Direkte" _webhookSettings: name: "Navn" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "E-post" _moderationLogTypes: suspend: "Suspender" diff --git a/locales/pl-PL.yml b/locales/pl-PL.yml index d7afd57760..496e9bfc30 100644 --- a/locales/pl-PL.yml +++ b/locales/pl-PL.yml @@ -20,7 +20,6 @@ noNotes: "Brak wpisów" noNotifications: "Brak powiadomień" instance: "Instancja" settings: "Ustawienia" -notificationSettings: "Powiadomienia" basicSettings: "Podstawowe ustawienia" otherSettings: "Pozostałe ustawienia" openInWindow: "Otwórz w oknie" @@ -45,20 +44,13 @@ pin: "Przypnij do profilu" unpin: "Odepnij z profilu" copyContent: "Skopiuj zawartość" copyLink: "Skopiuj odnośnik" -copyLinkRenote: "Skopiuj link renote'a" delete: "Usuń" deleteAndEdit: "Usuń i edytuj" deleteAndEditConfirm: "Czy na pewno chcesz usunąć ten wpis i zedytować go? Utracisz wszystkie reakcje, udostępnienia i odpowiedzi do tego wpisu." addToList: "Dodaj do listy" -addToAntenna: "Dodaj do anteny" sendMessage: "Wyślij wiadomość" copyRSS: "Kopiuj RSS" copyUsername: "Kopiuj nazwę użytkownika" -copyUserId: "Kopiuj ID użytkownika" -copyNoteId: "Kopiuj ID notatki" -copyFileId: "Kopiuj ID pliku" -copyFolderId: "Kopiuj ID folderu" -copyProfileUrl: "Kopiuj URL profilu" searchUser: "Wyszukiwanie użytkowników" reply: "Odpowiedz" loadMore: "Załaduj więcej" @@ -111,8 +103,6 @@ renoted: "Udostępniono." cantRenote: "Ten wpis nie może zostać udostępniony." cantReRenote: "Udostępnienie nie może zostać udostępnione." quote: "Cytuj" -inChannelRenote: "Renote tylko na kanale" -inChannelQuote: "Cytat tylko na kanale" pinnedNote: "Przypięty wpis" pinned: "Przypnij do profilu" you: "Ty" @@ -121,23 +111,14 @@ sensitive: "NSFW" add: "Dodaj" reaction: "Reakcja" reactions: "Reakcja" -emojiPicker: "Selektor Emoji" -pinnedEmojisForReactionSettingDescription: "Ustaw emotikony które powinny być przypięte i od razu wyświetlone podczas reagowania." -pinnedEmojisSettingDescription: "Ustaw emotikony które powinny być przypięte i wyświetlone podczas przeglądania selektora Emoji" -emojiPickerDisplay: "Wyświetlanie selektora Emoji" -overwriteFromPinnedEmojisForReaction: "Zastąp z ustawień reakcji" -overwriteFromPinnedEmojis: "Zastąp z ogólnych ustawień" reactionSettingDescription2: "Przeciągnij aby zmienić kolejność, naciśnij aby usunąć, naciśnij „+” aby dodać" rememberNoteVisibility: "Zapamiętuj ustawienia widoczności wpisu" attachCancel: "Usuń załącznik" -deleteFile: "Usuń plik" markAsSensitive: "Oznacz jako NSFW" unmarkAsSensitive: "Cofnij NSFW" enterFileName: "Wprowadź nazwę pliku" mute: "Wycisz" unmute: "Cofnij wyciszenie" -renoteMute: "Wycisz renote'y" -renoteUnmute: "Wyłącz wyciszenie renote'ów" block: "Zablokuj" unblock: "Odblokuj" suspend: "Zawieś" @@ -147,10 +128,8 @@ unblockConfirm: "Czy na pewno chcesz odblokować to konto?" suspendConfirm: "Czy na pewno chcesz zawiesić to konto?" unsuspendConfirm: "Czy na pewno chcesz cofnąć zawieszenie tego konta?" selectList: "Wybierz listę" -editList: "Edytuj listę" selectChannel: "Wybierz kanał" selectAntenna: "Wybierz Antennę" -editAntenna: "Edytuj antenę" selectWidget: "Wybierz widżet" editWidgets: "Edytuj widżety" editWidgetsExit: "Gotowe" @@ -163,15 +142,11 @@ addEmoji: "Dodaj emoji" settingGuide: "Proponowana konfiguracja" cacheRemoteFiles: "Przechowuj zdalne pliki w pamięci podręcznej" cacheRemoteFilesDescription: "Gdy ta opcja jest wyłączona, zdalne pliki są ładowane bezpośrednio ze zdalnych instancji. Wyłączenie the opcji zmniejszy użycie powierzchni dyskowej, ale zwiększy transfer, ponieważ miniaturki nie będą generowane." -youCanCleanRemoteFilesCache: "Możesz wyczyścić cache poprzez kliknięcie przycisku 🗑️ w widoku menedżera plików." -cacheRemoteSensitiveFiles: "Przechowuj wrażliwe zdalne pliki w pamięci podręcznej" -cacheRemoteSensitiveFilesDescription: "Gdy ta opcja jest wyłączona, wrażliwe pliki zdalne są wczytywane bezpośrednio ze zdalnej instancji bez cacheowania." flagAsBot: "To konto jest botem" flagAsBotDescription: "Jeżeli ten kanał jest kontrolowany przez jakiś program, ustaw tę opcję. Jeżeli włączona, będzie działać jako flaga informująca innych programistów, aby zapobiegać nieskończonej interakcji z różnymi botami i dostosowywać wewnętrzne systemy Misskey, traktując konto jako bota." flagAsCat: "To konto jest kotem" flagAsCatDescription: "Przełącz tę opcję, aby konto było oznaczone jako kot." flagShowTimelineReplies: "Pokazuj odpowiedzi na osi czasu" -flagShowTimelineRepliesDescription: "Gdy włączone, pokazuje odpowiedzi użytkowników na notatki innych użytkowników w osi czasu." autoAcceptFollowed: "Automatycznie przyjmuj prośby o możliwość obserwacji od użytkowników, których obserwujesz" addAccount: "Dodaj konto" reloadAccountsList: "Odśwież listę kont" @@ -201,7 +176,6 @@ perHour: "co godzinę" perDay: "co dzień" stopActivityDelivery: "Przestań przesyłać aktywności" blockThisInstance: "Zablokuj tę instancję" -silenceThisInstance: "Wycisz tę instancję" operations: "Działania" software: "Oprogramowanie" version: "Wersja" @@ -221,8 +195,6 @@ clearCachedFiles: "Wyczyść pamięć podręczną" clearCachedFilesConfirm: "Czy na pewno chcesz usunąć wszystkie zdalne pliki z pamięci podręcznej?" blockedInstances: "Zablokowane instancje" blockedInstancesDescription: "Wypisz nazwy hostów instancji, które powinny zostać zablokowane. Wypisane instancje nie będą mogły dłużej komunikować się z tą instancją." -silencedInstances: "Wyciszone instancje" -silencedInstancesDescription: "Wypisz nazwy hostów instancji, które chcesz wyciszyć. Wszystkie konta wymienionych instancji będą traktowane jako wyciszone, będą mogły jedynie wysyłać prośby o obserwację i nie będą mogły wspominać kont lokalnych, jeśli nie będą obserwowane. Nie będzie to miało wpływu na zablokowane instancje." muteAndBlock: "Wycisz / Zablokuj" mutedUsers: "Wyciszeni użytkownicy" blockedUsers: "Zablokowani użytkownicy" @@ -267,12 +239,10 @@ removed: "Pomyślnie usunięto" removeAreYouSure: "Czy na pewno chcesz usunąć „{x}”?" deleteAreYouSure: "Czy na pewno chcesz usunąć „{x}”?" resetAreYouSure: "Czy na pewno chcesz zresetować?" -areYouSure: "Na pewno?" saved: "Zapisano" messaging: "Wiadomości" upload: "Wyślij" keepOriginalUploading: "Zachowaj oryginalny obraz" -keepOriginalUploadingDescription: "Zapisuje oryginalnie przesłany obraz w niezmienionej postaci. Jeśli ta opcja jest wyłączona, po przesłaniu zostanie wygenerowana wersja do wyświetlenia w Internecie." fromDrive: "Z dysku" fromUrl: "Z adresu URL" uploadFromUrl: "Wyślij z adresu URL" @@ -285,10 +255,7 @@ noMoreHistory: "Nie ma dalszej historii" startMessaging: "Rozpocznij czat" nUsersRead: "przeczytano przez {n}" agreeTo: "Wyrażam zgodę na {0}" -agree: "Zatwierdź" agreeBelow: "Zaakceptuj poniżej" -basicNotesBeforeCreateAccount: "Ważne notatki" -termsOfService: "Warunki usługi" start: "Rozpocznij" home: "Strona główna" remoteUserCaution: "Te informacje mogą nie być aktualne, ponieważ użytkownik pochodzi ze zdalnej instancji." @@ -318,7 +285,6 @@ folderName: "Nazwa katalogu" createFolder: "Utwórz katalog" renameFolder: "Zmień nazwę katalogu" deleteFolder: "Usuń ten katalog" -folder: "Folder" addFile: "Dodaj plik" emptyDrive: "Dysk jest pusty" emptyFolder: "Ten katalog jest pusty" @@ -332,7 +298,6 @@ copyUrl: "Skopiuj adres URL" rename: "Zmień nazwę" avatar: "Awatar" banner: "Baner" -displayOfSensitiveMedia: "Wyświetlanie wrażliwej zawartości" whenServerDisconnected: "Po utracie połączenia z serwerem" disconnectedFromServer: "Utracono połączenie z serwerem." reload: "Odśwież" @@ -380,11 +345,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Włącz hCaptcha" hcaptchaSiteKey: "Klucz strony" hcaptchaSecretKey: "Tajny klucz" -mcaptcha: "mCaptcha" -enableMcaptcha: "Włącz mCaptcha" -mcaptchaSiteKey: "Klucz strony" -mcaptchaSecretKey: "Tajny klucz" -mcaptchaInstanceUrl: "URL instancji mCaptcha" recaptcha: "reCAPTCHA" enableRecaptcha: "Włącz reCAPTCHA" recaptchaSiteKey: "Klucz strony" @@ -427,19 +387,15 @@ aboutMisskey: "O Misskey" administrator: "Admin" token: "Token" 2fa: "Klucz 2FA " -setupOf2fa: "Skonfiguruj dwuetapową autentykację" totp: "Klucz aplikacji uwierzytelniającej (totp)" totpDescription: "Opis klucza czasowego" moderator: "Moderator" moderation: "Moderacja" -moderationNote: "Notka moderacyjna" -addModerationNote: "Dodaj notkę moderacyjną" -moderationLogs: "Logi moderacyjne" nUsersMentioned: "{n} wspomnianych użytkowników" securityKeyAndPasskey: "Klucz bezpieczeństwa i klucze Passkey" securityKey: "Klucz bezpieczeństwa" lastUsed: "Ostatnio używane" -lastUsedAt: "Ostatnio używane: {t}" +lastUsedAt: "Ostatnio używane w" unregister: "Cofnij rejestrację" passwordLessLogin: "Skonfiguruj logowanie bez użycia hasła" passwordLessLoginDescription: "Opis logowania bez użycia hasła" @@ -492,12 +448,9 @@ uiLanguage: "Język wyświetlania UI" aboutX: "O {x}" emojiStyle: "Styl emoji" native: "Natywny" -showNoteActionsOnlyHover: "Pokazuj akcje notatek tylko po najechaniu myszką" -showReactionsCount: "Wyświetl liczbę reakcji na notatkę" +disableDrawer: "Nie używaj menu w stylu szuflady" noHistory: "Brak historii" signinHistory: "Historia logowania" -enableAdvancedMfm: "Włącz zaawansowane MFM" -enableAnimatedMfm: "Włącz animowane MFM" doing: "Przetwarzanie..." category: "Kategoria" tags: "Tagi" @@ -506,8 +459,6 @@ createAccount: "Utwórz konto" existingAccount: "Istniejące konto" regenerate: "Wygeneruj ponownie" fontSize: "Rozmiar czcionki" -mediaListWithOneImageAppearance: "Wysokość list multimediów z tylko jednym obrazem" -limitTo: "Limituj do {x}" noFollowRequests: "Nie masz żadnych oczekujących próśb o możliwość obserwacji" openImageInNewTab: "Otwórz obraz w nowej karcie" dashboard: "Kokpit" @@ -527,7 +478,6 @@ showFeaturedNotesInTimeline: "Pokazuj wyróżnione wpisy w osi czasu" objectStorage: "Pamięć obiektowa" useObjectStorage: "Używaj pamięci obiektowej" objectStorageBaseUrl: "Podstawowy URL" -objectStorageBaseUrlDesc: "Adres URL używany jako odniesienie. Podaj adres URL swojego CDN lub Proxy, gdy używasz któregokolwiek z nich.\nDla S3 użyj 'https://.s3.amazonaws.com' a dla GCS lub równej usługi użyj 'https://storage.googleapis.com/', itd." objectStorageBucket: "Bucket" objectStorageBucketDesc: "Podaj nazwę „wiadra” używaną przez konfigurowaną usługę." objectStoragePrefix: "Prefiks" @@ -540,13 +490,9 @@ objectStorageUseSSL: "Użyj SSL" objectStorageUseSSLDesc: "Wyłącz, jeżeli nie zamierzasz używać HTTPS dla połączenia z API" objectStorageUseProxy: "Połącz przez proxy" objectStorageUseProxyDesc: "Wyłącz, jeżeli nie zamierzasz używać proxy dla połączenia z pamięcią blokową" -objectStorageSetPublicRead: "Ustaw opcję \"public-read\" przy przesyłaniu" -s3ForcePathStyleDesc: "Jeśli opcja s3ForcePathStyle jest włączona, nazwa Bucket'u musi być zawarta w ścieżce adresu URL, a nie w nazwie hosta adresu URL. Włączenie tego ustawienia może być konieczne w przypadku użycia usług takich jak self-hosted instancja Minio." serverLogs: "Dziennik zdarzeń" deleteAll: "Usuń wszystkie" showFixedPostForm: "Wyświetlaj formularz tworzenia wpisu w górnej części osi czasu" -showFixedPostFormInChannel: "Wyświetl formularz postowania w górnej części osi czasu (Kanały)" -withRepliesByDefaultForNewlyFollowed: "Domyślnie uwzględnij odpowiedzi nowo obserwowanych użytkowników w osi czasu" newNoteRecived: "Masz nowy wpis" sounds: "Dźwięk" sound: "Dźwięki" @@ -556,8 +502,6 @@ showInPage: "Pokaż na stronie" popout: "Popout" volume: "Głośność" masterVolume: "Głośność główna" -notUseSound: "Wyłącz dźwięk" -useSoundOnlyWhenActive: "Puszczaj dźwięki tylko, gdy Misskey jest aktywne." details: "Szczegóły" chooseEmoji: "Wybierz emoji" unableToProcess: "Nie udało się dokończyć działania." @@ -578,10 +522,6 @@ output: "Wyjście" script: "Skrypt" disablePagesScript: "Wyłącz AiScript na Stronach" updateRemoteUser: "Aktualizuj zdalne dane o użytkowniku" -unsetUserAvatar: "Usuń awatar" -unsetUserAvatarConfirm: "Czy na pewno chcesz usunąć awatar tego użytkownika?" -unsetUserBanner: "Usuń baner" -unsetUserBannerConfirm: "Czy na pewno chcesz usunąć baner?" deleteAllFiles: "Usuń wszystkie pliki" deleteAllFilesConfirm: "Czy na pewno chcesz usunąć wszystkie pliki?" removeAllFollowing: "Przestań obserwować" @@ -597,7 +537,6 @@ accountDeletedDescription: "Opis konta usuniętego" menu: "Menu" divider: "Rozdzielacz" addItem: "Dodaj element" -rearrange: "Posortuj" relays: "Przekaźniki" addRelay: "Dodaj przekaźnik" inboxUrl: "Adres URL skrzynki nadawczej" @@ -632,7 +571,6 @@ medium: "Średnie" small: "Małe" generateAccessToken: "Generuj token dostępu" permission: "Uprawnienia" -adminPermission: "Uprawnienia administracyjne" enableAll: "Włącz wszystko" disableAll: "Wyłącz wszystko" tokenRequested: "Przydziel dostęp do konta" @@ -650,12 +588,9 @@ smtpPort: "Port" smtpUser: "Nazwa użytkownika" smtpPass: "Hasło" emptyToDisableSmtpAuth: "Pozostaw adres e-mail i hasło puste, aby wyłączyć weryfikację SMTP" -smtpSecure: "Użyj niejawnego SSL/TLS dla połączeń SMTP" smtpSecureInfo: "Wyłącz, jeżeli używasz STARTTLS" testEmail: "Przetestuj dostarczanie wiadomości e-mail" wordMute: "Wyciszenie słowa" -regexpError: "Błąd wyrażenia regularnego" -regexpErrorDescription: "Wystąpił błąd w wyrażeniu regularnym w linii {line} twoich {tab} wyciszeń:" instanceMute: "Wyciszone instancje" userSaysSomething: "{name} powiedział(-a) coś" makeActive: "Aktywuj" @@ -675,21 +610,20 @@ useGlobalSettingDesc: "Jeżeli włączone, zostaną wykorzystane ustawienia powi other: "Inne" regenerateLoginToken: "Generuj token logowania ponownie" regenerateLoginTokenDescription: "Regeneruje token używany wewnętrznie podczas logowania. Zazwyczaj nie jest to konieczne. Po regeneracji wszystkie urządzenia zostaną wylogowane." -theKeywordWhenSearchingForCustomEmoji: "To jest słowo kluczowe używane podczas wyszukiwania customowych Emoji." setMultipleBySeparatingWithSpace: "Możesz ustawić wiele, oddzielając je spacjami." fileIdOrUrl: "ID pliku albo URL" behavior: "Zachowanie" sample: "Przykład" abuseReports: "Zgłoszenia" reportAbuse: "Zgłoś" -reportAbuseRenote: "Zgłoś renote" reportAbuseOf: "Zgłoś {name}" fillAbuseReportDescription: "Wypełnij szczegóły zgłoszenia. Jeżeli dotyczy ono określonego wpisu, uwzględnij jego adres URL." abuseReported: "Twoje zgłoszenie zostało wysłane. Dziękujemy." -reporter: "Zgłaszający" reporteeOrigin: "Pochodzenie zgłoszonego" reporterOrigin: "Pochodzenie zgłaszającego" +forwardReport: "Przekaż zgłoszenie do innej instancji" send: "Wyślij" +abuseMarkAsResolved: "Oznacz zgłoszenie jako rozwiązane" openInNewTab: "Otwórz w nowej karcie" openInSideView: "Otwórz w bocznym widoku" defaultNavigationBehaviour: "Domyślne zachowanie nawigacji" @@ -732,7 +666,6 @@ lockedAccountInfo: "Dopóki nie ustawisz widoczności wpisu na \"Obserwujący\", alwaysMarkSensitive: "Oznacz domyślnie jako NSFW" loadRawImages: "Wyświetlaj zdjęcia w załącznikach w całości zamiast miniatur" disableShowingAnimatedImages: "Nie odtwarzaj animowanych obrazów" -highlightSensitiveMedia: "Podkreśl wrażliwą zawartość" verificationEmailSent: "Wiadomość weryfikacyjna została wysłana. Odwiedź uwzględniony odnośnik, aby ukończyć weryfikację." notSet: "Nie ustawiono" emailVerified: "Adres e-mail został potwierdzony" @@ -743,8 +676,6 @@ contact: "Kontakt" useSystemFont: "Używaj domyślnej czcionki systemu" clips: "Klipy" experimentalFeatures: "Eksperymentalne funkcje" -experimental: "Eksperymentalne" -thisIsExperimentalFeature: "Ta funkcja jest eksperymentalna. Jej funkcjonalność może ulec zmianie, i może ona nie funkcjonować tak, jak zamierzono." developer: "Programista" makeExplorable: "Pokazuj konto na stronie „Eksploruj”" makeExplorableDescription: "Jeżeli wyłączysz tę opcję, Twoje konto nie będzie wyświetlać się w sekcji „Eksploruj”." @@ -762,14 +693,12 @@ onlineUsersCount: "{n} osób jest online" nUsers: "{n} użytkowników" nNotes: "{n} wpisów" sendErrorReports: "Wyślij raporty o błędach" -sendErrorReportsDescription: "Gdy włączone, jeśli wystąpi problem, szczegółowe informacje o błędach będą udostępniane Misskey, pomagając ulepszyć jakość Misskey.\nBędzie to zawierało informacje takie jak wersja twojego systemu operacyjnego, jakiej przeglądarki używasz, twoja aktywność w Misskey, itd." myTheme: "Mój motyw" backgroundColor: "Tło" accentColor: "Akcent" textColor: "Tekst" saveAs: "Zapisz jako…" advanced: "Zaawansowane" -advancedSettings: "Zaawansowane ustawienia" value: "Wartość" createdAt: "Utworzono" updatedAt: "Zaktualizowano" @@ -829,14 +758,12 @@ noMaintainerInformationWarning: "Informacje o administratorze nie są skonfiguro noBotProtectionWarning: "Zabezpieczenie przed botami nie jest skonfigurowane." configure: "Skonfiguruj" postToGallery: "Opublikuj w galerii" -postToHashtag: "Postuj do tego hashtagu" gallery: "Galeria" recentPosts: "Ostatnie wpisy" popularPosts: "Popularne wpisy" shareWithNote: "Udostępnij z wpisem" ads: "Reklamy" expiration: "Ankieta kończy się" -startingperiod: "Początek" memo: "Notatki" priority: "Priorytet" high: "Wysoki" @@ -863,19 +790,13 @@ translatedFrom: "Przetłumaczone z {x}" accountDeletionInProgress: "Trwa usuwanie konta" usernameInfo: "Nazwa, która identyfikuje Twoje konto spośród innych na tym serwerze. Możesz użyć alfabetu (a~z, A~Z), cyfr (0~9) lub podkreślników (_). Nazwy użytkownika nie mogą być później zmieniane." aiChanMode: "Tryb Ai" -devMode: "Tryb programisty" keepCw: "Zostaw ostrzeżenia o zawartości" pubSub: "Konta Pub/Sub" -lastCommunication: "Ostatnia komunikacja" resolved: "Rozwiązane" unresolved: "Nierozwiązane" breakFollow: "Usuń obserwującego" -breakFollowConfirm: "Czy na pewno usunąć tego obserwującego?" itsOn: "Włączone" itsOff: "Wyłączone" -on: "Włączone" -off: "Wyłączone" -emailRequiredForSignup: "Wymagaj adresu e-mail do rejestracji" unread: "Nieodczytane" filter: "Filtr" controlPanel: "Panel sterowania" @@ -885,8 +806,6 @@ makeReactionsPublicDescription: "To spowoduje, że lista wszystkich Twoich dotyc classic: "Klasyczny" muteThread: "Wycisz wątek" unmuteThread: "Wyłącz wyciszenie wątku" -followingVisibility: "Widoczność obserwacji" -followersVisibility: "Widoczność obserwujących" continueThread: "Pokaż kontynuację wątku" deleteAccountConfirm: "Spowoduje to nieodwracalne usunięcie Twojego konta. Kontynuować?" incorrectPassword: "Nieprawidłowe hasło." @@ -899,14 +818,9 @@ overridedDeviceKind: "Typ urządzenia" smartphone: "Smartfon" tablet: "Tablet" auto: "Automatycznie" -themeColor: "Motyw kolorystyczny" size: "Rozmiar" numberOfColumn: "Liczba kolumn" searchByGoogle: "Szukaj" -instanceDefaultLightTheme: "Domyślny motyw dla trybu jasnego" -instanceDefaultDarkTheme: "Domyślny motyw dla trybu ciemnego" -instanceDefaultThemeDescription: "Opis domyślnego motywu instancji" -mutePeriod: "Okres wyciszenia" period: "Ankieta kończy się" indefinitely: "Nigdy" tenMinutes: "10 minut" @@ -915,50 +829,29 @@ oneDay: "1 dzień" oneWeek: "1 tydzień" oneMonth: "jeden miesiąc" failedToFetchAccountInformation: "Nie udało się uzyskać informacji o koncie" -rateLimitExceeded: "Limit szybkości przekroczony" -cropImage: "Przytnij obraz" -cropImageAsk: "Czy chcesz przyciąć obrazek?" -cropYes: "Tak, przytnij" -cropNo: "Nie chce przycinać" file: "Pliki" -recentNHours: "W ciągu ostatnich {n} godzin" -recentNDays: "W ciągu ostatnich {n} dni" -noEmailServerWarning: "Serwer Email nie jest skonfigurowany" recommended: "Zalecane" check: "Zweryfikuj" -driveCapOverrideLabel: "Zmień limit pojemności dysku użytkownika" -requireAdminForView: "Aby to zobaczyć, musisz być administratorem" -isSystemAccount: "To jest konto stworzone i zarządzane przez system" -typeToConfirm: "Wprowadź {x}, aby potwierdzić" deleteAccount: "Usuń konto" document: "Dokumentacja" numberOfPageCache: "Ilość stron w cache" -numberOfPageCacheDescription: "Zwiększenie tej liczby polepszy wygodę, ale spowoduje większe obciążenie jako użycie pamięci na urządzeniu użytkownika." logoutConfirm: "Czy na pewno chcesz się wylogować?" lastActiveDate: "Ostatnio użyte w" statusbar: "Pasek stanu" pleaseSelect: "Wybierz opcję" reverse: "Odwróć" colored: "Kolorowe" -refreshInterval: "Okres aktualizacji" label: "Etykieta" type: "Typ" speed: "Prędkość" -slow: "Wolny" -fast: "Szybki" -sensitiveMediaDetection: "Detekcja wrażliwej zawartości" localOnly: "Lokalne tylko" -remoteOnly: "Tylko zdalne instancje" failedToUpload: "Przesyłanie nie powiodło się" cannotUploadBecauseInappropriate: "Nie można przesłać tego pliku, ponieważ jego części zostały wykryte jako potencjalnie nieodpowiednie." cannotUploadBecauseNoFreeSpace: "Przesyłanie nie powiodło się z powodu braku miejsca na dysku." -cannotUploadBecauseExceedsFileSizeLimit: "Nie można przesłać pliku, ponieważ wykracza on poza limit wielkości pliku." beta: "Beta" enableAutoSensitive: "Automatyczne oznaczanie NSFW" enableAutoSensitiveDescription: "Umożliwia automatyczne wykrywanie i oznaczanie zawartości NSFW za pomocą uczenia maszynowego. Nawet jeśli ta opcja jest wyłączona, może być włączona w całej instancji." -activeEmailValidationDescription: "Włącza bardziej restrykcyjną walidację adresów e-mail, co obejmuje sprawdzanie adresów jednorazowych i czy komunikacja z tym adresem jest możliwa. Gdy wyłączone, tylko format adresu e-mail jest sprawdzany." navbar: "Pasek nawigacyjny" -shuffle: "Mieszaj" account: "Konta" move: "Przenieś" pushNotification: "Powiadomienia" @@ -968,74 +861,21 @@ pushNotificationAlreadySubscribed: "Powiadomienia push są włączone" pushNotificationNotSupported: "Przeglądarka lub instancja nie obsługuje powiadomień push" sendPushNotificationReadMessage: "Usuń powiadomienia push po przeczytaniu powiadomień i wiadomości." sendPushNotificationReadMessageCaption: "Chwilowo pojawi się powiadomienie \"{emptyPushNotificationMessage}\". Może wzrosnąć zużycie baterii urządzenia." -windowMaximize: "Maksymalizuj" -windowMinimize: "Minimalizuj" -windowRestore: "Przywróć" -caption: "Legenda" loggedInAsBot: "Jesteś obecnie zalogowany/a jako bot" -tools: "Narzędzia" -cannotLoad: "Nie można wczytać" -numberOfProfileView: "Wyświetlenia profilu" like: "Polub" -unlike: "Usuń polubienie" -numberOfLikes: "Liczba polubień" show: "Wyświetlanie" -neverShow: "Nie pokazuj ponownie" -remindMeLater: "Przypomnij później" -didYouLikeMisskey: "Czy Misskey się tobie spodobało?" -pleaseDonate: "{host} używa darmowego oprogramowania — Misskey. Bylibyśmy bardzo wdzięczni za datki, które pozwolą na kontynuację rozwoju Misskey!" -correspondingSourceIsAvailable: "Odpowiedni kod źródłowy jest dostępny pod {anchor}." -roles: "Role" -role: "Rola" -noRole: "Rola nie znaleziona" -normalUser: "Normalny użytkownik" -undefined: "Niezdefiniowane" -assign: "Przydziel" -unassign: "Cofnij przydzielenie" color: "Kolor" -manageCustomEmojis: "Zarządzaj niestandardowymi Emoji" -manageAvatarDecorations: "Zarządzaj dekoracjami awatara" -invalidParamError: "Błąd parametrów" -permissionDeniedError: "Odrzucono operacje" -permissionDeniedErrorDescription: "Konto nie posiada uprawnień" -preset: "Konfiguracja" -selectFromPresets: "Wybierz konfiguracje" -achievements: "Osiągnięcia" -thisPostMayBeAnnoyingCancel: "Odrzuć" -internalServerError: "Wewnętrzny błąd serwera" -internalServerErrorDescription: "Niespodziewany błąd po stronie serwera" -copyErrorInfo: "Kopiuj informacje o błędzie" -joinThisServer: "Dołącz do chaty" -disableFederationOk: "Wyłącz federacje" -invitationRequiredToRegister: "Ten serwer wymaga zaproszenia. Tylko osoby z zaproszeniem mogą się zarejestrować" -emailNotSupported: "Wysyłanie wiadomości E-mail nie jest obsługiwane na tym serwerze" -postToTheChannel: "Publikuj na kanale" youFollowing: "Śledzeni" icon: "Awatar" replies: "Odpowiedz" renotes: "Udostępnij" -sourceCode: "Kod źródłowy" flip: "Odwróć" -lastNDays: "W ciągu ostatnich {n} dni" -surrender: "Odrzuć" -gameRetry: "Spróbuj ponownie" -_delivery: - stop: "Zawieszono" - _type: - none: "Publikowanie" -_bubbleGame: - _score: - score: "Wynik" _role: - assignTarget: "Przydziel" priority: "Priorytet" _priority: low: "Niski" middle: "Średnie" high: "Wysoki" - _options: - canManageCustomEmojis: "Zarządzaj niestandardowymi Emoji" - canManageAvatarDecorations: "Zarządzaj dekoracjami awatara" _sensitiveMediaDetection: description: "Zmniejsza wysiłek związany z moderacją serwera dzięki automatycznemu rozpoznawaniu zawartości NSFW za pomocą uczenia maszynowego. To nieznacznie zwiększy obciążenie serwera." setSensitiveFlagAutomatically: "Oznacz jako NSFW" @@ -1205,6 +1045,7 @@ _theme: buttonBg: "Tło przycisku" buttonHoverBg: "Tło przycisku (po najechaniu)" inputBorder: "Obramowanie pola wejścia" + listItemHoverBg: "Tło elementu listy (po najechaniu)" driveFolderBg: "Tło folderu na dysku" wallpaperOverlay: "Nakładka tapety" badge: "Odznaka" @@ -1216,6 +1057,8 @@ _sfx: note: "Wpisy" noteMy: "Mój wpis" notification: "Powiadomienia" + antenna: "Anteny" + channel: "Powiadomienia kanału" _ago: future: "W przyszłości" justNow: "Przed chwilą" @@ -1389,7 +1232,6 @@ _profile: _exportOrImport: allNotes: "Wszystkie wpisy" favoritedNotes: "Ulubione wpisy" - clips: "Klip" followingList: "Obserwowani" muteList: "Wycisz" blockingList: "Zablokuj" @@ -1505,7 +1347,6 @@ _notification: reaction: "Reakcja" receiveFollowRequest: "Otrzymano prośbę o możliwość obserwacji" followRequestAccepted: "Przyjęto prośbę o możliwość obserwacji" - login: "Zaloguj się" app: "Powiadomienia z aplikacji" _actions: followBack: "zaobserwował cię z powrotem" @@ -1540,6 +1381,7 @@ _webhookSettings: createWebhook: "Stwórz Webhook" name: "Nazwa" secret: "Sekret" + events: "Uruchomienie Webhooka" active: "Właczono" _events: follow: "Po zaobserwowaniu użytkownika" @@ -1549,12 +1391,6 @@ _webhookSettings: renote: "Po udostępnieniu wpisu" reaction: "Po otrzymaniu reakcji" mention: "Po zostaniu wspomnianym" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "Adres e-mail" _moderationLogTypes: suspend: "Zawieś" resetPassword: "Zresetuj hasło" -_reversi: - total: "Łącznie" diff --git a/locales/pt-PT.yml b/locales/pt-PT.yml index 9039fd2141..f969d711c0 100644 --- a/locales/pt-PT.yml +++ b/locales/pt-PT.yml @@ -2,14 +2,14 @@ _lang_: "Português" 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} é uma instância da plataforma de código aberto Misskey." +poweredByMisskeyDescription: "{name} é um dos servidores da plataforma de código aberto Misskey." monthAndDay: "{day}/{month}" search: "Pesquisar" notifications: "Notificações" username: "Nome de usuário" password: "Senha" forgotPassword: "Esqueci-me da senha" -fetchingAsApObject: "Buscando no Fediverso..." +fetchingAsApObject: "Buscando no Fediverso" ok: "OK" gotIt: "Entendi" cancel: "Cancelar" @@ -60,7 +60,6 @@ copyFileId: "Copiar o ID do arquivo" copyFolderId: "Copiar o ID da pasta" copyProfileUrl: "Copiar a URL do perfil" searchUser: "Pesquisar usuário" -searchThisUsersNotes: "Pesquisar as notas desse usuário" reply: "Responder" loadMore: "Carregar mais" showMore: "Ver mais" @@ -82,7 +81,7 @@ exportRequested: "A sua solicitação de exportação foi enviada. Isso pode lev importRequested: "A sua solicitação de importação foi enviada. Isso pode levar algum tempo." lists: "Listas" noLists: "Não possui nenhuma lista" -note: "Publicar" +note: "Post" notes: "Posts" following: "Seguindo" followers: "Seguidores" @@ -100,7 +99,7 @@ enterListName: "Insira um nome para a lista" privacy: "Privacidade" makeFollowManuallyApprove: "Pedidos de seguidores precisam ser aprovados" defaultNoteVisibility: "Visibilidade padrão" -follow: "Seguir" +follow: "Seguindo" followRequest: "Enviar pedido de seguidor" followRequests: "Pedidos de seguidor" unfollow: "Deixar de seguir" @@ -109,14 +108,11 @@ enterEmoji: "Inserir emoji" renote: "Repostar" unrenote: "Remover repostagem" renoted: "Repostado" -renotedToX: "Repostar em {name}." cantRenote: "Não é possível repostar esta postagem" cantReRenote: "Não pode repostar este repost" quote: "Citar" inChannelRenote: "Repostar no canal" inChannelQuote: "Citar no canal" -renoteToChannel: "Repostar em canal" -renoteToOtherChannel: "Repostar em outro canal" pinnedNote: "Nota fixada" pinned: "Fixar no perfil" you: "Você" @@ -125,16 +121,9 @@ sensitive: "Conteúdo sensível" add: "Adicionar" reaction: "Reações" reactions: "Reações" -emojiPicker: "Seleção de emoji" -pinnedEmojisForReactionSettingDescription: "Selecionar os emojis que serão fixados e exibidos ao reagir." -pinnedEmojisSettingDescription: "Selecionar os emojis que serão fixos e exibidos na seleção de emoji." -emojiPickerDisplay: "Janela de seleção de emoji" -overwriteFromPinnedEmojisForReaction: "Sobrescrever as opções de reação" -overwriteFromPinnedEmojis: "Sobrescrever as opções gerais" reactionSettingDescription2: "Arraste para reordenar, clique para excluir, pressione + para adicionar." rememberNoteVisibility: "Lembrar das configurações de visibilidade de notas" attachCancel: "Remover anexo" -deleteFile: "Excluir arquivo" markAsSensitive: "Marcar como sensível" unmarkAsSensitive: "Desmarcar como sensível" enterFileName: "Digite o nome do arquivo" @@ -155,7 +144,6 @@ editList: "Editar lista" selectChannel: "Selecionar canal" selectAntenna: "Selecione uma antena" editAntenna: "Editar antena" -createAntenna: "Criar uma antena" selectWidget: "Selecione um widget" editWidgets: "Editar widgets" editWidgetsExit: "Pronto" @@ -182,21 +170,16 @@ addAccount: "Adicionar Conta" reloadAccountsList: "Recarregar lista de contas" loginFailed: "Falha ao logar" showOnRemote: "Exibir remotamente" -continueOnRemote: "" -chooseServerOnMisskeyHub: "Escolher um servidor da Misskey Hub" -specifyServerHost: "Especificar uma instância diretamente" -inputHostName: "Insira o domínio" general: "Geral" wallpaper: "Papel de parede" setWallpaper: "Definir papel de parede" removeWallpaper: "Remover papel de parede" searchWith: "Buscar: {q}" youHaveNoLists: "Não tem nenhuma lista" -followConfirm: "Tem certeza que quer seguir {name}?" +followConfirm: "Tem certeza que quer deixar de seguir {name}?" proxyAccount: "Conta proxy" proxyAccountDescription: "Uma conta de proxy é uma conta que assume o acompanhamento remoto de um usuário sob certas condições específicas. Por exemplo, quando um usuário inclui um usuário remoto em uma lista, mas ninguém na lista está seguindo o usuário remoto, a atividade não é entregue ao servidor. Nesse caso, a conta de proxy entra em ação para seguir o usuário remoto em vez disso." host: "Host" -selectSelf: "Escolher manualmente" selectUser: "Selecionar usuário" recipient: "Destinatário" annotation: "Anotação" @@ -211,8 +194,6 @@ perHour: "Por Hora" perDay: "Por dia" stopActivityDelivery: "Parar a entrega de atividades" blockThisInstance: "Bloquear esta instância" -silenceThisInstance: "Silenciar essa instância" -mediaSilenceThisInstance: "Silenciar a mídia dessa instância" operations: "Operações" software: "Software" version: "Versão" @@ -232,10 +213,6 @@ clearCachedFiles: "Limpar o cache" clearCachedFilesConfirm: "Deseja excluir todos os arquivos remotos em cache?" blockedInstances: "Instância bloqueada" blockedInstancesDescription: "Configure os hosts dos servidores que deseja bloquear, separando-os por quebras de linha. Os servidores bloqueados não poderão interagir com este servidor, incluindo os subdomínios." -silencedInstances: "Instâncias silenciadas" -silencedInstancesDescription: "Liste o nome de hospedagem dos servidores que você deseja silenciar, separados por linha. Todas as contas desses servidores serão silenciada e poderão enviar solicitações para seguir, mas não poderão mencionar usuários locais sem segui-los. Isso não afetará servidores bloqueados." -mediaSilencedInstances: "Instâncias com mídia silenciadas" -mediaSilencedInstancesDescription: "Liste o nome de hospedagem dos servidores cuja mídia você deseja silenciar, separados por linha. Todas as contas desses servidores serão consideradas sensíveis e não poderão utilizar emojis personalizados. Isso não afetará servidores bloqueados." muteAndBlock: "Silenciar e bloquear" mutedUsers: "Usuários silenciados" blockedUsers: "Usuários bloqueados" @@ -272,7 +249,7 @@ more: "Mais!" featured: "Destaques" usernameOrUserId: "Nome de usuário ou ID do usuário" noSuchUser: "Usuário não encontrado" -lookup: "Consultar" +lookup: "Buscando" announcements: "Avisos" imageUrl: "URL da imagem" remove: "Remover" @@ -280,7 +257,6 @@ removed: "Removido" removeAreYouSure: "Deseja excluir \"{x}\"?" deleteAreYouSure: "Deseja excluir \"{x}\"?" resetAreYouSure: "Deseja reiniciar?" -areYouSure: "Tem certeza?" saved: "Salvo" messaging: "Chat" upload: "Fazer upload" @@ -296,7 +272,7 @@ explore: "Explorar" messageRead: "Lida" noMoreHistory: "Não existe histórico anterior" startMessaging: "Iniciar conversação" -nUsersRead: "{n} pessoas leram" +nUsersRead: "{n} Pessoas leem" agreeTo: "Eu concordo com {0}" agree: "Concordar" agreeBelow: "Eu concordo com o seguinte" @@ -312,7 +288,7 @@ birthday: "Aniversário" yearsOld: "{age} anos" registeredDate: "Data de registro" location: "Localização" -theme: "Tema" +theme: "tema" themeForLightMode: "Temas usados ​​no modo de luz" themeForDarkMode: "Temas usados ​​no modo escuro" light: "Claro" @@ -326,13 +302,11 @@ selectFile: "Selecione os arquivos" selectFiles: "Selecione os arquivos" selectFolder: "Selecionar uma pasta" selectFolders: "Selecionar uma pasta" -fileNotSelected: "Nenhuma pasta selecionada" renameFile: "Renomear ficheiro" folderName: "Nome da pasta" createFolder: "Criar pasta" renameFolder: "Renomear Pasta" deleteFolder: "Excluir pasta" -folder: "Pasta" addFile: "Adicionar arquivo" emptyDrive: "O drive está vazio" emptyFolder: "A pasta está vazia" @@ -394,11 +368,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Ativar hCaptcha" hcaptchaSiteKey: "Chave do sítio ‘web’" hcaptchaSecretKey: "Chave secreta" -mcaptcha: "mCaptcha" -enableMcaptcha: "Habilitar mCaptcha" -mcaptchaSiteKey: "Chave do sítio ‘web’" -mcaptchaSecretKey: "Chave secreta" -mcaptchaInstanceUrl: "URL do servidor mCaptcha" recaptcha: "reCAPTCHA" enableRecaptcha: "Habilitar reCAPTCHA" recaptchaSiteKey: "Chave do sítio ‘web’" @@ -414,7 +383,6 @@ name: "Nome" antennaSource: "Origem de entrada" antennaKeywords: "Palavras-chave recebidas" antennaExcludeKeywords: "Palavras-chave negativas" -antennaExcludeBots: "Ignorar contas de bot" antennaKeywordsDescription: "Se você separá-lo com um espaço, será uma especificação AND, e se você separá-lo com uma quebra de linha, será uma especificação OR." notifyAntenna: "Notificar novas notas" withFileAntenna: "Apenas notas com arquivos anexados" @@ -447,9 +415,6 @@ totp: "Aplicativo Autenticador" totpDescription: "Digite a senha de uso único informado pelo aplicativo autenticador" moderator: "Moderador" moderation: "Moderação" -moderationNote: "Nota de moderação" -addModerationNote: "Adicionar nota de moderação" -moderationLogs: "Logs de moderação" nUsersMentioned: "Postado por {n} pessoas" securityKeyAndPasskey: "Chave de segurança / Chave de acesso" securityKey: "Chave de segurança" @@ -482,12 +447,10 @@ retype: "Digite novamente" noteOf: "Publicação de {user}" quoteAttached: "Com citação" quoteQuestion: "Anexar como citação?" -attachAsFileQuestion: "O texto na área de transferência é muito longo. Você gostaria de anexá-lo como um arquivo de texto?" noMessagesYet: "Sem conversas até o momento" newMessageExists: "Há uma nova mensagem" onlyOneFileCanBeAttached: "Apenas um arquivo pode ser anexado a uma mensagem" signinRequired: "É necessário se inscrever ou fazer login antes de continuar" -signinOrContinueOnRemote: "Para continuar, você precisa mover o seu servidor ou entrar/cadastrar-se nesse servidor." invitations: "Convidar" invitationCode: "Código de convite" checking: "Verificando..." @@ -509,8 +472,8 @@ uiLanguage: "Idioma de exibição da interface " aboutX: "Sobre {x}" emojiStyle: "Estilo de emojis" native: "Nativo" +disableDrawer: "Não mostrar o menu em formato de gaveta" showNoteActionsOnlyHover: "Exibir as ações da nota somente ao passar o cursor sobre ela" -showReactionsCount: "Ver o número de reações nas notas" noHistory: "Ainda não há histórico" signinHistory: "Histórico de acesso" enableAdvancedMfm: "Habilitar MFM avançado" @@ -559,11 +522,10 @@ objectStorageUseProxy: "Usar proxy" objectStorageUseProxyDesc: "Se você não usa proxy para conexão de API, desative-o." objectStorageSetPublicRead: "Definir 'public-read' ao fazer o upload" s3ForcePathStyleDesc: "Ao habilitar s3ForcePathStyle, o nome do bucket é especificado como parte do caminho em vez de ser o nome do host na URL. Isso pode ser necessário ao usar serviços auto-hospedados como o Minio." -serverLogs: "Logs do servidor" +serverLogs: "Registro do servidor" deleteAll: "Excluir tudo" showFixedPostForm: "Exibir o formulário de postagem na parte superior da linha do tempo" showFixedPostFormInChannel: "Exibir o campo de postagem na parte superior da linha do tempo (canais)" -withRepliesByDefaultForNewlyFollowed: "Incluir respostas por usuários recém-seguidos na linha do tempo por padrão" newNoteRecived: "Nova nota recebida" sounds: "Sons" sound: "Sons" @@ -573,8 +535,6 @@ showInPage: "Ver na página" popout: "Sair" volume: "Volume" masterVolume: "volume principal" -notUseSound: "Desabilitar som" -useSoundOnlyWhenActive: "Apenas reproduzir sons quando Misskey estiver aberto." details: "Detalhes" chooseEmoji: "Selecione um emoji" unableToProcess: "Não é possível concluir a operação" @@ -595,10 +555,6 @@ output: "Resultado" script: "Script" disablePagesScript: "Desabilitar scripts nas páginas" updateRemoteUser: "Atualizar informações do usuário remoto" -unsetUserAvatar: "Remover avatar" -unsetUserAvatarConfirm: "Você tem certeza de que deseja remover o avatar?" -unsetUserBanner: "Remover banner" -unsetUserBannerConfirm: "Você tem certeza de que deseja remover o banner?" deleteAllFiles: "Excluir todos os arquivos" deleteAllFilesConfirm: "Deseja excluir todos os arquivos?" removeAllFollowing: "Deseja remover todos os seguidores?" @@ -649,7 +605,6 @@ medium: "Médio" small: "Pequeno" generateAccessToken: "Gerar token de acesso" permission: "Permissões" -adminPermission: "Permissões de administrador" enableAll: "Habilitar tudo" disableAll: "Desabilitar tudo" tokenRequested: "Autorização de acesso à conta" @@ -671,7 +626,6 @@ smtpSecure: "Use SSL/TLS implícito para conexões SMTP" smtpSecureInfo: "Desative esta opção ao utilizar STARTTLS." testEmail: "Testar envio de e-mail" wordMute: "Silenciar palavras" -hardWordMute: "SIlenciamento pesado de palavra" regexpError: "Erro na expressão regular" regexpErrorDescription: "Ocorreu um erro na expressão regular na linha {line} da palavra mutada {tab}:" instanceMute: "Instâncias silenciadas" @@ -693,13 +647,12 @@ useGlobalSettingDesc: "Ao ativar, serão utilizadas as configurações de notifi other: "Outros" regenerateLoginToken: "Gerar novo token de login" regenerateLoginTokenDescription: "Gera novamente o token interno usado para o login. Normalmente, isso não é necessário. Ao regenerar, você será desconectado de todos os dispositivos." -theKeywordWhenSearchingForCustomEmoji: "Essa é a palavra-chave ao pesquisar por emojis personalizados" setMultipleBySeparatingWithSpace: "Você pode configurar vários itens separando-os por espaço." fileIdOrUrl: "ID do arquivo ou URL" behavior: "Comportamento" sample: "Exemplo" abuseReports: "Denúncias" -reportAbuse: "Denunciar" +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." @@ -707,7 +660,10 @@ abuseReported: "Denúncia enviada. Obrigado por sua ajuda." reporter: "Denunciante" reporteeOrigin: "Origem da denúncia" reporterOrigin: "Origem do denunciante" +forwardReport: "Encaminhar a denúncia para o servidor remoto" +forwardReportIsAnonymous: "No servidor remoto, suas informações não serão visíveis, e você será apresentado como uma conta do sistema anônima." send: "Enviar" +abuseMarkAsResolved: "Marcar denúncia como resolvida" openInNewTab: "Abrir em nova aba" openInSideView: "Abrir em visão lateral" defaultNavigationBehaviour: "Navegação padrão" @@ -750,7 +706,6 @@ lockedAccountInfo: "Mesmo que você defina a aprovação para seguir, a menos qu alwaysMarkSensitive: "Marcar como sensível por padrão" loadRawImages: "Exibir as imagens originais ao invés de miniaturas" disableShowingAnimatedImages: "Não reproduzir imagens animadas" -highlightSensitiveMedia: "Destacar mídia sensível" verificationEmailSent: "Um e-mail de confirmação foi enviado. Siga o link no e-mail para concluir a verificação." notSet: "Não definido" emailVerified: "O endereço de e-mail foi confirmado" @@ -764,7 +719,7 @@ 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 encontrável em \"Explorar\"." +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" @@ -776,9 +731,9 @@ reloadToApplySetting: "As configurações serão refletidas após recarregar a p needReloadToApply: "É necessário recarregar a página para refletir as alterações." showTitlebar: "Exibir barra de título" clearCache: "Limpar o cache" -onlineUsersCount: "{n} Pessoas Online" -nUsers: "{n} Usuários" -nNotes: "{n} Notas" +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" @@ -810,7 +765,7 @@ 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: "{users} pessoas digitando" +typingUsers: "digitando" jumpToSpecifiedDate: "Pular para uma data específica" showingPastTimeline: "Visualizar linha de tempo anterior" clear: "Limpar" @@ -839,12 +794,11 @@ switchAccount: "Trocar conta" enabled: "Ativado" disabled: "Desativado" quickAction: "Ações rápidas" -user: "Usuário" +user: "Usuários" administration: "Administrar" accounts: "Contas" switch: "Trocar" noMaintainerInformationWarning: "A informação de administrador não foi configurada." -noInquiryUrlWarning: "URL de consulta não está definida" noBotProtectionWarning: "A proteção contra bots não foi configurada." configure: "Configurar" postToGallery: "Criar publicação em galeria" @@ -878,7 +832,7 @@ learnMore: "Saiba mais" misskeyUpdated: "Misskey foi atualizado!" whatIsNew: "Ver atualizações" translate: "Traduzir" -translatedFrom: "Traduzido de {x}" +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" @@ -904,8 +858,6 @@ makeReactionsPublicDescription: "Isto vai deixar o histórico de todas as suas r classic: "Clássico" muteThread: "Silenciar esta conversa" unmuteThread: "Desativar silêncio desta conversa" -followingVisibility: "Visibilidade dos usuários seguidos" -followersVisibility: "Visibilidade dos seguidores" continueThread: "Ver mais desta conversa" deleteAccountConfirm: "Deseja realmente excluir a conta?" incorrectPassword: "Senha inválida." @@ -971,33 +923,21 @@ fast: "Rápido" sensitiveMediaDetection: "Detecção de conteúdo sensível" localOnly: "Apenas local" remoteOnly: "Apenas remoto" -failedToUpload: "Falha ao enviar" -cannotUploadBecauseInappropriate: "Esse arquivo não pôde ser enviado porque partes dele foram detectadas como potencialmente inapropriadas." -cannotUploadBecauseNoFreeSpace: "Envio falhou devido à falta de capacidade no Drive." 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." -navbar: "Barra de navegação" shuffle: "Aleatório" account: "Contas" move: "Mover" pushNotification: "Notificações Push" subscribePushNotification: "Ativar notificações push" unsubscribePushNotification: "Desativar notificações push" -pushNotificationAlreadySubscribed: "Notificações push já estão habilitadas" -pushNotificationNotSupported: "Seu navegador ou instância não tem suporte às notificações push" -sendPushNotificationReadMessage: "Apagar notificações push quando elas foram lidas" -sendPushNotificationReadMessageCaption: "Pode aumentar o consumo de energia do dispositivo." -windowMaximize: "Maximizar" windowMinimize: "Minimizar" windowRestore: "Restaurar" caption: "legenda" -loggedInAsBot: "Atualmente conectado como bot" tools: "Ferramentas" -cannotLoad: "Não foi possível carregar" -numberOfProfileView: "Visualizações do perfil" like: "Curtir" unlike: "Remover curtida" numberOfLikes: "Número de curtidas" @@ -1006,7 +946,6 @@ 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!" -correspondingSourceIsAvailable: "O código-fonte correspondente está disponível em {anchor}" roles: "Cargos" role: "Cargo" noRole: "Nenhum cargo" @@ -1016,7 +955,6 @@ assign: "Atribuir" unassign: "Remover" color: "Cor" manageCustomEmojis: "Gerenciar Emojis customizados" -manageAvatarDecorations: "Gerenciar decorações de avatar" 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." @@ -1034,635 +972,212 @@ thisPostMayBeAnnoyingHome: "Postar na linha do tempo inicial" thisPostMayBeAnnoyingCancel: "Cancelar" thisPostMayBeAnnoyingIgnore: "Postar mesmo assim" collapseRenotes: "Ocultar repostagens já visualizadas" -collapseRenotesDescription: "Colapsar notas em que você reagiu ou repostou." internalServerError: "Erro interno de servidor" -internalServerErrorDescription: "Houve um erro inesperado no servidor." -copyErrorInfo: "Copiar detalhes de erro" -joinThisServer: "Cadastrar-se na instância" -exploreOtherServers: "Buscar outra instância" -letsLookAtTimeline: "Dar uma olhada na linha do tempo" -disableFederationConfirm: "Realmente desabilitar a federação?" -disableFederationConfirmWarn: "Mesmo se defederado, publicações continuarão sendo públicas, a menos que seja definido o contrário. Você geralmente não precisa disso." -disableFederationOk: "Desabilitar" -invitationRequiredToRegister: "Essa instância é apenas para convidados. Você precisa inserir um código válido para se cadastrar." emailNotSupported: "O envio de e-mails não é suportado nesta instância" -postToTheChannel: "Publicar ao canal" -cannotBeChangedLater: "Isso não pode ser alterado." -reactionAcceptance: "Aceitação de Reações" likeOnly: "Apenas curtidas" likeOnlyForRemote: "Tudo (somente curtidas remotas)" -nonSensitiveOnly: "Apenas não-sensível" nonSensitiveOnlyForLocalLikeOnlyForRemote: "Apenas não sensíveis (somente curtidas remotas)" rolesAssignedToMe: "Cargos atribuídos a mim" -resetPasswordConfirm: "Deseja realmente mudar a sua senha?" -sensitiveWords: "Palavras sensíveis" -sensitiveWordsDescription: "A visibilidade de todas as notas contendo as palavras configuradas será colocadas como \"Início\" automaticamente. Você pode listar várias delas separando-as por linha." -sensitiveWordsDescription2: "Utilizar espaços irá criar expressões aditivas (AND) e cercar palavras-chave com barras irá transformá-las em expressões regulares (RegEx)" -prohibitedWords: "Palavras proibidas" -prohibitedWordsDescription: "Habilita um erro ao tentar publicar uma nota contendo as palavras escolhidas. Várias palavras podem ser escolhidas, separando-as por linha." -prohibitedWordsDescription2: "Utilizar espaços irá criar expressões aditivas (AND) e cercar palavras-chave com barras irá transformá-las em expressões regulares (RegEx)" -hiddenTags: "Hashtags escondidas" -hiddenTagsDescription: "Selecione tags que não serão exibidas na lista de destaques. Várias tags podem ser escolhidas, separadas por linha." -notesSearchNotAvailable: "A pesquisa de notas está indisponível." -license: "Licença" unfavoriteConfirm: "Deseja realmente remover dos favoritos?" -myClips: "Meus clipes" drivecleaner: "Limpeza do drive" -retryAllQueuesNow: "Tentar novamente todas as pendências" retryAllQueuesConfirmTitle: "Gostaria de tentar novamente agora?" -retryAllQueuesConfirmText: "Isso irá temporariamente aumentar a carga do servidor." -enableChartsForRemoteUser: "Gerar gráficos estatísticos de usuários remotos" -enableChartsForFederatedInstances: "Gerar gráficos estatísticos de instâncias remotas" -showClipButtonInNoteFooter: "Adicionar \"Clip\" ao menu de ação de notas" reactionsDisplaySize: "Tamanho de exibição das reações" -limitWidthOfReaction: "Limita o comprimento máximo de reações e as exibe em tamanho reduzido" -noteIdOrUrl: "ID ou URL de nota" -video: "Vídeo" -videos: "Vídeos" -audio: "Áudio" -audioFiles: "Áudio" -dataSaver: "Economia de Dados" -accountMigration: "Migração da Conta" -accountMoved: "Esse usuário moveu-se para uma nova conta:" -accountMovedShort: "Essa conta foi migrada." -operationForbidden: "Operação proibída" -forceShowAds: "Sempre mostrar propagandas" -addMemo: "Adicionar memorando" -editMemo: "Editar memorando" reactionsList: "Reações" renotesList: "Repostagens" -notificationDisplay: "Notificações" leftTop: "Superior esquerdo" rightTop: "Superior direito" leftBottom: "Inferior esquerdo" rightBottom: "Inferior direito" -stackAxis: "Eixo de empilhamento" vertical: "Vertical" horizontal: "Exibir painel lateral inteiro" position: "Posição" serverRules: "Regras do servidor" -pleaseConfirmBelowBeforeSignup: "Para cadastrar-se no servidor, você precisa ler e concordar como seguinte:" -pleaseAgreeAllToContinue: "Você precisa concordar com todos os campos acima para continuar." continue: "Continuar" -preservedUsernames: "Nomes de usuário reservados" 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." -createNoteFromTheFile: "Compor nota a partir desse arquivo" archive: "Arquivo" -archived: "Arquivado" -unarchive: "Desarquivar" channelArchiveConfirmTitle: "Deseja realmente arquivar {name}?" -channelArchiveConfirmDescription: "Um canal arquivado não irá aparecer na lista de canais e nem resultados de pesquisa. Novas publicações não poderão mais ser adicionadas." -thisChannelArchived: "Esse canal foi arquivado." -displayOfNote: "Exibição de nota" -initialAccountSetting: "Configuração inicial do perfil" youFollowing: "Seguindo" -preventAiLearning: "Rejeitar uso de Aprendizado de Máquina (IA Generativa)" 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." options: "Opções" -specifyUser: "Usuário específico" -lookupConfirm: "Deseja buscar?" -openTagPageConfirm: "Deseja abrir a uma página de hashtag?" -specifyHost: "Especificar um hospedeiro" -failedToPreviewUrl: "Não foi possível carregar prévia" -update: "Atualizar" rolesThatCanBeUsedThisEmojiAsReaction: "Cargos que podem utilizar este emoji como reação" rolesThatCanBeUsedThisEmojiAsReactionEmptyDescription: "Se nenhum cargo for especificado, qualquer pessoa pode usar este emoji como reação." rolesThatCanBeUsedThisEmojiAsReactionPublicRoleWarn: "Estes cargos devem ser públicos." -cancelReactionConfirm: "Realmente excluir a sua reação?" -changeReactionConfirm: "Realmente mudar a sua reação?" -later: "Talvez mais tarde" -goToMisskey: "Ao Misskey" -additionalEmojiDictionary: "Dicionários adicionais de emoji" -installed: "Instalado" -branding: "Marca" -enableServerMachineStats: "Publicar estatísticas do hardware do servidor" -enableIdenticonGeneration: "Habilitar geração de identicon de usuário" -turnOffToImprovePerformance: "Desligar isso pode melhorar o desempenho." -createInviteCode: "Gerar convite" -createWithOptions: "Criar com opções" -createCount: "Número de convites" -inviteCodeCreated: "Convite gerado" -inviteLimitExceeded: "Você excedeu o limite de convites que podem ser gerados." -createLimitRemaining: "Limite de convites: {limit}" -inviteLimitResetCycle: "Esse limite irá tornar-se {limit} em {time}." -expirationDate: "Data de expiração" -noExpirationDate: "Sem expiração" -inviteCodeUsedAt: "Código de convite usado em" -registeredUserUsingInviteCode: "Convite usado por" waitingForMailAuth: "Verificação de e-mail pendente " -inviteCodeCreator: "Convite criado por" -usedAt: "Usado em" -unused: "Não foi usado" -used: "Usado" -expired: "Expirado" -doYouAgree: "Concorda?" -beSureToReadThisAsItIsImportant: "Por favor, leia essa informação importante." -iHaveReadXCarefullyAndAgree: "Eu li o texto \"{x}\" e concordo." -dialog: "Diálogo" icon: "Avatar" -forYou: "Para você" -currentAnnouncements: "Anúncios atuais" -pastAnnouncements: "Anúncios passados" -youHaveUnreadAnnouncements: "Há anúncios não lidos." -useSecurityKey: "Por favor, siga as instruções do seu navegador ou dispositivo para utilizar uma chave de acesso." replies: "Responder" renotes: "Repostar" -loadReplies: "Mostrar respostas" -loadConversation: "Mostrar conversa" -pinnedList: "Lista fixada" keepScreenOn: "Manter a tela do dispositivo sempre ligada" -verifiedLink: "A autoria do link foi verificada" -notifyNotes: "Notificar sobre novas notas" -unnotifyNotes: "Deixar de notificar sobre novas notas" -authentication: "Autenticação" -authenticationRequiredToContinue: "Por favor, autentique-se para continuar" -dateAndTime: "Data e Hora" -showRenotes: "Exibir reposts" -edited: "Editado" -notificationRecieveConfig: "Configurações de Notificação" -mutualFollow: "Seguidor mútuo" -followingOrFollower: "Seguidor ou usuário seguido" -fileAttachedOnly: "Apenas notas com arquivos" -showRepliesToOthersInTimeline: "Mostrar respostas aos outros na linha do tempo" -hideRepliesToOthersInTimeline: "Esconder respostas dos outros na linha do tempo" -showRepliesToOthersInTimelineAll: "Mostrar respostas aos outros, mas apenas de quem você segue, na linha do tempo" -hideRepliesToOthersInTimelineAll: "Esconder respostas de todos que você segue na linha do tempo" -confirmShowRepliesAll: "Essa operação é irreversível. Você gostaria de mostrar respostas a todos que você segue na sua linha do tempo?" -confirmHideRepliesAll: "Essa operação é irreversível. Você gostaria de esconder respostas a todos que você segue na sua linha do tempo?" -externalServices: "Serviços Externos" -sourceCode: "Código-fonte" -sourceCodeIsNotYetProvided: "Código-fonte está indisponível. Contate o administrador para resolver esse problema." -repositoryUrl: "URL do repositório" -repositoryUrlDescription: "Se você estiver utilizando Misskey como está (sem mudanças no código-fonte), insira https://github.com/misskey-dev/misskey" -repositoryUrlOrTarballRequired: "Se você não publicou um repositório, você precisa providenciar uma tarball em seu lugar. Veja .config/example.yml para mais informações." -feedback: "Feedback" -feedbackUrl: "Link para Feedback" -impressum: "Impressum" -impressumUrl: "URL de 'Impressum'" -impressumDescription: "Em alguns países, como a Alemanha, a inclusão de informação de contato do operador de um serviço é legalmente exigida para websites comerciais." -privacyPolicy: "Política de Privacidade" -privacyPolicyUrl: "URL da Política de Privacidade" -tosAndPrivacyPolicy: "Termos de Serviço e Política de Privacidade" -avatarDecorations: "Decorações de avatar" -attach: "Anexar" -detach: "Remover" -detachAll: "Remover Tudo" -angle: "Ângulo" flip: "Inversão" -showAvatarDecorations: "Exibir decorações de avatar" -releaseToRefresh: "Solte para atualizar" -refreshing: "Atualizando..." -pullDownToRefresh: "Puxe para baixo para atualizar" -disableStreamingTimeline: "Desabilitar atualizações em tempo real da linha do tempo" -useGroupedNotifications: "Agrupar notificações" -signupPendingError: "Houve um problema ao verificar o endereço de email. O link pode ter expirado." -cwNotationRequired: "Se \"Esconder conteúdo\" está habilitado, uma descrição deve ser adicionada." -doReaction: "Adicionar reação" -code: "Código" -reloadRequiredToApplySettings: "É necessário reiniciar para aplicar as configurações." -remainingN: "Restante: {n}" -overwriteContentConfirm: "Você tem certeza de que deseja sobrescrever o conteúdo atual?" -seasonalScreenEffect: "Efeito de Tela Sazonal" -decorate: "Decorar" -addMfmFunction: "Adicionar MFM" -enableQuickAddMfmFunction: "Exibir seleção avançada de MFM" -bubbleGame: "Bubble Game" -sfx: "Efeitos Sonoros" -soundWillBePlayed: "Sons serão reproduzidos" -showReplay: "Ver Replay" -replay: "Replay" -replaying: "Mostrando Replay" -endReplay: "Sair do Replay" -copyReplayData: "Copiar dados de Replay" -ranking: "Ranking" -lastNDays: "Últimos {n} dias" -backToTitle: "Voltar à página inicial" -hemisphere: "Onde você se localiza" -withSensitive: "Incluir notas com arquivos sensíveis" -userSaysSomethingSensitive: "Publicação de {name} contém conteúdo sensível" -enableHorizontalSwipe: "Arraste para mudar de aba" -loading: "Carregando" -surrender: "Cancelar" -gameRetry: "Tentar Novamente" -notUsePleaseLeaveBlank: "Deixe em branco caso inutilizado" -useTotp: "Digite a senha de uso único" -useBackupCode: "Usar códigos de “backup”" -launchApp: "Iniciar aplicação" -useNativeUIForVideoAudioPlayer: "Utilizar UI do navegador ao reproduzir vídeo e áudio" -keepOriginalFilename: "Manter nome original do arquivo" -keepOriginalFilenameDescription: "Se você desabilitar essa opção, os nomes de arquivos serão substituídos por uma sequência aleatória ao enviar arquivos." -noDescription: "Não há descrição" -alwaysConfirmFollow: "Sempre confirmar ao seguir" -inquiry: "Contato" -tryAgain: "Por favor, tente novamente mais tarde" -confirmWhenRevealingSensitiveMedia: "Confirmar ao revelar mídia sensível" -sensitiveMediaRevealConfirm: "Essa mídia pode ser sensível. Deseja revelá-la?" -createdLists: "Listas criadas" -createdAntennas: "Antenas criadas" -clipNoteLimitExceeded: "Não é possível adicionar mais notas ao clipe." -_delivery: - status: "Estado de entrega" - stop: "Suspenso" - resume: "Continuar entrega" - _type: - none: "Publicando" - manuallySuspended: "Suspenso manualmente" - goneSuspended: "Servidor foi suspenso devido ao seu apagamento" - autoSuspendedForNotResponding: "Servidor foi suspenso por não responder" -_bubbleGame: - howToPlay: "Como jogar" - hold: "Próximos" - _score: - score: "Pontuação" - scoreYen: "Dinheiro recebido" - highScore: "Melhor pontuação" - maxChain: "Número máximo de encadeamentos" - yen: "{yen} Yen" - estimatedQty: "{qty} Peças" - scoreSweets: "{onigiriQtyWithUnit} Onigiri" - _howToPlay: - section1: "Ajuste a posição e solte o objeto na caixa." - section2: "Quando dois objetos do mesmo tipo tocam-se, eles tornam-se outro objeto e você ganha pontos." - section3: "O jogo acaba quando objetos transbordam da caixa. Busque uma pontuação alta ao fundir objetos enquanto evita transbordar a caixa." -_announcement: - forExistingUsers: "Apenas aos usuários existente" - forExistingUsersDescription: "Se habilitado, esse anúncio será exibido apenas para usuários existentes no tempo de publicação. Se desabilitado, novos usuários também o receberão. " - needConfirmationToRead: "Exigir confirmação de leitura" - needConfirmationToReadDescription: "Um lembrete adicional será exibido para confirmar a leitura do anúncio. Esse anúncio também será excluído de qualquer forma de \"Marcar tudo como lido\"." - end: "Arquivar anúncio" - tooManyActiveAnnouncementDescription: "O excesso de anúncios pode atrapalhar a experiência do usuário. Considere arquivar anúncios obsoletos." - readConfirmTitle: "Marcar como lido?" - readConfirmText: "Isso marcará o conteúdo de \"{title}\" como lido." - shouldNotBeUsedToPresentPermanentInfo: "É preferível utilizar anúncios para publicar informações atuais e de curto prazo, e não informações que serão relevantes por muito tempo." - dialogAnnouncementUxWarn: "O uso de duas ou mais notificações de diálogo simultaneamente pode impactar significativamente a experiência de usuário. Portanto, utilize-as cuidadosamente." - silence: "Sem notificação" - silenceDescription: "Habilitar isso irá pular a notificação desse anúncio e o usuário não precisará lê-lo." _initialAccountSetting: - accountCreated: "A sua conta foi criada com sucesso!" - letsStartAccountSetup: "Em primeiro lugar, vamos configurar o seu perfil." - letsFillYourProfile: "Primeiramente, vamos configurar o seu perfil." - profileSetting: "Configurações do perfil" - privacySetting: "Configurações de privacidade" - theseSettingsCanEditLater: "Você pode alterar estas configurações mais tarde." - youCanEditMoreSettingsInSettingsPageLater: "Há mais configurações na página \"Configurações\". Não se esqueça de visitá-la mais tarde." followUsers: "Siga usuários que lhe interessam para criar a sua linha do tempo." - pushNotificationDescription: "Habilitar notificações push o possibilitará receber notificações de {name} diretamente no seu dispositivo." - initialAccountSettingCompleted: "Configuração de perfil completa!" - haveFun: "Aproveite {name}!" - youCanContinueTutorial: "Você pode iniciar um tutorial de como utilizar {name} (Misskey) ou pode sair da configuração e começar o uso imediatamente." - startTutorial: "Iniciar Tutorial" - skipAreYouSure: "Deseja pular a configuração de perfil?" - laterAreYouSure: "Deseja adiar a configuração de perfil?" -_initialTutorial: - launchTutorial: "Iniciar Tutorial" - title: "Tutorial" - wellDone: "Ótimo!" - skipAreYouSure: "Sair do Tutorial?" - _landing: - title: "Bem-vindo ao Tutorial!" - description: "Aqui, você pode aprender o básico de como usar o Misskey e as suas funções." - _note: - title: "O que é uma Nota?" - description: "Publicações no Misskey chamam-se 'Notas'. Notas são organizadas cronologicamente na linha do tempo e atualizam em tempo real." - reply: "Clique nesse botão para responder a uma mensagem. Também é possível responder respostas, continuando a conversa como uma \"thread\"." - renote: "Você pode compartilhar essa nota na sua linha do tempo. Você também pode citá-la com os seus comentários." - reaction: "Você pode adicionar reações à nota. Mais detalhes serão explicados na próxima página." - menu: "Você pode ver detalhes da nota, copiar links e realizar outras ações." - _reaction: - title: "O que são Reações?" - description: "É possível reagir às notas com diversos emojis. Reações permitem que você expresse sutilezas que não são possíveis apenas com uma curtida." - letsTryReacting: "Reações podem ser adicionadas clicando no botão \"+\". Tente reagir à nota de exemplo." - reactToContinue: "Adicione uma reação para continuar." - reactNotification: "Você receberá notificações em tempo real quando alguém reagir à sua nota." - reactDone: "Você pode desfazer uma reação ao selecionar o botão \"-\"." - _timeline: - title: "O Conceito das Linhas do Tempo" - description1: "Misskey providencia diversas linhas do tempo baseadas na sua utilidade (algumas podem não estar disponíveis a partir das configurações da instância)." - home: "Você pode ver as notas das contas seguidas. " - local: "Você pode ver notas de todos os usuários dessa instância." - social: "Notas da linha do tempo Início e Local serão exibidas." - global: "Você pode ver notas de todos os servidores conectados." - description2: "Você pode alterar dentre as linhas do tempo no todo da tela a qualquer momento." - description3: "Adicionalmente, há \"listas\" e \"canais\". Para mais informações, acesse {link}." - _postNote: - title: "Opções de Postagem de Nota" - description1: "Ao postar uma nota no Misskey, diversas opções estão disponíveis. A ficha de publicação parece com isto: " - _visibility: - description: "Você pode limitar quem vê a sua nota." - public: "Sua nota será visível a todos os usuários." - home: "Publicar apenas na linha do tempo Início. Pessoas visitando seu perfil, seja seguindo ou por um repost poderão vê-los." - followers: "Visível apenas para seguidores. Apenas seguidores podem vê-la e mais ninguém, e ela não pode ser repostada pelos demais." - direct: "Visível apenas para usuários específicos, e o destinatário será notificado. Pode ser usado como uma alternativa às mensagens diretas." - doNotSendConfidencialOnDirect1: "Tenha cuidado ao enviar informações sensíveis!" - doNotSendConfidencialOnDirect2: "Administradores do servidor podem ver o que foi escrito. Cuidado, também, ao enviar notas diretas a usuários de servidores não confiáveis." - localOnly: "Publicar com essa opção não federará a nota com outros servidores. Usuários desses servidores não poderão ver essas notas diretamente, independente das opções de visibilidade acima. " - _cw: - title: "Aviso de Conteúdo" - description: "Ao invés do corpo do texto, o conteúdo escrito na caixa \"anotação\" será exibido. Apertar \"Carregar mais\" irá revelar o corpo." - _exampleNote: - cw: "Isso irá te esfomear!" - note: "Acabei de comer um donut coberto de chocolate! 🍩😋" - useCases: "Isso pode ser usado caso seja exigido, pelas diretrizes do servidor, o cuidado com algum tópico ou ao publicar conteúdo sensível ou spoilers." - _howToMakeAttachmentsSensitive: - title: "Como Marcar Anexos como Sensíveis?" - description: "Para anexos cujo conteúdo é considerado sensível pelas diretrizes do servidor ou quando pretende-se esconder o seu conteúdo, adicione o sinal \"sensível\"." - tryThisFile: "Tente marcar a imagem anexada como sensível!" - _exampleNote: - note: "Opa, me atrapalhei abrindo a tampa do natô..." - method: "Para marcar um anexo como sensível, clique na sua miniatura, abra o menu e clique \"Marcar como sensível\"." - sensitiveSucceeded: "Ao anexar arquivos, por favor atribua uma sensibilidade coerente com as diretrizes da instância." - doItToContinue: "Marque o anexo como sensível para prosseguir." - _done: - title: "Você completou o tutorial! 🎉" - description: "As funções apresentadas aqui são apenas uma pequena parte. Para um conhecimento mais detalhado do uso do Misskey, acesse {link}." -_timelineDescription: - home: "Na linha do tempo Início, você verá notas dos usuários que você segue." - local: "Na linha do tempo Local, você verá notas de todos os usuários da instância." - social: "Na linha do tempo Social, você verá notas do Início e Local." - global: "Na linha do tempo Global, você verá notas de todas as instâncias conectadas." -_serverRules: - description: "Um grupo de regras a ser exibido antes de um cadastro. É recomendado que se faça um resumo dos Termos de Serviço." _serverSettings: iconUrl: "URL do ícone" - appIconDescription: "Especifica o ícone utilizado quando {host} é exibido como um app." - appIconUsageExample: "Exemplo: Como PWA, ou quando exibido num marcador de páginas ou na tela inicial de um celular" - appIconStyleRecommendation: "Como o ícone pode ser cortado para um quadrado ou círculo, é recomendado adicionar um fundo colorido na imagem." - appIconResolutionMustBe: "A resolução mínima é {resolution}." - manifestJsonOverride: "Sobrescrever manifest.json" - shortName: "Abreviação" - shortNameDescription: "Uma abreviação do nome da instância que pode ser exibido caso o nome oficial completo seja muito longo." - fanoutTimelineDescription: "Melhora significativamente a performance do retorno da linha do tempo e reduz o impacto no banco de dados quando habilitado. Em contrapartida, o uso de memória do Redis aumentará. Considere desabilitar em casos de baixa disponibilidade de memória ou instabilidade do servidor." - fanoutTimelineDbFallback: "\"Fallback\" ao banco de dados" - fanoutTimelineDbFallbackDescription: "Quando habilitado, a linha do tempo irá recuar ao banco de dados caso consultas adicionais sejam feitas e ela não estiver em cache. Quando desabilitado, o impacto no servidor será reduzido ao eliminar o recuo, mas limita a quantidade de linhas do tempo que podem ser recebidas." - inquiryUrl: "URL de inquérito" - inquiryUrlDescription: "Especifique um URL para um formulário de inquérito para a administração ou uma página web com informações de contato." _accountMigration: - moveFrom: "Migrar outra conta para essa" - moveFromSub: "Criar um 'alias' a outra conta" - moveFromLabel: "Conta original #{n}" 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)." - moveTo: "Migrar dessa conta para outra" - moveToLabel: "Conta para a qual se mover:" - moveCannotBeUndone: "A migração de conta não pode ser desfeita." 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.)" moveAccountHowTo: "Para realizar a migração da conta, primeiro crie um alias para esta conta no destino da migração. Após criar o alias, insira a conta de destino da migração no seguinte formato: @username@server.example.com." - startMigration: "Migrar" migrationConfirm: "Tem certeza de que deseja migrar esta conta para '{account}'? Uma vez migrada, não poderá ser desfeita e não será possível usar esta conta novamente em seu estado original." - movedAndCannotBeUndone: "Essa conta foi migrada. A migração não pode ser desfeita." postMigrationNote: "A remoção dos seguidores desta conta será realizada 24 horas após a operação de migração. O número de seguidores e seguidos desta conta se tornará zero. Os seguidores não serão removidos, portanto, eles continuarão a ver as postagens destinadas aos seguidores desta conta." - movedTo: "Conta para a qual se mover:" _achievements: earnedAt: "Data de aquisição" _types: _notes1: title: "Configurando o meu misskey" - description: "Poste uma nota pela primeira vez" + description: "Postou uma nota pela primeira vez" flavor: "Divirta-se com o Misskey!" _notes10: title: "Algumas notas" - description: "Poste 10 notas" + description: "Postou 10 notas" _notes100: title: "Um monte de notas" - description: "Poste 100 notas" + description: "Postou 100 notas" _notes500: title: "Coberto por notas" - description: "Poste 500 notas" + description: "Postou 500 notas" _notes1000: title: "Uma montanha de notas" - description: "Poste 1 000 notas" + description: "Postou 1000 notas" _notes5000: title: "Enxurrada de notas" - description: "Poste 5000 notas" + description: "Postou 5000 notas" _notes10000: - title: "Supernota" - description: "Poste 10 000 notas" + title: "Super nota" + description: "Postou 10000 notas" _notes20000: title: "Preciso... de mais... notas..." - description: "Poste 20 000 notas" + description: "Postou 20000 notas" _notes30000: title: "Notas, Notas, NOTAS!" - description: "Poste 30 000 notas" + description: "Postou 30000 notas" _notes40000: title: "Fábrica de notas" - description: "Poste 40 000 notas" + description: "Postou 40000 notas" _notes50000: title: "Planeta de notas" - description: "Poste 50 000 notas" + description: "Postou 50000 notas" _notes60000: title: "Quasar de notas" - description: "Poste 60 000 notas" + description: "Postou 60000 notas" _notes70000: title: "Buraco negro de notas" - description: "Poste 70 000 notas" + description: "Postou 70000 notas" _notes80000: title: "Galáxia de notas" - description: "Poste 80 000 notas" + description: "Postou 80000 notas" _notes90000: title: "Universo de notas" - description: "Poste 90 000 notas" + description: "Postou 90000 notas" _notes100000: title: "ALL YOUR NOTE ARE BELONG TO US" - description: "Poste 100 000 notas" + description: "Postou 100000 notas" flavor: "Você realmente tem muita coisa para escrever" _login3: title: "Iniciante I" - description: "Faça login por um total de 3 dias" + description: "Fez login por um total de 3 dias" flavor: "De hoje em diante, me chame apenas de Misskist" _login7: title: "Iniciante II" - description: "Faça login por um total de 7 dias" + description: "Fez login por um total de 7 dias" flavor: "Pegando o jeito da coisa?" _login15: title: "Iniciante III" - description: "Faça login por um total de 15 dias" + description: "Fez login por um total de 15 dias" _login30: title: "Misskist I" - description: "Faça login por um total de 30 dias" + description: "Fez login por um total de 30 dias" _login60: title: "Misskist II" - description: "Faça login por um total de 60 dias" + description: "Fez login por um total de 60 dias" _login100: title: "Misskist III" - description: "Faça login por um total de 100 dias" + description: "Fez login por um total de 100 dias" flavor: "Misskist violento" _login200: title: "Freguês I" - description: "Faça login por um total de 200 dias" + description: "Fez login por um total de 200 dias" _login300: title: "Freguês II" - description: "Faça login por um total de 300 dias" + description: "Fez login por um total de 300 dias" _login400: title: "Freguês III" - description: "Faça login por um total de 400 dias" + description: "Fez login por um total de 400 dias" _login500: title: "Veterano I" - description: "Faça login por um total de 500 dias" + description: "Fez login por um total de 500 dias" flavor: "Cavalheiros, tudo o que peço são notas" _login600: title: "Veterano II" - description: "Faça login por um total de 600 dias" + description: "Fez login por um total de 600 dias" _login700: title: "Veterano III" - description: "Faça login por um total de 700 dias" + description: "Fez login por um total de 700 dias" _login800: - title: "Mestre das Notas I" - description: "Faça login por um total de 800 dias" + title: "Mestre das notas I" + description: "Fez login por um total de 800 dias" _login900: - title: "Mestre das Notas II" - description: "Faça login por um total de 900 dias" + title: "Mestre das notas II" + description: "Fez login por um total de 900 dias" _login1000: - title: "Mestre das Notas III" - description: "Faça login por um total de 1 000 dias" + title: "Mestre das notas III" + description: "Fez login por um total de 1000 dias" flavor: "Obrigado por utilizar o Misskey!" _noteClipped1: - title: "Preciso... clipar..." - description: "Adicione a um clipe a sua primeira nota" + title: "Não posso deixar de adicionar ao clipe" + description: "Adicionou a um clipe a sua primeira nota" _noteFavorited1: - title: "Astrônomo Amador" - description: "Adicione uma nota aos favoritos pela primeira vez" + title: "Astrônomo amador" + description: "Adicionou uma nota aos favoritos pela primeira vez" _myNoteFavorited1: title: "Cabeça nas estrelas" - description: "Tenha uma das suas notas adicionada aos favoritos de alguém" + description: "Teve uma das suas notas adicionada aos favoritos de alguém" _profileFilled: - title: "Tudo Pronto" - description: "Configure o seu perfil" + title: "Tudo pronto" + description: "Configurou o seu perfil" _markedAsCat: title: "Eu Sou Um Gato" - description: "Marque a sua conta como um gato" + description: "Marcou a sua conta como um gato" flavor: "Ainda não tenho um nome." _following1: title: "Primeira vez seguindo alguém" - description: "Siga um usuário pela primeira vez" + description: "Seguiu um usuário pela primeira vez" _following10: title: "Circulando, circulando" - description: "Siga 10 usuários" + description: "Seguiu 10 usuários" _following50: title: "Muitos amigos" - description: "Siga 50 usuários" + description: "Seguiu 50 usuários" _following100: - title: "100 Amigos" - description: "Siga 100 usuários" + title: "100 amigos" + description: "Seguiu 100 usuários" _following300: title: "Sobrecarga de amigos" - description: "Siga 300 usuários" + description: "Seguiu 300 usuários" _followers1: title: "Primeiro seguidor" - description: "Ganhe o seu primeiro seguidor" + description: "Ganhou o seu primeiro seguidor" _followers10: title: "Sigam-me os bons!" - description: "Ganhe 10 seguidores" + description: "Ganhou 10 seguidores" _followers50: title: "Aos montes" - description: "Ganhe 50 seguidores" + description: "Ganhou 50 seguidores" _followers100: title: "Popular" - description: "Ganhe 100 seguidores" + description: "Ganhou 100 seguidores" _followers300: title: "Em fila única, por favor" - description: "Ganhe 300 seguidores" + description: "Ganhou 300 seguidores" _followers500: title: "Torre de celular" - description: "Ganhe 500 seguidores" + description: "Ganhou 500 seguidores" _followers1000: title: "Influencer" - description: "Ganhe 1 000 seguidores" - _collectAchievements30: - title: "Coletor de Conquistas" - description: "Ganhe 30 conquistas" - _viewAchievements3min: - title: "Curte Conquistas" - description: "Olhe para a sua lista de conquistas por pelo menos 3 minutos" - _iLoveMisskey: - title: "Eu Amo Misskey" - description: "Poste \"I ❤ #Misskey\"" - flavor: "A equipe de desenvolvimento do Misskey aprecia profundamente o seu apoio!" - _foundTreasure: - title: "Caça ao Tesouro" - description: "Você achou o tesouro escondido" - _client30min: - title: "Pausinha" - description: "Deixe o Misskey aberto por pelo menos 30 minutos" - _client60min: - title: "Sem falta" - description: "Deixe o Misskey aberto por pelo menos 60 minutos" + description: "Ganhou 1000 seguidores" _noteDeletedWithin1min: title: "Deixa pra lá" - description: "Exclua a postagem dentro de 1 minuto após a ter publicado" - _postedAtLateNight: - title: "Noturno" - description: "Poste uma nota tarde da noite" - flavor: "Tá na hora de ir dormir." - _postedAt0min0sec: - title: "Relógio Falante" - description: "Poste uma nota à meia-noite em ponto" - flavor: "Tic-Tac-Tic-Tac" - _selfQuote: - title: "Autorreferência" - description: "Cite sua própria nota" - _htl20npm: - title: "Linha do Tempo Fluida" - description: "Faça a velocidade da linha do tempo exceder 20 npm (notas por minuto)" - _viewInstanceChart: - title: "Analista" - description: "Veja os infográficos da instância" - _outputHelloWorldOnScratchpad: - title: "Olá, Mundo!" - description: "Produza \"hello world\" no Scratchpad" - _open3windows: - title: "Múlti-Janelas" - description: "Tenha ao mínimo 3 janelas abertas simultaneamente." + description: "Excluí a postagem dentro de 1 minuto após ter publicado" _driveFolderCircularReference: title: "Referência circular" - description: "Tente criar uma pasta recursiva no Drive." - _reactWithoutRead: - title: "Você leu tudo isso?" - description: "Reaja a uma nota com mais de 100 caracteres dentro de 3 segundos após a sua publicação." - _clickedClickHere: - title: "Clique aqui" - description: "Você clicou aqui" - _justPlainLucky: - title: "Pura Sorte" - description: "Tem uma chance de ser obtido com uma probabilidade de 0.005% a cada 10 segundos." - _setNameToSyuilo: - title: "Complexo de Deus" - description: "Colocar seu nome como \"syuilo\"" - _passedSinceAccountCreated1: - title: "Aniversário de Um Ano" - description: "Um ano passou-se desde a criação da conta" - _passedSinceAccountCreated2: - title: "Aniversário de Dois Anos" - description: "Dois anos passaram-se desde a criação da conta" - _passedSinceAccountCreated3: - title: "Aniversário de Três Anos" - description: "Três anos passaram-se desde a criação da conta" - _loggedInOnBirthday: - title: "Feliz Aniversário" - description: "Entre no dia do seu aniversário" - _loggedInOnNewYearsDay: - title: "Feliz Ano Novo!" - description: "Entre no primeiro dia do ano" - flavor: "Para outro ótimo ano nessa instância" - _cookieClicked: - title: "Um jogo onde você clica em cookies" - description: "Clicou o cookie" - flavor: "Pera, você tá no website correto?" - _brainDiver: - title: "Brain Diver" - description: "Poste o link do Brain Diver" - flavor: "Misskey-Misskey La-Tu-Ma" - _smashTestNotificationButton: - title: "Teste de Transbordamento" - description: "Ative o teste de notificações repetidamente dentro de um curto período de tempo" - _tutorialCompleted: - title: "Diploma de Ensino Fundamental Misskey" - description: "Complete o tutorial" - _bubbleGameExplodingHead: - title: "🤯" - description: "O maior objeto no Bubble Game" - _bubbleGameDoubleExplodingHead: - title: "🤯 Duplo" - description: "Dois dos maiores objetos do Bubble Game ao mesmo tempo." - flavor: "Dá para encher uma lancheira com esses 🤯🤯." _role: new: "Novo cargo" edit: "Editar cargo" @@ -1672,10 +1187,8 @@ _role: descriptionOfPermission: "Moderador permite que você execute operações básicas relacionadas à moderação.\nAdministradores podem alterar todas as configurações do servidor." assignTarget: "Atribuir" descriptionOfAssignTarget: "Manual para gerenciar manualmente quem está incluído neste cargo.\nCondicional define uma condição e os usuários que corresponderem a ela serão incluídos automaticamente." - manual: "Manual" - manualRoles: "Cargos manuais" + manual: "Documentação" conditional: "Condicional" - conditionalRoles: "Cargos condicionais" condition: "Condição" isConditionalRole: "Este é um cargo condicional." isPublic: "Cargo público" @@ -1703,16 +1216,13 @@ _role: gtlAvailable: "Visualizar Linha do Tempo Global" ltlAvailable: "Visualizar Linha do Tempo Local" canPublicNote: "Permitir postagem pública" - mentionMax: "Número máximo de menções em uma nota" canInvite: "Permitir a criação de códigos de convites para a instância" inviteLimit: "Limite de códigos de convite" inviteLimitCycle: "Intervalo de emissão do código de convite" inviteExpirationTime: "Prazo de validade do código de convite" canManageCustomEmojis: "Permitir gerenciar emojis personalizados" - canManageAvatarDecorations: "Gerenciar decorações de avatar" driveCapacity: "Capacidade do drive" alwaysMarkNsfw: "Sempre marcar arquivos como NSFW" - canUpdateBioMedia: "Permitir a edição de ícone ou imagem do banner." pinMax: "Número máximo de notas fixadas" antennaMax: "Número máximo de antenas" wordMuteMax: "Número máximo de caracteres nas palavras silenciadas" @@ -1725,17 +1235,9 @@ _role: descriptionOfRateLimitFactor: "Valores menores são menos restritivos, valores maiores são mais restritivos." canHideAds: "Permitir ocultar anúncios" canSearchNotes: "Permitir a busca de notas" - canUseTranslator: "Uso do tradutor" - avatarDecorationLimit: "Número máximo de decorações de avatar que podem ser aplicadas" _condition: - roleAssignedTo: "Atribuído a cargos manuais" isLocal: "Usuário local" isRemote: "Usuário remoto" - isCat: "Usuários Gatinho" - isBot: "Usuários Bot" - isSuspended: "Usuário suspenso" - isLocked: "Contas privadas" - isExplorable: "Encontrável em \"Explorar\"" createdLessThan: "Menos de X passados desde a criação da conta" createdMoreThan: "Mais de X passados desde a criação da conta" followersLessThanOrEq: "Possui X ou menos seguidores" @@ -1749,19 +1251,13 @@ _role: not: "Não ~ (Condicional)" _sensitiveMediaDetection: description: "Use o aprendizado de máquina para detectar automaticamente mídias sensíveis para moderação. Isso pode aumentar ligeiramente a carga no servidor." - sensitivity: "Detecção de sensibilidade" sensitivityDescription: "Ao reduzir a sensibilidade, as detecções incorretas (falsos positivos) diminuem. Ao aumentar a sensibilidade, as falhas de detecção (falsos negativos) diminuem." - setSensitiveFlagAutomatically: "Marcar como sensível" - setSensitiveFlagAutomaticallyDescription: "Os resultados da detecção interna serão mantidos mesmo se essa opção estiver desligada." - analyzeVideos: "Habilitar análise de vídeos" - analyzeVideosDescription: "Analisa vídeos em adição a imagens. Isso irá aumentar levemente a carga do servidor." _emailUnavailable: used: "O endereço de e-mail informado já está sendo utilizado" format: "Formado de e-mail inválido" disposable: "Endereços de e-mail descartáveis não devem ser utilizados" mx: "O servidor de informado é inválido" smtp: "O servidor de e-mail não está respondendo" - banned: "Você não pode se cadastrar com esse endereço de email" _ffVisibility: public: "Público" followers: "Visível apenas para seguidores" @@ -1781,17 +1277,10 @@ _ad: back: "Voltar" reduceFrequencyOfThisAd: "Diminuir frequência deste anúncio" hide: "Não exibir anúncios" - timezoneinfo: "O dia da semana é determinado pelo fuso horário do servidor." - adsSettings: "Configurações de propaganda" - notesPerOneAd: "Intervalo de notas entre o anúncio nas atualizações em tempo real." - setZeroToDisable: "Selecione o valor 0 para desabilitar anúncios nas atualizações em tempo real." - adsTooClose: "O intervalo atual de anúncio pode impactar negativamente a experiência de usuário por ser muito baixo." _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." - contactAdmin: "Essa instância não possui suporte ao uso de endereços de email, contate seu administrador para mudar a sua senha." _gallery: - my: "Minha Galeria" liked: "Postagens curtidas" like: "Curtir" unlike: "Remover curtida" @@ -1800,223 +1289,40 @@ _email: title: "Você tem um novo seguidor" _receiveFollowRequest: title: "Você recebeu um pedido de seguidor" -_plugin: - install: "Instalar plugins" - installWarn: "Por favor, não instale plugins duvidosos." - manage: "Gerenciar plugins" - viewSource: "Ver código-fonte" - viewLog: "Mostrar registo" _preferencesBackups: - list: "Backups criados" - saveNew: "Salvar novo backup" - loadFile: "Carregar de arquivo" - apply: "Aplicar a este dispositivo" - save: "Salvar mudanças" - inputName: "Insira um nome para esse backup" cannotSave: "Não foi possível salvar" - nameAlreadyExists: "Um backup chamado \"{name}\" já existe. Por favor, insira outro nome." applyConfirm: "Deseja aplicar o backup '{name}' ao dispositivo atual? As configurações atuais do dispositivo serão perdidas." - saveConfirm: "Salvar backup como \"{name}\"?" deleteConfirm: "Deseja excluir {name}?" - renameConfirm: "Renomear esse backup de \"{old}\" para \"{new}\"?" - noBackups: "Não há backups. Você pode configurar suas configurações de cliente nesse servidor ao selecionar \"Criar novo backup\"." - createdAt: "Criado em: {date} {time}" - updatedAt: "Atualizado em: {date} {time}" cannotLoad: "Não foi possível carregar" - invalidFile: "Formato de arquivo inválido" -_registry: - scope: "Escopo" - key: "Chave" - keys: "Chave" - domain: "Domínio" - createKey: "Criar chave" -_aboutMisskey: - about: "Misskey é um software de código aberto desenvolvido por syulio desde 2014." - contributors: "Contribuidores principais" - allContributors: "Todos os contribuidores" - source: "Código-fonte" - original: "Original" - thisIsModifiedVersion: "{name} utiliza uma versão modificada do Misskey original." - translation: "Traduza o Misskey" - donate: "Doe para o Misskey" - morePatrons: "Nós apreciamos o apoio de vários outros apoiadores não listados aqui. Obrigado! 🥰" - patrons: "Apoiadores" - projectMembers: "Membros do projeto" -_displayOfSensitiveMedia: - respect: "Esconder mídia marcada como sensível" - ignore: "Exibir mídia marcada como sensível" - force: "Esconder toda mídia" -_instanceTicker: - none: "Nunca mostrar" - remote: "Mostrar para usuários remotos" - always: "Sempre mostrar" -_serverDisconnectedBehavior: - reload: "Recarregar automaticamente" - dialog: "Exibir diálogo de aviso de conteúdo" - quiet: "Exibir aviso de conteúdo discreto" _channel: - create: "Criar canal" - edit: "Editar canal" - setBanner: "Definir banner" - removeBanner: "Remover banner" featured: "Destaques" - owned: "Autoral" following: "Seguindo" - usersCount: "{n} usuários ativos" - notesCount: "{n} notas" + usersCount: "usuários ativos" + notesCount: "notas" nameAndDescription: "Nome e descrição" - nameOnly: "Apenas o nome" - allowRenoteToExternal: "Permitir repostagens e citações de fora do canal" _menuDisplay: sideFull: "Exibir painel lateral inteiro" - sideIcon: "Lateral (Ícones)" top: "Exibir barra superior" hide: "Ocultar" -_wordMute: - muteWords: "Palavras silenciadas" - muteWordsDescription: "Separe com espaços para uma condicional AND (&&) ou por linha para uma condicional OR (||)." - muteWordsDescription2: "Cercar palavras-chave com barras para usar expressões regulares (RegEx)." _instanceMute: instanceMuteDescription: "Todas as notas e repostagens do servidor configurado serão silenciados, incluindo respostas aos usuários do servidor mutado." - instanceMuteDescription2: "Separar por linha" - title: "Esconder notas das instâncias listadas. " - heading: "Lista de instâncias a serem silenciadas" _theme: - explore: "Explorar Temas" - install: "Instalar um tema" - manage: "Gerenciar temas" - code: "Código do tema" description: "Descrição" - installed: "{name} foi instalado" - installedThemes: "Temas instalados" - builtinThemes: "Temas nativos" - alreadyInstalled: "Esse tema já foi instalado" - invalid: "O formato desse tema é invalido" - make: "Fazer um tema" - base: "Base" - addConstant: "Adicionar constante" - constant: "Constante" - defaultValue: "Valor padrão" - color: "Cor" - refProp: "Referenciar uma propriedade" - refConst: "Referenciar uma constante" - key: "Chave" - func: "Funções" - funcKind: "Tipo de função" - argument: "Argumento" - basedProp: "Propriedade referenciada" alpha: "Opacidade" - darken: "Escurecer" - lighten: "Esclarecer" - inputConstantName: "Insira um nome para essa constante" - importInfo: "Se você inserir o código do tema aqui, você pode importá-lo no editor de temas" deleteConstantConfirm: "Confirma a exclusão da constante {const}?" keys: - accent: "Cor de destaque" - bg: "Plano de fundo" - fg: "Texto" - focus: "Foco" - indicator: "Indicador" - panel: "Painel" - shadow: "Sombra" - header: "Cabeçalho" - navBg: "Plano de fundo da barra lateral" - navFg: "Texto da barra lateral" - navHoverFg: "Texto da coluna lateral (Selecionado)" - navActive: "Texto da coluna lateral (Ativa)" - navIndicator: "Indicador da coluna lateral" - link: "Link" - hashtag: "Hashtag" mention: "Menção" - mentionMe: "Menciona (a mim)" renote: "Repostar" - modalBg: "Plano de fundo modal" divider: "Separador" - scrollbarHandle: "Alça da barra de rolagem (Selecionada)" - scrollbarHandleHover: "Alça da barra de rolagem (Selecionada)" - dateLabelFg: "Texto do rótulo de data" - infoBg: "Plano de fundo de informações" - infoFg: "Texto de informações" - infoWarnBg: "Plano de fundo de avisos" - infoWarnFg: "Texto de avisos" - toastBg: "Plano de fundo de notificações" - toastFg: "Texto da notificação" - buttonBg: "Plano de fundo de botão" - buttonHoverBg: "Plano de fundo de botão (Selecionado)" - inputBorder: "Borda de campo digitável" - driveFolderBg: "Plano de fundo da pasta no Drive" - wallpaperOverlay: "Sobreposição do papel de parede." - badge: "Emblema" - messageBg: "Plano de fundo do chat" - accentDarken: "Cor de destaque (Escurecida)" - accentLighten: "Cor de destaque (Esclarecida)" - fgHighlighted: "Texto Destacado" _sfx: note: "Posts" - noteMy: "Própria nota" notification: "Notificações" - reaction: "Ao selecionar uma reação" -_soundSettings: - driveFile: "Usar um arquivo de áudio do Drive." - driveFileWarn: "Selecione um arquivo de áudio do Drive." - driveFileTypeWarn: "Esse arquivo não é compatível" - driveFileTypeWarnDescription: "Selecione um arquivo de áudio" - driveFileDurationWarn: "O áudio é muito longo." - driveFileDurationWarnDescription: "Áudios longos podem atrapalhar o funcionamento do Misskey. Deseja continuar?" - driveFileError: "Não foi possível carregar o som. Por favor, altere a configuração." _ago: - future: "Futuro" - justNow: "Agora mesmo" - secondsAgo: "{n}s atrás" - minutesAgo: "{n}m atrás" - hoursAgo: "{n}h atrás" - daysAgo: "{n}d atrás" - weeksAgo: "{n} semanas atrás" - monthsAgo: "{n} meses atrás" - yearsAgo: "{n} anos atrás" invalid: "Não há nada aqui" -_timeIn: - seconds: "Em {n}s" - minutes: "Em {n}m" - hours: "Em {n}h" - days: "Em {n}d" - weeks: "Em {n} semanas" - months: "Em {n} meses" - years: "Em {n} anos" -_time: - second: "Segundo(s)" - minute: "Minuto(s)" - hour: "Hora(s)" - day: "Dia(s)" _2fa: - alreadyRegistered: "Você já cadastrou um dispositivo de autenticação de dois fatores." - registerTOTP: "Cadastrar aplicativo autenticador" - step1: "Inicialmente, instale um aplicativo autenticador (como {a} ou {b}) em seu dispositivo." - step2: "Então, escaneie o código QR exibido na tela." - step2Uri: "Acesse o seguinte URI se você estiver utilizando um aplicativo no computador" - step3Title: "Insira o código de autenticação" - step3: "Insira o código de autenticação (token) providenciado pelo seu aplicativo para terminar a configuração." - setupCompleted: "Configuração completa" - step4: "De agora em diante, quaisquer solicitações de entrada pedirão pelo código." - securityKeyNotSupported: "O seu navegador não é compatível com chaves de segurança." - registerTOTPBeforeKey: "Por favor, configure um aplicativo autenticador para registrar uma chave de segurança." securityKeyInfo: "Além da autenticação por impressão digital ou PIN, você também pode configurar a autenticação por chaves de segurança de hardware compatível com FIDO2 para proteger ainda mais a sua conta." - registerSecurityKey: "Registre um código de segurança" - securityKeyName: "Insira um nome para a chave" - tapSecurityKey: "Por favor, siga as instruções do navegador para registrar o código de segurança" - removeKey: "Remover código de segurança" removeKeyConfirm: "Deseja excluir {name}?" - whyTOTPOnlyRenew: "O autenticador não pode ser removido enquanto há códigos de segurança registrados." - renewTOTP: "Reconfigurar autenticador" - renewTOTPConfirm: "Isso interromperá o funcionamento dos códigos de aplicativos anteriores " - renewTOTPOk: "Reconfigurar" renewTOTPCancel: "Não, obrigado" - checkBackupCodesBeforeCloseThisWizard: "Antes de fechar essa janela, anote os códigos de backup a seguir." - backupCodes: "Códigos de backup" - backupCodesDescription: "Você pode utilizar esses códigos para ganhar acesso à conta caso sua autenticação de dois fatores esteja indisponível. Cada código pode ser utilizado apenas uma vez. Por favor, guarde-os em um local seguro." - backupCodeUsedWarning: "Um código de backup foi utilizado. Por favor, reconfigure a autenticação de dois fatores o quanto antes, caso não consiga utilizá-la." - backupCodesExhaustedWarning: "Todos os códigos de backup foram utilizados. Caso perca acesso à autenticação de dois fatores, você perderá o acesso à conta. Por favor, reconfigure a autenticação de dois fatores." - moreDetailedGuideHere: "Aqui está um guia detalhado" _permissions: "read:account": "Visualizar informações da conta" "write:account": "Editar informações da conta" @@ -2050,82 +1356,6 @@ _permissions: "write:gallery": "Editar sua galeria" "read:gallery-likes": "Visualizar a sua lista de curtidas da galeria" "write:gallery-likes": "Editar a sua lista de curtidas da galeria" - "read:flash": "Ver Play" - "write:flash": "Editar Plays" - "read:flash-likes": "Ver lista de Plays curtidas" - "write:flash-likes": "Editar lista de Plays curtidas" - "read:admin:abuse-user-reports": "Ver relatórios de usuário" - "write:admin:delete-account": "Excluir conta de usuário" - "write:admin:delete-all-files-of-a-user": "Excluir todos os arquivos de um usuário" - "read:admin:index-stats": "Ver estatísticas do índice do banco de dados" - "read:admin:table-stats": "Ver estatísticas da tabela do banco de dados" - "read:admin:user-ips": "Ver endereços IP do usuário" - "read:admin:meta": "Ver metadados da instância" - "write:admin:reset-password": "Mudar a senha do usuário" - "write:admin:resolve-abuse-user-report": "Resolver relatório de usuário" - "write:admin:send-email": "Enviar email" - "read:admin:server-info": "Ver informações do servidor" - "read:admin:show-moderation-log": "Ver log de moderação" - "read:admin:show-user": "Ver informações privadas do usuário" - "write:admin:suspend-user": "Suspender usuário" - "write:admin:unset-user-avatar": "Remover avatar do usuário" - "write:admin:unset-user-banner": "Remover banner do usuário" - "write:admin:unsuspend-user": "Cancelar a suspensão do usuário" - "write:admin:meta": "Gerenciar os metadados da instância" - "write:admin:user-note": "Gerenciar a nota de moderação" - "write:admin:roles": "Gerenciar cargos" - "read:admin:roles": "Ver cargos" - "write:admin:relays": "Gerenciar relays" - "read:admin:relays": "Ver relays" - "write:admin:invite-codes": "Gerenciar códigos de convite" - "read:admin:invite-codes": "Ver códigos de convite" - "write:admin:announcements": "Gerenciar anúncios" - "read:admin:announcements": "Ver anúncios" - "write:admin:avatar-decorations": "Gerenciar decorações de avatar" - "read:admin:avatar-decorations": "Ver decorações de avatar" - "write:admin:federation": "Gerenciar dados de federação" - "write:admin:account": "Gerenciar conta de usuário" - "read:admin:account": "Ver conta de usuário" - "write:admin:emoji": "Gerenciar emoji" - "read:admin:emoji": "Ver emoji" - "write:admin:queue": "Gerenciar trabalhos pendentes" - "read:admin:queue": "Ver informações de trabalhos pendentes" - "write:admin:promo": "Gerenciar notas de promoção" - "write:admin:drive": "Gerenciar Drive de usuário" - "read:admin:drive": "Ver informações de Drive de usuário" - "read:admin:stream": "Utilizar WebSocket API para Admin" - "write:admin:ad": "Gerenciar propagandas" - "read:admin:ad": "Ver propagandas" - "write:invite-codes": "Criar códigos de convite" - "read:invite-codes": "Obter códigos de convite" - "write:clip-favorite": "Gerenciar clipes favoritados" - "read:clip-favorite": "Ver Clipes favoritados" - "read:federation": "Ver dados de federação" - "write:report-abuse": "Reportar violação" -_auth: - shareAccessTitle: "Conceder permissões do aplicativo" - shareAccess: "Você gostaria de autorizar \"{name}\" para acessar essa conta?" - shareAccessAsk: "Você tem certeza de que gostaria de conceder ao aplicativo o acesso à conta?" - permission: "{name} solicita as seguintes permissões" - permissionAsk: "O aplicativo solicita as seguintes permissões" - pleaseGoBack: "Por favor, volte ao aplicativo" - callback: "Retornando ao aplicativo" - denied: "Acesso negado" - pleaseLogin: "Por favor, entre para autorizar aplicativos." -_antennaSources: - all: "Todas as notas" - homeTimeline: "Notas de usuários seguidos" - users: "Notas de usuários específicos" - userList: "Notas de uma lista específica de usuários" - userBlacklist: "Todas as notas, exceto as de um ou mais usuários específicos" -_weekday: - sunday: "Domingo" - monday: "Segunda-feira" - tuesday: "Terça-feira" - wednesday: "Quarta-feira" - thursday: "Quinta-feira" - friday: "Sexta-feira" - saturday: "Sábado" _widgets: profile: "Perfil" instanceInfo: "Informações da instância" @@ -2156,112 +1386,28 @@ _widgets: _userList: chooseList: "Selecione uma lista" clicker: "Clicker" - birthdayFollowings: "Usuários de aniversário hoje" _cw: - hide: "Esconder" show: "Carregar mais" - chars: "{count} caracteres" - files: "{count} arquivo(s)" _poll: - noOnlyOneChoice: "São necessárias, no mínimo, duas escolhas" - choiceN: "Escolha {n}" - noMore: "Você não pode adicionar mais escolhas" canMultipleVote: "Permitir múltipla seleção" - expiration: "Encerrar enquete" - infinite: "Nunca" - at: "Terminar em..." - after: "Terminar após..." - deadlineDate: "Data de término" - deadlineTime: "Tempo" - duration: "Duração" - votesCount: "{n} votos" - totalVotes: "{n} votos totais" vote: "Votar em enquetes" - showResult: "Ver resultados" - voted: "Votada" - closed: "Encerrada" - remainingDays: "{d} dia(s) {h} hora(s) restantes" - remainingHours: "{h} hora(s) {m} minuto(s) restantes" - remainingMinutes: "{m} minuto(s) {s} segundo(s) restantes" - remainingSeconds: "{s} segundo(s) restantes" _visibility: - public: "Público" - publicDescription: "Sua nota será visível para todos os usuários" home: "Início" - homeDescription: "Publicar apenas na linha do tempo Início" followers: "Seguidores" followersDescription: "Tornar visível apenas para os meus seguidores" - specified: "Mensagem Direta" - specifiedDescription: "Tornar visível apenas para usuários específicos" - disableFederation: "Defederar" - disableFederationDescription: "Não transmitir às outras instâncias" -_postForm: - replyPlaceholder: "Responder a essa nota..." - quotePlaceholder: "Citar essa nota..." - channelPlaceholder: "Postar em canal..." - _placeholders: - a: "Como vão as coisas?" - b: "O que está rolando por aí?" - c: "No que está pensando?" - d: "Do que você quer falar?" - e: "Comece a digitar..." - f: "Esperando você digitar..." _profile: name: "Nome" username: "Nome de usuário" - description: "Bio" - youCanIncludeHashtags: "Você pode incluir hashtags em sua bio." - metadata: "Informações Adicionais" - metadataEdit: "Editar informações adicionais" - metadataDescription: "Aqui, você pode exibir campos adicionais de informação no seu perfil." - metadataLabel: "Rótulo" - metadataContent: "Conteúdo" - changeAvatar: "Mudar avatar" - changeBanner: "Mudar banner" - verifiedLinkDescription: "Ao inserir um URL que contém um link para essa conta, um ícone de verificação será exibido ao lado do campo" - avatarDecorationMax: "Você pode adicionar até {max} decorações." _exportOrImport: - allNotes: "Todas as notas" favoritedNotes: "Notas nos favoritos" - clips: "Clipe" followingList: "Seguindo" muteList: "Silenciar" blockingList: "Bloquear" userLists: "Listas" - excludeMutingUsers: "Excluir usuários silenciados" - excludeInactiveUsers: "Excluir usuários inativos" - withReplies: "Incluir respostas de usuários importados na linha do tempo" _charts: federation: "União" - apRequest: "Solicitações" - usersIncDec: "Diferença no número de usuários" - usersTotal: "Número total de usuários" - activeUsers: "Usuários ativos" - notesIncDec: "Diferença no número de notas" - localNotesIncDec: "Diferença no número de notas locais" - remoteNotesIncDec: "Diferença no número de notas remotas" - notesTotal: "Número total de notas" - filesIncDec: "Diferença no número de arquivos" - filesTotal: "Número total de arquivos" - storageUsageIncDec: "Diferença no uso de armazenamento" - storageUsageTotal: "Uso total de armazenamento" -_instanceCharts: - requests: "Solicitações" - users: "Diferença no número de usuários" - usersTotal: "Número cumulativo de usuários" - notes: "Diferença no número de notas" - notesTotal: "Número cumulativo de notas" - ff: "Diferença entre número de usuários seguidos/seguidores" - ffTotal: "Número cumulativo de usuários seguidos/seguidores" - cacheSize: "Diferença do tamanho do cache" - cacheSizeTotal: "Tamanho cumulativo do cache" - files: "Diferença no número de arquivos" - filesTotal: "Número cumulativo de arquivos" _timelines: home: "Início" - local: "Local" - social: "Social" - global: "Global" _play: new: "Criar Play" edit: "Editar Play" @@ -2270,66 +1416,18 @@ _play: deleted: "Play foi excluído" pageSetting: "Configurações do Play" editThisPage: "Editar este Play" - viewSource: "Ver fonte" my: "Meus Plays" liked: "Plays curtidos" - featured: "Popular" - title: "Título" script: "Script" summary: "Descrição" - visibilityDescription: "Pôr em privado significa que ele não será visível no perfil, mas qualquer um com o URL poderá acessar" _pages: - newPage: "Criar uma Página" - editPage: "Editar essa Página" - readPage: "Ver a fonte dessa Página" - created: "Página criada com sucesso" - updated: "Página atualizada com sucesso" deleted: "Página excluída com sucesso" - pageSetting: "Configurações da página" - nameAlreadyExists: "O URL de Página especificado já existe" - invalidNameTitle: "O URL de Página especificado é inválido" - invalidNameText: "Confira se o título da Página não está vazio" - editThisPage: "Editar essa Página" - viewSource: "Ver código-fonte" viewPage: "Visualizar as suas páginas" like: "Curtir" unlike: "Remover curtida" - my: "Minhas Páginas" liked: "Páginas curtidas" - featured: "Populares" - inspector: "Inspetor" - contents: "Conteúdo" - content: "Bloco da Página" - variables: "Variáveis" - title: "Título" - url: "URL da Página" - summary: "Resumo da página" - alignCenter: "Centralizar elementos" - hideTitleWhenPinned: "Esconder título da Página quando fixado em perfil" - font: "Fonte" - fontSerif: "Serif" - fontSansSerif: "Sans Serif" - eyeCatchingImageSet: "Escolher miniatura" - eyeCatchingImageRemove: "Excluir miniatura" - chooseBlock: "Adicionar bloco" - enterSectionTitle: "Insira um título à seção" - selectType: "Selecionar um tipo" - contentBlocks: "Conteúdo" - inputBlocks: "Inserir" - specialBlocks: "Especial" blocks: - text: "Texto" - textarea: "Área do texto" - section: "Seção" image: "imagem" - button: "Botão" - dynamic: "Blocos Dinâmicos" - dynamicDescription: "Esse bloco foi abolido. Por favor, use {play} de agora em diante." - note: "Nota embutida" - _note: - id: "ID da nota" - idDescription: "Você também pode colar o URL da nota aqui." - detailed: "Visão detalhada" _relayStatus: requesting: "Pendente" accepted: "Aprovado" @@ -2344,35 +1442,18 @@ _notification: youReceivedFollowRequest: "Você recebeu um pedido de seguidor" yourFollowRequestAccepted: "Seu pedido de seguidor foi aceito" pollEnded: "Os resultados da enquete agora estão disponíveis" - newNote: "Nova nota" - unreadAntennaNote: "Antena {name}" - roleAssigned: "Cargo dado" emptyPushNotificationMessage: "As notificações de alerta foram atualizadas" - achievementEarned: "Conquista desbloqueada" - testNotification: "Notificação teste" - checkNotificationBehavior: "Verificar aparência da notificação" - sendTestNotification: "Enviar notificação de teste" - notificationWillBeDisplayedLikeThis: "Notificações se parecem com isso" - reactedBySomeUsers: "{n} usuários reagiram" - likedBySomeUsers: "{n} usuários gostaram da nota" - renotedBySomeUsers: "{n} usuários repostaram a nota" - followedBySomeUsers: "{n} usuários te seguiram" - flushNotification: "Limpar notificações" _types: all: "Todas" - note: "Novas notas" follow: "Seguindo" mention: "Menção" reply: "Respostas" renote: "Repostar" - quote: "Citações" + quote: "Citar" reaction: "Reações" pollEnded: "Enquetes terminando" receiveFollowRequest: "Recebeu pedidos de seguidor" followRequestAccepted: "Aceitou pedidos de seguidor" - roleAssigned: "Cargo dado" - achievementEarned: "Conquista desbloqueada" - login: "Iniciar sessão" app: "Notificações de aplicativos conectados" _actions: followBack: "te seguiu de volta" @@ -2382,23 +1463,13 @@ _deck: alwaysShowMainColumn: "Sempre mostrar a coluna principal" columnAlign: "Alinhar colunas" addColumn: "Adicionar coluna" - newNoteNotificationSettings: "Opções de notificação para novas notas" - configureColumn: "Configurar coluna" swapLeft: "Trocar de posição com a coluna à esquerda" swapRight: "Trocar de posição com a coluna à direita" swapUp: "Trocar de posição com a coluna acima" swapDown: "Trocar de posição com a coluna abaixo" - stackLeft: "Empilhar na coluna à esquerda" popRight: "Acoplar coluna à direita" profile: "Perfil" - newProfile: "Novo perfil" deleteProfile: "Remover perfil" - introduction: "Crie a interface perfeita para você arranjando as colunas livremente!" - introduction2: "Clique no + à direita da tela para adicionar novas colunas quando quiser." - widgetsIntroduction: "Por favor, selecione \"Editar widgets\" no menu em coluna e adicione um widget." - useSimpleUiForNonRootPages: "Usar UI simples para páginas navegadas" - usedAsMinWidthWhenFlexible: "A largura mínima será usada para isso quando o \"Ajuste automático da largura\" estiver ativado" - flexible: "Ajuste automático da largura" _columns: main: "Principal" widgets: "Widgets" @@ -2410,230 +1481,16 @@ _deck: mentions: "Menções" direct: "Notas diretas" roleTimeline: "Linha do tempo do cargo" -_dialog: - charactersExceeded: "Você excedeu o limite de caracteres! Atualmente em {current} de {max}." - charactersBelow: "Você está abaixo do limite mínimo de caracteres! Atualmente em {current} of {min}." -_disabledTimeline: - title: "Linha do tempo desabilitada" - description: "Você não pode acessar essa linha do tempo sob o seu cargo atual." _drivecleaner: orderBySizeDesc: "Tamanho descendente" orderByCreatedAtAsc: "Data ascendente" _webhookSettings: - createWebhook: "Criar Webhook" - modifyWebhook: "Modificar Webhook" name: "Nome" - secret: "Segredo" - trigger: "Gatilho" active: "Ativado" _events: follow: "Quando seguindo um usuário" followed: "Quando sendo seguido" - note: "Ao postar uma nota" - reply: "Quando receber uma resposta" renote: "Quando repostado" - reaction: "Quando receber uma reação" - mention: "Quando for mencionado" - _systemEvents: - abuseReport: "Quando receber um relatório de abuso" - abuseReportResolved: "Quando relatórios de abuso forem resolvidos " - userCreated: "Quando um usuário é criado" - deleteConfirm: "Você tem certeza de que deseja excluir o Webhook?" -_abuseReport: - _notificationRecipient: - createRecipient: "Adicionar destinatário para relatórios de abuso" - modifyRecipient: "Editar destinatários para relatórios de abuso" - recipientType: "TIpo de notificação" - _recipientType: - mail: "E-mail" - webhook: "Webhook" - _captions: - mail: "Enviar o email aos endereços dos moderadores ao receber relatório de abuso." - webhook: "Enviar uma notificação ao SystemWebhook quando você receber um resolver um relatório de abuso." - keywords: "Palavras-chave" - notifiedUser: "Usuários para notificar" - notifiedWebhook: "Webhook usado" - deleteConfirm: "Você tem certeza de que quer excluir o destinatário da notificação?" _moderationLogTypes: - createRole: "Cargo criado" - deleteRole: "Cargo excluído" - updateRole: "Cargo atualizado" - assignRole: "Cargo atribuído" - unassignRole: "Cargo removido" suspend: "Suspender" - unsuspend: "Suspensão cancelada" - addCustomEmoji: "Emoji personalizado adicionado" - updateCustomEmoji: "Emoji personalizado atualizado" - deleteCustomEmoji: "Emoji personalizado removido" - updateServerSettings: "Configurações de servidor atualizadas" - updateUserNote: "Nota de moderação atualizada" - deleteDriveFile: "Arquivo excluído" - deleteNote: "Nota excluída" - createGlobalAnnouncement: "Anúncio global criado" - createUserAnnouncement: "Anúncio de usuário criado" - updateGlobalAnnouncement: "Anúncio global atualizado" - updateUserAnnouncement: "Anúncio de usuário atualizado" - deleteGlobalAnnouncement: "Anúncio global excluído" - deleteUserAnnouncement: "Anúncio de usuário excluído" resetPassword: "Redefinir senha" - suspendRemoteInstance: "Instância remota suspensa" - unsuspendRemoteInstance: "Suspensão de instância remota removida" - updateRemoteInstanceNote: "Nota de moderação atualizada para instância remota." - markSensitiveDriveFile: "Arquivo marcado como sensível" - unmarkSensitiveDriveFile: "Arquivo desmarcado como sensível" - resolveAbuseReport: "Relatório resolvido" - createInvitation: "Convite gerado" - createAd: "Propaganda criada" - deleteAd: "Propaganda excluída" - updateAd: "Propaganda atualizada" - createAvatarDecoration: "Decoração de avatar criada" - updateAvatarDecoration: "Decoração de avatar atualizada" - deleteAvatarDecoration: "Decoração de avatar removida" - unsetUserAvatar: "Remover avatar de usuário" - unsetUserBanner: "Remover banner de usuário" - createSystemWebhook: "Criar SystemWebhook" - updateSystemWebhook: "Atualizar SystemWebhook" - deleteSystemWebhook: "Remover SystemWebhook" - createAbuseReportNotificationRecipient: "Criar um destinatário para relatórios de abuso" - updateAbuseReportNotificationRecipient: "Atualizar destinatários para relatórios de abuso" - deleteAbuseReportNotificationRecipient: "Remover um destinatário para relatórios de abuso" - deleteAccount: "Remover conta" - deletePage: "Remover página" - deleteFlash: "Remover Play" - deleteGalleryPost: "Remover a publicação da galeria" -_fileViewer: - title: "Detalhes do arquivo" - type: "Tipo de arquivo" - size: "Tamanho do arquivo" - url: "URL" - uploadedAt: "Adicionado em" - attachedNotes: "Notas anexadas" - thisPageCanBeSeenFromTheAuthor: "Essa página só pode ser vista pelo usuário que enviou esse arquivo." -_externalResourceInstaller: - title: "Instalar de site externo" - checkVendorBeforeInstall: "Tenha certeza de que o distribuidor desse recurso é confiável antes da instalação." - _plugin: - title: "Deseja instalar esse plugin?" - metaTitle: "Informações do plugin" - _theme: - title: "Deseja instalar esse tema?" - metaTitle: "Informações do tema" - _meta: - base: "Paleta de cores base" - _vendorInfo: - title: "Informações do distribuidor" - endpoint: "Endpoint referenciado" - hashVerify: "Verificação de hashes" - _errors: - _invalidParams: - title: "Parâmetros inválidos" - description: "Não há informações suficientes para carregar dados do site externo. Por favor, confirme o URL inserido." - _resourceTypeNotSupported: - title: "Esse recurso externo é incompatível" - description: "Esse tipo de recuso externo é incompatível. Por favor, comunique o administrador do site." - _failedToFetch: - title: "Não foi possível obter dados" - fetchErrorDescription: "Houve um erro ao comunicar com o site externo. Se tentar novamente não resolver o problema, contate o administrador do site." - parseErrorDescription: "Houve um erro processando os dados do site externo. Por favor, contate o administrador do site." - _hashUnmatched: - title: "Verificação de dados falhou" - description: "Houve um erro verificando a integridade do conteúdo obtido. Como medida de segurança, a instalação foi interrompida. Por favor, contate o administrador do site." - _pluginParseFailed: - title: "Erro AiScript" - description: "Os dados solicitados foram obtidos com sucesso, mas houve um erro na leitura do AiScript. Por favor, contate o autor do plugin. Detalhes de erro podem ser vistos no console Javascript." - _pluginInstallFailed: - title: "A instalação do plugin falhou." - description: "Houve um problema na instalação do plugin. Por favor, tente novamente. Detalhes de erro podem ser vistos no console Javascript." - _themeParseFailed: - title: "Erro na leitura do tema" - description: "Os dados solicitados foram obtidos com sucesso, mas houve um erro na leitura do tema. Por favor, contate o autor do tema. Detalhes de erro podem ser vistos no console Javascript." - _themeInstallFailed: - title: "Falha ao instalar tema" - description: "Houve um problema na instalação do tema. Por favor, tente novamente. Detalhes do erro podem ser vistos no console Javascript." -_dataSaver: - _media: - title: "Carregando mídia" - description: "Previne que mídia seja carregada automaticamente. Mídias escondidas serão carregadas quando selecionadas." - _avatar: - title: "Imagem do avatar" - description: "Parar animação de avatares. Imagens animadas podem ter um arquivo mais pesado do que imagens normais, potencialmente levando a reduções no tráfego de dados." - _urlPreview: - title: "Miniaturas na prévia de URLs" - description: "Miniaturas na prévia de URLs não serão mais carregadas." - _code: - title: "Destaque de código" - description: "Se as notações de formatação de código forem utilizadas em MFM, elas não irão carregar até serem selecionadas. Destaque de código exige baixar arquivos de alta definição para cada linguagem de programação. Logo, desabilitar o carregamento automático desses arquivos diminui a quantidade de informação comunicada." -_hemisphere: - N: "Hemisfério Norte" - S: "Hemisfério Sul" - caption: "Utilizado em algumas configurações de aplicativo para determinar a estação do ano." -_reversi: - reversi: "Reversi" - gameSettings: "Configurações de jogo" - chooseBoard: "Escolha um tabuleiro" - blackOrWhite: "Preto/Branco" - blackIs: "{name} é as peças Pretas" - rules: "Regras" - thisGameIsStartedSoon: "O jogo começará em breve" - waitingForOther: "Esperando o turno do oponente" - waitingForMe: "Esperando o seu turno" - waitingBoth: "Prepare-se" - ready: "Pronto" - cancelReady: "Não pronto" - opponentTurn: "Turno do oponente" - myTurn: "Seu turno" - turnOf: "É o turno de {name}" - pastTurnOf: "Turno de {name}" - surrender: "Desistir" - surrendered: "Desistiu" - timeout: "Fim do tempo" - drawn: "Empate" - won: "{name} venceu" - black: "Preto" - white: "Branco" - total: "Total" - turnCount: "Turno {count}" - myGames: "Meus jogos" - allGames: "Todos os jogos" - ended: "Terminado" - playing: "Atualmente jogando" - isLlotheo: "Aquele com menos pedras vence (Llotheo)" - loopedMap: "Mapa em ‘loop’" - canPutEverywhere: "É possível pôr em qualquer lugar" - timeLimitForEachTurn: "Tempo limite por turno" - freeMatch: "Partida Livre" - lookingForPlayer: "À procura de adversários..." - gameCanceled: "A partida foi cancelada." - shareToTlTheGameWhenStart: "Compartilhar jogo na linha do tempo ao iniciar" - iStartedAGame: "O jogo começou! #MisskeyReversi" - opponentHasSettingsChanged: "O oponente alterou as configurações dele" - allowIrregularRules: "Regras irregulares (completamente livre)" - disallowIrregularRules: "Sem regras irregulares" - showBoardLabels: "Exibir numeração de linha e coluna no tabuleiro" - useAvatarAsStone: "Utilizar avatares de usuário como as pedras" -_offlineScreen: - title: "Offline - não foi possível conectar ao servidor" - header: "Não foi possível conectar ao servidor" -_urlPreviewSetting: - title: "Configurações da prévia de URL" - enable: "Habilitar prévia de URL" - timeout: "Tempo máximo para obter a prévia (ms)" - timeoutDescription: "Se demorar mais que esse valor para obter uma prévia, ela não será gerada." - maximumContentLength: "Content-Length máximo (em bytes)" - maximumContentLengthDescription: "Se o Content-Length for maior que esse valor, a prévia não será gerada." - requireContentLength: "Gerar previu apenas se houver cabeçalho Content-Length disponível na solicitação" - requireContentLengthDescription: "Se o outro servidor não retornar um cabeçalho Content-Length, a prévia não será gerada." - userAgent: "User-Agent" - userAgentDescription: "Define o User-Agent a ser usado ao gerar prévias. Se for deixado em branco, será usado o User-Agent padrão." - summaryProxy: "Endpoints do Proxy que geram prévias" - summaryProxyDescription: "Fora do Misskey, gerar prévias usando o Sumally Proxy." - summaryProxyDescription2: "Os parâmetros a seguir são vinculados ao proxy como um 'query string'. Se o proxy não os suportar, os valores serão ignorados." -_mediaControls: - pip: "Picture-in-Picture" - playbackRate: "Velocidade de Reprodução" - loop: "Reprodução em Loop" -_contextMenu: - title: "Menu de contexto" - app: "Aplicativo" - appWithShift: "Aplicativo com a tecla shift" - native: "Nativo" diff --git a/locales/ro-RO.yml b/locales/ro-RO.yml index 3cc09aa5c2..10be9539cf 100644 --- a/locales/ro-RO.yml +++ b/locales/ro-RO.yml @@ -359,8 +359,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Activează hCaptcha" hcaptchaSiteKey: "Site key" hcaptchaSecretKey: "Secret key" -mcaptchaSiteKey: "Site key" -mcaptchaSecretKey: "Secret key" recaptcha: "reCAPTCHA" enableRecaptcha: "Activează reCAPTCHA" recaptchaSiteKey: "Site key" @@ -453,6 +451,7 @@ or: "Sau" language: "Limbă" uiLanguage: "Limba interfeței" aboutX: "Despre {x}" +disableDrawer: "Nu folosi meniuri în stil sertar" noHistory: "Nu există istoric" signinHistory: "Istoric autentificări" doing: "Se procesează..." @@ -625,7 +624,10 @@ abuseReported: "Raportul tău a fost trimis. Mulțumim." reporter: "Raportorul" reporteeOrigin: "Originea raportatului" reporterOrigin: "Originea raportorului" +forwardReport: "Redirecționează raportul către instanța externă" +forwardReportIsAnonymous: "În locul contului tău, va fi afișat un cont anonim, de sistem, ca raportor către instanța externă." send: "Trimite" +abuseMarkAsResolved: "Marchează raportul ca rezolvat" openInNewTab: "Deschide în tab nou" openInSideView: "Deschide în vedere laterală" defaultNavigationBehaviour: "Comportament de navigare implicit" @@ -647,10 +649,6 @@ show: "Arată" icon: "Avatar" replies: "Răspunde" renotes: "Re-notează" -_delivery: - stop: "Suspendat" - _type: - none: "Publicare" _role: _priority: middle: "Mediu" @@ -711,7 +709,6 @@ _notification: renote: "Re-notează" quote: "Citează" reaction: "Reacție" - login: "Autentifică-te" _actions: reply: "Răspunde" renote: "Re-notează" @@ -725,12 +722,6 @@ _deck: mentions: "Mențiuni" _webhookSettings: name: "Nume" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "Email" _moderationLogTypes: suspend: "Suspendă" resetPassword: "Resetează parola" -_reversi: - total: "Total" diff --git a/locales/ru-RU.yml b/locales/ru-RU.yml index 8174675880..25f409df92 100644 --- a/locales/ru-RU.yml +++ b/locales/ru-RU.yml @@ -2,26 +2,23 @@ _lang_: "Русский" headlineMisskey: "Сеть, сплетённая из заметок" introMisskey: "Добро пожаловать! Misskey — это децентрализованный сервис микроблогов с открытым исходным кодом.\nПишите «заметки» — делитесь со всеми происходящим вокруг или рассказывайте о себе 📡\nСтавьте «реакции» — выражайте свои чувства и эмоции от заметок других 👍\nОткройте для себя новый мир 🚀" -poweredByMisskeyDescription: "{name} – сервис на платформе с открытым исходным кодом Misskey, называемый экземпляром Misskey." +poweredByMisskeyDescription: "{name} – сервис на платформе с открытым исходным кодом Misskey, называемый инстансом Misskey." monthAndDay: "{day}.{month}" search: "Поиск" notifications: "Уведомления" username: "Имя пользователя" password: "Пароль" -initialPasswordForSetup: "Пароль для начала настройки" -initialPasswordIsIncorrect: "Пароль для запуска настройки неверен" -initialPasswordForSetupDescription: "Если вы установили Misskey самостоятельно, используйте пароль, который вы указали в файле конфигурации.\nЕсли вы используете что-то вроде хостинга Misskey, используйте предоставленный пароль.\nЕсли вы не установили пароль, оставьте его пустым и продолжайте." forgotPassword: "Забыли пароль?" fetchingAsApObject: "Приём с других сайтов" -ok: "Подтвердить" +ok: "Окей" gotIt: "Ясно!" cancel: "Отмена" noThankYou: "Нет, спасибо" enterUsername: "Введите имя пользователя" -renotedBy: "{user} репостнул(а)" +renotedBy: "{user} делится" noNotes: "Нет ни одной заметки" -noNotifications: "Нет уведомлений" -instance: "Экземпляр" +noNotifications: "Нет ни одного уведомления" +instance: "Инстанс" settings: "Настройки" notificationSettings: "Настройки уведомлений" basicSettings: "Основные настройки" @@ -48,24 +45,22 @@ pin: "Закрепить в профиле" unpin: "Открепить от профиля" copyContent: "Скопировать содержимое" copyLink: "Скопировать ссылку" -copyLinkRenote: "Скопировать ссылку на репост" delete: "Удалить" deleteAndEdit: "Удалить и отредактировать" -deleteAndEditConfirm: "Удалить этот пост и отредактировать заново? Все реакции, репосты и ответы на него также будут удалены." +deleteAndEditConfirm: "Удалить эту заметку и создать отредактированную? Все реакции, ссылки и ответы на существующую будут будут потеряны." addToList: "Добавить в список" addToAntenna: "Добавить к антенне" sendMessage: "Отправить сообщение" copyRSS: "Скопировать RSS" copyUsername: "Скопировать имя пользователя" copyUserId: "Скопировать ID пользователя" -copyNoteId: "Скопировать ID поста" +copyNoteId: "Скопировать ID заметки" copyFileId: "Скопировать ID файла" copyFolderId: "Скопировать ID папки" -copyProfileUrl: "Скопировать ссылку на профиль" +copyProfileUrl: "Скопировать URL профиля " searchUser: "Поиск людей" -searchThisUsersNotes: "Искать по заметкам пользователя" reply: "Ответ" -loadMore: "Загрузить ещё" +loadMore: "Показать еще" showMore: "Показать ещё" showLess: "Закрыть" youGotNewFollower: "Новый подписчик" @@ -112,14 +107,11 @@ enterEmoji: "Введите эмодзи" renote: "Репост" unrenote: "Отмена репоста" renoted: "Репост совершён." -renotedToX: "Репостнуть в {name}." cantRenote: "Это нельзя репостить." cantReRenote: "Невозможно репостить репост." quote: "Цитата" inChannelRenote: "В канале" inChannelQuote: "Заметки в канале" -renoteToChannel: "Репостнуть в канал" -renoteToOtherChannel: "Репостнуть в другой канал" pinnedNote: "Закреплённая заметка" pinned: "Закрепить в профиле" you: "Вы" @@ -137,14 +129,13 @@ overwriteFromPinnedEmojis: "Заменить на эмодзи из общего reactionSettingDescription2: "Расставляйте перетаскиванием, удаляйте нажатием, добавляйте кнопкой «+»." rememberNoteVisibility: "Запоминать видимость заметок" attachCancel: "Удалить вложение" -deleteFile: "Удалить файл" markAsSensitive: "Отметить как «не для всех»" unmarkAsSensitive: "Снять отметку «не для всех»" enterFileName: "Введите имя файла" mute: "Скрыть" unmute: "Отменить скрытие" -renoteMute: "Скрыть репосты" -renoteUnmute: "Открыть репосты" +renoteMute: "Заглушить репосты" +renoteUnmute: "Включить репосты" block: "Заблокировать" unblock: "Разблокировать" suspend: "Заморозить" @@ -158,7 +149,6 @@ editList: "Редактировать список" selectChannel: "Выберите канал" selectAntenna: "Выберите антенну" editAntenna: "Редактировать антенну" -createAntenna: "Создать антенну" selectWidget: "Выберите виджет" editWidgets: "Редактировать виджеты" editWidgetsExit: "Готово" @@ -166,14 +156,13 @@ customEmojis: "Собственные эмодзи" emoji: "Эмодзи" emojis: "Эмодзи" emojiName: "Название эмодзи" -emojiUrl: "Ссылка на эмодзи" +emojiUrl: "URL эмодзи" addEmoji: "Добавить эмодзи" settingGuide: "Рекомендуемые настройки" cacheRemoteFiles: "Кешировать внешние файлы" cacheRemoteFilesDescription: "Когда эта настройка отключена, файлы с других сайтов будут загружаться прямо оттуда. Это сэкономит место на сервере, но увеличит трафик, так как не будут создаваться эскизы." -youCanCleanRemoteFilesCache: "Вы можете очистить кэш, нажав на кнопку 🗑️ в меню управления файлами." -cacheRemoteSensitiveFiles: "Кэшировать внешние файлы «не для всех»" -cacheRemoteSensitiveFilesDescription: "Если отключено, файлы «не для всех» загружаются непосредственно с удалённых серверов, не кэшируясь." +cacheRemoteSensitiveFiles: "Кешировать внешние файлы" +cacheRemoteSensitiveFilesDescription: "Описание удаленных внешних файлов в кэше" flagAsBot: "Аккаунт бота" flagAsBotDescription: "Включите, если этот аккаунт управляется программой. Это позволит системе Misskey учитывать это, а также поможет разработчикам других ботов предотвратить бесконечные циклы взаимодействия." flagAsCat: "Аккаунт кота" @@ -185,10 +174,6 @@ addAccount: "Добавить учётную запись" reloadAccountsList: "Обновить список учётных записей" loginFailed: "Неудачная попытка входа" showOnRemote: "Перейти к оригиналу на сайт" -continueOnRemote: "Продолжить на удалённом сервере" -chooseServerOnMisskeyHub: "Выбрать сервер с Misskey Hub" -specifyServerHost: "Укажите сервер напрямую" -inputHostName: "Введите домен" general: "Общее" wallpaper: "Обои" setWallpaper: "Установить обои" @@ -199,7 +184,6 @@ followConfirm: "Подписаться на {name}?" proxyAccount: "Учётная запись прокси" proxyAccountDescription: "Учетная запись прокси предназначена служить подписчиком на пользователей с других сайтов. Например, если пользователь добавит кого-то с другого сайта а список, деятельность того не отобразится, пока никто с этого же сайта не подписан на него. Чтобы это стало возможным, на него подписывается прокси." host: "Хост" -selectSelf: "Выбрать себя" selectUser: "Выберите пользователя" recipient: "Кому" annotation: "Описание" @@ -214,7 +198,6 @@ perHour: "По часам" perDay: "По дням" stopActivityDelivery: "Остановить отправку обновлений активности" blockThisInstance: "Блокировать этот инстанс" -silenceThisInstance: "Заглушить этот инстанс" operations: "Операции" software: "Программы" version: "Версия" @@ -234,8 +217,6 @@ clearCachedFiles: "Очистить кэш" clearCachedFilesConfirm: "Удалить все закэшированные файлы с других сайтов?" blockedInstances: "Заблокированные инстансы" blockedInstancesDescription: "Введите список инстансов, которые хотите заблокировать. Они больше не смогут обмениваться с вашим инстансом." -silencedInstances: "Заглушённые инстансы" -federationAllowedHosts: "Серверы, поддерживающие федерацию" muteAndBlock: "Скрытие и блокировка" mutedUsers: "Скрытые пользователи" blockedUsers: "Заблокированные пользователи" @@ -254,7 +235,7 @@ noJobs: "Нет заданий" federating: "Федерируется" blocked: "Заблокировано" suspended: "Заморожено" -all: "Все" +all: "Всё" subscribing: "Подписка" publishing: "Публикация" notResponding: "Нет ответа" @@ -280,13 +261,12 @@ removed: "Удалено" removeAreYouSure: "Хотите удалить «{x}»?" deleteAreYouSure: "Хотите удалить «{x}»?" resetAreYouSure: "На самом деле сбросить?" -areYouSure: "Вы уверены?" saved: "Сохранено" messaging: "Сообщения" upload: "Загрузить" keepOriginalUploading: "Сохранить исходное изображение" keepOriginalUploadingDescription: "Сохраняет исходную версию при загрузке изображений. Если выключить, то при загрузке браузер генерирует изображение для публикации." -fromDrive: "С Диска" +fromDrive: "С «диска»" fromUrl: "По ссылке" uploadFromUrl: "Загрузить по ссылке" uploadFromUrlDescription: "Ссылка на файл, который хотите загрузить" @@ -298,7 +278,7 @@ noMoreHistory: "История закончилась" startMessaging: "Начать общение" nUsersRead: "Прочитали {n}" agreeTo: "Я соглашаюсь с {0}" -agree: "Согласен" +agree: "Согласиться" agreeBelow: "Согласен со следующими" basicNotesBeforeCreateAccount: "Записи, перед созданием аккаунта" termsOfService: "Условия использования" @@ -326,15 +306,12 @@ selectFile: "Выберите файл" selectFiles: "Выберите файлы" selectFolder: "Выберите папку" selectFolders: "Выберите папки" -fileNotSelected: "Файл не выбран" renameFile: "Переименовать файл" folderName: "Имя папки" createFolder: "Создать папку" renameFolder: "Переименовать папку" deleteFolder: "Удалить папку" -folder: "Папка" addFile: "Добавить файл" -showFile: "Посмотреть файл" emptyDrive: "Диск пуст" emptyFolder: "Папка пуста" unableToDelete: "Удаление невозможно" @@ -347,7 +324,7 @@ copyUrl: "Копировать ссылку" rename: "Переименовать" avatar: "Аватар" banner: "Шапка" -displayOfSensitiveMedia: "Отображение содержимого не для всех" +displayOfSensitiveMedia: "Определение деликатного контента" whenServerDisconnected: "Когда соединение с сервером потеряно" disconnectedFromServer: "Разорвано соединение с сервером" reload: "Перезагрузить" @@ -379,8 +356,8 @@ disablingTimelinesInfo: "У администраторов и модератор registration: "Регистрация" enableRegistration: "Разрешить регистрацию" invite: "Пригласить" -driveCapacityPerLocalAccount: "Объём Диска на одного локального пользователя" -driveCapacityPerRemoteAccount: "Объём Диска на одного пользователя с другого экземпляра" +driveCapacityPerLocalAccount: "Объём диска на одного локального пользователя" +driveCapacityPerRemoteAccount: "Объём диска на одного пользователя с другого сайта" inMb: "В мегабайтах" bannerUrl: "Ссылка на изображение в шапке" backgroundImageUrl: "Ссылка на фоновое изображение" @@ -395,11 +372,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Включить hCaptcha" hcaptchaSiteKey: "Ключ сайта" hcaptchaSecretKey: "Секретный ключ" -mcaptcha: "mCaptcha" -enableMcaptcha: "Включить mCaptcha" -mcaptchaSiteKey: "Ключ сайта" -mcaptchaSecretKey: "Секретный ключ" -mcaptchaInstanceUrl: "Ссылка на сервер mCaptcha" recaptcha: "reCAPTCHA" enableRecaptcha: "Включить reCAPTCHA" recaptchaSiteKey: "Ключ сайта" @@ -414,8 +386,7 @@ manageAntennas: "Настройки антенн" name: "Название" antennaSource: "Источник антенны" antennaKeywords: "Ключевые слова" -antennaExcludeKeywords: "Чёрный список слов" -antennaExcludeBots: "Исключать ботов" +antennaExcludeKeywords: "Исключения" antennaKeywordsDescription: "Пишите слова через пробел в одной строке, чтобы ловить их появление вместе; на отдельных строках располагайте слова, или группы слов, чтобы ловить любые из них." notifyAntenna: "Уведомлять о новых заметках" withFileAntenna: "Только заметки с вложениями" @@ -442,14 +413,12 @@ about: "Описание" aboutMisskey: "О Misskey" administrator: "Администратор" token: "Токен" -2fa: "Двухфакторная аутентификация" +2fa: "2-х факторная аутентификация" setupOf2fa: "Настроить двухфакторную аутентификацию" totp: "Приложение-аутентификатор" totpDescription: "Описание приложения-аутентификатора" moderator: "Модератор" moderation: "Модерация" -moderationNote: "Примечания модератора" -moderationLogs: "Журнал модерации" nUsersMentioned: "Упомянуло пользователей: {n}" securityKeyAndPasskey: "Ключ безопасности и парольная фраза" securityKey: "Ключ безопасности" @@ -482,12 +451,10 @@ retype: "Введите ещё раз" noteOf: "Что пишет {user}" quoteAttached: "Цитата" quoteQuestion: "Хотите добавить цитату?" -attachAsFileQuestion: "Текста в буфере обмена слишком много. Прикрепить как текстовый файл?" noMessagesYet: "Пока ни одного сообщения" newMessageExists: "Новое сообщение" onlyOneFileCanBeAttached: "К сообщению можно прикрепить только один файл" signinRequired: "Пожалуйста, войдите" -signinOrContinueOnRemote: "Чтобы продолжить, вам необходимо войти в аккаунт на своём сервере или зарегистрироваться / войти в аккаунт на этом." invitations: "Приглашения" invitationCode: "Код приглашения" checking: "Проверка" @@ -497,7 +464,7 @@ usernameInvalidFormat: "Можно использовать только лат tooShort: "Слишком короткий" tooLong: "Слишком длинный" weakPassword: "Слабый пароль" -normalPassword: "Хороший пароль" +normalPassword: "Годный пароль" strongPassword: "Надёжный пароль" passwordMatched: "Совпали" passwordNotMatched: "Не совпадают" @@ -509,10 +476,8 @@ uiLanguage: "Язык интерфейса" aboutX: "Описание {x}" emojiStyle: "Стиль эмодзи" native: "Системные" -menuStyle: "Стиль меню" -style: "Стиль" -showNoteActionsOnlyHover: "Показывать кнопки у заметок только при наведении" -showReactionsCount: "Видеть количество реакций на заметках" +disableDrawer: "Не использовать выдвижные меню" +showNoteActionsOnlyHover: "Показывать кнопки управления заметкой только при наведении" noHistory: "История пока пуста" signinHistory: "Журнал посещений" enableAdvancedMfm: "Включить расширенный MFM" @@ -525,8 +490,8 @@ createAccount: "Новая учётная запись" existingAccount: "Существующая учётная запись" regenerate: "Создать повторно" fontSize: "Размер шрифта" -mediaListWithOneImageAppearance: "Вид изображения, если оно единственное в списке" -limitTo: "Ограничить до {x}" +mediaListWithOneImageAppearance: "Показывать список медиа только одним изображением" +limitTo: "Обрезать до {x}" noFollowRequests: "Нерассмотренные запросы на подписку отсутствуют" openImageInNewTab: "Открыть изображение в новой вкладке" dashboard: "Панель управления" @@ -560,7 +525,7 @@ objectStorageUseSSLDesc: "Отключите, если не собираетес objectStorageUseProxy: "Использовать прокси" objectStorageUseProxyDesc: "Отключите, если не будете испоьзовать прокси для соединений по протоколу ObjectStorage." objectStorageSetPublicRead: "Устанавливать public-read при загрузке на сервер" -s3ForcePathStyleDesc: "Включение s3ForcePathStyle приводит к тому, что имя корзины указывается как часть пути в URL, а не в имени хоста. Может потребоваться включить при использовании локального Minio или чего-то подобного." +s3ForcePathStyleDesc: "Включение s3ForcePathStyle принудительно указывает имя корзины как часть пути в URL-адресе вместо имени хоста. Может потребоваться активация при использовании таких вещей, как локальный Minio." serverLogs: "Журнал сервера" deleteAll: "Удалить всё" showFixedPostForm: "Показывать поле для ввода новой заметки наверху ленты" @@ -574,8 +539,6 @@ showInPage: "Показать страницу" popout: "Развернуть" volume: "Громкость" masterVolume: "Основная регулировка громкости" -notUseSound: "Выключить звук" -useSoundOnlyWhenActive: "Воспроизводить звук только когда Misskey активен." details: "Подробнее" chooseEmoji: "Выберите эмодзи" unableToProcess: "Не удаётся завершить операцию" @@ -596,10 +559,6 @@ output: "Выходы" script: "Скрипт" disablePagesScript: "Отключить скрипты на «Страницах»" updateRemoteUser: "Обновить данные пользователя с его сервера" -unsetUserAvatar: "Убрать аватар" -unsetUserAvatarConfirm: "Вы точно хотите убрать аватар?" -unsetUserBanner: "Убрать баннер" -unsetUserBannerConfirm: "Вы точно хотите убрать баннер?" deleteAllFiles: "Удалить все файлы" deleteAllFilesConfirm: "Вы хотите удалить все файлы?" removeAllFollowing: "Удалить всех подписчиков" @@ -610,7 +569,7 @@ yourAccountSuspendedTitle: "Эта учетная запись заблокир yourAccountSuspendedDescription: "Эта учетная запись была заблокирована из-за нарушения условий предоставления услуг сервера. Свяжитесь с администратором, если вы хотите узнать более подробную причину. Пожалуйста, не создавайте новую учетную запись." tokenRevoked: "Токен недействителен" tokenRevokedDescription: "Срок действия вашего токена входа истек. Пожалуйста, войдите снова." -accountDeleted: "Учетная запись удалена" +accountDeleted: "Эта учетная запись удалена" accountDeletedDescription: "Эта учетная запись удалена" menu: "Меню" divider: "Линия-разделитель" @@ -629,7 +588,7 @@ poll: "Опрос" useCw: "Скрывать содержимое под предупреждением" enablePlayer: "Включить проигрыватель" disablePlayer: "Выключить проигрыватель" -expandTweet: "Развернуть заметку" +expandTweet: "Развернуть твит" themeEditor: "Редактор темы оформления" description: "Описание" describeFile: "Добавить подпись" @@ -641,7 +600,7 @@ plugins: "Расширения" preferencesBackups: "Резервная копия" deck: "Пульт" undeck: "Покинуть пульт" -useBlurEffectForModal: "Размытие за формой ввода заметки" +useBlurEffectForModal: "Размывка под формой поверх всего" useFullReactionPicker: "Полнофункциональный выбор реакций" width: "Ширина" height: "Высота" @@ -650,7 +609,6 @@ medium: "Средне" small: "Мелко" generateAccessToken: "Создать токен доступа" permission: "Разрешения" -adminPermission: "Доступ администратора" enableAll: "Включить все" disableAll: "Выключить всё" tokenRequested: "Открыть доступ к учётной записи" @@ -672,7 +630,6 @@ smtpSecure: "Использовать SSL/TLS для SMTP-соединений" smtpSecureInfo: "Выключите при использовании STARTTLS." testEmail: "Проверка доставки электронной почты" wordMute: "Скрытие слов" -hardWordMute: "Строгое скрытие слов" regexpError: "Ошибка в регулярном выражении" regexpErrorDescription: "В списке {tab} скрытых слов, в строке {line} обнаружена синтаксическая ошибка:" instanceMute: "Глушение инстансов" @@ -694,7 +651,6 @@ useGlobalSettingDesc: "Если включено, будут использов other: "Другие" regenerateLoginToken: "Создать новый токен для входа" regenerateLoginTokenDescription: "Создаёт новый токен, используемый внутри программы во время входа. Обычно в этом нет необходимости. При создании все устройства будут отключены." -theKeywordWhenSearchingForCustomEmoji: "Это ключевое слово будет использовано при поиске эмодзи." setMultipleBySeparatingWithSpace: "Можно написать несколько через пробел" fileIdOrUrl: "Идентификатор файла или ссылка" behavior: "Поведение" @@ -708,7 +664,10 @@ abuseReported: "Жалоба отправлена. Большое спасибо reporter: "Сообщивший" reporteeOrigin: "О ком сообщено" reporterOrigin: "Кто сообщил" +forwardReport: "Отправить жалобу на инстанс автора." +forwardReportIsAnonymous: "Жалоба на удалённый инстанс будет отправлена анонимно. Вместо ваших данных у получателя будет отображена системная учётная запись." send: "Отправить" +abuseMarkAsResolved: "Отметить жалобу как решённую" openInNewTab: "Открыть в новой вкладке" openInSideView: "Открывать в боковой колонке" defaultNavigationBehaviour: "Поведение навигации по умолчанию" @@ -751,7 +710,6 @@ lockedAccountInfo: "Даже если вы вручную подтверждае alwaysMarkSensitive: "Отмечать файлы как «содержимое не для всех» по умолчанию" loadRawImages: "Сразу показывать изображения в полном размере" disableShowingAnimatedImages: "Не проигрывать анимацию" -highlightSensitiveMedia: "Выделять содержимое не для всех" verificationEmailSent: "Вам отправлено письмо для подтверждения. Пройдите, пожалуйста, по ссылке из письма, чтобы завершить проверку." notSet: "Не настроено" emailVerified: "Адрес электронной почты подтверждён." @@ -763,13 +721,13 @@ useSystemFont: "Использовать шрифт, предлагаемый с clips: "Подборки" experimentalFeatures: "Экспериментальные функции" experimental: "Экспериментальные" -thisIsExperimentalFeature: "Это экспериментальная функция. Её поведение, вероятно, поменяется в следующей версии, а ещё она может работать не так, как задумано." +thisIsExperimentalFeature: "Это экспериментальная функция. Технические характеристики могут измениться или он может работать неправильно." developer: "Разработчик" makeExplorable: "Опубликовать профиль в «Обзоре»." makeExplorableDescription: "Если выключить, ваш профиль не будет показан в разделе «Обзор»." showGapBetweenNotesInTimeline: "Показывать разделитель между заметками в ленте" duplicate: "Дубликат" -left: "Слева" +left: "Влево" center: "По центру" wide: "Толстый" narrow: "Тонкий" @@ -848,7 +806,7 @@ noMaintainerInformationWarning: "Не заполнены сведения об noBotProtectionWarning: "Ботозащита не настроена" configure: "Настроить" postToGallery: "Опубликовать в галерею" -postToHashtag: "Написать заметку с этим хештегом" +postToHashtag: "Опубликовать пост с этим хештегом" gallery: "Галерея" recentPosts: "Недавние публикации" popularPosts: "Популярные публикации" @@ -865,35 +823,35 @@ emailNotConfiguredWarning: "Не указан адрес электронной ratio: "Соотношение" previewNoteText: "Предварительный просмотр" customCss: "Индивидуальный CSS" -customCssWarn: "Используйте эту настройку только если знаете, что делаете. Ошибки здесь чреваты тем, что у вас перестанет нормально работать сайт." +customCssWarn: "Используйте эту настройку только если знаете, что делаете. Ошибки здесь чреваты тем, что сайт перестанет нормально работать у вас." global: "Всеобщая" squareAvatars: "Квадратные аватарки" sent: "Отправить" received: "Получено" searchResult: "Результаты поиска" -hashtags: "Хештеги" +hashtags: "Хэштег" troubleshooting: "Разрешение проблем" useBlurEffect: "Размытие в интерфейсе" learnMore: "Подробнее" misskeyUpdated: "Misskey обновился!" whatIsNew: "Что новенького?" -translate: "Перевести" +translate: "Перевод" translatedFrom: "Перевод. Язык оригинала — {x}" accountDeletionInProgress: "В настоящее время выполняется удаление учетной записи" usernameInfo: "Имя, которое отличает вашу учетную запись от других на этом сервере. Вы можете использовать алфавит (a~z, A~Z), цифры (0~9) или символы подчеркивания (_). Имена пользователей не могут быть изменены позже." aiChanMode: "Режим Ай" devMode: "Режим разработчика" -keepCw: "Сохраняйте предупреждения о содержимом" +keepCw: "Сохраняйте Предупреждения о содержимом" pubSub: "Учётные записи Pub/Sub" lastCommunication: "Последнее сообщение" resolved: "Решено" unresolved: "Без решения" breakFollow: "Отписка" -breakFollowConfirm: "Действительно удалить этого подписчика?" +breakFollowConfirm: "Удалить из подписок пользователя ?" itsOn: "Включено" itsOff: "Выключено" -on: "Вкл." -off: "Выкл." +on: "Вкл" +off: "Выкл" emailRequiredForSignup: "Для регистрации учётной записи нужен адрес электронной почты" unread: "Непрочитанное" filter: "Фильтры" @@ -904,8 +862,6 @@ makeReactionsPublicDescription: "Список сделанных вами реа classic: "Классика" muteThread: "Скрыть цепочку" unmuteThread: "Отменить сокрытие цепочки" -followingVisibility: "Видимость подписок" -followersVisibility: "Видимость подписчиков" continueThread: "Показать следующие ответы" deleteAccountConfirm: "Учётная запись будет безвозвратно удалена. Подтверждаете?" incorrectPassword: "Пароль неверен." @@ -924,7 +880,7 @@ numberOfColumn: "Количество столбцов" searchByGoogle: "Поиск" instanceDefaultLightTheme: "Светлая тема по умолчанию" instanceDefaultDarkTheme: "Темная тема по умолчанию" -instanceDefaultThemeDescription: "Введите код темы в формате объекта." +instanceDefaultThemeDescription: "Описание темы по умолчанию для инстанса" mutePeriod: "Продолжительность скрытия" period: "Опрос длится" indefinitely: "вечно" @@ -948,7 +904,7 @@ thereIsUnresolvedAbuseReportWarning: "Остались нерешённые жа recommended: "Рекомендуем" check: "Проверить" driveCapOverrideLabel: "Изменение лимита дискового пространства для этого пользователя" -driveCapOverrideCaption: "Введите нуль или меньше, чтобы использовать значение по умолчанию." +driveCapOverrideCaption: "Укажите меньше или равное нулю для отмены" requireAdminForView: "Для просмотра необходимо иметь аккаунт администратора" isSystemAccount: "Данная учётная запись создана автоматически и управляется системой" typeToConfirm: "Введите {x} для продолжения" @@ -968,7 +924,7 @@ type: "Тип" speed: "Скорость" slow: "Медленная" fast: "Быстрая" -sensitiveMediaDetection: "Распознание содержимого не для всех" +sensitiveMediaDetection: "Определение содержимого деликатного характера" localOnly: "Локально" remoteOnly: "Только удалённо" failedToUpload: "Сбой выгрузки" @@ -1015,7 +971,6 @@ assign: "Назначить" unassign: "Отменить назначение" color: "Цвет" manageCustomEmojis: "Управлять пользовательскими эмодзи" -manageAvatarDecorations: "Управление украшениями аватара" youCannotCreateAnymore: "Вы достигли лимита создания." cannotPerformTemporary: "Временно недоступен" cannotPerformTemporaryDescription: "Это действие временно невозможно выполнить из-за превышения лимита выполнения." @@ -1032,8 +987,7 @@ thisPostMayBeAnnoying: "Это сообщение может быть непри thisPostMayBeAnnoyingHome: "Этот пост может быть отправлен на главную" thisPostMayBeAnnoyingCancel: "Этот пост не может быть отменен." thisPostMayBeAnnoyingIgnore: "Этот пост может быть проигнорирован " -collapseRenotes: "Сворачивать увиденные репосты" -collapseRenotesDescription: "Сворачивать посты с которыми вы взаимодействовали." +collapseRenotes: "Свернуть репосты" internalServerError: "Внутренняя ошибка сервера" internalServerErrorDescription: "Внутри сервера произошла непредвиденная ошибка." copyErrorInfo: "Скопировать код ошибки" @@ -1047,20 +1001,15 @@ invitationRequiredToRegister: "Этот сервер в настоящее вр emailNotSupported: "Доставка почты не поддерживается на этом сервере" postToTheChannel: "Отправить в канал" cannotBeChangedLater: "Это нельзя изменить позже" -reactionAcceptance: "Допустимые реакции" -likeOnly: "Только «нравится!»" -likeOnlyForRemote: "Всё (с других серверов только «нравится!»)" -nonSensitiveOnly: "Только безопасные" -nonSensitiveOnlyForLocalLikeOnlyForRemote: "Только безопасные (с других серверов только «нравится!»)" +reactionAcceptance: "Принятие реакций" +likeOnly: "Только лайки" +likeOnlyForRemote: "Только лайки с удалённых серверов" +nonSensitiveOnly: "Безопасный серфинг" rolesAssignedToMe: "Мои роли" resetPasswordConfirm: "Сбросить пароль?" sensitiveWords: "Чувствительные слова" sensitiveWordsDescription: "Установите общедоступный диапазон заметки, содержащей заданное слово, на домашний. Можно сделать несколько настроек, разделив их переносами строк." sensitiveWordsDescription2: "Разделение пробелом создаёт спецификацию AND, а разделение косой чертой создаёт регулярное выражение." -prohibitedWords: "Запрещённые слова" -prohibitedWordsDescription: "Включает вывод ошибки при попытке опубликовать пост, содержащий указанное слово/набор слов.\nМножество слов может быть указано, разделяемые новой строкой." -prohibitedWordsDescription2: "Разделение пробелом создаёт спецификацию AND, а разделение косой чертой создаёт регулярное выражение." -hiddenTags: "Скрытые хештеги" notesSearchNotAvailable: "Поиск заметок недоступен" license: "Лицензия" unfavoriteConfirm: "Удалить избранное?" @@ -1071,32 +1020,26 @@ retryAllQueuesConfirmTitle: "Хотите попробовать ещё раз?" retryAllQueuesConfirmText: "Нагрузка на сервер может увеличиться" enableChartsForRemoteUser: "Создание диаграмм для удалённых пользователей" enableChartsForFederatedInstances: "Создание диаграмм для удалённых серверов" -showClipButtonInNoteFooter: "Показать кнопку добавления в подборку в меню действий с заметкой" -reactionsDisplaySize: "Размер реакций" -limitWidthOfReaction: "Ограничить максимальную ширину реакций и отображать их в уменьшенном размере." noteIdOrUrl: "ID или ссылка на заметку" video: "Видео" videos: "Видео" -audio: "Звук" -audioFiles: "Звуковые файлы" dataSaver: "Экономия трафика" -accountMigration: "Перенос учётной записи" -accountMoved: "Учётная запись перенесена" +accountMigration: "Перенести учётную запись" +accountMoved: "Учетная запись перенесена" accountMovedShort: "Эта учётная запись перемещена" -operationForbidden: "Это действие запрещено" +operationForbidden: "Эта операция невозможна." forceShowAds: "Всегда отображать рекламу" -addMemo: "Добавить памятку" -editMemo: "Изменить памятку" -reactionsList: "Список реакций" +addMemo: "Добавить заметку" +editMemo: "Редактировать заметку" +reactionsList: "Реакции" renotesList: "Репосты" -notificationDisplay: "Отображение уведомлений" -leftTop: "Слева вверху" -rightTop: "Справа сверху" -leftBottom: "Слева внизу" -rightBottom: "Справа внизу" -stackAxis: "Положение уведомлений" -vertical: "Вертикально" -horizontal: "Горизонтально" +notificationDisplay: "Отображение уведомления" +leftTop: "Верхний левый угол" +rightTop: "Сверху справа" +leftBottom: "Снизу слева" +rightBottom: "Снизу справа" +vertical: "Вертикальная" +horizontal: "Сбоку" position: "Позиция" serverRules: "Правила сервера" pleaseConfirmBelowBeforeSignup: "Для регистрации на данном сервере, необходимо согласится с нижеследующими положениями." @@ -1108,114 +1051,49 @@ createNoteFromTheFile: "Создать заметку из этого файла archive: "Архив" channelArchiveConfirmTitle: "Переместить {name} в архив?" channelArchiveConfirmDescription: "Архивированные каналы перестанут отображаться в списке каналов или результатах поиска. В них также нельзя будет добавлять новые записи." -thisChannelArchived: "Этот канал находится в архиве." displayOfNote: "Отображение заметок" initialAccountSetting: "Настройка профиля" youFollowing: "Подписки" preventAiLearning: "Отказаться от использования в машинном обучении (Генеративный ИИ)" -preventAiLearningDescription: "Запросить краулеров не использовать опубликованный текст или изображения и т.д. для машинного обучения (Прогнозирующий / Генеративный ИИ) датасетов. Это достигается путём добавления \"noai\" HTTP-заголовка в ответ на соответствующий контент. Полного предотвращения через этот заголовок не избежать, так как он может быть просто проигнорирован." options: "Настройки ролей" specifyUser: "Указанный пользователь" -openTagPageConfirm: "Открыть страницу этого хештега?" -specifyHost: "Указать сайт" failedToPreviewUrl: "Предварительный просмотр недоступен" update: "Обновить" rolesThatCanBeUsedThisEmojiAsReaction: "Роли тех, кому можно использовать эти эмодзи как реакцию" rolesThatCanBeUsedThisEmojiAsReactionEmptyDescription: "Если здесь ничего не указать, в качестве реакции эту эмодзи сможет использовать каждый." -rolesThatCanBeUsedThisEmojiAsReactionPublicRoleWarn: "Эти роли должны быть общедоступными." -cancelReactionConfirm: "Вы действительно хотите удалить свою реакцию?" later: "Позже" goToMisskey: "К Misskey" additionalEmojiDictionary: "Дополнительные словари эмодзи" installed: "Установлено" branding: "Бренд" -enableServerMachineStats: "Опубликовать характеристики сервера" enableIdenticonGeneration: "Включить генерацию иконки пользователя" turnOffToImprovePerformance: "Отключение этого параметра может повысить производительность." -createInviteCode: "Создать код приглашения" -createCount: "Количество приглашений" expirationDate: "Дата истечения" -noExpirationDate: "Бессрочно" -unused: "Неиспользованное" -used: "Использован" +unused: "Неиспользуемый" expired: "Срок действия приглашения истёк" doYouAgree: "Согласны?" icon: "Аватар" replies: "Ответы" renotes: "Репост" loadReplies: "Показать ответы" -pinnedList: "Закреплённый список" -keepScreenOn: "Держать экран включённым" -showRenotes: "Показывать репосты" -mutualFollow: "Взаимные подписки" -followingOrFollower: "Подписки или подписчики" -fileAttachedOnly: "Только заметки с файлами" -showRepliesToOthersInTimeline: "Показывать ответы в ленте" -showRepliesToOthersInTimelineAll: "Показывать в ленте ответы пользователей, на которых вы подписаны" -hideRepliesToOthersInTimelineAll: "Скрывать в ленте ответы пользователей, на которых вы подписаны" -sourceCode: "Исходный код" -sourceCodeIsNotYetProvided: "Исходный код пока не доступен. Свяжитесь с администратором, чтобы исправить эту проблему." -repositoryUrl: "Ссылка на репозиторий" -repositoryUrlDescription: "Если вы используете Misskey как есть (без изменений в исходном коде), введите https://github.com/misskey-dev/misskey" -privacyPolicy: "Политика Конфиденциальности" -privacyPolicyUrl: "Ссылка на Политику Конфиденциальности" -attach: "Прикрепить" -angle: "Угол" flip: "Переворот" -disableStreamingTimeline: "Отключить обновление ленты в режиме реального времени" -useGroupedNotifications: "Отображать уведомления сгруппировано" -doReaction: "Добавить реакцию" -code: "Код" -remainingN: "Остаётся: {n}" -seasonalScreenEffect: "Эффект времени года на экране" -decorate: "Украсить" -addMfmFunction: "Добавить MFM" -lastNDays: "Последние {n} сут" -hemisphere: "Место проживания" -enableHorizontalSwipe: "Смахните в сторону, чтобы сменить вкладки" -surrender: "Этот пост не может быть отменен." -useNativeUIForVideoAudioPlayer: "Использовать интерфейс браузера при проигрывании видео и звука" -keepOriginalFilename: "Сохранять исходное имя файла" -keepOriginalFilenameDescription: "Если вы выключите данную настройку, имена файлов будут автоматически заменены случайной строкой при загрузке." -alwaysConfirmFollow: "Всегда подтверждать подписку" -inquiry: "Связаться" -_delivery: - stop: "Заморожено" - _type: - none: "Публикация" -_announcement: - tooManyActiveAnnouncementDescription: "Большое количество оповещений может ухудшить пользовательский опыт. Рассмотрите архивирование неактуальных оповещений. " _initialAccountSetting: accountCreated: "Аккаунт успешно создан!" letsStartAccountSetup: "Давайте настроим вашу учётную запись." profileSetting: "Настройки профиля" privacySetting: "Настройки конфиденциальности" initialAccountSettingCompleted: "Первоначальная настройка успешно завершена!" - startTutorial: "Пройти Обучение" skipAreYouSure: "Пропустить настройку?" _initialTutorial: - launchTutorial: "Пройти обучение" _note: description: "Посты в Misskey называются 'Заметками.' Заметки отсортированы в хронологическом порядке в ленте и обновляются в режиме реального времени." - _reaction: - reactToContinue: "Добавьте реакцию, чтобы продолжить." - _postNote: - _visibility: - public: "Твоя заметка будет видна всем." - doNotSendConfidencialOnDirect2: "Администратор целевого сервера может видеть что вы отправляете. Будьте осторожны с конфиденциальной информацией, когда отправляете личные заметки пользователям с ненадёжных серверов." _timelineDescription: home: "В персональной ленте располагаются заметки тех, на которых вы подписаны." - local: "Местная лента показывает заметки всех пользователей этого экземпляра." + local: "Местная лента показывает заметки всех пользователей этого сайта." social: "В социальной ленте собирается всё, что есть в персональной и местной лентах." - global: "В глобальную ленту попадает вообще всё со связанных экземпляров." + global: "В глобальную ленту попадает вообще всё со связанных инстансов." _serverSettings: iconUrl: "Адрес на иконку роли" -_accountMigration: - moveFrom: "Перенести другую учётную запись сюда" - moveTo: "Перенести учётную запись на другой сервер" - moveAccountDescription: "Это действие перенесёт ваш аккаунт на другой сервер.\n ・Подписчики с этого аккаунта автоматически подпишутся на новый\n ・Этот аккаунт отпишется от всех пользователей, на которых подписан сейчас\n ・Вы не сможете создавать новые заметки и т.д. на этом аккаунте\n\nТогда как перенос подписчиков происходит автоматически, вы должны будете подготовиться, сделав некоторые шаги, чтобы перенести список пользователей, на которых вы подписаны. Чтобы сделать это, экспортируйте список подписчиков в файл, который затем импортируете на новом аккаунте в меню настроек. То же самое необходимо будет сделать со списками, также как и со скрытыми и заблокированными пользователями.\n\n(Это объяснение применяется к Misskey v13.12.0 и выше. Другое ActivityPub программное обеспечение, такое, как Mastodon, может работать по-другому." - startMigration: "Перенести" - movedAndCannotBeUndone: "Аккаунт был перемещён. Это действие необратимо." _achievements: earnedAt: "Разблокировано в" _types: @@ -1491,7 +1369,6 @@ _role: canPublicNote: "Может публиковать общедоступные заметки" canInvite: "Может создавать пригласительные коды" canManageCustomEmojis: "Управлять пользовательскими эмодзи" - canManageAvatarDecorations: "Управление украшениями аватара" driveCapacity: "Доступное пространство на «диске»" alwaysMarkNsfw: "Всегда отмечать файлы как «не для всех»" pinMax: "Доступное количество закреплённых заметок" @@ -1602,11 +1479,6 @@ _aboutMisskey: donate: "Пожертвование на Misskey" morePatrons: "Большое спасибо и многим другим, кто принял участие в этом проекте! 🥰" patrons: "Материальная поддержка" - projectMembers: "Участники проекта" -_displayOfSensitiveMedia: - respect: "Скрывать содержимое не для всех" - ignore: "Показывать содержимое не для всех" - force: "Скрывать всё содержимое" _instanceTicker: none: "Не показывать" remote: "Только для других сайтов" @@ -1635,7 +1507,7 @@ _wordMute: muteWordsDescription: "Пишите слова через пробел в одной строке, чтобы фильтровать их появление вместе; а если хотите фильтровать любое из них, пишите в отдельных строках." muteWordsDescription2: "Здесь можно использовать регулярные выражения — просто заключите их между двумя дробными чертами (/)." _instanceMute: - instanceMuteDescription: "Любые активности, затрагивающие инстансы из данного списка, будут скрыты." + instanceMuteDescription: "Заметки и репосты с указанных здесь инстансов, а также ответы пользователям оттуда же не будут отображаться." instanceMuteDescription2: "Пишите каждый инстанс на отдельной строке" title: "Скрывает заметки с заданных инстансов." heading: "Список скрытых инстансов" @@ -1684,7 +1556,7 @@ _theme: navActive: "Текст на боковой панели (активирован)" navIndicator: "Индикатор на боковой панели" link: "Ссылка" - hashtag: "Хештег" + hashtag: "Хэштег" mention: "Упоминание" mentionMe: "Упоминания вас" renote: "Репост" @@ -1702,6 +1574,7 @@ _theme: buttonBg: "Фон кнопки" buttonHoverBg: "Текст кнопки" inputBorder: "Рамка поля ввода" + listItemHoverBg: "Фон пункта списка (под указателем)" driveFolderBg: "Фон папки «Диска»" wallpaperOverlay: "Слой обоев" badge: "Значок" @@ -1713,10 +1586,8 @@ _sfx: note: "Заметки" noteMy: "Собственные заметки" notification: "Уведомления" - reaction: "При выборе реакции" -_soundSettings: - driveFile: "Использовать аудиофайл с Диска." - driveFileWarn: "Выбрать аудиофайл с Диска." + antenna: "Антенна" + channel: "Канал" _ago: future: "Из будущего" justNow: "Только что" @@ -1746,6 +1617,7 @@ _2fa: registerTOTP: "Начните настраивать приложение-аутентификатор" step1: "Прежде всего, установите на устройство приложение для аутентификации, например, {a} или {b}." step2: "Далее отсканируйте отображаемый QR-код при помощи приложения." + step2Click: "Нажав на QR-код, вы можете зарегистрироваться с помощью приложения для аутентификации или брелка для ключей, установленного на вашем устройстве." step3Title: "Введите проверочный код" step3: "И наконец, введите код, который покажет приложение." step4: "Теперь при каждом входе на сайт вам нужно будет вводить код из приложения аналогичным образом." @@ -1795,7 +1667,6 @@ _permissions: "write:gallery": "Редактирование галереи" "read:gallery-likes": "Просмотр списка понравившегося в галерее" "write:gallery-likes": "Изменение списка понравившегося в галерее" - "write:admin:reset-password": "Сбросить пароль пользователю" _auth: shareAccessTitle: "Разрешения для приложений" shareAccess: "Дать доступ для «{name}» к вашей учётной записи?" @@ -1822,7 +1693,7 @@ _weekday: _widgets: profile: "Профиль" instanceInfo: "Информация об инстансе" - memo: "Памятки" + memo: "Напоминания" notifications: "Уведомления" timeline: "Лента" calendar: "Календарь" @@ -1849,7 +1720,6 @@ _widgets: _userList: chooseList: "Выберите список" clicker: "Счётчик щелчков" - birthdayFollowings: "Пользователи, у которых сегодня день рождения" _cw: hide: "Спрятать" show: "Показать" @@ -1903,7 +1773,7 @@ _profile: name: "Имя" username: "Имя пользователя" description: "О себе" - youCanIncludeHashtags: "Можете использовать здесь хештеги." + youCanIncludeHashtags: "Можете использовать здесь хэштеги" metadata: "Дополнительные сведения" metadataEdit: "Редактировать дополнительные сведения" metadataDescription: "Можно добавить до четырёх дополнительных граф в профиль." @@ -1911,12 +1781,9 @@ _profile: metadataContent: "Содержимое" changeAvatar: "Поменять аватар" changeBanner: "Поменять изображение в шапке" - verifiedLinkDescription: "Указывая здесь URL, содержащий ссылку на профиль, иконка владения ресурсом может быть отображена рядом с полем" - avatarDecorationMax: "Вы можете добавить до {max} украшений." _exportOrImport: allNotes: "Все заметки\n" favoritedNotes: "Избранное" - clips: "Подборка" followingList: "Подписки" muteList: "Скрытые" blockingList: "Заблокированные" @@ -2035,9 +1902,6 @@ _notification: unreadAntennaNote: "Антенна {name}" emptyPushNotificationMessage: "Обновлены push-уведомления" achievementEarned: "Получено достижение" - checkNotificationBehavior: "Проверить внешний вид уведомления" - sendTestNotification: "Отправить тестовое уведомление" - flushNotification: "Очистить уведомления" _types: all: "Все" follow: "Подписки" @@ -2050,7 +1914,6 @@ _notification: receiveFollowRequest: "Получен запрос на подписку" followRequestAccepted: "Запрос на подписку одобрен" achievementEarned: "Получение достижений" - login: "Войти" app: "Уведомления из приложений" _actions: followBack: "отвечает взаимной подпиской" @@ -2090,57 +1953,10 @@ _dialog: _disabledTimeline: title: "Лента отключена" description: "Ваша текущая роль не позволяет пользоваться этой лентой." -_drivecleaner: - orderBySizeDesc: "Размеры файлов по убыванию" - orderByCreatedAtAsc: "По увеличению даты" _webhookSettings: createWebhook: "Создать вебхук" - modifyWebhook: "Изменить Вебхук" name: "Название" - secret: "Секрет" - trigger: "Условие срабатывания" active: "Вкл." - _events: - follow: "Когда подписались на пользователя" - followed: "Когда на вас подписались" - note: "Когда создали заметку" - reply: "Когда получили ответ на заметку" - renote: "Когда вас репостнули" - reaction: "Когда получили реакцию" - mention: "Когда вас упоминают" - _systemEvents: - abuseReport: "Когда приходит жалоба" - abuseReportResolved: "Когда разрешается жалоба" - userCreated: "Когда создан пользователь" - deleteConfirm: "Вы уверены, что хотите удалить этот Вебхук?" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "Электронная почта" - webhook: "Вебхук" - _captions: - webhook: "Отправить уведомление Системному Вебхуку при получении или разрешении жалоб." - notifiedWebhook: "Используемый Вебхук" _moderationLogTypes: suspend: "Заморозить" - addCustomEmoji: "Добавлено эмодзи" - updateCustomEmoji: "Изменено эмодзи" - deleteCustomEmoji: "Удалено эмодзи" - deleteDriveFile: "Файл удалён" resetPassword: "Сброс пароля:" - createInvitation: "Создать код приглашения" - createSystemWebhook: "Создать Системный Вебхук" - updateSystemWebhook: "Обновить Системый Вебхук" - deleteSystemWebhook: "Удалить Системный Вебхук" -_fileViewer: - url: "Ссылка" - attachedNotes: "Закреплённые заметки" -_dataSaver: - _code: - title: "Подсветка кода" -_hemisphere: - N: "Северное полушарие" - S: "Южное полушарие" - caption: "Используется для некоторых настроек клиента для определения сезона." -_reversi: - total: "Всего" diff --git a/locales/si-LK.yml b/locales/si-LK.yml index c43f3d860d..ed97d539c0 100644 --- a/locales/si-LK.yml +++ b/locales/si-LK.yml @@ -1,22 +1 @@ --- -_lang_: "සිංහල" -monthAndDay: "{month}-{day}" -username: "පරිශීලක නාමය" -password: "මුරපදය" -cancel: "අවලංගු කරන්න" -instance: "සර්වර්" -login: "පිවිසෙන්න" -users: "පරිශීලක" -note: "නෝට්" -notes: "නෝට්" -instances: "සර්වර්" -smtpUser: "පරිශීලක නාමය" -smtpPass: "මුරපදය" -user: "පරිශීලක" -_sfx: - note: "නෝට්" -_profile: - username: "පරිශීලක නාමය" -_notification: - _types: - login: "පිවිසෙන්න" diff --git a/locales/sk-SK.yml b/locales/sk-SK.yml index 60ce45a6b9..e8401af1cd 100644 --- a/locales/sk-SK.yml +++ b/locales/sk-SK.yml @@ -349,8 +349,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Zapnúť hCaptchu" hcaptchaSiteKey: "Site key" hcaptchaSecretKey: "Secret key" -mcaptchaSiteKey: "Site key" -mcaptchaSecretKey: "Secret key" recaptcha: "reCAPTCHA" enableRecaptcha: "Zapnúť ReCAPTCHA" recaptchaSiteKey: "Site key" @@ -454,6 +452,7 @@ uiLanguage: "Jazyk používateľského prostredia" aboutX: "O {x}" emojiStyle: "Štýl emoji" native: "Natívne" +disableDrawer: "Nepoužívať šuflíkové menu" showNoteActionsOnlyHover: "Ovládacie prvky poznámky sa zobrazujú len po nabehnutí myši" noHistory: "Žiadna história" signinHistory: "História prihlásení" @@ -631,7 +630,10 @@ abuseReported: "Vaše nahlásenie je odoslané. Veľmi pekne ďakujeme." reporter: "Nahlásil" reporteeOrigin: "Pôvod nahláseného" reporterOrigin: "Pôvod nahlasovača" +forwardReport: "Preposlať nahlásenie na server" +forwardReportIsAnonymous: "Namiesto vášho účtu bude zobrazený anonymný systémový účet na vzdialenom serveri ako autor nahlásenia." send: "Poslať" +abuseMarkAsResolved: "Označiť nahlásenia ako vyriešené" openInNewTab: "Otvoriť v novom tabe" openInSideView: "Otvoriť v bočnom paneli" defaultNavigationBehaviour: "Predvolené správanie navigácie" @@ -915,13 +917,7 @@ youFollowing: "Sledované" icon: "Avatar" replies: "Odpovedať" renotes: "Preposlať" -sourceCode: "Zdrojový kód" flip: "Preklopiť" -lastNDays: "Posledných {n} dní" -_delivery: - stop: "Zmrazené" - _type: - none: "Zverejňovanie" _role: priority: "Priorita" _priority: @@ -1108,6 +1104,7 @@ _theme: buttonBg: "Pozadie tlačidla" buttonHoverBg: "Pozadie tlačidla (pod kurzorom)" inputBorder: "Okraj vstupného poľa" + listItemHoverBg: "Pozadie položky zoznamu (pod kurzorom)" driveFolderBg: "Pozadie priečinu disku" wallpaperOverlay: "Vrstvenie pozadia" badge: "Odznak" @@ -1119,6 +1116,8 @@ _sfx: note: "Poznámky" noteMy: "Vlastná poznámka" notification: "Oznámenia" + antenna: "Antény" + channel: "Upozornenia kanála" _ago: future: "Budúcnosť" justNow: "Teraz" @@ -1285,7 +1284,6 @@ _profile: changeBanner: "Zmeniť banner" _exportOrImport: allNotes: "Všetky poznámky" - clips: "Klip" followingList: "Sledujete" muteList: "Vypnúť zvuk" blockingList: "Zablokovať" @@ -1405,7 +1403,6 @@ _notification: pollEnded: "Hlasovanie skončilo" receiveFollowRequest: "Doručené žiadosti o sledovanie" followRequestAccepted: "Schválené žiadosti o sledovanie" - login: "Prihlásiť sa" app: "Oznámenia z prepojených aplikácií" _actions: followBack: "Sledovať späť\n" @@ -1441,12 +1438,6 @@ _deck: _webhookSettings: name: "Názov" active: "Zapnuté" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "Email" _moderationLogTypes: suspend: "Zmraziť" resetPassword: "Resetovať heslo" -_reversi: - total: "Celkom" diff --git a/locales/sv-SE.yml b/locales/sv-SE.yml index 5a0de660e8..e5816ba105 100644 --- a/locales/sv-SE.yml +++ b/locales/sv-SE.yml @@ -345,8 +345,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Aktivera hCaptcha" hcaptchaSiteKey: "Webbplatsnyckel" hcaptchaSecretKey: "Hemlig nyckel" -mcaptchaSiteKey: "Webbplatsnyckel" -mcaptchaSecretKey: "Hemlig nyckel" recaptcha: "reCAPTCHA" enableRecaptcha: "Aktivera reCAPTCHA" recaptchaSiteKey: "Webbplatsnyckel" @@ -488,10 +486,6 @@ dataSaver: "Databesparing" icon: "Profilbild" replies: "Svara" renotes: "Omnotera" -_delivery: - stop: "Suspenderad" - _type: - none: "Publiceras" _achievements: _types: _open3windows: @@ -512,6 +506,7 @@ _theme: _sfx: note: "Noter" notification: "Notifikationer" + antenna: "Antenner" _2fa: renewTOTPCancel: "Nej tack" _antennaSources: @@ -562,7 +557,6 @@ _notification: renote: "Omnotera" quote: "Citat" reaction: "Reaktioner" - login: "Logga in" _actions: reply: "Svara" renote: "Omnotera" @@ -577,10 +571,6 @@ _deck: _webhookSettings: name: "Namn" active: "Aktiverad" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "E-post" _moderationLogTypes: suspend: "Suspendera" resetPassword: "Återställ Lösenord" diff --git a/locales/th-TH.yml b/locales/th-TH.yml index 58cf8f068c..7cb2d68321 100644 --- a/locales/th-TH.yml +++ b/locales/th-TH.yml @@ -1,27 +1,24 @@ --- _lang_: "ภาษาไทย" -headlineMisskey: "เชื่อมต่อเครือข่ายโดยโน้ต" -introMisskey: "ยินดีต้อนรับทุกคนจ้า! Misskey คือ ซอฟต์แวร์โอเพนซอร์สสำหรับบริการไมโครบล็อกกิ้ง (MicroBlogging) แบบกระจายศูนย์อำนาจ (Decentralized) \n\nเขียน “โน้ต (Note)” เพื่อส่งต่อเรื่องราวของคุณให้ทั้งโลกได้รับรู้📡\nและอย่าลืมที่จะ “รีแอคชั่น” กับเรื่องราวของคนอื่น ๆ ด้วยนะ! 👍\n\nท่องสำรวจโลกใบใหม่กันเถอะ🚀" -poweredByMisskeyDescription: "{name} เป็นหนึ่งในเซิร์ฟเวอร์ของแพลตฟอร์มโอเพ่นซอร์ส Misskey" +headlineMisskey: "เชื่อมต่อระบบ Network ด้วย Note" +introMisskey: "ยินดีต้อนรับทุกคนจ้า! Misskey คือ บริการไมโครบล็อกกิ้ง (MicroBlogging) แบบกระจายศูนย์อำนาจ (Decentralized) \n\nเขียน \"โน้ต (Note)\" เพื่อส่งต่อเรื่องราวของคุณให้ทั้งโลกได้รับรู้📡\nและอย่าลืมที่จะ \"React\" กับเรื่องราวของคนอื่น ๆ ด้วย! 👍\n\nมุ่งสู่โลกใบใหม่กันเถอะ🚀" +poweredByMisskeyDescription: "{name} เป็นส่วนหนึ่งในบริการที่ถูกขับเคลื่อนโดยแพลตฟอร์มโอเพ่นซอร์ส Misskey (เรียกว่า \"อินสแตนซ์ Misskey\")" monthAndDay: "{month}/{day}" search: "ค้นหา" -notifications: "เเจ้งเตือน" +notifications: "การเเจ้งเตือน" username: "ชื่อผู้ใช้" password: "รหัสผ่าน" -initialPasswordForSetup: "รหัสผ่านเริ่มต้นสำหรับการตั้งค่า" -initialPasswordIsIncorrect: "รหัสผ่านเริ่มต้นสำหรับตั้งค่านั้นไม่ถูกต้องค่ะ" -initialPasswordForSetupDescription: "ถ้าหากคุณติดตั้ง Misskey เอง ให้ใช้รหัสผ่านที่คุณป้อนในไฟล์กำหนดค่า \nถ้าหากคุณกำลังใช้บริการโฮสต์ Misskey ให้ใช้รหัสผ่านที่ได้รับมา\nถ้ายังไม่มีรหัสผ่าน ให้ข้ามช่องรหัสผ่านไป แล้วกดต่อไป" -forgotPassword: "ลืมรหัสผ่าน" -fetchingAsApObject: "กำลังดึงข้อมูลจากสหพันธ์..." -ok: "ตกลง" +forgotPassword: "ลืมรหัสผ่านใช่ไหม" +fetchingAsApObject: "กำลังดึงข้อมูล จาก เฟดิเวิร์ส..." +ok: "โอเค" gotIt: "เข้าใจแล้ว !" cancel: "ยกเลิก" -noThankYou: "ไม่เอาดีกว่า" -enterUsername: "กรอกชื่อผู้ใช้" +noThankYou: "ไม่เป็นไร" +enterUsername: "ใส่ชื่อผู้ใช้" renotedBy: "รีโน้ตโดย {user}" noNotes: "ไม่มีโน้ต" noNotifications: "ไม่มีการแจ้งเตือน" -instance: "เซิร์ฟเวอร์" +instance: "อินสแตนซ์" settings: "การตั้งค่า" notificationSettings: "ตั้งค่าการแจ้งเตือน" basicSettings: "การตั้งค่าพื้นฐาน" @@ -29,30 +26,30 @@ otherSettings: "การตั้งค่าอื่นๆ" openInWindow: "เปิดในหน้าต่าง" profile: "โปรไฟล์" timeline: "ไทม์ไลน์" -noAccountDescription: "ผู้ใช้รายนี้ยังไม่ได้เขียนคำแนะนำตัว" +noAccountDescription: "ผู้ใช้รายนี้ยังไม่ได้เขียนลงประวัติของพวกเขา" login: "เข้าสู่ระบบ" loggingIn: "กำลังเข้าสู่ระบบ" logout: "ออกจากระบบ" signup: "สร้างบัญชีผู้ใช้" -uploading: "กำลังอัปโหลด" +uploading: "กำลังอัพโหลด..." save: "บันทึก" -users: "ผู้ใช้" +users: "ผู้ใช้งาน" addUser: "เพิ่มผู้ใช้" favorite: "รายการโปรด" favorites: "รายการโปรด" unfavorite: "ลบออกจากรายการโปรด" -favorited: "เพิ่มลงรายการโปรดแล้ว" -alreadyFavorited: "เพิ่มลงรายการโปรดอยู่แล้ว" -cantFavorite: "ไม่สามารถเพิ่มลงรายการโปรดได้" -pin: "ปักหมุด" -unpin: "เลิกปักหมุด" +favorited: "เพิ่มแล้วในรายการโปรด" +alreadyFavorited: "เพิ่มในรายการโปรดอยู่แล้ว" +cantFavorite: "ไม่สามารถเพิ่มในรายการโปรดได้" +pin: "ปักหมุดไปยังโปรไฟล์" +unpin: "เลิกปักหมุดจากโปรไฟล์" copyContent: "คัดลอกเนื้อหา" copyLink: "คัดลอกลิงก์" copyLinkRenote: "คัดลอกลิงก์รีโน้ต" delete: "ลบ" deleteAndEdit: "ลบและแก้ไข" -deleteAndEditConfirm: "ต้องการลบโน้ตนี้และแก้ไขใหม่ใช่ไหม? รีแอคชั่น รีโน้ต และการตอบกลับต่อโน้ตนี้ทั้งหมดจะถูกลบออกด้วย" -addToList: "เพิ่มลงรายชื่อ" +deleteAndEditConfirm: "นายแน่ใจแล้วเหรอ? ว่าต้องการลบโน้ตนี้และแก้ไข คุณอาจจะสูญเสียการโต้ตอบ, โน้ต, และการตอบกลับทั้งหมดได้นะ" +addToList: "เพิ่มในลิสต์" addToAntenna: "เพิ่มไปยังเสาอากาศ" sendMessage: "ส่งข้อความ" copyRSS: "คัดลอก RSS" @@ -62,191 +59,168 @@ copyNoteId: "คัดลอก ID โน้ต " copyFileId: "คัดลอกไฟล์ ID" copyFolderId: "คัดลอกโฟลเดอร์ ID" copyProfileUrl: "คัดลอกโปรไฟล์ URL" -searchUser: "ค้นหาผู้ใช้" -searchThisUsersNotes: "ค้นหาโน้ตของผู้ใช้" +searchUser: "ค้นหาผู้ใช้งาน" reply: "ตอบกลับ" -loadMore: "แสดงเพิ่มเติม" +loadMore: "โหลดเพิ่มเติม" showMore: "แสดงเพิ่มเติม" showLess: "ปิด" youGotNewFollower: "ได้ติดตามคุณ" -receiveFollowRequest: "มีคำขอติดตามส่งมาหา" -followRequestAccepted: "การติดตามได้รับการอนุมัติแล้ว" +receiveFollowRequest: "คำขอผู้ติดตามที่ได้รับ" +followRequestAccepted: "ผู้ติดตามได้ตอบรับคำขอร้องของคุณแล้ว" mention: "กล่าวถึง" -mentions: "กล่าวถึงคุณ" -directNotes: "โพสต์แบบไดเร็กต์" +mentions: "พูดถึง" +directNotes: "ไดเร็คโน้ต" importAndExport: "นำเข้า / ส่งออก" import: "นำเข้า" -export: "ส่งออก" +export: "นำออก" files: "ไฟล์" download: "ดาวน์โหลด" -driveFileDeleteConfirm: "ต้องการลบไฟล์ “{name}” ใช่ไหม? โน้ตที่แนบมากับไฟล์นี้ก็จะถูกลบไปด้วย" -unfollowConfirm: "ต้องการเลิกติดตาม {name} ใช่ไหม?" -exportRequested: "คุณได้ร้องขอการส่งออก อาจใช้เวลาสักครู่ และจะถูกเพิ่มในไดรฟ์ของคุณเมื่อเสร็จสิ้นแล้ว" -importRequested: "คุณได้ร้องขอการนำเข้า การดำเนินการนี้อาจใช้เวลาสักครู่" -lists: "รายชื่อ" -noLists: "คุณไม่มีรายชื่อใดๆ" +driveFileDeleteConfirm: "คุณต้องการลบไฟล์ \"{name}\" ใช่หรือไม่? โน้ตย่อที่แนบมากับไฟล์นี้ก็จะถูกลบไปด้วย" +unfollowConfirm: "นายแน่ใจแล้วหรอว่าต้องการเลิกติดตาม {name}?" +exportRequested: "เมื่อคุณได้ร้องขอการส่งออก อาจจะต้องใช้เวลาสักครู่ และจะถูกเพิ่มในไดรฟ์ของคุณเมื่อเสร็จสิ้นแล้ว" +importRequested: "เมื่อคุณได้ร้องขอการนำเข้า อาจจะต้องใช้เวลาสักครู่นะ" +lists: "รายการ" +noLists: "คุณไม่มีลิสต์ใด ๆ" note: " โน้ต" -notes: " โน้ต" +notes: "ตัวโน้ต" following: "กำลังติดตาม" followers: "ผู้ติดตาม" followsYou: "ติดตามคุณ" -createList: "สร้างรายชื่อ" -manageLists: "จัดการรายชื่อ" +createList: "สร้างลิสต์" +manageLists: "จัดการลิสต์" error: "ผิดพลาด!" somethingHappened: "อุ๊ย ! มีอะไรบางอย่างผิดพลาด" retry: "ลองใหม่อีกครั้ง" pageLoadError: "เกิดข้อผิดพลาดในการโหลดหน้านี้" -pageLoadErrorDescription: "ปัญหานี้มักเกิดจากแคชของเครือข่ายหรือเบราว์เซอร์ ควรล้างแคช, รอสักครู่ แล้วลองใหม่อีกครั้ง" +pageLoadErrorDescription: "โดยปกติแล้วมักจะเกิดจากข้อผิดพลาดของเครือข่ายหรือแคชของเบราว์เซอร์ ลองล้างแคชแล้วลองใหม่อีกครั้งหลังจากรอสักครู่ " serverIsDead: "เซิร์ฟเวอร์นี้ไม่มีการตอบสนอง โปรดกรุณารอสักครู่แล้วลองใหม่อีกครั้ง" youShouldUpgradeClient: "หากต้องการดูหน้านี้ กรุณาโหลดหน้าใหม่เพื่ออัปเดตไคลเอ็นต์ของคุณ" -enterListName: "ป้อนนามเรียกของรายชื่อชุดนี้" +enterListName: "ใส่ชื่อสำหรับรายการลิสต์" privacy: "ความเป็นส่วนตัว" -makeFollowManuallyApprove: "อนุมัติคำขอติดตามด้วยตนเอง" +makeFollowManuallyApprove: "ติดตามคำขอที่ต้องได้รับการอนุมัติ" defaultNoteVisibility: "การมองเห็นที่เป็นค่าเริ่มต้น" follow: "ติดตาม" followRequest: "ส่งคำขอติดตาม" followRequests: "ส่งคำขอติดตาม" unfollow: "เลิกติดตาม" -followRequestPending: "รออนุมัติคำขอติดตาม" -enterEmoji: "พิมพ์เอโมจิ" +followRequestPending: "กำลังรอดำเนินการร้องขอติดตาม" +enterEmoji: "ใส่อีโมจิ" renote: "รีโน้ต" unrenote: "เลิกรีโน้ต" renoted: "รีโน้ตแล้ว" -renotedToX: "รีโน้ตให้ {name} แล้ว" -cantRenote: "โพสต์นี้ไม่สามารถรีโน้ตใหม่ได้" -cantReRenote: "รีโน้ตไม่สามารถรีโน้ตซ้ำได้" +cantRenote: "โพสต์นี้ไม่สามารถรีโน้ตไว้ใหม่ได้นะ" +cantReRenote: "ไม่สามารถรีโน้ตเอาไว้ใหม่ได้นะ" quote: "อ้างอิง" -inChannelRenote: "รีโน้ตในช่องเท่านั้น" -inChannelQuote: "อ้างอิงในช่องเท่านั้น" -renoteToChannel: "รีโน้ตไปที่ช่อง" -renoteToOtherChannel: "รีโน้ตไปยังช่องอื่น" -pinnedNote: "โน้ตที่ปักหมุดไว้" -pinned: "ปักหมุด" +inChannelRenote: "รีโน้ตช่องแชลแนลเท่านั้น" +inChannelQuote: "อ้างช่องเท่านั้น" +pinnedNote: "โน้ตที่ปักหมุดเอาไว้" +pinned: "ปักหมุดไปยังโปรไฟล์" you: "คุณ" clickToShow: "คลิกเพื่อแสดง" -sensitive: "เนื้อหาที่ละเอียดอ่อน" +sensitive: "เนื้อหาที่ละเอียดอ่อน NSFW" add: "เพิ่ม" reaction: "รีแอคชั่น" reactions: "รีแอคชั่น" -emojiPicker: "ตัวจิ้มเอโมจิ" -pinnedEmojisForReactionSettingDescription: "ตรึงเอโมจิไว้ด้านบนสำหรับรีแอคชั่นอย่างเร่งด่วน" -pinnedEmojisSettingDescription: "ตรึงเอโมจิไว้ด้านบนสำหรับพิมพ์เอโมจิอย่างเร่งด่วน" -emojiPickerDisplay: "แสดงตัวจิ้มเอโมจิ" -overwriteFromPinnedEmojisForReaction: "เขียนทับการตั้งค่ารีแอคชั่น" -overwriteFromPinnedEmojis: "เขียนทับการตั้งค่าทั่วไป" -reactionSettingDescription2: "ลากเพื่อจัดลำดับใหม่ คลิกที่เอโมจินั้นเพื่อลบ กด “+” เพื่อเพิ่ม" -rememberNoteVisibility: "จำการตั้งค่าการมองเห็นโน้ต" -attachCancel: "ยกเลิกแนบไฟล์" -deleteFile: "ลบไฟล์ออก" -markAsSensitive: "ทำเครื่องหมายว่ามีเนื้อหาละเอียดอ่อน" -unmarkAsSensitive: "ยกเลิกทำเครื่องหมายว่ามีเนื้อหาละเอียดอ่อน" +reactionSettingDescription2: "กดลากเพื่อจัดลำดับใหม่ กดคลิกเพื่อลบ กด \"+\" เพื่อเพิ่ม" +rememberNoteVisibility: "จดจำการตั้งค่าการมองเห็นตัวโน้ต" +attachCancel: "ลบไฟล์ออกที่แนบมา" +markAsSensitive: "ทำเครื่องหมายว่าละเอียดอ่อน" +unmarkAsSensitive: "ยกเลิกทำเครื่องหมายเป็น NSFW" enterFileName: "พิมพ์ชื่อไฟล์" mute: "ปิดเสียง" unmute: "ยกเลิกการปิดเสียง" renoteMute: "ปิดเสียงรีโน้ต" renoteUnmute: "เปิดเสียง รีโน้ต" -block: "บล็อก" -unblock: "เลิกบล็อก" -suspend: "ระงับ" -unsuspend: "เลิกระงับ" -blockConfirm: "ต้องการบล็อกบัญชีนี้ใช่ไหม?" -unblockConfirm: "ต้องการเลิกบล็อกบัญชีนี้ใช่ไหม?" -suspendConfirm: "ต้องการระงับบัญชีนี้ใช่ไหม?" -unsuspendConfirm: "ต้องการยกเลิกการระงับบัญชีนี้ใช่ไหม?" -selectList: "เลือกรายชื่อ" -editList: "แก้ไขรายชื่อ" -selectChannel: "เลือกช่อง" +block: "บล็อค" +unblock: "เลิกปิดกั้น" +suspend: "ถูกระงับ" +unsuspend: "ยกเลิกระงับ" +blockConfirm: "คุณแน่ใจแล้วเหรอ? ว่าต้องการบล็อกบัญชีนี้" +unblockConfirm: "คุณแน่ใจแล้วเหรอ? ว่าต้องการปลดบล็อคบัญชีนี้" +suspendConfirm: "แน่ใจว่าคุณต้องการระงับบัญชีนี้?" +unsuspendConfirm: "นายแน่ใจแล้วหรอ? ว่าต้องการยกเลิกการระงับบัญชีนี้" +selectList: "เลือกรายการ" +editList: "แก้ไขรายการ" +selectChannel: "เลือกแชนแนล" selectAntenna: "เลือกเสาอากาศ" editAntenna: "แก้ไขเสาอากาศ" -createAntenna: "สร้างเสาอากาศ" selectWidget: "เลือกวิดเจ็ต" editWidgets: "แก้ไขวิดเจ็ต" editWidgetsExit: "เรียบร้อย" -customEmojis: "เอโมจิที่กำหนดเอง" -emoji: "เอโมจิ" +customEmojis: "กำหนดอีโมจิเอง" +emoji: "อีโมจิ" emojis: "อีโมจิ" -emojiName: "ชื่อเอโมจิ" -emojiUrl: "URL ของเอโมจิ" -addEmoji: "แทรกเอโมจิ" +emojiName: "ชื่ออิโมจิ" +emojiUrl: "อิโมจิ URL" +addEmoji: "แทรกอีโมจิ" settingGuide: "การตั้งค่าที่แนะนำ" cacheRemoteFiles: "แคชไฟล์ระยะไกล" -cacheRemoteFilesDescription: "หากเปิดใช้งาน ไฟล์ระยะไกลจะถูกแคชไว้ ทำให้แสดงภาพเร็วขึ้น แต่ก็ใช้พื้นที่เก็บข้อมูลของเซิร์ฟเวอร์มากขึ้นเช่นกัน สำหรับขีดจำกัดที่ผู้ใช้ระยะไกลถูกแคชไว้จะขึ้นอยู่กับความจุไดรฟ์ตามบทบาทของเขา เมื่อเกินแล้วไฟล์เก่าจะถูกลบออกและเก็บเป็นลิงก์แทน หากปิดใช้งาน ไฟล์ระยะไกลจะถูกเก็บเป็นลิงก์ตั้งแต่ต้น เราแนะนำให้ตั้งค่า proxyRemoteFiles ใน default.yml เป็น true เพื่อสร้างธัมบ์เนลและปกป้องความเป็นส่วนตัวของผู้ใช้" -youCanCleanRemoteFilesCache: "สามารถลบแคชทั้งหมดได้โดยใช้ปุ่ม 🗑️ ในหน้าการจัดการไฟล์" -cacheRemoteSensitiveFiles: "แคชไฟล์ระยะไกลที่มีเนื้อหาละเอียดอ่อน" -cacheRemoteSensitiveFilesDescription: "เมื่อปิดการใช้งานการตั้งค่านี้ ไฟล์ระยะไกลที่มีเนื้อหาละเอียดอ่อนจะถูกโหลดโดยตรงจากเซิร์ฟเวอร์ระยะไกลโดยไม่มีการแคช" -flagAsBot: "ทำเครื่องหมายบอกว่าบัญชีนี้เป็นบอต" -flagAsBotDescription: "เปิดใช้งานตัวเลือกนี้หากบัญชีนี้ถูกควบคุมโดยโปรแกรม เมื่อเปิดใช้งาน มันจะทำหน้าที่เป็นแฟล็กสำหรับนักพัฒนารายอื่นในการป้องกันการสร้างห่วงโซ่การโต้ตอบแบบอนันต์กับบอตตัวอื่น และปรับระบบภายในของ Misskey เพื่อจัดการบัญชีนี้ในฐานะบอต" -flagAsCat: "เมี้ยววววววววววววววว!!!!!!!!!!!" -flagAsCatDescription: "เหมียวเหมียวเมี้ยว??" -flagShowTimelineReplies: "แสดงตอบกลับโน้ตลงไทม์ไลน์" -flagShowTimelineRepliesDescription: "เมื่อเปิดใช้งาน จะแสดงการตอบกลับของผู้ใช้คนนั้นต่อโน้ตอื่นๆ ในไทม์ไลน์ด้วย" -autoAcceptFollowed: "อนุมัติคำขอติดตามจากผู้ใช้ที่คุณติดตามอยู่โดยอัตโนมัติ" +cacheRemoteFilesDescription: "เมื่อปิดใช้งานการตั้งค่านี้ ไฟล์ระยะไกลนั้นจะถูกโหลดโดยตรงจากอินสแตนซ์ระยะไกล แต่กรณีการปิดใช้งานนี้จะช่วยลดปริมาณการใช้พื้นที่จัดเก็บข้อมูล แต่เพิ่มปริมาณการใช้งาน เพราะเนื่องจากจะไม่มีการสร้างภาพขนาดย่อ" +youCanCleanRemoteFilesCache: "คุณสามารถล้างแคชได้โดยคลิกที่ปุ่ม 🗑️ ในมุมมองการจัดการไฟล์" +cacheRemoteSensitiveFiles: "ไฟล์ระยะไกลที่มีความละเอียดอ่อนแคช" +cacheRemoteSensitiveFilesDescription: "เมื่อปิดการใช้งานแล้วการตั้งค่านี้ ไฟล์รีโมตที่มีความละเอียดอ่อนนั้นจะถูกโหลดโดยตรงจากอินสแตนซ์ระยะไกลโดยที่ไม่มีการแคช" +flagAsBot: "ทำเครื่องหมายบอกว่าบัญชีนี้เป็นบอท" +flagAsBotDescription: "การเปิดใช้งานตัวเลือกนี้หากบัญชีนี้ถูกควบคุมโดยนักเขียนโปรแกรม หรือ ถ้าหากเปิดใช้งาน มันจะทำหน้าที่เป็นแฟล็กสำหรับนักพัฒนารายอื่นๆ และเพื่อป้องกันการโต้ตอบแบบไม่มีที่สิ้นสุดกับบอทตัวอื่นๆ และยังสามารถปรับเปลี่ยนระบบภายในของ Misskey เพื่อปฏิบัติต่อบัญชีนี้เป็นบอท" +flagAsCat: "ทำเครื่องหมายบอกว่าบัญชีนี้เป็นแมว" +flagAsCatDescription: "การเปิดใช้งานตัวเลือกนี้เพื่อทำเครื่องหมายบอกว่าบัญชีนี้เป็นแมว" +flagShowTimelineReplies: "แสดงตอบกลับ ในไทม์ไลน์" +flagShowTimelineRepliesDescription: "แสดงการตอบกลับของผู้ใช้งานไปยังโน้ตของผู้ใช้งานรายอื่นๆในไทม์ไลน์หากได้เปิดเอาไว้" +autoAcceptFollowed: "อนุมัติคำขอติดตามโดยอัตโนมัติทันที จากผู้ใช้งานที่คุณกำลังติดตาม" addAccount: "เพิ่มบัญชี" reloadAccountsList: "รีโหลดรายการบัญชีใหม่" loginFailed: "การเข้าสู่ระบบไม่สำเร็จ" -showOnRemote: "ดูบนเซิร์ฟเวอร์ฝั่งระยะไกล" -continueOnRemote: "ดำเนินการต่อบนเซิร์ฟเวอร์ฝั่งระยะไกล" -chooseServerOnMisskeyHub: "เลือกเซิร์ฟเวอร์จาก Misskey Hub" -specifyServerHost: "ระบุโดเมนของเซิร์ฟเวอร์โดยตรง" -inputHostName: "โปรดป้อนโดเมน" +showOnRemote: "ดูบนอินสแตนซ์ระยะไกล" general: "ทั่วไป" -wallpaper: "ภาพพื้นหลัง" -setWallpaper: "ตั้งค่าภาพพื้นหลัง" -removeWallpaper: "นำภาพพื้นหลังออก" +wallpaper: "วอลล์เปเปอร์" +setWallpaper: "ตั้งวอลเปเปอร์" +removeWallpaper: "นำวอลเปเปอร์ออก" searchWith: "ค้นหา: {q}" -youHaveNoLists: "คุณไม่มีรายชื่อใดๆ " -followConfirm: "ต้องการติดตาม {name} ใช่ไหม?" -proxyAccount: "บัญชีพร็อกซี่" -proxyAccountDescription: "บัญชีพร็อกซี คือ บัญชีที่ทำหน้าที่ติดตาม(ผู้ใช้)ระยะไกลภายใต้เงื่อนไขบางประการ ตัวอย่างเช่น เมื่อผู้ใช้ท้องถิ่นเพิ่มผู้ใช้ระยะไกลลงรายชื่อ หากไม่มีใครติดตามผู้ใช้ระยะไกลในรายชื่อนั้น กิจกรรมก็จะไม่ถูกส่งมายังเซิร์ฟเวอร์ ดังนั้นจึงมีบัญชีพร็อกซีไว้ติดตามผู้ใช้ระยะไกลเหล่านั้น" +youHaveNoLists: "คุณไม่มีลิสต์ใด ๆ " +followConfirm: "คุณแน่ใจแล้วหรอว่าต้องการที่จะติดตาม {name}?" +proxyAccount: "บัญชี พร็อกซี่" +proxyAccountDescription: "บัญชีพร็อกซี่ คือ บัญชีที่จะทำหน้าที่เป็นผู้ติดตามระยะไกลสำหรับผู้ใช้งานที่อยู่ภายใต้ด้วยเงื่อนไขบางอย่าง ยกตัวอย่าง เช่น เมื่อมีผู้ใช้งานนั้นได้เพิ่มผู้ใช้งานจากระยะไกลลงในรายการ แต่กิจกรรมของผู้ใช้ในระยะไกลนั้นจะไม่ถูกส่งไปยังอินสแตนซ์หากไม่มีผู้ใช้งานในพื้นที่ติดตามผู้ใช้รายนั้น ดังนั้นบัญชีพร็อกซีนี้จะติดตามแทน" host: "โฮสต์" -selectSelf: "เลือกตัวเอง" selectUser: "เลือกผู้ใช้งาน" recipient: "ผู้รับ" -annotation: "หมายเหตุประกอบ" -federation: "สหพันธ์" -instances: "เซิร์ฟเวอร์" -registeredAt: "วันที่ลงทะเบียน" -latestRequestReceivedAt: "คำขอล่าสุดที่ได้รับ" +annotation: "ความคิดเห็น" +federation: "เฟดิเวิร์ส" +instances: "Server" +registeredAt: "จดทะเบียนที่" +latestRequestReceivedAt: "ได้รับคำขอล่าสุดไปแล้ว" latestStatus: "สถานะล่าสุด" storageUsage: "พื้นที่จัดเก็บข้อมูลที่ใช้ไป" -charts: "แผนภูมิ" -perHour: "ต่อชั่วโมง" +charts: "โดดเด่น" +perHour: "ทุกชั่วโมง" perDay: "ต่อวัน" stopActivityDelivery: "หยุดส่งกิจกรรม" -blockThisInstance: "บล็อกเซิร์ฟเวอร์นี้" -silenceThisInstance: "ปิดปากเซิร์ฟเวอร์นี้" -mediaSilenceThisInstance: "ปิดปากสื่อของเซิร์ฟเวอร์นี้" +blockThisInstance: "บล็อกอินสแตนซ์นี้" +silenceThisInstance: "ปกปิดอินสแตนซ์นี้" operations: "ดำเนินการ" software: "ซอฟต์แวร์" version: "เวอร์ชั่น" metadata: "Metadata" -withNFiles: "{n} ไฟล์" +withNFiles: "{n} ไฟล์(s)" monitor: "มอนิเตอร์" jobQueue: "คิวงาน" cpuAndMemory: "ซีพียู และ หน่วยความจำ" -network: "เครือข่าย" +network: "เน็ตเวิร์ก" disk: "ดิสก์" -instanceInfo: "ข้อมูลเซิร์ฟเวอร์" +instanceInfo: "ข้อมูล อินสแตนซ์" statistics: "สถิติการใช้งาน" clearQueue: "ล้างคิว" -clearQueueConfirmTitle: "ต้องการล้างคิวใช่ไหม?" -clearQueueConfirmText: "โพสต์ที่ยังค้างในคิวจะไม่ถูกจัดส่งอีกต่อไป โดยปกติแล้วการดำเนินการนี้ไม่จำเป็น" +clearQueueConfirmTitle: "คุณแน่ใจแล้วหรอว่าต้องการที่จะล้างคิว?" +clearQueueConfirmText: "บันทึกย่อที่ยังไม่ได้ส่งที่เหลืออยู่ในคิวนั้นมักจะ ไม่ถูกรวมเข้าด้วยกัน โดยปกติแล้วไม่จำเป็นต้องดำเนินการนี้" clearCachedFiles: "ล้างแคช" -clearCachedFilesConfirm: "ต้องการลบไฟล์ระยะไกลที่แคชไว้ทั้งหมดใช่ไหม?" -blockedInstances: "เซิร์ฟเวอร์ที่ถูกบล็อก" -blockedInstancesDescription: "ระบุโฮสต์ของเซิร์ฟเวอร์ที่ต้องการบล็อก คั่นด้วยการขึ้นบรรทัดใหม่ เซิร์ฟเวอร์ที่ถูกบล็อกจะไม่สามารถติดต่อกับอินสแตนซ์นี้ได้" -silencedInstances: "ปิดปากเซิร์ฟเวอร์นี้แล้ว" -silencedInstancesDescription: "ระบุโฮสต์ของเซิร์ฟเวอร์ที่ต้องการปิดปาก คั่นด้วยการขึ้นบรรทัดใหม่, บัญชีทั้งหมดของเซิร์ฟเวอร์ดังกล่าวจะถือว่าถูกปิดปากเช่นกัน ทำได้เฉพาะคำขอติดตามเท่านั้น และไม่สามารถกล่าวถึงบัญชีในเซิร์ฟเวอร์นี้ได้หากไม่ได้ถูกติดตามกลับ | สิ่งนี้ไม่มีผลต่ออินสแตนซ์ที่ถูกบล็อก" -mediaSilencedInstances: "เซิร์ฟเวอร์ที่ถูกปิดปากสื่อ" -mediaSilencedInstancesDescription: "ระบุโฮสต์ของเซิร์ฟเวอร์ที่ต้องการปิดปากสื่อ คั่นด้วยการขึ้นบรรทัดใหม่, ไฟล์ที่ถูกส่งจากบัญชีของเซิร์ฟเวอร์ดังกล่าวจะถือว่าถูกปิดปาก แล้วจะถูกติดเครื่องหมายว่ามีเนื้อหาละเอียดอ่อน และเอโมจิแบบกำหนดเองก็จะใช้ไม่ได้ด้วย | สิ่งนี้ไม่มีผลต่ออินสแตนซ์ที่ถูกบล็อก" -federationAllowedHosts: "เซิร์ฟเวอร์ที่เปิดให้บริการแบบเฟเดอเรชั่น" -federationAllowedHostsDescription: "ระบุชื่อโฮสต์ของเซิร์ฟเวอร์ที่คุณต้องการอนุญาตให้เชื่อมต่อแบบเฟเดอเรชั่น โดยต้องเว้นวรรคแต่ละบรรทัด" +clearCachedFilesConfirm: "นายแน่ใจแล้วหรอว่าต้องการที่จะลบไฟล์ระยะไกลที่แคชไว้ทั้งหมด?" +blockedInstances: "อินสแตนซ์ที่ ถูกบล็อก" +blockedInstancesDescription: "ระบุชื่อโฮสต์ของอินสแตนซ์ที่คุณต้องการบล็อก อินสแตนซ์ที่อยู่ในรายการนั้นจะไม่สามารถพูดคุยกับอินสแตนซ์นี้ได้อีกต่อไป" +silencedInstances: "ปกปิดอินสแตนซ์นี้แล้ว" muteAndBlock: "ปิดเสียงและบล็อก" mutedUsers: "ผู้ใช้ที่ถูกปิดเสียง" blockedUsers: "ผู้ใช้ที่ถูกบล็อก" noUsers: "ไม่พบผู้ใช้งาน" editProfile: "แก้ไขโปรไฟล์" -noteDeleteConfirm: "ต้องการลบโน้ตนี้ใช่ไหม?" +noteDeleteConfirm: "นายแน่ใจแล้วหรอว่าต้องการลบโน้ตนี้นะ?" pinLimitExceeded: "คุณไม่สามารถปักหมุดโน้ตเพิ่มเติมใดๆได้อีก" intro: "การติดตั้ง Misskey เสร็จสิ้นแล้วนะ! โปรดสร้างผู้ใช้งานที่เป็นผู้ดูแลระบบ" done: "เสร็จสิ้น" @@ -254,193 +228,183 @@ processing: "กำลังประมวลผล..." preview: "แสดงตัวอย่าง" default: "ค่าเริ่มต้น" defaultValueIs: "ค่าเริ่มต้น: {value}" -noCustomEmojis: "ไม่มีเอโมจิ" -noJobs: "ไม่มีงาน" +noCustomEmojis: "ไม่มีอีโมจิ" +noJobs: "ไม่มีชิ้นงาน" federating: "สหพันธ์" blocked: "ถูกบล็อก" -suspended: "ระงับการส่ง" +suspended: "ถูกระงับ" all: "ทั้งหมด" -subscribing: "กำลังสมัครสมาชิก" +subscribing: "สมัครแล้ว" publishing: "กำลังเผยแพร่" notResponding: "ไม่มีการตอบสนอง" -instanceFollowing: "กำลังติดตามบนเซิร์ฟเวอร์" -instanceFollowers: "ผู้ติดตามของเซิร์ฟเวอร์" -instanceUsers: "ผู้ใช้ของเซิร์ฟเวอร์นี้" +instanceFollowing: "กำลังติดตาม บน อินสแตนซ์" +instanceFollowers: "ผู้ติดตามของอินสแตนซ์" +instanceUsers: "ผู้ใช้งานของอินสแตนซ์นี้" changePassword: "เปลี่ยนรหัสผ่าน" security: "ความปลอดภัย" -retypedNotMatch: "ทั้งสองป้อนข้อมูลไม่สอดคล้องกัน" +retypedNotMatch: "อินพุตไม่ตรงกันนะ" currentPassword: "รหัสผ่านปัจจุบัน" newPassword: "รหัสผ่านใหม่" newPasswordRetype: "ใส่รหัสผ่านใหม่อีกครั้ง" attachFile: "แนบไฟล์" -more: "เพิ่มเติม!" +more: "เพิ่มเติม" featured: "ไฮไลท์" usernameOrUserId: "ชื่อผู้ใช้หรือรหัสผู้ใช้งาน" noSuchUser: "ไม่พบผู้ใช้" lookup: "การค้นหา" announcements: "ประกาศ" -imageUrl: "URL รูปภาพ" +imageUrl: "url รูปภาพ" remove: "ลบ" removed: "ถูกลบไปแล้ว" -removeAreYouSure: "ต้องการลบ “{x}” ใช่ไหม?" -deleteAreYouSure: "ต้องการลบ “{x}” ใช่ไหม?" -resetAreYouSure: "รีเซ็ตเลยไหม?" -areYouSure: "แน่ใจแล้วใช่ไหมคะ?" +removeAreYouSure: "นายแน่ใจจริงหรอว่าต้องการที่จะลบออก \"{x}\"" +deleteAreYouSure: "ต้องการลบ {x} หรือไม่คะ?" +resetAreYouSure: "รีเซ็ตเลยไหม" saved: "บันทึกแล้ว" messaging: "แชท" -upload: "อัปโหลด" +upload: "อัพโหลด" keepOriginalUploading: "เก็บภาพต้นฉบับ" -keepOriginalUploadingDescription: "เก็บภาพต้นฉบับไว้เมื่ออัปโหลดภาพ หากปิด รูปภาพสำหรับการเผยแพร่ทางเว็บจะถูกสร้างขึ้นในเบราว์เซอร์เมื่อทำการอัปโหลด" +keepOriginalUploadingDescription: "บันทึกรูปภาพที่อัพโหลดต้นฉบับตามที่เป็นอยู่ ถ้าหากปิดอยู่ ระบบจะสร้างเวอร์ชั่นที่จะแสดงบนเว็บเมื่ออัพโหลดนะ" fromDrive: "จากไดรฟ์" fromUrl: "จาก URL" -uploadFromUrl: "อัปโหลดจาก URL" +uploadFromUrl: "อัพโหลดจาก URL" uploadFromUrlDescription: "URL ของไฟล์ที่คุณต้องการอัปโหลด" -uploadFromUrlRequested: "ร้องขอการอัปโหลดแล้ว" -uploadFromUrlMayTakeTime: "การอัปโหลดอาจใช้เวลาสักครู่จึงจะเสร็จสมบูรณ์" +uploadFromUrlRequested: "อัพโหลดที่ร้องขอ" +uploadFromUrlMayTakeTime: "มันอาจจะต้องใช้เวลาสักครู่จนกว่าการอัพโหลดจะเสร็จสมบูรณ์นะ" explore: "สำรวจ" messageRead: "อ่านแล้ว" -noMoreHistory: "ไม่มีประวัติเพิ่มเติม" +noMoreHistory: "ในนั้นไม่มีประวัติอีกต่อไปแล้วนะ" startMessaging: "เริ่มการสนทนา" nUsersRead: "อ่านโดย {n}" -agreeTo: "ฉันยอมรับ {0}" +agreeTo: "ฉันยอมรับที่จะ {0}" agree: "ยอมรับ" -agreeBelow: "ยอมรับตามที่ระบุด้านล่าง" +agreeBelow: "ฉันยอมรับถึงด้านล่าง" basicNotesBeforeCreateAccount: "หมายเหตุสำคัญ" termsOfService: "เงื่อนไขการให้บริการ" -start: "เริ่ม" -home: "หน้าหลัก" -remoteUserCaution: "ข้อมูลอาจไม่สมบูรณ์เนื่องจากผู้ใช้รายนี้มาจากเซิร์ฟเวอร์ระยะไกล" +start: "เริ่มต้น​ใช้งาน​" +home: "หน้าแรก" +remoteUserCaution: "เนื่องจากผู้ใช้งานรายนี้นั้น มาจากอินสแตนซ์ระยะไกล ข้อมูลที่แสดงดังกล่าวนั้นอาจจะไม่สมบูรณ์ก็ได้นะ" activity: "กิจกรรม" images: "รูปภาพ" image: "รูปภาพ" birthday: "วันเกิด" yearsOld: "{age} ปี" -registeredDate: "วันที่ลงทะเบียน" +registeredDate: "วันที่สมัครสมาชิก" location: "ตำแหน่งที่ตั้ง" theme: "ธีม" -themeForLightMode: "ธีมที่จะใช้ในโหมดสว่าง" +themeForLightMode: "ธีมที่จะใช้ในโหมดแสง" themeForDarkMode: "ธีมที่จะใช้ในโหมดมืด" light: "สว่าง" dark: "มืด" lightThemes: "ธีมสว่าง" darkThemes: "ธีมมืด" -syncDeviceDarkMode: "ซิงค์โหมดมืดกับการตั้งค่าอุปกรณ์ของคุณ" +syncDeviceDarkMode: "ซิงค์โหมดมืดด้วยการตั้งค่ากับอุปกรณ์" drive: "ไดรฟ์" fileName: "ชื่อไฟล์" selectFile: "เลือกไฟล์" selectFiles: "เลือกไฟล์" selectFolder: "เลือกโฟลเดอร์" selectFolders: "เลือกโฟลเดอร์" -fileNotSelected: "ยังไม่ได้เลือกไฟล์" renameFile: "เปลี่ยนชื่อไฟล์" -folderName: "ชื่อโฟลเดอร์" +folderName: "ชื่อแฟ้ม" createFolder: "สร้างโฟลเดอร์" renameFolder: "เปลี่ยนชื่อโฟลเดอร์" deleteFolder: "ลบโฟลเดอร์" -folder: "โฟลเดอร์" addFile: "เพิ่มไฟล์" -showFile: "แสดงไฟล์" emptyDrive: "ไดรฟ์ของคุณว่างเปล่านะ" emptyFolder: "โฟลเดอร์นี้ว่างเปล่า" unableToDelete: "ไม่สามารถลบออกได้" -inputNewFileName: "ป้อนชื่อไฟล์ใหม่" +inputNewFileName: "ป้อนชื่อไฟล์ใหม่นะ" inputNewDescription: "กรุณาใส่แคปชั่นใหม่" -inputNewFolderName: "กรุณาใส่ชื่อโฟลเดอร์ใหม่" -circularReferenceFolder: "โฟลเดอร์ปลายทางคือโฟลเดอร์ย่อยของโฟลเดอร์ที่คุณกำลังย้าย" -hasChildFilesOrFolders: "เนื่องจากโฟลเดอร์นี้ไม่ว่างเปล่า จึงไม่สามารถลบ" +inputNewFolderName: "กรุณาใส่ชื่อโฟลเดอร์ใหม่นะ\n" +circularReferenceFolder: "โฟลเดอร์ปลายทาง คือ โฟลเดอร์ย่อยของโฟลเดอร์ที่คุณต้องการที่จะย้ายล่ะนะ" +hasChildFilesOrFolders: "เนื่องจากโฟลเดอร์นี้ไม่ว่างเปล่า จึงไม่สามารถลบได้นะ" copyUrl: "คัดลอก URL" rename: "เปลี่ยนชื่อ" avatar: "ไอคอน" banner: "แบนเนอร์" -displayOfSensitiveMedia: "แสดงสื่อที่มีเนื้อหาละเอียดอ่อน" -whenServerDisconnected: "เมื่อสูญเสียการเชื่อมต่อกับเซิร์ฟเวอร์" -disconnectedFromServer: "การเชื่อมต่อเซิร์ฟเวอร์ถูกตัด" +displayOfSensitiveMedia: "แสดงผลสื่อละเอียดอ่อน" +whenServerDisconnected: "สูญเสียการเชื่อมต่อกับเซิร์ฟเวอร์" +disconnectedFromServer: "ถูกตัดการเชื่อมต่อออกจากเซิร์ฟเวอร์" reload: "รีโหลด" -doNothing: "ช่างมัน" -reloadConfirm: "รีโหลดเลยไหม?" -watch: "เพ่งเล็ง" -unwatch: "เลิกเพ่งเล็ง" +doNothing: "เมิน" +reloadConfirm: "นายต้องการรีเฟรชไทม์ไลน์หรือป่าว?" +watch: "ดู" +unwatch: "หยุดดู" accept: "ยอมรับ" reject: "ปฏิเสธ" normal: "ปกติ" -instanceName: "ชื่อเซิร์ฟเวอร์" -instanceDescription: "คำอธิบายแนะนำเซิร์ฟเวอร์" +instanceName: "ชื่อ อินสแตนซ์" +instanceDescription: "คำอธิบายอินสแตนซ์" maintainerName: "ผู้ดูแล" -maintainerEmail: "อีเมลผู้ดูแลระบบ" -tosUrl: "URL เงื่อนไขการให้บริการ" +maintainerEmail: "อีเมล์แอดมิน" +tosUrl: "เงื่อนไขการให้บริการ URL" thisYear: "ปีนี้" thisMonth: "เดือนนี้" today: "วันนี้" dayX: "{day}" monthX: "เดือน {month}" yearX: "{year}" -pages: "หน้าเพจ" -integration: "เชื่อมโยง" +pages: "หน้า" +integration: "รวบรวม" connectService: "เชื่อมต่อ" disconnectService: "ตัดการเชื่อมต่อ" -enableLocalTimeline: "เปิดใช้งานไทม์ไลน์ท้องถิ่น" +enableLocalTimeline: "เปิดใช้งานไทม์ไลน์ในพื้นที่" enableGlobalTimeline: "เปิดใช้งานไทม์ไลน์ทั่วโลก" disablingTimelinesInfo: "ผู้ดูแลระบบและผู้ควบคุมจะสามารถเข้าถึงไทม์ไลน์ทั้งหมด ถึงแม้ว่าจะไม่ได้เปิดใช้งานก็ตาม" registration: "ลงทะเบียน" enableRegistration: "เปิดใช้งานการลงทะเบียนผู้ใช้ใหม่" -invite: "คำเชิญ" -driveCapacityPerLocalAccount: "ความจุของไดรฟ์ต่อผู้ใช้ท้องถิ่น" +invite: "เชิญชวน" +driveCapacityPerLocalAccount: "ความจุของไดรฟ์ต่อผู้ใช้ภายในเครื่อง" driveCapacityPerRemoteAccount: "ความจุของไดรฟ์ต่อผู้ใช้ระยะไกล" inMb: "เป็นเมกะไบต์" bannerUrl: "URL รูปภาพแบนเนอร์" backgroundImageUrl: "URL ภาพพื้นหลัง" basicInfo: "ข้อมูลเบื้องต้น" -pinnedUsers: "ผู้ใช้ที่ถูกปักหมุด" -pinnedUsersDescription: "ป้อนชื่อผู้ใช้ที่คุณต้องการปักหมุดในหน้า “ค้นพบ” ฯลฯ คั่นด้วยการขึ้นบรรทัดใหม่" -pinnedPages: "หน้าเพจที่ปักหมุด" -pinnedPagesDescription: "ป้อนเส้นทางของหน้าเพจที่คุณต้องการปักหมุดไว้ที่หน้าแรกของเซิร์ฟเวอร์นี้ คั่นด้วยการขึ้นบรรทัดใหม่" +pinnedUsers: "ผู้ใช้งานที่ได้รับการปักหมุด" +pinnedUsersDescription: "ลิสต์ชื่อผู้ใช้โดยคั่นด้วยการขึ้นบรรทัดใหม่เพื่อปักหมุดในแท็บ \"สำรวจ\"" +pinnedPages: "หน้าที่ปักหมุด" +pinnedPagesDescription: "ป้อนเส้นทางของหน้าที่คุณต้องการตรึงไว้ที่หน้าแรกของอินสแตนซ์นี้ โดยคั่นด้วยตัวแบ่งบรรทัด" pinnedClipId: "ID ของคลิปที่จะปักหมุด" pinnedNotes: "โน้ตที่ปักหมุดไว้" hcaptcha: "hCaptcha" enableHcaptcha: "เปิดใช้ hCaptcha" hcaptchaSiteKey: "คีย์ไซต์" hcaptchaSecretKey: "คีย์ลับ" -mcaptcha: "mCaptcha" -enableMcaptcha: "เปิดใช้ mCaptcha" -mcaptchaSiteKey: "คีย์ไซต์" -mcaptchaSecretKey: "คีย์ลับ" -mcaptchaInstanceUrl: "URL ของอินสแตนซ์ของ mCaptcha" recaptcha: "reCAPTCHA" enableRecaptcha: "เปิดใช้ reCAPTCHA" recaptchaSiteKey: "คีย์ไซต์" recaptchaSecretKey: "คีย์ลับ" -turnstile: "Turnstile" -enableTurnstile: "เปิดใช้งาน Turnstile" +turnstile: "เทิร์น'สไทล" +enableTurnstile: "เปิดใช้งาน เทิร์น'สไทล" turnstileSiteKey: "คีย์ไซต์" turnstileSecretKey: "คีย์ลับ" -avoidMultiCaptchaConfirm: "การใช้ Captcha หลายตัวอาจทำให้เกิดการรบกวนหรือข้อผิดพลาดได้ ต้องการที่จะปิดการใช้งาน Captcha ตัวอื่นเลยไหม? หากต้องการให้เปิดใช้งานต่อไป ให้กดยกเลิก" +avoidMultiCaptchaConfirm: "การใช้ระบบ Captcha หลายระบบอาจทำให้เกิดการรบกวนหรืออาจจะเกิดข้อผิดพลาดได้ หากต้องการที่จะปิดการใช้งานระบบ Captcha อื่น ๆ แนะนำให้ปิดตัวอื่นๆก่อน ถ้าหากคุณต้องการให้เปิดใช้งานต่อไป ให้ กด ยกเลิก" antennas: "เสาอากาศ" manageAntennas: "จัดการเสาอากาศ" name: "ชื่อ" antennaSource: "แหล่งเสาอากาศ" antennaKeywords: "คีย์เวิร์ดที่ควรฟัง" antennaExcludeKeywords: "คีย์เวิร์ดที่จะยกเว้น" -antennaExcludeBots: "ยกเว้นบัญชีบอต" -antennaKeywordsDescription: "คั่นด้วยเว้นวรรคสำหรับเงื่อนไข AND, หรือขึ้นบรรทัดใหม่สำหรับเงื่อนไข OR" +antennaKeywordsDescription: "คั่นด้วยช่องว่างสำหรับเงื่อนไข AND หรือด้วยการขึ้นบรรทัดใหม่สำหรับเงื่อนไข OR นะ" notifyAntenna: "แจ้งเตือนเกี่ยวกับโน้ตใหม่" withFileAntenna: "เฉพาะโน้ตที่มีไฟล์" -enableServiceworker: "เปิดใช้งานการแจ้งเตือนแบบพุชไปยังเบราว์เซอร์ของคุณ" +enableServiceworker: "เปิดใช้งาน การแจ้งเตือนแบบพุชสำหรับเบราว์เซอร์ของคุณ" antennaUsersDescription: "ระบุหนึ่งชื่อผู้ใช้ต่อบรรทัด" -caseSensitive: "อักษรพิมพ์ใหญ่-พิมพ์เล็กความหมายต่างกัน" +caseSensitive: "กรณีที่สำคัญ" withReplies: "รวมตอบกลับ" connectedTo: "บัญชีดังต่อไปนี้มีการเชื่อมต่อกัน" notesAndReplies: "โพสต์และการตอบกลับ" -withFiles: "มีไฟล์" +withFiles: "รวบรวมไฟล์" silence: "ถูกปิดปาก" -silenceConfirm: "ต้องการปิดปากผู้ใช้รายนี้ใช่ไหม?" +silenceConfirm: "นายแน่ใจแล้วหรอว่าต้องการที่จะ ปิดปาก ผู้ใช้งานรายนี้?" unsilence: "ยกเลิกการปิดปาก" -unsilenceConfirm: "ต้องการเลิกปิดปากผู้ใช้รายนี้ใช่ไหม?" +unsilenceConfirm: "นายแน่ใจแล้วหรอว่าต้องการที่จะยกเลิกปิดปากผู้ใช้งานรายนี้?" popularUsers: "ผู้ใช้ที่เป็นที่นิยม" recentlyUpdatedUsers: "ผู้ใช้ที่เพิ่งใช้งานล่าสุด" recentlyRegisteredUsers: "ผู้ใช้ที่เข้าร่วมใหม่" -recentlyDiscoveredUsers: "ผู้ใช้ที่เพิ่งค้นพบล่าสุด" -exploreUsersCount: "มีผู้ใช้ {count} ราย" -exploreFediverse: "สำรวจสหพันธ์" +recentlyDiscoveredUsers: "ผู้ใช้ที่เพิ่งค้นพบใหม่" +exploreUsersCount: "มีผู้ใช้ {จำนวน} ราย" +exploreFediverse: "สำรวจเฟดดิเวิร์ส" popularTags: "แท็กยอดนิยม" userList: "ลิสต์" about: "เกี่ยวกับ" @@ -454,10 +418,9 @@ totpDescription: "ใช้แอปยืนยันตัวตนเพื moderator: "ผู้ควบคุม" moderation: "การกลั่นกรอง" moderationNote: "โน้ตการกลั่นกรอง" -moderationNoteDescription: "คุณสามารถใส่โน้ตส่วนตัวที่เฉพาะผู้ดูแลระบบเท่านั้นที่สามารถเข้าถึงได้" addModerationNote: "เพิ่มโน้ตการกลั่นกรอง" -moderationLogs: "ปูมการควบคุมดูแล" -nUsersMentioned: "กล่าวถึงโดยผู้ใช้ {n} ราย" +moderationLogs: "บันทึกการกลั่นกรอง" +nUsersMentioned: "กล่าวถึงโดยผู้ใช้ {n} รายนี้" securityKeyAndPasskey: "ความปลอดภัยและรหัสผ่าน" securityKey: "กุญแจความปลอดภัย" lastUsed: "ใช้ล่าสุด" @@ -466,19 +429,19 @@ unregister: "เลิกติดตาม" passwordLessLogin: "เข้าสู่ระบบแบบไม่ใช้รหัสผ่าน" passwordLessLoginDescription: "อนุญาตให้เข้าสู่ระบบโดยไม่ต้องใช้รหัสผ่านโดยใช้รหัสรักษาความปลอดภัยหรือรหัสผ่านเท่านั้น" resetPassword: "รีเซ็ตรหัสผ่าน" -newPasswordIs: "รหัสผ่านใหม่คือ “{password}”" +newPasswordIs: "รหัสผ่านใหม่คือ \"{password}\"" reduceUiAnimation: "ลดภาพเคลื่อนไหว UI" -share: "แบ่งปัน" +share: "แชร์" notFound: "ไม่พบหน้าที่ต้องการ" -notFoundDescription: "ไม่พบหน้าตาม URL ที่ระบุ" -uploadFolder: "โฟลเดอร์เริ่มต้นสำหรับอัปโหลด" +notFoundDescription: "ไม่พบหน้าที่สอดคล้องตรงกันกับ URL นี้นะ" +uploadFolder: "โฟลเดอร์เริ่มต้นสำหรับอัพโหลด" markAsReadAllNotifications: "ทำเครื่องหมายการแจ้งเตือนทั้งหมดว่าอ่านแล้ว" markAsReadAllUnreadNotes: "ทำเครื่องหมายโน้ตทั้งหมดว่าอ่านแล้ว" markAsReadAllTalkMessages: "ทำเครื่องหมายข้อความทั้งหมดว่าอ่านแล้ว" help: "ช่วยเหลือ" inputMessageHere: "พิมพ์ข้อความที่นี่" close: "ปิด" -invites: "คำเชิญ" +invites: "เชิญชวน" members: "สมาชิก" transfer: "ถ่ายโอน" title: "หัวข้อ" @@ -486,64 +449,58 @@ text: "ข้อความ" enable: "เปิดใช้งาน" next: "ถัด​ไป" retype: "พิมพ์รหัสอีกครั้ง" -noteOf: "โน้ตของ {user}" +noteOf: "โน้ต โดย {user}" quoteAttached: "อ้างอิง" -quoteQuestion: "ต้องการที่จะแนบมันเพื่ออ้างอิงใช่ไหม?" -attachAsFileQuestion: "ข้อความในคลิปบอร์ดยาวเกินไป คุณต้องการแนบเป็นไฟล์ข้อความหรือไม่?" -noMessagesYet: "ยังไม่มีข้อความ" +quoteQuestion: "นายต้องการที่จะอ้างอิงหรอ?" +noMessagesYet: "ยังไม่มีข้อความนะ" newMessageExists: "คุณมีข้อความใหม่" -onlyOneFileCanBeAttached: "สามารถแนบไฟล์ได้เพียงไฟล์เดียวต่อ 1 ข้อความ" -signinRequired: "ก่อนดำเนินการต่อ กรุณาลงทะเบียนหรือเข้าสู่ระบบ" -signinOrContinueOnRemote: "เพื่อดำเนินการต่อได้ คุณต้องไปที่เซิร์ฟเวอร์ที่คุณใช้งานอยู่ หรือลงทะเบียน/เข้าสู่ระบบเซิร์ฟเวอร์นี้" -invitations: "คำเชิญ" -invitationCode: "รหัสเชิญ" +onlyOneFileCanBeAttached: "คุณสามารถแนบไฟล์กับข้อความได้เพียงไฟล์เดียวเท่านั้นนะ" +signinRequired: "กรุณาลงทะเบียนหรือลงชื่อเข้าใช้ก่อนดำเนินการต่อนะ" +invitations: "เชิญชวน" +invitationCode: "รหัสคำเชิญ" checking: "Checking" available: "พร้อมใช้งาน" unavailable: "ไม่พร้อมใช้" -usernameInvalidFormat: "สามารถใช้ a~z A~Z 0~9 และ _ ได้" +usernameInvalidFormat: "คุณสามารถใช้อักษรตัวพิมพ์ใหญ่และตัวพิมพ์เล็ก ตัวเลข และขีดล่างได้นะ ( a-z , A-Z , 0-9 , รวมไปถึงอักษรพิเศษเช่น + * / , . - อื่นๆเป็นต้น )" tooShort: "สั้นเกินไปนะ" tooLong: "ยาวเกินไปนะ" -weakPassword: "รหัสผ่านแย่มาก" +weakPassword: "รหัสผ่าน แย่มาก" normalPassword: "รหัสผ่านปกติ" strongPassword: "รหัสผ่านรัดกุมมาก" passwordMatched: "ถูกต้อง!" passwordNotMatched: "ไม่ถูกต้อง" -signinWith: "เข้าสู่ระบบด้วย {x}" -signinFailed: "ไม่สามารถเข้าสู่ระบบได้ กรุณาตรวจสอบชื่อผู้ใช้และรหัสผ่าน" +signinWith: "ลงชื่อเข้าใช้ด้วย {x}" +signinFailed: "ไม่สามารถลงชื่อผู้เข้าใช้ได้ เนื่องจาก ชื่อผู้ใช้หรือรหัสผ่านที่คุณป้อนนั้นไม่ถูกต้องนะ" or: "หรือ" language: "ภาษา" uiLanguage: "ภาษาอินเทอร์เฟซผู้ใช้งาน" aboutX: "เกี่ยวกับ {x}" -emojiStyle: "สไตล์ของเอโมจิ" +emojiStyle: "สไตล์อิโมจิ" native: "ภาษาแม่" -menuStyle: "สไตล์เมนู" -style: "สไตล์" -drawer: "ตัววาด" -popup: "ป๊อปอัพ" -showNoteActionsOnlyHover: "แสดงการดำเนินการโน้ตเมื่อโฮเวอร์(วางเมาส์เหนือ)เท่านั้น" -showReactionsCount: "แสดงจำนวนรีแอกชั่นในโน้ต" -noHistory: "ไม่มีประวัติ" +disableDrawer: "อย่าใช้ลิ้นชักสไตล์เมนู" +showNoteActionsOnlyHover: "แสดงการดำเนินการเฉพาะโน้ตเมื่อโฮเวอร์" +noHistory: "ไม่มีรายการ" signinHistory: "ประวัติการเข้าสู่ระบบ" enableAdvancedMfm: "เปิดใช้งาน MFM ขั้นสูง" -enableAnimatedMfm: "เปิดการใช้งาน MFM แบบเคลื่อนไหว" +enableAnimatedMfm: "เปิดการใช้งาน MFM ด้วยแอนิเมชั่น" doing: "กำลังประมวลผล......" category: "หมวดหมู่" tags: "นามแฝง" docSource: "ที่มาของเอกสารนี้" createAccount: "สร้างบัญชี" -existingAccount: "บัญชีที่มีอยู่แล้ว" +existingAccount: "บัญชีที่มีอยู่" regenerate: "สร้างอีกครั้ง" fontSize: "ขนาดตัวอักษร" -mediaListWithOneImageAppearance: "ความสูงของรายการสื่อที่มีเพียงรูปเดียว" +mediaListWithOneImageAppearance: "ความสูงของลิสต์สื่อจะต้องมีรูปภาพเดียวเท่านั้น" limitTo: "จำกัดไว้ที่ {x}" noFollowRequests: "คุณไม่มีคำขอติดตามที่รอดำเนินการ" openImageInNewTab: "เปิดรูปภาพในแท็บใหม่" dashboard: "หน้ากระดานหลัก" -local: "ท้องถิ่น" +local: "ในพื้นที่" remote: "ระยะไกล" total: "รวมทั้งหมด" -weekOverWeekChanges: "เทียบกับสัปดาห์ก่อน" -dayOverDayChanges: "เทียบกับเมื่อวาน" +weekOverWeekChanges: "เปลี่ยนแปลงไปเมื่อสัปดาห์ที่แล้ว" +dayOverDayChanges: "เปลี่ยนแปลงไปเมื่อวานนี้" appearance: "ภาพลักษณ์" clientSettings: "การตั้งค่าไคลเอนต์" accountSettings: "ตั้งค่าบัญชี" @@ -552,29 +509,28 @@ promote: "โปรโมท" numberOfDays: "จำนวนวัน" hideThisNote: "ซ่อนโน้ตนี้" showFeaturedNotesInTimeline: "แสดงโน้ตเด่นในไทม์ไลน์" -objectStorage: "การจัดเก็บในรูปแบบอ็อบเจกต์" -useObjectStorage: "ใช้การจัดเก็บในรูปแบบอ็อบเจกต์" -objectStorageBaseUrl: "Base URL" +objectStorage: "อ็อบเจ็กต์ ที่จัดเก็บ" +useObjectStorage: "ใช้ อ็อบเจ็กต์ ที่จัดเก็บ" +objectStorageBaseUrl: "URL ฐาน" objectStorageBaseUrlDesc: "URL ที่ใช้เป็นข้อมูลอ้างอิง ระบุ URL ของ CDN หรือ Proxy ถ้าหากคุณใช้อย่างใดอย่างหนึ่ง\n สำหรับการใช้งาน S3 'https://.s3.amazonaws.com' และสำหรับ GCS หรือบริการที่เทียบเท่าใช้ 'https://storage.googleapis.com/', เป็นต้น" objectStorageBucket: "Bucket" -objectStorageBucketDesc: "โปรดระบุชื่อบัคเก็ตของบริการที่ใช้อยู่" +objectStorageBucketDesc: "โปรดระบุชื่อที่เก็บข้อมูลที่ใช้กับผู้ให้บริการของคุณ" objectStoragePrefix: "คำนำหน้า" -objectStoragePrefixDesc: "ไฟล์ทั้งหมดจะถูกเก็บไว้ภายใต้ไดเร็กทอรีที่มีคำนำหน้านี้" +objectStoragePrefixDesc: "ไฟล์ทั้งหมดจะถูกเก็บไว้ภายใต้ไดเร็กทอรีที่มีคำนำหน้านี้นะ" objectStorageEndpoint: "ปลายทาง" objectStorageEndpointDesc: "เว้นว่างไว้หากคุณใช้ AWS S3 หรือระบุปลายทางเป็น '' หรือ ':' ทั้งนี้ขึ้นอยู่กับผู้ให้บริการที่คุณใช้อยู่ด้วย" objectStorageRegion: "ภูมิภาค" -objectStorageRegionDesc: "ระบุภูมิภาค เช่น ‘xx-east-1’ หากบริการของคุณไม่แยกภูมิภาค ให้ระบุเป็น ‘us-east-1’ หรือเว้นวางไว้หากใช้ AWS configuration files / environment variables" +objectStorageRegionDesc: "ระบุภูมิภาค เช่น 'xx-east-1' ถ้าหากบริการของคุณไม่ได้แยกความแตกต่างระหว่างภูมิภาคก็ให้ เว้นว่างไว้หรือป้อน 'us-east-1'" objectStorageUseSSL: "ใช้ SSL" objectStorageUseSSLDesc: "ปิดการทำงานนี้ไว้ ถ้าหากคุณจะไม่ใช้ HTTPS สำหรับการเชื่อมต่อ API" objectStorageUseProxy: "เชื่อมต่อผ่านพร็อกซี" objectStorageUseProxyDesc: "ปิดสิ่งนี้ไว้ถ้าหากคุณจะไม่ใช้ Proxy สำหรับการเชื่อมต่อ API" -objectStorageSetPublicRead: "ตั้งค่าเป็น “public-read” เมื่ออัปโหลด" -s3ForcePathStyleDesc: "เมื่อเปิดใช้งาน s3ForcePathStyle จะบังคับให้ ระบุชื่อบัคเก็ตเป็นส่วนหนึ่งของพาธ แทนที่จะเป็นชื่อโฮสต์ใน URL, อาจจำเป็นต้องเปิดใช้งานตัวเลือกนี้เมื่อใช้กับ Minio ที่โฮสต์เองหรือบริการที่คล้ายกัน" -serverLogs: "ปูมของเซิร์ฟเวอร์" +objectStorageSetPublicRead: "ตั้งค่า \"public-read\" ในการอัปโหลด" +s3ForcePathStyleDesc: "ถ้าหากเปิดใช้งาน s3ForcePathStyle ชื่อบัคเก็ตนั้นอาจจะต้องรวมอยู่ในเส้นทางของ URL ซึ่งตรงข้ามกับชื่อโฮสต์ของ URL คุณอาจจะต้องเปิดใช้งานการตั้งค่านี้เมื่อใช้บริการต่างๆ เช่น อินสแตนซ์ Minio ที่โฮสต์เองนะ" +serverLogs: "บันทึกของเซิร์ฟเวอร์" deleteAll: "ลบทั้งหมด" showFixedPostForm: "แสดงแบบฟอร์มการโพสต์ที่ด้านบนสุดของไทม์ไลน์" -showFixedPostFormInChannel: "แสดงแบบฟอร์มการโพสต์ที่ด้านบนของไทม์ไลน์ (ช่อง)" -withRepliesByDefaultForNewlyFollowed: "แสดงการตอบกลับจากผู้ใช้ที่คุณเพิ่งติดตามลงไทม์ไลน์ตามค่าเริ่มต้น" +showFixedPostFormInChannel: "แสดงแบบฟอร์มกำลังโพสต์ที่ด้านบนของไทม์ไลน์ (แชนแนล)" newNoteRecived: "มีโน้ตใหม่" sounds: "เสียง" sound: "เสียง" @@ -582,12 +538,10 @@ listen: "ฟัง" none: "ไม่มี" showInPage: "แสดงในเพจ" popout: "ป๊อปเอาต์" -volume: "ระดับเสียง" -masterVolume: "ระดับเสียงหลัก" -notUseSound: "ไม่ใช้เสียง" -useSoundOnlyWhenActive: "มีเสียงออกเฉพาะตอนกำลังใช้ Misskey อยู่เท่านั้น" +volume: "ความดัง" +masterVolume: "มาสเตอร์วอลุ่ม" details: "รายละเอียด" -chooseEmoji: "เลือกเอโมจิ" +chooseEmoji: "เลือกโมจิของเธอ" unableToProcess: "ไม่สามารถดำเนินการให้เสร็จสิ้นได้" recentUsed: "ใช้ล่าสุด" install: "ติดตั้ง" @@ -598,39 +552,37 @@ installedDate: "วันที่ติดตั้ง" lastUsedDate: "ใช้งานครั้งล่าสุด" state: "สถานะ" sort: "เรียงลำดับ" -ascendingOrder: "เรียงลำดับขึ้น" -descendingOrder: "เรียงลำดับลง" -scratchpad: "Scratchpad" -scratchpadDescription: "Scratchpad ให้สภาพแวดล้อมสำหรับการทดลอง AiScript คุณสามารถเขียนโค้ด/สั่งดำเนินการ/ตรวจสอบผลลัพธ์ ของการโต้ตอบกับ Misskey ได้" -uiInspector: "ตัวตรวจสอบ UI" -uiInspectorDescription: "คุณสามารถตรวจสอบรายชื่อเซิร์ฟเวอร์ที่เกี่ยวข้องกับส่วนประกอบอินเตอร์เฟซผู้ใช้ (UI) บนหน่วยความจำของระบบ ส่วนประกอบ UI เหล่านี้จะถูกสร้างขึ้นโดยฟังก์ชัน Ui:C:" +ascendingOrder: "เรียงจากน้อยไปมาก" +descendingOrder: "เรียงจากมากไปน้อย" +scratchpad: "กระดานทดลอง" +scratchpadDescription: "Scratchpad เป็นการจัดเตรียมสภาพแวดล้อมสำหรับการทดลอง AiScript แต่คุณสามารถเขียน ดำเนินการ และตรวจสอบผลลัพธ์ของการโต้ตอบกับ Misskey มันได้ด้วยนะ" output: "เอาท์พุต" script: "สคริปต์" disablePagesScript: "ปิดการใช้งาน AiScript บนเพจ" updateRemoteUser: "อัปเดตข้อมูลผู้ใช้งานระยะไกล" unsetUserAvatar: "เลิกตั้งอวตาร" -unsetUserAvatarConfirm: "ต้องการเลิกตั้งอวตารใข่ไหม?" +unsetUserAvatarConfirm: "คุณแน่ใจหรือไม่ว่าต้องการเลิกตั้งอวตาร?" unsetUserBanner: "เลิกตั้งแบนเนอร์" -unsetUserBannerConfirm: "ต้องการเลิกตั้งแบนเนอร์?" +unsetUserBannerConfirm: "คุณแน่ใจหรือไม่ว่าต้องการเลิกตั้งแบนเนอร์เลยมั้ย?" deleteAllFiles: "ลบไฟล์ทั้งหมด" -deleteAllFilesConfirm: "ต้องการลบไฟล์ทั้งหมดใช่ไหม?" +deleteAllFilesConfirm: "นายแน่ใจแล้วหรอว่าต้องการที่จะลบไฟล์ทั้งหมด?" removeAllFollowing: "เลิกติดตามผู้ใช้ที่ติดตามทั้งหมด" -removeAllFollowingDescription: "จะเลิกติดตามทั้งหมดจาก {host} โปรดดำเนินการสิ่งนี้เมื่อเซิร์ฟเวอร์ดังกล่าวได้สูญหายตายจากไปแล้ว" +removeAllFollowingDescription: "การที่คุณดำเนินการนี้จะเลิกติดตามบัญชีทั้งหมดจาก {host} โปรดเรียกใช้คำสั่งสิ่งนี้หากต้องการยกเลิกอินสแตนซ์ เช่น ไม่มีอยู่แล้ว" userSuspended: "ผู้ใช้รายนี้ถูกระงับการใช้งาน" -userSilenced: "ผู้ใช้รายนี้ถูกปิดปากอยู่" +userSilenced: "ผู้ใช้รายนี้กำลังถูกปิดกั้น" yourAccountSuspendedTitle: "บัญชีนี้นั้นถูกระงับ" yourAccountSuspendedDescription: "บัญชีนี้ถูกระงับ เนื่องจากละเมิดข้อกำหนดในการให้บริการของเซิร์ฟเวอร์หรืออาจจะละเมิดหลักเกณฑ์ชุมชน หรือ อาจจะโดนร้องเรียนเรื่องการละเมิดลิขสิทธิ์และอื่นๆอย่างต่อเนื่องซ้ำๆ หากคุณคิดว่าไม่ได้ทำผิดจริงๆหรือตัดสินผิดพลาด ได้โปรดกรุณาติดต่อผู้ดูแลระบบหากคุณต้องการทราบเหตุผลโดยละเอียดเพิ่มเติม และขอความกรุณาอย่าสร้างบัญชีใหม่" tokenRevoked: "โทเค็นไม่ถูกต้อง" -tokenRevokedDescription: "โทเค็นการเข้าสู่ระบบหมดอายุ กรุณาเข้าสู่ระบบใหม่อีกครั้ง" +tokenRevokedDescription: "โทเค็นนี้หมดอายุแล้วนะค่ะกรุณาเข้าสู่ระบบอีกครั้งนะ" accountDeleted: "ลบบัญชีแล้ว" -accountDeletedDescription: "บัญชีนี้ถูกลบแล้ว" +accountDeletedDescription: "บัญชีนี้ถูกลบไปแล้วนะ" menu: "เมนู" divider: "ตัวแบ่ง" addItem: "เพิ่มรายการ" rearrange: "จัดใหม่" relays: "รีเลย์" addRelay: "เพิ่มรีเลย์" -inboxUrl: "URL ของอินบ็อกซ์" +inboxUrl: "อินบ็อกซ์ URL" addedRelays: "เพิ่มรีเลย์แล้ว" serviceworkerInfo: "ต้องเปิดใช้งานสำหรับการแจ้งเตือนแบบพุช" deletedNote: "โน้ตที่ถูกลบ" @@ -643,38 +595,37 @@ enablePlayer: "เปิดเครื่องเล่นวิดีโอ" disablePlayer: "ปิดเครื่องเล่นวิดีโอ" expandTweet: "ขยายทวีต" themeEditor: "ตัวแก้ไขธีม" -description: "คำอธิบาย" +description: "รายละเอียด" describeFile: "เพิ่มแคปชั่น" enterFileDescription: "ใส่แคปชั่น" author: "ผู้เขียน" -leaveConfirm: "มีการเปลี่ยนแปลงที่ยังไม่ได้บันทึก ต้องการละทิ้งมันใช่ไหม?" +leaveConfirm: "คุณมีการเปลี่ยนแปลงที่ไม่ได้บันทึกนะ นายต้องการทิ้งการเปลี่ยนแปลงเหล่านั้นหรอ?" manage: "การจัดการ" plugins: "ปลั๊กอิน" -preferencesBackups: "สำรองการตั้งค่า" +preferencesBackups: "ตั้งค่าการสำรองข้อมูล" deck: "เด็ค" undeck: "ออกจากเด็ค" useBlurEffectForModal: "ใช้เอฟเฟกต์เบลอสำหรับโมดอล" -useFullReactionPicker: "ใช้ตัวจิ้มรีแอคชั่นอย่างเต็มรูปแบบ" +useFullReactionPicker: "ใช้เครื่องมือเลือกปฏิกิริยาขนาดเต็ม" width: "ความกว้าง" height: "ความสูง" large: "ใหญ่" medium: "ปานกลาง" small: "เล็ก" -generateAccessToken: "สร้างโทเค็นการเข้าถึง" -permission: "สิทธิ์" -adminPermission: "สิทธิ์ของผู้ดูแลระบบ" +generateAccessToken: "สร้างการเข้าถึงโทเค็น" +permission: "การอนุญาต" enableAll: "เปิดใช้งานทั้งหมด" disableAll: "ปิดการใช้งานทั้งหมด" tokenRequested: "ให้สิทธิ์การเข้าถึงบัญชี" -pluginTokenRequestedDescription: "ปลั๊กอินนี้จะใช้สิทธิ์ตามที่ตั้งค่าไว้ที่นี่" +pluginTokenRequestedDescription: "ปลั๊กอินนี้จะสามารถใช้การอนุญาตที่ตั้งค่าไว้ที่นี่นะ" notificationType: "ประเภทการแจ้งเตือน" edit: "แก้ไข" -emailServer: "เซิร์ฟเวอร์ของอีเมล" +emailServer: "อีเมล์เซิร์ฟเวอร์" enableEmail: "เปิดใช้งานการกระจายอีเมล" -emailConfigInfo: "ใช้สำหรับการยืนยันอีเมลหรือการรีเซ็ตรหัสผ่าน" -email: "อีเมล" -emailAddress: "ที่อยู่อีเมล" -smtpConfig: "ตั้งค่าเซิร์ฟเวอร์ SMTP" +emailConfigInfo: "ใช้เพื่อยืนยันอีเมลของคุณระหว่างการสมัครหรือถ้าหากคุณลืมรหัสผ่าน" +email: "อีเมล์" +emailAddress: "ที่อยู่อีเมล์" +smtpConfig: "กำหนดค่าเซิร์ฟเวอร์ SMTP" smtpHost: "โฮสต์" smtpPort: "พอร์ต" smtpUser: "ชื่อผู้ใช้" @@ -684,49 +635,51 @@ smtpSecure: "ใช้โดยนัย SSL/TLS สำหรับการเ smtpSecureInfo: "ปิดสิ่งนี้เมื่อใช้ STARTTLS" testEmail: "ทดสอบการส่งอีเมล" wordMute: "ปิดเสียงคำ" -hardWordMute: "ปิดเสียงคำแบบแข็งโป๊ก" -regexpError: "เกิดข้อผิดพลาดใน regular expression" -regexpErrorDescription: "เกิดข้อผิดพลาดใน regular expression บรรทัดที่ {line} ของการปิดเสียงคำ {tab} :" -instanceMute: "ปิดเสียงเซิร์ฟเวอร์" +hardWordMute: "ปิดเสียงคำยาก" +regexpError: "ข้อผิดพลาดของนิพจน์ทั่วไป" +regexpErrorDescription: "เกิดข้อผิดพลาดในนิพจน์ทั่วไปในบรรทัดที่ {line} ของการปิดเสียงคำ {tab} ของคุณ:" +instanceMute: "ปิดเสียง อินสแตนซ์" userSaysSomething: "{name} พูดอะไรบางอย่าง" makeActive: "เปิดใช้งาน" display: "แสดงผล" copy: "คัดลอก" metrics: "เมตริก" overview: "ภาพรวม" -logs: "ปูม" +logs: "บันทึกข้อมูลระบบ" delayed: "ดีเลย์" database: "ฐานข้อมูล" -channel: "ช่อง" +channel: "แชนแนล" create: "สร้าง" notificationSetting: "ตั้งค่าการแจ้งเตือน" notificationSettingDesc: "เลือกประเภทการแจ้งเตือนที่ต้องการจะแสดง" useGlobalSetting: "ใช้การตั้งค่าส่วนกลาง" -useGlobalSettingDesc: "เมื่อเปิดใช้งาน ใช้การตั้งค่าการแจ้งเตือนจากบัญชีคุณ เมื่อปิดใช้งาน สามารถตั้งค่าได้อย่างอิสระ" +useGlobalSettingDesc: "หากเปิดไว้ ระบบจะใช้การตั้งค่าการแจ้งเตือนของบัญชีของคุณ หากปิดอยู่ สามารถทำการกำหนดค่าแต่ละรายการได้นะ" other: "อื่น ๆ" regenerateLoginToken: "สร้างโทเค็นการเข้าสู่ระบบอีกครั้ง" regenerateLoginTokenDescription: "สร้างโทเค็นใหม่ที่ใช้ภายในระหว่างการเข้าสู่ระบบ โดยตามหลักปกติแล้วการดำเนินการนี้ไม่จำเป็น หากสร้างใหม่ อุปกรณ์ทั้งหมดจะถูกออกจากระบบนะ" -theKeywordWhenSearchingForCustomEmoji: "คีย์เวิร์ดสำหรับใช้ค้นหาเอโมจิที่กำหนดเอง" setMultipleBySeparatingWithSpace: "คั่นหลายรายการด้วยช่องว่าง" -fileIdOrUrl: "ID ของไฟล์ หรือ URL" +fileIdOrUrl: "ไฟล์ ID หรือ URL" behavior: "พฤติกรรม" sample: "ตัวอย่าง" abuseReports: "รายงาน" reportAbuse: "รายงาน" reportAbuseRenote: "รายงานรีโน้ต" -reportAbuseOf: "รายงาน {name}" +reportAbuseOf: "รายงาน {ชื่อ}" fillAbuseReportDescription: "กรุณากรอกรายละเอียดเกี่ยวกับรายงานนี้ หากเป็นเรื่องเกี่ยวกับโน้ตโดยเฉพาะ ได้โปรดระบุ URL" abuseReported: "เราได้ส่งรายงานของคุณไปแล้ว ขอบคุณมากๆนะ" -reporter: "ผู้รายงาน" -reporteeOrigin: "ปลายทางรายงาน" -reporterOrigin: "แหล่งผู้รายงาน" +reporter: "นักข่าว" +reporteeOrigin: "รายงานต้นทาง" +reporterOrigin: "นักข่าวต้นทาง" +forwardReport: "ส่งต่อรายงานไปยังอินสแตนซ์ระยะไกล" +forwardReportIsAnonymous: "แทนที่จะเป็นบัญชีของคุณ บัญชีระบบที่ไม่ระบุตัวตนจะแสดงเป็นนักข่าวที่อินสแตนซ์ระยะไกล" send: "ส่ง" +abuseMarkAsResolved: "ทำเครื่องหมายรายงานว่าแก้ไขแล้ว" openInNewTab: "เปิดในแท็บใหม่" openInSideView: "เปิดในมุมมองด้านข้าง" defaultNavigationBehaviour: "พฤติกรรมการนำทางที่เป็นค่าเริ่มต้น" editTheseSettingsMayBreakAccount: "การแก้ไขการตั้งค่าเหล่านี้อาจทำให้บัญชีของคุณเสียหายนะ" -instanceTicker: "ข้อมูลเซิร์ฟเวอร์ของโน้ต" -waitingFor: "กำลังรอ {x}" +instanceTicker: "ข้อมูลอินสแตนซ์ของบันทึกย่อ" +waitingFor: "กำลังรอคอย {x}" random: "สุ่มค่า" system: "ระบบ" switchUi: "สลับ UI" @@ -736,7 +689,7 @@ createNew: "สร้างใหม่" optional: "ไม่บังคับ" createNewClip: "สร้างคลิปใหม่" unclip: "ลบคลิป" -confirmToUnclipAlreadyClippedNote: "โน้ตนี้เป็นส่วนหนึ่งของคลิป “{name}” อยู่แล้ว ต้องการนำมันออกจากคลิปใช่ไหม?" +confirmToUnclipAlreadyClippedNote: "โน้ตนี้เป็นส่วนหนึ่งของคลิป \"{name}\" แล้ว คุณต้องการลบออกจากคลิปนี้แทนอย่างงั้นหรอ?" public: "สาธารณะ" private: "ส่วนตัว" i18nInfo: "Misskey กำลังได้รับการแปลเป็นภาษาต่างๆ โดยอาสาสมัคร คุณสามารถช่วยเหลือได้ที่ {link}" @@ -749,8 +702,8 @@ repliedCount: "จำนวนของการตอบกลับที่ renotedCount: "จำนวนรีโน้ตที่ได้รับแล้ว" followingCount: "จำนวนบัญชีที่ติดตาม" followersCount: "จำนวนผู้ติดตาม" -sentReactionsCount: "จำนวนรีแอคชั่นที่ส่ง" -receivedReactionsCount: "จำนวนรีแอคชั่นที่ได้รับ" +sentReactionsCount: "จำนวนปฏิกิริยาที่ส่ง" +receivedReactionsCount: "จำนวนปฏิกิริยาที่ได้รับ" pollVotesCount: "จำนวนโหวตที่ส่งไป" pollVotedCount: "จำนวนโหวตที่ได้รับ" yes: "ใช่" @@ -758,108 +711,107 @@ no: "ไม่" driveFilesCount: "จำนวนไฟล์ไดรฟ์" driveUsage: "การใช้พื้นที่ไดรฟ์" noCrawle: "ปฏิเสธการจัดทำดัชนีของโปรแกรมรวบรวมข้อมูล" -noCrawleDescription: "ขอให้เครื่องมือค้นหาไม่จัดทำดัชนีหน้าโปรไฟล์ โน้ต หน้าเพจ ฯลฯ" -lockedAccountInfo: "แม้ว่าการอนุมัติการติดตามถูกเปิดใช้งานอยู่ทุกคนก็ยังคงสามารถเห็นโน้ตของคุณได้ เว้นแต่ว่าคุณจะเปลี่ยนการเปิดเผยโน้ตของคุณเป็น “เฉพาะผู้ติดตาม”" -alwaysMarkSensitive: "ทำเครื่องหมายว่ามีเนื้อหาละเอียดอ่อนเป็นค่าเริ่มต้น" +noCrawleDescription: "ขอให้เครื่องมือค้นหาไม่จัดทำดัชนีหน้าโปรไฟล์ บันทึกย่อ หน้า ฯลฯ" +lockedAccountInfo: "เว้นแต่ว่าคุณจะต้องตั้งค่าการเปิดเผยโน้ตเป็น \"ผู้ติดตามเท่านั้น\" โน้ตย่อของคุณจะปรากฏแก่ทุกคน ถึงแม้ว่าคุณจะเป็นกำหนดให้ผู้ติดตามต้องได้รับการอนุมัติด้วยตนเองก็ตาม" +alwaysMarkSensitive: "ทำเครื่องหมายเป็น NSFW เป็นค่าเริ่มต้น" loadRawImages: "โหลดภาพต้นฉบับแทนการแสดงภาพขนาดย่อ" disableShowingAnimatedImages: "ไม่ต้องเล่นภาพเคลื่อนไหว" -highlightSensitiveMedia: "ไฮไลท์สื่อที่มีเนื้อหาละเอียดอ่อน" -verificationEmailSent: "ได้ส่งอีเมลยืนยันแล้ว กรุณาเข้าลิงก์ที่ระบุในอีเมลเพื่อทำการตั้งค่าให้เสร็จสิ้น" +highlightSensitiveMedia: "ไฮไลท์สื่อที่ละเอียดอ่อน" +verificationEmailSent: "ส่งอีเมลยืนยันแล้วนะ ได้โปรดกรุณาไปที่ลิงก์ที่รวมไว้เพื่อทำการตรวจสอบให้เสร็จสิ้น" notSet: "ไม่ได้ตั้งค่า" emailVerified: "อีเมลได้รับการยืนยันแล้ว" noteFavoritesCount: "จำนวนโน้ตที่ชื่นชอบ" -pageLikesCount: "จำนวนเพจที่ถูกใจ" +pageLikesCount: "จำนวนเพจที่ชอบ" pageLikedCount: "จำนวนการกดถูกใจเพจที่ได้รับแล้ว" contact: "ติดต่อ" useSystemFont: "ใช้ฟอนต์เริ่มต้นของระบบ" clips: "คลิป" experimentalFeatures: "ฟังก์ชั่นทดสอบ" experimental: "ทดลอง" -thisIsExperimentalFeature: "นี่เป็นฟีเจอร์ทดลอง ซึ่งอาจมีการเปลี่ยนแปลงการทำงาน และอาจไม่ทำงานตามที่ตั้งใจไว้" +thisIsExperimentalFeature: "นี่คือฟีเจอร์ทดลองนะค่ะ ฟังก์ชันการทำงานบางอย่างอาจเปลี่ยนแปลงได้ และอาจไม่ทำงานหรือไม่เสถียรตามที่ตั้งใจไว้นะ" developer: "สำหรับนักพัฒนา" -makeExplorable: "ทำให้บัญชีมองเห็นใน “สำรวจ”" -makeExplorableDescription: "ถ้าหากคุณปิดการทำงานนี้ บัญชีของคุณนั้นจะไม่แสดงในส่วน “สำรวจ”" +makeExplorable: "ทำให้บัญชีมองเห็นใน \"สำรวจ\"" +makeExplorableDescription: "ถ้าหากคุณปิดการทำงานนี้ บัญชีของคุณนั้นจะไม่แสดงในส่วน \"สำรวจ\" นะ" showGapBetweenNotesInTimeline: "แสดงช่องว่างระหว่างโพสต์บนไทม์ไลน์" duplicate: "ทำซ้ำ" left: "ซ้าย" -center: "กึ่งกลาง" +center: "ศูนย์กลาง" wide: "กว้าง" narrow: "ชิด" -reloadToApplySetting: "การตั้งค่านี้จะมีผลหลังจากโหลดหน้าซ้ำเท่านั้น ต้องการที่จะโหลดใหม่เลยไหม?" -needReloadToApply: "ต้องรีโหลดเพื่อให้การเปลี่ยนแปลงมีผล" +reloadToApplySetting: "การตั้งค่านี้จะมีผลหลังจากโหลดหน้าซ้ำเท่านั้น ต้องการที่จะโหลดใหม่เลยมั้ย" +needReloadToApply: "จำเป็นต้องโหลดซ้ำถึงจะมีผลนะ" showTitlebar: "แสดงแถบชื่อ" clearCache: "ล้างแคช" -onlineUsersCount: "{n} รายกำลังออนไลน์" +onlineUsersCount: "{n} ผู้ใช้คนนี้กำลังออนไลน์" nUsers: "{n} ผู้ใช้งาน" nNotes: "{n} โน้ต" -sendErrorReports: "ส่งรายงานข้อผิดพลาด" -sendErrorReportsDescription: "เมื่อเปิดใช้งาน การแจ้งข้อผิดพลาดจะถูกแชร์กับ Misskey เมื่อเกิดปัญหา ซึ่งช่วยในการปรับปรุงคุณภาพของซอฟต์แวร์ ข้อมูลข้อผิดพลาดอาจรวมถึงเวอร์ชันของระบบปฏิบัติการ ประเภทของเบราว์เซอร์ และประวัติการใช้งาน ฯลฯ" +sendErrorReports: "ส่งรายงานว่าข้อผิดพลาด" +sendErrorReportsDescription: "เมื่อเปิดใช้งาน ข้อมูลข้อผิดพลาดโดยรายละเอียดนั้นจะถูกแชร์ให้กับ Misskey เมื่อเกิดปัญหา ซึ่งช่วยปรับปรุงคุณภาพของ Misskey\nซึ่งจะรวมถึงข้อมูล เช่น เวอร์ชั่นของระบบปฏิบัติการ เบราว์เซอร์ที่คุณใช้ กิจกรรมของคุณใน Misskey เป็นต้น" myTheme: "ธีมของฉัน" -backgroundColor: "สีพื้นหลัง" -accentColor: "สีหลัก" +backgroundColor: "ภาพพื้นหลัง" +accentColor: "รูปแบบสี" textColor: "สีข้อความ" saveAs: "บันทึกเป็น..." advanced: "ขั้นสูง" advancedSettings: "การตั้งค่าขั้นสูง" value: "ค่า" createdAt: "สร้างเมื่อ" -updatedAt: "อัปเดตล่าสุด" +updatedAt: "อัพเดทล่าสุด" saveConfirm: "บันทึกเปลี่ยนแปลงมั้ย?" -deleteConfirm: "ต้องการลบใช่ไหม?" +deleteConfirm: "ลบจริงๆเหรอ?" invalidValue: "ค่านี้ไม่ถูกต้อง" registry: "ทะเบียน" closeAccount: "ปิด บัญชี" currentVersion: "เวอร์ชั่นปัจจุบัน" -latestVersion: "เวอร์ชั่นล่าสุด" +latestVersion: "รุ่นปัจจุบัน" youAreRunningUpToDateClient: "คุณกำลังใช้ไคลเอ็นต์เวอร์ชันใหม่ล่าสุดนะ" newVersionOfClientAvailable: "มีไคลเอ็นต์เวอร์ชันใหม่กว่าของคุณพร้อมใช้งานนะ" usageAmount: "การใช้งาน" capacity: "ความจุ" inUse: "ใช้แล้ว" editCode: "แก้ไขโค้ด" -apply: "นำไปใช้" -receiveAnnouncementFromInstance: "รับการแจ้งเตือนจากเซิร์ฟเวอร์นี้" -emailNotification: "การแจ้งเตือนทางอีเมล" +apply: "ตกลง" +receiveAnnouncementFromInstance: "รับการแจ้งเตือนจากอินสแตนซ์นี้" +emailNotification: "การแจ้งเตือนทางอีเมล์" publish: "เผยแพร่" inChannelSearch: "ค้นหาในช่อง" -useReactionPickerForContextMenu: "คลิกขวาเพื่อเปิดตัวจิ้มรีแอคชั่น" -typingUsers: "{users} กำลังพิมพ์..." +useReactionPickerForContextMenu: "เปิดตัวเลือกปฏิกิริยาเมื่อคลิกขวา" +typingUsers: "{users} กำลัง/กำลังพิมพ์..." jumpToSpecifiedDate: "ข้ามไปยังวันที่เฉพาะเจาะจง" showingPastTimeline: "กำลังแสดงผลไทม์ไลน์เก่า" clear: "ล้าง" markAllAsRead: "ทำเครื่องหมายทั้งหมดว่าอ่านแล้ว" goBack: "ย้อนกลับ" -unlikeConfirm: "ต้องการเลิกถูกใจใช่ไหม?" +unlikeConfirm: "ลบไลค์ของคุณออกจริงๆหรอ" fullView: "มุมมองแบบเต็ม" quitFullView: "ออกจากมุมมองแบบเต็ม" addDescription: "เพิ่มคำอธิบาย" -userPagePinTip: "ปักหมุดโน้ตให้แสดงที่นี่ได้โดยเลือกเมนู “ปักหมุด” ของโน้ตนั้นๆ" +userPagePinTip: "คุณสามารถแสดงผลโน้ตย่อได้ที่นี่โดยเลือก \"ปักหมุดที่โปรไฟล์\" จากเมนูของโน้ตย่อแต่ละรายการนะ" notSpecifiedMentionWarning: "โน้ตนี้มีการกล่าวถึงผู้ใช้งานที่ไม่รวมอยู่ในผู้รับ" info: "เกี่ยวกับ" userInfo: "ข้อมูลผู้ใช้" unknown: "ไม่ทราบสถานะ" onlineStatus: "สถานะออนไลน์" hideOnlineStatus: "ซ่อนสถานะออนไลน์" -hideOnlineStatusDescription: "การซ่อนสถานะออนไลน์อาจทำให้ฟังก์ชันบางอย่าง เช่น การค้นหา สะดวกน้อยลง" +hideOnlineStatusDescription: "การซ่อนสถานะออนไลน์ของคุณช่วยลดความสะดวกของคุณสมบัติบางอย่าง เช่น การค้นหา อ่ะนะ" online: "ออนไลน์" active: "ใช้งานอยู่" offline: "ออฟไลน์" -notRecommended: "ไม่แนะนำ" -botProtection: "การป้องกัน Bot" -instanceBlocking: "เซิร์ฟเวอร์ที่ถูกบล็อก/ปิดปาก" +notRecommended: "ไม่ใช้งาน" +botProtection: "การป้องกัน Bot (or AI)" +instanceBlocking: "อินสแตนซ์ที่ถูกบล็อก" selectAccount: "เลือกบัญชี" switchAccount: "สลับบัญชีผู้ใช้" enabled: "เปิดใช้งาน" disabled: "ปิดการใช้งาน" quickAction: "ปุ่มลัด" -user: "ผู้ใช้" +user: "ผู้ใช้งาน" administration: "การจัดการ" accounts: "บัญชีผู้ใช้" switch: "สลับ" -noMaintainerInformationWarning: "ยังไม่ได้ตั้งค่าข้อมูลของผู้ดูแลระบบ" -noInquiryUrlWarning: "ยังไม่ได้ตั้งค่า URL สำหรับการติดต่อสอบถาม" -noBotProtectionWarning: "ยังไม่ได้ตั้งค่าการป้องกันบอต" -configure: "ตั้งค่า" +noMaintainerInformationWarning: "ข้อมูลผู้ดูแลไม่ได้รับการกำหนดค่านะ" +noBotProtectionWarning: "ไม่ได้กำหนดค่าการป้องกันบอทนะ" +configure: "กำหนดค่า" postToGallery: "สร้างโพสต์แกลเลอรี่ใหม่" postToHashtag: "โพสต์ไปที่แฮชแท็กนี้" gallery: "แกลเลอรี่" @@ -868,19 +820,19 @@ popularPosts: "โพสต์ติดอันดับ" shareWithNote: "แบ่งปันด้วยโน้ต" ads: "โฆษณา" expiration: "กำหนดเวลา" -startingperiod: "เริ่มเมื่อ" -memo: "เมโม" +startingperiod: "เริ่ม" +memo: "ข้อควรจำ" priority: "ลำดับความสำคัญ" high: "สูง" middle: "ปานกลาง" low: "ต่ำ" -emailNotConfiguredWarning: "ยังไม่ได้ตั้งค่าที่อยู่อีเมล" +emailNotConfiguredWarning: "ไม่ได้ตั้งค่าที่อยู่อีเมลนะ" ratio: "อัตราส่วน" previewNoteText: "แสดงตัวอย่าง" customCss: "CSS ที่กำหนดเอง" -customCssWarn: "ควรใช้การตั้งค่านี้เฉพาะต่อเมื่อคุณรู้มันใช้ทำอะไร การตั้งค่าที่ไม่เหมาะสมอาจทำให้ไคลเอ็นต์ไม่สามารถใช้งานได้อย่างถูกต้อง" +customCssWarn: "ควรใช้การตั้งค่านี้เฉพาะต่อเมื่อคุณรู้ว่าการตั้งค่านี้ใช้ทำอะไร การป้อนค่าที่ไม่เหมาะสมอาจทำให้ไคลเอ็นต์หยุดทำงานตามปกติได้นะ" global: "ทั่วโลก" -squareAvatars: "แสดงผลอวตารเป็นสี่เหลี่ยม" +squareAvatars: "แสดงผลอวตารสี่เหลี่ยม" sent: "ส่ง" received: "ได้รับแล้ว" searchResult: "ผลการค้นหา" @@ -896,11 +848,11 @@ accountDeletionInProgress: "กำลังดำเนินการลบบ usernameInfo: "ชื่อที่ระบุบัญชีของคุณจากผู้อื่นในเซิร์ฟเวอร์นี้ คุณสามารถใช้ตัวอักษร (a~z, A~Z), ตัวเลข (0~9) หรือขีดล่าง (_) ชื่อผู้ใช้ไม่สามารถเปลี่ยนแปลงได้ในภายหลัง" aiChanMode: "โหมด Ai " devMode: "โหมดนักพัฒนา" -keepCw: "คงการเตือนเนื้อหาไว้" -pubSub: "บัญชี Pub/Sub" +keepCw: "เก็บคำเตือนเนื้อหา" +pubSub: "บัญชีผับ/ย่อย" lastCommunication: "การสื่อสารครั้งสุดท้ายล่าสุด" resolved: "คลี่คลายแล้ว" -unresolved: "ยังไม่ได้รับการแก้ไข" +unresolved: "รอการเฉลย" breakFollow: "ลบผู้ติดตาม" breakFollowConfirm: "ลบผู้ติดตามนี้ออกจริงหรอ?" itsOn: "เปิดใช้งาน" @@ -908,39 +860,36 @@ itsOff: "ปิดใช้งาน" on: "เปิด" off: "ปิด" emailRequiredForSignup: "จำเป็นต้องการใช้ที่อยู่อีเมลสำหรับการสมัคร" -unread: "ยังไม่ได้อ่าน" +unread: "ไม่ได้อ่าน" filter: "กรอง" controlPanel: "แผงควบคุม" manageAccounts: "จัดการบัญชี" -makeReactionsPublic: "ตั้งค่าประวัติการรีแอคชั่นเป็นสาธารณะ" -makeReactionsPublicDescription: "การทำเช่นนี้จะทำให้รายการรีแอคชั่นของคุณที่ผ่านมาทั้งหมดปรากฏต่อสาธารณะ" +makeReactionsPublic: "ตั้งค่าประวัติปฏิกิริยาต่อสาธารณะ" +makeReactionsPublicDescription: "การทำเช่นนี้จะทำให้รายการปฏิกิริยาที่ผ่านมาของคุณจะปรากฏต่อสาธารณะนะ" classic: "คลาสสิค" muteThread: "ปิดเสียงเธรด" -unmuteThread: "เลิกปิดเสียงเธรด" -followingVisibility: "การมองเห็นที่เรากำลังติดตาม" -followersVisibility: "การมองเห็นผู้ที่กำลังติดตามเรา" +unmuteThread: "เปิดเสียงเธรด" continueThread: "ดูความต่อเนื่องเธรด" deleteAccountConfirm: "การดำเนินการนี้จะลบบัญชีของคุณอย่างถาวรเลยนะ แน่ใจหรอดำเนินการ?" incorrectPassword: "รหัสผ่านไม่ถูกต้อง" -incorrectTotp: "รหัสยืนยันตัวตนแบบใช้ครั้งเดียวที่ท่านได้ระบุมานั้น ไม่ถูกต้องหรือหมดอายุลงแล้วค่ะ" -voteConfirm: "ต้องการโหวต “{choice}” ใช่ไหม?" +voteConfirm: "ยืนยันการโหวต \"{choice}\" มั้ย?" hide: "ซ่อน" -useDrawerReactionPickerForMobile: "แสดง ตัวจิ้มรีแอคชั่น เป็นแบบลิ้นชัก เมื่อใช้บนมือถือ" -welcomeBackWithName: "ยินดีต้อนรับการกลับมานะคะ, คุณ{name}" -clickToFinishEmailVerification: "กรุณาคลิก [{ok}] เพื่อดำเนินการยืนยันอีเมลให้เสร็จสมบูรณ์" +useDrawerReactionPickerForMobile: "แสดงผล ตัวเลือกปฏิกิริยาเป็นลิ้นชักบนมือถือ" +welcomeBackWithName: "ยินดีต้อนรับการกลับมานะคะ, {name}" +clickToFinishEmailVerification: "กรุณาคลิก [{ok}] เพื่อดำเนินการยืนยันอีเมลให้เสร็จสมบูรณ์นะ" overridedDeviceKind: "ประเภทอุปกรณ์" smartphone: "สมาร์ทโฟน" tablet: "แท็บเล็ต" auto: "อัตโนมัติ" -themeColor: "สีธีม" +themeColor: "อินสแตนซ์ Ticker Color" size: "ขนาด" numberOfColumn: "จำนวนคอลัมน์" searchByGoogle: "ค้นหา" -instanceDefaultLightTheme: "ธีมสว่างตามค่าเริ่มต้นของเซิร์ฟเวอร์" -instanceDefaultDarkTheme: "ธีมมืดตามค่าเริ่มต้นของเซิร์ฟเวอร์" +instanceDefaultLightTheme: "ธีมสว่างค่าเริ่มต้นสำหรับอินสแตนซ์" +instanceDefaultDarkTheme: "ธีมมืดค่าเริ่มต้นอินสแตนซ์" instanceDefaultThemeDescription: "ป้อนรหัสธีมในรูปแบบออบเจ็กต์" mutePeriod: "ระยะเวลาปิดเสียง" -period: "ระยะเวลา" +period: "สิ้นสุดการสำรวจความคิดเห็น" indefinitely: "ตลอดไป" tenMinutes: "10 นาที" oneHour: "1 ชั่วโมง" @@ -957,7 +906,7 @@ cropNo: "ใช้ตามที่เป็นอยู่" file: "ไฟล์" recentNHours: "ล่าสุด {n} ชั่วโมงที่แล้ว" recentNDays: "ล่าสุด {n} วันที่แล้ว" -noEmailServerWarning: "ยังไม่ได้ตั้งค่าเซิร์ฟเวอร์ของอีเมล" +noEmailServerWarning: "ไม่ได้กำหนดค่าเซิร์ฟเวอร์อีเมลนี้" thereIsUnresolvedAbuseReportWarning: "มีรายงานที่ยังไม่ได้แก้ไข" recommended: "แนะนำ" check: "ตรวจสอบ" @@ -970,29 +919,29 @@ deleteAccount: "ลบบัญชี" document: "เอกสาร" numberOfPageCache: "จำนวนหน้าเพจที่แคช" numberOfPageCacheDescription: "การเพิ่มจำนวนนี้จะช่วยเพิ่มความสะดวกให้กับผู้ใช้งาน แต่จะทำให้เซิร์ฟเวอร์โหลดมากขึ้นและต้องใช้หน่วยความจำมากขึ้นอีกด้วย" -logoutConfirm: "ต้องการออกจากระบบใช่ไหม?" -lastActiveDate: "ใช้งานล่าสุดเมื่อ" -statusbar: "แถบสถานะ" +logoutConfirm: "คุณแน่ใจว่าต้องการออกจากระบบ?" +lastActiveDate: "ใช้งานล่าสุดที่" +statusbar: "ไอคอนบนแถบสถานะ" pleaseSelect: "ตัวเลือก" -reverse: "พลิก" +reverse: "ย้อนกลับ" colored: "สี" -refreshInterval: "ความถี่ในการอัปเดต" +refreshInterval: "รอบการอัพเดต" label: "ป้ายชื่อ" type: "รูปแบบ" speed: "ความเร็ว" slow: "ช้า" fast: "เร็ว" -sensitiveMediaDetection: "การตรวจจับสื่อที่มีเนื้อหาละเอียดอ่อน" +sensitiveMediaDetection: "การตรวจจับของสื่อ NSFW" localOnly: "เฉพาะท้องถิ่น" -remoteOnly: "ระยะไกลเท่านั้น" +remoteOnly: "รีโมทเท่านั้น" failedToUpload: "การอัปโหลดล้มเหลว" cannotUploadBecauseInappropriate: "ไม่สามารถอัปโหลดไฟล์นี้ได้เนื่องจากระบบตรวจพบบางส่วนของไฟล์ว่านี้อาจจะเป็น NSFW" -cannotUploadBecauseNoFreeSpace: "ไม่สามารถอัปโหลดได้เนื่องจากไม่มีพื้นที่ว่างในไดรฟ์เหลือแล้ว" +cannotUploadBecauseNoFreeSpace: "การอัปโหลดนั้นล้มเหลวเนื่องจากไม่มีความจุของไดรฟ์" cannotUploadBecauseExceedsFileSizeLimit: "ไม่สามารถอัปโหลดไฟล์นี้ได้แล้วเนื่องจากเกินขีดจำกัดของขนาดไฟล์แล้ว" beta: "เบต้า" -enableAutoSensitive: "ทำเครื่องหมายว่ามีเนื้อหาที่ละเอียดอ่อนโดยอัตโนมัติ" -enableAutoSensitiveDescription: "อนุญาตให้ตรวจหาและทำเครื่องหมายสื่อว่ามีเนื้อหาโดยละเอียดอ่อนโดยอัตโนมัติ ผ่าน Machine Learning หากเป็นไปได้ แม้ว่าคุณจะปิดคุณสมบัตินี้ ก็อาจถูกตั้งค่าโดยอัตโนมัติ ทั้งนี้ขึ้นอยู่กับเซิร์ฟเวอร์" -activeEmailValidationDescription: "การตรวจสอบอีเมลของผู้ใช้จะเข้มงวดมากขึ้น โดยพิจารณาว่าเป็นอีเมลชั่วคราวหรือไม่ และสามารถติดต่อได้จริงหรือไม่ หากปิดการตรวจสอบนี้ จะตรวจสอบเพียงว่ารูปแบบอีเมลที่ถูกต้องหรือไม่เท่านั้น" +enableAutoSensitive: "ทำเครื่องหมาย NSFW อัตโนมัติ" +enableAutoSensitiveDescription: "อนุญาตให้ตรวจหาและทำเครื่องหมายสื่อ NSFW โดยอัตโนมัติผ่านการเรียนรู้ของเครื่องหากเป็นไปได้ แม้ว่าตัวเลือกนี้จะถูกปิดใช้งาน แต่ก็สามารถเปิดใช้งานได้ทั้งอินสแตนซ์นี้" +activeEmailValidationDescription: "เปิดใช้งานการตรวจสอบที่อยู่อีเมลให้มีความเข้มงวดยิ่งขึ้น ซึ่งอาจจะรวมไปถึงการตรวจสอบที่อยู่อีเมล์ที่ใช้แล้วทิ้งและโดยให้พิจารณาว่าสามารถสื่อสารด้วยได้หรือไม่ เมื่อไม่เลือกระบบจะตรวจสอบเฉพาะรูปแบบของอีเมลเท่านั้น" navbar: "แถบนำทาง" shuffle: "สลับ" account: "บัญชีผู้ใช้" @@ -1001,35 +950,34 @@ pushNotification: "การแจ้งเตือนแบบพุช" subscribePushNotification: "เปิดการแจ้งเตือนแบบพุช" unsubscribePushNotification: "ปิดการแจ้งเตือนแบบพุช" pushNotificationAlreadySubscribed: "การแจ้งเตือนแบบพุชได้เปิดใช้งานแล้ว" -pushNotificationNotSupported: "เบราว์เซอร์หรือเซิร์ฟเวอร์ไม่รองรับการแจ้งเตือนแบบพุช" +pushNotificationNotSupported: "เบราว์เซอร์หรืออินสแตนซ์ของคุณนั้นไม่รองรับการแจ้งเตือนแบบพุช" sendPushNotificationReadMessage: "ลบการแจ้งเตือนแบบพุชเมื่ออ่านการแจ้งเตือนหรือข้อความที่เกี่ยวข้องแล้ว" -sendPushNotificationReadMessageCaption: "อาจทำให้อุปกรณ์ของคุณใช้พลังงานมากขึ้น" -windowMaximize: "ขยายใหญ่สุด" +sendPushNotificationReadMessageCaption: "การแจ้งเตือนที่มีข้อความ \"{emptyPushNotificationMessage}\" จะแสดงขึ้นมาในช่วงระยะเวลาสั้นๆ การดำเนินการนี้อาจทำให้เพิ่มการใช้งานแบตเตอรี่ของอุปกรณ์ถ้าหากมีนะ" +windowMaximize: "ขยายใหญ่สุดแล้ว" windowMinimize: "ย่อเล็กที่สุด" windowRestore: "เลิกทำ" -caption: "คำอธิบาย" +caption: "รายละเอียด" loggedInAsBot: "ล็อกอินเป็นบอตอยู่ในขณะนี้" tools: "เครื่องมือ" cannotLoad: "ไม่สามารถโหลดได้" numberOfProfileView: "มุมมองโปรไฟล์" -like: "ถูกใจ!" -unlike: "เลิกถูกใจ" -numberOfLikes: "จำนวนยอดถูกใจ" +like: "ชื่นชอบ" +unlike: "ไม่ชอบ" +numberOfLikes: "จำนวนไลค์" show: "แสดงผล" neverShow: "ไม่ต้องแสดงข้อความนี้อีก" remindMeLater: "ไว้ครั้งหน้าแล้วกัน" -didYouLikeMisskey: "คุณชอบ Misskey ไหม?" +didYouLikeMisskey: "คุณเคยชอบ Misskey ไหม?" pleaseDonate: "Misskey เป็นซอฟต์แวร์ฟรีที่ใช้งานโดย {host} เราขอขอบคุณการสนับสนุนของคุณอย่างสูงเพื่อให้การพัฒนา Misskey สามารถดำเนินต่อไปได้!" -correspondingSourceIsAvailable: "ซอร์สโค้ดที่เกี่ยวข้องมีอยู่ที่ {anchor}" roles: "บทบาท" role: "บทบาท" noRole: "ไม่พบบทบาท" normalUser: "ผู้ใช้มาตรฐาน" undefined: "ไม่ได้กำหนด" -assign: "มอบหมาย" -unassign: "เลิกมอบหมาย" +assign: "กำหนด" +unassign: "ยังไม่มอบหมาย" color: "สี" -manageCustomEmojis: "จัดการเอโมจิที่กำหนดเอง" +manageCustomEmojis: "จัดการอีโมจิแบบกำหนดเอง" manageAvatarDecorations: "จัดการตกแต่งอวตาร" youCannotCreateAnymore: "คุณถึงขีดจํากัดการสร้างแล้วนะ" cannotPerformTemporary: "ไม่สามารถใช้การได้ชั่วคราว" @@ -1044,39 +992,33 @@ achievements: "ความสำเร็จ" gotInvalidResponseError: "การตอบสนองเซิร์ฟเวอร์ไม่ถูกต้อง" gotInvalidResponseErrorDescription: "เซิร์ฟเวอร์อาจไม่สามารถเข้าถึงได้หรืออาจจะกำลังอยู่ในระหว่างปรับปรุง กรุณาลองใหม่อีกครั้งในภายหลังนะคะ" thisPostMayBeAnnoying: "โน้ตนี้อาจจะเป็นการรบกวนผู้อื่นนะคะ" -thisPostMayBeAnnoyingHome: "โพสต์ลงไทม์ไลน์หลักเท่านั้น" -thisPostMayBeAnnoyingCancel: "ยกเลิก" -thisPostMayBeAnnoyingIgnore: "โพสต์ไปเลย ไม่ต้องปรับการมองเห็น" -collapseRenotes: "ยุบรีโน้ตที่คุณเคยเห็นแล้ว" -collapseRenotesDescription: "พับย่อโน้ตที่เคยตอบสนองหรือรีโน้ตแล้ว" +thisPostMayBeAnnoyingHome: "โพสต์ไปยังบ้านไทม์ไลน์" +thisPostMayBeAnnoyingCancel: "เลิก" +thisPostMayBeAnnoyingIgnore: "โพสต์ยังไงก็แล้วแต่" +collapseRenotes: "ยุบ renotes ที่คุณได้เห็นแล้ว" internalServerError: "เซิร์ฟเวอร์ภายในเกิดข้อผิดพลาด" -internalServerErrorDescription: "เกิดข้อผิดพลาดที่ไม่คาดคิดภายในเซิร์ฟเวอร์" +internalServerErrorDescription: "เซิร์ฟเวอร์รันค้นพบข้อผิดพลาดที่ไม่คาดคิด" copyErrorInfo: "คัดลอกรายละเอียดข้อผิดพลาด" -joinThisServer: "ลงทะเบียนในเซิร์ฟเวอร์นี้" -exploreOtherServers: "มองหาเซิร์ฟเวอร์อื่น" -letsLookAtTimeline: "มาดูไทม์ไลน์กัน" -disableFederationConfirm: "ปิดใช้งานสหพันธ์เลยใช่ไหม?" +joinThisServer: "ลงชื่อสมัครใช้ในอินสแตนซ์นี้" +exploreOtherServers: "มองหาอินสแตนซ์อื่น" +letsLookAtTimeline: "ลองดูที่ไทม์ไลน์" +disableFederationConfirm: "ปิดใช้งานสหพันธ์จริงๆหรอแน่ใจแล้วนะ?" disableFederationConfirmWarn: "โพสต์จะยังคงเป็นสาธารณะต่อไป เว้นแต่จะตั้งค่าเป็นอย่างอื่น" disableFederationOk: "ปิดการใช้งาน" -invitationRequiredToRegister: "เซิร์ฟเวอร์นี้เป็นแบบรับเชิญ เฉพาะผู้มีรหัสเชิญเท่านั้นถึงสามารถลงทะเบียนได้" -emailNotSupported: "เซิร์ฟเวอร์นี้ไม่รองรับการส่งอีเมล" +invitationRequiredToRegister: "อินสแตนซ์นี้เป็นแบบรับเชิญเท่านั้น คุณต้องป้อนรหัสเชิญ เพื่องลงทะเบียนเข้าใช้งาน" +emailNotSupported: "อินสแตนซ์นี้ไม่รองรับการส่งอีเมล" postToTheChannel: "โพสต์ลงช่อง" cannotBeChangedLater: "สิ่งนี้ไม่สามารถเปลี่ยนแปลงได้ในภายหลังนะ" reactionAcceptance: "การยอมรับรีแอคชั่น" -likeOnly: "ที่ถูกใจเท่านั้น" -likeOnlyForRemote: "ทั้งหมด (เฉพาะการถูกใจจากเซิร์ฟเวอร์ระยะไกล)" -nonSensitiveOnly: "เฉพาะไม่มีเนื้อหาละเอียดอ่อน" -nonSensitiveOnlyForLocalLikeOnlyForRemote: "เฉพาะไม่มีเนื้อหาละเอียดอ่อน (เฉพาะการถูกใจจากระยะไกลเท่านั้น)" +likeOnly: "ที่ชอบเท่านั้น" +likeOnlyForRemote: "ไลค์สำหรับอินสแตนซ์ระยะไกลเท่านั้น" +nonSensitiveOnly: "ไม่มีความอ่อนไหวเท่านั้น" +nonSensitiveOnlyForLocalLikeOnlyForRemote: "ไม่มีความอ่อนไหวเท่านั้น (เฉพาะไลค์จากระยะไกลเท่านั้น)" rolesAssignedToMe: "บทบาทที่ได้รับมอบหมายให้ฉัน" -resetPasswordConfirm: "ต้องการรีเซ็ตรหัสผ่านใช่ไหม?" -sensitiveWords: "คำที่มีเนื้อหาละเอียดอ่อน" -sensitiveWordsDescription: "โน้ตที่มีคำที่ระบุไว้จะถูกตั้งค่าการมองเห็นของให้แสดงเฉพาะในหน้าหลักเท่านั้น คั่นคำด้วยการขึ้นบรรทัดใหม่" -sensitiveWordsDescription2: "ถ้าแยกด้วยเว้นวรรคจะเป็นการระบุ AND และถ้าล้อมคำด้วยสแลช (/) จะเป็นการใช้ regular expression" -prohibitedWords: "คำต้องห้าม" -prohibitedWordsDescription: "จะแจ้งเตือนว่าเกิดข้อผิดพลาดเมื่อพยายามโพสต์โน้ตที่มีคำที่กำหนดไว้ สามารถตั้งได้หลายคำด้วยการขึ้นบรรทัดใหม่" -prohibitedWordsDescription2: "ถ้าแยกด้วยเว้นวรรคจะเป็นการระบุ AND และถ้าล้อมคำด้วยสแลช (/) จะเป็นการใช้ regular expression" -hiddenTags: "แฮชแท็กที่ซ่อนอยู่" -hiddenTagsDescription: "เลือกแท็กที่จะไม่แสดงในรายการเทรนด์ สามารถลงทะเบียนหลายแท็กได้โดยขึ้นบรรทัดใหม่" +resetPasswordConfirm: "รีเซ็ตรหัสผ่านของคุณจริงๆหรอ?" +sensitiveWords: "คำที่ละเอียดอ่อน" +sensitiveWordsDescription: "การเปิดเผยโน้ตทั้งหมดที่มีคำที่กำหนดค่าไว้จะถูกตั้งค่าเป็น \"หน้าแรก\" โดยอัตโนมัติ คุณยังสามารถแสดงหลายรายการได้โดยแยกรายการโดยใช้ตัวแบ่งบรรทัดได้นะ" +sensitiveWordsDescription2: "การใช้ช่องว่างนั้นอาจจะสร้างนิพจน์ AND และคำหลักที่มีเครื่องหมายทับล้อมรอบจะเปลี่ยนเป็นนิพจน์ทั่วไปนะ" notesSearchNotAvailable: "การค้นหาโน้ตไม่พร้อมใช้งาน" license: "ใบอนุญาต" unfavoriteConfirm: "ลบออกจากรายการโปรดแน่ใจหรอ?" @@ -1086,144 +1028,119 @@ retryAllQueuesNow: "ลองเรียกใช้คิวทั้งหม retryAllQueuesConfirmTitle: "ลองใหม่ทั้งหมดจริงๆหรอแน่ใจนะ?" retryAllQueuesConfirmText: "สิ่งนี้จะเพิ่มการโหลดเซิร์ฟเวอร์ชั่วคราวนะ" enableChartsForRemoteUser: "สร้างแผนภูมิข้อมูลผู้ใช้ระยะไกล" -enableChartsForFederatedInstances: "สร้างแผนภูมิของเซิร์ฟเวอร์ระยะไกล" -enableStatsForFederatedInstances: "ดึงข้อมูลสถิติจากเซิร์ฟเวอร์ที่อยู่ห่างไกล" -showClipButtonInNoteFooter: "เพิ่ม “คลิป” ไปยังเมนูสั่งการของโน้ต" -reactionsDisplaySize: "ขนาดของรีแอคชั่น" -limitWidthOfReaction: "จำกัดความกว้างสูงสุดของรีแอคชั่นและแสดงให้เล็กลง" -noteIdOrUrl: "ID ของโน้ต หรือ URL" +enableChartsForFederatedInstances: "สร้างแผนภูมิข้อมูลอินสแตนซ์ระยะไกล" +showClipButtonInNoteFooter: "เพิ่ม \"คลิป\" เพื่อบันทึกเมนูการทำงาน" +reactionsDisplaySize: "รีแอคชั่นแสดงผลขนาด" +noteIdOrUrl: "โน้ต ID หรือ URL" video: "วีดีโอ" videos: "วีดีโอ" -audio: "เสียง" -audioFiles: "เสียง" dataSaver: "ประหยัดข้อมูล" -accountMigration: "โยกย้ายบัญชี" +accountMigration: "การโยกย้ายบัญชี" accountMoved: "ผู้ใช้รายนี้ได้ย้ายไปยังบัญชีใหม่แล้ว:" accountMovedShort: "บัญชีนี้ถูกโอนย้ายไปแล้วค่ะ" -operationForbidden: "การดำเนินการถูกห้าม" +operationForbidden: "ห้ามดำเนินการ" forceShowAds: "แสดงโฆษณาเสมอ" -addMemo: "เพิ่มเมโม" -editMemo: "แก้ไขเมโม" -reactionsList: "รายการรีแอคชั่น" -renotesList: "รายการรีโน้ต" -notificationDisplay: "การแสดงการแจ้งเตือน" +addMemo: "เพิ่มมีโม" +editMemo: "แก้ไขมีโม" +reactionsList: "ปฏิกิริยา" +renotesList: "Renotes รีโน้ต" +notificationDisplay: "การแจ้งเตือน" leftTop: "บนซ้าย" rightTop: "บนขวา" leftBottom: "ล่างซ้าย" rightBottom: "ล่างขวา" stackAxis: "ทิศทางการซ้อน" vertical: "แนวตั้ง" -horizontal: "แนวนอน" +horizontal: "ด้านข้าง" position: "ตำแหน่ง" -serverRules: "กฎของเซิร์ฟเวอร์" -pleaseConfirmBelowBeforeSignup: "หากต้องการลงทะเบียนในเซิร์ฟเวอร์นี้ คุณต้องตรวจสอบและยอมรับสิ่งต่อไปนี้" +serverRules: "กฎของเซิฟเวอร์" +pleaseConfirmBelowBeforeSignup: "โปรดยืนยันที่ด้านล่างก่อนสมัครใช้งาน" pleaseAgreeAllToContinue: "คุณต้องยอมรับทุกช่องตรงด้านบนเพื่อดำเนินการต่อค่ะ" continue: "ดำเนินการต่อ" preservedUsernames: "ชื่อผู้ใช้ที่สงวนไว้" -preservedUsernamesDescription: "ระบุชื่อผู้ใช้ที่จะสงวนชื่อไว้ คั่นด้วยการขึ้นบรรทัดใหม่ ชื่อผู้ใช้ที่ระบุที่นี่จะไม่สามารถใช้งานได้อีกต่อไปเมื่อสร้างบัญชีใหม่ ยกเว้นเมื่อผู้ดูแลระบบสร้างบัญชี นอกจากนี้ บัญชีที่มีอยู่แล้วจะไม่ได้รับผลกระทบ" +preservedUsernamesDescription: "ลิสต์ชื่อผู้ใช้ที่จะสำรองโดยคั่นด้วยการแบ่งบรรทัดนั้น เพราะสิ่งเหล่านี้จะไม่สามารถทำได้ในระหว่างการสร้างบัญชีตามปกติ บัญชีที่มีอยู่แล้วนั้นโดยใช้ชื่อผู้ใช้เหล่านี้จะไม่ได้รับผลกระทบอะไร" createNoteFromTheFile: "เรียบเรียงโน้ตจากไฟล์นี้" archive: "เก็บถาวร" -archived: "เก็บถาวรแล้ว" -unarchive: "เลิกการเก็บถาวร" -channelArchiveConfirmTitle: "ต้องการเก็บถาวรเจ้า {name} ใช่ไหม?" -channelArchiveConfirmDescription: "เมื่อเก็บถาวรแล้ว จะไม่ปรากฏในรายการช่องหรือผลการค้นหาอีกต่อไป และจะไม่สามารถโพสต์ใหม่ได้อีกต่อไป" +channelArchiveConfirmTitle: "เก็บถาวรจริงๆ {name} มั้ย?" +channelArchiveConfirmDescription: "ช่องที่ถูกเก็บถาวรแล้วนั้นจะไม่ปรากฏในรายการช่องหรือผลการค้นหานั้นอีกต่อไปไม่สามารถเพิ่มโพสต์ใหม่ได้อีกต่อไปนะ" thisChannelArchived: "ช่องนี้ถูกเก็บถาวรแล้วนะ" displayOfNote: "การแสดงโน้ต" initialAccountSetting: "ตั้งค่าโปรไฟล์" youFollowing: "ติดตามแล้ว" -preventAiLearning: "ปฏิเสธการเรียนรู้ด้วย generative AI" -preventAiLearningDescription: "ส่งคำร้องขอไม่ให้ใช้ ข้อความในโน้ตที่โพสต์, หรือเนื้อหารูปภาพ ฯลฯ ในการเรียนรู้ของเครื่อง(machine learning) / Predictive AI / Generative AI โดยการเพิ่มแฟล็ก “noai” ลง HTML-Response ให้กับเนื้อหาที่เกี่ยวข้อง แต่ทั้งนี้ ไม่ได้ป้องกัน AI จากการเรียนรู้ได้อย่างสมบูรณ์ เนื่องจากมี AI บางตัวเท่านั้นที่จะเคารพคำขอดังกล่าว" +preventAiLearning: "ปฏิเสธการใช้งาน ในการเรียนรู้ของเครื่อง (Generative AI)" +preventAiLearningDescription: "การส่งคำร้องขอโปรแกรมรวบรวมข้อมูลไม่ให้ใช้ข้อความที่โพสต์หรือรูปภาพ ฯลฯ ในชุดข้อมูลแมชชีนเลิร์นนิง (Predictive / Generative AI) สิ่งนี้นั้นทำได้โดยการเพิ่มแฟล็กการตอบสนอง \"noai\" HTML ให้กับเนื้อหาที่เกี่ยวข้อง แต่อย่างไรก็ตามแล้ว การป้องกันโดยสมบูรณ์นั้นไม่สามารถทำได้ผ่านแฟล็กนี้เนื่องจากอาจจะทำให้ถูกเพิกเฉยได้" options: "ตัวเลือกบทบาท" specifyUser: "ผู้ใช้เฉพาะ" -lookupConfirm: "ต้องการเรียกดูข้อมูลใช่ไหม?" -openTagPageConfirm: "ต้องการเปิดหน้าแฮชแท็กใช่ไหม?" -specifyHost: "ระบุโฮสต์" failedToPreviewUrl: "ไม่สามารถดูตัวอย่างได้" update: "อัปเดต" -rolesThatCanBeUsedThisEmojiAsReaction: "บทบาทที่สามารถใช้เอโมจินี้เป็นรีแอคชั่นได้" -rolesThatCanBeUsedThisEmojiAsReactionEmptyDescription: "ถ้าหากไม่ได้ระบุบทบาท ใคร ๆ ก็สามารถใช้เอโมจินี้เพื่อรีแอคชั่นได้" +rolesThatCanBeUsedThisEmojiAsReaction: "บทบาทที่สามารถใช้อิโมจินี้เป็นรีแอคชั่นได้" +rolesThatCanBeUsedThisEmojiAsReactionEmptyDescription: "ถ้าหากไม่ได้ระบุบทบาท ทุกคนนั้นก็สามารถใช้อิโมจินี้เป็นการแสดงความรู้สึกได้นะ" rolesThatCanBeUsedThisEmojiAsReactionPublicRoleWarn: "บทบาทเหล่านี้ต้องเป็นสาธารณะ" -cancelReactionConfirm: "ต้องการลบรีแอคชั่นใช่ไหม?" -changeReactionConfirm: "ต้องการเปลี่ยนรีแอคชั่นใช่ไหม?" +cancelReactionConfirm: "ต้องการลบรีแอคชั่นของคุณจริงๆหรอ?" +changeReactionConfirm: "ต้องการเปลี่ยนรีแอคชั่นของคุณจริงๆหรอ?" later: "ไว้ทีหลัง" goToMisskey: "ถึง Misskey" -additionalEmojiDictionary: "พจนานุกรมเอโมจิเพิ่มเติม" +additionalEmojiDictionary: "พจนานุกรมอีโมจิเพิ่มเติม" installed: "ติดตั้งแล้ว" branding: "แบรนดิ้ง" enableServerMachineStats: "เผยแพร่สถานะฮาร์ดแวร์ของเซิร์ฟเวอร์" enableIdenticonGeneration: "เปิดใช้งานผู้ใช้สร้างตัวระบุ" turnOffToImprovePerformance: "การปิดส่วนนี้สามารถเพิ่มประสิทธิภาพได้" -createInviteCode: "สร้างรหัสเชิญ" +createInviteCode: "สร้างคำเชิญ" createWithOptions: "สร้างด้วยตัวเลือก" -createCount: "จำนวนรหัสเชิญ" -inviteCodeCreated: "สร้างรหัสเชิญแล้ว" -inviteLimitExceeded: "จำนวนรหัสเชิญที่สามารถสร้างได้ถึงขีดจำกัดแล้ว" -createLimitRemaining: "รหัสเชิญที่สามารถสร้างได้: เหลืออยู่ {limit} รหัส" -inviteLimitResetCycle: "สามารถสร้างรหัสเชิญได้อีกสูงสุด {limit} รหัส ภายใน {time}" +createCount: "จำนวนการเชิญ" +inviteCodeCreated: "สร้างคำเชิญแล้ว" +inviteLimitExceeded: "คุณสร้างคำเชิญเกินถึงขีดจำกัดแล้วนะ" +createLimitRemaining: "ขีดจำกัดการเชิญ: {limit} ที่เหลืออยู่" +inviteLimitResetCycle: "ขีดจำกัดนี้จะถูกรีเซ็ตเป็น {limit} ที่ {time}." expirationDate: "วันที่หมดอายุ" noExpirationDate: "ไม่มีหมดอายุ" -inviteCodeUsedAt: "วันเวลาที่ใช้รหัสเชิญ" -registeredUserUsingInviteCode: "ผู้ใช้ที่ใช้รหัสเชิญ" +inviteCodeUsedAt: "รหัสคำเชิญใช้แล้วที่" +registeredUserUsingInviteCode: "ใช้คำเชิญแล้วโดย" waitingForMailAuth: "กำลังรอการยืนยันอีเมล" -inviteCodeCreator: "ผู้ใช้ที่สร้างรหัสเชิญ" -usedAt: "วันเวลาที่ถูกใช้" -unused: "ยังไม่ได้ใช้" -used: "ถูกใช้แล้ว" +inviteCodeCreator: "สร้างการเชิญแล้วโดย" +usedAt: "ใช้แล้วที่" +unused: "ไม่ใช้แล้ว" +used: "ใช้แล้ว" expired: "หมดอายุแล้ว" -doYouAgree: "ยอมรับไหม?" +doYouAgree: "ยอมรับมั้ย?" beSureToReadThisAsItIsImportant: "กรุณาอ่านข้อมูลที่สำคัญอันนี้" -iHaveReadXCarefullyAndAgree: "ฉันได้อ่านและยินยอมเนื้อหาของ “{x}”" +iHaveReadXCarefullyAndAgree: "ฉันได้อ่านข้อความ \"{x}\" และยินยอม" dialog: "ไดอะล็อก" icon: "ไอคอน" forYou: "สำหรับคุณ" currentAnnouncements: "ประกาศในปัจจุบัน" pastAnnouncements: "ประกาศที่ผ่านมา" youHaveUnreadAnnouncements: "มีการประกาศที่ยังไม่ได้อ่าน" -useSecurityKey: "โปรดปฏิบัติตามคำแนะนำของเบราว์เซอร์หรืออุปกรณ์ของคุณเพื่อใช้ security key หรือ passkey" replies: "ตอบกลับ" renotes: "รีโน้ต" loadReplies: "แสดงการตอบกลับ" loadConversation: "แสดงบทสนทนา" -pinnedList: "รายชื่อที่ปักหมุดไว้" -keepScreenOn: "เปิดหน้าจออุปกรณ์ค้างไว้" -verifiedLink: "ความเป็นเจ้าของลิงก์ได้รับการยืนยันแล้ว" +pinnedList: "รายการที่ปักหมุดไว้แล้ว" +keepScreenOn: "เปิดหน้าจอไว้" notifyNotes: "แจ้งเตือนเกี่ยวกับโพสต์ใหม่" unnotifyNotes: "หยุดการแจ้งเตือนเกี่ยวกับโน้ตใหม่" authentication: "การตรวจสอบสิทธิ์" -authenticationRequiredToContinue: "กรุณายืนยันตัวตนทางอิเล็กทรอนิกส์เพื่อดำเนินการต่อ" -dateAndTime: "วันเวลา" +authenticationRequiredToContinue: "กรุณาตรวจสอบการรับรองความถูกต้องเพื่อดำเนินการต่อ" +dateAndTime: "เวลาประทับ" showRenotes: "แสดงรีโน้ต" edited: "แก้ไขแล้ว" notificationRecieveConfig: "การตั้งค่าการแจ้งเตือน" mutualFollow: "ติดตามซึ่งกันและกัน" -followingOrFollower: "กำลังติดตามหรือผู้ติดตาม" fileAttachedOnly: "เฉพาะโน้ตที่มีไฟล์เท่านั้น" -showRepliesToOthersInTimeline: "แสดงการตอบกลับผู้อื่นลงในไทม์ไลน์" -hideRepliesToOthersInTimeline: "ไม่แสดงการตอบกลับผู้อื่นลงในไทม์ไลน์" -showRepliesToOthersInTimelineAll: "รวมตอบกลับจากทุกคนที่คุณติดตามไว้ในไทม์ไลน์ของคุณ" -hideRepliesToOthersInTimelineAll: "ซ่อนตอบกลับจากทุกคนที่คุณติดตามไปจากไทม์ไลน์ของคุณ" -confirmShowRepliesAll: "การดำเนินการนี้ไม่สามารถย้อนกลับได้ คุณต้องการแสดงการตอบกลับผู้อื่นจากผู้ใช้ทุกคนที่คุณติดตามอยู่ ใส่ลงไทม์ไลน์ใช่ไหม?" -confirmHideRepliesAll: "การดำเนินการนี้ไม่สามารถย้อนกลับได้ คุณต้องการซ่อนการตอบกลับผู้อื่นจากผู้ใช้ทุกคนที่คุณติดตามอยู่ ไปจากไทม์ไลน์ใช่ไหม?" +showRepliesToOthersInTimeline: "แสดงการตอบกลับไปยังอื่นๆในไทม์ไลน์" +hideRepliesToOthersInTimeline: "ซ่อนการตอบกลับไปยังอื่นๆจากไทม์ไลน์" externalServices: "บริการภายนอก" -sourceCode: "ซอร์สโค้ด" -sourceCodeIsNotYetProvided: "ซอร์สโค้ดยังไม่พร้อมใช้งาน โปรดติดต่อผู้ดูแลระบบเพื่อแก้ไขปัญหานี้" -repositoryUrl: "URL ของ repository" -repositoryUrlDescription: "หากมีที่เก็บซอร์สโค้ดที่เปิดเผยต่อสาธารณะ ให้ป้อน URL ที่เก็บซอร์สโค้ดนั้น แต่หากคุณใช้ Misskey ตามต้นฉบับ (ไม่มีการเปลี่ยนแปลงซอร์สโค้ด) ให้ป้อน https://github.com/misskey-dev/misskey" -repositoryUrlOrTarballRequired: "หากคุณไม่มี repository สาธารณะ คุณจะต้องจัดเตรียม tarball แทน ดู .config/example.yml สำหรับรายละเอียด" -feedback: "ฟีดแบ็ก" -feedbackUrl: "URLของฟีดแบ็ก" impressum: "อิมเพรสชั่น" impressumUrl: "URL อิมเพรสชั่น" -impressumDescription: "การติดป้ายกำกับ (Impressum) มีผลบังคับใช้ในบางประเทศและภูมิภาค เช่น ประเทศเยอรมนี" privacyPolicy: "นโยบายความเป็นส่วนตัว" privacyPolicyUrl: "URL นโยบายความเป็นส่วนตัว" tosAndPrivacyPolicy: "เงื่อนไขในการให้บริการและนโยบายความเป็นส่วนตัว" avatarDecorations: "การตกแต่งอวตาร" attach: "แนบ" detach: "นำออก" -detachAll: "เอาออกทั้งหมด" angle: "แองเกิล" -flip: "พลิก" +flip: "ย้อนกลับ" showAvatarDecorations: "แสดงตกแต่งอวตาร" releaseToRefresh: "ปล่อยเพื่อรีเฟรช" refreshing: "กำลังรีเฟรช..." @@ -1231,125 +1148,29 @@ pullDownToRefresh: "ดึงลงเพื่อรีเฟรช" disableStreamingTimeline: "ปิดใช้งานอัปเดตไทม์ไลน์แบบเรียลไทม์" useGroupedNotifications: "แสดงผลการแจ้งเตือนแบบกลุ่มแล้ว" signupPendingError: "มีปัญหาในการตรวจสอบที่อยู่อีเมลลิงก์อาจหมดอายุแล้ว" -cwNotationRequired: "หากเปิดใช้งาน “ซ่อนเนื้อหา” จะต้องระบุคำอธิบาย" doReaction: "เพิ่มรีแอคชั่น" -code: "โค้ด" -reloadRequiredToApplySettings: "จำเป็นต้องมีการโหลดซ้ำเพื่อให้การตั้งค่ามีผล" -remainingN: "เหลือ : {n}" -overwriteContentConfirm: "แน่ใจหรือไม่ว่าต้องการเขียนทับเนื้อหาปัจจุบัน?" -seasonalScreenEffect: "เอฟเฟกต์หน้าจอตามฤดูกาล" -decorate: "ตกแต่ง" -addMfmFunction: "เพิ่มการตกแต่ง" -enableQuickAddMfmFunction: "แสดงตัวจิ้มเลือก MFM ขั้นสูง" -bubbleGame: "เกมบับเบิ้ล" -sfx: "เสียงเอฟเฟ็กต์" -soundWillBePlayed: "จะมีการเล่นเอฟเฟกต์เสียง" -showReplay: "ดูรีเพลย์" -replay: "รีเพลย์" -replaying: "กำลังรีเพลย์" -endReplay: "ออกจากรีเพลย์" -copyReplayData: "คัดลอกข้อมูลรีเพลย์" -ranking: "อันดับ" -lastNDays: "ล่าสุด {n} วันที่แล้ว" -backToTitle: "กลับไปหน้าไตเติ้ล" -hemisphere: "พื้นที่ที่อาศัยอยู่" -withSensitive: "แสดงโน้ตที่มีไฟล์เนื้อหาละเอียดอ่อน" -userSaysSomethingSensitive: "โพสต์ที่มีไฟล์เนื้อหาละเอียดอ่อนของ {name}" -enableHorizontalSwipe: "ปัดเพื่อสลับแท็บ" -loading: "กำลังโหลด" -surrender: "ยอมแพ้" -gameRetry: "เริ่มเกมใหม่" -notUsePleaseLeaveBlank: "หากไม่ได้ใช้กรุณาเว้นว่างไว้" -useTotp: "ใช้รหัสผ่านแบบใช้ครั้งเดียว (TOTP)" -useBackupCode: "ใช้รหัสแบ๊กอัป" -launchApp: "เริ่มแอป" -useNativeUIForVideoAudioPlayer: "ใช้ UI ของเบราว์เซอร์เพื่อเล่นวิดีโอ/เสียง" -keepOriginalFilename: "คงชื่อไฟล์เดิมไว้" -keepOriginalFilenameDescription: "หากปิดการตั้งค่านี้ ในระหว่างการอัปโหลดชื่อไฟล์จะถูกแทนที่ด้วยสตริงแบบสุ่มโดยอัตโนมัติ" -noDescription: "ไม่มีข้อความอธิบาย" -alwaysConfirmFollow: "แสดงข้อความยืนยันเมื่อกดติดตาม" -inquiry: "ติดต่อเรา" -tryAgain: "โปรดลองอีกครั้ง" -confirmWhenRevealingSensitiveMedia: "ตรวจสอบก่อนแสดงสื่อที่มีเนื้อหาละเอียดอ่อน" -sensitiveMediaRevealConfirm: "สื่อนี้มีเนื้อหาละเอียดอ่อน, ต้องการแสดงใช่ไหม?" -createdLists: "รายชื่อที่ถูกสร้าง" -createdAntennas: "เสาอากาศที่ถูกสร้าง" -fromX: "จาก {x}" -genEmbedCode: "สร้างรหัสฝัง" -noteOfThisUser: "โน้ตโดยผู้ใช้นี้" -clipNoteLimitExceeded: "ไม่สามารถเพิ่มโน้ตเพิ่มเติมในคลิปนี้ได้อีกแล้ว" -performance: "ประสิทธิภาพ​" -modified: "แก้ไข" -discard: "ละทิ้ง" -thereAreNChanges: "มีอยู่ {n} เปลี่ยนแปลง(s)" -signinWithPasskey: "ลงชื่อเข้าใช้ด้วย Passkey" -unknownWebAuthnKey: "พาสคีย์ไม่ถูกต้องค่ะ" -passkeyVerificationFailed: "การยืนยันกุญแจดิจิทัลไม่สำเร็จค่ะ" -passkeyVerificationSucceededButPasswordlessLoginDisabled: "การยืนยันพาสคีย์สำเร็จแล้ว แต่การลงชื่อเข้าใช้แบบไม่ต้องใส่รหัสผ่านถูกปิดใช้งานแล้ว" -messageToFollower: "ข้อความถึงผู้ติดตาม" -target: "เป้า" -testCaptchaWarning: "ฟังก์ชันนี้มีไว้สำหรับทดสอบ CAPTCHA เท่านั้น\nห้ามนำไปใช้ในระบบจริงโดยเด็ดขาด" -prohibitedWordsForNameOfUser: "คำนี้ไม่สามารถใช้เป็นชื่อผู้ใช้ได้" -prohibitedWordsForNameOfUserDescription: "หากมีสตริงใดๆ ในรายการนี้ปรากฏอยู่ในชื่อของผู้ใช้ ชื่อนั้นจะถูกปฏิเสธ ผู้ใช้ที่มีสิทธิ์แต่ผู้ดูแลระบบนั้นจะไม่ได้รับผลกระทบใดๆจากข้อจำกัดนี้ค่ะ" -yourNameContainsProhibitedWords: "ชื่อของคุณนั้นมีคำที่ต้องห้าม" -yourNameContainsProhibitedWordsDescription: "ถ้าหากคุณต้องการใช้ชื่อนี้ กรุณาติดต่อผู้ดูแลระบบของเซิร์ฟเวอร์นะค่ะ" -_abuseUserReport: - forward: "ส่ง​ต่อ" - forwardDescription: "ส่งรายงานไปยังเซิร์ฟเวอร์ระยะไกลโดยใช้บัญชีระบบที่ไม่ระบุตัวตน" - resolve: "แก้ไข" - accept: "ยอมรับ" - reject: "ปฏิเสธ" - resolveTutorial: "ถ้าหากรายงานนี้มีเนื้อหาถูกต้อง ให้เลือก \"ยอมรับ\" เพื่อปิดเคสกรณีนี้โดยถือว่าได้รับการแก้ไขแล้ว\nถ้าหากเนื้อหาในรายงานนี้นั้นไม่ถูกต้อง ให้เลือก \"ปฏิเสธ\" เพื่อปิดเคสกรณีนี้โดยถือว่าไม่ได้รับการแก้ไข" -_delivery: - status: "สถานะการจัดส่ง" - stop: "ระงับการส่ง" - resume: "จัดส่งต่อ" - _type: - none: "กำลังเผยแพร่" - manuallySuspended: "หยุดชั่วคราวด้วยตนเอง" - goneSuspended: "เซิร์ฟเวอร์ถูกระงับเนื่องจากมีการลบเซิร์ฟเวอร์นี้" - autoSuspendedForNotResponding: "เซิร์ฟเวอร์ถูกระงับเนื่องจากไม่ตอบสนอง" -_bubbleGame: - howToPlay: "วิธีเล่น" - hold: "ถือไว้" - _score: - score: "คะแนน" - scoreYen: "จำนวนเงินที่ได้รับ" - highScore: "คะแนนสูงสุด" - maxChain: "จำนวน chain สูงสุด" - yen: "{yen} เยน" - estimatedQty: "{qty} อัน" - scoreSweets: "โอนิงิริ {onigiriQtyWithUnit}" - _howToPlay: - section1: "ขยับตำแหน่งและวางวัตถุลงในกล่อง" - section2: "เมื่อวัตถุประเภทเดียวกันมารวมกัน พวกมันจะกลายเป็นวัตถุใหม่และคุณจะได้รับคะแนน" - section3: "หากวัตถุล้นออกมาจากกล่อง เกมก็จะจบลง ตั้งเป้าทำคะแนนให้สูงด้วยการหลอมวัตถุต่าง ๆ โดยไม่ทำให้ล้นกล่อง!" _announcement: - forExistingUsers: "ผู้ใช้งานที่มีอยู่ตอนนี้เท่านั้น" - forExistingUsersDescription: "หากเปิดใช้งาน การประกาศนี้จะแสดงเฉพาะกับผู้ใช้ที่สร้างบัญชีก่อน/ที่มีอยู่ในขณะที่สร้างประกาศนี้เท่านั้น หากปิดใช้งาน การประกาศนี้จะแสดงกับผู้ใช้ที่สร้างบัญชีหลังจากสร้างประกาศนี้ด้วย" - needConfirmationToRead: "จำเป็นต้องยืนยันว่าอ่านแล้ว" - needConfirmationToReadDescription: "กล่องโต้ตอบการยืนยันจะปรากฏขึ้นเมื่อจะทำเครื่องหมายว่าอ่านแล้ว นอกจากนี้ยังทำให้ประกาศนี้ยังไม่ถูกอ่านเมื่อใช้ฟังก์ชั่น “ทำเครื่องหมายฯ ทั้งหมดว่าอ่านแล้ว”" - end: "เก็บประกาศ" - tooManyActiveAnnouncementDescription: "เนื่องจากมีการประกาศที่ยังใช้งานอยู่จำนวนมาก อาจทำให้ UX ลดลง แนะนำให้พิจารณาการเก็บประกาศที่สิ้นสุดไปแล้ว" - readConfirmTitle: "ทำเครื่องหมายว่าอ่านแล้วเลยไหม?" - readConfirmText: "จะทำเครื่องหมายใส่ “{title}” ว่าอ่านแล้ว" - shouldNotBeUsedToPresentPermanentInfo: "เนื่องจากมีความเป็นไปได้สูงที่จะส่งผลเสียต่อง UX ของผู้ใช้ใหม่ จึงขอแนะนำให้ใช้ประกาศสำหรับข้อมูลที่ต้องการการตอบสนองในทันที ไม่ใช่ข้อมูลที่ต้องการแสดงตลอดเวลา" - dialogAnnouncementUxWarn: "เราขอแนะนำให้ใช้ด้วยความระมัดระวัง เนื่องจากการแจ้งเตือนแบบกล่องโต้ตอบตั้งแต่ 2 รายการขึ้นไปพร้อมกันอาจส่งผลเสียต่อ UX ได้อย่างมาก" + forExistingUsers: "ผู้ใช้งานที่มีอยู่เท่านั้น" + forExistingUsersDescription: "การประกาศนี้จะแสดงต่อผู้ใช้ที่มีอยู่ ณ จุดที่เผยแพร่นั้นๆถ้าหากเปิดใช้งาน ถ้าหากปิดใช้งานผู้ที่กำลังสมัครใหม่หลังจากโพสต์แล้วนั้นก็จะเห็นเช่นกัน" + needConfirmationToRead: "จำเป็นต้องยืนยันเพื่อทำเครื่องหมายบอกว่าอ่านแล้ว" + needConfirmationToReadDescription: "ข้อความแจ้งแยก ถ้าหากต้องการเพื่อยืนยันว่ากำลังทำเครื่องหมายประกาศนี้ว่าอ่านแล้วจะแสดงขึ้นถ้าหากเปิดใช้งาน การประกาศนั้นจะไม่รวมอยู่ในฟังก์ชั่นว่า \"ทำเครื่องหมายทั้งหมดว่าอ่านแล้ว\"" + end: "ประกาศเก็บถาวร" + tooManyActiveAnnouncementDescription: "การมีประกาศที่ใช้งานมากเกินไปนั้นอาจจะทำให้ประสบการณ์ของผู้ใช้งานนั้นดูแย่ลง โปรดกรุณาพิจารณาการเก็บประกาศที่ล้าสมัยด้วยนะค่ะ" + readConfirmTitle: "ทำเครื่องหมายบอกว่าอ่านแล้วเลยมั้ย?" + readConfirmText: "การดำเนินการนี้จะทำเครื่องหมายเนื้อหาของ \"{title}\" บอกว่าอ่านแล้วนะ" silence: "ไม่มีการแจ้งเตือน" - silenceDescription: "หากเปิดใช้งาน จะไม่มีการแจ้งเตือนประกาศนี้ และผู้ใช้จะไม่จำเป็นต้องทำเครื่องหมายว่าอ่านแล้ว" _initialAccountSetting: - accountCreated: "สร้างบัญชีเสร็จสมบูรณ์!" + accountCreated: "คุณได้สร้างบัญชีของคุณสำเร็จเรียบร้อยแล้ว!" letsStartAccountSetup: "สำหรับผู้เริ่มต้นมาตั้งค่าโปรไฟล์ของคุณกันเถอะ" letsFillYourProfile: "ก่อนอื่นมาตั้งค่าโปรไฟล์ของคุณ" profileSetting: "ตั้งค่าโปรไฟล์" privacySetting: "ตั้งค่าความเป็นส่วนตัว" theseSettingsCanEditLater: "คุณสามารถเปลี่ยนการตั้งค่าเหล่านี้ได้ในภายหลังได้ตลอดเวลานะ" - youCanEditMoreSettingsInSettingsPageLater: "สามารถตั้งค่าเพิ่มเติมได้ที่หน้า “การตั้งค่า” อย่าลืมไปเยี่ยมชมภายหลังด้วย" - followUsers: "ลองติดตามผู้ใช้ที่สนใจเพื่อสร้างไทม์ไลน์ดูสิ" + youCanEditMoreSettingsInSettingsPageLater: "ยังมีการตั้งค่าอื่นๆ อีกมากมายที่คุณนั้นสามารถกำหนดค่าได้จาก \"การตั้งค่า\" เพื่อให้แน่ใจว่าได้เยี่ยมชมมันได้ภายหลังนะ" + followUsers: "ลองติดตามผู้ใช้บางคนที่คุณอาจจะสนใจเพื่อสร้างไทม์ไลน์ของคุณสิ !" pushNotificationDescription: "กำลังเปิดใช้งานการแจ้งเตือนแบบพุชจะช่วยให้คุณได้รับการแจ้งเตือนจาก {name} โดยตรงบนอุปกรณ์ของคุณนะ" initialAccountSettingCompleted: "ตั้งค่าโปรไฟล์เสร็จสมบูรณ์แล้ว!" - haveFun: "ขอให้สนุกกับ {name}!" - youCanContinueTutorial: "คุณสามารถดำเนินการต่อด้วยบทช่วยสอนเกี่ยวกับวิธีใช้ {name} (Misskey) หรือออกจากบทช่วยสอนแล้วเริ่มใช้งานได้ทันที" + haveFun: "ขอให้สนุก {name}!" startTutorial: "เริ่มการฝึกสอน" skipAreYouSure: "ต้องการข้ามการตั้งค่าโปรไฟล์จริงๆแบบนั้นหรอ?" laterAreYouSure: "ต้องการตั้งค่าโปรไฟล์ในภายหลังจริงๆอย่างงั้นหรอ?" @@ -1360,132 +1181,77 @@ _initialTutorial: skipAreYouSure: "ต้องการออกจากบทช่วยสอนใช่ไหม?" _landing: title: "ยินดีต้อนรับสู่บทช่วยสอน" - description: "คุณสามารถตรวจสอบการใช้งานและฟังก์ชั่นพื้นฐานของ Misskey ได้ที่นี่" _note: title: "โน้ตคืออะไร?" - description: "โพสต์ใน Misskey เรียกว่า “โน้ต” ซึ่งจะจัดเรียงตามลำดับเวลาบนไทม์ไลน์และอัปเดตแบบเรียลไทม์" - reply: "คุณสามารถตอบกลับได้ และคุณยังสามารถตอบกลับใส่การตอบกลับเพื่อสนทนาต่อได้เสมือนดั่งเธรด" - renote: "คุณสามารถแชร์โน้ตไปยังไทม์ไลน์ของคุณเอง คุณยังสามารถเพิ่มข้อความและเครื่องหมายคำพูดได้" - reaction: "คุณสามารถเพิ่มรีแอคชั่นได้ รายละเอียดจะอธิบายอยู่ในหน้าถัดไป" - menu: "คุณสามารถดูรายละเอียดโน้ต คัดลอกลิงก์ และดำเนินการอื่นๆ ได้" _reaction: title: "รีแอคชั่นคืออะไร?" - description: "โน้ตสามารถ“รีแอคชั่น”ด้วยเอโมจิต่างๆ ซึ่งทำให้สามารถแสดงความแตกต่างเล็กๆ น้อยๆ ที่อาจไม่สามารถสื่อออกมาได้ด้วยการแค่การกด “ถูกใจ”" - letsTryReacting: "คุณสามารถเพิ่มรีแอคชั่นได้ด้วยการคลิกปุ่ม “+” บนโน้ต ลองรีแอคชั่นโน้ตตัวอย่างนี้ดูสิ!" - reactToContinue: "เพิ่มรีแอคชั่นเพื่อดำเนินการต่อ" - reactNotification: "คุณจะได้รับการแจ้งเตือนแบบเรียลไทม์เมื่อมีคนตอบรีแอคชั่นโน้ตของคุณ" - reactDone: "คุณสามารถยกเลิกรีแอคชั่นได้โดยการกดปุ่ม “-”" _timeline: title: "แนวคิดเรื่องของไทม์ไลน์" - description1: "Misskey มีหลายไทม์ไลน์ขึ้นอยู่กับวิธีการใช้งานของคุณ (บางไทม์ไลน์อาจไม่สามารถใช้ได้ขึ้นอยู่กับนโยบายของเซิร์ฟเวอร์)" - home: "คุณสามารถดูโพสต์จากบัญชีที่คุณติดตามได้" - local: "คุณสามารถดูโพสต์จากผู้ใช้ทั้งหมดบนเซิร์ฟเวอร์นี้" - social: "จะแสดงโพสต์ทั้งจากไทม์ไลน์หลักและไทม์ไลน์ท้องถิ่น" - global: "คุณสามารถดูโพสต์จากเซิร์ฟเวอร์ที่เชื่อมต่ออื่นๆ ทั้งหมดได้" - description2: "คุณสามารถสลับระหว่างแต่ละไทม์ไลน์ได้ตลอดเวลาได้ที่บริเวณด้านบนของหน้าจอ" - description3: "นอกจากนี้ยังมีรายการไทม์ไลน์ ไทม์ไลน์ของช่อง ฯลฯ โปรดดู {link} สำหรับรายละเอียดเพิ่มเติม" _postNote: - title: "ตั้งค่าการโพสต์โน้ต" - description1: "เมื่อโพสต์โน้ตบน Misskey คุณสามารถตั้งค่าตัวเลือกต่างๆ ได้ แบบฟอร์มการส่งมีลักษณะดังนี้" + title: "ตั้งค่ากำลังโพสต์โน้ต" _visibility: description: "คุณสามารถจำกัดผู้ที่สามารถดูโน้ตของคุณได้นะ" public: "โน้ตของคุณนั้นจะปรากฏแก่ผู้ใช้งานทุกคน" - home: "เผยแพร่บนไทม์ไลน์หลักเท่านั้น แต่ผู้ติดตาม ผู้ที่เข้ามาดูโปรไฟล์ และผู้ที่เห็นจากรีโน้ตยังสามารถดูโพสต์นี้ได้" - followers: "มองเห็นได้เฉพาะผู้ติดตามเท่านั้น ไม่มีใครอื่นนอกจากตัวคุณเองที่สามารถรีโน้ตได้ และมีเพียงผู้ติดตามของคุณเท่านั้นที่สามารถดูได้" - direct: "เปิดให้เห็นเฉพาะผู้ใช้ที่ระบุเท่านั้น และพวกเขาจะได้รับแจ้งเตือนด้วย คุณสามารถใช้มันแทนข้อความโดยตรง (dm)" - doNotSendConfidencialOnDirect1: "โปรดใช้ความระมัดระวังในการส่งข้อมูลที่ละเอียดอ่อน" - doNotSendConfidencialOnDirect2: "ผู้ดูแลระบบเซิร์ฟเวอร์ปลายทางสามารถดูเนื้อหาที่โพสต์ได้ ดังนั้นหากคุณส่งโพสต์โดยตรงไปยังผู้ใช้บนเซิร์ฟเวอร์ที่ไม่น่าเชื่อถือ คุณจะต้องใช้ความระมัดระวังในการจัดการข้อมูลที่เป็นความลับ" - localOnly: "การโพสต์ด้วย flag นี้จะไม่รวมโน้ตไปยังเซิร์ฟเวอร์อื่น ผู้ใช้บนเซิร์ฟเวอร์อื่นจะไม่สามารถดูโน้ตเหล่านี้ได้โดยตรง โดยไม่คำนึงถึงการตั้งค่าการแสดงผลข้างต้น" _cw: title: "คำเตือนเกี่ยวกับเนื้อหา" - description: "เนื้อหาที่เขียนใน “คำอธิบายประกอบ” จะแสดงแทนเนื้อหาหลัก ต้องคลิก “ดูเพิ่มเติม” เพื่อให้เนื้อหาหลักแสดง" _exampleNote: - cw: " ห้ามดู ระวังหิว" - note: "เพิ่งไปกินโดนัทเคลือบช็อคโกแลตมา 🍩😋" - useCases: "ใช้สิ่งนี้เพื่อระบุโน้ตที่ต้องตามแนวทางปฏิบัติของเซิร์ฟเวอร์ หรือเพื่อควบคุมการสปอยล์และข้อความที่ละเอียดอ่อนด้วยตนเอง" - _howToMakeAttachmentsSensitive: - title: "จะทำเครื่องหมายไฟล์แนบว่ามีเนื้อหาละเอียดอ่อนได้อย่างไร?" - description: "ทำเครื่องหมายไฟล์แนบว่า “มีเนื้อหาละเอียดอ่อน” เมื่อจำเป็นตามแนวทางของเซิร์ฟเวอร์ หรือเมื่อไฟล์แนบไม่ควรปรากฏให้เห็น" - tryThisFile: "ลองทำให้รูปภาพที่แนบมากับแบบฟอร์มนี้มีเนื้อหาละเอียดอ่อน!" - _exampleNote: - note: "อุ้ย นัตโตะ ฝาเปิดเละเทะ..." - method: "หากต้องการทำให้ไฟล์แนบมีเนื้อหาละเอียดอ่อน ให้คลิกไฟล์เพื่อเปิดเมนูแล้วคลิก “ทำเครื่องหมายว่ามีเนื้อหาละเอียดอ่อน”" - sensitiveSucceeded: "เมื่อแนบไฟล์ โปรดตั้งค่าเครื่องหมายว่ามีเนื้อหาละเอียดอ่อนตามแนวทางของเซิร์ฟเวอร์" - doItToContinue: "ทำเครื่องหมายกับรูปภาพว่ามีเนื้อหาละเอียดอ่อน เพื่อดำเนินการต่อ" - _done: - title: "บทเรียนจบลงแล้วจ้า เย่เย่เย่ 🎉" - description: "คุณสมบัติที่แนะนำในที่นี่เป็นเพียงบางส่วนเท่านั้น หากต้องการเรียนรู้เพิ่มเติมเกี่ยวกับวิธีใช้ Misskey โปรดไปที่ {link}" -_timelineDescription: - home: "บนไทม์ไลน์หลัก คุณสามารถดูโพสต์จากบัญชีที่ติดตามอยู่ได้" - local: "ไทม์ไลน์ท้องถิ่นช่วยให้เห็นโพสต์จากผู้ใช้ทั้งหมดบนเซิร์ฟเวอร์นี้" - social: "ไทม์ไลน์โซเชียลจะแสดงโพสต์จากทั้งไทม์ไลน์หลักและไทม์ไลน์ท้องถิ่น" - global: "ในไทม์ไลน์ทั่วโลก คุณสามารถดูโน้ตจากเซิร์ฟเวอร์ที่เชื่อมต่อทั้งหมดได้" + cw: "นี่อาจจะทำให้คุณหิวอย่างแน่นอน!" _serverRules: description: "ชุดของกฎที่จะแสดงก่อนการลงทะเบียนเราขอแนะนำให้ตั้งค่าสรุปข้อกำหนดในการให้บริการ" _serverSettings: - iconUrl: "URL ไอคอน" - appIconDescription: "ระบุไอคอนที่จะใช้เมื่อ {host} แสดงเป็นแอป" - appIconUsageExample: "ตัวอย่างเช่น เมื่อถูกเพิ่มเป็น PWA หรือบุ๊กมาร์กบนหน้าจอหลักในสมาร์ทโฟน" - appIconStyleRecommendation: "เนื่องจากอาจถูกครอบตัดเป็นสี่เหลี่ยมหรือวงกลม จึงแนะนำให้ใช้ภาพที่เผื่อพื้นที่รอบๆ ตัวโลโก้ไอคอนไว้" + iconUrl: "ไอคอน URL" + appIconUsageExample: "E.g. เป็น PWA หรือเมื่อแสดงผลเป็นบุ๊กมาร์กหน้าจอหลักบนโทรศัพท์" appIconResolutionMustBe: "ความละเอียดขั้นต่ำไว้คือ {resolution}." - manifestJsonOverride: "เขียนทับ manifest.json" + manifestJsonOverride: "manifest.json โอเวอร์ลาย" shortName: "ชื่อย่อ" - shortNameDescription: "ตัวย่อหรือชื่อทั่วไปที่สามารถแสดงแทนชื่ออย่างเป็นทางการแบบยาวของเซิร์ฟเวอร์" - fanoutTimelineDescription: "เพิ่มประสิทธิภาพการดึงข้อมูลไทม์ไลน์อย่างมาก และลดภาระในฐานข้อมูลเมื่อเปิดใช้งาน ในทางกลับกัน การใช้หน่วยความจำของ Redis จะเพิ่มขึ้น ลองปิดการใช้งานนี้ในกรณีที่หน่วยความจำเซิร์ฟเวอร์เหลือน้อยหรือเซิร์ฟเวอร์ไม่เสถียร" - fanoutTimelineDbFallback: "ฟอลแบ๊กกลับฐานข้อมูล" - fanoutTimelineDbFallbackDescription: "เมื่อเปิดใช้งาน หากไม่ได้แคชไทม์ไลน์ ไทม์ไลน์จะฟอลแบ๊กไปยังฐานข้อมูลสำหรับการ query เพิ่มเติม การปิดใช้งานจะช่วยลดภาระของเซิร์ฟเวอร์ด้วยการกำจัดกระบวนฟอลแบ๊ก แต่มันก็จะจำกัดช่วงเวลาไทม์ไลน์ที่สามารถดึงข้อมูลได้" - reactionsBufferingDescription: "เมื่อเปิดใช้งานฟังก์ชันนี้ก็จะช่วยลด latency ในการสร้างปฏิกิริยา แต่อาจจะส่งผลให้ memory footprint ของ Redis เพิ่มขึ้นนะ" - inquiryUrl: "URL สำหรับการติดต่อสอบถาม" - inquiryUrlDescription: "ระบุ URL ของหน้าเว็บที่มีแบบฟอร์มสำหรับติดต่อผู้ดูแลเซิร์ฟเวอร์ หรือข้อมูลการติดต่อของผู้ดูแลเซิร์ฟเวอร์" - thisSettingWillAutomaticallyOffWhenModeratorsInactive: "ถ้าหากไม่มีการตรวจสอบจากผู้ดูแลระบบหรือไม่มีความเคลื่อนไหวมาเป็นระยะเวลาหนึ่ง ระบบจะทำการปิดใช้งานฟังก์ชันนี้โดยอัตโนมัติ เพื่อลดความเสี่ยงในการถูกโจมตีด้วยสแปมและอื่นๆ" _accountMigration: - moveFrom: "ย้ายจากบัญชีอื่นมาที่บัญชีนี้" + moveFrom: "ย้ายข้อมูลบัญชีอื่นไปยังอีกบัญชีนี้หนึ่ง" moveFromSub: "สร้างนามแฝงไปยังบัญชีอื่น" - moveFromLabel: "บัญชีที่จะย้ายจาก #{n}" - moveFromDescription: "หากต้องการโอนข้อมูลจากบัญชีอื่นมายังบัญชีนี้ จำเป็นต้องสร้างบัญชีนามแฝง (alias) ไว้ที่นี่ด้วย\nกรุณากรอกบัญชีเดิมในรูปแบบ: @username@server.example.com\nหากต้องการลบ alias, ให้เว้นว่างไว้แล้วบันทึก (ไม่แนะนำ)" - moveTo: "ย้ายบัญชีนี้ไปยังบัญชีใหม่" + moveFromLabel: "บัญชีที่จะย้ายจาก:" + moveFromDescription: "ถ้าหากคุณต้องการโอนข้อมูล คุณจำเป็นต้องสร้างบัญชีสำรองสำหรับการย้ายบัญชี หลังจากนั้นป้อนบัญชีที่จะย้ายไปในรูปแบบต่อไปนี้: @person@instance.com" + moveTo: "ย้ายข้อมูลบัญชีนี้ไปยังบัญชีอีกหนึ่ง" moveToLabel: "บัญชีที่จะย้ายไปที่:" moveCannotBeUndone: "ไม่สามารถยกเลิกการโอนย้ายบัญชีได้" - moveAccountDescription: "การดำเนินการนี้จะย้ายบัญชีของคุณไปยังบัญชีอื่น\n・ผู้ที่กำลังติดตามคุณจากบัญชีนี้จะถูกย้ายไปยังบัญชีใหม่โดยอัตโนมัติ\n・บัญชีนี้จะเลิกติดตามผู้ใช้ทั้งหมดที่กำลังติดตามอยู่\n・คุณจะไม่สามารถสร้างโน้ต ฯลฯ ในบัญชีนี้ได้\n\nแม้ว่าการย้ายผู้ที่ติดตามคุณจะเป็นไปโดยอัตโนมัติ แต่คุณต้องเตรียมขั้นตอนบางอย่างด้วยตนเอง เพื่อย้ายรายชื่อผู้ใช้ที่คุณกำลังติดตาม โดยดำเนินการส่งออกรายชื่อแล้วค่อยนำเข้ามาภายหลังในเมนูการตั้งค่าของบัญชีใหม่ ใช้ขั้นตอนเดียวกันนี้ใช้รายชื่อผู้ใช้ที่ถูกปิดเสียงและถูกบล็อก\n\n(คำอธิบายนี้ใช้กับ Misskey v13.12.0 ขึ้นไป, ซอฟต์แวร์ ActivityPub อื่นๆ เช่น Mastodon อาจทำงานแตกต่างออกไป)" - moveAccountHowTo: "การย้ายบัญชีจะเริ่มต้นโดยการสร้างบัญชีนามแฝง (alias) ของบัญชีนี้ ณ บัญชีที่เป็นปลายทาง หลังจากสร้างนามแฝงแล้ว ให้ป้อนบัญชีปลายทางในรูปแบบดังนี้: @username@server.example.com" + moveAccountDescription: "การกระทำนี้ไม่สามารถย้อนกลับได้นะ ขั้นตอนแรก ต้องสร้างนามแฝงสำหรับบัญชีนี้ในบัญชีที่คุณต้องการย้ายไป หลังจากนั้นแล้ว ป้อนบัญชีที่จะย้ายไปในรูปแบบดังต่อไปนี้: @person@instance.com" + moveAccountHowTo: "หากต้องการย้ายข้อมูลก่อนอื่นให้สร้างชื่อแทนสำหรับบัญชีนี้ ในบัญชีที่จะต้องการย้ายไป\nหลังจากที่คุณสร้างนามแฝงนั้นแล้ว ให้ป้อนบัญชีที่ต้องการจะย้ายไปในรูปแบบดังต่อไปนี้: @username@server.example.com" startMigration: "โอนย้าย" migrationConfirm: "ยืนยันการย้ายข้อมูลบัญชีนี้ไปที่ {account} เมื่อเริ่มแล้วจะไม่สามารถหยุดหรือนำกลับคืนมาได้ และคุณจะไม่สามารถใช้บัญชีนี้ในสถานะดั้งเดิมได้อีกต่อไป\n\nนอกจากนี้ คุณจำเป็นต้องสร้างบัญชีสำรองสำหรับการย้ายบัญชี" - movedAndCannotBeUndone: "\nบัญชีนี้ถูกโอนย้ายไปแล้ว\nไม่สามารถยกเลิกการโอนย้ายได้" - postMigrationNote: "บัญชีนี้จะดำเนินการยกเลิกการติดตามทั้งหมดหลังจากการย้ายข้อมูลไปแล้ว 24 ชั่วโมง จำนวนกำลังติดตามและจำนวนผู้ติดตามของบัญชีนี้จะเป็น 0 และเพื่อหลีกเลี่ยงไม่ให้ผู้ติดตามคุณนั้นไม่สามารถเห็นโพสต์เฉพาะผู้ติดตามฯได้ การยกเลิกการติดตามจะไม่กระทบกับผู้ติดตามคุณ ดังนั้นผู้ติดตามคุณยังคงสามารถดูโพสต์ของบัญชีนี้ได้" - movedTo: "บัญชีที่จะย้ายไป:" + movedAndCannotBeUndone: "\nบัญชีนี้ถูกโอนย้ายไปแล้ว\nไม่สามารถย้อนกลับโอนย้ายข้อมูลได้" + postMigrationNote: "บัญชีนี้จะถูกเลิกติดตามบัญชีทั้งหมดที่กำลังติดตามภายใน 24 ชั่วโมงหลังจากการย้ายข้อมูลนั้นเสร็จสิ้น ทั้งจำนวนผู้ติดตามและผู้ติดตามนั้นจะกลายเป็นศูนย์ เพื่อหลีกเลี่ยงป้องกันไม่ให้ผู้ติดตามของคุณนั้นไม่สามารถเห็นโพสต์เฉพาะผู้ติดตามของบัญชีนี้ได้ แต่อย่างไรก็ตามแล้วพวกเขาจะยังคงติดตามบัญชีนี้ต่อไป" + movedTo: "บัญชีที่จะย้ายไปที่:" _achievements: earnedAt: "ได้รับเมื่อ" _types: _notes1: title: "just setting up my msky" - description: "โพสต์โน้ตเป็นครั้งแรก" + description: "โพสต์โน้ตแรกของคุณ" flavor: "ขอให้มีช่วงเวลาที่ดีกับ Misskey นะคะ!" _notes10: - title: "โน้ตไม่กี่ชิ้น" + title: "โน้ตบางอย่าง" description: "โพสต์ 10 โน้ต" _notes100: - title: "โน้ตเยอะอยู่" + title: "โน้ตจำนวนมาก" description: "โพสต์ 100 โน้ต" _notes500: - title: "จมคากองโน้ต" + title: "ครอบคลุมในโน้ต" description: "โพสต์ 500 โน้ต" _notes1000: title: "ภูเขาแห่งโน้ต" description: "โพสต์ 1,000 โน้ต" _notes5000: - title: "โน้ตล้นไปแล้ว" + title: "โน้ตล้น" description: "โพสต์ 5,000 โน้ต" _notes10000: title: "ซุปเปอร์โน้ต" description: "โพสต์ 10,000 โน้ต" _notes20000: - title: "ต้ อ ง ก า ร โ น้ ต เ พิ่ ม อี ก !" + title: "ต้องการ... เพิ่มเติม... โน้ต..." description: "โพสต์ 20,000 โน้ต" _notes30000: title: "โน้ต โน้ต โน้ต!" description: "โพสต์ 30,000 โน้ต" _notes40000: - title: "โรงงานผลิตโน้ต" + title: "โน้ตโรงงาน" description: "โพสต์ 40,000 โน้ต" _notes50000: title: "ดาวเคราะห์แห่งโน้ต" @@ -1494,39 +1260,39 @@ _achievements: title: "โน้ตควอซาร์" description: "โพสต์ 60,000 โน้ต" _notes70000: - title: "หลุม-โน้ต-ดำ" + title: "โน้ตหลุมดำ" description: "โพสต์ 70,000 โน้ต" _notes80000: - title: "ดาราจักรโน้ต" + title: "โน้ต กาแล็กซี่" description: "โพสต์ 80,000 โน้ต" _notes90000: - title: "จักรวาลโน้ต" + title: "โน้ต จักรวาล" description: "โพสต์ 90,000 โน้ต" _notes100000: title: "ALL YOUR NOTE ARE BELONG TO US" description: "โพสต์ 100,000 โน้ต" - flavor: "มีเรื่องจะเขียนมากขนาดนั้นเลยเหรอนั่น?" + flavor: "นายแน่ใจล่ะก็ มีอะไรพูดมาได้นะ" _login3: title: "มือใหม่ I" description: "เข้าสู่ระบบเป็นเวลารวม 3 วัน" - flavor: "ตั้งแต่วันนี้เป็นต้นไป ฉันคือมิสคิสต์" + flavor: "เริ่มตั้งแต่วันนี้ เรียกฉันว่ามิสคิสต์" _login7: title: "มือใหม่ II" description: "เข้าสู่ระบบเป็นเวลารวม 7 วัน" - flavor: "ชินกับมันแล้วหรือยัง?" + flavor: "รู้สึกเหมือนคุณได้แขวนของสิ่งต่างๆ หรือยังคะ?" _login15: title: "มือใหม่ III" description: "เข้าสู่ระบบเป็นเวลารวม 15 วัน" _login30: - title: "มิสคิสต์ I" + title: "มิสคิสท์ I" description: "เข้าสู่ระบบเป็นเวลารวม 30 วัน" _login60: - title: "มิสคิสต์ II" + title: "มิสคิสท์ II" description: "เข้าสู่ระบบเป็นเวลารวม 60 วัน" _login100: - title: "มิสคิสต์ III" + title: "มิสคิสท์ III" description: "เข้าสู่ระบบเป็นเวลารวม 100 วัน" - flavor: "Violent Misskist (ทำไมเหมือนชื่อหนังสักเรื่องจังเลยนะ)" + flavor: "ความรุนแรง Misskist" _login200: title: "ลูกค้าประจำ I" description: "เข้าสู่ระบบเป็นเวลารวม 200 วัน" @@ -1539,7 +1305,7 @@ _achievements: _login500: title: "ผู้เชี่ยวชาญ I" description: "เข้าสู่ระบบเป็นเวลารวม 500 วัน" - flavor: "ทุกท่าน ผมชอบโน้ต (กล่าวโดย เดอะ เ_เ_อร์)" + flavor: "เพื่อนของผมนะมักจะกล่าวว่าผมนะชอบจดโน้ต" _login600: title: "ผู้เชี่ยวชาญ II" description: "เข้าสู่ระบบเป็นเวลารวม 600 วัน" @@ -1557,24 +1323,24 @@ _achievements: description: "เข้าสู่ระบบเป็นเวลารวม 1,000 วัน" flavor: "ขอบคุณที่ใช้ Misskey นะ !" _noteClipped1: - title: "อดไม่ได้ที่จะต้องคลิปมันเอาไว้" - description: "คลิปโน้ตเป็นครั้งแรก" + title: "จะต้อง... คลิป..." + description: "คลิปโน้ตตัวแรกของคุณ" _noteFavorited1: title: "สตาร์เกเซอร์" - description: "ใส่โน้ตเป็นรายการโปรดเป็นครั้งแรก" + description: "ชื่นชอบโน้ตแรกของคุณ" _myNoteFavorited1: title: "แสวงหาดวงดาว" - description: "โน้ตตัวเองถูกคนอื่นเพิ่มลงรายการโปรดของเขา" + description: "มีคนอื่นๆที่ชื่นชอบหนึ่งในโน้ตของคุณ" _profileFilled: - title: "เตรียมตัวอย่างดี" - description: "ตั้งค่าโปรไฟล์" + title: "เตรียมไว้อย่างดี" + description: "ตั้งค่าโปรไฟล์ของคุณ" _markedAsCat: title: "ฉันเป็นแมว" - description: "ตั้งค่าบัญชีเป็นแมวเมี้ยวเมี้ยว" - flavor: "แมวน้อยไร้ชื่อ" + description: "ทำเครื่องหมายบัญชีของคุณว่าเป็นแมว" + flavor: "ฉันจะให้ชื่อคุณภายหลังนะ" _following1: - title: "ก้าวแรกสู่...กดติดตาม" - description: "กดติดตามชาวบ้านครั้งแรก" + title: "กำลังติดตามผู้ใช้คนแรกของคุณ" + description: "ติดตามผู้ใช้" _following10: title: "ทำต่อไป... ทำต่อไป..." description: "ติดตาม 10 บัญชีผู้ใช้" @@ -1585,7 +1351,7 @@ _achievements: title: "เพื่อน 100 คน" description: "ติดตาม 100 บัญชี" _following300: - title: "มีเพื่อนมากเกินไปละ" + title: "เพื่อนโอเวอร์โหลด" description: "ติดตาม 300 บัญชี" _followers1: title: "ผู้ติดตามคนแรก" @@ -1612,12 +1378,12 @@ _achievements: title: "นักสะสมความสำเร็จ" description: "ได้รับความสำเร็จ 30 ครั้ง" _viewAchievements3min: - title: "ชอบบรรลุความสําเร็จ" - description: "มองดูรายการความสำเร็จเป็นเวลานานกว่า 3 นาที" + title: "ชอบบรรลุผลสําเร็จ" + description: "มองดูรายการความสำเร็จของคุณเป็นเวลาอย่างน้อย 3 นาที" _iLoveMisskey: title: "ฉันรัก Misskey" - description: "โพสต์ “I ❤ #Misskey”" - flavor: "ขอบคุณพระคุณเป็นอย่างสูงที่ท่านใช้ Misskey นะคะ ! by ทีมผู้พัฒนา" + description: "โพสต์ \"I ❤ #Misskey\"" + flavor: "ขอบคุณที่ใช้ Misskey! by ทีมผู้พัฒนา" _foundTreasure: title: "ล่าสมบัติ" description: "คุณพบสมบัติที่ซ่อนอยู่" @@ -1625,28 +1391,28 @@ _achievements: title: "พักผ่อนสักหน่อย" description: "ใช้เวลา 30 นาทีบน Misskey" _client60min: - title: "Misskey ต้องไม่มีสิ่งใด “Miss”" + title: "ไม่มี \"Miss\" ใน Misskey " description: "เปิด Misskey ค้างไว้แล้วอย่างน้อย 60 นาที" _noteDeletedWithin1min: title: "ไม่เป็นไร" description: "ลบโน้ตภายในหนึ่งนาทีหลังจากที่โพสต์" _postedAtLateNight: - title: "ออกหากินยามดึกดื่น" + title: "กลางคืน" description: "โพสต์โน้ตตอนดึกๆ" flavor: "ได้เวลาเข้านอนแล้วนะ" _postedAt0min0sec: - title: "นาฬิกาเทียบเวลา" - description: "โพสต์โน้ตเมื่อเวลา 00:00 น." - flavor: "โป๊ะ โป๊ะ โป๊ะ ปิ้งงงงง" + title: "นาฬิกาพูดได้" + description: "โพสต์บนโน้ตเมื่อเวลา 00:00 น." + flavor: "คลิก คลิก คลิก แกล๊งๆ" _selfQuote: title: "อ้างอิงตนเอง" - description: "อ้างอิงโน้ตตัวเอง" + description: "อ้างโน้ตย่อของคุณเอง" _htl20npm: title: "ไทม์ไลน์ไหล" - description: "มีการทำความเร็วของไทม์ไลน์หลักเกิน 20 npm (โน้ตต่อนาที)" + description: "มีการทำความเร็วของไทม์ไลน์ที่บ้านของคุณเกิน 20 npm (โน้ตต่อนาที)" _viewInstanceChart: title: "วิเคราะห์" - description: "ดูแผนภูมิของเซิร์ฟเวอร์" + description: "ดูแผนภูมิอินสแตนซ์ของคุณ" _outputHelloWorldOnScratchpad: title: "หวัดดีชาวโลก!" description: "เอาพุต \"hello world\" ใน Scratchpad" @@ -1660,23 +1426,23 @@ _achievements: title: "คุณอ่านมันจริงๆหรือเปล่า?" description: "มีการโต้ตอบกับโน้ตที่มีความยาวมากกว่า 100 ตัวอักษรภายใน 3 วินาทีหลังจากที่โพสต์" _clickedClickHere: - title: "คลิกที่นี่" + title: "คลิ๊กที่นี่" description: "คุณได้คลิกที่นี่" _justPlainLucky: title: "แค่ลัคกี้ธรรมดา" description: "มีโอกาสที่จะได้รับด้วยความน่าจะเป็นไปได้ 0.005% ทุก ๆ 10 วินาที" _setNameToSyuilo: - title: "คอมเพล็กซ์ของพระเจ้า" - description: "ตั้งชื่อเป็น “syuilo”" + title: "พระเจ้าคอมเพล็กซ์" + description: "ตั้งชื่อของคุณเป็น \"syuilo\"" _passedSinceAccountCreated1: title: "ครบรอบหนึ่งปี" - description: "ผ่านไป 1 ปีนับตั้งแต่สร้างบัญชี" + description: "ผ่านไปหนึ่งปีแล้วนะตั้งแต่บัญชีของคุณถูกสร้างขึ้นมาน่ะ" _passedSinceAccountCreated2: title: "ครบรอบสองปี" - description: "ผ่านไป 2 ปีนับตั้งแต่สร้างบัญชี" + description: "ผ่านไปสองปีแล้วนะตั้งแต่บัญชีของคุณถูกสร้างขึ้นมาน่ะ" _passedSinceAccountCreated3: title: "ครบรอบสามปี" - description: "ผ่านไป 3 ปีนับตั้งแต่สร้างบัญชี" + description: "ผ่านไปสามปีแล้วนะตั้งแต่บัญชีของคุณถูกสร้างขึ้นมาน่ะ" _loggedInOnBirthday: title: "สุขสันต์วันเกิด" description: "เข้าสู่ระบบในวันเกิดของคุณ" @@ -1687,7 +1453,7 @@ _achievements: _cookieClicked: title: "เกมที่คุณคลิกที่คุกกี้" description: "คลิกคุกกี้" - flavor: "ใช่หรอ? แน่ใจว่าซอฟต์แวร์ทำงานถูกต้องนะ?" + flavor: "เดี๋ยวก่อนนะ คุณอยู่ในเว็บไซต์ที่ถูกต้องแน่อย่างงั้นเหรอ?" _brainDiver: title: "Brain Diver" description: "โพสต์ลิงก์ไปยัง Brain Diver" @@ -1695,66 +1461,52 @@ _achievements: _smashTestNotificationButton: title: "ทดสอบโอเวอร์โฟลว์" description: "ทดสอบการแจ้งเตือนทริกเกอร์ซ้ำๆ ภายในระยะเวลาอันสั้นๆ" - _tutorialCompleted: - title: "ใบรับรองการสำเร็จหลักสูตร Misskey มือใหม่" - description: "เสร็จสิ้นการสอนแล้ว" - _bubbleGameExplodingHead: - title: "🤯" - description: "สร้างวัตถุที่ใหญ่ที่สุดในเกมบับเบิ้ล" - _bubbleGameDoubleExplodingHead: - title: "ดับเบิ้ล" - description: "สร้างวัตถุที่ใหญ่ที่สุดในเกมบับเบิ้ลสองชิ้นในเวลาเดียวกัน" - flavor: "ปิ่นโตขนาดนี้ น่าจะเพิ่ม 🤯 🤯 เข้าไปนิดหน่อย" _role: new: "บทบาทใหม่" edit: "แก้ไขบทบาท" name: "ชื่อบทบาท" description: "คำอธิบายบทบาท" permission: "สิทธิ์ตามบทบาท" - descriptionOfPermission: "ผู้ควบคุม สามารถดำเนินการดูแลขั้นพื้นฐานได้\nผู้ดูแลระบบ สามารถเปลี่ยนการตั้งค่าทั้งหมดของเซิร์ฟเวอร์ได้" + descriptionOfPermission: "ผู้ดูแลกลั่นกรองเนื้อหา สามารถดำเนินการดูแลขั้นพื้นฐานได้นะ\nผู้ดูแลระบบ สามารถเปลี่ยนการตั้งค่าทั้งหมดของอินสแตนซ์ได้นะ" assignTarget: "มอบหมาย" - descriptionOfAssignTarget: "แบบปรับเอง เพิ่มถอนบทบาทนี้แก่ผู้ใช้ด้วยตัวเอง\nแบบมีเงื่อนไข เพิ่มถอนบทบาทนี้แก่ผู้ใช้โดยอัตโนมัติหากเข้าเงื่อนไขใดต่อไปนี้" + descriptionOfAssignTarget: "แมนนวล เพื่อเปลี่ยนผู้ที่เป็นส่วนหนึ่งของบทบาทนี้และใครที่ไม่ใช่ด้วยตนเอง\nเงื่อนไข เพื่อให้ผู้ใช้ได้รับการกำหนดและนำออกจากบทบาทนี้โดยอัตโนมัติตามเงื่อนไขชุดหนึ่ง" manual: "ปรับเอง" - manualRoles: "บทบาทแบบทำมือ" conditional: "มีเงื่อนไข" - conditionalRoles: "บทบาทแบบมีเงื่อนไข" condition: "เงื่อนไข" isConditionalRole: "นี่คือบทบาทที่มีเงื่อนไข" - isPublic: "ทำให้บทบาทเปิดเผยต่อสาธารณะ" - descriptionOfIsPublic: "บทบาทจะปรากฏบนโปรไฟล์ของผู้ใช้และเปิดเผยต่อสาธารณะ (ทุกคนสามารถเห็นได้ว่าผู้ใช้รายนี้มีบทบาทนี้)" + isPublic: "บทบาทสาธารณะ" + descriptionOfIsPublic: "ทุกคนสามารถดูได้ว่าผู้ใช้งานนั้นได้รับมอบหมายบทบาทด้วยหรือไม่ \n\nบทบาทจะแสดงในโปรไฟล์ของผู้ใช้ด้วย" options: "ตัวเลือกบทบาท" policies: "นโยบาย" - baseRole: "แม่แบบบทบาท" - useBaseValue: "ใช้ตามแม่แบบบทบาท" + baseRole: "บทบาทพื้นฐาน" + useBaseValue: "ใช้บทบาทพื้นฐานเริ่มต้น" chooseRoleToAssign: "เลือกบทบาทที่ต้องการกำหนด" - iconUrl: "URL ไอคอน" + iconUrl: "ไอคอน URL" asBadge: "แสดงเป็นตรา" - descriptionOfAsBadge: "เมื่อเปิดใช้งาน ไอคอนบทบาทจะปรากฏถัดจากชื่อผู้ใช้" - isExplorable: "ค้นหาผู้ใช้ได้ง่ายขึ้นโดยดูจากบทบาท" - descriptionOfIsExplorable: "เมื่อเปิดใช้งาน ไทมไลน์บทบาทนี้และสมาชิกที่มีบทบาทนี้จะเปิดเผยเป็นสาธารณะ" - displayOrder: "ลำดับการแสดงผล" - descriptionOfDisplayOrder: "เลขที่สูงกว่าจะแสดงบน UI ก่อน" - canEditMembersByModerator: "อนุญาตให้ผู้ควบคุมแก้ไขสมาชิก" - descriptionOfCanEditMembersByModerator: "เมื่อเปิดใช้ นอกเหนือจากผู้ควบคุมและผู้ดูแลระบบแล้ว จะสามารถเพิ่มถอนบทบาทนี้แก่ผู้ใช้ได้ แต่เมื่อปิดใช้ จะมีเฉพาะผู้ดูแลระบบเท่านั้นที่จะสามารถดำเนินการได้" + descriptionOfAsBadge: "ไอคอนของบทบาทนี้จะปรากฏถัดจากชื่อผู้ใช้ของผู้ใช้งานด้วยบทบาทนี้ถ้าหากเปิดใช้งาน" + isExplorable: "บทบาทไทม์ไลน์เป็นแบบสาธารณะ" + descriptionOfIsExplorable: "ไทม์ไลน์ของบทบาทนี้จะสามารถเข้าถึงได้แบบสาธารณะถ้าหากเปิดใช้งาน เส้นเวลาของบทบาทนั้นจะไม่ถูกเปิดเผยต่อสาธารณะ ถึงแม้ว่าจะไม่เปิดเผยต่อสาธารณะแม้แต่ว่า...จะตั้งค่าไว้ยังไงก็ตาม" + displayOrder: "ตำแหน่ง" + descriptionOfDisplayOrder: "ยิ่งตัวเลขสูง ตำแหน่ง UI ก็ยิ่งสูงขึ้นนะ" + canEditMembersByModerator: "อนุญาตให้ผู้ดูแลแก้ไขสมาชิก" + descriptionOfCanEditMembersByModerator: "เมื่อเปิดใช้ ผู้ดูแลนอกเหนือจากผู้ดูแลระบบแล้ว จะสามารถกำหนดและยกเลิกการมอบหมายบทบาทนี้ให้กับผู้ใช้ได้ เมื่อปิด เฉพาะผู้ดูแลระบบเท่านั้นที่จะสามารถกำหนดผู้ใช้ได้นะ" priority: "ลำดับความสำคัญ" _priority: low: "ต่ำ" middle: "ปานกลาง" high: "สูง" _options: - gtlAvailable: "สามารถดูไทม์ไลน์ทั่วโลกได้" - ltlAvailable: "สามารถดูไทม์ไลน์ท้องถิ่นได้" - canPublicNote: "สามารถโพสต์แบบสาธารณะ" - mentionMax: "จำนวนการกล่าวถึงสูงสุดต่อโน้ต" - canInvite: "สร้างรหัสเชิญเข้าเซิร์ฟเวอร์" + gtlAvailable: "การดูไทม์ไลน์ทั่วโลก" + ltlAvailable: "การดูไทม์ไลน์ในท้องถิ่น" + canPublicNote: "สามารถส่งโน้ตสาธารณะ" + canInvite: "สร้างรหัสเชิญอินสแตนซ์" inviteLimit: "จำกัดการเชิญ" - inviteLimitCycle: "คูลดาวน์ในการเชิญ" + inviteLimitCycle: "จำกัดการเชิญไว้คูลดาวน์" inviteExpirationTime: "วันหมดอายุของรหัสการเชิญ" - canManageCustomEmojis: "จัดการเอโมจิที่กำหนดเอง" + canManageCustomEmojis: "จัดการอีโมจิแบบกำหนดเอง" canManageAvatarDecorations: "จัดการตกแต่งอวตาร" driveCapacity: "ความจุของไดรฟ์" alwaysMarkNsfw: "ทำเครื่องหมายไฟล์ว่าเป็น NSFW เสมอ" - canUpdateBioMedia: "อนุญาตให้ปรับปรุงไอคอนและแบนเนอร์" pinMax: "จํานวนสูงสุดของโน้ตที่ปักหมุดไว้" antennaMax: "จำนวนสูงสุดของเสาอากาศ" wordMuteMax: "จำนวนอักขระสูงสุดที่อนุญาตในการปิดเสียงคำ" @@ -1763,26 +1515,14 @@ _role: noteEachClipsMax: "จำนวนโน้ตสูงสุดภายในคลิป" userListMax: "จำนวนรายชื่อผู้ใช้สูงสุด" userEachUserListsMax: "จำนวนผู้ใช้สูงสุดภายในรายการผู้ใช้" - rateLimitFactor: "อัตราการจำกัด" - descriptionOfRateLimitFactor: "ยิ่งตัวเลขน้อยก็ยิ่งจำกัดน้อย ยิ่งมากก็ยิ่งเข้มงวดมากขึ้น" + rateLimitFactor: "ขีดจำกัดอัตรา" + descriptionOfRateLimitFactor: "ขีดจํากัดอัตราที่ต่ำกว่ามีข้อจํากัดน้อยกว่าข้อจํากัดที่สูงกว่า" canHideAds: "ซ่อนโฆษณา" canSearchNotes: "การใช้การค้นหาโน้ต" canUseTranslator: "การใช้งานแปล" - avatarDecorationLimit: "จำนวนการตกแต่งไอคอนสูงสุดที่สามารถติดตั้งได้" - canImportAntennas: "อนุญาตให้นำเข้าเสาอากาศ" - canImportBlocking: "อนุญาตให้นำเข้าการบล็อก" - canImportFollowing: "อนุญาตให้นำเข้ารายการต่อไปนี้" - canImportMuting: "อนุญาตให้นำเข้าการปิดกั้น" - canImportUserLists: "อนุญาตให้นำเข้ารายการ" _condition: - roleAssignedTo: "มอบหมายให้มีบทบาทแบบทำมือ" - isLocal: "ผู้ใช้ท้องถิ่น" + isLocal: "ผู้ใช้ภายใน" isRemote: "ผู้ใช้ระยะไกล" - isCat: "ผู้ใช้ที่เป็นแมว" - isBot: "ผู้ใช้ที่เป็นบอต" - isSuspended: "ผู้ใช้ที่ถูกระงับ" - isLocked: "ผู้ใช้บัญชีไม่เปิดเผยสาธารณะ" - isExplorable: "ผู้ใช้ที่เปิดใช้งาน “ทำให้บัญชีของฉันค้นหาได้ง่ายขึ้น”" createdLessThan: "สร้างน้อยกว่า" createdMoreThan: "สร้างมากกว่า" followersLessThanOrEq: "จำนวนผู้ติดตามน้อยกว่าหรือเท่ากับ\n" @@ -1795,10 +1535,10 @@ _role: or: "หรือ" not: "ไม่" _sensitiveMediaDetection: - description: "ใช้ Machine Learning เพื่อตรวจจับสื่อที่มีเนื้อหาละเอียดอ่อนโดยอัตโนมัติและใช้เพื่อการกลั่นกรอง ภาระของเซิร์ฟเวอร์จะเพิ่มขึ้นเล็กน้อย" - sensitivity: "ความไวในการตรวจจับ" - sensitivityDescription: "เมื่อความไวต่ำ Misdetection (ผลบวกลวง) จะลดลง, เมื่อความไวสูง Missed detection (ผลลบลวง) จะลดลง" - setSensitiveFlagAutomatically: "ทำเครื่องหมายว่ามีเนื้อหาละเอียดอ่อน" + description: "ลดความพยายามในการดูแลเซิร์ฟเวอร์ผ่านการจดจำสื่อ NSFW โดยอัตโนมัติผ่านการเรียนรู้ของเครื่อง การทำสิ่งนี้อาจจะเพิ่มภาระบนเซิร์ฟเวอร์เล็กน้อย" + sensitivity: "การตรวจจับความไว" + sensitivityDescription: "การลดความไวนั้นจะนำไปสู่การตรวจจับที่ผิดพลาดน้อยลง (ผลบวกที่ผิดพลาด) แต่ในขณะที่การเพิ่มนั้นจะนำไปสู่การตรวจหาที่พลาดน้อยลง (ผลลบเท็จ)" + setSensitiveFlagAutomatically: "ทำเครื่องหมายว่าเป็น NSFW" setSensitiveFlagAutomaticallyDescription: "ผลลัพธ์ของการตรวจจับภายในนั้นจะยังคงอยู่ ถึงแม้ว่าจะปิดตัวเลือกนี้" analyzeVideos: "เปิดใช้งานวิเคราะห์ของวิดีโอ" analyzeVideosDescription: "การวิเคราะห์วิดีโอนอกเหนือจากรูปภาพนั้น การทำสิ่งนี้จะทำให้เพิ่มภาระบนเซิร์ฟเวอร์เล็กน้อย" @@ -1808,19 +1548,18 @@ _emailUnavailable: disposable: "ไม่สามารถใช้อีเมลชั่วคราวได้" mx: "เซิร์ฟเวอร์อีเมลนี้ไม่ถูกต้อง" smtp: "เซิร์ฟเวอร์อีเมลนี้ไม่มีการตอบสนอง" - banned: "คุณไม่สามารถลงทะเบียนด้วยที่อยู่อีเมลนี้ได้" _ffVisibility: - public: "สาธารณะ" + public: "เผยแพร่" followers: "ปรากฏให้แก่ผู้ติดตามเท่านั้น" private: "ส่วนตัว" _signup: - almostThere: "เกือบจะเสร็จแล้ว" - emailAddressInfo: "กรุณากรอกที่อยู่อีเมลที่คุณใช้ ที่อยู่อีเมลของคุณจะไม่ถูกเผยแพร่สู่สาธารณชน" - emailSent: "อีเมลยืนยันได้ถูกส่งไปยังที่อยู่อีเมลที่คุณป้อน ({email}) แล้ว กรุณาติดตามลิงก์ในอีเมลเพื่อสร้างบัญชีให้เสร็จสมบูรณ์ ลิงก์ที่ให้ไว้จะหมดอายุใน 30 นาที" + almostThere: "เกือบจะมี" + emailAddressInfo: "โปรดกรอกอีเมลของคุณ มันจะไม่เปิดเผยต่อสาธารณะ" + emailSent: "เราได้ส่งอีเมลยืนยันไปยังที่อยู่อีเมลของคุณแล้วนะ ({email}) โปรดคลิกลิงก์ที่รวมไว้เพื่อสร้างบัญชีให้เสร็จสิ้น" _accountDelete: accountDelete: "ลบบัญชีผู้ใช้" mayTakeTime: "เนื่องจากการลบบัญชีนี้จะเป็นกระบวนการที่ต้องใช้ทรัพยากรมาก จึงอาจจะต้องใช้เวลาสักครู่ถึงจะเสร็จสมบูรณ์ ทั้งนี้ขึ้นอยู่กับจำนวนเนื้อหาที่คุณสร้างและจำนวนไฟล์ที่คุณอัปโหลดนะ" - sendEmail: "เมื่อการลบบัญชีเสร็จสิ้น การแจ้งเตือนจะถูกส่งไปยังที่อยู่อีเมลที่ลงทะเบียนไว้" + sendEmail: "เมื่อการลบบัญชีนี้เสร็จสิ้น เราอาจจะส่งอีเมลไปยังที่อยู่อีเมลของคุณที่เคยลงทะเบียนไว้กับบัญชีนี้นะ" requestAccountDelete: "ร้องขอให้ลบบัญชี" started: "การลบได้เริ่มต้นขึ้น" inProgress: "ปัจจุบันกำลังดำเนินการลบอยู่" @@ -1830,18 +1569,16 @@ _ad: hide: "ไม่ต้องแสดง" timezoneinfo: "วันในสัปดาห์นี้จะถูกกำหนดจากโซนเวลาของเซิร์ฟเวอร์" adsSettings: "ตั้งค่าการโฆษณา" - notesPerOneAd: "อัปเดตช่วงเวลาตำแหน่งโฆษณาแบบเรียลไทม์ (จำนวนโน้ตต่อโฆษณา)" setZeroToDisable: "ตั้งค่านี้ให้เป็น 0 เพื่อปิดใช้งานโฆษณาอัปเดตแบบเรียลไทม์" - adsTooClose: "เนื่องจากช่วงเวลาการแสดงโฆษณาสั้นมาก ประสบการณ์ผู้ใช้จึงอาจลดลงอย่างมาก" _forgotPassword: enterEmail: "ป้อนที่อยู่อีเมลที่คุณเคยใช้ในการลงทะเบียนไว้ ลิงก์ที่คุณสามารถรีเซ็ตรหัสผ่านได้นั้นจะถูกส่งไปนะ" - ifNoEmail: "หากลงทะเบียนแบบไม่ใช้อีเมล โปรดติดต่อผู้ดูแลระบบ" - contactAdmin: "เนื่องจากเซิร์ฟเวอร์นี้ไม่รองรับการส่งอีเมล หากต้องการรีเซ็ตรหัสผ่าน กรุณาติดต่อผู้ดูแลระบบ" + ifNoEmail: "ถ้าหากคุณไม่ได้ใช้อีเมลระหว่างการลงทะเบียน กรุณาติดต่อผู้ดูแลระบบอินสแตนซ์แทนนะ" + contactAdmin: "อินสแตนซ์นี้ไม่รองรับการใช้งานที่อยู่อีเมลนี้ กรุณาติดต่อผู้ดูแลระบบอินสแตนซ์เพื่อรีเซ็ตรหัสผ่านของคุณแทน" _gallery: my: "แกลลอรี่ของฉัน" liked: "โพสต์ที่ถูกใจ" - like: "ถูกใจ!" - unlike: "เลิกถูกใจ" + like: "ชื่นชอบ" + unlike: "ลบไลค์" _email: _follow: title: "ได้ติดตามคุณ" @@ -1852,25 +1589,24 @@ _plugin: installWarn: "กรุณาอย่าติดตั้งปลั๊กอินที่ไม่น่าเชื่อถือนะคะ" manage: "จัดการปลั๊กอิน" viewSource: "ดูต้นฉบับ" - viewLog: "แสดงปูม" _preferencesBackups: - list: "การตั้งค่าที่สำรองไว้" - saveNew: "บันทึกการตั้งค่าสำรองใหม่" + list: "สร้างการสำรองข้อมูล" + saveNew: "บันทึกใหม่" loadFile: "โหลดจากไฟล์" apply: "นำไปใช้กับอุปกรณ์นี้" save: "บันทึก" - inputName: "กรุณาป้อนชื่อการตั้งค่าสำรองนี้" + inputName: "กรุณาป้อนชื่อสำหรับข้อมูลสำรองนี้" cannotSave: "การบันทึกล้มเหลว" - nameAlreadyExists: "มีการตั้งค่าสำรองชื่อ “{name}” อยู่แล้ว กรุณาป้อนชื่ออื่น" - applyConfirm: "ต้องการใช้การตั้งค่าสำรอง “{name}” กับอุปกรณ์นี้ใช่ไหม? การตั้งค่าที่มีอยู่บนอุปกรณ์นี้จะถูกเขียนทับ" - saveConfirm: "บันทึกการตั้งค่าสำรองเป็น {name} ใช่ไหม?" - deleteConfirm: "ต้องการลบ {name} ใช่ไหม?" - renameConfirm: "ต้องการเปลี่ยนชื่อจาก “{old}” เป็น “{new}” ใช่ไหม?" - noBackups: "ไม่มีการตั้งค่าสำรอง สามารถบันทึกการตั้งค่าไคลเอนต์ปัจจุบันไปยังเซิร์ฟเวอร์ด้วย “บันทึกการตั้งค่าสำรองใหม่”" + nameAlreadyExists: "มีข้อมูลสำรองชื่อ \"{name}\" นี้อยู่แล้ว กรุณาป้อนชื่ออื่นนะ" + applyConfirm: "คุณต้องการใช้ข้อมูลสำรอง \"{name}\" กับอุปกรณ์นี้อย่างงั้นจริงหรอ การตั้งค่าที่มีอยู่ของอุปกรณ์นี้จะถูกเขียนทับนะ" + saveConfirm: "บันทึกข้อมูลสำรองเป็น {name} มั้ย?" + deleteConfirm: "ลบข้อมูลสำรอง {name} มั้ย?" + renameConfirm: "เปลี่ยนชื่อข้อมูลสำรองนี้จาก \"{old}\" เป็น \"{new}\" หรือป่าว" + noBackups: "ไม่มีข้อมูลสำรองนะ คุณสามารถสำรองข้อมูลการตั้งค่าไคลเอนต์ของคุณบนเซิร์ฟเวอร์นี้โดยใช้ \"สร้างการสำรองข้อมูลใหม่\"ได้นะ" createdAt: "สร้างเมื่อ: {date} {time}" updatedAt: "อัปเดตเมื่อ: {date} {time}" cannotLoad: "การโหลดล้มเหลว" - invalidFile: "รูปแบบไฟล์ไม่ถูกต้อง" + invalidFile: "รูปแบบไฟล์ไม่ถูกต้องนะ" _registry: scope: "สโคป" key: "คีย์" @@ -1882,16 +1618,13 @@ _aboutMisskey: contributors: "ผู้สนับสนุนหลัก" allContributors: "ผู้มีส่วนร่วมทั้งหมด" source: "ซอร์สโค้ด" - original: "ต้นฉบับ" - thisIsModifiedVersion: "{name} ใช้ Misskey เวอร์ชันดัดแปลง" translation: "แปลภาษา Misskey" donate: "บริจาคให้กับ Misskey" - morePatrons: "และอีกหลายท่านที่ไม่ได้เอ่ยนาม ขอบคุณที่ร่วมช่วยเหลือตลอดมานะคะ 🥰" - patrons: "ผู้อุปถัมภ์" - projectMembers: "สมาชิกในโครงการ" + morePatrons: " ขอบคุณทุกท่านที่ร่วมกันช่วยเหลือตลอดมานะคะ 🥰" + patrons: "สมาชิกพันธมิตร" _displayOfSensitiveMedia: - respect: "ซ่อนสื่อที่มีเนื้อหาละเอียดอ่อน" - ignore: "แสดงสื่อที่มีเนื้อหาละเอียดอ่อน" + respect: "ซ่อนสื่อทำเครื่องหมายบอกว่าละเอียดอ่อน" + ignore: "แสดงผลสื่อทำเครื่องหมายบอกว่าละเอียดอ่อน" force: "ซ่อนสื่อทั้งหมด" _instanceTicker: none: "ไม่ต้องแสดง" @@ -1902,18 +1635,17 @@ _serverDisconnectedBehavior: dialog: "แสดงกล่องโต้ตอบคำเตือน" quiet: "แสดงคำเตือนที่ไม่เป็นการรบกวน" _channel: - create: "สร้างช่องใหม่" - edit: "แก้ไขช่อง" + create: "สร้างแชนแนลใหม่" + edit: "แก้ไขแชนแนล" setBanner: "เซตแบนเนอร์" removeBanner: "ลบแบนเนอร์" featured: "เทรนด์" owned: "เจ้าของ" following: "ติดตามแล้ว" usersCount: "{n} ผู้เข้าร่วม" - notesCount: "มี {n} โน้ต" + notesCount: "{n} โน้ต" nameAndDescription: "ชื่อและคำอธิบาย" nameOnly: "ชื่อเท่านั้น" - allowRenoteToExternal: "อนุญาตให้รีโน้ตและอ้างอิงนอกช่องได้" _menuDisplay: sideFull: "ด้านข้าง" sideIcon: "ด้านข้าง (ไอคอน)" @@ -1921,13 +1653,13 @@ _menuDisplay: hide: "ซ่อน" _wordMute: muteWords: "ปิดเสียงคำ" - muteWordsDescription: "คั่นด้วยเว้นวรรคสำหรับเงื่อนไข AND, หรือขึ้นบรรทัดใหม่สำหรับเงื่อนไข OR" + muteWordsDescription: "คั่นด้วยช่องว่างสำหรับเงื่อนไข AND หรือด้วยการขึ้นบรรทัดใหม่สำหรับเงื่อนไข OR นะ" muteWordsDescription2: "ล้อมรอบคีย์เวิร์ดด้วยเครื่องหมายทับเพื่อใช้นิพจน์ทั่วไป" _instanceMute: - instanceMuteDescription: "ปิดเสียง “โน้ต/รีโน้ต” ทั้งหมดจากเซิร์ฟเวอร์ที่ระบุไว้ รวมถึงโน้ตของผู้ใช้ที่ตอบกลับผู้ใช้จากเซิร์ฟเวอร์ที่ถูกปิดเสียง" + instanceMuteDescription: "การดำเนินการนี้จะปิดเสียง\"โน้ต/รีโน้ต\"จากอินสแตนซ์ที่อยู่ในรายการ รวมถึงบันทึกของผู้ใช้ที่ตอบกลับผู้ใช้จากอินสแตนซ์ที่ปิดเสียง" instanceMuteDescription2: "คั่นด้วยการขึ้นบรรทัดใหม่" - title: "ซ่อนโน้ตจากเซิร์ฟเวอร์ที่มีระบุไว้" - heading: "เซิร์ฟเวอร์ที่ถูกปิดเสียง" + title: "ซ่อนโน้ตจากอินสแตนซ์ที่มีอยู่ในรายการ" + heading: "รายชื่ออินสแตนซ์ที่ถูกปิดเสียง" _theme: explore: "สำรวจธีม" install: "ติดตั้งธีม" @@ -1959,8 +1691,8 @@ _theme: importInfo: "ถ้าหากต้องการป้อนโค้ดที่นี่ คุณยังสามารถนำเข้าไปยังโปรแกรมแก้ไขธีมได้" deleteConstantConfirm: "คุณต้องการลบค่าคงที่ {const} หรือป่าว?" keys: - accent: "สีหลัก" - bg: "พื้นหลัง" + accent: "เน้น" + bg: "ภาพพื้นหลัง" fg: "ข้อความ" focus: "โฟกัส" indicator: "ตัวบ่งชี้" @@ -1991,26 +1723,20 @@ _theme: buttonBg: "ปุ่มพื้นหลัง" buttonHoverBg: "ปุ่มพื้นหลัง (โฮเวอร์)" inputBorder: "เส้นขอบของช่องป้อนข้อมูล" + listItemHoverBg: "รายการไอเทมพื้นหลัง (โฮเวอร์)" driveFolderBg: "พื้นหลังโฟลเดอร์ไดรฟ์" wallpaperOverlay: "วอลล์เปเปอร์ซ้อนทับ" badge: "ตรา" messageBg: "พื้นหลังแชท" - accentDarken: "สีหลัก (มืด)" - accentLighten: "สีหลัก (สว่าง)" + accentDarken: "เน้น (มืด)" + accentLighten: "เน้น (สว่าง)" fgHighlighted: "ข้อความที่ไฮไลต์" _sfx: - note: "โน้ต" + note: "หมายเหตุ" noteMy: "โน้ตของตัวเอง" notification: "การเเจ้งเตือน" - reaction: "เมื่อเลือกรีแอคชั่น" -_soundSettings: - driveFile: "ใช้เสียงจากไดรฟ์" - driveFileWarn: "เลือกไฟล์ในไดรฟ์ของคุณ" - driveFileTypeWarn: "ไม่รองรับไฟล์นี้" - driveFileTypeWarnDescription: "กรุณาเลือกไฟล์เสียง" - driveFileDurationWarn: "เสียงยาวเกินไป" - driveFileDurationWarnDescription: "การใช้เสียงที่ยาว อาจรบกวนการใช้งาน Misskey, ต้องการดำเนินการต่อใช่ไหม?" - driveFileError: "ไม่สามารถโหลดไฟล์เสียงได้ กรุณาเปลี่ยนแปลงการตั้งค่า" + antenna: "เสาอากาศ" + channel: "การแจ้งเตือนช่อง" _ago: future: "อนาคต" justNow: "เมื่อกี๊นี้" @@ -2022,14 +1748,6 @@ _ago: monthsAgo: "{n} เดือนที่แล้ว" yearsAgo: "{n} ปีที่ผ่านมา" invalid: "ไม่พบผลลัพธ์" -_timeIn: - seconds: "ใน {n} วินาที" - minutes: "ใน {n} นาที" - hours: "ใน {n} ชั่วโมง" - days: "ใน {n} วัน" - weeks: "ใน {n} สัปดาห์" - months: "ใน {n} เดือน" - years: "ใน {n} ปี" _time: second: "วินาที" minute: "นาที" @@ -2040,6 +1758,7 @@ _2fa: registerTOTP: "ลงทะเบียนแอพตัวตรวจสอบสิทธิ์" step1: "ขั้นตอนแรก ติดตั้งแอปยืนยันตัวตน (เช่น {a} หรือ {b}) บนอุปกรณ์ของคุณ" step2: "จากนั้นสแกนรหัส QR ที่แสดงบนหน้าจอนี้" + step2Click: "การคลิกที่รหัส QR นี้จะช่วยให้คุณนั้นสามารถลงทะเบียน 2FA กับคีย์ความปลอดภัยหรือแอปตรวจสอบความถูกต้องของโทรศัพท์ได้" step2Uri: "ป้อนใส่ URL ดังต่อไปนี้ถ้าหากคุณใช้โปรแกรมเดสก์ท็อป" step3Title: "ป้อนรหัสยืนยัน" step3: "ป้อนโทเค็นที่แอปของคุณให้มาเพื่อเสร็จสิ้นการตั้งค่า" @@ -2054,105 +1773,54 @@ _2fa: removeKey: "ลบคีย์ความปลอดภัยออก" removeKeyConfirm: "ลบข้อมูลสำรอง {name} มั้ย?" whyTOTPOnlyRenew: "ไม่สามารถลบแอปตัวรับรองความถูกต้องได้ตราบใดที่มีการลงทะเบียนคีย์ความปลอดภัยไว้แล้ว" - renewTOTP: "ตั้งค่าแอปยืนยันตัวตน" + renewTOTP: "กำหนดค่าแอพตัวตรวจสอบสิทธิ์ใหม่" renewTOTPConfirm: "วิธีการแบบนี้จะทําให้รหัสยืนยันจากแอพก่อนหน้าของคุณหยุดทํางานเลยนะ" renewTOTPOk: "ตั้งค่าคอนฟิกใหม่" renewTOTPCancel: "ไม่เป็นไร" - checkBackupCodesBeforeCloseThisWizard: "โปรดตรวจสอบรหัสแบ๊กอัปด้านล่างก่อนที่จะปิดวิซาร์ดนี้" - backupCodes: "รหัสแบ๊กอัป" - backupCodesDescription: "หากแอปยืนยันตัวตนของคุณไม่พร้อมใช้งาน คุณสามารถใช้รหัสสำรองด้านล่างเพื่อเข้าถึงบัญชีของคุณได้ อย่าลืมเก็บรหัสเหล่านี้ไว้ในที่ปลอดภัย แต่ละรหัสสามารถใช้ได้เพียงครั้งเดียวเท่านั้น" - backupCodeUsedWarning: "รหัสแบ๊กอัปถูกใช้งานแล้ว หากแอปพลิเคชันการยืนยันตัวตนไม่สามารถใช้งานได้ ให้รีบทำการตั้งค่าแอปฯใหม่โดยเร็วที่สุด" - backupCodesExhaustedWarning: "รหัสแบ๊กอัปทั้งหมดถูกใช้งานแล้ว หากยังไม่สามารถใช้แอปพลิเคชันการยืนยันตัวตนได้ก็จะไม่สามารถเข้าถึงบัญชีนี้ได้อีกต่อไป กรุณาลงทะเบียนแอปพลิเคชันการยืนยันตัวตนใหม่" - moreDetailedGuideHere: "คลิกที่นี่เพื่อดูคำแนะนำโดยละเอียด" + backupCodes: "รหัสสำรองข้อมูล" + backupCodeUsedWarning: "มีการใช้รหัสสำรองแล้ว โปรดกรุณากำหนดค่าการตรวจสอบสิทธิ์แบบสองปัจจัยโดยเร็วที่สุดถ้าหากคุณยังไม่สามารถใช้งานได้อีก" + backupCodesExhaustedWarning: "รหัสสำรองทั้งหมดถูกใช้แล้ว ถ้าหากคุณยังสูญเสียการเข้าถึงแอปการตรวจสอบสิทธิ์แบบสองปัจจัยคุณจะยังไม่สามารถเข้าถึงบัญชีนี้ได้ กรุณากำหนดค่าการรับรองความถูกต้องด้วยการยืนยันสองชั้น" _permissions: - "read:account": "ดูข้อมูลบัญชี" - "write:account": "แก้ไขข้อมูลบัญชี" - "read:blocks": "ดูรายชื่อผู้ใช้ที่ถูกบล็อก" - "write:blocks": "แก้ไขรายชื่อผู้ใช้ที่ถูกบล็อก" - "read:drive": "เข้าถึงไดรฟ์" - "write:drive": "จัดการไดรฟ์" + "read:account": "ดูข้อมูลบัญชีของคุณ" + "write:account": "แก้ไขข้อมูลบัญชีของคุณ" + "read:blocks": "ดูรายชื่อผู้ใช้ที่ถูกบล็อกของคุณ" + "write:blocks": "แก้ไขรายชื่อผู้ใช้ที่ถูกบล็อกของคุณ" + "read:drive": "เข้าถึงไฟล์และโฟลเดอร์ในไดรฟ์ของคุณ" + "write:drive": "แก้ไขหรือลบไฟล์และโฟลเดอร์ในไดรฟ์ของคุณ" "read:favorites": "ดูรายการโปรด" "write:favorites": "แก้ไขรายการโปรด" "read:following": "ดูข้อมูลว่าใครที่คุณติดตาม" "write:following": "ติดตามหรือเลิกติดตามบัญชีอื่น" - "read:messaging": "ดูแชท" + "read:messaging": "ดูแชทของคุณ" "write:messaging": "เขียนหรือลบข้อความแชท" - "read:mutes": "ดูรายชื่อผู้ใช้ที่ถูกปิดเสียง" + "read:mutes": "ดูรายชื่อผู้ใช้ที่ปิดเสียงของคุณ" "write:mutes": "แก้ไขรายชื่อผู้ใช้ที่ถูกปิดเสียง" "write:notes": "เขียนหรือลบโน้ต" - "read:notifications": "ดูการแจ้งเตือน" - "write:notifications": "จัดการแจ้งเตือน" - "read:reactions": "ดูรีแอคชั่น" - "write:reactions": "แก้ไขรีแอคชั่น" + "read:notifications": "ดูการแจ้งเตือนของคุณ" + "write:notifications": "จัดการแจ้งเตือนของคุณ" + "read:reactions": "ดูปฏิกิริยาของคุณ" + "write:reactions": "แก้ไขปฏิกิริยาของคุณ" "write:votes": "โหวตบนสำรวจความคิดเห็น" - "read:pages": "ดูหน้าเพจ" - "write:pages": "แก้ไขหรือลบเพจ" - "read:page-likes": "ดูรายการเพจที่ถูกใจไว้" - "write:page-likes": "แก้ไขรายการเพจที่ถูกใจ" - "read:user-groups": "ดูกลุ่มผู้ใช้" - "write:user-groups": "แก้ไขหรือลบกลุ่มผู้ใช้" - "read:channels": "ดูช่อง" - "write:channels": "แก้ไขช่อง" + "read:pages": "ดูหน้า" + "write:pages": "แก้ไขหรือลบเพจของคุณ" + "read:page-likes": "ดูไลค์ของคุณบนเพจ" + "write:page-likes": "แก้ไขการถูกใจของคุณบนเพจ" + "read:user-groups": "ดูกลุ่มผู้ใช้ของคุณ" + "write:user-groups": "แก้ไขหรือลบกลุ่มผู้ใช้ของคุณ" + "read:channels": "ดูแชนแนลของคุณ" + "write:channels": "แก้ไขแชนแนลของคุณ" "read:gallery": "ดูแกลเลอรี่" - "write:gallery": "แก้ไขแกลเลอรี" - "read:gallery-likes": "ดูแกลเลอรีที่ถูกใจไว้" - "write:gallery-likes": "จัดการแกลเลอรีที่ถูกใจไว้" - "read:flash": "ดู Play" - "write:flash": "แก้ไข Play" - "read:flash-likes": "ดูรายการ play ที่ถูกใจไว้" - "write:flash-likes": "แก้ไขรายการ play ที่ถูกใจไว้" - "read:admin:abuse-user-reports": "ดูรายงานจากผู้ใช้" - "write:admin:delete-account": "ลบบัญชีผู้ใช้" - "write:admin:delete-all-files-of-a-user": "ลบไฟล์ทั้งหมดของผู้ใช้" - "read:admin:index-stats": "ดูข้อมูลเกี่ยวกับดัชนีฐานข้อมูล" - "read:admin:table-stats": "ดูข้อมูลเกี่ยวกับตารางในฐานข้อมูล" - "read:admin:user-ips": "ดูที่อยู่ IP ของผู้ใช้" - "read:admin:meta": "ดูข้อมูลอภิพันธุ์ของอินสแตนซ์" - "write:admin:reset-password": "รีเซ็ตรหัสผ่านของผู้ใช้" - "write:admin:resolve-abuse-user-report": "แก้ไขรายงานจากผู้ใช้" - "write:admin:send-email": "ส่งอีเมล" - "read:admin:server-info": "ดูข้อมูลเซิร์ฟเวอร์" - "read:admin:show-moderation-log": "ดูปูมการควบคุมดูแล" - "read:admin:show-user": "ดูข้อมูลส่วนตัวของผู้ใช้" - "write:admin:suspend-user": "ระงับผู้ใช้" - "write:admin:unset-user-avatar": "ลบอวตารผู้ใช้" - "write:admin:unset-user-banner": "ลบแบนเนอร์ผู้ใช้" - "write:admin:unsuspend-user": "ยกเลิกการระงับผู้ใช้" - "write:admin:meta": "จัดการข้อมูลอภิพันธุ์ของอินสแตนซ์" - "write:admin:user-note": "จัดการโน้ตการกลั่นกรอง" - "write:admin:roles": "จัดการบทบาท" - "read:admin:roles": "ดูบทบาท" - "write:admin:relays": "จัดการรีเลย์" - "read:admin:relays": "ดูรีเลย์" - "write:admin:invite-codes": "จัดการรหัสเชิญ" - "read:admin:invite-codes": "ดูรหัสเชิญ" - "write:admin:announcements": "จัดการประกาศ" - "read:admin:announcements": "ดูประกาศ" - "write:admin:avatar-decorations": "จัดการการตกแต่งอวตาร" - "read:admin:avatar-decorations": "ดูการตกแต่งอวตาร" - "write:admin:federation": "จัดการข้อมูลเกี่ยวกับสหพันธ์" - "write:admin:account": "จัดการบัญชีผู้ใช้" - "read:admin:account": "ดูข้อมูลเกี่ยวกับผู้ใช้" - "write:admin:emoji": "จัดการเอโมจิ" - "read:admin:emoji": "ดูเอโมจิ" - "write:admin:queue": "จัดการคิวงาน" - "read:admin:queue": "ดูข้อมูลเกี่ยวกับคิวงาน" - "write:admin:promo": "จัดการโน้ตโปรโมชั่น" - "write:admin:drive": "จัดการไดรฟ์ของผู้ใช้" - "read:admin:drive": "ดูข้อมูลเกี่ยวกับไดรฟ์ของผู้ใช้" - "read:admin:stream": "ใช้ Websocket API สำหรับผู้ดูแลระบบ" - "write:admin:ad": "จัดการโฆษณา" - "read:admin:ad": "ดูโฆษณา" - "write:invite-codes": "สร้างรหัสเชิญ" - "read:invite-codes": "รับรหัสเชิญ" - "write:clip-favorite": "จัดการคลิปที่ถูกใจ" - "read:clip-favorite": "ดูคลิปที่ถูกใจ" - "read:federation": "รับข้อมูลเกี่ยวกับสหพันธ์" - "write:report-abuse": "รายงานการละเมิด" + "write:gallery": "แก้ไขแกลเลอรี่ของคุณ" + "read:gallery-likes": "ดูรายการโพสต์ในแกลเลอรีที่ชอบของคุณ" + "write:gallery-likes": "แก้ไขรายการโพสต์ในแกลเลอรีที่ชอบของคุณ" + "read:flash": "วิว เพลย์" + "write:flash": "แก้ไขเพลย์" + "read:flash-likes": "ดูรายชื่อของไลค์ เพลย์" + "write:flash-likes": "แก้ไขรายชื่อของไลค์ เพลย์" _auth: shareAccessTitle: "การให้สิทธิ์แอปพลิเคชัน" shareAccess: "คุณต้องการอนุญาตให้ \"{name}\" เข้าถึงบัญชีนี้เลยมั้ย?" - shareAccessAsk: "ต้องการอนุญาตให้แอปพลิเคชันนี้เข้าถึงบัญชีของคุณใช่ไหม?" + shareAccessAsk: "คุณแน่ใจแล้วจริงๆหรอว่าต้องการอนุญาตให้แอปพลิเคชันนี้เข้าถึงบัญชีของคุณแน่ใจแล้วหรอ?" permission: "{name} ได้ขอสิทธิ์การเข้าถึงดังต่อไปนี้" permissionAsk: "แอปพลิเคชันนี้ขอสิทธิ์ดังต่อไปนี้" pleaseGoBack: "กรุณากลับไปที่แอปพลิเคชัน" @@ -2175,7 +1843,7 @@ _weekday: saturday: "วันเสาร์" _widgets: profile: "โปรไฟล์" - instanceInfo: "ข้อมูลเซิร์ฟเวอร์" + instanceInfo: "ข้อมูล อินสแตนซ์" memo: "โน้ตแปะ" notifications: "การเเจ้งเตือน" timeline: "ไทม์ไลน์" @@ -2188,22 +1856,21 @@ _widgets: photos: "รูปภาพ" digitalClock: "นาฬิกาดิจิตอล" unixClock: "นาฬิกา UNIX" - federation: "สหพันธ์" - instanceCloud: "กลุ่มเมฆเซิร์ฟเวอร์" + federation: "Fediration" + instanceCloud: "อินสแตนซ์คลาวด์" postForm: "แบบฟอร์มการโพสต์" slideshow: "แสดงภาพนิ่ง" button: "ปุ่ม" onlineUsers: "ผู้ใช้ที่ออนไลน์" jobQueue: "คิวงาน" serverMetric: "ตัวชี้วัดเซิร์ฟเวอร์" - aiscript: " คอนโซล AiScript" - aiscriptApp: "แอป AiScript" - aichan: "藍 (ไอ)" + aiscript: "AiScript คอนโซล" + aiscriptApp: "AiScript แอพ" + aichan: "ไอ" userList: "รายชื่อผู้ใช้" _userList: - chooseList: "เลือกรายชื่อ" + chooseList: "เลือกรายการ" clicker: "คลิกเกอร์" - birthdayFollowings: "วันเกิดผู้ใช้ในวันนี้" _cw: hide: "ซ่อน" show: "โหลดเพิ่มเติม" @@ -2211,53 +1878,53 @@ _cw: files: "{count} ไฟล์" _poll: noOnlyOneChoice: "จำเป็นต้องมีอย่างน้อยสองตัวเลือก" - choiceN: "ตัวเลือกที่ {n}" - noMore: "เพิ่มตัวเลือกอีกไม่ได้แล้ว" + choiceN: "ตัวเลือก {n}" + noMore: "คุณไม่สามารถเพิ่มตัวเลือกอื่นได้" canMultipleVote: "สามารถตอบได้หลายคำตอบ" - expiration: "สิ้นสุดโพล" - infinite: "ไม่กำหนดระยะเวลา" - at: "ระบุวันเวลา" - after: "ระบุระยะเวลา" + expiration: "สิ้นสุดการสำรวจความคิดเห็น" + infinite: "ไม่ต้องเลย" + at: "จบที่..." + after: "สิ้นสุดหลัง..." deadlineDate: "วันสิ้นสุด" - deadlineTime: "เวลา" + deadlineTime: "ชั่วโมง" duration: "ระยะเวลา" votesCount: "{n} คะแนนเสียง" - totalVotes: "ทั้งหมด {n} คะแนนเสียง" + totalVotes: "{n} คะแนนเสียงทั้งหมด" vote: "โหวต" showResult: "ดูผลลัพธ์" voted: "โหวตแล้ว" closed: "สิ้นสุดแล้ว" - remainingDays: "เหลืออีก {d} วัน {h} ชั่วโมง" - remainingHours: "เหลืออีก {h} ชั่วโมง {m} นาที" - remainingMinutes: "เหลืออีก {m} นาที {s} วินาที" - remainingSeconds: "เหลืออีก {s} วินาที" + remainingDays: "{d} วัน(s) {h} ชั่วโมง(s) ที่เหลืออยู่" + remainingHours: "{h} ชั่วโมง(s) {m} นาที(s) ที่เหลืออยู่" + remainingMinutes: "{m} นาที(s) {s} วินาที(s) ที่เหลืออยู่" + remainingSeconds: "{s} นาที(s) ที่เหลืออยู่" _visibility: public: "สาธารณะ" publicDescription: "โน้ตของคุณจะปรากฏแก่ผู้ใช้ทุกคน" - home: "หน้าหลัก" - homeDescription: "โพสต์ลงไทม์ไลน์หลักเท่านั้น" + home: "หน้าแรก" + homeDescription: "โพสลงไทม์ไลน์ที่บ้านเท่านั้น" followers: "ผู้ติดตาม" - followersDescription: "เฉพาะผู้ติดตามเท่านั้นที่มองเห็นได้" + followersDescription: "ทำให้ผู้ติดตามนั้นมองเห็นแค่คุณเท่านั้น" specified: "ไดเร็ค" specifiedDescription: "ทำให้มองเห็นได้เฉพาะผู้ใช้ที่ระบุเท่านั้น" - disableFederation: "การปิดใช้งานสหพันธ์" - disableFederationDescription: "อย่าส่งข้อมูลไปยังเซิร์ฟเวอร์อื่น" + disableFederation: "ไม่มีสหภาพ" + disableFederationDescription: "อย่าส่งไปยังอินสแตนซ์อื่น" _postForm: replyPlaceholder: "ตอบกลับโน้ตนี้..." quotePlaceholder: "อ้างโน้ตนี้..." channelPlaceholder: "โพสต์ลงช่อง..." _placeholders: - a: "ตอนนี้เป็นยังไงบ้าง?" - b: "มีอะไรเกิดขึ้นหรือเปล่า?" - c: "กำลังคิดอะไรอยู่?" - d: "ต้องการจะพูดอะไรไหม?" - e: "มาเขียนกันเถอะ" + a: "คุณเป็นอะไรไปหรอ?" + b: "เกิดอะไรขึ้นรอบตัวคุณ?" + c: "คุณกำลังคิดอะไรอยู่?" + d: "คุณต้องการจะพูดอะไร?" + e: "เริ่มเขียน..." f: "กำลังรอให้คุณเขียน..." _profile: name: "ชื่อ" username: "ชื่อผู้ใช้" - description: "แนะนำตัว" - youCanIncludeHashtags: "คุณสามารถใส่แฮชแท็กในส่วนแนะนำตัวของคุณได้" + description: "ประวัติ" + youCanIncludeHashtags: "คุณยังสามารถใส่แฮชแท็กในประวัติของคุณได้นะ" metadata: "ข้อมูลเพิ่มเติม" metadataEdit: "แก้ไขข้อมูลเพิ่มเติม" metadataDescription: "ใช้สิ่งเหล่านี้ คุณสามารถแสดงฟิลด์ข้อมูลเพิ่มเติมในโปรไฟล์ของคุณ" @@ -2265,69 +1932,63 @@ _profile: metadataContent: "เนื้อหา" changeAvatar: "เปลี่ยนอวาตาร์" changeBanner: "เปลี่ยนแบนเนอร์" - verifiedLinkDescription: "หากป้อน URL ที่มีลิงก์ไปยังโปรไฟล์ของคุณ ไอคอนการยืนยันความเป็นเจ้าของจะแสดงถัดจากฟิลด์นั้น ๆ" - avatarDecorationMax: "คุณสามารถเพิ่มการตกแต่งได้สูงสุด {max}" - followedMessage: "ส่งข้อความเมื่อมีคนกดติดตาม" - followedMessageDescription: "ส่งข้อความเมื่อมีคนกดติดตามแล้ว" - followedMessageDescriptionForLockedAccount: "ถ้าหากคุณตั้งค่าให้คนอื่นต้องขออนุญาตก่อนที่จะติดตามคุณ ระบบจะขึ้นข้อความนี้ในตอนที่คุณอนุมัติให้เขาติดตาม" + verifiedLinkDescription: "โดยการป้อน URL ที่มีลิงก์ไปยังโปรไฟล์ของคุณตรงนี้ ส่วนไอคอนการยืนยันความเป็นเจ้าของนั้นก็สามารถแสดงถัดจากฟิลด์ได้นะ" _exportOrImport: allNotes: "โน้ตทั้งหมด" - favoritedNotes: "โน้ตที่ถูกใจไว้" - clips: "คลิป" + favoritedNotes: "บันทึกที่ชื่นชอบ" followingList: "กำลังติดตาม" muteList: "ปิดเสียง" blockingList: "บล็อค" - userLists: "รายชื่อ" + userLists: "รายการ" excludeMutingUsers: "ยกเว้นผู้ใช้ที่ปิดเสียง" excludeInactiveUsers: "ยกเว้นผู้ใช้ที่ไม่ได้ใช้งาน" - withReplies: "รวมการตอบกลับจากผู้ใช้ที่ถูกนำเข้า ลงไทม์ไลน์" + withReplies: "รวมการตอบกลับจากผู้ใช้ที่นำเข้าไว้ในไทม์ไลน์" _charts: federation: "สหพันธ์" apRequest: "คำขอ" - usersIncDec: "การเพิ่มลดของจำนวนผู้ใช้" + usersIncDec: "ความแตกต่างของจำนวนผู้ใช้งาน" usersTotal: "จำนวนผู้ใช้งานทั้งหมด" activeUsers: "จำนวนผู้ใช้งานที่ยังมีความเคลื่อนไหวอยู่" - notesIncDec: "การเพิ่มลดของจำนวนโน้ต" - localNotesIncDec: "การเพิ่มลดของจำนวนโน้ตท้องถิ่น" - remoteNotesIncDec: "การเพิ่มลดของจำนวนโน้ตระยะไกล" + notesIncDec: "ความแตกต่างของจำนวนโน้ต" + localNotesIncDec: "ความแตกต่างของจำนวนโน้ตท้องถิ่น" + remoteNotesIncDec: "ความแตกต่างของจำนวนโน้ตระยะไกล" notesTotal: "จำนวนโน้ตทั้งหมด" - filesIncDec: "การเพิ่มลดของจำนวนไฟล์" + filesIncDec: "ความแตกต่างของจำนวนไฟล์" filesTotal: "จำนวนไฟล์ทั้งหมด" - storageUsageIncDec: "การเพิ่มลดในการใช้พื้นที่เก็บข้อมูล" + storageUsageIncDec: "ความแตกต่างในการใช้พื้นที่เก็บข้อมูล" storageUsageTotal: "การใช้พื้นที่เก็บข้อมูลทั้งหมด" _instanceCharts: requests: "คำขอ" - users: "การเพิ่มลดของจำนวนผู้ใช้งาน" + users: "ความแตกต่างของจำนวนผู้ใช้งาน" usersTotal: "จำนวนผู้ใช้งานสะสม" - notes: "การเพิ่มลดของจำนวนโน้ต" + notes: "ความแตกต่างของจำนวนโน้ต" notesTotal: "จำนวนโน้ตสะสม" - ff: "การเพิ่มลดของการติดตาม/ผู้ติดตาม" - ffTotal: "จำนวนสะสมของการติดตาม/ผู้ติดตาม" - cacheSize: "การเพิ่มลดขนาดของแคช" - cacheSizeTotal: "ขนาดแคชสะสม" - files: "การเพิ่มลดของจำนวนไฟล์" + ff: "ความแตกต่างของจำนวนผู้ใช้ที่ติดตาม / ผู้ติดตาม" + ffTotal: "จำนวนผู้ใช้งานที่ติดตามสะสม / ผู้ติดตาม" + cacheSize: "ความแตกต่างในขนาดของแคช" + cacheSizeTotal: "ขนาดแคชรวมที่สะสม" + files: "ความแตกต่างของจำนวนไฟล์" filesTotal: "จำนวนไฟล์สะสม" _timelines: - home: "หน้าหลัก" - local: "ท้องถิ่น" - social: "โซเชียล" + home: "หน้าแรก" + local: "ในพื้นที่" + social: "โซเชี่ยล" global: "ทั่วโลก" _play: - new: "สร้าง Play" - edit: "แก้ไข Play" - created: "สร้าง Play แล้ว" - updated: "แก้ไข Play แล้ว" - deleted: "ลบ Play แล้ว" - pageSetting: "ตั้งค่า Play" + new: "สร้างการเล่น" + edit: "แก้ไขเล่น" + created: "สร้างการเล่นแล้ว" + updated: "แก้ไขการเล่นแล้ว" + deleted: "ลบการเล่นแล้ว" + pageSetting: "ตั้งค่าการเล่น" editThisPage: "แก้ไข Play นี้" viewSource: "ดูต้นฉบับ" - my: "Play ของฉัน" - liked: "Play ที่ถูกใจไว้" + my: "มาย เพลย์" + liked: "ไลค์ เพลย์" featured: "เป็นที่นิยม" title: "หัวข้อ" script: "สคริปต์" - summary: "คำอธิบาย" - visibilityDescription: "หากตั้งค่าเป็นส่วนตัว มันจะไม่ปรากฏในโปรไฟล์อีกต่อไป แต่ผู้ที่ทราบ URL ของมันจะยังสามารถเข้าถึงได้" + summary: "รายละเอียด" _pages: newPage: "สร้างหน้าเพจใหม่" editPage: "แก้ไขหน้าเพจ" @@ -2335,15 +1996,15 @@ _pages: created: "สร้างหน้าเพจสำเร็จเรียบร้อยแล้ว" updated: "แก้ไขหน้าเพจสำเร็จเรียบร้อยแล้ว" deleted: "ลบหน้าเพจสำเร็จเรียบร้อยแล้ว" - pageSetting: "การตั้งค่าหน้าเพจ" + pageSetting: "การตั้งค่าหน้า" nameAlreadyExists: "URL ของหน้าที่ระบุนั้นมีอยู่แล้ว" invalidNameTitle: "URL ของหน้าที่ระบุนั้นไม่ถูกต้อง" invalidNameText: "ตรวจสอบให้แน่ใจนะว่าชื่อหน้าไม่ว่างเปล่า" editThisPage: "แก้ไขเพจนี้" viewSource: "ดูต้นฉบับ" - viewPage: "ดูหน้าเพจ" + viewPage: "ดูหน้า" like: "ถูกใจ" - unlike: "เลิกถูกใจ" + unlike: "ลบไลค์" my: "หน้าเพจของฉัน" liked: "หน้าเพจที่ถูกใจ" featured: "เป็นที่นิยม" @@ -2356,16 +2017,15 @@ _pages: summary: "สรุปเพจ" alignCenter: "เซ็นเตอร์" hideTitleWhenPinned: "ซ่อนชื่อหน้าเพจเมื่อปักหมุดไว้ที่โปรไฟล์" - font: "แบบอักษร" + font: "ตัวอักษร" fontSerif: "Serif" fontSansSerif: "Sans Serif" eyeCatchingImageSet: "ตั้งค่าภาพขนาดย่อ" eyeCatchingImageRemove: "ลบภาพขนาดย่อ" chooseBlock: "เพิ่มบล็อค" - enterSectionTitle: "ป้อนชื่อหัวข้อ" selectType: "เลือกชนิด" contentBlocks: "เนื้อหา" - inputBlocks: "ป้อนข้อมูล" + inputBlocks: "อินพุต" specialBlocks: "พิเศษ" blocks: text: "ข้อความ" @@ -2373,8 +2033,6 @@ _pages: section: "ประเภท" image: "รูปภาพ" button: "ปุ่ม" - dynamic: "บล็อกแบบไดนามิก" - dynamicDescription: "บล็อกนี้ล้าสมัยแล้ว โปรดใช้ {play} แทน นับจากนี้เป็นต้นไป" note: "โน้ตที่ฝังตัว" _note: id: "โน้ต ID" @@ -2385,31 +2043,23 @@ _relayStatus: accepted: "ได้รับการอนุมัติ" rejected: "ถูกปฏิเสธ" _notification: - fileUploaded: "ไฟล์ถูกอัปโหลดแล้ว" + fileUploaded: "ไฟล์ถูกอัพโหลดแล้วน่ะ" youGotMention: "{name} กล่าวถึงคุณ" youGotReply: "{name} ตอบกลับถึงคุณ" - youGotQuote: "{name} อ้างอิงคุณ" + youGotQuote: "{name} อ้างถึงคุณ" youRenoted: "รีโน้ตจาก {name}" youWereFollowed: "ได้ติดตามคุณ" - youReceivedFollowRequest: "ได้รับคำขอติดตาม" - yourFollowRequestAccepted: "คำขอติดตามได้รับการอนุมัติแล้ว" - pollEnded: "ผลโพลออกมาแล้ว" + youReceivedFollowRequest: "คุณมีคำขอติดตามใหม่น่ะ" + yourFollowRequestAccepted: "คำขอติดตามของคุณได้รับการยอมรับแล้วน่ะ" + pollEnded: "โพลสำรวจความคิดเห็นผลลัพธ์มีพร้อมใช้งาน" newNote: "โพสต์ใหม่" unreadAntennaNote: "เสาอากาศ {name}" - roleAssigned: "ได้รับบทบาท" - emptyPushNotificationMessage: "อัปเดตการแจ้งเตือนแบบพุชแล้ว" + emptyPushNotificationMessage: "การแจ้งเตือนแบบพุชได้รับการอัพเดทแล้ว" achievementEarned: "รับความสำเร็จ" testNotification: "ทดสอบการแจ้งเตือน" - checkNotificationBehavior: "กดเพื่อดูลักษณะการแจ้งเตือน" + checkNotificationBehavior: "ตรวจสอบลักษณะที่ปรากฏการแจ้งเตือน" sendTestNotification: "ส่งทดสอบการแจ้งเตือน" notificationWillBeDisplayedLikeThis: "การแจ้งเตือนมีลักษณะแบบนี้" - reactedBySomeUsers: "ถูกรีแอคชั่นโดยผู้ใช้ {n} ราย" - likedBySomeUsers: "{n} คนถูกใจ" - renotedBySomeUsers: "รีโน้ตจากผู้ใช้ {n} ราย" - followedBySomeUsers: "มีผู้ติดตาม {n} ราย" - flushNotification: "ล้างประวัติการแจ้งเตือน" - exportOfXCompleted: "การดำเนินการส่งออก {x} ได้เสร็จสิ้นลงแล้ว" - login: "มีคนล็อกอิน" _types: all: "ทั้งหมด" note: "โน้ตใหม่" @@ -2417,16 +2067,12 @@ _notification: mention: "กล่าวถึง" reply: "ตอบกลับ" renote: "รีโน้ต" - quote: "อ้างอิง" + quote: "อ้างคำพูด" reaction: "รีแอคชั่น" - pollEnded: "โพลสิ้นสุดแล้ว" - receiveFollowRequest: "ได้รับคำร้องขอติดตาม" - followRequestAccepted: "อนุมัติให้ติดตามแล้ว" - roleAssigned: "ให้บทบาท" + pollEnded: "โพลนี้สิ้นสุดลงแล้ว" + receiveFollowRequest: "ได้รับคำขอติดตาม\n" + followRequestAccepted: "ยอมรับคำขอติดตาม" achievementEarned: "ปลดล็อกความสำเร็จแล้ว" - exportCompleted: "กระบวนการส่งออกข้อมูลได้เสร็จสิ้นสมบูรณ์แล้ว" - login: "เข้าสู่ระบบ" - test: "ทดสอบระบบแจ้งเตือน" app: "การแจ้งเตือนจากแอปที่มีลิงก์" _actions: followBack: "ติดตามกลับด้วย" @@ -2436,7 +2082,6 @@ _deck: alwaysShowMainColumn: "แสดงคอลัมน์หลักเสมอ" columnAlign: "จัดแนวคอลัมน์" addColumn: "เพิ่มคอลัมน์" - newNoteNotificationSettings: "ตั้งค่าการแจ้งเตือนเมื่อมีโน้ตใหม่" configureColumn: "ตั้งค่าคอลัมน์" swapLeft: "ขยับไปทางซ้าย" swapRight: "ขยับไปทางขวา" @@ -2460,9 +2105,9 @@ _deck: tl: "ไทม์ไลน์" antenna: "เสาอากาศ" list: "รายการ" - channel: "ช่อง" - mentions: "กล่าวถึงคุณ" - direct: "ไดเร็กต์" + channel: "แชนแนล" + mentions: "พูดถึง" + direct: "ไดเร็ค" roleTimeline: "บทบาทไทม์ไลน์" _dialog: charactersExceeded: "คุณกำลังมีตัวอักขระเกินขีดจำกัดสูงสุดแล้วนะ! ปัจจุบันอยู่ที่ {current} จาก {max}" @@ -2475,10 +2120,9 @@ _drivecleaner: orderByCreatedAtAsc: "วันที่จากน้อยไปหามาก" _webhookSettings: createWebhook: "สร้าง Webhook" - modifyWebhook: "แก้ไข Webhook" name: "ชื่อ" secret: "ความลับ" - trigger: "ทริกเกอร์" + events: "อีเว้นท์ Webhook" active: "เปิดใช้งาน" _events: follow: "เมื่อกำลังติดตามผู้ใช้" @@ -2488,40 +2132,17 @@ _webhookSettings: renote: "รีโน้ตแล้วเมื่อ" reaction: "เมื่อได้รับรีแอคชั่น" mention: "เมื่อกำลังถูกกล่าวถึง" - _systemEvents: - abuseReport: "เมื่อมีการรายงานจากผู้ใช้" - abuseReportResolved: "เมื่อมีการจัดการกับการรายงานจากผู้ใช้" - userCreated: "เมื่อผู้ใช้ถูกสร้างขึ้น" - inactiveModeratorsWarning: "เมื่อผู้ดูแลระบบไม่ได้ใช้งานมานานระยะหนึ่ง" - inactiveModeratorsInvitationOnlyChanged: "เมื่อผู้ดูแลระบบที่ไม่ได้ใช้งานมานาน และเซิร์ฟเวอร์เปลี่ยนเป็นแบบเชิญเข้าร่วมเท่านั้น" - deleteConfirm: "ต้องการลบ Webhook ใช่ไหม?" - testRemarks: "คลิกปุ่มทางด้านขวาของสวิตช์เพื่อส่ง Webhook ทดสอบที่มีข้อมูลจำลอง" -_abuseReport: - _notificationRecipient: - createRecipient: "เพิ่มปลายทางการแจ้งเตือนการรายงาน" - modifyRecipient: "แก้ไขปลายทางการแจ้งเตือนการรายงาน" - recipientType: "ประเภทของปลายทางการแจ้งเตือน\n" - _recipientType: - mail: "อีเมล" - webhook: "Webhook" - _captions: - mail: "ส่งการแจ้งเตือนไปยังที่อยู่อีเมลของผู้ควบคุม (เฉพาะเมื่อได้รับการรายงาน)" - webhook: "ส่งการแจ้งเตือนไปยัง SystemWebhook ที่กำหนด (จะส่งเมื่อได้รับการรายงานและเมื่อการรายงานได้รับการแก้ไข)" - keywords: "คีย์เวิร์ด" - notifiedUser: "ผู้ใช้ที่ได้รับการแจ้งเตือน" - notifiedWebhook: "Webhook ที่ใช้" - deleteConfirm: "ต้องการลบปลายทางการแจ้งเตือนใช่ไหม?" _moderationLogTypes: createRole: "สร้างบทบาทแล้ว" deleteRole: "ลบบทบาทแล้ว" updateRole: "อัปเดตบทบาทแล้ว" assignRole: "ได้รับมอบหมายบทบาท" unassignRole: "ถอดออกจากบทบาทแล้ว" - suspend: "ระงับ" - unsuspend: "เลิกระงับ" - addCustomEmoji: "เพิ่มเอโมจิที่กำหนดเองแล้ว" - updateCustomEmoji: "อัปเดตเอโมจิที่กำหนดเองแล้ว" - deleteCustomEmoji: "ลบเอโมจิที่กำหนดเองออกแล้ว" + suspend: "ถูกระงับ" + unsuspend: "เลิกถูกระงับ" + addCustomEmoji: "เพิ่มอีโมจิที่กำหนดเองแล้ว" + updateCustomEmoji: "อัปเดตอีโมจิที่กำหนดเองแล้ว" + deleteCustomEmoji: "ลบอีโมจิที่กำหนดเองออกแล้ว" updateServerSettings: "อัปเดตการตั้งค่าเซิร์ฟเวอร์แล้ว" updateUserNote: "อัปเดตโน้ตการกลั่นกรองแล้ว" deleteDriveFile: "ลบไฟล์ออกแล้ว" @@ -2533,33 +2154,15 @@ _moderationLogTypes: deleteGlobalAnnouncement: "ลบประกาศทั่วโลกออกแล้ว" deleteUserAnnouncement: "ลบประกาศผู้ใช้ออกแล้ว" resetPassword: "รีเซ็ตรหัสผ่าน" - suspendRemoteInstance: "ระงับเซิร์ฟเวอร์ระยะไกล" - unsuspendRemoteInstance: "เลิกระงับเซิร์ฟเวอร์ระยะไกล" - updateRemoteInstanceNote: "อัปเดตโน้ตการกลั่นกรองสำหรับเซิร์ฟเวอร์ระยะไกลแล้ว" - markSensitiveDriveFile: "ทำเครื่องหมายไฟล์ว่ามีเนื้อหาละเอียดอ่อน" - unmarkSensitiveDriveFile: "ยกเลิกทำเครื่องหมายไฟล์ว่ามีเนื้อหาละเอียดอ่อน" + suspendRemoteInstance: "อินสแตนซ์ระยะไกลถูกระงับ" + unsuspendRemoteInstance: "อินสแตนซ์ระยะไกลเลิกการระงับ" + markSensitiveDriveFile: "ทำเครื่องหมายไฟล์บอกว่าละเอียดอ่อน" + unmarkSensitiveDriveFile: "ยกเลิกทำเครื่องหมายไฟล์ว่าละเอียดอ่อน" resolveAbuseReport: "รายงานได้รับการแก้ไขแล้ว" - forwardAbuseReport: "ได้ส่งรายงานไปแล้ว" - updateAbuseReportNote: "โน้ตการกลั่นกรองที่รายงานไปนั้น ได้รับการอัปเดตแล้ว" - createInvitation: "สร้างรหัสเชิญ" + createInvitation: "สร้างคำเชิญ" createAd: "สร้างโฆษณาแล้ว" deleteAd: "ลบโฆษณาออกแล้ว" updateAd: "อัปเดตโฆษณาแล้ว" - createAvatarDecoration: "สร้างการตกแต่งไอคอนแล้ว" - updateAvatarDecoration: "อัปเดตการตกแต่งไอคอนแล้ว" - deleteAvatarDecoration: "ลบการตกแต่งไอคอนแล้ว" - unsetUserAvatar: "ลบไอคอนผู้ใช้" - unsetUserBanner: "ลบแบนเนอร์ผู้ใช้" - createSystemWebhook: "สร้าง SystemWebhook" - updateSystemWebhook: "อัปเดต SystemWebhook" - deleteSystemWebhook: "ลบ SystemWebhook" - createAbuseReportNotificationRecipient: "สร้างปลายทางการแจ้งเตือนการรายงาน" - updateAbuseReportNotificationRecipient: "อัปเดตปลายทางการแจ้งเตือนการรายงาน" - deleteAbuseReportNotificationRecipient: "ลบปลายทางการแจ้งเตือนการรายงาน" - deleteAccount: "บัญชีถูกลบไปแล้ว" - deletePage: "เพจถูกลบออกไปแล้ว" - deleteFlash: "Play ถูกลบออกไปแล้ว" - deleteGalleryPost: "โพสต์แกลเลอรี่ถูกลบออกแล้ว" _fileViewer: title: "รายละเอียดไฟล์" type: "ประเภทไฟล์" @@ -2569,144 +2172,14 @@ _fileViewer: attachedNotes: "โน้ตที่แนบมาด้วย" thisPageCanBeSeenFromTheAuthor: "หน้าเพจนี้จะสามารถปรากฏได้โดยผู้ใช้ที่อัปโหลดไฟล์นี้เท่านั้น" _externalResourceInstaller: - title: "ติดตั้งจากไซต์ภายนอก" - checkVendorBeforeInstall: "โปรดตรวจสอบให้แน่ใจว่าแหล่งแจกหน่ายมีความน่าเชื่อถือก่อนทำการติดตั้ง" _plugin: - title: "ต้องการติดตั้งปลั๊กอินนี้ใช่ไหม?" metaTitle: "ข้อมูลส่วนเสริม" _theme: - title: "ต้องการติดตั้งธีมนี้ใช่ไหม?" metaTitle: "ข้อมูลธีม" - _meta: - base: "โทนสีพื้นฐาน" _vendorInfo: title: "ข้อมูลผู้จัดจำหน่าย" - endpoint: "จุดอ้างอิงปลายทาง (Referenced endpoint)" - hashVerify: "การตรวจสอบแฮช (ความสมบูรณ์ของไฟล์)" _errors: - _invalidParams: - title: "พารามิเตอร์ไม่ถูกต้อง" - description: "มีสารสนเทศไม่เพียงพอที่จะโหลดข้อมูลจากไซต์ภายนอก โปรดยืนยัน URL ที่ป้อน" - _resourceTypeNotSupported: - title: "ไม่รองรับทรัพยากรภายนอกนี้" - description: "ไม่รองรับประเภทของทรัพยากรภายนอกนี้ โปรดติดต่อผู้ดูแลเว็บไซต์" - _failedToFetch: - title: "รับข้อมูลล้มเหลว" - fetchErrorDescription: "เกิดข้อผิดพลาดในการสื่อสารกับไซต์ภายนอก หากการลองอีกครั้งไม่สามารถแก้ไขปัญหานี้ได้ โปรดติดต่อผู้ดูแลไซต์" - parseErrorDescription: "เกิดข้อผิดพลาดในการประมวลผลข้อมูลที่โหลดจากไซต์ภายนอก โปรดติดต่อผู้ดูแลเว็บไซต์" - _hashUnmatched: - title: "การยืนยัน/ตรวจสอบข้อมูลล้มเหลว" - description: "เกิดข้อผิดพลาดในการตรวจสอบความสมบูรณ์ของข้อมูลที่ดึงมา เพื่อเป็นมาตรการรักษาความปลอดภัย การติดตั้งไม่สามารถดำเนินการต่อได้ โปรดติดต่อผู้ดูแลเว็บไซต์" _pluginParseFailed: title: "ข้อผิดพลาด AiScript" - description: "ดึงข้อมูลที่ร้องขอสำเร็จแล้ว แต่มีข้อผิดพลาดเกิดขึ้นระหว่างการแยกวิเคราะห์ AiScript โปรดติดต่อผู้เขียนปลั๊กอิน รายละเอียดข้อผิดพลาดสามารถดูได้ในคอนโซล Javascript" - _pluginInstallFailed: - title: "ติดตั้งปลั๊กอินล้มเหลว" - description: "เกิดปัญหาขณะติดตั้งปลั๊กอิน กรุณาลองอีกครั้ง. โปรดดูคอนโซล Javascript สำหรับรายละเอียดข้อผิดพลาด" _themeParseFailed: title: "การแยกวิเคราะห์ธีมล้มเหลว" - description: "ดึงข้อมูลที่ร้องขอสำเร็จแล้ว แต่มีข้อผิดพลาดเกิดขึ้นระหว่างการแยกวิเคราะห์ธีม โปรดติดต่อผู้เขียนธีม รายละเอียดข้อผิดพลาดสามารถดูได้ในคอนโซล Javascript" - _themeInstallFailed: - title: "ติดตั้งธีมล้มเหลว" - description: "เกิดปัญหาระหว่างการติดตั้งธีม กรุณาลองอีกครั้ง. รายละเอียดข้อผิดพลาดสามารถดูได้ในคอนโซล Javascript" -_dataSaver: - _media: - title: "โหลดสื่อ" - description: "กันไม่ให้ภาพและวิดีโอโหลดโดยอัตโนมัติ แตะรูปภาพ/วิดีโอที่ซ่อนอยู่เพื่อโหลด" - _avatar: - title: "รูปไอคอน" - description: "ระงับการเคลื่อนไหวของภาพไอคอน ภาพเคลื่อนไหวอาจมีขนาดไฟล์ใหญ่กว่าภาพปกติ ดังนั้นจึงสามารถช่วยในการลดการใช้ข้อมูล" - _urlPreview: - title: "ธัมบ์เนลแสดงตัวอย่าง URL" - description: "ธัมบ์เนลแสดงตัวอย่าง URL จะไม่โหลดโดยอัตโนมัติ" - _code: - title: "ไฮไลต์โค้ด" - description: "หากใช้สัญลักษณ์ไฮไลต์โค้ดใน MFM ฯลฯ สัญลักษณ์เหล่านั้นจะไม่โหลดจนกว่าจะแตะ การไฮไลต์ไวยากรณ์(syntax)จำเป็นต้องดาวน์โหลดไฟล์คำจำกัดความของไฮไลต์สำหรับแต่ละภาษา ดังนั้นการปิดใช้งานการโหลดไฟล์เหล่านี้โดยอัตโนมัติจึงคาดว่าจะช่วยลดปริมาณข้อมูลการสื่อสารได้" -_hemisphere: - N: "ซีกโลกเหนือ" - S: "ซีกโลกใต้" - caption: "ใช้เพื่อกำหนดฤดูกาลของไคลเอ็นต์" -_reversi: - reversi: "รีเวอร์ซี" - gameSettings: "ตั้งค่าการเล่น" - chooseBoard: "เลือกกระดาน" - blackOrWhite: "ดำ/ขาว" - blackIs: "{name}เป็นสีดำ" - rules: "กฎ" - thisGameIsStartedSoon: "การเล่นจะเริ่มแล้ว" - waitingForOther: "กำลังรออีกฝ่ายเตรียมตัวให้เสร็จ" - waitingForMe: "กำลังรอฝ่ายคุณเตรียมตัวให้เสร็จ" - waitingBoth: "กรุณาเตรียมตัว" - ready: "เตรียมตัวพร้อมแล้ว" - cancelReady: "ยกเลิกการเตรียมตัวพร้อม" - opponentTurn: "ตาอีกฝ่าย" - myTurn: "ตาของคุณ" - turnOf: "ตาของ{name}" - pastTurnOf: "ตาของ{name}" - surrender: "ยอมแพ้" - surrendered: "ยอมแพ้แล้ว" - timeout: "หมดเวลาแล้ว" - drawn: "เสมอ" - won: "{name}ชนะ" - black: "ดำ" - white: "ขาว" - total: "รวมทั้งหมด" - turnCount: "ตาที่{count}" - myGames: "การเล่นของตัวเอง" - allGames: "การเล่นของทุกคน" - ended: "จบ" - playing: "กำลังเล่น" - isLlotheo: "คนที่มีตัวหมากน้อยกว่าชนะ (Roseo)" - loopedMap: "ลูปแมป" - canPutEverywhere: "โหมดที่สามารถวางได้ทุกที่" - timeLimitForEachTurn: "จำกัดเวลาต่อแต่ละตา" - freeMatch: "ฟรีแมตช์" - lookingForPlayer: "กำลังมองหาคู่ต่อสู้อยู่" - gameCanceled: "ยกเลิกการเล่นแล้ว" - shareToTlTheGameWhenStart: "โพสต์ลงไทม์ไลน์เมื่อเริ่มการเล่น" - iStartedAGame: "เริ่มเล่นหมากรีเวอร์ซีแล้ว! #MisskeyReversi" - opponentHasSettingsChanged: "อีกฝ่ายเปลี่ยนการตั้งค่า" - allowIrregularRules: "อนุญาตกฎที่ไม่ปรกติ (โหมดฟรีทุกอย่าง)" - disallowIrregularRules: "ไม่อนุญาตกฎที่ไม่ปรกติ" - showBoardLabels: "แสดงหมายเลขแถว/คอลัมน์บนกระดาน" - useAvatarAsStone: "ใช้รูปอวตารเป็นหมาก" -_offlineScreen: - title: "ออฟไลน์ - ไม่สามารถเชื่อมต่อกับเซิร์ฟเวอร์ได้" - header: "ไม่สามารถเชื่อมต่อกับเซิร์ฟเวอร์ได้" -_urlPreviewSetting: - title: "การตั้งค่าการแสดงตัวอย่าง URL" - enable: "เปิดใช้งานการแสดงตัวอย่าง URL" - timeout: "เวลาจำกัดในการโหลดตัวอย่าง URL (ms)" - timeoutDescription: "หากเวลาที่ใช้ในการโหลดเกินค่านี้ จะไม่มีการสร้างการแสดงตัวอย่าง" - maximumContentLength: "ค่าสูงสุดของ Content-Length (byte)" - maximumContentLengthDescription: "หาก Content-Length เกินค่านี้ จะไม่มีการสร้างการแสดงตัวอย่าง" - requireContentLength: "สร้างการแสดงตัวอย่างเฉพาะในกรณีที่รับ Content-Length ไหว" - requireContentLengthDescription: "หากเซิร์ฟเวอร์อื่นไม่ส่งคืน Content-Length จะไม่มีการสร้างการแสดงตัวอย่าง" - userAgent: "User-Agent" - userAgentDescription: "ตั้งค่า User-Agent ที่ใช้ในการรับการแสดงตัวอย่าง หากเว้นว่างไว้ ระบบจะใช้ User-Agent เริ่มต้น" - summaryProxy: "endpoint ของพร็อกซีที่สร้างการแสดงตัวอย่าง" - summaryProxyDescription: "สร้างการแสดงตัวอย่างด้วย summary Proxy แทนที่จะใช้เนื้อหา Misskey" - summaryProxyDescription2: "พารามิเตอร์ต่อไปนี้จะถูกใช้เป็นสตริงการสืบค้นเพื่อเชื่อมต่อกับพร็อกซี หากฝั่งพร็อกซีไม่รองรับการตั้งค่าเหล่านี้จะถูกละเว้น" -_mediaControls: - pip: "รูปภาพในรูปภาม" - playbackRate: "ความเร็วในการเล่น" - loop: "เล่นวนซ้ำ" -_contextMenu: - title: "เมนูเนื้อหา" - app: "แอปพลิเคชัน" - appWithShift: "แอปฟลิเคชันด้วยปุ่มยกแคร่ (Shift)" - native: "UI ของเบราว์เซอร์" -_embedCodeGen: - title: "ปรับแต่งโค้ดฝัง" - header: "แสดงส่วนหัว" - autoload: "โหลดเพิ่มโดยอัตโนมัติ (เลิกใช้แล้ว)" - maxHeight: "ความสูงสุด" - maxHeightDescription: "หากถ้าตั้งค่าเป็น 0 จะทำให้ไม่มีการจำกัดความสูงของวิดเจ็ต แต่ควรตั้งค่าเป็นตัวเลขอื่นๆ เพื่อไม่ให้วิดเจ็ตยืดตัวลงไปเรื่อยๆ" - maxHeightWarn: "การจำกัดความสูงสูงสุดถูกปิดใช้งาน (0) หากไม่ได้ตั้งใจให้เป็นเช่นนี้ โปรดตั้งค่าความสูงสูงสุดให้เป็นค่าอื่นๆแทน" - previewIsNotActual: "การแสดงผลนั้นต่างจากการฝังจริงเพราะเกินขอบเขตที่แสดงบนหน้าจอตัวอย่างนะ" - rounded: "ทำให้มันกลม" - border: "เพิ่มขอบให้กับกรอบด้านนอก" - applyToPreview: "นำไปใช้กับการแสดงตัวอย่าง" - generateCode: "สร้างโค้ดสำหรับการฝัง" - codeGenerated: "รหัสถูกสร้างขึ้นแล้ว" - codeGeneratedDescription: "นำโค้ดที่สร้างแล้วไปวางในเว็บไซต์ของคุณเพื่อฝังเนื้อหา" diff --git a/locales/tr-TR.yml b/locales/tr-TR.yml index fe2f158ff6..0793592d34 100644 --- a/locales/tr-TR.yml +++ b/locales/tr-TR.yml @@ -378,10 +378,6 @@ addMemo: "Kısa not ekle" icon: "Avatar" replies: "yanıt" renotes: "vazgeçme" -_delivery: - stop: "Askıya alınmış" - _type: - none: "Paylaşım" _accountDelete: started: "Silme işlemi başlatıldı" _email: @@ -446,7 +442,6 @@ _notification: reaction: "Tepkiler" receiveFollowRequest: "Takip isteği alındı" followRequestAccepted: "Takip isteği kabul edildi" - login: "Giriş Yap " _actions: reply: "yanıt" renote: "vazgeçme" diff --git a/locales/ug-CN.yml b/locales/ug-CN.yml index fef26040a5..e48f64511c 100644 --- a/locales/ug-CN.yml +++ b/locales/ug-CN.yml @@ -17,6 +17,3 @@ _2fa: renewTOTPCancel: "ئۇنى توختىتىڭ" _widgets: profile: "profile" -_notification: - _types: - login: "كىرىش" diff --git a/locales/uk-UA.yml b/locales/uk-UA.yml index f2262cd71f..9b609edebb 100644 --- a/locales/uk-UA.yml +++ b/locales/uk-UA.yml @@ -352,8 +352,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Увімкнути hCaptcha" hcaptchaSiteKey: "Ключ сайту" hcaptchaSecretKey: "Секретний ключ" -mcaptchaSiteKey: "Ключ сайту" -mcaptchaSecretKey: "Секретний ключ" recaptcha: "reCAPTCHA" enableRecaptcha: "Увімкнути reCAPTCHA" recaptchaSiteKey: "Ключ сайту" @@ -452,6 +450,7 @@ language: "Мова" uiLanguage: "Мова інтерфейсу" aboutX: "Про {x}" native: "місцевий" +disableDrawer: "Не використовувати висувні меню" noHistory: "Історія порожня" signinHistory: "Історія входів" enableAdvancedMfm: "Увімкнути розширений MFM" @@ -630,7 +629,10 @@ abuseReported: "Дякуємо, вашу скаргу було відправл reporter: "Репортер" reporteeOrigin: "Про кого повідомлено" reporterOrigin: "Хто повідомив" +forwardReport: "Переслати звіт на віддалений інстанс" +forwardReportIsAnonymous: "Замість вашого облікового запису анонімний системний обліковий запис буде відображатися як доповідач на віддаленому інстансі" send: "Відправити" +abuseMarkAsResolved: "Позначити скаргу як вирішену" openInNewTab: "Відкрити в новій вкладці" openInSideView: "Відкрити збоку" defaultNavigationBehaviour: "Поведінка навігації за замовчуванням" @@ -907,13 +909,7 @@ youFollowing: "Підписки" icon: "Аватар" replies: "Відповісти" renotes: "Поширити" -sourceCode: "Вихідний код" flip: "Перевернути" -lastNDays: "Останні {n} днів" -_delivery: - stop: "Призупинено" - _type: - none: "Публікація" _achievements: earnedAt: "Відкрито" _types: @@ -1302,6 +1298,7 @@ _theme: buttonBg: "Фон кнопки" buttonHoverBg: "Фон кнопки (при наведенні)" inputBorder: "Край поля вводу" + listItemHoverBg: "Фон елементу в списку (при наведенні)" driveFolderBg: "Фон папки на диску" wallpaperOverlay: "Накладання шпалер" badge: "Значок" @@ -1313,6 +1310,8 @@ _sfx: note: "Нотатки" noteMy: "Мої нотатки" notification: "Сповіщення" + antenna: "Прийом антени" + channel: "Повідомлення каналу" _ago: future: "Майбутнє" justNow: "Щойно" @@ -1469,7 +1468,6 @@ _profile: changeBanner: "Змінити банер" _exportOrImport: allNotes: "Всі нотатки" - clips: "Добірка" followingList: "Підписки" muteList: "Ігнорувати" blockingList: "Заблокувати" @@ -1583,7 +1581,6 @@ _notification: reaction: "Реакції" receiveFollowRequest: "Запити на підписку" followRequestAccepted: "Прийняті підписки" - login: "Увійти" app: "Сповіщення від додатків" _actions: reply: "Відповісти" @@ -1616,12 +1613,6 @@ _deck: _webhookSettings: name: "Ім'я" active: "Увімкнено" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "E-mail" _moderationLogTypes: suspend: "Призупинити" resetPassword: "Скинути пароль" -_reversi: - total: "Всього" diff --git a/locales/uz-UZ.yml b/locales/uz-UZ.yml index 37a550008a..54e20b001d 100644 --- a/locales/uz-UZ.yml +++ b/locales/uz-UZ.yml @@ -366,8 +366,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "hCaptchani yoqish" hcaptchaSiteKey: "Sayt kaliti" hcaptchaSecretKey: "Mahfiy kalit" -mcaptchaSiteKey: "Sayt kaliti" -mcaptchaSecretKey: "Maxfiy kalit" recaptcha: "reCAPTCHA" enableRecaptcha: "reCAPTCHA ni yoqish" recaptchaSiteKey: "Sayt kaliti" @@ -471,6 +469,7 @@ 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" @@ -629,7 +628,10 @@ 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" @@ -842,10 +844,6 @@ icon: "Avatar" replies: "Javob berish" renotes: "Qayta qayd etish" flip: "Teskari" -_delivery: - stop: "To'xtatilgan" - _type: - none: "Yuborilmoqda" _achievements: _types: _viewInstanceChart: @@ -975,7 +973,6 @@ _profile: changeBanner: "Bannerni o'zgartirish" _exportOrImport: allNotes: "Barcha qaydlar" - clips: "Klip" followingList: "Obuna bo‘lish" muteList: "Ovozni o‘chirish" blockingList: "Bloklangan foydalanuvchilar" @@ -1054,7 +1051,6 @@ _notification: quote: "Iqtibos keltirish" reaction: "Reaktsiyalar" receiveFollowRequest: "Qabul qilingan kuzatuv so'rovlari" - login: "Kirish" _actions: reply: "Javob berish" renote: "Qayta qayd qilish" @@ -1086,12 +1082,6 @@ _webhookSettings: _events: renote: "Qayta qayd qilinganda" mention: "Eslanganda" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "Email" _moderationLogTypes: suspend: "To'xtatish" resetPassword: "Parolni tiklash" -_reversi: - total: "Jami" diff --git a/locales/verify.js b/locales/verify.js deleted file mode 100644 index a8e9875d6e..0000000000 --- a/locales/verify.js +++ /dev/null @@ -1,53 +0,0 @@ -import locales from './index.js'; - -let valid = true; - -function writeError(type, lang, tree, data) { - process.stderr.write(JSON.stringify({ type, lang, tree, data })); - process.stderr.write('\n'); - valid = false; -} - -function verify(expected, actual, lang, trace) { - for (let key in expected) { - if (!Object.prototype.hasOwnProperty.call(actual, key)) { - continue; - } - if (typeof expected[key] === 'object') { - if (typeof actual[key] !== 'object') { - writeError('mismatched_type', lang, trace ? `${trace}.${key}` : key, { expected: 'object', actual: typeof actual[key] }); - continue; - } - verify(expected[key], actual[key], lang, trace ? `${trace}.${key}` : key); - } else if (typeof expected[key] === 'string') { - switch (typeof actual[key]) { - case 'object': - writeError('mismatched_type', lang, trace ? `${trace}.${key}` : key, { expected: 'string', actual: 'object' }); - break; - case 'undefined': - continue; - case 'string': - const expectedParameters = new Set(expected[key].match(/\{[^}]+\}/g)?.map((s) => s.slice(1, -1))); - const actualParameters = new Set(actual[key].match(/\{[^}]+\}/g)?.map((s) => s.slice(1, -1))); - for (let parameter of expectedParameters) { - if (!actualParameters.has(parameter)) { - writeError('missing_parameter', lang, trace ? `${trace}.${key}` : key, { parameter }); - } - } - } - } - } -} - -const { ['ja-JP']: original, ...verifiees } = locales; - -for (let lang in verifiees) { - if (!Object.prototype.hasOwnProperty.call(locales, lang)) { - continue; - } - verify(original, verifiees[lang], lang); -} - -if (!valid) { - process.exit(1); -} diff --git a/locales/vi-VN.yml b/locales/vi-VN.yml index 235497d844..c2d68d8b27 100644 --- a/locales/vi-VN.yml +++ b/locales/vi-VN.yml @@ -121,11 +121,9 @@ sensitive: "Nhạy cảm" add: "Thêm" reaction: "Biểu cảm" reactions: "Biểu cảm" -emojiPicker: "Bộ chọn biểu tượng cảm xúc" reactionSettingDescription2: "Kéo để sắp xếp, nhấn để xóa, nhấn \"+\" để thêm." rememberNoteVisibility: "Lưu kiểu tút mặc định" attachCancel: "Gỡ tập tin đính kèm" -deleteFile: "Xoá tệp tin" markAsSensitive: "Đánh dấu là nhạy cảm" unmarkAsSensitive: "Bỏ đánh dấu nhạy cảm" enterFileName: "Nhập tên tập tin" @@ -259,7 +257,6 @@ removed: "Đã xóa" removeAreYouSure: "Bạn có chắc muốn gỡ \"{x}\"?" deleteAreYouSure: "Bạn có chắc muốn xóa \"{x}\"?" resetAreYouSure: "Bạn có chắc muốn đặt lại?" -areYouSure: "Bạn chắc chứ?" saved: "Đã lưu" messaging: "Trò chuyện" upload: "Tải lên" @@ -310,7 +307,6 @@ folderName: "Tên thư mục" createFolder: "Tạo thư mục" renameFolder: "Đổi tên thư mục" deleteFolder: "Xóa thư mục" -folder: "Thư mục" addFile: "Thêm tập tin" emptyDrive: "Ổ đĩa của bạn trống trơn" emptyFolder: "Thư mục trống" @@ -372,11 +368,6 @@ hcaptcha: "hCaptcha" enableHcaptcha: "Bật hCaptcha" hcaptchaSiteKey: "Khóa của trang" hcaptchaSecretKey: "Khóa bí mật" -mcaptcha: "mCaptcha" -enableMcaptcha: "Bật mCaptcha" -mcaptchaSiteKey: "Khóa của trang" -mcaptchaSecretKey: "Khóa bí mật" -mcaptchaInstanceUrl: "URL mCaptcha máy chủ" recaptcha: "reCAPTCHA" enableRecaptcha: "Bật reCAPTCHA" recaptchaSiteKey: "Khóa của trang" @@ -392,7 +383,6 @@ name: "Tên" antennaSource: "Nguồn trạm phát sóng" antennaKeywords: "Từ khóa để nghe" antennaExcludeKeywords: "Từ khóa để lọc ra" -antennaExcludeBots: "Loại trừ các tài khoản bot" antennaKeywordsDescription: "Phân cách bằng dấu cách cho điều kiện AND hoặc bằng xuống dòng cho điều kiện OR." notifyAntenna: "Thông báo có tút mới" withFileAntenna: "Chỉ những tút có media" @@ -427,7 +417,6 @@ 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" -moderationLogs: "Nhật kí quản trị" nUsersMentioned: "Dùng bởi {n} người" securityKeyAndPasskey: "Mã bảo mật・Passkey" securityKey: "Khóa bảo mật" @@ -460,7 +449,6 @@ retype: "Nhập lại" noteOf: "Tút của {user}" quoteAttached: "Trích dẫn" quoteQuestion: "Trích dẫn lại?" -attachAsFileQuestion: "Văn bản ở trong bộ nhớ tạm rất dài. Bạn có muốn đăng nó dưới dạng một tệp văn bản không?" noMessagesYet: "Chưa có tin nhắn" newMessageExists: "Bạn có tin nhắn mới" onlyOneFileCanBeAttached: "Bạn chỉ có thể đính kèm một tập tin" @@ -486,6 +474,7 @@ uiLanguage: "Ngôn ngữ giao diện" 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" @@ -546,7 +535,6 @@ showInPage: "Hiện trong trang" popout: "Pop-out" volume: "Âm lượng" masterVolume: "Âm thanh chung" -notUseSound: "Tắt tiếng" details: "Chi tiết" chooseEmoji: "Chọn emoji" unableToProcess: "Không thể hoàn tất hành động" @@ -567,10 +555,6 @@ output: "Nguồn ra" script: "Kịch bản" disablePagesScript: "Tắt AiScript trên Trang" updateRemoteUser: "Cập nhật thông tin người dùng ở máy chủ khác" -unsetUserAvatar: "Gỡ ảnh đại diện" -unsetUserAvatarConfirm: "Bạn có chắc muốn gỡ ảnh đại diện?" -unsetUserBanner: "Gỡ ảnh bìa" -unsetUserBannerConfirm: "Bạn có chắc muốn gỡ ảnh bìa?" deleteAllFiles: "Xóa toàn bộ tập tin" deleteAllFilesConfirm: "Bạn có chắc xóa toàn bộ tập tin?" removeAllFollowing: "Ngưng theo dõi tất cả mọi người" @@ -675,7 +659,10 @@ abuseReported: "Báo cáo đã được gửi. Cảm ơn bạn nhiều." reporter: "Người báo cáo" reporteeOrigin: "Bị báo cáo" reporterOrigin: "Máy chủ người báo cáo" +forwardReport: "Chuyển tiếp báo cáo cho máy chủ từ xa" +forwardReportIsAnonymous: "Thay vì tài khoản của bạn, một tài khoản hệ thống ẩn danh sẽ được hiển thị dưới dạng người báo cáo ở máy chủ từ xa." send: "Gửi" +abuseMarkAsResolved: "Đánh dấu đã xử lý" openInNewTab: "Mở trong tab mới" openInSideView: "Mở trong thanh bên" defaultNavigationBehaviour: "Thao tác điều hướng mặc định" @@ -870,8 +857,6 @@ makeReactionsPublicDescription: "Điều này sẽ hiển thị công khai danh classic: "Cổ điển" muteThread: "Không quan tâm nữa" unmuteThread: "Quan tâm tút này" -followingVisibility: "Hiển thị lượt theo dõi" -followersVisibility: "Hiển thị người theo dõi" continueThread: "Tiếp tục xem chuỗi tút" deleteAccountConfirm: "Điều này sẽ khiến tài khoản bị xóa vĩnh viễn. Vẫn tiếp tục?" incorrectPassword: "Sai mật khẩu." @@ -981,7 +966,6 @@ assign: "Phân công" unassign: "Hủy phân công" color: "Màu sắc" manageCustomEmojis: "Quản lý CustomEmoji" -manageAvatarDecorations: "Quản lý trang trí ảnh đại diện" 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." @@ -1005,24 +989,18 @@ 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" -disableFederationOk: "Vô hiệu hoá" 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." -likeOnly: "Chỉ lượt thích" 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" -prohibitedWords: "Các từ bị cấm" license: "Giấy phép" unfavoriteConfirm: "Bạn thực sự muốn xoá khỏi mục yêu thích?" -retryAllQueuesConfirmTitle: "Bạn có muốn thử lại?" 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" -audio: "Âm thanh" -audioFiles: "Âm thanh" 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:" @@ -1039,88 +1017,33 @@ vertical: "Dọc" horizontal: "Thanh bên" position: "Vị trí" serverRules: "Luật của máy chủ" -pleaseConfirmBelowBeforeSignup: "Để đăng ký trên máy chủ này, bạn phải xem xét và đồng ý với những điều sau." -pleaseAgreeAllToContinue: "Bạn phải đồng ý tất cả điều trên để tiếp tục." -continue: "Tiếp tục" -archive: "Lưu trữ" -thisChannelArchived: "Kênh này đã được lưu trữ." -initialAccountSetting: "Thiết lập hồ sơ" youFollowing: "Đang theo dõi" -preventAiLearning: "Từ chối sử dụng công nghệ Máy Học (AI Sáng Tạo)" -options: "Tùy chọn" -specifyUser: "Người dùng chỉ định" -failedToPreviewUrl: "Không thể xem trước" -update: "Cập nhật" 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." -createInviteCode: "Tạo lời mời" -createWithOptions: "Tạo cùng tùy chọn" -createCount: "Số lượng mời" -inviteCodeCreated: "Lời mời đã được tạo" -inviteLimitExceeded: "Bạn đã vượt quá số lượng mời mà bạn có thể tạo." -createLimitRemaining: "Giới hạn lượt mời: Còn lại {limit}" -inviteLimitResetCycle: "Giới hạn này sẽ được đặt lại về {limit} lúc {time}." expirationDate: "Ngày hết hạn" noExpirationDate: "Vô thời hạn" -inviteCodeUsedAt: "Mã mời đã được sử dụng lúc" -registeredUserUsingInviteCode: "Lời mời đã được sử dụng bởi" waitingForMailAuth: "Đang chờ xác nhận email" -inviteCodeCreator: "Lời mời đã được tạo bởi" -usedAt: "Sử dụng vào lúc" unused: "Chưa được sử dụng" used: "Đã được sử dụng" expired: "Đã hết hạn" doYouAgree: "Đồng ý?" -beSureToReadThisAsItIsImportant: "Hãy đọc kỹ vì nó rất quan trọng." -iHaveReadXCarefullyAndAgree: "Tôi đã đọc và đồng ý với \"{x}\"." +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." -useSecurityKey: "Làm theo hướng dẫn trên trình duyệt hoặc thiết bị của bạn để sử dụng khóa bảo mật hoặc mật mã." replies: "Trả lời" renotes: "Đăng lại" loadReplies: "Hiển thị các trả lời" -loadConversation: "Xem cuộc trò chuyện" 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" -authentication: "Xác thực" -authenticationRequiredToContinue: "Vui lòng xác thực để tiếp tục" -dateAndTime: "Ngày và giờ" -edited: "Đã chỉnh sửa" -notificationRecieveConfig: "Cài đặt thông báo" -mutualFollow: "Theo dõi lẫn nhau" -followingOrFollower: "Đang theo dõi hoặc người theo dõi" -externalServices: "Các dịch vụ bên ngoài" -sourceCode: "Mã nguồn" -feedback: "Phản hồi" -feedbackUrl: "URL phản hồi" -privacyPolicy: "Chính sách bảo mật" -privacyPolicyUrl: "URL Chính sách bảo mật" -tosAndPrivacyPolicy: "Điều khoản sử dụng và Chính sách bảo mật" -avatarDecorations: "Trang trí ảnh đại diện" -attach: "Mặc" -detach: "Bỏ" -detachAll: "Bỏ tất cả" -angle: "Góc" flip: "Lật" -showAvatarDecorations: "Hiển thị trang trí ảnh đại diện" -releaseToRefresh: "Thả để làm mới" -refreshing: "Đang làm mới" -pullDownToRefresh: "Kéo xuống để làm mới" -cwNotationRequired: "Nếu \"Ẩn nội dung\" được bật thì cần phải có chú thích." -lastNDays: "{n} ngày trước" -surrender: "Từ chối" -_delivery: - stop: "Đã vô hiệu hóa" - _type: - none: "Đang đăng" _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ó." @@ -1352,7 +1275,6 @@ _role: ltlAvailable: "Xem Timeline trong máy chủ này" canPublicNote: "Cho phép đăng bài công khai" canManageCustomEmojis: "Quản lý CustomEmoji" - canManageAvatarDecorations: "Quản lý trang trí ảnh đại diện" driveCapacity: "Dữ liệu Drive" pinMax: "Giới hạn ghim bài viết" antennaMax: "Giới hạn tạo ăng ten" @@ -1546,6 +1468,7 @@ _theme: buttonBg: "Nền nút" buttonHoverBg: "Nền nút (Chạm)" inputBorder: "Đường viền khung soạn thảo" + listItemHoverBg: "Nền mục liệt kê (Chạm)" driveFolderBg: "Nền thư mục Ổ đĩa" wallpaperOverlay: "Lớp phủ hình nền" badge: "Huy hiệu" @@ -1557,6 +1480,8 @@ _sfx: note: "Tút" noteMy: "Tút của tôi" notification: "Thông báo" + antenna: "Trạm phát sóng" + channel: "Kênh" _ago: future: "Tương lai" justNow: "Vừa xong" @@ -1578,6 +1503,7 @@ _2fa: 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." + 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 đó." @@ -1743,7 +1669,6 @@ _profile: _exportOrImport: allNotes: "Toàn bộ tút" favoritedNotes: "Bài viết đã thích" - clips: "Lưu bài viết" followingList: "Đang theo dõi" muteList: "Ẩn" blockingList: "Chặn" @@ -1859,7 +1784,7 @@ _notification: youReceivedFollowRequest: "Bạn vừa có một yêu cầu theo dõi" yourFollowRequestAccepted: "Yêu cầu theo dõi của bạn đã được chấp nhận" pollEnded: "Cuộc bình chọn đã kết thúc" - unreadAntennaNote: "Ăng ten {name}" + unreadAntennaNote: "Ăng ten" emptyPushNotificationMessage: "Đã cập nhật thông báo đẩy" achievementEarned: "Hoàn thành Achievement" _types: @@ -1874,7 +1799,6 @@ _notification: receiveFollowRequest: "Yêu cầu theo dõi" followRequestAccepted: "Yêu cầu theo dõi được chấp nhận" achievementEarned: "Hoàn thành Achievement" - login: "Đăng nhập" app: "Từ app liên kết" _actions: followBack: "đã theo dõi lại bạn" @@ -1914,17 +1838,11 @@ _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" -_abuseReport: - _notificationRecipient: - _recipientType: - mail: "Email" _moderationLogTypes: suspend: "Vô hiệu hóa" resetPassword: "Đặt lại mật khẩu" - createInvitation: "Tạo lời mời" -_reversi: - total: "Tổng cộng" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index 93804608c2..bfacc03e0a 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -8,13 +8,10 @@ search: "搜索" notifications: "通知" username: "用户名" password: "密码" -initialPasswordForSetup: "初始化密码" -initialPasswordIsIncorrect: "初始化密码不正确" -initialPasswordForSetupDescription: "如果是自己安装的 Misskey,请输入配置文件里设好的密码。\n如果使用的是 Misskey 的托管服务等,请输入服务商提供的密码。\n如果没有设置密码,请留空并继续。" forgotPassword: "忘记密码" fetchingAsApObject: "在联邦宇宙查询中..." ok: "OK" -gotIt: "好" +gotIt: "我明白了" cancel: "取消" noThankYou: "不用,谢谢" enterUsername: "输入用户名" @@ -61,9 +58,8 @@ copyUserId: "复制用户 ID" copyNoteId: "复制帖子 ID" copyFileId: "复制文件ID" copyFolderId: "复制文件夹ID" -copyProfileUrl: "复制个人资料URL" +copyProfileUrl: "复制配置文件URL" searchUser: "搜索用户" -searchThisUsersNotes: "搜索用户帖子" reply: "回复" loadMore: "查看更多" showMore: "查看更多" @@ -93,7 +89,7 @@ followsYou: "正在关注你" createList: "创建列表" manageLists: "管理列表" error: "错误" -somethingHappened: "出错了" +somethingHappened: "出现了一些问题!" retry: "重试" pageLoadError: "页面加载失败。" pageLoadErrorDescription: "这通常是由于网络或浏览器缓存的原因。请清除缓存或等待片刻后重试。" @@ -112,14 +108,11 @@ enterEmoji: "输入表情符号" renote: "转发" unrenote: "取消转发" renoted: "已转发。" -renotedToX: "转帖给 {name}" cantRenote: "该帖无法转发。" cantReRenote: "转发无法被再次转发。" quote: "引用" inChannelRenote: "在频道内转发" inChannelQuote: "在频道内引用" -renoteToChannel: "转帖至频道" -renoteToOtherChannel: "转帖至其它频道" pinnedNote: "已置顶的帖子" pinned: "置顶" you: "您" @@ -128,21 +121,14 @@ sensitive: "敏感内容" add: "添加" reaction: "回应" reactions: "回应" -emojiPicker: "表情符号选择器" -pinnedEmojisForReactionSettingDescription: "可以设置发表回应时置顶显示的表情符号" -pinnedEmojisSettingDescription: "可以设置输入表情符号时置顶显示的表情符号" -emojiPickerDisplay: "选择器显示设置" -overwriteFromPinnedEmojisForReaction: "从「置顶(回应)」设置覆盖" -overwriteFromPinnedEmojis: "从全局设置覆盖" reactionSettingDescription2: "拖动重新排序,单击删除,点击 + 添加。" rememberNoteVisibility: "保存上次设置的可见性" attachCancel: "删除附件" -deleteFile: "删除文件" markAsSensitive: "标记为敏感内容" unmarkAsSensitive: "取消标记为敏感内容" enterFileName: "输入文件名" mute: "屏蔽" -unmute: "解除静音" +unmute: "解除屏蔽" renoteMute: "屏蔽转帖" renoteUnmute: "解除屏蔽转帖" block: "拉黑" @@ -158,7 +144,6 @@ editList: "编辑列表" selectChannel: "选择频道" selectAntenna: "选择天线" editAntenna: "编辑天线" -createAntenna: "创建天线" selectWidget: "选择小工具" editWidgets: "编辑部件" editWidgetsExit: "完成编辑" @@ -170,7 +155,7 @@ emojiUrl: "emoji 地址" addEmoji: "添加表情符号" settingGuide: "推荐配置" cacheRemoteFiles: "缓存远程文件" -cacheRemoteFilesDescription: "启用此设定时,将在此服务器上缓存远程文件。虽然可以加快图片显示的速度,但是相对的会消耗大量的服务器存储空间。用户角色内的网盘容量决定了这个远程用户能在服务器上保留多少缓存。当超出了这个限制时,旧的文件将从缓存中被删除,成为链接。当禁用此设定时,则是从一开始就将远程文件保留为链接。此时推荐将 default.yml 的 proxyRemoteFiles 设置为 true 以优化缩略图生成及保护用户隐私。" +cacheRemoteFilesDescription: "启用此设定时,将在此服务器上缓存远程文件。虽然可以加快图片显示的速度,但是相对的会消耗大量的服务器存储空间。用户角色内的网盘容量决定了这个远程用户能在服务器上保留保留多少缓存。当超出了这个限制时,旧的文件将从缓存中被删除,成为链接。当禁用此设定时,则是从一开始就将远程文件保留为链接。此时推荐将 default.yml 的 proxyRemoteFiles 设置为 true 以优化缩略图生成及保护用户隐私。" youCanCleanRemoteFilesCache: "可以使用文件管理的🗑️按钮来删除所有的缓存。" cacheRemoteSensitiveFiles: "缓存远程敏感媒体文件" cacheRemoteSensitiveFilesDescription: "如果禁用这项设定,远程服务器的敏感媒体将不会被缓存,而是直接链接。" @@ -185,10 +170,6 @@ addAccount: "添加账户" reloadAccountsList: "更新账户列表" loginFailed: "登录失败" showOnRemote: "转到所在服务器显示" -continueOnRemote: "转到所在服务器继续" -chooseServerOnMisskeyHub: "从 Misskey Hub 选择服务器" -specifyServerHost: "直接输入服务器域名" -inputHostName: "请输入域名" general: "常规设置" wallpaper: "壁纸" setWallpaper: "设置壁纸" @@ -199,7 +180,6 @@ followConfirm: "你确定要关注 {name} 吗?" proxyAccount: "代理账户" proxyAccountDescription: "代理账户是在某些情况下替代用户进行远程关注用的账户。 例如说,当用户将一位远程用户放入一个列表中时,如果本地服务器上没有任何人关注这位远程用户,则这位远程用户的账户活动将不会被送到本地服务器上。作为替代,此时将使用代理账户进行关注。" host: "主机名" -selectSelf: "选择自己" selectUser: "选择用户" recipient: "收件人" annotation: "注解" @@ -213,9 +193,8 @@ charts: "图表" perHour: "每小时" perDay: "每天" stopActivityDelivery: "停止发送活动" -blockThisInstance: "封锁此服务器" -silenceThisInstance: "静音此服务器" -mediaSilenceThisInstance: "隐藏此服务器的媒体文件" +blockThisInstance: "阻止此服务器向本服务器推流" +silenceThisInstance: "使服务器静音" operations: "操作" software: "软件" version: "版本" @@ -230,19 +209,15 @@ instanceInfo: "服务器信息" statistics: "统计" clearQueue: "清除队列" clearQueueConfirmTitle: "确定清除队列?" -clearQueueConfirmText: "未送达的帖子将不会被投递。 通常无需执行此操作。" +clearQueueConfirmText: "未送达的帖子将不会投递。 通常,您不需要这样做。" clearCachedFiles: "清除缓存" -clearCachedFilesConfirm: "确定要清除所有缓存的远程文件?" +clearCachedFilesConfirm: "确定要清除缓存文件?" blockedInstances: "被封锁的服务器" -blockedInstancesDescription: "设定要封锁的服务器,以换行分隔。被封锁的服务器将无法与本服务器进行交换通讯。子域名也同样会被封锁。" -silencedInstances: "被静音的服务器" -silencedInstancesDescription: "设置要静音的服务器,以换行分隔。被静音的服务器内所有的账户将默认处于「静音」状态,仅能发送关注请求,并且在未关注状态下无法提及本地账户。被阻止的实例不受影响。" -mediaSilencedInstances: "已隐藏媒体文件的服务器" -mediaSilencedInstancesDescription: "设置要隐藏媒体文件的服务器,以换行分隔。被设置为隐藏媒体文件服务器内所有账号的文件均按照「敏感内容」处理,且将无法使用自定义表情符号。被阻止的实例不受影响。" -federationAllowedHosts: "允许联合的服务器" -federationAllowedHostsDescription: "设定允许联合的服务器,以换行分隔。" -muteAndBlock: "静音/拉黑" -mutedUsers: "已静音用户" +blockedInstancesDescription: "设定要封锁的服务器,以换行来进行分割。被封锁的服务器将无法与本服务器进行交换通讯。子域名也同样会被封锁。" +silencedInstances: "沉默的服务器" +silencedInstancesDescription: "设置要静音的服务器的主机,以换行符分隔。属于静默服务器的所有帐户都将被视为“静默”,所有关注都将成为请求,并且您将无法提及非关注者的本地帐户。被阻止的实例不受影响。" +muteAndBlock: "屏蔽/拉黑" +mutedUsers: "已屏蔽用户" blockedUsers: "已拉黑的用户" noUsers: "无用户" editProfile: "编辑资料" @@ -258,7 +233,7 @@ noCustomEmojis: "没有自定义表情符号" noJobs: "没有任务" federating: "联合中" blocked: "已拉黑" -suspended: "停止投递" +suspended: "停止推流" all: "全部" subscribing: "已订阅" publishing: "投递中" @@ -285,7 +260,6 @@ removed: "已删除" removeAreYouSure: "要删掉「{x}」吗?" deleteAreYouSure: "要删掉「{x}」吗?" resetAreYouSure: "恢复默认设置?" -areYouSure: "你确定吗?" saved: "已保存" messaging: "聊天" upload: "本地上传" @@ -331,7 +305,6 @@ selectFile: "选择文件" selectFiles: "选择文件" selectFolder: "选择文件夹" selectFolders: "选择多个文件夹" -fileNotSelected: "未选择文件" renameFile: "重命名文件" folderName: "文件夹名称" createFolder: "创建文件夹" @@ -339,7 +312,6 @@ renameFolder: "重命名文件夹" deleteFolder: "删除文件夹" folder: "文件夹" addFile: "添加文件" -showFile: "显示文件" emptyDrive: "网盘中无文件" emptyFolder: "此文件夹中无文件" unableToDelete: "无法删除" @@ -356,7 +328,7 @@ displayOfSensitiveMedia: "显示敏感媒体" whenServerDisconnected: "与服务器连接中断时" disconnectedFromServer: "已和服务器断开连接" reload: "重新加载" -doNothing: "关闭" +doNothing: "关闭弹窗" reloadConfirm: "确定要重新加载吗?" watch: "关注" unwatch: "取消关注" @@ -367,7 +339,7 @@ instanceName: "服务器名称" instanceDescription: "服务器简介" maintainerName: "管理员名称" maintainerEmail: "管理员电子邮箱" -tosUrl: "服务条款地址" +tosUrl: "服务条款 URL" thisYear: "今年" thisMonth: "本月" today: "今天" @@ -380,7 +352,7 @@ connectService: "连接" disconnectService: "断开连接" enableLocalTimeline: "启用本地时间线" enableGlobalTimeline: "启用全局时间线" -disablingTimelinesInfo: "即使时间线功能被禁用,出于方便,管理员和监察员也可以继续使用。" +disablingTimelinesInfo: "即使时间线功能被禁用,出于方便,管理员和协作者也可以继续使用。" registration: "注册" enableRegistration: "允许任何人注册" invite: "邀请" @@ -400,27 +372,21 @@ hcaptcha: "hCaptcha" enableHcaptcha: "启用 hCaptcha" hcaptchaSiteKey: "网站密钥" hcaptchaSecretKey: "hCaptcha 密钥(SecretKey)" -mcaptcha: "mCaptcha" -enableMcaptcha: "启用 mCaptcha" -mcaptchaSiteKey: "网站密钥" -mcaptchaSecretKey: "mCaptcha 密钥(SecretKey)" -mcaptchaInstanceUrl: "mCaptcha 实例地址" recaptcha: "reCAPTCHA" enableRecaptcha: "启用 reCAPTCHA\n(请注意, 此功能在中国大陆不可用. 如果启用, 可能导致无法正常使用登录或注册等功能)" recaptchaSiteKey: "网站密钥" -recaptchaSecretKey: "mCaptcha 密钥(SecretKey)" +recaptchaSecretKey: "reCAPTCHA 密钥(SecretKey)" turnstile: "Turnstile" enableTurnstile: "启用 Turnstile" turnstileSiteKey: "网站密钥" turnstileSecretKey: "Turnstile 密钥(SecretKey)" -avoidMultiCaptchaConfirm: "使用多个 Captcha 可能会互相干扰,您要禁用其它 Captcha 吗?您可以按“取消”按钮,继续保持启用多种验证方式。" +avoidMultiCaptchaConfirm: "使用多种验证方式可能会造成干扰,您要禁用其他验证方式吗?您可以按“取消”按钮,继续保持启用多种验证方式。" antennas: "天线" manageAntennas: "天线管理" name: "名称" antennaSource: "接收来源" antennaKeywords: "包含关键字" antennaExcludeKeywords: "排除关键字" -antennaExcludeBots: "排除机器人账户" antennaKeywordsDescription: "AND 条件用空格分隔,OR 条件用换行符分隔。" notifyAntenna: "开启通知" withFileAntenna: "仅带有附件的帖子" @@ -449,12 +415,11 @@ administrator: "管理员" token: "Token (令牌)" 2fa: "双因素认证" setupOf2fa: "设置双因素认证" -totp: "验证器" -totpDescription: "使用验证器输入一次性密码" +totp: "身份验证应用" +totpDescription: "使用认证应用输入一次性密码。" moderator: "监察员" moderation: "管理" moderationNote: "管理笔记" -moderationNoteDescription: "可以用来记录仅在管理员之间共享的笔记。" addModerationNote: "添加管理笔记" moderationLogs: "管理日志" nUsersMentioned: "{n} 被提到" @@ -489,12 +454,10 @@ retype: "重新输入" noteOf: "{user} 的帖子" quoteAttached: "已引用" quoteQuestion: "是否引用此链接内容?" -attachAsFileQuestion: "剪贴板内的文字过长。要转换为文本文件并添加吗?" noMessagesYet: "现在没有新的聊天" newMessageExists: "新信息" onlyOneFileCanBeAttached: "只能添加一个附件" signinRequired: "请先登录" -signinOrContinueOnRemote: "若要继续,需要转到您所使用的实例,或者在此服务器上注册或登录。" invitations: "邀请" invitationCode: "邀请码" checking: "正在确认" @@ -514,14 +477,10 @@ or: "或者" language: "语言" uiLanguage: "显示语言" aboutX: "关于 {x}" -emojiStyle: "表情符号的样式" +emojiStyle: "emoji 的样式" native: "原生" -menuStyle: "菜单样式" -style: "样式" -drawer: "抽屉" -popup: "弹窗" +disableDrawer: "不显示抽屉菜单" showNoteActionsOnlyHover: "仅在悬停时显示帖子操作" -showReactionsCount: "显示帖子的回应数" noHistory: "没有历史记录" signinHistory: "登录历史" enableAdvancedMfm: "启用扩展 MFM" @@ -555,7 +514,7 @@ showFeaturedNotesInTimeline: "在时间线上显示热门推荐" objectStorage: "对象存储" useObjectStorage: "使用对象存储" objectStorageBaseUrl: "Base URL" -objectStorageBaseUrlDesc: "用于参考的 URL,如果您正在使用 CDN 或 Proxy,请填入服务商提供的 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: "前缀" @@ -574,7 +533,6 @@ serverLogs: "服务器日志" deleteAll: "全部删除" showFixedPostForm: "在时间线顶部显示发帖框" showFixedPostFormInChannel: "在时间线顶部显示发帖对话框(频道)" -withRepliesByDefaultForNewlyFollowed: "在时间线中默认包含新关注用户的回复" newNoteRecived: "有新的帖子" sounds: "提示音" sound: "提示音" @@ -584,8 +542,6 @@ showInPage: "在页面中显示" popout: "弹窗" volume: "音量" masterVolume: "主音量" -notUseSound: "静音" -useSoundOnlyWhenActive: "仅在 Misskey 活跃时输出声音" details: "详情" chooseEmoji: "选择表情符号" unableToProcess: "操作无法完成" @@ -602,20 +558,14 @@ ascendingOrder: "升序" descendingOrder: "降序" scratchpad: "AiScript 控制台" scratchpadDescription: "AiScript 控制台为 AiScript 提供了实验环境。您可以编写代码与 Misskey 交互,运行并查看结果。" -uiInspector: "UI 检查器" -uiInspectorDescription: "查看所有内存中由 UI 组件生成出的实例。UI 组件由 UI:C 系列函数所生成。" output: "输出" script: "脚本" disablePagesScript: "禁用页面脚本" updateRemoteUser: "更新远程用户信息" -unsetUserAvatar: "清除头像" -unsetUserAvatarConfirm: "要清除头像吗?" -unsetUserBanner: "清除横幅" -unsetUserBannerConfirm: "要清除横幅吗?" deleteAllFiles: "删除所有文件" deleteAllFilesConfirm: "要删除所有文件吗?" removeAllFollowing: "取消所有关注" -removeAllFollowingDescription: "取消来自 {host} 的所有关注者。当服务器不再存在时执行。" +removeAllFollowingDescription: "取消 {host} 的所有关注者。当服务器不再存在时执行。" userSuspended: "该用户已被冻结。" userSilenced: "该用户已被禁言。" yourAccountSuspendedTitle: "账户已被冻结" @@ -644,7 +594,7 @@ disablePlayer: "关闭播放器" expandTweet: "展开帖子" themeEditor: "主题编辑器" description: "描述" -describeFile: "添加描述" +describeFile: "添加标题" enterFileDescription: "输入标题" author: "作者" leaveConfirm: "存在未保存的更改。要放弃更改吗?" @@ -662,7 +612,6 @@ medium: "中" small: "小" generateAccessToken: "生成访问令牌" permission: "权限" -adminPermission: "管理员权限" enableAll: "启用全部" disableAll: "禁用全部" tokenRequested: "允许访问账户" @@ -684,7 +633,6 @@ smtpSecure: "在 SMTP 连接中使用隐式 SSL / TLS" smtpSecureInfo: "使用 STARTTLS 时关闭。" testEmail: "邮件发送测试" wordMute: "文字屏蔽" -hardWordMute: "屏蔽关键词" regexpError: "正则表达式错误" regexpErrorDescription: "{tab} 屏蔽文字的第 {line} 行的正则表达式有错误:" instanceMute: "被屏蔽的服务器" @@ -706,7 +654,6 @@ useGlobalSettingDesc: "启用时,将使用账户通知设置。关闭时,则 other: "其他" regenerateLoginToken: "重新生成登录令牌" regenerateLoginTokenDescription: "重新生成用于登录的内部令牌。通常您不需要这样做。重新生成后,您将在所有设备上登出。" -theKeywordWhenSearchingForCustomEmoji: "这将是搜索自定义表情符号时的关键词。" setMultipleBySeparatingWithSpace: "您可以使用空格分隔多个项目。" fileIdOrUrl: "文件 ID 或者 URL" behavior: "行为" @@ -720,7 +667,10 @@ abuseReported: "内容已发送。感谢您提交信息。" reporter: "举报者" reporteeOrigin: "举报来源" reporterOrigin: "举报者来源" +forwardReport: "将该举报信息转发给远程服务器" +forwardReportIsAnonymous: "在远程实例上显示的报告者是匿名的系统账号,而不是您的账号。" send: "发送" +abuseMarkAsResolved: "处理完毕" openInNewTab: "在新标签页中打开" openInSideView: "在侧边栏中打开" defaultNavigationBehaviour: "默认导航" @@ -857,7 +807,6 @@ administration: "管理" accounts: "账户" switch: "切换" noMaintainerInformationWarning: "管理人员信息未设置。" -noInquiryUrlWarning: "尚未设置联络地址。" noBotProtectionWarning: "Bot 防御未设置。" configure: "设置" postToGallery: "发送到图库" @@ -869,7 +818,7 @@ shareWithNote: "在帖子中分享" ads: "广告" expiration: "截止时间" startingperiod: "开始时间" -memo: "备注" +memo: "便笺" priority: "优先级" high: "高" middle: "中" @@ -917,12 +866,9 @@ makeReactionsPublicDescription: "将您发表过的回应设置成公开可见 classic: "经典" muteThread: "屏蔽帖子列表" unmuteThread: "取消屏蔽帖子列表" -followingVisibility: "关注的人的公开范围" -followersVisibility: "关注者的公开范围" continueThread: "查看更多帖子" deleteAccountConfirm: "将要删除账户。是否确认?" incorrectPassword: "密码错误" -incorrectTotp: "一次性密码不正确或已过期" voteConfirm: "确定投给 “{choice}” ?" hide: "隐藏" useDrawerReactionPickerForMobile: "在移动设备上使用抽屉显示" @@ -947,9 +893,6 @@ oneHour: "1 小时" oneDay: "1 天" oneWeek: "1 周" oneMonth: "1 个月" -threeMonths: "3 个月" -oneYear: "1 年" -threeDays: "3 天" reflectMayTakeTime: "可能需要一些时间才能体现出效果。" failedToFetchAccountInformation: "获取账户信息失败" rateLimitExceeded: "已超过速率限制" @@ -1006,7 +949,7 @@ unsubscribePushNotification: "停用推送通知消息" pushNotificationAlreadySubscribed: "推送通知消息已启用" pushNotificationNotSupported: "浏览器或服务器不支持推送通知消息" sendPushNotificationReadMessage: "删除已读推送通知消息" -sendPushNotificationReadMessageCaption: "您终端设备的电池消耗可能会增加。" +sendPushNotificationReadMessageCaption: "“{emptyPushNotificationMessage}”的通知消息将会显示。您终端设备的电池消耗可能会增加。" windowMaximize: "最大化" windowMinimize: "最小化" windowRestore: "还原" @@ -1023,7 +966,6 @@ neverShow: "不再显示" remindMeLater: "稍后提醒我" didYouLikeMisskey: "您喜欢 Misskey 吗?" pleaseDonate: "Misskey 是 {host} 所使用的免费软件。为了今后也能够维持 Misskey 的开发,请在有余力的情况下进行捐助!" -correspondingSourceIsAvailable: "对应的源代码可在{anchor}找到" roles: "角色" role: "角色" noRole: "角色不存在" @@ -1033,7 +975,6 @@ assign: "分配" unassign: "取消分配" color: "颜色" manageCustomEmojis: "管理自定义表情符号" -manageAvatarDecorations: "管理头像挂件" youCannotCreateAnymore: "抱歉,您无法再创建更多了。" cannotPerformTemporary: "暂时不可用" cannotPerformTemporaryDescription: "因操作过于频繁,暂时不可用,请稍后再试。" @@ -1051,7 +992,6 @@ thisPostMayBeAnnoyingHome: "发到首页" thisPostMayBeAnnoyingCancel: "取消" thisPostMayBeAnnoyingIgnore: "就这样发布" collapseRenotes: "省略显示已经看过的转发内容" -collapseRenotesDescription: "将回应过或转贴过的贴子折叠表示。" internalServerError: "内部服务器错误" internalServerErrorDescription: "内部服务器发生了预期外的错误" copyErrorInfo: "复制错误信息" @@ -1073,13 +1013,8 @@ nonSensitiveOnlyForLocalLikeOnlyForRemote: "仅限非敏感内容(远程仅点 rolesAssignedToMe: "指派给自己的角色" resetPasswordConfirm: "确定重置密码?" sensitiveWords: "敏感词" -sensitiveWordsDescription: "包含这些词的帖子将只在首页可见。可用换行来设定多个词。" +sensitiveWordsDescription: "将包含设置词的帖子的可见范围设置为首页。可以通过用换行符分隔来设置多个。" sensitiveWordsDescription2: "AND 条件用空格分隔,正则表达式用斜线包裹。" -prohibitedWords: "禁用词" -prohibitedWordsDescription: "发布包含设定词汇的帖子时将出错。可用换行设定多个关键字" -prohibitedWordsDescription2: "AND 条件用空格分隔,正则表达式用斜线包裹。" -hiddenTags: "隐藏标签" -hiddenTagsDescription: "设定的标签将不会在时间线上显示。可使用换行来设置多个标签。" notesSearchNotAvailable: "帖子检索不可用" license: "许可信息" unfavoriteConfirm: "确定要取消收藏吗?" @@ -1090,15 +1025,11 @@ retryAllQueuesConfirmTitle: "要再尝试一次吗?" retryAllQueuesConfirmText: "可能会使服务器负荷在一定时间内增加" enableChartsForRemoteUser: "生成远程用户的图表" enableChartsForFederatedInstances: "生成远程服务器的图表" -enableStatsForFederatedInstances: "获取远程服务器的信息" showClipButtonInNoteFooter: "在贴文下方显示便签按钮" reactionsDisplaySize: "回应显示大小" -limitWidthOfReaction: "限制回应的最大宽度,并将其缩小显示" noteIdOrUrl: "帖子 ID 或 URL" video: "视频" videos: "视频" -audio: "音频" -audioFiles: "音频" dataSaver: "省流量模式" accountMigration: "账户迁移" accountMoved: "此用户已迁移账户" @@ -1126,8 +1057,6 @@ preservedUsernames: "保留的用户名" preservedUsernamesDescription: "列出需要保留的用户名,使用换行来作为分割。被指定的用户名在建立账户时无法使用,但由管理员所创建的账户不受该限制。此外,现有的账户也不会受到影响。" createNoteFromTheFile: "从文件创建帖子" archive: "归档" -archived: "已归档" -unarchive: "取消归档" channelArchiveConfirmTitle: "要将 {name} 归档吗?" channelArchiveConfirmDescription: "归档后,在频道列表与搜索结果中不会显示,也无法发布新的贴文。" thisChannelArchived: "该频道已被归档。" @@ -1138,9 +1067,6 @@ preventAiLearning: "拒绝接受生成式 AI 的学习" preventAiLearningDescription: "要求文章生成 AI 或图像生成 AI 不能够以发布的帖子和图像等内容作为学习对象。这是通过在 HTML 响应中包含 noai 标志来实现的,这不能完全阻止 AI 学习你的发布内容,并不是所有 AI 都会遵守这类请求。" options: "选项" specifyUser: "用户指定" -lookupConfirm: "确定查询?" -openTagPageConfirm: "确定打开话题标签页面?" -specifyHost: "指定主机名" failedToPreviewUrl: "无法预览" update: "更新" rolesThatCanBeUsedThisEmojiAsReaction: "可以使用表情作为回应的角色" @@ -1156,7 +1082,7 @@ branding: "品牌" enableServerMachineStats: "公开服务器硬件统计信息" enableIdenticonGeneration: "启用生成用户 Identicon" turnOffToImprovePerformance: "关闭该选项可以提高性能。" -createInviteCode: "生成邀请码" +createInviteCode: "发行邀请码" createWithOptions: "使用选项来创建" createCount: "发行数" inviteCodeCreated: "已创建邀请码" @@ -1168,7 +1094,7 @@ noExpirationDate: "不设置有效日期" inviteCodeUsedAt: "邀请码被使用的日期和时间" registeredUserUsingInviteCode: "使用了邀请码的用户" waitingForMailAuth: "等待验证电子邮件" -inviteCodeCreator: "生成邀请码的用户" +inviteCodeCreator: "发行邀请码的用户" usedAt: "使用时间" unused: "未使用" used: "已使用" @@ -1199,162 +1125,20 @@ showRenotes: "显示转帖" edited: "已编辑" notificationRecieveConfig: "通知接收设置" mutualFollow: "互相关注" -followingOrFollower: "关注中或关注者" fileAttachedOnly: "仅限媒体" -showRepliesToOthersInTimeline: "在时间线中包含给别人的回复" -hideRepliesToOthersInTimeline: "在时间线中隐藏给别人的回复" -showRepliesToOthersInTimelineAll: "在时间线中显示所有现在关注的人的回复" -hideRepliesToOthersInTimelineAll: "在时间线中隐藏所有现在关注的人的回复" -confirmShowRepliesAll: "此操作不可撤销。确认要在时间线中显示所有现在关注的人的回复吗?" -confirmHideRepliesAll: "此操作不可撤销。确认要在时间线中隐藏所有现在关注的人的回复吗?" -externalServices: "外部服务" -sourceCode: "源代码" -sourceCodeIsNotYetProvided: "还未提供源代码。要解决此问题请联系管理员。" -repositoryUrl: "仓库地址" -repositoryUrlDescription: "若源代码所在的仓库是公开的,请填入对应的 URL。若并未追加或者修改 Misskey 的代码,请填入 https://github.com/misskey-dev/misskey。" -repositoryUrlOrTarballRequired: "若仓库并未公开,则需要提供 tarball 作为替代。详情请看 .config/example.yml。" -feedback: "反馈" -feedbackUrl: "反馈地址" -impressum: "运营商信息" -impressumUrl: "运营商信息地址" -impressumDescription: "德国等国家和地区有义务展示此类信息(Impressum)。" -privacyPolicy: "隐私政策" -privacyPolicyUrl: "隐私政策地址" -tosAndPrivacyPolicy: "服务条款及隐私政策" +showRepliesToOthersInTimeline: "在时间线上显示给其他人的回复" +hideRepliesToOthersInTimeline: "在时间线上隐藏给其他人的回复" avatarDecorations: "头像挂件" -attach: "佩戴" -detach: "卸下" -detachAll: "全部卸下" -angle: "角度" flip: "翻转" -showAvatarDecorations: "显示头像挂件" -releaseToRefresh: "松开以刷新" -refreshing: "刷新中" -pullDownToRefresh: "下拉以刷新" -disableStreamingTimeline: "禁止实时更新时间线" -useGroupedNotifications: "分组显示通知" -signupPendingError: "确认电子邮件时出现错误。链接可能已过期。" -cwNotationRequired: "在启用「隐藏内容」时必须输入注释" -doReaction: "回应" -code: "代码" -reloadRequiredToApplySettings: "需要重新载入来使设置生效" -remainingN: "剩余:{n}" -overwriteContentConfirm: "将覆盖现有内容。确定吗?" -seasonalScreenEffect: "符合当前季节的画面效果" -decorate: "装饰" -addMfmFunction: "添加装饰" -enableQuickAddMfmFunction: "显示高级 MFM 选择器" -bubbleGame: "泡泡游戏" -sfx: "音效" -soundWillBePlayed: "声音将会播放" -showReplay: "观看回放" -replay: "重播" -replaying: "重播中" -endReplay: "结束回放" -copyReplayData: "复制回放数据" -ranking: "排行榜" -lastNDays: "最近 {n} 天" -backToTitle: "返回标题" -hemisphere: "居住地区" -withSensitive: "显示包含敏感媒体的帖子" -userSaysSomethingSensitive: "含 {name} 敏感文件的帖子" -enableHorizontalSwipe: "滑动切换标签页" -loading: "读取中" -surrender: "取消" -gameRetry: "重试" -notUsePleaseLeaveBlank: "如不使用请留空" -useTotp: "使用一次性代码" -useBackupCode: "使用备用代码" -launchApp: "启动应用" -useNativeUIForVideoAudioPlayer: "使用浏览器的 UI 播放动画及音频" -keepOriginalFilename: "保持原文件名" -keepOriginalFilenameDescription: "若关闭此设置,上传文件时文件名将被替换为随机字符。" -noDescription: "没有描述" -alwaysConfirmFollow: "总是确认关注" -inquiry: "联系我们" -tryAgain: "请再试一次" -confirmWhenRevealingSensitiveMedia: "显示敏感内容前需要确认" -sensitiveMediaRevealConfirm: "这是敏感内容。是否显示?" -createdLists: "已创建的列表" -createdAntennas: "已创建的天线" -fromX: "从 {x}" -genEmbedCode: "生成嵌入代码" -noteOfThisUser: "此用户的帖子" -clipNoteLimitExceeded: "无法再往此便签内添加更多帖子" -performance: "性能" -modified: "有变更" -discard: "取消" -thereAreNChanges: "有 {n} 处更改" -signinWithPasskey: "使用通行密钥登录" -unknownWebAuthnKey: "此通行密钥未注册。" -passkeyVerificationFailed: "验证通行密钥失败。" -passkeyVerificationSucceededButPasswordlessLoginDisabled: "通行密钥验证成功,但账户未开启无密码登录。" -messageToFollower: "给关注者的消息" -target: "对象" -testCaptchaWarning: "此功能为测试 CAPTCHA 用。请勿在正式环境中使用。" -prohibitedWordsForNameOfUser: "用户名中禁止的词" -prohibitedWordsForNameOfUserDescription: "更改用户名时,如果用户名中包含此列表里的词汇,用户的改名请求将被拒绝。持有管理员权限的用户不受此限制。" -yourNameContainsProhibitedWords: "目标用户名包含违禁词" -yourNameContainsProhibitedWordsDescription: "用户名内含有违禁词。若想使用此用户名,请联系服务器管理员。" -thisContentsAreMarkedAsSigninRequiredByAuthor: "根据发帖者的设定,需要登录才能显示" -lockdown: "锁定" -pleaseSelectAccount: "请选择帐户" -_accountSettings: - requireSigninToViewContents: "需要登录才能显示内容" - requireSigninToViewContentsDescription1: "您发布的所有帖子将变成需要登入后才会显示。有望防止爬虫收集各种信息。" - requireSigninToViewContentsDescription2: "没有 URL 预览(OGP)、内嵌网页、引用帖子的功能的服务器也将无法显示。" - requireSigninToViewContentsDescription3: "这些限制可能不适用于联合到远程服务器的内容。" - makeNotesFollowersOnlyBefore: "可将过去的帖子设为仅关注者可见" - makeNotesFollowersOnlyBeforeDescription: "开启此设定时,超过设定的时间或日期后,帖子将变为仅关注者可见。关闭后帖子的公开状态将恢复成原本的设定。" - makeNotesHiddenBefore: "将过去的帖子设为私密" - makeNotesHiddenBeforeDescription: "开启此设定时,超过设定的时间或日期后,帖子将变为仅自己可见。关闭后帖子的公开状态将恢复成原本的设定。" - mayNotEffectForFederatedNotes: "与远程服务器联合的帖子在远端可能会没有效果。" - notesHavePassedSpecifiedPeriod: "超过指定时间的帖子" - notesOlderThanSpecifiedDateAndTime: "指定日期前的帖子" -_abuseUserReport: - forward: "转发" - forwardDescription: "目标是匿名系统账户,将把举报转发给远程服务器。" - resolve: "解决" - accept: "确认" - reject: "拒绝" - resolveTutorial: "如果举报内容有理且已解决,选择「确认」将案件以肯定的态度标记为已解决。\n如果举报内容站不住脚,选择「拒绝」将案件以否定的态度标记为已解决。" -_delivery: - status: "投递状态" - stop: "停止投递" - resume: "继续投递" - _type: - none: "投递中" - manuallySuspended: "手动停止中" - goneSuspended: "因服务器被删除而停止" - autoSuspendedForNotResponding: "因服务器无应答而停止" -_bubbleGame: - howToPlay: "游戏说明" - hold: "抓住" - _score: - score: "得分" - scoreYen: "赚到的钱" - highScore: "最高分" - maxChain: "最高连击数" - yen: "{yen} 日元" - estimatedQty: "约 {qty} 个" - scoreSweets: "相当于 {onigiriQtyWithUnit} 饭团" - _howToPlay: - section1: "对准位置将Emoji投入盒子。" - section2: "相同的Emoji相互接触合成后会得到新的Emoji,以此获得分数。" - section3: "如果Emoji从箱子中溢出游戏将会结束。在防止Emoji溢出的同时,不断合成新的Emoji,来获取更高的分数吧!" _announcement: forExistingUsers: "仅限现有用户" forExistingUsersDescription: "若启用,该公告将仅对创建此公告时存在的用户可见。 如果禁用,则在创建此公告后注册的用户也可以看到该公告。" needConfirmationToRead: "需要确认才能标记为已读" needConfirmationToReadDescription: "若启用,则会在标记已读时会显示确认对话框。此外,它也会不受批量已读操作的影响。" end: "结束公告" - tooManyActiveAnnouncementDescription: "若有大量活动公告,可能会造成用户体验下降。请考虑归档已完成的公告。" + tooManyActiveAnnouncementDescription: "若有大量活动公告,可能会造成用户体验可能下降。请考虑归档已完成的公告。" readConfirmTitle: "标记为已读?" readConfirmText: "阅读“{title}”的内容并将其标记为已读。" - shouldNotBeUsedToPresentPermanentInfo: "我们建议使用公告来发布临时性的流动信息而不是固定的常规信息,因为这可能损害用户体验,尤其是对于新用户而言。" - dialogAnnouncementUxWarn: "同时存在 2 个或以上的对话框公告极有可能对用户体验产生负面的影响,建议谨慎使用。" - silence: "不发送通知" - silenceDescription: "开启后,此条公告将不会发送通知,也不强制用户阅读。" _initialAccountSetting: accountCreated: "账户创建完成了!" letsStartAccountSetup: "来进行帐户的初始设置吧。" @@ -1367,99 +1151,23 @@ _initialAccountSetting: pushNotificationDescription: "启用推送通知的话,就可以在设备上接收来自 {name} 的通知了。" initialAccountSettingCompleted: "初始设定已经完成了!" haveFun: "希望 {name} 在这里玩得开心!" - youCanContinueTutorial: "您可以继续了解 {name}(Misskey) 的使用教程,也可以在此停止教程并立即开始使用它。\n" - startTutorial: "开始教学" skipAreYouSure: "要跳过初始设置吗?" laterAreYouSure: "要稍后再进行初始设定吗?" -_initialTutorial: - launchTutorial: "观看教学" - title: "教学" - wellDone: "做得好" - skipAreYouSure: "是否退出教学?" - _landing: - title: "欢迎来到教学" - description: "在这里,您可以查看 Misskey 的基本使用方法和功能。" - _note: - title: "什么是帖子?" - description: "在 Misskey 上发表的文章称为「帖子」。帖子在时间线上按照时间顺序排列,并实时更新。" - reply: "用来回复帖子。可以对回复进行回复,从而形成一串对话。" - renote: "用来将帖子共享到自己的时间线上。也可以加上自己的文字然后引用它。" - reaction: "用来添加回应。详细信息将在下一页进行说明。" - menu: "用来进行例如显示帖子详情、复制链接等各种各样的操作。" - _reaction: - title: "什么是回应?" - description: "您可以在帖子中添加“回应”。 您可以使用反应轻松地表达点“赞”所无法传达的细微差别。" - letsTryReacting: "回应可以通过点击帖子中的「+」按钮来添加。试着给这个示例帖子添加一个回应!" - reactToContinue: "添加一个回应来继续" - reactNotification: "当您的帖子被某人添加了回应时,将实时收到通知。" - reactDone: "通过按下「ー」按钮,可以取消已经添加的回应" - _timeline: - title: "时间线的运作方式" - description1: "Misskey 根据使用方式提供了多个时间线(根据服务器的设定,可能有一些被禁用)。" - home: "可以查看您关注的账户的帖子。" - local: "可以查看这个服务器上所有用户发表的帖子。" - social: "将同时显示首页时间线和本地时间线的内容。" - global: "可以查看所有已联合的服务器上的帖子。" - description2: "可以随时在屏幕顶部在每个时间线之间切换。" - description3: "另外,还有列表时间线和频道时间线。请参阅{link}了解更多详细信息。" - _postNote: - title: "帖子发布设置" - description1: "在 Misskey 发布帖子时,您可以设置各种选项。发帖窗口看起来是这样的。\n" - _visibility: - description: "您可以限制谁可以看到您的帖子。" - public: "向所有用户公开。\n" - home: "仅在首页时间线上发布。 关注者、从个人资料页查看过来的用户、以及通过转帖也能被别的用户看见。" - followers: "仅对关注者可见。 除了您自己之外,没有人可以转贴,并且只有您的关注者可以查看它。\n" - direct: "它将仅向指定用户公开,并且他们也会收到通知。 您可以使用它来代替私信。\n" - doNotSendConfidencialOnDirect1: "发送敏感信息时请注意。\n" - doNotSendConfidencialOnDirect2: "目标服务器的管理员可以看到发布的内容,因此如果您向不受信任的服务器上的用户发送私信,则在处理敏感信息时需要小心。" - localOnly: "不将帖子推送到其它服务器。 无论上述公开范围如何,其它服务器的用户将无法看到附加了此设定的帖子。\n" - _cw: - title: "隐藏内容 (CW)\n" - description: "显示「注解」里的内容而不是正文。点击「查看更多」将会把正文显示出来。" - _exampleNote: - cw: "深夜报复社会" - note: "茨了带巧克力的甜甜圈🍩😋" - useCases: "用于服务器条款所规定的帖子,或对剧透内容和敏感内容进行自主规制。" - _howToMakeAttachmentsSensitive: - title: "如何将附件标注为敏感内容?" - description: "对于服务器方针所要求要求的,又或者不适合直接展示的附件,请添加「敏感」标记。\n" - tryThisFile: "试试看,将附加到此窗口的图像标注为敏感!" - _exampleNote: - note: "拆纳豆包装时出错了…" - method: "要标注附件为敏感内容,请单击该文件以打开菜单,然后单击“标记为敏感内容”。" - sensitiveSucceeded: "附加文件时,请遵循服务器的条款来设置正确敏感设定。\n" - doItToContinue: "将图像标记为敏感后才能够继续" - _done: - title: "恭喜您,已经完成了教程🎉\n" - description: "这里介绍的只是其中一小部分的功能。 要了解更多有关如何使用 Misskey 的更多信息,请访问 {link}。" -_timelineDescription: - home: "首页时间线可以查看您关注的账户的帖子。" - local: "本地时间线可以查看这个服务器上所有用户发表的帖子。" - social: "社交时间线将同时显示首页时间线和本地时间线的内容。" - global: "全局时间线可以查看所有已联合的服务器上的帖子。" _serverRules: description: "在新用户注册前显示服务器的简单规则。推荐显示服务条款的主要内容。" _serverSettings: iconUrl: "图标 URL" appIconDescription: "指定当 {host} 显示为 app 时的图标。" - appIconUsageExample: "如作为书签添加到 PWA 或手机主屏幕时" + appIconUsageExample: "例如:作为书签添加到 PWA 或手机主屏幕的时候" appIconStyleRecommendation: "因为有可能会被裁切为圆形或者圆角矩形,建议使用边缘带有留白背景的图标。" appIconResolutionMustBe: "分辨率必须为 {resolution}。" manifestJsonOverride: "覆盖 manifest.json" shortName: "简称" shortNameDescription: "如果服务器的正式名称很长,可以用简称或者別名来替代。" - fanoutTimelineDescription: "当启用时,可显著提高获取各种时间线时的性能,并减轻数据库的负荷。但是相对的 Redis 的内存使用量将会增加。如果服务器的内存不是很大,又或者运行不稳定的话可以把它关掉。" - fanoutTimelineDbFallback: "回退到数据库" - fanoutTimelineDbFallbackDescription: "当启用时,若时间线未被缓存,则将额外查询数据库。禁用该功能可通过不执行回退处理进一步减少服务器负载,但会限制可检索的时间线范围。" - reactionsBufferingDescription: "开启时可显著提高发送回应时的性能,及减轻数据库负荷。但 Redis 的内存用量会相应增加。" - inquiryUrl: "联络地址" - inquiryUrlDescription: "用来指定诸如向服务运营商咨询的论坛地址,或记载了运营商联系方式之类的网页地址。" - thisSettingWillAutomaticallyOffWhenModeratorsInactive: "若在一段时间内没有检测到管理活动,为防止垃圾信息,此设定将自动关闭。" _accountMigration: moveFrom: "从别的账号迁移到此账户" moveFromSub: "为另一个账户建立别名" - moveFromLabel: "迁移前的账户 #{n}" + moveFromLabel: "迁移前的账户" moveFromDescription: "如果迁移时需要继承其他账户的关注者,你需要创建一个别名。此操作需要在迁移前完成!\n请像这样输入要迁移的账户:@username@server.example.com\n如果要删除,请将输入字段留空,并保存(不推荐)。" moveTo: "把这个账户迁移到新的账户" moveToLabel: "迁移后的账户" @@ -1655,7 +1363,7 @@ _achievements: _postedAt0min0sec: title: "报时" description: "在 0 点发布一篇帖子" - flavor: "嘟 · 嘟 · 嘟 · 哔——" + flavor: "嘣 嘣 嘣 Biu——!" _selfQuote: title: "自我引用" description: "引用了自己的帖子" @@ -1682,7 +1390,7 @@ _achievements: description: "点了这里" _justPlainLucky: title: "超高校级的幸运" - description: "每 10 秒有 0.005% 的概率自动获得" + description: "每 10 秒有 0.01 的概率自动获得" _setNameToSyuilo: title: "像神一样呐" description: "将名称设定为 syuilo" @@ -1704,8 +1412,8 @@ _achievements: flavor: "今年也请对本服务器多多指教!" _cookieClicked: title: "点击饼干小游戏" - description: "点击了饼干" - flavor: "用错软件了?" + description: "点击了可疑的饼干" + flavor: "是不是软件有问题?" _brainDiver: title: "Brain Diver" description: "发布了包含 Brain Diver 链接的帖子" @@ -1713,16 +1421,6 @@ _achievements: _smashTestNotificationButton: title: "过度测试" description: "短时间内连续测试通知" - _tutorialCompleted: - title: "Misskey 初学者课程 结业证书" - description: "完成了教学" - _bubbleGameExplodingHead: - title: "🤯" - description: "你合成出了游戏里最大的Emoji" - _bubbleGameDoubleExplodingHead: - title: "两个🤯" - description: "你合成出了2个游戏里最大的Emoji" - flavor: "大约能 装满 这些便当盒 🤯 🤯 (比划)" _role: new: "创建角色" edit: "编辑角色" @@ -1733,9 +1431,7 @@ _role: assignTarget: "授权对象" descriptionOfAssignTarget: "手动指手动选择谁被包括在这个角色中。\n符合条件指设置条件以自动包括符合条件的用户。" manual: "手动" - manualRoles: "手动角色" conditional: "符合条件" - conditionalRoles: "条件角色" condition: "条件" isConditionalRole: "这是一个条件控制的角色。" isPublic: "角色公开" @@ -1752,8 +1448,8 @@ _role: descriptionOfIsExplorable: "打开后将公开角色时间线。如果角色不是公开的,就无法公开时间线。" displayOrder: "显示顺序" descriptionOfDisplayOrder: "数字越大,显示位置越靠前。" - canEditMembersByModerator: "允许监察员编辑成员" - descriptionOfCanEditMembersByModerator: "如果选中,监察员和管理员都能够为用户分配/取消分配角色。如果未选中,则只有管理员可以执行此操作。" + canEditMembersByModerator: "允许监察者编辑成员" + descriptionOfCanEditMembersByModerator: "如果选中,监察者和管理员都能够为用户分配/取消分配角色。如果未选中,则只有管理员可以执行此操作。" priority: "优先级" _priority: low: "低" @@ -1763,16 +1459,13 @@ _role: gtlAvailable: "查看全局时间线" ltlAvailable: "查看本地时间线" canPublicNote: "允许公开发帖" - mentionMax: "帖子内最多提及数" canInvite: "发放服务器邀请码" - inviteLimit: "可生成邀请码的数量" + inviteLimit: "可发行邀请码的数量" inviteLimitCycle: "邀请码的发行间隔" inviteExpirationTime: "邀请码的有效日期" canManageCustomEmojis: "管理自定义表情符号" - canManageAvatarDecorations: "管理头像挂件" driveCapacity: "网盘容量" alwaysMarkNsfw: "总是将文件标记为 NSFW" - canUpdateBioMedia: "可以更新头像和横幅" pinMax: "帖子置顶数量限制" antennaMax: "可创建的最大天线数量" wordMuteMax: "屏蔽词的字数限制" @@ -1785,22 +1478,9 @@ _role: descriptionOfRateLimitFactor: "值越小限制越少,值越大限制越多。" canHideAds: "可以隐藏广告" canSearchNotes: "是否可以搜索帖子" - canUseTranslator: "使用翻译功能" - avatarDecorationLimit: "可添加头像挂件的最大个数" - canImportAntennas: "允许导入天线" - canImportBlocking: "允许导入拉黑列表" - canImportFollowing: "允许导入关注列表" - canImportMuting: "允许导入屏蔽列表" - canImportUserLists: "允许导入用户列表" _condition: - roleAssignedTo: "已分配给手动角色" isLocal: "是本地用户" isRemote: "是远程用户" - isCat: "猫猫用户" - isBot: "机器人用户" - isSuspended: "停用的用户" - isLocked: "锁推用户" - isExplorable: "启用“使账号可见”的用户" createdLessThan: "账户创建时间少于" createdMoreThan: "账户创建时间超过" followersLessThanOrEq: "关注者不多于" @@ -1826,7 +1506,6 @@ _emailUnavailable: disposable: "不是永久可用的地址" mx: "邮件服务器不正确" smtp: "邮件服务器没有响应" - banned: "无法使用此邮件地址注册" _ffVisibility: public: "公开" followers: "只有关注你的用户能看到" @@ -1847,10 +1526,6 @@ _ad: reduceFrequencyOfThisAd: "减少此广告的频率" hide: "不显示" timezoneinfo: "星期几是由服务器的时区所指定的。" - adsSettings: "广告设置" - notesPerOneAd: "在实时更新时间线中插入广告的间隔(帖子个数)" - setZeroToDisable: "设为 0 将不在实时更新时间线中投放广告" - adsTooClose: "广告投放时间间隔过短将可能显著损害用户体验。" _forgotPassword: enterEmail: "请输入您设置的电子邮箱地址,密码重置链接将发送至该邮箱上。" ifNoEmail: "如果您没有设置电子邮件地址,请联系管理员。" @@ -1870,7 +1545,6 @@ _plugin: installWarn: "请不要安装不可信的插件。" manage: "管理插件..." viewSource: "查看源代码" - viewLog: "显示日志" _preferencesBackups: list: "已创建的备份" saveNew: "另存为" @@ -1891,8 +1565,8 @@ _preferencesBackups: invalidFile: "无效的的文件格式。" _registry: scope: "范围" - key: "键" - keys: "键" + key: "主要" + keys: "主要" domain: "域" createKey: "创建键" _aboutMisskey: @@ -1900,13 +1574,10 @@ _aboutMisskey: contributors: "主要贡献者" allContributors: "全体贡献者" source: "源代码" - original: "原版" - thisIsModifiedVersion: "{name}正在使用修改后的 Misskey。" translation: "翻译 Misskey" donate: "赞助 Misskey" morePatrons: "还有很多其它的人也在支持我们,非常感谢🥰" patrons: "支持者" - projectMembers: "项目成员" _displayOfSensitiveMedia: respect: "隐藏敏感媒体" ignore: "显示敏感媒体" @@ -1931,7 +1602,6 @@ _channel: notesCount: "有 {n} 个帖子" nameAndDescription: "名称与描述" nameOnly: "仅名称" - allowRenoteToExternal: "允许在频道外转帖及引用" _menuDisplay: sideFull: "横向" sideIcon: "横向(图标)" @@ -2009,6 +1679,7 @@ _theme: buttonBg: "按钮背景" buttonHoverBg: "按钮背景(悬停)" inputBorder: "输入框边框" + listItemHoverBg: "下拉列表项目背景(悬停)" driveFolderBg: "网盘的文件夹背景" wallpaperOverlay: "壁纸叠加层" badge: "徽章" @@ -2020,15 +1691,8 @@ _sfx: note: "帖子" noteMy: "我的帖子" notification: "通知" - reaction: "选择回应时" -_soundSettings: - driveFile: "使用网盘内的音频" - driveFileWarn: "选择网盘上的文件" - driveFileTypeWarn: "不支持此文件" - driveFileTypeWarnDescription: "请选择音频文件" - driveFileDurationWarn: "音频过长" - driveFileDurationWarnDescription: "使用长音频可能会影响 Misskey 的使用。即使这样也要继续吗?" - driveFileError: "无法读取声音。请更改设置。" + antenna: "天线接收" + channel: "频道通知" _ago: future: "未来" justNow: "最近" @@ -2042,12 +1706,7 @@ _ago: invalid: "没有" _timeIn: seconds: "{n}秒后" - minutes: "{n} 分后" - hours: "{n} 小时后" days: "{n}天后" - weeks: "{n} 周后" - months: "{n} 月后" - years: "{n} 年后" _time: second: "秒" minute: "分" @@ -2055,33 +1714,33 @@ _time: day: "日" _2fa: alreadyRegistered: "此设备已被注册" - registerTOTP: "开始设置验证器" + registerTOTP: "开始设置认证应用" step1: "首先,在您的设备上安装验证应用,例如 {a} 或 {b}。" step2: "然后,扫描屏幕上显示的二维码。" + step2Click: "通过点击二维码,您可以使用设备上安装的身份验证器应用程序或密钥环进行注册" step2Uri: "如果使用桌面应用程序的话,请输入下面的 URI" step3Title: "输入验证码" step3: "输入您的应用提供的动态口令以完成设置。" setupCompleted: "设置完成" step4: "从现在开始,任何登录操作都将要求您提供动态口令。" securityKeyNotSupported: "您的浏览器不支持安全密钥。" - registerTOTPBeforeKey: "要注册安全密钥或 Passkey,请先设置验证器。" + registerTOTPBeforeKey: "要注册安全密钥或 Passkey,请先设置验证器应用程序。" securityKeyInfo: "注册兼容 WebAuthn 的密钥,例如支持 FIDO2 的硬件安全密钥、设备上的生物识别功能、PIN 码以及 Passkey 等。" registerSecurityKey: "注册安全密钥或 Passkey" securityKeyName: "输入密钥名称" tapSecurityKey: "请按照浏览器说明操作来注册安全密钥或 Passkey。" removeKey: "删除安全密钥" removeKeyConfirm: "您确定要删除 {name} 吗?" - whyTOTPOnlyRenew: "当注册了安全密钥时,无法取消使用验证器。" - renewTOTP: "重置验证器" - renewTOTPConfirm: "当前验证器的验证码及备用代码已失效" + whyTOTPOnlyRenew: "如果注册了安全密钥,则无法取消验证器应用程序上的设置。" + renewTOTP: "重置验证器应用程序" + renewTOTPConfirm: "当前验证器应用程序的验证码将不再有效" renewTOTPOk: "重新配置" renewTOTPCancel: "不用,谢谢" checkBackupCodesBeforeCloseThisWizard: "在关闭此窗口前,请确认下面的备用代码" backupCodes: "备用代码" - backupCodesDescription: "如果无法使用验证器,可以使用以下的备用代码来访问账户。请务必将这些代码保存在安全的地方。每个代码仅可使用一次。" - backupCodeUsedWarning: "已使用备用代码。若验证器无法使用,请尽快重置验证器。" - backupCodesExhaustedWarning: "已使用完所有的备用代码。若验证器无法使用,则无法再访问您的账户。请重置验证器。" - moreDetailedGuideHere: "此处为详细指南" + backupCodesDescription: "如果无法使用认证应用,可以使用以下的备用代码来访问账户。请务必将这些代码保存在安全的地方。每个代码仅可使用一次。" + backupCodeUsedWarning: "已使用备用代码。如果无法使用认证应用,请尽快重新设定。" + backupCodesExhaustedWarning: "已使用完所有的备用代码。如果无法使用认证应用,将无法再访问您的账户。请再次设定认证应用。" _permissions: "read:account": "查看账户信息" "write:account": "更改帐户信息" @@ -2119,54 +1778,6 @@ _permissions: "write:flash": "编辑 Play" "read:flash-likes": "查看 Play 的点赞" "write:flash-likes": "编辑 Play 的点赞列表" - "read:admin:abuse-user-reports": "查看来自用户的举报" - "write:admin:delete-account": "删除用户账户" - "write:admin:delete-all-files-of-a-user": "删除用户所有的文件" - "read:admin:index-stats": "查看数据库索引相关的信息" - "read:admin:table-stats": "查看数据库表相关的信息" - "read:admin:user-ips": "查看用户 IP 地址" - "read:admin:meta": "查看实例的元数据" - "write:admin:reset-password": "重置用户密码" - "write:admin:resolve-abuse-user-report": "将来自用户的报告标记为「已解决」" - "write:admin:send-email": "发送邮件" - "read:admin:server-info": "查看服务器信息" - "read:admin:show-moderation-log": "查看管理日志" - "read:admin:show-user": "查看用户的非公开信息" - "write:admin:suspend-user": "冻结用户" - "write:admin:unset-user-avatar": "删除用户头像" - "write:admin:unset-user-banner": "删除用户横幅" - "write:admin:unsuspend-user": "解除用户冻结" - "write:admin:meta": "编辑实例元数据" - "write:admin:user-note": "编辑管理笔记" - "write:admin:roles": "编辑角色" - "read:admin:roles": "查看角色" - "write:admin:relays": "编辑中继" - "read:admin:relays": "查看中继" - "write:admin:invite-codes": "编辑邀请码" - "read:admin:invite-codes": "查看邀请码" - "write:admin:announcements": "编辑公告" - "read:admin:announcements": "查看公告" - "write:admin:avatar-decorations": "编辑头像挂件" - "read:admin:avatar-decorations": "查看头像挂件" - "write:admin:federation": "编辑联合相关信息" - "write:admin:account": "编辑用户账户" - "read:admin:account": "查看用户相关情报" - "write:admin:emoji": "编辑表情文字" - "read:admin:emoji": "查看表情文字" - "write:admin:queue": "编辑作业队列" - "read:admin:queue": "查看作业队列相关情报" - "write:admin:promo": "运营推广说明" - "write:admin:drive": "编辑用户网盘" - "read:admin:drive": "查看用户网盘相关情报" - "read:admin:stream": "使用管理员用的 Websocket API" - "write:admin:ad": "编辑广告" - "read:admin:ad": "查看广告" - "write:invite-codes": "生成邀请码" - "read:invite-codes": "获取已发行的邀请码" - "write:clip-favorite": "编辑便签的点赞" - "read:clip-favorite": "查看便签的点赞" - "read:federation": "查看联合相关信息" - "write:report-abuse": "举报用户" _auth: shareAccessTitle: "应用程序授权许可" shareAccess: "您要授权允许 “{name}” 访问您的帐户吗?" @@ -2175,11 +1786,8 @@ _auth: permissionAsk: "这个应用程序需要以下权限" pleaseGoBack: "请返回到应用程序" callback: "回到应用程序" - accepted: "已允许访问" denied: "拒绝访问" - scopeUser: "以下面的用户进行操作" pleaseLogin: "在对应用进行授权许可之前,请先登录" - byClickingYouWillBeRedirectedToThisUrl: "允许访问后将会自动重定向到以下 URL" _antennaSources: all: "所有帖子" homeTimeline: "已关注用户的帖子" @@ -2224,7 +1832,6 @@ _widgets: _userList: chooseList: "选择列表" clicker: "点击器" - birthdayFollowings: "今天是他们的生日" _cw: hide: "隐藏" show: "查看更多" @@ -2287,21 +1894,15 @@ _profile: changeAvatar: "修改头像" changeBanner: "修改横幅" verifiedLinkDescription: "如果将内容设置为 URL,当链接所指向的网页内包含自己的个人资料链接时,可以显示一个已验证图标。" - avatarDecorationMax: "最多可添加 {max} 个挂件" - followedMessage: "被关注时显示的消息" - followedMessageDescription: "可以设置被关注时向对方显示的短消息。" - followedMessageDescriptionForLockedAccount: "需要批准才能关注的情况下,消息是在请求被批准后显示。" _exportOrImport: allNotes: "所有帖子" favoritedNotes: "收藏的帖子" - clips: "便签" followingList: "关注中" muteList: "屏蔽" blockingList: "拉黑" userLists: "列表" excludeMutingUsers: "排除屏蔽用户" excludeInactiveUsers: "排除不活跃用户" - withReplies: "在时间线中包含导入用户的回复" _charts: federation: "联合" apRequest: "请求" @@ -2348,7 +1949,6 @@ _play: title: "标题" script: "脚本" summary: "描述" - visibilityDescription: "设置为不公开后资料将不再显示,但知道 URL 的人仍可继续访问。" _pages: newPage: "创建页面" editPage: "编辑页面" @@ -2383,7 +1983,6 @@ _pages: eyeCatchingImageSet: "设置封面图片" eyeCatchingImageRemove: "删除封面图片" chooseBlock: "添加块" - enterSectionTitle: "输入会话标题" selectType: "选择类型" contentBlocks: "内容" inputBlocks: "输入" @@ -2394,8 +1993,6 @@ _pages: section: "章节" image: "图片" button: "按钮" - dynamic: "动态区块" - dynamicDescription: "这个区块已经废弃。以后请使用{play}。" note: "嵌入的帖子" _note: id: "帖子 ID" @@ -2417,20 +2014,12 @@ _notification: pollEnded: "问卷调查结果已生成。" newNote: "新的帖子" unreadAntennaNote: "天线 {name}" - roleAssigned: "授予的角色" emptyPushNotificationMessage: "推送通知已更新" achievementEarned: "获得成就" testNotification: "测试通知" checkNotificationBehavior: "检查通知显示" sendTestNotification: "发送测试通知" notificationWillBeDisplayedLikeThis: "通知将会这样表示" - reactedBySomeUsers: "{n} 人回应了" - likedBySomeUsers: "{n}人赞了你的帖子" - renotedBySomeUsers: "{n} 人转发了" - followedBySomeUsers: "被 {n} 人关注" - flushNotification: "重置通知历史" - exportOfXCompleted: "已完成 {x} 个导出" - login: "有新的登录" _types: all: "全部" note: "用户的新帖子" @@ -2443,11 +2032,7 @@ _notification: pollEnded: "问卷调查结束" receiveFollowRequest: "收到关注请求" followRequestAccepted: "关注请求已通过" - roleAssigned: "授予的角色" achievementEarned: "取得的成就" - exportCompleted: "已完成导出" - login: "登录" - test: "测试通知" app: "关联应用的通知" _actions: followBack: "回关" @@ -2457,7 +2042,6 @@ _deck: alwaysShowMainColumn: "总是显示主列" columnAlign: "列对齐" addColumn: "添加列" - newNoteNotificationSettings: "新帖子通知设定" configureColumn: "列设置" swapLeft: "向左移动" swapRight: "向右移动" @@ -2496,10 +2080,9 @@ _drivecleaner: orderByCreatedAtAsc: "按添加日期降序排列" _webhookSettings: createWebhook: "创建 Webhook" - modifyWebhook: "编辑 webhook" name: "名称" secret: "密钥" - trigger: "触发器" + events: "何时运行 Webhook" active: "已启用" _events: follow: "关注时" @@ -2509,29 +2092,6 @@ _webhookSettings: renote: "被转发时" reaction: "被回应时" mention: "被提及时" - _systemEvents: - abuseReport: "当收到举报时" - abuseReportResolved: "当举报被处理时" - userCreated: "当用户被创建时" - inactiveModeratorsWarning: "当管理员在一段时间内不活跃时" - inactiveModeratorsInvitationOnlyChanged: "当因为管理员在一段时间内不活跃,导致服务器变为邀请制时" - deleteConfirm: "要删除 webhook 吗?" - testRemarks: "点击开关右侧的按钮,可以发送使用假数据的测试 Webhook。" -_abuseReport: - _notificationRecipient: - createRecipient: "新建举报通知" - modifyRecipient: "编辑举报通知" - recipientType: "通知类型" - _recipientType: - mail: "邮箱" - webhook: "Webhook" - _captions: - mail: "当收到新举报时,向持有监察员权限的用户发送通知邮件" - webhook: "当收到新举报及举报被处理时,使用指定的 SystemWebhook 发送通知" - keywords: "关键字" - notifiedUser: "通知的用户" - notifiedWebhook: "使用的 webhook" - deleteConfirm: "要删除通知吗?" _moderationLogTypes: createRole: "创建角色" deleteRole: "删除角色" @@ -2554,186 +2114,17 @@ _moderationLogTypes: deleteGlobalAnnouncement: "删除全体通知" deleteUserAnnouncement: "删除用户通知" resetPassword: "重置密码" - suspendRemoteInstance: "停止远程服务器" - unsuspendRemoteInstance: "恢复远程服务器" - updateRemoteInstanceNote: "更新远程服务器的管理笔记" markSensitiveDriveFile: "标记网盘文件为敏感媒体" unmarkSensitiveDriveFile: "取消标记网盘文件为敏感媒体" resolveAbuseReport: "处理举报" - forwardAbuseReport: "转发举报" - updateAbuseReportNote: "更新举报用管理笔记" - createInvitation: "生成邀请码" + createInvitation: "发行邀请码" createAd: "创建了广告" deleteAd: "删除了广告" updateAd: "更新了广告" - createAvatarDecoration: "新建头像挂件" - updateAvatarDecoration: "更新头像挂件" - deleteAvatarDecoration: "删除头像挂件" - unsetUserAvatar: "清除用户头像" - unsetUserBanner: "清除用户横幅" - createSystemWebhook: "新建了 SystemWebhook" - updateSystemWebhook: "更新了 SystemWebhook" - deleteSystemWebhook: "删除了 SystemWebhook" - createAbuseReportNotificationRecipient: "新建了举报通知" - updateAbuseReportNotificationRecipient: "更新了举报通知" - deleteAbuseReportNotificationRecipient: "删除了举报通知" - deleteAccount: "删除了账户" - deletePage: "删除了页面" - deleteFlash: "删除了 Play" - deleteGalleryPost: "删除了图库稿件" _fileViewer: - title: "文件信息" - type: "文件类型" - size: "文件大小" url: "URL" uploadedAt: "添加日期" - attachedNotes: "附加到的帖子" - thisPageCanBeSeenFromTheAuthor: "此页只能被该文件的上传者查看。" _externalResourceInstaller: - title: "从外部站点安装" - checkVendorBeforeInstall: "请在安装前确保来源可靠" - _plugin: - title: "要安装此插件吗?" - metaTitle: "插件信息" - _theme: - title: "要安装此主题吗?" - metaTitle: "主题信息" - _meta: - base: "基本配色方案" - _vendorInfo: - title: "来源信息" - endpoint: "参考端点" - hashVerify: "确认文件完整性" _errors: - _invalidParams: - title: "缺少参数" - description: "缺少从外部站点获取数据所需的信息。请检查 URL。" - _resourceTypeNotSupported: - title: "不支持此外部资源" - description: "不支持从此外部站点获取的资源类型。请联系站点管理员。" - _failedToFetch: - title: "获取数据失败" - fetchErrorDescription: "与外部站点的通信失败。 如果重试后问题仍然存在,请联系站点管理员。" - parseErrorDescription: "无法读取从外部站点取得的数据。请联系站点管理员。" - _hashUnmatched: - title: "无法获取正确数据" - description: "无法验证数据的完整性。安全起见,无法继续安装。请联系站点管理员。" _pluginParseFailed: title: "AiScript 错误" - description: "虽然取得了数据,但是由于 AiScript 解析时出现错误,无法读取数据。请联系插件的作者。可在 Javascript 控制台查看错误详情。" - _pluginInstallFailed: - title: "插件安装失败" - description: "安装插件时出现错误。请再试一次。可在 Javascript 控制台查看错误详情。" - _themeParseFailed: - title: "主题解析错误" - description: "虽然取得了主题文件,但是由于解析时出现错误,无法加载主题。请联系主题的作者。可在 Javascript 控制台查看错误详情。" - _themeInstallFailed: - title: "安装主题失败" - description: "安装主题时出错。请再试一次。可在 Javascript 控制台查看错误详情。" -_dataSaver: - _media: - title: "加载媒体" - description: "防止自动加载图像和视频。 点击隐藏的图像/视频即可加载它们。\n" - _avatar: - title: "头像" - description: "停止播放头像的动画。 由于动画图片的文件大小可能比普通图像大,这可以进一步减少数据流量。" - _urlPreview: - title: "URL预览缩略图\n" - description: "将不再加载 URL 预览缩略图。" - _code: - title: "代码高亮" - description: "如果使用了代码高亮标记,例如在 MFM 中,则在点击之前不会加载。 代码高亮要求加载每种高亮语言的定义文件,由于这些文件不再自动加载,因此有望减少数据传输量。" -_hemisphere: - N: "北半球" - S: "南半球" - caption: "在某些客户端设置中用来确定季节" -_reversi: - reversi: "黑白棋" - gameSettings: "对局设置" - chooseBoard: "选择棋盘" - blackOrWhite: "先手/后手" - blackIs: "{name}执黑(先手)" - rules: "规则" - thisGameIsStartedSoon: "对局即将开始" - waitingForOther: "等待对手准备" - waitingForMe: "等待你的准备" - waitingBoth: "请准备" - ready: "准备就绪" - cancelReady: "重新准备" - opponentTurn: "对手的回合" - myTurn: "你的回合" - turnOf: "{name}的回合" - pastTurnOf: "{name}的回合" - surrender: "认输" - surrendered: "已认输" - timeout: "超时" - drawn: "平局" - won: "{name}获胜" - black: "黑" - white: "白" - total: "总计" - turnCount: "第{count}回合" - myGames: "我的对局" - allGames: "所有对局" - ended: "结束" - playing: "对局中" - isLlotheo: "落子少的一方获胜(又名奥赛罗)" - loopedMap: "循环棋盘" - canPutEverywhere: "无限制放置模式" - timeLimitForEachTurn: "1回合的时间限制" - freeMatch: "自由匹配" - lookingForPlayer: "正在寻找对手" - gameCanceled: "对局被取消了" - shareToTlTheGameWhenStart: "开始时在时间线发布对局" - iStartedAGame: "对局开始!#MisskeyReversi" - opponentHasSettingsChanged: "对手更改了设定" - allowIrregularRules: "允许非常规规则(完全自由)" - disallowIrregularRules: "禁止非常规规则" - showBoardLabels: "显示行号和列号" - useAvatarAsStone: "用头像作为棋子" -_offlineScreen: - title: "离线——无法连接到服务器" - header: "无法连接到服务器" -_urlPreviewSetting: - title: "设置 URL 预览" - enable: "启用 URL 预览" - timeout: "超时阈值(ms)" - timeoutDescription: "如果获取预览所用时间超过这个值,则不生成预览。" - maximumContentLength: "Content-Length 的最大值(byte)" - maximumContentLengthDescription: "如果 Content-Length 超过这个值,则不生成预览。" - requireContentLength: "仅在能取得 Content-Length 时生成预览" - requireContentLengthDescription: "如果目标服务器不返回 Content-Length,则不生成预览。" - userAgent: "User-Agent" - userAgentDescription: "设定获取预览时使用的 User-Agent。留空时将使用默认的 User-Agent。" - summaryProxy: "用来生成预览的代理的 endpoint。" - summaryProxyDescription: "不使用 Misskey 本体,而是通过 Summaly Proxy 生成预览。" - summaryProxyDescription2: "下面的参数将作为查询字符串发送至代理。代理侧如果不支持此设置,则忽略设定值。" -_mediaControls: - pip: "画中画" - playbackRate: "播放速度" - loop: "循环播放" -_contextMenu: - title: "上下文菜单" - app: "应用" - appWithShift: "Shift 键应用" - native: "浏览器的用户界面" -_embedCodeGen: - title: "自定义嵌入代码" - header: "显示标题" - autoload: "连续加载(不推荐)" - maxHeight: "最大高度" - maxHeightDescription: "若将最大值设为 0 则不限制最大高度。为防止小工具无限增高,建议设置一下。" - maxHeightWarn: "最大高度限制已禁用(0)。若这不是您想要的效果,请将最大高度设一个值。" - previewIsNotActual: "由于超出了预览画面可显示的范围,因此显示内容会与实际嵌入时有所不同。" - rounded: "圆角" - border: "外边框" - applyToPreview: "应用预览" - generateCode: "生成嵌入代码" - codeGenerated: "已生成代码" - codeGeneratedDescription: "将生成的代码贴到网站上来使用。" -_selfXssPrevention: - warning: "警告" - title: "「在此处粘贴什么东西」是欺诈行为。" - description1: "如果在此处粘贴了什么,恶意用户可能会接管账户或者盗取个人资料。" - description2: "如果不能完全理解将要粘贴的内容,%c 请立即停止操作并关闭这个窗口。" - description3: "详情请看这里。{link}" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index 16afeed0f8..36b6e77e9b 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -8,9 +8,6 @@ search: "搜尋" notifications: "通知" username: "使用者名稱" password: "密碼" -initialPasswordForSetup: "初始設定用的密碼" -initialPasswordIsIncorrect: "初始設定用的密碼錯誤。" -initialPasswordForSetupDescription: "如果您自己安裝了 Misskey,請使用您在設定檔中輸入的密碼。\n如果您使用 Misskey 的託管服務之類的服務,請使用提供的密碼。\n如果您尚未設定密碼,請將其留空並繼續。" forgotPassword: "忘記密碼" fetchingAsApObject: "從聯邦宇宙取得中..." ok: "OK" @@ -63,14 +60,13 @@ copyFileId: "複製檔案 ID" copyFolderId: "複製資料夾ID" copyProfileUrl: "複製個人資料網址" searchUser: "搜尋使用者" -searchThisUsersNotes: "搜尋這個使用者的貼文" reply: "回覆" loadMore: "載入更多" showMore: "載入更多" showLess: "關閉" youGotNewFollower: "您有新的追隨者" receiveFollowRequest: "您有新的追隨請求" -followRequestAccepted: "追隨請求已被接受" +followRequestAccepted: "追隨請求已接受" mention: "提及" mentions: "提及" directNotes: "私訊" @@ -95,7 +91,7 @@ manageLists: "管理清單" error: "錯誤" somethingHappened: "發生錯誤" retry: "重試" -pageLoadError: "無法載入頁面。" +pageLoadError: "載入頁面失敗" pageLoadErrorDescription: "這通常是網路錯誤或瀏覽器快取殘留而引起的。請先清除瀏覽器快取,稍後再重試。" serverIsDead: "伺服器沒有回應。請稍等片刻再試。" youShouldUpgradeClient: "請重新載入以使用新版客戶端顯示此頁面。" @@ -112,14 +108,11 @@ enterEmoji: "輸入表情符號" renote: "轉發" unrenote: "取消轉發" renoted: "轉發成功。" -renotedToX: "轉發給 {name} 了。" cantRenote: "無法轉發此貼文。" cantReRenote: "無法轉發之前已經轉發過的內容。" quote: "引用" inChannelRenote: "在頻道內轉發" inChannelQuote: "在頻道內引用" -renoteToChannel: "轉發至頻道" -renoteToOtherChannel: "轉發至其他頻道" pinnedNote: "已置頂的貼文" pinned: "置頂" you: "您" @@ -137,7 +130,6 @@ overwriteFromPinnedEmojis: "從一般複寫設定" reactionSettingDescription2: "拖動以交換,點擊以刪除,按下「+」以新增。" rememberNoteVisibility: "記住貼文可見性" attachCancel: "移除附件" -deleteFile: "刪除檔案" markAsSensitive: "標記為敏感內容" unmarkAsSensitive: "取消標記為敏感內容" enterFileName: "請輸入檔案名稱" @@ -158,7 +150,6 @@ editList: "編輯清單" selectChannel: "選擇頻道" selectAntenna: "選擇天線" editAntenna: "編輯天線" -createAntenna: "建立天線" selectWidget: "選擇小工具" editWidgets: "編輯小工具" editWidgetsExit: "完成" @@ -177,7 +168,7 @@ cacheRemoteSensitiveFilesDescription: "若停用這個設定,則不會快取 flagAsBot: "此使用者是機器人" flagAsBotDescription: "如果本帳戶是由程式控制,請啟用此選項。啟用後,會作為標示幫助其他開發者防止機器人之間產生無限互動的行為,並會調整 Misskey 內部系統將本帳戶識別為機器人。" flagAsCat: "此帳戶是一隻貓,喵~~~!!!" -flagAsCatDescription: "喵喵喵??" +flagAsCatDescription: "如果想將本帳戶標示為一隻貓,請開啟此標示" flagShowTimelineReplies: "在時間軸上顯示貼文的回覆" flagShowTimelineRepliesDescription: "啟用後,時間軸除了顯示使用者的貼文以外,還會顯示使用者對其他貼文的回覆。" autoAcceptFollowed: "自動允許來自追隨中使用者的追隨請求" @@ -185,10 +176,6 @@ addAccount: "新增帳戶" reloadAccountsList: "更新帳戶清單的資訊" loginFailed: "登入失敗" showOnRemote: "轉到所在實例顯示" -continueOnRemote: "在遠端伺服器繼續" -chooseServerOnMisskeyHub: "從 Misskey Hub 選擇伺服器" -specifyServerHost: "直接指定伺服器網域" -inputHostName: "請輸入域名" general: "一般" wallpaper: "桌布" setWallpaper: "設定桌布" @@ -199,7 +186,6 @@ followConfirm: "你真的要追隨{name}嗎?" proxyAccount: "代理帳戶" proxyAccountDescription: "代理帳戶是在特定條件下充當遠端追隨者的帳戶。例如,當使用者新增遠端使用者至其列表時,若沒有本地使用者追隨該遠端使用者,則其活動將不會傳送至伺服器,此時便會由代理帳戶代為追隨以解決問題。" host: "主機" -selectSelf: "選擇自己" selectUser: "選取使用者" recipient: "收件人" annotation: "註解" @@ -215,11 +201,10 @@ perDay: "每日" stopActivityDelivery: "停止發送活動" blockThisInstance: "封鎖此伺服器" silenceThisInstance: "禁言此伺服器" -mediaSilenceThisInstance: "將這個伺服器的媒體設為禁言" operations: "操作" software: "軟體" version: "版本" -metadata: "詮釋資料" +metadata: "元資料" withNFiles: "{n} 個檔案" monitor: "監視器" jobQueue: "佇列" @@ -237,10 +222,6 @@ blockedInstances: "已封鎖的伺服器" blockedInstancesDescription: "請逐行輸入需要封鎖的伺服器。已封鎖的伺服器將無法與本伺服器進行通訊。" silencedInstances: "被禁言的伺服器" silencedInstancesDescription: "設定要禁言的伺服器主機名稱,以換行分隔。隸屬於禁言伺服器的所有帳戶都將被視為「禁言帳戶」,只能發出「追隨請求」,而且無法提及未追隨的本地帳戶。這不會影響已封鎖的實例。" -mediaSilencedInstances: "媒體被禁言的伺服器" -mediaSilencedInstancesDescription: "設定您想要對媒體設定禁言的伺服器,以換行符號區隔。來自被媒體禁言的伺服器所屬帳戶的所有檔案都會被視為敏感檔案,且自訂表情符號不能使用。被封鎖的伺服器不受影響。" -federationAllowedHosts: "允許聯邦通訊的伺服器" -federationAllowedHostsDescription: "設定允許聯邦通訊的伺服器主機,以換行符號分隔。" muteAndBlock: "靜音和封鎖" mutedUsers: "被靜音的使用者" blockedUsers: "被封鎖的使用者" @@ -258,10 +239,10 @@ noCustomEmojis: "沒有自訂的表情符號" noJobs: "沒有任務" federating: "聯邦運作中" blocked: "已封鎖" -suspended: "停止發送" +suspended: "已凍結" all: "全部" subscribing: "訂閱中" -publishing: "發送中" +publishing: "直播中" notResponding: "沒有回應" instanceFollowing: "追隨的伺服器" instanceFollowers: "伺服器的追隨者" @@ -331,7 +312,6 @@ selectFile: "選擇檔案" selectFiles: "選擇檔案" selectFolder: "選擇資料夾" selectFolders: "選擇資料夾" -fileNotSelected: "尚未選擇檔案" renameFile: "重新命名檔案" folderName: "資料夾名稱" createFolder: "新增資料夾" @@ -339,7 +319,6 @@ renameFolder: "重新命名資料夾" deleteFolder: "刪除資料夾" folder: "資料夾" addFile: "加入附件" -showFile: "瀏覽文件" emptyDrive: "雲端硬碟為空" emptyFolder: "資料夾為空" unableToDelete: "無法刪除" @@ -359,7 +338,7 @@ reload: "重新整理" doNothing: "無視" reloadConfirm: "確定要重新整理嗎?" watch: "關注" -unwatch: "取消關注" +unwatch: "取消追隨" accept: "接受" reject: "拒絕" normal: "正常" @@ -386,7 +365,7 @@ enableRegistration: "開放新使用者註冊" invite: "邀請" driveCapacityPerLocalAccount: "每個本地使用者的雲端硬碟容量" driveCapacityPerRemoteAccount: "每個非本地用戶的雲端空間大小" -inMb: "以 MB 為單位" +inMb: "以Mbps為單位" bannerUrl: "橫幅圖片URL" backgroundImageUrl: "背景圖片的來源網址 " basicInfo: "基本資訊" @@ -398,21 +377,16 @@ pinnedClipId: "置頂的摘錄ID" pinnedNotes: "已置頂的貼文" hcaptcha: "hCaptcha" enableHcaptcha: "啟用 hCaptcha" -hcaptchaSiteKey: "hcaptchaSiteKey" -hcaptchaSecretKey: "hcaptchaSecretKey" -mcaptcha: "mCaptcha" -enableMcaptcha: "啟用 mCaptcha" -mcaptchaSiteKey: "網站金鑰" -mcaptchaSecretKey: "私密金鑰" -mcaptchaInstanceUrl: "mCaptcha 的實例網址" +hcaptchaSiteKey: "網站金鑰" +hcaptchaSecretKey: "金鑰" recaptcha: "reCAPTCHA" enableRecaptcha: "啟用 reCAPTCHA" recaptchaSiteKey: "網站金鑰" recaptchaSecretKey: "金鑰" turnstile: "Turnstile" enableTurnstile: "啟用 Turnstile" -turnstileSiteKey: "turnstileSiteKey" -turnstileSecretKey: "turnstileSecretKey" +turnstileSiteKey: "網站金鑰" +turnstileSecretKey: "金鑰" avoidMultiCaptchaConfirm: "使用多種驗證方式可能會造成干擾,您要關閉其他驗證方式嗎?您可以按「取消」保留多種驗證方式。" antennas: "天線" manageAntennas: "管理天線" @@ -420,7 +394,6 @@ name: "名稱" antennaSource: "接收來源" antennaKeywords: "包含關鍵字" antennaExcludeKeywords: "排除關鍵字" -antennaExcludeBots: "排除機器人帳戶" antennaKeywordsDescription: "空格代表「以及」(AND),換行代表「或者」(OR)" notifyAntenna: "通知有新貼文" withFileAntenna: "僅帶有附件的貼文" @@ -454,7 +427,6 @@ totpDescription: "以驗證應用程式輸入一次性密碼" moderator: "審查員" moderation: "審查" moderationNote: "管理筆記" -moderationNoteDescription: "您可以編寫僅在審查員之間共用的註解。" addModerationNote: "新增管理筆記" moderationLogs: "管理日誌" nUsersMentioned: "被 {n} 個人提及" @@ -485,16 +457,14 @@ title: "標題" text: "文字" enable: "啟用" next: "下一步" -retype: "重新輸入" +retype: "再次輸入" noteOf: "{user}的貼文" quoteAttached: "引用" quoteQuestion: "是否要引用?" -attachAsFileQuestion: "剪貼簿的文字較長。請問是否要將其以文字檔的方式附加呢?" noMessagesYet: "沒有訊息" newMessageExists: "有新的訊息" onlyOneFileCanBeAttached: "只能加入一個附件" signinRequired: "請先登入" -signinOrContinueOnRemote: "若要繼續,需前往您所在的伺服器,或者註冊並登入此伺服器" invitations: "邀請" invitationCode: "邀請碼" checking: "確認中" @@ -516,12 +486,8 @@ uiLanguage: "介面語言" aboutX: "關於{x}" emojiStyle: "表情符號的風格" native: "原生" -menuStyle: "選單風格" -style: "風格" -drawer: "側邊欄" -popup: "彈出式視窗" -showNoteActionsOnlyHover: "僅在游標停留時顯示貼文的" -showReactionsCount: "顯示貼文的反應數目" +disableDrawer: "不顯示下拉式選單" +showNoteActionsOnlyHover: "僅在游標停留時顯示貼文的操作選項" noHistory: "沒有歷史紀錄" signinHistory: "登入歷史" enableAdvancedMfm: "啟用進階 MFM" @@ -602,8 +568,6 @@ ascendingOrder: "昇冪" descendingOrder: "降冪" scratchpad: "暫存記憶體" scratchpadDescription: "AiScript 控制臺為 AiScript 的實驗環境。您可以在此編寫、執行和確認程式碼與 Misskey 互動的結果。" -uiInspector: "UI 檢查" -uiInspectorDescription: "您可以看到記憶體中存在的 UI 元件實例的清單。 UI 元件由 Ui:C: 系列函數產生。" output: "輸出" script: "腳本" disablePagesScript: "停用頁面的 AiScript 腳本" @@ -628,13 +592,13 @@ menu: "選單" divider: "分隔線" addItem: "新增項目" rearrange: "排序方式" -relays: "中繼器" -addRelay: "新增中繼器" -inboxUrl: "收件夾 URL" -addedRelays: "已加入的中繼器" +relays: "中繼" +addRelay: "新增中繼" +inboxUrl: "收件夾URL" +addedRelays: "已加入的中繼" serviceworkerInfo: "如要使用推播通知,需要啟用此選項並設定金鑰。" deletedNote: "已刪除的貼文" -invisibleNote: "私人貼文" +invisibleNote: "私密的貼文" enableInfiniteScroll: "啟用自動滾動頁面模式" visibility: "可見性" poll: "票選活動" @@ -662,7 +626,6 @@ medium: "中" small: "小" generateAccessToken: "發行存取權杖" permission: "權限" -adminPermission: "管理員權限" enableAll: "啟用全部" disableAll: "停用全部" tokenRequested: "允許存取帳戶" @@ -706,7 +669,6 @@ useGlobalSettingDesc: "啟用時,將使用帳戶通知設定。停用時,則 other: "其他" regenerateLoginToken: "重新產生登入權杖" regenerateLoginTokenDescription: "重新產生用於登入的內部權杖。一般情況下是不需要這樣做的。重新產生後,所有裝置將會被登出。" -theKeywordWhenSearchingForCustomEmoji: "這是搜尋自訂表情符號時的關鍵字" setMultipleBySeparatingWithSpace: "您可以使用空格分隔多個項目。" fileIdOrUrl: "檔案 ID 或 URL" behavior: "行為" @@ -720,12 +682,15 @@ abuseReported: "檢舉完成。感謝您的報告。" reporter: "檢舉者" reporteeOrigin: "檢舉來源" reporterOrigin: "檢舉者來源" +forwardReport: "將報告轉送給遠端實例" +forwardReportIsAnonymous: "在遠端實例上看不到您的資訊,顯示的報告者是匿名的系统帳戶。" send: "發送" +abuseMarkAsResolved: "處理完畢" openInNewTab: "在新分頁中開啟" openInSideView: "在側欄中開啟" defaultNavigationBehaviour: "預設導航" editTheseSettingsMayBreakAccount: "修改這些設定可能會毀損您的帳戶" -instanceTicker: "貼文的伺服器資訊" +instanceTicker: "貼文的實例來源" waitingFor: "等待{x}" random: "隨機" system: "系統" @@ -777,7 +742,7 @@ experimentalFeatures: "實驗中的功能" experimental: "實驗性" thisIsExperimentalFeature: "這是實驗性的功能。可能會有變更規格和不能正常動作的可能性。" developer: "開發者" -makeExplorable: "使自己的帳戶更容易被找到" +makeExplorable: "使自己的帳戶能夠在「探索」頁面中顯示" makeExplorableDescription: "如果關閉,帳戶將不會被顯示在「探索」頁面中。" showGapBetweenNotesInTimeline: "分開顯示時間軸上的貼文" duplicate: "複製" @@ -816,7 +781,7 @@ newVersionOfClientAvailable: "新版本的客戶端可用。" usageAmount: "使用量" capacity: "容量" inUse: "已使用" -editCode: "編輯程式碼" +editCode: "編輯代碼" apply: "套用" receiveAnnouncementFromInstance: "接收來自伺服器的通知" emailNotification: "郵件通知" @@ -846,7 +811,7 @@ active: "最近活躍" offline: "離線" notRecommended: "不推薦" botProtection: "Bot 防護" -instanceBlocking: "已封鎖或禁言的伺服器" +instanceBlocking: "已封鎖的實例" selectAccount: "選擇帳戶" switchAccount: "切換帳戶" enabled: "已啟用" @@ -857,7 +822,6 @@ administration: "管理" accounts: "帳戶" switch: "切換" noMaintainerInformationWarning: "尚未設定管理員訊息。" -noInquiryUrlWarning: "尚未設定聯絡表單網址。" noBotProtectionWarning: "尚未設定 Bot 防護。" configure: "設定" postToGallery: "發佈到相簿" @@ -922,7 +886,6 @@ followersVisibility: "追隨者的可見性" continueThread: "查看更多貼文" deleteAccountConfirm: "將要刪除帳戶。是否確定?" incorrectPassword: "密碼錯誤。" -incorrectTotp: "一次性密碼錯誤,或者已過期。" voteConfirm: "確定投給「{choice}」?" hide: "隱藏" useDrawerReactionPickerForMobile: "在移動設備上使用抽屜顯示" @@ -947,9 +910,6 @@ oneHour: "一小時" oneDay: "一天" oneWeek: "一週" oneMonth: "一個月" -threeMonths: "3 個月" -oneYear: "1 年" -threeDays: "3 日" reflectMayTakeTime: "可能需要一些時間才會出現效果。" failedToFetchAccountInformation: "取得帳戶資訊失敗" rateLimitExceeded: "已超過速率限制" @@ -994,7 +954,7 @@ cannotUploadBecauseNoFreeSpace: "由於雲端硬碟沒有可用空間,因此 cannotUploadBecauseExceedsFileSizeLimit: "由於超過了檔案大小的限制,無法上傳。" beta: "測試版" enableAutoSensitive: "自動 NSFW 判定" -enableAutoSensitiveDescription: "如果可行,它將使用機器學習技術判斷檔案是否需要標記為敏感。即使關閉此功能,也可能會依伺服器規則而自動啟用。" +enableAutoSensitiveDescription: "如果可用,它將使用機器學習技術判斷檔案是否需要標記為敏感。即使關閉此功能,也可能會依實例規則而自動啟用。" activeEmailValidationDescription: "主動地驗證使用者的電子郵件地址,以確定是否是一次性地址以及是否可以真正與其進行通訊。關閉時,僅檢查格式是否正確。" navbar: "導覽列" shuffle: "隨機" @@ -1004,7 +964,7 @@ pushNotification: "推播通知" subscribePushNotification: "啟用推播通知" unsubscribePushNotification: "停用推播通知" pushNotificationAlreadySubscribed: "推播通知啟用中" -pushNotificationNotSupported: "瀏覽器或伺服器不支援推播通知" +pushNotificationNotSupported: "瀏覽器或實例不支援推播通知" sendPushNotificationReadMessage: "如果已閱讀通知與訊息,就刪除推播通知" sendPushNotificationReadMessageCaption: "「{emptyPushNotificationMessage}」通知將立刻顯示。可能會更消耗裝置電池。" windowMaximize: "最大化" @@ -1022,8 +982,7 @@ show: "檢視" neverShow: "不再顯示" remindMeLater: "以後再說" didYouLikeMisskey: "您喜歡 Misskey 嗎?" -pleaseDonate: "Misskey是由{host}使用的免費軟體。請贊助我們,讓開發的工作能夠持續!" -correspondingSourceIsAvailable: "對應的原始碼可以在 {anchor} 處找到。" +pleaseDonate: "Misskey 是由 {host} 使用的免費軟體。請贊助我們,讓開發得以持續!" roles: "角色" role: "角色" noRole: "沒有角色" @@ -1051,7 +1010,6 @@ thisPostMayBeAnnoyingHome: "發佈到首頁" thisPostMayBeAnnoyingCancel: "退出" thisPostMayBeAnnoyingIgnore: "直接發佈貼文" collapseRenotes: "省略顯示已看過的轉發貼文" -collapseRenotesDescription: "將已做過反應和轉發的貼文折疊顯示。" internalServerError: "內部伺服器錯誤" internalServerErrorDescription: "內部伺服器出現意外錯誤。" copyErrorInfo: "複製錯誤資訊" @@ -1075,9 +1033,6 @@ resetPasswordConfirm: "重設密碼?" sensitiveWords: "敏感詞" sensitiveWordsDescription: "將含有設定詞彙的貼文可見性設為發送至首頁。可以用換行來進行複數的設定。" sensitiveWordsDescription2: "空格代表「以及」(AND),斜線包圍關鍵字代表使用正規表達式。" -prohibitedWords: "禁語" -prohibitedWordsDescription: "當要發布包含禁語的貼文時,會出現錯誤。可以用換行分隔來設定多個禁語。" -prohibitedWordsDescription2: "空格代表「以及」(AND),斜線包圍關鍵字代表使用正規表達式。" hiddenTags: "隱藏標籤" hiddenTagsDescription: "設定的標籤不會在趨勢中顯示,換行可以設定多個標籤。" notesSearchNotAvailable: "無法使用搜尋貼文功能。" @@ -1090,15 +1045,12 @@ retryAllQueuesConfirmTitle: "要現在重試嗎?" retryAllQueuesConfirmText: "伺服器的負荷可能會暫時增加。" enableChartsForRemoteUser: "生成遠端使用者的圖表" enableChartsForFederatedInstances: "生成遠端伺服器的圖表" -enableStatsForFederatedInstances: "取得遠端伺服器資訊" showClipButtonInNoteFooter: "新增摘錄按鈕至貼文" reactionsDisplaySize: "反應的顯示尺寸" limitWidthOfReaction: "限制反應的最大寬度,並縮小顯示尺寸。" -noteIdOrUrl: "貼文 ID 或 URL" +noteIdOrUrl: "貼文ID或URL" video: "影片" videos: "影片" -audio: "音效" -audioFiles: "音效檔案" dataSaver: "數據節省模式" accountMigration: "遷移帳戶" accountMoved: "這個使用者已遷移至新的帳戶:" @@ -1109,7 +1061,7 @@ addMemo: "新增備註" editMemo: "編輯備註" reactionsList: "反應列表" renotesList: "轉發貼文列表" -notificationDisplay: "通知" +notificationDisplay: "通知的顯示" leftTop: "左上" rightTop: "右上" leftBottom: "左下" @@ -1126,8 +1078,6 @@ preservedUsernames: "保留的使用者名稱" preservedUsernamesDescription: "換行列舉要保留的使用者名稱。此處出現的名稱將在註冊時禁用,但由管理者建立帳戶則不受此限。此外,既有的帳戶也不受影響。" createNoteFromTheFile: "由此檔案建立貼文" archive: "封存" -archived: "已封存" -unarchive: "取消封存" channelArchiveConfirmTitle: "要封存{name}嗎?" channelArchiveConfirmDescription: "封存後,將不會在頻道列表與搜尋結果中顯示,也無法發佈新貼文。" thisChannelArchived: "這個頻道已被封存。" @@ -1138,9 +1088,6 @@ preventAiLearning: "拒絕接受生成式AI的訓練" preventAiLearningDescription: "要求站外生成式 AI 不使用您發佈的內容訓練模型。此功能會使伺服器於 HTML 回應新增「noai」標籤,而因為要視乎 AI 會否遵守該標籤,所以此功能無法完全阻止所有 AI 使用您的內容。" options: "選項" specifyUser: "指定使用者" -lookupConfirm: "要查詢嗎?" -openTagPageConfirm: "要開啟標籤的頁面嗎?" -specifyHost: "指定主機" failedToPreviewUrl: "無法預覽" update: "更新" rolesThatCanBeUsedThisEmojiAsReaction: "可以使用此表情符號為反應的角色" @@ -1199,8 +1146,7 @@ showRenotes: "顯示其他人的轉發貼文" edited: "已編輯" notificationRecieveConfig: "接受通知的設定" mutualFollow: "互相追隨" -followingOrFollower: "追隨中或者追隨者" -fileAttachedOnly: "只顯示包含附件的貼文" +fileAttachedOnly: "顯示包含附件的貼文" showRepliesToOthersInTimeline: "顯示給其他人的回覆" hideRepliesToOthersInTimeline: "在時間軸上隱藏給其他人的回覆" showRepliesToOthersInTimelineAll: "在時間軸包含追隨中所有人的回覆" @@ -1208,23 +1154,16 @@ hideRepliesToOthersInTimelineAll: "在時間軸不包含追隨中所有人的回 confirmShowRepliesAll: "進行此操作後無法復原。您真的希望時間軸「包含」您目前追隨的所有人的回覆嗎?" confirmHideRepliesAll: "進行此操作後無法復原。您真的希望時間軸「不包含」您目前追隨的所有人的回覆嗎?" externalServices: "外部服務" -sourceCode: "原始碼" -sourceCodeIsNotYetProvided: "尚未提供原始碼,請洽詢管理員解決這個問題。" -repositoryUrl: "儲存庫 URL" -repositoryUrlDescription: "如果存在可公開取得原始碼的儲存庫,請輸入其 URL。 如果您按原樣使用 Misskey(不對原始碼進行任何更改),請輸入 https://github.com/misskey-dev/misskey。" -repositoryUrlOrTarballRequired: "如果儲存庫不是公開的,則必須提供 tarball。 詳細資訊請參閱 .config/example.yml。" -feedback: "意見回饋" -feedbackUrl: "意見回饋 URL" impressum: "營運者資訊" -impressumUrl: "營運者資訊 URL" +impressumUrl: "營運者資訊網址" impressumDescription: "在德國與部份地區必須要明確顯示營運者資訊。" privacyPolicy: "隱私政策" -privacyPolicyUrl: "隱私政策 URL" +privacyPolicyUrl: "隱私政策網址" tosAndPrivacyPolicy: "服務條款和隱私政策" avatarDecorations: "頭像裝飾" attach: "裝上" detach: "取下" -detachAll: "全部移除" +detachAll: "移除所有裝飾" angle: "角度" flip: "翻轉" showAvatarDecorations: "顯示頭像裝飾" @@ -1242,106 +1181,8 @@ remainingN: "剩餘:{n}" overwriteContentConfirm: "確定要覆蓋目前的內容嗎?" seasonalScreenEffect: "隨季節變換畫面的呈現" decorate: "設置頭像裝飾" -addMfmFunction: "插入 MFM 功能語法" -enableQuickAddMfmFunction: "顯示高級 MFM 選擇器" -bubbleGame: "氣泡遊戲" -sfx: "音效" -soundWillBePlayed: "將播放音效" -showReplay: "觀看重播" -replay: "重播" -replaying: "重播中" -endReplay: "退出重播" -copyReplayData: "複製重播資料" -ranking: "排行榜" -lastNDays: "過去 {n} 天" -backToTitle: "回到遊戲標題頁" -hemisphere: "您居住的地區" -withSensitive: "顯示包含敏感檔案的貼文" -userSaysSomethingSensitive: "包含 {name} 敏感檔案的貼文" -enableHorizontalSwipe: "滑動切換時間軸" -loading: "載入中" -surrender: "退出" -gameRetry: "再試一次" -notUsePleaseLeaveBlank: "如果不使用的話請留白" -useTotp: "使用一次性密碼" -useBackupCode: "使用備用驗證碼" -launchApp: "啟動 APP" -useNativeUIForVideoAudioPlayer: "使用瀏覽器的 UI 播放影片與音訊" -keepOriginalFilename: "保留原始檔名" -keepOriginalFilenameDescription: "如果關閉此設置,上傳時檔案名稱會自動替換為隨機字串。" -noDescription: "沒有說明文字" -alwaysConfirmFollow: "跟隨時總是確認" -inquiry: "聯絡我們" -tryAgain: "請再試一次。" -confirmWhenRevealingSensitiveMedia: "要顯示敏感媒體時需確認" -sensitiveMediaRevealConfirm: "這是敏感媒體。確定要顯示嗎?" -createdLists: "已建立的清單" -createdAntennas: "已建立的天線" -fromX: "自 {x}" -genEmbedCode: "產生嵌入程式碼" -noteOfThisUser: "這個使用者的貼文列表" -clipNoteLimitExceeded: "沒辦法在這個摘錄中增加更多貼文了。" -performance: "性能" -modified: "已變更" -discard: "取消" -thereAreNChanges: "有 {n} 處的變更" -signinWithPasskey: "使用密碼金鑰登入" -unknownWebAuthnKey: "未註冊的金鑰。" -passkeyVerificationFailed: "驗證金鑰失敗。" -passkeyVerificationSucceededButPasswordlessLoginDisabled: "雖然驗證金鑰成功,但是無密碼登入的方式是停用的。" -messageToFollower: "給追隨者的訊息" -target: "目標 " -testCaptchaWarning: "此功能用於 CAPTCHA 的測試。請勿在正式環境中使用。" -prohibitedWordsForNameOfUser: "禁止使用的字詞(使用者名稱)" -prohibitedWordsForNameOfUserDescription: "如果使用者名稱包含此清單中的任何字串,則拒絕重新命名使用者。 具有審查員權限的使用者不受此限制的影響。" -yourNameContainsProhibitedWords: "您嘗試更改的名稱包含禁止的字串" -yourNameContainsProhibitedWordsDescription: "名稱中包含禁止使用的字串。 如果您想使用此名稱,請聯絡您的伺服器管理員。" -thisContentsAreMarkedAsSigninRequiredByAuthor: "作者將其設定為需要登入才能顯示。" -lockdown: "鎖定" -pleaseSelectAccount: "請選擇帳戶" -_accountSettings: - requireSigninToViewContents: "須登入以顯示內容" - requireSigninToViewContentsDescription1: "必須登入才會顯示您建立的貼文等內容。可望有效防止資訊被爬蟲蒐集。" - requireSigninToViewContentsDescription2: "來自不支援 URL 預覽 (OGP)、 網頁嵌入和引用貼文的伺服器,也將停止顯示。" - requireSigninToViewContentsDescription3: "這些限制可能不適用於被聯邦發送至遠端伺服器的內容。" - makeNotesFollowersOnlyBefore: "讓過去的貼文僅對追隨者顯示" - makeNotesFollowersOnlyBeforeDescription: "啟用此功能後,超過設定的日期和時間或超過設定時間的貼文將僅對追隨者顯示。 如果您再次停用它,貼文的公開狀態也會恢復原狀。" - makeNotesHiddenBefore: "隱藏過去的貼文" - makeNotesHiddenBeforeDescription: "啟用此功能後,超過設定的日期和時間或超過設定時間的貼文將僅對自己顯示(私密化)。 如果您再次停用它,貼文的公開狀態也會恢復原狀。" - mayNotEffectForFederatedNotes: "聯邦發送至遠端伺服器的貼文可能會不受影響。" - notesHavePassedSpecifiedPeriod: "早於指定時間的貼文" - notesOlderThanSpecifiedDateAndTime: "指定時間和日期之前的貼文" -_abuseUserReport: - forward: "轉發" - forwardDescription: "以匿名系統帳戶將檢舉轉發至遠端伺服器。" - resolve: "解決" - accept: "接受" - reject: "拒絕" - resolveTutorial: "如果您已回覆正當的檢舉,請選擇「接受」以將案件標記為已解決。\n 如果檢舉的內容不正當,請選擇「拒絕」將案件標記為已解決。" -_delivery: - status: "傳送狀態" - stop: "停止發送" - resume: "恢復發送" - _type: - none: "發送中" - manuallySuspended: "手動暫停中" - goneSuspended: "因為伺服器刪除所以暫停中" - autoSuspendedForNotResponding: "因為伺服器沒有回應所以暫停中" -_bubbleGame: - howToPlay: "玩法說明" - hold: "保留" - _score: - score: "分數" - scoreYen: "賺取的金額" - highScore: "最高分" - maxChain: "最大結合數" - yen: "{yen}円" - estimatedQty: "{qty}個" - scoreSweets: "飯糰 {onigiriQtyWithUnit}" - _howToPlay: - section1: "調整位置並將物體放入盒子中。" - section2: "當相同類型的物體黏在一起時,它們會變成不同的物體,您就會得到分數。" - section3: "如果物體從盒子裡溢出,遊戲就結束了。透過融合物體而不溢出盒子來獲得高分!" +addMfmFunction: "插入MFM功能語法" +enableQuickAddMfmFunction: "顯示高級MFM選擇器" _announcement: forExistingUsers: "僅限既有的使用者" forExistingUsersDescription: "啟用代表僅向現存使用者顯示;停用代表張貼後註冊的新使用者也會看到。" @@ -1351,7 +1192,7 @@ _announcement: tooManyActiveAnnouncementDescription: "有過多公告可能會影響使用者體驗。請考慮歸檔已結束的公告。" readConfirmTitle: "標記為已讀嗎?" readConfirmText: "閱讀「{title}」的內容並標記為已讀。" - shouldNotBeUsedToPresentPermanentInfo: "為了避免損害新用戶的使用體驗,建議使用公告來發布即時性的訊息,而不是用於固定不變的資訊。" + shouldNotBeUsedToPresentPermanentInfo: "由於可能會破壞使用者體驗,尤其是對於新使用者而言,我們建議使用公告來發布有時效性的資訊而不是固定不變的資訊。" dialogAnnouncementUxWarn: "如果同時有 2 個以上對話方塊形式的公告存在,對於使用者體驗很可能會有不良的影響,因此建議謹慎使用。" silence: "不發送通知" silenceDescription: "啟用此選項後,將不會發送此公告的通知,並且無需將其標記為已讀。" @@ -1363,7 +1204,7 @@ _initialAccountSetting: privacySetting: "隱私設定" theseSettingsCanEditLater: "這裡的設定可以在之後變更。" youCanEditMoreSettingsInSettingsPageLater: "除此之外,還可以在「設定」頁面進行各種設定。之後請確認看看。" - followUsers: "為了構築時間軸,試著追隨您感興趣的使用者吧。" + followUsers: "為了構築時間軸,試著追蹤您感興趣的使用者吧。" pushNotificationDescription: "啟用推送通知,就可以在設備上接收{name}的通知。" initialAccountSettingCompleted: "初始設定完成了!" haveFun: "盡情享受{name}吧!" @@ -1418,7 +1259,7 @@ _initialTutorial: title: "隱藏內容(CW)" description: "將顯示「註釋」中寫入的內容而不是本文。按一下「顯示內容」以顯示本文。" _exampleNote: - cw: "注意消夜文" + cw: "美食恐怖主義注意" note: "我吃了一個巧克力甜甜圈🍩😋" useCases: "伺服器的服務條款可能會規範特定的貼文需要使用隱藏內容,除此之外也會用在隱藏劇情洩漏與敏感內容的貼文。" _howToMakeAttachmentsSensitive: @@ -1443,7 +1284,7 @@ _serverRules: _serverSettings: iconUrl: "圖示的 URL" appIconDescription: "指定顯示 {host} 為應用程式時的圖示。" - appIconUsageExample: "例如:PWA 或是在手機桌面作為書籤等" + appIconUsageExample: "例如:漸進式網路應用程式(PWA)、於手機桌面新增書籤" appIconStyleRecommendation: "因為可能會裁剪成圓形或圓角,所以建議用單色填滿邊框及背景。" appIconResolutionMustBe: "解析度必須為 {resolution}。" manifestJsonOverride: "覆寫 manifest.json" @@ -1452,14 +1293,10 @@ _serverSettings: fanoutTimelineDescription: "如果啟用的話,檢索各個時間軸的性能會顯著提昇,資料庫的負荷也會減少。不過,Redis 的記憶體使用量會增加。如果伺服器的記憶體容量比較少或者運行不穩定,可以停用。" fanoutTimelineDbFallback: "資料庫的回退" fanoutTimelineDbFallbackDescription: "若啟用,在時間軸沒有快取的情況下將執行回退處理以額外查詢資料庫。若停用,可以透過不執行回退處理來進一步減少伺服器的負荷,但會限制可取得的時間軸範圍。" - reactionsBufferingDescription: "啟用時,可以顯著提高建立反應時的效能並減少資料庫的負載。 但是,Redis 記憶體使用量會增加。" - inquiryUrl: "聯絡表單網址" - inquiryUrlDescription: "指定伺服器運營者的聯絡表單網址,或包含運營者聯絡資訊網頁的網址。" - thisSettingWillAutomaticallyOffWhenModeratorsInactive: "為了防止 spam,如果一段期間內沒有偵測到審查員的活動,此設定將自動關閉。" _accountMigration: moveFrom: "從其他帳戶遷移到這個帳戶" moveFromSub: "為另一個帳戶建立別名" - moveFromLabel: "要遷移過來的帳戶 #{n}" + moveFromLabel: "要遷移過來的帳戶:" moveFromDescription: "如果你想把追隨者從別的帳戶遷移過來,必須先在這裡建立別名。請務必在執行遷移之前建立別名!請像這樣輸入要遷移的帳戶:@person@instance.com" moveTo: "將這個帳戶遷移至新的帳戶" moveToLabel: "要遷移到的帳戶:" @@ -1469,7 +1306,7 @@ _accountMigration: startMigration: "遷移" migrationConfirm: "確定要將這個帳戶遷移至 {account} 嗎?一旦遷移就無法撤銷,也就無法以原來的狀態使用這個帳戶。\n另外,請確認在要遷移到的帳戶已經建立了一個別名。" movedAndCannotBeUndone: "帳戶已遷移。\n遷移無法撤消。" - postMigrationNote: "取消追蹤此帳戶將在遷移操作後 24 小時執行。\n 此帳戶有 0 個關注者/關注者。 您的關注者仍然可以看到此帳戶的關注者帖子,因為您不會被取消關注。" + postMigrationNote: "在完成遷移的 24 小時後解除此帳戶的追隨。此帳戶的追隨中、追隨者數量變為 0。由於不會解除追隨者,你的追隨者仍然可以繼續檢視這個帳戶發布給追隨者的貼文。" movedTo: "要遷移到的帳戶:" _achievements: earnedAt: "獲得日期" @@ -1589,7 +1426,7 @@ _achievements: _markedAsCat: title: "我是貓" description: "已將帳戶設定為貓" - flavor: "沒有名字。" + flavor: "還沒有名字。" _following1: title: "首次追隨" description: "首次追隨了" @@ -1603,7 +1440,7 @@ _achievements: title: "一百位朋友" description: "追隨超過100人了" _following300: - title: "朋友太多" + title: "朋友過多" description: "追隨超過300人了" _followers1: title: "第一個追隨者" @@ -1655,7 +1492,7 @@ _achievements: _postedAt0min0sec: title: "報時" description: "在零分零秒發佈貼文" - flavor: "啵.啵.啵.嗶ー" + flavor: "啵、啵、啵、嗶ーー" _selfQuote: title: "自我引用" description: "引用了自己的貼文" @@ -1664,7 +1501,7 @@ _achievements: description: "首頁時間軸在一分鐘內出現超過二十篇貼文" _viewInstanceChart: title: "分析師" - description: "顯示了伺服器的圖表" + description: "顯示了實例的圖表" _outputHelloWorldOnScratchpad: title: "Hello, world!" description: "在 AiScript 控制臺輸出了「hello world」" @@ -1716,20 +1553,13 @@ _achievements: _tutorialCompleted: title: "Misskey新手講座 結業證書" description: "已完成教學課程" - _bubbleGameExplodingHead: - title: "🤯" - description: "氣泡遊戲中最大的物體出現了" - _bubbleGameDoubleExplodingHead: - title: "雙重🤯" - description: "氣泡遊戲中最大的物體同時出現了兩個" - flavor: "這樣大小的便當盒,用 🤯 🤯 稍微裝滿一些吧" _role: new: "建立角色" edit: "編輯角色" name: "角色名稱" description: "角色描述 " permission: "角色的權限" - descriptionOfPermission: "審查員執行與審查相關的基本操作。\n管理員能變更伺服器的全部設定。" + descriptionOfPermission: "審查員執行與審查相關的基本操作。\n管理員能變更實例的全部設定" assignTarget: "指派目標" descriptionOfAssignTarget: "手動是以手動管理這個角色包含的人員。\n符合條件是設定條件以自動包含符合條件的使用者。" manual: "手動" @@ -1745,7 +1575,7 @@ _role: baseRole: "基本角色" useBaseValue: "使用基本角色的值" chooseRoleToAssign: "選擇要指派的角色" - iconUrl: "圖示的 URL" + iconUrl: "圖示的URL" asBadge: "顯示為徽章" descriptionOfAsBadge: "開啟的話,角色圖示會顯示在使用者名稱旁邊。" isExplorable: "讓使用者更容易找到您" @@ -1763,8 +1593,7 @@ _role: gtlAvailable: "瀏覽全域時間軸" ltlAvailable: "瀏覽本地時間軸" canPublicNote: "允許公開貼文" - mentionMax: "貼文內的最大提及數" - canInvite: "發行伺服器邀請碼" + canInvite: "發行實例邀請碼" inviteLimit: "可建立邀請碼的數量" inviteLimitCycle: "邀請碼的發放間隔" inviteExpirationTime: "邀請碼的有效日期" @@ -1772,7 +1601,6 @@ _role: canManageAvatarDecorations: "管理頭像裝飾" driveCapacity: "雲端硬碟容量" alwaysMarkNsfw: "總是將檔案標記為NSFW" - canUpdateBioMedia: "允許更新大頭貼和橫幅" pinMax: "置頂貼文的最大數量" antennaMax: "可建立的天線數量" wordMuteMax: "靜音文字的最大字數" @@ -1787,20 +1615,9 @@ _role: canSearchNotes: "可否搜尋貼文" canUseTranslator: "使用翻譯功能" avatarDecorationLimit: "頭像裝飾的最大設置量" - canImportAntennas: "允許匯入天線" - canImportBlocking: "允許匯入封鎖名單" - canImportFollowing: "允許匯入跟隨名單" - canImportMuting: "允許匯入靜音名單" - canImportUserLists: "允許匯入清單" _condition: - roleAssignedTo: "手動指派角色完成" isLocal: "本地使用者" isRemote: "遠端使用者" - isCat: "貓使用者" - isBot: "機器人使用者" - isSuspended: "被停權的使用者" - isLocked: "上鎖的使用者" - isExplorable: "開啟了「使您的帳戶更容易被找到」功能的使用者" createdLessThan: "帳戶加入時間不超過" createdMoreThan: "帳戶加入時間已超過" followersLessThanOrEq: "追隨者人數在~以下" @@ -1854,7 +1671,7 @@ _ad: _forgotPassword: enterEmail: "請輸入您的帳戶註冊的電子郵件地址。 密碼重置連結將被發送到該電子郵件地址。" ifNoEmail: "如果您還沒有註冊您的電子郵件地址,請聯繫管理員。 " - contactAdmin: "本伺服器不支援電子郵件,請聯繫您的管理員重置您的密碼。 " + contactAdmin: "此實例不支持電子郵件,請聯繫您的管理員重置您的密碼。 " _gallery: my: "我的貼文" liked: "喜歡的貼文" @@ -1870,7 +1687,6 @@ _plugin: installWarn: "請不要安裝來源不明的外掛。" manage: "管理外掛" viewSource: "檢視原始碼" - viewLog: "顯示記錄 " _preferencesBackups: list: "已備份的設定檔" saveNew: "另存新檔" @@ -1900,8 +1716,6 @@ _aboutMisskey: contributors: "主要貢獻者" allContributors: "全體貢獻人員" source: "原始碼" - original: "原始" - thisIsModifiedVersion: "{name} 使用原始 Misskey 的修改版本。" translation: "翻譯 Misskey" donate: "贊助 Misskey" morePatrons: "還有許許多多幫助我們的其他人,非常感謝你們。 🥰" @@ -1929,7 +1743,7 @@ _channel: following: "追隨中" usersCount: "有 {n} 人參與" notesCount: "有 {n} 篇貼文" - nameAndDescription: "名稱" + nameAndDescription: "名稱與說明" nameOnly: "僅名稱" allowRenoteToExternal: "允許在頻道外轉發和引用" _menuDisplay: @@ -1944,8 +1758,8 @@ _wordMute: _instanceMute: instanceMuteDescription: "包括對被靜音伺服器上的使用者的回覆,被設定的伺服器上所有貼文及轉發都會被靜音。" instanceMuteDescription2: "設定時以換行進行分隔" - title: "將隱藏被設定的伺服器貼文。" - heading: "將伺服器靜音" + title: "將隱藏被設定的實例貼文。" + heading: "將實例靜音" _theme: explore: "探索佈景主題" install: "安裝佈景主題" @@ -1959,7 +1773,7 @@ _theme: invalid: "佈景主題格式錯誤" make: "製作佈景主題" base: "基於" - addConstant: "新增常數" + addConstant: "添加常數" constant: "常數" defaultValue: "預設值" color: "顏色" @@ -2009,6 +1823,7 @@ _theme: buttonBg: "按鈕背景" buttonHoverBg: "按鈕背景 (漂浮)" inputBorder: "輸入框邊框" + listItemHoverBg: "列表物品背景 (漂浮)" driveFolderBg: "雲端硬碟文件夾背景" wallpaperOverlay: "壁紙覆蓋層" badge: "徽章" @@ -2020,6 +1835,8 @@ _sfx: note: "貼文" noteMy: "我的貼文" notification: "通知" + antenna: "天線接收" + channel: "頻道通知" reaction: "選擇反應時" _soundSettings: driveFile: "使用雲端硬碟的音效檔案" @@ -2028,26 +1845,25 @@ _soundSettings: driveFileTypeWarnDescription: "請選擇音效檔案" driveFileDurationWarn: "音效太長了" driveFileDurationWarnDescription: "使用長音效檔可能會影響 Misskey 的使用體驗。仍要使用此檔案嗎?" - driveFileError: "無法載入語音。請變更設定" _ago: future: "未來" justNow: "剛剛" - secondsAgo: "{n}秒前" - minutesAgo: "{n}分鐘前" - hoursAgo: "{n}小時前" - daysAgo: "{n}天前" - weeksAgo: "{n}周前" - monthsAgo: "{n}個月前" - yearsAgo: "{n}年前" + secondsAgo: "{n} 秒前" + minutesAgo: "{n} 分鐘前 " + hoursAgo: "{n} 小時前" + daysAgo: "{n} 天前" + weeksAgo: "{n} 週前" + monthsAgo: "{n} 個月前" + yearsAgo: "{n} 年前" invalid: "無" _timeIn: - seconds: "{n}秒後" - minutes: "{n}分鐘後" - hours: "{n}小時後" - days: "{n}天後" - weeks: "{n}周後" - months: "{n}個月後" - years: "{n}年後" + seconds: "{n} 秒後" + minutes: "{n} 分後" + hours: "{n} 小時後" + days: "{n} 日後" + weeks: "{n} 週後" + months: "{n} 個月後" + years: "{n} 年後" _time: second: "秒" minute: "分鐘" @@ -2058,6 +1874,7 @@ _2fa: registerTOTP: "開始設定驗證應用程式" step1: "首先,在您的裝置上安裝驗證程式,例如 {a} 或 {b}。" step2: "然後,掃描螢幕上的 QR 碼。" + step2Click: "您可以點擊 QR 碼,以使用裝置上的驗證應用程式或金鑰環註冊。" step2Uri: "使用桌面版應用程式時,請輸入以下的 URI" step3Title: "輸入驗證碼" step3: "輸入應用程式所提供的權杖以完成設定。" @@ -2081,7 +1898,6 @@ _2fa: backupCodesDescription: "如果驗證應用程式不能用了,可以使用以下的備用驗證碼存取您的帳戶。請務必妥善保管這個驗證碼。每個驗證碼只能使用一次。" backupCodeUsedWarning: "已使用備用驗證碼。如果無法使用驗證應用程式,請盡快重新設定。" backupCodesExhaustedWarning: "已使用所有備用驗證碼。如果無法使用驗證應用程式,則將無法再存取您的帳戶。請重新設定您的驗證應用程式。" - moreDetailedGuideHere: "請點擊此處查看詳細說明。" _permissions: "read:account": "查看我的帳戶資訊" "write:account": "更改我的帳戶資訊" @@ -2111,62 +1927,14 @@ _permissions: "write:user-groups": "編輯使用者群組" "read:channels": "已查看的頻道" "write:channels": "編輯頻道" - "read:gallery": "瀏覽相簿" - "write:gallery": "編輯相簿" - "read:gallery-likes": "瀏覽相簿的讚" - "write:gallery-likes": "編輯相簿的讚" + "read:gallery": "瀏覽圖庫" + "write:gallery": "操作圖庫" + "read:gallery-likes": "讀取喜歡的圖片" + "write:gallery-likes": "操作喜歡的圖片" "read:flash": "檢視 Play" "write:flash": "編輯 Play" "read:flash-likes": "檢視 Play 的讚" "write:flash-likes": "編輯 Play 的讚" - "read:admin:abuse-user-reports": "查看來自使用者的檢舉" - "write:admin:delete-account": "刪除使用者帳戶" - "write:admin:delete-all-files-of-a-user": "刪除使用者的所有檔案" - "read:admin:index-stats": "查看資料庫索引的相關資訊" - "read:admin:table-stats": "查看資料庫表格的相關資訊" - "read:admin:user-ips": "查看使用者的 IP 位址" - "read:admin:meta": "查看實例的詮釋資料" - "write:admin:reset-password": "重設使用者的密碼" - "write:admin:resolve-abuse-user-report": "解決來自使用者的檢舉" - "write:admin:send-email": "發送郵件" - "read:admin:server-info": "查看伺服器的資訊" - "read:admin:show-moderation-log": "查看審查紀錄" - "read:admin:show-user": "查看使用者的私密資訊" - "write:admin:suspend-user": "凍結使用者" - "write:admin:unset-user-avatar": "刪除使用者的頭像" - "write:admin:unset-user-banner": "刪除使用者的橫幅" - "write:admin:unsuspend-user": "解除凍結使用者" - "write:admin:meta": "編輯實例的詮釋資料" - "write:admin:user-note": "編輯審查筆記" - "write:admin:roles": "編輯角色" - "read:admin:roles": "查看角色" - "write:admin:relays": "編輯中繼器" - "read:admin:relays": "查看中繼器" - "write:admin:invite-codes": "編輯邀請碼" - "read:admin:invite-codes": "查看邀請碼" - "write:admin:announcements": "編輯公告" - "read:admin:announcements": "查看公告" - "write:admin:avatar-decorations": "編輯頭像裝飾" - "read:admin:avatar-decorations": "查看頭像裝飾" - "write:admin:federation": "編輯站台聯邦的相關資訊" - "write:admin:account": "編輯使用者帳戶" - "read:admin:account": "查看使用者的相關資訊" - "write:admin:emoji": "編輯表情符號" - "read:admin:emoji": "查看表情符號" - "write:admin:queue": "編輯工作佇列" - "read:admin:queue": "查看工作佇列的相關資訊" - "write:admin:promo": "編輯推廣貼文" - "write:admin:drive": "編輯使用者的雲端硬碟" - "read:admin:drive": "查看使用者雲端硬碟的相關資訊" - "read:admin:stream": "使用管理員的 Websocket API" - "write:admin:ad": "編輯廣告" - "read:admin:ad": "查看廣告" - "write:invite-codes": "建立邀請碼" - "read:invite-codes": "取得邀請碼" - "write:clip-favorite": "編輯摘錄的讚" - "read:clip-favorite": "查看摘錄的讚" - "read:federation": "查看站台聯邦的相關資訊" - "write:report-abuse": "檢舉違規行為" _auth: shareAccessTitle: "應用程式的存取權限" shareAccess: "要授權「“{name}”」存取您的帳戶嗎?" @@ -2175,11 +1943,8 @@ _auth: permissionAsk: "此應用程式需要以下權限" pleaseGoBack: "請返回至應用程式" callback: "回到應用程式" - accepted: "已授予存取權限" denied: "拒絕訪問" - scopeUser: "以下列使用者身分操作" pleaseLogin: "必須登入以提供應用程式的存取權限。" - byClickingYouWillBeRedirectedToThisUrl: "如果授予存取權限,就會自動導向到以下的網址" _antennaSources: all: "全部貼文" homeTimeline: "來自已追隨使用者的貼文" @@ -2187,16 +1952,16 @@ _antennaSources: userList: "來自特定清單中的貼文" userBlacklist: "除指定使用者外的所有貼文" _weekday: - sunday: "星期天" - monday: "星期一" - tuesday: "星期二" - wednesday: "星期三" - thursday: "星期四" - friday: "星期五" - saturday: "星期六" + sunday: "週日" + monday: "週一" + tuesday: "週二" + wednesday: "週三" + thursday: "週四" + friday: "週五" + saturday: "週六" _widgets: profile: "個人檔案" - instanceInfo: "伺服器資訊" + instanceInfo: "實例資訊" memo: "備忘錄" notifications: "通知" timeline: "時間軸" @@ -2210,7 +1975,7 @@ _widgets: digitalClock: "電子時鐘" unixClock: "UNIX 時間" federation: "聯邦宇宙" - instanceCloud: "伺服器雲" + instanceCloud: "實例雲" postForm: "發文視窗" slideshow: "幻燈片" button: "按鈕" @@ -2242,8 +2007,8 @@ _poll: deadlineDate: "截止日期" deadlineTime: "小時" duration: "時長" - votesCount: "{n}票" - totalVotes: "合計 {n} 票" + votesCount: "{n} 票" + totalVotes: "一共{n}票" vote: "投票" showResult: "顯示結果" voted: "已投票" @@ -2262,7 +2027,7 @@ _visibility: specified: "指定使用者" specifiedDescription: "僅發布至指定使用者" disableFederation: "停用聯邦" - disableFederationDescription: "不發送到其他伺服器" + disableFederationDescription: "不要傳遞給其他實例" _postForm: replyPlaceholder: "回覆此貼文..." quotePlaceholder: "引用此貼文..." @@ -2275,7 +2040,7 @@ _postForm: e: "寫些什麼吧……" f: "靜待發文……" _profile: - name: "名字" + name: "名稱" username: "使用者名稱" description: "關於我" youCanIncludeHashtags: "你也可以在「關於我」中加上 #tag" @@ -2288,13 +2053,9 @@ _profile: changeBanner: "變更橫幅圖像" verifiedLinkDescription: "如果輸入包含您個人資料的網站 URL,欄位旁邊將出現驗證圖示。" avatarDecorationMax: "最多可以設置 {max} 個裝飾。" - followedMessage: "被追隨時的訊息" - followedMessageDescription: "可以設定被追隨時顯示給對方的訊息。" - followedMessageDescriptionForLockedAccount: "如果追隨是需要審核的話,在允許追隨請求之後顯示。" _exportOrImport: allNotes: "所有貼文" favoritedNotes: "「我的最愛」貼文" - clips: "摘錄" followingList: "追隨中" muteList: "靜音" blockingList: "封鎖" @@ -2306,12 +2067,12 @@ _charts: federation: "聯邦宇宙" apRequest: "請求" usersIncDec: "使用者增減" - usersTotal: "使用者合計" + usersTotal: "使用者總數" activeUsers: "活躍使用者" notesIncDec: "貼文増減" localNotesIncDec: "本地貼文増減" remoteNotesIncDec: "遠端貼文數目增减" - notesTotal: "貼文總數" + notesTotal: "貼文合共" filesIncDec: "檔案增減" filesTotal: "檔案總數" storageUsageIncDec: "儲存空間增減" @@ -2336,10 +2097,10 @@ _timelines: _play: new: "新增 Play" edit: "編輯 Play" - created: "已新增 Play " - updated: "已更新 Play " + created: "已新增Play " + updated: "已更新Play " deleted: "已刪除 Play" - pageSetting: "Play 設定" + pageSetting: "Play設定" editThisPage: "編輯此 Play" viewSource: "檢視原始碼" my: "自己的 Play" @@ -2348,11 +2109,10 @@ _play: title: "標題" script: "腳本" summary: "描述" - visibilityDescription: "如果您將其設為私密,它將不再顯示在您的個人資料中,但知道該 URL 的人仍然可以存取它。" _pages: newPage: "建立頁面" editPage: "編輯頁面" - readPage: "正在檢視原始碼" + readPage: "正檢視原始碼" created: "頁面已建立" updated: "頁面已更新" deleted: "頁面已被刪除" @@ -2379,11 +2139,10 @@ _pages: hideTitleWhenPinned: "被置頂於個人資料時隱藏頁面標題" font: "字型" fontSerif: "襯線體" - fontSansSerif: "黑體" + fontSansSerif: "無襯線體" eyeCatchingImageSet: "設定封面影像" eyeCatchingImageRemove: "刪除封面影像" chooseBlock: "新增方塊" - enterSectionTitle: "輸入區段的標題" selectType: "選擇類型" contentBlocks: "內容" inputBlocks: "輸入" @@ -2394,8 +2153,6 @@ _pages: section: "區段" image: "圖片" button: "按鈕" - dynamic: "動態方塊" - dynamicDescription: "這個方塊已經廢止,現在開始請使用 {play}。" note: "嵌式貼文" _note: id: "貼文ID" @@ -2425,19 +2182,15 @@ _notification: sendTestNotification: "發送測試通知" notificationWillBeDisplayedLikeThis: "通知會以這樣的方式顯示" reactedBySomeUsers: "{n}人做出了反應" - likedBySomeUsers: "{n} 人按了讚" renotedBySomeUsers: "{n}人做了轉發" followedBySomeUsers: "被{n}人追隨了" - flushNotification: "重置通知歷史紀錄" - exportOfXCompleted: "{x} 的匯出已完成。" - login: "已登入" _types: all: "全部 " note: "使用者的最新貼文" follow: "追隨中" mention: "提及" reply: "回覆" - renote: "轉發" + renote: "轉發貼文" quote: "引用" reaction: "反應" pollEnded: "問卷調查結束" @@ -2445,9 +2198,6 @@ _notification: followRequestAccepted: "追隨請求已接受" roleAssigned: "已授予角色" achievementEarned: "獲得成就" - exportCompleted: "已完成匯出。" - login: "登入" - test: "通知測試" app: "應用程式通知" _actions: followBack: "追隨回去" @@ -2457,7 +2207,6 @@ _deck: alwaysShowMainColumn: "總是顯示主欄" columnAlign: "對齊欄位" addColumn: "新增欄位" - newNoteNotificationSettings: "新貼文通知的設定" configureColumn: "欄位的設定" swapLeft: "向左移動" swapRight: "向右移動" @@ -2496,10 +2245,9 @@ _drivecleaner: orderByCreatedAtAsc: "按新增日期降序排列" _webhookSettings: createWebhook: "建立 Webhook" - modifyWebhook: "編輯 Webhook" - name: "名字" + name: "名稱" secret: "密鑰" - trigger: "觸發器" + events: "何時運行 Webhook" active: "已啟用" _events: follow: "當你追隨時" @@ -2509,29 +2257,6 @@ _webhookSettings: renote: "當被轉發時" reaction: "當獲得反應時" mention: "當被提到時" - _systemEvents: - abuseReport: "當使用者檢舉時" - abuseReportResolved: "當處理了使用者的檢舉時" - userCreated: "使用者被新增時" - inactiveModeratorsWarning: "當審查員在一段時間內沒有活動時" - inactiveModeratorsInvitationOnlyChanged: "當審查員在一段時間內不活動時,系統會將模式變更為邀請制" - deleteConfirm: "請問是否要刪除 Webhook?" - testRemarks: "按下切換開關右側的按鈕,就會將假資料發送至 Webhook。" -_abuseReport: - _notificationRecipient: - createRecipient: "新增接收檢舉的通知對象" - modifyRecipient: "編輯接收檢舉的通知對象" - recipientType: "通知對象的種類" - _recipientType: - mail: "電子郵件" - webhook: "Webhook" - _captions: - mail: "寄送到擁有監察員權限的使用者電子郵件地址(僅在收到檢舉時)" - webhook: "向指定的 SystemWebhook 發送通知(在收到檢舉和解決檢舉時發送)" - keywords: "關鍵字" - notifiedUser: "通知的使用者" - notifiedWebhook: "使用的 Webhook" - deleteConfirm: "確定要刪除通知對象嗎?" _moderationLogTypes: createRole: "新增角色" deleteRole: "刪除角色 " @@ -2544,7 +2269,7 @@ _moderationLogTypes: updateCustomEmoji: "更新自訂表情符號" deleteCustomEmoji: "刪除自訂表情符號" updateServerSettings: "更新伺服器設定" - updateUserNote: "更新了使用者的管理筆記" + updateUserNote: "更新管理筆記" deleteDriveFile: "刪除檔案" deleteNote: "刪除貼文" createGlobalAnnouncement: "建立全網通知" @@ -2556,12 +2281,9 @@ _moderationLogTypes: resetPassword: "重設密碼" suspendRemoteInstance: "封鎖遠端伺服器" unsuspendRemoteInstance: "解除封鎖遠端伺服器" - updateRemoteInstanceNote: "更新了遠端伺服器的管理筆記" markSensitiveDriveFile: "標記為敏感檔案" unmarkSensitiveDriveFile: "撤銷標記為敏感檔案" resolveAbuseReport: "解決檢舉" - forwardAbuseReport: "轉發檢舉" - updateAbuseReportNote: "更新檢舉的審查備註" createInvitation: "建立邀請碼" createAd: "建立廣告" deleteAd: "刪除廣告" @@ -2571,16 +2293,6 @@ _moderationLogTypes: deleteAvatarDecoration: "刪除頭像裝飾" unsetUserAvatar: "移除使用者的大頭貼" unsetUserBanner: "移除使用者的橫幅圖像" - createSystemWebhook: "建立 SystemWebhook" - updateSystemWebhook: "更新 SystemWebhook" - deleteSystemWebhook: "刪除 SystemWebhook" - createAbuseReportNotificationRecipient: "建立接收檢舉的通知對象" - updateAbuseReportNotificationRecipient: "更新接收檢舉的通知對象" - deleteAbuseReportNotificationRecipient: "刪除接收檢舉的通知對象" - deleteAccount: "刪除帳戶" - deletePage: "刪除頁面" - deleteFlash: "刪除 Play" - deleteGalleryPost: "刪除相簿的貼文" _fileViewer: title: "檔案詳細資訊" type: "檔案類型 " @@ -2643,97 +2355,3 @@ _dataSaver: _code: title: "程式碼突出顯示" description: "如果使用了 MFM 的程式碼突顯標記,則在點擊之前不會載入。程式碼突顯要求加載每種程式語言的突顯定義檔案,但由於這些檔案不再自動載入,因此有望減少資料流量。" -_hemisphere: - N: "北半球" - S: "南半球" - caption: "在某些客戶端的設定中,用於判斷季節。" -_reversi: - reversi: "黑白棋" - gameSettings: "對弈設定" - chooseBoard: "選擇棋盤" - blackOrWhite: "先手/後手" - blackIs: "{name} 為黑棋(先攻)" - rules: "規則" - thisGameIsStartedSoon: "對弈即將開始" - waitingForOther: "等待對手準備就緒" - waitingForMe: "等待您準備就緒" - waitingBoth: "請準備" - ready: "準備就緒" - cancelReady: "重新準備" - opponentTurn: "對手的回合" - myTurn: "您的回合" - turnOf: "{name} 的回合" - pastTurnOf: "{name} 的回合" - surrender: "認輸" - surrendered: "對手認輸" - timeout: "時間到" - drawn: "平手" - won: "{name} 獲勝" - black: "黑" - white: "白" - total: "合計" - turnCount: "{count} 回合" - myGames: "我的對弈" - allGames: "所有對弈" - ended: "已結束" - playing: "正在對弈" - isLlotheo: "子較少的一方為勝(顛倒規則)" - loopedMap: "循環棋盤" - canPutEverywhere: "隨意置放模式" - timeLimitForEachTurn: "每回合的時間限制" - freeMatch: "自由對戰" - lookingForPlayer: "正在搜尋對手" - gameCanceled: "對弈已被取消" - shareToTlTheGameWhenStart: "在遊戲開始時將對弈資訊發布到時間軸" - iStartedAGame: "對弈開始了! #MisskeyReversi" - opponentHasSettingsChanged: "對手更改了設定" - allowIrregularRules: "允許異常規則(完全自由)" - disallowIrregularRules: "不允許異常規則" - showBoardLabels: "在棋盤上顯示行、列號" - useAvatarAsStone: "用大頭貼當作棋子" -_offlineScreen: - title: "離線-無法連接伺服器" - header: "無法連接伺服器" -_urlPreviewSetting: - title: "URL 預覽設定" - enable: "啟用 URL 預覽" - timeout: "取得預覽的逾時時間 (ms)" - timeoutDescription: "若取得預覽所需的時間超過這個值,則不會產生預覽。" - maximumContentLength: "Content-Length 的最大値 (byte)" - maximumContentLengthDescription: "若 Content-Length 超過這個值,則不會產生預覽。" - requireContentLength: "僅在能夠取得 Content-Length 時,才產生預覽。" - requireContentLengthDescription: "若對方的伺服器未回傳 Content -Length,則不會產生預覽。" - userAgent: "User-Agent" - userAgentDescription: "設定獲取預覽時使用的 User-Agent 。如果留空,將使用預設的 User-Agent 。" - summaryProxy: "產生預覽的代理端點" - summaryProxyDescription: "使用摘要代理程式而不是 Misskey 本身產生預覽。" - summaryProxyDescription2: "以下參數會作為查詢字串連結到代理。如果代理端不支援,這些設定將被忽略。" -_mediaControls: - pip: "畫中畫" - playbackRate: "播放速度" - loop: "循環播放" -_contextMenu: - title: "內容功能表" - app: "應用程式" - appWithShift: "Shift 鍵應用程式" - native: "瀏覽器的使用者介面" -_embedCodeGen: - title: "自訂嵌入程式碼" - header: "檢視標頭 " - autoload: "自動繼續載入(不建議)" - maxHeight: "最大高度" - maxHeightDescription: "設定為 0 時代表沒有最大值。請指定某個值以避免小工具持續在縱向延伸。" - maxHeightWarn: "最大高度限制已停用(0)。如果這個變更不是您想要的,請將最大高度設定為某個值。" - previewIsNotActual: "由於超出了預覽畫面可顯示的範圍,因此顯示內容會與實際嵌入時有所不同。" - rounded: "圓角" - border: "給外框加上邊框" - applyToPreview: "反映在預覽中" - generateCode: "建立嵌入程式碼" - codeGenerated: "已產生程式碼" - codeGeneratedDescription: "請將產生的程式碼貼到您的網站上。" -_selfXssPrevention: - warning: "警告" - title: "「在此畫面貼上一些內容」完全是個騙局。" - description1: "如果您在此處貼上任何內容,惡意使用者可能會接管您的帳戶或竊取您的個人資訊。" - description2: "如果您不確切知道要貼上的內容,%c 請立即停止工作並關閉此視窗。" - description3: "細節請看這裡。{link}" diff --git a/misskey-assets b/misskey-assets new file mode 160000 index 0000000000..0179793ec8 --- /dev/null +++ b/misskey-assets @@ -0,0 +1 @@ +Subproject commit 0179793ec891856d6f37a3be16ba4c22f67a81b5 diff --git a/package.json b/package.json index 6a44eb04f3..49de5a5efd 100644 --- a/package.json +++ b/package.json @@ -1,21 +1,16 @@ { "name": "misskey", - "version": "2024.11.0-alpha.0", + "version": "2023.12.2", "codename": "nasubi", "repository": { "type": "git", "url": "https://github.com/misskey-dev/misskey.git" }, - "packageManager": "pnpm@9.6.0", + "packageManager": "pnpm@8.12.1", "workspaces": [ - "packages/frontend-shared", "packages/frontend", - "packages/frontend-embed", "packages/backend", - "packages/sw", - "packages/misskey-js", - "packages/misskey-reversi", - "packages/misskey-bubble-game" + "packages/sw" ], "private": true, "scripts": { @@ -23,7 +18,7 @@ "build-assets": "node ./scripts/build-assets.mjs", "build": "pnpm build-pre && pnpm -r build && pnpm build-assets", "build-storybook": "pnpm --filter frontend build-storybook", - "build-misskey-js-with-types": "pnpm build-pre && pnpm --filter backend... --filter=!misskey-js build && pnpm --filter backend generate-api-json --no-build && ncp packages/backend/built/api.json packages/misskey-js/generator/api.json && pnpm --filter misskey-js update-autogen-code && pnpm --filter misskey-js build && pnpm --filter misskey-js api", + "build-misskey-js-with-types": "pnpm --filter backend build && pnpm --filter backend generate-api-json && ncp packages/backend/built/api.json packages/misskey-js/generator/api.json && pnpm --filter misskey-js update-autogen-code && pnpm --filter misskey-js build && pnpm --filter misskey-js api", "start": "pnpm check:connect && cd packages/backend && node ./built/boot/entry.js", "start:test": "cd packages/backend && cross-env NODE_ENV=test node ./built/boot/entry.js", "init": "pnpm migrate", @@ -37,7 +32,6 @@ "cy:open": "pnpm cypress open --browser --e2e --config-file=cypress.config.ts", "cy:run": "pnpm cypress run", "e2e": "pnpm start-server-and-test start:test http://localhost:61812 cy:run", - "e2e-dev-container": "cp ./.config/cypress-devcontainer.yml ./.config/test.yml && pnpm start-server-and-test start:test http://localhost:61812 cy:run", "jest": "cd packages/backend && pnpm jest", "jest-and-coverage": "cd packages/backend && pnpm jest-and-coverage", "test": "pnpm -r test", @@ -51,29 +45,21 @@ "lodash": "4.17.21" }, "dependencies": { - "cssnano": "6.1.2", "execa": "8.0.1", - "fast-glob": "3.3.2", - "ignore-walk": "6.0.5", + "cssnano": "6.0.2", "js-yaml": "4.1.0", - "postcss": "8.4.47", - "tar": "6.2.1", - "terser": "5.33.0", - "typescript": "5.6.2", - "esbuild": "0.23.1", - "glob": "11.0.0" + "postcss": "8.4.32", + "terser": "5.26.0", + "typescript": "5.3.3" }, "devDependencies": { - "@misskey-dev/eslint-plugin": "2.0.3", - "@types/node": "20.14.12", - "@typescript-eslint/eslint-plugin": "7.17.0", - "@typescript-eslint/parser": "7.17.0", + "@typescript-eslint/eslint-plugin": "6.14.0", + "@typescript-eslint/parser": "6.14.0", "cross-env": "7.0.3", - "cypress": "13.14.2", - "eslint": "9.8.0", - "globals": "15.9.0", - "ncp": "2.0.0", - "start-server-and-test": "2.0.8" + "cypress": "13.6.1", + "eslint": "8.56.0", + "start-server-and-test": "2.0.3", + "ncp": "2.0.0" }, "optionalDependencies": { "@tensorflow/tfjs-core": "4.4.0" diff --git a/packages/backend/.eslintignore b/packages/backend/.eslintignore new file mode 100644 index 0000000000..790eb90145 --- /dev/null +++ b/packages/backend/.eslintignore @@ -0,0 +1,4 @@ +node_modules +/built +/.eslintrc.js +/@types/**/* diff --git a/packages/backend/.eslintrc.cjs b/packages/backend/.eslintrc.cjs new file mode 100644 index 0000000000..f9fe4814e6 --- /dev/null +++ b/packages/backend/.eslintrc.cjs @@ -0,0 +1,32 @@ +module.exports = { + parserOptions: { + tsconfigRootDir: __dirname, + project: ['./tsconfig.json', './test/tsconfig.json'], + }, + extends: [ + '../shared/.eslintrc.js', + ], + rules: { + 'import/order': ['warn', { + 'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'], + 'pathGroups': [ + { + 'pattern': '@/**', + 'group': 'external', + 'position': 'after' + } + ], + }], + 'no-restricted-globals': [ + 'error', + { + 'name': '__dirname', + 'message': 'Not in ESModule. Use `import.meta.url` instead.' + }, + { + 'name': '__filename', + 'message': 'Not in ESModule. Use `import.meta.url` instead.' + } + ] + }, +}; diff --git a/packages/backend/.swcrc b/packages/backend/.swcrc index 845190b5f4..0504a2d389 100644 --- a/packages/backend/.swcrc +++ b/packages/backend/.swcrc @@ -19,6 +19,5 @@ }, "target": "es2022" }, - "minify": false, - "sourceMaps": "inline" + "minify": false } diff --git a/packages/backend/assets/api-doc.html b/packages/backend/assets/api-doc.html deleted file mode 100644 index 19e0349d47..0000000000 --- a/packages/backend/assets/api-doc.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - Misskey API - - - - - - - - - diff --git a/packages/backend/assets/embed.js b/packages/backend/assets/embed.js deleted file mode 100644 index 24fccc1b6c..0000000000 --- a/packages/backend/assets/embed.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: MIT - */ -//@ts-check -(() => { - /** @type {NodeListOf} */ - const els = document.querySelectorAll('iframe[data-misskey-embed-id]'); - - window.addEventListener('message', function (event) { - els.forEach((el) => { - if (event.source !== el.contentWindow) { - return; - } - - const id = el.dataset.misskeyEmbedId; - - if (event.data.type === 'misskey:embed:ready') { - el.contentWindow?.postMessage({ - type: 'misskey:embedParent:registerIframeId', - payload: { - iframeId: id, - } - }, '*'); - } - if (event.data.type === 'misskey:embed:changeHeight' && event.data.iframeId === id) { - el.style.height = event.data.payload.height + 'px'; - } - }); - }); -})(); diff --git a/packages/backend/assets/redoc.html b/packages/backend/assets/redoc.html new file mode 100644 index 0000000000..a9ebf662fc --- /dev/null +++ b/packages/backend/assets/redoc.html @@ -0,0 +1,24 @@ + + + + Misskey API + + + + + + + + + + + + + diff --git a/packages/backend/assets/tabler-badges/login-2.png b/packages/backend/assets/tabler-badges/login-2.png deleted file mode 100644 index f3ca8de3dd..0000000000 Binary files a/packages/backend/assets/tabler-badges/login-2.png and /dev/null differ diff --git a/packages/backend/check_connect.js b/packages/backend/check_connect.js new file mode 100644 index 0000000000..ea988a7f69 --- /dev/null +++ b/packages/backend/check_connect.js @@ -0,0 +1,15 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import Redis from 'ioredis'; +import { loadConfig } from './built/config.js'; + +const config = loadConfig(); +const redis = new Redis(config.redis); + +redis.on('connect', () => redis.disconnect()); +redis.on('error', (e) => { + throw e; +}); diff --git a/packages/backend/eslint.config.js b/packages/backend/eslint.config.js deleted file mode 100644 index ae7b2baf49..0000000000 --- a/packages/backend/eslint.config.js +++ /dev/null @@ -1,46 +0,0 @@ -import tsParser from '@typescript-eslint/parser'; -import sharedConfig from '../shared/eslint.config.js'; - -export default [ - ...sharedConfig, - { - ignores: ['**/node_modules', 'built', '@types/**/*', 'migration'], - }, - { - files: ['**/*.ts', '**/*.tsx'], - languageOptions: { - parserOptions: { - parser: tsParser, - project: ['./tsconfig.json', './test/tsconfig.json', './test-federation/tsconfig.json'], - sourceType: 'module', - tsconfigRootDir: import.meta.dirname, - }, - }, - rules: { - 'import/order': ['warn', { - groups: [ - 'builtin', - 'external', - 'internal', - 'parent', - 'sibling', - 'index', - 'object', - 'type', - ], - pathGroups: [{ - pattern: '@/**', - group: 'external', - position: 'after', - }], - }], - 'no-restricted-globals': ['error', { - name: '__dirname', - message: 'Not in ESModule. Use `import.meta.url` instead.', - }, { - name: '__filename', - message: 'Not in ESModule. Use `import.meta.url` instead.', - }], - }, - }, -]; diff --git a/packages/backend/generate_api_json.js b/packages/backend/generate_api_json.js new file mode 100644 index 0000000000..5819c60a5f --- /dev/null +++ b/packages/backend/generate_api_json.js @@ -0,0 +1,8 @@ +import { loadConfig } from './built/config.js' +import { genOpenapiSpec } from './built/server/api/openapi/gen-spec.js' +import { writeFileSync } from "node:fs"; + +const config = loadConfig(); +const spec = genOpenapiSpec(config); + +writeFileSync('./built/api.json', JSON.stringify(spec), 'utf-8'); \ No newline at end of file diff --git a/packages/backend/jest.config.cjs b/packages/backend/jest.config.cjs index 5a4aa4e15a..97d777c862 100644 --- a/packages/backend/jest.config.cjs +++ b/packages/backend/jest.config.cjs @@ -160,6 +160,7 @@ module.exports = { testMatch: [ "/test/unit/**/*.ts", "/src/**/*.test.ts", + "/test/e2e/**/*.ts", ], // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped diff --git a/packages/backend/jest.config.e2e.cjs b/packages/backend/jest.config.e2e.cjs deleted file mode 100644 index 4502da47df..0000000000 --- a/packages/backend/jest.config.e2e.cjs +++ /dev/null @@ -1,15 +0,0 @@ -/* -* For a detailed explanation regarding each configuration property and type check, visit: -* https://jestjs.io/docs/en/configuration.html -*/ - -const base = require('./jest.config.cjs') - -module.exports = { - ...base, - globalSetup: "/built-test/entry.js", - setupFilesAfterEnv: ["/test/jest.setup.ts"], - testMatch: [ - "/test/e2e/**/*.ts", - ], -}; diff --git a/packages/backend/jest.config.fed.cjs b/packages/backend/jest.config.fed.cjs deleted file mode 100644 index fae187bc23..0000000000 --- a/packages/backend/jest.config.fed.cjs +++ /dev/null @@ -1,13 +0,0 @@ -/* - * For a detailed explanation regarding each configuration property and type check, visit: - * https://jestjs.io/docs/en/configuration.html - */ - -const base = require('./jest.config.cjs'); - -module.exports = { - ...base, - testMatch: [ - '/test-federation/test/**/*.test.ts', - ], -}; diff --git a/packages/backend/jest.config.unit.cjs b/packages/backend/jest.config.unit.cjs deleted file mode 100644 index aa5992936b..0000000000 --- a/packages/backend/jest.config.unit.cjs +++ /dev/null @@ -1,14 +0,0 @@ -/* -* For a detailed explanation regarding each configuration property and type check, visit: -* https://jestjs.io/docs/en/configuration.html -*/ - -const base = require('./jest.config.cjs') - -module.exports = { - ...base, - testMatch: [ - "/test/unit/**/*.ts", - "/src/**/*.test.ts", - ], -}; diff --git a/packages/backend/migration/1000000000000-Init.js b/packages/backend/migration/1000000000000-Init.js index c06885fd40..6f04b52ae1 100644 --- a/packages/backend/migration/1000000000000-Init.js +++ b/packages/backend/migration/1000000000000-Init.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1556348509290-Pages.js b/packages/backend/migration/1556348509290-Pages.js index c7542e808c..05d801227b 100644 --- a/packages/backend/migration/1556348509290-Pages.js +++ b/packages/backend/migration/1556348509290-Pages.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1556746559567-UserProfile.js b/packages/backend/migration/1556746559567-UserProfile.js index 13ff6ce6bf..7cc1ba0083 100644 --- a/packages/backend/migration/1556746559567-UserProfile.js +++ b/packages/backend/migration/1556746559567-UserProfile.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1557476068003-PinnedUsers.js b/packages/backend/migration/1557476068003-PinnedUsers.js index f2f1deae2f..12f0b8fc6a 100644 --- a/packages/backend/migration/1557476068003-PinnedUsers.js +++ b/packages/backend/migration/1557476068003-PinnedUsers.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1557761316509-AddSomeUrls.js b/packages/backend/migration/1557761316509-AddSomeUrls.js index eaf78b85b6..244f64f8ef 100644 --- a/packages/backend/migration/1557761316509-AddSomeUrls.js +++ b/packages/backend/migration/1557761316509-AddSomeUrls.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1557932705754-ObjectStorageSetting.js b/packages/backend/migration/1557932705754-ObjectStorageSetting.js index 0e1ef321ab..736dcafaac 100644 --- a/packages/backend/migration/1557932705754-ObjectStorageSetting.js +++ b/packages/backend/migration/1557932705754-ObjectStorageSetting.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1558072954435-PageLike.js b/packages/backend/migration/1558072954435-PageLike.js index a08f68a0e6..d9502a6e03 100644 --- a/packages/backend/migration/1558072954435-PageLike.js +++ b/packages/backend/migration/1558072954435-PageLike.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1558103093633-UserGroup.js b/packages/backend/migration/1558103093633-UserGroup.js index f762dc2371..b3cc6eb949 100644 --- a/packages/backend/migration/1558103093633-UserGroup.js +++ b/packages/backend/migration/1558103093633-UserGroup.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1558257926829-UserGroupInvite.js b/packages/backend/migration/1558257926829-UserGroupInvite.js index 853b52d17d..a87173cdfe 100644 --- a/packages/backend/migration/1558257926829-UserGroupInvite.js +++ b/packages/backend/migration/1558257926829-UserGroupInvite.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1558266512381-UserListJoining.js b/packages/backend/migration/1558266512381-UserListJoining.js index e161d52f12..bc94b7f425 100644 --- a/packages/backend/migration/1558266512381-UserListJoining.js +++ b/packages/backend/migration/1558266512381-UserListJoining.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1561706992953-webauthn.js b/packages/backend/migration/1561706992953-webauthn.js index 4c81035ff1..fa9b1188ca 100644 --- a/packages/backend/migration/1561706992953-webauthn.js +++ b/packages/backend/migration/1561706992953-webauthn.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1561873850023-ChartIndexes.js b/packages/backend/migration/1561873850023-ChartIndexes.js index 3f190ce143..c7e93ba7b7 100644 --- a/packages/backend/migration/1561873850023-ChartIndexes.js +++ b/packages/backend/migration/1561873850023-ChartIndexes.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1562422242907-PasswordLessLogin.js b/packages/backend/migration/1562422242907-PasswordLessLogin.js index 4c0fbbbc9f..3df3a6f5f5 100644 --- a/packages/backend/migration/1562422242907-PasswordLessLogin.js +++ b/packages/backend/migration/1562422242907-PasswordLessLogin.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1562444565093-PinnedPage.js b/packages/backend/migration/1562444565093-PinnedPage.js index 89639399f0..329d49bbed 100644 --- a/packages/backend/migration/1562444565093-PinnedPage.js +++ b/packages/backend/migration/1562444565093-PinnedPage.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1562448332510-PageTitleHideOption.js b/packages/backend/migration/1562448332510-PageTitleHideOption.js index 70d54aa777..e41db08090 100644 --- a/packages/backend/migration/1562448332510-PageTitleHideOption.js +++ b/packages/backend/migration/1562448332510-PageTitleHideOption.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1562869971568-ModerationLog.js b/packages/backend/migration/1562869971568-ModerationLog.js index 3dd9b22edf..2eb3015d5c 100644 --- a/packages/backend/migration/1562869971568-ModerationLog.js +++ b/packages/backend/migration/1562869971568-ModerationLog.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1563757595828-UsedUsername.js b/packages/backend/migration/1563757595828-UsedUsername.js index 258e5abab2..91d9d36b9d 100644 --- a/packages/backend/migration/1563757595828-UsedUsername.js +++ b/packages/backend/migration/1563757595828-UsedUsername.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1565634203341-room.js b/packages/backend/migration/1565634203341-room.js index 04c9749c1b..c2e5fca863 100644 --- a/packages/backend/migration/1565634203341-room.js +++ b/packages/backend/migration/1565634203341-room.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1571220798684-CustomEmojiCategory.js b/packages/backend/migration/1571220798684-CustomEmojiCategory.js index 1fc78a65ff..f211af67be 100644 --- a/packages/backend/migration/1571220798684-CustomEmojiCategory.js +++ b/packages/backend/migration/1571220798684-CustomEmojiCategory.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1572760203493-nodeinfo.js b/packages/backend/migration/1572760203493-nodeinfo.js index ea7a67bc3e..c281b0b2db 100644 --- a/packages/backend/migration/1572760203493-nodeinfo.js +++ b/packages/backend/migration/1572760203493-nodeinfo.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1576269851876-TalkFederationId.js b/packages/backend/migration/1576269851876-TalkFederationId.js index c49c716e7a..045f9ddb04 100644 --- a/packages/backend/migration/1576269851876-TalkFederationId.js +++ b/packages/backend/migration/1576269851876-TalkFederationId.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1576869585998-ProxyRemoteFiles.js b/packages/backend/migration/1576869585998-ProxyRemoteFiles.js index 192dbe3485..0dde1ae70c 100644 --- a/packages/backend/migration/1576869585998-ProxyRemoteFiles.js +++ b/packages/backend/migration/1576869585998-ProxyRemoteFiles.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1579267006611-v12.js b/packages/backend/migration/1579267006611-v12.js index 9267be5630..86f9da7e7a 100644 --- a/packages/backend/migration/1579267006611-v12.js +++ b/packages/backend/migration/1579267006611-v12.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1579270193251-v12-2.js b/packages/backend/migration/1579270193251-v12-2.js index e2ca9709ea..2593aca573 100644 --- a/packages/backend/migration/1579270193251-v12-2.js +++ b/packages/backend/migration/1579270193251-v12-2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1579282808087-v12-3.js b/packages/backend/migration/1579282808087-v12-3.js index 4098f041c8..a816b2e82e 100644 --- a/packages/backend/migration/1579282808087-v12-3.js +++ b/packages/backend/migration/1579282808087-v12-3.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1579544426412-v12-4.js b/packages/backend/migration/1579544426412-v12-4.js index 1153993f35..600dc270a5 100644 --- a/packages/backend/migration/1579544426412-v12-4.js +++ b/packages/backend/migration/1579544426412-v12-4.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1579977526288-v12-5.js b/packages/backend/migration/1579977526288-v12-5.js index d9e1b48bb2..73f3343347 100644 --- a/packages/backend/migration/1579977526288-v12-5.js +++ b/packages/backend/migration/1579977526288-v12-5.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1579993013959-v12-6.js b/packages/backend/migration/1579993013959-v12-6.js index 9c249422a2..5009e0aa88 100644 --- a/packages/backend/migration/1579993013959-v12-6.js +++ b/packages/backend/migration/1579993013959-v12-6.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1580069531114-v12-7.js b/packages/backend/migration/1580069531114-v12-7.js index ceee6b2031..ff943ffa6b 100644 --- a/packages/backend/migration/1580069531114-v12-7.js +++ b/packages/backend/migration/1580069531114-v12-7.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1580148575182-v12-8.js b/packages/backend/migration/1580148575182-v12-8.js index 6841dcc38f..20b77b391f 100644 --- a/packages/backend/migration/1580148575182-v12-8.js +++ b/packages/backend/migration/1580148575182-v12-8.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1580154400017-v12-9.js b/packages/backend/migration/1580154400017-v12-9.js index c01d8089d0..f78dc47456 100644 --- a/packages/backend/migration/1580154400017-v12-9.js +++ b/packages/backend/migration/1580154400017-v12-9.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1580276619901-v12-10.js b/packages/backend/migration/1580276619901-v12-10.js index be6e467fab..09fa27ae83 100644 --- a/packages/backend/migration/1580276619901-v12-10.js +++ b/packages/backend/migration/1580276619901-v12-10.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1580331224276-v12-11.js b/packages/backend/migration/1580331224276-v12-11.js index af817a8c8a..f118c34937 100644 --- a/packages/backend/migration/1580331224276-v12-11.js +++ b/packages/backend/migration/1580331224276-v12-11.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1580508795118-v12-12.js b/packages/backend/migration/1580508795118-v12-12.js index 4bd855f7ab..4fba933a08 100644 --- a/packages/backend/migration/1580508795118-v12-12.js +++ b/packages/backend/migration/1580508795118-v12-12.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1580543501339-v12-13.js b/packages/backend/migration/1580543501339-v12-13.js index be76c02163..9344516309 100644 --- a/packages/backend/migration/1580543501339-v12-13.js +++ b/packages/backend/migration/1580543501339-v12-13.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1580864313253-v12-14.js b/packages/backend/migration/1580864313253-v12-14.js index f8891a2b66..5034492a70 100644 --- a/packages/backend/migration/1580864313253-v12-14.js +++ b/packages/backend/migration/1580864313253-v12-14.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1581526429287-user-group-invitation.js b/packages/backend/migration/1581526429287-user-group-invitation.js index 51703e2ba1..fc81813807 100644 --- a/packages/backend/migration/1581526429287-user-group-invitation.js +++ b/packages/backend/migration/1581526429287-user-group-invitation.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1581695816408-user-group-antenna.js b/packages/backend/migration/1581695816408-user-group-antenna.js index e6791ba1a4..8a212c092a 100644 --- a/packages/backend/migration/1581695816408-user-group-antenna.js +++ b/packages/backend/migration/1581695816408-user-group-antenna.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1581708415836-drive-user-folder-id-index.js b/packages/backend/migration/1581708415836-drive-user-folder-id-index.js index 28ce4cc142..6594078db8 100644 --- a/packages/backend/migration/1581708415836-drive-user-folder-id-index.js +++ b/packages/backend/migration/1581708415836-drive-user-folder-id-index.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1581979837262-promo.js b/packages/backend/migration/1581979837262-promo.js index 707c85fcb3..585564a400 100644 --- a/packages/backend/migration/1581979837262-promo.js +++ b/packages/backend/migration/1581979837262-promo.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1582019042083-featured-injecttion.js b/packages/backend/migration/1582019042083-featured-injecttion.js index f308f0a454..d270006277 100644 --- a/packages/backend/migration/1582019042083-featured-injecttion.js +++ b/packages/backend/migration/1582019042083-featured-injecttion.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1582210532752-antenna-exclude.js b/packages/backend/migration/1582210532752-antenna-exclude.js index 9b87e3ff39..12eee2364c 100644 --- a/packages/backend/migration/1582210532752-antenna-exclude.js +++ b/packages/backend/migration/1582210532752-antenna-exclude.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1582875306439-note-reaction-length.js b/packages/backend/migration/1582875306439-note-reaction-length.js index e801d1ac44..a4413c9533 100644 --- a/packages/backend/migration/1582875306439-note-reaction-length.js +++ b/packages/backend/migration/1582875306439-note-reaction-length.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1585361548360-miauth.js b/packages/backend/migration/1585361548360-miauth.js index d5932c6083..d073fa3d26 100644 --- a/packages/backend/migration/1585361548360-miauth.js +++ b/packages/backend/migration/1585361548360-miauth.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1585385921215-custom-notification.js b/packages/backend/migration/1585385921215-custom-notification.js index 35303b99e9..a3336e0eca 100644 --- a/packages/backend/migration/1585385921215-custom-notification.js +++ b/packages/backend/migration/1585385921215-custom-notification.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1585772678853-ap-url.js b/packages/backend/migration/1585772678853-ap-url.js index f978fc80b4..f67f5a4542 100644 --- a/packages/backend/migration/1585772678853-ap-url.js +++ b/packages/backend/migration/1585772678853-ap-url.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js b/packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js index fde8629bba..16f7599b80 100644 --- a/packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js +++ b/packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1586641139527-remote-reaction.js b/packages/backend/migration/1586641139527-remote-reaction.js index 3e907af5f1..666bb42ca6 100644 --- a/packages/backend/migration/1586641139527-remote-reaction.js +++ b/packages/backend/migration/1586641139527-remote-reaction.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1586708940386-pageAiScript.js b/packages/backend/migration/1586708940386-pageAiScript.js index ce5007cea1..3d0d0ab915 100644 --- a/packages/backend/migration/1586708940386-pageAiScript.js +++ b/packages/backend/migration/1586708940386-pageAiScript.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1588044505511-hCaptcha.js b/packages/backend/migration/1588044505511-hCaptcha.js index aeacb653b3..22cc6672c5 100644 --- a/packages/backend/migration/1588044505511-hCaptcha.js +++ b/packages/backend/migration/1588044505511-hCaptcha.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1589023282116-pubRelay.js b/packages/backend/migration/1589023282116-pubRelay.js index 8739adb733..ed010699e1 100644 --- a/packages/backend/migration/1589023282116-pubRelay.js +++ b/packages/backend/migration/1589023282116-pubRelay.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1595075960584-blurhash.js b/packages/backend/migration/1595075960584-blurhash.js index 9752625cd2..967676531f 100644 --- a/packages/backend/migration/1595075960584-blurhash.js +++ b/packages/backend/migration/1595075960584-blurhash.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js b/packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js index fdff8c633a..7df079ac05 100644 --- a/packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js +++ b/packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1595676934834-instance-icon-url.js b/packages/backend/migration/1595676934834-instance-icon-url.js index 5f834064c4..6bccff082b 100644 --- a/packages/backend/migration/1595676934834-instance-icon-url.js +++ b/packages/backend/migration/1595676934834-instance-icon-url.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1595771249699-word-mute.js b/packages/backend/migration/1595771249699-word-mute.js index f4fa1227e3..cfd0a5ccc1 100644 --- a/packages/backend/migration/1595771249699-word-mute.js +++ b/packages/backend/migration/1595771249699-word-mute.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1595782306083-word-mute2.js b/packages/backend/migration/1595782306083-word-mute2.js index 3c2062ec07..64acf2b721 100644 --- a/packages/backend/migration/1595782306083-word-mute2.js +++ b/packages/backend/migration/1595782306083-word-mute2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1596548170836-channel.js b/packages/backend/migration/1596548170836-channel.js index ee6753a476..a26991d4d8 100644 --- a/packages/backend/migration/1596548170836-channel.js +++ b/packages/backend/migration/1596548170836-channel.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1596786425167-channel2.js b/packages/backend/migration/1596786425167-channel2.js index 9e6ead4378..4e87b11bb5 100644 --- a/packages/backend/migration/1596786425167-channel2.js +++ b/packages/backend/migration/1596786425167-channel2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1597230137744-objectStorageSetPublicRead.js b/packages/backend/migration/1597230137744-objectStorageSetPublicRead.js index bc32d4a052..93e6f186d5 100644 --- a/packages/backend/migration/1597230137744-objectStorageSetPublicRead.js +++ b/packages/backend/migration/1597230137744-objectStorageSetPublicRead.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1597236229720-IncludingNotificationTypes.js b/packages/backend/migration/1597236229720-IncludingNotificationTypes.js index 99686bd70e..bda702d999 100644 --- a/packages/backend/migration/1597236229720-IncludingNotificationTypes.js +++ b/packages/backend/migration/1597236229720-IncludingNotificationTypes.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1597385880794-add-sensitive-index.js b/packages/backend/migration/1597385880794-add-sensitive-index.js index a67810880b..ffb94895d7 100644 --- a/packages/backend/migration/1597385880794-add-sensitive-index.js +++ b/packages/backend/migration/1597385880794-add-sensitive-index.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1597459042300-channel-unread.js b/packages/backend/migration/1597459042300-channel-unread.js index ced9b5265a..5b94d8296a 100644 --- a/packages/backend/migration/1597459042300-channel-unread.js +++ b/packages/backend/migration/1597459042300-channel-unread.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js b/packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js index ca4eba385e..543e511404 100644 --- a/packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js +++ b/packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1600353287890-mutingNotificationTypes.js b/packages/backend/migration/1600353287890-mutingNotificationTypes.js index 0996aa21f6..4e0b8ad6eb 100644 --- a/packages/backend/migration/1600353287890-mutingNotificationTypes.js +++ b/packages/backend/migration/1600353287890-mutingNotificationTypes.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1603094348345-refine-abuse-user-report.js b/packages/backend/migration/1603094348345-refine-abuse-user-report.js index 354915b165..4e052e07c2 100644 --- a/packages/backend/migration/1603094348345-refine-abuse-user-report.js +++ b/packages/backend/migration/1603094348345-refine-abuse-user-report.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1603095701770-refine-abuse-user-report2.js b/packages/backend/migration/1603095701770-refine-abuse-user-report2.js index 75dd3513b5..2eb205c6e0 100644 --- a/packages/backend/migration/1603095701770-refine-abuse-user-report2.js +++ b/packages/backend/migration/1603095701770-refine-abuse-user-report2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1603776877564-instance-theme-color.js b/packages/backend/migration/1603776877564-instance-theme-color.js index c8ab89ab56..5f83bc14e6 100644 --- a/packages/backend/migration/1603776877564-instance-theme-color.js +++ b/packages/backend/migration/1603776877564-instance-theme-color.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1603781553011-instance-favicon.js b/packages/backend/migration/1603781553011-instance-favicon.js index 7d793d4f1f..758b86408f 100644 --- a/packages/backend/migration/1603781553011-instance-favicon.js +++ b/packages/backend/migration/1603781553011-instance-favicon.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1604821689616-delete-auto-watch.js b/packages/backend/migration/1604821689616-delete-auto-watch.js index 8160877038..917ef5b10c 100644 --- a/packages/backend/migration/1604821689616-delete-auto-watch.js +++ b/packages/backend/migration/1604821689616-delete-auto-watch.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1605408848373-clip-description.js b/packages/backend/migration/1605408848373-clip-description.js index 77a218791c..fedc603b3c 100644 --- a/packages/backend/migration/1605408848373-clip-description.js +++ b/packages/backend/migration/1605408848373-clip-description.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1605408971051-comments.js b/packages/backend/migration/1605408971051-comments.js index 494bfb7950..8ab16859d2 100644 --- a/packages/backend/migration/1605408971051-comments.js +++ b/packages/backend/migration/1605408971051-comments.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1605585339718-instance-pinned-pages.js b/packages/backend/migration/1605585339718-instance-pinned-pages.js index 15a0cecd19..e6f3c2a785 100644 --- a/packages/backend/migration/1605585339718-instance-pinned-pages.js +++ b/packages/backend/migration/1605585339718-instance-pinned-pages.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1605965516823-instance-images.js b/packages/backend/migration/1605965516823-instance-images.js index 9cc2eb4032..848b53f1ba 100644 --- a/packages/backend/migration/1605965516823-instance-images.js +++ b/packages/backend/migration/1605965516823-instance-images.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1606191203881-no-crawle.js b/packages/backend/migration/1606191203881-no-crawle.js index af04566eaa..5c878f5a24 100644 --- a/packages/backend/migration/1606191203881-no-crawle.js +++ b/packages/backend/migration/1606191203881-no-crawle.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1607151207216-instance-pinned-clip.js b/packages/backend/migration/1607151207216-instance-pinned-clip.js index f85c3d42d7..67db39fede 100644 --- a/packages/backend/migration/1607151207216-instance-pinned-clip.js +++ b/packages/backend/migration/1607151207216-instance-pinned-clip.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1607353487793-isExplorable.js b/packages/backend/migration/1607353487793-isExplorable.js index e07fe6c306..95ee07e917 100644 --- a/packages/backend/migration/1607353487793-isExplorable.js +++ b/packages/backend/migration/1607353487793-isExplorable.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1610277136869-registry.js b/packages/backend/migration/1610277136869-registry.js index 1a10f23590..c5fe2c5a62 100644 --- a/packages/backend/migration/1610277136869-registry.js +++ b/packages/backend/migration/1610277136869-registry.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1610277585759-registry2.js b/packages/backend/migration/1610277585759-registry2.js index 46e56279f4..f734a235b0 100644 --- a/packages/backend/migration/1610277585759-registry2.js +++ b/packages/backend/migration/1610277585759-registry2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1610283021566-registry3.js b/packages/backend/migration/1610283021566-registry3.js index 402040f38b..c94546c732 100644 --- a/packages/backend/migration/1610283021566-registry3.js +++ b/packages/backend/migration/1610283021566-registry3.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1611354329133-followersUri.js b/packages/backend/migration/1611354329133-followersUri.js index 15abb2a9d1..7e5f8c3093 100644 --- a/packages/backend/migration/1611354329133-followersUri.js +++ b/packages/backend/migration/1611354329133-followersUri.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1611397665007-gallery.js b/packages/backend/migration/1611397665007-gallery.js index cbd2b62c56..cd5c39cc10 100644 --- a/packages/backend/migration/1611397665007-gallery.js +++ b/packages/backend/migration/1611397665007-gallery.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js b/packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js index c5440b7a48..c0b1da1e53 100644 --- a/packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js +++ b/packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1612619156584-announcement-email.js b/packages/backend/migration/1612619156584-announcement-email.js index ddacab322b..f8277725f7 100644 --- a/packages/backend/migration/1612619156584-announcement-email.js +++ b/packages/backend/migration/1612619156584-announcement-email.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1613155914446-emailNotificationTypes.js b/packages/backend/migration/1613155914446-emailNotificationTypes.js index d34ba7e826..3afe491e48 100644 --- a/packages/backend/migration/1613155914446-emailNotificationTypes.js +++ b/packages/backend/migration/1613155914446-emailNotificationTypes.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1613181457597-user-lang.js b/packages/backend/migration/1613181457597-user-lang.js index 6ef5245953..33e363477f 100644 --- a/packages/backend/migration/1613181457597-user-lang.js +++ b/packages/backend/migration/1613181457597-user-lang.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js b/packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js index 8529ea3247..9c75c0ae54 100644 --- a/packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js +++ b/packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1615965918224-chart-v2.js b/packages/backend/migration/1615965918224-chart-v2.js index deecde7227..2c0cacd1d9 100644 --- a/packages/backend/migration/1615965918224-chart-v2.js +++ b/packages/backend/migration/1615965918224-chart-v2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1615966519402-chart-v2-2.js b/packages/backend/migration/1615966519402-chart-v2-2.js index 7842a27108..8d6ebf6a81 100644 --- a/packages/backend/migration/1615966519402-chart-v2-2.js +++ b/packages/backend/migration/1615966519402-chart-v2-2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1618637372000-user-last-active-date.js b/packages/backend/migration/1618637372000-user-last-active-date.js index 7caf179fa5..8b4652898d 100644 --- a/packages/backend/migration/1618637372000-user-last-active-date.js +++ b/packages/backend/migration/1618637372000-user-last-active-date.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1618639857000-user-hide-online-status.js b/packages/backend/migration/1618639857000-user-hide-online-status.js index 2012962742..1f19a7ebb4 100644 --- a/packages/backend/migration/1618639857000-user-hide-online-status.js +++ b/packages/backend/migration/1618639857000-user-hide-online-status.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1619942102890-password-reset.js b/packages/backend/migration/1619942102890-password-reset.js index 7784da2bce..9898011774 100644 --- a/packages/backend/migration/1619942102890-password-reset.js +++ b/packages/backend/migration/1619942102890-password-reset.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1620019354680-ad.js b/packages/backend/migration/1620019354680-ad.js index 7630ed01a1..1ae66d71f4 100644 --- a/packages/backend/migration/1620019354680-ad.js +++ b/packages/backend/migration/1620019354680-ad.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1620364649428-ad2.js b/packages/backend/migration/1620364649428-ad2.js index 7959185685..b9b26be076 100644 --- a/packages/backend/migration/1620364649428-ad2.js +++ b/packages/backend/migration/1620364649428-ad2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1621479946000-add-note-indexes.js b/packages/backend/migration/1621479946000-add-note-indexes.js index f72bf8211e..299c1f6c02 100644 --- a/packages/backend/migration/1621479946000-add-note-indexes.js +++ b/packages/backend/migration/1621479946000-add-note-indexes.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1622679304522-user-profile-description-length.js b/packages/backend/migration/1622679304522-user-profile-description-length.js index 7324175b46..988456fe7d 100644 --- a/packages/backend/migration/1622679304522-user-profile-description-length.js +++ b/packages/backend/migration/1622679304522-user-profile-description-length.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1622681548499-log-message-length.js b/packages/backend/migration/1622681548499-log-message-length.js index b4d8d497e3..e1fa22c88b 100644 --- a/packages/backend/migration/1622681548499-log-message-length.js +++ b/packages/backend/migration/1622681548499-log-message-length.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1626509500668-fix-remote-file-proxy.js b/packages/backend/migration/1626509500668-fix-remote-file-proxy.js index 9145247ab1..906e49cabb 100644 --- a/packages/backend/migration/1626509500668-fix-remote-file-proxy.js +++ b/packages/backend/migration/1626509500668-fix-remote-file-proxy.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1629004542760-chart-reindex.js b/packages/backend/migration/1629004542760-chart-reindex.js index 072cdec3c1..f1d08ecfe4 100644 --- a/packages/backend/migration/1629004542760-chart-reindex.js +++ b/packages/backend/migration/1629004542760-chart-reindex.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1629024377804-deepl-integration.js b/packages/backend/migration/1629024377804-deepl-integration.js index 5889196f15..465f1bcca9 100644 --- a/packages/backend/migration/1629024377804-deepl-integration.js +++ b/packages/backend/migration/1629024377804-deepl-integration.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1629288472000-fix-channel-userId.js b/packages/backend/migration/1629288472000-fix-channel-userId.js index d7907d05bd..9f946ad550 100644 --- a/packages/backend/migration/1629288472000-fix-channel-userId.js +++ b/packages/backend/migration/1629288472000-fix-channel-userId.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1629512953000-user-is-deleted.js b/packages/backend/migration/1629512953000-user-is-deleted.js index 94165e466b..78bbd8bbee 100644 --- a/packages/backend/migration/1629512953000-user-is-deleted.js +++ b/packages/backend/migration/1629512953000-user-is-deleted.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1629778475000-deepl-integration2.js b/packages/backend/migration/1629778475000-deepl-integration2.js index a54daf8fb3..b719dcf57f 100644 --- a/packages/backend/migration/1629778475000-deepl-integration2.js +++ b/packages/backend/migration/1629778475000-deepl-integration2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1629833361000-AddShowTLReplies.js b/packages/backend/migration/1629833361000-AddShowTLReplies.js index b80e2ef67f..00aef6aeb8 100644 --- a/packages/backend/migration/1629833361000-AddShowTLReplies.js +++ b/packages/backend/migration/1629833361000-AddShowTLReplies.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1629968054000_userInstanceBlocks.js b/packages/backend/migration/1629968054000_userInstanceBlocks.js index e88fa8aece..e8168e372e 100644 --- a/packages/backend/migration/1629968054000_userInstanceBlocks.js +++ b/packages/backend/migration/1629968054000_userInstanceBlocks.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1633068642000-email-required-for-signup.js b/packages/backend/migration/1633068642000-email-required-for-signup.js index d23db2052f..230227d364 100644 --- a/packages/backend/migration/1633068642000-email-required-for-signup.js +++ b/packages/backend/migration/1633068642000-email-required-for-signup.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1633071909016-user-pending.js b/packages/backend/migration/1633071909016-user-pending.js index db0f2fde1a..f0d037967f 100644 --- a/packages/backend/migration/1633071909016-user-pending.js +++ b/packages/backend/migration/1633071909016-user-pending.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1634486652000-user-public-reactions.js b/packages/backend/migration/1634486652000-user-public-reactions.js index ce1818886a..09870c79c6 100644 --- a/packages/backend/migration/1634486652000-user-public-reactions.js +++ b/packages/backend/migration/1634486652000-user-public-reactions.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1634902659689-delete-log.js b/packages/backend/migration/1634902659689-delete-log.js index 2e2267f9f4..e4e625536b 100644 --- a/packages/backend/migration/1634902659689-delete-log.js +++ b/packages/backend/migration/1634902659689-delete-log.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1635500777168-note-thread-mute.js b/packages/backend/migration/1635500777168-note-thread-mute.js index d5fca59594..9f376c4795 100644 --- a/packages/backend/migration/1635500777168-note-thread-mute.js +++ b/packages/backend/migration/1635500777168-note-thread-mute.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1636197624383-ff-visibility.js b/packages/backend/migration/1636197624383-ff-visibility.js index 27faae1c92..aa089d42ac 100644 --- a/packages/backend/migration/1636197624383-ff-visibility.js +++ b/packages/backend/migration/1636197624383-ff-visibility.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1636697408073-remove-via-mobile.js b/packages/backend/migration/1636697408073-remove-via-mobile.js index 81f0b63443..c014ceb921 100644 --- a/packages/backend/migration/1636697408073-remove-via-mobile.js +++ b/packages/backend/migration/1636697408073-remove-via-mobile.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1637320813000-forwarded-report.js b/packages/backend/migration/1637320813000-forwarded-report.js index 8125468aae..0d1f48beb4 100644 --- a/packages/backend/migration/1637320813000-forwarded-report.js +++ b/packages/backend/migration/1637320813000-forwarded-report.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1639325650583-chart-v3.js b/packages/backend/migration/1639325650583-chart-v3.js index 2255476394..e6209e2b70 100644 --- a/packages/backend/migration/1639325650583-chart-v3.js +++ b/packages/backend/migration/1639325650583-chart-v3.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1642611822809-emoji-url.js b/packages/backend/migration/1642611822809-emoji-url.js index 421614b408..212fc957ad 100644 --- a/packages/backend/migration/1642611822809-emoji-url.js +++ b/packages/backend/migration/1642611822809-emoji-url.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1642613870898-drive-file-webpublic-type.js b/packages/backend/migration/1642613870898-drive-file-webpublic-type.js index e61a3fc49e..e50770fff3 100644 --- a/packages/backend/migration/1642613870898-drive-file-webpublic-type.js +++ b/packages/backend/migration/1642613870898-drive-file-webpublic-type.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1643963705770-chart-v4.js b/packages/backend/migration/1643963705770-chart-v4.js index 77355cd7f3..af0bd18e58 100644 --- a/packages/backend/migration/1643963705770-chart-v4.js +++ b/packages/backend/migration/1643963705770-chart-v4.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1643966656277-chart-v5.js b/packages/backend/migration/1643966656277-chart-v5.js index 54e4705e56..b3389a6539 100644 --- a/packages/backend/migration/1643966656277-chart-v5.js +++ b/packages/backend/migration/1643966656277-chart-v5.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1643967331284-chart-v6.js b/packages/backend/migration/1643967331284-chart-v6.js index aa64bc9faa..1197bdd717 100644 --- a/packages/backend/migration/1643967331284-chart-v6.js +++ b/packages/backend/migration/1643967331284-chart-v6.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1644010796173-convert-hard-mutes.js b/packages/backend/migration/1644010796173-convert-hard-mutes.js index 9aec21b5ff..1a5316ac05 100644 --- a/packages/backend/migration/1644010796173-convert-hard-mutes.js +++ b/packages/backend/migration/1644010796173-convert-hard-mutes.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1644058404077-chart-v7.js b/packages/backend/migration/1644058404077-chart-v7.js index a09fff1bc7..a850d5f48f 100644 --- a/packages/backend/migration/1644058404077-chart-v7.js +++ b/packages/backend/migration/1644058404077-chart-v7.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1644059847460-chart-v8.js b/packages/backend/migration/1644059847460-chart-v8.js index 43b95926b6..2e20159ba9 100644 --- a/packages/backend/migration/1644059847460-chart-v8.js +++ b/packages/backend/migration/1644059847460-chart-v8.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1644060125705-chart-v9.js b/packages/backend/migration/1644060125705-chart-v9.js index dc99f3c8f8..d1d9469ea2 100644 --- a/packages/backend/migration/1644060125705-chart-v9.js +++ b/packages/backend/migration/1644060125705-chart-v9.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1644073149413-chart-v10.js b/packages/backend/migration/1644073149413-chart-v10.js index 4d36235729..466ae59837 100644 --- a/packages/backend/migration/1644073149413-chart-v10.js +++ b/packages/backend/migration/1644073149413-chart-v10.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1644095659741-chart-v11.js b/packages/backend/migration/1644095659741-chart-v11.js index 80bacbf710..5c98e25d86 100644 --- a/packages/backend/migration/1644095659741-chart-v11.js +++ b/packages/backend/migration/1644095659741-chart-v11.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1644328606241-chart-v12.js b/packages/backend/migration/1644328606241-chart-v12.js index 15c0dd9040..2a7272fd22 100644 --- a/packages/backend/migration/1644328606241-chart-v12.js +++ b/packages/backend/migration/1644328606241-chart-v12.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1644331238153-chart-v13.js b/packages/backend/migration/1644331238153-chart-v13.js index 0c2db66f27..7e33b0a8e9 100644 --- a/packages/backend/migration/1644331238153-chart-v13.js +++ b/packages/backend/migration/1644331238153-chart-v13.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1644344266289-chart-v14.js b/packages/backend/migration/1644344266289-chart-v14.js index 0f4688ab77..2050d54591 100644 --- a/packages/backend/migration/1644344266289-chart-v14.js +++ b/packages/backend/migration/1644344266289-chart-v14.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1644395759931-instance-theme-color.js b/packages/backend/migration/1644395759931-instance-theme-color.js index fd7356e68a..ac842e4fe5 100644 --- a/packages/backend/migration/1644395759931-instance-theme-color.js +++ b/packages/backend/migration/1644395759931-instance-theme-color.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1644481657998-chart-v15.js b/packages/backend/migration/1644481657998-chart-v15.js index 964bea3d07..ad5589df8b 100644 --- a/packages/backend/migration/1644481657998-chart-v15.js +++ b/packages/backend/migration/1644481657998-chart-v15.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1644551208096-following-indexes.js b/packages/backend/migration/1644551208096-following-indexes.js index 8d1d4890dc..795b8e900e 100644 --- a/packages/backend/migration/1644551208096-following-indexes.js +++ b/packages/backend/migration/1644551208096-following-indexes.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1645340161439-remove-max-note-text-length.js b/packages/backend/migration/1645340161439-remove-max-note-text-length.js index 1cf6b0801b..84eaeddfa4 100644 --- a/packages/backend/migration/1645340161439-remove-max-note-text-length.js +++ b/packages/backend/migration/1645340161439-remove-max-note-text-length.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1645599900873-federation-chart-pubsub.js b/packages/backend/migration/1645599900873-federation-chart-pubsub.js index 3042c8ecd9..4f9f501cca 100644 --- a/packages/backend/migration/1645599900873-federation-chart-pubsub.js +++ b/packages/backend/migration/1645599900873-federation-chart-pubsub.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1646143552768-instance-default-theme.js b/packages/backend/migration/1646143552768-instance-default-theme.js index 8f0755e3a2..3532916304 100644 --- a/packages/backend/migration/1646143552768-instance-default-theme.js +++ b/packages/backend/migration/1646143552768-instance-default-theme.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1646387162108-mute-expires-at.js b/packages/backend/migration/1646387162108-mute-expires-at.js index 412db14881..868f5c87ef 100644 --- a/packages/backend/migration/1646387162108-mute-expires-at.js +++ b/packages/backend/migration/1646387162108-mute-expires-at.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1646549089451-poll-ended-notification.js b/packages/backend/migration/1646549089451-poll-ended-notification.js index 6c481c6ac6..fa7327ff9c 100644 --- a/packages/backend/migration/1646549089451-poll-ended-notification.js +++ b/packages/backend/migration/1646549089451-poll-ended-notification.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1646633030285-chart-federation-active.js b/packages/backend/migration/1646633030285-chart-federation-active.js index 13d54c3180..b9863746ad 100644 --- a/packages/backend/migration/1646633030285-chart-federation-active.js +++ b/packages/backend/migration/1646633030285-chart-federation-active.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1646655454495-remove-instance-drive-columns.js b/packages/backend/migration/1646655454495-remove-instance-drive-columns.js index 04d6fce887..8fd96ed4c6 100644 --- a/packages/backend/migration/1646655454495-remove-instance-drive-columns.js +++ b/packages/backend/migration/1646655454495-remove-instance-drive-columns.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js b/packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js index 289b929ad9..1b28d012ae 100644 --- a/packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js +++ b/packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1648548247382-webhook.js b/packages/backend/migration/1648548247382-webhook.js index f31d3c5bb5..fc2a691918 100644 --- a/packages/backend/migration/1648548247382-webhook.js +++ b/packages/backend/migration/1648548247382-webhook.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1648816172177-webhook-2.js b/packages/backend/migration/1648816172177-webhook-2.js index 4d1b293b2c..a7bccff82d 100644 --- a/packages/backend/migration/1648816172177-webhook-2.js +++ b/packages/backend/migration/1648816172177-webhook-2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1651224615271-foreign-key.js b/packages/backend/migration/1651224615271-foreign-key.js index fa51bb5e31..12e4646329 100644 --- a/packages/backend/migration/1651224615271-foreign-key.js +++ b/packages/backend/migration/1651224615271-foreign-key.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1652859567549-uniform-themecolor.js b/packages/backend/migration/1652859567549-uniform-themecolor.js index 754e089824..422e63dfec 100644 --- a/packages/backend/migration/1652859567549-uniform-themecolor.js +++ b/packages/backend/migration/1652859567549-uniform-themecolor.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1655368940105-nsfw-detection.js b/packages/backend/migration/1655368940105-nsfw-detection.js index d2d0d00117..ad37ff6f83 100644 --- a/packages/backend/migration/1655368940105-nsfw-detection.js +++ b/packages/backend/migration/1655368940105-nsfw-detection.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1655371960534-nsfw-detection-2.js b/packages/backend/migration/1655371960534-nsfw-detection-2.js index e5adbddca4..e6cc266178 100644 --- a/packages/backend/migration/1655371960534-nsfw-detection-2.js +++ b/packages/backend/migration/1655371960534-nsfw-detection-2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1655388169582-nsfw-detection-3.js b/packages/backend/migration/1655388169582-nsfw-detection-3.js index 12fc281327..40362cc20c 100644 --- a/packages/backend/migration/1655388169582-nsfw-detection-3.js +++ b/packages/backend/migration/1655388169582-nsfw-detection-3.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1655393015659-nsfw-detection-4.js b/packages/backend/migration/1655393015659-nsfw-detection-4.js index 39fb175679..d74fe9c929 100644 --- a/packages/backend/migration/1655393015659-nsfw-detection-4.js +++ b/packages/backend/migration/1655393015659-nsfw-detection-4.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1655813815729-driveCapacityOverrideMb.js b/packages/backend/migration/1655813815729-driveCapacityOverrideMb.js index e64c8c1b82..7e97f9dc74 100644 --- a/packages/backend/migration/1655813815729-driveCapacityOverrideMb.js +++ b/packages/backend/migration/1655813815729-driveCapacityOverrideMb.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1655918165614-user-ip.js b/packages/backend/migration/1655918165614-user-ip.js index 668c6d909b..ccb3ceb49d 100644 --- a/packages/backend/migration/1655918165614-user-ip.js +++ b/packages/backend/migration/1655918165614-user-ip.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1656122560740-file-ip.js b/packages/backend/migration/1656122560740-file-ip.js index e5efaf3d9f..dc02df0e68 100644 --- a/packages/backend/migration/1656122560740-file-ip.js +++ b/packages/backend/migration/1656122560740-file-ip.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1656251734807-nsfw-detection-5.js b/packages/backend/migration/1656251734807-nsfw-detection-5.js index 9b36bd76eb..06da9251b1 100644 --- a/packages/backend/migration/1656251734807-nsfw-detection-5.js +++ b/packages/backend/migration/1656251734807-nsfw-detection-5.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1656328812281-ip-2.js b/packages/backend/migration/1656328812281-ip-2.js index 39fcd1d83d..1b53e697de 100644 --- a/packages/backend/migration/1656328812281-ip-2.js +++ b/packages/backend/migration/1656328812281-ip-2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1656408772602-nsfw-detection-6.js b/packages/backend/migration/1656408772602-nsfw-detection-6.js index efadd22e5d..0adc8bb793 100644 --- a/packages/backend/migration/1656408772602-nsfw-detection-6.js +++ b/packages/backend/migration/1656408772602-nsfw-detection-6.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1656772790599-user-moderation-note.js b/packages/backend/migration/1656772790599-user-moderation-note.js index ef2f0f6522..63a993851f 100644 --- a/packages/backend/migration/1656772790599-user-moderation-note.js +++ b/packages/backend/migration/1656772790599-user-moderation-note.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1657346559800-active-email-validation.js b/packages/backend/migration/1657346559800-active-email-validation.js index e8d5b29cdf..44b1f3f4fa 100644 --- a/packages/backend/migration/1657346559800-active-email-validation.js +++ b/packages/backend/migration/1657346559800-active-email-validation.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1664694635394-turnstile.js b/packages/backend/migration/1664694635394-turnstile.js index a9baf4c657..3ec6da9136 100644 --- a/packages/backend/migration/1664694635394-turnstile.js +++ b/packages/backend/migration/1664694635394-turnstile.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1665091090561-add-renote-muting.js b/packages/backend/migration/1665091090561-add-renote-muting.js index 5748572517..a22d7037f3 100644 --- a/packages/backend/migration/1665091090561-add-renote-muting.js +++ b/packages/backend/migration/1665091090561-add-renote-muting.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js b/packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js index 431241897d..a317468ac9 100644 --- a/packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js +++ b/packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1671924750884-RetentionAggregation.js b/packages/backend/migration/1671924750884-RetentionAggregation.js index 67079bb7a1..5057bf1060 100644 --- a/packages/backend/migration/1671924750884-RetentionAggregation.js +++ b/packages/backend/migration/1671924750884-RetentionAggregation.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1671926422832-RetentionAggregation2.js b/packages/backend/migration/1671926422832-RetentionAggregation2.js index f26e0f7d2e..665e24d721 100644 --- a/packages/backend/migration/1671926422832-RetentionAggregation2.js +++ b/packages/backend/migration/1671926422832-RetentionAggregation2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1672562400597-PerUserPvChart.js b/packages/backend/migration/1672562400597-PerUserPvChart.js index 844f665a8b..1fbe1eb14a 100644 --- a/packages/backend/migration/1672562400597-PerUserPvChart.js +++ b/packages/backend/migration/1672562400597-PerUserPvChart.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1672703171386-remove-latestRequestSentAt.js b/packages/backend/migration/1672703171386-remove-latestRequestSentAt.js index fa73fc8977..f053e5c20c 100644 --- a/packages/backend/migration/1672703171386-remove-latestRequestSentAt.js +++ b/packages/backend/migration/1672703171386-remove-latestRequestSentAt.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1672704017999-remove-lastCommunicatedAt.js b/packages/backend/migration/1672704017999-remove-lastCommunicatedAt.js index abf209162b..b71f7e1306 100644 --- a/packages/backend/migration/1672704017999-remove-lastCommunicatedAt.js +++ b/packages/backend/migration/1672704017999-remove-lastCommunicatedAt.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1672704136584-remove-latestStatus.js b/packages/backend/migration/1672704136584-remove-latestStatus.js index d75344c053..f08ed96a45 100644 --- a/packages/backend/migration/1672704136584-remove-latestStatus.js +++ b/packages/backend/migration/1672704136584-remove-latestStatus.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1672822262496-Flash.js b/packages/backend/migration/1672822262496-Flash.js index fd3f77d893..e45055b3cc 100644 --- a/packages/backend/migration/1672822262496-Flash.js +++ b/packages/backend/migration/1672822262496-Flash.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1673336077243-PollChoiceLength.js b/packages/backend/migration/1673336077243-PollChoiceLength.js index 7bd65149d6..8c4a5007e4 100644 --- a/packages/backend/migration/1673336077243-PollChoiceLength.js +++ b/packages/backend/migration/1673336077243-PollChoiceLength.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1673500412259-Role.js b/packages/backend/migration/1673500412259-Role.js index 6bfb31e08e..2bf6a7f4e8 100644 --- a/packages/backend/migration/1673500412259-Role.js +++ b/packages/backend/migration/1673500412259-Role.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1673515526953-RoleColor.js b/packages/backend/migration/1673515526953-RoleColor.js index b856e4183b..693dcfb0b6 100644 --- a/packages/backend/migration/1673515526953-RoleColor.js +++ b/packages/backend/migration/1673515526953-RoleColor.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1673522856499-RoleIroiro.js b/packages/backend/migration/1673522856499-RoleIroiro.js index 40635e50d8..10a6eef162 100644 --- a/packages/backend/migration/1673522856499-RoleIroiro.js +++ b/packages/backend/migration/1673522856499-RoleIroiro.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1673524604156-RoleLastUsedAt.js b/packages/backend/migration/1673524604156-RoleLastUsedAt.js index 3bbb8000d8..5bbd0c39ac 100644 --- a/packages/backend/migration/1673524604156-RoleLastUsedAt.js +++ b/packages/backend/migration/1673524604156-RoleLastUsedAt.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1673570377815-RoleConditional.js b/packages/backend/migration/1673570377815-RoleConditional.js index 354fd6c66a..d2b25d121e 100644 --- a/packages/backend/migration/1673570377815-RoleConditional.js +++ b/packages/backend/migration/1673570377815-RoleConditional.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1673575973645-MetaClean.js b/packages/backend/migration/1673575973645-MetaClean.js index 684d62e8e9..7671785d94 100644 --- a/packages/backend/migration/1673575973645-MetaClean.js +++ b/packages/backend/migration/1673575973645-MetaClean.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1673783015567-Policies.js b/packages/backend/migration/1673783015567-Policies.js index 8674306620..4f76752c9f 100644 --- a/packages/backend/migration/1673783015567-Policies.js +++ b/packages/backend/migration/1673783015567-Policies.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1673812883772-firstRetrievedAt.js b/packages/backend/migration/1673812883772-firstRetrievedAt.js index 4111cc4ad0..82990e30b6 100644 --- a/packages/backend/migration/1673812883772-firstRetrievedAt.js +++ b/packages/backend/migration/1673812883772-firstRetrievedAt.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1674086433654-flashScriptLength.js b/packages/backend/migration/1674086433654-flashScriptLength.js index cdfb812ba0..996fe8c691 100644 --- a/packages/backend/migration/1674086433654-flashScriptLength.js +++ b/packages/backend/migration/1674086433654-flashScriptLength.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1674118260469-achievement.js b/packages/backend/migration/1674118260469-achievement.js index 072cf81ec3..5d79dc669e 100644 --- a/packages/backend/migration/1674118260469-achievement.js +++ b/packages/backend/migration/1674118260469-achievement.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1674255666603-loggedInDates.js b/packages/backend/migration/1674255666603-loggedInDates.js index a2a217da95..a6cf4b400f 100644 --- a/packages/backend/migration/1674255666603-loggedInDates.js +++ b/packages/backend/migration/1674255666603-loggedInDates.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1675053125067-fixforeignkeyreports.js b/packages/backend/migration/1675053125067-fixforeignkeyreports.js index 2ca383f563..d24dc5ec5a 100644 --- a/packages/backend/migration/1675053125067-fixforeignkeyreports.js +++ b/packages/backend/migration/1675053125067-fixforeignkeyreports.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1675404035646-cleanup.js b/packages/backend/migration/1675404035646-cleanup.js index 5cd5f5534a..c4e4332bbc 100644 --- a/packages/backend/migration/1675404035646-cleanup.js +++ b/packages/backend/migration/1675404035646-cleanup.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1675557528704-role-icon-badge.js b/packages/backend/migration/1675557528704-role-icon-badge.js index 48684075d1..ee39c07a51 100644 --- a/packages/backend/migration/1675557528704-role-icon-badge.js +++ b/packages/backend/migration/1675557528704-role-icon-badge.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1676434944993-drop-group.js b/packages/backend/migration/1676434944993-drop-group.js index 2df8a2d789..1db2d5818f 100644 --- a/packages/backend/migration/1676434944993-drop-group.js +++ b/packages/backend/migration/1676434944993-drop-group.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1676438468213-ad3.js b/packages/backend/migration/1676438468213-ad3.js index 83ca5828e3..8347f56b95 100644 --- a/packages/backend/migration/1676438468213-ad3.js +++ b/packages/backend/migration/1676438468213-ad3.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1677054292210-ad4.js b/packages/backend/migration/1677054292210-ad4.js index 11c42dd354..037e21059c 100644 --- a/packages/backend/migration/1677054292210-ad4.js +++ b/packages/backend/migration/1677054292210-ad4.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1677570181236-role-assignment-expires-at.js b/packages/backend/migration/1677570181236-role-assignment-expires-at.js index 6fe32ffeb0..e44bca1d20 100644 --- a/packages/backend/migration/1677570181236-role-assignment-expires-at.js +++ b/packages/backend/migration/1677570181236-role-assignment-expires-at.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1678164627293-per-note-reaction-acceptance.js b/packages/backend/migration/1678164627293-per-note-reaction-acceptance.js index 44c807499c..c85aafbd4c 100644 --- a/packages/backend/migration/1678164627293-per-note-reaction-acceptance.js +++ b/packages/backend/migration/1678164627293-per-note-reaction-acceptance.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1678426061773-tweak-varchar-length.js b/packages/backend/migration/1678426061773-tweak-varchar-length.js index 74c4fd6715..2541f99a19 100644 --- a/packages/backend/migration/1678426061773-tweak-varchar-length.js +++ b/packages/backend/migration/1678426061773-tweak-varchar-length.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1678427401214-remove-unused.js b/packages/backend/migration/1678427401214-remove-unused.js index e398b3700c..59f42da080 100644 --- a/packages/backend/migration/1678427401214-remove-unused.js +++ b/packages/backend/migration/1678427401214-remove-unused.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1678602320354-role-display-order.js b/packages/backend/migration/1678602320354-role-display-order.js index d3cc9792ca..0ab7b0c3e2 100644 --- a/packages/backend/migration/1678602320354-role-display-order.js +++ b/packages/backend/migration/1678602320354-role-display-order.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1678694614599-sensitive-words.js b/packages/backend/migration/1678694614599-sensitive-words.js index 13361f597e..5f69424eca 100644 --- a/packages/backend/migration/1678694614599-sensitive-words.js +++ b/packages/backend/migration/1678694614599-sensitive-words.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1678869617549-retention-date-key.js b/packages/backend/migration/1678869617549-retention-date-key.js index 1b995385b0..55bf6248e6 100644 --- a/packages/backend/migration/1678869617549-retention-date-key.js +++ b/packages/backend/migration/1678869617549-retention-date-key.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1678945242650-add-props-for-custom-emoji.js b/packages/backend/migration/1678945242650-add-props-for-custom-emoji.js index 5d1218be12..0054e78f88 100644 --- a/packages/backend/migration/1678945242650-add-props-for-custom-emoji.js +++ b/packages/backend/migration/1678945242650-add-props-for-custom-emoji.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1678953978856-clip-favorite.js b/packages/backend/migration/1678953978856-clip-favorite.js index 9d706c4dae..13145497bb 100644 --- a/packages/backend/migration/1678953978856-clip-favorite.js +++ b/packages/backend/migration/1678953978856-clip-favorite.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1679309757174-antenna-active.js b/packages/backend/migration/1679309757174-antenna-active.js index dadea25a7c..0b2bcc69ff 100644 --- a/packages/backend/migration/1679309757174-antenna-active.js +++ b/packages/backend/migration/1679309757174-antenna-active.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1679639483253-enableChartsForRemoteUser.js b/packages/backend/migration/1679639483253-enableChartsForRemoteUser.js index f2a13100e2..68576064f2 100644 --- a/packages/backend/migration/1679639483253-enableChartsForRemoteUser.js +++ b/packages/backend/migration/1679639483253-enableChartsForRemoteUser.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1679651580149-cleanup.js b/packages/backend/migration/1679651580149-cleanup.js index efee339c46..7049891cf0 100644 --- a/packages/backend/migration/1679651580149-cleanup.js +++ b/packages/backend/migration/1679651580149-cleanup.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1679652081809-enableChartsForFederatedInstances.js b/packages/backend/migration/1679652081809-enableChartsForFederatedInstances.js index 67be10e6fd..f3a07cbd1d 100644 --- a/packages/backend/migration/1679652081809-enableChartsForFederatedInstances.js +++ b/packages/backend/migration/1679652081809-enableChartsForFederatedInstances.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1680228513388-channelFavorite.js b/packages/backend/migration/1680228513388-channelFavorite.js index 866173305e..58eb7359f2 100644 --- a/packages/backend/migration/1680228513388-channelFavorite.js +++ b/packages/backend/migration/1680228513388-channelFavorite.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1680238118084-channelNotePining.js b/packages/backend/migration/1680238118084-channelNotePining.js index 78bafc0237..f1f192d7bb 100644 --- a/packages/backend/migration/1680238118084-channelNotePining.js +++ b/packages/backend/migration/1680238118084-channelNotePining.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1680491187535-cleanup.js b/packages/backend/migration/1680491187535-cleanup.js index f0b1bccdab..006b403bd1 100644 --- a/packages/backend/migration/1680491187535-cleanup.js +++ b/packages/backend/migration/1680491187535-cleanup.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1680582195041-cleanup.js b/packages/backend/migration/1680582195041-cleanup.js index 83d04b6186..7d941be8cf 100644 --- a/packages/backend/migration/1680582195041-cleanup.js +++ b/packages/backend/migration/1680582195041-cleanup.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1680702787050-UserMemo.js b/packages/backend/migration/1680702787050-UserMemo.js index 3f7afe8657..104d66ce24 100644 --- a/packages/backend/migration/1680702787050-UserMemo.js +++ b/packages/backend/migration/1680702787050-UserMemo.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1680775031481-avatar-url-and-banner-url.js b/packages/backend/migration/1680775031481-avatar-url-and-banner-url.js index 49295e70eb..c613ee511e 100644 --- a/packages/backend/migration/1680775031481-avatar-url-and-banner-url.js +++ b/packages/backend/migration/1680775031481-avatar-url-and-banner-url.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1680931179228-account-move.js b/packages/backend/migration/1680931179228-account-move.js index a8b5e4df68..203d838f57 100644 --- a/packages/backend/migration/1680931179228-account-move.js +++ b/packages/backend/migration/1680931179228-account-move.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1681400427971-serverRules.js b/packages/backend/migration/1681400427971-serverRules.js index 176783b50a..70a74ebfff 100644 --- a/packages/backend/migration/1681400427971-serverRules.js +++ b/packages/backend/migration/1681400427971-serverRules.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1681870960239-RoleTLSetting.js b/packages/backend/migration/1681870960239-RoleTLSetting.js index 2999051a3b..07b9bc4e35 100644 --- a/packages/backend/migration/1681870960239-RoleTLSetting.js +++ b/packages/backend/migration/1681870960239-RoleTLSetting.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1682190963894-movedAt.js b/packages/backend/migration/1682190963894-movedAt.js index 852cf58969..cc33da8747 100644 --- a/packages/backend/migration/1682190963894-movedAt.js +++ b/packages/backend/migration/1682190963894-movedAt.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1682754135458-preservedUsernames.js b/packages/backend/migration/1682754135458-preservedUsernames.js index 8aae3c2054..61723e4abd 100644 --- a/packages/backend/migration/1682754135458-preservedUsernames.js +++ b/packages/backend/migration/1682754135458-preservedUsernames.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1682985520254-channelColor.js b/packages/backend/migration/1682985520254-channelColor.js index 3c7f3101a5..43f1f48334 100644 --- a/packages/backend/migration/1682985520254-channelColor.js +++ b/packages/backend/migration/1682985520254-channelColor.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1683328299359-channelArchive.js b/packages/backend/migration/1683328299359-channelArchive.js index 10a87246de..759dcbfdae 100644 --- a/packages/backend/migration/1683328299359-channelArchive.js +++ b/packages/backend/migration/1683328299359-channelArchive.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1683682889948-prevent-ai-larning.js b/packages/backend/migration/1683682889948-prevent-ai-larning.js index 167c9f71d2..1dc3eec21f 100644 --- a/packages/backend/migration/1683682889948-prevent-ai-larning.js +++ b/packages/backend/migration/1683682889948-prevent-ai-larning.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1683683083083-public-reactions-default-true.js b/packages/backend/migration/1683683083083-public-reactions-default-true.js index f416e5ffa7..32cbe33b2f 100644 --- a/packages/backend/migration/1683683083083-public-reactions-default-true.js +++ b/packages/backend/migration/1683683083083-public-reactions-default-true.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1683789676867-fix-typo.js b/packages/backend/migration/1683789676867-fix-typo.js index d647d20e62..5cd686e2f1 100644 --- a/packages/backend/migration/1683789676867-fix-typo.js +++ b/packages/backend/migration/1683789676867-fix-typo.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1683847157541-UserList.js b/packages/backend/migration/1683847157541-UserList.js index 14a52d64f8..f9e79a43a1 100644 --- a/packages/backend/migration/1683847157541-UserList.js +++ b/packages/backend/migration/1683847157541-UserList.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1683869758873-UserListFavorites.js b/packages/backend/migration/1683869758873-UserListFavorites.js index aae4056845..aef4597a75 100644 --- a/packages/backend/migration/1683869758873-UserListFavorites.js +++ b/packages/backend/migration/1683869758873-UserListFavorites.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1684206886988-remove-showTimelineReplies.js b/packages/backend/migration/1684206886988-remove-showTimelineReplies.js index 398f9f0803..a0798f85c6 100644 --- a/packages/backend/migration/1684206886988-remove-showTimelineReplies.js +++ b/packages/backend/migration/1684206886988-remove-showTimelineReplies.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1684386446061-emoji-improve.js b/packages/backend/migration/1684386446061-emoji-improve.js index e7e94769b8..7bded84cc9 100644 --- a/packages/backend/migration/1684386446061-emoji-improve.js +++ b/packages/backend/migration/1684386446061-emoji-improve.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1685973839966-errorImageUrl.js b/packages/backend/migration/1685973839966-errorImageUrl.js index ca685ef088..c4a1567b9b 100644 --- a/packages/backend/migration/1685973839966-errorImageUrl.js +++ b/packages/backend/migration/1685973839966-errorImageUrl.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1688280713783-add-meta-options.js b/packages/backend/migration/1688280713783-add-meta-options.js index 77d1934925..ade8378c00 100644 --- a/packages/backend/migration/1688280713783-add-meta-options.js +++ b/packages/backend/migration/1688280713783-add-meta-options.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1688720440658-refactor-invite-system.js b/packages/backend/migration/1688720440658-refactor-invite-system.js index ea192a1950..20f178612d 100644 --- a/packages/backend/migration/1688720440658-refactor-invite-system.js +++ b/packages/backend/migration/1688720440658-refactor-invite-system.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1688880985544-add-index-to-relations.js b/packages/backend/migration/1688880985544-add-index-to-relations.js index c18903641c..6daac20329 100644 --- a/packages/backend/migration/1688880985544-add-index-to-relations.js +++ b/packages/backend/migration/1688880985544-add-index-to-relations.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1689102832143-nsfw-cache.js b/packages/backend/migration/1689102832143-nsfw-cache.js index 90d453418b..419588296e 100644 --- a/packages/backend/migration/1689102832143-nsfw-cache.js +++ b/packages/backend/migration/1689102832143-nsfw-cache.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1689325027964-UserBlacklistAnntena.js b/packages/backend/migration/1689325027964-UserBlacklistAnntena.js index 2dc7774493..ce246b20f8 100644 --- a/packages/backend/migration/1689325027964-UserBlacklistAnntena.js +++ b/packages/backend/migration/1689325027964-UserBlacklistAnntena.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class UserBlacklistAnntena1689325027964 { name = 'UserBlacklistAnntena1689325027964' diff --git a/packages/backend/migration/1690417561185-fix-renote-muting.js b/packages/backend/migration/1690417561185-fix-renote-muting.js index d9604ca26c..14150b0362 100644 --- a/packages/backend/migration/1690417561185-fix-renote-muting.js +++ b/packages/backend/migration/1690417561185-fix-renote-muting.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class FixRenoteMuting1690417561185 { name = 'FixRenoteMuting1690417561185' diff --git a/packages/backend/migration/1690417561186-ChangeCacheRemoteFilesDefault.js b/packages/backend/migration/1690417561186-ChangeCacheRemoteFilesDefault.js index 9bccdb3bb5..7eda5debe5 100644 --- a/packages/backend/migration/1690417561186-ChangeCacheRemoteFilesDefault.js +++ b/packages/backend/migration/1690417561186-ChangeCacheRemoteFilesDefault.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class ChangeCacheRemoteFilesDefault1690417561186 { name = 'ChangeCacheRemoteFilesDefault1690417561186' diff --git a/packages/backend/migration/1690417561187-Fix.js b/packages/backend/migration/1690417561187-Fix.js index 7f1d62d68c..e780e66d7b 100644 --- a/packages/backend/migration/1690417561187-Fix.js +++ b/packages/backend/migration/1690417561187-Fix.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class Fix1690417561187 { name = 'Fix1690417561187' diff --git a/packages/backend/migration/1690569881926-user-2fa-backup-codes.js b/packages/backend/migration/1690569881926-user-2fa-backup-codes.js index a3ef8dcf08..2049df8ea2 100644 --- a/packages/backend/migration/1690569881926-user-2fa-backup-codes.js +++ b/packages/backend/migration/1690569881926-user-2fa-backup-codes.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class User2faBackupCodes1690569881926 { name = 'User2faBackupCodes1690569881926' diff --git a/packages/backend/migration/1690782653311-SensitiveChannel.js b/packages/backend/migration/1690782653311-SensitiveChannel.js index afec1a2153..e76dda5180 100644 --- a/packages/backend/migration/1690782653311-SensitiveChannel.js +++ b/packages/backend/migration/1690782653311-SensitiveChannel.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1690796169261-play-visibility.js b/packages/backend/migration/1690796169261-play-visibility.js index 5e5843bfee..c57fa7a109 100644 --- a/packages/backend/migration/1690796169261-play-visibility.js +++ b/packages/backend/migration/1690796169261-play-visibility.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1691649257651-refine-announcement.js b/packages/backend/migration/1691649257651-refine-announcement.js index ac621155d5..d8d63f3103 100644 --- a/packages/backend/migration/1691649257651-refine-announcement.js +++ b/packages/backend/migration/1691649257651-refine-announcement.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class RefineAnnouncement1691649257651 { name = 'RefineAnnouncement1691649257651' diff --git a/packages/backend/migration/1691657412740-refine-announcement-2.js b/packages/backend/migration/1691657412740-refine-announcement-2.js index 67edf19659..8791f99f44 100644 --- a/packages/backend/migration/1691657412740-refine-announcement-2.js +++ b/packages/backend/migration/1691657412740-refine-announcement-2.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class RefineAnnouncement21691657412740 { name = 'RefineAnnouncement21691657412740' diff --git a/packages/backend/migration/1691959191872-passkey-support.js b/packages/backend/migration/1691959191872-passkey-support.js index 1da9bdb363..55b571d60d 100644 --- a/packages/backend/migration/1691959191872-passkey-support.js +++ b/packages/backend/migration/1691959191872-passkey-support.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1694850832075-server-icons-and-manifest.js b/packages/backend/migration/1694850832075-server-icons-and-manifest.js index 235bf05744..1bd8979d9b 100644 --- a/packages/backend/migration/1694850832075-server-icons-and-manifest.js +++ b/packages/backend/migration/1694850832075-server-icons-and-manifest.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1694915420864-clipped-count.js b/packages/backend/migration/1694915420864-clipped-count.js index 6d70aaecf1..1ad8e04ce0 100644 --- a/packages/backend/migration/1694915420864-clipped-count.js +++ b/packages/backend/migration/1694915420864-clipped-count.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1695260774117-verified-links.js b/packages/backend/migration/1695260774117-verified-links.js index 64c8a9ad8f..18e0571d81 100644 --- a/packages/backend/migration/1695260774117-verified-links.js +++ b/packages/backend/migration/1695260774117-verified-links.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class VerifiedLinks1695260774117 { name = 'VerifiedLinks1695260774117' diff --git a/packages/backend/migration/1695288787870-following-notify.js b/packages/backend/migration/1695288787870-following-notify.js index b3f78d5f2a..e7e2194b15 100644 --- a/packages/backend/migration/1695288787870-following-notify.js +++ b/packages/backend/migration/1695288787870-following-notify.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class FollowingNotify1695288787870 { name = 'FollowingNotify1695288787870' diff --git a/packages/backend/migration/1695440131671-short-name.js b/packages/backend/migration/1695440131671-short-name.js index fdc256caf8..2c37297fc1 100644 --- a/packages/backend/migration/1695440131671-short-name.js +++ b/packages/backend/migration/1695440131671-short-name.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class ShortName1695440131671 { name = 'ShortName1695440131671' diff --git a/packages/backend/migration/1695605508898-mutingNotificationTypes.js b/packages/backend/migration/1695605508898-mutingNotificationTypes.js index 67d4243142..8c0e52a2f0 100644 --- a/packages/backend/migration/1695605508898-mutingNotificationTypes.js +++ b/packages/backend/migration/1695605508898-mutingNotificationTypes.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class MutingNotificationTypes1695605508898 { name = 'MutingNotificationTypes1695605508898' diff --git a/packages/backend/migration/1695901659683-note-updated-at.js b/packages/backend/migration/1695901659683-note-updated-at.js index e828fb1a6f..d8a151a1f7 100644 --- a/packages/backend/migration/1695901659683-note-updated-at.js +++ b/packages/backend/migration/1695901659683-note-updated-at.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class NoteUpdatedAt1695901659683 { name = 'NoteUpdatedAt1695901659683' diff --git a/packages/backend/migration/1695944637565-notificationRecieveConfig.js b/packages/backend/migration/1695944637565-notificationRecieveConfig.js index 04a40993c0..42d3dce5d6 100644 --- a/packages/backend/migration/1695944637565-notificationRecieveConfig.js +++ b/packages/backend/migration/1695944637565-notificationRecieveConfig.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1696003580220-AddSomeUrls.js b/packages/backend/migration/1696003580220-AddSomeUrls.js index 213e39e7af..683aa5eeed 100644 --- a/packages/backend/migration/1696003580220-AddSomeUrls.js +++ b/packages/backend/migration/1696003580220-AddSomeUrls.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1696222183852-withReplies.js b/packages/backend/migration/1696222183852-withReplies.js index 84a5511d17..9f65d5f6a1 100644 --- a/packages/backend/migration/1696222183852-withReplies.js +++ b/packages/backend/migration/1696222183852-withReplies.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1696323464251-user-list-membership.js b/packages/backend/migration/1696323464251-user-list-membership.js index dc1d438dd7..7534040c4c 100644 --- a/packages/backend/migration/1696323464251-user-list-membership.js +++ b/packages/backend/migration/1696323464251-user-list-membership.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class UserListMembership1696323464251 { name = 'UserListMembership1696323464251' diff --git a/packages/backend/migration/1696331570827-hibernation.js b/packages/backend/migration/1696331570827-hibernation.js index 1487ece77c..119d35913f 100644 --- a/packages/backend/migration/1696331570827-hibernation.js +++ b/packages/backend/migration/1696331570827-hibernation.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class Hibernation1696331570827 { name = 'Hibernation1696331570827' diff --git a/packages/backend/migration/1696332072038-clean.js b/packages/backend/migration/1696332072038-clean.js index 92a6810d6a..97dba655f4 100644 --- a/packages/backend/migration/1696332072038-clean.js +++ b/packages/backend/migration/1696332072038-clean.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class Clean1696332072038 { name = 'Clean1696332072038' diff --git a/packages/backend/migration/1696373953614-meta-cache-settings.js b/packages/backend/migration/1696373953614-meta-cache-settings.js index cbbe471d45..f994b76ef2 100644 --- a/packages/backend/migration/1696373953614-meta-cache-settings.js +++ b/packages/backend/migration/1696373953614-meta-cache-settings.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1696388600237-revert-note-edit.js b/packages/backend/migration/1696388600237-revert-note-edit.js index d353c851db..83bc552c35 100644 --- a/packages/backend/migration/1696388600237-revert-note-edit.js +++ b/packages/backend/migration/1696388600237-revert-note-edit.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1696405744672-clean-up.js b/packages/backend/migration/1696405744672-clean-up.js index 4e1ee6cd61..5ec89b08f4 100644 --- a/packages/backend/migration/1696405744672-clean-up.js +++ b/packages/backend/migration/1696405744672-clean-up.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1696569742153-clean-up.js b/packages/backend/migration/1696569742153-clean-up.js index b7c981bab2..de48fab5aa 100644 --- a/packages/backend/migration/1696569742153-clean-up.js +++ b/packages/backend/migration/1696569742153-clean-up.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1696581429196-clean-up.js b/packages/backend/migration/1696581429196-clean-up.js index b6723f3430..da69b4e9de 100644 --- a/packages/backend/migration/1696581429196-clean-up.js +++ b/packages/backend/migration/1696581429196-clean-up.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1696743032098-AdsOnStream.js b/packages/backend/migration/1696743032098-AdsOnStream.js index 43b9f83e66..c86ee84883 100644 --- a/packages/backend/migration/1696743032098-AdsOnStream.js +++ b/packages/backend/migration/1696743032098-AdsOnStream.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1696807733453-userListUserId.js b/packages/backend/migration/1696807733453-userListUserId.js index 8f0ae2cd87..ab2ba07fb5 100644 --- a/packages/backend/migration/1696807733453-userListUserId.js +++ b/packages/backend/migration/1696807733453-userListUserId.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1696808725134-userListUserId-2.js b/packages/backend/migration/1696808725134-userListUserId-2.js index cc504e761c..5bcb5aedc2 100644 --- a/packages/backend/migration/1696808725134-userListUserId-2.js +++ b/packages/backend/migration/1696808725134-userListUserId-2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1697247230117-InstanceSilence.js b/packages/backend/migration/1697247230117-InstanceSilence.js index 309d817087..5fdbca3b27 100644 --- a/packages/backend/migration/1697247230117-InstanceSilence.js +++ b/packages/backend/migration/1697247230117-InstanceSilence.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1697420555911-deleteCreatedAt.js b/packages/backend/migration/1697420555911-deleteCreatedAt.js index 407a5f449a..958d61a348 100644 --- a/packages/backend/migration/1697420555911-deleteCreatedAt.js +++ b/packages/backend/migration/1697420555911-deleteCreatedAt.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1697436246389-antenna-localOnly.js b/packages/backend/migration/1697436246389-antenna-localOnly.js index d7c0ca6510..0228673291 100644 --- a/packages/backend/migration/1697436246389-antenna-localOnly.js +++ b/packages/backend/migration/1697436246389-antenna-localOnly.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1697441463087-FollowRequestWithReplies.js b/packages/backend/migration/1697441463087-FollowRequestWithReplies.js index 58b61aff63..214c6f6680 100644 --- a/packages/backend/migration/1697441463087-FollowRequestWithReplies.js +++ b/packages/backend/migration/1697441463087-FollowRequestWithReplies.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1697673894459-note-reactionAndUserPairCache.js b/packages/backend/migration/1697673894459-note-reactionAndUserPairCache.js index fab07fd3f4..fe0ea282d2 100644 --- a/packages/backend/migration/1697673894459-note-reactionAndUserPairCache.js +++ b/packages/backend/migration/1697673894459-note-reactionAndUserPairCache.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1697847397844-avatar-decoration.js b/packages/backend/migration/1697847397844-avatar-decoration.js index 32ee47e968..1f22139746 100644 --- a/packages/backend/migration/1697847397844-avatar-decoration.js +++ b/packages/backend/migration/1697847397844-avatar-decoration.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1697941908548-avatar-decoration2.js b/packages/backend/migration/1697941908548-avatar-decoration2.js index 58344e2bb6..9d15c1c3d0 100644 --- a/packages/backend/migration/1697941908548-avatar-decoration2.js +++ b/packages/backend/migration/1697941908548-avatar-decoration2.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1698041201306-enable-ftt.js b/packages/backend/migration/1698041201306-enable-ftt.js index c67dda6f5f..6769ed53b5 100644 --- a/packages/backend/migration/1698041201306-enable-ftt.js +++ b/packages/backend/migration/1698041201306-enable-ftt.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1698840138000-add-allow-renote-to-external.js b/packages/backend/migration/1698840138000-add-allow-renote-to-external.js index 8ce35b0f69..0edf298841 100644 --- a/packages/backend/migration/1698840138000-add-allow-renote-to-external.js +++ b/packages/backend/migration/1698840138000-add-allow-renote-to-external.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1699141698112-announcement-silence.js b/packages/backend/migration/1699141698112-announcement-silence.js index f462d30b51..eef9b076fc 100644 --- a/packages/backend/migration/1699141698112-announcement-silence.js +++ b/packages/backend/migration/1699141698112-announcement-silence.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1700096812223-enableFanoutTimelineDbFallback.js b/packages/backend/migration/1700096812223-enableFanoutTimelineDbFallback.js index 2ab93624ce..94fa588985 100644 --- a/packages/backend/migration/1700096812223-enableFanoutTimelineDbFallback.js +++ b/packages/backend/migration/1700096812223-enableFanoutTimelineDbFallback.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1700303245007-supportVerifyMailApi.js b/packages/backend/migration/1700303245007-supportVerifyMailApi.js index 58ff7a69c4..3ac59ec37a 100644 --- a/packages/backend/migration/1700303245007-supportVerifyMailApi.js +++ b/packages/backend/migration/1700303245007-supportVerifyMailApi.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1700383825690-hard-mute.js b/packages/backend/migration/1700383825690-hard-mute.js index 92c3ada4a1..afd3247f5c 100644 --- a/packages/backend/migration/1700383825690-hard-mute.js +++ b/packages/backend/migration/1700383825690-hard-mute.js @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export class HardMute1700383825690 { name = 'HardMute1700383825690' diff --git a/packages/backend/migration/1700902349231-add-bday-index.js b/packages/backend/migration/1700902349231-add-bday-index.js index c58165c70e..251526fc26 100644 --- a/packages/backend/migration/1700902349231-add-bday-index.js +++ b/packages/backend/migration/1700902349231-add-bday-index.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1702718871541-ffVisibility.js b/packages/backend/migration/1702718871541-ffVisibility.js index 164af00f25..e9e820c897 100644 --- a/packages/backend/migration/1702718871541-ffVisibility.js +++ b/packages/backend/migration/1702718871541-ffVisibility.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1703209889304-bannedEmailDomains.js b/packages/backend/migration/1703209889304-bannedEmailDomains.js index 2fdd4e1183..5dc99c138f 100644 --- a/packages/backend/migration/1703209889304-bannedEmailDomains.js +++ b/packages/backend/migration/1703209889304-bannedEmailDomains.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1703658526000-supportTrueMailApi.js b/packages/backend/migration/1703658526000-supportTrueMailApi.js index fb62653e40..0054d54122 100644 --- a/packages/backend/migration/1703658526000-supportTrueMailApi.js +++ b/packages/backend/migration/1703658526000-supportTrueMailApi.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1704373210054-support-mcaptcha.js b/packages/backend/migration/1704373210054-support-mcaptcha.js deleted file mode 100644 index 50b4801e14..0000000000 --- a/packages/backend/migration/1704373210054-support-mcaptcha.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class SupportMcaptcha1704373210054 { - name = 'SupportMcaptcha1704373210054' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "enableMcaptcha" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`ALTER TABLE "meta" ADD "mcaptchaSitekey" character varying(1024)`); - await queryRunner.query(`ALTER TABLE "meta" ADD "mcaptchaSecretKey" character varying(1024)`); - await queryRunner.query(`ALTER TABLE "meta" ADD "mcaptchaInstanceUrl" character varying(1024)`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "mcaptchaInstanceUrl"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "mcaptchaSecretKey"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "mcaptchaSitekey"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableMcaptcha"`); - } -} diff --git a/packages/backend/migration/1704959805077-bubble-game-record.js b/packages/backend/migration/1704959805077-bubble-game-record.js deleted file mode 100644 index 6c4d7ab1a9..0000000000 --- a/packages/backend/migration/1704959805077-bubble-game-record.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class BubbleGameRecord1704959805077 { - name = 'BubbleGameRecord1704959805077' - - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "bubble_game_record" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "seededAt" TIMESTAMP WITH TIME ZONE NOT NULL, "seed" character varying(1024) NOT NULL, "gameVersion" integer NOT NULL, "gameMode" character varying(128) NOT NULL, "score" integer NOT NULL, "logs" jsonb NOT NULL DEFAULT '[]', "isVerified" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_a75395fe404b392e2893b50d7ea" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_75276757070d21fdfaf4c05290" ON "bubble_game_record" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_4ae7053179014915d1432d3f40" ON "bubble_game_record" ("seededAt") `); - await queryRunner.query(`CREATE INDEX "IDX_26d4ee490b5a487142d35466ee" ON "bubble_game_record" ("score") `); - await queryRunner.query(`ALTER TABLE "bubble_game_record" ADD CONSTRAINT "FK_75276757070d21fdfaf4c052909" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "bubble_game_record" DROP CONSTRAINT "FK_75276757070d21fdfaf4c052909"`); - await queryRunner.query(`DROP INDEX "public"."IDX_26d4ee490b5a487142d35466ee"`); - await queryRunner.query(`DROP INDEX "public"."IDX_4ae7053179014915d1432d3f40"`); - await queryRunner.query(`DROP INDEX "public"."IDX_75276757070d21fdfaf4c05290"`); - await queryRunner.query(`DROP TABLE "bubble_game_record"`); - } -} diff --git a/packages/backend/migration/1705222772858-optimize-note-index-for-array-column.js b/packages/backend/migration/1705222772858-optimize-note-index-for-array-column.js deleted file mode 100644 index fe0a5a2bcf..0000000000 --- a/packages/backend/migration/1705222772858-optimize-note-index-for-array-column.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class OptimizeNoteIndexForArrayColumns1705222772858 { - name = 'OptimizeNoteIndexForArrayColumns1705222772858' - - async up(queryRunner) { - await queryRunner.query(`DROP INDEX "public"."IDX_796a8c03959361f97dc2be1d5c"`); - await queryRunner.query(`DROP INDEX "public"."IDX_54ebcb6d27222913b908d56fd8"`); - await queryRunner.query(`DROP INDEX "public"."IDX_88937d94d7443d9a99a76fa5c0"`); - await queryRunner.query(`DROP INDEX "public"."IDX_51c063b6a133a9cb87145450f5"`); - await queryRunner.query(`CREATE INDEX "IDX_NOTE_FILE_IDS" ON "note" using gin ("fileIds")`) - } - - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_NOTE_FILE_IDS"`) - await queryRunner.query(`CREATE INDEX "IDX_51c063b6a133a9cb87145450f5" ON "note" ("fileIds") `); - await queryRunner.query(`CREATE INDEX "IDX_88937d94d7443d9a99a76fa5c0" ON "note" ("tags") `); - await queryRunner.query(`CREATE INDEX "IDX_54ebcb6d27222913b908d56fd8" ON "note" ("mentions") `); - await queryRunner.query(`CREATE INDEX "IDX_796a8c03959361f97dc2be1d5c" ON "note" ("visibleUserIds") `); - } -} diff --git a/packages/backend/migration/1705475608437-reversi.js b/packages/backend/migration/1705475608437-reversi.js deleted file mode 100644 index 9921728457..0000000000 --- a/packages/backend/migration/1705475608437-reversi.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class Reversi1705475608437 { - name = 'Reversi1705475608437' - - async up(queryRunner) { - await queryRunner.query(`DROP INDEX "public"."IDX_b46ec40746efceac604142be1c"`); - await queryRunner.query(`DROP INDEX "public"."IDX_b604d92d6c7aec38627f6eaf16"`); - await queryRunner.query(`ALTER TABLE "reversi_game" DROP COLUMN "createdAt"`); - await queryRunner.query(`ALTER TABLE "reversi_matching" DROP COLUMN "createdAt"`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "reversi_matching" ADD "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL`); - await queryRunner.query(`ALTER TABLE "reversi_game" ADD "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL`); - await queryRunner.query(`CREATE INDEX "IDX_b604d92d6c7aec38627f6eaf16" ON "reversi_matching" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_b46ec40746efceac604142be1c" ON "reversi_game" ("createdAt") `); - } -} diff --git a/packages/backend/migration/1705654039457-reversi-2.js b/packages/backend/migration/1705654039457-reversi-2.js deleted file mode 100644 index 6685dca73b..0000000000 --- a/packages/backend/migration/1705654039457-reversi-2.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class Reversi21705654039457 { - name = 'Reversi21705654039457' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "reversi_game" RENAME COLUMN "user1Accepted" TO "user1Ready"`); - await queryRunner.query(`ALTER TABLE "reversi_game" RENAME COLUMN "user2Accepted" TO "user2Ready"`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "reversi_game" RENAME COLUMN "user1Ready" TO "user1Accepted"`); - await queryRunner.query(`ALTER TABLE "reversi_game" RENAME COLUMN "user2Ready" TO "user2Accepted"`); - } -} diff --git a/packages/backend/migration/1705793785675-reversi-3.js b/packages/backend/migration/1705793785675-reversi-3.js deleted file mode 100644 index 94b1e4fac9..0000000000 --- a/packages/backend/migration/1705793785675-reversi-3.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class Reversi31705793785675 { - name = 'Reversi31705793785675' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "reversi_game" RENAME COLUMN "surrendered" TO "surrenderedUserId"`); - await queryRunner.query(`ALTER TABLE "reversi_game" ADD "timeoutUserId" character varying(32)`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "reversi_game" DROP COLUMN "timeoutUserId"`); - await queryRunner.query(`ALTER TABLE "reversi_game" RENAME COLUMN "surrenderedUserId" TO "surrendered"`); - } -} diff --git a/packages/backend/migration/1705794768153-reversi-4.js b/packages/backend/migration/1705794768153-reversi-4.js deleted file mode 100644 index 95119cabba..0000000000 --- a/packages/backend/migration/1705794768153-reversi-4.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class Reversi41705794768153 { - name = 'Reversi41705794768153' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "reversi_game" ADD "endedAt" TIMESTAMP WITH TIME ZONE`); - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."endedAt" IS 'The ended date of the ReversiGame.'`); - } - - async down(queryRunner) { - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."endedAt" IS 'The ended date of the ReversiGame.'`); - await queryRunner.query(`ALTER TABLE "reversi_game" DROP COLUMN "endedAt"`); - } -} diff --git a/packages/backend/migration/1705798904141-reversi-5.js b/packages/backend/migration/1705798904141-reversi-5.js deleted file mode 100644 index f1a1a42d46..0000000000 --- a/packages/backend/migration/1705798904141-reversi-5.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class Reversi51705798904141 { - name = 'Reversi51705798904141' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "reversi_game" ADD "timeLimitForEachTurn" smallint NOT NULL DEFAULT '90'`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "reversi_game" DROP COLUMN "timeLimitForEachTurn"`); - } -} diff --git a/packages/backend/migration/1706081514499-reversi-6.js b/packages/backend/migration/1706081514499-reversi-6.js deleted file mode 100644 index 0d9e5cbbf2..0000000000 --- a/packages/backend/migration/1706081514499-reversi-6.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class Reversi61706081514499 { - name = 'Reversi61706081514499' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "reversi_game" ADD "noIrregularRules" boolean NOT NULL DEFAULT false`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "reversi_game" DROP COLUMN "noIrregularRules"`); - } -} diff --git a/packages/backend/migration/1706791962000-fix-meta-disableRegistration.js b/packages/backend/migration/1706791962000-fix-meta-disableRegistration.js deleted file mode 100644 index 1c45f3756d..0000000000 --- a/packages/backend/migration/1706791962000-fix-meta-disableRegistration.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class FixMetaDisableRegistration1706791962000 { - name = 'FixMetaDisableRegistration1706791962000' - - async up(queryRunner) { - await queryRunner.query(`alter table meta alter column "disableRegistration" set default true;`); - } - - async down(queryRunner) { - await queryRunner.query(`alter table meta alter column "disableRegistration" set default false;`); - } -} diff --git a/packages/backend/migration/1707429690000-prohibited-words.js b/packages/backend/migration/1707429690000-prohibited-words.js deleted file mode 100644 index 44e96cb160..0000000000 --- a/packages/backend/migration/1707429690000-prohibited-words.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class prohibitedWords1707429690000 { - name = 'prohibitedWords1707429690000' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "prohibitedWords" character varying(1024) array NOT NULL DEFAULT '{}'`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "prohibitedWords"`); - } -} diff --git a/packages/backend/migration/1707808106310-MakeRepositoryUrlNullable.js b/packages/backend/migration/1707808106310-MakeRepositoryUrlNullable.js deleted file mode 100644 index 335b14976c..0000000000 --- a/packages/backend/migration/1707808106310-MakeRepositoryUrlNullable.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class MakeRepositoryUrlNullable1707808106310 { - name = 'MakeRepositoryUrlNullable1707808106310' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "repositoryUrl" DROP NOT NULL`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "repositoryUrl" SET NOT NULL`); - } -} diff --git a/packages/backend/migration/1708266695091-repositoryUrl-from-syuilo-to-misskey-dev.js b/packages/backend/migration/1708266695091-repositoryUrl-from-syuilo-to-misskey-dev.js deleted file mode 100644 index e4dbaa16d0..0000000000 --- a/packages/backend/migration/1708266695091-repositoryUrl-from-syuilo-to-misskey-dev.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class RepositoryUrlFromSyuiloToMisskeyDev1708266695091 { - name = 'RepositoryUrlFromSyuiloToMisskeyDev1708266695091' - - async up(queryRunner) { - await queryRunner.query(`UPDATE "meta" SET "repositoryUrl" = 'https://github.com/misskey-dev/misskey' WHERE "repositoryUrl" = 'https://github.com/syuilo/misskey'`); - } - - async down(queryRunner) { - // no valid down migration - } -} diff --git a/packages/backend/migration/1708399372194-per-instance-mod-note.js b/packages/backend/migration/1708399372194-per-instance-mod-note.js deleted file mode 100644 index 339a4d7af9..0000000000 --- a/packages/backend/migration/1708399372194-per-instance-mod-note.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class PerInstanceModNote1708399372194 { - name = 'PerInstanceModNote1708399372194' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" ADD "moderationNote" character varying(16384) NOT NULL DEFAULT ''`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "moderationNote"`); - } -} diff --git a/packages/backend/migration/1710512074000-url-preview-meta.js b/packages/backend/migration/1710512074000-url-preview-meta.js deleted file mode 100644 index 8af521bbf4..0000000000 --- a/packages/backend/migration/1710512074000-url-preview-meta.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class UrlPreviewMeta1710512074000 { - name = 'UrlPreviewMeta1710512074000' - - async up(queryRunner) { - await queryRunner.query(` - alter table meta - rename column "summalyProxy" to "urlPreviewSummaryProxyUrl"; - alter table meta - add "urlPreviewEnabled" boolean default true not null; - alter table meta - add "urlPreviewTimeout" integer default 10000 not null; - alter table meta - add "urlPreviewMaximumContentLength" bigint default 10485760 not null; - alter table meta - add "urlPreviewRequireContentLength" boolean default false not null; - alter table meta - add "urlPreviewUserAgent" varchar(1024) default null; - `); - } - - async down(queryRunner) { - await queryRunner.query(` - alter table meta - rename column "urlPreviewSummaryProxyUrl" to "summalyProxy"; - alter table meta - drop column "urlPreviewEnabled"; - alter table meta - drop column "urlPreviewTimeout"; - alter table meta - drop column "urlPreviewMaximumContentLength"; - alter table meta - drop column "urlPreviewRequireContentLength"; - alter table meta - drop column "urlPreviewUserAgent"; - `); - } -} diff --git a/packages/backend/migration/1710919614510-antenna-exclude-bots.js b/packages/backend/migration/1710919614510-antenna-exclude-bots.js deleted file mode 100644 index fac84317cc..0000000000 --- a/packages/backend/migration/1710919614510-antenna-exclude-bots.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class AntennaExcludeBots1710919614510 { - name = 'AntennaExcludeBots1710919614510' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "antenna" ADD "excludeBots" boolean NOT NULL DEFAULT false`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "excludeBots"`); - } -} diff --git a/packages/backend/migration/1713656541000-abuse-report-notification.js b/packages/backend/migration/1713656541000-abuse-report-notification.js deleted file mode 100644 index 4a754f81e2..0000000000 --- a/packages/backend/migration/1713656541000-abuse-report-notification.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class AbuseReportNotification1713656541000 { - name = 'AbuseReportNotification1713656541000' - - async up(queryRunner) { - await queryRunner.query(` - CREATE TABLE "system_webhook" ( - "id" varchar(32) NOT NULL, - "isActive" boolean NOT NULL DEFAULT true, - "updatedAt" timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP, - "latestSentAt" timestamp with time zone NULL DEFAULT NULL, - "latestStatus" integer NULL DEFAULT NULL, - "name" varchar(255) NOT NULL, - "on" varchar(128) [] NOT NULL DEFAULT '{}'::character varying[], - "url" varchar(1024) NOT NULL, - "secret" varchar(1024) NOT NULL, - CONSTRAINT "PK_system_webhook_id" PRIMARY KEY ("id") - ); - CREATE INDEX "IDX_system_webhook_isActive" ON "system_webhook" ("isActive"); - CREATE INDEX "IDX_system_webhook_on" ON "system_webhook" USING gin ("on"); - - CREATE TABLE "abuse_report_notification_recipient" ( - "id" varchar(32) NOT NULL, - "isActive" boolean NOT NULL DEFAULT true, - "updatedAt" timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP, - "name" varchar(255) NOT NULL, - "method" varchar(64) NOT NULL, - "userId" varchar(32) NULL DEFAULT NULL, - "systemWebhookId" varchar(32) NULL DEFAULT NULL, - CONSTRAINT "PK_abuse_report_notification_recipient_id" PRIMARY KEY ("id"), - CONSTRAINT "FK_abuse_report_notification_recipient_userId1" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION, - CONSTRAINT "FK_abuse_report_notification_recipient_userId2" FOREIGN KEY ("userId") REFERENCES "user_profile"("userId") ON DELETE CASCADE ON UPDATE NO ACTION, - CONSTRAINT "FK_abuse_report_notification_recipient_systemWebhookId" FOREIGN KEY ("systemWebhookId") REFERENCES "system_webhook"("id") ON DELETE CASCADE ON UPDATE NO ACTION - ); - CREATE INDEX "IDX_abuse_report_notification_recipient_isActive" ON "abuse_report_notification_recipient" ("isActive"); - CREATE INDEX "IDX_abuse_report_notification_recipient_method" ON "abuse_report_notification_recipient" ("method"); - CREATE INDEX "IDX_abuse_report_notification_recipient_userId" ON "abuse_report_notification_recipient" ("userId"); - CREATE INDEX "IDX_abuse_report_notification_recipient_systemWebhookId" ON "abuse_report_notification_recipient" ("systemWebhookId"); - `); - } - - async down(queryRunner) { - await queryRunner.query(` - ALTER TABLE "abuse_report_notification_recipient" DROP CONSTRAINT "FK_abuse_report_notification_recipient_userId1"; - ALTER TABLE "abuse_report_notification_recipient" DROP CONSTRAINT "FK_abuse_report_notification_recipient_userId2"; - ALTER TABLE "abuse_report_notification_recipient" DROP CONSTRAINT "FK_abuse_report_notification_recipient_systemWebhookId"; - DROP INDEX "IDX_abuse_report_notification_recipient_isActive"; - DROP INDEX "IDX_abuse_report_notification_recipient_method"; - DROP INDEX "IDX_abuse_report_notification_recipient_userId"; - DROP INDEX "IDX_abuse_report_notification_recipient_systemWebhookId"; - DROP TABLE "abuse_report_notification_recipient"; - - DROP INDEX "IDX_system_webhook_isActive"; - DROP INDEX "IDX_system_webhook_on"; - DROP TABLE "system_webhook"; - `); - } -} diff --git a/packages/backend/migration/1716129964060-ChannelIdDenormalizedForMiPoll.js b/packages/backend/migration/1716129964060-ChannelIdDenormalizedForMiPoll.js deleted file mode 100644 index f736378c04..0000000000 --- a/packages/backend/migration/1716129964060-ChannelIdDenormalizedForMiPoll.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class ChannelIdDenormalizedForMiPoll1716129964060 { - name = 'ChannelIdDenormalizedForMiPoll1716129964060' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "poll" ADD "channelId" character varying(32)`); - await queryRunner.query(`COMMENT ON COLUMN "poll"."channelId" IS '[Denormalized]'`); - await queryRunner.query(`CREATE INDEX "IDX_c1240fcc9675946ea5d6c2860e" ON "poll" ("channelId") `); - await queryRunner.query(`UPDATE "poll" SET "channelId" = "note"."channelId" FROM "note" WHERE "poll"."noteId" = "note"."id"`); - } - - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "public"."IDX_c1240fcc9675946ea5d6c2860e"`); - await queryRunner.query(`COMMENT ON COLUMN "poll"."channelId" IS '[Denormalized]'`); - await queryRunner.query(`ALTER TABLE "poll" DROP COLUMN "channelId"`); - } -} diff --git a/packages/backend/migration/1716197366117-MediaSilenceForHosts.js b/packages/backend/migration/1716197366117-MediaSilenceForHosts.js deleted file mode 100644 index 10bb7f0255..0000000000 --- a/packages/backend/migration/1716197366117-MediaSilenceForHosts.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class MediaSilenceForHosts1716197366117 { - name = 'MediaSilenceForHosts1716197366117' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "mediaSilencedHosts" character varying(1024) array NOT NULL DEFAULT '{}'`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "mediaSilencedHosts"`); - } -} diff --git a/packages/backend/migration/1716345015347-NotRespondingSince.js b/packages/backend/migration/1716345015347-NotRespondingSince.js deleted file mode 100644 index fc4ee6639a..0000000000 --- a/packages/backend/migration/1716345015347-NotRespondingSince.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class NotRespondingSince1716345015347 { - name = 'NotRespondingSince1716345015347' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" ADD "notRespondingSince" TIMESTAMP WITH TIME ZONE`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "notRespondingSince"`); - } -} diff --git a/packages/backend/migration/1716447138870-SuspensionStateInsteadOfIsSspended.js b/packages/backend/migration/1716447138870-SuspensionStateInsteadOfIsSspended.js deleted file mode 100644 index 4808a9a3db..0000000000 --- a/packages/backend/migration/1716447138870-SuspensionStateInsteadOfIsSspended.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class SuspensionStateInsteadOfIsSspended1716345771510 { - name = 'SuspensionStateInsteadOfIsSspended1716345771510' - - async up(queryRunner) { - await queryRunner.query(`CREATE TYPE "public"."instance_suspensionstate_enum" AS ENUM('none', 'manuallySuspended', 'goneSuspended', 'autoSuspendedForNotResponding')`); - - await queryRunner.query(`DROP INDEX "public"."IDX_34500da2e38ac393f7bb6b299c"`); - - await queryRunner.query(`ALTER TABLE "instance" RENAME COLUMN "isSuspended" TO "suspensionState"`); - - await queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "suspensionState" DROP DEFAULT`); - - await queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "suspensionState" TYPE "public"."instance_suspensionstate_enum" USING ( - CASE "suspensionState" - WHEN TRUE THEN 'manuallySuspended'::instance_suspensionstate_enum - ELSE 'none'::instance_suspensionstate_enum - END - )`); - - await queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "suspensionState" SET DEFAULT 'none'`); - - await queryRunner.query(`CREATE INDEX "IDX_3ede46f507c87ad698051d56a8" ON "instance" ("suspensionState") `); - } - - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "public"."IDX_3ede46f507c87ad698051d56a8"`); - - await queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "suspensionState" DROP DEFAULT`); - - await queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "suspensionState" TYPE boolean USING ( - CASE "suspensionState" - WHEN 'none'::instance_suspensionstate_enum THEN FALSE - ELSE TRUE - END - )`); - - await queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "suspensionState" SET DEFAULT false`); - - await queryRunner.query(`ALTER TABLE "instance" RENAME COLUMN "suspensionState" TO "isSuspended"`); - - await queryRunner.query(`CREATE INDEX "IDX_34500da2e38ac393f7bb6b299c" ON "instance" ("isSuspended") `); - - await queryRunner.query(`DROP TYPE "public"."instance_suspensionstate_enum"`); - } -} diff --git a/packages/backend/migration/1716450883149-RemoveAntennaNotify.js b/packages/backend/migration/1716450883149-RemoveAntennaNotify.js deleted file mode 100644 index b5a2441855..0000000000 --- a/packages/backend/migration/1716450883149-RemoveAntennaNotify.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class RemoveAntennaNotify1716450883149 { - name = 'RemoveAntennaNotify1716450883149' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "notify"`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "antenna" ADD "notify" boolean NOT NULL`); - } -} diff --git a/packages/backend/migration/1717117195275-inquiryUrl.js b/packages/backend/migration/1717117195275-inquiryUrl.js deleted file mode 100644 index 29ca31af14..0000000000 --- a/packages/backend/migration/1717117195275-inquiryUrl.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class InquiryUrl1717117195275 { - name = 'InquiryUrl1717117195275' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "inquiryUrl" character varying(1024)`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "inquiryUrl"`); - } -} diff --git a/packages/backend/migration/1721666053703-fixDriveUrl.js b/packages/backend/migration/1721666053703-fixDriveUrl.js deleted file mode 100644 index d8512fb835..0000000000 --- a/packages/backend/migration/1721666053703-fixDriveUrl.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class FixDriveUrl1721666053703 { - name = 'FixDriveUrl1721666053703' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN "url" TYPE character varying(1024), ALTER COLUMN "url" SET NOT NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."url" IS 'The URL of the DriveFile.'`); - await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN "uri" TYPE character varying(1024)`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."uri" IS 'The URI of the DriveFile. it will be null when the DriveFile is local.'`); - await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN "src" TYPE character varying(1024)`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN "src" TYPE character varying(512)`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."uri" IS 'The URI of the DriveFile. it will be null when the DriveFile is local.'`); - await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN "uri" TYPE character varying(512)`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."url" IS 'The URL of the DriveFile.'`); - await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN "url" TYPE character varying(512), ALTER COLUMN "url" SET NOT NULL`); - } -} diff --git a/packages/backend/migration/1723944246767-followedMessage.js b/packages/backend/migration/1723944246767-followedMessage.js deleted file mode 100644 index fc9ad1cb85..0000000000 --- a/packages/backend/migration/1723944246767-followedMessage.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class FollowedMessage1723944246767 { - name = 'FollowedMessage1723944246767'; - - async up(queryRunner) { - await queryRunner.query('ALTER TABLE "user_profile" ADD "followedMessage" character varying(256)'); - } - - async down(queryRunner) { - await queryRunner.query('ALTER TABLE "user_profile" DROP COLUMN "followedMessage"'); - } -} diff --git a/packages/backend/migration/1726804538569-reactions-buffering.js b/packages/backend/migration/1726804538569-reactions-buffering.js deleted file mode 100644 index bc19e9cc8a..0000000000 --- a/packages/backend/migration/1726804538569-reactions-buffering.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class ReactionsBuffering1726804538569 { - name = 'ReactionsBuffering1726804538569' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "enableReactionsBuffering" boolean NOT NULL DEFAULT false`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableReactionsBuffering"`); - } -} diff --git a/packages/backend/migration/1727318020265-enableStatsForFederatedInstances.js b/packages/backend/migration/1727318020265-enableStatsForFederatedInstances.js deleted file mode 100644 index 4ff520172b..0000000000 --- a/packages/backend/migration/1727318020265-enableStatsForFederatedInstances.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class EnableStatsForFederatedInstances1727318020265 { - name = 'EnableStatsForFederatedInstances1727318020265' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "enableStatsForFederatedInstances" boolean NOT NULL DEFAULT true`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableStatsForFederatedInstances"`); - } -} diff --git a/packages/backend/migration/1727491883993-user-score.js b/packages/backend/migration/1727491883993-user-score.js deleted file mode 100644 index 7292d5363c..0000000000 --- a/packages/backend/migration/1727491883993-user-score.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class UserScore1727491883993 { - name = 'UserScore1727491883993' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" ADD "score" integer NOT NULL DEFAULT '0'`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "score"`); - } -} diff --git a/packages/backend/migration/1727512908322-meta-federation.js b/packages/backend/migration/1727512908322-meta-federation.js deleted file mode 100644 index 52c24df4f7..0000000000 --- a/packages/backend/migration/1727512908322-meta-federation.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class MetaFederation1727512908322 { - name = 'MetaFederation1727512908322' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "federation" character varying(128) NOT NULL DEFAULT 'all'`); - await queryRunner.query(`ALTER TABLE "meta" ADD "federationHosts" character varying(1024) array NOT NULL DEFAULT '{}'`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "federationHosts"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "federation"`); - } -} diff --git a/packages/backend/migration/1728085812127-refine-abuse-user-report.js b/packages/backend/migration/1728085812127-refine-abuse-user-report.js deleted file mode 100644 index 57cbfdcf6d..0000000000 --- a/packages/backend/migration/1728085812127-refine-abuse-user-report.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class RefineAbuseUserReport1728085812127 { - name = 'RefineAbuseUserReport1728085812127' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "abuse_user_report" ADD "moderationNote" character varying(8192) NOT NULL DEFAULT ''`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" ADD "resolvedAs" character varying(128)`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP COLUMN "resolvedAs"`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP COLUMN "moderationNote"`); - } -} diff --git a/packages/backend/migration/1728550878802-testcaptcha.js b/packages/backend/migration/1728550878802-testcaptcha.js deleted file mode 100644 index d8d987c0c1..0000000000 --- a/packages/backend/migration/1728550878802-testcaptcha.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class Testcaptcha1728550878802 { - name = 'Testcaptcha1728550878802' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "enableTestcaptcha" boolean NOT NULL DEFAULT false`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableTestcaptcha"`); - } -} diff --git a/packages/backend/migration/1728634286056-prohibitedWordsForNameOfUser.js b/packages/backend/migration/1728634286056-prohibitedWordsForNameOfUser.js deleted file mode 100644 index 36e698d120..0000000000 --- a/packages/backend/migration/1728634286056-prohibitedWordsForNameOfUser.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class ProhibitedWordsForNameOfUser1728634286056 { - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "prohibitedWordsForNameOfUser" character varying(1024) array NOT NULL DEFAULT '{}'`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "prohibitedWordsForNameOfUser"`); - } -} diff --git a/packages/backend/migration/1729333924409-signinRequiredForShowContents.js b/packages/backend/migration/1729333924409-signinRequiredForShowContents.js deleted file mode 100644 index 5d4d1fcce2..0000000000 --- a/packages/backend/migration/1729333924409-signinRequiredForShowContents.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class SigninRequiredForShowContents1729333924409 { - name = 'SigninRequiredForShowContents1729333924409' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" ADD "requireSigninToViewContents" boolean NOT NULL DEFAULT false`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "requireSigninToViewContents"`); - } -} diff --git a/packages/backend/migration/1729486255072-makeNotesHiddenBefore.js b/packages/backend/migration/1729486255072-makeNotesHiddenBefore.js deleted file mode 100644 index 5fe4886b04..0000000000 --- a/packages/backend/migration/1729486255072-makeNotesHiddenBefore.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export class MakeNotesHiddenBefore1729486255072 { - name = 'MakeNotesHiddenBefore1729486255072' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" ADD "makeNotesFollowersOnlyBefore" integer`); - await queryRunner.query(`ALTER TABLE "user" ADD "makeNotesHiddenBefore" integer`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "makeNotesHiddenBefore"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "makeNotesFollowersOnlyBefore"`); - } -} diff --git a/packages/backend/package.json b/packages/backend/package.json index 0dd738a1e6..4d1e9936aa 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -4,36 +4,29 @@ "private": true, "type": "module", "engines": { - "node": "^20.10.0 || ^22.0.0" + "node": ">=20.10.0" }, "scripts": { "start": "node ./built/boot/entry.js", - "start:test": "cross-env NODE_ENV=test node ./built/boot/entry.js", + "start:test": "NODE_ENV=test node ./built/boot/entry.js", "migrate": "pnpm typeorm migration:run -d ormconfig.js", "revert": "pnpm typeorm migration:revert -d ormconfig.js", - "check:connect": "node ./scripts/check_connect.js", - "build": "swc src -d built -D --strip-leading-paths", - "build:test": "swc test-server -d built-test -D --config-file test-server/.swcrc --strip-leading-paths", - "watch:swc": "swc src -d built -D -w --strip-leading-paths", + "check:connect": "node ./check_connect.js", + "build": "swc src -d built -D", + "watch:swc": "swc src -d built -D -w", "build:tsc": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", - "watch": "node ./scripts/watch.mjs", + "watch": "node watch.mjs", "restart": "pnpm build && pnpm start", - "dev": "node ./scripts/dev.mjs", - "typecheck": "tsc --noEmit && tsc -p test --noEmit && tsc -p test-federation --noEmit", - "eslint": "eslint --quiet \"{src,test-federation}/**/*.ts\"", + "dev": "nodemon -w src -e ts,js,mjs,cjs,json --exec \"cross-env NODE_ENV=development pnpm run restart\"", + "typecheck": "tsc --noEmit", + "eslint": "eslint --quiet \"src/**/*.ts\"", "lint": "pnpm typecheck && pnpm eslint", - "jest": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --forceExit --config jest.config.unit.cjs", - "jest:e2e": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --forceExit --config jest.config.e2e.cjs", - "jest:fed": "node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --forceExit --config jest.config.fed.cjs", - "jest-and-coverage": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --coverage --forceExit --config jest.config.unit.cjs", - "jest-and-coverage:e2e": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --coverage --forceExit --config jest.config.e2e.cjs", + "jest": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --forceExit", + "jest-and-coverage": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --coverage --forceExit", "jest-clear": "cross-env NODE_ENV=test node --experimental-vm-modules --experimental-import-meta-resolve node_modules/jest/bin/jest.js --clearCache", "test": "pnpm jest", - "test:e2e": "pnpm build && pnpm build:test && pnpm jest:e2e", - "test:fed": "pnpm jest:fed", "test-and-coverage": "pnpm jest-and-coverage", - "test-and-coverage:e2e": "pnpm build && pnpm build:test && pnpm jest-and-coverage:e2e", - "generate-api-json": "node ./scripts/generate_api_json.js" + "generate-api-json": "node ./generate_api_json.js" }, "optionalDependencies": { "@swc/core-android-arm64": "1.3.11", @@ -67,179 +60,174 @@ "utf-8-validate": "6.0.3" }, "dependencies": { - "@aws-sdk/client-s3": "3.620.0", - "@aws-sdk/lib-storage": "3.620.0", - "@bull-board/api": "6.0.0", - "@bull-board/fastify": "6.0.0", - "@bull-board/ui": "6.0.0", - "@discordapp/twemoji": "15.1.0", - "@fastify/accepts": "5.0.1", - "@fastify/cookie": "10.0.1", - "@fastify/cors": "10.0.1", - "@fastify/express": "4.0.1", - "@fastify/http-proxy": "10.0.0", - "@fastify/multipart": "9.0.1", - "@fastify/static": "8.0.1", - "@fastify/view": "10.0.1", - "@misskey-dev/sharp-read-bmp": "1.2.0", - "@misskey-dev/summaly": "5.1.0", - "@napi-rs/canvas": "0.1.56", - "@nestjs/common": "10.4.4", - "@nestjs/core": "10.4.4", - "@nestjs/testing": "10.4.4", + "@aws-sdk/client-s3": "3.412.0", + "@aws-sdk/lib-storage": "3.412.0", + "@bull-board/api": "5.10.2", + "@bull-board/fastify": "5.10.2", + "@bull-board/ui": "5.10.2", + "@discordapp/twemoji": "15.0.2", + "@fastify/accepts": "4.3.0", + "@fastify/cookie": "9.2.0", + "@fastify/cors": "8.5.0", + "@fastify/express": "2.3.0", + "@fastify/http-proxy": "9.3.0", + "@fastify/multipart": "8.0.0", + "@fastify/static": "6.12.0", + "@fastify/view": "8.2.0", + "@nestjs/common": "10.2.10", + "@nestjs/core": "10.2.10", + "@nestjs/testing": "10.2.10", "@peertube/http-signature": "1.7.0", - "@sentry/node": "8.20.0", - "@sentry/profiling-node": "8.20.0", - "@simplewebauthn/server": "10.0.1", + "@simplewebauthn/server": "8.3.5", "@sinonjs/fake-timers": "11.2.2", - "@smithy/node-http-handler": "2.5.0", - "@swc/cli": "0.3.12", - "@swc/core": "1.6.6", - "@twemoji/parser": "15.1.1", + "@smithy/node-http-handler": "2.1.10", + "@swc/cli": "0.1.63", + "@swc/core": "1.3.100", + "@twemoji/parser": "15.0.0", "accepts": "1.3.8", - "ajv": "8.17.1", - "archiver": "7.0.1", - "async-mutex": "0.5.0", + "ajv": "8.12.0", + "archiver": "6.0.1", + "async-mutex": "0.4.0", "bcryptjs": "2.4.3", "blurhash": "2.0.5", - "body-parser": "1.20.3", - "bullmq": "5.15.0", + "body-parser": "1.20.2", + "bullmq": "4.15.4", "cacheable-lookup": "7.0.0", - "cbor": "9.0.2", + "cbor": "9.0.1", "chalk": "5.3.0", "chalk-template": "1.1.0", - "chokidar": "3.6.0", + "chokidar": "3.5.3", "cli-highlight": "2.1.11", "color-convert": "2.0.1", "content-disposition": "0.5.4", "date-fns": "2.30.0", "deep-email-validator": "0.1.21", - "fastify": "5.0.0", - "fastify-raw-body": "5.0.0", + "fastify": "4.24.3", + "fastify-raw-body": "4.3.0", "feed": "4.2.2", - "file-type": "19.5.0", - "fluent-ffmpeg": "2.1.3", + "file-type": "18.7.0", + "fluent-ffmpeg": "2.1.2", "form-data": "4.0.0", - "got": "14.4.2", - "happy-dom": "15.7.4", + "got": "14.0.0", + "happy-dom": "10.0.3", "hpagent": "1.2.0", - "htmlescape": "1.1.1", - "http-link-header": "1.1.3", - "ioredis": "5.4.1", - "ip-cidr": "4.0.2", - "ipaddr.js": "2.2.0", - "is-svg": "5.1.0", + "http-link-header": "1.1.1", + "ioredis": "5.3.2", + "ip-cidr": "3.1.0", + "ipaddr.js": "2.1.0", + "is-svg": "5.0.0", "js-yaml": "4.1.0", - "jsdom": "24.1.1", + "jsdom": "23.0.1", "json5": "2.2.3", "jsonld": "8.3.2", - "jsrsasign": "11.1.0", - "meilisearch": "0.42.0", - "juice": "11.0.0", + "jsrsasign": "10.9.0", + "meilisearch": "0.36.0", "mfm-js": "0.24.0", "microformats-parser": "2.0.2", "mime-types": "2.1.35", "misskey-js": "workspace:*", - "misskey-reversi": "workspace:*", "ms": "3.0.0-canary.1", - "nanoid": "5.0.7", + "nanoid": "5.0.4", "nested-property": "4.0.0", "node-fetch": "3.3.2", - "nodemailer": "6.9.15", + "nodemailer": "6.9.7", "nsfwjs": "2.4.2", "oauth": "0.10.0", "oauth2orize": "1.12.0", "oauth2orize-pkce": "0.1.2", "os-utils": "0.0.14", - "otpauth": "9.3.4", + "otpauth": "9.2.1", "parse5": "7.1.2", - "pg": "8.13.0", - "pkce-challenge": "4.1.0", + "pg": "8.11.3", + "pkce-challenge": "4.0.1", "probe-image-size": "7.2.3", "promise-limit": "2.7.0", - "pug": "3.0.3", + "pug": "3.0.2", "punycode": "2.3.1", - "qrcode": "1.5.4", + "pureimage": "0.3.17", + "qrcode": "1.5.3", "random-seed": "0.3.0", "ratelimiter": "3.4.1", - "re2": "1.21.4", + "re2": "1.20.9", "redis-lock": "0.1.4", - "reflect-metadata": "0.2.2", + "reflect-metadata": "0.1.14", "rename": "1.0.4", "rss-parser": "3.13.0", "rxjs": "7.8.1", - "sanitize-html": "2.13.1", + "sanitize-html": "2.11.0", "secure-json-parse": "2.7.0", - "sharp": "0.33.5", + "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", - "systeminformation": "5.23.5", + "summaly": "github:misskey-dev/summaly", + "systeminformation": "5.21.20", "tinycolor2": "1.6.0", - "tmp": "0.2.3", - "tsc-alias": "1.8.10", + "tmp": "0.2.1", + "tsc-alias": "1.8.8", "tsconfig-paths": "4.2.0", - "typeorm": "0.3.20", - "typescript": "5.6.2", + "typeorm": "0.3.17", + "typescript": "5.3.3", "ulid": "2.3.0", "vary": "1.1.2", - "web-push": "3.6.7", - "ws": "8.18.0", + "web-push": "3.6.6", + "ws": "8.15.1", "xev": "3.0.2" }, "devDependencies": { "@jest/globals": "29.7.0", - "@nestjs/platform-express": "10.4.4", - "@simplewebauthn/types": "10.0.0", - "@swc/jest": "0.2.36", + "@simplewebauthn/typescript-types": "8.3.4", + "@swc/jest": "0.2.29", "@types/accepts": "1.3.7", "@types/archiver": "6.0.2", "@types/bcryptjs": "2.4.6", "@types/body-parser": "1.19.5", - "@types/color-convert": "2.0.4", + "@types/cbor": "6.0.0", + "@types/color-convert": "2.0.3", "@types/content-disposition": "0.5.8", - "@types/fluent-ffmpeg": "2.1.26", - "@types/htmlescape": "1.1.3", - "@types/http-link-header": "1.0.7", - "@types/jest": "29.5.13", + "@types/fluent-ffmpeg": "2.1.24", + "@types/http-link-header": "1.0.5", + "@types/jest": "29.5.11", "@types/js-yaml": "4.0.9", - "@types/jsdom": "21.1.7", - "@types/jsonld": "1.5.15", - "@types/jsrsasign": "10.5.14", + "@types/jsdom": "21.1.6", + "@types/jsonld": "1.5.13", + "@types/jsrsasign": "10.5.12", "@types/mime-types": "2.1.4", "@types/ms": "0.7.34", - "@types/node": "20.14.12", - "@types/nodemailer": "6.4.16", - "@types/oauth": "0.9.5", - "@types/oauth2orize": "1.11.5", + "@types/node": "20.10.5", + "@types/node-fetch": "3.0.3", + "@types/nodemailer": "6.4.14", + "@types/oauth": "0.9.4", + "@types/oauth2orize": "1.11.3", "@types/oauth2orize-pkce": "0.1.2", - "@types/pg": "8.11.10", + "@types/pg": "8.10.9", "@types/pug": "2.0.10", - "@types/punycode": "2.1.4", + "@types/punycode": "2.1.3", "@types/qrcode": "1.5.5", "@types/random-seed": "0.3.5", "@types/ratelimiter": "3.4.6", "@types/rename": "1.0.7", - "@types/sanitize-html": "2.13.0", - "@types/semver": "7.5.8", + "@types/sanitize-html": "2.9.5", + "@types/semver": "7.5.6", + "@types/sharp": "0.32.0", "@types/simple-oauth2": "5.0.7", "@types/sinonjs__fake-timers": "8.1.5", "@types/tinycolor2": "1.4.6", "@types/tmp": "0.2.6", "@types/vary": "1.1.3", "@types/web-push": "3.6.3", - "@types/ws": "8.5.12", - "@typescript-eslint/eslint-plugin": "7.17.0", - "@typescript-eslint/parser": "7.17.0", - "aws-sdk-client-mock": "4.0.1", + "@types/ws": "8.5.10", + "@typescript-eslint/eslint-plugin": "6.14.0", + "@typescript-eslint/parser": "6.14.0", + "aws-sdk-client-mock": "3.0.0", "cross-env": "7.0.3", - "eslint-plugin-import": "2.30.0", - "execa": "9.4.0", - "fkill": "9.0.0", + "eslint": "8.56.0", + "eslint-plugin-import": "2.29.1", + "execa": "8.0.1", "jest": "29.7.0", "jest-mock": "29.7.0", - "nodemon": "3.1.7", - "pid-port": "1.0.0", - "simple-oauth2": "5.1.0" + "nodemon": "3.0.2", + "simple-oauth2": "5.0.0" } } diff --git a/packages/backend/scripts/check_connect.js b/packages/backend/scripts/check_connect.js deleted file mode 100644 index bb149444b5..0000000000 --- a/packages/backend/scripts/check_connect.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import Redis from 'ioredis'; -import { loadConfig } from '../built/config.js'; -import { createPostgresDataSource } from '../built/postgres.js'; - -const config = loadConfig(); - -async function connectToPostgres() { - const source = createPostgresDataSource(config); - await source.initialize(); - await source.destroy(); -} - -async function connectToRedis(redisOptions) { - return await new Promise(async (resolve, reject) => { - const redis = new Redis({ - ...redisOptions, - lazyConnect: true, - reconnectOnError: false, - showFriendlyErrorStack: true, - }); - redis.on('error', e => reject(e)); - - try { - await redis.connect(); - resolve(); - - } catch (e) { - reject(e); - - } finally { - redis.disconnect(false); - } - }); -} - -// If not all of these are defined, the default one gets reused. -// so we use a Set to only try connecting once to each **uniq** redis. -const promises = Array - .from(new Set([ - config.redis, - config.redisForPubsub, - config.redisForJobQueue, - config.redisForTimelines, - config.redisForReactions, - ])) - .map(connectToRedis) - .concat([ - connectToPostgres() - ]); - -await Promise.allSettled(promises); diff --git a/packages/backend/scripts/dev.mjs b/packages/backend/scripts/dev.mjs deleted file mode 100644 index a3e0558abd..0000000000 --- a/packages/backend/scripts/dev.mjs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { execa, execaNode } from 'execa'; - -/** @type {import('execa').ExecaChildProcess | undefined} */ -let backendProcess; - -async function execBuildAssets() { - await execa('pnpm', ['run', 'build-assets'], { - cwd: '../../', - stdout: process.stdout, - stderr: process.stderr, - }) -} - -function execStart() { - // pnpm run start を呼び出したいが、windowsだとプロセスグループ単位でのkillが出来ずゾンビプロセス化するので - // 上記と同等の動きをするコマンドで子・孫プロセスを作らないようにしたい - backendProcess = execaNode('./built/boot/entry.js', [], { - stdout: process.stdout, - stderr: process.stderr, - env: { - 'NODE_ENV': 'development', - }, - }); -} - -async function killProc() { - if (backendProcess) { - backendProcess.catch(() => {}); // backendProcess.kill()によって発生する例外を無視するためにcatch()を呼び出す - backendProcess.kill(); - await new Promise(resolve => backendProcess.on('exit', resolve)); - backendProcess = undefined; - } -} - -(async () => { - execaNode( - './node_modules/nodemon/bin/nodemon.js', - [ - '-w', 'src', - '-e', 'ts,js,mjs,cjs,json', - '--exec', 'pnpm', 'run', 'build', - ], - { - stdio: [process.stdin, process.stdout, process.stderr, 'ipc'], - serialization: "json", - }) - .on('message', async (message) => { - if (message.type === 'exit') { - // かならずbuild->build-assetsの順番で呼び出したいので、 - // 少々トリッキーだがnodemonからのexitイベントを利用してbuild-assets->startを行う。 - // pnpm restartをbuildが終わる前にbuild-assetsが動いてしまうので、バラバラに呼び出す必要がある - - await killProc(); - await execBuildAssets(); - execStart(); - } - }) -})(); diff --git a/packages/backend/scripts/generate_api_json.js b/packages/backend/scripts/generate_api_json.js deleted file mode 100644 index 798e243004..0000000000 --- a/packages/backend/scripts/generate_api_json.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { execa } from 'execa'; -import { writeFileSync, existsSync } from "node:fs"; - -async function main() { - if (!process.argv.includes('--no-build')) { - await execa('pnpm', ['run', 'build'], { - stdout: process.stdout, - stderr: process.stderr, - }); - } - - if (!existsSync('./built')) { - throw new Error('`built` directory does not exist.'); - } - - /** @type {import('../src/config.js')} */ - const { loadConfig } = await import('../built/config.js'); - - /** @type {import('../src/server/api/openapi/gen-spec.js')} */ - const { genOpenapiSpec } = await import('../built/server/api/openapi/gen-spec.js'); - - const config = loadConfig(); - const spec = genOpenapiSpec(config, true); - - writeFileSync('./built/api.json', JSON.stringify(spec), 'utf-8'); -} - -main().catch(e => { - console.error(e); - process.exit(1); -}); diff --git a/packages/backend/src/@types/hcaptcha.d.ts b/packages/backend/src/@types/hcaptcha.d.ts index e11dda4662..43e67dd340 100644 --- a/packages/backend/src/@types/hcaptcha.d.ts +++ b/packages/backend/src/@types/hcaptcha.d.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/@types/http-signature.d.ts b/packages/backend/src/@types/http-signature.d.ts index 75b62e55f0..1f3b48aa54 100644 --- a/packages/backend/src/@types/http-signature.d.ts +++ b/packages/backend/src/@types/http-signature.d.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/@types/os-utils.d.ts b/packages/backend/src/@types/os-utils.d.ts index 8943edddd1..8c44232c14 100644 --- a/packages/backend/src/@types/os-utils.d.ts +++ b/packages/backend/src/@types/os-utils.d.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/@types/package.json.d.ts b/packages/backend/src/@types/package.json.d.ts index 52a2b356db..197b4b6bf0 100644 --- a/packages/backend/src/@types/package.json.d.ts +++ b/packages/backend/src/@types/package.json.d.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/@types/probe-image-size.d.ts b/packages/backend/src/@types/probe-image-size.d.ts index 538836475c..4d312cba34 100644 --- a/packages/backend/src/@types/probe-image-size.d.ts +++ b/packages/backend/src/@types/probe-image-size.d.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/@types/redis-lock.d.ts b/packages/backend/src/@types/redis-lock.d.ts index b037cde5ee..c607d600d8 100644 --- a/packages/backend/src/@types/redis-lock.d.ts +++ b/packages/backend/src/@types/redis-lock.d.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/GlobalModule.ts b/packages/backend/src/GlobalModule.ts index 6ae8ccfbb3..3e9d19f825 100644 --- a/packages/backend/src/GlobalModule.ts +++ b/packages/backend/src/GlobalModule.ts @@ -1,8 +1,9 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ +import { setTimeout } from 'node:timers/promises'; import { Global, Inject, Module } from '@nestjs/common'; import * as Redis from 'ioredis'; import { DataSource } from 'typeorm'; @@ -11,10 +12,7 @@ import { DI } from './di-symbols.js'; import { Config, loadConfig } from './config.js'; import { createPostgresDataSource } from './postgres.js'; import { RepositoryModule } from './models/RepositoryModule.js'; -import { allSettled } from './misc/promise-tracker.js'; import type { Provider, OnApplicationShutdown } from '@nestjs/common'; -import { MiMeta } from '@/models/Meta.js'; -import { GlobalEvents } from './core/GlobalEventService.js'; const $config: Provider = { provide: DI.config, @@ -35,7 +33,7 @@ const $meilisearch: Provider = { useFactory: (config: Config) => { if (config.meilisearch) { return new MeiliSearch({ - host: `${config.meilisearch.ssl ? 'https' : 'http'}://${config.meilisearch.host}:${config.meilisearch.port}`, + host: `${config.meilisearch.ssl ? 'https' : 'http' }://${config.meilisearch.host}:${config.meilisearch.port}`, apiKey: config.meilisearch.apiKey, }); } else { @@ -80,76 +78,11 @@ const $redisForTimelines: Provider = { inject: [DI.config], }; -const $redisForReactions: Provider = { - provide: DI.redisForReactions, - useFactory: (config: Config) => { - return new Redis.Redis(config.redisForReactions); - }, - inject: [DI.config], -}; - -const $meta: Provider = { - provide: DI.meta, - useFactory: async (db: DataSource, redisForSub: Redis.Redis) => { - const meta = await db.transaction(async transactionalEntityManager => { - // 過去のバグでレコードが複数出来てしまっている可能性があるので新しいIDを優先する - const metas = await transactionalEntityManager.find(MiMeta, { - order: { - id: 'DESC', - }, - }); - - const meta = metas[0]; - - if (meta) { - return meta; - } else { - // metaが空のときfetchMetaが同時に呼ばれるとここが同時に呼ばれてしまうことがあるのでフェイルセーフなupsertを使う - const saved = await transactionalEntityManager - .upsert( - MiMeta, - { - id: 'x', - }, - ['id'], - ) - .then((x) => transactionalEntityManager.findOneByOrFail(MiMeta, x.identifiers[0])); - - return saved; - } - }); - - async function onMessage(_: string, data: string): Promise { - const obj = JSON.parse(data); - - if (obj.channel === 'internal') { - const { type, body } = obj.message as GlobalEvents['internal']['payload']; - switch (type) { - case 'metaUpdated': { - for (const key in body.after) { - (meta as any)[key] = (body.after as any)[key]; - } - meta.proxyAccount = null; // joinなカラムは通常取ってこないので - break; - } - default: - break; - } - } - } - - redisForSub.on('message', onMessage); - - return meta; - }, - inject: [DI.db, DI.redisForSub], -}; - @Global() @Module({ imports: [RepositoryModule], - providers: [$config, $db, $meta, $meilisearch, $redis, $redisForPub, $redisForSub, $redisForTimelines, $redisForReactions], - exports: [$config, $db, $meta, $meilisearch, $redis, $redisForPub, $redisForSub, $redisForTimelines, $redisForReactions, RepositoryModule], + providers: [$config, $db, $meilisearch, $redis, $redisForPub, $redisForSub, $redisForTimelines], + exports: [$config, $db, $meilisearch, $redis, $redisForPub, $redisForSub, $redisForTimelines, RepositoryModule], }) export class GlobalModule implements OnApplicationShutdown { constructor( @@ -158,20 +91,23 @@ export class GlobalModule implements OnApplicationShutdown { @Inject(DI.redisForPub) private redisForPub: Redis.Redis, @Inject(DI.redisForSub) private redisForSub: Redis.Redis, @Inject(DI.redisForTimelines) private redisForTimelines: Redis.Redis, - @Inject(DI.redisForReactions) private redisForReactions: Redis.Redis, - ) { } + ) {} public async dispose(): Promise { - // Wait for all potential DB queries - await allSettled(); - // And then disconnect from DB + if (process.env.NODE_ENV === 'test') { + // XXX: + // Shutting down the existing connections causes errors on Jest as + // Misskey has asynchronous postgres/redis connections that are not + // awaited. + // Let's wait for some random time for them to finish. + await setTimeout(5000); + } await Promise.all([ this.db.destroy(), this.redisClient.disconnect(), this.redisForPub.disconnect(), this.redisForSub.disconnect(), this.redisForTimelines.disconnect(), - this.redisForReactions.disconnect(), ]); } diff --git a/packages/backend/src/MainModule.ts b/packages/backend/src/MainModule.ts index f86a0be93c..90aba0cc91 100644 --- a/packages/backend/src/MainModule.ts +++ b/packages/backend/src/MainModule.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/NestLogger.ts b/packages/backend/src/NestLogger.ts index d0be19664f..e18e9e88a7 100644 --- a/packages/backend/src/NestLogger.ts +++ b/packages/backend/src/NestLogger.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,7 +7,7 @@ import { LoggerService } from '@nestjs/common'; import Logger from '@/logger.js'; const logger = new Logger('core', 'cyan'); -const nestLogger = logger.createSubLogger('nest', 'green'); +const nestLogger = logger.createSubLogger('nest', 'green', false); export class NestLogger implements LoggerService { /** diff --git a/packages/backend/src/boot/common.ts b/packages/backend/src/boot/common.ts index 268c07582d..df10ab1e3d 100644 --- a/packages/backend/src/boot/common.ts +++ b/packages/backend/src/boot/common.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/boot/entry.ts b/packages/backend/src/boot/entry.ts index 25375c3015..fc8fc2ffb4 100644 --- a/packages/backend/src/boot/entry.ts +++ b/packages/backend/src/boot/entry.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -15,7 +15,6 @@ import Logger from '@/logger.js'; import { envOption } from '../env.js'; import { masterMain } from './master.js'; import { workerMain } from './worker.js'; -import { readyRef } from './ready.js'; import 'reflect-metadata'; @@ -25,7 +24,7 @@ Error.stackTraceLimit = Infinity; EventEmitter.defaultMaxListeners = 128; const logger = new Logger('core', 'cyan'); -const clusterLogger = logger.createSubLogger('cluster', 'orange'); +const clusterLogger = logger.createSubLogger('cluster', 'orange', false); const ev = new Xev(); //#region Events @@ -80,8 +79,6 @@ if (cluster.isWorker || envOption.disableClustering) { await workerMain(); } -readyRef.value = true; - // ユニットテスト時にMisskeyが子プロセスで起動された時のため // それ以外のときは process.send は使えないので弾く if (process.send) { diff --git a/packages/backend/src/boot/master.ts b/packages/backend/src/boot/master.ts index 4bc5c799cf..623cc964ac 100644 --- a/packages/backend/src/boot/master.ts +++ b/packages/backend/src/boot/master.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,8 +10,6 @@ import * as os from 'node:os'; import cluster from 'node:cluster'; import chalk from 'chalk'; import chalkTemplate from 'chalk-template'; -import * as Sentry from '@sentry/node'; -import { nodeProfilingIntegration } from '@sentry/profiling-node'; import Logger from '@/logger.js'; import { loadConfig } from '@/config.js'; import type { Config } from '@/config.js'; @@ -25,7 +23,7 @@ const _dirname = dirname(_filename); const meta = JSON.parse(fs.readFileSync(`${_dirname}/../../../../built/meta.json`, 'utf-8')); const logger = new Logger('core', 'cyan'); -const bootLogger = logger.createSubLogger('boot', 'magenta'); +const bootLogger = logger.createSubLogger('boot', 'magenta', false); const themeColor = chalk.hex('#86b300'); @@ -73,24 +71,6 @@ export async function masterMain() { bootLogger.succ('Misskey initialized'); - if (config.sentryForBackend) { - Sentry.init({ - integrations: [ - ...(config.sentryForBackend.enableNodeProfiling ? [nodeProfilingIntegration()] : []), - ], - - // Performance Monitoring - tracesSampleRate: 1.0, // Capture 100% of the transactions - - // Set sampling rate for profiling - this is relative to tracesSampleRate - profilesSampleRate: 1.0, - - maxBreadcrumbs: 0, - - ...config.sentryForBackend.options, - }); - } - if (envOption.disableClustering) { if (envOption.onlyServer) { await server(); diff --git a/packages/backend/src/boot/ready.ts b/packages/backend/src/boot/ready.ts deleted file mode 100644 index 591ae5cb58..0000000000 --- a/packages/backend/src/boot/ready.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export const readyRef = { value: false }; diff --git a/packages/backend/src/boot/worker.ts b/packages/backend/src/boot/worker.ts index 5d4a15b29f..0399c9fe5c 100644 --- a/packages/backend/src/boot/worker.ts +++ b/packages/backend/src/boot/worker.ts @@ -1,39 +1,16 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import cluster from 'node:cluster'; -import * as Sentry from '@sentry/node'; -import { nodeProfilingIntegration } from '@sentry/profiling-node'; import { envOption } from '@/env.js'; -import { loadConfig } from '@/config.js'; import { jobQueue, server } from './common.js'; /** * Init worker process */ export async function workerMain() { - const config = loadConfig(); - - if (config.sentryForBackend) { - Sentry.init({ - integrations: [ - ...(config.sentryForBackend.enableNodeProfiling ? [nodeProfilingIntegration()] : []), - ], - - // Performance Monitoring - tracesSampleRate: 1.0, // Capture 100% of the transactions - - // Set sampling rate for profiling - this is relative to tracesSampleRate - profilesSampleRate: 1.0, - - maxBreadcrumbs: 0, - - ...config.sentryForBackend.options, - }); - } - if (envOption.onlyServer) { await server(); } else if (envOption.onlyQueue) { diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index 42f1033b9d..b25554b229 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,7 +7,6 @@ import * as fs from 'node:fs'; import { fileURLToPath } from 'node:url'; import { dirname, resolve } from 'node:path'; import * as yaml from 'js-yaml'; -import * as Sentry from '@sentry/node'; import type { RedisOptions } from 'ioredis'; type RedisOptionsSource = Partial & { @@ -23,7 +22,7 @@ type RedisOptionsSource = Partial & { * 設定ファイルの型 */ type Source = { - url?: string; + url: string; port?: number; socket?: string; chmodSocket?: string; @@ -31,9 +30,9 @@ type Source = { db: { host: string; port: number; - db?: string; - user?: string; - pass?: string; + db: string; + user: string; + pass: string; disableCache?: boolean; extra?: { [x: string]: string }; }; @@ -49,7 +48,6 @@ type Source = { redisForPubsub?: RedisOptionsSource; redisForJobQueue?: RedisOptionsSource; redisForTimelines?: RedisOptionsSource; - redisForReactions?: RedisOptionsSource; meilisearch?: { host: string; port: string; @@ -58,12 +56,6 @@ type Source = { index: string; scope?: 'local' | 'global' | string[]; }; - sentryForBackend?: { options: Partial; enableNodeProfiling: boolean; }; - sentryForFrontend?: { options: Partial }; - - publishTarballInsteadOfProvideRepositoryUrl?: boolean; - - setupPassword?: string; proxy?: string; proxySmtp?: string; @@ -82,10 +74,10 @@ type Source = { deliverJobConcurrency?: number; inboxJobConcurrency?: number; - relationshipJobConcurrency?: number; + relashionshipJobConcurrency?: number; deliverJobPerSec?: number; inboxJobPerSec?: number; - relationshipJobPerSec?: number; + relashionshipJobPerSec?: number; deliverJobMaxAttempts?: number; inboxJobMaxAttempts?: number; @@ -136,25 +128,23 @@ export type Config = { proxySmtp: string | undefined; proxyBypassHosts: string[] | undefined; allowedPrivateNetworks: string[] | undefined; - maxFileSize: number; + maxFileSize: number | undefined; clusterLimit: number | undefined; id: string; outgoingAddress: string | undefined; outgoingAddressFamily: 'ipv4' | 'ipv6' | 'dual' | undefined; deliverJobConcurrency: number | undefined; inboxJobConcurrency: number | undefined; - relationshipJobConcurrency: number | undefined; + relashionshipJobConcurrency: number | undefined; deliverJobPerSec: number | undefined; inboxJobPerSec: number | undefined; - relationshipJobPerSec: number | undefined; + relashionshipJobPerSec: number | undefined; deliverJobMaxAttempts: number | undefined; inboxJobMaxAttempts: number | undefined; proxyRemoteFiles: boolean | undefined; signToActivityPubGet: boolean | undefined; version: string; - publishTarballInsteadOfProvideRepositoryUrl: boolean; - setupPassword: string | undefined; host: string; hostname: string; scheme: string; @@ -164,10 +154,8 @@ export type Config = { authUrl: string; driveUrl: string; userAgent: string; - frontendEntry: string; - frontendManifestExists: boolean; - frontendEmbedEntry: string; - frontendEmbedManifestExists: boolean; + clientEntry: string; + clientManifestExists: boolean; mediaProxy: string; externalMediaProxyEnabled: boolean; videoThumbnailGenerator: string | null; @@ -175,9 +163,6 @@ export type Config = { redisForPubsub: RedisOptions & RedisOptionsSource; redisForJobQueue: RedisOptions & RedisOptionsSource; redisForTimelines: RedisOptions & RedisOptionsSource; - redisForReactions: RedisOptions & RedisOptionsSource; - sentryForBackend: { options: Partial; enableNodeProfiling: boolean; } | undefined; - sentryForFrontend: { options: Partial } | undefined; perChannelMaxNoteCacheCount: number; perUserNotificationsMaxCount: number; deactivateAntennaThreshold: number; @@ -203,29 +188,19 @@ const path = process.env.MISSKEY_CONFIG_YML export function loadConfig(): Config { const meta = JSON.parse(fs.readFileSync(`${_dirname}/../../../built/meta.json`, 'utf-8')); - - const frontendManifestExists = fs.existsSync(_dirname + '/../../../built/_frontend_vite_/manifest.json'); - const frontendEmbedManifestExists = fs.existsSync(_dirname + '/../../../built/_frontend_embed_vite_/manifest.json'); - const frontendManifest = frontendManifestExists ? - JSON.parse(fs.readFileSync(`${_dirname}/../../../built/_frontend_vite_/manifest.json`, 'utf-8')) + const clientManifestExists = fs.existsSync(_dirname + '/../../../built/_vite_/manifest.json'); + const clientManifest = clientManifestExists ? + JSON.parse(fs.readFileSync(`${_dirname}/../../../built/_vite_/manifest.json`, 'utf-8')) : { 'src/_boot_.ts': { file: 'src/_boot_.ts' } }; - const frontendEmbedManifest = frontendEmbedManifestExists ? - JSON.parse(fs.readFileSync(`${_dirname}/../../../built/_frontend_embed_vite_/manifest.json`, 'utf-8')) - : { 'src/boot.ts': { file: 'src/boot.ts' } }; - const config = yaml.load(fs.readFileSync(path, 'utf-8')) as Source; - const url = tryCreateUrl(config.url ?? process.env.MISSKEY_URL ?? ''); + const url = tryCreateUrl(config.url); const version = meta.version; const host = url.host; const hostname = url.hostname; const scheme = url.protocol.replace(/:$/, ''); const wsScheme = scheme.replace('http', 'ws'); - const dbDb = config.db.db ?? process.env.DATABASE_DB ?? ''; - const dbUser = config.db.user ?? process.env.DATABASE_USER ?? ''; - const dbPass = config.db.pass ?? process.env.DATABASE_PASSWORD ?? ''; - const externalMediaProxy = config.mediaProxy ? config.mediaProxy.endsWith('/') ? config.mediaProxy.substring(0, config.mediaProxy.length - 1) : config.mediaProxy : null; @@ -234,8 +209,6 @@ export function loadConfig(): Config { return { version, - publishTarballInsteadOfProvideRepositoryUrl: !!config.publishTarballInsteadOfProvideRepositoryUrl, - setupPassword: config.setupPassword, url: url.origin, port: config.port ?? parseInt(process.env.PORT ?? '', 10), socket: config.socket, @@ -249,7 +222,7 @@ export function loadConfig(): Config { apiUrl: `${scheme}://${host}/api`, authUrl: `${scheme}://${host}/auth`, driveUrl: `${scheme}://${host}/files`, - db: { ...config.db, db: dbDb, user: dbUser, pass: dbPass }, + db: config.db, dbReplications: config.dbReplications, dbSlaves: config.dbSlaves, meilisearch: config.meilisearch, @@ -257,38 +230,33 @@ export function loadConfig(): Config { redisForPubsub: config.redisForPubsub ? convertRedisOptions(config.redisForPubsub, host) : redis, redisForJobQueue: config.redisForJobQueue ? convertRedisOptions(config.redisForJobQueue, host) : redis, redisForTimelines: config.redisForTimelines ? convertRedisOptions(config.redisForTimelines, host) : redis, - redisForReactions: config.redisForReactions ? convertRedisOptions(config.redisForReactions, host) : redis, - sentryForBackend: config.sentryForBackend, - sentryForFrontend: config.sentryForFrontend, id: config.id, proxy: config.proxy, proxySmtp: config.proxySmtp, proxyBypassHosts: config.proxyBypassHosts, allowedPrivateNetworks: config.allowedPrivateNetworks, - maxFileSize: config.maxFileSize ?? 262144000, + maxFileSize: config.maxFileSize, clusterLimit: config.clusterLimit, outgoingAddress: config.outgoingAddress, outgoingAddressFamily: config.outgoingAddressFamily, deliverJobConcurrency: config.deliverJobConcurrency, inboxJobConcurrency: config.inboxJobConcurrency, - relationshipJobConcurrency: config.relationshipJobConcurrency, + relashionshipJobConcurrency: config.relashionshipJobConcurrency, deliverJobPerSec: config.deliverJobPerSec, inboxJobPerSec: config.inboxJobPerSec, - relationshipJobPerSec: config.relationshipJobPerSec, + relashionshipJobPerSec: config.relashionshipJobPerSec, deliverJobMaxAttempts: config.deliverJobMaxAttempts, inboxJobMaxAttempts: config.inboxJobMaxAttempts, proxyRemoteFiles: config.proxyRemoteFiles, - signToActivityPubGet: config.signToActivityPubGet ?? true, + 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})`, - frontendEntry: frontendManifest['src/_boot_.ts'], - frontendManifestExists: frontendManifestExists, - frontendEmbedEntry: frontendEmbedManifest['src/boot.ts'], - frontendEmbedManifestExists: frontendEmbedManifestExists, + clientEntry: clientManifest['src/_boot_.ts'], + clientManifestExists: clientManifestExists, perChannelMaxNoteCacheCount: config.perChannelMaxNoteCacheCount ?? 1000, perUserNotificationsMaxCount: config.perUserNotificationsMaxCount ?? 500, deactivateAntennaThreshold: config.deactivateAntennaThreshold ?? (1000 * 60 * 60 * 24 * 7), diff --git a/packages/backend/src/const.ts b/packages/backend/src/const.ts index e3a61861f4..716a8de382 100644 --- a/packages/backend/src/const.ts +++ b/packages/backend/src/const.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,8 +8,6 @@ export const MAX_NOTE_TEXT_LENGTH = 3000; export const USER_ONLINE_THRESHOLD = 1000 * 60 * 10; // 10min export const USER_ACTIVE_THRESHOLD = 1000 * 60 * 60 * 24 * 3; // 3days -export const PER_NOTE_REACTION_USER_PAIR_CACHE_MAX = 16; - //#region hard limits // If you change DB_* values, you must also change the DB schema. diff --git a/packages/backend/src/core/AbuseReportNotificationService.ts b/packages/backend/src/core/AbuseReportNotificationService.ts deleted file mode 100644 index 25e265f2b1..0000000000 --- a/packages/backend/src/core/AbuseReportNotificationService.ts +++ /dev/null @@ -1,432 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable, type OnApplicationShutdown } from '@nestjs/common'; -import { Brackets, In, IsNull, Not } from 'typeorm'; -import * as Redis from 'ioredis'; -import sanitizeHtml from 'sanitize-html'; -import { DI } from '@/di-symbols.js'; -import { bindThis } from '@/decorators.js'; -import { GlobalEvents, GlobalEventService } from '@/core/GlobalEventService.js'; -import type { - AbuseReportNotificationRecipientRepository, - MiAbuseReportNotificationRecipient, - MiAbuseUserReport, - MiMeta, - MiUser, -} from '@/models/_.js'; -import { EmailService } from '@/core/EmailService.js'; -import { RoleService } from '@/core/RoleService.js'; -import { RecipientMethod } from '@/models/AbuseReportNotificationRecipient.js'; -import { ModerationLogService } from '@/core/ModerationLogService.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import { IdService } from './IdService.js'; - -@Injectable() -export class AbuseReportNotificationService implements OnApplicationShutdown { - constructor( - @Inject(DI.meta) - private meta: MiMeta, - - @Inject(DI.abuseReportNotificationRecipientRepository) - private abuseReportNotificationRecipientRepository: AbuseReportNotificationRecipientRepository, - - @Inject(DI.redisForSub) - private redisForSub: Redis.Redis, - - private idService: IdService, - private roleService: RoleService, - private systemWebhookService: SystemWebhookService, - private emailService: EmailService, - private moderationLogService: ModerationLogService, - private globalEventService: GlobalEventService, - private userEntityService: UserEntityService, - ) { - this.redisForSub.on('message', this.onMessage); - } - - /** - * 管理者用Redisイベントを用いて{@link abuseReports}の内容を管理者各位に通知する. - * 通知先ユーザは{@link getModeratorIds}の取得結果に依る. - * - * @see RoleService.getModeratorIds - * @see GlobalEventService.publishAdminStream - */ - @bindThis - public async notifyAdminStream(abuseReports: MiAbuseUserReport[]) { - if (abuseReports.length <= 0) { - return; - } - - const moderatorIds = await this.roleService.getModeratorIds({ - includeAdmins: true, - excludeExpire: true, - }); - - for (const moderatorId of moderatorIds) { - for (const abuseReport of abuseReports) { - this.globalEventService.publishAdminStream( - moderatorId, - 'newAbuseUserReport', - { - id: abuseReport.id, - targetUserId: abuseReport.targetUserId, - reporterId: abuseReport.reporterId, - comment: abuseReport.comment, - }, - ); - } - } - } - - /** - * Mailを用いて{@link abuseReports}の内容を管理者各位に通知する. - * メールアドレスの送信先は以下の通り. - * - モデレータ権限所有者ユーザ(設定画面からメールアドレスの設定を行っているユーザに限る) - * - metaテーブルに設定されているメールアドレス - * - * @see EmailService.sendEmail - */ - @bindThis - public async notifyMail(abuseReports: MiAbuseUserReport[]) { - if (abuseReports.length <= 0) { - return; - } - - const recipientEMailAddresses = await this.fetchEMailRecipients().then(it => it - .filter(it => it.isActive && it.userProfile?.emailVerified) - .map(it => it.userProfile?.email) - .filter(x => x != null), - ); - - recipientEMailAddresses.push( - ...(this.meta.email ? [this.meta.email] : []), - ); - - if (recipientEMailAddresses.length <= 0) { - return; - } - - for (const mailAddress of recipientEMailAddresses) { - await Promise.all( - abuseReports.map(it => { - // TODO: 送信処理はJobQueue化したい - return this.emailService.sendEmail( - mailAddress, - 'New Abuse Report', - sanitizeHtml(it.comment), - sanitizeHtml(it.comment), - ); - }), - ); - } - } - - /** - * SystemWebhookを用いて{@link abuseReports}の内容を管理者各位に通知する. - * ここではJobQueueへのエンキューのみを行うため、即時実行されない. - * - * @see SystemWebhookService.enqueueSystemWebhook - */ - @bindThis - public async notifySystemWebhook( - abuseReports: MiAbuseUserReport[], - type: 'abuseReport' | 'abuseReportResolved', - ) { - if (abuseReports.length <= 0) { - return; - } - - const usersMap = await this.userEntityService.packMany( - [ - ...new Set([ - ...abuseReports.map(it => it.reporter ?? it.reporterId), - ...abuseReports.map(it => it.targetUser ?? it.targetUserId), - ...abuseReports.map(it => it.assignee ?? it.assigneeId), - ].filter(x => x != null)), - ], - null, - { schema: 'UserLite' }, - ).then(it => new Map(it.map(it => [it.id, it]))); - const convertedReports = abuseReports.map(it => { - return { - ...it, - reporter: usersMap.get(it.reporterId), - targetUser: usersMap.get(it.targetUserId), - assignee: it.assigneeId ? usersMap.get(it.assigneeId) : null, - }; - }); - - const recipientWebhookIds = await this.fetchWebhookRecipients() - .then(it => it - .filter(it => it.isActive && it.systemWebhookId && it.method === 'webhook') - .map(it => it.systemWebhookId) - .filter(x => x != null)); - for (const webhookId of recipientWebhookIds) { - await Promise.all( - convertedReports.map(it => { - return this.systemWebhookService.enqueueSystemWebhook( - webhookId, - type, - it, - ); - }), - ); - } - } - - /** - * 通報の通知先一覧を取得する. - * - * @param {Object} [params] クエリの取得条件 - * @param {Object} [params.method] 取得する通知先の通知方法 - * @param {Object} [opts] 動作時の詳細なオプション - * @param {boolean} [opts.removeUnauthorized] 副作用としてモデレータ権限を持たない送信先ユーザをDBから削除するかどうか(default: true) - * @param {boolean} [opts.joinUser] 通知先のユーザ情報をJOINするかどうか(default: false) - * @param {boolean} [opts.joinSystemWebhook] 通知先のSystemWebhook情報をJOINするかどうか(default: false) - * @see removeUnauthorizedRecipientUsers - */ - @bindThis - public async fetchRecipients( - params?: { - ids?: MiAbuseReportNotificationRecipient['id'][], - method?: RecipientMethod[], - }, - opts?: { - removeUnauthorized?: boolean, - joinUser?: boolean, - joinSystemWebhook?: boolean, - }, - ): Promise { - const query = this.abuseReportNotificationRecipientRepository.createQueryBuilder('recipient'); - - if (opts?.joinUser) { - query.innerJoinAndSelect('user', 'user', 'recipient.userId = user.id'); - query.innerJoinAndSelect('recipient.userProfile', 'userProfile'); - } - - if (opts?.joinSystemWebhook) { - query.innerJoinAndSelect('recipient.systemWebhook', 'systemWebhook'); - } - - if (params?.ids) { - query.andWhere({ id: In(params.ids) }); - } - - if (params?.method) { - query.andWhere(new Brackets(qb => { - if (params.method?.includes('email')) { - qb.orWhere({ method: 'email', userId: Not(IsNull()) }); - } - if (params.method?.includes('webhook')) { - qb.orWhere({ method: 'webhook', userId: IsNull() }); - } - })); - } - - const recipients = await query.getMany(); - if (recipients.length <= 0) { - return []; - } - - // アサイン有効期限切れはイベントで拾えないので、このタイミングでチェック及び削除(オプション) - return (opts?.removeUnauthorized ?? true) - ? await this.removeUnauthorizedRecipientUsers(recipients) - : recipients; - } - - /** - * EMailの通知先一覧を取得する. - * リレーション先の{@link MiUser}および{@link MiUserProfile}も同時に取得する. - * - * @param {Object} [opts] - * @param {boolean} [opts.removeUnauthorized] 副作用としてモデレータ権限を持たない送信先ユーザをDBから削除するかどうか(default: true) - * @see removeUnauthorizedRecipientUsers - */ - @bindThis - public async fetchEMailRecipients(opts?: { - removeUnauthorized?: boolean - }): Promise { - return this.fetchRecipients({ method: ['email'] }, { joinUser: true, ...opts }); - } - - /** - * Webhookの通知先一覧を取得する. - * リレーション先の{@link MiSystemWebhook}も同時に取得する. - */ - @bindThis - public fetchWebhookRecipients(): Promise { - return this.fetchRecipients({ method: ['webhook'] }, { joinSystemWebhook: true }); - } - - /** - * 通知先を作成する. - */ - @bindThis - public async createRecipient( - params: { - isActive: MiAbuseReportNotificationRecipient['isActive']; - name: MiAbuseReportNotificationRecipient['name']; - method: MiAbuseReportNotificationRecipient['method']; - userId: MiAbuseReportNotificationRecipient['userId']; - systemWebhookId: MiAbuseReportNotificationRecipient['systemWebhookId']; - }, - updater: MiUser, - ): Promise { - const id = this.idService.gen(); - await this.abuseReportNotificationRecipientRepository.insert({ - ...params, - id, - }); - - const created = await this.abuseReportNotificationRecipientRepository.findOneByOrFail({ id: id }); - - this.moderationLogService - .log(updater, 'createAbuseReportNotificationRecipient', { - recipientId: id, - recipient: created, - }); - - return created; - } - - /** - * 通知先を更新する. - */ - @bindThis - public async updateRecipient( - params: { - id: MiAbuseReportNotificationRecipient['id']; - isActive: MiAbuseReportNotificationRecipient['isActive']; - name: MiAbuseReportNotificationRecipient['name']; - method: MiAbuseReportNotificationRecipient['method']; - userId: MiAbuseReportNotificationRecipient['userId']; - systemWebhookId: MiAbuseReportNotificationRecipient['systemWebhookId']; - }, - updater: MiUser, - ): Promise { - const beforeEntity = await this.abuseReportNotificationRecipientRepository.findOneByOrFail({ id: params.id }); - - await this.abuseReportNotificationRecipientRepository.update(params.id, { - isActive: params.isActive, - updatedAt: new Date(), - name: params.name, - method: params.method, - userId: params.userId, - systemWebhookId: params.systemWebhookId, - }); - - const afterEntity = await this.abuseReportNotificationRecipientRepository.findOneByOrFail({ id: params.id }); - - this.moderationLogService - .log(updater, 'updateAbuseReportNotificationRecipient', { - recipientId: params.id, - before: beforeEntity, - after: afterEntity, - }); - - return afterEntity; - } - - /** - * 通知先を削除する. - */ - @bindThis - public async deleteRecipient( - id: MiAbuseReportNotificationRecipient['id'], - updater: MiUser, - ) { - const entity = await this.abuseReportNotificationRecipientRepository.findBy({ id }); - - await this.abuseReportNotificationRecipientRepository.delete(id); - - this.moderationLogService - .log(updater, 'deleteAbuseReportNotificationRecipient', { - recipientId: id, - recipient: entity, - }); - } - - /** - * モデレータ権限を持たない(*1)通知先ユーザを削除する. - * - * *1: 以下の両方を満たすものの事を言う - * - 通知先にユーザIDが設定されている - * - 付与ロールにモデレータ権限がない or アサインの有効期限が切れている - * - * @param recipients 通知先一覧の配列 - * @returns {@lisk recipients}からモデレータ権限を持たない通知先を削除した配列 - */ - @bindThis - private async removeUnauthorizedRecipientUsers(recipients: MiAbuseReportNotificationRecipient[]): Promise { - const userRecipients = recipients.filter(it => it.userId !== null); - const recipientUserIds = new Set(userRecipients.map(it => it.userId).filter(x => x != null)); - if (recipientUserIds.size <= 0) { - // ユーザが通知先として設定されていない場合、この関数での処理を行うべきレコードが無い - return recipients; - } - - // モデレータ権限の有無で通知先設定を振り分ける - const authorizedUserIds = await this.roleService.getModeratorIds({ - includeAdmins: true, - excludeExpire: true, - }); - const authorizedUserRecipients = Array.of(); - const unauthorizedUserRecipients = Array.of(); - for (const recipient of userRecipients) { - // eslint-disable-next-line - if (authorizedUserIds.includes(recipient.userId!)) { - authorizedUserRecipients.push(recipient); - } else { - unauthorizedUserRecipients.push(recipient); - } - } - - // モデレータ権限を持たない通知先をDBから削除する - if (unauthorizedUserRecipients.length > 0) { - await this.abuseReportNotificationRecipientRepository.delete(unauthorizedUserRecipients.map(it => it.id)); - } - const nonUserRecipients = recipients.filter(it => it.userId === null); - return [...nonUserRecipients, ...authorizedUserRecipients].sort((a, b) => a.id.localeCompare(b.id)); - } - - @bindThis - private async onMessage(_: string, data: string): Promise { - const obj = JSON.parse(data); - if (obj.channel !== 'internal') { - return; - } - - const { type } = obj.message as GlobalEvents['internal']['payload']; - switch (type) { - case 'roleUpdated': - case 'roleDeleted': - case 'userRoleUnassigned': { - // 場合によってはキャッシュ更新よりも先にここが呼ばれてしまう可能性があるのでnextTickで遅延実行 - process.nextTick(async () => { - const recipients = await this.abuseReportNotificationRecipientRepository.findBy({ - userId: Not(IsNull()), - }); - await this.removeUnauthorizedRecipientUsers(recipients); - }); - break; - } - default: { - break; - } - } - } - - @bindThis - public dispose(): void { - this.redisForSub.off('message', this.onMessage); - } - - @bindThis - public onApplicationShutdown(signal?: string | undefined): void { - this.dispose(); - } -} diff --git a/packages/backend/src/core/AbuseReportService.ts b/packages/backend/src/core/AbuseReportService.ts deleted file mode 100644 index 0b022d3b08..0000000000 --- a/packages/backend/src/core/AbuseReportService.ts +++ /dev/null @@ -1,176 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { In } from 'typeorm'; -import { DI } from '@/di-symbols.js'; -import { bindThis } from '@/decorators.js'; -import type { AbuseUserReportsRepository, MiAbuseUserReport, MiUser, UsersRepository } from '@/models/_.js'; -import { AbuseReportNotificationService } from '@/core/AbuseReportNotificationService.js'; -import { QueueService } from '@/core/QueueService.js'; -import { InstanceActorService } from '@/core/InstanceActorService.js'; -import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; -import { ModerationLogService } from '@/core/ModerationLogService.js'; -import { IdService } from './IdService.js'; - -@Injectable() -export class AbuseReportService { - constructor( - @Inject(DI.abuseUserReportsRepository) - private abuseUserReportsRepository: AbuseUserReportsRepository, - - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - - private idService: IdService, - private abuseReportNotificationService: AbuseReportNotificationService, - private queueService: QueueService, - private instanceActorService: InstanceActorService, - private apRendererService: ApRendererService, - private moderationLogService: ModerationLogService, - ) { - } - - /** - * ユーザからの通報をDBに記録し、その内容を下記の手段で管理者各位に通知する. - * - 管理者用Redisイベント - * - EMail(モデレータ権限所有者ユーザ+metaテーブルに設定されているメールアドレス) - * - SystemWebhook - * - * @param params 通報内容. もし複数件の通報に対応した時のために、あらかじめ複数件を処理できる前提で考える - * @see AbuseReportNotificationService.notify - */ - @bindThis - public async report(params: { - targetUserId: MiAbuseUserReport['targetUserId'], - targetUserHost: MiAbuseUserReport['targetUserHost'], - reporterId: MiAbuseUserReport['reporterId'], - reporterHost: MiAbuseUserReport['reporterHost'], - comment: string, - }[]) { - const entities = params.map(param => { - return { - id: this.idService.gen(), - targetUserId: param.targetUserId, - targetUserHost: param.targetUserHost, - reporterId: param.reporterId, - reporterHost: param.reporterHost, - comment: param.comment, - }; - }); - - const reports = Array.of(); - for (const entity of entities) { - const report = await this.abuseUserReportsRepository.insertOne(entity); - reports.push(report); - } - - return Promise.all([ - this.abuseReportNotificationService.notifyAdminStream(reports), - this.abuseReportNotificationService.notifySystemWebhook(reports, 'abuseReport'), - this.abuseReportNotificationService.notifyMail(reports), - ]); - } - - /** - * 通報を解決し、その内容を下記の手段で管理者各位に通知する. - * - SystemWebhook - * - * @param params 通報内容. もし複数件の通報に対応した時のために、あらかじめ複数件を処理できる前提で考える - * @param moderator 通報を処理したユーザ - * @see AbuseReportNotificationService.notify - */ - @bindThis - public async resolve( - params: { - reportId: string; - resolvedAs: MiAbuseUserReport['resolvedAs']; - }[], - moderator: MiUser, - ) { - const paramsMap = new Map(params.map(it => [it.reportId, it])); - const reports = await this.abuseUserReportsRepository.findBy({ - id: In(params.map(it => it.reportId)), - }); - - for (const report of reports) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const ps = paramsMap.get(report.id)!; - - await this.abuseUserReportsRepository.update(report.id, { - resolved: true, - assigneeId: moderator.id, - resolvedAs: ps.resolvedAs, - }); - - this.moderationLogService - .log(moderator, 'resolveAbuseReport', { - reportId: report.id, - report: report, - resolvedAs: ps.resolvedAs, - }); - } - - return this.abuseUserReportsRepository.findBy({ id: In(reports.map(it => it.id)) }) - .then(reports => this.abuseReportNotificationService.notifySystemWebhook(reports, 'abuseReportResolved')); - } - - @bindThis - public async forward( - reportId: MiAbuseUserReport['id'], - moderator: MiUser, - ) { - const report = await this.abuseUserReportsRepository.findOneByOrFail({ id: reportId }); - - if (report.targetUserHost == null) { - throw new Error('The target user host is null.'); - } - - if (report.forwarded) { - throw new Error('The report has already been forwarded.'); - } - - await this.abuseUserReportsRepository.update(report.id, { - forwarded: true, - }); - - const actor = await this.instanceActorService.getInstanceActor(); - const targetUser = await this.usersRepository.findOneByOrFail({ id: report.targetUserId }); - - const flag = this.apRendererService.renderFlag(actor, targetUser.uri!, report.comment); - const contextAssignedFlag = this.apRendererService.addContext(flag); - this.queueService.deliver(actor, contextAssignedFlag, targetUser.inbox, false); - - this.moderationLogService - .log(moderator, 'forwardAbuseReport', { - reportId: report.id, - report: report, - }); - } - - @bindThis - public async update( - reportId: MiAbuseUserReport['id'], - params: { - moderationNote?: MiAbuseUserReport['moderationNote']; - }, - moderator: MiUser, - ) { - const report = await this.abuseUserReportsRepository.findOneByOrFail({ id: reportId }); - - await this.abuseUserReportsRepository.update(report.id, { - moderationNote: params.moderationNote, - }); - - if (params.moderationNote != null && report.moderationNote !== params.moderationNote) { - this.moderationLogService.log(moderator, 'updateAbuseReportNote', { - reportId: report.id, - report: report, - before: report.moderationNote, - after: params.moderationNote, - }); - } - } -} diff --git a/packages/backend/src/core/AccountMoveService.ts b/packages/backend/src/core/AccountMoveService.ts index 24d11f29ff..350aa6ba24 100644 --- a/packages/backend/src/core/AccountMoveService.ts +++ b/packages/backend/src/core/AccountMoveService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -9,7 +9,7 @@ import { IsNull, In, MoreThan, Not } from 'typeorm'; import { bindThis } from '@/decorators.js'; import { DI } from '@/di-symbols.js'; import type { MiLocalUser, MiRemoteUser, MiUser } from '@/models/User.js'; -import type { BlockingsRepository, FollowingsRepository, InstancesRepository, MiMeta, MutingsRepository, UserListMembershipsRepository, UsersRepository } from '@/models/_.js'; +import type { BlockingsRepository, FollowingsRepository, InstancesRepository, MutingsRepository, UserListMembershipsRepository, UsersRepository } from '@/models/_.js'; import type { RelationshipJobData, ThinUser } from '@/queue/types.js'; import { IdService } from '@/core/IdService.js'; @@ -20,17 +20,16 @@ import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js'; import { ApDeliverManagerService } from '@/core/activitypub/ApDeliverManagerService.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; +import { CacheService } from '@/core/CacheService.js'; import { ProxyAccountService } from '@/core/ProxyAccountService.js'; import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; +import { MetaService } from '@/core/MetaService.js'; import InstanceChart from '@/core/chart/charts/instance.js'; import PerUserFollowingChart from '@/core/chart/charts/per-user-following.js'; @Injectable() export class AccountMoveService { constructor( - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -59,7 +58,9 @@ export class AccountMoveService { private perUserFollowingChart: PerUserFollowingChart, private federatedInstanceService: FederatedInstanceService, private instanceChart: InstanceChart, + private metaService: MetaService, private relayService: RelayService, + private cacheService: CacheService, private queueService: QueueService, ) { } @@ -83,7 +84,7 @@ export class AccountMoveService { Object.assign(src, update); // Update cache - this.globalEventService.publishInternalEvent('localUserUpdated', src); + this.cacheService.uriPersonCache.set(srcUri, src); const srcPerson = await this.apRendererService.renderPerson(src); const updateAct = this.apRendererService.addContext(this.apRendererService.renderUpdate(srcPerson, src)); @@ -95,7 +96,7 @@ export class AccountMoveService { await this.apDeliverManagerService.deliverToFollowers(src, moveAct); // Publish meUpdated event - const iObj = await this.userEntityService.pack(src.id, src, { schema: 'MeDetailed', includeSecrets: true }); + const iObj = await this.userEntityService.pack(src.id, src, { detail: true, includeSecrets: true }); this.globalEventService.publishMainStream(src.id, 'meUpdated', iObj); // Unfollow after 24 hours @@ -274,15 +275,13 @@ export class AccountMoveService { } // Update instance stats by decreasing remote followers count by the number of local followers who were following the old account. - if (this.meta.enableStatsForFederatedInstances) { - if (this.userEntityService.isRemoteUser(oldAccount)) { - this.federatedInstanceService.fetchOrRegister(oldAccount.host).then(async i => { - this.instancesRepository.decrement({ id: i.id }, 'followersCount', localFollowerIds.length); - if (this.meta.enableChartsForFederatedInstances) { - this.instanceChart.updateFollowers(i.host, false); - } - }); - } + if (this.userEntityService.isRemoteUser(oldAccount)) { + this.federatedInstanceService.fetch(oldAccount.host).then(async i => { + this.instancesRepository.decrement({ id: i.id }, 'followersCount', localFollowerIds.length); + if ((await this.metaService.fetch()).enableChartsForFederatedInstances) { + this.instanceChart.updateFollowers(i.host, false); + } + }); } // FIXME: expensive? @@ -308,7 +307,7 @@ export class AccountMoveService { let resultUser: MiLocalUser | MiRemoteUser | null = null; if (this.userEntityService.isRemoteUser(dst)) { - if (Date.now() - (dst.lastFetchedAt?.getTime() ?? 0) > 10 * 1000) { + if ((new Date()).getTime() - (dst.lastFetchedAt?.getTime() ?? 0) > 10 * 1000) { await this.apPersonService.updatePerson(dst.uri); } dst = await this.apPersonService.fetchPerson(dst.uri) ?? dst; @@ -324,7 +323,7 @@ export class AccountMoveService { if (!src) continue; // oldAccountを探してもこのサーバーに存在しない場合はフォロー関係もないということなのでスルー if (this.userEntityService.isRemoteUser(dst)) { - if (Date.now() - (src.lastFetchedAt?.getTime() ?? 0) > 10 * 1000) { + if ((new Date()).getTime() - (src.lastFetchedAt?.getTime() ?? 0) > 10 * 1000) { await this.apPersonService.updatePerson(srcUri); } diff --git a/packages/backend/src/core/AccountUpdateService.ts b/packages/backend/src/core/AccountUpdateService.ts index 69a57b4854..664700ea6b 100644 --- a/packages/backend/src/core/AccountUpdateService.ts +++ b/packages/backend/src/core/AccountUpdateService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/AchievementService.ts b/packages/backend/src/core/AchievementService.ts index 4fc1193f32..88fc033859 100644 --- a/packages/backend/src/core/AchievementService.ts +++ b/packages/backend/src/core/AchievementService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -87,8 +87,6 @@ export const ACHIEVEMENT_TYPES = [ 'brainDiver', 'smashTestNotificationButton', 'tutorialCompleted', - 'bubbleGameExplodingHead', - 'bubbleGameDoubleExplodingHead', ] as const; @Injectable() diff --git a/packages/backend/src/core/AiService.ts b/packages/backend/src/core/AiService.ts index ad852fdd6e..4e876495a6 100644 --- a/packages/backend/src/core/AiService.ts +++ b/packages/backend/src/core/AiService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/AnnouncementService.ts b/packages/backend/src/core/AnnouncementService.ts index d4fcf19439..8c348e595d 100644 --- a/packages/backend/src/core/AnnouncementService.ts +++ b/packages/backend/src/core/AnnouncementService.ts @@ -1,17 +1,16 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; -import { Brackets, EntityNotFoundError } from 'typeorm'; +import { Brackets } from 'typeorm'; import { DI } from '@/di-symbols.js'; import type { MiUser } from '@/models/User.js'; import type { AnnouncementReadsRepository, AnnouncementsRepository, MiAnnouncement, MiAnnouncementRead, UsersRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; import { Packed } from '@/misc/json-schema.js'; import { IdService } from '@/core/IdService.js'; -import { AnnouncementEntityService } from '@/core/entities/AnnouncementEntityService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { ModerationLogService } from '@/core/ModerationLogService.js'; @@ -30,7 +29,6 @@ export class AnnouncementService { private idService: IdService, private globalEventService: GlobalEventService, private moderationLogService: ModerationLogService, - private announcementEntityService: AnnouncementEntityService, ) { } @@ -67,7 +65,7 @@ export class AnnouncementService { @bindThis public async create(values: Partial, moderator?: MiUser): Promise<{ raw: MiAnnouncement; packed: Packed<'Announcement'> }> { - const announcement = await this.announcementsRepository.insertOne({ + const announcement = await this.announcementsRepository.insert({ id: this.idService.gen(), updatedAt: null, title: values.title, @@ -79,9 +77,9 @@ export class AnnouncementService { silence: values.silence, needConfirmationToRead: values.needConfirmationToRead, userId: values.userId, - }); + }).then(x => this.announcementsRepository.findOneByOrFail(x.identifiers[0])); - const packed = await this.announcementEntityService.pack(announcement); + const packed = (await this.packMany([announcement]))[0]; if (values.userId) { this.globalEventService.publishMainStream(values.userId, 'announcementCreated', { @@ -179,24 +177,6 @@ export class AnnouncementService { } } - @bindThis - public async getAnnouncement(announcementId: MiAnnouncement['id'], me: MiUser | null): Promise> { - const announcement = await this.announcementsRepository.findOneByOrFail({ id: announcementId }); - if (me) { - if (announcement.userId && announcement.userId !== me.id) { - throw new EntityNotFoundError(this.announcementsRepository.metadata.target, { id: announcementId }); - } - - const read = await this.announcementReadsRepository.findOneBy({ - announcementId: announcement.id, - userId: me.id, - }); - return this.announcementEntityService.pack({ ...announcement, isRead: read !== null }, me); - } else { - return this.announcementEntityService.pack(announcement, null); - } - } - @bindThis public async read(user: MiUser, announcementId: MiAnnouncement['id']): Promise { try { @@ -209,15 +189,33 @@ export class AnnouncementService { return; } - const announcement = await this.announcementsRepository.findOneBy({ id: announcementId }); - if (announcement != null && announcement.userId === user.id) { - await this.announcementsRepository.update(announcementId, { - isActive: false, - }); - } - 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: this.idService.parse(announcement.id).date.toISOString(), + updatedAt: announcement.updatedAt?.toISOString() ?? null, + text: announcement.text, + title: announcement.title, + imageUrl: announcement.imageUrl, + icon: announcement.icon, + display: announcement.display, + needConfirmationToRead: announcement.needConfirmationToRead, + silence: announcement.silence, + 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 e827ffa68c..2c27a02559 100644 --- a/packages/backend/src/core/AntennaService.ts +++ b/packages/backend/src/core/AntennaService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -55,29 +55,23 @@ export class AntennaService implements OnApplicationShutdown { const { type, body } = obj.message as GlobalEvents['internal']['payload']; switch (type) { case 'antennaCreated': - this.antennas.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい + this.antennas.push({ ...body, lastUsedAt: new Date(body.lastUsedAt), - user: null, // joinなカラムは通常取ってこないので - userList: null, // joinなカラムは通常取ってこないので }); break; case 'antennaUpdated': { const idx = this.antennas.findIndex(a => a.id === body.id); if (idx >= 0) { - this.antennas[idx] = { // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい + this.antennas[idx] = { ...body, lastUsedAt: new Date(body.lastUsedAt), - user: null, // joinなカラムは通常取ってこないので - userList: null, // joinなカラムは通常取ってこないので }; } else { // サーバ起動時にactiveじゃなかった場合、リストに持っていないので追加する必要あり - this.antennas.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい + this.antennas.push({ ...body, lastUsedAt: new Date(body.lastUsedAt), - user: null, // joinなカラムは通常取ってこないので - userList: null, // joinなカラムは通常取ってこないので }); } } @@ -92,7 +86,7 @@ export class AntennaService implements OnApplicationShutdown { } @bindThis - public async addNoteToAntennas(note: MiNote, noteUser: { id: MiUser['id']; username: string; host: string | null; isBot: boolean; }): Promise { + public async addNoteToAntennas(note: MiNote, noteUser: { id: MiUser['id']; username: string; host: string | null; }): Promise { const antennas = await this.getAntennas(); const antennasWithMatchResult = await Promise.all(antennas.map(antenna => this.checkHitAntenna(antenna, note, noteUser).then(hit => [antenna, hit] as const))); const matchedAntennas = antennasWithMatchResult.filter(([, hit]) => hit).map(([antenna]) => antenna); @@ -110,12 +104,10 @@ export class AntennaService implements OnApplicationShutdown { // NOTE: フォローしているユーザーのノート、リストのユーザーのノート、グループのユーザーのノート指定はパフォーマンス上の理由で無効になっている @bindThis - public async checkHitAntenna(antenna: MiAntenna, note: (MiNote | Packed<'Note'>), noteUser: { id: MiUser['id']; username: string; host: string | null; isBot: boolean; }): Promise { + public async checkHitAntenna(antenna: MiAntenna, note: (MiNote | Packed<'Note'>), noteUser: { id: MiUser['id']; username: string; host: string | null; }): Promise { if (note.visibility === 'specified') return false; if (note.visibility === 'followers') return false; - if (antenna.excludeBots && noteUser.isBot) return false; - if (antenna.localOnly && noteUser.host != null) return false; if (!antenna.withReplies && note.replyId != null) return false; @@ -123,14 +115,11 @@ export class AntennaService implements OnApplicationShutdown { if (antenna.src === 'home') { // TODO } else if (antenna.src === 'list') { - if (antenna.userListId == null) return false; - const exists = await this.userListMembershipsRepository.exists({ - where: { - userListId: antenna.userListId, - userId: note.userId, - }, - }); - if (!exists) return false; + const listUsers = (await this.userListMembershipsRepository.findBy({ + userListId: antenna.userListId!, + })).map(x => x.userId); + + if (!listUsers.includes(note.userId)) return false; } else if (antenna.src === 'users') { const accts = antenna.users.map(x => { const { username, host } = Acct.parse(x); diff --git a/packages/backend/src/core/AppLockService.ts b/packages/backend/src/core/AppLockService.ts index bd2749cb87..7a1293a6de 100644 --- a/packages/backend/src/core/AppLockService.ts +++ b/packages/backend/src/core/AppLockService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/AvatarDecorationService.ts b/packages/backend/src/core/AvatarDecorationService.ts index 4efd6122b1..e97946f9dc 100644 --- a/packages/backend/src/core/AvatarDecorationService.ts +++ b/packages/backend/src/core/AvatarDecorationService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -29,7 +29,7 @@ export class AvatarDecorationService implements OnApplicationShutdown { private moderationLogService: ModerationLogService, private globalEventService: GlobalEventService, ) { - this.cache = new MemorySingleCache(1000 * 60 * 30); // 30s + this.cache = new MemorySingleCache(1000 * 60 * 30); this.redisForSub.on('message', this.onMessage); } @@ -55,10 +55,10 @@ export class AvatarDecorationService implements OnApplicationShutdown { @bindThis public async create(options: Partial, moderator?: MiUser): Promise { - const created = await this.avatarDecorationsRepository.insertOne({ + const created = await this.avatarDecorationsRepository.insert({ id: this.idService.gen(), ...options, - }); + }).then(x => this.avatarDecorationsRepository.findOneByOrFail(x.identifiers[0])); this.globalEventService.publishInternalEvent('avatarDecorationCreated', created); diff --git a/packages/backend/src/core/CacheService.ts b/packages/backend/src/core/CacheService.ts index 6725ebe75b..e1413342b1 100644 --- a/packages/backend/src/core/CacheService.ts +++ b/packages/backend/src/core/CacheService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -16,10 +16,10 @@ import type { OnApplicationShutdown } from '@nestjs/common'; @Injectable() export class CacheService implements OnApplicationShutdown { - public userByIdCache: MemoryKVCache; - public localUserByNativeTokenCache: MemoryKVCache; + public userByIdCache: MemoryKVCache; + public localUserByNativeTokenCache: MemoryKVCache; public localUserByIdCache: MemoryKVCache; - public uriPersonCache: MemoryKVCache; + public uriPersonCache: MemoryKVCache; public userProfileCache: RedisKVCache; public userMutingsCache: RedisKVCache>; public userBlockingCache: RedisKVCache>; @@ -56,10 +56,41 @@ export class CacheService implements OnApplicationShutdown { ) { //this.onMessage = this.onMessage.bind(this); - this.userByIdCache = new MemoryKVCache(1000 * 60 * 5); // 5m - this.localUserByNativeTokenCache = new MemoryKVCache(1000 * 60 * 5); // 5m - this.localUserByIdCache = new MemoryKVCache(1000 * 60 * 5); // 5m - this.uriPersonCache = new MemoryKVCache(1000 * 60 * 5); // 5m + const localUserByIdCache = new MemoryKVCache(1000 * 60 * 60 * 6 /* 6h */); + this.localUserByIdCache = localUserByIdCache; + + // ローカルユーザーならlocalUserByIdCacheにデータを追加し、こちらにはid(文字列)だけを追加する + const userByIdCache = new MemoryKVCache(1000 * 60 * 60 * 6 /* 6h */, { + toMapConverter: user => { + if (user.host === null) { + localUserByIdCache.set(user.id, user as MiLocalUser); + return user.id; + } + + return user; + }, + fromMapConverter: userOrId => typeof userOrId === 'string' ? localUserByIdCache.get(userOrId) : userOrId, + }); + this.userByIdCache = userByIdCache; + + this.localUserByNativeTokenCache = new MemoryKVCache(Infinity, { + toMapConverter: user => { + if (user === null) return null; + + localUserByIdCache.set(user.id, user); + return user.id; + }, + fromMapConverter: id => id === null ? null : localUserByIdCache.get(id), + }); + this.uriPersonCache = new MemoryKVCache(Infinity, { + toMapConverter: user => { + if (user === null) return null; + + userByIdCache.set(user.id, user); + return user.id; + }, + fromMapConverter: id => id === null ? null : userByIdCache.get(id), + }); this.userProfileCache = new RedisKVCache(this.redisClient, 'userProfile', { lifetime: 1000 * 60 * 30, // 30m @@ -128,30 +159,18 @@ export class CacheService implements OnApplicationShutdown { const { type, body } = obj.message as GlobalEvents['internal']['payload']; switch (type) { case 'userChangeSuspendedState': - case 'userChangeDeletedState': - case 'remoteUserUpdated': - case 'localUserUpdated': { - const user = await this.usersRepository.findOneBy({ id: body.id }); - if (user == null) { - this.userByIdCache.delete(body.id); - this.localUserByIdCache.delete(body.id); - for (const [k, v] of this.uriPersonCache.entries) { - if (v.value?.id === body.id) { - this.uriPersonCache.delete(k); - } - } - } else { - this.userByIdCache.set(user.id, user); - for (const [k, v] of this.uriPersonCache.entries) { - if (v.value?.id === user.id) { - this.uriPersonCache.set(k, user); - } - } - if (this.userEntityService.isLocalUser(user)) { - this.localUserByNativeTokenCache.set(user.token!, user); - this.localUserByIdCache.set(user.id, user); + case 'remoteUserUpdated': { + const user = await this.usersRepository.findOneByOrFail({ id: body.id }); + this.userByIdCache.set(user.id, user); + for (const [k, v] of this.uriPersonCache.cache.entries()) { + if (v.value === user.id) { + this.uriPersonCache.set(k, user); } } + if (this.userEntityService.isLocalUser(user)) { + this.localUserByNativeTokenCache.set(user.token!, user); + this.localUserByIdCache.set(user.id, user); + } break; } case 'userTokenRegenerated': { diff --git a/packages/backend/src/core/CaptchaService.ts b/packages/backend/src/core/CaptchaService.ts index 206d0dbe0a..f64196f4fc 100644 --- a/packages/backend/src/core/CaptchaService.ts +++ b/packages/backend/src/core/CaptchaService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -73,37 +73,6 @@ export class CaptchaService { } } - // https://codeberg.org/Gusted/mCaptcha/src/branch/main/mcaptcha.go - @bindThis - public async verifyMcaptcha(secret: string, siteKey: string, instanceHost: string, response: string | null | undefined): Promise { - if (response == null) { - throw new Error('mcaptcha-failed: no response provided'); - } - - const endpointUrl = new URL('/api/v1/pow/siteverify', instanceHost); - const result = await this.httpRequestService.send(endpointUrl.toString(), { - method: 'POST', - body: JSON.stringify({ - key: siteKey, - secret: secret, - token: response, - }), - headers: { - 'Content-Type': 'application/json', - }, - }); - - if (result.status !== 200) { - throw new Error('mcaptcha-failed: mcaptcha didn\'t return 200 OK'); - } - - const resp = (await result.json()) as { valid: boolean }; - - if (!resp.valid) { - throw new Error('mcaptcha-request-failed'); - } - } - @bindThis public async verifyTurnstile(secret: string, response: string | null | undefined): Promise { if (response == null) { @@ -119,18 +88,5 @@ export class CaptchaService { throw new Error(`turnstile-failed: ${errorCodes}`); } } - - @bindThis - public async verifyTestcaptcha(response: string | null | undefined): Promise { - if (response == null) { - throw new Error('testcaptcha-failed: no response provided'); - } - - const success = response === 'testcaptcha-passed'; - - if (!success) { - throw new Error('testcaptcha-failed'); - } - } } diff --git a/packages/backend/src/core/ChannelFollowingService.ts b/packages/backend/src/core/ChannelFollowingService.ts index 12251595e2..75843b9773 100644 --- a/packages/backend/src/core/ChannelFollowingService.ts +++ b/packages/backend/src/core/ChannelFollowingService.ts @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - import { Inject, Injectable, OnModuleInit } from '@nestjs/common'; import Redis from 'ioredis'; import { DI } from '@/di-symbols.js'; diff --git a/packages/backend/src/core/ClipService.ts b/packages/backend/src/core/ClipService.ts index 929a9db064..e94f1eb531 100644 --- a/packages/backend/src/core/ClipService.ts +++ b/packages/backend/src/core/ClipService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -41,17 +41,17 @@ export class ClipService { const currentCount = await this.clipsRepository.countBy({ userId: me.id, }); - if (currentCount >= (await this.roleService.getUserPolicies(me.id)).clipLimit) { + if (currentCount > (await this.roleService.getUserPolicies(me.id)).clipLimit) { throw new ClipService.TooManyClipsError(); } - const clip = await this.clipsRepository.insertOne({ + const clip = await this.clipsRepository.insert({ id: this.idService.gen(), userId: me.id, name: name, isPublic: isPublic, description: description, - }); + }).then(x => this.clipsRepository.findOneByOrFail(x.identifiers[0])); return clip; } @@ -102,7 +102,7 @@ export class ClipService { const currentCount = await this.clipNotesRepository.countBy({ clipId: clip.id, }); - if (currentCount >= (await this.roleService.getUserPolicies(me.id)).noteEachClipsLimit) { + if (currentCount > (await this.roleService.getUserPolicies(me.id)).noteEachClipsLimit) { throw new ClipService.TooManyClipNotesError(); } diff --git a/packages/backend/src/core/CoreModule.ts b/packages/backend/src/core/CoreModule.ts index 734d135648..bc6d24b951 100644 --- a/packages/backend/src/core/CoreModule.ts +++ b/packages/backend/src/core/CoreModule.ts @@ -1,20 +1,10 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Module } from '@nestjs/common'; import { FanoutTimelineEndpointService } from '@/core/FanoutTimelineEndpointService.js'; -import { AbuseReportService } from '@/core/AbuseReportService.js'; -import { SystemWebhookEntityService } from '@/core/entities/SystemWebhookEntityService.js'; -import { - AbuseReportNotificationRecipientEntityService, -} from '@/core/entities/AbuseReportNotificationRecipientEntityService.js'; -import { AbuseReportNotificationService } from '@/core/AbuseReportNotificationService.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; -import { UserSearchService } from '@/core/UserSearchService.js'; -import { WebhookTestService } from '@/core/WebhookTestService.js'; -import { FlashService } from '@/core/FlashService.js'; import { AccountMoveService } from './AccountMoveService.js'; import { AccountUpdateService } from './AccountUpdateService.js'; import { AiService } from './AiService.js'; @@ -51,7 +41,6 @@ import { PollService } from './PollService.js'; import { PushNotificationService } from './PushNotificationService.js'; import { QueryService } from './QueryService.js'; import { ReactionService } from './ReactionService.js'; -import { ReactionsBufferingService } from './ReactionsBufferingService.js'; import { RelayService } from './RelayService.js'; import { RoleService } from './RoleService.js'; import { S3Service } from './S3Service.js'; @@ -64,11 +53,10 @@ import { UserFollowingService } from './UserFollowingService.js'; import { UserKeypairService } from './UserKeypairService.js'; import { UserListService } from './UserListService.js'; import { UserMutingService } from './UserMutingService.js'; -import { UserRenoteMutingService } from './UserRenoteMutingService.js'; import { UserSuspendService } from './UserSuspendService.js'; import { UserAuthService } from './UserAuthService.js'; import { VideoProcessingService } from './VideoProcessingService.js'; -import { UserWebhookService } from './UserWebhookService.js'; +import { WebhookService } from './WebhookService.js'; import { ProxyAccountService } from './ProxyAccountService.js'; import { UtilityService } from './UtilityService.js'; import { FileInfoService } from './FileInfoService.js'; @@ -78,8 +66,6 @@ import { FeaturedService } from './FeaturedService.js'; import { FanoutTimelineService } from './FanoutTimelineService.js'; import { ChannelFollowingService } from './ChannelFollowingService.js'; import { RegistryApiService } from './RegistryApiService.js'; -import { ReversiService } from './ReversiService.js'; - import { ChartLoggerService } from './chart/ChartLoggerService.js'; import FederationChart from './chart/charts/federation.js'; import NotesChart from './chart/charts/notes.js'; @@ -94,9 +80,7 @@ import PerUserFollowingChart from './chart/charts/per-user-following.js'; import PerUserDriveChart from './chart/charts/per-user-drive.js'; import ApRequestChart from './chart/charts/ap-request.js'; import { ChartManagementService } from './chart/ChartManagementService.js'; - import { AbuseUserReportEntityService } from './entities/AbuseUserReportEntityService.js'; -import { AnnouncementEntityService } from './entities/AnnouncementEntityService.js'; import { AntennaEntityService } from './entities/AntennaEntityService.js'; import { AppEntityService } from './entities/AppEntityService.js'; import { AuthSessionEntityService } from './entities/AuthSessionEntityService.js'; @@ -128,9 +112,6 @@ import { UserListEntityService } from './entities/UserListEntityService.js'; import { FlashEntityService } from './entities/FlashEntityService.js'; import { FlashLikeEntityService } from './entities/FlashLikeEntityService.js'; import { RoleEntityService } from './entities/RoleEntityService.js'; -import { ReversiGameEntityService } from './entities/ReversiGameEntityService.js'; -import { MetaEntityService } from './entities/MetaEntityService.js'; - import { ApAudienceService } from './activitypub/ApAudienceService.js'; import { ApDbResolverService } from './activitypub/ApDbResolverService.js'; import { ApDeliverManagerService } from './activitypub/ApDeliverManagerService.js'; @@ -140,7 +121,7 @@ import { ApMfmService } from './activitypub/ApMfmService.js'; import { ApRendererService } from './activitypub/ApRendererService.js'; import { ApRequestService } from './activitypub/ApRequestService.js'; import { ApResolverService } from './activitypub/ApResolverService.js'; -import { JsonLdService } from './activitypub/JsonLdService.js'; +import { LdSignatureService } from './activitypub/LdSignatureService.js'; import { RemoteLoggerService } from './RemoteLoggerService.js'; import { RemoteUserResolveService } from './RemoteUserResolveService.js'; import { WebfingerService } from './WebfingerService.js'; @@ -156,8 +137,6 @@ import type { Provider } from '@nestjs/common'; //#region 文字列ベースでのinjection用(循環参照対応のため) const $LoggerService: Provider = { provide: 'LoggerService', useExisting: LoggerService }; -const $AbuseReportService: Provider = { provide: 'AbuseReportService', useExisting: AbuseReportService }; -const $AbuseReportNotificationService: Provider = { provide: 'AbuseReportNotificationService', useExisting: AbuseReportNotificationService }; const $AccountMoveService: Provider = { provide: 'AccountMoveService', useExisting: AccountMoveService }; const $AccountUpdateService: Provider = { provide: 'AccountUpdateService', useExisting: AccountUpdateService }; const $AiService: Provider = { provide: 'AiService', useExisting: AiService }; @@ -195,7 +174,6 @@ const $ProxyAccountService: Provider = { provide: 'ProxyAccountService', useExis const $PushNotificationService: Provider = { provide: 'PushNotificationService', useExisting: PushNotificationService }; const $QueryService: Provider = { provide: 'QueryService', useExisting: QueryService }; const $ReactionService: Provider = { provide: 'ReactionService', useExisting: ReactionService }; -const $ReactionsBufferingService: Provider = { provide: 'ReactionsBufferingService', useExisting: ReactionsBufferingService }; const $RelayService: Provider = { provide: 'RelayService', useExisting: RelayService }; const $RoleService: Provider = { provide: 'RoleService', useExisting: RoleService }; const $S3Service: Provider = { provide: 'S3Service', useExisting: S3Service }; @@ -208,17 +186,12 @@ const $UserFollowingService: Provider = { provide: 'UserFollowingService', useEx const $UserKeypairService: Provider = { provide: 'UserKeypairService', useExisting: UserKeypairService }; const $UserListService: Provider = { provide: 'UserListService', useExisting: UserListService }; const $UserMutingService: Provider = { provide: 'UserMutingService', useExisting: UserMutingService }; -const $UserRenoteMutingService: Provider = { provide: 'UserRenoteMutingService', useExisting: UserRenoteMutingService }; -const $UserSearchService: Provider = { provide: 'UserSearchService', useExisting: UserSearchService }; const $UserSuspendService: Provider = { provide: 'UserSuspendService', useExisting: UserSuspendService }; const $UserAuthService: Provider = { provide: 'UserAuthService', useExisting: UserAuthService }; const $VideoProcessingService: Provider = { provide: 'VideoProcessingService', useExisting: VideoProcessingService }; -const $UserWebhookService: Provider = { provide: 'UserWebhookService', useExisting: UserWebhookService }; -const $SystemWebhookService: Provider = { provide: 'SystemWebhookService', useExisting: SystemWebhookService }; -const $WebhookTestService: Provider = { provide: 'WebhookTestService', useExisting: WebhookTestService }; +const $WebhookService: Provider = { provide: 'WebhookService', useExisting: WebhookService }; const $UtilityService: Provider = { provide: 'UtilityService', useExisting: UtilityService }; const $FileInfoService: Provider = { provide: 'FileInfoService', useExisting: FileInfoService }; -const $FlashService: Provider = { provide: 'FlashService', useExisting: FlashService }; const $SearchService: Provider = { provide: 'SearchService', useExisting: SearchService }; const $ClipService: Provider = { provide: 'ClipService', useExisting: ClipService }; const $FeaturedService: Provider = { provide: 'FeaturedService', useExisting: FeaturedService }; @@ -226,7 +199,6 @@ const $FanoutTimelineService: Provider = { provide: 'FanoutTimelineService', use const $FanoutTimelineEndpointService: Provider = { provide: 'FanoutTimelineEndpointService', useExisting: FanoutTimelineEndpointService }; const $ChannelFollowingService: Provider = { provide: 'ChannelFollowingService', useExisting: ChannelFollowingService }; const $RegistryApiService: Provider = { provide: 'RegistryApiService', useExisting: RegistryApiService }; -const $ReversiService: Provider = { provide: 'ReversiService', useExisting: ReversiService }; const $ChartLoggerService: Provider = { provide: 'ChartLoggerService', useExisting: ChartLoggerService }; const $FederationChart: Provider = { provide: 'FederationChart', useExisting: FederationChart }; @@ -244,8 +216,6 @@ const $ApRequestChart: Provider = { provide: 'ApRequestChart', useExisting: ApRe const $ChartManagementService: Provider = { provide: 'ChartManagementService', useExisting: ChartManagementService }; const $AbuseUserReportEntityService: Provider = { provide: 'AbuseUserReportEntityService', useExisting: AbuseUserReportEntityService }; -const $AnnouncementEntityService: Provider = { provide: 'AnnouncementEntityService', useExisting: AnnouncementEntityService }; -const $AbuseReportNotificationRecipientEntityService: Provider = { provide: 'AbuseReportNotificationRecipientEntityService', useExisting: AbuseReportNotificationRecipientEntityService }; const $AntennaEntityService: Provider = { provide: 'AntennaEntityService', useExisting: AntennaEntityService }; const $AppEntityService: Provider = { provide: 'AppEntityService', useExisting: AppEntityService }; const $AuthSessionEntityService: Provider = { provide: 'AuthSessionEntityService', useExisting: AuthSessionEntityService }; @@ -277,9 +247,6 @@ const $UserListEntityService: Provider = { provide: 'UserListEntityService', use const $FlashEntityService: Provider = { provide: 'FlashEntityService', useExisting: FlashEntityService }; const $FlashLikeEntityService: Provider = { provide: 'FlashLikeEntityService', useExisting: FlashLikeEntityService }; const $RoleEntityService: Provider = { provide: 'RoleEntityService', useExisting: RoleEntityService }; -const $ReversiGameEntityService: Provider = { provide: 'ReversiGameEntityService', useExisting: ReversiGameEntityService }; -const $MetaEntityService: Provider = { provide: 'MetaEntityService', useExisting: MetaEntityService }; -const $SystemWebhookEntityService: Provider = { provide: 'SystemWebhookEntityService', useExisting: SystemWebhookEntityService }; const $ApAudienceService: Provider = { provide: 'ApAudienceService', useExisting: ApAudienceService }; const $ApDbResolverService: Provider = { provide: 'ApDbResolverService', useExisting: ApDbResolverService }; @@ -290,7 +257,7 @@ const $ApMfmService: Provider = { provide: 'ApMfmService', useExisting: ApMfmSer const $ApRendererService: Provider = { provide: 'ApRendererService', useExisting: ApRendererService }; const $ApRequestService: Provider = { provide: 'ApRequestService', useExisting: ApRequestService }; const $ApResolverService: Provider = { provide: 'ApResolverService', useExisting: ApResolverService }; -const $JsonLdService: Provider = { provide: 'JsonLdService', useExisting: JsonLdService }; +const $LdSignatureService: Provider = { provide: 'LdSignatureService', useExisting: LdSignatureService }; const $RemoteLoggerService: Provider = { provide: 'RemoteLoggerService', useExisting: RemoteLoggerService }; const $RemoteUserResolveService: Provider = { provide: 'RemoteUserResolveService', useExisting: RemoteUserResolveService }; const $WebfingerService: Provider = { provide: 'WebfingerService', useExisting: WebfingerService }; @@ -307,8 +274,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting ], providers: [ LoggerService, - AbuseReportService, - AbuseReportNotificationService, AccountMoveService, AccountUpdateService, AiService, @@ -346,7 +311,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting PushNotificationService, QueryService, ReactionService, - ReactionsBufferingService, RelayService, RoleService, S3Service, @@ -359,17 +323,12 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting UserKeypairService, UserListService, UserMutingService, - UserRenoteMutingService, - UserSearchService, UserSuspendService, UserAuthService, VideoProcessingService, - UserWebhookService, - SystemWebhookService, - WebhookTestService, + WebhookService, UtilityService, FileInfoService, - FlashService, SearchService, ClipService, FeaturedService, @@ -377,8 +336,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting FanoutTimelineEndpointService, ChannelFollowingService, RegistryApiService, - ReversiService, - ChartLoggerService, FederationChart, NotesChart, @@ -393,10 +350,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting PerUserDriveChart, ApRequestChart, ChartManagementService, - AbuseUserReportEntityService, - AnnouncementEntityService, - AbuseReportNotificationRecipientEntityService, AntennaEntityService, AppEntityService, AuthSessionEntityService, @@ -428,10 +382,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting FlashEntityService, FlashLikeEntityService, RoleEntityService, - ReversiGameEntityService, - MetaEntityService, - SystemWebhookEntityService, - ApAudienceService, ApDbResolverService, ApDeliverManagerService, @@ -441,7 +391,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting ApRendererService, ApRequestService, ApResolverService, - JsonLdService, + LdSignatureService, RemoteLoggerService, RemoteUserResolveService, WebfingerService, @@ -454,8 +404,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting //#region 文字列ベースでのinjection用(循環参照対応のため) $LoggerService, - $AbuseReportService, - $AbuseReportNotificationService, $AccountMoveService, $AccountUpdateService, $AiService, @@ -493,7 +441,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $PushNotificationService, $QueryService, $ReactionService, - $ReactionsBufferingService, $RelayService, $RoleService, $S3Service, @@ -506,17 +453,12 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $UserKeypairService, $UserListService, $UserMutingService, - $UserRenoteMutingService, - $UserSearchService, $UserSuspendService, $UserAuthService, $VideoProcessingService, - $UserWebhookService, - $SystemWebhookService, - $WebhookTestService, + $WebhookService, $UtilityService, $FileInfoService, - $FlashService, $SearchService, $ClipService, $FeaturedService, @@ -524,8 +466,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $FanoutTimelineEndpointService, $ChannelFollowingService, $RegistryApiService, - $ReversiService, - $ChartLoggerService, $FederationChart, $NotesChart, @@ -540,10 +480,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $PerUserDriveChart, $ApRequestChart, $ChartManagementService, - $AbuseUserReportEntityService, - $AnnouncementEntityService, - $AbuseReportNotificationRecipientEntityService, $AntennaEntityService, $AppEntityService, $AuthSessionEntityService, @@ -575,10 +512,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $FlashEntityService, $FlashLikeEntityService, $RoleEntityService, - $ReversiGameEntityService, - $MetaEntityService, - $SystemWebhookEntityService, - $ApAudienceService, $ApDbResolverService, $ApDeliverManagerService, @@ -588,7 +521,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $ApRendererService, $ApRequestService, $ApResolverService, - $JsonLdService, + $LdSignatureService, $RemoteLoggerService, $RemoteUserResolveService, $WebfingerService, @@ -602,8 +535,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting exports: [ QueueModule, LoggerService, - AbuseReportService, - AbuseReportNotificationService, AccountMoveService, AccountUpdateService, AiService, @@ -641,7 +572,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting PushNotificationService, QueryService, ReactionService, - ReactionsBufferingService, RelayService, RoleService, S3Service, @@ -654,17 +584,12 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting UserKeypairService, UserListService, UserMutingService, - UserRenoteMutingService, - UserSearchService, UserSuspendService, UserAuthService, VideoProcessingService, - UserWebhookService, - SystemWebhookService, - WebhookTestService, + WebhookService, UtilityService, FileInfoService, - FlashService, SearchService, ClipService, FeaturedService, @@ -672,8 +597,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting FanoutTimelineEndpointService, ChannelFollowingService, RegistryApiService, - ReversiService, - FederationChart, NotesChart, UsersChart, @@ -687,10 +610,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting PerUserDriveChart, ApRequestChart, ChartManagementService, - AbuseUserReportEntityService, - AnnouncementEntityService, - AbuseReportNotificationRecipientEntityService, AntennaEntityService, AppEntityService, AuthSessionEntityService, @@ -722,10 +642,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting FlashEntityService, FlashLikeEntityService, RoleEntityService, - ReversiGameEntityService, - MetaEntityService, - SystemWebhookEntityService, - ApAudienceService, ApDbResolverService, ApDeliverManagerService, @@ -735,7 +651,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting ApRendererService, ApRequestService, ApResolverService, - JsonLdService, + LdSignatureService, RemoteLoggerService, RemoteUserResolveService, WebfingerService, @@ -748,8 +664,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting //#region 文字列ベースでのinjection用(循環参照対応のため) $LoggerService, - $AbuseReportService, - $AbuseReportNotificationService, $AccountMoveService, $AccountUpdateService, $AiService, @@ -787,7 +701,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $PushNotificationService, $QueryService, $ReactionService, - $ReactionsBufferingService, $RelayService, $RoleService, $S3Service, @@ -800,14 +713,10 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $UserKeypairService, $UserListService, $UserMutingService, - $UserRenoteMutingService, - $UserSearchService, $UserSuspendService, $UserAuthService, $VideoProcessingService, - $UserWebhookService, - $SystemWebhookService, - $WebhookTestService, + $WebhookService, $UtilityService, $FileInfoService, $SearchService, @@ -817,8 +726,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $FanoutTimelineEndpointService, $ChannelFollowingService, $RegistryApiService, - $ReversiService, - $FederationChart, $NotesChart, $UsersChart, @@ -832,10 +739,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $PerUserDriveChart, $ApRequestChart, $ChartManagementService, - $AbuseUserReportEntityService, - $AnnouncementEntityService, - $AbuseReportNotificationRecipientEntityService, $AntennaEntityService, $AppEntityService, $AuthSessionEntityService, @@ -867,10 +771,6 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $FlashEntityService, $FlashLikeEntityService, $RoleEntityService, - $ReversiGameEntityService, - $MetaEntityService, - $SystemWebhookEntityService, - $ApAudienceService, $ApDbResolverService, $ApDeliverManagerService, @@ -880,7 +780,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting $ApRendererService, $ApRequestService, $ApResolverService, - $JsonLdService, + $LdSignatureService, $RemoteLoggerService, $RemoteUserResolveService, $WebfingerService, diff --git a/packages/backend/src/core/CreateSystemUserService.ts b/packages/backend/src/core/CreateSystemUserService.ts index 6c5b0f6a36..6b475316f0 100644 --- a/packages/backend/src/core/CreateSystemUserService.ts +++ b/packages/backend/src/core/CreateSystemUserService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/CustomEmojiService.ts b/packages/backend/src/core/CustomEmojiService.ts index 4566113449..9a8267b466 100644 --- a/packages/backend/src/core/CustomEmojiService.ts +++ b/packages/backend/src/core/CustomEmojiService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -20,11 +20,11 @@ import { query } from '@/misc/prelude/url.js'; import type { Serialized } from '@/types.js'; import { ModerationLogService } from '@/core/ModerationLogService.js'; -const parseEmojiStrRegexp = /^([-\w]+)(?:@([\w.-]+))?$/; +const parseEmojiStrRegexp = /^(\w+)(?:@([\w.-]+))?$/; @Injectable() export class CustomEmojiService implements OnApplicationShutdown { - private emojisCache: MemoryKVCache; + private cache: MemoryKVCache; public localEmojisCache: RedisSingleCache>; constructor( @@ -40,7 +40,7 @@ export class CustomEmojiService implements OnApplicationShutdown { private moderationLogService: ModerationLogService, private globalEventService: GlobalEventService, ) { - this.emojisCache = new MemoryKVCache(1000 * 60 * 60 * 12); // 12h + this.cache = new MemoryKVCache(1000 * 60 * 60 * 12); this.localEmojisCache = new RedisSingleCache>(this.redisClient, 'localEmojis', { lifetime: 1000 * 60 * 30, // 30m @@ -68,7 +68,7 @@ export class CustomEmojiService implements OnApplicationShutdown { localOnly: boolean; roleIdsThatCanBeUsedThisEmojiAsReaction: MiRole['id'][]; }, moderator?: MiUser): Promise { - const emoji = await this.emojisRepository.insertOne({ + const emoji = await this.emojisRepository.insert({ id: this.idService.gen(), updatedAt: new Date(), name: data.name, @@ -82,7 +82,7 @@ export class CustomEmojiService implements OnApplicationShutdown { isSensitive: data.isSensitive, localOnly: data.localOnly, roleIdsThatCanBeUsedThisEmojiAsReaction: data.roleIdsThatCanBeUsedThisEmojiAsReaction, - }); + }).then(x => this.emojisRepository.findOneByOrFail(x.identifiers[0])); if (data.host == null) { this.localEmojisCache.refresh(); @@ -103,33 +103,19 @@ export class CustomEmojiService implements OnApplicationShutdown { } @bindThis - public async update(data: ( - { id: MiEmoji['id'], name?: string; } | { name: string; id?: MiEmoji['id'], } - ) & { + public async update(id: MiEmoji['id'], data: { driveFile?: MiDriveFile; + name?: string; category?: string | null; aliases?: string[]; license?: string | null; isSensitive?: boolean; localOnly?: boolean; roleIdsThatCanBeUsedThisEmojiAsReaction?: MiRole['id'][]; - }, moderator?: MiUser): Promise< - null - | 'NO_SUCH_EMOJI' - | 'SAME_NAME_EMOJI_EXISTS' - > { - const emoji = data.id - ? await this.getEmojiById(data.id) - : await this.getEmojiByName(data.name!); - if (emoji === null) return 'NO_SUCH_EMOJI'; - const id = emoji.id; - - // IDと絵文字名が両方指定されている場合は絵文字名の変更を行うため重複チェックが必要 - const doNameUpdate = data.id && data.name && (data.name !== emoji.name); - if (doNameUpdate) { - const isDuplicate = await this.checkDuplicate(data.name!); - if (isDuplicate) return 'SAME_NAME_EMOJI_EXISTS'; - } + }, 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'); await this.emojisRepository.update(emoji.id, { updatedAt: new Date(), @@ -149,7 +135,7 @@ export class CustomEmojiService implements OnApplicationShutdown { const packed = await this.emojiEntityService.packDetailed(emoji.id); - if (!doNameUpdate) { + if (emoji.name === data.name) { this.globalEventService.publishBroadcastStream('emojiUpdated', { emojis: [packed], }); @@ -171,7 +157,6 @@ export class CustomEmojiService implements OnApplicationShutdown { after: updated, }); } - return null; } @bindThis @@ -349,7 +334,7 @@ export class CustomEmojiService implements OnApplicationShutdown { host, })) ?? null; - const emoji = await this.emojisCache.fetch(`${name} ${host}`, queryOrNull); + const emoji = await this.cache.fetch(`${name} ${host}`, queryOrNull); if (emoji == null) return null; return emoji.publicUrl || emoji.originalUrl; // || emoji.originalUrl してるのは後方互換性のため(publicUrlはstringなので??はだめ) @@ -361,11 +346,10 @@ export class CustomEmojiService implements OnApplicationShutdown { @bindThis public async populateEmojis(emojiNames: string[], noteUserHost: string | null): Promise> { const emojis = await Promise.all(emojiNames.map(x => this.populateEmoji(x, noteUserHost))); - const res = {} as Record; + const res = {} as any; for (let i = 0; i < emojiNames.length; i++) { - const resolvedEmoji = emojis[i]; - if (resolvedEmoji != null) { - res[emojiNames[i]] = resolvedEmoji; + if (emojis[i] != null) { + res[emojiNames[i]] = emojis[i]; } } return res; @@ -376,7 +360,7 @@ export class CustomEmojiService implements OnApplicationShutdown { */ @bindThis public async prefetchEmojis(emojis: { name: string; host: string | null; }[]): Promise { - const notCachedEmojis = emojis.filter(emoji => this.emojisCache.get(`${emoji.name} ${emoji.host}`) == null); + const notCachedEmojis = emojis.filter(emoji => this.cache.get(`${emoji.name} ${emoji.host}`) == null); const emojisQuery: any[] = []; const hosts = new Set(notCachedEmojis.map(e => e.host)); for (const host of hosts) { @@ -391,7 +375,7 @@ export class CustomEmojiService implements OnApplicationShutdown { select: ['name', 'host', 'originalUrl', 'publicUrl'], }) : []; for (const emoji of _emojis) { - this.emojisCache.set(`${emoji.name} ${emoji.host}`, emoji); + this.cache.set(`${emoji.name} ${emoji.host}`, emoji); } } @@ -401,7 +385,7 @@ export class CustomEmojiService implements OnApplicationShutdown { */ @bindThis public checkDuplicate(name: string): Promise { - return this.emojisRepository.exists({ where: { name, host: IsNull() } }); + return this.emojisRepository.exist({ where: { name, host: IsNull() } }); } @bindThis @@ -409,14 +393,9 @@ export class CustomEmojiService implements OnApplicationShutdown { return this.emojisRepository.findOneBy({ id }); } - @bindThis - public getEmojiByName(name: string): Promise { - return this.emojisRepository.findOneBy({ name, host: IsNull() }); - } - @bindThis public dispose(): void { - this.emojisCache.dispose(); + this.cache.dispose(); } @bindThis diff --git a/packages/backend/src/core/DeleteAccountService.ts b/packages/backend/src/core/DeleteAccountService.ts index 7f1b8f3efb..570bd440e4 100644 --- a/packages/backend/src/core/DeleteAccountService.ts +++ b/packages/backend/src/core/DeleteAccountService.ts @@ -1,18 +1,14 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; -import { Not, IsNull } from 'typeorm'; -import type { FollowingsRepository, MiUser, UsersRepository } from '@/models/_.js'; +import type { UsersRepository } from '@/models/_.js'; import { QueueService } from '@/core/QueueService.js'; +import { UserSuspendService } from '@/core/UserSuspendService.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; -import { ModerationLogService } from '@/core/ModerationLogService.js'; @Injectable() export class DeleteAccountService { @@ -20,14 +16,8 @@ export class DeleteAccountService { @Inject(DI.usersRepository) private usersRepository: UsersRepository, - @Inject(DI.followingsRepository) - private followingsRepository: FollowingsRepository, - - private userEntityService: UserEntityService, - private apRendererService: ApRendererService, + private userSuspendService: UserSuspendService, private queueService: QueueService, - private globalEventService: GlobalEventService, - private moderationLogService: ModerationLogService, ) { } @@ -35,57 +25,19 @@ export class DeleteAccountService { public async deleteAccount(user: { id: string; host: string | null; - }, moderator?: MiUser): Promise { + }): Promise { const _user = await this.usersRepository.findOneByOrFail({ id: user.id }); if (_user.isRoot) throw new Error('cannot delete a root account'); - if (moderator != null) { - this.moderationLogService.log(moderator, 'deleteAccount', { - userId: user.id, - userUsername: _user.username, - userHost: user.host, - }); - } - // 物理削除する前にDelete activityを送信する - if (this.userEntityService.isLocalUser(user)) { - // 知り得る全SharedInboxにDelete配信 - const content = this.apRendererService.addContext(this.apRendererService.renderDelete(this.userEntityService.genLocalUserUri(user.id), user)); + await this.userSuspendService.doPostSuspend(user).catch(e => {}); - const queue: string[] = []; - - const followings = await this.followingsRepository.find({ - where: [ - { followerSharedInbox: Not(IsNull()) }, - { followeeSharedInbox: Not(IsNull()) }, - ], - select: ['followerSharedInbox', 'followeeSharedInbox'], - }); - - const inboxes = followings.map(x => x.followerSharedInbox ?? x.followeeSharedInbox); - - for (const inbox of inboxes) { - if (inbox != null && !queue.includes(inbox)) queue.push(inbox); - } - - for (const inbox of queue) { - this.queueService.deliver(user, content, inbox, true); - } - - this.queueService.createDeleteAccountJob(user, { - soft: false, - }); - } else { - // リモートユーザーの削除は、完全にDBから物理削除してしまうと再度連合してきてアカウントが復活する可能性があるため、soft指定する - this.queueService.createDeleteAccountJob(user, { - soft: true, - }); - } + this.queueService.createDeleteAccountJob(user, { + soft: false, + }); await this.usersRepository.update(user.id, { isDeleted: true, }); - - this.globalEventService.publishInternalEvent('userChangeDeletedState', { id: user.id, isDeleted: true }); } } diff --git a/packages/backend/src/core/DownloadService.ts b/packages/backend/src/core/DownloadService.ts index 93f4a38246..5474272b00 100644 --- a/packages/backend/src/core/DownloadService.ts +++ b/packages/backend/src/core/DownloadService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -42,7 +42,7 @@ export class DownloadService { const timeout = 30 * 1000; const operationTimeout = 60 * 1000; - const maxSize = this.config.maxFileSize; + const maxSize = this.config.maxFileSize ?? 262144000; const urlObj = new URL(url); let filename = urlObj.pathname.split('/').pop() ?? 'untitled'; @@ -145,8 +145,7 @@ export class DownloadService { const parsedIp = ipaddr.parse(ip); for (const net of this.config.allowedPrivateNetworks ?? []) { - const cidr = ipaddr.parseCIDR(net); - if (cidr[0].kind() === parsedIp.kind() && parsedIp.match(ipaddr.parseCIDR(net))) { + if (parsedIp.match(ipaddr.parseCIDR(net))) { return false; } } diff --git a/packages/backend/src/core/DriveService.ts b/packages/backend/src/core/DriveService.ts index c332e5a0a8..484f4fc52e 100644 --- a/packages/backend/src/core/DriveService.ts +++ b/packages/backend/src/core/DriveService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,14 +7,15 @@ import { randomUUID } from 'node:crypto'; import * as fs from 'node:fs'; import { Inject, Injectable } from '@nestjs/common'; import sharp from 'sharp'; -import { sharpBmp } from '@misskey-dev/sharp-read-bmp'; +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, MiMeta } from '@/models/_.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/User.js'; +import { MetaService } from '@/core/MetaService.js'; import { MiDriveFile } from '@/models/DriveFile.js'; import { IdService } from '@/core/IdService.js'; import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; @@ -42,7 +43,6 @@ 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'; -import { UtilityService } from '@/core/UtilityService.js'; type AddFileArgs = { /** User who wish to add file */ @@ -98,9 +98,6 @@ export class DriveService { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -117,6 +114,7 @@ export class DriveService { private userEntityService: UserEntityService, private driveFileEntityService: DriveFileEntityService, private idService: IdService, + private metaService: MetaService, private downloadService: DownloadService, private internalStorageService: InternalStorageService, private s3Service: S3Service, @@ -129,7 +127,6 @@ export class DriveService { private driveChart: DriveChart, private perUserDriveChart: PerUserDriveChart, private instanceChart: InstanceChart, - private utilityService: UtilityService, ) { const logger = new Logger('drive', 'blue'); this.registerLogger = logger.createSubLogger('register', 'yellow'); @@ -150,7 +147,9 @@ export class DriveService { // thunbnail, webpublic を必要なら生成 const alts = await this.generateAlts(path, type, !file.uri); - if (this.meta.useObjectStorage) { + const meta = await this.metaService.fetch(); + + if (meta.useObjectStorage) { //#region ObjectStorage params let [ext] = (name.match(/\.([a-zA-Z0-9_-]+)$/) ?? ['']); @@ -169,11 +168,11 @@ export class DriveService { ext = ''; } - const baseUrl = this.meta.objectStorageBaseUrl - ?? `${ this.meta.objectStorageUseSSL ? 'https' : 'http' }://${ this.meta.objectStorageEndpoint }${ this.meta.objectStoragePort ? `:${this.meta.objectStoragePort}` : '' }/${ this.meta.objectStorageBucket }`; + const baseUrl = meta.objectStorageBaseUrl + ?? `${ meta.objectStorageUseSSL ? 'https' : 'http' }://${ meta.objectStorageEndpoint }${ meta.objectStoragePort ? `:${meta.objectStoragePort}` : '' }/${ meta.objectStorageBucket }`; // for original - const key = `${this.meta.objectStoragePrefix}/${randomUUID()}${ext}`; + const key = `${meta.objectStoragePrefix}/${randomUUID()}${ext}`; const url = `${ baseUrl }/${ key }`; // for alts @@ -190,7 +189,7 @@ export class DriveService { ]; if (alts.webpublic) { - webpublicKey = `${this.meta.objectStoragePrefix}/webpublic-${randomUUID()}.${alts.webpublic.ext}`; + webpublicKey = `${meta.objectStoragePrefix}/webpublic-${randomUUID()}.${alts.webpublic.ext}`; webpublicUrl = `${ baseUrl }/${ webpublicKey }`; this.registerLogger.info(`uploading webpublic: ${webpublicKey}`); @@ -198,7 +197,7 @@ export class DriveService { } if (alts.thumbnail) { - thumbnailKey = `${this.meta.objectStoragePrefix}/thumbnail-${randomUUID()}.${alts.thumbnail.ext}`; + thumbnailKey = `${meta.objectStoragePrefix}/thumbnail-${randomUUID()}.${alts.thumbnail.ext}`; thumbnailUrl = `${ baseUrl }/${ thumbnailKey }`; this.registerLogger.info(`uploading thumbnail: ${thumbnailKey}`); @@ -221,7 +220,7 @@ export class DriveService { file.size = size; file.storedInternal = false; - return await this.driveFilesRepository.insertOne(file); + return await this.driveFilesRepository.insert(file).then(x => this.driveFilesRepository.findOneByOrFail(x.identifiers[0])); } else { // use internal storage const accessKey = randomUUID(); const thumbnailAccessKey = 'thumbnail-' + randomUUID(); @@ -255,7 +254,7 @@ export class DriveService { file.md5 = hash; file.size = size; - return await this.driveFilesRepository.insertOne(file); + return await this.driveFilesRepository.insert(file).then(x => this.driveFilesRepository.findOneByOrFail(x.identifiers[0])); } } @@ -375,8 +374,10 @@ export class DriveService { if (type === 'image/apng') type = 'image/png'; if (!FILE_TYPE_BROWSERSAFE.includes(type)) type = 'application/octet-stream'; + const meta = await this.metaService.fetch(); + const params = { - Bucket: this.meta.objectStorageBucket, + Bucket: meta.objectStorageBucket, Key: key, Body: stream, ContentType: type, @@ -389,9 +390,9 @@ export class DriveService { // 許可されているファイル形式でしか拡張子をつけない ext ? correctFilename(filename, ext) : filename, ); - if (this.meta.objectStorageSetPublicRead) params.ACL = 'public-read'; + if (meta.objectStorageSetPublicRead) params.ACL = 'public-read'; - await this.s3Service.upload(this.meta, params) + await this.s3Service.upload(meta, params) .then( result => { if ('Bucket' in result) { // CompleteMultipartUploadCommandOutput @@ -457,31 +458,32 @@ export class DriveService { ext = null, }: AddFileArgs): Promise { let skipNsfwCheck = false; + const instance = await this.metaService.fetch(); const userRoleNSFW = user && (await this.roleService.getUserPolicies(user.id)).alwaysMarkNsfw; if (user == null) { skipNsfwCheck = true; } else if (userRoleNSFW) { skipNsfwCheck = true; } - if (this.meta.sensitiveMediaDetection === 'none') skipNsfwCheck = true; - if (user && this.meta.sensitiveMediaDetection === 'local' && this.userEntityService.isRemoteUser(user)) skipNsfwCheck = true; - if (user && this.meta.sensitiveMediaDetection === 'remote' && this.userEntityService.isLocalUser(user)) skipNsfwCheck = true; + if (instance.sensitiveMediaDetection === 'none') skipNsfwCheck = true; + if (user && instance.sensitiveMediaDetection === 'local' && this.userEntityService.isRemoteUser(user)) skipNsfwCheck = true; + if (user && instance.sensitiveMediaDetection === 'remote' && this.userEntityService.isLocalUser(user)) skipNsfwCheck = true; const info = await this.fileInfoService.getFileInfo(path, { skipSensitiveDetection: skipNsfwCheck, sensitiveThreshold: // 感度が高いほどしきい値は低くすることになる - this.meta.sensitiveMediaDetectionSensitivity === 'veryHigh' ? 0.1 : - this.meta.sensitiveMediaDetectionSensitivity === 'high' ? 0.3 : - this.meta.sensitiveMediaDetectionSensitivity === 'low' ? 0.7 : - this.meta.sensitiveMediaDetectionSensitivity === 'veryLow' ? 0.9 : + instance.sensitiveMediaDetectionSensitivity === 'veryHigh' ? 0.1 : + instance.sensitiveMediaDetectionSensitivity === 'high' ? 0.3 : + instance.sensitiveMediaDetectionSensitivity === 'low' ? 0.7 : + instance.sensitiveMediaDetectionSensitivity === 'veryLow' ? 0.9 : 0.5, sensitiveThresholdForPorn: 0.75, - enableSensitiveMediaDetectionForVideos: this.meta.enableSensitiveMediaDetectionForVideos, + enableSensitiveMediaDetectionForVideos: instance.enableSensitiveMediaDetectionForVideos, }); this.registerLogger.info(`${JSON.stringify(info)}`); // 現状 false positive が多すぎて実用に耐えない - //if (info.porn && this.meta.disallowUploadWhenPredictedAsPorn) { + //if (info.porn && instance.disallowUploadWhenPredictedAsPorn) { // throw new IdentifiableError('282f77bf-5816-4f72-9264-aa14d8261a21', 'Detected as porn.'); //} @@ -495,20 +497,14 @@ export class DriveService { if (user && !force) { // Check if there is a file with the same hash - const matched = await this.driveFilesRepository.findOneBy({ + const much = await this.driveFilesRepository.findOneBy({ md5: info.md5, userId: user.id, }); - if (matched) { - this.registerLogger.info(`file with same hash is found: ${matched.id}`); - if (sensitive && !matched.isSensitive) { - // The file is federated as sensitive for this time, but was federated as non-sensitive before. - // Therefore, update the file to sensitive. - await this.driveFilesRepository.update({ id: matched.id }, { isSensitive: true }); - matched.isSensitive = true; - } - return matched; + if (much) { + this.registerLogger.info(`file with same hash is found: ${much.id}`); + return much; } } @@ -585,9 +581,8 @@ export class DriveService { sensitive ?? false : false; - if (user && this.utilityService.isMediaSilencedHost(this.meta.mediaSilencedHosts, user.host)) file.isSensitive = true; if (info.sensitive && profile!.autoSensitive) file.isSensitive = true; - if (info.sensitive && this.meta.setSensitiveFlagAutomatically) file.isSensitive = true; + if (info.sensitive && instance.setSensitiveFlagAutomatically) file.isSensitive = true; if (userRoleNSFW) file.isSensitive = true; if (url !== null) { @@ -614,7 +609,7 @@ export class DriveService { file.type = info.type.mime; file.storedInternal = false; - file = await this.driveFilesRepository.insertOne(file); + file = await this.driveFilesRepository.insert(file).then(x => this.driveFilesRepository.findOneByOrFail(x.identifiers[0])); } catch (err) { // duplicate key error (when already registered) if (isDuplicateKeyValueError(err)) { @@ -648,7 +643,7 @@ export class DriveService { // ローカルユーザーのみ this.perUserDriveChart.update(file, true); } else { - if (this.meta.enableChartsForFederatedInstances) { + if ((await this.metaService.fetch()).enableChartsForFederatedInstances) { this.instanceChart.updateDrive(file, true); } } @@ -660,7 +655,7 @@ export class DriveService { public async updateFile(file: MiDriveFile, values: Partial, updater: MiUser) { const alwaysMarkNsfw = (await this.roleService.getUserPolicies(file.userId)).alwaysMarkNsfw; - if (values.name != null && !this.driveFileEntityService.validateFileName(values.name)) { + if (values.name && !this.driveFileEntityService.validateFileName(file.name)) { throw new DriveService.InvalidFileNameError(); } @@ -794,7 +789,7 @@ export class DriveService { // ローカルユーザーのみ this.perUserDriveChart.update(file, false); } else { - if (this.meta.enableChartsForFederatedInstances) { + if ((await this.metaService.fetch()).enableChartsForFederatedInstances) { this.instanceChart.updateDrive(file, false); } } @@ -816,13 +811,14 @@ export class DriveService { @bindThis public async deleteObjectStorageFile(key: string) { + const meta = await this.metaService.fetch(); try { const param = { - Bucket: this.meta.objectStorageBucket, + Bucket: meta.objectStorageBucket, Key: key, } as DeleteObjectCommandInput; - await this.s3Service.delete(this.meta, param); + await this.s3Service.delete(meta, param); } catch (err: any) { if (err.name === 'NoSuchKey') { this.deleteLogger.warn(`The object storage had no such key to delete: ${key}. Skipping this.`, err as Error); diff --git a/packages/backend/src/core/EmailService.ts b/packages/backend/src/core/EmailService.ts index a176474b95..7e812b4df2 100644 --- a/packages/backend/src/core/EmailService.ts +++ b/packages/backend/src/core/EmailService.ts @@ -1,18 +1,18 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { URLSearchParams } from 'node:url'; import * as nodemailer from 'nodemailer'; -import juice from 'juice'; import { Inject, Injectable } from '@nestjs/common'; import { validate as validateEmail } from 'deep-email-validator'; +import { MetaService } from '@/core/MetaService.js'; import { UtilityService } from '@/core/UtilityService.js'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import type Logger from '@/logger.js'; -import type { MiMeta, UserProfilesRepository } from '@/models/_.js'; +import type { UserProfilesRepository } from '@/models/_.js'; import { LoggerService } from '@/core/LoggerService.js'; import { bindThis } from '@/decorators.js'; import { HttpRequestService } from '@/core/HttpRequestService.js'; @@ -25,12 +25,10 @@ export class EmailService { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, + private metaService: MetaService, private loggerService: LoggerService, private utilityService: UtilityService, private httpRequestService: HttpRequestService, @@ -40,26 +38,33 @@ export class EmailService { @bindThis public async sendEmail(to: string, subject: string, html: string, text: string) { - if (!this.meta.enableEmail) return; + const meta = await this.metaService.fetch(true); const iconUrl = `${this.config.url}/static-assets/mi-white.png`; const emailSettingUrl = `${this.config.url}/settings/email`; - const enableAuth = this.meta.smtpUser != null && this.meta.smtpUser !== ''; + const enableAuth = meta.smtpUser != null && meta.smtpUser !== ''; const transporter = nodemailer.createTransport({ - host: this.meta.smtpHost, - port: this.meta.smtpPort, - secure: this.meta.smtpSecure, + host: meta.smtpHost, + port: meta.smtpPort, + secure: meta.smtpSecure, ignoreTLS: !enableAuth, proxy: this.config.proxySmtp, auth: enableAuth ? { - user: this.meta.smtpUser, - pass: this.meta.smtpPass, + user: meta.smtpUser, + pass: meta.smtpPass, } : undefined, } as any); - const htmlContent = ` + try { + // TODO: htmlサニタイズ + const info = await transporter.sendMail({ + from: meta.email!, + to: to, + subject: subject, + text: text, + html: ` @@ -124,7 +129,7 @@ export class EmailService {
- +

${ subject }

@@ -138,18 +143,7 @@ export class EmailService { ${ this.config.host } -`; - - const inlinedHtml = juice(htmlContent); - - try { - // TODO: htmlサニタイズ - const info = await transporter.sendMail({ - from: this.meta.email!, - to: to, - subject: subject, - text: text, - html: inlinedHtml, +`, }); this.logger.info(`Message sent: ${info.messageId}`); @@ -164,28 +158,23 @@ export class EmailService { available: boolean; reason: null | 'used' | 'format' | 'disposable' | 'mx' | 'smtp' | 'banned' | 'network' | 'blacklist'; }> { + const meta = await this.metaService.fetch(); + const exist = await this.userProfilesRepository.countBy({ emailVerified: true, email: emailAddress, }); - if (exist !== 0) { - return { - available: false, - reason: 'used', - }; - } - let validated: { valid: boolean, reason?: string | null, - } = { valid: true, reason: null }; + }; - if (this.meta.enableActiveEmailValidation) { - if (this.meta.enableVerifymailApi && this.meta.verifymailAuthKey != null) { - validated = await this.verifyMail(emailAddress, this.meta.verifymailAuthKey); - } else if (this.meta.enableTruemailApi && this.meta.truemailInstance && this.meta.truemailAuthKey != null) { - validated = await this.trueMail(this.meta.truemailInstance, emailAddress, this.meta.truemailAuthKey); + if (meta.enableActiveEmailValidation) { + if (meta.enableVerifymailApi && meta.verifymailAuthKey != null) { + validated = await this.verifyMail(emailAddress, meta.verifymailAuthKey); + } else if (meta.enableTruemailApi && meta.truemailInstance && meta.truemailAuthKey != null) { + validated = await this.trueMail(meta.truemailInstance, emailAddress, meta.truemailAuthKey); } else { validated = await validateEmail({ email: emailAddress, @@ -196,37 +185,27 @@ export class EmailService { validateSMTP: false, // 日本だと25ポートが殆どのプロバイダーで塞がれていてタイムアウトになるので }); } - } - - if (!validated.valid) { - const formatReason: Record = { - regex: 'format', - disposable: 'disposable', - mx: 'mx', - smtp: 'smtp', - network: 'network', - blacklist: 'blacklist', - }; - - return { - available: false, - reason: validated.reason ? formatReason[validated.reason] ?? null : null, - }; + } else { + validated = { valid: true, reason: null }; } const emailDomain: string = emailAddress.split('@')[1]; - const isBanned = this.utilityService.isBlockedHost(this.meta.bannedEmailDomains, emailDomain); + const isBanned = this.utilityService.isBlockedHost(meta.bannedEmailDomains, emailDomain); - if (isBanned) { - return { - available: false, - reason: 'banned', - }; - } + const available = exist === 0 && validated.valid && !isBanned; return { - available: true, - reason: null, + available, + reason: available ? null : + exist !== 0 ? 'used' : + isBanned ? 'banned' : + validated.reason === 'regex' ? 'format' : + validated.reason === 'disposable' ? 'disposable' : + validated.reason === 'mx' ? 'mx' : + validated.reason === 'smtp' ? 'smtp' : + validated.reason === 'network' ? 'network' : + validated.reason === 'blacklist' ? 'blacklist' : + null, }; } @@ -243,8 +222,7 @@ export class EmailService { }, }); - const json = (await res.json()) as Partial<{ - message: string; + const json = (await res.json()) as { block: boolean; catch_all: boolean; deliverable_email: boolean; @@ -259,15 +237,8 @@ export class EmailService { mx_priority: { [key: string]: number }; privacy: boolean; related_domains: string[]; - }>; + }; - /* api error: when there is only one `message` attribute in the returned result */ - if (Object.keys(json).length === 1 && Reflect.has(json, 'message')) { - return { - valid: false, - reason: null, - }; - } if (json.email_address === undefined) { return { valid: false, @@ -310,26 +281,25 @@ export class EmailService { headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: truemailAuthKey, + Authorization: truemailAuthKey }, }); - + const json = (await res.json()) as { email: string; success: boolean; - error?: string; - errors?: { + errors?: { list_match?: string; regex?: string; mx?: string; smtp?: string; } | null; }; - - if (json.email === undefined || json.errors?.regex) { + + if (json.email === undefined || (json.email !== undefined && json.errors?.regex)) { return { - valid: false, - reason: 'format', + valid: false, + reason: 'format', }; } if (json.errors?.smtp) { @@ -350,7 +320,7 @@ export class EmailService { reason: json.errors?.list_match as T || 'blacklist', }; } - + return { valid: true, reason: null, diff --git a/packages/backend/src/core/FanoutTimelineEndpointService.ts b/packages/backend/src/core/FanoutTimelineEndpointService.ts index b05af99c5e..11027960f1 100644 --- a/packages/backend/src/core/FanoutTimelineEndpointService.ts +++ b/packages/backend/src/core/FanoutTimelineEndpointService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -13,7 +13,7 @@ import type { NotesRepository } from '@/models/_.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { FanoutTimelineName, FanoutTimelineService } from '@/core/FanoutTimelineService.js'; import { isUserRelated } from '@/misc/is-user-related.js'; -import { isQuote, isRenote } from '@/misc/is-renote.js'; +import { isPureRenote } from '@/misc/is-pure-renote.js'; import { CacheService } from '@/core/CacheService.js'; import { isReply } from '@/misc/is-reply.js'; import { isInstanceMuted } from '@/misc/is-instance-muted.js'; @@ -55,20 +55,24 @@ export class FanoutTimelineEndpointService { @bindThis private async getMiNotes(ps: TimelineOptions): Promise { + let noteIds: string[]; + let shouldFallbackToDb = false; + // 呼び出し元と以下の処理をシンプルにするためにdbFallbackを置き換える if (!ps.useDbFallback) ps.dbFallback = () => Promise.resolve([]); - const ascending = ps.sinceId && !ps.untilId; - const idCompare: (a: string, b: string) => number = ascending ? (a, b) => a < b ? -1 : 1 : (a, b) => a > b ? -1 : 1; + const shouldPrepend = ps.sinceId && !ps.untilId; + const idCompare: (a: string, b: string) => number = shouldPrepend ? (a, b) => a < b ? -1 : 1 : (a, b) => a > b ? -1 : 1; const redisResult = await this.fanoutTimelineService.getMulti(ps.redisTimelines, ps.untilId, ps.sinceId); // TODO: いい感じにgetMulti内でソート済だからuniqするときにredisResultが全てソート済なのを利用して再ソートを避けたい - const redisResultIds = Array.from(new Set(redisResult.flat(1))).sort(idCompare); + const redisResultIds = Array.from(new Set(redisResult.flat(1))); - let noteIds = redisResultIds.slice(0, ps.limit); - const oldestNoteId = ascending ? redisResultIds[0] : redisResultIds[redisResultIds.length - 1]; - const shouldFallbackToDb = noteIds.length === 0 || ps.sinceId != null && ps.sinceId < oldestNoteId; + redisResultIds.sort(idCompare); + noteIds = redisResultIds.slice(0, ps.limit); + + shouldFallbackToDb = shouldFallbackToDb || (noteIds.length === 0); if (!shouldFallbackToDb) { let filter = ps.noteFilter ?? (_note => true); @@ -91,7 +95,7 @@ export class FanoutTimelineEndpointService { if (ps.excludePureRenotes) { const parentFilter = filter; - filter = (note) => (!isRenote(note) || isQuote(note)) && parentFilter(note); + filter = (note) => !isPureRenote(note) && parentFilter(note); } if (ps.me) { @@ -112,7 +116,7 @@ export class FanoutTimelineEndpointService { filter = (note) => { if (isUserRelated(note, userIdsWhoBlockingMe, ps.ignoreAuthorFromBlock)) return false; if (isUserRelated(note, userIdsWhoMeMuting, ps.ignoreAuthorFromMute)) return false; - if (!ps.ignoreAuthorFromMute && isRenote(note) && !isQuote(note) && userIdsWhoMeMutingRenotes.has(note.userId)) return false; + if (isPureRenote(note) && isUserRelated(note, userIdsWhoMeMutingRenotes, ps.ignoreAuthorFromMute)) return false; if (isInstanceMuted(note, userMutedInstances)) return false; return parentFilter(note); @@ -138,7 +142,9 @@ export class FanoutTimelineEndpointService { if (ps.allowPartial ? redisTimeline.length !== 0 : redisTimeline.length >= ps.limit) { // 十分Redisからとれた - return redisTimeline.slice(0, ps.limit); + const result = redisTimeline.slice(0, ps.limit); + if (shouldPrepend) result.reverse(); + return result; } } @@ -146,7 +152,8 @@ export class FanoutTimelineEndpointService { const remainingToRead = ps.limit - redisTimeline.length; let dbUntil: string | null; let dbSince: string | null; - if (ascending) { + if (shouldPrepend) { + redisTimeline.reverse(); dbUntil = ps.untilId; dbSince = noteIds[noteIds.length - 1]; } else { @@ -154,7 +161,7 @@ export class FanoutTimelineEndpointService { dbSince = ps.sinceId; } const gotFromDb = await ps.dbFallback(dbUntil, dbSince, remainingToRead); - return [...redisTimeline, ...gotFromDb]; + return shouldPrepend ? [...gotFromDb, ...redisTimeline] : [...redisTimeline, ...gotFromDb]; } return await ps.dbFallback(ps.untilId, ps.sinceId, ps.limit); diff --git a/packages/backend/src/core/FanoutTimelineService.ts b/packages/backend/src/core/FanoutTimelineService.ts index f6dabfadcd..9b2678fbcd 100644 --- a/packages/backend/src/core/FanoutTimelineService.ts +++ b/packages/backend/src/core/FanoutTimelineService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/FeaturedService.ts b/packages/backend/src/core/FeaturedService.ts index b3335e38da..595383c82c 100644 --- a/packages/backend/src/core/FeaturedService.ts +++ b/packages/backend/src/core/FeaturedService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/FederatedInstanceService.ts b/packages/backend/src/core/FederatedInstanceService.ts index 73bbf03b26..e41f010e48 100644 --- a/packages/backend/src/core/FederatedInstanceService.ts +++ b/packages/backend/src/core/FederatedInstanceService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -40,14 +40,13 @@ export class FederatedInstanceService implements OnApplicationShutdown { firstRetrievedAt: new Date(parsed.firstRetrievedAt), latestRequestReceivedAt: parsed.latestRequestReceivedAt ? new Date(parsed.latestRequestReceivedAt) : null, infoUpdatedAt: parsed.infoUpdatedAt ? new Date(parsed.infoUpdatedAt) : null, - notRespondingSince: parsed.notRespondingSince ? new Date(parsed.notRespondingSince) : null, }; }, }); } @bindThis - public async fetchOrRegister(host: string): Promise { + public async fetch(host: string): Promise { host = this.utilityService.toPuny(host); const cached = await this.federatedInstanceCache.get(host); @@ -56,11 +55,11 @@ export class FederatedInstanceService implements OnApplicationShutdown { const index = await this.instancesRepository.findOneBy({ host }); if (index == null) { - const i = await this.instancesRepository.insertOne({ + const i = await this.instancesRepository.insert({ id: this.idService.gen(), host, firstRetrievedAt: new Date(), - }); + }).then(x => this.instancesRepository.findOneByOrFail(x.identifiers[0])); this.federatedInstanceCache.set(host, i); return i; @@ -70,24 +69,6 @@ export class FederatedInstanceService implements OnApplicationShutdown { } } - @bindThis - public async fetch(host: string): Promise { - host = this.utilityService.toPuny(host); - - const cached = await this.federatedInstanceCache.get(host); - if (cached !== undefined) return cached; - - const index = await this.instancesRepository.findOneBy({ host }); - - if (index == null) { - this.federatedInstanceCache.set(host, null); - return null; - } else { - this.federatedInstanceCache.set(host, index); - return index; - } - } - @bindThis public async update(id: MiInstance['id'], data: Partial): Promise { const result = await this.instancesRepository.createQueryBuilder().update() diff --git a/packages/backend/src/core/FetchInstanceMetadataService.ts b/packages/backend/src/core/FetchInstanceMetadataService.ts index 987999bce7..682acef15b 100644 --- a/packages/backend/src/core/FetchInstanceMetadataService.ts +++ b/packages/backend/src/core/FetchInstanceMetadataService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -51,38 +51,24 @@ export class FetchInstanceMetadataService { } @bindThis - // public for test - public async tryLock(host: string): Promise { - // TODO: マイグレーションなのであとで消す (2024.3.1) - this.redisClient.del(`fetchInstanceMetadata:mutex:${host}`); - - return await this.redisClient.set( - `fetchInstanceMetadata:mutex:v2:${host}`, '1', - 'EX', 30, // 30秒したら自動でロック解除 https://github.com/misskey-dev/misskey/issues/13506#issuecomment-1975375395 - 'GET' // 古い値を返す(なかったらnull) - ); + public async tryLock(host: string): Promise { + const mutex = await this.redisClient.set(`fetchInstanceMetadata:mutex:${host}`, '1', 'GET'); + return mutex !== '1'; } @bindThis - // public for test - public unlock(host: string): Promise { - return this.redisClient.del(`fetchInstanceMetadata:mutex:v2:${host}`); + public unlock(host: string): Promise<'OK'> { + return this.redisClient.set(`fetchInstanceMetadata:mutex:${host}`, '0'); } @bindThis public async fetchInstanceMetadata(instance: MiInstance, force = false): Promise { const host = instance.host; - - // finallyでunlockされてしまうのでtry内でロックチェックをしない - // (returnであってもfinallyは実行される) - if (!force && await this.tryLock(host) === '1') { - // 1が返ってきていたらロックされているという意味なので、何もしない - return; - } - + // Acquire mutex to ensure no parallel runs + if (!await this.tryLock(host)) return; try { if (!force) { - const _instance = await this.federatedInstanceService.fetchOrRegister(host); + const _instance = await this.federatedInstanceService.fetch(host); const now = Date.now(); if (_instance && _instance.infoUpdatedAt && (now - _instance.infoUpdatedAt.getTime() < 1000 * 60 * 60 * 24)) { // unlock at the finally caluse @@ -154,7 +140,7 @@ export class FetchInstanceMetadataService { throw new Error('No wellknown links'); } - const links = wellknown.links as ({ rel: string, href: string; })[]; + const links = wellknown.links as any[]; 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'); diff --git a/packages/backend/src/core/FileInfoService.ts b/packages/backend/src/core/FileInfoService.ts index 6bd6cb8d9b..fdea59a8ad 100644 --- a/packages/backend/src/core/FileInfoService.ts +++ b/packages/backend/src/core/FileInfoService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -14,12 +14,10 @@ import FFmpeg from 'fluent-ffmpeg'; import isSvg from 'is-svg'; import probeImageSize from 'probe-image-size'; import { type predictionType } from 'nsfwjs'; -import { sharpBmp } from '@misskey-dev/sharp-read-bmp'; -import * as blurhash from 'blurhash'; +import sharp from 'sharp'; +import { encode } from 'blurhash'; import { createTempDir } from '@/misc/create-temp.js'; import { AiService } from '@/core/AiService.js'; -import { LoggerService } from '@/core/LoggerService.js'; -import type Logger from '@/logger.js'; import { bindThis } from '@/decorators.js'; export type FileInfo = { @@ -50,13 +48,9 @@ const TYPE_SVG = { @Injectable() export class FileInfoService { - private logger: Logger; - constructor( private aiService: AiService, - private loggerService: LoggerService, ) { - this.logger = this.loggerService.getLogger('file-info'); } /** @@ -128,7 +122,7 @@ export class FileInfoService { 'image/avif', 'image/svg+xml', ].includes(type.mime)) { - blurhash = await this.getBlurhash(path, type.mime).catch(e => { + blurhash = await this.getBlurhash(path).catch(e => { warnings.push(`getBlurhash failed: ${e}`); return undefined; }); @@ -322,34 +316,6 @@ export class FileInfoService { return mime; } - /** - * ビデオファイルにビデオトラックがあるかどうかチェック - * (ない場合:m4a, webmなど) - * - * @param path ファイルパス - * @returns ビデオトラックがあるかどうか(エラー発生時は常に`true`を返す) - */ - @bindThis - private hasVideoTrackOnVideoFile(path: string): Promise { - const sublogger = this.logger.createSubLogger('ffprobe'); - sublogger.info(`Checking the video file. File path: ${path}`); - return new Promise((resolve) => { - try { - FFmpeg.ffprobe(path, (err, metadata) => { - if (err) { - sublogger.warn(`Could not check the video file. Returns true. File path: ${path}`, err); - resolve(true); - return; - } - resolve(metadata.streams.some((stream) => stream.codec_type === 'video')); - }); - } catch (err) { - sublogger.warn(`Could not check the video file. Returns true. File path: ${path}`, err as Error); - resolve(true); - } - }); - } - /** * Detect MIME Type and extension */ @@ -372,20 +338,6 @@ export class FileInfoService { return TYPE_SVG; } - if ((type.mime.startsWith('video') || type.mime === 'application/ogg') && !(await this.hasVideoTrackOnVideoFile(path))) { - const newMime = `audio/${type.mime.split('/')[1]}`; - if (newMime === 'audio/mp4') { - return { - mime: 'audio/mp4', - ext: 'm4a', - }; - } - return { - mime: newMime, - ext: type.ext, - }; - } - return { mime: this.fixMime(type.mime), ext: type.ext, @@ -452,12 +404,12 @@ export class FileInfoService { } /** - * Calculate blurhash string of image + * Calculate average color of image */ @bindThis - private getBlurhash(path: string, type: string): Promise { - return new Promise(async (resolve, reject) => { - (await sharpBmp(path, type)) + private getBlurhash(path: string): Promise { + return new Promise((resolve, reject) => { + sharp(path) .raw() .ensureAlpha() .resize(64, 64, { fit: 'inside' }) @@ -467,7 +419,7 @@ export class FileInfoService { let hash; try { - hash = blurhash.encode(new Uint8ClampedArray(buffer), info.width, info.height, 5, 5); + hash = encode(new Uint8ClampedArray(buffer), info.width, info.height, 5, 5); } catch (e) { return reject(e); } diff --git a/packages/backend/src/core/FlashService.ts b/packages/backend/src/core/FlashService.ts deleted file mode 100644 index 2a98225382..0000000000 --- a/packages/backend/src/core/FlashService.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { DI } from '@/di-symbols.js'; -import { type FlashsRepository } from '@/models/_.js'; - -/** - * MisskeyPlay関係のService - */ -@Injectable() -export class FlashService { - constructor( - @Inject(DI.flashsRepository) - private flashRepository: FlashsRepository, - ) { - } - - /** - * 人気のあるPlay一覧を取得する. - */ - public async featured(opts?: { offset?: number, limit: number }) { - const builder = this.flashRepository.createQueryBuilder('flash') - .andWhere('flash.likedCount > 0') - .andWhere('flash.visibility = :visibility', { visibility: 'public' }) - .addOrderBy('flash.likedCount', 'DESC') - .addOrderBy('flash.updatedAt', 'DESC') - .addOrderBy('flash.id', 'DESC'); - - if (opts?.offset) { - builder.skip(opts.offset); - } - - builder.take(opts?.limit ?? 10); - - return await builder.getMany(); - } -} diff --git a/packages/backend/src/core/GlobalEventService.ts b/packages/backend/src/core/GlobalEventService.ts index 03646ff566..d175f21f2f 100644 --- a/packages/backend/src/core/GlobalEventService.ts +++ b/packages/backend/src/core/GlobalEventService.ts @@ -1,11 +1,10 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; import * as Redis from 'ioredis'; -import * as Reversi from 'misskey-reversi'; import type { MiChannel } from '@/models/Channel.js'; import type { MiUser } from '@/models/User.js'; import type { MiUserProfile } from '@/models/UserProfile.js'; @@ -18,9 +17,8 @@ import type { MiAbuseUserReport } from '@/models/AbuseUserReport.js'; import type { MiSignin } from '@/models/Signin.js'; import type { MiPage } from '@/models/Page.js'; import type { MiWebhook } from '@/models/Webhook.js'; -import type { MiSystemWebhook } from '@/models/SystemWebhook.js'; import type { MiMeta } from '@/models/Meta.js'; -import { MiAvatarDecoration, MiReversiGame, MiRole, MiRoleAssignment } from '@/models/_.js'; +import { MiAvatarDecoration, MiRole, MiRoleAssignment } from '@/models/_.js'; import type { Packed } from '@/misc/json-schema.js'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; @@ -55,22 +53,21 @@ export interface MainEventTypes { reply: Packed<'Note'>; renote: Packed<'Note'>; follow: Packed<'UserDetailedNotMe'>; - followed: Packed<'UserLite'>; - unfollow: Packed<'UserDetailedNotMe'>; - meUpdated: Packed<'MeDetailed'>; + followed: Packed<'User'>; + unfollow: Packed<'User'>; + meUpdated: Packed<'User'>; pageEvent: { pageId: MiPage['id']; event: string; var: any; userId: MiUser['id']; - user: Packed<'UserDetailed'>; + user: Packed<'User'>; }; urlUploadFinished: { marker?: string | null; file: Packed<'DriveFile'>; }; readAllNotifications: undefined; - notificationFlushed: undefined; unreadNotification: Packed<'Notification'>; unreadMention: MiNote['id']; readAllUnreadMentions: undefined; @@ -94,7 +91,7 @@ export interface MainEventTypes { }; driveFileCreated: Packed<'DriveFile'>; readAntenna: MiAntenna; - receiveFollowRequest: Packed<'UserLite'>; + receiveFollowRequest: Packed<'User'>; announcementCreated: { announcement: Packed<'Announcement'>; }; @@ -142,8 +139,8 @@ type NoteStreamEventTypes = { }; export interface UserListEventTypes { - userAdded: Packed<'UserLite'>; - userRemoved: Packed<'UserLite'>; + userAdded: Packed<'User'>; + userRemoved: Packed<'User'>; } export interface AntennaEventTypes { @@ -162,38 +159,6 @@ export interface AdminEventTypes { comment: string; }; } - -export interface ReversiEventTypes { - matched: { - game: Packed<'ReversiGameDetailed'>; - }; - invited: { - user: Packed<'User'>; - }; -} - -export interface ReversiGameEventTypes { - changeReadyStates: { - user1: boolean; - user2: boolean; - }; - updateSettings: { - userId: MiUser['id']; - key: string; - value: any; - }; - log: Reversi.Serializer.Log & { id: string | null }; - started: { - game: Packed<'ReversiGameDetailed'>; - }; - ended: { - winnerId: MiUser['id'] | null; - game: Packed<'ReversiGameDetailed'>; - }; - canceled: { - userId: MiUser['id']; - }; -} //#endregion // 辞書(interface or type)から{ type, body }ユニオンを定義 @@ -209,16 +174,10 @@ type SerializedAll = { [K in keyof T]: Serialized; }; -type UndefinedAsNullAll = { - [K in keyof T]: T[K] extends undefined ? null : T[K]; -} - export interface InternalEventTypes { userChangeSuspendedState: { id: MiUser['id']; isSuspended: MiUser['isSuspended']; }; - userChangeDeletedState: { id: MiUser['id']; isDeleted: MiUser['isDeleted']; }; userTokenRegenerated: { id: MiUser['id']; oldToken: string; newToken: string; }; remoteUserUpdated: { id: MiUser['id']; }; - localUserUpdated: { id: MiUser['id']; }; follow: { followerId: MiUser['id']; followeeId: MiUser['id']; }; unfollow: { followerId: MiUser['id']; followeeId: MiUser['id']; }; blockingCreated: { blockerId: MiUser['id']; blockeeId: MiUser['id']; }; @@ -232,16 +191,13 @@ export interface InternalEventTypes { webhookCreated: MiWebhook; webhookDeleted: MiWebhook; webhookUpdated: MiWebhook; - systemWebhookCreated: MiSystemWebhook; - systemWebhookDeleted: MiSystemWebhook; - systemWebhookUpdated: MiSystemWebhook; antennaCreated: MiAntenna; antennaDeleted: MiAntenna; antennaUpdated: MiAntenna; avatarDecorationCreated: MiAvatarDecoration; avatarDecorationDeleted: MiAvatarDecoration; avatarDecorationUpdated: MiAvatarDecoration; - metaUpdated: { before?: MiMeta; after: MiMeta; }; + metaUpdated: MiMeta; followChannel: { userId: MiUser['id']; channelId: MiChannel['id']; }; unfollowChannel: { userId: MiUser['id']; channelId: MiChannel['id']; }; updateUserProfile: MiUserProfile; @@ -251,58 +207,48 @@ export interface InternalEventTypes { userListMemberRemoved: { userListId: MiUserList['id']; memberId: MiUser['id']; }; } -type EventTypesToEventPayload = EventUnionFromDictionary>>; - // name/messages(spec) pairs dictionary export type GlobalEvents = { internal: { name: 'internal'; - payload: EventTypesToEventPayload; + payload: EventUnionFromDictionary>; }; broadcast: { name: 'broadcast'; - payload: EventTypesToEventPayload; + payload: EventUnionFromDictionary>; }; main: { name: `mainStream:${MiUser['id']}`; - payload: EventTypesToEventPayload; + payload: EventUnionFromDictionary>; }; drive: { name: `driveStream:${MiUser['id']}`; - payload: EventTypesToEventPayload; + payload: EventUnionFromDictionary>; }; note: { name: `noteStream:${MiNote['id']}`; - payload: EventTypesToEventPayload; + payload: EventUnionFromDictionary>; }; userList: { name: `userListStream:${MiUserList['id']}`; - payload: EventTypesToEventPayload; + payload: EventUnionFromDictionary>; }; roleTimeline: { name: `roleTimelineStream:${MiRole['id']}`; - payload: EventTypesToEventPayload; + payload: EventUnionFromDictionary>; }; antenna: { name: `antennaStream:${MiAntenna['id']}`; - payload: EventTypesToEventPayload; + payload: EventUnionFromDictionary>; }; admin: { name: `adminStream:${MiUser['id']}`; - payload: EventTypesToEventPayload; + payload: EventUnionFromDictionary>; }; notes: { name: 'notesStream'; payload: Serialized>; }; - reversi: { - name: `reversiStream:${MiUser['id']}`; - payload: EventTypesToEventPayload; - }; - reversiGame: { - name: `reversiGameStream:${MiReversiGame['id']}`; - payload: EventTypesToEventPayload; - }; }; // API event definitions @@ -392,14 +338,4 @@ export class GlobalEventService { public publishAdminStream(userId: MiUser['id'], type: K, value?: AdminEventTypes[K]): void { this.publish(`adminStream:${userId}`, type, typeof value === 'undefined' ? null : value); } - - @bindThis - public publishReversiStream(userId: MiUser['id'], type: K, value?: ReversiEventTypes[K]): void { - this.publish(`reversiStream:${userId}`, type, typeof value === 'undefined' ? null : value); - } - - @bindThis - public publishReversiGameStream(gameId: MiReversiGame['id'], type: K, value?: ReversiGameEventTypes[K]): void { - this.publish(`reversiGameStream:${gameId}`, type, typeof value === 'undefined' ? null : value); - } } diff --git a/packages/backend/src/core/HashtagService.ts b/packages/backend/src/core/HashtagService.ts index 793bbeecb1..5a2417c9cd 100644 --- a/packages/backend/src/core/HashtagService.ts +++ b/packages/backend/src/core/HashtagService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,18 +10,16 @@ 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/Hashtag.js'; -import type { HashtagsRepository, MiMeta } from '@/models/_.js'; +import type { HashtagsRepository } from '@/models/_.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; import { FeaturedService } from '@/core/FeaturedService.js'; +import { MetaService } from '@/core/MetaService.js'; import { UtilityService } from '@/core/UtilityService.js'; @Injectable() export class HashtagService { constructor( - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.redis) private redisClient: Redis.Redis, // TODO: 専用のRedisサーバーを設定できるようにする @@ -31,6 +29,7 @@ export class HashtagService { private userEntityService: UserEntityService, private featuredService: FeaturedService, private idService: IdService, + private metaService: MetaService, private utilityService: UtilityService, ) { } @@ -161,9 +160,10 @@ export class HashtagService { @bindThis public async updateHashtagsRanking(hashtag: string, userId: MiUser['id']): Promise { - const hiddenTags = this.meta.hiddenTags.map(t => normalizeForSearch(t)); + const instance = await this.metaService.fetch(); + const hiddenTags = instance.hiddenTags.map(t => normalizeForSearch(t)); if (hiddenTags.includes(hashtag)) return; - if (this.utilityService.isKeyWordIncluded(hashtag, this.meta.sensitiveWords)) return; + if (this.utilityService.isSensitiveWordIncluded(hashtag, instance.sensitiveWords)) return; // YYYYMMDDHHmm (10分間隔) const now = new Date(); diff --git a/packages/backend/src/core/HttpRequestService.ts b/packages/backend/src/core/HttpRequestService.ts index 7f3cac7c58..73bb3dc7e9 100644 --- a/packages/backend/src/core/HttpRequestService.ts +++ b/packages/backend/src/core/HttpRequestService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -14,16 +14,9 @@ import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import { StatusError } from '@/misc/status-error.js'; import { bindThis } from '@/decorators.js'; -import { validateContentTypeSetAsActivityPub } from '@/core/activitypub/misc/validator.js'; -import type { IObject } from '@/core/activitypub/type.js'; import type { Response } from 'node-fetch'; import type { URL } from 'node:url'; -export type HttpRequestSendOptions = { - throwErrorWhenResponseNotOk: boolean; - validators?: ((res: Response) => void)[]; -}; - @Injectable() export class HttpRequestService { /** @@ -111,23 +104,6 @@ export class HttpRequestService { } } - @bindThis - public async getActivityJson(url: string): Promise { - const res = await this.send(url, { - method: 'GET', - headers: { - Accept: 'application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"', - }, - timeout: 5000, - size: 1024 * 256, - }, { - throwErrorWhenResponseNotOk: true, - validators: [validateContentTypeSetAsActivityPub], - }); - - return await res.json() as IObject; - } - @bindThis public async getJson(url: string, accept = 'application/json, */*', headers?: Record): Promise { const res = await this.send(url, { @@ -156,20 +132,17 @@ export class HttpRequestService { } @bindThis - public async send( - url: string, - args: { - method?: string, - body?: string, - headers?: Record, - timeout?: number, - size?: number, - } = {}, - extra: HttpRequestSendOptions = { - throwErrorWhenResponseNotOk: true, - validators: [], - }, - ): Promise { + public async send(url: string, args: { + method?: string, + body?: string, + headers?: Record, + timeout?: number, + size?: number, + } = {}, extra: { + throwErrorWhenResponseNotOk: boolean; + } = { + throwErrorWhenResponseNotOk: true, + }): Promise { const timeout = args.timeout ?? 5000; const controller = new AbortController(); @@ -193,12 +166,6 @@ export class HttpRequestService { throw new StatusError(`${res.status} ${res.statusText}`, res.status, res.statusText); } - if (res.ok) { - for (const validator of (extra.validators ?? [])) { - validator(res); - } - } - return res; } } diff --git a/packages/backend/src/core/IdService.ts b/packages/backend/src/core/IdService.ts index 10df6ef266..43e72d2d7b 100644 --- a/packages/backend/src/core/IdService.ts +++ b/packages/backend/src/core/IdService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/ImageProcessingService.ts b/packages/backend/src/core/ImageProcessingService.ts index 6f978b34c8..8e800eb8f5 100644 --- a/packages/backend/src/core/ImageProcessingService.ts +++ b/packages/backend/src/core/ImageProcessingService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/InstanceActorService.ts b/packages/backend/src/core/InstanceActorService.ts index 22c47297a3..b40fd46291 100644 --- a/packages/backend/src/core/InstanceActorService.ts +++ b/packages/backend/src/core/InstanceActorService.ts @@ -1,10 +1,10 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; -import { IsNull, Not } from 'typeorm'; +import { IsNull } from 'typeorm'; import type { MiLocalUser } from '@/models/User.js'; import type { UsersRepository } from '@/models/_.js'; import { MemorySingleCache } from '@/misc/cache.js'; @@ -27,14 +27,6 @@ export class InstanceActorService { this.cache = new MemorySingleCache(Infinity); } - @bindThis - public async realLocalUsersPresent(): Promise { - return await this.usersRepository.existsBy({ - host: IsNull(), - username: Not(ACTOR_USERNAME), - }); - } - @bindThis public async getInstanceActor(): Promise { const cached = this.cache.get(); diff --git a/packages/backend/src/core/InternalStorageService.ts b/packages/backend/src/core/InternalStorageService.ts index 4fb8a93e49..22129bb348 100644 --- a/packages/backend/src/core/InternalStorageService.ts +++ b/packages/backend/src/core/InternalStorageService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/LoggerService.ts b/packages/backend/src/core/LoggerService.ts index f102461a50..46b000ee63 100644 --- a/packages/backend/src/core/LoggerService.ts +++ b/packages/backend/src/core/LoggerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -15,7 +15,7 @@ export class LoggerService { } @bindThis - public getLogger(domain: string, color?: KEYWORD | undefined) { - return new Logger(domain, color); + public getLogger(domain: string, color?: KEYWORD | undefined, store?: boolean) { + return new Logger(domain, color, store); } } diff --git a/packages/backend/src/core/MetaService.ts b/packages/backend/src/core/MetaService.ts index 3d88d0aefe..80e8020961 100644 --- a/packages/backend/src/core/MetaService.ts +++ b/packages/backend/src/core/MetaService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -51,10 +51,7 @@ export class MetaService implements OnApplicationShutdown { const { type, body } = obj.message as GlobalEvents['internal']['payload']; switch (type) { case 'metaUpdated': { - this.cache = { // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい - ...(body.after), - proxyAccount: null, // joinなカラムは通常取ってこないので - }; + this.cache = body; break; } default: @@ -141,7 +138,7 @@ export class MetaService implements OnApplicationShutdown { }); } - this.globalEventService.publishInternalEvent('metaUpdated', { before, after: updated }); + this.globalEventService.publishInternalEvent('metaUpdated', updated); return updated; } diff --git a/packages/backend/src/core/MfmService.ts b/packages/backend/src/core/MfmService.ts index 8061622340..e74c62e1a8 100644 --- a/packages/backend/src/core/MfmService.ts +++ b/packages/backend/src/core/MfmService.ts @@ -1,24 +1,21 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { URL } from 'node:url'; import { Inject, Injectable } from '@nestjs/common'; import * as parse5 from 'parse5'; -import { Window, XMLSerializer } from 'happy-dom'; +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 { normalizeForSearch } from '@/misc/normalize-for-search.js'; import type { IMentionedRemoteUsers } from '@/models/Note.js'; import { bindThis } from '@/decorators.js'; -import type { DefaultTreeAdapterMap } from 'parse5'; +import * as TreeAdapter from '../../node_modules/parse5/dist/tree-adapters/default.js'; import type * as mfm from 'mfm-js'; -const treeAdapter = parse5.defaultTreeAdapter; -type Node = DefaultTreeAdapterMap['node']; -type ChildNode = DefaultTreeAdapterMap['childNode']; +const treeAdapter = TreeAdapter.defaultTreeAdapter; const urlRegex = /^https?:\/\/[\w\/:%#@$&?!()\[\]~.,=+\-]+/; const urlRegexFull = /^https?:\/\/[\w\/:%#@$&?!()\[\]~.,=+\-]+$/; @@ -36,8 +33,6 @@ export class MfmService { // some AP servers like Pixelfed use br tags as well as newlines html = html.replace(/\r?\n/gi, '\n'); - const normalizedHashtagNames = hashtagNames == null ? undefined : new Set(hashtagNames.map(x => normalizeForSearch(x))); - const dom = parse5.parseFragment(html); let text = ''; @@ -48,7 +43,7 @@ export class MfmService { return text.trim(); - function getText(node: Node): string { + function getText(node: TreeAdapter.Node): string { if (treeAdapter.isTextNode(node)) return node.value; if (!treeAdapter.isElementNode(node)) return ''; if (node.nodeName === 'br') return '\n'; @@ -60,7 +55,7 @@ export class MfmService { return ''; } - function appendChildren(childNodes: ChildNode[]): void { + function appendChildren(childNodes: TreeAdapter.ChildNode[]): void { if (childNodes) { for (const n of childNodes) { analyze(n); @@ -68,16 +63,14 @@ export class MfmService { } } - function analyze(node: Node) { + function analyze(node: TreeAdapter.Node) { if (treeAdapter.isTextNode(node)) { text += node.value; return; } // Skip comment or document type node - if (!treeAdapter.isElementNode(node)) { - return; - } + if (!treeAdapter.isElementNode(node)) return; switch (node.nodeName) { case 'br': { @@ -85,15 +78,16 @@ export class MfmService { break; } - case 'a': { + case 'a': + { const txt = getText(node); const rel = node.attrs.find(x => x.name === 'rel'); const href = node.attrs.find(x => x.name === 'href'); // ハッシュタグ - if (normalizedHashtagNames && href && normalizedHashtagNames.has(normalizeForSearch(txt))) { + if (hashtagNames && href && hashtagNames.map(x => x.toLowerCase()).includes(txt.toLowerCase())) { text += txt; - // メンション + // メンション } else if (txt.startsWith('@') && !(rel && rel.value.startsWith('me '))) { const part = txt.split('@'); @@ -105,7 +99,7 @@ export class MfmService { } else if (part.length === 3) { text += txt; } - // その他 + // その他 } else { const generateLink = () => { if (!href && !txt) { @@ -133,7 +127,8 @@ export class MfmService { break; } - case 'h1': { + case 'h1': + { text += '【'; appendChildren(node.childNodes); text += '】\n'; @@ -141,14 +136,16 @@ export class MfmService { } case 'b': - case 'strong': { + case 'strong': + { text += '**'; appendChildren(node.childNodes); text += '**'; break; } - case 'small': { + case 'small': + { text += ''; appendChildren(node.childNodes); text += ''; @@ -156,7 +153,8 @@ export class MfmService { } case 's': - case 'del': { + case 'del': + { text += '~~'; appendChildren(node.childNodes); text += '~~'; @@ -164,7 +162,8 @@ export class MfmService { } case 'i': - case 'em': { + case 'em': + { text += ''; appendChildren(node.childNodes); text += ''; @@ -205,7 +204,8 @@ export class MfmService { case 'h3': case 'h4': case 'h5': - case 'h6': { + case 'h6': + { text += '\n\n'; appendChildren(node.childNodes); break; @@ -218,7 +218,8 @@ export class MfmService { case 'article': case 'li': case 'dt': - case 'dd': { + case 'dd': + { text += '\n'; appendChildren(node.childNodes); break; @@ -239,12 +240,10 @@ export class MfmService { return null; } - const { happyDOM, window } = new Window(); + const { window } = new Window(); const doc = window.document; - const body = doc.createElement('p'); - function appendChildren(children: mfm.MfmNode[], targetElement: any): void { if (children) { for (const child of children.map(x => (handlers as any)[x.type](x))) targetElement.appendChild(child); @@ -406,10 +405,8 @@ export class MfmService { mention: (node) => { const a = doc.createElement('a'); const { username, host, acct } = node.props; - const remoteUserInfo = mentionedRemoteUsers.find(remoteUser => remoteUser.username.toLowerCase() === username.toLowerCase() && remoteUser.host?.toLowerCase() === host?.toLowerCase()); - a.setAttribute('href', remoteUserInfo - ? (remoteUserInfo.url ? remoteUserInfo.url : remoteUserInfo.uri) - : `${this.config.url}/${acct.endsWith(`@${this.config.url}`) ? acct.substring(0, acct.length - this.config.url.length - 1) : acct}`); + const remoteUserInfo = mentionedRemoteUsers.find(remoteUser => remoteUser.username === username && remoteUser.host === host); + a.setAttribute('href', remoteUserInfo ? (remoteUserInfo.url ? remoteUserInfo.url : remoteUserInfo.uri) : `${this.config.url}/${acct}`); a.className = 'u-url mention'; a.textContent = acct; return a; @@ -422,10 +419,6 @@ export class MfmService { }, text: (node) => { - if (!node.props.text.match(/[\r\n]/)) { - return doc.createTextNode(node.props.text); - } - const el = doc.createElement('span'); const nodes = node.props.text.split(/\r\n|\r|\n/).map(x => doc.createTextNode(x)); @@ -457,12 +450,8 @@ export class MfmService { }, }; - appendChildren(nodes, body); + appendChildren(nodes, doc.body); - const serialized = new XMLSerializer().serializeToString(body); - - happyDOM.close().catch(err => {}); - - return serialized; + return `

${doc.body.innerHTML}

`; } } diff --git a/packages/backend/src/core/ModerationLogService.ts b/packages/backend/src/core/ModerationLogService.ts index 2c02af217d..8b78d02047 100644 --- a/packages/backend/src/core/ModerationLogService.ts +++ b/packages/backend/src/core/ModerationLogService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -9,8 +9,7 @@ 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 type { ModerationLogPayloads } from '@/types.js'; -import { moderationLogTypes } from '@/types.js'; +import { ModerationLogPayloads, moderationLogTypes } from '@/types.js'; @Injectable() export class ModerationLogService { diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 3647fa7231..ed8d51df16 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,12 +8,13 @@ import * as mfm from 'mfm-js'; import { In, DataSource, IsNull, LessThan } from 'typeorm'; import * as Redis from 'ioredis'; import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; +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/Note.js'; import { MiNote } from '@/models/Note.js'; -import type { ChannelFollowingsRepository, ChannelsRepository, FollowingsRepository, InstancesRepository, MiFollowing, MiMeta, MutingsRepository, NotesRepository, NoteThreadMutingsRepository, UserListMembershipsRepository, UserProfilesRepository, UsersRepository } from '@/models/_.js'; +import type { ChannelFollowingsRepository, ChannelsRepository, FollowingsRepository, InstancesRepository, MiFollowing, MutingsRepository, NotesRepository, NoteThreadMutingsRepository, UserListMembershipsRepository, 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'; @@ -22,8 +23,11 @@ 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/Channel.js'; import { normalizeForSearch } from '@/misc/normalize-for-search.js'; +import { MemorySingleCache } from '@/misc/cache.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'; @@ -34,7 +38,7 @@ import InstanceChart from '@/core/chart/charts/instance.js'; import ActiveUsersChart from '@/core/chart/charts/active-users.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { NotificationService } from '@/core/NotificationService.js'; -import { UserWebhookService } from '@/core/UserWebhookService.js'; +import { WebhookService } from '@/core/WebhookService.js'; import { HashtagService } from '@/core/HashtagService.js'; import { AntennaService } from '@/core/AntennaService.js'; import { QueueService } from '@/core/QueueService.js'; @@ -47,15 +51,13 @@ import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js'; import { bindThis } from '@/decorators.js'; import { DB_MAX_NOTE_TEXT_LENGTH } from '@/const.js'; import { RoleService } from '@/core/RoleService.js'; +import { MetaService } from '@/core/MetaService.js'; import { SearchService } from '@/core/SearchService.js'; import { FeaturedService } from '@/core/FeaturedService.js'; import { FanoutTimelineService } from '@/core/FanoutTimelineService.js'; import { UtilityService } from '@/core/UtilityService.js'; import { UserBlockingService } from '@/core/UserBlockingService.js'; import { isReply } from '@/misc/is-reply.js'; -import { trackPromise } from '@/misc/promise-tracker.js'; -import { IdentifiableError } from '@/misc/identifiable-error.js'; -import { CollapsedQueue } from '@/misc/collapsed-queue.js'; type NotificationType = 'reply' | 'renote' | 'quote' | 'mention'; @@ -147,15 +149,11 @@ type Option = { @Injectable() export class NoteCreateService implements OnApplicationShutdown { #shutdownController = new AbortController(); - private updateNotesCountQueue: CollapsedQueue; constructor( @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.db) private db: DataSource, @@ -204,12 +202,13 @@ export class NoteCreateService implements OnApplicationShutdown { private federatedInstanceService: FederatedInstanceService, private hashtagService: HashtagService, private antennaService: AntennaService, - private webhookService: UserWebhookService, + private webhookService: WebhookService, private featuredService: FeaturedService, private remoteUserResolveService: RemoteUserResolveService, private apDeliverManagerService: ApDeliverManagerService, private apRendererService: ApRendererService, private roleService: RoleService, + private metaService: MetaService, private searchService: SearchService, private notesChart: NotesChart, private perUserNotesChart: PerUserNotesChart, @@ -217,9 +216,7 @@ export class NoteCreateService implements OnApplicationShutdown { private instanceChart: InstanceChart, private utilityService: UtilityService, private userBlockingService: UserBlockingService, - ) { - this.updateNotesCountQueue = new CollapsedQueue(process.env.NODE_ENV !== 'test' ? 60 * 1000 * 5 : 0, this.collapseNotesCount, this.performUpdateNotesCount); - } + ) { } @bindThis public async create(user: { @@ -252,26 +249,18 @@ export class NoteCreateService implements OnApplicationShutdown { if (data.channel != null) data.visibleUsers = []; if (data.channel != null) data.localOnly = true; + const meta = await this.metaService.fetch(); + if (data.visibility === 'public' && data.channel == null) { - const sensitiveWords = this.meta.sensitiveWords; - if (this.utilityService.isKeyWordIncluded(data.cw ?? data.text ?? '', sensitiveWords)) { + const sensitiveWords = meta.sensitiveWords; + if (this.utilityService.isSensitiveWordIncluded(data.cw ?? data.text ?? '', sensitiveWords)) { data.visibility = 'home'; } else if ((await this.roleService.getUserPolicies(user.id)).canPublicNote === false) { data.visibility = 'home'; } } - const hasProhibitedWords = this.checkProhibitedWordsContain({ - cw: data.cw, - text: data.text, - pollChoices: data.poll?.choices, - }, this.meta.prohibitedWords); - - if (hasProhibitedWords) { - throw new IdentifiableError('689ee33f-f97c-479a-ac49-1b9f8140af99', 'Note contains prohibited words'); - } - - const inSilencedInstance = this.utilityService.isSilencedHost(this.meta.silencedHosts, user.host); + const inSilencedInstance = this.utilityService.isSilencedHost(meta.silencedHosts, user.host); if (data.visibility === 'public' && inSilencedInstance && user.host !== null) { data.visibility = 'home'; @@ -304,7 +293,7 @@ export class NoteCreateService implements OnApplicationShutdown { } // Check blocking - if (this.isRenote(data) && !this.isQuote(data)) { + if (data.renote && !this.isQuote(data)) { if (data.renote.userHost === null) { if (data.renote.userId !== user.id) { const blocked = await this.userBlockingService.checkBlocked(data.renote.userId, user.id); @@ -335,9 +324,6 @@ export class NoteCreateService implements OnApplicationShutdown { data.text = data.text.slice(0, DB_MAX_NOTE_TEXT_LENGTH); } data.text = data.text.trim(); - if (data.text === '') { - data.text = null; - } } else { data.text = null; } @@ -363,9 +349,6 @@ export class NoteCreateService implements OnApplicationShutdown { mentionedUsers = data.apMentions ?? await this.extractMentionedUsers(user, combinedTokens); } - // if the host is media-silenced, custom emojis are not allowed - if (this.utilityService.isMediaSilencedHost(this.meta.mediaSilencedHosts, user.host)) emojis = []; - tags = tags.filter(tag => Array.from(tag).length <= 128).splice(0, 32); if (data.reply && (user.id !== data.reply.userId) && !mentionedUsers.some(u => u.id === data.reply!.userId)) { @@ -386,10 +369,6 @@ export class NoteCreateService implements OnApplicationShutdown { } } - if (mentionedUsers.length > 0 && mentionedUsers.length > (await this.roleService.getUserPolicies(user.id)).mentionLimit) { - throw new IdentifiableError('9f466dab-c856-48cd-9e65-ff90ff750580', 'Note contains too many mentions'); - } - const note = await this.insertNote(user, data, tags, emojis, mentionedUsers); setImmediate('post created', { signal: this.#shutdownController.signal }).then( @@ -474,7 +453,6 @@ export class NoteCreateService implements OnApplicationShutdown { noteVisibility: insert.visibility, userId: user.id, userHost: user.host, - channelId: insert.channelId, }); await transactionalEntityManager.insert(MiPoll, poll); @@ -505,21 +483,21 @@ export class NoteCreateService implements OnApplicationShutdown { host: MiUser['host']; isBot: MiUser['isBot']; }, data: Option, silent: boolean, tags: string[], mentionedUsers: MinimumUser[]) { + const meta = await this.metaService.fetch(); + this.notesChart.update(note, true); - if (note.visibility !== 'specified' && (this.meta.enableChartsForRemoteUser || (user.host == null))) { + if (meta.enableChartsForRemoteUser || (user.host == null)) { this.perUserNotesChart.update(user, note, true); } // Register host - if (this.meta.enableStatsForFederatedInstances) { - if (this.userEntityService.isRemoteUser(user)) { - this.federatedInstanceService.fetchOrRegister(user.host).then(async i => { - this.updateNotesCountQueue.enqueue(i.id, 1); - if (this.meta.enableChartsForFederatedInstances) { - this.instanceChart.updateNote(i.host, note, true); - } - }); - } + if (this.userEntityService.isRemoteUser(user)) { + this.federatedInstanceService.fetch(user.host).then(async i => { + this.instancesRepository.increment({ id: i.id }, 'notesCount', 1); + if ((await this.metaService.fetch()).enableChartsForFederatedInstances) { + this.instanceChart.updateNote(i.host, note, true); + } + }); } // ハッシュタグ更新 @@ -607,7 +585,7 @@ export class NoteCreateService implements OnApplicationShutdown { this.webhookService.getActiveWebhooks().then(webhooks => { webhooks = webhooks.filter(x => x.userId === user.id && x.on.includes('note')); for (const webhook of webhooks) { - this.queueService.userWebhookDeliver(webhook, 'note', { + this.queueService.webhookDeliver(webhook, 'note', { note: noteObj, }); } @@ -621,7 +599,7 @@ export class NoteCreateService implements OnApplicationShutdown { if (data.reply) { // 通知 if (data.reply.userHost === null) { - const isThreadMuted = await this.noteThreadMutingsRepository.exists({ + const isThreadMuted = await this.noteThreadMutingsRepository.exist({ where: { userId: data.reply.userId, threadId: data.reply.threadId ?? data.reply.id, @@ -634,7 +612,7 @@ export class NoteCreateService implements OnApplicationShutdown { const webhooks = (await this.webhookService.getActiveWebhooks()).filter(x => x.userId === data.reply!.userId && x.on.includes('reply')); for (const webhook of webhooks) { - this.queueService.userWebhookDeliver(webhook, 'reply', { + this.queueService.webhookDeliver(webhook, 'reply', { note: noteObj, }); } @@ -643,7 +621,7 @@ export class NoteCreateService implements OnApplicationShutdown { } // If it is renote - if (this.isRenote(data)) { + if (data.renote) { const type = this.isQuote(data) ? 'quote' : 'renote'; // Notify @@ -657,7 +635,7 @@ export class NoteCreateService implements OnApplicationShutdown { const webhooks = (await this.webhookService.getActiveWebhooks()).filter(x => x.userId === data.renote!.userId && x.on.includes('renote')); for (const webhook of webhooks) { - this.queueService.userWebhookDeliver(webhook, 'renote', { + this.queueService.webhookDeliver(webhook, 'renote', { note: noteObj, }); } @@ -698,7 +676,7 @@ export class NoteCreateService implements OnApplicationShutdown { this.relayService.deliverToRelays(user, noteActivity); } - trackPromise(dm.execute()); + dm.execute(); })(); } //#endregion @@ -727,20 +705,9 @@ export class NoteCreateService implements OnApplicationShutdown { } @bindThis - private isRenote(note: Option): note is Option & { renote: MiNote } { - return note.renote != null; - } - - @bindThis - private isQuote(note: Option & { renote: MiNote }): note is Option & { renote: MiNote } & ( - { text: string } | { cw: string } | { reply: MiNote } | { poll: IPoll } | { files: MiDriveFile[] } - ) { - // NOTE: SYNC WITH misc/is-quote.ts - return note.text != null || - note.reply != null || - note.cw != null || - note.poll != null || - (note.files != null && note.files.length > 0); + private isQuote(note: Option): note is Option & { renote: MiNote } { + // sync with misc/is-quote.ts + return !!note.renote && (!!note.text || !!note.cw || (!!note.files && !!note.files.length) || !!note.poll); } @bindThis @@ -770,7 +737,7 @@ export class NoteCreateService implements OnApplicationShutdown { @bindThis private async createMentionedEvents(mentionedUsers: MinimumUser[], note: MiNote, nm: NotificationManager) { for (const u of mentionedUsers.filter(u => this.userEntityService.isLocalUser(u))) { - const isThreadMuted = await this.noteThreadMutingsRepository.exists({ + const isThreadMuted = await this.noteThreadMutingsRepository.exist({ where: { userId: u.id, threadId: note.threadId ?? note.id, @@ -789,7 +756,7 @@ export class NoteCreateService implements OnApplicationShutdown { const webhooks = (await this.webhookService.getActiveWebhooks()).filter(x => x.userId === u.id && x.on.includes('mention')); for (const webhook of webhooks) { - this.queueService.userWebhookDeliver(webhook, 'mention', { + this.queueService.webhookDeliver(webhook, 'mention', { note: detailPackedNote, }); } @@ -808,7 +775,7 @@ export class NoteCreateService implements OnApplicationShutdown { private async renderNoteOrRenoteActivity(data: Option, note: MiNote) { if (data.localOnly) return null; - const content = this.isRenote(data) && !this.isQuote(data) + const content = data.renote && !this.isQuote(data) ? this.apRendererService.renderAnnounce(data.renote.uri ? data.renote.uri : `${this.config.url}/notes/${data.renote.id}`, note) : this.apRendererService.renderCreate(await this.apRendererService.renderNote(note, false), note); @@ -840,7 +807,7 @@ export class NoteCreateService implements OnApplicationShutdown { const mentions = extractMentions(tokens); let mentionedUsers = (await Promise.all(mentions.map(m => this.remoteUserResolveService.resolveUser(m.username, m.host ?? user.host).catch(() => null), - ))).filter(x => x != null); + ))).filter(x => x != null) as MiUser[]; // Drop duplicate users mentionedUsers = mentionedUsers.filter((u, i, self) => @@ -852,14 +819,15 @@ export class NoteCreateService implements OnApplicationShutdown { @bindThis private async pushToTl(note: MiNote, user: { id: MiUser['id']; host: MiUser['host']; }) { - if (!this.meta.enableFanoutTimeline) return; + const meta = await this.metaService.fetch(); + if (!meta.enableFanoutTimeline) return; const r = this.redisForTimelines.pipeline(); if (note.channelId) { this.fanoutTimelineService.push(`channelTimeline:${note.channelId}`, note.id, this.config.perChannelMaxNoteCacheCount, r); - this.fanoutTimelineService.push(`userTimelineWithChannel:${user.id}`, note.id, note.userHost == null ? this.meta.perLocalUserUserTimelineCacheMax : this.meta.perRemoteUserUserTimelineCacheMax, r); + this.fanoutTimelineService.push(`userTimelineWithChannel:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax : meta.perRemoteUserUserTimelineCacheMax, r); const channelFollowings = await this.channelFollowingsRepository.find({ where: { @@ -869,9 +837,9 @@ export class NoteCreateService implements OnApplicationShutdown { }); for (const channelFollowing of channelFollowings) { - this.fanoutTimelineService.push(`homeTimeline:${channelFollowing.followerId}`, note.id, this.meta.perUserHomeTimelineCacheMax, r); + this.fanoutTimelineService.push(`homeTimeline:${channelFollowing.followerId}`, note.id, meta.perUserHomeTimelineCacheMax, r); if (note.fileIds.length > 0) { - this.fanoutTimelineService.push(`homeTimelineWithFiles:${channelFollowing.followerId}`, note.id, this.meta.perUserHomeTimelineCacheMax / 2, r); + this.fanoutTimelineService.push(`homeTimelineWithFiles:${channelFollowing.followerId}`, note.id, meta.perUserHomeTimelineCacheMax / 2, r); } } } else { @@ -909,9 +877,9 @@ export class NoteCreateService implements OnApplicationShutdown { if (!following.withReplies) continue; } - this.fanoutTimelineService.push(`homeTimeline:${following.followerId}`, note.id, this.meta.perUserHomeTimelineCacheMax, r); + this.fanoutTimelineService.push(`homeTimeline:${following.followerId}`, note.id, meta.perUserHomeTimelineCacheMax, r); if (note.fileIds.length > 0) { - this.fanoutTimelineService.push(`homeTimelineWithFiles:${following.followerId}`, note.id, this.meta.perUserHomeTimelineCacheMax / 2, r); + this.fanoutTimelineService.push(`homeTimelineWithFiles:${following.followerId}`, note.id, meta.perUserHomeTimelineCacheMax / 2, r); } } @@ -928,25 +896,22 @@ export class NoteCreateService implements OnApplicationShutdown { if (!userListMembership.withReplies) continue; } - this.fanoutTimelineService.push(`userListTimeline:${userListMembership.userListId}`, note.id, this.meta.perUserListTimelineCacheMax, r); + this.fanoutTimelineService.push(`userListTimeline:${userListMembership.userListId}`, note.id, meta.perUserListTimelineCacheMax, r); if (note.fileIds.length > 0) { - this.fanoutTimelineService.push(`userListTimelineWithFiles:${userListMembership.userListId}`, note.id, this.meta.perUserListTimelineCacheMax / 2, r); + this.fanoutTimelineService.push(`userListTimelineWithFiles:${userListMembership.userListId}`, note.id, meta.perUserListTimelineCacheMax / 2, r); } } - // 自分自身のHTL - if (note.userHost == null) { - if (note.visibility !== 'specified' || !note.visibleUserIds.some(v => v === user.id)) { - this.fanoutTimelineService.push(`homeTimeline:${user.id}`, note.id, this.meta.perUserHomeTimelineCacheMax, r); - if (note.fileIds.length > 0) { - this.fanoutTimelineService.push(`homeTimelineWithFiles:${user.id}`, note.id, this.meta.perUserHomeTimelineCacheMax / 2, r); - } + if (note.visibility !== 'specified' || !note.visibleUserIds.some(v => v === user.id)) { // 自分自身のHTL + this.fanoutTimelineService.push(`homeTimeline:${user.id}`, note.id, meta.perUserHomeTimelineCacheMax, r); + if (note.fileIds.length > 0) { + this.fanoutTimelineService.push(`homeTimelineWithFiles:${user.id}`, note.id, meta.perUserHomeTimelineCacheMax / 2, r); } } // 自分自身以外への返信 if (isReply(note)) { - this.fanoutTimelineService.push(`userTimelineWithReplies:${user.id}`, note.id, note.userHost == null ? this.meta.perLocalUserUserTimelineCacheMax : this.meta.perRemoteUserUserTimelineCacheMax, r); + this.fanoutTimelineService.push(`userTimelineWithReplies:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax : meta.perRemoteUserUserTimelineCacheMax, r); if (note.visibility === 'public' && note.userHost == null) { this.fanoutTimelineService.push('localTimelineWithReplies', note.id, 300, r); @@ -955,9 +920,9 @@ export class NoteCreateService implements OnApplicationShutdown { } } } else { - this.fanoutTimelineService.push(`userTimeline:${user.id}`, note.id, note.userHost == null ? this.meta.perLocalUserUserTimelineCacheMax : this.meta.perRemoteUserUserTimelineCacheMax, r); + this.fanoutTimelineService.push(`userTimeline:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax : meta.perRemoteUserUserTimelineCacheMax, r); if (note.fileIds.length > 0) { - this.fanoutTimelineService.push(`userTimelineWithFiles:${user.id}`, note.id, note.userHost == null ? this.meta.perLocalUserUserTimelineCacheMax / 2 : this.meta.perRemoteUserUserTimelineCacheMax / 2, r); + this.fanoutTimelineService.push(`userTimelineWithFiles:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax / 2 : meta.perRemoteUserUserTimelineCacheMax / 2, r); } if (note.visibility === 'public' && note.userHost == null) { @@ -1016,41 +981,13 @@ export class NoteCreateService implements OnApplicationShutdown { } } - public checkProhibitedWordsContain(content: Parameters[0], prohibitedWords?: string[]) { - if (prohibitedWords == null) { - prohibitedWords = this.meta.prohibitedWords; - } - - if ( - this.utilityService.isKeyWordIncluded( - this.utilityService.concatNoteContentsForKeyWordCheck(content), - prohibitedWords, - ) - ) { - return true; - } - - return false; - } - @bindThis - private collapseNotesCount(oldValue: number, newValue: number) { - return oldValue + newValue; - } - - @bindThis - private async performUpdateNotesCount(id: MiNote['id'], incrBy: number) { - await this.instancesRepository.increment({ id: id }, 'notesCount', incrBy); - } - - @bindThis - public async dispose(): Promise { + public dispose(): void { this.#shutdownController.abort(); - await this.updateNotesCountQueue.performAllNow(); } @bindThis - public async onApplicationShutdown(signal?: string | undefined): Promise { - await this.dispose(); + public onApplicationShutdown(signal?: string | undefined): void { + this.dispose(); } } diff --git a/packages/backend/src/core/NoteDeleteService.ts b/packages/backend/src/core/NoteDeleteService.ts index 4ecd2592b2..632daf991a 100644 --- a/packages/backend/src/core/NoteDeleteService.ts +++ b/packages/backend/src/core/NoteDeleteService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,7 +7,7 @@ import { Brackets, In } from 'typeorm'; import { Injectable, Inject } from '@nestjs/common'; import type { MiUser, MiLocalUser, MiRemoteUser } from '@/models/User.js'; import type { MiNote, IMentionedRemoteUsers } from '@/models/Note.js'; -import type { InstancesRepository, MiMeta, NotesRepository, UsersRepository } from '@/models/_.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'; @@ -19,10 +19,12 @@ import { GlobalEventService } from '@/core/GlobalEventService.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; import { ApDeliverManagerService } from '@/core/activitypub/ApDeliverManagerService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; +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'; -import { isQuote, isRenote } from '@/misc/is-renote.js'; +import { isPureRenote } from '@/misc/is-pure-renote.js'; @Injectable() export class NoteDeleteService { @@ -30,9 +32,6 @@ export class NoteDeleteService { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -43,11 +42,13 @@ export class NoteDeleteService { private instancesRepository: InstancesRepository, private userEntityService: UserEntityService, + private noteEntityService: NoteEntityService, private globalEventService: GlobalEventService, private relayService: RelayService, private federatedInstanceService: FederatedInstanceService, private apRendererService: ApRendererService, private apDeliverManagerService: ApDeliverManagerService, + private metaService: MetaService, private searchService: SearchService, private moderationLogService: ModerationLogService, private notesChart: NotesChart, @@ -78,7 +79,7 @@ export class NoteDeleteService { let renote: MiNote | null = null; // if deleted note is renote - if (isRenote(note) && !isQuote(note)) { + if (isPureRenote(note)) { renote = await this.notesRepository.findOneBy({ id: note.renoteId, }); @@ -91,7 +92,7 @@ export class NoteDeleteService { this.deliverToConcerned(user, note, content); } - // also deliver delete activity to cascaded notes + // also deliever delete activity to cascaded notes const federatedLocalCascadingNotes = (cascadingNotes).filter(note => !note.localOnly && note.userHost == null); // filter out local-only notes for (const cascadingNote of federatedLocalCascadingNotes) { if (!cascadingNote.user) continue; @@ -101,20 +102,20 @@ export class NoteDeleteService { } //#endregion + const meta = await this.metaService.fetch(); + this.notesChart.update(note, false); - if (this.meta.enableChartsForRemoteUser || (user.host == null)) { + if (meta.enableChartsForRemoteUser || (user.host == null)) { this.perUserNotesChart.update(user, note, false); } - if (this.meta.enableStatsForFederatedInstances) { - if (this.userEntityService.isRemoteUser(user)) { - this.federatedInstanceService.fetchOrRegister(user.host).then(async i => { - this.instancesRepository.decrement({ id: i.id }, 'notesCount', 1); - if (this.meta.enableChartsForFederatedInstances) { - this.instanceChart.updateNote(i.host, note, false); - } - }); - } + if (this.userEntityService.isRemoteUser(user)) { + this.federatedInstanceService.fetch(user.host).then(async i => { + this.instancesRepository.decrement({ id: i.id }, 'notesCount', 1); + if ((await this.metaService.fetch()).enableChartsForFederatedInstances) { + this.instanceChart.updateNote(i.host, note, false); + } + }); } } diff --git a/packages/backend/src/core/NotePiningService.ts b/packages/backend/src/core/NotePiningService.ts index d38b48b65d..74e53c5c46 100644 --- a/packages/backend/src/core/NotePiningService.ts +++ b/packages/backend/src/core/NotePiningService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/NoteReadService.ts b/packages/backend/src/core/NoteReadService.ts index 181c9f7649..03c1735e04 100644 --- a/packages/backend/src/core/NoteReadService.ts +++ b/packages/backend/src/core/NoteReadService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -14,7 +14,6 @@ import { IdService } from '@/core/IdService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import type { NoteUnreadsRepository, MutingsRepository, NoteThreadMutingsRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; -import { trackPromise } from '@/misc/promise-tracker.js'; @Injectable() export class NoteReadService implements OnApplicationShutdown { @@ -49,7 +48,7 @@ export class NoteReadService implements OnApplicationShutdown { //#endregion // スレッドミュート - const isThreadMuted = await this.noteThreadMutingsRepository.exists({ + const isThreadMuted = await this.noteThreadMutingsRepository.exist({ where: { userId: userId, threadId: note.threadId ?? note.id, @@ -70,7 +69,7 @@ export class NoteReadService implements OnApplicationShutdown { // 2秒経っても既読にならなかったら「未読の投稿がありますよ」イベントを発行する setTimeout(2000, 'unread note', { signal: this.#shutdownController.signal }).then(async () => { - const exist = await this.noteUnreadsRepository.exists({ where: { id: unread.id } }); + const exist = await this.noteUnreadsRepository.exist({ where: { id: unread.id } }); if (!exist) return; @@ -88,47 +87,46 @@ export class NoteReadService implements OnApplicationShutdown { userId: MiUser['id'], notes: (MiNote | Packed<'Note'>)[], ): Promise { - if (notes.length === 0) return; - - const noteIds = new Set(); + const readMentions: (MiNote | Packed<'Note'>)[] = []; + const readSpecifiedNotes: (MiNote | Packed<'Note'>)[] = []; for (const note of notes) { if (note.mentions && note.mentions.includes(userId)) { - noteIds.add(note.id); + readMentions.push(note); } else if (note.visibleUserIds && note.visibleUserIds.includes(userId)) { - noteIds.add(note.id); + readSpecifiedNotes.push(note); } } - if (noteIds.size === 0) return; + if ((readMentions.length > 0) || (readSpecifiedNotes.length > 0)) { + // Remove the record + await this.noteUnreadsRepository.delete({ + userId: userId, + noteId: In([...readMentions.map(n => n.id), ...readSpecifiedNotes.map(n => n.id)]), + }); - // Remove the record - await this.noteUnreadsRepository.delete({ - userId: userId, - noteId: In(Array.from(noteIds)), - }); + // TODO: ↓まとめてクエリしたい - // TODO: ↓まとめてクエリしたい + this.noteUnreadsRepository.countBy({ + userId: userId, + isMentioned: true, + }).then(mentionsCount => { + if (mentionsCount === 0) { + // 全て既読になったイベントを発行 + this.globalEventService.publishMainStream(userId, 'readAllUnreadMentions'); + } + }); - trackPromise(this.noteUnreadsRepository.countBy({ - userId: userId, - isMentioned: true, - }).then(mentionsCount => { - if (mentionsCount === 0) { - // 全て既読になったイベントを発行 - this.globalEventService.publishMainStream(userId, 'readAllUnreadMentions'); - } - })); - - trackPromise(this.noteUnreadsRepository.countBy({ - userId: userId, - isSpecified: true, - }).then(specifiedCount => { - if (specifiedCount === 0) { - // 全て既読になったイベントを発行 - this.globalEventService.publishMainStream(userId, 'readAllUnreadSpecifiedNotes'); - } - })); + this.noteUnreadsRepository.countBy({ + userId: userId, + isSpecified: true, + }).then(specifiedCount => { + if (specifiedCount === 0) { + // 全て既読になったイベントを発行 + this.globalEventService.publishMainStream(userId, 'readAllUnreadSpecifiedNotes'); + } + }); + } } @bindThis diff --git a/packages/backend/src/core/NotificationService.ts b/packages/backend/src/core/NotificationService.ts index 68ad92f396..ad7be83e5b 100644 --- a/packages/backend/src/core/NotificationService.ts +++ b/packages/backend/src/core/NotificationService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -20,7 +20,6 @@ import { CacheService } from '@/core/CacheService.js'; import type { Config } from '@/config.js'; import { UserListService } from '@/core/UserListService.js'; import type { FilterUnionByProperty } from '@/types.js'; -import { trackPromise } from '@/misc/promise-tracker.js'; @Injectable() export class NotificationService implements OnApplicationShutdown { @@ -75,18 +74,7 @@ export class NotificationService implements OnApplicationShutdown { } @bindThis - public createNotification( - notifieeId: MiUser['id'], - type: T, - data: Omit, 'type' | 'id' | 'createdAt' | 'notifierId'>, - notifierId?: MiUser['id'] | null, - ) { - trackPromise( - this.#createNotificationInternal(notifieeId, type, data, notifierId), - ); - } - - async #createNotificationInternal( + public async createNotification( notifieeId: MiUser['id'], type: T, data: Omit, 'type' | 'id' | 'createdAt' | 'notifierId'>, @@ -122,14 +110,6 @@ export class NotificationService implements OnApplicationShutdown { return null; } } else if (recieveConfig?.type === 'mutualFollow') { - const [isFollowing, isFollower] = await Promise.all([ - this.cacheService.userFollowingsCache.fetch(notifieeId).then(followings => Object.hasOwn(followings, notifierId)), - this.cacheService.userFollowingsCache.fetch(notifierId).then(followings => Object.hasOwn(followings, notifieeId)), - ]); - if (!(isFollowing && isFollower)) { - return null; - } - } else if (recieveConfig?.type === 'followingOrFollower') { const [isFollowing, isFollower] = await Promise.all([ this.cacheService.userFollowingsCache.fetch(notifieeId).then(followings => Object.hasOwn(followings, notifierId)), this.cacheService.userFollowingsCache.fetch(notifierId).then(followings => Object.hasOwn(followings, notifieeId)), @@ -163,8 +143,6 @@ export class NotificationService implements OnApplicationShutdown { const packed = await this.notificationEntityService.pack(notification, notifieeId, {}); - if (packed == null) return null; - // Publish notification event this.globalEventService.publishMainStream(notifieeId, 'notification', packed); @@ -214,15 +192,6 @@ export class NotificationService implements OnApplicationShutdown { */ } - @bindThis - public async flushAllNotifications(userId: MiUser['id']) { - await Promise.all([ - this.redisClient.del(`notificationTimeline:${userId}`), - this.redisClient.del(`latestReadNotification:${userId}`), - ]); - this.globalEventService.publishMainStream(userId, 'notificationFlushed'); - } - @bindThis public dispose(): void { this.#shutdownController.abort(); diff --git a/packages/backend/src/core/PollService.ts b/packages/backend/src/core/PollService.ts index 6c96ab16cf..9e1b5ca78a 100644 --- a/packages/backend/src/core/PollService.ts +++ b/packages/backend/src/core/PollService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/ProxyAccountService.ts b/packages/backend/src/core/ProxyAccountService.ts index c3ff2a68d3..b1bc60701b 100644 --- a/packages/backend/src/core/ProxyAccountService.ts +++ b/packages/backend/src/core/ProxyAccountService.ts @@ -1,28 +1,29 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; -import type { MiMeta, UsersRepository } from '@/models/_.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'; @Injectable() export class ProxyAccountService { constructor( - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, + + private metaService: MetaService, ) { } @bindThis public async fetch(): Promise { - if (this.meta.proxyAccountId == null) return null; - return await this.usersRepository.findOneByOrFail({ id: this.meta.proxyAccountId }) as MiLocalUser; + const meta = await this.metaService.fetch(); + if (meta.proxyAccountId == null) return null; + return await this.usersRepository.findOneByOrFail({ id: meta.proxyAccountId }) as MiLocalUser; } } diff --git a/packages/backend/src/core/PushNotificationService.ts b/packages/backend/src/core/PushNotificationService.ts index 1479bb00d9..40d1deceeb 100644 --- a/packages/backend/src/core/PushNotificationService.ts +++ b/packages/backend/src/core/PushNotificationService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,7 +10,8 @@ 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 { MiMeta, MiSwSubscription, SwSubscriptionsRepository } from '@/models/_.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'; @@ -53,14 +54,13 @@ export class PushNotificationService implements OnApplicationShutdown { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.redis) private redisClient: Redis.Redis, @Inject(DI.swSubscriptionsRepository) private swSubscriptionsRepository: SwSubscriptionsRepository, + + private metaService: MetaService, ) { this.subscriptionsCache = new RedisKVCache(this.redisClient, 'userSwSubscriptions', { lifetime: 1000 * 60 * 60 * 1, // 1h @@ -73,12 +73,14 @@ export class PushNotificationService implements OnApplicationShutdown { @bindThis public async pushNotification(userId: string, type: T, body: PushNotificationsTypes[T]) { - if (!this.meta.enableServiceWorker || this.meta.swPublicKey == null || this.meta.swPrivateKey == null) return; + const meta = await this.metaService.fetch(); + + if (!meta.enableServiceWorker || meta.swPublicKey == null || meta.swPrivateKey == null) return; // アプリケーションの連絡先と、サーバーサイドの鍵ペアの情報を登録 push.setVapidDetails(this.config.url, - this.meta.swPublicKey, - this.meta.swPrivateKey); + meta.swPublicKey, + meta.swPrivateKey); const subscriptions = await this.subscriptionsCache.fetch(userId); @@ -99,7 +101,7 @@ export class PushNotificationService implements OnApplicationShutdown { type, body: (type === 'notification' || type === 'unreadAntennaNote') ? truncateBody(type, body) : body, userId, - dateTime: Date.now(), + dateTime: (new Date()).getTime(), }), { proxy: this.config.proxy, }).catch((err: any) => { @@ -113,19 +115,12 @@ export class PushNotificationService implements OnApplicationShutdown { endpoint: subscription.endpoint, auth: subscription.auth, publickey: subscription.publickey, - }).then(() => { - this.refreshCache(userId); }); } }); } } - @bindThis - public refreshCache(userId: string): void { - this.subscriptionsCache.refresh(userId); - } - @bindThis public dispose(): void { this.subscriptionsCache.dispose(); diff --git a/packages/backend/src/core/QueryService.ts b/packages/backend/src/core/QueryService.ts index c4feeaf971..f006ed4944 100644 --- a/packages/backend/src/core/QueryService.ts +++ b/packages/backend/src/core/QueryService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -212,8 +212,8 @@ export class QueryService { // または 自分自身 .orWhere('note.userId = :meId') // または 自分宛て - .orWhere(':meIdAsList <@ note.visibleUserIds') - .orWhere(':meIdAsList <@ note.mentions') + .orWhere(':meId = ANY(note.visibleUserIds)') + .orWhere(':meId = ANY(note.mentions)') .orWhere(new Brackets(qb => { qb // または フォロワー宛ての投稿であり、 @@ -228,7 +228,7 @@ export class QueryService { })); })); - q.setParameters({ meId: me.id, meIdAsList: [me.id] }); + q.setParameters({ meId: me.id }); } } diff --git a/packages/backend/src/core/QueueModule.ts b/packages/backend/src/core/QueueModule.ts index b10b8e5899..4444dc9787 100644 --- a/packages/backend/src/core/QueueModule.ts +++ b/packages/backend/src/core/QueueModule.ts @@ -1,23 +1,16 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ +import { setTimeout } from 'node:timers/promises'; import { Inject, Module, OnApplicationShutdown } from '@nestjs/common'; import * as Bull from 'bullmq'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; -import { baseQueueOptions, QUEUE } from '@/queue/const.js'; -import { allSettled } from '@/misc/promise-tracker.js'; -import { - DeliverJobData, - EndedPollNotificationJobData, - InboxJobData, - RelationshipJobData, - UserWebhookDeliverJobData, - SystemWebhookDeliverJobData, -} from '../queue/types.js'; +import { QUEUE, baseQueueOptions } from '@/queue/const.js'; import type { Provider } from '@nestjs/common'; +import type { DeliverJobData, InboxJobData, EndedPollNotificationJobData, WebhookDeliverJobData, RelationshipJobData } from '../queue/types.js'; export type SystemQueue = Bull.Queue>; export type EndedPollNotificationQueue = Bull.Queue; @@ -26,8 +19,7 @@ export type InboxQueue = Bull.Queue; export type DbQueue = Bull.Queue; export type RelationshipQueue = Bull.Queue; export type ObjectStorageQueue = Bull.Queue; -export type UserWebhookDeliverQueue = Bull.Queue; -export type SystemWebhookDeliverQueue = Bull.Queue; +export type WebhookDeliverQueue = Bull.Queue; const $system: Provider = { provide: 'queue:system', @@ -71,15 +63,9 @@ const $objectStorage: Provider = { inject: [DI.config], }; -const $userWebhookDeliver: Provider = { - provide: 'queue:userWebhookDeliver', - useFactory: (config: Config) => new Bull.Queue(QUEUE.USER_WEBHOOK_DELIVER, baseQueueOptions(config, QUEUE.USER_WEBHOOK_DELIVER)), - inject: [DI.config], -}; - -const $systemWebhookDeliver: Provider = { - provide: 'queue:systemWebhookDeliver', - useFactory: (config: Config) => new Bull.Queue(QUEUE.SYSTEM_WEBHOOK_DELIVER, baseQueueOptions(config, QUEUE.SYSTEM_WEBHOOK_DELIVER)), +const $webhookDeliver: Provider = { + provide: 'queue:webhookDeliver', + useFactory: (config: Config) => new Bull.Queue(QUEUE.WEBHOOK_DELIVER, baseQueueOptions(config, QUEUE.WEBHOOK_DELIVER)), inject: [DI.config], }; @@ -94,8 +80,7 @@ const $systemWebhookDeliver: Provider = { $db, $relationship, $objectStorage, - $userWebhookDeliver, - $systemWebhookDeliver, + $webhookDeliver, ], exports: [ $system, @@ -105,8 +90,7 @@ const $systemWebhookDeliver: Provider = { $db, $relationship, $objectStorage, - $userWebhookDeliver, - $systemWebhookDeliver, + $webhookDeliver, ], }) export class QueueModule implements OnApplicationShutdown { @@ -118,14 +102,18 @@ export class QueueModule implements OnApplicationShutdown { @Inject('queue:db') public dbQueue: DbQueue, @Inject('queue:relationship') public relationshipQueue: RelationshipQueue, @Inject('queue:objectStorage') public objectStorageQueue: ObjectStorageQueue, - @Inject('queue:userWebhookDeliver') public userWebhookDeliverQueue: UserWebhookDeliverQueue, - @Inject('queue:systemWebhookDeliver') public systemWebhookDeliverQueue: SystemWebhookDeliverQueue, + @Inject('queue:webhookDeliver') public webhookDeliverQueue: WebhookDeliverQueue, ) {} public async dispose(): Promise { - // Wait for all potential queue jobs - await allSettled(); - // And then close all queues + if (process.env.NODE_ENV === 'test') { + // XXX: + // Shutting down the existing connections causes errors on Jest as + // Misskey has asynchronous postgres/redis connections that are not + // awaited. + // Let's wait for some random time for them to finish. + await setTimeout(5000); + } await Promise.all([ this.systemQueue.close(), this.endedPollNotificationQueue.close(), @@ -134,8 +122,7 @@ export class QueueModule implements OnApplicationShutdown { this.dbQueue.close(), this.relationshipQueue.close(), this.objectStorageQueue.close(), - this.userWebhookDeliverQueue.close(), - this.systemWebhookDeliverQueue.close(), + this.webhookDeliverQueue.close(), ]); } diff --git a/packages/backend/src/core/QueueService.ts b/packages/backend/src/core/QueueService.ts index 50f08da241..be378a899b 100644 --- a/packages/backend/src/core/QueueService.ts +++ b/packages/backend/src/core/QueueService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,35 +7,15 @@ import { randomUUID } from 'node:crypto'; import { Inject, Injectable } from '@nestjs/common'; import type { IActivity } from '@/core/activitypub/type.js'; import type { MiDriveFile } from '@/models/DriveFile.js'; -import type { MiWebhook, WebhookEventTypes, webhookEventTypes } from '@/models/Webhook.js'; -import type { MiSystemWebhook, SystemWebhookEventType } from '@/models/SystemWebhook.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'; import type { Antenna } from '@/server/api/endpoints/i/import-antennas.js'; -import { ApRequestCreator } from '@/core/activitypub/ApRequestService.js'; -import type { - DbJobData, - DeliverJobData, - RelationshipJobData, - SystemWebhookDeliverJobData, - ThinUser, - UserWebhookDeliverJobData, -} from '../queue/types.js'; -import type { - DbQueue, - DeliverQueue, - EndedPollNotificationQueue, - InboxQueue, - ObjectStorageQueue, - RelationshipQueue, - SystemQueue, - UserWebhookDeliverQueue, - SystemWebhookDeliverQueue, -} from './QueueModule.js'; +import type { DbQueue, DeliverQueue, EndedPollNotificationQueue, InboxQueue, ObjectStorageQueue, RelationshipQueue, SystemQueue, WebhookDeliverQueue } from './QueueModule.js'; +import type { DbJobData, DeliverJobData, RelationshipJobData, ThinUser } from '../queue/types.js'; import type httpSignature from '@peertube/http-signature'; import type * as Bull from 'bullmq'; -import { type UserWebhookPayload } from './UserWebhookService.js'; @Injectable() export class QueueService { @@ -50,8 +30,7 @@ export class QueueService { @Inject('queue:db') public dbQueue: DbQueue, @Inject('queue:relationship') public relationshipQueue: RelationshipQueue, @Inject('queue:objectStorage') public objectStorageQueue: ObjectStorageQueue, - @Inject('queue:userWebhookDeliver') public userWebhookDeliverQueue: UserWebhookDeliverQueue, - @Inject('queue:systemWebhookDeliver') public systemWebhookDeliverQueue: SystemWebhookDeliverQueue, + @Inject('queue:webhookDeliver') public webhookDeliverQueue: WebhookDeliverQueue, ) { this.systemQueue.add('tickCharts', { }, { @@ -88,19 +67,6 @@ export class QueueService { repeat: { pattern: '*/5 * * * *' }, removeOnComplete: true, }); - - this.systemQueue.add('bakeBufferedReactions', { - }, { - repeat: { pattern: '0 0 * * *' }, - removeOnComplete: true, - }); - - this.systemQueue.add('checkModeratorsActivity', { - }, { - // 毎時30分に起動 - repeat: { pattern: '30 * * * *' }, - removeOnComplete: true, - }); } @bindThis @@ -108,15 +74,11 @@ export class QueueService { if (content == null) return null; if (to == null) return null; - const contentBody = JSON.stringify(content); - const digest = ApRequestCreator.createDigest(contentBody); - const data: DeliverJobData = { user: { id: user.id, }, - content: contentBody, - digest, + content, to, isSharedInbox, }; @@ -141,8 +103,6 @@ export class QueueService { @bindThis public async deliverMany(user: ThinUser, content: IActivity | null, inboxes: Map) { if (content == null) return null; - const contentBody = JSON.stringify(content); - const digest = ApRequestCreator.createDigest(contentBody); const opts = { attempts: this.config.deliverJobMaxAttempts ?? 12, @@ -157,8 +117,7 @@ export class QueueService { name: d[0], data: { user, - content: contentBody, - digest, + content, to: d[0], isSharedInbox: d[1], } as DeliverJobData, @@ -215,16 +174,6 @@ export class QueueService { }); } - @bindThis - public createExportClipsJob(user: ThinUser) { - return this.dbQueue.add('exportClips', { - user: { id: user.id }, - }, { - removeOnComplete: true, - removeOnFail: true, - }); - } - @bindThis public createExportFavoritesJob(user: ThinUser) { return this.dbQueue.add('exportFavorites', { @@ -464,18 +413,9 @@ export class QueueService { }); } - /** - * @see UserWebhookDeliverJobData - * @see UserWebhookDeliverProcessorService - */ @bindThis - public userWebhookDeliver( - webhook: MiWebhook, - type: T, - content: UserWebhookPayload, - opts?: { attempts?: number }, - ) { - const data: UserWebhookDeliverJobData = { + public webhookDeliver(webhook: MiWebhook, type: typeof webhookEventTypes[number], content: unknown) { + const data = { type, content, webhookId: webhook.id, @@ -486,39 +426,8 @@ export class QueueService { eventId: randomUUID(), }; - return this.userWebhookDeliverQueue.add(webhook.id, data, { - attempts: opts?.attempts ?? 4, - backoff: { - type: 'custom', - }, - removeOnComplete: true, - removeOnFail: true, - }); - } - - /** - * @see SystemWebhookDeliverJobData - * @see SystemWebhookDeliverProcessorService - */ - @bindThis - public systemWebhookDeliver( - webhook: MiSystemWebhook, - type: SystemWebhookEventType, - content: unknown, - opts?: { attempts?: number }, - ) { - const data: SystemWebhookDeliverJobData = { - type, - content, - webhookId: webhook.id, - to: webhook.url, - secret: webhook.secret, - createdAt: Date.now(), - eventId: randomUUID(), - }; - - return this.systemWebhookDeliverQueue.add(webhook.id, data, { - attempts: opts?.attempts ?? 4, + return this.webhookDeliverQueue.add(webhook.id, data, { + attempts: 4, backoff: { type: 'custom', }, diff --git a/packages/backend/src/core/ReactionService.ts b/packages/backend/src/core/ReactionService.ts index 6f9fe53937..3ca12551b1 100644 --- a/packages/backend/src/core/ReactionService.ts +++ b/packages/backend/src/core/ReactionService.ts @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; +import * as Redis from 'ioredis'; import { DI } from '@/di-symbols.js'; -import type { EmojisRepository, NoteReactionsRepository, UsersRepository, NotesRepository, MiMeta } from '@/models/_.js'; +import type { EmojisRepository, NoteReactionsRepository, UsersRepository, NotesRepository } from '@/models/_.js'; import { IdentifiableError } from '@/misc/identifiable-error.js'; import type { MiRemoteUser, MiUser } from '@/models/User.js'; import type { MiNote } from '@/models/Note.js'; @@ -20,22 +21,20 @@ import { ApDeliverManagerService } from '@/core/activitypub/ApDeliverManagerServ import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; +import { MetaService } from '@/core/MetaService.js'; import { bindThis } from '@/decorators.js'; import { UtilityService } from '@/core/UtilityService.js'; import { UserBlockingService } from '@/core/UserBlockingService.js'; import { CustomEmojiService } from '@/core/CustomEmojiService.js'; import { RoleService } from '@/core/RoleService.js'; import { FeaturedService } from '@/core/FeaturedService.js'; -import { trackPromise } from '@/misc/promise-tracker.js'; -import { isQuote, isRenote } from '@/misc/is-renote.js'; -import { ReactionsBufferingService } from '@/core/ReactionsBufferingService.js'; -import { PER_NOTE_REACTION_USER_PAIR_CACHE_MAX } from '@/const.js'; -const FALLBACK = '\u2764'; +const FALLBACK = '❤'; +const PER_NOTE_REACTION_USER_PAIR_CACHE_MAX = 16; const legacies: Record = { 'like': '👍', - 'love': '\u2764', // ハート、異体字セレクタを入れない + 'love': '❤', // ここに記述する場合は異体字セレクタを入れない 'laugh': '😆', 'hmm': '🤔', 'surprise': '😮', @@ -70,8 +69,8 @@ const decodeCustomEmojiRegexp = /^:([\w+-]+)(?:@([\w.-]+))?:$/; @Injectable() export class ReactionService { constructor( - @Inject(DI.meta) - private meta: MiMeta, + @Inject(DI.redis) + private redisClient: Redis.Redis, @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -86,12 +85,12 @@ export class ReactionService { private emojisRepository: EmojisRepository, private utilityService: UtilityService, + private metaService: MetaService, private customEmojiService: CustomEmojiService, private roleService: RoleService, private userEntityService: UserEntityService, private noteEntityService: NoteEntityService, private userBlockingService: UserBlockingService, - private reactionsBufferingService: ReactionsBufferingService, private idService: IdService, private featuredService: FeaturedService, private globalEventService: GlobalEventService, @@ -117,16 +116,11 @@ export class ReactionService { throw new IdentifiableError('68e9d2d1-48bf-42c2-b90a-b20e09fd3d48', 'Note not accessible for you.'); } - // Check if note is Renote - if (isRenote(note) && !isQuote(note)) { - throw new IdentifiableError('12c35529-3c79-4327-b1cc-e2cf63a71925', 'You cannot react to Renote.'); - } - let reaction = _reaction ?? FALLBACK; if (note.reactionAcceptance === 'likeOnly' || ((note.reactionAcceptance === 'likeOnlyForRemote' || note.reactionAcceptance === 'nonSensitiveOnlyForLocalLikeOnlyForRemote') && (user.host != null))) { - reaction = '\u2764'; - } else if (_reaction != null) { + reaction = '❤️'; + } else if (_reaction) { const custom = reaction.match(isCustomEmojiRegexp); if (custom) { const reacterHost = this.utilityService.toPunyNullable(user.host); @@ -147,11 +141,6 @@ export class ReactionService { if ((note.reactionAcceptance === 'nonSensitiveOnly' || note.reactionAcceptance === 'nonSensitiveOnlyForLocalLikeOnlyForRemote') && emoji.isSensitive) { reaction = FALLBACK; } - - // for media silenced host, custom emoji reactions are not allowed - if (reacterHost != null && this.utilityService.isMediaSilencedHost(this.meta.mediaSilencedHosts, reacterHost)) { - reaction = FALLBACK; - } } else { // リアクションとして使う権限がない reaction = FALLBACK; @@ -171,6 +160,7 @@ export class ReactionService { reaction, }; + // Create reaction try { await this.noteReactionsRepository.insert(record); } catch (e) { @@ -194,20 +184,16 @@ export class ReactionService { } // Increment reactions count - if (this.meta.enableReactionsBuffering) { - await this.reactionsBufferingService.create(note.id, user.id, reaction, note.reactionAndUserPairCache); - } else { - const sql = `jsonb_set("reactions", '{${reaction}}', (COALESCE("reactions"->>'${reaction}', '0')::int + 1)::text::jsonb)`; - await this.notesRepository.createQueryBuilder().update() - .set({ - reactions: () => sql, - ...(note.reactionAndUserPairCache.length < PER_NOTE_REACTION_USER_PAIR_CACHE_MAX ? { - reactionAndUserPairCache: () => `array_append("reactionAndUserPairCache", '${user.id}/${reaction}')`, - } : {}), - }) - .where('id = :id', { id: note.id }) - .execute(); - } + const sql = `jsonb_set("reactions", '{${reaction}}', (COALESCE("reactions"->>'${reaction}', '0')::int + 1)::text::jsonb)`; + await this.notesRepository.createQueryBuilder().update() + .set({ + reactions: () => sql, + ...(note.reactionAndUserPairCache.length < PER_NOTE_REACTION_USER_PAIR_CACHE_MAX ? { + reactionAndUserPairCache: () => `array_append("reactionAndUserPairCache", '${user.id}/${reaction}')`, + } : {}), + }) + .where('id = :id', { id: note.id }) + .execute(); // 30%の確率、セルフではない、3日以内に投稿されたノートの場合ハイライト用ランキング更新 if ( @@ -227,7 +213,9 @@ export class ReactionService { } } - if (this.meta.enableChartsForRemoteUser || (user.host == null)) { + const meta = await this.metaService.fetch(); + + if (meta.enableChartsForRemoteUser || (user.host == null)) { this.perUserReactionsChart.update(user, note); } @@ -280,7 +268,7 @@ export class ReactionService { } } - trackPromise(dm.execute()); + dm.execute(); } //#endregion } @@ -305,18 +293,14 @@ export class ReactionService { } // Decrement reactions count - if (this.meta.enableReactionsBuffering) { - await this.reactionsBufferingService.delete(note.id, user.id, exist.reaction); - } else { - const sql = `jsonb_set("reactions", '{${exist.reaction}}', (COALESCE("reactions"->>'${exist.reaction}', '0')::int - 1)::text::jsonb)`; - await this.notesRepository.createQueryBuilder().update() - .set({ - reactions: () => sql, - reactionAndUserPairCache: () => `array_remove("reactionAndUserPairCache", '${user.id}/${exist.reaction}')`, - }) - .where('id = :id', { id: note.id }) - .execute(); - } + const sql = `jsonb_set("reactions", '{${exist.reaction}}', (COALESCE("reactions"->>'${exist.reaction}', '0')::int - 1)::text::jsonb)`; + await this.notesRepository.createQueryBuilder().update() + .set({ + reactions: () => sql, + reactionAndUserPairCache: () => `array_remove("reactionAndUserPairCache", '${user.id}/${exist.reaction}')`, + }) + .where('id = :id', { id: note.id }) + .execute(); this.globalEventService.publishNoteStream(note.id, 'unreacted', { reaction: this.decodeReaction(exist.reaction).reaction, @@ -332,51 +316,40 @@ export class ReactionService { dm.addDirectRecipe(reactee as MiRemoteUser); } dm.addFollowersRecipe(); - trackPromise(dm.execute()); + dm.execute(); } //#endregion } - /** - * - 文字列タイプのレガシーな形式のリアクションを現在の形式に変換する - * - ローカルのリアクションのホストを `@.` にする(`decodeReaction()`の効果) - */ @bindThis - public convertLegacyReaction(reaction: string): string { - reaction = this.decodeReaction(reaction).reaction; - if (Object.keys(legacies).includes(reaction)) return legacies[reaction]; - return reaction; - } + public convertLegacyReactions(reactions: Record) { + const _reactions = {} as Record; - // TODO: 廃止 - /** - * - 文字列タイプのレガシーな形式のリアクションを現在の形式に変換する - * - ローカルのリアクションのホストを `@.` にする(`decodeReaction()`の効果) - * - データベース上には存在する「0個のリアクションがついている」という情報を削除する - */ - @bindThis - public convertLegacyReactions(reactions: MiNote['reactions']): MiNote['reactions'] { - return Object.entries(reactions) - .filter(([, count]) => { - // `ReactionService.prototype.delete`ではリアクション削除時に、 - // `MiNote['reactions']`のエントリの値をデクリメントしているが、 - // デクリメントしているだけなのでエントリ自体は0を値として持つ形で残り続ける。 - // そのため、この処理がなければ、「0個のリアクションがついている」ということになってしまう。 - return count > 0; - }) - .map(([reaction, count]) => { - const key = this.convertLegacyReaction(reaction); + for (const reaction of Object.keys(reactions)) { + if (reactions[reaction] <= 0) continue; - return [key, count] as const; - }) - .reduce((acc, [key, count]) => { - // unchecked indexed access - const prevCount = acc[key] as number | undefined; + if (Object.keys(legacies).includes(reaction)) { + if (_reactions[legacies[reaction]]) { + _reactions[legacies[reaction]] += reactions[reaction]; + } else { + _reactions[legacies[reaction]] = reactions[reaction]; + } + } else { + if (_reactions[reaction]) { + _reactions[reaction] += reactions[reaction]; + } else { + _reactions[reaction] = reactions[reaction]; + } + } + } - acc[key] = (prevCount ?? 0) + count; + const _reactions2 = {} as Record; - return acc; - }, {}); + for (const reaction of Object.keys(_reactions)) { + _reactions2[this.decodeReaction(reaction).reaction] = _reactions[reaction]; + } + + return _reactions2; } @bindThis @@ -420,4 +393,11 @@ export class ReactionService { host: undefined, }; } + + @bindThis + public convertLegacyReaction(reaction: string): string { + reaction = this.decodeReaction(reaction).reaction; + if (Object.keys(legacies).includes(reaction)) return legacies[reaction]; + return reaction; + } } diff --git a/packages/backend/src/core/ReactionsBufferingService.ts b/packages/backend/src/core/ReactionsBufferingService.ts deleted file mode 100644 index b4207c5106..0000000000 --- a/packages/backend/src/core/ReactionsBufferingService.ts +++ /dev/null @@ -1,211 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import * as Redis from 'ioredis'; -import { DI } from '@/di-symbols.js'; -import type { MiNote } from '@/models/Note.js'; -import { bindThis } from '@/decorators.js'; -import type { MiUser, NotesRepository } from '@/models/_.js'; -import type { Config } from '@/config.js'; -import { PER_NOTE_REACTION_USER_PAIR_CACHE_MAX } from '@/const.js'; -import type { GlobalEvents } from '@/core/GlobalEventService.js'; -import type { OnApplicationShutdown } from '@nestjs/common'; - -const REDIS_DELTA_PREFIX = 'reactionsBufferDeltas'; -const REDIS_PAIR_PREFIX = 'reactionsBufferPairs'; - -@Injectable() -export class ReactionsBufferingService implements OnApplicationShutdown { - constructor( - @Inject(DI.config) - private config: Config, - - @Inject(DI.redisForSub) - private redisForSub: Redis.Redis, - - @Inject(DI.redisForReactions) - private redisForReactions: Redis.Redis, // TODO: 専用のRedisインスタンスにする - - @Inject(DI.notesRepository) - private notesRepository: NotesRepository, - ) { - this.redisForSub.on('message', this.onMessage); - } - - @bindThis - private async onMessage(_: string, data: string) { - const obj = JSON.parse(data); - - if (obj.channel === 'internal') { - const { type, body } = obj.message as GlobalEvents['internal']['payload']; - switch (type) { - case 'metaUpdated': { - // リアクションバッファリングが有効→無効になったら即bake - if (body.before != null && body.before.enableReactionsBuffering && !body.after.enableReactionsBuffering) { - this.bake(); - } - break; - } - default: - break; - } - } - } - - @bindThis - public async create(noteId: MiNote['id'], userId: MiUser['id'], reaction: string, currentPairs: string[]): Promise { - const pipeline = this.redisForReactions.pipeline(); - pipeline.hincrby(`${REDIS_DELTA_PREFIX}:${noteId}`, reaction, 1); - for (let i = 0; i < currentPairs.length; i++) { - pipeline.zadd(`${REDIS_PAIR_PREFIX}:${noteId}`, i, currentPairs[i]); - } - pipeline.zadd(`${REDIS_PAIR_PREFIX}:${noteId}`, Date.now(), `${userId}/${reaction}`); - pipeline.zremrangebyrank(`${REDIS_PAIR_PREFIX}:${noteId}`, 0, -(PER_NOTE_REACTION_USER_PAIR_CACHE_MAX + 1)); - await pipeline.exec(); - } - - @bindThis - public async delete(noteId: MiNote['id'], userId: MiUser['id'], reaction: string): Promise { - const pipeline = this.redisForReactions.pipeline(); - pipeline.hincrby(`${REDIS_DELTA_PREFIX}:${noteId}`, reaction, -1); - pipeline.zrem(`${REDIS_PAIR_PREFIX}:${noteId}`, `${userId}/${reaction}`); - // TODO: 「消した要素一覧」も持っておかないとcreateされた時に上書きされて復活する - await pipeline.exec(); - } - - @bindThis - public async get(noteId: MiNote['id']): Promise<{ - deltas: Record; - pairs: ([MiUser['id'], string])[]; - }> { - const pipeline = this.redisForReactions.pipeline(); - pipeline.hgetall(`${REDIS_DELTA_PREFIX}:${noteId}`); - pipeline.zrange(`${REDIS_PAIR_PREFIX}:${noteId}`, 0, -1); - const results = await pipeline.exec(); - - const resultDeltas = results![0][1] as Record; - const resultPairs = results![1][1] as string[]; - - const deltas = {} as Record; - for (const [name, count] of Object.entries(resultDeltas)) { - deltas[name] = parseInt(count); - } - - const pairs = resultPairs.map(x => x.split('/') as [MiUser['id'], string]); - - return { - deltas, - pairs, - }; - } - - @bindThis - public async getMany(noteIds: MiNote['id'][]): Promise; - pairs: ([MiUser['id'], string])[]; - }>> { - const map = new Map; - pairs: ([MiUser['id'], string])[]; - }>(); - - const pipeline = this.redisForReactions.pipeline(); - for (const noteId of noteIds) { - pipeline.hgetall(`${REDIS_DELTA_PREFIX}:${noteId}`); - pipeline.zrange(`${REDIS_PAIR_PREFIX}:${noteId}`, 0, -1); - } - const results = await pipeline.exec(); - - const opsForEachNotes = 2; - for (let i = 0; i < noteIds.length; i++) { - const noteId = noteIds[i]; - const resultDeltas = results![i * opsForEachNotes][1] as Record; - const resultPairs = results![i * opsForEachNotes + 1][1] as string[]; - - const deltas = {} as Record; - for (const [name, count] of Object.entries(resultDeltas)) { - deltas[name] = parseInt(count); - } - - const pairs = resultPairs.map(x => x.split('/') as [MiUser['id'], string]); - - map.set(noteId, { - deltas, - pairs, - }); - } - - return map; - } - - // TODO: scanは重い可能性があるので、別途 bufferedNoteIds を直接Redis上に持っておいてもいいかもしれない - @bindThis - public async bake(): Promise { - const bufferedNoteIds = []; - let cursor = '0'; - do { - // https://github.com/redis/ioredis#transparent-key-prefixing - const result = await this.redisForReactions.scan( - cursor, - 'MATCH', - `${this.config.redis.prefix}:${REDIS_DELTA_PREFIX}:*`, - 'COUNT', - '1000'); - - cursor = result[0]; - bufferedNoteIds.push(...result[1].map(x => x.replace(`${this.config.redis.prefix}:${REDIS_DELTA_PREFIX}:`, ''))); - } while (cursor !== '0'); - - const bufferedMap = await this.getMany(bufferedNoteIds); - - // clear - const pipeline = this.redisForReactions.pipeline(); - for (const noteId of bufferedNoteIds) { - pipeline.del(`${REDIS_DELTA_PREFIX}:${noteId}`); - pipeline.del(`${REDIS_PAIR_PREFIX}:${noteId}`); - } - await pipeline.exec(); - - // TODO: SQL一個にまとめたい - for (const [noteId, buffered] of bufferedMap) { - const sql = Object.entries(buffered.deltas) - .map(([reaction, count]) => - `jsonb_set("reactions", '{${reaction}}', (COALESCE("reactions"->>'${reaction}', '0')::int + ${count})::text::jsonb)`) - .join(' || '); - - this.notesRepository.createQueryBuilder().update() - .set({ - reactions: () => sql, - reactionAndUserPairCache: buffered.pairs.map(x => x.join('/')), - }) - .where('id = :id', { id: noteId }) - .execute(); - } - } - - @bindThis - public mergeReactions(src: MiNote['reactions'], delta: Record): MiNote['reactions'] { - const reactions = { ...src }; - for (const [name, count] of Object.entries(delta)) { - if (reactions[name] != null) { - reactions[name] += count; - } else { - reactions[name] = count; - } - } - return reactions; - } - - @bindThis - public dispose(): void { - this.redisForSub.off('message', this.onMessage); - } - - @bindThis - public onApplicationShutdown(signal?: string | undefined): void { - this.dispose(); - } -} diff --git a/packages/backend/src/core/RegistryApiService.ts b/packages/backend/src/core/RegistryApiService.ts index 2c8877d8a8..d340c5e480 100644 --- a/packages/backend/src/core/RegistryApiService.ts +++ b/packages/backend/src/core/RegistryApiService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/RelayService.ts b/packages/backend/src/core/RelayService.ts index db32114346..d40cd080c7 100644 --- a/packages/backend/src/core/RelayService.ts +++ b/packages/backend/src/core/RelayService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -35,7 +35,7 @@ export class RelayService { private createSystemUserService: CreateSystemUserService, private apRendererService: ApRendererService, ) { - this.relaysCache = new MemorySingleCache(1000 * 60 * 10); // 10m + this.relaysCache = new MemorySingleCache(1000 * 60 * 10); } @bindThis @@ -53,11 +53,11 @@ export class RelayService { @bindThis public async addRelay(inbox: string): Promise { - const relay = await this.relaysRepository.insertOne({ + const relay = await this.relaysRepository.insert({ id: this.idService.gen(), inbox, status: 'requesting', - }); + }).then(x => this.relaysRepository.findOneByOrFail(x.identifiers[0])); const relayActor = await this.getRelayActor(); const follow = await this.apRendererService.renderFollowRelay(relay, relayActor); diff --git a/packages/backend/src/core/RemoteLoggerService.ts b/packages/backend/src/core/RemoteLoggerService.ts index 413b03bb56..5d13988ed7 100644 --- a/packages/backend/src/core/RemoteLoggerService.ts +++ b/packages/backend/src/core/RemoteLoggerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/RemoteUserResolveService.ts b/packages/backend/src/core/RemoteUserResolveService.ts index f5a55eb8bc..75c5f14aa4 100644 --- a/packages/backend/src/core/RemoteUserResolveService.ts +++ b/packages/backend/src/core/RemoteUserResolveService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/ReversiService.ts b/packages/backend/src/core/ReversiService.ts deleted file mode 100644 index 51dca3da59..0000000000 --- a/packages/backend/src/core/ReversiService.ts +++ /dev/null @@ -1,633 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import * as Redis from 'ioredis'; -import { ModuleRef } from '@nestjs/core'; -import { reversiUpdateKeys } from 'misskey-js'; -import * as Reversi from 'misskey-reversi'; -import { IsNull, LessThan, MoreThan } from 'typeorm'; -import type { - MiReversiGame, - ReversiGamesRepository, -} from '@/models/_.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'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; -import { IdService } from '@/core/IdService.js'; -import { NotificationService } from '@/core/NotificationService.js'; -import { Serialized } from '@/types.js'; -import { ReversiGameEntityService } from './entities/ReversiGameEntityService.js'; -import type { OnApplicationShutdown, OnModuleInit } from '@nestjs/common'; - -const INVITATION_TIMEOUT_MS = 1000 * 20; // 20sec - -@Injectable() -export class ReversiService implements OnApplicationShutdown, OnModuleInit { - private notificationService: NotificationService; - - constructor( - private moduleRef: ModuleRef, - - @Inject(DI.redis) - private redisClient: Redis.Redis, - - @Inject(DI.reversiGamesRepository) - private reversiGamesRepository: ReversiGamesRepository, - - private cacheService: CacheService, - private userEntityService: UserEntityService, - private globalEventService: GlobalEventService, - private reversiGameEntityService: ReversiGameEntityService, - private idService: IdService, - ) { - } - - async onModuleInit() { - this.notificationService = this.moduleRef.get(NotificationService.name); - } - - @bindThis - private async cacheGame(game: MiReversiGame) { - await this.redisClient.setex(`reversi:game:cache:${game.id}`, 60 * 60, JSON.stringify(game)); - } - - @bindThis - private async deleteGameCache(gameId: MiReversiGame['id']) { - await this.redisClient.del(`reversi:game:cache:${gameId}`); - } - - @bindThis - private getBakeProps(game: MiReversiGame) { - return { - startedAt: game.startedAt, - endedAt: game.endedAt, - // ゲームの途中からユーザーが変わることは無いので - //user1Id: game.user1Id, - //user2Id: game.user2Id, - user1Ready: game.user1Ready, - user2Ready: game.user2Ready, - black: game.black, - isStarted: game.isStarted, - isEnded: game.isEnded, - winnerId: game.winnerId, - surrenderedUserId: game.surrenderedUserId, - timeoutUserId: game.timeoutUserId, - isLlotheo: game.isLlotheo, - canPutEverywhere: game.canPutEverywhere, - loopedBoard: game.loopedBoard, - timeLimitForEachTurn: game.timeLimitForEachTurn, - logs: game.logs, - map: game.map, - bw: game.bw, - crc32: game.crc32, - noIrregularRules: game.noIrregularRules, - } satisfies Partial; - } - - @bindThis - public async matchSpecificUser(me: MiUser, targetUser: MiUser, multiple = false): Promise { - if (targetUser.id === me.id) { - throw new Error('You cannot match yourself.'); - } - - if (!multiple) { - // 既にマッチしている対局が無いか探す(3分以内) - const games = await this.reversiGamesRepository.find({ - where: [ - { id: MoreThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user1Id: me.id, user2Id: targetUser.id, isStarted: false }, - { id: MoreThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user1Id: targetUser.id, user2Id: me.id, isStarted: false }, - ], - relations: ['user1', 'user2'], - order: { id: 'DESC' }, - }); - if (games.length > 0) { - return games[0]; - } - } - - //#region 相手から既に招待されてないか確認 - const invitations = await this.redisClient.zrange( - `reversi:matchSpecific:${me.id}`, - Date.now() - INVITATION_TIMEOUT_MS, - '+inf', - 'BYSCORE'); - - if (invitations.includes(targetUser.id)) { - await this.redisClient.zrem(`reversi:matchSpecific:${me.id}`, targetUser.id); - - const game = await this.matched(targetUser.id, me.id, { - noIrregularRules: false, - }); - - return game; - } - //#endregion - - const redisPipeline = this.redisClient.pipeline(); - redisPipeline.zadd(`reversi:matchSpecific:${targetUser.id}`, Date.now(), me.id); - redisPipeline.expire(`reversi:matchSpecific:${targetUser.id}`, 120, 'NX'); - await redisPipeline.exec(); - - this.globalEventService.publishReversiStream(targetUser.id, 'invited', { - user: await this.userEntityService.pack(me, targetUser), - }); - - return null; - } - - @bindThis - public async matchAnyUser(me: MiUser, options: { noIrregularRules: boolean }, multiple = false): Promise { - if (!multiple) { - // 既にマッチしている対局が無いか探す(3分以内) - const games = await this.reversiGamesRepository.find({ - where: [ - { id: MoreThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user1Id: me.id, isStarted: false }, - { id: MoreThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user2Id: me.id, isStarted: false }, - ], - relations: ['user1', 'user2'], - order: { id: 'DESC' }, - }); - if (games.length > 0) { - return games[0]; - } - } - - //#region まず自分宛ての招待を探す - const invitations = await this.redisClient.zrange( - `reversi:matchSpecific:${me.id}`, - Date.now() - INVITATION_TIMEOUT_MS, - '+inf', - 'BYSCORE'); - - if (invitations.length > 0) { - const invitorId = invitations[Math.floor(Math.random() * invitations.length)]; - await this.redisClient.zrem(`reversi:matchSpecific:${me.id}`, invitorId); - - const game = await this.matched(invitorId, me.id, { - noIrregularRules: false, - }); - - return game; - } - //#endregion - - const matchings = await this.redisClient.zrange( - 'reversi:matchAny', - 0, - 2, // 自分自身のIDが入っている場合もあるので2つ取得 - 'REV'); - - const items = matchings.filter(id => !id.startsWith(me.id)); - - if (items.length > 0) { - const [matchedUserId, option] = items[0].split(':'); - - await this.redisClient.zrem('reversi:matchAny', - me.id, - matchedUserId, - me.id + ':noIrregularRules', - matchedUserId + ':noIrregularRules'); - - const game = await this.matched(matchedUserId, me.id, { - noIrregularRules: options.noIrregularRules || option === 'noIrregularRules', - }); - - return game; - } else { - const redisPipeline = this.redisClient.pipeline(); - if (options.noIrregularRules) { - redisPipeline.zadd('reversi:matchAny', Date.now(), me.id + ':noIrregularRules'); - } else { - redisPipeline.zadd('reversi:matchAny', Date.now(), me.id); - } - redisPipeline.expire('reversi:matchAny', 15, 'NX'); - await redisPipeline.exec(); - return null; - } - } - - @bindThis - public async matchSpecificUserCancel(user: MiUser, targetUserId: MiUser['id']) { - await this.redisClient.zrem(`reversi:matchSpecific:${targetUserId}`, user.id); - } - - @bindThis - public async matchAnyUserCancel(user: MiUser) { - await this.redisClient.zrem('reversi:matchAny', user.id, user.id + ':noIrregularRules'); - } - - @bindThis - public async cleanOutdatedGames() { - await this.reversiGamesRepository.delete({ - id: LessThan(this.idService.gen(Date.now() - 1000 * 60 * 10)), - isStarted: false, - }); - } - - @bindThis - public async gameReady(gameId: MiReversiGame['id'], user: MiUser, ready: boolean) { - const game = await this.get(gameId); - if (game == null) throw new Error('game not found'); - if (game.isStarted) return; - - let isBothReady = false; - - if (game.user1Id === user.id) { - const updatedGame = { - ...game, - user1Ready: ready, - }; - this.cacheGame(updatedGame); - - this.globalEventService.publishReversiGameStream(game.id, 'changeReadyStates', { - user1: ready, - user2: updatedGame.user2Ready, - }); - - if (ready && updatedGame.user2Ready) isBothReady = true; - } else if (game.user2Id === user.id) { - const updatedGame = { - ...game, - user2Ready: ready, - }; - this.cacheGame(updatedGame); - - this.globalEventService.publishReversiGameStream(game.id, 'changeReadyStates', { - user1: updatedGame.user1Ready, - user2: ready, - }); - - if (ready && updatedGame.user1Ready) isBothReady = true; - } else { - return; - } - - if (isBothReady) { - // 3秒後、両者readyならゲーム開始 - setTimeout(async () => { - const freshGame = await this.get(game.id); - if (freshGame == null || freshGame.isStarted || freshGame.isEnded) return; - if (!freshGame.user1Ready || !freshGame.user2Ready) return; - - this.startGame(freshGame); - }, 3000); - } - } - - @bindThis - private async matched(parentId: MiUser['id'], childId: MiUser['id'], options: { noIrregularRules: boolean; }): Promise { - const game = await this.reversiGamesRepository.insertOne({ - id: this.idService.gen(), - user1Id: parentId, - user2Id: childId, - user1Ready: false, - user2Ready: false, - isStarted: false, - isEnded: false, - logs: [], - map: Reversi.maps.eighteight.data, - bw: 'random', - isLlotheo: false, - noIrregularRules: options.noIrregularRules, - }, { relations: ['user1', 'user2'] }); - this.cacheGame(game); - - const packed = await this.reversiGameEntityService.packDetail(game); - this.globalEventService.publishReversiStream(parentId, 'matched', { game: packed }); - - return game; - } - - @bindThis - private async startGame(game: MiReversiGame) { - let bw: number; - if (game.bw === 'random') { - bw = Math.random() > 0.5 ? 1 : 2; - } else { - bw = parseInt(game.bw, 10); - } - - const engine = new Reversi.Game(game.map, { - isLlotheo: game.isLlotheo, - canPutEverywhere: game.canPutEverywhere, - loopedBoard: game.loopedBoard, - }); - - const crc32 = engine.calcCrc32().toString(); - - const updatedGame = await this.reversiGamesRepository.createQueryBuilder().update() - .set({ - ...this.getBakeProps(game), - startedAt: new Date(), - isStarted: true, - black: bw, - map: game.map, - crc32, - }) - .where('id = :id', { id: game.id }) - .returning('*') - .execute() - .then((response) => response.raw[0]); - // キャッシュ効率化のためにユーザー情報は再利用 - updatedGame.user1 = game.user1; - updatedGame.user2 = game.user2; - this.cacheGame(updatedGame); - - //#region 盤面に最初から石がないなどして始まった瞬間に勝敗が決定する場合があるのでその処理 - if (engine.isEnded) { - let winnerId; - if (engine.winner === true) { - winnerId = bw === 1 ? updatedGame.user1Id : updatedGame.user2Id; - } else if (engine.winner === false) { - winnerId = bw === 1 ? updatedGame.user2Id : updatedGame.user1Id; - } else { - winnerId = null; - } - - await this.endGame(updatedGame, winnerId, null); - - return; - } - //#endregion - - this.redisClient.setex(`reversi:game:turnTimer:${game.id}:1`, updatedGame.timeLimitForEachTurn, ''); - - this.globalEventService.publishReversiGameStream(game.id, 'started', { - game: await this.reversiGameEntityService.packDetail(updatedGame), - }); - } - - @bindThis - private async endGame(game: MiReversiGame, winnerId: MiUser['id'] | null, reason: 'surrender' | 'timeout' | null) { - const updatedGame = await this.reversiGamesRepository.createQueryBuilder().update() - .set({ - ...this.getBakeProps(game), - isEnded: true, - endedAt: new Date(), - winnerId: winnerId, - surrenderedUserId: reason === 'surrender' ? (winnerId === game.user1Id ? game.user2Id : game.user1Id) : null, - timeoutUserId: reason === 'timeout' ? (winnerId === game.user1Id ? game.user2Id : game.user1Id) : null, - }) - .where('id = :id', { id: game.id }) - .returning('*') - .execute() - .then((response) => response.raw[0]); - // キャッシュ効率化のためにユーザー情報は再利用 - updatedGame.user1 = game.user1; - updatedGame.user2 = game.user2; - this.cacheGame(updatedGame); - - this.globalEventService.publishReversiGameStream(game.id, 'ended', { - winnerId: winnerId, - game: await this.reversiGameEntityService.packDetail(updatedGame), - }); - } - - @bindThis - public async getInvitations(user: MiUser): Promise { - const invitations = await this.redisClient.zrange( - `reversi:matchSpecific:${user.id}`, - Date.now() - INVITATION_TIMEOUT_MS, - '+inf', - 'BYSCORE'); - return invitations; - } - - @bindThis - public isValidReversiUpdateKey(key: unknown): key is typeof reversiUpdateKeys[number] { - if (typeof key !== 'string') return false; - return (reversiUpdateKeys as string[]).includes(key); - } - - @bindThis - public isValidReversiUpdateValue(key: K, value: unknown): value is MiReversiGame[K] { - switch (key) { - case 'map': - return Array.isArray(value) && value.every(row => typeof row === 'string'); - case 'bw': - return typeof value === 'string' && ['random', '1', '2'].includes(value); - case 'isLlotheo': - return typeof value === 'boolean'; - case 'canPutEverywhere': - return typeof value === 'boolean'; - case 'loopedBoard': - return typeof value === 'boolean'; - case 'timeLimitForEachTurn': - return typeof value === 'number' && value >= 0; - default: - return false; - } - } - - @bindThis - public async updateSettings(gameId: MiReversiGame['id'], user: MiUser, key: K, value: MiReversiGame[K]) { - const game = await this.get(gameId); - if (game == null) throw new Error('game not found'); - if (game.isStarted) return; - if ((game.user1Id !== user.id) && (game.user2Id !== user.id)) return; - if ((game.user1Id === user.id) && game.user1Ready) return; - if ((game.user2Id === user.id) && game.user2Ready) return; - - const updatedGame = { - ...game, - [key]: value, - }; - this.cacheGame(updatedGame); - - this.globalEventService.publishReversiGameStream(game.id, 'updateSettings', { - userId: user.id, - key: key, - value: value, - }); - } - - @bindThis - public async putStoneToGame(gameId: MiReversiGame['id'], user: MiUser, pos: number, id?: string | null) { - const game = await this.get(gameId); - if (game == null) throw new Error('game not found'); - if (!game.isStarted) return; - if (game.isEnded) return; - if ((game.user1Id !== user.id) && (game.user2Id !== user.id)) return; - - const myColor = - ((game.user1Id === user.id) && game.black === 1) || ((game.user2Id === user.id) && game.black === 2) - ? true - : false; - - const engine = Reversi.Serializer.restoreGame({ - map: game.map, - isLlotheo: game.isLlotheo, - canPutEverywhere: game.canPutEverywhere, - loopedBoard: game.loopedBoard, - logs: game.logs, - }); - - if (engine.turn !== myColor) return; - if (!engine.canPut(myColor, pos)) return; - - engine.putStone(pos); - - const logs = Reversi.Serializer.deserializeLogs(game.logs); - - const log = { - time: Date.now(), - player: myColor, - operation: 'put', - pos, - } as const; - - logs.push(log); - - const serializeLogs = Reversi.Serializer.serializeLogs(logs); - - const crc32 = engine.calcCrc32().toString(); - - const updatedGame = { - ...game, - crc32, - logs: serializeLogs, - }; - this.cacheGame(updatedGame); - - this.globalEventService.publishReversiGameStream(game.id, 'log', { - ...log, - id: id ?? null, - }); - - if (engine.isEnded) { - let winnerId; - if (engine.winner === true) { - winnerId = game.black === 1 ? game.user1Id : game.user2Id; - } else if (engine.winner === false) { - winnerId = game.black === 1 ? game.user2Id : game.user1Id; - } else { - winnerId = null; - } - - await this.endGame(updatedGame, winnerId, null); - } else { - this.redisClient.setex(`reversi:game:turnTimer:${game.id}:${engine.turn ? '1' : '0'}`, updatedGame.timeLimitForEachTurn, ''); - } - } - - @bindThis - public async surrender(gameId: MiReversiGame['id'], user: MiUser) { - const game = await this.get(gameId); - if (game == null) throw new Error('game not found'); - if (game.isEnded) return; - if ((game.user1Id !== user.id) && (game.user2Id !== user.id)) return; - - const winnerId = game.user1Id === user.id ? game.user2Id : game.user1Id; - - await this.endGame(game, winnerId, 'surrender'); - } - - @bindThis - public async checkTimeout(gameId: MiReversiGame['id']) { - const game = await this.get(gameId); - if (game == null) throw new Error('game not found'); - if (game.isEnded) return; - - const engine = Reversi.Serializer.restoreGame({ - map: game.map, - isLlotheo: game.isLlotheo, - canPutEverywhere: game.canPutEverywhere, - loopedBoard: game.loopedBoard, - logs: game.logs, - }); - - if (engine.turn == null) return; - - const timer = await this.redisClient.exists(`reversi:game:turnTimer:${game.id}:${engine.turn ? '1' : '0'}`); - - if (timer === 0) { - const winnerId = engine.turn ? (game.black === 1 ? game.user2Id : game.user1Id) : (game.black === 1 ? game.user1Id : game.user2Id); - - await this.endGame(game, winnerId, 'timeout'); - } - } - - @bindThis - public async cancelGame(gameId: MiReversiGame['id'], user: MiUser) { - const game = await this.get(gameId); - if (game == null) throw new Error('game not found'); - if (game.isStarted) return; - if ((game.user1Id !== user.id) && (game.user2Id !== user.id)) return; - - await this.reversiGamesRepository.delete(game.id); - this.deleteGameCache(game.id); - - this.globalEventService.publishReversiGameStream(game.id, 'canceled', { - userId: user.id, - }); - } - - @bindThis - public async get(id: MiReversiGame['id']): Promise { - const cached = await this.redisClient.get(`reversi:game:cache:${id}`); - if (cached != null) { - // TODO: この辺りのデシリアライズ処理をどこか別のサービスに切り出したい - const parsed = JSON.parse(cached) as Serialized; - return { - ...parsed, - startedAt: parsed.startedAt != null ? new Date(parsed.startedAt) : null, - endedAt: parsed.endedAt != null ? new Date(parsed.endedAt) : null, - user1: parsed.user1 != null ? { - ...parsed.user1, - avatar: null, - banner: null, - updatedAt: parsed.user1.updatedAt != null ? new Date(parsed.user1.updatedAt) : null, - lastActiveDate: parsed.user1.lastActiveDate != null ? new Date(parsed.user1.lastActiveDate) : null, - lastFetchedAt: parsed.user1.lastFetchedAt != null ? new Date(parsed.user1.lastFetchedAt) : null, - movedAt: parsed.user1.movedAt != null ? new Date(parsed.user1.movedAt) : null, - } : null, - user2: parsed.user2 != null ? { - ...parsed.user2, - avatar: null, - banner: null, - updatedAt: parsed.user2.updatedAt != null ? new Date(parsed.user2.updatedAt) : null, - lastActiveDate: parsed.user2.lastActiveDate != null ? new Date(parsed.user2.lastActiveDate) : null, - lastFetchedAt: parsed.user2.lastFetchedAt != null ? new Date(parsed.user2.lastFetchedAt) : null, - movedAt: parsed.user2.movedAt != null ? new Date(parsed.user2.movedAt) : null, - } : null, - }; - } else { - const game = await this.reversiGamesRepository.findOne({ - where: { id }, - relations: ['user1', 'user2'], - }); - if (game == null) return null; - - this.cacheGame(game); - - return game; - } - } - - @bindThis - public async checkCrc(gameId: MiReversiGame['id'], crc32: string | number) { - const game = await this.get(gameId); - if (game == null) throw new Error('game not found'); - - if (crc32.toString() !== game.crc32) { - return game; - } else { - return null; - } - } - - @bindThis - public dispose(): void { - } - - @bindThis - public onApplicationShutdown(signal?: string | undefined): void { - this.dispose(); - } -} diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts index 5af6b05942..d354faa7c2 100644 --- a/packages/backend/src/core/RoleService.ts +++ b/packages/backend/src/core/RoleService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,7 +8,6 @@ import * as Redis from 'ioredis'; import { In } from 'typeorm'; import { ModuleRef } from '@nestjs/core'; import type { - MiMeta, MiRole, MiRoleAssignment, RoleAssignmentsRepository, @@ -19,6 +18,7 @@ import { MemoryKVCache, MemorySingleCache } from '@/misc/cache.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/Role.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; @@ -35,7 +35,6 @@ export type RolePolicies = { gtlAvailable: boolean; ltlAvailable: boolean; canPublicNote: boolean; - mentionLimit: number; canInvite: boolean; inviteLimit: number; inviteLimitCycle: number; @@ -47,7 +46,6 @@ export type RolePolicies = { canHideAds: boolean; driveCapacityMb: number; alwaysMarkNsfw: boolean; - canUpdateBioMedia: boolean; pinLimit: number; antennaLimit: number; wordMuteLimit: number; @@ -58,18 +56,12 @@ export type RolePolicies = { userEachUserListsLimit: number; rateLimitFactor: number; avatarDecorationLimit: number; - canImportAntennas: boolean; - canImportBlocking: boolean; - canImportFollowing: boolean; - canImportMuting: boolean; - canImportUserLists: boolean; }; export const DEFAULT_POLICIES: RolePolicies = { gtlAvailable: true, ltlAvailable: true, canPublicNote: true, - mentionLimit: 20, canInvite: false, inviteLimit: 0, inviteLimitCycle: 60 * 24 * 7, @@ -81,7 +73,6 @@ export const DEFAULT_POLICIES: RolePolicies = { canHideAds: false, driveCapacityMb: 100, alwaysMarkNsfw: false, - canUpdateBioMedia: true, pinLimit: 5, antennaLimit: 5, wordMuteLimit: 200, @@ -92,16 +83,10 @@ export const DEFAULT_POLICIES: RolePolicies = { userEachUserListsLimit: 50, rateLimitFactor: 1, avatarDecorationLimit: 1, - canImportAntennas: true, - canImportBlocking: true, - canImportFollowing: true, - canImportMuting: true, - canImportUserLists: true, }; @Injectable() export class RoleService implements OnApplicationShutdown, OnModuleInit { - private rootUserIdCache: MemorySingleCache; private rolesCache: MemorySingleCache; private roleAssignmentByUserIdCache: MemoryKVCache; private notificationService: NotificationService; @@ -112,8 +97,8 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { constructor( private moduleRef: ModuleRef, - @Inject(DI.meta) - private meta: MiMeta, + @Inject(DI.redis) + private redisClient: Redis.Redis, @Inject(DI.redisForTimelines) private redisForTimelines: Redis.Redis, @@ -130,6 +115,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { @Inject(DI.roleAssignmentsRepository) private roleAssignmentsRepository: RoleAssignmentsRepository, + private metaService: MetaService, private cacheService: CacheService, private userEntityService: UserEntityService, private globalEventService: GlobalEventService, @@ -137,9 +123,10 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { private moderationLogService: ModerationLogService, private fanoutTimelineService: FanoutTimelineService, ) { - this.rootUserIdCache = new MemorySingleCache(1000 * 60 * 60 * 24 * 7); // 1week. rootユーザのIDは不変なので長めに - this.rolesCache = new MemorySingleCache(1000 * 60 * 60); // 1h - this.roleAssignmentByUserIdCache = new MemoryKVCache(1000 * 60 * 5); // 5m + //this.onMessage = this.onMessage.bind(this); + + this.rolesCache = new MemorySingleCache(1000 * 60 * 60 * 1); + this.roleAssignmentByUserIdCache = new MemoryKVCache(1000 * 60 * 60 * 1); this.redisForSub.on('message', this.onMessage); } @@ -190,11 +177,9 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { case 'userRoleAssigned': { const cached = this.roleAssignmentByUserIdCache.get(body.userId); if (cached) { - cached.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい + cached.push({ ...body, expiresAt: body.expiresAt ? new Date(body.expiresAt) : null, - user: null, // joinなカラムは通常取ってこないので - role: null, // joinなカラムは通常取ってこないので }); } break; @@ -213,82 +198,45 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { } @bindThis - private evalCond(user: MiUser, roles: MiRole[], value: RoleCondFormulaValue): boolean { + private evalCond(user: MiUser, value: RoleCondFormulaValue): boolean { try { switch (value.type) { - // ~かつ~ case 'and': { - return value.values.every(v => this.evalCond(user, roles, v)); + return value.values.every(v => this.evalCond(user, v)); } - // ~または~ case 'or': { - return value.values.some(v => this.evalCond(user, roles, v)); + return value.values.some(v => this.evalCond(user, v)); } - // ~ではない case 'not': { - return !this.evalCond(user, roles, value.value); + return !this.evalCond(user, value.value); } - // マニュアルロールがアサインされている - case 'roleAssignedTo': { - return roles.some(r => r.id === value.roleId); - } - // ローカルユーザのみ case 'isLocal': { return this.userEntityService.isLocalUser(user); } - // リモートユーザのみ case 'isRemote': { return this.userEntityService.isRemoteUser(user); } - // サスペンド済みユーザである - case 'isSuspended': { - return user.isSuspended; - } - // 鍵アカウントユーザである - case 'isLocked': { - return user.isLocked; - } - // botユーザである - case 'isBot': { - return user.isBot; - } - // 猫である - case 'isCat': { - return user.isCat; - } - // 「ユーザを見つけやすくする」が有効なアカウント - case 'isExplorable': { - return user.isExplorable; - } - // ユーザが作成されてから指定期間経過した case 'createdLessThan': { return this.idService.parse(user.id).date.getTime() > (Date.now() - (value.sec * 1000)); } - // ユーザが作成されてから指定期間経っていない case 'createdMoreThan': { return this.idService.parse(user.id).date.getTime() < (Date.now() - (value.sec * 1000)); } - // フォロワー数が指定値以下 case 'followersLessThanOrEq': { return user.followersCount <= value.value; } - // フォロワー数が指定値以上 case 'followersMoreThanOrEq': { return user.followersCount >= value.value; } - // フォロー数が指定値以下 case 'followingLessThanOrEq': { return user.followingCount <= value.value; } - // フォロー数が指定値以上 case 'followingMoreThanOrEq': { return user.followingCount >= value.value; } - // ノート数が指定値以下 case 'notesLessThanOrEq': { return user.notesCount <= value.value; } - // ノート数が指定値以上 case 'notesMoreThanOrEq': { return user.notesCount >= value.value; } @@ -322,7 +270,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { const assigns = await this.getUserAssigns(userId); const assignedRoles = roles.filter(r => assigns.map(x => x.roleId).includes(r.id)); const user = roles.some(r => r.target === 'conditional') ? await this.cacheService.findUserById(userId) : null; - const matchedCondRoles = roles.filter(r => r.target === 'conditional' && this.evalCond(user!, assignedRoles, r.condFormula)); + const matchedCondRoles = roles.filter(r => r.target === 'conditional' && this.evalCond(user!, r.condFormula)); return [...assignedRoles, ...matchedCondRoles]; } @@ -335,13 +283,13 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { let assigns = await this.roleAssignmentByUserIdCache.fetch(userId, () => this.roleAssignmentsRepository.findBy({ userId })); // 期限切れのロールを除外 assigns = assigns.filter(a => a.expiresAt == null || (a.expiresAt.getTime() > now)); + const assignedRoleIds = assigns.map(x => x.roleId); const roles = await this.rolesCache.fetch(() => this.rolesRepository.findBy({})); - const assignedRoles = roles.filter(r => assigns.map(x => x.roleId).includes(r.id)); - const assignedBadgeRoles = assignedRoles.filter(r => r.asBadge); + const assignedBadgeRoles = roles.filter(r => r.asBadge && assignedRoleIds.includes(r.id)); const badgeCondRoles = roles.filter(r => r.asBadge && (r.target === 'conditional')); if (badgeCondRoles.length > 0) { const user = roles.some(r => r.target === 'conditional') ? await this.cacheService.findUserById(userId) : null; - const matchedBadgeCondRoles = badgeCondRoles.filter(r => this.evalCond(user!, assignedRoles, r.condFormula)); + const matchedBadgeCondRoles = badgeCondRoles.filter(r => this.evalCond(user!, r.condFormula)); return [...assignedBadgeRoles, ...matchedBadgeCondRoles]; } else { return assignedBadgeRoles; @@ -350,7 +298,8 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { @bindThis public async getUserPolicies(userId: MiUser['id'] | null): Promise { - const basePolicies = { ...DEFAULT_POLICIES, ...this.meta.policies }; + const meta = await this.metaService.fetch(); + const basePolicies = { ...DEFAULT_POLICIES, ...meta.policies }; if (userId == null) return basePolicies; @@ -374,7 +323,6 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { gtlAvailable: calc('gtlAvailable', vs => vs.some(v => v === true)), ltlAvailable: calc('ltlAvailable', vs => vs.some(v => v === true)), canPublicNote: calc('canPublicNote', vs => vs.some(v => v === true)), - mentionLimit: calc('mentionLimit', vs => Math.max(...vs)), canInvite: calc('canInvite', vs => vs.some(v => v === true)), inviteLimit: calc('inviteLimit', vs => Math.max(...vs)), inviteLimitCycle: calc('inviteLimitCycle', vs => Math.max(...vs)), @@ -386,7 +334,6 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { canHideAds: calc('canHideAds', vs => vs.some(v => v === true)), driveCapacityMb: calc('driveCapacityMb', vs => Math.max(...vs)), alwaysMarkNsfw: calc('alwaysMarkNsfw', vs => vs.some(v => v === true)), - canUpdateBioMedia: calc('canUpdateBioMedia', vs => vs.some(v => v === true)), pinLimit: calc('pinLimit', vs => Math.max(...vs)), antennaLimit: calc('antennaLimit', vs => Math.max(...vs)), wordMuteLimit: calc('wordMuteLimit', vs => Math.max(...vs)), @@ -397,11 +344,6 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { userEachUserListsLimit: calc('userEachUserListsLimit', vs => Math.max(...vs)), rateLimitFactor: calc('rateLimitFactor', vs => Math.max(...vs)), avatarDecorationLimit: calc('avatarDecorationLimit', vs => Math.max(...vs)), - canImportAntennas: calc('canImportAntennas', vs => vs.some(v => v === true)), - canImportBlocking: calc('canImportBlocking', vs => vs.some(v => v === true)), - canImportFollowing: calc('canImportFollowing', vs => vs.some(v => v === true)), - canImportMuting: calc('canImportMuting', vs => vs.some(v => v === true)), - canImportUserLists: calc('canImportUserLists', vs => vs.some(v => v === true)), }; } @@ -418,78 +360,31 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { } @bindThis - public async isExplorable(role: { id: MiRole['id'] } | null): Promise { + public async isExplorable(role: { id: MiRole['id']} | null): Promise { if (role == null) return false; const check = await this.rolesRepository.findOneBy({ id: role.id }); if (check == null) return false; return check.isExplorable; } - /** - * モデレーター権限のロールが割り当てられているユーザID一覧を取得する. - * - * @param opts.includeAdmins 管理者権限も含めるか(デフォルト: true) - * @param opts.includeRoot rootユーザも含めるか(デフォルト: false) - * @param opts.excludeExpire 期限切れのロールを除外するか(デフォルト: false) - */ @bindThis - public async getModeratorIds(opts?: { - includeAdmins?: boolean, - includeRoot?: boolean, - excludeExpire?: boolean, - }): Promise { - const includeAdmins = opts?.includeAdmins ?? true; - const includeRoot = opts?.includeRoot ?? false; - const excludeExpire = opts?.excludeExpire ?? false; - + public async getModeratorIds(includeAdmins = true): Promise { const roles = await this.rolesCache.fetch(() => this.rolesRepository.findBy({})); - const moderatorRoles = includeAdmins - ? roles.filter(r => r.isModerator || r.isAdministrator) - : roles.filter(r => r.isModerator); - - const assigns = moderatorRoles.length > 0 - ? await this.roleAssignmentsRepository.findBy({ roleId: In(moderatorRoles.map(r => r.id)) }) - : []; - - // Setを経由して重複を除去(ユーザIDは重複する可能性があるので) - const now = Date.now(); - const resultSet = new Set( - assigns - .filter(it => - (excludeExpire) - ? (it.expiresAt == null || it.expiresAt.getTime() > now) - : true, - ) - .map(a => a.userId), - ); - - if (includeRoot) { - const rootUserId = await this.rootUserIdCache.fetch(async () => { - const it = await this.usersRepository.createQueryBuilder('users') - .select('id') - .where({ isRoot: true }) - .getRawOne<{ id: string }>(); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - return it!.id; - }); - resultSet.add(rootUserId); - } - - return [...resultSet].sort((x, y) => x.localeCompare(y)); + const moderatorRoles = includeAdmins ? roles.filter(r => r.isModerator || r.isAdministrator) : roles.filter(r => r.isModerator); + const assigns = moderatorRoles.length > 0 ? await this.roleAssignmentsRepository.findBy({ + roleId: In(moderatorRoles.map(r => r.id)), + }) : []; + // TODO: isRootなアカウントも含める + return assigns.map(a => a.userId); } @bindThis - public async getModerators(opts?: { - includeAdmins?: boolean, - includeRoot?: boolean, - excludeExpire?: boolean, - }): Promise { - const ids = await this.getModeratorIds(opts); - return ids.length > 0 - ? await this.usersRepository.findBy({ - id: In(ids), - }) - : []; + public async getModerators(includeAdmins = true): Promise { + const ids = await this.getModeratorIds(includeAdmins); + const users = ids.length > 0 ? await this.usersRepository.findBy({ + id: In(ids), + }) : []; + return users; } @bindThis @@ -534,12 +429,12 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { } } - const created = await this.roleAssignmentsRepository.insertOne({ + const created = await this.roleAssignmentsRepository.insert({ id: this.idService.gen(now), expiresAt: expiresAt, roleId: roleId, userId: userId, - }); + }).then(x => this.roleAssignmentsRepository.findOneByOrFail(x.identifiers[0])); this.rolesRepository.update(roleId, { lastUsedAt: new Date(), @@ -547,15 +442,14 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { this.globalEventService.publishInternalEvent('userRoleAssigned', created); - const user = await this.usersRepository.findOneByOrFail({ id: userId }); - - if (role.isPublic && user.host === null) { + if (role.isPublic) { this.notificationService.createNotification(userId, 'roleAssigned', { roleId: roleId, }); } if (moderator) { + const user = await this.usersRepository.findOneByOrFail({ id: userId }); this.moderationLogService.log(moderator, 'assignRole', { roleId: roleId, roleName: role.name, @@ -622,7 +516,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { @bindThis public async create(values: Partial, moderator?: MiUser): Promise { const date = new Date(); - const created = await this.rolesRepository.insertOne({ + const created = await this.rolesRepository.insert({ id: this.idService.gen(date.getTime()), updatedAt: date, lastUsedAt: date, @@ -640,7 +534,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit { canEditMembersByModerator: values.canEditMembersByModerator, displayOrder: values.displayOrder, policies: values.policies, - }); + }).then(x => this.rolesRepository.findOneByOrFail(x.identifiers[0])); this.globalEventService.publishInternalEvent('roleCreated', created); diff --git a/packages/backend/src/core/S3Service.ts b/packages/backend/src/core/S3Service.ts index bb2a463354..df0991539d 100644 --- a/packages/backend/src/core/S3Service.ts +++ b/packages/backend/src/core/S3Service.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/SearchService.ts b/packages/backend/src/core/SearchService.ts index edfc470375..a46d68fd84 100644 --- a/packages/backend/src/core/SearchService.ts +++ b/packages/backend/src/core/SearchService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/SignupService.ts b/packages/backend/src/core/SignupService.ts index 3865392b7f..b9e3ded46f 100644 --- a/packages/backend/src/core/SignupService.ts +++ b/packages/backend/src/core/SignupService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,7 +8,7 @@ import { Inject, Injectable } from '@nestjs/common'; import bcrypt from 'bcryptjs'; import { DataSource, IsNull } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { MiMeta, UsedUsernamesRepository, UsersRepository } from '@/models/_.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'; @@ -16,11 +16,10 @@ 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 { InstanceActorService } from '@/core/InstanceActorService.js'; import { bindThis } from '@/decorators.js'; import UsersChart from '@/core/chart/charts/users.js'; import { UtilityService } from '@/core/UtilityService.js'; -import { UserService } from '@/core/UserService.js'; +import { MetaService } from '@/core/MetaService.js'; @Injectable() export class SignupService { @@ -28,9 +27,6 @@ export class SignupService { @Inject(DI.db) private db: DataSource, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -38,10 +34,9 @@ export class SignupService { private usedUsernamesRepository: UsedUsernamesRepository, private utilityService: UtilityService, - private userService: UserService, private userEntityService: UserEntityService, private idService: IdService, - private instanceActorService: InstanceActorService, + private metaService: MetaService, private usersChart: UsersChart, ) { } @@ -77,19 +72,20 @@ export class SignupService { const secret = generateUserToken(); // Check username duplication - if (await this.usersRepository.exists({ where: { usernameLower: username.toLowerCase(), host: IsNull() } })) { + if (await this.usersRepository.exist({ where: { usernameLower: username.toLowerCase(), host: IsNull() } })) { throw new Error('DUPLICATED_USERNAME'); } // Check deleted username duplication - if (await this.usedUsernamesRepository.exists({ where: { username: username.toLowerCase() } })) { + if (await this.usedUsernamesRepository.exist({ where: { username: username.toLowerCase() } })) { throw new Error('USED_USERNAME'); } - const isTheFirstUser = !await this.instanceActorService.realLocalUsersPresent(); + const isTheFirstUser = (await this.usersRepository.countBy({ host: IsNull() })) === 0; if (!opts.ignorePreservedUsernames && !isTheFirstUser) { - const isPreserved = this.meta.preservedUsernames.map(x => x.toLowerCase()).includes(username.toLowerCase()); + const instance = await this.metaService.fetch(true); + const isPreserved = instance.preservedUsernames.map(x => x.toLowerCase()).includes(username.toLowerCase()); if (isPreserved) { throw new Error('USED_USERNAME'); } @@ -151,7 +147,6 @@ export class SignupService { }); this.usersChart.update(account, true); - this.userService.notifySystemWebhook(account, 'userCreated'); return { account, secret }; } diff --git a/packages/backend/src/core/SystemWebhookService.ts b/packages/backend/src/core/SystemWebhookService.ts deleted file mode 100644 index db6407dcb3..0000000000 --- a/packages/backend/src/core/SystemWebhookService.ts +++ /dev/null @@ -1,235 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import * as Redis from 'ioredis'; -import type { MiUser, SystemWebhooksRepository } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; -import { bindThis } from '@/decorators.js'; -import { GlobalEvents, GlobalEventService } from '@/core/GlobalEventService.js'; -import { MiSystemWebhook, type SystemWebhookEventType } from '@/models/SystemWebhook.js'; -import { IdService } from '@/core/IdService.js'; -import { QueueService } from '@/core/QueueService.js'; -import { ModerationLogService } from '@/core/ModerationLogService.js'; -import { LoggerService } from '@/core/LoggerService.js'; -import Logger from '@/logger.js'; -import type { OnApplicationShutdown } from '@nestjs/common'; - -@Injectable() -export class SystemWebhookService implements OnApplicationShutdown { - private logger: Logger; - private activeSystemWebhooksFetched = false; - private activeSystemWebhooks: MiSystemWebhook[] = []; - - constructor( - @Inject(DI.redisForSub) - private redisForSub: Redis.Redis, - @Inject(DI.systemWebhooksRepository) - private systemWebhooksRepository: SystemWebhooksRepository, - private idService: IdService, - private queueService: QueueService, - private moderationLogService: ModerationLogService, - private loggerService: LoggerService, - private globalEventService: GlobalEventService, - ) { - this.redisForSub.on('message', this.onMessage); - this.logger = this.loggerService.getLogger('webhook'); - } - - @bindThis - public async fetchActiveSystemWebhooks() { - if (!this.activeSystemWebhooksFetched) { - this.activeSystemWebhooks = await this.systemWebhooksRepository.findBy({ - isActive: true, - }); - this.activeSystemWebhooksFetched = true; - } - - return this.activeSystemWebhooks; - } - - /** - * SystemWebhook の一覧を取得する. - */ - @bindThis - public fetchSystemWebhooks(params?: { - ids?: MiSystemWebhook['id'][]; - isActive?: MiSystemWebhook['isActive']; - on?: MiSystemWebhook['on']; - }): Promise { - const query = this.systemWebhooksRepository.createQueryBuilder('systemWebhook'); - if (params) { - if (params.ids && params.ids.length > 0) { - query.andWhere('systemWebhook.id IN (:...ids)', { ids: params.ids }); - } - if (params.isActive !== undefined) { - query.andWhere('systemWebhook.isActive = :isActive', { isActive: params.isActive }); - } - if (params.on && params.on.length > 0) { - query.andWhere(':on <@ systemWebhook.on', { on: params.on }); - } - } - - return query.getMany(); - } - - /** - * SystemWebhook を作成する. - */ - @bindThis - public async createSystemWebhook( - params: { - isActive: MiSystemWebhook['isActive']; - name: MiSystemWebhook['name']; - on: MiSystemWebhook['on']; - url: MiSystemWebhook['url']; - secret: MiSystemWebhook['secret']; - }, - updater: MiUser, - ): Promise { - const id = this.idService.gen(); - await this.systemWebhooksRepository.insert({ - ...params, - id, - }); - - const webhook = await this.systemWebhooksRepository.findOneByOrFail({ id }); - this.globalEventService.publishInternalEvent('systemWebhookCreated', webhook); - this.moderationLogService - .log(updater, 'createSystemWebhook', { - systemWebhookId: webhook.id, - webhook: webhook, - }); - - return webhook; - } - - /** - * SystemWebhook を更新する. - */ - @bindThis - public async updateSystemWebhook( - params: { - id: MiSystemWebhook['id']; - isActive: MiSystemWebhook['isActive']; - name: MiSystemWebhook['name']; - on: MiSystemWebhook['on']; - url: MiSystemWebhook['url']; - secret: MiSystemWebhook['secret']; - }, - updater: MiUser, - ): Promise { - const beforeEntity = await this.systemWebhooksRepository.findOneByOrFail({ id: params.id }); - await this.systemWebhooksRepository.update(beforeEntity.id, { - updatedAt: new Date(), - isActive: params.isActive, - name: params.name, - on: params.on, - url: params.url, - secret: params.secret, - }); - - const afterEntity = await this.systemWebhooksRepository.findOneByOrFail({ id: beforeEntity.id }); - this.globalEventService.publishInternalEvent('systemWebhookUpdated', afterEntity); - this.moderationLogService - .log(updater, 'updateSystemWebhook', { - systemWebhookId: beforeEntity.id, - before: beforeEntity, - after: afterEntity, - }); - - return afterEntity; - } - - /** - * SystemWebhook を削除する. - */ - @bindThis - public async deleteSystemWebhook(id: MiSystemWebhook['id'], updater: MiUser) { - const webhook = await this.systemWebhooksRepository.findOneByOrFail({ id }); - await this.systemWebhooksRepository.delete(id); - - this.globalEventService.publishInternalEvent('systemWebhookDeleted', webhook); - this.moderationLogService - .log(updater, 'deleteSystemWebhook', { - systemWebhookId: webhook.id, - webhook, - }); - } - - /** - * SystemWebhook をWebhook配送キューに追加する - * @see QueueService.systemWebhookDeliver - * // TODO: contentの型を厳格化する - */ - @bindThis - public async enqueueSystemWebhook( - webhook: MiSystemWebhook | MiSystemWebhook['id'], - type: T, - content: unknown, - ) { - const webhookEntity = typeof webhook === 'string' - ? (await this.fetchActiveSystemWebhooks()).find(a => a.id === webhook) - : webhook; - if (!webhookEntity || !webhookEntity.isActive) { - this.logger.info(`SystemWebhook is not active or not found : ${webhook}`); - return; - } - - if (!webhookEntity.on.includes(type)) { - this.logger.info(`SystemWebhook ${webhookEntity.id} is not listening to ${type}`); - return; - } - - return this.queueService.systemWebhookDeliver(webhookEntity, type, content); - } - - @bindThis - private async onMessage(_: string, data: string): Promise { - const obj = JSON.parse(data); - if (obj.channel !== 'internal') { - return; - } - - const { type, body } = obj.message as GlobalEvents['internal']['payload']; - switch (type) { - case 'systemWebhookCreated': { - if (body.isActive) { - this.activeSystemWebhooks.push(MiSystemWebhook.deserialize(body)); - } - break; - } - case 'systemWebhookUpdated': { - if (body.isActive) { - const i = this.activeSystemWebhooks.findIndex(a => a.id === body.id); - if (i > -1) { - this.activeSystemWebhooks[i] = MiSystemWebhook.deserialize(body); - } else { - this.activeSystemWebhooks.push(MiSystemWebhook.deserialize(body)); - } - } else { - this.activeSystemWebhooks = this.activeSystemWebhooks.filter(a => a.id !== body.id); - } - break; - } - case 'systemWebhookDeleted': { - this.activeSystemWebhooks = this.activeSystemWebhooks.filter(a => a.id !== body.id); - break; - } - default: - break; - } - } - - @bindThis - public dispose(): void { - this.redisForSub.off('message', this.onMessage); - } - - @bindThis - public onApplicationShutdown(signal?: string | undefined): void { - this.dispose(); - } -} diff --git a/packages/backend/src/core/UserAuthService.ts b/packages/backend/src/core/UserAuthService.ts index bdc27cbe8e..ccf4dfc6bd 100644 --- a/packages/backend/src/core/UserAuthService.ts +++ b/packages/backend/src/core/UserAuthService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/UserBlockingService.ts b/packages/backend/src/core/UserBlockingService.ts index 2f1310b8ef..39b19325c3 100644 --- a/packages/backend/src/core/UserBlockingService.ts +++ b/packages/backend/src/core/UserBlockingService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -16,7 +16,7 @@ import Logger from '@/logger.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; import { LoggerService } from '@/core/LoggerService.js'; -import { UserWebhookService } from '@/core/UserWebhookService.js'; +import { WebhookService } from '@/core/WebhookService.js'; import { bindThis } from '@/decorators.js'; import { CacheService } from '@/core/CacheService.js'; import { UserFollowingService } from '@/core/UserFollowingService.js'; @@ -46,7 +46,7 @@ export class UserBlockingService implements OnModuleInit { private idService: IdService, private queueService: QueueService, private globalEventService: GlobalEventService, - private webhookService: UserWebhookService, + private webhookService: WebhookService, private apRendererService: ApRendererService, private loggerService: LoggerService, ) { @@ -109,19 +109,19 @@ export class UserBlockingService implements OnModuleInit { if (this.userEntityService.isLocalUser(followee)) { this.userEntityService.pack(followee, followee, { - schema: 'MeDetailed', + detail: true, }).then(packed => this.globalEventService.publishMainStream(followee.id, 'meUpdated', packed)); } if (this.userEntityService.isLocalUser(follower) && !silent) { this.userEntityService.pack(followee, follower, { - schema: 'UserDetailedNotMe', + detail: true, }).then(async packed => { this.globalEventService.publishMainStream(follower.id, 'unfollow', packed); const webhooks = (await this.webhookService.getActiveWebhooks()).filter(x => x.userId === follower.id && x.on.includes('unfollow')); for (const webhook of webhooks) { - this.queueService.userWebhookDeliver(webhook, 'unfollow', { + this.queueService.webhookDeliver(webhook, 'unfollow', { user: packed, }); } diff --git a/packages/backend/src/core/UserFollowingService.ts b/packages/backend/src/core/UserFollowingService.ts index 8963003057..d600ffb9d9 100644 --- a/packages/backend/src/core/UserFollowingService.ts +++ b/packages/backend/src/core/UserFollowingService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -13,21 +13,23 @@ import PerUserFollowingChart from '@/core/chart/charts/per-user-following.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { IdService } from '@/core/IdService.js'; import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js'; +import type { Packed } from '@/misc/json-schema.js'; import InstanceChart from '@/core/chart/charts/instance.js'; import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; -import { UserWebhookService } from '@/core/UserWebhookService.js'; +import { WebhookService } from '@/core/WebhookService.js'; import { NotificationService } from '@/core/NotificationService.js'; import { DI } from '@/di-symbols.js'; -import type { FollowingsRepository, FollowRequestsRepository, InstancesRepository, MiMeta, UserProfilesRepository, UsersRepository } from '@/models/_.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'; import { UserBlockingService } from '@/core/UserBlockingService.js'; +import { MetaService } from '@/core/MetaService.js'; import { CacheService } from '@/core/CacheService.js'; import type { Config } from '@/config.js'; import { AccountMoveService } from '@/core/AccountMoveService.js'; import { UtilityService } from '@/core/UtilityService.js'; -import type { ThinUser } from '@/queue/types.js'; +import { FanoutTimelineService } from '@/core/FanoutTimelineService.js'; import Logger from '../logger.js'; const logger = new Logger('following/create'); @@ -55,9 +57,6 @@ export class UserFollowingService implements OnModuleInit { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -79,11 +78,13 @@ export class UserFollowingService implements OnModuleInit { private idService: IdService, private queueService: QueueService, private globalEventService: GlobalEventService, + private metaService: MetaService, private notificationService: NotificationService, private federatedInstanceService: FederatedInstanceService, - private webhookService: UserWebhookService, + private webhookService: WebhookService, private apRendererService: ApRendererService, private accountMoveService: AccountMoveService, + private fanoutTimelineService: FanoutTimelineService, private perUserFollowingChart: PerUserFollowingChart, private instanceChart: InstanceChart, ) { @@ -93,35 +94,21 @@ export class UserFollowingService implements OnModuleInit { this.userBlockingService = this.moduleRef.get('UserBlockingService'); } - @bindThis - public async deliverAccept(follower: MiRemoteUser, followee: MiPartialLocalUser, requestId?: string) { - const content = this.apRendererService.addContext(this.apRendererService.renderAccept(this.apRendererService.renderFollow(follower, followee, requestId), followee)); - this.queueService.deliver(followee, content, follower.inbox, false); - } - @bindThis public async follow( - _follower: ThinUser, - _followee: ThinUser, + _follower: { id: MiUser['id'] }, + _followee: { id: MiUser['id'] }, { requestId, silent = false, withReplies }: { requestId?: string, silent?: boolean, withReplies?: boolean, } = {}, ): Promise { - /** - * 必ず最新のユーザー情報を取得する - */ const [follower, followee] = await Promise.all([ this.usersRepository.findOneByOrFail({ id: _follower.id }), this.usersRepository.findOneByOrFail({ id: _followee.id }), ]) as [MiLocalUser | MiRemoteUser, MiLocalUser | MiRemoteUser]; - if (this.userEntityService.isRemoteUser(follower) && this.userEntityService.isRemoteUser(followee)) { - // What? - throw new Error('Remote user cannot follow remote user.'); - } - // check blocking const [blocking, blocked] = await Promise.all([ this.userBlockingService.checkBlocked(follower.id, followee.id), @@ -142,24 +129,6 @@ export class UserFollowingService implements OnModuleInit { if (blocked) throw new IdentifiableError('3338392a-f764-498d-8855-db939dcf8c48', 'blocked'); } - if (await this.followingsRepository.exists({ - where: { - followerId: follower.id, - followeeId: followee.id, - }, - })) { - // すでにフォロー関係が存在している場合 - if (this.userEntityService.isRemoteUser(follower) && this.userEntityService.isLocalUser(followee)) { - // リモート → ローカル: acceptを送り返しておしまい - this.deliverAccept(follower, followee, requestId); - return; - } - if (this.userEntityService.isLocalUser(follower)) { - // ローカル → リモート/ローカル: 例外 - throw new IdentifiableError('ec3f65c0-a9d1-47d9-8791-b2e7b9dcdced', 'already following'); - } - } - const followeeProfile = await this.userProfilesRepository.findOneByOrFail({ userId: followee.id }); // フォロー対象が鍵アカウントである or // フォロワーがBotであり、フォロー対象がBotからのフォローに慎重である or @@ -170,12 +139,12 @@ export class UserFollowingService implements OnModuleInit { followee.isLocked || (followeeProfile.carefulBot && follower.isBot) || (this.userEntityService.isLocalUser(follower) && this.userEntityService.isRemoteUser(followee) && process.env.FORCE_FOLLOW_REMOTE_USER_FOR_TESTING !== 'true') || - (this.userEntityService.isLocalUser(followee) && this.userEntityService.isRemoteUser(follower) && this.utilityService.isSilencedHost(this.meta.silencedHosts, follower.host)) + (this.userEntityService.isLocalUser(followee) && this.userEntityService.isRemoteUser(follower) && this.utilityService.isSilencedHost((await this.metaService.fetch()).silencedHosts, follower.host)) ) { let autoAccept = false; // 鍵アカウントであっても、既にフォローされていた場合はスルー - const isFollowing = await this.followingsRepository.exists({ + const isFollowing = await this.followingsRepository.exist({ where: { followerId: follower.id, followeeId: followee.id, @@ -187,7 +156,7 @@ export class UserFollowingService implements OnModuleInit { // フォローしているユーザーは自動承認オプション if (!autoAccept && (this.userEntityService.isLocalUser(followee) && followeeProfile.autoAcceptFollowed)) { - const isFollowed = await this.followingsRepository.exists({ + const isFollowed = await this.followingsRepository.exist({ where: { followerId: followee.id, followeeId: follower.id, @@ -201,7 +170,7 @@ export class UserFollowingService implements OnModuleInit { if (followee.isLocked && !autoAccept) { autoAccept = !!(await this.accountMoveService.validateAlsoKnownAs( follower, - (oldSrc, newSrc) => this.followingsRepository.exists({ + (oldSrc, newSrc) => this.followingsRepository.exist({ where: { followeeId: followee.id, followerId: newSrc.id, @@ -220,7 +189,8 @@ export class UserFollowingService implements OnModuleInit { await this.insertFollowingDoc(followee, follower, silent, withReplies); if (this.userEntityService.isRemoteUser(follower) && this.userEntityService.isLocalUser(followee)) { - this.deliverAccept(follower, followee, requestId); + const content = this.apRendererService.addContext(this.apRendererService.renderAccept(this.apRendererService.renderFollow(follower, followee, requestId), followee)); + this.queueService.deliver(followee, content, follower.inbox, false); } } @@ -263,7 +233,7 @@ export class UserFollowingService implements OnModuleInit { this.cacheService.userFollowingsCache.refresh(follower.id); - const requestExist = await this.followRequestsRepository.exists({ + const requestExist = await this.followRequestsRepository.exist({ where: { followeeId: followee.id, followerId: follower.id, @@ -275,19 +245,14 @@ export class UserFollowingService implements OnModuleInit { followeeId: followee.id, followerId: follower.id, }); + + // 通知を作成 + this.notificationService.createNotification(follower.id, 'followRequestAccepted', { + }, followee.id); } if (alreadyFollowed) return; - // 通知を作成 - if (follower.host === null) { - const profile = await this.cacheService.userProfileCache.fetch(followee.id); - - this.notificationService.createNotification(follower.id, 'followRequestAccepted', { - message: profile.followedMessage, - }, followee.id); - } - this.globalEventService.publishInternalEvent('follow', { followerId: follower.id, followeeId: followee.id }); const [followeeUser, followerUser] = await Promise.all([ @@ -305,22 +270,20 @@ export class UserFollowingService implements OnModuleInit { //#endregion //#region Update instance stats - if (this.meta.enableStatsForFederatedInstances) { - if (this.userEntityService.isRemoteUser(follower) && this.userEntityService.isLocalUser(followee)) { - this.federatedInstanceService.fetchOrRegister(follower.host).then(async i => { - this.instancesRepository.increment({ id: i.id }, 'followingCount', 1); - if (this.meta.enableChartsForFederatedInstances) { - this.instanceChart.updateFollowing(i.host, true); - } - }); - } else if (this.userEntityService.isLocalUser(follower) && this.userEntityService.isRemoteUser(followee)) { - this.federatedInstanceService.fetchOrRegister(followee.host).then(async i => { - this.instancesRepository.increment({ id: i.id }, 'followersCount', 1); - if (this.meta.enableChartsForFederatedInstances) { - this.instanceChart.updateFollowers(i.host, true); - } - }); - } + if (this.userEntityService.isRemoteUser(follower) && this.userEntityService.isLocalUser(followee)) { + this.federatedInstanceService.fetch(follower.host).then(async i => { + this.instancesRepository.increment({ id: i.id }, 'followingCount', 1); + if ((await this.metaService.fetch()).enableChartsForFederatedInstances) { + this.instanceChart.updateFollowing(i.host, true); + } + }); + } else if (this.userEntityService.isLocalUser(follower) && this.userEntityService.isRemoteUser(followee)) { + this.federatedInstanceService.fetch(followee.host).then(async i => { + this.instancesRepository.increment({ id: i.id }, 'followersCount', 1); + if ((await this.metaService.fetch()).enableChartsForFederatedInstances) { + this.instanceChart.updateFollowers(i.host, true); + } + }); } //#endregion @@ -330,13 +293,13 @@ export class UserFollowingService implements OnModuleInit { if (this.userEntityService.isLocalUser(follower) && !silent) { // Publish follow event this.userEntityService.pack(followee.id, follower, { - schema: 'UserDetailedNotMe', + detail: true, }).then(async packed => { - this.globalEventService.publishMainStream(follower.id, 'follow', packed); + this.globalEventService.publishMainStream(follower.id, 'follow', packed as Packed<'UserDetailedNotMe'>); const webhooks = (await this.webhookService.getActiveWebhooks()).filter(x => x.userId === follower.id && x.on.includes('follow')); for (const webhook of webhooks) { - this.queueService.userWebhookDeliver(webhook, 'follow', { + this.queueService.webhookDeliver(webhook, 'follow', { user: packed, }); } @@ -350,7 +313,7 @@ export class UserFollowingService implements OnModuleInit { const webhooks = (await this.webhookService.getActiveWebhooks()).filter(x => x.userId === followee.id && x.on.includes('followed')); for (const webhook of webhooks) { - this.queueService.userWebhookDeliver(webhook, 'followed', { + this.queueService.webhookDeliver(webhook, 'followed', { user: packed, }); } @@ -397,13 +360,13 @@ export class UserFollowingService implements OnModuleInit { if (!silent && this.userEntityService.isLocalUser(follower)) { // Publish unfollow event this.userEntityService.pack(followee.id, follower, { - schema: 'UserDetailedNotMe', + detail: true, }).then(async packed => { this.globalEventService.publishMainStream(follower.id, 'unfollow', packed); const webhooks = (await this.webhookService.getActiveWebhooks()).filter(x => x.userId === follower.id && x.on.includes('unfollow')); for (const webhook of webhooks) { - this.queueService.userWebhookDeliver(webhook, 'unfollow', { + this.queueService.webhookDeliver(webhook, 'unfollow', { user: packed, }); } @@ -439,22 +402,20 @@ export class UserFollowingService implements OnModuleInit { //#endregion //#region Update instance stats - if (this.meta.enableStatsForFederatedInstances) { - if (this.userEntityService.isRemoteUser(follower) && this.userEntityService.isLocalUser(followee)) { - this.federatedInstanceService.fetchOrRegister(follower.host).then(async i => { - this.instancesRepository.decrement({ id: i.id }, 'followingCount', 1); - if (this.meta.enableChartsForFederatedInstances) { - this.instanceChart.updateFollowing(i.host, false); - } - }); - } else if (this.userEntityService.isLocalUser(follower) && this.userEntityService.isRemoteUser(followee)) { - this.federatedInstanceService.fetchOrRegister(followee.host).then(async i => { - this.instancesRepository.decrement({ id: i.id }, 'followersCount', 1); - if (this.meta.enableChartsForFederatedInstances) { - this.instanceChart.updateFollowers(i.host, false); - } - }); - } + if (this.userEntityService.isRemoteUser(follower) && this.userEntityService.isLocalUser(followee)) { + this.federatedInstanceService.fetch(follower.host).then(async i => { + this.instancesRepository.decrement({ id: i.id }, 'followingCount', 1); + if ((await this.metaService.fetch()).enableChartsForFederatedInstances) { + this.instanceChart.updateFollowing(i.host, false); + } + }); + } else if (this.userEntityService.isLocalUser(follower) && this.userEntityService.isRemoteUser(followee)) { + this.federatedInstanceService.fetch(followee.host).then(async i => { + this.instancesRepository.decrement({ id: i.id }, 'followersCount', 1); + if ((await this.metaService.fetch()).enableChartsForFederatedInstances) { + this.instanceChart.updateFollowers(i.host, false); + } + }); } //#endregion @@ -518,13 +479,7 @@ export class UserFollowingService implements OnModuleInit { if (blocking) throw new Error('blocking'); if (blocked) throw new Error('blocked'); - // Remove old follow requests before creating a new one. - await this.followRequestsRepository.delete({ - followeeId: followee.id, - followerId: follower.id, - }); - - const followRequest = await this.followRequestsRepository.insertOne({ + const followRequest = await this.followRequestsRepository.insert({ id: this.idService.gen(), followerId: follower.id, followeeId: followee.id, @@ -538,14 +493,14 @@ export class UserFollowingService implements OnModuleInit { followeeHost: followee.host, followeeInbox: this.userEntityService.isRemoteUser(followee) ? followee.inbox : undefined, followeeSharedInbox: this.userEntityService.isRemoteUser(followee) ? followee.sharedInbox : undefined, - }); + }).then(x => this.followRequestsRepository.findOneByOrFail(x.identifiers[0])); // Publish receiveRequest event if (this.userEntityService.isLocalUser(followee)) { this.userEntityService.pack(follower.id, followee).then(packed => this.globalEventService.publishMainStream(followee.id, 'receiveFollowRequest', packed)); this.userEntityService.pack(followee.id, followee, { - schema: 'MeDetailed', + detail: true, }).then(packed => this.globalEventService.publishMainStream(followee.id, 'meUpdated', packed)); // 通知を作成 @@ -576,7 +531,7 @@ export class UserFollowingService implements OnModuleInit { } } - const requestExist = await this.followRequestsRepository.exists({ + const requestExist = await this.followRequestsRepository.exist({ where: { followeeId: followee.id, followerId: follower.id, @@ -593,7 +548,7 @@ export class UserFollowingService implements OnModuleInit { }); this.userEntityService.pack(followee.id, followee, { - schema: 'MeDetailed', + detail: true, }).then(packed => this.globalEventService.publishMainStream(followee.id, 'meUpdated', packed)); } @@ -616,11 +571,12 @@ export class UserFollowingService implements OnModuleInit { await this.insertFollowingDoc(followee, follower, false, request.withReplies); if (this.userEntityService.isRemoteUser(follower) && this.userEntityService.isLocalUser(followee)) { - this.deliverAccept(follower, followee as MiPartialLocalUser, request.requestId ?? undefined); + const content = this.apRendererService.addContext(this.apRendererService.renderAccept(this.apRendererService.renderFollow(follower, followee as MiPartialLocalUser, request.requestId!), followee)); + this.queueService.deliver(followee, content, follower.inbox, false); } this.userEntityService.pack(followee.id, followee, { - schema: 'MeDetailed', + detail: true, }).then(packed => this.globalEventService.publishMainStream(followee.id, 'meUpdated', packed)); } @@ -740,14 +696,14 @@ export class UserFollowingService implements OnModuleInit { @bindThis private async publishUnfollow(followee: Both, follower: Local): Promise { const packedFollowee = await this.userEntityService.pack(followee.id, follower, { - schema: 'UserDetailedNotMe', + detail: true, }); this.globalEventService.publishMainStream(follower.id, 'unfollow', packedFollowee); const webhooks = (await this.webhookService.getActiveWebhooks()).filter(x => x.userId === follower.id && x.on.includes('unfollow')); for (const webhook of webhooks) { - this.queueService.userWebhookDeliver(webhook, 'unfollow', { + this.queueService.webhookDeliver(webhook, 'unfollow', { user: packedFollowee, }); } diff --git a/packages/backend/src/core/UserKeypairService.ts b/packages/backend/src/core/UserKeypairService.ts index 92d61cd103..425a97f3f1 100644 --- a/packages/backend/src/core/UserKeypairService.ts +++ b/packages/backend/src/core/UserKeypairService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -25,7 +25,7 @@ export class UserKeypairService implements OnApplicationShutdown { ) { this.cache = new RedisKVCache(this.redisClient, 'userKeypair', { lifetime: 1000 * 60 * 60 * 24, // 24h - memoryCacheLifetime: 1000 * 60 * 60, // 1h + memoryCacheLifetime: Infinity, fetcher: (key) => this.userKeypairsRepository.findOneByOrFail({ userId: key }), toRedisConverter: (value) => JSON.stringify(value), fromRedisConverter: (value) => JSON.parse(value), diff --git a/packages/backend/src/core/UserListService.ts b/packages/backend/src/core/UserListService.ts index 6333356fe9..b6e4e1e884 100644 --- a/packages/backend/src/core/UserListService.ts +++ b/packages/backend/src/core/UserListService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -95,7 +95,7 @@ export class UserListService implements OnApplicationShutdown, OnModuleInit { const currentCount = await this.userListMembershipsRepository.countBy({ userListId: list.id, }); - if (currentCount >= (await this.roleService.getUserPolicies(me.id)).userEachUserListsLimit) { + if (currentCount > (await this.roleService.getUserPolicies(me.id)).userEachUserListsLimit) { throw new UserListService.TooManyUsersError(); } diff --git a/packages/backend/src/core/UserMutingService.ts b/packages/backend/src/core/UserMutingService.ts index 06643be5fb..397e6bdd5d 100644 --- a/packages/backend/src/core/UserMutingService.ts +++ b/packages/backend/src/core/UserMutingService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/UserRenoteMutingService.ts b/packages/backend/src/core/UserRenoteMutingService.ts deleted file mode 100644 index bdc5e23f4b..0000000000 --- a/packages/backend/src/core/UserRenoteMutingService.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project , Type4ny-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { In } from 'typeorm'; -import type { RenoteMutingsRepository } from '@/models/_.js'; -import type { MiRenoteMuting } from '@/models/RenoteMuting.js'; - -import { IdService } from '@/core/IdService.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'; - -@Injectable() -export class UserRenoteMutingService { - constructor( - @Inject(DI.renoteMutingsRepository) - private renoteMutingsRepository: RenoteMutingsRepository, - - private idService: IdService, - private cacheService: CacheService, - ) { - } - - @bindThis - public async mute(user: MiUser, target: MiUser, expiresAt: Date | null = null): Promise { - await this.renoteMutingsRepository.insert({ - id: this.idService.gen(), - muterId: user.id, - muteeId: target.id, - }); - - await this.cacheService.renoteMutingsCache.refresh(user.id); - } - - @bindThis - public async unmute(mutings: MiRenoteMuting[]): Promise { - if (mutings.length === 0) return; - - await this.renoteMutingsRepository.delete({ - id: In(mutings.map(m => m.id)), - }); - - const muterIds = [...new Set(mutings.map(m => m.muterId))]; - for (const muterId of muterIds) { - await this.cacheService.renoteMutingsCache.refresh(muterId); - } - } -} diff --git a/packages/backend/src/core/UserSearchService.ts b/packages/backend/src/core/UserSearchService.ts deleted file mode 100644 index 0d03cf6ee0..0000000000 --- a/packages/backend/src/core/UserSearchService.ts +++ /dev/null @@ -1,205 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { Brackets, SelectQueryBuilder } from 'typeorm'; -import { DI } from '@/di-symbols.js'; -import { type FollowingsRepository, MiUser, type UsersRepository } from '@/models/_.js'; -import { bindThis } from '@/decorators.js'; -import { sqlLikeEscape } from '@/misc/sql-like-escape.js'; -import type { Config } from '@/config.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import { Packed } from '@/misc/json-schema.js'; - -function defaultActiveThreshold() { - return new Date(Date.now() - 1000 * 60 * 60 * 24 * 30); -} - -@Injectable() -export class UserSearchService { - constructor( - @Inject(DI.config) - private config: Config, - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.followingsRepository) - private followingsRepository: FollowingsRepository, - private userEntityService: UserEntityService, - ) { - } - - /** - * ユーザ名とホスト名によるユーザ検索を行う. - * - * - 検索結果には優先順位がつけられており、以下の順序で検索が行われる. - * 1. フォローしているユーザのうち、一定期間以内(※)に更新されたユーザ - * 2. フォローしているユーザのうち、一定期間以内に更新されていないユーザ - * 3. フォローしていないユーザのうち、一定期間以内に更新されたユーザ - * 4. フォローしていないユーザのうち、一定期間以内に更新されていないユーザ - * - ログインしていない場合は、以下の順序で検索が行われる. - * 1. 一定期間以内に更新されたユーザ - * 2. 一定期間以内に更新されていないユーザ - * - それぞれの検索結果はユーザ名の昇順でソートされる. - * - 動作的には先に登場した検索結果の登場位置が優先される(条件的にユーザIDが重複することはないが). - * (1で既にヒットしていた場合、2, 3, 4でヒットしても無視される) - * - ユーザ名とホスト名の検索条件はそれぞれ前方一致で検索される. - * - ユーザ名の検索は大文字小文字を区別しない. - * - ホスト名の検索は大文字小文字を区別しない. - * - 検索結果は最大で {@link opts.limit} 件までとなる. - * - * ※一定期間とは {@link params.activeThreshold} で指定された日時から現在までの期間を指す. - * - * @param params 検索条件. - * @param opts 関数の動作を制御するオプション. - * @param me 検索を実行するユーザの情報. 未ログインの場合は指定しない. - * @see {@link UserSearchService#buildSearchUserQueries} - * @see {@link UserSearchService#buildSearchUserNoLoginQueries} - */ - @bindThis - public async search( - params: { - username?: string | null, - host?: string | null, - activeThreshold?: Date, - }, - opts?: { - limit?: number, - detail?: boolean, - }, - me?: MiUser | null, - ): Promise[]> { - const queries = me ? this.buildSearchUserQueries(me, params) : this.buildSearchUserNoLoginQueries(params); - - let resultSet = new Set(); - const limit = opts?.limit ?? 10; - for (const query of queries) { - const ids = await query - .select('user.id') - .limit(limit - resultSet.size) - .orderBy('user.usernameLower', 'ASC') - .getRawMany<{ user_id: MiUser['id'] }>() - .then(res => res.map(x => x.user_id)); - - resultSet = new Set([...resultSet, ...ids]); - if (resultSet.size >= limit) { - break; - } - } - - return this.userEntityService.packMany<'UserLite' | 'UserDetailed'>( - [...resultSet].slice(0, limit), - me, - { schema: opts?.detail ? 'UserDetailed' : 'UserLite' }, - ); - } - - /** - * ログイン済みユーザによる検索実行時のクエリ一覧を構築する. - * @param me - * @param params - * @private - */ - @bindThis - private buildSearchUserQueries( - me: MiUser, - params: { - username?: string | null, - host?: string | null, - activeThreshold?: Date, - }, - ) { - // デフォルト30日以内に更新されたユーザーをアクティブユーザーとする - const activeThreshold = params.activeThreshold ?? defaultActiveThreshold(); - - const followingUserQuery = this.followingsRepository.createQueryBuilder('following') - .select('following.followeeId') - .where('following.followerId = :followerId', { followerId: me.id }); - - const activeFollowingUsersQuery = this.generateUserQueryBuilder(params) - .andWhere(`user.id IN (${followingUserQuery.getQuery()})`) - .andWhere('user.updatedAt > :activeThreshold', { activeThreshold }); - activeFollowingUsersQuery.setParameters(followingUserQuery.getParameters()); - - const inactiveFollowingUsersQuery = this.generateUserQueryBuilder(params) - .andWhere(`user.id IN (${followingUserQuery.getQuery()})`) - .andWhere(new Brackets(qb => { - qb - .where('user.updatedAt IS NULL') - .orWhere('user.updatedAt <= :activeThreshold', { activeThreshold }); - })); - inactiveFollowingUsersQuery.setParameters(followingUserQuery.getParameters()); - - // 自分自身がヒットするとしたらここ - const activeUserQuery = this.generateUserQueryBuilder(params) - .andWhere(`user.id NOT IN (${followingUserQuery.getQuery()})`) - .andWhere('user.updatedAt > :activeThreshold', { activeThreshold }); - activeUserQuery.setParameters(followingUserQuery.getParameters()); - - const inactiveUserQuery = this.generateUserQueryBuilder(params) - .andWhere(`user.id NOT IN (${followingUserQuery.getQuery()})`) - .andWhere('user.updatedAt <= :activeThreshold', { activeThreshold }); - inactiveUserQuery.setParameters(followingUserQuery.getParameters()); - - return [activeFollowingUsersQuery, inactiveFollowingUsersQuery, activeUserQuery, inactiveUserQuery]; - } - - /** - * ログインしていないユーザによる検索実行時のクエリ一覧を構築する. - * @param params - * @private - */ - @bindThis - private buildSearchUserNoLoginQueries(params: { - username?: string | null, - host?: string | null, - activeThreshold?: Date, - }) { - // デフォルト30日以内に更新されたユーザーをアクティブユーザーとする - const activeThreshold = params.activeThreshold ?? defaultActiveThreshold(); - - const activeUserQuery = this.generateUserQueryBuilder(params) - .andWhere(new Brackets(qb => { - qb - .where('user.updatedAt IS NULL') - .orWhere('user.updatedAt > :activeThreshold', { activeThreshold }); - })); - - const inactiveUserQuery = this.generateUserQueryBuilder(params) - .andWhere('user.updatedAt <= :activeThreshold', { activeThreshold }); - - return [activeUserQuery, inactiveUserQuery]; - } - - /** - * ユーザ検索クエリで共通する抽出条件をあらかじめ設定したクエリビルダを生成する. - * @param params - * @private - */ - @bindThis - private generateUserQueryBuilder(params: { - username?: string | null, - host?: string | null, - }): SelectQueryBuilder { - const userQuery = this.usersRepository.createQueryBuilder('user'); - - if (params.username) { - userQuery.andWhere('user.usernameLower LIKE :username', { username: sqlLikeEscape(params.username.toLowerCase()) + '%' }); - } - - if (params.host) { - if (params.host === this.config.hostname || params.host === '.') { - userQuery.andWhere('user.host IS NULL'); - } else { - userQuery.andWhere('user.host LIKE :host', { - host: sqlLikeEscape(params.host.toLowerCase()) + '%', - }); - } - } - - userQuery.andWhere('user.isSuspended = FALSE'); - - return userQuery; - } -} diff --git a/packages/backend/src/core/UserService.ts b/packages/backend/src/core/UserService.ts index 9b1961c631..d16e1be615 100644 --- a/packages/backend/src/core/UserService.ts +++ b/packages/backend/src/core/UserService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,18 +8,15 @@ import type { FollowingsRepository, UsersRepository } from '@/models/_.js'; import type { MiUser } from '@/models/User.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; @Injectable() export class UserService { constructor( @Inject(DI.usersRepository) private usersRepository: UsersRepository, + @Inject(DI.followingsRepository) private followingsRepository: FollowingsRepository, - private systemWebhookService: SystemWebhookService, - private userEntityService: UserEntityService, ) { } @@ -53,23 +50,4 @@ export class UserService { }); } } - - /** - * SystemWebhookを用いてユーザに関する操作内容を管理者各位に通知する. - * ここではJobQueueへのエンキューのみを行うため、即時実行されない. - * - * @see SystemWebhookService.enqueueSystemWebhook - */ - @bindThis - public async notifySystemWebhook(user: MiUser, type: 'userCreated') { - const packedUser = await this.userEntityService.pack(user, null, { schema: 'UserLite' }); - const recipientWebhookIds = await this.systemWebhookService.fetchSystemWebhooks({ isActive: true, on: [type] }); - for (const webhookId of recipientWebhookIds) { - await this.systemWebhookService.enqueueSystemWebhook( - webhookId, - type, - packedUser, - ); - } - } } diff --git a/packages/backend/src/core/UserSuspendService.ts b/packages/backend/src/core/UserSuspendService.ts index 7920e58e36..8940a142d1 100644 --- a/packages/backend/src/core/UserSuspendService.ts +++ b/packages/backend/src/core/UserSuspendService.ts @@ -1,11 +1,11 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; import { Not, IsNull } from 'typeorm'; -import type { FollowingsRepository, FollowRequestsRepository, UsersRepository } from '@/models/_.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'; @@ -13,75 +13,24 @@ import { DI } from '@/di-symbols.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; -import { RelationshipJobData } from '@/queue/types.js'; -import { ModerationLogService } from '@/core/ModerationLogService.js'; @Injectable() export class UserSuspendService { constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - @Inject(DI.followingsRepository) private followingsRepository: FollowingsRepository, - @Inject(DI.followRequestsRepository) - private followRequestsRepository: FollowRequestsRepository, - private userEntityService: UserEntityService, private queueService: QueueService, private globalEventService: GlobalEventService, private apRendererService: ApRendererService, - private moderationLogService: ModerationLogService, ) { } @bindThis - public async suspend(user: MiUser, moderator: MiUser): Promise { - await this.usersRepository.update(user.id, { - isSuspended: true, - }); - - this.moderationLogService.log(moderator, 'suspend', { - userId: user.id, - userUsername: user.username, - userHost: user.host, - }); - - (async () => { - await this.postSuspend(user).catch(e => {}); - await this.unFollowAll(user).catch(e => {}); - })(); - } - - @bindThis - public async unsuspend(user: MiUser, moderator: MiUser): Promise { - await this.usersRepository.update(user.id, { - isSuspended: false, - }); - - this.moderationLogService.log(moderator, 'unsuspend', { - userId: user.id, - userUsername: user.username, - userHost: user.host, - }); - - (async () => { - await this.postUnsuspend(user).catch(e => {}); - })(); - } - - @bindThis - private async postSuspend(user: { id: MiUser['id']; host: MiUser['host'] }): Promise { + public async doPostSuspend(user: { id: MiUser['id']; host: MiUser['host'] }): Promise { this.globalEventService.publishInternalEvent('userChangeSuspendedState', { id: user.id, isSuspended: true }); - this.followRequestsRepository.delete({ - followeeId: user.id, - }); - this.followRequestsRepository.delete({ - followerId: user.id, - }); - if (this.userEntityService.isLocalUser(user)) { // 知り得る全SharedInboxにDelete配信 const content = this.apRendererService.addContext(this.apRendererService.renderDelete(this.userEntityService.genLocalUserUri(user.id), user)); @@ -109,7 +58,7 @@ export class UserSuspendService { } @bindThis - private async postUnsuspend(user: MiUser): Promise { + public async doPostUnsuspend(user: MiUser): Promise { this.globalEventService.publishInternalEvent('userChangeSuspendedState', { id: user.id, isSuspended: false }); if (this.userEntityService.isLocalUser(user)) { @@ -137,26 +86,4 @@ export class UserSuspendService { } } } - - @bindThis - private async unFollowAll(follower: MiUser) { - const followings = await this.followingsRepository.find({ - where: { - followerId: follower.id, - followeeId: Not(IsNull()), - }, - }); - - const jobs: RelationshipJobData[] = []; - for (const following of followings) { - if (following.followeeId && following.followerId) { - jobs.push({ - from: { id: following.followerId }, - to: { id: following.followeeId }, - silent: true, - }); - } - } - this.queueService.createUnfollowJob(jobs); - } } diff --git a/packages/backend/src/core/UserWebhookService.ts b/packages/backend/src/core/UserWebhookService.ts deleted file mode 100644 index 7117a3d7fa..0000000000 --- a/packages/backend/src/core/UserWebhookService.ts +++ /dev/null @@ -1,136 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import * as Redis from 'ioredis'; -import { type WebhooksRepository } from '@/models/_.js'; -import { MiWebhook, WebhookEventTypes } from '@/models/Webhook.js'; -import { DI } from '@/di-symbols.js'; -import { bindThis } from '@/decorators.js'; -import { GlobalEvents } from '@/core/GlobalEventService.js'; -import type { OnApplicationShutdown } from '@nestjs/common'; -import type { Packed } from '@/misc/json-schema.js'; - -export type UserWebhookPayload = - T extends 'note' | 'reply' | 'renote' |'mention' ? { - note: Packed<'Note'>, - } : - T extends 'follow' | 'unfollow' ? { - user: Packed<'UserDetailedNotMe'>, - } : - T extends 'followed' ? { - user: Packed<'UserLite'>, - } : never; - -@Injectable() -export class UserWebhookService implements OnApplicationShutdown { - private activeWebhooksFetched = false; - private activeWebhooks: MiWebhook[] = []; - - constructor( - @Inject(DI.redisForSub) - private redisForSub: Redis.Redis, - @Inject(DI.webhooksRepository) - private webhooksRepository: WebhooksRepository, - ) { - this.redisForSub.on('message', this.onMessage); - } - - @bindThis - public async getActiveWebhooks() { - if (!this.activeWebhooksFetched) { - this.activeWebhooks = await this.webhooksRepository.findBy({ - active: true, - }); - this.activeWebhooksFetched = true; - } - - return this.activeWebhooks; - } - - /** - * UserWebhook の一覧を取得する. - */ - @bindThis - public fetchWebhooks(params?: { - ids?: MiWebhook['id'][]; - isActive?: MiWebhook['active']; - on?: MiWebhook['on']; - }): Promise { - const query = this.webhooksRepository.createQueryBuilder('webhook'); - if (params) { - if (params.ids && params.ids.length > 0) { - query.andWhere('webhook.id IN (:...ids)', { ids: params.ids }); - } - if (params.isActive !== undefined) { - query.andWhere('webhook.active = :isActive', { isActive: params.isActive }); - } - if (params.on && params.on.length > 0) { - query.andWhere(':on <@ webhook.on', { on: params.on }); - } - } - - return query.getMany(); - } - - @bindThis - private async onMessage(_: string, data: string): Promise { - const obj = JSON.parse(data); - if (obj.channel !== 'internal') { - return; - } - - const { type, body } = obj.message as GlobalEvents['internal']['payload']; - switch (type) { - case 'webhookCreated': { - if (body.active) { - this.activeWebhooks.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい - ...body, - latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null, - user: null, // joinなカラムは通常取ってこないので - }); - } - break; - } - case 'webhookUpdated': { - if (body.active) { - const i = this.activeWebhooks.findIndex(a => a.id === body.id); - if (i > -1) { - this.activeWebhooks[i] = { // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい - ...body, - latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null, - user: null, // joinなカラムは通常取ってこないので - }; - } else { - this.activeWebhooks.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい - ...body, - latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null, - user: null, // joinなカラムは通常取ってこないので - }); - } - } else { - this.activeWebhooks = this.activeWebhooks.filter(a => a.id !== body.id); - } - break; - } - case 'webhookDeleted': { - this.activeWebhooks = this.activeWebhooks.filter(a => a.id !== body.id); - break; - } - default: - break; - } - } - - @bindThis - public dispose(): void { - this.redisForSub.off('message', this.onMessage); - } - - @bindThis - public onApplicationShutdown(signal?: string | undefined): void { - this.dispose(); - } -} diff --git a/packages/backend/src/core/UtilityService.ts b/packages/backend/src/core/UtilityService.ts index 86082ccdcd..5dec36c89e 100644 --- a/packages/backend/src/core/UtilityService.ts +++ b/packages/backend/src/core/UtilityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,16 +10,12 @@ import RE2 from 're2'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import { bindThis } from '@/decorators.js'; -import { MiMeta } from '@/models/Meta.js'; @Injectable() export class UtilityService { constructor( @Inject(DI.config) private config: Config, - - @Inject(DI.meta) - private meta: MiMeta, ) { } @@ -47,33 +43,13 @@ export class UtilityService { } @bindThis - public isMediaSilencedHost(silencedHosts: string[] | undefined, host: string | null): boolean { - if (!silencedHosts || host == null) return false; - return silencedHosts.some(x => host.toLowerCase() === x); - } - - @bindThis - public concatNoteContentsForKeyWordCheck(content: { - cw?: string | null; - text?: string | null; - pollChoices?: string[] | null; - others?: string[] | null; - }): string { - /** - * ノートの内容を結合してキーワードチェック用の文字列を生成する - * cwとtextは内容が繋がっているかもしれないので間に何も入れずにチェックする - */ - return `${content.cw ?? ''}${content.text ?? ''}\n${(content.pollChoices ?? []).join('\n')}\n${(content.others ?? []).join('\n')}`; - } - - @bindThis - public isKeyWordIncluded(text: string, keyWords: string[]): boolean { - if (keyWords.length === 0) return false; + public isSensitiveWordIncluded(text: string, sensitiveWords: string[]): boolean { + if (sensitiveWords.length === 0) return false; if (text === '') return false; const regexpregexp = /^\/(.+)\/(.*)$/; - const matched = keyWords.some(filter => { + const matched = sensitiveWords.some(filter => { // represents RegExp const regexp = filter.match(regexpregexp); // This should never happen due to input sanitisation. @@ -109,19 +85,4 @@ export class UtilityService { if (host == null) return null; return toASCII(host.toLowerCase()); } - - @bindThis - public isFederationAllowedHost(host: string): boolean { - if (this.meta.federation === 'none') return false; - if (this.meta.federation === 'specified' && !this.meta.federationHosts.some(x => `.${host.toLowerCase()}`.endsWith(`.${x}`))) return false; - if (this.isBlockedHost(this.meta.blockedHosts, host)) return false; - - return true; - } - - @bindThis - public isFederationAllowedUri(uri: string): boolean { - const host = this.extractDbHost(uri); - return this.isFederationAllowedHost(host); - } } diff --git a/packages/backend/src/core/VideoProcessingService.ts b/packages/backend/src/core/VideoProcessingService.ts index 747fe4fc7e..ffb7573358 100644 --- a/packages/backend/src/core/VideoProcessingService.ts +++ b/packages/backend/src/core/VideoProcessingService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/WebAuthnService.ts b/packages/backend/src/core/WebAuthnService.ts index 75ab0a207c..5945dc2919 100644 --- a/packages/backend/src/core/WebAuthnService.ts +++ b/packages/backend/src/core/WebAuthnService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,11 +10,12 @@ import { generateRegistrationOptions, verifyAuthenticationResponse, verifyRegistrationResponse, } from '@simplewebauthn/server'; -import { AttestationFormat, isoCBOR, isoUint8Array } from '@simplewebauthn/server/helpers'; +import { AttestationFormat, isoCBOR } from '@simplewebauthn/server/helpers'; import { DI } from '@/di-symbols.js'; -import type { MiMeta, UserSecurityKeysRepository } from '@/models/_.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/_.js'; import { IdentifiableError } from '@/misc/identifiable-error.js'; import type { @@ -22,40 +23,41 @@ import type { AuthenticatorTransportFuture, CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, + PublicKeyCredentialDescriptorFuture, PublicKeyCredentialRequestOptionsJSON, RegistrationResponseJSON, -} from '@simplewebauthn/types'; +} from '@simplewebauthn/typescript-types'; @Injectable() export class WebAuthnService { constructor( - @Inject(DI.config) - private config: Config, - - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.redis) private redisClient: Redis.Redis, + @Inject(DI.config) + private config: Config, + @Inject(DI.userSecurityKeysRepository) private userSecurityKeysRepository: UserSecurityKeysRepository, + + private metaService: MetaService, ) { } @bindThis - public getRelyingParty(): { origin: string; rpId: string; rpName: string; rpIcon?: string; } { + public async getRelyingParty(): Promise<{ origin: string; rpId: string; rpName: string; rpIcon?: string; }> { + const instance = await this.metaService.fetch(); return { origin: this.config.url, - rpId: this.config.hostname, - rpName: this.meta.name ?? this.config.host, - rpIcon: this.meta.iconUrl ?? undefined, + rpId: this.config.host, + rpName: instance.name ?? this.config.host, + rpIcon: instance.iconUrl ?? undefined, }; } @bindThis public async initiateRegistration(userId: MiUser['id'], userName: string, userDisplayName?: string): Promise { - const relyingParty = this.getRelyingParty(); + const relyingParty = await this.getRelyingParty(); const keys = await this.userSecurityKeysRepository.findBy({ userId: userId, }); @@ -63,12 +65,13 @@ export class WebAuthnService { const registrationOptions = await generateRegistrationOptions({ rpName: relyingParty.rpName, rpID: relyingParty.rpId, - userID: isoUint8Array.fromUTF8String(userId), + userID: userId, userName: userName, userDisplayName: userDisplayName, attestationType: 'indirect', - excludeCredentials: keys.map(key => (<{ id: string; transports?: AuthenticatorTransportFuture[]; }>{ - id: key.id, + excludeCredentials: keys.map(key => ({ + id: Buffer.from(key.id, 'base64url'), + type: 'public-key', transports: key.transports ?? undefined, })), authenticatorSelection: { @@ -84,7 +87,7 @@ export class WebAuthnService { @bindThis public async verifyRegistration(userId: MiUser['id'], response: RegistrationResponseJSON): Promise<{ - credentialID: string; + credentialID: Uint8Array; credentialPublicKey: Uint8Array; attestationObject: Uint8Array; fmt: AttestationFormat; @@ -102,7 +105,7 @@ export class WebAuthnService { await this.redisClient.del(`webauthn:challenge:${userId}`); - const relyingParty = this.getRelyingParty(); + const relyingParty = await this.getRelyingParty(); let verification; try { @@ -141,7 +144,6 @@ export class WebAuthnService { @bindThis public async initiateAuthentication(userId: MiUser['id']): Promise { - const relyingParty = this.getRelyingParty(); const keys = await this.userSecurityKeysRepository.findBy({ userId: userId, }); @@ -151,9 +153,9 @@ export class WebAuthnService { } const authenticationOptions = await generateAuthenticationOptions({ - rpID: relyingParty.rpId, - allowCredentials: keys.map(key => (<{ id: string; transports?: AuthenticatorTransportFuture[]; }>{ - id: key.id, + allowCredentials: keys.map(key => ({ + id: Buffer.from(key.id, 'base64url'), + type: 'public-key', transports: key.transports ?? undefined, })), userVerification: 'preferred', @@ -164,86 +166,6 @@ export class WebAuthnService { return authenticationOptions; } - /** - * Initiate Passkey Auth (Without specifying user) - * @returns authenticationOptions - */ - @bindThis - public async initiateSignInWithPasskeyAuthentication(context: string): Promise { - const relyingParty = await this.getRelyingParty(); - - const authenticationOptions = await generateAuthenticationOptions({ - rpID: relyingParty.rpId, - userVerification: 'preferred', - }); - - await this.redisClient.setex(`webauthn:challenge:${context}`, 90, authenticationOptions.challenge); - - return authenticationOptions; - } - - /** - * Verify Webauthn AuthenticationCredential - * @throws IdentifiableError - * @returns If the challenge is successful, return the user ID. Otherwise, return null. - */ - @bindThis - public async verifySignInWithPasskeyAuthentication(context: string, response: AuthenticationResponseJSON): Promise { - const challenge = await this.redisClient.get(`webauthn:challenge:${context}`); - - if (!challenge) { - throw new IdentifiableError('2d16e51c-007b-4edd-afd2-f7dd02c947f6', `challenge '${context}' not found`); - } - - await this.redisClient.del(`webauthn:challenge:${context}`); - - const key = await this.userSecurityKeysRepository.findOneBy({ - id: response.id, - }); - - if (!key) { - throw new IdentifiableError('36b96a7d-b547-412d-aeed-2d611cdc8cdc', 'Unknown Webauthn key'); - } - - const relyingParty = await this.getRelyingParty(); - - let verification; - try { - verification = await verifyAuthenticationResponse({ - response: response, - expectedChallenge: challenge, - expectedOrigin: relyingParty.origin, - expectedRPID: relyingParty.rpId, - authenticator: { - credentialID: key.id, - credentialPublicKey: Buffer.from(key.publicKey, 'base64url'), - counter: key.counter, - transports: key.transports ? key.transports as AuthenticatorTransportFuture[] : undefined, - }, - requireUserVerification: true, - }); - } catch (error) { - throw new IdentifiableError('b18c89a7-5b5e-4cec-bb5b-0419f332d430', `verification failed: ${error}`); - } - - const { verified, authenticationInfo } = verification; - - if (!verified) { - return null; - } - - await this.userSecurityKeysRepository.update({ - id: response.id, - }, { - lastUsed: new Date(), - counter: authenticationInfo.newCounter, - credentialDeviceType: authenticationInfo.credentialDeviceType, - credentialBackedUp: authenticationInfo.credentialBackedUp, - }); - - return key.userId; - } - @bindThis public async verifyAuthentication(userId: MiUser['id'], response: AuthenticationResponseJSON): Promise { const challenge = await this.redisClient.get(`webauthn:challenge:${userId}`); @@ -269,7 +191,7 @@ export class WebAuthnService { if (cert[0] === 0x04) { // 前の実装ではいつも 0x04 で始まっていた const halfLength = (cert.length - 1) / 2; - const cborMap = new Map(); + const cborMap = new Map(); cborMap.set(1, 2); // kty, EC2 cborMap.set(3, -7); // alg, ES256 cborMap.set(-1, 1); // crv, P256 @@ -287,7 +209,7 @@ export class WebAuthnService { } } - const relyingParty = this.getRelyingParty(); + const relyingParty = await this.getRelyingParty(); let verification; try { @@ -297,7 +219,7 @@ export class WebAuthnService { expectedOrigin: relyingParty.origin, expectedRPID: relyingParty.rpId, authenticator: { - credentialID: key.id, + credentialID: Buffer.from(key.id, 'base64url'), credentialPublicKey: Buffer.from(key.publicKey, 'base64url'), counter: key.counter, transports: key.transports ? key.transports as AuthenticatorTransportFuture[] : undefined, diff --git a/packages/backend/src/core/WebfingerService.ts b/packages/backend/src/core/WebfingerService.ts index 374536a741..3d5747aebd 100644 --- a/packages/backend/src/core/WebfingerService.ts +++ b/packages/backend/src/core/WebfingerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/WebhookService.ts b/packages/backend/src/core/WebhookService.ts new file mode 100644 index 0000000000..930e6ef64a --- /dev/null +++ b/packages/backend/src/core/WebhookService.ts @@ -0,0 +1,94 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { Inject, Injectable } from '@nestjs/common'; +import * as Redis from 'ioredis'; +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 type { GlobalEvents } from '@/core/GlobalEventService.js'; +import type { OnApplicationShutdown } from '@nestjs/common'; + +@Injectable() +export class WebhookService implements OnApplicationShutdown { + private webhooksFetched = false; + private webhooks: MiWebhook[] = []; + + constructor( + @Inject(DI.redisForSub) + private redisForSub: Redis.Redis, + + @Inject(DI.webhooksRepository) + private webhooksRepository: WebhooksRepository, + ) { + //this.onMessage = this.onMessage.bind(this); + this.redisForSub.on('message', this.onMessage); + } + + @bindThis + public async getActiveWebhooks() { + if (!this.webhooksFetched) { + this.webhooks = await this.webhooksRepository.findBy({ + active: true, + }); + this.webhooksFetched = true; + } + + return this.webhooks; + } + + @bindThis + private async onMessage(_: string, data: string): Promise { + const obj = JSON.parse(data); + + if (obj.channel === 'internal') { + const { type, body } = obj.message as GlobalEvents['internal']['payload']; + switch (type) { + case 'webhookCreated': + if (body.active) { + this.webhooks.push({ + ...body, + latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null, + }); + } + break; + case 'webhookUpdated': + if (body.active) { + const i = this.webhooks.findIndex(a => a.id === body.id); + if (i > -1) { + this.webhooks[i] = { + ...body, + latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null, + }; + } else { + this.webhooks.push({ + ...body, + latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null, + }); + } + } else { + this.webhooks = this.webhooks.filter(a => a.id !== body.id); + } + break; + case 'webhookDeleted': + this.webhooks = this.webhooks.filter(a => a.id !== body.id); + break; + default: + break; + } + } + } + + @bindThis + public dispose(): void { + this.redisForSub.off('message', this.onMessage); + } + + @bindThis + public onApplicationShutdown(signal?: string | undefined): void { + this.dispose(); + } +} diff --git a/packages/backend/src/core/WebhookTestService.ts b/packages/backend/src/core/WebhookTestService.ts deleted file mode 100644 index b1ea7974fb..0000000000 --- a/packages/backend/src/core/WebhookTestService.ts +++ /dev/null @@ -1,478 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { MiAbuseUserReport, MiNote, MiUser, MiWebhook } from '@/models/_.js'; -import { bindThis } from '@/decorators.js'; -import { MiSystemWebhook, type SystemWebhookEventType } from '@/models/SystemWebhook.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; -import { Packed } from '@/misc/json-schema.js'; -import { type WebhookEventTypes } from '@/models/Webhook.js'; -import { type UserWebhookPayload, UserWebhookService } from '@/core/UserWebhookService.js'; -import { QueueService } from '@/core/QueueService.js'; -import { ModeratorInactivityRemainingTime } from '@/queue/processors/CheckModeratorsActivityProcessorService.js'; - -const oneDayMillis = 24 * 60 * 60 * 1000; - -type AbuseUserReportDto = Omit & { - targetUser: Packed<'UserLite'> | null, - reporter: Packed<'UserLite'> | null, - assignee: Packed<'UserLite'> | null, -}; - -function generateAbuseReport(override?: Partial): AbuseUserReportDto { - const result: MiAbuseUserReport = { - id: 'dummy-abuse-report1', - targetUserId: 'dummy-target-user', - targetUser: null, - reporterId: 'dummy-reporter-user', - reporter: null, - assigneeId: null, - assignee: null, - resolved: false, - forwarded: false, - comment: 'This is a dummy report for testing purposes.', - targetUserHost: null, - reporterHost: null, - resolvedAs: null, - moderationNote: 'foo', - ...override, - }; - - return { - ...result, - targetUser: result.targetUser ? toPackedUserLite(result.targetUser) : null, - reporter: result.reporter ? toPackedUserLite(result.reporter) : null, - assignee: result.assignee ? toPackedUserLite(result.assignee) : null, - }; -} - -function generateDummyUser(override?: Partial): MiUser { - return { - id: 'dummy-user-1', - updatedAt: new Date(Date.now() - oneDayMillis * 7), - lastFetchedAt: new Date(Date.now() - oneDayMillis * 5), - lastActiveDate: new Date(Date.now() - oneDayMillis * 3), - hideOnlineStatus: false, - username: 'dummy1', - usernameLower: 'dummy1', - name: 'DummyUser1', - followersCount: 10, - followingCount: 5, - movedToUri: null, - movedAt: null, - alsoKnownAs: null, - notesCount: 30, - avatarId: null, - avatar: null, - bannerId: null, - banner: null, - avatarUrl: null, - bannerUrl: null, - avatarBlurhash: null, - bannerBlurhash: null, - avatarDecorations: [], - tags: [], - isSuspended: false, - isLocked: false, - isBot: false, - isCat: true, - isRoot: false, - isExplorable: true, - isHibernated: false, - isDeleted: false, - requireSigninToViewContents: false, - makeNotesFollowersOnlyBefore: null, - makeNotesHiddenBefore: null, - emojis: [], - score: 0, - host: null, - inbox: null, - sharedInbox: null, - featured: null, - uri: null, - followersUri: null, - token: null, - ...override, - }; -} - -function generateDummyNote(override?: Partial): MiNote { - return { - id: 'dummy-note-1', - replyId: null, - reply: null, - renoteId: null, - renote: null, - threadId: null, - text: 'This is a dummy note for testing purposes.', - name: null, - cw: null, - userId: 'dummy-user-1', - user: null, - localOnly: true, - reactionAcceptance: 'likeOnly', - renoteCount: 10, - repliesCount: 5, - clippedCount: 0, - reactions: {}, - visibility: 'public', - uri: null, - url: null, - fileIds: [], - attachedFileTypes: [], - visibleUserIds: [], - mentions: [], - mentionedRemoteUsers: '[]', - reactionAndUserPairCache: [], - emojis: [], - tags: [], - hasPoll: false, - channelId: null, - channel: null, - userHost: null, - replyUserId: null, - replyUserHost: null, - renoteUserId: null, - renoteUserHost: null, - ...override, - }; -} - -function toPackedNote(note: MiNote, detail = true, override?: Packed<'Note'>): Packed<'Note'> { - return { - id: note.id, - createdAt: new Date().toISOString(), - deletedAt: null, - text: note.text, - cw: note.cw, - userId: note.userId, - user: toPackedUserLite(note.user ?? generateDummyUser()), - replyId: note.replyId, - renoteId: note.renoteId, - isHidden: false, - visibility: note.visibility, - mentions: note.mentions, - visibleUserIds: note.visibleUserIds, - fileIds: note.fileIds, - files: [], - tags: note.tags, - poll: null, - emojis: note.emojis, - channelId: note.channelId, - channel: note.channel, - localOnly: note.localOnly, - reactionAcceptance: note.reactionAcceptance, - reactionEmojis: {}, - reactions: {}, - reactionCount: 0, - renoteCount: note.renoteCount, - repliesCount: note.repliesCount, - uri: note.uri ?? undefined, - url: note.url ?? undefined, - reactionAndUserPairCache: note.reactionAndUserPairCache, - ...(detail ? { - clippedCount: note.clippedCount, - reply: note.reply ? toPackedNote(note.reply, false) : null, - renote: note.renote ? toPackedNote(note.renote, true) : null, - myReaction: null, - } : {}), - ...override, - }; -} - -function toPackedUserLite(user: MiUser, override?: Packed<'UserLite'>): Packed<'UserLite'> { - return { - id: user.id, - name: user.name, - username: user.username, - host: user.host, - avatarUrl: user.avatarUrl, - avatarBlurhash: user.avatarBlurhash, - avatarDecorations: user.avatarDecorations.map(it => ({ - id: it.id, - angle: it.angle, - flipH: it.flipH, - url: 'https://example.com/dummy-image001.png', - offsetX: it.offsetX, - offsetY: it.offsetY, - })), - isBot: user.isBot, - isCat: user.isCat, - emojis: user.emojis, - onlineStatus: 'active', - badgeRoles: [], - ...override, - }; -} - -function toPackedUserDetailedNotMe(user: MiUser, override?: Packed<'UserDetailedNotMe'>): Packed<'UserDetailedNotMe'> { - return { - ...toPackedUserLite(user), - url: null, - uri: null, - movedTo: null, - alsoKnownAs: [], - createdAt: new Date().toISOString(), - updatedAt: user.updatedAt?.toISOString() ?? null, - lastFetchedAt: user.lastFetchedAt?.toISOString() ?? null, - bannerUrl: user.bannerUrl, - bannerBlurhash: user.bannerBlurhash, - isLocked: user.isLocked, - isSilenced: false, - isSuspended: user.isSuspended, - description: null, - location: null, - birthday: null, - lang: null, - fields: [], - verifiedLinks: [], - followersCount: user.followersCount, - followingCount: user.followingCount, - notesCount: user.notesCount, - pinnedNoteIds: [], - pinnedNotes: [], - pinnedPageId: null, - pinnedPage: null, - publicReactions: true, - followersVisibility: 'public', - followingVisibility: 'public', - twoFactorEnabled: false, - usePasswordLessLogin: false, - securityKeys: false, - roles: [], - memo: null, - moderationNote: undefined, - isFollowing: false, - isFollowed: false, - hasPendingFollowRequestFromYou: false, - hasPendingFollowRequestToYou: false, - isBlocking: false, - isBlocked: false, - isMuted: false, - isRenoteMuted: false, - notify: 'none', - withReplies: true, - ...override, - }; -} - -const dummyUser1 = generateDummyUser(); -const dummyUser2 = generateDummyUser({ - id: 'dummy-user-2', - updatedAt: new Date(Date.now() - oneDayMillis * 30), - lastFetchedAt: new Date(Date.now() - oneDayMillis), - lastActiveDate: new Date(Date.now() - oneDayMillis), - username: 'dummy2', - usernameLower: 'dummy2', - name: 'DummyUser2', - followersCount: 40, - followingCount: 50, - notesCount: 900, -}); -const dummyUser3 = generateDummyUser({ - id: 'dummy-user-3', - updatedAt: new Date(Date.now() - oneDayMillis * 15), - lastFetchedAt: new Date(Date.now() - oneDayMillis * 2), - lastActiveDate: new Date(Date.now() - oneDayMillis * 2), - username: 'dummy3', - usernameLower: 'dummy3', - name: 'DummyUser3', - followersCount: 60, - followingCount: 70, - notesCount: 15900, -}); - -@Injectable() -export class WebhookTestService { - public static NoSuchWebhookError = class extends Error { - }; - - constructor( - private userWebhookService: UserWebhookService, - private systemWebhookService: SystemWebhookService, - private queueService: QueueService, - ) { - } - - /** - * UserWebhookのテスト送信を行う. - * 送信されるペイロードはいずれもダミーの値で、実際にはデータベース上に存在しない. - * - * また、この関数経由で送信されるWebhookは以下の設定を無視する. - * - Webhookそのものの有効・無効設定(active) - * - 送信対象イベント(on)に関する設定 - */ - @bindThis - public async testUserWebhook( - params: { - webhookId: MiWebhook['id'], - type: T, - override?: Partial>, - }, - sender: MiUser | null, - ) { - const webhooks = await this.userWebhookService.fetchWebhooks({ ids: [params.webhookId] }) - .then(it => it.filter(it => it.userId === sender?.id)); - if (webhooks.length === 0) { - throw new WebhookTestService.NoSuchWebhookError(); - } - - const webhook = webhooks[0]; - const send = (type: U, contents: UserWebhookPayload) => { - const merged = { - ...webhook, - ...params.override, - }; - - // テスト目的なのでUserWebhookServiceの機能を経由せず直接キューに追加する(チェック処理などをスキップする意図). - // また、Jobの試行回数も1回だけ. - this.queueService.userWebhookDeliver(merged, type, contents, { attempts: 1 }); - }; - - const dummyNote1 = generateDummyNote({ - userId: dummyUser1.id, - user: dummyUser1, - }); - const dummyReply1 = generateDummyNote({ - id: 'dummy-reply-1', - replyId: dummyNote1.id, - reply: dummyNote1, - userId: dummyUser1.id, - user: dummyUser1, - }); - const dummyRenote1 = generateDummyNote({ - id: 'dummy-renote-1', - renoteId: dummyNote1.id, - renote: dummyNote1, - userId: dummyUser2.id, - user: dummyUser2, - text: null, - }); - const dummyMention1 = generateDummyNote({ - id: 'dummy-mention-1', - userId: dummyUser1.id, - user: dummyUser1, - text: `@${dummyUser2.username} This is a mention to you.`, - mentions: [dummyUser2.id], - }); - - switch (params.type) { - case 'note': { - send('note', { note: toPackedNote(dummyNote1) }); - break; - } - case 'reply': { - send('reply', { note: toPackedNote(dummyReply1) }); - break; - } - case 'renote': { - send('renote', { note: toPackedNote(dummyRenote1) }); - break; - } - case 'mention': { - send('mention', { note: toPackedNote(dummyMention1) }); - break; - } - case 'follow': { - send('follow', { user: toPackedUserDetailedNotMe(dummyUser1) }); - break; - } - case 'followed': { - send('followed', { user: toPackedUserLite(dummyUser2) }); - break; - } - case 'unfollow': { - send('unfollow', { user: toPackedUserDetailedNotMe(dummyUser3) }); - break; - } - // まだ実装されていない (#9485) - case 'reaction': return; - default: { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const _exhaustiveAssertion: never = params.type; - return; - } - } - } - - /** - * SystemWebhookのテスト送信を行う. - * 送信されるペイロードはいずれもダミーの値で、実際にはデータベース上に存在しない. - * - * また、この関数経由で送信されるWebhookは以下の設定を無視する. - * - Webhookそのものの有効・無効設定(isActive) - * - 送信対象イベント(on)に関する設定 - */ - @bindThis - public async testSystemWebhook( - params: { - webhookId: MiSystemWebhook['id'], - type: SystemWebhookEventType, - override?: Partial>, - }, - ) { - const webhooks = await this.systemWebhookService.fetchSystemWebhooks({ ids: [params.webhookId] }); - if (webhooks.length === 0) { - throw new WebhookTestService.NoSuchWebhookError(); - } - - const webhook = webhooks[0]; - const send = (contents: unknown) => { - const merged = { - ...webhook, - ...params.override, - }; - - // テスト目的なのでSystemWebhookServiceの機能を経由せず直接キューに追加する(チェック処理などをスキップする意図). - // また、Jobの試行回数も1回だけ. - this.queueService.systemWebhookDeliver(merged, params.type, contents, { attempts: 1 }); - }; - - switch (params.type) { - case 'abuseReport': { - send(generateAbuseReport({ - targetUserId: dummyUser1.id, - targetUser: dummyUser1, - reporterId: dummyUser2.id, - reporter: dummyUser2, - })); - break; - } - case 'abuseReportResolved': { - send(generateAbuseReport({ - targetUserId: dummyUser1.id, - targetUser: dummyUser1, - reporterId: dummyUser2.id, - reporter: dummyUser2, - assigneeId: dummyUser3.id, - assignee: dummyUser3, - resolved: true, - })); - break; - } - case 'userCreated': { - send(toPackedUserLite(dummyUser1)); - break; - } - case 'inactiveModeratorsWarning': { - const dummyTime: ModeratorInactivityRemainingTime = { - time: 100000, - asDays: 1, - asHours: 24, - }; - - send({ - remainingTime: dummyTime, - }); - break; - } - case 'inactiveModeratorsInvitationOnlyChanged': { - send({}); - break; - } - } - } -} diff --git a/packages/backend/src/core/activitypub/ApAudienceService.ts b/packages/backend/src/core/activitypub/ApAudienceService.ts index 5a5a76f7d6..440852bdf3 100644 --- a/packages/backend/src/core/activitypub/ApAudienceService.ts +++ b/packages/backend/src/core/activitypub/ApAudienceService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -40,7 +40,7 @@ export class ApAudienceService { const limit = promiseLimit(2); const mentionedUsers = (await Promise.all( others.map(id => limit(() => this.apPersonService.resolvePerson(id, resolver).catch(() => null))), - )).filter(x => x != null); + )).filter((x): x is MiUser => x != null); if (toGroups.public.length > 0) { return { @@ -58,7 +58,7 @@ export class ApAudienceService { }; } - if (toGroups.followers.length > 0 || ccGroups.followers.length > 0) { + if (toGroups.followers.length > 0) { return { visibility: 'followers', mentionedUsers, diff --git a/packages/backend/src/core/activitypub/ApDbResolverService.ts b/packages/backend/src/core/activitypub/ApDbResolverService.ts index 4192e8659a..995c5dcd5f 100644 --- a/packages/backend/src/core/activitypub/ApDbResolverService.ts +++ b/packages/backend/src/core/activitypub/ApDbResolverService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -54,8 +54,8 @@ export class ApDbResolverService implements OnApplicationShutdown { private cacheService: CacheService, private apPersonService: ApPersonService, ) { - this.publicKeyCache = new MemoryKVCache(1000 * 60 * 60 * 12); // 12h - this.publicKeyByUserIdCache = new MemoryKVCache(1000 * 60 * 60 * 12); // 12h + this.publicKeyCache = new MemoryKVCache(Infinity); + this.publicKeyByUserIdCache = new MemoryKVCache(Infinity); } @bindThis @@ -106,12 +106,12 @@ export class ApDbResolverService implements OnApplicationShutdown { return await this.cacheService.userByIdCache.fetchMaybe( parsed.id, - () => this.usersRepository.findOneBy({ id: parsed.id, isDeleted: false }).then(x => x ?? undefined), + () => this.usersRepository.findOneBy({ id: parsed.id }).then(x => x ?? undefined), ) as MiLocalUser | undefined ?? null; } else { return await this.cacheService.uriPersonCache.fetch( parsed.uri, - () => this.usersRepository.findOneBy({ uri: parsed.uri, isDeleted: false }), + () => this.usersRepository.findOneBy({ uri: parsed.uri }), ) as MiRemoteUser | null; } } @@ -136,12 +136,8 @@ export class ApDbResolverService implements OnApplicationShutdown { if (key == null) return null; - const user = await this.cacheService.findUserById(key.userId).catch(() => null) as MiRemoteUser | null; - if (user == null) return null; - if (user.isDeleted) return null; - return { - user, + user: await this.cacheService.findUserById(key.userId) as MiRemoteUser, key, }; } @@ -155,7 +151,6 @@ export class ApDbResolverService implements OnApplicationShutdown { key: MiUserPublickey | null; } | null> { const user = await this.apPersonService.resolvePerson(uri) as MiRemoteUser; - if (user.isDeleted) return null; const key = await this.publicKeyByUserIdCache.fetch( user.id, diff --git a/packages/backend/src/core/activitypub/ApDeliverManagerService.ts b/packages/backend/src/core/activitypub/ApDeliverManagerService.ts index 5d07cd8e8f..81003bcf1c 100644 --- a/packages/backend/src/core/activitypub/ApDeliverManagerService.ts +++ b/packages/backend/src/core/activitypub/ApDeliverManagerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -144,7 +144,7 @@ class DeliverManager { } // deliver - await this.queueService.deliverMany(this.actor, this.activity, inboxes); + this.queueService.deliverMany(this.actor, this.activity, inboxes); } } diff --git a/packages/backend/src/core/activitypub/ApInboxService.ts b/packages/backend/src/core/activitypub/ApInboxService.ts index 376c9c0151..baaab67e48 100644 --- a/packages/backend/src/core/activitypub/ApInboxService.ts +++ b/packages/backend/src/core/activitypub/ApInboxService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -17,17 +17,16 @@ import { NoteCreateService } from '@/core/NoteCreateService.js'; 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 { IdService } from '@/core/IdService.js'; import { StatusError } from '@/misc/status-error.js'; import { UtilityService } from '@/core/UtilityService.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, MiMeta } from '@/models/_.js'; +import type { UsersRepository, NotesRepository, FollowingsRepository, AbuseUserReportsRepository, FollowRequestsRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; import type { MiRemoteUser } from '@/models/User.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; -import { AbuseReportService } from '@/core/AbuseReportService.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'; @@ -37,7 +36,7 @@ import { ApAudienceService } from './ApAudienceService.js'; import { ApPersonService } from './models/ApPersonService.js'; import { ApQuestionService } from './models/ApQuestionService.js'; import type { Resolver } from './ApResolverService.js'; -import type { IAccept, IAdd, IAnnounce, IBlock, ICreate, IDelete, IFlag, IFollow, ILike, IObject, IReject, IRemove, IUndo, IUpdate, IMove, IPost } from './type.js'; +import type { IAccept, IAdd, IAnnounce, IBlock, ICreate, IDelete, IFlag, IFollow, ILike, IObject, IReject, IRemove, IUndo, IUpdate, IMove } from './type.js'; @Injectable() export class ApInboxService { @@ -47,9 +46,6 @@ export class ApInboxService { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -59,6 +55,9 @@ export class ApInboxService { @Inject(DI.followingsRepository) private followingsRepository: FollowingsRepository, + @Inject(DI.abuseUserReportsRepository) + private abuseUserReportsRepository: AbuseUserReportsRepository, + @Inject(DI.followRequestsRepository) private followRequestsRepository: FollowRequestsRepository, @@ -66,7 +65,7 @@ export class ApInboxService { private noteEntityService: NoteEntityService, private utilityService: UtilityService, private idService: IdService, - private abuseReportService: AbuseReportService, + private metaService: MetaService, private userFollowingService: UserFollowingService, private apAudienceService: ApAudienceService, private reactionService: ReactionService, @@ -83,36 +82,26 @@ export class ApInboxService { private apPersonService: ApPersonService, private apQuestionService: ApQuestionService, private queueService: QueueService, - private globalEventService: GlobalEventService, ) { this.logger = this.apLoggerService.logger; } @bindThis - public async performActivity(actor: MiRemoteUser, activity: IObject): Promise { - let result = undefined as string | void; + public async performActivity(actor: MiRemoteUser, activity: IObject): Promise { if (isCollectionOrOrderedCollection(activity)) { - const results = [] as [string, string | void][]; const resolver = this.apResolverService.createResolver(); for (const item of toArray(isCollection(activity) ? activity.items : activity.orderedItems)) { const act = await resolver.resolve(item); try { - results.push([getApId(item), await this.performOneActivity(actor, act)]); + await this.performOneActivity(actor, act); } catch (err) { if (err instanceof Error || typeof err === 'string') { this.logger.error(err); - } else { - throw err; } } } - - const hasReason = results.some(([, reason]) => (reason != null && !reason.startsWith('ok'))); - if (hasReason) { - result = results.map(([id, reason]) => `${id}: ${reason}`).join('\n'); - } } else { - result = await this.performOneActivity(actor, activity); + await this.performOneActivity(actor, activity); } // ついでにリモートユーザーの情報が古かったら更新しておく @@ -123,43 +112,42 @@ export class ApInboxService { }); } } - return result; } @bindThis - public async performOneActivity(actor: MiRemoteUser, activity: IObject): Promise { + public async performOneActivity(actor: MiRemoteUser, activity: IObject): Promise { if (actor.isSuspended) return; if (isCreate(activity)) { - return await this.create(actor, activity); + await this.create(actor, activity); } else if (isDelete(activity)) { - return await this.delete(actor, activity); + await this.delete(actor, activity); } else if (isUpdate(activity)) { - return await this.update(actor, activity); + await this.update(actor, activity); } else if (isFollow(activity)) { - return await this.follow(actor, activity); + await this.follow(actor, activity); } else if (isAccept(activity)) { - return await this.accept(actor, activity); + await this.accept(actor, activity); } else if (isReject(activity)) { - return await this.reject(actor, activity); + await this.reject(actor, activity); } else if (isAdd(activity)) { - return await this.add(actor, activity); + await this.add(actor, activity).catch(err => this.logger.error(err)); } else if (isRemove(activity)) { - return await this.remove(actor, activity); + await this.remove(actor, activity).catch(err => this.logger.error(err)); } else if (isAnnounce(activity)) { - return await this.announce(actor, activity); + await this.announce(actor, activity); } else if (isLike(activity)) { - return await this.like(actor, activity); + await this.like(actor, activity); } else if (isUndo(activity)) { - return await this.undo(actor, activity); + await this.undo(actor, activity); } else if (isBlock(activity)) { - return await this.block(actor, activity); + await this.block(actor, activity); } else if (isFlag(activity)) { - return await this.flag(actor, activity); + await this.flag(actor, activity); } else if (isMove(activity)) { - return await this.move(actor, activity); + await this.move(actor, activity); } else { - return `unrecognized activity type: ${activity.type}`; + this.logger.warn(`unrecognized activity type: ${activity.type}`); } } @@ -241,57 +229,47 @@ export class ApInboxService { } @bindThis - private async add(actor: MiRemoteUser, activity: IAdd): Promise { + private async add(actor: MiRemoteUser, activity: IAdd): Promise { if (actor.uri !== activity.actor) { - return 'invalid actor'; + throw new Error('invalid actor'); } if (activity.target == null) { - return 'target is null'; + throw new Error('target is null'); } if (activity.target === actor.featured) { const note = await this.apNoteService.resolveNote(activity.object); - if (note == null) return 'note not found'; + if (note == null) throw new Error('note not found'); await this.notePiningService.addPinned(actor, note.id); return; } - return `unknown target: ${activity.target}`; + throw new Error(`unknown target: ${activity.target}`); } @bindThis - private async announce(actor: MiRemoteUser, activity: IAnnounce): Promise { + private async announce(actor: MiRemoteUser, activity: IAnnounce): Promise { const uri = getApId(activity); this.logger.info(`Announce: ${uri}`); - const resolver = this.apResolverService.createResolver(); - - if (!activity.object) return 'skip: activity has no object property'; const targetUri = getApId(activity.object); - if (targetUri.startsWith('bear:')) return 'skip: bearcaps url not supported.'; - const target = await resolver.resolve(activity.object).catch(e => { - this.logger.error(`Resolution failed: ${e}`); - return e; - }); - - if (isPost(target)) return await this.announceNote(actor, activity, target); - - return `skip: unknown object type ${getApType(target)}`; + this.announceNote(actor, activity, targetUri); } @bindThis - private async announceNote(actor: MiRemoteUser, activity: IAnnounce, target: IPost): Promise { + private async announceNote(actor: MiRemoteUser, activity: IAnnounce, targetUri: string): Promise { const uri = getApId(activity); if (actor.isSuspended) { return; } - // アナウンス先が許可されているかチェック - if (!this.utilityService.isFederationAllowedUri(uri)) return; + // アナウンス先をブロックしてたら中断 + const meta = await this.metaService.fetch(); + if (this.utilityService.isBlockedHost(meta.blockedHosts, this.utilityService.extractDbHost(uri))) return; const unlock = await this.appLockService.getApLock(uri); @@ -305,21 +283,24 @@ export class ApInboxService { // Announce対象をresolve let renote; try { - renote = await this.apNoteService.resolveNote(target); - if (renote == null) return 'announce target is null'; + renote = await this.apNoteService.resolveNote(targetUri); + if (renote == null) throw new Error('announce target is null'); } catch (err) { // 対象が4xxならスキップ if (err instanceof StatusError) { - if (!err.isRetryable) { - return `Ignored announce target ${target.id} - ${err.statusCode}`; + if (err.isClientError) { + this.logger.warn(`Ignored announce target ${targetUri} - ${err.statusCode}`); + return; } - return `Error in announce target ${target.id} - ${err.statusCode}`; + + this.logger.warn(`Error in announce target ${targetUri} - ${err.statusCode}`); } throw err; } if (!await this.noteEntityService.isVisibleForMe(renote, actor.id)) { - return 'skip: invalid actor for this activity'; + this.logger.warn('skip: invalid actor for this activity'); + return; } this.logger.info(`Creating the (Re)Note: ${uri}`); @@ -328,7 +309,8 @@ export class ApInboxService { const createdAt = activity.published ? new Date(activity.published) : null; if (createdAt && createdAt < this.idService.parse(renote.id).date) { - return 'skip: malformed createdAt'; + this.logger.warn('skip: malformed createdAt'); + return; } await this.noteCreateService.create(actor, { @@ -362,15 +344,11 @@ export class ApInboxService { } @bindThis - private async create(actor: MiRemoteUser, activity: ICreate): Promise { + private async create(actor: MiRemoteUser, activity: ICreate): Promise { const uri = getApId(activity); this.logger.info(`Create: ${uri}`); - if (!activity.object) return 'skip: activity has no object property'; - const targetUri = getApId(activity.object); - if (targetUri.startsWith('bear:')) return 'skip: bearcaps url not supported.'; - // copy audiences between activity <=> object. if (typeof activity.object === 'object') { const to = unique(concat([toArray(activity.to), toArray(activity.object.to)])); @@ -395,9 +373,9 @@ export class ApInboxService { }); if (isPost(object)) { - await this.createNote(resolver, actor, object, false, activity); + this.createNote(resolver, actor, object, false, activity); } else { - return `Unknown type: ${getApType(object)}`; + this.logger.warn(`Unknown type: ${getApType(object)}`); } } @@ -426,7 +404,7 @@ export class ApInboxService { await this.apNoteService.createNote(note, resolver, silent); return 'ok'; } catch (err) { - if (err instanceof StatusError && !err.isRetryable) { + if (err instanceof StatusError && err.isClientError) { return `skip ${err.statusCode}`; } else { throw err; @@ -439,7 +417,7 @@ export class ApInboxService { @bindThis private async delete(actor: MiRemoteUser, activity: IDelete): Promise { if (actor.uri !== activity.actor) { - return 'invalid actor'; + throw new Error('invalid actor'); } // 削除対象objectのtype @@ -499,8 +477,6 @@ export class ApInboxService { isDeleted: true, }); - this.globalEventService.publishInternalEvent('remoteUserUpdated', { id: actor.id }); - return `ok: queued ${job.name} ${job.id}`; } @@ -537,19 +513,20 @@ export class ApInboxService { const userIds = uris .filter(uri => uri.startsWith(this.config.url + '/users/')) .map(uri => uri.split('/').at(-1)) - .filter(x => x != null); + .filter((userId): userId is string => userId !== undefined); const users = await this.usersRepository.findBy({ id: In(userIds), }); if (users.length < 1) return 'skip'; - await this.abuseReportService.report([{ + await this.abuseUserReportsRepository.insert({ + id: this.idService.gen(), targetUserId: users[0].id, targetUserHost: users[0].host, reporterId: actor.id, reporterHost: actor.host, comment: `${activity.content}\n${JSON.stringify(uris, null, 2)}`, - }]); + }); return 'ok'; } @@ -597,29 +574,29 @@ export class ApInboxService { } @bindThis - private async remove(actor: MiRemoteUser, activity: IRemove): Promise { + private async remove(actor: MiRemoteUser, activity: IRemove): Promise { if (actor.uri !== activity.actor) { - return 'invalid actor'; + throw new Error('invalid actor'); } if (activity.target == null) { - return 'target is null'; + throw new Error('target is null'); } if (activity.target === actor.featured) { const note = await this.apNoteService.resolveNote(activity.object); - if (note == null) return 'note not found'; + if (note == null) throw new Error('note not found'); await this.notePiningService.removePinned(actor, note.id); return; } - return `unknown target: ${activity.target}`; + throw new Error(`unknown target: ${activity.target}`); } @bindThis private async undo(actor: MiRemoteUser, activity: IUndo): Promise { if (actor.uri !== activity.actor) { - return 'invalid actor'; + throw new Error('invalid actor'); } const uri = activity.id ?? activity; @@ -630,7 +607,7 @@ export class ApInboxService { const object = await resolver.resolve(activity.object).catch(e => { this.logger.error(`Resolution failed: ${e}`); - return e; + throw e; }); // don't queue because the sender may attempt again when timeout @@ -650,7 +627,7 @@ export class ApInboxService { return 'skip: follower not found'; } - const isFollowing = await this.followingsRepository.exists({ + const isFollowing = await this.followingsRepository.exist({ where: { followerId: follower.id, followeeId: actor.id, @@ -707,14 +684,14 @@ export class ApInboxService { return 'skip: フォロー解除しようとしているユーザーはローカルユーザーではありません'; } - const requestExist = await this.followRequestsRepository.exists({ + const requestExist = await this.followRequestsRepository.exist({ where: { followerId: actor.id, followeeId: followee.id, }, }); - const isFollowing = await this.followingsRepository.exists({ + const isFollowing = await this.followingsRepository.exist({ where: { followerId: actor.id, followeeId: followee.id, diff --git a/packages/backend/src/core/activitypub/ApLoggerService.ts b/packages/backend/src/core/activitypub/ApLoggerService.ts index 428d8061ce..cd9597e423 100644 --- a/packages/backend/src/core/activitypub/ApLoggerService.ts +++ b/packages/backend/src/core/activitypub/ApLoggerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/activitypub/ApMfmService.ts b/packages/backend/src/core/activitypub/ApMfmService.ts index 4036d2794a..60868627a2 100644 --- a/packages/backend/src/core/activitypub/ApMfmService.ts +++ b/packages/backend/src/core/activitypub/ApMfmService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -25,21 +25,8 @@ export class ApMfmService { } @bindThis - public getNoteHtml(note: Pick, apAppend?: string) { - let noMisskeyContent = false; - const srcMfm = (note.text ?? '') + (apAppend ?? ''); - - const parsed = mfm.parse(srcMfm); - - if (!apAppend && parsed?.every(n => ['text', 'unicodeEmoji', 'emojiCode', 'mention', 'hashtag', 'url'].includes(n.type))) { - noMisskeyContent = true; - } - - const content = this.mfmService.toHtml(parsed, JSON.parse(note.mentionedRemoteUsers)); - - return { - content, - noMisskeyContent, - }; + public getNoteHtml(note: MiNote): string | null { + if (!note.text) return ''; + return this.mfmService.toHtml(mfm.parse(note.text), JSON.parse(note.mentionedRemoteUsers)); } } diff --git a/packages/backend/src/core/activitypub/ApRendererService.ts b/packages/backend/src/core/activitypub/ApRendererService.ts index 5617a29bab..1891c341e4 100644 --- a/packages/backend/src/core/activitypub/ApRendererService.ts +++ b/packages/backend/src/core/activitypub/ApRendererService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -26,10 +26,10 @@ 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'; import { IdService } from '@/core/IdService.js'; -import { JsonLdService } from './JsonLdService.js'; +import { LdSignatureService } from './LdSignatureService.js'; import { ApMfmService } from './ApMfmService.js'; -import { CONTEXT } from './misc/contexts.js'; import type { IAccept, IActivity, IAdd, IAnnounce, IApDocument, IApEmoji, IApHashtag, IApImage, IApMention, IBlock, ICreate, IDelete, IFlag, IFollow, IKey, ILike, IMove, IObject, IPost, IQuestion, IReject, IRemove, ITombstone, IUndo, IUpdate } from './type.js'; @Injectable() @@ -56,7 +56,7 @@ export class ApRendererService { private customEmojiService: CustomEmojiService, private userEntityService: UserEntityService, private driveFileEntityService: DriveFileEntityService, - private jsonLdService: JsonLdService, + private ldSignatureService: LdSignatureService, private userKeypairService: UserKeypairService, private apMfmService: ApMfmService, private mfmService: MfmService, @@ -166,7 +166,6 @@ export class ApRendererService { mediaType: file.webpublicType ?? file.type, url: this.driveFileEntityService.getPublicUrl(file), name: file.comment, - sensitive: file.isSensitive, }; } @@ -316,7 +315,7 @@ export class ApRendererService { const getPromisedFiles = async (ids: string[]): Promise => { if (ids.length === 0) return []; const items = await this.driveFilesRepository.findBy({ id: In(ids) }); - return ids.map(id => items.find(item => item.id === id)).filter(x => x != null); + return ids.map(id => items.find(item => item.id === id)).filter((item): item is MiDriveFile => item != null); }; let inReplyTo; @@ -326,7 +325,7 @@ export class ApRendererService { inReplyToNote = await this.notesRepository.findOneBy({ id: note.replyId }); if (inReplyToNote != null) { - const inReplyToUserExist = await this.usersRepository.exists({ where: { id: inReplyToNote.userId } }); + const inReplyToUserExist = await this.usersRepository.exist({ where: { id: inReplyToNote.userId } }); if (inReplyToUserExist) { if (inReplyToNote.uri) { @@ -390,15 +389,17 @@ export class ApRendererService { poll = await this.pollsRepository.findOneBy({ noteId: note.id }); } - let apAppend = ''; + let apText = text; if (quote) { - apAppend += `\n\nRE: ${quote}`; + apText += `\n\nRE: ${quote}`; } const summary = note.cw === '' ? String.fromCharCode(0x200B) : note.cw; - const { content, noMisskeyContent } = this.apMfmService.getNoteHtml(note, apAppend); + const content = this.apMfmService.getNoteHtml(Object.assign({}, note, { + text: apText, + })); const emojis = await this.getEmojis(note.emojis); const apemojis = emojis.filter(emoji => !emoji.localOnly).map(emoji => this.renderEmoji(emoji)); @@ -411,6 +412,9 @@ export class ApRendererService { const asPoll = poll ? { type: 'Question', + content: this.apMfmService.getNoteHtml(Object.assign({}, note, { + text: text, + })), [poll.expiresAt && poll.expiresAt < new Date() ? 'closed' : 'endTime']: poll.expiresAt, [poll.multiple ? 'anyOf' : 'oneOf']: poll.choices.map((text, i) => ({ type: 'Note', @@ -428,13 +432,11 @@ export class ApRendererService { attributedTo, summary: summary ?? undefined, content: content ?? undefined, - ...(noMisskeyContent ? {} : { - _misskey_content: text, - source: { - content: text, - mediaType: 'text/x.misskeymarkdown', - }, - }), + _misskey_content: text, + source: { + content: text, + mediaType: 'text/x.misskeymarkdown', + }, _misskey_quote: quote, quoteUrl: quote, published: this.idService.parse(note.id).date.toISOString(), @@ -494,10 +496,6 @@ export class ApRendererService { name: user.name, summary: profile.description ? this.mfmService.toHtml(mfm.parse(profile.description)) : null, _misskey_summary: profile.description, - _misskey_followedMessage: profile.followedMessage, - _misskey_requireSigninToViewContents: user.requireSigninToViewContents, - _misskey_makeNotesFollowersOnlyBefore: user.makeNotesFollowersOnlyBefore, - _misskey_makeNotesHiddenBefore: user.makeNotesHiddenBefore, icon: avatar ? this.renderImage(avatar) : null, image: banner ? this.renderImage(banner) : null, tag, @@ -622,16 +620,47 @@ export class ApRendererService { x.id = `${this.config.url}/${randomUUID()}`; } - return Object.assign({ '@context': CONTEXT }, x as T & { id: string }); + return Object.assign({ + '@context': [ + 'https://www.w3.org/ns/activitystreams', + 'https://w3id.org/security/v1', + { + // as non-standards + manuallyApprovesFollowers: 'as:manuallyApprovesFollowers', + sensitive: 'as:sensitive', + Hashtag: 'as:Hashtag', + quoteUrl: 'as:quoteUrl', + // Mastodon + toot: 'http://joinmastodon.org/ns#', + Emoji: 'toot:Emoji', + featured: 'toot:featured', + discoverable: 'toot:discoverable', + // schema + schema: 'http://schema.org#', + PropertyValue: 'schema:PropertyValue', + value: 'schema:value', + // Misskey + misskey: 'https://misskey-hub.net/ns#', + '_misskey_content': 'misskey:_misskey_content', + '_misskey_quote': 'misskey:_misskey_quote', + '_misskey_reaction': 'misskey:_misskey_reaction', + '_misskey_votes': 'misskey:_misskey_votes', + '_misskey_summary': 'misskey:_misskey_summary', + 'isCat': 'misskey:isCat', + // vcard + vcard: 'http://www.w3.org/2006/vcard/ns#', + }, + ], + }, x as T & { id: string }); } @bindThis public async attachLdSignature(activity: any, user: { id: MiUser['id']; host: null; }): Promise { const keypair = await this.userKeypairService.getUserKeypair(user.id); - const jsonLd = this.jsonLdService.use(); - jsonLd.debug = false; - activity = await jsonLd.signRsaSignature2017(activity, keypair.privateKey, `${this.config.url}/users/${user.id}#main-key`); + const ldSignature = this.ldSignatureService.use(); + ldSignature.debug = false; + activity = await ldSignature.signRsaSignature2017(activity, keypair.privateKey, `${this.config.url}/users/${user.id}#main-key`); return activity; } @@ -689,7 +718,7 @@ export class ApRendererService { if (names.length === 0) return []; const allEmojis = await this.customEmojiService.localEmojisCache.fetch(); - const emojis = names.map(name => allEmojis.get(name)).filter(x => x != null); + const emojis = names.map(name => allEmojis.get(name)).filter(isNotNull); return emojis; } diff --git a/packages/backend/src/core/activitypub/ApRequestService.ts b/packages/backend/src/core/activitypub/ApRequestService.ts index c7d19adfd5..b59ce5241f 100644 --- a/packages/backend/src/core/activitypub/ApRequestService.ts +++ b/packages/backend/src/core/activitypub/ApRequestService.ts @@ -1,12 +1,11 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import * as crypto from 'node:crypto'; import { URL } from 'node:url'; import { Inject, Injectable } from '@nestjs/common'; -import { Window } from 'happy-dom'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import type { MiUser } from '@/models/User.js'; @@ -15,7 +14,6 @@ import { HttpRequestService } from '@/core/HttpRequestService.js'; import { LoggerService } from '@/core/LoggerService.js'; import { bindThis } from '@/decorators.js'; import type Logger from '@/logger.js'; -import { validateContentTypeSetAsActivityPub } from '@/core/activitypub/misc/validator.js'; type Request = { url: string; @@ -36,9 +34,9 @@ type PrivateKey = { }; export class ApRequestCreator { - static createSignedPost(args: { key: PrivateKey, url: string, body: string, digest?: string, additionalHeaders: Record }): Signed { + static createSignedPost(args: { key: PrivateKey, url: string, body: string, additionalHeaders: Record }): Signed { const u = new URL(args.url); - const digestHeader = args.digest ?? this.createDigest(args.body); + const digestHeader = `SHA-256=${crypto.createHash('sha256').update(args.body).digest('base64')}`; const request: Request = { url: u.href, @@ -61,10 +59,6 @@ export class ApRequestCreator { }; } - static createDigest(body: string) { - return `SHA-256=${crypto.createHash('sha256').update(body).digest('base64')}`; - } - static createSignedGet(args: { key: PrivateKey, url: string, additionalHeaders: Record }): Signed { const u = new URL(args.url); @@ -72,7 +66,7 @@ export class ApRequestCreator { url: u.href, method: 'GET', headers: this.#objectAssignWithLcKey({ - 'Accept': 'application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"', + 'Accept': 'application/activity+json, application/ld+json', 'Date': new Date().toUTCString(), 'Host': new URL(args.url).host, }, args.additionalHeaders), @@ -151,8 +145,8 @@ export class ApRequestService { } @bindThis - public async signedPost(user: { id: MiUser['id'] }, url: string, object: unknown, digest?: string): Promise { - const body = typeof object === 'string' ? object : JSON.stringify(object); + public async signedPost(user: { id: MiUser['id'] }, url: string, object: unknown): Promise { + const body = JSON.stringify(object); const keypair = await this.userKeypairService.getUserKeypair(user.id); @@ -163,7 +157,6 @@ export class ApRequestService { }, url, body, - digest, additionalHeaders: { }, }); @@ -181,8 +174,7 @@ export class ApRequestService { * @param url URL to fetch */ @bindThis - public async signedGet(url: string, user: { id: MiUser['id'] }, followAlternate?: boolean): Promise { - const _followAlternate = followAlternate ?? true; + public async signedGet(url: string, user: { id: MiUser['id'] }): Promise { const keypair = await this.userKeypairService.getUserKeypair(user.id); const req = ApRequestCreator.createSignedGet({ @@ -198,60 +190,8 @@ export class ApRequestService { const res = await this.httpRequestService.send(url, { method: req.request.method, headers: req.request.headers, - }, { - throwErrorWhenResponseNotOk: true, }); - //#region リクエスト先がhtmlかつactivity+jsonへのalternate linkタグがあるとき - const contentType = res.headers.get('content-type'); - - if ( - res.ok && - (contentType ?? '').split(';')[0].trimEnd().toLowerCase() === 'text/html' && - _followAlternate === true - ) { - const html = await res.text(); - const { window, happyDOM } = new Window({ - settings: { - disableJavaScriptEvaluation: true, - disableJavaScriptFileLoading: true, - disableCSSFileLoading: true, - disableComputedStyleRendering: true, - handleDisabledFileLoadingAsSuccess: true, - navigation: { - disableMainFrameNavigation: true, - disableChildFrameNavigation: true, - disableChildPageNavigation: true, - disableFallbackToSetURL: true, - }, - timer: { - maxTimeout: 0, - maxIntervalTime: 0, - maxIntervalIterations: 0, - }, - }, - }); - const document = window.document; - try { - document.documentElement.innerHTML = html; - - const alternate = document.querySelector('head > link[rel="alternate"][type="application/activity+json"]'); - if (alternate) { - const href = alternate.getAttribute('href'); - if (href) { - return await this.signedGet(href, user, false); - } - } - } catch (e) { - // something went wrong parsing the HTML, ignore the whole thing - } finally { - happyDOM.close().catch(err => {}); - } - } - //#endregion - - validateContentTypeSetAsActivityPub(res); - return await res.json(); } } diff --git a/packages/backend/src/core/activitypub/ApResolverService.ts b/packages/backend/src/core/activitypub/ApResolverService.ts index ca35608d9b..9ca63c9ec5 100644 --- a/packages/backend/src/core/activitypub/ApResolverService.ts +++ b/packages/backend/src/core/activitypub/ApResolverService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,8 +7,9 @@ import { Inject, Injectable } from '@nestjs/common'; 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, FollowRequestsRepository, MiMeta } from '@/models/_.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'; import { DI } from '@/di-symbols.js'; import { UtilityService } from '@/core/UtilityService.js'; @@ -28,7 +29,6 @@ export class Resolver { constructor( private config: Config, - private meta: MiMeta, private usersRepository: UsersRepository, private notesRepository: NotesRepository, private pollsRepository: PollsRepository, @@ -36,6 +36,7 @@ export class Resolver { private followRequestsRepository: FollowRequestsRepository, private utilityService: UtilityService, private instanceActorService: InstanceActorService, + private metaService: MetaService, private apRequestService: ApRequestService, private httpRequestService: HttpRequestService, private apRendererService: ApRendererService, @@ -93,7 +94,8 @@ export class Resolver { return await this.resolveLocal(value); } - if (!this.utilityService.isFederationAllowedHost(host)) { + const meta = await this.metaService.fetch(); + if (this.utilityService.isBlockedHost(meta.blockedHosts, host)) { throw new Error('Instance is blocked'); } @@ -103,7 +105,7 @@ export class Resolver { const object = (this.user ? await this.apRequestService.signedGet(value, this.user) as IObject - : await this.httpRequestService.getActivityJson(value)) as IObject; + : await this.httpRequestService.getJson(value, 'application/activity+json, application/ld+json')) as IObject; if ( Array.isArray(object['@context']) ? @@ -176,9 +178,6 @@ export class ApResolverService { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -196,6 +195,7 @@ export class ApResolverService { private utilityService: UtilityService, private instanceActorService: InstanceActorService, + private metaService: MetaService, private apRequestService: ApRequestService, private httpRequestService: HttpRequestService, private apRendererService: ApRendererService, @@ -208,7 +208,6 @@ export class ApResolverService { public createResolver(): Resolver { return new Resolver( this.config, - this.meta, this.usersRepository, this.notesRepository, this.pollsRepository, @@ -216,6 +215,7 @@ export class ApResolverService { this.followRequestsRepository, this.utilityService, this.instanceActorService, + this.metaService, this.apRequestService, this.httpRequestService, this.apRendererService, diff --git a/packages/backend/src/core/activitypub/JsonLdService.ts b/packages/backend/src/core/activitypub/LdSignatureService.ts similarity index 79% rename from packages/backend/src/core/activitypub/JsonLdService.ts rename to packages/backend/src/core/activitypub/LdSignatureService.ts index 100d4fa19f..39b5ff8abc 100644 --- a/packages/backend/src/core/activitypub/JsonLdService.ts +++ b/packages/backend/src/core/activitypub/LdSignatureService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,14 +7,13 @@ import * as crypto from 'node:crypto'; import { Injectable } from '@nestjs/common'; import { HttpRequestService } from '@/core/HttpRequestService.js'; import { bindThis } from '@/decorators.js'; -import { CONTEXT, PRELOADED_CONTEXTS } from './misc/contexts.js'; -import { validateContentTypeSetAsJsonLD } from './misc/validator.js'; +import { CONTEXTS } from './misc/contexts.js'; import type { JsonLdDocument } from 'jsonld'; -import type { JsonLd as JsonLdObject, RemoteDocument } from 'jsonld/jsonld-spec.js'; +import type { JsonLd, RemoteDocument } from 'jsonld/jsonld-spec.js'; -// RsaSignature2017 implementation is based on https://github.com/transmute-industries/RsaSignature2017 +// RsaSignature2017 based from https://github.com/transmute-industries/RsaSignature2017 -class JsonLd { +class LdSignature { public debug = false; public preLoad = true; public loderTimeout = 5000; @@ -89,18 +88,10 @@ class JsonLd { } @bindThis - public async compact(data: any, context: any = CONTEXT): Promise { + public async normalize(data: JsonLdDocument): Promise { const customLoader = this.getLoader(); // XXX: Importing jsonld dynamically since Jest frequently fails to import it statically // https://github.com/misskey-dev/misskey/pull/9894#discussion_r1103753595 - return (await import('jsonld')).default.compact(data, context, { - documentLoader: customLoader, - }); - } - - @bindThis - public async normalize(data: JsonLdDocument): Promise { - const customLoader = this.getLoader(); return (await import('jsonld')).default.normalize(data, { documentLoader: customLoader, }); @@ -112,11 +103,11 @@ class JsonLd { if (!/^https?:\/\//.test(url)) throw new Error(`Invalid URL ${url}`); if (this.preLoad) { - if (url in PRELOADED_CONTEXTS) { + if (url in CONTEXTS) { if (this.debug) console.debug(`HIT: ${url}`); return { contextUrl: undefined, - document: PRELOADED_CONTEXTS[url], + document: CONTEXTS[url], documentUrl: url, }; } @@ -133,7 +124,7 @@ class JsonLd { } @bindThis - private async fetchDocument(url: string): Promise { + private async fetchDocument(url: string): Promise { const json = await this.httpRequestService.send( url, { @@ -142,10 +133,7 @@ class JsonLd { }, timeout: this.loderTimeout, }, - { - throwErrorWhenResponseNotOk: false, - validators: [validateContentTypeSetAsJsonLD], - }, + { throwErrorWhenResponseNotOk: false }, ).then(res => { if (!res.ok) { throw new Error(`${res.status} ${res.statusText}`); @@ -154,7 +142,7 @@ class JsonLd { } }); - return json as JsonLdObject; + return json as JsonLd; } @bindThis @@ -166,14 +154,14 @@ class JsonLd { } @Injectable() -export class JsonLdService { +export class LdSignatureService { constructor( private httpRequestService: HttpRequestService, ) { } @bindThis - public use(): JsonLd { - return new JsonLd(this.httpRequestService); + public use(): LdSignature { + return new LdSignature(this.httpRequestService); } } diff --git a/packages/backend/src/core/activitypub/misc/contexts.ts b/packages/backend/src/core/activitypub/misc/contexts.ts index 94cb0785cb..71c440e5cc 100644 --- a/packages/backend/src/core/activitypub/misc/contexts.ts +++ b/packages/backend/src/core/activitypub/misc/contexts.ts @@ -1,9 +1,9 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import type { Context, JsonLd } from 'jsonld/jsonld-spec.js'; +import type { JsonLd } from 'jsonld/jsonld-spec.js'; /* eslint:disable:quotemark indent */ const id_v1 = { @@ -526,46 +526,7 @@ const activitystreams = { }, } satisfies JsonLd; -const context_iris = [ - 'https://www.w3.org/ns/activitystreams', - 'https://w3id.org/security/v1', -]; - -const extension_context_definition = { - Key: 'sec:Key', - // as non-standards - manuallyApprovesFollowers: 'as:manuallyApprovesFollowers', - sensitive: 'as:sensitive', - Hashtag: 'as:Hashtag', - quoteUrl: 'as:quoteUrl', - // Mastodon - toot: 'http://joinmastodon.org/ns#', - Emoji: 'toot:Emoji', - featured: 'toot:featured', - discoverable: 'toot:discoverable', - // schema - schema: 'http://schema.org#', - PropertyValue: 'schema:PropertyValue', - value: 'schema:value', - // Misskey - misskey: 'https://misskey-hub.net/ns#', - '_misskey_content': 'misskey:_misskey_content', - '_misskey_quote': 'misskey:_misskey_quote', - '_misskey_reaction': 'misskey:_misskey_reaction', - '_misskey_votes': 'misskey:_misskey_votes', - '_misskey_summary': 'misskey:_misskey_summary', - '_misskey_followedMessage': 'misskey:_misskey_followedMessage', - '_misskey_requireSigninToViewContents': 'misskey:_misskey_requireSigninToViewContents', - '_misskey_makeNotesFollowersOnlyBefore': 'misskey:_misskey_makeNotesFollowersOnlyBefore', - '_misskey_makeNotesHiddenBefore': 'misskey:_misskey_makeNotesHiddenBefore', - 'isCat': 'misskey:isCat', - // vcard - vcard: 'http://www.w3.org/2006/vcard/ns#', -} satisfies Context; - -export const CONTEXT: (string | Context)[] = [...context_iris, extension_context_definition]; - -export const PRELOADED_CONTEXTS: Record = { +export const CONTEXTS: Record = { 'https://w3id.org/identity/v1': id_v1, 'https://w3id.org/security/v1': security_v1, 'https://www.w3.org/ns/activitystreams': activitystreams, diff --git a/packages/backend/src/core/activitypub/misc/validator.ts b/packages/backend/src/core/activitypub/misc/validator.ts deleted file mode 100644 index 690beeffef..0000000000 --- a/packages/backend/src/core/activitypub/misc/validator.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import type { Response } from 'node-fetch'; - -export function validateContentTypeSetAsActivityPub(response: Response): void { - const contentType = (response.headers.get('content-type') ?? '').toLowerCase(); - - if (contentType === '') { - throw new Error('Validate content type of AP response: No content-type header'); - } - if ( - contentType.startsWith('application/activity+json') || - (contentType.startsWith('application/ld+json;') && contentType.includes('https://www.w3.org/ns/activitystreams')) - ) { - return; - } - throw new Error('Validate content type of AP response: Content type is not application/activity+json or application/ld+json'); -} - -const plusJsonSuffixRegex = /^\s*(application|text)\/[a-zA-Z0-9\.\-\+]+\+json\s*(;|$)/; - -export function validateContentTypeSetAsJsonLD(response: Response): void { - const contentType = (response.headers.get('content-type') ?? '').toLowerCase(); - - if (contentType === '') { - throw new Error('Validate content type of JSON LD: No content-type header'); - } - if ( - contentType.startsWith('application/ld+json') || - contentType.startsWith('application/json') || - plusJsonSuffixRegex.test(contentType) - ) { - return; - } - throw new Error('Validate content type of JSON LD: Content type is not application/ld+json or application/json'); -} diff --git a/packages/backend/src/core/activitypub/models/ApImageService.ts b/packages/backend/src/core/activitypub/models/ApImageService.ts index e7ece87b01..a4cd533892 100644 --- a/packages/backend/src/core/activitypub/models/ApImageService.ts +++ b/packages/backend/src/core/activitypub/models/ApImageService.ts @@ -1,13 +1,14 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { DriveFilesRepository, MiMeta } from '@/models/_.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'; import { DriveService } from '@/core/DriveService.js'; @@ -16,19 +17,17 @@ import { bindThis } from '@/decorators.js'; import { checkHttps } from '@/misc/check-https.js'; import { ApResolverService } from '../ApResolverService.js'; import { ApLoggerService } from '../ApLoggerService.js'; -import { isDocument, type IObject } from '../type.js'; +import type { IObject } from '../type.js'; @Injectable() export class ApImageService { private logger: Logger; constructor( - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, + private metaService: MetaService, private apResolverService: ApResolverService, private driveService: DriveService, private apLoggerService: ApLoggerService, @@ -40,7 +39,7 @@ export class ApImageService { * Imageを作成します。 */ @bindThis - public async createImage(actor: MiRemoteUser, value: string | IObject): Promise { + public async createImage(actor: MiRemoteUser, value: string | IObject): Promise { // 投稿者が凍結されていたらスキップ if (actor.isSuspended) { throw new Error('actor has been suspended'); @@ -48,26 +47,26 @@ export class ApImageService { const image = await this.apResolverService.createResolver().resolve(value); - if (!isDocument(image)) return null; - if (image.url == null) { - return null; + throw new Error('invalid image: url not provided'); } if (typeof image.url !== 'string') { - return null; + throw new Error('invalid image: unexpected type of url: ' + JSON.stringify(image.url, null, 2)); } if (!checkHttps(image.url)) { - return null; + throw new Error('invalid image: unexpected schema of url: ' + image.url); } this.logger.info(`Creating the Image: ${image.url}`); + const instance = await this.metaService.fetch(); + // Cache if remote file cache is on AND either // 1. remote sensitive file is also on // 2. or the image is not sensitive - const shouldBeCached = this.meta.cacheRemoteFiles && (this.meta.cacheRemoteSensitiveFiles || !image.sensitive); + const shouldBeCached = instance.cacheRemoteFiles && (instance.cacheRemoteSensitiveFiles || !image.sensitive); const file = await this.driveService.uploadFromUrl({ url: image.url, @@ -87,11 +86,12 @@ export class ApImageService { /** * Imageを解決します。 * - * ImageをリモートサーバーからフェッチしてMisskeyに登録しそれを返します。 + * Misskeyに対象のImageが登録されていればそれを返し、そうでなければ + * リモートサーバーからフェッチしてMisskeyに登録しそれを返します。 */ @bindThis - public async resolveImage(actor: MiRemoteUser, value: string | IObject): Promise { - // TODO: Misskeyに対象のImageが登録されていればそれを返す + public async resolveImage(actor: MiRemoteUser, value: string | IObject): Promise { + // TODO // リモートサーバーからフェッチしてきて登録 return await this.createImage(actor, value); diff --git a/packages/backend/src/core/activitypub/models/ApMentionService.ts b/packages/backend/src/core/activitypub/models/ApMentionService.ts index 2cd151fa04..9aa8ba5ede 100644 --- a/packages/backend/src/core/activitypub/models/ApMentionService.ts +++ b/packages/backend/src/core/activitypub/models/ApMentionService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -27,7 +27,7 @@ export class ApMentionService { const limit = promiseLimit(2); const mentionedUsers = (await Promise.all( hrefs.map(x => limit(() => this.apPersonService.resolvePerson(x, resolver).catch(() => null))), - )).filter(x => x != null); + )).filter((x): x is MiUser => x != null); return mentionedUsers; } diff --git a/packages/backend/src/core/activitypub/models/ApNoteService.ts b/packages/backend/src/core/activitypub/models/ApNoteService.ts index 2d333b3634..05d5ca15db 100644 --- a/packages/backend/src/core/activitypub/models/ApNoteService.ts +++ b/packages/backend/src/core/activitypub/models/ApNoteService.ts @@ -1,17 +1,19 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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, MiMeta } from '@/models/_.js'; +import type { PollsRepository, EmojisRepository } from '@/models/_.js'; import type { Config } from '@/config.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/Emoji.js'; +import { MetaService } from '@/core/MetaService.js'; import { AppLockService } from '@/core/AppLockService.js'; import type { MiDriveFile } from '@/models/DriveFile.js'; import { NoteCreateService } from '@/core/NoteCreateService.js'; @@ -22,7 +24,6 @@ import { StatusError } from '@/misc/status-error.js'; import { UtilityService } from '@/core/UtilityService.js'; import { bindThis } from '@/decorators.js'; import { checkHttps } from '@/misc/check-https.js'; -import { IdentifiableError } from '@/misc/identifiable-error.js'; import { getOneApId, getApId, getOneApHrefNullable, validPost, isEmoji, getApType } from '../type.js'; import { ApLoggerService } from '../ApLoggerService.js'; import { ApMfmService } from '../ApMfmService.js'; @@ -45,9 +46,6 @@ export class ApNoteService { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.pollsRepository) private pollsRepository: PollsRepository, @@ -67,6 +65,7 @@ export class ApNoteService { private apMentionService: ApMentionService, private apImageService: ApImageService, private apQuestionService: ApQuestionService, + private metaService: MetaService, private appLockService: AppLockService, private pollService: PollService, private noteCreateService: NoteCreateService, @@ -79,23 +78,22 @@ export class ApNoteService { @bindThis public validateNote(object: IObject, uri: string): Error | null { const expectHost = this.utilityService.extractDbHost(uri); - const apType = getApType(object); - if (apType == null || !validPost.includes(apType)) { - return new IdentifiableError('d450b8a9-48e4-4dab-ae36-f4db763fda7c', `invalid Note: invalid object type ${apType ?? 'undefined'}`); + if (!validPost.includes(getApType(object))) { + return new Error(`invalid Note: invalid object type ${getApType(object)}`); } if (object.id && this.utilityService.extractDbHost(object.id) !== expectHost) { - return new IdentifiableError('d450b8a9-48e4-4dab-ae36-f4db763fda7c', `invalid Note: id has different host. expected: ${expectHost}, actual: ${this.utilityService.extractDbHost(object.id)}`); + return new Error(`invalid Note: id has different host. expected: ${expectHost}, actual: ${this.utilityService.extractDbHost(object.id)}`); } const actualHost = object.attributedTo && this.utilityService.extractDbHost(getOneApId(object.attributedTo)); if (object.attributedTo && actualHost !== expectHost) { - return new IdentifiableError('d450b8a9-48e4-4dab-ae36-f4db763fda7c', `invalid Note: attributedTo has different host. expected: ${expectHost}, actual: ${actualHost}`); + return new Error(`invalid Note: attributedTo has different host. expected: ${expectHost}, actual: ${actualHost}`); } if (object.published && !this.idService.isSafeT(new Date(object.published).valueOf())) { - return new IdentifiableError('d450b8a9-48e4-4dab-ae36-f4db763fda7c', 'invalid Note: published timestamp is malformed'); + return new Error('invalid Note: published timestamp is malformed'); } return null; @@ -129,7 +127,7 @@ export class ApNoteService { value, object, }); - throw err; + throw new Error('invalid note'); } const note = object as IPost; @@ -153,47 +151,11 @@ export class ApNoteService { throw new Error('invalid note.attributedTo: ' + note.attributedTo); } - const uri = getOneApId(note.attributedTo); + const actor = await this.apPersonService.resolvePerson(getOneApId(note.attributedTo), resolver) as MiRemoteUser; - // ローカルで投稿者を検索し、もし凍結されていたらスキップ - const cachedActor = await this.apPersonService.fetchPerson(uri) as MiRemoteUser; - if (cachedActor && cachedActor.isSuspended) { - throw new IdentifiableError('85ab9bd7-3a41-4530-959d-f07073900109', 'actor has been suspended'); - } - - const apMentions = await this.apMentionService.extractApMentions(note.tag, resolver); - const apHashtags = extractApHashtags(note.tag); - - const cw = note.summary === '' ? null : note.summary; - - // テキストのパース - let text: string | null = null; - if (note.source?.mediaType === 'text/x.misskeymarkdown' && typeof note.source.content === 'string') { - text = note.source.content; - } else if (typeof note._misskey_content !== 'undefined') { - text = note._misskey_content; - } else if (typeof note.content === 'string') { - text = this.apMfmService.htmlToMfm(note.content, note.tag); - } - - const poll = await this.apQuestionService.extractPollFromQuestion(note, resolver).catch(() => undefined); - - //#region Contents Check - // 添付ファイルとユーザーをこのサーバーで登録する前に内容をチェックする - /** - * 禁止ワードチェック - */ - const hasProhibitedWords = this.noteCreateService.checkProhibitedWordsContain({ cw, text, pollChoices: poll?.choices }); - if (hasProhibitedWords) { - throw new IdentifiableError('689ee33f-f97c-479a-ac49-1b9f8140af99', 'Note contains prohibited words'); - } - //#endregion - - const actor = cachedActor ?? await this.apPersonService.resolvePerson(uri, resolver) as MiRemoteUser; - - // 解決した投稿者が凍結されていたらスキップ + // 投稿者が凍結されていたらスキップ if (actor.isSuspended) { - throw new IdentifiableError('85ab9bd7-3a41-4530-959d-f07073900109', 'actor has been suspended'); + throw new Error('actor has been suspended'); } const noteAudience = await this.apAudienceService.parseAudience(actor, note.to, note.cc, resolver); @@ -208,14 +170,19 @@ export class ApNoteService { } } - // 添付ファイル - const files: MiDriveFile[] = []; + const apMentions = await this.apMentionService.extractApMentions(note.tag, resolver); + const apHashtags = extractApHashtags(note.tag); - for (const attach of toArray(note.attachment)) { - attach.sensitive ??= note.sensitive; - const file = await this.apImageService.resolveImage(actor, attach); - if (file) files.push(file); - } + // 添付ファイル + // TODO: attachmentは必ずしもImageではない + // TODO: attachmentは必ずしも配列ではない + const limit = promiseLimit(2); + const files = (await Promise.all(toArray(note.attachment).map(attach => ( + limit(() => this.apImageService.resolveImage(actor, { + ...attach, + sensitive: note.sensitive, // Noteがsensitiveなら添付もsensitiveにする + })) + )))); // リプライ const reply: MiNote | null = note.inReplyTo @@ -249,12 +216,12 @@ export class ApNoteService { return { status: 'ok', res }; } catch (e) { return { - status: (e instanceof StatusError && !e.isRetryable) ? 'permerror' : 'temperror', + status: (e instanceof StatusError && e.isClientError) ? 'permerror' : 'temperror', }; } }; - const uris = unique([note._misskey_quote, note.quoteUrl].filter(x => x != null)); + const uris = unique([note._misskey_quote, note.quoteUrl].filter((x): x is string => typeof x === 'string')); const results = await Promise.all(uris.map(tryResolveNote)); quote = results.filter((x): x is { status: 'ok', res: MiNote } => x.status === 'ok').map(x => x.res).at(0); @@ -265,6 +232,18 @@ export class ApNoteService { } } + const cw = note.summary === '' ? null : note.summary; + + // テキストのパース + let text: string | null = null; + if (note.source?.mediaType === 'text/x.misskeymarkdown' && typeof note.source.content === 'string') { + text = note.source.content; + } else if (typeof note._misskey_content !== 'undefined') { + text = note._misskey_content; + } else if (typeof note.content === 'string') { + text = this.apMfmService.htmlToMfm(note.content, note.tag); + } + // vote if (reply && reply.hasPoll) { const poll = await this.pollsRepository.findOneByOrFail({ noteId: reply.id }); @@ -294,6 +273,8 @@ export class ApNoteService { const apEmojis = emojis.map(emoji => emoji.name); + const poll = await this.apQuestionService.extractPollFromQuestion(note, resolver).catch(() => undefined); + try { return await this.noteCreateService.create(actor, { createdAt: note.published ? new Date(note.published) : null, @@ -336,7 +317,9 @@ export class ApNoteService { public async resolveNote(value: string | IObject, options: { sentFrom?: URL, resolver?: Resolver } = {}): Promise { const uri = getApId(value); - if (!this.utilityService.isFederationAllowedUri(uri)) { + // ブロックしていたら中断 + const meta = await this.metaService.fetch(); + if (this.utilityService.isBlockedHost(meta.blockedHosts, this.utilityService.extractDbHost(uri))) { throw new StatusError('blocked host', 451); } @@ -406,7 +389,7 @@ export class ApNoteService { this.logger.info(`register emoji host=${host}, name=${name}`); - return await this.emojisRepository.insertOne({ + return await this.emojisRepository.insert({ id: this.idService.gen(), host, name, @@ -415,7 +398,7 @@ export class ApNoteService { publicUrl: tag.icon.url, updatedAt: new Date(), aliases: [], - }); + }).then(x => this.emojisRepository.findOneByOrFail(x.identifiers[0])); })); } } diff --git a/packages/backend/src/core/activitypub/models/ApPersonService.ts b/packages/backend/src/core/activitypub/models/ApPersonService.ts index c9de67b3a0..bf38d5fd60 100644 --- a/packages/backend/src/core/activitypub/models/ApPersonService.ts +++ b/packages/backend/src/core/activitypub/models/ApPersonService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,7 +8,7 @@ import promiseLimit from 'promise-limit'; import { DataSource } from 'typeorm'; import { ModuleRef } from '@nestjs/core'; import { DI } from '@/di-symbols.js'; -import type { FollowingsRepository, InstancesRepository, MiMeta, UserProfilesRepository, UserPublickeysRepository, UsersRepository } from '@/models/_.js'; +import type { FollowingsRepository, InstancesRepository, UserProfilesRepository, UserPublickeysRepository, UsersRepository } from '@/models/_.js'; import type { Config } from '@/config.js'; import type { MiLocalUser, MiRemoteUser } from '@/models/User.js'; import { MiUser } from '@/models/User.js'; @@ -34,7 +34,7 @@ import { StatusError } from '@/misc/status-error.js'; import type { UtilityService } from '@/core/UtilityService.js'; import type { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; -import { RoleService } from '@/core/RoleService.js'; +import { MetaService } from '@/core/MetaService.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; import type { AccountMoveService } from '@/core/AccountMoveService.js'; import { checkHttps } from '@/misc/check-https.js'; @@ -45,9 +45,9 @@ import type { ApNoteService } from './ApNoteService.js'; import type { ApMfmService } from '../ApMfmService.js'; import type { ApResolverService, Resolver } from '../ApResolverService.js'; import type { ApLoggerService } from '../ApLoggerService.js'; - +// eslint-disable-next-line @typescript-eslint/consistent-type-imports import type { ApImageService } from './ApImageService.js'; -import type { IActor, ICollection, IObject, IOrderedCollection } from '../type.js'; +import type { IActor, IObject } from '../type.js'; const nameLength = 128; const summaryLength = 2048; @@ -61,6 +61,7 @@ export class ApPersonService implements OnModuleInit { private driveFileEntityService: DriveFileEntityService; private idService: IdService; private globalEventService: GlobalEventService; + private metaService: MetaService; private federatedInstanceService: FederatedInstanceService; private fetchInstanceMetadataService: FetchInstanceMetadataService; private cacheService: CacheService; @@ -82,9 +83,6 @@ export class ApPersonService implements OnModuleInit { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.db) private db: DataSource, @@ -102,8 +100,6 @@ export class ApPersonService implements OnModuleInit { @Inject(DI.followingsRepository) private followingsRepository: FollowingsRepository, - - private roleService: RoleService, ) { } @@ -113,6 +109,7 @@ export class ApPersonService implements OnModuleInit { this.driveFileEntityService = this.moduleRef.get('DriveFileEntityService'); this.idService = this.moduleRef.get('IdService'); this.globalEventService = this.moduleRef.get('GlobalEventService'); + this.metaService = this.moduleRef.get('MetaService'); this.federatedInstanceService = this.moduleRef.get('FederatedInstanceService'); this.fetchInstanceMetadataService = this.moduleRef.get('FetchInstanceMetadataService'); this.cacheService = this.moduleRef.get('CacheService'); @@ -228,48 +225,20 @@ export class ApPersonService implements OnModuleInit { return null; } - private async resolveAvatarAndBanner(user: MiRemoteUser, icon: any, image: any): Promise>> { - if (user == null) throw new Error('failed to create user: user is null'); - + private async resolveAvatarAndBanner(user: MiRemoteUser, icon: any, image: any): Promise> { const [avatar, banner] = await Promise.all([icon, image].map(img => { - // icon and image may be arrays - // see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-icon - if (Array.isArray(img)) { - img = img.find(item => item && item.url) ?? null; - } - - // if we have an explicitly missing image, return an - // explicitly-null set of values - if ((img == null) || (typeof img === 'object' && img.url == null)) { - return { id: null, url: null, blurhash: null }; - } - + if (img == null) return null; + if (user == null) throw new Error('failed to create user: user is null'); return this.apImageService.resolveImage(user, img).catch(() => null); })); - if (((avatar != null && avatar.id != null) || (banner != null && banner.id != null)) - && !(await this.roleService.getUserPolicies(user.id)).canUpdateBioMedia) { - return {}; - } - - /* - we don't want to return nulls on errors! if the database fields - are already null, nothing changes; if the database has old - values, we should keep those. The exception is if the remote has - actually removed the images: in that case, the block above - returns the special {id:null}&c value, and we return those - */ return { - ...( avatar ? { - avatarId: avatar.id, - avatarUrl: avatar.url ? this.driveFileEntityService.getPublicUrl(avatar, 'avatar') : null, - avatarBlurhash: avatar.blurhash, - } : {}), - ...( banner ? { - bannerId: banner.id, - bannerUrl: banner.url ? this.driveFileEntityService.getPublicUrl(banner) : null, - bannerBlurhash: banner.blurhash, - } : {}), + avatarId: avatar?.id ?? null, + bannerId: banner?.id ?? null, + avatarUrl: avatar ? this.driveFileEntityService.getPublicUrl(avatar, 'avatar') : null, + bannerUrl: banner ? this.driveFileEntityService.getPublicUrl(banner) : null, + avatarBlurhash: avatar?.blurhash ?? null, + bannerBlurhash: banner?.blurhash ?? null, }; } @@ -302,21 +271,6 @@ export class ApPersonService implements OnModuleInit { const isBot = getApType(object) === 'Service' || getApType(object) === 'Application'; - const [followingVisibility, followersVisibility] = await Promise.all( - [ - this.isPublicCollection(person.following, resolver), - this.isPublicCollection(person.followers, resolver), - ].map((p): Promise<'public' | 'private'> => p - .then(isPublic => isPublic ? 'public' : 'private') - .catch(err => { - if (!(err instanceof StatusError) || err.isRetryable) { - this.logger.error('error occurred while fetching following/followers collection', { stack: err }); - } - return 'private'; - }), - ), - ); - const bday = person['vcard:bday']?.match(/^\d{4}-\d{2}-\d{2}/); const url = getOneApHrefNullable(person.url); @@ -362,9 +316,6 @@ export class ApPersonService implements OnModuleInit { tags, isBot, isCat: (person as any).isCat === true, - requireSigninToViewContents: (person as any).requireSigninToViewContents === true, - makeNotesFollowersOnlyBefore: (person as any).makeNotesFollowersOnlyBefore ?? null, - makeNotesHiddenBefore: (person as any).makeNotesHiddenBefore ?? null, emojis, })) as MiRemoteUser; @@ -379,11 +330,8 @@ export class ApPersonService implements OnModuleInit { await transactionalEntityManager.save(new MiUserProfile({ userId: user.id, description: _description, - followedMessage: person._misskey_followedMessage != null ? truncate(person._misskey_followedMessage, 256) : null, url, fields, - followingVisibility, - followersVisibility, birthday: bday?.[0] ?? null, location: person['vcard:Address'] ?? null, userHost: host, @@ -417,15 +365,13 @@ export class ApPersonService implements OnModuleInit { this.cacheService.uriPersonCache.set(user.uri, user); // Register host - if (this.meta.enableStatsForFederatedInstances) { - this.federatedInstanceService.fetchOrRegister(host).then(i => { - this.instancesRepository.increment({ id: i.id }, 'usersCount', 1); - if (this.meta.enableChartsForFederatedInstances) { - this.instanceChart.newUser(i.host); - } - this.fetchInstanceMetadataService.fetchInstanceMetadata(i); - }); - } + this.federatedInstanceService.fetch(host).then(async i => { + this.instancesRepository.increment({ id: i.id }, 'usersCount', 1); + this.fetchInstanceMetadataService.fetchInstanceMetadata(i); + if ((await this.metaService.fetch()).enableChartsForFederatedInstances) { + this.instanceChart.newUser(i.host); + } + }); this.usersChart.update(user, true); @@ -493,23 +439,6 @@ export class ApPersonService implements OnModuleInit { const tags = extractApHashtags(person.tag).map(normalizeForSearch).splice(0, 32); - const [followingVisibility, followersVisibility] = await Promise.all( - [ - this.isPublicCollection(person.following, resolver), - this.isPublicCollection(person.followers, resolver), - ].map((p): Promise<'public' | 'private' | undefined> => p - .then(isPublic => isPublic ? 'public' : 'private') - .catch(err => { - if (!(err instanceof StatusError) || err.isRetryable) { - this.logger.error('error occurred while fetching following/followers collection', { stack: err }); - // Do not update the visibiility on transient errors. - return undefined; - } - return 'private'; - }), - ), - ); - const bday = person['vcard:bday']?.match(/^\d{4}-\d{2}-\d{2}/); const url = getOneApHrefNullable(person.url); @@ -578,9 +507,6 @@ export class ApPersonService implements OnModuleInit { url, fields, description: _description, - followedMessage: person._misskey_followedMessage != null ? truncate(person._misskey_followedMessage, 256) : null, - followingVisibility, - followersVisibility, birthday: bday?.[0] ?? null, location: person['vcard:Address'] ?? null, }); @@ -693,7 +619,7 @@ export class ApPersonService implements OnModuleInit { // とりあえずidを別の時間で生成して順番を維持 let td = 0; - for (const note of featuredNotes.filter(x => x != null)) { + for (const note of featuredNotes.filter((note): note is MiNote => note != null)) { td -= 1000; transactionalEntityManager.insert(MiUserNotePining, { id: this.idService.gen(Date.now() + td), @@ -752,16 +678,4 @@ export class ApPersonService implements OnModuleInit { return 'ok'; } - - @bindThis - private async isPublicCollection(collection: string | ICollection | IOrderedCollection | undefined, resolver: Resolver): Promise { - if (collection) { - const resolved = await resolver.resolveCollection(collection); - if (resolved.first || (resolved as ICollection).items || (resolved as IOrderedCollection).orderedItems) { - return true; - } - } - - return false; - } } diff --git a/packages/backend/src/core/activitypub/models/ApQuestionService.ts b/packages/backend/src/core/activitypub/models/ApQuestionService.ts index 73004d10b0..27bd62268b 100644 --- a/packages/backend/src/core/activitypub/models/ApQuestionService.ts +++ b/packages/backend/src/core/activitypub/models/ApQuestionService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -51,7 +51,7 @@ export class ApQuestionService { const choices = question[multiple ? 'anyOf' : 'oneOf'] ?.map((x) => x.name) - .filter(x => x != null) + .filter((x): x is string => typeof x === 'string') ?? []; const votes = question[multiple ? 'anyOf' : 'oneOf']?.map((x) => x.replies?.totalItems ?? x._misskey_votes ?? 0); @@ -74,10 +74,10 @@ export class ApQuestionService { //#region このサーバーに既に登録されているか const note = await this.notesRepository.findOneBy({ uri }); - if (note == null) throw new Error('Question is not registered'); + if (note == null) throw new Error('Question is not registed'); const poll = await this.pollsRepository.findOneBy({ noteId: note.id }); - if (poll == null) throw new Error('Question is not registered'); + if (poll == null) throw new Error('Question is not registed'); //#endregion // resolve new Question object diff --git a/packages/backend/src/core/activitypub/models/icon.ts b/packages/backend/src/core/activitypub/models/icon.ts index 5722507a3b..9fed78020d 100644 --- a/packages/backend/src/core/activitypub/models/icon.ts +++ b/packages/backend/src/core/activitypub/models/icon.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/activitypub/models/identifier.ts b/packages/backend/src/core/activitypub/models/identifier.ts index dce4f410b4..22a7b0a76e 100644 --- a/packages/backend/src/core/activitypub/models/identifier.ts +++ b/packages/backend/src/core/activitypub/models/identifier.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/activitypub/models/tag.ts b/packages/backend/src/core/activitypub/models/tag.ts index f75cc45f7e..772ea11864 100644 --- a/packages/backend/src/core/activitypub/models/tag.ts +++ b/packages/backend/src/core/activitypub/models/tag.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -15,7 +15,7 @@ export function extractApHashtags(tags: IObject | IObject[] | null | undefined): return hashtags.map(tag => { const m = tag.name.match(/^#(.+)/); return m ? m[1] : null; - }).filter(x => x != null); + }).filter((x): x is string => x != null); } export function extractApHashtagObjects(tags: IObject | IObject[] | null | undefined): IApHashtag[] { diff --git a/packages/backend/src/core/activitypub/type.ts b/packages/backend/src/core/activitypub/type.ts index 7496315f09..d9fcc99066 100644 --- a/packages/backend/src/core/activitypub/type.ts +++ b/packages/backend/src/core/activitypub/type.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -13,10 +13,6 @@ export interface IObject { name?: string | null; summary?: string; _misskey_summary?: string; - _misskey_followedMessage?: string | null; - _misskey_requireSigninToViewContents?: boolean; - _misskey_makeNotesFollowersOnlyBefore?: number | null; - _misskey_makeNotesHiddenBefore?: number | null; published?: string; cc?: ApObject; to?: ApObject; @@ -29,7 +25,6 @@ export interface IObject { endTime?: Date; icon?: any; image?: any; - mediaType?: string; url?: ApObject | string; href?: string; tag?: IObject | IObject[]; @@ -64,14 +59,11 @@ export function getApId(value: string | IObject): string { /** * Get ActivityStreams Object type - * - * タイプ判定ができなかった場合に、あえてエラーではなくnullを返すようにしている。 - * 詳細: https://github.com/misskey-dev/misskey/issues/14239 */ -export function getApType(value: IObject): string | null { +export function getApType(value: IObject): string { if (typeof value.type === 'string') return value.type; if (Array.isArray(value.type) && typeof value.type[0] === 'string') return value.type[0]; - return null; + throw new Error('cannot detect type'); } export function getOneApHrefNullable(value: ApObject | undefined): string | undefined { @@ -104,23 +96,19 @@ export interface IActivity extends IObject { export interface ICollection extends IObject { type: 'Collection'; totalItems: number; - first?: IObject | string; - items?: ApObject; + items: ApObject; } export interface IOrderedCollection extends IObject { type: 'OrderedCollection'; totalItems: number; - first?: IObject | string; - orderedItems?: ApObject; + orderedItems: ApObject; } export const validPost = ['Note', 'Question', 'Article', 'Audio', 'Document', 'Image', 'Page', 'Video', 'Event']; -export const isPost = (object: IObject): object is IPost => { - const type = getApType(object); - return type != null && validPost.includes(type); -}; +export const isPost = (object: IObject): object is IPost => + validPost.includes(getApType(object)); export interface IPost extends IObject { type: 'Note' | 'Question' | 'Article' | 'Audio' | 'Document' | 'Image' | 'Page' | 'Video' | 'Event'; @@ -167,10 +155,8 @@ export const isTombstone = (object: IObject): object is ITombstone => export const validActor = ['Person', 'Service', 'Group', 'Organization', 'Application']; -export const isActor = (object: IObject): object is IActor => { - const type = getApType(object); - return type != null && validActor.includes(type); -}; +export const isActor = (object: IObject): object is IActor => + validActor.includes(getApType(object)); export interface IActor extends IObject { type: 'Person' | 'Service' | 'Organization' | 'Group' | 'Application'; @@ -253,19 +239,15 @@ export interface IKey extends IObject { publicKeyPem: string | Buffer; } -export const validDocumentTypes = ['Audio', 'Document', 'Image', 'Page', 'Video']; - export interface IApDocument extends IObject { - type: 'Audio' | 'Document' | 'Image' | 'Page' | 'Video'; + type: 'Document'; + name: string | null; + mediaType: string; } -export const isDocument = (object: IObject): object is IApDocument => { - const type = getApType(object); - return type != null && validDocumentTypes.includes(type); -}; - -export interface IApImage extends IApDocument { +export interface IApImage extends IObject { type: 'Image'; + name: string | null; } export interface ICreate extends IActivity { @@ -340,12 +322,8 @@ export const isAccept = (object: IObject): object is IAccept => getApType(object export const isReject = (object: IObject): object is IReject => getApType(object) === 'Reject'; export const isAdd = (object: IObject): object is IAdd => getApType(object) === 'Add'; export const isRemove = (object: IObject): object is IRemove => getApType(object) === 'Remove'; -export const isLike = (object: IObject): object is ILike => { - const type = getApType(object); - return type != null && ['Like', 'EmojiReaction', 'EmojiReact'].includes(type); -}; +export const isLike = (object: IObject): object is ILike => getApType(object) === 'Like' || getApType(object) === 'EmojiReaction' || getApType(object) === 'EmojiReact'; export const isAnnounce = (object: IObject): object is IAnnounce => getApType(object) === 'Announce'; export const isBlock = (object: IObject): object is IBlock => getApType(object) === 'Block'; export const isFlag = (object: IObject): object is IFlag => getApType(object) === 'Flag'; export const isMove = (object: IObject): object is IMove => getApType(object) === 'Move'; -export const isNote = (object: IObject): object is IPost => getApType(object) === 'Note'; diff --git a/packages/backend/src/core/chart/ChartLoggerService.ts b/packages/backend/src/core/chart/ChartLoggerService.ts index 20815ea968..bd90efec64 100644 --- a/packages/backend/src/core/chart/ChartLoggerService.ts +++ b/packages/backend/src/core/chart/ChartLoggerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -14,6 +14,6 @@ export class ChartLoggerService { constructor( private loggerService: LoggerService, ) { - this.logger = this.loggerService.getLogger('chart', 'white'); + this.logger = this.loggerService.getLogger('chart', 'white', process.env.NODE_ENV !== 'test'); } } diff --git a/packages/backend/src/core/chart/ChartManagementService.ts b/packages/backend/src/core/chart/ChartManagementService.ts index 79681370a1..f751a68cb4 100644 --- a/packages/backend/src/core/chart/ChartManagementService.ts +++ b/packages/backend/src/core/chart/ChartManagementService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/active-users.ts b/packages/backend/src/core/chart/charts/active-users.ts index 05905f3782..f0918e059c 100644 --- a/packages/backend/src/core/chart/charts/active-users.ts +++ b/packages/backend/src/core/chart/charts/active-users.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/ap-request.ts b/packages/backend/src/core/chart/charts/ap-request.ts index 04e771a95b..03c9b42be1 100644 --- a/packages/backend/src/core/chart/charts/ap-request.ts +++ b/packages/backend/src/core/chart/charts/ap-request.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/drive.ts b/packages/backend/src/core/chart/charts/drive.ts index 613e074a9f..bbcbf1a955 100644 --- a/packages/backend/src/core/chart/charts/drive.ts +++ b/packages/backend/src/core/chart/charts/drive.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/active-users.ts b/packages/backend/src/core/chart/charts/entities/active-users.ts index fc2b88a2bb..e68022ef29 100644 --- a/packages/backend/src/core/chart/charts/entities/active-users.ts +++ b/packages/backend/src/core/chart/charts/entities/active-users.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/ap-request.ts b/packages/backend/src/core/chart/charts/entities/ap-request.ts index 93e47e081b..a824515255 100644 --- a/packages/backend/src/core/chart/charts/entities/ap-request.ts +++ b/packages/backend/src/core/chart/charts/entities/ap-request.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/drive.ts b/packages/backend/src/core/chart/charts/entities/drive.ts index 4ea16da38c..4a56bd45c5 100644 --- a/packages/backend/src/core/chart/charts/entities/drive.ts +++ b/packages/backend/src/core/chart/charts/entities/drive.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/federation.ts b/packages/backend/src/core/chart/charts/entities/federation.ts index 5ed7804343..e067c71a7f 100644 --- a/packages/backend/src/core/chart/charts/entities/federation.ts +++ b/packages/backend/src/core/chart/charts/entities/federation.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/instance.ts b/packages/backend/src/core/chart/charts/entities/instance.ts index d0cac3e73f..4ea10d56d1 100644 --- a/packages/backend/src/core/chart/charts/entities/instance.ts +++ b/packages/backend/src/core/chart/charts/entities/instance.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/notes.ts b/packages/backend/src/core/chart/charts/entities/notes.ts index 325236ab35..26e2529b17 100644 --- a/packages/backend/src/core/chart/charts/entities/notes.ts +++ b/packages/backend/src/core/chart/charts/entities/notes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/per-user-drive.ts b/packages/backend/src/core/chart/charts/entities/per-user-drive.ts index 25d4619dde..aec3dd5140 100644 --- a/packages/backend/src/core/chart/charts/entities/per-user-drive.ts +++ b/packages/backend/src/core/chart/charts/entities/per-user-drive.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/per-user-following.ts b/packages/backend/src/core/chart/charts/entities/per-user-following.ts index 1618bd22f3..afb5813058 100644 --- a/packages/backend/src/core/chart/charts/entities/per-user-following.ts +++ b/packages/backend/src/core/chart/charts/entities/per-user-following.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/per-user-notes.ts b/packages/backend/src/core/chart/charts/entities/per-user-notes.ts index 30404b2e48..60a0b01c8e 100644 --- a/packages/backend/src/core/chart/charts/entities/per-user-notes.ts +++ b/packages/backend/src/core/chart/charts/entities/per-user-notes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/per-user-pv.ts b/packages/backend/src/core/chart/charts/entities/per-user-pv.ts index 7a903afad4..78d4464d7e 100644 --- a/packages/backend/src/core/chart/charts/entities/per-user-pv.ts +++ b/packages/backend/src/core/chart/charts/entities/per-user-pv.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/per-user-reactions.ts b/packages/backend/src/core/chart/charts/entities/per-user-reactions.ts index bb62bb2386..761101d479 100644 --- a/packages/backend/src/core/chart/charts/entities/per-user-reactions.ts +++ b/packages/backend/src/core/chart/charts/entities/per-user-reactions.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/test-grouped.ts b/packages/backend/src/core/chart/charts/entities/test-grouped.ts index 599c1dc136..15eb1fd1f8 100644 --- a/packages/backend/src/core/chart/charts/entities/test-grouped.ts +++ b/packages/backend/src/core/chart/charts/entities/test-grouped.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/test-intersection.ts b/packages/backend/src/core/chart/charts/entities/test-intersection.ts index d29b39716c..2ef63977a5 100644 --- a/packages/backend/src/core/chart/charts/entities/test-intersection.ts +++ b/packages/backend/src/core/chart/charts/entities/test-intersection.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/test-unique.ts b/packages/backend/src/core/chart/charts/entities/test-unique.ts index bdaa1716ed..56233585db 100644 --- a/packages/backend/src/core/chart/charts/entities/test-unique.ts +++ b/packages/backend/src/core/chart/charts/entities/test-unique.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/test.ts b/packages/backend/src/core/chart/charts/entities/test.ts index c80ff55c99..163db4e79f 100644 --- a/packages/backend/src/core/chart/charts/entities/test.ts +++ b/packages/backend/src/core/chart/charts/entities/test.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/entities/users.ts b/packages/backend/src/core/chart/charts/entities/users.ts index f94a5029d7..c7bffd3fd4 100644 --- a/packages/backend/src/core/chart/charts/entities/users.ts +++ b/packages/backend/src/core/chart/charts/entities/users.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/federation.ts b/packages/backend/src/core/chart/charts/federation.ts index c9b43cc66d..fc474b002b 100644 --- a/packages/backend/src/core/chart/charts/federation.ts +++ b/packages/backend/src/core/chart/charts/federation.ts @@ -1,13 +1,14 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Injectable, Inject } from '@nestjs/common'; import { DataSource } from 'typeorm'; -import type { FollowingsRepository, InstancesRepository, MiMeta } from '@/models/_.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'; import { bindThis } from '@/decorators.js'; import Chart from '../core.js'; import { ChartLoggerService } from '../ChartLoggerService.js'; @@ -23,15 +24,13 @@ export default class FederationChart extends Chart { // eslint-di @Inject(DI.db) private db: DataSource, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.followingsRepository) private followingsRepository: FollowingsRepository, @Inject(DI.instancesRepository) private instancesRepository: InstancesRepository, + private metaService: MetaService, private appLockService: AppLockService, private chartLoggerService: ChartLoggerService, ) { @@ -44,9 +43,11 @@ export default class FederationChart extends Chart { // eslint-di } protected async tickMinor(): Promise>> { + const meta = await this.metaService.fetch(); + const suspendedInstancesQuery = this.instancesRepository.createQueryBuilder('instance') .select('instance.host') - .where('instance.suspensionState != \'none\''); + .where('instance.isSuspended = true'); const pubsubSubQuery = this.followingsRepository.createQueryBuilder('f') .select('f.followerHost') @@ -64,21 +65,21 @@ export default class FederationChart extends Chart { // eslint-di this.followingsRepository.createQueryBuilder('following') .select('COUNT(DISTINCT following.followeeHost)') .where('following.followeeHost IS NOT NULL') - .andWhere(this.meta.blockedHosts.length === 0 ? '1=1' : 'following.followeeHost NOT ILIKE ALL(ARRAY[:...blocked])', { blocked: this.meta.blockedHosts.flatMap(x => [x, `%.${x}`]) }) + .andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followeeHost NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) }) .andWhere(`following.followeeHost NOT IN (${ suspendedInstancesQuery.getQuery() })`) .getRawOne() .then(x => parseInt(x.count, 10)), this.followingsRepository.createQueryBuilder('following') .select('COUNT(DISTINCT following.followerHost)') .where('following.followerHost IS NOT NULL') - .andWhere(this.meta.blockedHosts.length === 0 ? '1=1' : 'following.followerHost NOT ILIKE ALL(ARRAY[:...blocked])', { blocked: this.meta.blockedHosts.flatMap(x => [x, `%.${x}`]) }) + .andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followerHost NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) }) .andWhere(`following.followerHost NOT IN (${ suspendedInstancesQuery.getQuery() })`) .getRawOne() .then(x => parseInt(x.count, 10)), this.followingsRepository.createQueryBuilder('following') .select('COUNT(DISTINCT following.followeeHost)') .where('following.followeeHost IS NOT NULL') - .andWhere(this.meta.blockedHosts.length === 0 ? '1=1' : 'following.followeeHost NOT ILIKE ALL(ARRAY[:...blocked])', { blocked: this.meta.blockedHosts.flatMap(x => [x, `%.${x}`]) }) + .andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'following.followeeHost NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) }) .andWhere(`following.followeeHost NOT IN (${ suspendedInstancesQuery.getQuery() })`) .andWhere(`following.followeeHost IN (${ pubsubSubQuery.getQuery() })`) .setParameters(pubsubSubQuery.getParameters()) @@ -87,16 +88,16 @@ export default class FederationChart extends Chart { // eslint-di this.instancesRepository.createQueryBuilder('instance') .select('COUNT(instance.id)') .where(`instance.host IN (${ subInstancesQuery.getQuery() })`) - .andWhere(this.meta.blockedHosts.length === 0 ? '1=1' : 'instance.host NOT ILIKE ALL(ARRAY[:...blocked])', { blocked: this.meta.blockedHosts.flatMap(x => [x, `%.${x}`]) }) - .andWhere('instance.suspensionState = \'none\'') + .andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'instance.host NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) }) + .andWhere('instance.isSuspended = false') .andWhere('instance.isNotResponding = false') .getRawOne() .then(x => parseInt(x.count, 10)), this.instancesRepository.createQueryBuilder('instance') .select('COUNT(instance.id)') .where(`instance.host IN (${ pubInstancesQuery.getQuery() })`) - .andWhere(this.meta.blockedHosts.length === 0 ? '1=1' : 'instance.host NOT ILIKE ALL(ARRAY[:...blocked])', { blocked: this.meta.blockedHosts.flatMap(x => [x, `%.${x}`]) }) - .andWhere('instance.suspensionState = \'none\'') + .andWhere(meta.blockedHosts.length === 0 ? '1=1' : 'instance.host NOT ILIKE ANY(ARRAY[:...blocked])', { blocked: meta.blockedHosts.flatMap(x => [x, `%.${x}`]) }) + .andWhere('instance.isSuspended = false') .andWhere('instance.isNotResponding = false') .getRawOne() .then(x => parseInt(x.count, 10)), diff --git a/packages/backend/src/core/chart/charts/instance.ts b/packages/backend/src/core/chart/charts/instance.ts index 97f3bc6f2b..9df0afb02e 100644 --- a/packages/backend/src/core/chart/charts/instance.ts +++ b/packages/backend/src/core/chart/charts/instance.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/notes.ts b/packages/backend/src/core/chart/charts/notes.ts index f763b5fffa..df3295dbac 100644 --- a/packages/backend/src/core/chart/charts/notes.ts +++ b/packages/backend/src/core/chart/charts/notes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 404964d8b7..18354359c8 100644 --- a/packages/backend/src/core/chart/charts/per-user-drive.ts +++ b/packages/backend/src/core/chart/charts/per-user-drive.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 588ac638de..79bff2cb66 100644 --- a/packages/backend/src/core/chart/charts/per-user-following.ts +++ b/packages/backend/src/core/chart/charts/per-user-following.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 e4900772bb..0db0e6f07f 100644 --- a/packages/backend/src/core/chart/charts/per-user-notes.ts +++ b/packages/backend/src/core/chart/charts/per-user-notes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 31708fefa8..cf1b4c71f6 100644 --- a/packages/backend/src/core/chart/charts/per-user-pv.ts +++ b/packages/backend/src/core/chart/charts/per-user-pv.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 c29c4d2870..9f4f6e9651 100644 --- a/packages/backend/src/core/chart/charts/per-user-reactions.ts +++ b/packages/backend/src/core/chart/charts/per-user-reactions.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/test-grouped.ts b/packages/backend/src/core/chart/charts/test-grouped.ts index 7a2844f4ed..00fb872237 100644 --- a/packages/backend/src/core/chart/charts/test-grouped.ts +++ b/packages/backend/src/core/chart/charts/test-grouped.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/test-intersection.ts b/packages/backend/src/core/chart/charts/test-intersection.ts index b8d0556c9f..45a7e805c5 100644 --- a/packages/backend/src/core/chart/charts/test-intersection.ts +++ b/packages/backend/src/core/chart/charts/test-intersection.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/test-unique.ts b/packages/backend/src/core/chart/charts/test-unique.ts index f94e008059..e9d38eaf13 100644 --- a/packages/backend/src/core/chart/charts/test-unique.ts +++ b/packages/backend/src/core/chart/charts/test-unique.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/test.ts b/packages/backend/src/core/chart/charts/test.ts index a90dc8f99b..4dd6063b5b 100644 --- a/packages/backend/src/core/chart/charts/test.ts +++ b/packages/backend/src/core/chart/charts/test.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/charts/users.ts b/packages/backend/src/core/chart/charts/users.ts index d148fc629b..c2026c2aea 100644 --- a/packages/backend/src/core/chart/charts/users.ts +++ b/packages/backend/src/core/chart/charts/users.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/chart/core.ts b/packages/backend/src/core/chart/core.ts index af5485a46e..8d0a89f2d6 100644 --- a/packages/backend/src/core/chart/core.ts +++ b/packages/backend/src/core/chart/core.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -14,8 +14,7 @@ import { EntitySchema, LessThan, Between } from 'typeorm'; import { dateUTC, isTimeSame, isTimeBefore, subtractTime, addTime } from '@/misc/prelude/time.js'; import type Logger from '@/logger.js'; import { bindThis } from '@/decorators.js'; -import { MiRepository, miRepository } from '@/models/_.js'; -import type { DataSource, Repository } from 'typeorm'; +import type { Repository, DataSource } from 'typeorm'; const COLUMN_PREFIX = '___' as const; const UNIQUE_TEMP_COLUMN_PREFIX = 'unique_temp___' as const; @@ -95,29 +94,6 @@ type ToJsonSchema = { }; export function getJsonSchema(schema: S): ToJsonSchema>> { - const unflatten = (str: string, parent: Record) => { - const keys = str.split('.'); - const key = keys.shift(); - const nextKey = keys[0]; - - if (key == null) return; - - if (parent.properties[key] == null) { - parent.properties[key] = nextKey ? { - type: 'object', - properties: {}, - required: [], - } : { - type: 'array', - items: { - type: 'number', - }, - }; - } - - if (nextKey) unflatten(keys.join('.'), parent.properties[key] as Record); - }; - const jsonSchema = { type: 'object', properties: {} as Record, @@ -125,7 +101,10 @@ export function getJsonSchema(schema: S): ToJsonSchema>>; @@ -146,10 +125,10 @@ export default abstract class Chart { group: string | null; }[] = []; // ↓にしたいけどfindOneとかで型エラーになる - //private repositoryForHour: Repository> & MiRepository>; - //private repositoryForDay: Repository> & MiRepository>; - private repositoryForHour: Repository<{ id: number; group?: string | null; date: number; }> & MiRepository<{ id: number; group?: string | null; date: number; }>; - private repositoryForDay: Repository<{ id: number; group?: string | null; date: number; }> & MiRepository<{ id: number; group?: string | null; date: number; }>; + //private repositoryForHour: Repository>; + //private repositoryForDay: Repository>; + private repositoryForHour: Repository<{ id: number; group?: string | null; date: number; }>; + private repositoryForDay: Repository<{ id: number; group?: string | null; date: number; }>; /** * 1日に一回程度実行されれば良いような計算処理を入れる(主にCASCADE削除などアプリケーション側で感知できない変動によるズレの修正用) @@ -212,10 +191,6 @@ export default abstract class Chart { } { const createEntity = (span: 'hour' | 'day'): EntitySchema => new EntitySchema({ name: - span === 'hour' ? `ChartX${name}` : - span === 'day' ? `ChartDayX${name}` : - new Error('not happen') as never, - tableName: span === 'hour' ? `__chart__${camelToSnake(name)}` : span === 'day' ? `__chart_day__${camelToSnake(name)}` : new Error('not happen') as never, @@ -276,8 +251,8 @@ export default abstract class Chart { this.logger = logger; const { hour, day } = Chart.schemaToEntity(name, schema, grouped); - this.repositoryForHour = db.getRepository<{ id: number; group?: string | null; date: number; }>(hour).extend(miRepository as MiRepository<{ id: number; group?: string | null; date: number; }>); - this.repositoryForDay = db.getRepository<{ id: number; group?: string | null; date: number; }>(day).extend(miRepository as MiRepository<{ id: number; group?: string | null; date: number; }>); + this.repositoryForHour = db.getRepository<{ id: number; group?: string | null; date: number; }>(hour); + this.repositoryForDay = db.getRepository<{ id: number; group?: string | null; date: number; }>(day); } @bindThis @@ -392,11 +367,11 @@ export default abstract class Chart { } // 新規ログ挿入 - log = await repository.insertOne({ + log = await repository.insert({ date: date, ...(group ? { group: group } : {}), ...columns, - }) as RawRecord; + }).then(x => repository.findOneByOrFail(x.identifiers[0])) as RawRecord; this.logger.info(`${this.name + (group ? `:${group}` : '')}(${span}): New commit created`); @@ -464,15 +439,13 @@ export default abstract class Chart { } } - // bake cardinality + // bake unique count for (const [k, v] of Object.entries(finalDiffs)) { if (this.schema[k].uniqueIncrement) { const name = COLUMN_PREFIX + k.replaceAll('.', COLUMN_DELIMITER) as keyof Columns; const tempColumnName = UNIQUE_TEMP_COLUMN_PREFIX + k.replaceAll('.', COLUMN_DELIMITER) as keyof TempColumnsForUnique; - const cardinalityOfHour = new Set([...(v as string[]), ...(logHour[tempColumnName] as unknown as string[])]).size; - const cardinalityOfDay = new Set([...(v as string[]), ...(logDay[tempColumnName] as unknown as string[])]).size; - queryForHour[name] = cardinalityOfHour; - queryForDay[name] = cardinalityOfDay; + queryForHour[name] = new Set([...(v as string[]), ...(logHour[tempColumnName] as unknown as string[])]).size; + queryForDay[name] = new Set([...(v as string[]), ...(logDay[tempColumnName] as unknown as string[])]).size; } } @@ -644,7 +617,7 @@ export default abstract class Chart { // 要求された範囲にログがひとつもなかったら if (logs.length === 0) { // もっとも新しいログを持ってくる - // (すくなくともひとつログが無いと補間できないため) + // (すくなくともひとつログが無いと隙間埋めできないため) const recentLog = await repository.findOne({ where: group ? { group: group, @@ -661,7 +634,7 @@ export default abstract class Chart { // 要求された範囲の最も古い箇所に位置するログが存在しなかったら } else if (!isTimeSame(new Date(logs.at(-1)!.date * 1000), gt)) { // 要求された範囲の最も古い箇所時点での最も新しいログを持ってきて末尾に追加する - // (補間できないため) + // (隙間埋めできないため) const outdatedLog = await repository.findOne({ where: { date: LessThan(Chart.dateToTimestamp(gt)), @@ -690,7 +663,7 @@ export default abstract class Chart { if (log) { chart.unshift(this.convertRawRecord(log)); } else { - // 補間 + // 隙間埋め const latest = logs.find(l => isTimeBefore(new Date(l.date * 1000), current)); const data = latest ? this.convertRawRecord(latest) : null; chart.unshift(this.getNewLog(data)); diff --git a/packages/backend/src/core/chart/entities.ts b/packages/backend/src/core/chart/entities.ts index e424f2c8c5..b6a1299a2f 100644 --- a/packages/backend/src/core/chart/entities.ts +++ b/packages/backend/src/core/chart/entities.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/entities/AbuseReportNotificationRecipientEntityService.ts b/packages/backend/src/core/entities/AbuseReportNotificationRecipientEntityService.ts deleted file mode 100644 index 1e23c194c5..0000000000 --- a/packages/backend/src/core/entities/AbuseReportNotificationRecipientEntityService.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { In } from 'typeorm'; -import { DI } from '@/di-symbols.js'; -import type { AbuseReportNotificationRecipientRepository, MiAbuseReportNotificationRecipient } from '@/models/_.js'; -import { bindThis } from '@/decorators.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import { Packed } from '@/misc/json-schema.js'; -import { SystemWebhookEntityService } from '@/core/entities/SystemWebhookEntityService.js'; - -@Injectable() -export class AbuseReportNotificationRecipientEntityService { - constructor( - @Inject(DI.abuseReportNotificationRecipientRepository) - private abuseReportNotificationRecipientRepository: AbuseReportNotificationRecipientRepository, - private userEntityService: UserEntityService, - private systemWebhookEntityService: SystemWebhookEntityService, - ) { - } - - @bindThis - public async pack( - src: MiAbuseReportNotificationRecipient['id'] | MiAbuseReportNotificationRecipient, - opts?: { - users: Map>, - webhooks: Map>, - }, - ): Promise> { - const recipient = typeof src === 'object' - ? src - : await this.abuseReportNotificationRecipientRepository.findOneByOrFail({ id: src }); - const user = recipient.userId - ? (opts?.users.get(recipient.userId) ?? await this.userEntityService.pack<'UserLite'>(recipient.userId)) - : undefined; - const webhook = recipient.systemWebhookId - ? (opts?.webhooks.get(recipient.systemWebhookId) ?? await this.systemWebhookEntityService.pack(recipient.systemWebhookId)) - : undefined; - - return { - id: recipient.id, - isActive: recipient.isActive, - updatedAt: recipient.updatedAt.toISOString(), - name: recipient.name, - method: recipient.method, - userId: recipient.userId ?? undefined, - user: user, - systemWebhookId: recipient.systemWebhookId ?? undefined, - systemWebhook: webhook, - }; - } - - @bindThis - public async packMany( - src: MiAbuseReportNotificationRecipient['id'][] | MiAbuseReportNotificationRecipient[], - ): Promise[]> { - const objs = src.filter((it): it is MiAbuseReportNotificationRecipient => typeof it === 'object'); - const ids = src.filter((it): it is MiAbuseReportNotificationRecipient['id'] => typeof it === 'string'); - if (ids.length > 0) { - objs.push( - ...await this.abuseReportNotificationRecipientRepository.findBy({ id: In(ids) }), - ); - } - - const userIds = objs.map(it => it.userId).filter(x => x != null); - const users: Map> = (userIds.length > 0) - ? await this.userEntityService.packMany(userIds) - .then(it => new Map(it.map(it => [it.id, it]))) - : new Map(); - - const systemWebhookIds = objs.map(it => it.systemWebhookId).filter(x => x != null); - const systemWebhooks: Map> = (systemWebhookIds.length > 0) - ? await this.systemWebhookEntityService.packMany(systemWebhookIds) - .then(it => new Map(it.map(it => [it.id, it]))) - : new Map(); - - return Promise - .all( - objs.map(it => this.pack(it, { users: users, webhooks: systemWebhooks })), - ) - .then(it => it.sort((a, b) => a.id.localeCompare(b.id))); - } -} - diff --git a/packages/backend/src/core/entities/AbuseUserReportEntityService.ts b/packages/backend/src/core/entities/AbuseUserReportEntityService.ts index 70ead890ab..97de891ece 100644 --- a/packages/backend/src/core/entities/AbuseUserReportEntityService.ts +++ b/packages/backend/src/core/entities/AbuseUserReportEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,7 +10,6 @@ import { awaitAll } from '@/misc/prelude/await-all.js'; import type { MiAbuseUserReport } from '@/models/AbuseUserReport.js'; import { bindThis } from '@/decorators.js'; import { IdService } from '@/core/IdService.js'; -import type { Packed } from '@/misc/json-schema.js'; import { UserEntityService } from './UserEntityService.js'; @Injectable() @@ -27,11 +26,6 @@ export class AbuseUserReportEntityService { @bindThis public async pack( src: MiAbuseUserReport['id'] | MiAbuseUserReport, - hint?: { - packedReporter?: Packed<'UserDetailedNotMe'>, - packedTargetUser?: Packed<'UserDetailedNotMe'>, - packedAssignee?: Packed<'UserDetailedNotMe'>, - }, ) { const report = typeof src === 'object' ? src : await this.abuseUserReportsRepository.findOneByOrFail({ id: src }); @@ -43,40 +37,23 @@ export class AbuseUserReportEntityService { reporterId: report.reporterId, targetUserId: report.targetUserId, assigneeId: report.assigneeId, - reporter: hint?.packedReporter ?? this.userEntityService.pack(report.reporter ?? report.reporterId, null, { - schema: 'UserDetailedNotMe', + reporter: this.userEntityService.pack(report.reporter ?? report.reporterId, null, { + detail: true, }), - targetUser: hint?.packedTargetUser ?? this.userEntityService.pack(report.targetUser ?? report.targetUserId, null, { - schema: 'UserDetailedNotMe', + targetUser: this.userEntityService.pack(report.targetUser ?? report.targetUserId, null, { + detail: true, }), - assignee: report.assigneeId ? hint?.packedAssignee ?? this.userEntityService.pack(report.assignee ?? report.assigneeId, null, { - schema: 'UserDetailedNotMe', + assignee: report.assigneeId ? this.userEntityService.pack(report.assignee ?? report.assigneeId, null, { + detail: true, }) : null, forwarded: report.forwarded, - resolvedAs: report.resolvedAs, - moderationNote: report.moderationNote, }); } @bindThis - public async packMany( - reports: MiAbuseUserReport[], + public packMany( + reports: any[], ) { - const _reporters = reports.map(({ reporter, reporterId }) => reporter ?? reporterId); - const _targetUsers = reports.map(({ targetUser, targetUserId }) => targetUser ?? targetUserId); - const _assignees = reports.map(({ assignee, assigneeId }) => assignee ?? assigneeId).filter(x => x != null); - const _userMap = await this.userEntityService.packMany( - [..._reporters, ..._targetUsers, ..._assignees], - null, - { schema: 'UserDetailedNotMe' }, - ).then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all( - reports.map(report => { - const packedReporter = _userMap.get(report.reporterId); - const packedTargetUser = _userMap.get(report.targetUserId); - const packedAssignee = report.assigneeId != null ? _userMap.get(report.assigneeId) : undefined; - return this.pack(report, { packedReporter, packedTargetUser, packedAssignee }); - }), - ); + return Promise.all(reports.map(x => this.pack(x))); } } diff --git a/packages/backend/src/core/entities/AnnouncementEntityService.ts b/packages/backend/src/core/entities/AnnouncementEntityService.ts deleted file mode 100644 index 90b04d0229..0000000000 --- a/packages/backend/src/core/entities/AnnouncementEntityService.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { DI } from '@/di-symbols.js'; -import type { AnnouncementsRepository, AnnouncementReadsRepository, MiAnnouncement, MiUser } from '@/models/_.js'; -import type { Packed } from '@/misc/json-schema.js'; -import { bindThis } from '@/decorators.js'; -import { IdService } from '@/core/IdService.js'; - -@Injectable() -export class AnnouncementEntityService { - constructor( - @Inject(DI.announcementsRepository) - private announcementsRepository: AnnouncementsRepository, - - @Inject(DI.announcementReadsRepository) - private announcementReadsRepository: AnnouncementReadsRepository, - - private idService: IdService, - ) { - } - - @bindThis - public async pack( - src: MiAnnouncement['id'] | MiAnnouncement & { isRead?: boolean | null }, - me?: { id: MiUser['id'] } | null | undefined, - ): Promise> { - const announcement = typeof src === 'object' - ? src - : await this.announcementsRepository.findOneByOrFail({ - id: src, - }) as MiAnnouncement & { isRead?: boolean | null }; - - if (me && announcement.isRead === undefined) { - announcement.isRead = await this.announcementReadsRepository - .countBy({ - announcementId: announcement.id, - userId: me.id, - }) - .then((count: number) => count > 0); - } - - return { - id: announcement.id, - createdAt: this.idService.parse(announcement.id).date.toISOString(), - updatedAt: announcement.updatedAt?.toISOString() ?? null, - title: announcement.title, - text: announcement.text, - imageUrl: announcement.imageUrl, - icon: announcement.icon, - display: announcement.display, - forYou: announcement.userId === me?.id, - needConfirmationToRead: announcement.needConfirmationToRead, - silence: announcement.silence, - isRead: announcement.isRead !== null ? announcement.isRead : undefined, - }; - } - - @bindThis - public async packMany( - announcements: (MiAnnouncement['id'] | MiAnnouncement & { isRead?: boolean | null } | MiAnnouncement)[], - me?: { id: MiUser['id'] } | null | undefined, - ) : Promise[]> { - return (await Promise.allSettled(announcements.map(x => this.pack(x, me)))) - .filter(result => result.status === 'fulfilled') - .map(result => (result as PromiseFulfilledResult>).value); - } -} diff --git a/packages/backend/src/core/entities/AntennaEntityService.ts b/packages/backend/src/core/entities/AntennaEntityService.ts index e770028af3..265a61e8ad 100644 --- a/packages/backend/src/core/entities/AntennaEntityService.ts +++ b/packages/backend/src/core/entities/AntennaEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -38,12 +38,11 @@ export class AntennaEntityService { users: antenna.users, caseSensitive: antenna.caseSensitive, localOnly: antenna.localOnly, - excludeBots: antenna.excludeBots, + notify: antenna.notify, withReplies: antenna.withReplies, withFile: antenna.withFile, isActive: antenna.isActive, hasUnreadNote: false, // TODO - notify: false, // 後方互換性のため }; } } diff --git a/packages/backend/src/core/entities/AppEntityService.ts b/packages/backend/src/core/entities/AppEntityService.ts index 785b84689a..14a93cda5b 100644 --- a/packages/backend/src/core/entities/AppEntityService.ts +++ b/packages/backend/src/core/entities/AppEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/entities/AuthSessionEntityService.ts b/packages/backend/src/core/entities/AuthSessionEntityService.ts index 72873680c9..fd356cc89d 100644 --- a/packages/backend/src/core/entities/AuthSessionEntityService.ts +++ b/packages/backend/src/core/entities/AuthSessionEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/entities/BlockingEntityService.ts b/packages/backend/src/core/entities/BlockingEntityService.ts index 1e699032e2..b4760346b7 100644 --- a/packages/backend/src/core/entities/BlockingEntityService.ts +++ b/packages/backend/src/core/entities/BlockingEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -29,9 +29,6 @@ export class BlockingEntityService { public async pack( src: MiBlocking['id'] | MiBlocking, me?: { id: MiUser['id'] } | null | undefined, - hint?: { - blockee?: Packed<'UserDetailedNotMe'>, - }, ): Promise> { const blocking = typeof src === 'object' ? src : await this.blockingsRepository.findOneByOrFail({ id: src }); @@ -39,20 +36,17 @@ export class BlockingEntityService { id: blocking.id, createdAt: this.idService.parse(blocking.id).date.toISOString(), blockeeId: blocking.blockeeId, - blockee: hint?.blockee ?? this.userEntityService.pack(blocking.blockeeId, me, { - schema: 'UserDetailedNotMe', + blockee: this.userEntityService.pack(blocking.blockeeId, me, { + detail: true, }), }); } @bindThis - public async packMany( - blockings: MiBlocking[], + public packMany( + blockings: any[], me: { id: MiUser['id'] }, ) { - const _blockees = blockings.map(({ blockee, blockeeId }) => blockee ?? blockeeId); - const _userMap = await this.userEntityService.packMany(_blockees, me, { schema: 'UserDetailedNotMe' }) - .then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all(blockings.map(blocking => this.pack(blocking, me, { blockee: _userMap.get(blocking.blockeeId) }))); + return Promise.all(blockings.map(x => this.pack(x, me))); } } diff --git a/packages/backend/src/core/entities/ChannelEntityService.ts b/packages/backend/src/core/entities/ChannelEntityService.ts index 1ba7ca8e57..305946b8a6 100644 --- a/packages/backend/src/core/entities/ChannelEntityService.ts +++ b/packages/backend/src/core/entities/ChannelEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -51,14 +51,14 @@ export class ChannelEntityService { const banner = channel.bannerId ? await this.driveFilesRepository.findOneBy({ id: channel.bannerId }) : null; - const isFollowing = meId ? await this.channelFollowingsRepository.exists({ + const isFollowing = meId ? await this.channelFollowingsRepository.exist({ where: { followerId: meId, followeeId: channel.id, }, }) : false; - const isFavorited = meId ? await this.channelFavoritesRepository.exists({ + const isFavorited = meId ? await this.channelFavoritesRepository.exist({ where: { userId: meId, channelId: channel.id, diff --git a/packages/backend/src/core/entities/ClipEntityService.ts b/packages/backend/src/core/entities/ClipEntityService.ts index d915645906..96422894fd 100644 --- a/packages/backend/src/core/entities/ClipEntityService.ts +++ b/packages/backend/src/core/entities/ClipEntityService.ts @@ -1,11 +1,11 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { ClipNotesRepository, ClipFavoritesRepository, ClipsRepository, MiUser } from '@/models/_.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 { } from '@/models/Blocking.js'; @@ -20,9 +20,6 @@ export class ClipEntityService { @Inject(DI.clipsRepository) private clipsRepository: ClipsRepository, - @Inject(DI.clipNotesRepository) - private clipNotesRepository: ClipNotesRepository, - @Inject(DI.clipFavoritesRepository) private clipFavoritesRepository: ClipFavoritesRepository, @@ -35,9 +32,6 @@ export class ClipEntityService { public async pack( src: MiClip['id'] | MiClip, me?: { id: MiUser['id'] } | null | undefined, - hint?: { - packedUser?: Packed<'UserLite'> - }, ): Promise> { const meId = me ? me.id : null; const clip = typeof src === 'object' ? src : await this.clipsRepository.findOneByOrFail({ id: src }); @@ -47,25 +41,21 @@ export class ClipEntityService { createdAt: this.idService.parse(clip.id).date.toISOString(), lastClippedAt: clip.lastClippedAt ? clip.lastClippedAt.toISOString() : null, userId: clip.userId, - user: hint?.packedUser ?? this.userEntityService.pack(clip.user ?? clip.userId), + user: this.userEntityService.pack(clip.user ?? clip.userId), name: clip.name, description: clip.description, isPublic: clip.isPublic, favoritedCount: await this.clipFavoritesRepository.countBy({ clipId: clip.id }), - isFavorited: meId ? await this.clipFavoritesRepository.exists({ where: { clipId: clip.id, userId: meId } }) : undefined, - notesCount: (meId === clip.userId) ? await this.clipNotesRepository.countBy({ clipId: clip.id }) : undefined, + isFavorited: meId ? await this.clipFavoritesRepository.exist({ where: { clipId: clip.id, userId: meId } }) : undefined, }); } @bindThis - public async packMany( + public packMany( clips: MiClip[], me?: { id: MiUser['id'] } | null | undefined, ) { - const _users = clips.map(({ user, userId }) => user ?? userId); - const _userMap = await this.userEntityService.packMany(_users, me) - .then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all(clips.map(clip => this.pack(clip, me, { packedUser: _userMap.get(clip.userId) }))); + return Promise.all(clips.map(x => this.pack(x, me))); } } diff --git a/packages/backend/src/core/entities/DriveFileEntityService.ts b/packages/backend/src/core/entities/DriveFileEntityService.ts index c485555f90..14be000367 100644 --- a/packages/backend/src/core/entities/DriveFileEntityService.ts +++ b/packages/backend/src/core/entities/DriveFileEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -16,6 +16,7 @@ import { appendQuery, query } from '@/misc/prelude/url.js'; import { deepClone } from '@/misc/clone.js'; import { bindThis } from '@/decorators.js'; import { isMimeImage } from '@/misc/is-mime-image.js'; +import { isNotNull } from '@/misc/is-not-null.js'; import { IdService } from '@/core/IdService.js'; import { UtilityService } from '../UtilityService.js'; import { VideoProcessingService } from '../VideoProcessingService.js'; @@ -221,9 +222,6 @@ export class DriveFileEntityService { public async packNullable( src: MiDriveFile['id'] | MiDriveFile, options?: PackOptions, - hint?: { - packedUser?: Packed<'UserLite'> - }, ): Promise | null> { const opts = Object.assign({ detail: false, @@ -250,8 +248,8 @@ export class DriveFileEntityService { folder: opts.detail && file.folderId ? this.driveFolderEntityService.pack(file.folderId, { detail: true, }) : null, - userId: file.userId, - user: (opts.withUser && file.userId) ? hint?.packedUser ?? this.userEntityService.pack(file.userId) : null, + userId: opts.withUser ? file.userId : null, + user: (opts.withUser && file.userId) ? this.userEntityService.pack(file.userId) : null, }); } @@ -260,11 +258,8 @@ export class DriveFileEntityService { files: MiDriveFile[], options?: PackOptions, ): Promise[]> { - const _user = files.map(({ user, userId }) => user ?? userId).filter(x => x != null); - const _userMap = await this.userEntityService.packMany(_user) - .then(users => new Map(users.map(user => [user.id, user]))); - const items = await Promise.all(files.map(f => this.packNullable(f, options, f.userId ? { packedUser: _userMap.get(f.userId) } : {}))); - return items.filter(x => x != null); + const items = await Promise.all(files.map(f => this.packNullable(f, options))); + return items.filter((x): x is Packed<'DriveFile'> => x != null); } @bindThis @@ -289,6 +284,6 @@ export class DriveFileEntityService { ): Promise[]> { if (fileIds.length === 0) return []; const filesMap = await this.packManyByIdsMap(fileIds, options); - return fileIds.map(id => filesMap.get(id)).filter(x => x != null); + return fileIds.map(id => filesMap.get(id)).filter(isNotNull); } } diff --git a/packages/backend/src/core/entities/DriveFolderEntityService.ts b/packages/backend/src/core/entities/DriveFolderEntityService.ts index 299f23ad38..8fa78154b9 100644 --- a/packages/backend/src/core/entities/DriveFolderEntityService.ts +++ b/packages/backend/src/core/entities/DriveFolderEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/entities/EmojiEntityService.ts b/packages/backend/src/core/entities/EmojiEntityService.ts index 841bd731c0..5b97cfad5e 100644 --- a/packages/backend/src/core/entities/EmojiEntityService.ts +++ b/packages/backend/src/core/entities/EmojiEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -31,7 +31,6 @@ export class EmojiEntityService { category: emoji.category, // || emoji.originalUrl してるのは後方互換性のため(publicUrlはstringなので??はだめ) url: emoji.publicUrl || emoji.originalUrl, - localOnly: emoji.localOnly ? true : undefined, isSensitive: emoji.isSensitive ? true : undefined, roleIdsThatCanBeUsedThisEmojiAsReaction: emoji.roleIdsThatCanBeUsedThisEmojiAsReaction.length > 0 ? emoji.roleIdsThatCanBeUsedThisEmojiAsReaction : undefined, }; diff --git a/packages/backend/src/core/entities/FlashEntityService.ts b/packages/backend/src/core/entities/FlashEntityService.ts index 7b0150f5b6..dc335d9975 100644 --- a/packages/backend/src/core/entities/FlashEntityService.ts +++ b/packages/backend/src/core/entities/FlashEntityService.ts @@ -1,12 +1,14 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { FlashLikesRepository, FlashsRepository } from '@/models/_.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 { } from '@/models/Blocking.js'; import type { MiUser } from '@/models/User.js'; import type { MiFlash } from '@/models/Flash.js'; import { bindThis } from '@/decorators.js'; @@ -18,8 +20,10 @@ export class FlashEntityService { constructor( @Inject(DI.flashsRepository) private flashsRepository: FlashsRepository, + @Inject(DI.flashLikesRepository) private flashLikesRepository: FlashLikesRepository, + private userEntityService: UserEntityService, private idService: IdService, ) { @@ -29,60 +33,30 @@ export class FlashEntityService { public async pack( src: MiFlash['id'] | MiFlash, me?: { id: MiUser['id'] } | null | undefined, - hint?: { - packedUser?: Packed<'UserLite'>, - likedFlashIds?: MiFlash['id'][], - }, ): Promise> { const meId = me ? me.id : null; const flash = typeof src === 'object' ? src : await this.flashsRepository.findOneByOrFail({ id: src }); - // { schema: 'UserDetailed' } すると無限ループするので注意 - const user = hint?.packedUser ?? await this.userEntityService.pack(flash.user ?? flash.userId, me); - - let isLiked = undefined; - if (meId) { - isLiked = hint?.likedFlashIds - ? hint.likedFlashIds.includes(flash.id) - : await this.flashLikesRepository.exists({ where: { flashId: flash.id, userId: meId } }); - } - - return { + return await awaitAll({ id: flash.id, createdAt: this.idService.parse(flash.id).date.toISOString(), updatedAt: flash.updatedAt.toISOString(), userId: flash.userId, - user: user, + user: this.userEntityService.pack(flash.user ?? flash.userId, me), // { detail: true } すると無限ループするので注意 title: flash.title, summary: flash.summary, script: flash.script, - visibility: flash.visibility, likedCount: flash.likedCount, - isLiked: isLiked, - }; + isLiked: meId ? await this.flashLikesRepository.exist({ where: { flashId: flash.id, userId: meId } }) : undefined, + }); } @bindThis - public async packMany( - flashes: MiFlash[], + public packMany( + flashs: MiFlash[], me?: { id: MiUser['id'] } | null | undefined, ) { - const _users = flashes.map(({ user, userId }) => user ?? userId); - const _userMap = await this.userEntityService.packMany(_users, me) - .then(users => new Map(users.map(u => [u.id, u]))); - const _likedFlashIds = me - ? await this.flashLikesRepository.createQueryBuilder('flashLike') - .select('flashLike.flashId') - .where('flashLike.userId = :userId', { userId: me.id }) - .getRawMany<{ flashLike_flashId: string }>() - .then(likes => [...new Set(likes.map(like => like.flashLike_flashId))]) - : []; - return Promise.all( - flashes.map(flash => this.pack(flash, me, { - packedUser: _userMap.get(flash.userId), - likedFlashIds: _likedFlashIds, - })), - ); + return Promise.all(flashs.map(x => this.pack(x, me))); } } diff --git a/packages/backend/src/core/entities/FlashLikeEntityService.ts b/packages/backend/src/core/entities/FlashLikeEntityService.ts index 6e0b9d6e11..2eff86217a 100644 --- a/packages/backend/src/core/entities/FlashLikeEntityService.ts +++ b/packages/backend/src/core/entities/FlashLikeEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/entities/FollowRequestEntityService.ts b/packages/backend/src/core/entities/FollowRequestEntityService.ts index 0101ec8aa7..0e0fec9f46 100644 --- a/packages/backend/src/core/entities/FollowRequestEntityService.ts +++ b/packages/backend/src/core/entities/FollowRequestEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,7 +10,6 @@ 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 type { Packed } from '@/misc/json-schema.js'; import { UserEntityService } from './UserEntityService.js'; @Injectable() @@ -27,36 +26,14 @@ export class FollowRequestEntityService { public async pack( src: MiFollowRequest['id'] | MiFollowRequest, me?: { id: MiUser['id'] } | null | undefined, - hint?: { - packedFollower?: Packed<'UserLite'>, - packedFollowee?: Packed<'UserLite'>, - }, ) { const request = typeof src === 'object' ? src : await this.followRequestsRepository.findOneByOrFail({ id: src }); return { id: request.id, - follower: hint?.packedFollower ?? await this.userEntityService.pack(request.followerId, me), - followee: hint?.packedFollowee ?? await this.userEntityService.pack(request.followeeId, me), + follower: await this.userEntityService.pack(request.followerId, me), + followee: await this.userEntityService.pack(request.followeeId, me), }; } - - @bindThis - public async packMany( - requests: MiFollowRequest[], - me?: { id: MiUser['id'] } | null | undefined, - ) { - const _followers = requests.map(({ follower, followerId }) => follower ?? followerId); - const _followees = requests.map(({ followee, followeeId }) => followee ?? followeeId); - const _userMap = await this.userEntityService.packMany([..._followers, ..._followees], me) - .then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all( - requests.map(req => { - const packedFollower = _userMap.get(req.followerId); - const packedFollowee = _userMap.get(req.followeeId); - return this.pack(req, me, { packedFollower, packedFollowee }); - }), - ); - } } diff --git a/packages/backend/src/core/entities/FollowingEntityService.ts b/packages/backend/src/core/entities/FollowingEntityService.ts index d2dbaf2270..52aa979677 100644 --- a/packages/backend/src/core/entities/FollowingEntityService.ts +++ b/packages/backend/src/core/entities/FollowingEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -78,10 +78,6 @@ export class FollowingEntityService { populateFollowee?: boolean; populateFollower?: boolean; }, - hint?: { - packedFollowee?: Packed<'UserDetailedNotMe'>, - packedFollower?: Packed<'UserDetailedNotMe'>, - }, ): Promise> { const following = typeof src === 'object' ? src : await this.followingsRepository.findOneByOrFail({ id: src }); @@ -92,35 +88,25 @@ export class FollowingEntityService { createdAt: this.idService.parse(following.id).date.toISOString(), followeeId: following.followeeId, followerId: following.followerId, - followee: opts.populateFollowee ? hint?.packedFollowee ?? this.userEntityService.pack(following.followee ?? following.followeeId, me, { - schema: 'UserDetailedNotMe', + followee: opts.populateFollowee ? this.userEntityService.pack(following.followee ?? following.followeeId, me, { + detail: true, }) : undefined, - follower: opts.populateFollower ? hint?.packedFollower ?? this.userEntityService.pack(following.follower ?? following.followerId, me, { - schema: 'UserDetailedNotMe', + follower: opts.populateFollower ? this.userEntityService.pack(following.follower ?? following.followerId, me, { + detail: true, }) : undefined, }); } @bindThis - public async packMany( - followings: MiFollowing[], + public packMany( + followings: any[], me?: { id: MiUser['id'] } | null | undefined, opts?: { populateFollowee?: boolean; populateFollower?: boolean; }, ) { - const _followees = opts?.populateFollowee ? followings.map(({ followee, followeeId }) => followee ?? followeeId) : []; - const _followers = opts?.populateFollower ? followings.map(({ follower, followerId }) => follower ?? followerId) : []; - const _userMap = await this.userEntityService.packMany([..._followees, ..._followers], me, { schema: 'UserDetailedNotMe' }) - .then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all( - followings.map(following => { - const packedFollowee = opts?.populateFollowee ? _userMap.get(following.followeeId) : undefined; - const packedFollower = opts?.populateFollower ? _userMap.get(following.followerId) : undefined; - return this.pack(following, me, opts, { packedFollowee, packedFollower }); - }), - ); + return Promise.all(followings.map(x => this.pack(x, me, opts))); } } diff --git a/packages/backend/src/core/entities/GalleryLikeEntityService.ts b/packages/backend/src/core/entities/GalleryLikeEntityService.ts index f199a81b4d..e740701888 100644 --- a/packages/backend/src/core/entities/GalleryLikeEntityService.ts +++ b/packages/backend/src/core/entities/GalleryLikeEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/entities/GalleryPostEntityService.ts b/packages/backend/src/core/entities/GalleryPostEntityService.ts index 9746a4c1af..d7b960e0d9 100644 --- a/packages/backend/src/core/entities/GalleryPostEntityService.ts +++ b/packages/backend/src/core/entities/GalleryPostEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -35,9 +35,6 @@ export class GalleryPostEntityService { public async pack( src: MiGalleryPost['id'] | MiGalleryPost, me?: { id: MiUser['id'] } | null | undefined, - hint?: { - packedUser?: Packed<'UserLite'> - }, ): Promise> { const meId = me ? me.id : null; const post = typeof src === 'object' ? src : await this.galleryPostsRepository.findOneByOrFail({ id: src }); @@ -47,7 +44,7 @@ export class GalleryPostEntityService { createdAt: this.idService.parse(post.id).date.toISOString(), updatedAt: post.updatedAt.toISOString(), userId: post.userId, - user: hint?.packedUser ?? this.userEntityService.pack(post.user ?? post.userId, me), + user: this.userEntityService.pack(post.user ?? post.userId, me), title: post.title, description: post.description, fileIds: post.fileIds, @@ -56,19 +53,16 @@ export class GalleryPostEntityService { tags: post.tags.length > 0 ? post.tags : undefined, isSensitive: post.isSensitive, likedCount: post.likedCount, - isLiked: meId ? await this.galleryLikesRepository.exists({ where: { postId: post.id, userId: meId } }) : undefined, + isLiked: meId ? await this.galleryLikesRepository.exist({ where: { postId: post.id, userId: meId } }) : undefined, }); } @bindThis - public async packMany( + public packMany( posts: MiGalleryPost[], me?: { id: MiUser['id'] } | null | undefined, ) { - const _users = posts.map(({ user, userId }) => user ?? userId); - const _userMap = await this.userEntityService.packMany(_users, me) - .then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all(posts.map(post => this.pack(post, me, { packedUser: _userMap.get(post.userId) }))); + return Promise.all(posts.map(x => this.pack(x, me))); } } diff --git a/packages/backend/src/core/entities/HashtagEntityService.ts b/packages/backend/src/core/entities/HashtagEntityService.ts index d798b15807..006e267b12 100644 --- a/packages/backend/src/core/entities/HashtagEntityService.ts +++ b/packages/backend/src/core/entities/HashtagEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/entities/InstanceEntityService.ts b/packages/backend/src/core/entities/InstanceEntityService.ts index 284537b986..7d16a7a80e 100644 --- a/packages/backend/src/core/entities/InstanceEntityService.ts +++ b/packages/backend/src/core/entities/InstanceEntityService.ts @@ -1,25 +1,19 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import type { Packed } from '@/misc/json-schema.js'; import type { MiInstance } from '@/models/Instance.js'; +import { MetaService } from '@/core/MetaService.js'; import { bindThis } from '@/decorators.js'; -import { UtilityService } from '@/core/UtilityService.js'; -import { RoleService } from '@/core/RoleService.js'; -import { MiUser } from '@/models/User.js'; -import { DI } from '@/di-symbols.js'; -import { MiMeta } from '@/models/_.js'; +import { UtilityService } from '../UtilityService.js'; @Injectable() export class InstanceEntityService { constructor( - @Inject(DI.meta) - private meta: MiMeta, - - private roleService: RoleService, + private metaService: MetaService, private utilityService: UtilityService, ) { @@ -28,10 +22,8 @@ export class InstanceEntityService { @bindThis public async pack( instance: MiInstance, - me?: { id: MiUser['id']; } | null | undefined, ): Promise> { - const iAmModerator = me ? await this.roleService.isModerator(me as MiUser) : false; - + const meta = await this.metaService.fetch(); return { id: instance.id, firstRetrievedAt: instance.firstRetrievedAt.toISOString(), @@ -41,9 +33,8 @@ export class InstanceEntityService { followingCount: instance.followingCount, followersCount: instance.followersCount, isNotResponding: instance.isNotResponding, - isSuspended: instance.suspensionState !== 'none', - suspensionState: instance.suspensionState, - isBlocked: this.utilityService.isBlockedHost(this.meta.blockedHosts, instance.host), + isSuspended: instance.isSuspended, + isBlocked: this.utilityService.isBlockedHost(meta.blockedHosts, instance.host), softwareName: instance.softwareName, softwareVersion: instance.softwareVersion, openRegistrations: instance.openRegistrations, @@ -51,23 +42,20 @@ export class InstanceEntityService { description: instance.description, maintainerName: instance.maintainerName, maintainerEmail: instance.maintainerEmail, - isSilenced: this.utilityService.isSilencedHost(this.meta.silencedHosts, instance.host), - isMediaSilenced: this.utilityService.isMediaSilencedHost(this.meta.mediaSilencedHosts, instance.host), + isSilenced: this.utilityService.isSilencedHost(meta.silencedHosts, instance.host), iconUrl: instance.iconUrl, faviconUrl: instance.faviconUrl, themeColor: instance.themeColor, infoUpdatedAt: instance.infoUpdatedAt ? instance.infoUpdatedAt.toISOString() : null, latestRequestReceivedAt: instance.latestRequestReceivedAt ? instance.latestRequestReceivedAt.toISOString() : null, - moderationNote: iAmModerator ? instance.moderationNote : null, }; } @bindThis public packMany( instances: MiInstance[], - me?: { id: MiUser['id']; } | null | undefined, ) { - return Promise.all(instances.map(x => this.pack(x, me))); + return Promise.all(instances.map(x => this.pack(x))); } } diff --git a/packages/backend/src/core/entities/InviteCodeEntityService.ts b/packages/backend/src/core/entities/InviteCodeEntityService.ts index 5d3e823a2a..0f15fb5ab2 100644 --- a/packages/backend/src/core/entities/InviteCodeEntityService.ts +++ b/packages/backend/src/core/entities/InviteCodeEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -29,10 +29,6 @@ export class InviteCodeEntityService { public async pack( src: MiRegistrationTicket['id'] | MiRegistrationTicket, me?: { id: MiUser['id'] } | null | undefined, - hints?: { - packedCreatedBy?: Packed<'UserLite'>, - packedUsedBy?: Packed<'UserLite'>, - }, ): Promise> { const target = typeof src === 'object' ? src : await this.registrationTicketsRepository.findOneOrFail({ where: { @@ -46,28 +42,18 @@ export class InviteCodeEntityService { code: target.code, expiresAt: target.expiresAt ? target.expiresAt.toISOString() : null, createdAt: this.idService.parse(target.id).date.toISOString(), - createdBy: target.createdBy ? hints?.packedCreatedBy ?? await this.userEntityService.pack(target.createdBy, me) : null, - usedBy: target.usedBy ? hints?.packedUsedBy ?? await this.userEntityService.pack(target.usedBy, me) : null, + createdBy: target.createdBy ? await this.userEntityService.pack(target.createdBy, me) : null, + usedBy: target.usedBy ? await this.userEntityService.pack(target.usedBy, me) : null, usedAt: target.usedAt ? target.usedAt.toISOString() : null, used: !!target.usedAt, }); } @bindThis - public async packMany( - tickets: MiRegistrationTicket[], + public packMany( + targets: any[], me: { id: MiUser['id'] }, ) { - const _createdBys = tickets.map(({ createdBy, createdById }) => createdBy ?? createdById).filter(x => x != null); - const _usedBys = tickets.map(({ usedBy, usedById }) => usedBy ?? usedById).filter(x => x != null); - const _userMap = await this.userEntityService.packMany([..._createdBys, ..._usedBys], me) - .then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all( - tickets.map(ticket => { - const packedCreatedBy = ticket.createdById != null ? _userMap.get(ticket.createdById) : undefined; - const packedUsedBy = ticket.usedById != null ? _userMap.get(ticket.usedById) : undefined; - return this.pack(ticket, me, { packedCreatedBy, packedUsedBy }); - }), - ); + return Promise.all(targets.map(x => this.pack(x, me))); } } diff --git a/packages/backend/src/core/entities/MetaEntityService.ts b/packages/backend/src/core/entities/MetaEntityService.ts deleted file mode 100644 index 409dca3426..0000000000 --- a/packages/backend/src/core/entities/MetaEntityService.ts +++ /dev/null @@ -1,175 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Brackets } from 'typeorm'; -import { Inject, Injectable } from '@nestjs/common'; -import JSON5 from 'json5'; -import type { Packed } from '@/misc/json-schema.js'; -import type { MiMeta } from '@/models/Meta.js'; -import type { AdsRepository } from '@/models/_.js'; -import { MAX_NOTE_TEXT_LENGTH } from '@/const.js'; -import { bindThis } from '@/decorators.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import { InstanceActorService } from '@/core/InstanceActorService.js'; -import type { Config } from '@/config.js'; -import { DI } from '@/di-symbols.js'; -import { DEFAULT_POLICIES } from '@/core/RoleService.js'; - -@Injectable() -export class MetaEntityService { - constructor( - @Inject(DI.config) - private config: Config, - - @Inject(DI.meta) - private meta: MiMeta, - - @Inject(DI.adsRepository) - private adsRepository: AdsRepository, - - private userEntityService: UserEntityService, - private instanceActorService: InstanceActorService, - ) { } - - @bindThis - public async pack(meta?: MiMeta): Promise> { - let instance = meta; - - if (!instance) { - instance = this.meta; - } - - const ads = await this.adsRepository.createQueryBuilder('ads') - .where('ads.expiresAt > :now', { now: new Date() }) - .andWhere('ads.startsAt <= :now', { now: new Date() }) - .andWhere(new Brackets(qb => { - // 曜日のビットフラグを確認する - qb.where('ads.dayOfWeek & :dayOfWeek > 0', { dayOfWeek: 1 << new Date().getDay() }) - .orWhere('ads.dayOfWeek = 0'); - })) - .getMany(); - - // クライアントの手間を減らすためあらかじめJSONに変換しておく - let defaultLightTheme = null; - let defaultDarkTheme = null; - if (instance.defaultLightTheme) { - try { - defaultLightTheme = JSON.stringify(JSON5.parse(instance.defaultLightTheme)); - } catch (e) { - } - } - if (instance.defaultDarkTheme) { - try { - defaultDarkTheme = JSON.stringify(JSON5.parse(instance.defaultDarkTheme)); - } catch (e) { - } - } - - const packed: Packed<'MetaLite'> = { - maintainerName: instance.maintainerName, - maintainerEmail: instance.maintainerEmail, - - version: this.config.version, - providesTarball: this.config.publishTarballInsteadOfProvideRepositoryUrl, - - name: instance.name, - shortName: instance.shortName, - uri: this.config.url, - description: instance.description, - langs: instance.langs, - tosUrl: instance.termsOfServiceUrl, - repositoryUrl: instance.repositoryUrl, - feedbackUrl: instance.feedbackUrl, - impressumUrl: instance.impressumUrl, - privacyPolicyUrl: instance.privacyPolicyUrl, - inquiryUrl: instance.inquiryUrl, - disableRegistration: instance.disableRegistration, - emailRequiredForSignup: instance.emailRequiredForSignup, - enableHcaptcha: instance.enableHcaptcha, - hcaptchaSiteKey: instance.hcaptchaSiteKey, - enableMcaptcha: instance.enableMcaptcha, - mcaptchaSiteKey: instance.mcaptchaSitekey, - mcaptchaInstanceUrl: instance.mcaptchaInstanceUrl, - enableRecaptcha: instance.enableRecaptcha, - recaptchaSiteKey: instance.recaptchaSiteKey, - enableTurnstile: instance.enableTurnstile, - turnstileSiteKey: instance.turnstileSiteKey, - enableTestcaptcha: instance.enableTestcaptcha, - swPublickey: instance.swPublicKey, - themeColor: instance.themeColor, - mascotImageUrl: instance.mascotImageUrl ?? '/assets/ai.png', - bannerUrl: instance.bannerUrl, - infoImageUrl: instance.infoImageUrl, - serverErrorImageUrl: instance.serverErrorImageUrl, - notFoundImageUrl: instance.notFoundImageUrl, - iconUrl: instance.iconUrl, - backgroundImageUrl: instance.backgroundImageUrl, - logoImageUrl: instance.logoImageUrl, - maxNoteTextLength: MAX_NOTE_TEXT_LENGTH, - defaultLightTheme, - defaultDarkTheme, - ads: ads.map(ad => ({ - id: ad.id, - url: ad.url, - place: ad.place, - ratio: ad.ratio, - imageUrl: ad.imageUrl, - dayOfWeek: ad.dayOfWeek, - })), - notesPerOneAd: instance.notesPerOneAd, - enableEmail: instance.enableEmail, - enableServiceWorker: instance.enableServiceWorker, - - translatorAvailable: instance.deeplAuthKey != null, - - serverRules: instance.serverRules, - - policies: { ...DEFAULT_POLICIES, ...instance.policies }, - - mediaProxy: this.config.mediaProxy, - enableUrlPreview: instance.urlPreviewEnabled, - noteSearchableScope: (this.config.meilisearch == null || this.config.meilisearch.scope !== 'local') ? 'global' : 'local', - maxFileSize: this.config.maxFileSize, - }; - - return packed; - } - - @bindThis - public async packDetailed(meta?: MiMeta): Promise> { - let instance = meta; - - if (!instance) { - instance = this.meta; - } - - const packed = await this.pack(instance); - - const proxyAccount = instance.proxyAccountId ? await this.userEntityService.pack(instance.proxyAccountId).catch(() => null) : null; - - const packDetailed: Packed<'MetaDetailed'> = { - ...packed, - cacheRemoteFiles: instance.cacheRemoteFiles, - cacheRemoteSensitiveFiles: instance.cacheRemoteSensitiveFiles, - requireSetup: !await this.instanceActorService.realLocalUsersPresent(), - proxyAccountName: proxyAccount ? proxyAccount.username : null, - features: { - localTimeline: instance.policies.ltlAvailable, - globalTimeline: instance.policies.gtlAvailable, - registration: !instance.disableRegistration, - emailRequiredForSignup: instance.emailRequiredForSignup, - hcaptcha: instance.enableHcaptcha, - recaptcha: instance.enableRecaptcha, - turnstile: instance.enableTurnstile, - objectStorage: instance.useObjectStorage, - serviceWorker: instance.enableServiceWorker, - miauth: true, - }, - }; - - return packDetailed; - } -} - diff --git a/packages/backend/src/core/entities/ModerationLogEntityService.ts b/packages/backend/src/core/entities/ModerationLogEntityService.ts index bf1b2a002c..6729ca2671 100644 --- a/packages/backend/src/core/entities/ModerationLogEntityService.ts +++ b/packages/backend/src/core/entities/ModerationLogEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,10 +8,9 @@ import { DI } from '@/di-symbols.js'; import type { ModerationLogsRepository } from '@/models/_.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { } from '@/models/Blocking.js'; -import { MiModerationLog } from '@/models/ModerationLog.js'; +import type { MiModerationLog } from '@/models/ModerationLog.js'; import { bindThis } from '@/decorators.js'; import { IdService } from '@/core/IdService.js'; -import type { Packed } from '@/misc/json-schema.js'; import { UserEntityService } from './UserEntityService.js'; @Injectable() @@ -28,9 +27,6 @@ export class ModerationLogEntityService { @bindThis public async pack( src: MiModerationLog['id'] | MiModerationLog, - hint?: { - packedUser?: Packed<'UserDetailedNotMe'>, - }, ) { const log = typeof src === 'object' ? src : await this.moderationLogsRepository.findOneByOrFail({ id: src }); @@ -40,20 +36,17 @@ export class ModerationLogEntityService { type: log.type, info: log.info, userId: log.userId, - user: hint?.packedUser ?? this.userEntityService.pack(log.user ?? log.userId, null, { - schema: 'UserDetailedNotMe', + user: this.userEntityService.pack(log.user ?? log.userId, null, { + detail: true, }), }); } @bindThis - public async packMany( - reports: MiModerationLog[], + public packMany( + reports: any[], ) { - const _users = reports.map(({ user, userId }) => user ?? userId); - const _userMap = await this.userEntityService.packMany(_users, null, { schema: 'UserDetailedNotMe' }) - .then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all(reports.map(report => this.pack(report, { packedUser: _userMap.get(report.userId) }))); + return Promise.all(reports.map(x => this.pack(x))); } } diff --git a/packages/backend/src/core/entities/MutingEntityService.ts b/packages/backend/src/core/entities/MutingEntityService.ts index d361a20271..9d672169ba 100644 --- a/packages/backend/src/core/entities/MutingEntityService.ts +++ b/packages/backend/src/core/entities/MutingEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -30,9 +30,6 @@ export class MutingEntityService { public async pack( src: MiMuting['id'] | MiMuting, me?: { id: MiUser['id'] } | null | undefined, - hints?: { - packedMutee?: Packed<'UserDetailedNotMe'>, - }, ): Promise> { const muting = typeof src === 'object' ? src : await this.mutingsRepository.findOneByOrFail({ id: src }); @@ -41,21 +38,18 @@ export class MutingEntityService { createdAt: this.idService.parse(muting.id).date.toISOString(), expiresAt: muting.expiresAt ? muting.expiresAt.toISOString() : null, muteeId: muting.muteeId, - mutee: hints?.packedMutee ?? this.userEntityService.pack(muting.muteeId, me, { - schema: 'UserDetailedNotMe', + mutee: this.userEntityService.pack(muting.muteeId, me, { + detail: true, }), }); } @bindThis - public async packMany( - mutings: MiMuting[], + public packMany( + mutings: any[], me: { id: MiUser['id'] }, ) { - const _mutees = mutings.map(({ mutee, muteeId }) => mutee ?? muteeId); - const _userMap = await this.userEntityService.packMany(_mutees, me, { schema: 'UserDetailedNotMe' }) - .then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all(mutings.map(muting => this.pack(muting, me, { packedMutee: _userMap.get(muting.muteeId) }))); + return Promise.all(mutings.map(x => this.pack(x, me))); } } diff --git a/packages/backend/src/core/entities/NoteEntityService.ts b/packages/backend/src/core/entities/NoteEntityService.ts index 96cc6b028e..c49dad8e79 100644 --- a/packages/backend/src/core/entities/NoteEntityService.ts +++ b/packages/backend/src/core/entities/NoteEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -11,57 +11,30 @@ import type { Packed } from '@/misc/json-schema.js'; import { awaitAll } from '@/misc/prelude/await-all.js'; import type { MiUser } from '@/models/User.js'; import type { MiNote } from '@/models/Note.js'; -import type { UsersRepository, NotesRepository, FollowingsRepository, PollsRepository, PollVotesRepository, NoteReactionsRepository, ChannelsRepository, MiMeta } from '@/models/_.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 { DebounceLoader } from '@/misc/loader.js'; import { IdService } from '@/core/IdService.js'; -import { ReactionsBufferingService } from '@/core/ReactionsBufferingService.js'; import type { OnModuleInit } from '@nestjs/common'; import type { CustomEmojiService } from '../CustomEmojiService.js'; import type { ReactionService } from '../ReactionService.js'; import type { UserEntityService } from './UserEntityService.js'; import type { DriveFileEntityService } from './DriveFileEntityService.js'; -// is-renote.tsとよしなにリンク -function isPureRenote(note: MiNote): note is MiNote & { renoteId: MiNote['id']; renote: MiNote } { - return ( - note.renote != null && - note.reply == null && - note.text == null && - note.cw == null && - (note.fileIds == null || note.fileIds.length === 0) && - !note.hasPoll - ); -} - -function getAppearNoteIds(notes: MiNote[]): Set { - const appearNoteIds = new Set(); - for (const note of notes) { - if (isPureRenote(note)) { - appearNoteIds.add(note.renoteId); - } else { - appearNoteIds.add(note.id); - } - } - return appearNoteIds; -} - @Injectable() export class NoteEntityService implements OnModuleInit { private userEntityService: UserEntityService; private driveFileEntityService: DriveFileEntityService; private customEmojiService: CustomEmojiService; private reactionService: ReactionService; - private reactionsBufferingService: ReactionsBufferingService; private idService: IdService; private noteLoader = new DebounceLoader(this.findNoteOrFail); constructor( private moduleRef: ModuleRef, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -87,8 +60,6 @@ export class NoteEntityService implements OnModuleInit { //private driveFileEntityService: DriveFileEntityService, //private customEmojiService: CustomEmojiService, //private reactionService: ReactionService, - //private reactionsBufferingService: ReactionsBufferingService, - //private idService: IdService, ) { } @@ -97,85 +68,54 @@ export class NoteEntityService implements OnModuleInit { this.driveFileEntityService = this.moduleRef.get('DriveFileEntityService'); this.customEmojiService = this.moduleRef.get('CustomEmojiService'); this.reactionService = this.moduleRef.get('ReactionService'); - this.reactionsBufferingService = this.moduleRef.get('ReactionsBufferingService'); this.idService = this.moduleRef.get('IdService'); } @bindThis - private async hideNote(packedNote: Packed<'Note'>, meId: MiUser['id'] | null): Promise { - // FIXME: このvisibility変更処理が当関数にあるのは若干不自然かもしれない(関数名を treatVisibility とかに変える手もある) - if (packedNote.visibility === 'public' || packedNote.visibility === 'home') { - const followersOnlyBefore = packedNote.user.makeNotesFollowersOnlyBefore; - if ((followersOnlyBefore != null) - && ( - (followersOnlyBefore <= 0 && (Date.now() - new Date(packedNote.createdAt).getTime() > 0 - (followersOnlyBefore * 1000))) - || (followersOnlyBefore > 0 && (new Date(packedNote.createdAt).getTime() < followersOnlyBefore * 1000)) - ) - ) { - packedNote.visibility = 'followers'; - } - } - - if (meId === packedNote.userId) return; - + private async hideNote(packedNote: Packed<'Note'>, meId: MiUser['id'] | null) { // TODO: isVisibleForMe を使うようにしても良さそう(型違うけど) let hide = false; - if (packedNote.user.requireSigninToViewContents && meId == null) { - hide = true; - } - - if (!hide) { - const hiddenBefore = packedNote.user.makeNotesHiddenBefore; - if ((hiddenBefore != null) - && ( - (hiddenBefore <= 0 && (Date.now() - new Date(packedNote.createdAt).getTime() > 0 - (hiddenBefore * 1000))) - || (hiddenBefore > 0 && (new Date(packedNote.createdAt).getTime() < hiddenBefore * 1000)) - ) - ) { - hide = true; - } - } - // visibility が specified かつ自分が指定されていなかったら非表示 - if (!hide) { - if (packedNote.visibility === 'specified') { - if (meId == null) { - hide = true; - } else { - // 指定されているかどうか - const specified = packedNote.visibleUserIds!.some(id => meId === id); + if (packedNote.visibility === 'specified') { + if (meId == null) { + hide = true; + } else if (meId === packedNote.userId) { + hide = false; + } else { + // 指定されているかどうか + const specified = packedNote.visibleUserIds!.some((id: any) => meId === id); - if (!specified) { - hide = true; - } + if (specified) { + hide = false; + } else { + hide = true; } } } // visibility が followers かつ自分が投稿者のフォロワーでなかったら非表示 - if (!hide) { - if (packedNote.visibility === 'followers') { - if (meId == null) { - hide = true; - } else if (packedNote.reply && (meId === packedNote.reply.userId)) { - // 自分の投稿に対するリプライ - hide = false; - } else if (packedNote.mentions && packedNote.mentions.some(id => meId === id)) { - // 自分へのメンション - hide = false; - } else { - // フォロワーかどうか - // TODO: 当関数呼び出しごとにクエリが走るのは重そうだからなんとかする - const isFollowing = await this.followingsRepository.exists({ - where: { - followeeId: packedNote.userId, - followerId: meId, - }, - }); + if (packedNote.visibility === 'followers') { + if (meId == null) { + hide = true; + } else if (meId === packedNote.userId) { + hide = false; + } else if (packedNote.reply && (meId === packedNote.reply.userId)) { + // 自分の投稿に対するリプライ + hide = false; + } else if (packedNote.mentions && packedNote.mentions.some(id => meId === id)) { + // 自分へのメンション + hide = false; + } else { + // フォロワーかどうか + const isFollowing = await this.followingsRepository.exist({ + where: { + followeeId: packedNote.userId, + followerId: meId, + }, + }); - hide = !isFollowing; - } + hide = !isFollowing; } } @@ -187,7 +127,6 @@ export class NoteEntityService implements OnModuleInit { packedNote.poll = undefined; packedNote.cw = null; packedNote.isHidden = true; - // TODO: hiddenReason みたいなのを提供しても良さそう } } @@ -225,7 +164,7 @@ export class NoteEntityService implements OnModuleInit { return { multiple: poll.multiple, - expiresAt: poll.expiresAt?.toISOString() ?? null, + expiresAt: poll.expiresAt, choices, }; } @@ -282,7 +221,7 @@ export class NoteEntityService implements OnModuleInit { return true; } else { // 指定されているかどうか - return note.visibleUserIds.some(id => meId === id); + return note.visibleUserIds.some((id: any) => meId === id); } } @@ -337,7 +276,7 @@ export class NoteEntityService implements OnModuleInit { packedFiles.set(k, v); } } - return fileIds.map(id => packedFiles.get(id)).filter(x => x != null); + return fileIds.map(id => packedFiles.get(id)).filter(isNotNull); } @bindThis @@ -349,10 +288,8 @@ export class NoteEntityService implements OnModuleInit { skipHide?: boolean; withReactionAndUserPairCache?: boolean; _hint_?: { - bufferedReactions: Map; pairs: ([MiUser['id'], string])[] }> | null; myReactions: Map; packedFiles: Map | null>; - packedUsers: Map> }; }, ): Promise> { @@ -366,15 +303,6 @@ export class NoteEntityService implements OnModuleInit { const note = typeof src === 'object' ? src : await this.noteLoader.load(src); const host = note.userHost; - const bufferedReactions = opts._hint_?.bufferedReactions != null - ? (opts._hint_.bufferedReactions.get(note.id) ?? { deltas: {}, pairs: [] }) - : this.meta.enableReactionsBuffering - ? await this.reactionsBufferingService.get(note.id) - : { deltas: {}, pairs: [] }; - const reactions = this.reactionService.convertLegacyReactions(this.reactionsBufferingService.mergeReactions(note.reactions, bufferedReactions.deltas ?? {})); - - const reactionAndUserPairCache = note.reactionAndUserPairCache.concat(bufferedReactions.pairs.map(x => x.join('/'))); - let text = note.text; if (note.name && (note.url ?? note.uri)) { @@ -387,17 +315,18 @@ export class NoteEntityService implements OnModuleInit { : await this.channelsRepository.findOneBy({ id: note.channelId }) : null; - const reactionEmojiNames = Object.keys(reactions) + const reactionEmojiNames = Object.keys(note.reactions) .filter(x => x.startsWith(':') && x.includes('@') && !x.includes('@.')) // リモートカスタム絵文字のみ .map(x => this.reactionService.decodeReaction(x).reaction.replaceAll(':', '')); const packedFiles = options?._hint_?.packedFiles; - const packedUsers = options?._hint_?.packedUsers; const packed: Packed<'Note'> = await awaitAll({ id: note.id, createdAt: this.idService.parse(note.id).date.toISOString(), userId: note.userId, - user: packedUsers?.get(note.userId) ?? this.userEntityService.pack(note.user ?? note.userId, me), + user: this.userEntityService.pack(note.user ?? note.userId, me, { + detail: false, + }), text: text, cw: note.cw, visibility: note.visibility, @@ -406,10 +335,9 @@ export class NoteEntityService implements OnModuleInit { visibleUserIds: note.visibility === 'specified' ? note.visibleUserIds : undefined, renoteCount: note.renoteCount, repliesCount: note.repliesCount, - reactionCount: Object.values(reactions).reduce((a, b) => a + b, 0), - reactions: reactions, + reactions: this.reactionService.convertLegacyReactions(note.reactions), reactionEmojis: this.customEmojiService.populateEmojis(reactionEmojiNames, host), - reactionAndUserPairCache: opts.withReactionAndUserPairCache ? reactionAndUserPairCache : undefined, + reactionAndUserPairCache: opts.withReactionAndUserPairCache ? note.reactionAndUserPairCache : undefined, emojis: host != null ? this.customEmojiService.populateEmojis(note.emojis, host) : undefined, tags: note.tags.length > 0 ? note.tags : undefined, fileIds: note.fileIds, @@ -423,7 +351,6 @@ export class NoteEntityService implements OnModuleInit { color: channel.color, isSensitive: channel.isSensitive, allowRenoteToExternal: channel.allowRenoteToExternal, - userId: channel.userId, } : undefined, mentions: note.mentions.length > 0 ? note.mentions : undefined, uri: note.uri ?? undefined, @@ -448,12 +375,8 @@ export class NoteEntityService implements OnModuleInit { poll: note.hasPoll ? this.populatePoll(note, meId) : undefined, - ...(meId && Object.keys(reactions).length > 0 ? { - myReaction: this.populateMyReaction({ - id: note.id, - reactions: reactions, - reactionAndUserPairCache: reactionAndUserPairCache, - }, meId, options?._hint_), + ...(meId && Object.keys(note.reactions).length > 0 ? { + myReaction: this.populateMyReaction(note, meId, options?._hint_), } : {}), } : {}), }); @@ -476,8 +399,6 @@ export class NoteEntityService implements OnModuleInit { ) { if (notes.length === 0) return []; - const bufferedReactions = this.meta.enableReactionsBuffering ? await this.reactionsBufferingService.getMany([...getAppearNoteIds(notes)]) : null; - const meId = me ? me.id : null; const myReactionsMap = new Map(); if (meId) { @@ -487,34 +408,24 @@ export class NoteEntityService implements OnModuleInit { const oldId = this.idService.gen(Date.now() - 2000); for (const note of notes) { - if (isPureRenote(note)) { - const reactionsCount = Object.values(this.reactionsBufferingService.mergeReactions(note.renote.reactions, bufferedReactions?.get(note.renote.id)?.deltas ?? {})).reduce((a, b) => a + b, 0); + if (note.renote && (note.text == null && note.fileIds.length === 0)) { // pure renote + const reactionsCount = Object.values(note.renote.reactions).reduce((a, b) => a + b, 0); if (reactionsCount === 0) { myReactionsMap.set(note.renote.id, null); - } else if (reactionsCount <= note.renote.reactionAndUserPairCache.length + (bufferedReactions?.get(note.renote.id)?.pairs.length ?? 0)) { - const pairInBuffer = bufferedReactions?.get(note.renote.id)?.pairs.find(p => p[0] === meId); - if (pairInBuffer) { - myReactionsMap.set(note.renote.id, pairInBuffer[1]); - } else { - const pair = note.renote.reactionAndUserPairCache.find(p => p.startsWith(meId)); - myReactionsMap.set(note.renote.id, pair ? pair.split('/')[1] : null); - } + } else if (reactionsCount <= note.renote.reactionAndUserPairCache.length) { + const pair = note.renote.reactionAndUserPairCache.find(p => p.startsWith(meId)); + myReactionsMap.set(note.renote.id, pair ? pair.split('/')[1] : null); } else { idsNeedFetchMyReaction.add(note.renote.id); } } else { if (note.id < oldId) { - const reactionsCount = Object.values(this.reactionsBufferingService.mergeReactions(note.reactions, bufferedReactions?.get(note.id)?.deltas ?? {})).reduce((a, b) => a + b, 0); + const reactionsCount = Object.values(note.reactions).reduce((a, b) => a + b, 0); if (reactionsCount === 0) { myReactionsMap.set(note.id, null); - } else if (reactionsCount <= note.reactionAndUserPairCache.length + (bufferedReactions?.get(note.id)?.pairs.length ?? 0)) { - const pairInBuffer = bufferedReactions?.get(note.id)?.pairs.find(p => p[0] === meId); - if (pairInBuffer) { - myReactionsMap.set(note.id, pairInBuffer[1]); - } else { - const pair = note.reactionAndUserPairCache.find(p => p.startsWith(meId)); - myReactionsMap.set(note.id, pair ? pair.split('/')[1] : null); - } + } else if (reactionsCount <= note.reactionAndUserPairCache.length) { + const pair = note.reactionAndUserPairCache.find(p => p.startsWith(meId)); + myReactionsMap.set(note.id, pair ? pair.split('/')[1] : null); } else { idsNeedFetchMyReaction.add(note.id); } @@ -536,23 +447,14 @@ export class NoteEntityService implements OnModuleInit { await this.customEmojiService.prefetchEmojis(this.aggregateNoteEmojis(notes)); // TODO: 本当は renote とか reply がないのに renoteId とか replyId があったらここで解決しておく - const fileIds = notes.map(n => [n.fileIds, n.renote?.fileIds, n.reply?.fileIds]).flat(2).filter(x => x != null); + const fileIds = notes.map(n => [n.fileIds, n.renote?.fileIds, n.reply?.fileIds]).flat(2).filter(isNotNull); const packedFiles = fileIds.length > 0 ? await this.driveFileEntityService.packManyByIdsMap(fileIds) : new Map(); - const users = [ - ...notes.map(({ user, userId }) => user ?? userId), - ...notes.map(({ replyUserId }) => replyUserId).filter(x => x != null), - ...notes.map(({ renoteUserId }) => renoteUserId).filter(x => x != null), - ]; - const packedUsers = await this.userEntityService.packMany(users, me) - .then(users => new Map(users.map(u => [u.id, u]))); return await Promise.all(notes.map(n => this.pack(n, me, { ...options, _hint_: { - bufferedReactions, myReactions: myReactionsMap, packedFiles, - packedUsers, }, }))); } diff --git a/packages/backend/src/core/entities/NoteFavoriteEntityService.ts b/packages/backend/src/core/entities/NoteFavoriteEntityService.ts index 3cdafe48ad..1c9aed413f 100644 --- a/packages/backend/src/core/entities/NoteFavoriteEntityService.ts +++ b/packages/backend/src/core/entities/NoteFavoriteEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/entities/NoteReactionEntityService.ts b/packages/backend/src/core/entities/NoteReactionEntityService.ts index 46ec13704c..f4aba3e543 100644 --- a/packages/backend/src/core/entities/NoteReactionEntityService.ts +++ b/packages/backend/src/core/entities/NoteReactionEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -52,9 +52,6 @@ export class NoteReactionEntityService implements OnModuleInit { options?: { withNote: boolean; }, - hints?: { - packedUser?: Packed<'UserLite'> - }, ): Promise> { const opts = Object.assign({ withNote: false, @@ -65,28 +62,11 @@ export class NoteReactionEntityService implements OnModuleInit { return { id: reaction.id, createdAt: this.idService.parse(reaction.id).date.toISOString(), - user: hints?.packedUser ?? await this.userEntityService.pack(reaction.user ?? reaction.userId, me), + user: await this.userEntityService.pack(reaction.user ?? reaction.userId, me), type: this.reactionService.convertLegacyReaction(reaction.reaction), ...(opts.withNote ? { note: await this.noteEntityService.pack(reaction.note ?? reaction.noteId, me), } : {}), }; } - - @bindThis - public async packMany( - reactions: MiNoteReaction[], - me?: { id: MiUser['id'] } | null | undefined, - options?: { - withNote: boolean; - }, - ): Promise[]> { - const opts = Object.assign({ - withNote: false, - }, options); - const _users = reactions.map(({ user, userId }) => user ?? userId); - const _userMap = await this.userEntityService.packMany(_users, me) - .then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all(reactions.map(reaction => this.pack(reaction, me, opts, { packedUser: _userMap.get(reaction.userId) }))); - } } diff --git a/packages/backend/src/core/entities/NotificationEntityService.ts b/packages/backend/src/core/entities/NotificationEntityService.ts index dff6968f9c..704081ed00 100644 --- a/packages/backend/src/core/entities/NotificationEntityService.ts +++ b/packages/backend/src/core/entities/NotificationEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -13,14 +13,15 @@ import type { MiGroupedNotification, MiNotification } from '@/models/Notificatio import type { MiNote } from '@/models/Note.js'; import type { Packed } from '@/misc/json-schema.js'; import { bindThis } from '@/decorators.js'; -import { FilterUnionByProperty, groupedNotificationTypes } from '@/types.js'; -import { CacheService } from '@/core/CacheService.js'; +import { isNotNull } from '@/misc/is-not-null.js'; +import { FilterUnionByProperty, notificationTypes } from '@/types.js'; import { RoleEntityService } from './RoleEntityService.js'; import type { OnModuleInit } from '@nestjs/common'; import type { UserEntityService } from './UserEntityService.js'; import type { NoteEntityService } from './NoteEntityService.js'; -const NOTE_REQUIRED_NOTIFICATION_TYPES = new Set(['note', 'mention', 'reply', 'renote', 'renote:grouped', 'quote', 'reaction', 'reaction:grouped', 'pollEnded'] as (typeof groupedNotificationTypes[number])[]); +const NOTE_REQUIRED_NOTIFICATION_TYPES = new Set(['note', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollEnded'] as (typeof notificationTypes[number])[]); +const NOTE_REQUIRED_GROUPED_NOTIFICATION_TYPES = new Set(['note', 'mention', 'reply', 'renote', 'renote:grouped', 'quote', 'reaction', 'reaction:grouped', 'pollEnded']); @Injectable() export class NotificationEntityService implements OnModuleInit { @@ -40,8 +41,6 @@ export class NotificationEntityService implements OnModuleInit { @Inject(DI.followRequestsRepository) private followRequestsRepository: FollowRequestsRepository, - private cacheService: CacheService, - //private userEntityService: UserEntityService, //private noteEntityService: NoteEntityService, ) { @@ -53,98 +52,35 @@ export class NotificationEntityService implements OnModuleInit { this.roleEntityService = this.moduleRef.get('RoleEntityService'); } - /** - * 通知をパックする共通処理 - */ - async #packInternal ( - src: T, + @bindThis + public async pack( + src: MiNotification, meId: MiUser['id'], - + // eslint-disable-next-line @typescript-eslint/ban-types options: { - checkValidNotifier?: boolean; + }, hint?: { packedNotes: Map>; - packedUsers: Map>; + packedUsers: Map>; }, - ): Promise | null> { + ): Promise> { const notification = src; - - if (options.checkValidNotifier !== false && !(await this.#isValidNotifier(notification, meId))) return null; - - const needsNote = NOTE_REQUIRED_NOTIFICATION_TYPES.has(notification.type) && 'noteId' in notification; - const noteIfNeed = needsNote ? ( + const noteIfNeed = NOTE_REQUIRED_NOTIFICATION_TYPES.has(notification.type) && 'noteId' in notification ? ( hint?.packedNotes != null ? hint.packedNotes.get(notification.noteId) : this.noteEntityService.pack(notification.noteId, { id: meId }, { detail: true, }) ) : undefined; - // if the note has been deleted, don't show this notification - if (needsNote && !noteIfNeed) return null; - - const needsUser = 'notifierId' in notification; - const userIfNeed = needsUser ? ( + const userIfNeed = 'notifierId' in notification ? ( hint?.packedUsers != null ? hint.packedUsers.get(notification.notifierId) - : this.userEntityService.pack(notification.notifierId, { id: meId }) + : this.userEntityService.pack(notification.notifierId, { id: meId }, { + detail: false, + }) ) : undefined; - // if the user has been deleted, don't show this notification - if (needsUser && !userIfNeed) return null; - - // #region Grouped notifications - if (notification.type === 'reaction:grouped') { - const reactions = (await Promise.all(notification.reactions.map(async reaction => { - const user = hint?.packedUsers != null - ? hint.packedUsers.get(reaction.userId)! - : await this.userEntityService.pack(reaction.userId, { id: meId }); - return { - user, - reaction: reaction.reaction, - }; - }))).filter(r => r.user != null); - // if all users have been deleted, don't show this notification - if (reactions.length === 0) { - return null; - } - - return await awaitAll({ - id: notification.id, - createdAt: new Date(notification.createdAt).toISOString(), - type: notification.type, - note: noteIfNeed, - reactions, - }); - } else if (notification.type === 'renote:grouped') { - const users = (await Promise.all(notification.userIds.map(userId => { - const packedUser = hint?.packedUsers != null ? hint.packedUsers.get(userId) : null; - if (packedUser) { - return packedUser; - } - - return this.userEntityService.pack(userId, { id: meId }); - }))).filter(x => x != null); - // if all users have been deleted, don't show this notification - if (users.length === 0) { - return null; - } - - return await awaitAll({ - id: notification.id, - createdAt: new Date(notification.createdAt).toISOString(), - type: notification.type, - note: noteIfNeed, - users, - }); - } - // #endregion - - const needsRole = notification.type === 'roleAssigned'; - const role = needsRole ? await this.roleEntityService.pack(notification.roleId) : undefined; - // if the role has been deleted, don't show this notification - if (needsRole && !role) { - return null; - } + const role = notification.type === 'roleAssigned' ? await this.roleEntityService.pack(notification.roleId) : undefined; return await awaitAll({ id: notification.id, @@ -159,16 +95,9 @@ export class NotificationEntityService implements OnModuleInit { ...(notification.type === 'roleAssigned' ? { role: role, } : {}), - ...(notification.type === 'followRequestAccepted' ? { - message: notification.message, - } : {}), ...(notification.type === 'achievementEarned' ? { achievement: notification.achievement, } : {}), - ...(notification.type === 'exportCompleted' ? { - exportedEntity: notification.exportedEntity, - fileId: notification.fileId, - } : {}), ...(notification.type === 'app' ? { body: notification.customBody, header: notification.customHeader, @@ -177,17 +106,155 @@ export class NotificationEntityService implements OnModuleInit { }); } - async #packManyInternal ( - notifications: T[], + @bindThis + public async packMany( + notifications: MiNotification[], meId: MiUser['id'], - ): Promise { + ) { if (notifications.length === 0) return []; let validNotifications = notifications; - validNotifications = await this.#filterValidNotifier(validNotifications, meId); + const noteIds = validNotifications.map(x => 'noteId' in x ? x.noteId : null).filter(isNotNull); + const notes = noteIds.length > 0 ? await this.notesRepository.find({ + where: { id: In(noteIds) }, + relations: ['user', 'reply', 'reply.user', 'renote', 'renote.user'], + }) : []; + const packedNotesArray = await this.noteEntityService.packMany(notes, { id: meId }, { + detail: true, + }); + const packedNotes = new Map(packedNotesArray.map(p => [p.id, p])); - const noteIds = validNotifications.map(x => 'noteId' in x ? x.noteId : null).filter(x => x != null); + validNotifications = validNotifications.filter(x => !('noteId' in x) || packedNotes.has(x.noteId)); + + const userIds = validNotifications.map(x => 'notifierId' in x ? x.notifierId : null).filter(isNotNull); + const users = userIds.length > 0 ? await this.usersRepository.find({ + where: { id: In(userIds) }, + }) : []; + const packedUsersArray = await this.userEntityService.packMany(users, { id: meId }, { + detail: false, + }); + const packedUsers = new Map(packedUsersArray.map(p => [p.id, p])); + + // 既に解決されたフォローリクエストの通知を除外 + const followRequestNotifications = validNotifications.filter((x): x is FilterUnionByProperty => x.type === 'receiveFollowRequest'); + if (followRequestNotifications.length > 0) { + const reqs = await this.followRequestsRepository.find({ + where: { followerId: In(followRequestNotifications.map(x => x.notifierId)) }, + }); + validNotifications = validNotifications.filter(x => (x.type !== 'receiveFollowRequest') || reqs.some(r => r.followerId === x.notifierId)); + } + + return await Promise.all(validNotifications.map(x => this.pack(x, meId, {}, { + packedNotes, + packedUsers, + }))); + } + + @bindThis + public async packGrouped( + src: MiGroupedNotification, + meId: MiUser['id'], + // eslint-disable-next-line @typescript-eslint/ban-types + options: { + + }, + hint?: { + packedNotes: Map>; + packedUsers: Map>; + }, + ): Promise> { + const notification = src; + const noteIfNeed = NOTE_REQUIRED_GROUPED_NOTIFICATION_TYPES.has(notification.type) && 'noteId' in notification ? ( + hint?.packedNotes != null + ? hint.packedNotes.get(notification.noteId) + : this.noteEntityService.pack(notification.noteId, { id: meId }, { + detail: true, + }) + ) : undefined; + const userIfNeed = 'notifierId' in notification ? ( + hint?.packedUsers != null + ? hint.packedUsers.get(notification.notifierId) + : this.userEntityService.pack(notification.notifierId, { id: meId }, { + detail: false, + }) + ) : undefined; + + if (notification.type === 'reaction:grouped') { + const reactions = await Promise.all(notification.reactions.map(async reaction => { + const user = hint?.packedUsers != null + ? hint.packedUsers.get(reaction.userId)! + : await this.userEntityService.pack(reaction.userId, { id: meId }, { + detail: false, + }); + return { + user, + reaction: reaction.reaction, + }; + })); + return await awaitAll({ + id: notification.id, + createdAt: new Date(notification.createdAt).toISOString(), + type: notification.type, + note: noteIfNeed, + reactions, + }); + } else if (notification.type === 'renote:grouped') { + const users = await Promise.all(notification.userIds.map(userId => { + const packedUser = hint?.packedUsers != null ? hint.packedUsers.get(userId) : null; + if (packedUser) { + return packedUser; + } + + return this.userEntityService.pack(userId, { id: meId }, { + detail: false, + }); + })); + return await awaitAll({ + id: notification.id, + createdAt: new Date(notification.createdAt).toISOString(), + type: notification.type, + note: noteIfNeed, + users, + }); + } + + const role = notification.type === 'roleAssigned' ? await this.roleEntityService.pack(notification.roleId) : undefined; + + return await awaitAll({ + id: notification.id, + createdAt: new Date(notification.createdAt).toISOString(), + type: notification.type, + userId: 'notifierId' in notification ? notification.notifierId : undefined, + ...(userIfNeed != null ? { user: userIfNeed } : {}), + ...(noteIfNeed != null ? { note: noteIfNeed } : {}), + ...(notification.type === 'reaction' ? { + reaction: notification.reaction, + } : {}), + ...(notification.type === 'roleAssigned' ? { + role: role, + } : {}), + ...(notification.type === 'achievementEarned' ? { + achievement: notification.achievement, + } : {}), + ...(notification.type === 'app' ? { + body: notification.customBody, + header: notification.customHeader, + icon: notification.customIcon, + } : {}), + }); + } + + @bindThis + public async packGroupedMany( + notifications: MiGroupedNotification[], + meId: MiUser['id'], + ) { + if (notifications.length === 0) return []; + + let validNotifications = notifications; + + const noteIds = validNotifications.map(x => 'noteId' in x ? x.noteId : null).filter(isNotNull); const notes = noteIds.length > 0 ? await this.notesRepository.find({ where: { id: In(noteIds) }, relations: ['user', 'reply', 'reply.user', 'renote', 'renote.user'], @@ -208,11 +275,13 @@ export class NotificationEntityService implements OnModuleInit { const users = userIds.length > 0 ? await this.usersRepository.find({ where: { id: In(userIds) }, }) : []; - const packedUsersArray = await this.userEntityService.packMany(users, { id: meId }); + const packedUsersArray = await this.userEntityService.packMany(users, { id: meId }, { + detail: false, + }); const packedUsers = new Map(packedUsersArray.map(p => [p.id, p])); // 既に解決されたフォローリクエストの通知を除外 - const followRequestNotifications = validNotifications.filter((x): x is FilterUnionByProperty => x.type === 'receiveFollowRequest'); + const followRequestNotifications = validNotifications.filter((x): x is FilterUnionByProperty => x.type === 'receiveFollowRequest'); if (followRequestNotifications.length > 0) { const reqs = await this.followRequestsRepository.find({ where: { followerId: In(followRequestNotifications.map(x => x.notifierId)) }, @@ -220,107 +289,9 @@ export class NotificationEntityService implements OnModuleInit { validNotifications = validNotifications.filter(x => (x.type !== 'receiveFollowRequest') || reqs.some(r => r.followerId === x.notifierId)); } - const packPromises = validNotifications.map(x => { - return this.pack( - x, - meId, - { checkValidNotifier: false }, - { packedNotes, packedUsers }, - ); - }); - - return (await Promise.all(packPromises)).filter(x => x != null); - } - - @bindThis - public async pack( - src: MiNotification | MiGroupedNotification, - meId: MiUser['id'], - - options: { - checkValidNotifier?: boolean; - }, - hint?: { - packedNotes: Map>; - packedUsers: Map>; - }, - ): Promise | null> { - return await this.#packInternal(src, meId, options, hint); - } - - @bindThis - public async packMany( - notifications: MiNotification[], - meId: MiUser['id'], - ): Promise { - return await this.#packManyInternal(notifications, meId); - } - - @bindThis - public async packGroupedMany( - notifications: MiGroupedNotification[], - meId: MiUser['id'], - ): Promise { - return await this.#packManyInternal(notifications, meId); - } - - /** - * notifierが存在するか、ミュートされていないか、サスペンドされていないかを確認するvalidator - */ - #validateNotifier ( - notification: T, - userIdsWhoMeMuting: Set, - userMutedInstances: Set, - notifiers: MiUser[], - ): boolean { - if (!('notifierId' in notification)) return true; - if (userIdsWhoMeMuting.has(notification.notifierId)) return false; - - const notifier = notifiers.find(x => x.id === notification.notifierId) ?? null; - - if (notifier == null) return false; - if (notifier.host && userMutedInstances.has(notifier.host)) return false; - - if (notifier.isSuspended) return false; - - return true; - } - - /** - * notifierが存在するか、ミュートされていないか、サスペンドされていないかを実際に確認する - */ - async #isValidNotifier( - notification: MiNotification | MiGroupedNotification, - meId: MiUser['id'], - ): Promise { - return (await this.#filterValidNotifier([notification], meId)).length === 1; - } - - /** - * notifierが存在するか、ミュートされていないか、サスペンドされていないかを実際に複数確認する - */ - async #filterValidNotifier ( - notifications: T[], - meId: MiUser['id'], - ): Promise { - const [ - userIdsWhoMeMuting, - userMutedInstances, - ] = await Promise.all([ - this.cacheService.userMutingsCache.fetch(meId), - this.cacheService.userProfileCache.fetch(meId).then(p => new Set(p.mutedInstances)), - ]); - - const notifierIds = notifications.map(notification => 'notifierId' in notification ? notification.notifierId : null).filter(x => x != null); - const notifiers = notifierIds.length > 0 ? await this.usersRepository.find({ - where: { id: In(notifierIds) }, - }) : []; - - const filteredNotifications = ((await Promise.all(notifications.map(async (notification) => { - const isValid = this.#validateNotifier(notification, userIdsWhoMeMuting, userMutedInstances, notifiers); - return isValid ? notification : null; - }))) as [T | null] ).filter(x => x != null); - - return filteredNotifications; + return await Promise.all(validNotifications.map(x => this.packGrouped(x, meId, {}, { + packedNotes, + packedUsers, + }))); } } diff --git a/packages/backend/src/core/entities/PageEntityService.ts b/packages/backend/src/core/entities/PageEntityService.ts index 46bf51bb6d..f39ef949db 100644 --- a/packages/backend/src/core/entities/PageEntityService.ts +++ b/packages/backend/src/core/entities/PageEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -39,9 +39,6 @@ export class PageEntityService { public async pack( src: MiPage['id'] | MiPage, me?: { id: MiUser['id'] } | null | undefined, - hint?: { - packedUser?: Packed<'UserLite'> - }, ): Promise> { const meId = me ? me.id : null; const page = typeof src === 'object' ? src : await this.pagesRepository.findOneByOrFail({ id: src }); @@ -93,7 +90,7 @@ export class PageEntityService { createdAt: this.idService.parse(page.id).date.toISOString(), updatedAt: page.updatedAt.toISOString(), userId: page.userId, - user: hint?.packedUser ?? this.userEntityService.pack(page.user ?? page.userId, me), // { schema: 'UserDetailed' } すると無限ループするので注意 + user: this.userEntityService.pack(page.user ?? page.userId, me), // { detail: true } すると無限ループするので注意 content: page.content, variables: page.variables, title: page.title, @@ -105,21 +102,18 @@ export class PageEntityService { script: page.script, eyeCatchingImageId: page.eyeCatchingImageId, eyeCatchingImage: page.eyeCatchingImageId ? await this.driveFileEntityService.pack(page.eyeCatchingImageId) : null, - attachedFiles: this.driveFileEntityService.packMany((await Promise.all(attachedFiles)).filter(x => x != null)), + attachedFiles: this.driveFileEntityService.packMany((await Promise.all(attachedFiles)).filter((x): x is MiDriveFile => x != null)), likedCount: page.likedCount, - isLiked: meId ? await this.pageLikesRepository.exists({ where: { pageId: page.id, userId: meId } }) : undefined, + isLiked: meId ? await this.pageLikesRepository.exist({ where: { pageId: page.id, userId: meId } }) : undefined, }); } @bindThis - public async packMany( + public packMany( pages: MiPage[], me?: { id: MiUser['id'] } | null | undefined, ) { - const _users = pages.map(({ user, userId }) => user ?? userId); - const _userMap = await this.userEntityService.packMany(_users, me) - .then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all(pages.map(page => this.pack(page, me, { packedUser: _userMap.get(page.userId) }))); + return Promise.all(pages.map(x => this.pack(x, me))); } } diff --git a/packages/backend/src/core/entities/PageLikeEntityService.ts b/packages/backend/src/core/entities/PageLikeEntityService.ts index cfccbcb660..4dc691ab93 100644 --- a/packages/backend/src/core/entities/PageLikeEntityService.ts +++ b/packages/backend/src/core/entities/PageLikeEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/entities/RenoteMutingEntityService.ts b/packages/backend/src/core/entities/RenoteMutingEntityService.ts index e4e154109a..3f9dc9180a 100644 --- a/packages/backend/src/core/entities/RenoteMutingEntityService.ts +++ b/packages/backend/src/core/entities/RenoteMutingEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -30,9 +30,6 @@ export class RenoteMutingEntityService { public async pack( src: MiRenoteMuting['id'] | MiRenoteMuting, me?: { id: MiUser['id'] } | null | undefined, - hints?: { - packedMutee?: Packed<'UserDetailedNotMe'> - }, ): Promise> { const muting = typeof src === 'object' ? src : await this.renoteMutingsRepository.findOneByOrFail({ id: src }); @@ -40,21 +37,18 @@ export class RenoteMutingEntityService { id: muting.id, createdAt: this.idService.parse(muting.id).date.toISOString(), muteeId: muting.muteeId, - mutee: hints?.packedMutee ?? this.userEntityService.pack(muting.muteeId, me, { - schema: 'UserDetailedNotMe', + mutee: this.userEntityService.pack(muting.muteeId, me, { + detail: true, }), }); } @bindThis - public async packMany( - mutings: MiRenoteMuting[], + public packMany( + mutings: any[], me: { id: MiUser['id'] }, ) { - const _users = mutings.map(({ mutee, muteeId }) => mutee ?? muteeId); - const _userMap = await this.userEntityService.packMany(_users, me, { schema: 'UserDetailedNotMe' }) - .then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all(mutings.map(muting => this.pack(muting, me, { packedMutee: _userMap.get(muting.muteeId) }))); + return Promise.all(mutings.map(x => this.pack(x, me))); } } diff --git a/packages/backend/src/core/entities/ReversiGameEntityService.ts b/packages/backend/src/core/entities/ReversiGameEntityService.ts deleted file mode 100644 index df042e75c1..0000000000 --- a/packages/backend/src/core/entities/ReversiGameEntityService.ts +++ /dev/null @@ -1,146 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { DI } from '@/di-symbols.js'; -import type { ReversiGamesRepository } from '@/models/_.js'; -import { awaitAll } from '@/misc/prelude/await-all.js'; -import type { Packed } from '@/misc/json-schema.js'; -import type { } from '@/models/Blocking.js'; -import type { MiReversiGame } from '@/models/ReversiGame.js'; -import { bindThis } from '@/decorators.js'; -import { IdService } from '@/core/IdService.js'; -import { UserEntityService } from './UserEntityService.js'; - -@Injectable() -export class ReversiGameEntityService { - constructor( - @Inject(DI.reversiGamesRepository) - private reversiGamesRepository: ReversiGamesRepository, - - private userEntityService: UserEntityService, - private idService: IdService, - ) { - } - - @bindThis - public async packDetail( - src: MiReversiGame['id'] | MiReversiGame, - hint?: { - packedUser1?: Packed<'UserLite'>, - packedUser2?: Packed<'UserLite'>, - }, - ): Promise> { - const game = typeof src === 'object' ? src : await this.reversiGamesRepository.findOneByOrFail({ id: src }); - - const user1 = hint?.packedUser1 ?? await this.userEntityService.pack(game.user1 ?? game.user1Id); - const user2 = hint?.packedUser2 ?? await this.userEntityService.pack(game.user2 ?? game.user2Id); - - return await awaitAll({ - id: game.id, - createdAt: this.idService.parse(game.id).date.toISOString(), - startedAt: game.startedAt && game.startedAt.toISOString(), - endedAt: game.endedAt && game.endedAt.toISOString(), - isStarted: game.isStarted, - isEnded: game.isEnded, - form1: game.form1, - form2: game.form2, - user1Ready: game.user1Ready, - user2Ready: game.user2Ready, - user1Id: game.user1Id, - user2Id: game.user2Id, - user1, - user2, - winnerId: game.winnerId, - winner: game.winnerId ? [user1, user2].find(u => u.id === game.winnerId)! : null, - surrenderedUserId: game.surrenderedUserId, - timeoutUserId: game.timeoutUserId, - black: game.black, - bw: game.bw, - isLlotheo: game.isLlotheo, - canPutEverywhere: game.canPutEverywhere, - loopedBoard: game.loopedBoard, - timeLimitForEachTurn: game.timeLimitForEachTurn, - noIrregularRules: game.noIrregularRules, - logs: game.logs, - map: game.map, - }); - } - - @bindThis - public async packDetailMany( - games: MiReversiGame[], - ) { - const _user1s = games.map(({ user1, user1Id }) => user1 ?? user1Id); - const _user2s = games.map(({ user2, user2Id }) => user2 ?? user2Id); - const _userMap = await this.userEntityService.packMany([..._user1s, ..._user2s]) - .then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all( - games.map(game => { - return this.packDetail(game, { - packedUser1: _userMap.get(game.user1Id), - packedUser2: _userMap.get(game.user2Id), - }); - }), - ); - } - - @bindThis - public async packLite( - src: MiReversiGame['id'] | MiReversiGame, - hint?: { - packedUser1?: Packed<'UserLite'>, - packedUser2?: Packed<'UserLite'>, - }, - ): Promise> { - const game = typeof src === 'object' ? src : await this.reversiGamesRepository.findOneByOrFail({ id: src }); - - const user1 = hint?.packedUser1 ?? await this.userEntityService.pack(game.user1 ?? game.user1Id); - const user2 = hint?.packedUser2 ?? await this.userEntityService.pack(game.user2 ?? game.user2Id); - - return await awaitAll({ - id: game.id, - createdAt: this.idService.parse(game.id).date.toISOString(), - startedAt: game.startedAt && game.startedAt.toISOString(), - endedAt: game.endedAt && game.endedAt.toISOString(), - isStarted: game.isStarted, - isEnded: game.isEnded, - user1Id: game.user1Id, - user2Id: game.user2Id, - user1, - user2, - winnerId: game.winnerId, - winner: game.winnerId ? [user1, user2].find(u => u.id === game.winnerId)! : null, - surrenderedUserId: game.surrenderedUserId, - timeoutUserId: game.timeoutUserId, - black: game.black, - bw: game.bw, - isLlotheo: game.isLlotheo, - canPutEverywhere: game.canPutEverywhere, - loopedBoard: game.loopedBoard, - timeLimitForEachTurn: game.timeLimitForEachTurn, - noIrregularRules: game.noIrregularRules, - }); - } - - @bindThis - public async packLiteMany( - games: MiReversiGame[], - ) { - const _user1s = games.map(({ user1, user1Id }) => user1 ?? user1Id); - const _user2s = games.map(({ user2, user2Id }) => user2 ?? user2Id); - const _userMap = await this.userEntityService.packMany([..._user1s, ..._user2s]) - .then(users => new Map(users.map(u => [u.id, u]))); - return Promise.all( - games.map(game => { - return this.packLite(game, { - packedUser1: _userMap.get(game.user1Id), - packedUser2: _userMap.get(game.user2Id), - }); - }), - ); - } -} - diff --git a/packages/backend/src/core/entities/RoleEntityService.ts b/packages/backend/src/core/entities/RoleEntityService.ts index 2a7dc37bce..5563f9a1ac 100644 --- a/packages/backend/src/core/entities/RoleEntityService.ts +++ b/packages/backend/src/core/entities/RoleEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/entities/SigninEntityService.ts b/packages/backend/src/core/entities/SigninEntityService.ts index 00b124d594..6bde3e589a 100644 --- a/packages/backend/src/core/entities/SigninEntityService.ts +++ b/packages/backend/src/core/entities/SigninEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/core/entities/SystemWebhookEntityService.ts b/packages/backend/src/core/entities/SystemWebhookEntityService.ts deleted file mode 100644 index e18734091c..0000000000 --- a/packages/backend/src/core/entities/SystemWebhookEntityService.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { In } from 'typeorm'; -import { DI } from '@/di-symbols.js'; -import type { MiSystemWebhook, SystemWebhooksRepository } from '@/models/_.js'; -import { bindThis } from '@/decorators.js'; -import { Packed } from '@/misc/json-schema.js'; - -@Injectable() -export class SystemWebhookEntityService { - constructor( - @Inject(DI.systemWebhooksRepository) - private systemWebhooksRepository: SystemWebhooksRepository, - ) { - } - - @bindThis - public async pack( - src: MiSystemWebhook['id'] | MiSystemWebhook, - opts?: { - webhooks: Map - }, - ): Promise> { - const webhook = typeof src === 'object' - ? src - : opts?.webhooks.get(src) ?? await this.systemWebhooksRepository.findOneByOrFail({ id: src }); - - return { - id: webhook.id, - isActive: webhook.isActive, - updatedAt: webhook.updatedAt.toISOString(), - latestSentAt: webhook.latestSentAt?.toISOString() ?? null, - latestStatus: webhook.latestStatus, - name: webhook.name, - on: webhook.on, - url: webhook.url, - secret: webhook.secret, - }; - } - - @bindThis - public async packMany(src: MiSystemWebhook['id'][] | MiSystemWebhook[]): Promise[]> { - if (src.length === 0) { - return []; - } - - const webhooks = Array.of(); - webhooks.push( - ...src.filter((it): it is MiSystemWebhook => typeof it === 'object'), - ); - - const ids = src.filter((it): it is MiSystemWebhook['id'] => typeof it === 'string'); - if (ids.length > 0) { - webhooks.push( - ...await this.systemWebhooksRepository.findBy({ id: In(ids) }), - ); - } - - return Promise - .all( - webhooks.map(x => - this.pack(x, { - webhooks: new Map(webhooks.map(x => [x.id, x])), - }), - ), - ) - .then(it => it.sort((a, b) => a.id.localeCompare(b.id))); - } -} - diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts index d3c087a153..ef815a388a 100644 --- a/packages/backend/src/core/entities/UserEntityService.ts +++ b/packages/backend/src/core/entities/UserEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,7 +7,6 @@ import { Inject, Injectable } from '@nestjs/common'; import * as Redis from 'ioredis'; import _Ajv from 'ajv'; import { ModuleRef } from '@nestjs/core'; -import { In } from 'typeorm'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import type { Packed } from '@/misc/json-schema.js'; @@ -15,30 +14,9 @@ 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/User.js'; -import { - birthdaySchema, - descriptionSchema, - localUsernameSchema, - locationSchema, - nameSchema, - passwordSchema, -} from '@/models/User.js'; -import type { - BlockingsRepository, - FollowingsRepository, - FollowRequestsRepository, - MiFollowing, - MiUserNotePining, - MiUserProfile, - MutingsRepository, - NoteUnreadsRepository, - RenoteMutingsRepository, - UserMemoRepository, - UserNotePiningsRepository, - UserProfilesRepository, - UserSecurityKeysRepository, - UsersRepository, -} from '@/models/_.js'; +import { birthdaySchema, descriptionSchema, localUsernameSchema, locationSchema, nameSchema, passwordSchema } from '@/models/User.js'; +import { MiNotification } from '@/models/Notification.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'; @@ -52,6 +30,14 @@ import type { NoteEntityService } from './NoteEntityService.js'; import type { DriveFileEntityService } from './DriveFileEntityService.js'; import type { PageEntityService } from './PageEntityService.js'; +type IsUserDetailed = Detailed extends true ? Packed<'UserDetailed'> : Packed<'UserLite'>; +type IsMeAndIsUserDetailed = + Detailed extends true ? + ExpectsMe extends true ? Packed<'MeDetailed'> : + ExpectsMe extends false ? Packed<'UserDetailedNotMe'> : + Packed<'UserDetailed'> : + Packed<'UserLite'>; + const Ajv = _Ajv.default; const ajv = new Ajv(); @@ -67,23 +53,11 @@ function isRemoteUser(user: MiUser | { host: MiUser['host'] }): boolean { return !isLocalUser(user); } -export type UserRelation = { - id: MiUser['id'] - following: MiFollowing | null, - isFollowing: boolean - isFollowed: boolean - hasPendingFollowRequestFromYou: boolean - hasPendingFollowRequestToYou: boolean - isBlocking: boolean - isBlocked: boolean - isMuted: boolean - isRenoteMuted: boolean -} - @Injectable() export class UserEntityService implements OnModuleInit { private apPersonService: ApPersonService; private noteEntityService: NoteEntityService; + private driveFileEntityService: DriveFileEntityService; private pageEntityService: PageEntityService; private customEmojiService: CustomEmojiService; private announcementService: AnnouncementService; @@ -122,6 +96,9 @@ export class UserEntityService implements OnModuleInit { @Inject(DI.renoteMutingsRepository) private renoteMutingsRepository: RenoteMutingsRepository, + @Inject(DI.driveFilesRepository) + private driveFilesRepository: DriveFilesRepository, + @Inject(DI.noteUnreadsRepository) private noteUnreadsRepository: NoteUnreadsRepository, @@ -131,6 +108,12 @@ export class UserEntityService implements OnModuleInit { @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, + @Inject(DI.announcementReadsRepository) + private announcementReadsRepository: AnnouncementReadsRepository, + + @Inject(DI.announcementsRepository) + private announcementsRepository: AnnouncementsRepository, + @Inject(DI.userMemosRepository) private userMemosRepository: UserMemoRepository, ) { @@ -139,6 +122,7 @@ export class UserEntityService implements OnModuleInit { onModuleInit() { this.apPersonService = this.moduleRef.get('ApPersonService'); this.noteEntityService = this.moduleRef.get('NoteEntityService'); + this.driveFileEntityService = this.moduleRef.get('DriveFileEntityService'); this.pageEntityService = this.moduleRef.get('PageEntityService'); this.customEmojiService = this.moduleRef.get('CustomEmojiService'); this.announcementService = this.moduleRef.get('AnnouncementService'); @@ -161,7 +145,7 @@ export class UserEntityService implements OnModuleInit { public isRemoteUser = isRemoteUser; @bindThis - public async getRelation(me: MiUser['id'], target: MiUser['id']): Promise { + public async getRelation(me: MiUser['id'], target: MiUser['id']) { const [ following, isFollowed, @@ -176,43 +160,43 @@ export class UserEntityService implements OnModuleInit { followerId: me, followeeId: target, }), - this.followingsRepository.exists({ + this.followingsRepository.exist({ where: { followerId: target, followeeId: me, }, }), - this.followRequestsRepository.exists({ + this.followRequestsRepository.exist({ where: { followerId: me, followeeId: target, }, }), - this.followRequestsRepository.exists({ + this.followRequestsRepository.exist({ where: { followerId: target, followeeId: me, }, }), - this.blockingsRepository.exists({ + this.blockingsRepository.exist({ where: { blockerId: me, blockeeId: target, }, }), - this.blockingsRepository.exists({ + this.blockingsRepository.exist({ where: { blockerId: target, blockeeId: me, }, }), - this.mutingsRepository.exists({ + this.mutingsRepository.exist({ where: { muterId: me, muteeId: target, }, }), - this.renoteMutingsRepository.exists({ + this.renoteMutingsRepository.exist({ where: { muterId: me, muteeId: target, @@ -234,86 +218,12 @@ export class UserEntityService implements OnModuleInit { }; } - @bindThis - public async getRelations(me: MiUser['id'], targets: MiUser['id'][]): Promise> { - const [ - followers, - followees, - followersRequests, - followeesRequests, - blockers, - blockees, - muters, - renoteMuters, - ] = await Promise.all([ - this.followingsRepository.findBy({ followerId: me }) - .then(f => new Map(f.map(it => [it.followeeId, it]))), - this.followingsRepository.createQueryBuilder('f') - .select('f.followerId') - .where('f.followeeId = :me', { me }) - .getRawMany<{ f_followerId: string }>() - .then(it => it.map(it => it.f_followerId)), - this.followRequestsRepository.createQueryBuilder('f') - .select('f.followeeId') - .where('f.followerId = :me', { me }) - .getRawMany<{ f_followeeId: string }>() - .then(it => it.map(it => it.f_followeeId)), - this.followRequestsRepository.createQueryBuilder('f') - .select('f.followerId') - .where('f.followeeId = :me', { me }) - .getRawMany<{ f_followerId: string }>() - .then(it => it.map(it => it.f_followerId)), - this.blockingsRepository.createQueryBuilder('b') - .select('b.blockeeId') - .where('b.blockerId = :me', { me }) - .getRawMany<{ b_blockeeId: string }>() - .then(it => it.map(it => it.b_blockeeId)), - this.blockingsRepository.createQueryBuilder('b') - .select('b.blockerId') - .where('b.blockeeId = :me', { me }) - .getRawMany<{ b_blockerId: string }>() - .then(it => it.map(it => it.b_blockerId)), - this.mutingsRepository.createQueryBuilder('m') - .select('m.muteeId') - .where('m.muterId = :me', { me }) - .getRawMany<{ m_muteeId: string }>() - .then(it => it.map(it => it.m_muteeId)), - this.renoteMutingsRepository.createQueryBuilder('m') - .select('m.muteeId') - .where('m.muterId = :me', { me }) - .getRawMany<{ m_muteeId: string }>() - .then(it => it.map(it => it.m_muteeId)), - ]); - - return new Map( - targets.map(target => { - const following = followers.get(target) ?? null; - - return [ - target, - { - id: target, - following: following, - isFollowing: following != null, - isFollowed: followees.includes(target), - hasPendingFollowRequestFromYou: followersRequests.includes(target), - hasPendingFollowRequestToYou: followeesRequests.includes(target), - isBlocking: blockers.includes(target), - isBlocked: blockees.includes(target), - isMuted: muters.includes(target), - isRenoteMuted: renoteMuters.includes(target), - }, - ]; - }), - ); - } - @bindThis public async getHasUnreadAntenna(userId: MiUser['id']): Promise { /* const myAntennas = (await this.antennaService.getAntennas()).filter(a => a.userId === userId); - const isUnread = (myAntennas.length > 0 ? await this.antennaNotesRepository.exists({ + const isUnread = (myAntennas.length > 0 ? await this.antennaNotesRepository.exist({ where: { antennaId: In(myAntennas.map(x => x.id)), read: false, @@ -393,85 +303,53 @@ export class UserEntityService implements OnModuleInit { return `${this.config.url}/users/${userId}`; } - public async pack( + public async pack( src: MiUser['id'] | MiUser, me?: { id: MiUser['id']; } | null | undefined, options?: { - schema?: S, + detail?: D, includeSecrets?: boolean, userProfile?: MiUserProfile, - userRelations?: Map, - userMemos?: Map, - pinNotes?: Map, }, - ): Promise> { + ): Promise> { const opts = Object.assign({ - schema: 'UserLite', + detail: false, includeSecrets: false, }, options); const user = typeof src === 'object' ? src : await this.usersRepository.findOneByOrFail({ id: src }); - const isDetailed = opts.schema !== 'UserLite'; const meId = me ? me.id : null; const isMe = meId === user.id; const iAmModerator = me ? await this.roleService.isModerator(me as MiUser) : false; - const profile = isDetailed - ? (opts.userProfile ?? await this.userProfilesRepository.findOneByOrFail({ userId: user.id })) - : null; - - let relation: UserRelation | null = null; - if (meId && !isMe && isDetailed) { - if (opts.userRelations) { - relation = opts.userRelations.get(user.id) ?? null; - } else { - relation = await this.getRelation(meId, user.id); - } - } - - let memo: string | null = null; - if (isDetailed && meId) { - if (opts.userMemos) { - memo = opts.userMemos.get(user.id) ?? null; - } else { - memo = await this.userMemosRepository.findOneBy({ userId: meId, targetUserId: user.id }) - .then(row => row?.memo ?? null); - } - } - - let pins: MiUserNotePining[] = []; - if (isDetailed) { - if (opts.pinNotes) { - pins = opts.pinNotes.get(user.id) ?? []; - } else { - pins = await this.userNotePiningsRepository.createQueryBuilder('pin') - .where('pin.userId = :userId', { userId: user.id }) - .innerJoinAndSelect('pin.note', 'note') - .orderBy('pin.id', 'DESC') - .getMany(); - } - } + const relation = meId && !isMe && opts.detail ? await this.getRelation(meId, user.id) : null; + const pins = opts.detail ? await this.userNotePiningsRepository.createQueryBuilder('pin') + .where('pin.userId = :userId', { userId: user.id }) + .innerJoinAndSelect('pin.note', 'note') + .orderBy('pin.id', 'DESC') + .getMany() : []; + const profile = opts.detail ? (opts.userProfile ?? await this.userProfilesRepository.findOneByOrFail({ userId: user.id })) : null; const followingCount = profile == null ? null : - (profile.followingVisibility === 'public') || isMe || iAmModerator ? user.followingCount : + (profile.followingVisibility === 'public') || isMe ? user.followingCount : (profile.followingVisibility === 'followers') && (relation && relation.isFollowing) ? user.followingCount : null; const followersCount = profile == null ? null : - (profile.followersVisibility === 'public') || isMe || iAmModerator ? user.followersCount : + (profile.followersVisibility === 'public') || isMe ? user.followersCount : (profile.followersVisibility === 'followers') && (relation && relation.isFollowing) ? user.followersCount : null; - const isModerator = isMe && isDetailed ? this.roleService.isModerator(user) : null; - const isAdmin = isMe && isDetailed ? this.roleService.isAdministrator(user) : null; - const unreadAnnouncements = isMe && isDetailed ? + const isModerator = isMe && opts.detail ? this.roleService.isModerator(user) : null; + const isAdmin = isMe && opts.detail ? this.roleService.isAdministrator(user) : null; + const unreadAnnouncements = isMe && opts.detail ? (await this.announcementService.getUnreadAnnouncements(user)).map((announcement) => ({ createdAt: this.idService.parse(announcement.id).date.toISOString(), ...announcement, })) : null; - const notificationsInfo = isMe && isDetailed ? await this.getNotificationsInfo(user.id) : null; + const notificationsInfo = isMe && opts.detail ? await this.getNotificationsInfo(user.id) : null; const packed = { id: user.id, @@ -490,9 +368,6 @@ export class UserEntityService implements OnModuleInit { }))) : [], isBot: user.isBot, isCat: user.isCat, - requireSigninToViewContents: user.requireSigninToViewContents === false ? undefined : true, - makeNotesFollowersOnlyBefore: user.makeNotesFollowersOnlyBefore ?? undefined, - makeNotesHiddenBefore: user.makeNotesHiddenBefore ?? undefined, instance: user.host ? this.federatedInstanceService.federatedInstanceCache.fetch(user.host).then(instance => instance ? { name: instance.name, softwareName: instance.softwareName, @@ -504,23 +379,19 @@ export class UserEntityService implements OnModuleInit { emojis: this.customEmojiService.populateEmojis(user.emojis, user.host), onlineStatus: this.getOnlineStatus(user), // パフォーマンス上の理由でローカルユーザーのみ - badgeRoles: user.host == null ? this.roleService.getUserBadgeRoles(user.id).then((rs) => rs - .filter((r) => r.isPublic || iAmModerator) - .sort((a, b) => b.displayOrder - a.displayOrder) - .map((r) => ({ - name: r.name, - iconUrl: r.iconUrl, - displayOrder: r.displayOrder, - })), - ) : undefined, + badgeRoles: user.host == null ? this.roleService.getUserBadgeRoles(user.id).then(rs => rs.sort((a, b) => b.displayOrder - a.displayOrder).map(r => ({ + name: r.name, + iconUrl: r.iconUrl, + displayOrder: r.displayOrder, + }))) : undefined, - ...(isDetailed ? { + ...(opts.detail ? { url: profile!.url, uri: user.uri, movedTo: user.movedToUri ? this.apPersonService.resolvePerson(user.movedToUri).then(user => user.id).catch(() => null) : null, alsoKnownAs: user.alsoKnownAs ? Promise.all(user.alsoKnownAs.map(uri => this.apPersonService.fetchPerson(uri).then(user => user?.id).catch(() => null))) - .then(xs => xs.length === 0 ? null : xs.filter(x => x != null)) + .then(xs => xs.length === 0 ? null : xs.filter(x => x != null) as string[]) : null, createdAt: this.idService.parse(user.id).date.toISOString(), updatedAt: user.updatedAt ? user.updatedAt.toISOString() : null, @@ -545,9 +416,16 @@ export class UserEntityService implements OnModuleInit { }), pinnedPageId: profile!.pinnedPageId, pinnedPage: profile!.pinnedPageId ? this.pageEntityService.pack(profile!.pinnedPageId, me) : null, - publicReactions: this.isLocalUser(user) ? profile!.publicReactions : false, // https://github.com/misskey-dev/misskey/issues/12964 + publicReactions: profile!.publicReactions, followersVisibility: profile!.followersVisibility, followingVisibility: profile!.followingVisibility, + twoFactorEnabled: profile!.twoFactorEnabled, + usePasswordLessLogin: profile!.usePasswordLessLogin, + securityKeys: profile!.twoFactorEnabled + ? this.userSecurityKeysRepository.countBy({ + userId: user.id, + }).then(result => result >= 1) + : false, roles: this.roleService.getUserRoles(user.id).then(roles => roles.filter(role => role.isPublic).sort((a, b) => b.displayOrder - a.displayOrder).map(role => ({ id: role.id, name: role.name, @@ -558,22 +436,16 @@ export class UserEntityService implements OnModuleInit { isAdministrator: role.isAdministrator, displayOrder: role.displayOrder, }))), - memo: memo, + memo: meId == null ? null : await this.userMemosRepository.findOneBy({ + userId: meId, + targetUserId: user.id, + }).then(row => row?.memo ?? null), moderationNote: iAmModerator ? (profile!.moderationNote ?? '') : undefined, } : {}), - ...(isDetailed && (isMe || iAmModerator) ? { - twoFactorEnabled: profile!.twoFactorEnabled, - usePasswordLessLogin: profile!.usePasswordLessLogin, - securityKeys: profile!.twoFactorEnabled - ? this.userSecurityKeysRepository.countBy({ userId: user.id }).then(result => result >= 1) - : false, - } : {}), - - ...(isDetailed && isMe ? { + ...(opts.detail && isMe ? { avatarId: user.avatarId, bannerId: user.bannerId, - followedMessage: profile!.followedMessage, isModerator: isModerator, isAdmin: isAdmin, injectFeaturedNote: profile!.injectFeaturedNote, @@ -642,84 +514,20 @@ export class UserEntityService implements OnModuleInit { isRenoteMuted: relation.isRenoteMuted, notify: relation.following?.notify ?? 'none', withReplies: relation.following?.withReplies ?? false, - followedMessage: relation.isFollowing ? profile!.followedMessage : undefined, } : {}), - } as Promiseable>; + } as Promiseable> as Promiseable>; return await awaitAll(packed); } - public async packMany( + public packMany( users: (MiUser['id'] | MiUser)[], me?: { id: MiUser['id'] } | null | undefined, options?: { - schema?: S, + detail?: D, includeSecrets?: boolean, }, - ): Promise[]> { - // -- IDのみの要素を補完して完全なエンティティ一覧を作る - - const _users = users.filter((user): user is MiUser => typeof user !== 'string'); - if (_users.length !== users.length) { - _users.push( - ...await this.usersRepository.findBy({ - id: In(users.filter((user): user is string => typeof user === 'string')), - }), - ); - } - const _userIds = _users.map(u => u.id); - - // -- 実行者の有無や指定スキーマの種別によって要否が異なる値群を取得 - - let profilesMap: Map = new Map(); - let userRelations: Map = new Map(); - let userMemos: Map = new Map(); - let pinNotes: Map = new Map(); - - if (options?.schema !== 'UserLite') { - profilesMap = await this.userProfilesRepository.findBy({ userId: In(_userIds) }) - .then(profiles => new Map(profiles.map(p => [p.userId, p]))); - - const meId = me ? me.id : null; - if (meId) { - userMemos = await this.userMemosRepository.findBy({ userId: meId }) - .then(memos => new Map(memos.map(memo => [memo.targetUserId, memo.memo]))); - - if (_userIds.length > 0) { - userRelations = await this.getRelations(meId, _userIds); - pinNotes = await this.userNotePiningsRepository.createQueryBuilder('pin') - .where('pin.userId IN (:...userIds)', { userIds: _userIds }) - .innerJoinAndSelect('pin.note', 'note') - .getMany() - .then(pinsNotes => { - const map = new Map(); - for (const note of pinsNotes) { - const notes = map.get(note.userId) ?? []; - notes.push(note); - map.set(note.userId, notes); - } - for (const [, notes] of map.entries()) { - // pack側ではDESCで取得しているので、それに合わせて降順に並び替えておく - notes.sort((a, b) => b.id.localeCompare(a.id)); - } - return map; - }); - } - } - } - - return Promise.all( - _users.map(u => this.pack( - u, - me, - { - ...options, - userProfile: profilesMap.get(u.id), - userRelations: userRelations, - userMemos: userMemos, - pinNotes: pinNotes, - }, - )), - ); + ): Promise[]> { + return Promise.all(users.map(u => this.pack(u, me, options))); } } diff --git a/packages/backend/src/core/entities/UserListEntityService.ts b/packages/backend/src/core/entities/UserListEntityService.ts index b77249c5cb..31ab7293da 100644 --- a/packages/backend/src/core/entities/UserListEntityService.ts +++ b/packages/backend/src/core/entities/UserListEntityService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -50,14 +50,11 @@ export class UserListEntityService { public async packMembershipsMany( memberships: MiUserListMembership[], ) { - const _users = memberships.map(({ user, userId }) => user ?? userId); - const _userMap = await this.userEntityService.packMany(_users) - .then(users => new Map(users.map(u => [u.id, u]))); return Promise.all(memberships.map(async x => ({ id: x.id, createdAt: this.idService.parse(x.id).date.toISOString(), userId: x.userId, - user: _userMap.get(x.userId) ?? await this.userEntityService.pack(x.userId), + user: await this.userEntityService.pack(x.userId), withReplies: x.withReplies, }))); } diff --git a/packages/backend/src/daemons/DaemonModule.ts b/packages/backend/src/daemons/DaemonModule.ts index a67907e6dd..236985076c 100644 --- a/packages/backend/src/daemons/DaemonModule.ts +++ b/packages/backend/src/daemons/DaemonModule.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/daemons/QueueStatsService.ts b/packages/backend/src/daemons/QueueStatsService.ts index ede104b9fe..5edc0f45ab 100644 --- a/packages/backend/src/daemons/QueueStatsService.ts +++ b/packages/backend/src/daemons/QueueStatsService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/daemons/ServerStatsService.ts b/packages/backend/src/daemons/ServerStatsService.ts index d229efb123..c5ef9b2fa3 100644 --- a/packages/backend/src/daemons/ServerStatsService.ts +++ b/packages/backend/src/daemons/ServerStatsService.ts @@ -1,16 +1,15 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import si from 'systeminformation'; import Xev from 'xev'; import * as osUtils from 'os-utils'; import { bindThis } from '@/decorators.js'; +import { MetaService } from '@/core/MetaService.js'; import type { OnApplicationShutdown } from '@nestjs/common'; -import { MiMeta } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; const ev = new Xev(); @@ -24,8 +23,7 @@ export class ServerStatsService implements OnApplicationShutdown { private intervalId: NodeJS.Timeout | null = null; constructor( - @Inject(DI.meta) - private meta: MiMeta, + private metaService: MetaService, ) { } @@ -34,12 +32,12 @@ export class ServerStatsService implements OnApplicationShutdown { */ @bindThis public async start(): Promise { - if (!this.meta.enableServerMachineStats) return; + if (!(await this.metaService.fetch(true)).enableServerMachineStats) return; const log = [] as any[]; ev.on('requestServerStatsLog', x => { - ev.emit(`serverStatsLog:${x.id}`, log.slice(0, x.length)); + ev.emit(`serverStatsLog:${x.id}`, log.slice(0, x.length ?? 50)); }); const tick = async () => { diff --git a/packages/backend/src/decorators.ts b/packages/backend/src/decorators.ts index 42f925e125..6b439978db 100644 --- a/packages/backend/src/decorators.ts +++ b/packages/backend/src/decorators.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,9 +10,8 @@ * The getter will return a .bind version of the function * and memoize the result against a symbol on the instance */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any export function bindThis(target: any, key: string, descriptor: any) { - const fn = descriptor.value; + let fn = descriptor.value; if (typeof fn !== 'function') { throw new TypeError(`@bindThis decorator can only be applied to methods not: ${typeof fn}`); @@ -22,18 +21,26 @@ export function bindThis(target: any, key: string, descriptor: any) { configurable: true, get() { // eslint-disable-next-line no-prototype-builtins - if (this === target.prototype || this.hasOwnProperty(key)) { + if (this === target.prototype || this.hasOwnProperty(key) || + typeof fn !== 'function') { return fn; } const boundFn = fn.bind(this); - Reflect.defineProperty(this, key, { - value: boundFn, + Object.defineProperty(this, key, { configurable: true, - writable: true, + get() { + return boundFn; + }, + set(value) { + fn = value; + delete this[key]; + }, }); - return boundFn; }, + set(value: any) { + fn = value; + }, }; } diff --git a/packages/backend/src/di-symbols.ts b/packages/backend/src/di-symbols.ts index e599fc7b37..8411cb8229 100644 --- a/packages/backend/src/di-symbols.ts +++ b/packages/backend/src/di-symbols.ts @@ -1,18 +1,16 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ export const DI = { config: Symbol('config'), db: Symbol('db'), - meta: Symbol('meta'), meilisearch: Symbol('meilisearch'), redis: Symbol('redis'), redisForPub: Symbol('redisForPub'), redisForSub: Symbol('redisForSub'), redisForTimelines: Symbol('redisForTimelines'), - redisForReactions: Symbol('redisForReactions'), //#region Repositories usersRepository: Symbol('usersRepository'), @@ -51,7 +49,6 @@ export const DI = { swSubscriptionsRepository: Symbol('swSubscriptionsRepository'), hashtagsRepository: Symbol('hashtagsRepository'), abuseUserReportsRepository: Symbol('abuseUserReportsRepository'), - abuseReportNotificationRecipientRepository: Symbol('abuseReportNotificationRecipientRepository'), registrationTicketsRepository: Symbol('registrationTicketsRepository'), authSessionsRepository: Symbol('authSessionsRepository'), accessTokensRepository: Symbol('accessTokensRepository'), @@ -73,7 +70,6 @@ export const DI = { channelFavoritesRepository: Symbol('channelFavoritesRepository'), registryItemsRepository: Symbol('registryItemsRepository'), webhooksRepository: Symbol('webhooksRepository'), - systemWebhooksRepository: Symbol('systemWebhooksRepository'), adsRepository: Symbol('adsRepository'), passwordResetRequestsRepository: Symbol('passwordResetRequestsRepository'), retentionAggregationsRepository: Symbol('retentionAggregationsRepository'), @@ -82,7 +78,5 @@ export const DI = { flashsRepository: Symbol('flashsRepository'), flashLikesRepository: Symbol('flashLikesRepository'), userMemosRepository: Symbol('userMemosRepository'), - bubbleGameRecordsRepository: Symbol('bubbleGameRecordsRepository'), - reversiGamesRepository: Symbol('reversiGamesRepository'), //#endregion }; diff --git a/packages/backend/src/env.ts b/packages/backend/src/env.ts index ba44cfa2e6..af1c3bdd3c 100644 --- a/packages/backend/src/env.ts +++ b/packages/backend/src/env.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/global.d.ts b/packages/backend/src/global.d.ts index 2f19e85525..a9e6243cc4 100644 --- a/packages/backend/src/global.d.ts +++ b/packages/backend/src/global.d.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/logger.ts b/packages/backend/src/logger.ts index ff5363a425..5c10559ec6 100644 --- a/packages/backend/src/logger.ts +++ b/packages/backend/src/logger.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -22,27 +22,31 @@ type Level = 'error' | 'success' | 'warning' | 'debug' | 'info'; export default class Logger { private context: Context; private parentLogger: Logger | null = null; + private store: boolean; - constructor(context: string, color?: KEYWORD) { + constructor(context: string, color?: KEYWORD, store = true) { this.context = { name: context, color: color, }; + this.store = store; } @bindThis - public createSubLogger(context: string, color?: KEYWORD): Logger { - const logger = new Logger(context, color); + public createSubLogger(context: string, color?: KEYWORD, store = true): Logger { + const logger = new Logger(context, color, store); logger.parentLogger = this; return logger; } @bindThis - private log(level: Level, message: string, data?: Record | null, important = false, subContexts: Context[] = []): void { + private log(level: Level, message: string, data?: Record | null, important = false, subContexts: Context[] = [], store = true): void { if (envOption.quiet) return; + if (!this.store) store = false; + if (level === 'debug') store = false; if (this.parentLogger) { - this.parentLogger.log(level, message, data, important, [this.context].concat(subContexts)); + this.parentLogger.log(level, message, data, important, [this.context].concat(subContexts), store); return; } @@ -67,11 +71,8 @@ export default class Logger { let log = `${l} ${worker}\t[${contexts.join(' ')}]\t${m}`; if (envOption.withLogTime) log = chalk.gray(time) + ' ' + log; - const args: unknown[] = [important ? chalk.bold(log) : log]; - if (data != null) { - args.push(data); - } - console.log(...args); + console.log(important ? chalk.bold(log) : log); + if (level === 'error' && data) console.log(data); } @bindThis diff --git a/packages/backend/src/misc/FileWriterStream.ts b/packages/backend/src/misc/FileWriterStream.ts deleted file mode 100644 index 367a8eb560..0000000000 --- a/packages/backend/src/misc/FileWriterStream.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import * as fs from 'node:fs/promises'; -import type { PathLike } from 'node:fs'; - -/** - * `fs.createWriteStream()`相当のことを行う`WritableStream` (Web標準) - */ -export class FileWriterStream extends WritableStream { - constructor(path: PathLike) { - let file: fs.FileHandle | null = null; - - super({ - start: async () => { - file = await fs.open(path, 'a'); - }, - write: async (chunk, controller) => { - if (file === null) { - controller.error(); - throw new Error(); - } - - await file.write(chunk); - }, - close: async () => { - await file?.close(); - }, - abort: async () => { - await file?.close(); - }, - }); - } -} diff --git a/packages/backend/src/misc/JsonArrayStream.ts b/packages/backend/src/misc/JsonArrayStream.ts deleted file mode 100644 index 754938989d..0000000000 --- a/packages/backend/src/misc/JsonArrayStream.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { TransformStream } from 'node:stream/web'; - -/** - * ストリームに流れてきた各データについて`JSON.stringify()`した上で、それらを一つの配列にまとめる - */ -export class JsonArrayStream extends TransformStream { - constructor() { - /** 最初の要素かどうかを変数に記録 */ - let isFirst = true; - - super({ - start(controller) { - controller.enqueue('['); - }, - flush(controller) { - controller.enqueue(']'); - }, - transform(chunk, controller) { - if (isFirst) { - isFirst = false; - } else { - // 妥当なJSON配列にするためには最初以外の要素の前に`,`を挿入しなければならない - controller.enqueue(',\n'); - } - - controller.enqueue(JSON.stringify(chunk)); - }, - }); - } -} diff --git a/packages/backend/src/misc/acct.ts b/packages/backend/src/misc/acct.ts index 3d729b1151..5db72746c0 100644 --- a/packages/backend/src/misc/acct.ts +++ b/packages/backend/src/misc/acct.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/cache.ts b/packages/backend/src/misc/cache.ts index f9692ce5d5..c235871931 100644 --- a/packages/backend/src/misc/cache.ts +++ b/packages/backend/src/misc/cache.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,23 +7,23 @@ import * as Redis from 'ioredis'; import { bindThis } from '@/decorators.js'; export class RedisKVCache { - private readonly lifetime: number; - private readonly memoryCache: MemoryKVCache; - private readonly fetcher: (key: string) => Promise; - private readonly toRedisConverter: (value: T) => string; - private readonly fromRedisConverter: (value: string) => T | undefined; + private redisClient: Redis.Redis; + private name: string; + private lifetime: number; + private memoryCache: MemoryKVCache; + private fetcher: (key: string) => Promise; + private toRedisConverter: (value: T) => string; + private fromRedisConverter: (value: string) => T | undefined; - constructor( - private redisClient: Redis.Redis, - private name: string, - opts: { - lifetime: RedisKVCache['lifetime']; - memoryCacheLifetime: number; - fetcher: RedisKVCache['fetcher']; - toRedisConverter: RedisKVCache['toRedisConverter']; - fromRedisConverter: RedisKVCache['fromRedisConverter']; - }, - ) { + constructor(redisClient: RedisKVCache['redisClient'], name: RedisKVCache['name'], opts: { + lifetime: RedisKVCache['lifetime']; + memoryCacheLifetime: number; + fetcher: RedisKVCache['fetcher']; + toRedisConverter: RedisKVCache['toRedisConverter']; + fromRedisConverter: RedisKVCache['fromRedisConverter']; + }) { + this.redisClient = redisClient; + this.name = name; this.lifetime = opts.lifetime; this.memoryCache = new MemoryKVCache(opts.memoryCacheLifetime); this.fetcher = opts.fetcher; @@ -55,13 +55,7 @@ export class RedisKVCache { const cached = await this.redisClient.get(`kvcache:${this.name}:${key}`); if (cached == null) return undefined; - - const value = this.fromRedisConverter(cached); - if (value !== undefined) { - this.memoryCache.set(key, value); - } - - return value; + return this.fromRedisConverter(cached); } @bindThis @@ -72,10 +66,6 @@ export class RedisKVCache { /** * キャッシュがあればそれを返し、無ければfetcherを呼び出して結果をキャッシュ&返します - * This awaits the call to Redis to ensure that the write succeeded, which is important for a few reasons: - * * Other code uses this to synchronize changes between worker processes. A failed write can internally de-sync the cluster. - * * Without an `await`, consecutive calls could race. An unlucky race could result in the older write overwriting the newer value. - * * Not awaiting here makes the entire cache non-consistent. The prevents many possible uses. */ @bindThis public async fetch(key: string): Promise { @@ -87,14 +77,14 @@ export class RedisKVCache { // Cache MISS const value = await this.fetcher(key); - await this.set(key, value); + this.set(key, value); return value; } @bindThis public async refresh(key: string) { const value = await this.fetcher(key); - await this.set(key, value); + this.set(key, value); // TODO: イベント発行して他プロセスのメモリキャッシュも更新できるようにする } @@ -111,23 +101,23 @@ export class RedisKVCache { } export class RedisSingleCache { - private readonly lifetime: number; - private readonly memoryCache: MemorySingleCache; - private readonly fetcher: () => Promise; - private readonly toRedisConverter: (value: T) => string; - private readonly fromRedisConverter: (value: string) => T | undefined; + private redisClient: Redis.Redis; + private name: string; + private lifetime: number; + private memoryCache: MemorySingleCache; + private fetcher: () => Promise; + private toRedisConverter: (value: T) => string; + private fromRedisConverter: (value: string) => T | undefined; - constructor( - private redisClient: Redis.Redis, - private name: string, - opts: { - lifetime: number; - memoryCacheLifetime: number; - fetcher: RedisSingleCache['fetcher']; - toRedisConverter: RedisSingleCache['toRedisConverter']; - fromRedisConverter: RedisSingleCache['fromRedisConverter']; - }, - ) { + constructor(redisClient: RedisSingleCache['redisClient'], name: RedisSingleCache['name'], opts: { + lifetime: RedisSingleCache['lifetime']; + memoryCacheLifetime: number; + fetcher: RedisSingleCache['fetcher']; + toRedisConverter: RedisSingleCache['toRedisConverter']; + fromRedisConverter: RedisSingleCache['fromRedisConverter']; + }) { + this.redisClient = redisClient; + this.name = name; this.lifetime = opts.lifetime; this.memoryCache = new MemorySingleCache(opts.memoryCacheLifetime); this.fetcher = opts.fetcher; @@ -159,13 +149,7 @@ export class RedisSingleCache { const cached = await this.redisClient.get(`singlecache:${this.name}`); if (cached == null) return undefined; - - const value = this.fromRedisConverter(cached); - if (value !== undefined) { - this.memoryCache.set(value); - } - - return value; + return this.fromRedisConverter(cached); } @bindThis @@ -176,10 +160,6 @@ export class RedisSingleCache { /** * キャッシュがあればそれを返し、無ければfetcherを呼び出して結果をキャッシュ&返します - * This awaits the call to Redis to ensure that the write succeeded, which is important for a few reasons: - * * Other code uses this to synchronize changes between worker processes. A failed write can internally de-sync the cluster. - * * Without an `await`, consecutive calls could race. An unlucky race could result in the older write overwriting the newer value. - * * Not awaiting here makes the entire cache non-consistent. The prevents many possible uses. */ @bindThis public async fetch(): Promise { @@ -191,14 +171,14 @@ export class RedisSingleCache { // Cache MISS const value = await this.fetcher(); - await this.set(value); + this.set(value); return value; } @bindThis public async refresh() { const value = await this.fetcher(); - await this.set(value); + this.set(value); // TODO: イベント発行して他プロセスのメモリキャッシュも更新できるようにする } @@ -206,23 +186,39 @@ export class RedisSingleCache { // TODO: メモリ節約のためあまり参照されないキーを定期的に削除できるようにする? -export class MemoryKVCache { - private readonly cache = new Map(); - private readonly gcIntervalHandle = setInterval(() => this.gc(), 1000 * 60 * 3); // 3m +function nothingToDo(value: T): V { + return value as unknown as V; +} - constructor( - private readonly lifetime: number, - ) {} +export class MemoryKVCache { + public cache: Map; + private lifetime: number; + private gcIntervalHandle: NodeJS.Timeout; + private toMapConverter: (value: T) => V; + private fromMapConverter: (cached: V) => T | undefined; + + constructor(lifetime: MemoryKVCache['lifetime'], options: { + toMapConverter: (value: T) => V; + fromMapConverter: (cached: V) => T | undefined; + } = { + toMapConverter: nothingToDo, + fromMapConverter: nothingToDo, + }) { + this.cache = new Map(); + this.lifetime = lifetime; + this.toMapConverter = options.toMapConverter; + this.fromMapConverter = options.fromMapConverter; + + this.gcIntervalHandle = setInterval(() => { + this.gc(); + }, 1000 * 60 * 3); + } @bindThis - /** - * Mapにキャッシュをセットします - * @deprecated これを直接呼び出すべきではない。InternalEventなどで変更を全てのプロセス/マシンに通知するべき - */ public set(key: string, value: T): void { this.cache.set(key, { date: Date.now(), - value, + value: this.toMapConverter(value), }); } @@ -234,7 +230,7 @@ export class MemoryKVCache { this.cache.delete(key); return undefined; } - return cached.value; + return this.fromMapConverter(cached.value); } @bindThis @@ -245,9 +241,10 @@ export class MemoryKVCache { /** * キャッシュがあればそれを返し、無ければfetcherを呼び出して結果をキャッシュ&返します * optional: キャッシュが存在してもvalidatorでfalseを返すとキャッシュ無効扱いにします + * fetcherの引数はcacheに保存されている値があれば渡されます */ @bindThis - public async fetch(key: string, fetcher: () => Promise, validator?: (cachedValue: T) => boolean): Promise { + public async fetch(key: string, fetcher: (value: V | undefined) => Promise, validator?: (cachedValue: T) => boolean): Promise { const cachedValue = this.get(key); if (cachedValue !== undefined) { if (validator) { @@ -262,7 +259,7 @@ export class MemoryKVCache { } // Cache MISS - const value = await fetcher(); + const value = await fetcher(this.cache.get(key)?.value); this.set(key, value); return value; } @@ -270,9 +267,10 @@ export class MemoryKVCache { /** * キャッシュがあればそれを返し、無ければfetcherを呼び出して結果をキャッシュ&返します * optional: キャッシュが存在してもvalidatorでfalseを返すとキャッシュ無効扱いにします + * fetcherの引数はcacheに保存されている値があれば渡されます */ @bindThis - public async fetchMaybe(key: string, fetcher: () => Promise, validator?: (cachedValue: T) => boolean): Promise { + public async fetchMaybe(key: string, fetcher: (value: V | undefined) => Promise, validator?: (cachedValue: T) => boolean): Promise { const cachedValue = this.get(key); if (cachedValue !== undefined) { if (validator) { @@ -287,7 +285,7 @@ export class MemoryKVCache { } // Cache MISS - const value = await fetcher(); + const value = await fetcher(this.cache.get(key)?.value); if (value !== undefined) { this.set(key, value); } @@ -297,14 +295,10 @@ export class MemoryKVCache { @bindThis public gc(): void { const now = Date.now(); - for (const [key, { date }] of this.cache.entries()) { - // The map is ordered from oldest to youngest. - // We can stop once we find an entry that's still active, because all following entries must *also* be active. - const age = now - date; - if (age < this.lifetime) break; - - this.cache.delete(key); + if ((now - date) > this.lifetime) { + this.cache.delete(key); + } } } @@ -312,19 +306,16 @@ export class MemoryKVCache { public dispose(): void { clearInterval(this.gcIntervalHandle); } - - public get entries() { - return this.cache.entries(); - } } export class MemorySingleCache { private cachedAt: number | null = null; private value: T | undefined; + private lifetime: number; - constructor( - private lifetime: number, - ) {} + constructor(lifetime: MemorySingleCache['lifetime']) { + this.lifetime = lifetime; + } @bindThis public set(value: T): void { diff --git a/packages/backend/src/misc/check-https.ts b/packages/backend/src/misc/check-https.ts index 15a54f6ce7..0b13ccabdd 100644 --- a/packages/backend/src/misc/check-https.ts +++ b/packages/backend/src/misc/check-https.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/check-word-mute.ts b/packages/backend/src/misc/check-word-mute.ts index c50f2b723c..cef5595451 100644 --- a/packages/backend/src/misc/check-word-mute.ts +++ b/packages/backend/src/misc/check-word-mute.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/clone.ts b/packages/backend/src/misc/clone.ts index ed05485649..9d20deac3b 100644 --- a/packages/backend/src/misc/clone.ts +++ b/packages/backend/src/misc/clone.ts @@ -1,12 +1,12 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ // structredCloneが遅いため // SEE: http://var.blog.jp/archives/86038606.html -type Cloneable = string | number | boolean | null | undefined | { [key: string]: Cloneable } | Cloneable[]; +type Cloneable = string | number | boolean | null | { [key: string]: Cloneable } | Cloneable[]; export function deepClone(x: T): T { if (typeof x === 'object') { @@ -14,7 +14,7 @@ export function deepClone(x: T): T { if (Array.isArray(x)) return x.map(deepClone) as T; const obj = {} as Record; for (const [k, v] of Object.entries(x)) { - obj[k] = v === undefined ? undefined : deepClone(v); + obj[k] = deepClone(v); } return obj as T; } else { diff --git a/packages/backend/src/misc/collapsed-queue.ts b/packages/backend/src/misc/collapsed-queue.ts deleted file mode 100644 index 5bc20a78ae..0000000000 --- a/packages/backend/src/misc/collapsed-queue.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -type Job = { - value: V; - timer: NodeJS.Timeout; -}; - -// TODO: redis使えるようにする -export class CollapsedQueue { - private jobs: Map> = new Map(); - - constructor( - private timeout: number, - private collapse: (oldValue: V, newValue: V) => V, - private perform: (key: K, value: V) => Promise, - ) {} - - enqueue(key: K, value: V) { - if (this.jobs.has(key)) { - const old = this.jobs.get(key)!; - const merged = this.collapse(old.value, value); - this.jobs.set(key, { ...old, value: merged }); - } else { - const timer = setTimeout(() => { - const job = this.jobs.get(key)!; - this.jobs.delete(key); - this.perform(key, job.value); - }, this.timeout); - this.jobs.set(key, { value, timer }); - } - } - - async performAllNow() { - const entries = [...this.jobs.entries()]; - this.jobs.clear(); - for (const [_key, job] of entries) { - clearTimeout(job.timer); - } - await Promise.allSettled(entries.map(([key, job]) => this.perform(key, job.value))); - } -} diff --git a/packages/backend/src/misc/content-disposition.ts b/packages/backend/src/misc/content-disposition.ts index 467b5057d6..1ac8c88d21 100644 --- a/packages/backend/src/misc/content-disposition.ts +++ b/packages/backend/src/misc/content-disposition.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/correct-filename.ts b/packages/backend/src/misc/correct-filename.ts index f7ee02781d..9130af44c3 100644 --- a/packages/backend/src/misc/correct-filename.ts +++ b/packages/backend/src/misc/correct-filename.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -21,7 +21,7 @@ const extRegExp = /\.[0-9a-zA-Z]+$/i; /** * 与えられた拡張子とファイル名が一致しているかどうかを確認し、 * 一致していない場合は拡張子を付与して返す - * + * * extはfile-typeのextを想定 */ export function correctFilename(filename: string, ext: string | null) { diff --git a/packages/backend/src/misc/create-temp.ts b/packages/backend/src/misc/create-temp.ts index 9aaecf8263..2bb0e88489 100644 --- a/packages/backend/src/misc/create-temp.ts +++ b/packages/backend/src/misc/create-temp.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/dev-null.ts b/packages/backend/src/misc/dev-null.ts index 4d9806fbe8..f510177c0b 100644 --- a/packages/backend/src/misc/dev-null.ts +++ b/packages/backend/src/misc/dev-null.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/emoji-regex.ts b/packages/backend/src/misc/emoji-regex.ts index 6d03b433ba..37ecde6eb1 100644 --- a/packages/backend/src/misc/emoji-regex.ts +++ b/packages/backend/src/misc/emoji-regex.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/extract-custom-emojis-from-mfm.ts b/packages/backend/src/misc/extract-custom-emojis-from-mfm.ts index 73ae9abb54..0b898d47e8 100644 --- a/packages/backend/src/misc/extract-custom-emojis-from-mfm.ts +++ b/packages/backend/src/misc/extract-custom-emojis-from-mfm.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/extract-hashtags.ts b/packages/backend/src/misc/extract-hashtags.ts index d3d245d414..3bd56e98eb 100644 --- a/packages/backend/src/misc/extract-hashtags.ts +++ b/packages/backend/src/misc/extract-hashtags.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/extract-mentions.ts b/packages/backend/src/misc/extract-mentions.ts index 2ec9349718..272eb92192 100644 --- a/packages/backend/src/misc/extract-mentions.ts +++ b/packages/backend/src/misc/extract-mentions.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/fastify-hook-handlers.ts b/packages/backend/src/misc/fastify-hook-handlers.ts deleted file mode 100644 index fa3ef0a267..0000000000 --- a/packages/backend/src/misc/fastify-hook-handlers.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import type { onRequestHookHandler } from 'fastify'; - -export const handleRequestRedirectToOmitSearch: onRequestHookHandler = (request, reply, done) => { - const index = request.url.indexOf('?'); - if (~index) { - reply.redirect(request.url.slice(0, index), 301); - } - done(); -}; diff --git a/packages/backend/src/misc/fastify-reply-error.ts b/packages/backend/src/misc/fastify-reply-error.ts index e6c4e78d2f..7c889bab7a 100644 --- a/packages/backend/src/misc/fastify-reply-error.ts +++ b/packages/backend/src/misc/fastify-reply-error.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/gen-identicon.ts b/packages/backend/src/misc/gen-identicon.ts index 342e0f8602..c36b00af63 100644 --- a/packages/backend/src/misc/gen-identicon.ts +++ b/packages/backend/src/misc/gen-identicon.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,8 +8,9 @@ * https://en.wikipedia.org/wiki/Identicon */ -import { createCanvas } from '@napi-rs/canvas'; +import * as p from 'pureimage'; import gen from 'random-seed'; +import type { WriteStream } from 'node:fs'; const size = 128; // px const n = 5; // resolution @@ -44,9 +45,9 @@ const sideN = Math.floor(n / 2); /** * Generate buffer of an identicon by seed */ -export async function genIdenticon(seed: string): Promise { +export function genIdenticon(seed: string, stream: WriteStream): Promise { const rand = gen.create(seed); - const canvas = createCanvas(size, size); + const canvas = p.make(size, size, undefined); const ctx = canvas.getContext('2d'); const bgColors = colors[rand(colors.length)]; @@ -100,5 +101,5 @@ export async function genIdenticon(seed: string): Promise { } } - return await canvas.encode('png'); + return p.encodePNGToStream(canvas, stream); } diff --git a/packages/backend/src/misc/gen-key-pair.ts b/packages/backend/src/misc/gen-key-pair.ts index 02a303dc0a..c0815613e7 100644 --- a/packages/backend/src/misc/gen-key-pair.ts +++ b/packages/backend/src/misc/gen-key-pair.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/generate-invite-code.ts b/packages/backend/src/misc/generate-invite-code.ts index 006920cf0e..7c88561179 100644 --- a/packages/backend/src/misc/generate-invite-code.ts +++ b/packages/backend/src/misc/generate-invite-code.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/generate-native-user-token.ts b/packages/backend/src/misc/generate-native-user-token.ts index 85fb383ba2..094c625120 100644 --- a/packages/backend/src/misc/generate-native-user-token.ts +++ b/packages/backend/src/misc/generate-native-user-token.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/get-ip-hash.ts b/packages/backend/src/misc/get-ip-hash.ts index e132fa8f31..3a01e4f578 100644 --- a/packages/backend/src/misc/get-ip-hash.ts +++ b/packages/backend/src/misc/get-ip-hash.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/get-note-summary.ts b/packages/backend/src/misc/get-note-summary.ts index 1a07139a50..1bda5cdcf7 100644 --- a/packages/backend/src/misc/get-note-summary.ts +++ b/packages/backend/src/misc/get-note-summary.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/get-reaction-emoji.ts b/packages/backend/src/misc/get-reaction-emoji.ts index 3f975853ed..80ef7ff7bc 100644 --- a/packages/backend/src/misc/get-reaction-emoji.ts +++ b/packages/backend/src/misc/get-reaction-emoji.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/i18n.ts b/packages/backend/src/misc/i18n.ts index 6cbbdef74c..4c9d1a08e3 100644 --- a/packages/backend/src/misc/i18n.ts +++ b/packages/backend/src/misc/i18n.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/id/aid.ts b/packages/backend/src/misc/id/aid.ts index 60ba788e44..de03f6793f 100644 --- a/packages/backend/src/misc/id/aid.ts +++ b/packages/backend/src/misc/id/aid.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/id/aidx.ts b/packages/backend/src/misc/id/aidx.ts index 1b087e70af..9f457f6f0a 100644 --- a/packages/backend/src/misc/id/aidx.ts +++ b/packages/backend/src/misc/id/aidx.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/id/meid.ts b/packages/backend/src/misc/id/meid.ts index dfab48a369..7646282edb 100644 --- a/packages/backend/src/misc/id/meid.ts +++ b/packages/backend/src/misc/id/meid.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/id/meidg.ts b/packages/backend/src/misc/id/meidg.ts index b9c0cc3dda..f2a55443ef 100644 --- a/packages/backend/src/misc/id/meidg.ts +++ b/packages/backend/src/misc/id/meidg.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/id/object-id.ts b/packages/backend/src/misc/id/object-id.ts index 243f92bbac..f5c3619fdb 100644 --- a/packages/backend/src/misc/id/object-id.ts +++ b/packages/backend/src/misc/id/object-id.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/id/ulid.ts b/packages/backend/src/misc/id/ulid.ts index fc3654d6d2..00dd67dafe 100644 --- a/packages/backend/src/misc/id/ulid.ts +++ b/packages/backend/src/misc/id/ulid.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/identifiable-error.ts b/packages/backend/src/misc/identifiable-error.ts index 13c41f1e3b..71a4773fac 100644 --- a/packages/backend/src/misc/identifiable-error.ts +++ b/packages/backend/src/misc/identifiable-error.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/is-duplicate-key-value-error.ts b/packages/backend/src/misc/is-duplicate-key-value-error.ts index 8da0280f60..91e0a6b93d 100644 --- a/packages/backend/src/misc/is-duplicate-key-value-error.ts +++ b/packages/backend/src/misc/is-duplicate-key-value-error.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/is-instance-muted.ts b/packages/backend/src/misc/is-instance-muted.ts index 096a8b39c7..35fe11849d 100644 --- a/packages/backend/src/misc/is-instance-muted.ts +++ b/packages/backend/src/misc/is-instance-muted.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/is-mime-image.ts b/packages/backend/src/misc/is-mime-image.ts index 8ffbc99230..1a5a8cf0f4 100644 --- a/packages/backend/src/misc/is-mime-image.ts +++ b/packages/backend/src/misc/is-mime-image.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/is-native-token.ts b/packages/backend/src/misc/is-native-token.ts index 300c4c05b3..618e60b7d8 100644 --- a/packages/backend/src/misc/is-native-token.ts +++ b/packages/backend/src/misc/is-native-token.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/is-not-null.ts b/packages/backend/src/misc/is-not-null.ts new file mode 100644 index 0000000000..153a9e51ef --- /dev/null +++ b/packages/backend/src/misc/is-not-null.ts @@ -0,0 +1,10 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +// we are using {} as "any non-nullish value" as expected +// eslint-disable-next-line @typescript-eslint/ban-types +export function isNotNull(input: T | undefined | null): input is T { + return input != null; +} diff --git a/packages/backend/src/misc/is-pure-renote.ts b/packages/backend/src/misc/is-pure-renote.ts new file mode 100644 index 0000000000..994d981522 --- /dev/null +++ b/packages/backend/src/misc/is-pure-renote.ts @@ -0,0 +1,10 @@ +import type { MiNote } from '@/models/Note.js'; + +export function isPureRenote(note: MiNote): note is MiNote & { renoteId: NonNullable } { + if (!note.renoteId) return false; + + if (note.text) return false; // it's quoted with text + if (note.fileIds.length !== 0) return false; // it's quoted with files + if (note.hasPoll) return false; // it's quoted with poll + return true; +} diff --git a/packages/backend/src/misc/is-quote.ts b/packages/backend/src/misc/is-quote.ts new file mode 100644 index 0000000000..db72d1d57a --- /dev/null +++ b/packages/backend/src/misc/is-quote.ts @@ -0,0 +1,12 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type { MiNote } from '@/models/Note.js'; + +// eslint-disable-next-line import/no-default-export +export default function(note: MiNote): boolean { + // sync with NoteCreateService.isQuote + return note.renoteId != null && (note.text != null || note.hasPoll || (note.fileIds != null && note.fileIds.length > 0)); +} diff --git a/packages/backend/src/misc/is-renote.ts b/packages/backend/src/misc/is-renote.ts deleted file mode 100644 index f4bb329d80..0000000000 --- a/packages/backend/src/misc/is-renote.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import type { MiNote } from '@/models/Note.js'; -import type { Packed } from '@/misc/json-schema.js'; - -// NoteEntityService.isPureRenote とよしなにリンク - -type Renote = - MiNote & { - renoteId: NonNullable - }; - -type Quote = - Renote & ({ - text: NonNullable - } | { - cw: NonNullable - } | { - replyId: NonNullable - reply: NonNullable - } | { - hasPoll: true - }); - -export function isRenote(note: MiNote): note is Renote { - return note.renoteId != null; -} - -export function isQuote(note: Renote): note is Quote { - // NOTE: SYNC WITH NoteCreateService.isQuote - return note.text != null || - note.cw != null || - note.replyId != null || - note.hasPoll || - note.fileIds.length > 0; -} - -type PackedRenote = - Packed<'Note'> & { - renoteId: NonNullable['renoteId']> - }; - -type PackedQuote = - PackedRenote & ({ - text: NonNullable['text']> - } | { - cw: NonNullable['cw']> - } | { - replyId: NonNullable['replyId']> - } | { - poll: NonNullable['poll']> - } | { - fileIds: NonNullable['fileIds']> - }); - -export function isRenotePacked(note: Packed<'Note'>): note is PackedRenote { - return note.renoteId != null; -} - -export function isQuotePacked(note: PackedRenote): note is PackedQuote { - return note.text != null || - note.cw != null || - note.replyId != null || - note.poll != null || - (note.fileIds != null && note.fileIds.length > 0); -} diff --git a/packages/backend/src/misc/is-reply.ts b/packages/backend/src/misc/is-reply.ts index 980eae11c9..964c2aa153 100644 --- a/packages/backend/src/misc/is-reply.ts +++ b/packages/backend/src/misc/is-reply.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/is-user-related.ts b/packages/backend/src/misc/is-user-related.ts index 862d6e6a38..6efb1194d3 100644 --- a/packages/backend/src/misc/is-user-related.ts +++ b/packages/backend/src/misc/is-user-related.ts @@ -1,13 +1,9 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ export function isUserRelated(note: any, userIds: Set, ignoreAuthor = false): boolean { - if (!note) { - return false; - } - if (userIds.has(note.userId) && !ignoreAuthor) { return true; } diff --git a/packages/backend/src/misc/json-schema.ts b/packages/backend/src/misc/json-schema.ts index 040e36228c..176978d35f 100644 --- a/packages/backend/src/misc/json-schema.ts +++ b/packages/backend/src/misc/json-schema.ts @@ -1,15 +1,15 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { - packedMeDetailedOnlySchema, - packedMeDetailedSchema, - packedUserDetailedNotMeOnlySchema, - packedUserDetailedNotMeSchema, - packedUserDetailedSchema, packedUserLiteSchema, + packedUserDetailedNotMeOnlySchema, + packedMeDetailedOnlySchema, + packedUserDetailedNotMeSchema, + packedMeDetailedSchema, + packedUserDetailedSchema, packedUserSchema, } from '@/models/json-schema/user.js'; import { packedNoteSchema } from '@/models/json-schema/note.js'; @@ -25,7 +25,7 @@ import { packedBlockingSchema } from '@/models/json-schema/blocking.js'; import { packedNoteReactionSchema } from '@/models/json-schema/note-reaction.js'; import { packedHashtagSchema } from '@/models/json-schema/hashtag.js'; import { packedInviteCodeSchema } from '@/models/json-schema/invite-code.js'; -import { packedPageBlockSchema, packedPageSchema } from '@/models/json-schema/page.js'; +import { packedPageSchema } from '@/models/json-schema/page.js'; import { packedNoteFavoriteSchema } from '@/models/json-schema/note-favorite.js'; import { packedChannelSchema } from '@/models/json-schema/channel.js'; import { packedAntennaSchema } from '@/models/json-schema/antenna.js'; @@ -37,28 +37,8 @@ import { packedEmojiDetailedSchema, packedEmojiSimpleSchema } from '@/models/jso import { packedFlashSchema } from '@/models/json-schema/flash.js'; import { packedAnnouncementSchema } from '@/models/json-schema/announcement.js'; import { packedSigninSchema } from '@/models/json-schema/signin.js'; -import { - packedRoleCondFormulaFollowersOrFollowingOrNotesSchema, - packedRoleCondFormulaLogicsSchema, - packedRoleCondFormulaValueAssignedRoleSchema, - packedRoleCondFormulaValueCreatedSchema, - packedRoleCondFormulaValueIsLocalOrRemoteSchema, - packedRoleCondFormulaValueNot, - packedRoleCondFormulaValueSchema, - packedRoleCondFormulaValueUserSettingBooleanSchema, - packedRoleLiteSchema, - packedRolePoliciesSchema, - packedRoleSchema, -} from '@/models/json-schema/role.js'; +import { packedRoleLiteSchema, packedRoleSchema } from '@/models/json-schema/role.js'; import { packedAdSchema } from '@/models/json-schema/ad.js'; -import { packedReversiGameDetailedSchema, packedReversiGameLiteSchema } from '@/models/json-schema/reversi-game.js'; -import { - packedMetaDetailedOnlySchema, - packedMetaDetailedSchema, - packedMetaLiteSchema, -} from '@/models/json-schema/meta.js'; -import { packedSystemWebhookSchema } from '@/models/json-schema/system-webhook.js'; -import { packedAbuseReportNotificationRecipientSchema } from '@/models/json-schema/abuse-report-notification-recipient.js'; export const refs = { UserLite: packedUserLiteSchema, @@ -86,7 +66,6 @@ export const refs = { Hashtag: packedHashtagSchema, InviteCode: packedInviteCodeSchema, Page: packedPageSchema, - PageBlock: packedPageBlockSchema, Channel: packedChannelSchema, QueueCount: packedQueueCountSchema, Antenna: packedAntennaSchema, @@ -97,31 +76,12 @@ export const refs = { EmojiDetailed: packedEmojiDetailedSchema, Flash: packedFlashSchema, Signin: packedSigninSchema, - RoleCondFormulaLogics: packedRoleCondFormulaLogicsSchema, - RoleCondFormulaValueNot: packedRoleCondFormulaValueNot, - RoleCondFormulaValueIsLocalOrRemote: packedRoleCondFormulaValueIsLocalOrRemoteSchema, - RoleCondFormulaValueUserSettingBooleanSchema: packedRoleCondFormulaValueUserSettingBooleanSchema, - RoleCondFormulaValueAssignedRole: packedRoleCondFormulaValueAssignedRoleSchema, - RoleCondFormulaValueCreated: packedRoleCondFormulaValueCreatedSchema, - RoleCondFormulaFollowersOrFollowingOrNotes: packedRoleCondFormulaFollowersOrFollowingOrNotesSchema, - RoleCondFormulaValue: packedRoleCondFormulaValueSchema, RoleLite: packedRoleLiteSchema, Role: packedRoleSchema, - RolePolicies: packedRolePoliciesSchema, - ReversiGameLite: packedReversiGameLiteSchema, - ReversiGameDetailed: packedReversiGameDetailedSchema, - MetaLite: packedMetaLiteSchema, - MetaDetailedOnly: packedMetaDetailedOnlySchema, - MetaDetailed: packedMetaDetailedSchema, - SystemWebhook: packedSystemWebhookSchema, - AbuseReportNotificationRecipient: packedAbuseReportNotificationRecipientSchema, }; export type Packed = SchemaType; -export type KeyOf = PropertiesToUnion; -type PropertiesToUnion

= p['properties'] extends NonNullable ? keyof p['properties'] : never; - type TypeStringef = 'null' | 'boolean' | 'integer' | 'number' | 'string' | 'array' | 'object' | 'any'; type StringDefToType = T extends 'null' ? null : @@ -144,16 +104,13 @@ export interface Schema extends OfSchema { readonly type?: TypeStringef; readonly nullable?: boolean; readonly optional?: boolean; - readonly prefixItems?: ReadonlyArray; readonly items?: Schema; - readonly unevaluatedItems?: Schema | boolean; readonly properties?: Obj; readonly required?: ReadonlyArray, string>>; readonly description?: string; readonly example?: any; readonly format?: string; readonly ref?: keyof typeof refs; - readonly selfRef?: boolean; readonly enum?: ReadonlyArray; readonly default?: (this['type'] extends TypeStringef ? StringDefToType : any) | null; readonly maxLength?: number; @@ -200,7 +157,6 @@ type UnionSchemaType = X //type UnionObjectSchemaType = X extends any ? ObjectSchemaType : never; type UnionObjType = a[number]> = X extends any ? ObjType : never; type ArrayUnion = T extends any ? Array : never; -type ArrayToTuple> = { [K in keyof X]: SchemaType }; type ObjectSchemaTypeDef

= p['ref'] extends keyof typeof refs ? Packed : @@ -235,13 +191,7 @@ export type SchemaTypeDef

= p['items']['allOf'] extends ReadonlyArray ? UnionToIntersection>>[] : never ) : - p['prefixItems'] extends ReadonlyArray ? ( - p['items'] extends NonNullable ? [...ArrayToTuple, ...SchemaType[]] : - p['items'] extends false ? ArrayToTuple : - p['unevaluatedItems'] extends false ? ArrayToTuple : - [...ArrayToTuple, ...unknown[]] - ) : - p['items'] extends NonNullable ? SchemaType[] : + p['items'] extends NonNullable ? SchemaTypeDef[] : any[] ) : p['anyOf'] extends ReadonlyArray ? UnionSchemaType & PartialIntersection> : diff --git a/packages/backend/src/misc/json-value.ts b/packages/backend/src/misc/json-value.ts deleted file mode 100644 index bd7fe12058..0000000000 --- a/packages/backend/src/misc/json-value.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export type JsonValue = JsonArray | JsonObject | string | number | boolean | null; -export type JsonObject = {[K in string]?: JsonValue}; -export type JsonArray = JsonValue[]; - -export function isJsonObject(value: JsonValue | undefined): value is JsonObject { - return typeof value === 'object' && value !== null && !Array.isArray(value); -} diff --git a/packages/backend/src/misc/langmap.ts b/packages/backend/src/misc/langmap.ts index 5ff9338651..9e287677df 100644 --- a/packages/backend/src/misc/langmap.ts +++ b/packages/backend/src/misc/langmap.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/loader.ts b/packages/backend/src/misc/loader.ts index 7f29b9db10..25f7b54d31 100644 --- a/packages/backend/src/misc/loader.ts +++ b/packages/backend/src/misc/loader.ts @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export type FetchFunction = (key: K) => Promise; type ResolveReject = Parameters>[0]>; diff --git a/packages/backend/src/misc/normalize-for-search.ts b/packages/backend/src/misc/normalize-for-search.ts index 3f19617e14..9d96f4169d 100644 --- a/packages/backend/src/misc/normalize-for-search.ts +++ b/packages/backend/src/misc/normalize-for-search.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/prelude/array.ts b/packages/backend/src/misc/prelude/array.ts index f741a0c913..b2f29bcecf 100644 --- a/packages/backend/src/misc/prelude/array.ts +++ b/packages/backend/src/misc/prelude/array.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -65,6 +65,44 @@ export function maximum(xs: number[]): number { return Math.max(...xs); } +/** + * Splits an array based on the equivalence relation. + * The concatenation of the result is equal to the argument. + */ +export function groupBy(f: EndoRelation, xs: T[]): T[][] { + const groups = [] as T[][]; + for (const x of xs) { + const lastGroup = groups.at(-1); + if (lastGroup !== undefined && f(lastGroup[0], x)) { + lastGroup.push(x); + } else { + groups.push([x]); + } + } + return groups; +} + +/** + * Splits an array based on the equivalence relation induced by the function. + * The concatenation of the result is equal to the argument. + */ +export function groupOn(f: (x: T) => S, xs: T[]): T[][] { + return groupBy((a, b) => f(a) === f(b), xs); +} + +export function groupByX(collections: T[], keySelector: (x: T) => string) { + return collections.reduce((obj: Record, item: T) => { + const key = keySelector(item); + if (!Object.prototype.hasOwnProperty.call(obj, key)) { + obj[key] = []; + } + + obj[key].push(item); + + return obj; + }, {}); +} + /** * Compare two arrays by lexicographical order */ diff --git a/packages/backend/src/misc/prelude/await-all.ts b/packages/backend/src/misc/prelude/await-all.ts index 48249fe1ae..6b8a91f8a5 100644 --- a/packages/backend/src/misc/prelude/await-all.ts +++ b/packages/backend/src/misc/prelude/await-all.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/prelude/math.ts b/packages/backend/src/misc/prelude/math.ts new file mode 100644 index 0000000000..87b5017d09 --- /dev/null +++ b/packages/backend/src/misc/prelude/math.ts @@ -0,0 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +export function gcd(a: number, b: number): number { + return b === 0 ? a : gcd(b, a % b); +} diff --git a/packages/backend/src/misc/prelude/maybe.ts b/packages/backend/src/misc/prelude/maybe.ts new file mode 100644 index 0000000000..17c100b80d --- /dev/null +++ b/packages/backend/src/misc/prelude/maybe.ts @@ -0,0 +1,25 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +export interface IMaybe { + isJust(): this is IJust; +} + +export interface IJust extends IMaybe { + get(): T; +} + +export function just(value: T): IJust { + return { + isJust: () => true, + get: () => value, + }; +} + +export function nothing(): IMaybe { + return { + isJust: () => false, + }; +} diff --git a/packages/backend/src/misc/prelude/relation.ts b/packages/backend/src/misc/prelude/relation.ts index 7dcd4c700a..3456c1a0bc 100644 --- a/packages/backend/src/misc/prelude/relation.ts +++ b/packages/backend/src/misc/prelude/relation.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/prelude/string.ts b/packages/backend/src/misc/prelude/string.ts new file mode 100644 index 0000000000..a727ab7f1d --- /dev/null +++ b/packages/backend/src/misc/prelude/string.ts @@ -0,0 +1,20 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +export function concat(xs: string[]): string { + return xs.join(''); +} + +export function capitalize(s: string): string { + return toUpperCase(s.charAt(0)) + toLowerCase(s.slice(1)); +} + +export function toUpperCase(s: string): string { + return s.toUpperCase(); +} + +export function toLowerCase(s: string): string { + return s.toLowerCase(); +} diff --git a/packages/backend/src/misc/prelude/symbol.ts b/packages/backend/src/misc/prelude/symbol.ts new file mode 100644 index 0000000000..91c058a845 --- /dev/null +++ b/packages/backend/src/misc/prelude/symbol.ts @@ -0,0 +1,6 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +export const fallback = Symbol('fallback'); diff --git a/packages/backend/src/misc/prelude/time.ts b/packages/backend/src/misc/prelude/time.ts index 275b67ed00..4479db1081 100644 --- a/packages/backend/src/misc/prelude/time.ts +++ b/packages/backend/src/misc/prelude/time.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/prelude/url.ts b/packages/backend/src/misc/prelude/url.ts index 270a075075..633eb98218 100644 --- a/packages/backend/src/misc/prelude/url.ts +++ b/packages/backend/src/misc/prelude/url.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/prelude/xml.ts b/packages/backend/src/misc/prelude/xml.ts index 61c166cee5..bca116a7ec 100644 --- a/packages/backend/src/misc/prelude/xml.ts +++ b/packages/backend/src/misc/prelude/xml.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/promise-tracker.ts b/packages/backend/src/misc/promise-tracker.ts deleted file mode 100644 index 8a52ca703e..0000000000 --- a/packages/backend/src/misc/promise-tracker.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -const promiseRefs: Set>> = new Set(); - -/** - * This tracks promises that other modules decided not to wait for, - * and makes sure they are all settled before fully closing down the server. - */ -export function trackPromise(promise: Promise) { - if (process.env.NODE_ENV !== 'test') { - return; - } - const ref = new WeakRef(promise); - promiseRefs.add(ref); - promise.finally(() => promiseRefs.delete(ref)); -} - -export async function allSettled(): Promise { - await Promise.allSettled([...promiseRefs].map(r => r.deref())); -} diff --git a/packages/backend/src/misc/reset-db.ts b/packages/backend/src/misc/reset-db.ts index 75fb4c3e7b..a571460a59 100644 --- a/packages/backend/src/misc/reset-db.ts +++ b/packages/backend/src/misc/reset-db.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/safe-for-sql.ts b/packages/backend/src/misc/safe-for-sql.ts index ac4b8e2e2e..d7bdd0a81c 100644 --- a/packages/backend/src/misc/safe-for-sql.ts +++ b/packages/backend/src/misc/safe-for-sql.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/secure-rndstr.ts b/packages/backend/src/misc/secure-rndstr.ts index 7853100d89..01368d808a 100644 --- a/packages/backend/src/misc/secure-rndstr.ts +++ b/packages/backend/src/misc/secure-rndstr.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/show-machine-info.ts b/packages/backend/src/misc/show-machine-info.ts index 8ddec35f23..ed0fa651f1 100644 --- a/packages/backend/src/misc/show-machine-info.ts +++ b/packages/backend/src/misc/show-machine-info.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/misc/sql-like-escape.ts b/packages/backend/src/misc/sql-like-escape.ts index 6b4f51b00e..85cc7405e1 100644 --- a/packages/backend/src/misc/sql-like-escape.ts +++ b/packages/backend/src/misc/sql-like-escape.ts @@ -1,8 +1,8 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ export function sqlLikeEscape(s: string) { - return s.replace(/([\\%_])/g, '\\$1'); + return s.replace(/([%_])/g, '\\$1'); } diff --git a/packages/backend/src/misc/status-error.ts b/packages/backend/src/misc/status-error.ts index c3533db607..4285685d24 100644 --- a/packages/backend/src/misc/status-error.ts +++ b/packages/backend/src/misc/status-error.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,7 +7,6 @@ export class StatusError extends Error { public statusCode: number; public statusMessage?: string; public isClientError: boolean; - public isRetryable: boolean; constructor(message: string, statusCode: number, statusMessage?: string) { super(message); @@ -15,6 +14,5 @@ export class StatusError extends Error { this.statusCode = statusCode; this.statusMessage = statusMessage; this.isClientError = typeof this.statusCode === 'number' && this.statusCode >= 400 && this.statusCode < 500; - this.isRetryable = !this.isClientError || this.statusCode === 429; } } diff --git a/packages/backend/src/misc/truncate.ts b/packages/backend/src/misc/truncate.ts index 1c8a274609..b65202fbd4 100644 --- a/packages/backend/src/misc/truncate.ts +++ b/packages/backend/src/misc/truncate.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/AbuseReportNotificationRecipient.ts b/packages/backend/src/models/AbuseReportNotificationRecipient.ts deleted file mode 100644 index fbff880afc..0000000000 --- a/packages/backend/src/models/AbuseReportNotificationRecipient.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryColumn } from 'typeorm'; -import { MiSystemWebhook } from '@/models/SystemWebhook.js'; -import { MiUserProfile } from '@/models/UserProfile.js'; -import { id } from './util/id.js'; -import { MiUser } from './User.js'; - -/** - * 通報受信時に通知を送信する方法. - */ -export type RecipientMethod = 'email' | 'webhook'; - -@Entity('abuse_report_notification_recipient') -export class MiAbuseReportNotificationRecipient { - @PrimaryColumn(id()) - public id: string; - - /** - * 有効かどうか. - */ - @Index() - @Column('boolean', { - default: true, - }) - public isActive: boolean; - - /** - * 更新日時. - */ - @Column('timestamp with time zone', { - default: () => 'CURRENT_TIMESTAMP', - }) - public updatedAt: Date; - - /** - * 通知設定名. - */ - @Column('varchar', { - length: 255, - }) - public name: string; - - /** - * 通知方法. - */ - @Index() - @Column('varchar', { - length: 64, - }) - public method: RecipientMethod; - - /** - * 通知先のユーザID. - */ - @Index() - @Column({ - ...id(), - nullable: true, - }) - public userId: MiUser['id'] | null; - - /** - * 通知先のユーザ. - */ - @ManyToOne(type => MiUser, { - onDelete: 'CASCADE', - }) - @JoinColumn({ name: 'userId', referencedColumnName: 'id', foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_userId1' }) - public user: MiUser | null; - - /** - * 通知先のユーザプロフィール. - */ - @ManyToOne(type => MiUserProfile, {}) - @JoinColumn({ name: 'userId', referencedColumnName: 'userId', foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_userId2' }) - public userProfile: MiUserProfile | null; - - /** - * 通知先のシステムWebhookId. - */ - @Index() - @Column({ - ...id(), - nullable: true, - }) - public systemWebhookId: string | null; - - /** - * 通知先のシステムWebhook. - */ - @ManyToOne(type => MiSystemWebhook, { - onDelete: 'CASCADE', - }) - @JoinColumn() - public systemWebhook: MiSystemWebhook | null; -} diff --git a/packages/backend/src/models/AbuseUserReport.ts b/packages/backend/src/models/AbuseUserReport.ts index cb5672e4ac..593c44f66b 100644 --- a/packages/backend/src/models/AbuseUserReport.ts +++ b/packages/backend/src/models/AbuseUserReport.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -50,9 +50,6 @@ export class MiAbuseUserReport { }) public resolved: boolean; - /** - * リモートサーバーに転送したかどうか - */ @Column('boolean', { default: false, }) @@ -63,21 +60,6 @@ export class MiAbuseUserReport { }) public comment: string; - @Column('varchar', { - length: 8192, default: '', - }) - public moderationNote: string; - - /** - * accept 是認 ... 通報内容が正当であり、肯定的に対応された - * reject 否認 ... 通報内容が正当でなく、否定的に対応された - * null ... その他 - */ - @Column('varchar', { - length: 128, nullable: true, - }) - public resolvedAs: 'accept' | 'reject' | null; - //#region Denormalized fields @Index() @Column('varchar', { diff --git a/packages/backend/src/models/AccessToken.ts b/packages/backend/src/models/AccessToken.ts index 6f98c14ec1..452711eb8c 100644 --- a/packages/backend/src/models/AccessToken.ts +++ b/packages/backend/src/models/AccessToken.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Ad.ts b/packages/backend/src/models/Ad.ts index 108e991c70..b1d7d7d79e 100644 --- a/packages/backend/src/models/Ad.ts +++ b/packages/backend/src/models/Ad.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Announcement.ts b/packages/backend/src/models/Announcement.ts index d0c59fff50..8f8be88fed 100644 --- a/packages/backend/src/models/Announcement.ts +++ b/packages/backend/src/models/Announcement.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -38,7 +38,7 @@ export class MiAnnouncement { length: 256, nullable: false, default: 'info', }) - public icon: 'info' | 'warning' | 'error' | 'success'; + public icon: string; // normal ... お知らせページ掲載 // banner ... お知らせページ掲載 + バナー表示 @@ -47,7 +47,7 @@ export class MiAnnouncement { length: 256, nullable: false, default: 'normal', }) - public display: 'normal' | 'banner' | 'dialog'; + public display: string; @Column('boolean', { default: false, diff --git a/packages/backend/src/models/AnnouncementRead.ts b/packages/backend/src/models/AnnouncementRead.ts index 47de8dd180..db09e65f50 100644 --- a/packages/backend/src/models/AnnouncementRead.ts +++ b/packages/backend/src/models/AnnouncementRead.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Antenna.ts b/packages/backend/src/models/Antenna.ts index 33e6f48189..b74c61b728 100644 --- a/packages/backend/src/models/Antenna.ts +++ b/packages/backend/src/models/Antenna.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -72,11 +72,6 @@ export class MiAntenna { }) public caseSensitive: boolean; - @Column('boolean', { - default: false, - }) - public excludeBots: boolean; - @Column('boolean', { default: false, }) @@ -90,6 +85,9 @@ export class MiAntenna { }) public expression: string | null; + @Column('boolean') + public notify: boolean; + @Index() @Column('boolean', { default: true, diff --git a/packages/backend/src/models/App.ts b/packages/backend/src/models/App.ts index 0185e2995c..5c56a224a2 100644 --- a/packages/backend/src/models/App.ts +++ b/packages/backend/src/models/App.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/AuthSession.ts b/packages/backend/src/models/AuthSession.ts index 03050ba955..81bed21211 100644 --- a/packages/backend/src/models/AuthSession.ts +++ b/packages/backend/src/models/AuthSession.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/AvatarDecoration.ts b/packages/backend/src/models/AvatarDecoration.ts index 13f0b05667..08ebbdeac1 100644 --- a/packages/backend/src/models/AvatarDecoration.ts +++ b/packages/backend/src/models/AvatarDecoration.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Blocking.ts b/packages/backend/src/models/Blocking.ts index 34a6efe5a6..9bf7a63b6e 100644 --- a/packages/backend/src/models/Blocking.ts +++ b/packages/backend/src/models/Blocking.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/BubbleGameRecord.ts b/packages/backend/src/models/BubbleGameRecord.ts deleted file mode 100644 index 686e39c118..0000000000 --- a/packages/backend/src/models/BubbleGameRecord.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from './util/id.js'; -import { MiUser } from './User.js'; - -@Entity('bubble_game_record') -export class MiBubbleGameRecord { - @PrimaryColumn(id()) - public id: string; - - @Index() - @Column({ - ...id(), - }) - public userId: MiUser['id']; - - @ManyToOne(type => MiUser, { - onDelete: 'CASCADE', - }) - @JoinColumn() - public user: MiUser | null; - - @Index() - @Column('timestamp with time zone') - public seededAt: Date; - - @Column('varchar', { - length: 1024, - }) - public seed: string; - - @Column('integer') - public gameVersion: number; - - @Column('varchar', { - length: 128, - }) - public gameMode: string; - - @Index() - @Column('integer') - public score: number; - - @Column('jsonb', { - default: [], - }) - public logs: number[][]; - - @Column('boolean', { - default: false, - }) - public isVerified: boolean; -} diff --git a/packages/backend/src/models/Channel.ts b/packages/backend/src/models/Channel.ts index f5e9b17e3e..a7f9e262b1 100644 --- a/packages/backend/src/models/Channel.ts +++ b/packages/backend/src/models/Channel.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/ChannelFavorite.ts b/packages/backend/src/models/ChannelFavorite.ts index 167f41cf16..fc25ffe260 100644 --- a/packages/backend/src/models/ChannelFavorite.ts +++ b/packages/backend/src/models/ChannelFavorite.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/ChannelFollowing.ts b/packages/backend/src/models/ChannelFollowing.ts index c7afdd05b0..4dd391a082 100644 --- a/packages/backend/src/models/ChannelFollowing.ts +++ b/packages/backend/src/models/ChannelFollowing.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Clip.ts b/packages/backend/src/models/Clip.ts index 6295a329fb..2483b0925a 100644 --- a/packages/backend/src/models/Clip.ts +++ b/packages/backend/src/models/Clip.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/ClipFavorite.ts b/packages/backend/src/models/ClipFavorite.ts index 40bdb9f4aa..aa949b3ea8 100644 --- a/packages/backend/src/models/ClipFavorite.ts +++ b/packages/backend/src/models/ClipFavorite.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/ClipNote.ts b/packages/backend/src/models/ClipNote.ts index 6e1d2bec4c..b7cc5ee39b 100644 --- a/packages/backend/src/models/ClipNote.ts +++ b/packages/backend/src/models/ClipNote.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/DriveFile.ts b/packages/backend/src/models/DriveFile.ts index 7b03e3e494..24e6be9c90 100644 --- a/packages/backend/src/models/DriveFile.ts +++ b/packages/backend/src/models/DriveFile.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -82,7 +82,7 @@ export class MiDriveFile { public storedInternal: boolean; @Column('varchar', { - length: 1024, + length: 512, comment: 'The URL of the DriveFile.', }) public url: string; @@ -124,13 +124,13 @@ export class MiDriveFile { @Index() @Column('varchar', { - length: 1024, nullable: true, + length: 512, nullable: true, comment: 'The URI of the DriveFile. it will be null when the DriveFile is local.', }) public uri: string | null; @Column('varchar', { - length: 1024, nullable: true, + length: 512, nullable: true, }) public src: string | null; diff --git a/packages/backend/src/models/DriveFolder.ts b/packages/backend/src/models/DriveFolder.ts index 07046d6e11..18f6d17709 100644 --- a/packages/backend/src/models/DriveFolder.ts +++ b/packages/backend/src/models/DriveFolder.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Emoji.ts b/packages/backend/src/models/Emoji.ts index d62b6e9f6f..563ac1d9d3 100644 --- a/packages/backend/src/models/Emoji.ts +++ b/packages/backend/src/models/Emoji.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Flash.ts b/packages/backend/src/models/Flash.ts index 5db7dca992..ac880843b0 100644 --- a/packages/backend/src/models/Flash.ts +++ b/packages/backend/src/models/Flash.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,9 +7,6 @@ import { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from 'typ import { id } from './util/id.js'; import { MiUser } from './User.js'; -export const flashVisibility = ['public', 'private'] as const; -export type FlashVisibility = typeof flashVisibility[number]; - @Entity('flash') export class MiFlash { @PrimaryColumn(id()) @@ -66,5 +63,5 @@ export class MiFlash { @Column('varchar', { length: 512, default: 'public', }) - public visibility: FlashVisibility; + public visibility: 'public' | 'private'; } diff --git a/packages/backend/src/models/FlashLike.ts b/packages/backend/src/models/FlashLike.ts index a9fb48123e..ad7f4966b4 100644 --- a/packages/backend/src/models/FlashLike.ts +++ b/packages/backend/src/models/FlashLike.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/FollowRequest.ts b/packages/backend/src/models/FollowRequest.ts index 3ff5e7a478..9899694dd6 100644 --- a/packages/backend/src/models/FollowRequest.ts +++ b/packages/backend/src/models/FollowRequest.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Following.ts b/packages/backend/src/models/Following.ts index 62cbc29f26..e320911a1d 100644 --- a/packages/backend/src/models/Following.ts +++ b/packages/backend/src/models/Following.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/GalleryLike.ts b/packages/backend/src/models/GalleryLike.ts index ed0963122d..84d4ce9c3e 100644 --- a/packages/backend/src/models/GalleryLike.ts +++ b/packages/backend/src/models/GalleryLike.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/GalleryPost.ts b/packages/backend/src/models/GalleryPost.ts index 04d8823e37..b72220caf9 100644 --- a/packages/backend/src/models/GalleryPost.ts +++ b/packages/backend/src/models/GalleryPost.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Hashtag.ts b/packages/backend/src/models/Hashtag.ts index 3add06d0c3..1493774752 100644 --- a/packages/backend/src/models/Hashtag.ts +++ b/packages/backend/src/models/Hashtag.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Instance.ts b/packages/backend/src/models/Instance.ts index 17cd5c6665..b225d918d6 100644 --- a/packages/backend/src/models/Instance.ts +++ b/packages/backend/src/models/Instance.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -81,22 +81,13 @@ export class MiInstance { public isNotResponding: boolean; /** - * このインスタンスと不通になった日時 - */ - @Column('timestamp with time zone', { - nullable: true, - }) - public notRespondingSince: Date | null; - - /** - * このインスタンスへの配信状態 + * このインスタンスへの配信を停止するか */ @Index() - @Column('enum', { - default: 'none', - enum: ['none', 'manuallySuspended', 'goneSuspended', 'autoSuspendedForNotResponding'], + @Column('boolean', { + default: false, }) - public suspensionState: 'none' | 'manuallySuspended' | 'goneSuspended' | 'autoSuspendedForNotResponding'; + public isSuspended: boolean; @Column('varchar', { length: 64, nullable: true, @@ -153,9 +144,4 @@ export class MiInstance { nullable: true, }) public infoUpdatedAt: Date | null; - - @Column('varchar', { - length: 16384, default: '', - }) - public moderationNote: string; } diff --git a/packages/backend/src/models/Meta.ts b/packages/backend/src/models/Meta.ts index ad5e31ad6f..f5a75ed28a 100644 --- a/packages/backend/src/models/Meta.ts +++ b/packages/backend/src/models/Meta.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -76,26 +76,11 @@ export class MiMeta { }) public sensitiveWords: string[]; - @Column('varchar', { - length: 1024, array: true, default: '{}', - }) - public prohibitedWords: string[]; - - @Column('varchar', { - length: 1024, array: true, default: '{}', - }) - public prohibitedWordsForNameOfUser: string[]; - @Column('varchar', { length: 1024, array: true, default: '{}', }) public silencedHosts: string[]; - @Column('varchar', { - length: 1024, array: true, default: '{}', - }) - public mediaSilencedHosts: string[]; - @Column('varchar', { length: 1024, nullable: true, @@ -206,29 +191,6 @@ export class MiMeta { }) public hcaptchaSecretKey: string | null; - @Column('boolean', { - default: false, - }) - public enableMcaptcha: boolean; - - @Column('varchar', { - length: 1024, - nullable: true, - }) - public mcaptchaSitekey: string | null; - - @Column('varchar', { - length: 1024, - nullable: true, - }) - public mcaptchaSecretKey: string | null; - - @Column('varchar', { - length: 1024, - nullable: true, - }) - public mcaptchaInstanceUrl: string | null; - @Column('boolean', { default: false, }) @@ -263,13 +225,6 @@ export class MiMeta { }) public turnstileSecretKey: string | null; - @Column('boolean', { - default: false, - }) - public enableTestcaptcha: boolean; - - // chaptcha系を追加した際にはnodeinfoのレスポンスに追加するのを忘れないようにすること - @Column('enum', { enum: ['none', 'all', 'local', 'remote'], default: 'none', @@ -292,6 +247,12 @@ export class MiMeta { }) public enableSensitiveMediaDetectionForVideos: boolean; + @Column('varchar', { + length: 1024, + nullable: true, + }) + public summalyProxy: string | null; + @Column('boolean', { default: false, }) @@ -368,9 +329,9 @@ export class MiMeta { @Column('varchar', { length: 1024, default: 'https://github.com/misskey-dev/misskey', - nullable: true, + nullable: false, }) - public repositoryUrl: string | null; + public repositoryUrl: string; @Column('varchar', { length: 1024, @@ -391,12 +352,6 @@ export class MiMeta { }) public privacyPolicyUrl: string | null; - @Column('varchar', { - length: 1024, - nullable: true, - }) - public inquiryUrl: string | null; - @Column('varchar', { length: 8192, nullable: true, @@ -512,7 +467,7 @@ export class MiMeta { nullable: true, }) public truemailInstance: string | null; - + @Column('varchar', { length: 1024, nullable: true, @@ -529,11 +484,6 @@ export class MiMeta { }) public enableChartsForFederatedInstances: boolean; - @Column('boolean', { - default: true, - }) - public enableStatsForFederatedInstances: boolean; - @Column('boolean', { default: false, }) @@ -604,58 +554,8 @@ export class MiMeta { }) public perUserListTimelineCacheMax: number; - @Column('boolean', { - default: false, - }) - public enableReactionsBuffering: boolean; - @Column('integer', { default: 0, }) public notesPerOneAd: number; - - @Column('boolean', { - default: true, - }) - public urlPreviewEnabled: boolean; - - @Column('integer', { - default: 10000, - }) - public urlPreviewTimeout: number; - - @Column('bigint', { - default: 1024 * 1024 * 10, - }) - public urlPreviewMaximumContentLength: number; - - @Column('boolean', { - default: true, - }) - public urlPreviewRequireContentLength: boolean; - - @Column('varchar', { - length: 1024, - nullable: true, - }) - public urlPreviewSummaryProxyUrl: string | null; - - @Column('varchar', { - length: 1024, - nullable: true, - }) - public urlPreviewUserAgent: string | null; - - @Column('varchar', { - length: 128, - default: 'all', - }) - public federation: 'all' | 'specified' | 'none'; - - @Column('varchar', { - length: 1024, - array: true, - default: '{}', - }) - public federationHosts: string[]; } diff --git a/packages/backend/src/models/ModerationLog.ts b/packages/backend/src/models/ModerationLog.ts index edde315fdf..71b33c3e47 100644 --- a/packages/backend/src/models/ModerationLog.ts +++ b/packages/backend/src/models/ModerationLog.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Muting.ts b/packages/backend/src/models/Muting.ts index e1240b9c4e..a528e1e7d7 100644 --- a/packages/backend/src/models/Muting.ts +++ b/packages/backend/src/models/Muting.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Note.ts b/packages/backend/src/models/Note.ts index 9a95c6faab..a4358b9ba6 100644 --- a/packages/backend/src/models/Note.ts +++ b/packages/backend/src/models/Note.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -11,6 +11,9 @@ import { MiChannel } from './Channel.js'; import type { MiDriveFile } from './DriveFile.js'; @Entity('note') +@Index('IDX_NOTE_TAGS', { synchronize: false }) +@Index('IDX_NOTE_MENTIONS', { synchronize: false }) +@Index('IDX_NOTE_VISIBLE_USER_IDS', { synchronize: false }) export class MiNote { @PrimaryColumn(id()) public id: string; @@ -130,7 +133,7 @@ export class MiNote { }) public url: string | null; - @Index('IDX_NOTE_FILE_IDS', { synchronize: false }) + @Index() @Column({ ...id(), array: true, default: '{}', @@ -142,14 +145,14 @@ export class MiNote { }) public attachedFileTypes: string[]; - @Index('IDX_NOTE_VISIBLE_USER_IDS', { synchronize: false }) + @Index() @Column({ ...id(), array: true, default: '{}', }) public visibleUserIds: MiUser['id'][]; - @Index('IDX_NOTE_MENTIONS', { synchronize: false }) + @Index() @Column({ ...id(), array: true, default: '{}', @@ -171,7 +174,7 @@ export class MiNote { }) public emojis: string[]; - @Index('IDX_NOTE_TAGS', { synchronize: false }) + @Index() @Column('varchar', { length: 128, array: true, default: '{}', }) diff --git a/packages/backend/src/models/NoteFavorite.ts b/packages/backend/src/models/NoteFavorite.ts index cf76c767b0..364eaabd98 100644 --- a/packages/backend/src/models/NoteFavorite.ts +++ b/packages/backend/src/models/NoteFavorite.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/NoteReaction.ts b/packages/backend/src/models/NoteReaction.ts index 42dfcaa9ad..ee3a447464 100644 --- a/packages/backend/src/models/NoteReaction.ts +++ b/packages/backend/src/models/NoteReaction.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/NoteThreadMuting.ts b/packages/backend/src/models/NoteThreadMuting.ts index e7bd39f348..00311aa570 100644 --- a/packages/backend/src/models/NoteThreadMuting.ts +++ b/packages/backend/src/models/NoteThreadMuting.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/NoteUnread.ts b/packages/backend/src/models/NoteUnread.ts index c759181117..d86a474553 100644 --- a/packages/backend/src/models/NoteUnread.ts +++ b/packages/backend/src/models/NoteUnread.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Notification.ts b/packages/backend/src/models/Notification.ts index b7f8e94d69..3bc2edaa0d 100644 --- a/packages/backend/src/models/Notification.ts +++ b/packages/backend/src/models/Notification.ts @@ -1,14 +1,12 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { userExportableEntities } from '@/types.js'; import { MiUser } from './User.js'; import { MiNote } from './Note.js'; import { MiAccessToken } from './AccessToken.js'; import { MiRole } from './Role.js'; -import { MiDriveFile } from './DriveFile.js'; export type MiNotification = { type: 'note'; @@ -69,7 +67,6 @@ export type MiNotification = { id: string; createdAt: string; notifierId: MiUser['id']; - message: string | null; } | { type: 'roleAssigned'; id: string; @@ -80,16 +77,6 @@ export type MiNotification = { id: string; createdAt: string; achievement: string; -} | { - type: 'exportCompleted'; - id: string; - createdAt: string; - exportedEntity: typeof userExportableEntities[number]; - fileId: MiDriveFile['id']; -} | { - type: 'login'; - id: string; - createdAt: string; } | { type: 'app'; id: string; @@ -98,7 +85,7 @@ export type MiNotification = { /** * アプリ通知のbody */ - customBody: string; + customBody: string | null; /** * アプリ通知のheader diff --git a/packages/backend/src/models/Page.ts b/packages/backend/src/models/Page.ts index 1695bf570e..9cab875499 100644 --- a/packages/backend/src/models/Page.ts +++ b/packages/backend/src/models/Page.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/PageLike.ts b/packages/backend/src/models/PageLike.ts index 05ca22cf2c..b845f58b7d 100644 --- a/packages/backend/src/models/PageLike.ts +++ b/packages/backend/src/models/PageLike.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/PasswordResetRequest.ts b/packages/backend/src/models/PasswordResetRequest.ts index fdaf21056b..5be439511f 100644 --- a/packages/backend/src/models/PasswordResetRequest.ts +++ b/packages/backend/src/models/PasswordResetRequest.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Poll.ts b/packages/backend/src/models/Poll.ts index ca985c8b24..5ce0b9a2fc 100644 --- a/packages/backend/src/models/Poll.ts +++ b/packages/backend/src/models/Poll.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,7 +8,6 @@ import { noteVisibilities } from '@/types.js'; import { id } from './util/id.js'; import { MiNote } from './Note.js'; import type { MiUser } from './User.js'; -import type { MiChannel } from "@/models/Channel.js"; @Entity('poll') export class MiPoll { @@ -59,14 +58,6 @@ export class MiPoll { comment: '[Denormalized]', }) public userHost: string | null; - - @Index() - @Column({ - ...id(), - nullable: true, - comment: '[Denormalized]', - }) - public channelId: MiChannel['id'] | null; //#endregion constructor(data: Partial) { diff --git a/packages/backend/src/models/PollVote.ts b/packages/backend/src/models/PollVote.ts index b5c780293c..751be8a32b 100644 --- a/packages/backend/src/models/PollVote.ts +++ b/packages/backend/src/models/PollVote.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/PromoNote.ts b/packages/backend/src/models/PromoNote.ts index ae27adec9e..f4425fe88b 100644 --- a/packages/backend/src/models/PromoNote.ts +++ b/packages/backend/src/models/PromoNote.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/PromoRead.ts b/packages/backend/src/models/PromoRead.ts index b2a698cc7b..d9f3075416 100644 --- a/packages/backend/src/models/PromoRead.ts +++ b/packages/backend/src/models/PromoRead.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/RegistrationTicket.ts b/packages/backend/src/models/RegistrationTicket.ts index 0a4e4b9189..730cedffba 100644 --- a/packages/backend/src/models/RegistrationTicket.ts +++ b/packages/backend/src/models/RegistrationTicket.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/RegistryItem.ts b/packages/backend/src/models/RegistryItem.ts index 335e8b9eab..60bdced957 100644 --- a/packages/backend/src/models/RegistryItem.ts +++ b/packages/backend/src/models/RegistryItem.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Relay.ts b/packages/backend/src/models/Relay.ts index eca2916032..293fccecfc 100644 --- a/packages/backend/src/models/Relay.ts +++ b/packages/backend/src/models/Relay.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/RenoteMuting.ts b/packages/backend/src/models/RenoteMuting.ts index 448a0b7663..17df43ea31 100644 --- a/packages/backend/src/models/RenoteMuting.ts +++ b/packages/backend/src/models/RenoteMuting.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/RepositoryModule.ts b/packages/backend/src/models/RepositoryModule.ts index ea0f88baba..866fdfe6d4 100644 --- a/packages/backend/src/models/RepositoryModule.ts +++ b/packages/backend/src/models/RepositoryModule.ts @@ -1,502 +1,407 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import type { Provider } from '@nestjs/common'; import { Module } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import { - MiAbuseReportNotificationRecipient, - MiAbuseUserReport, - MiAccessToken, - MiAd, - MiAnnouncement, - MiAnnouncementRead, - MiAntenna, - MiApp, - MiAuthSession, - MiAvatarDecoration, - MiBlocking, - MiBubbleGameRecord, - MiChannel, - MiChannelFavorite, - MiChannelFollowing, - MiClip, - MiClipFavorite, - MiClipNote, - MiDriveFile, - MiDriveFolder, - MiEmoji, - MiFlash, - MiFlashLike, - MiFollowing, - MiFollowRequest, - MiGalleryLike, - MiGalleryPost, - MiHashtag, - MiInstance, - MiMeta, - MiModerationLog, - MiMuting, - MiNote, - MiNoteFavorite, - MiNoteReaction, - MiNoteThreadMuting, - MiNoteUnread, - MiPage, - MiPageLike, - MiPasswordResetRequest, - MiPoll, - MiPollVote, - MiPromoNote, - MiPromoRead, - MiRegistrationTicket, - MiRegistryItem, - MiRelay, - MiRenoteMuting, - MiRepository, - miRepository, - MiRetentionAggregation, - MiReversiGame, - MiRole, - MiRoleAssignment, - MiSignin, - MiSwSubscription, - MiSystemWebhook, - MiUsedUsername, - MiUser, - MiUserIp, - MiUserKeypair, - MiUserList, - MiUserListFavorite, - MiUserListMembership, - MiUserMemo, - MiUserNotePining, - MiUserPending, - MiUserProfile, - MiUserPublickey, - MiUserSecurityKey, - MiWebhook -} from './_.js'; +import { MiAbuseUserReport, MiAccessToken, MiAd, MiAnnouncement, MiAnnouncementRead, MiAntenna, MiApp, MiAuthSession, MiAvatarDecoration, MiBlocking, MiChannel, MiChannelFavorite, MiChannelFollowing, MiClip, MiClipFavorite, MiClipNote, MiDriveFile, MiDriveFolder, MiEmoji, MiFlash, MiFlashLike, MiFollowRequest, MiFollowing, MiGalleryLike, MiGalleryPost, MiHashtag, MiInstance, MiMeta, MiModerationLog, 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, MiUserListMembership, MiUserMemo, MiUserNotePining, MiUserPending, MiUserProfile, MiUserPublickey, MiUserSecurityKey, MiWebhook } from './_.js'; import type { DataSource } from 'typeorm'; +import type { Provider } from '@nestjs/common'; const $usersRepository: Provider = { provide: DI.usersRepository, - useFactory: (db: DataSource) => db.getRepository(MiUser).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiUser), inject: [DI.db], }; const $notesRepository: Provider = { provide: DI.notesRepository, - useFactory: (db: DataSource) => db.getRepository(MiNote).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiNote), inject: [DI.db], }; const $announcementsRepository: Provider = { provide: DI.announcementsRepository, - useFactory: (db: DataSource) => db.getRepository(MiAnnouncement).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiAnnouncement), inject: [DI.db], }; const $announcementReadsRepository: Provider = { provide: DI.announcementReadsRepository, - useFactory: (db: DataSource) => db.getRepository(MiAnnouncementRead).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiAnnouncementRead), inject: [DI.db], }; const $appsRepository: Provider = { provide: DI.appsRepository, - useFactory: (db: DataSource) => db.getRepository(MiApp).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiApp), inject: [DI.db], }; const $avatarDecorationsRepository: Provider = { provide: DI.avatarDecorationsRepository, - useFactory: (db: DataSource) => db.getRepository(MiAvatarDecoration).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiAvatarDecoration), inject: [DI.db], }; const $noteFavoritesRepository: Provider = { provide: DI.noteFavoritesRepository, - useFactory: (db: DataSource) => db.getRepository(MiNoteFavorite).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiNoteFavorite), inject: [DI.db], }; const $noteThreadMutingsRepository: Provider = { provide: DI.noteThreadMutingsRepository, - useFactory: (db: DataSource) => db.getRepository(MiNoteThreadMuting).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiNoteThreadMuting), inject: [DI.db], }; const $noteReactionsRepository: Provider = { provide: DI.noteReactionsRepository, - useFactory: (db: DataSource) => db.getRepository(MiNoteReaction).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiNoteReaction), inject: [DI.db], }; const $noteUnreadsRepository: Provider = { provide: DI.noteUnreadsRepository, - useFactory: (db: DataSource) => db.getRepository(MiNoteUnread).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiNoteUnread), inject: [DI.db], }; const $pollsRepository: Provider = { provide: DI.pollsRepository, - useFactory: (db: DataSource) => db.getRepository(MiPoll).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiPoll), inject: [DI.db], }; const $pollVotesRepository: Provider = { provide: DI.pollVotesRepository, - useFactory: (db: DataSource) => db.getRepository(MiPollVote).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiPollVote), inject: [DI.db], }; const $userProfilesRepository: Provider = { provide: DI.userProfilesRepository, - useFactory: (db: DataSource) => db.getRepository(MiUserProfile).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiUserProfile), inject: [DI.db], }; const $userKeypairsRepository: Provider = { provide: DI.userKeypairsRepository, - useFactory: (db: DataSource) => db.getRepository(MiUserKeypair).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiUserKeypair), inject: [DI.db], }; const $userPendingsRepository: Provider = { provide: DI.userPendingsRepository, - useFactory: (db: DataSource) => db.getRepository(MiUserPending).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiUserPending), inject: [DI.db], }; const $userSecurityKeysRepository: Provider = { provide: DI.userSecurityKeysRepository, - useFactory: (db: DataSource) => db.getRepository(MiUserSecurityKey).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiUserSecurityKey), inject: [DI.db], }; const $userPublickeysRepository: Provider = { provide: DI.userPublickeysRepository, - useFactory: (db: DataSource) => db.getRepository(MiUserPublickey).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiUserPublickey), inject: [DI.db], }; const $userListsRepository: Provider = { provide: DI.userListsRepository, - useFactory: (db: DataSource) => db.getRepository(MiUserList).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiUserList), inject: [DI.db], }; const $userListFavoritesRepository: Provider = { provide: DI.userListFavoritesRepository, - useFactory: (db: DataSource) => db.getRepository(MiUserListFavorite).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiUserListFavorite), inject: [DI.db], }; const $userListMembershipsRepository: Provider = { provide: DI.userListMembershipsRepository, - useFactory: (db: DataSource) => db.getRepository(MiUserListMembership).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiUserListMembership), inject: [DI.db], }; const $userNotePiningsRepository: Provider = { provide: DI.userNotePiningsRepository, - useFactory: (db: DataSource) => db.getRepository(MiUserNotePining).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiUserNotePining), inject: [DI.db], }; const $userIpsRepository: Provider = { provide: DI.userIpsRepository, - useFactory: (db: DataSource) => db.getRepository(MiUserIp).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiUserIp), inject: [DI.db], }; const $usedUsernamesRepository: Provider = { provide: DI.usedUsernamesRepository, - useFactory: (db: DataSource) => db.getRepository(MiUsedUsername).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiUsedUsername), inject: [DI.db], }; const $followingsRepository: Provider = { provide: DI.followingsRepository, - useFactory: (db: DataSource) => db.getRepository(MiFollowing).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiFollowing), inject: [DI.db], }; const $followRequestsRepository: Provider = { provide: DI.followRequestsRepository, - useFactory: (db: DataSource) => db.getRepository(MiFollowRequest).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiFollowRequest), inject: [DI.db], }; const $instancesRepository: Provider = { provide: DI.instancesRepository, - useFactory: (db: DataSource) => db.getRepository(MiInstance).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiInstance), inject: [DI.db], }; const $emojisRepository: Provider = { provide: DI.emojisRepository, - useFactory: (db: DataSource) => db.getRepository(MiEmoji).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiEmoji), inject: [DI.db], }; const $driveFilesRepository: Provider = { provide: DI.driveFilesRepository, - useFactory: (db: DataSource) => db.getRepository(MiDriveFile).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiDriveFile), inject: [DI.db], }; const $driveFoldersRepository: Provider = { provide: DI.driveFoldersRepository, - useFactory: (db: DataSource) => db.getRepository(MiDriveFolder).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiDriveFolder), inject: [DI.db], }; const $metasRepository: Provider = { provide: DI.metasRepository, - useFactory: (db: DataSource) => db.getRepository(MiMeta).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiMeta), inject: [DI.db], }; const $mutingsRepository: Provider = { provide: DI.mutingsRepository, - useFactory: (db: DataSource) => db.getRepository(MiMuting).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiMuting), inject: [DI.db], }; const $renoteMutingsRepository: Provider = { provide: DI.renoteMutingsRepository, - useFactory: (db: DataSource) => db.getRepository(MiRenoteMuting).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiRenoteMuting), inject: [DI.db], }; const $blockingsRepository: Provider = { provide: DI.blockingsRepository, - useFactory: (db: DataSource) => db.getRepository(MiBlocking).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiBlocking), inject: [DI.db], }; const $swSubscriptionsRepository: Provider = { provide: DI.swSubscriptionsRepository, - useFactory: (db: DataSource) => db.getRepository(MiSwSubscription).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiSwSubscription), inject: [DI.db], }; const $hashtagsRepository: Provider = { provide: DI.hashtagsRepository, - useFactory: (db: DataSource) => db.getRepository(MiHashtag).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiHashtag), inject: [DI.db], }; const $abuseUserReportsRepository: Provider = { provide: DI.abuseUserReportsRepository, - useFactory: (db: DataSource) => db.getRepository(MiAbuseUserReport).extend(miRepository as MiRepository), - inject: [DI.db], -}; - -const $abuseReportNotificationRecipientRepository: Provider = { - provide: DI.abuseReportNotificationRecipientRepository, - useFactory: (db: DataSource) => db.getRepository(MiAbuseReportNotificationRecipient), + useFactory: (db: DataSource) => db.getRepository(MiAbuseUserReport), inject: [DI.db], }; const $registrationTicketsRepository: Provider = { provide: DI.registrationTicketsRepository, - useFactory: (db: DataSource) => db.getRepository(MiRegistrationTicket).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiRegistrationTicket), inject: [DI.db], }; const $authSessionsRepository: Provider = { provide: DI.authSessionsRepository, - useFactory: (db: DataSource) => db.getRepository(MiAuthSession).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiAuthSession), inject: [DI.db], }; const $accessTokensRepository: Provider = { provide: DI.accessTokensRepository, - useFactory: (db: DataSource) => db.getRepository(MiAccessToken).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiAccessToken), inject: [DI.db], }; const $signinsRepository: Provider = { provide: DI.signinsRepository, - useFactory: (db: DataSource) => db.getRepository(MiSignin).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiSignin), inject: [DI.db], }; const $pagesRepository: Provider = { provide: DI.pagesRepository, - useFactory: (db: DataSource) => db.getRepository(MiPage).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiPage), inject: [DI.db], }; const $pageLikesRepository: Provider = { provide: DI.pageLikesRepository, - useFactory: (db: DataSource) => db.getRepository(MiPageLike).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiPageLike), inject: [DI.db], }; const $galleryPostsRepository: Provider = { provide: DI.galleryPostsRepository, - useFactory: (db: DataSource) => db.getRepository(MiGalleryPost).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiGalleryPost), inject: [DI.db], }; const $galleryLikesRepository: Provider = { provide: DI.galleryLikesRepository, - useFactory: (db: DataSource) => db.getRepository(MiGalleryLike).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiGalleryLike), inject: [DI.db], }; const $moderationLogsRepository: Provider = { provide: DI.moderationLogsRepository, - useFactory: (db: DataSource) => db.getRepository(MiModerationLog).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiModerationLog), inject: [DI.db], }; const $clipsRepository: Provider = { provide: DI.clipsRepository, - useFactory: (db: DataSource) => db.getRepository(MiClip).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiClip), inject: [DI.db], }; const $clipNotesRepository: Provider = { provide: DI.clipNotesRepository, - useFactory: (db: DataSource) => db.getRepository(MiClipNote).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiClipNote), inject: [DI.db], }; const $clipFavoritesRepository: Provider = { provide: DI.clipFavoritesRepository, - useFactory: (db: DataSource) => db.getRepository(MiClipFavorite).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiClipFavorite), inject: [DI.db], }; const $antennasRepository: Provider = { provide: DI.antennasRepository, - useFactory: (db: DataSource) => db.getRepository(MiAntenna).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiAntenna), inject: [DI.db], }; const $promoNotesRepository: Provider = { provide: DI.promoNotesRepository, - useFactory: (db: DataSource) => db.getRepository(MiPromoNote).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiPromoNote), inject: [DI.db], }; const $promoReadsRepository: Provider = { provide: DI.promoReadsRepository, - useFactory: (db: DataSource) => db.getRepository(MiPromoRead).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiPromoRead), inject: [DI.db], }; const $relaysRepository: Provider = { provide: DI.relaysRepository, - useFactory: (db: DataSource) => db.getRepository(MiRelay).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiRelay), inject: [DI.db], }; const $channelsRepository: Provider = { provide: DI.channelsRepository, - useFactory: (db: DataSource) => db.getRepository(MiChannel).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiChannel), inject: [DI.db], }; const $channelFollowingsRepository: Provider = { provide: DI.channelFollowingsRepository, - useFactory: (db: DataSource) => db.getRepository(MiChannelFollowing).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiChannelFollowing), inject: [DI.db], }; const $channelFavoritesRepository: Provider = { provide: DI.channelFavoritesRepository, - useFactory: (db: DataSource) => db.getRepository(MiChannelFavorite).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiChannelFavorite), inject: [DI.db], }; const $registryItemsRepository: Provider = { provide: DI.registryItemsRepository, - useFactory: (db: DataSource) => db.getRepository(MiRegistryItem).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiRegistryItem), inject: [DI.db], }; const $webhooksRepository: Provider = { provide: DI.webhooksRepository, - useFactory: (db: DataSource) => db.getRepository(MiWebhook).extend(miRepository as MiRepository), - inject: [DI.db], -}; - -const $systemWebhooksRepository: Provider = { - provide: DI.systemWebhooksRepository, - useFactory: (db: DataSource) => db.getRepository(MiSystemWebhook), + useFactory: (db: DataSource) => db.getRepository(MiWebhook), inject: [DI.db], }; const $adsRepository: Provider = { provide: DI.adsRepository, - useFactory: (db: DataSource) => db.getRepository(MiAd).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiAd), inject: [DI.db], }; const $passwordResetRequestsRepository: Provider = { provide: DI.passwordResetRequestsRepository, - useFactory: (db: DataSource) => db.getRepository(MiPasswordResetRequest).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiPasswordResetRequest), inject: [DI.db], }; const $retentionAggregationsRepository: Provider = { provide: DI.retentionAggregationsRepository, - useFactory: (db: DataSource) => db.getRepository(MiRetentionAggregation).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiRetentionAggregation), inject: [DI.db], }; const $flashsRepository: Provider = { provide: DI.flashsRepository, - useFactory: (db: DataSource) => db.getRepository(MiFlash).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiFlash), inject: [DI.db], }; const $flashLikesRepository: Provider = { provide: DI.flashLikesRepository, - useFactory: (db: DataSource) => db.getRepository(MiFlashLike).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiFlashLike), inject: [DI.db], }; const $rolesRepository: Provider = { provide: DI.rolesRepository, - useFactory: (db: DataSource) => db.getRepository(MiRole).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiRole), inject: [DI.db], }; const $roleAssignmentsRepository: Provider = { provide: DI.roleAssignmentsRepository, - useFactory: (db: DataSource) => db.getRepository(MiRoleAssignment).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiRoleAssignment), inject: [DI.db], }; const $userMemosRepository: Provider = { provide: DI.userMemosRepository, - useFactory: (db: DataSource) => db.getRepository(MiUserMemo).extend(miRepository as MiRepository), - inject: [DI.db], -}; - -const $bubbleGameRecordsRepository: Provider = { - provide: DI.bubbleGameRecordsRepository, - useFactory: (db: DataSource) => db.getRepository(MiBubbleGameRecord).extend(miRepository as MiRepository), - inject: [DI.db], -}; - -const $reversiGamesRepository: Provider = { - provide: DI.reversiGamesRepository, - useFactory: (db: DataSource) => db.getRepository(MiReversiGame).extend(miRepository as MiRepository), + useFactory: (db: DataSource) => db.getRepository(MiUserMemo), inject: [DI.db], }; @Module({ - imports: [], + imports: [ + ], providers: [ $usersRepository, $notesRepository, @@ -534,7 +439,6 @@ const $reversiGamesRepository: Provider = { $swSubscriptionsRepository, $hashtagsRepository, $abuseUserReportsRepository, - $abuseReportNotificationRecipientRepository, $registrationTicketsRepository, $authSessionsRepository, $accessTokensRepository, @@ -556,7 +460,6 @@ const $reversiGamesRepository: Provider = { $channelFavoritesRepository, $registryItemsRepository, $webhooksRepository, - $systemWebhooksRepository, $adsRepository, $passwordResetRequestsRepository, $retentionAggregationsRepository, @@ -565,8 +468,6 @@ const $reversiGamesRepository: Provider = { $flashsRepository, $flashLikesRepository, $userMemosRepository, - $bubbleGameRecordsRepository, - $reversiGamesRepository, ], exports: [ $usersRepository, @@ -605,7 +506,6 @@ const $reversiGamesRepository: Provider = { $swSubscriptionsRepository, $hashtagsRepository, $abuseUserReportsRepository, - $abuseReportNotificationRecipientRepository, $registrationTicketsRepository, $authSessionsRepository, $accessTokensRepository, @@ -627,7 +527,6 @@ const $reversiGamesRepository: Provider = { $channelFavoritesRepository, $registryItemsRepository, $webhooksRepository, - $systemWebhooksRepository, $adsRepository, $passwordResetRequestsRepository, $retentionAggregationsRepository, @@ -636,9 +535,6 @@ const $reversiGamesRepository: Provider = { $flashsRepository, $flashLikesRepository, $userMemosRepository, - $bubbleGameRecordsRepository, - $reversiGamesRepository, ], }) -export class RepositoryModule { -} +export class RepositoryModule {} diff --git a/packages/backend/src/models/RetentionAggregation.ts b/packages/backend/src/models/RetentionAggregation.ts index 139f3e4dfd..9da401597c 100644 --- a/packages/backend/src/models/RetentionAggregation.ts +++ b/packages/backend/src/models/RetentionAggregation.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/ReversiGame.ts b/packages/backend/src/models/ReversiGame.ts deleted file mode 100644 index 6b29a0ce8c..0000000000 --- a/packages/backend/src/models/ReversiGame.ts +++ /dev/null @@ -1,148 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from './util/id.js'; -import { MiUser } from './User.js'; - -@Entity('reversi_game') -export class MiReversiGame { - @PrimaryColumn(id()) - public id: string; - - @Column('timestamp with time zone', { - nullable: true, - comment: 'The started date of the ReversiGame.', - }) - public startedAt: Date | null; - - @Column('timestamp with time zone', { - nullable: true, - comment: 'The ended date of the ReversiGame.', - }) - public endedAt: Date | null; - - @Column(id()) - public user1Id: MiUser['id']; - - @ManyToOne(type => MiUser, { - onDelete: 'CASCADE', - }) - @JoinColumn() - public user1: MiUser | null; - - @Column(id()) - public user2Id: MiUser['id']; - - @ManyToOne(type => MiUser, { - onDelete: 'CASCADE', - }) - @JoinColumn() - public user2: MiUser | null; - - @Column('boolean', { - default: false, - }) - public user1Ready: boolean; - - @Column('boolean', { - default: false, - }) - public user2Ready: boolean; - - /** - * どちらのプレイヤーが先行(黒)か - * 1 ... user1 - * 2 ... user2 - */ - @Column('integer', { - nullable: true, - }) - public black: number | null; - - @Column('boolean', { - default: false, - }) - public isStarted: boolean; - - @Column('boolean', { - default: false, - }) - public isEnded: boolean; - - @Column({ - ...id(), - nullable: true, - }) - public winnerId: MiUser['id'] | null; - - @Column({ - ...id(), - nullable: true, - }) - public surrenderedUserId: MiUser['id'] | null; - - @Column({ - ...id(), - nullable: true, - }) - public timeoutUserId: MiUser['id'] | null; - - // in sec - @Column('smallint', { - default: 90, - }) - public timeLimitForEachTurn: number; - - @Column('jsonb', { - default: [], - }) - public logs: number[][]; - - @Column('varchar', { - array: true, length: 64, - }) - public map: string[]; - - @Column('varchar', { - length: 32, - }) - public bw: string; - - @Column('boolean', { - default: false, - }) - public noIrregularRules: boolean; - - @Column('boolean', { - default: false, - }) - public isLlotheo: boolean; - - @Column('boolean', { - default: false, - }) - public canPutEverywhere: boolean; - - @Column('boolean', { - default: false, - }) - public loopedBoard: boolean; - - @Column('jsonb', { - nullable: true, default: null, - }) - public form1: any | null; - - @Column('jsonb', { - nullable: true, default: null, - }) - public form2: any | null; - - @Column('varchar', { - length: 32, nullable: true, - }) - public crc32: string | null; -} diff --git a/packages/backend/src/models/Role.ts b/packages/backend/src/models/Role.ts index a173971b2c..6976956e13 100644 --- a/packages/backend/src/models/Role.ts +++ b/packages/backend/src/models/Role.ts @@ -1,171 +1,80 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Entity, Column, PrimaryColumn } from 'typeorm'; import { id } from './util/id.js'; -/** - * ~かつ~ - * 複数の条件を同時に満たす場合のみ成立とする - */ type CondFormulaValueAnd = { type: 'and'; values: RoleCondFormulaValue[]; }; -/** - * ~または~ - * 複数の条件のうち、いずれかを満たす場合のみ成立とする - */ type CondFormulaValueOr = { type: 'or'; values: RoleCondFormulaValue[]; }; -/** - * ~ではない - * 条件を満たさない場合のみ成立とする - */ type CondFormulaValueNot = { type: 'not'; value: RoleCondFormulaValue; }; -/** - * ローカルユーザーのみ成立とする - */ type CondFormulaValueIsLocal = { type: 'isLocal'; }; -/** - * リモートユーザーのみ成立とする - */ type CondFormulaValueIsRemote = { type: 'isRemote'; }; -/** - * 既に指定のマニュアルロールにアサインされている場合のみ成立とする - */ -type CondFormulaValueRoleAssignedTo = { - type: 'roleAssignedTo'; - roleId: string; -}; - -/** - * サスペンド済みアカウントの場合のみ成立とする - */ -type CondFormulaValueIsSuspended = { - type: 'isSuspended'; -}; - -/** - * 鍵アカウントの場合のみ成立とする - */ -type CondFormulaValueIsLocked = { - type: 'isLocked'; -}; - -/** - * botアカウントの場合のみ成立とする - */ -type CondFormulaValueIsBot = { - type: 'isBot'; -}; - -/** - * 猫アカウントの場合のみ成立とする - */ -type CondFormulaValueIsCat = { - type: 'isCat'; -}; - -/** - * 「ユーザを見つけやすくする」が有効なアカウントの場合のみ成立とする - */ -type CondFormulaValueIsExplorable = { - type: 'isExplorable'; -}; - -/** - * ユーザが作成されてから指定期間経過した場合のみ成立とする - */ type CondFormulaValueCreatedLessThan = { type: 'createdLessThan'; sec: number; }; -/** - * ユーザが作成されてから指定期間経っていない場合のみ成立とする - */ type CondFormulaValueCreatedMoreThan = { type: 'createdMoreThan'; sec: number; }; -/** - * フォロワー数が指定値以下の場合のみ成立とする - */ type CondFormulaValueFollowersLessThanOrEq = { type: 'followersLessThanOrEq'; value: number; }; -/** - * フォロワー数が指定値以上の場合のみ成立とする - */ type CondFormulaValueFollowersMoreThanOrEq = { type: 'followersMoreThanOrEq'; value: number; }; -/** - * フォロー数が指定値以下の場合のみ成立とする - */ type CondFormulaValueFollowingLessThanOrEq = { type: 'followingLessThanOrEq'; value: number; }; -/** - * フォロー数が指定値以上の場合のみ成立とする - */ type CondFormulaValueFollowingMoreThanOrEq = { type: 'followingMoreThanOrEq'; value: number; }; -/** - * 投稿数が指定値以下の場合のみ成立とする - */ type CondFormulaValueNotesLessThanOrEq = { type: 'notesLessThanOrEq'; value: number; }; -/** - * 投稿数が指定値以上の場合のみ成立とする - */ type CondFormulaValueNotesMoreThanOrEq = { type: 'notesMoreThanOrEq'; value: number; }; -export type RoleCondFormulaValue = { id: string } & ( +export type RoleCondFormulaValue = CondFormulaValueAnd | CondFormulaValueOr | CondFormulaValueNot | CondFormulaValueIsLocal | CondFormulaValueIsRemote | - CondFormulaValueIsSuspended | - CondFormulaValueIsLocked | - CondFormulaValueIsBot | - CondFormulaValueIsCat | - CondFormulaValueIsExplorable | - CondFormulaValueRoleAssignedTo | CondFormulaValueCreatedLessThan | CondFormulaValueCreatedMoreThan | CondFormulaValueFollowersLessThanOrEq | @@ -173,8 +82,7 @@ export type RoleCondFormulaValue = { id: string } & ( CondFormulaValueFollowingLessThanOrEq | CondFormulaValueFollowingMoreThanOrEq | CondFormulaValueNotesLessThanOrEq | - CondFormulaValueNotesMoreThanOrEq -); + CondFormulaValueNotesMoreThanOrEq; @Entity('role') export class MiRole { diff --git a/packages/backend/src/models/RoleAssignment.ts b/packages/backend/src/models/RoleAssignment.ts index 37755d631b..30c7e19f2a 100644 --- a/packages/backend/src/models/RoleAssignment.ts +++ b/packages/backend/src/models/RoleAssignment.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Signin.ts b/packages/backend/src/models/Signin.ts index f8ff9c57d7..656b44dfe0 100644 --- a/packages/backend/src/models/Signin.ts +++ b/packages/backend/src/models/Signin.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/SwSubscription.ts b/packages/backend/src/models/SwSubscription.ts index 0c531132b3..f685a8ff3e 100644 --- a/packages/backend/src/models/SwSubscription.ts +++ b/packages/backend/src/models/SwSubscription.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/SystemWebhook.ts b/packages/backend/src/models/SystemWebhook.ts deleted file mode 100644 index 1a7ce4962b..0000000000 --- a/packages/backend/src/models/SystemWebhook.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Column, Entity, Index, PrimaryColumn } from 'typeorm'; -import { Serialized } from '@/types.js'; -import { id } from './util/id.js'; - -export const systemWebhookEventTypes = [ - // ユーザからの通報を受けたとき - 'abuseReport', - // 通報を処理したとき - 'abuseReportResolved', - // ユーザが作成された時 - 'userCreated', - // モデレータが一定期間不在である警告 - 'inactiveModeratorsWarning', - // モデレータが一定期間不在のためシステムにより招待制へと変更された - 'inactiveModeratorsInvitationOnlyChanged', -] as const; -export type SystemWebhookEventType = typeof systemWebhookEventTypes[number]; - -@Entity('system_webhook') -export class MiSystemWebhook { - @PrimaryColumn(id()) - public id: string; - - /** - * 有効かどうか. - */ - @Index('IDX_system_webhook_isActive', { synchronize: false }) - @Column('boolean', { - default: true, - }) - public isActive: boolean; - - /** - * 更新日時. - */ - @Column('timestamp with time zone', { - default: () => 'CURRENT_TIMESTAMP', - }) - public updatedAt: Date; - - /** - * 最後に送信された日時. - */ - @Column('timestamp with time zone', { - nullable: true, - }) - public latestSentAt: Date | null; - - /** - * 最後に送信されたステータスコード - */ - @Column('integer', { - nullable: true, - }) - public latestStatus: number | null; - - /** - * 通知設定名. - */ - @Column('varchar', { - length: 255, - }) - public name: string; - - /** - * イベント種別. - */ - @Index('IDX_system_webhook_on', { synchronize: false }) - @Column('varchar', { - length: 128, - array: true, - default: '{}', - }) - public on: SystemWebhookEventType[]; - - /** - * Webhook送信先のURL. - */ - @Column('varchar', { - length: 1024, - }) - public url: string; - - /** - * Webhook検証用の値. - */ - @Column('varchar', { - length: 1024, - }) - public secret: string; - - static deserialize(obj: Serialized): MiSystemWebhook { - return { - ...obj, - updatedAt: new Date(obj.updatedAt), - latestSentAt: obj.latestSentAt ? new Date(obj.latestSentAt) : null, - }; - } -} diff --git a/packages/backend/src/models/UsedUsername.ts b/packages/backend/src/models/UsedUsername.ts index fbfc126763..c75bf424c1 100644 --- a/packages/backend/src/models/UsedUsername.ts +++ b/packages/backend/src/models/UsedUsername.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/User.ts b/packages/backend/src/models/User.ts index 96de30c4c2..219497a125 100644 --- a/packages/backend/src/models/User.ts +++ b/packages/backend/src/models/User.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -155,11 +155,6 @@ export class MiUser { }) public tags: string[]; - @Column('integer', { - default: 0, - }) - public score: number; - @Column('boolean', { default: false, comment: 'Whether the User is suspended.', @@ -202,23 +197,6 @@ export class MiUser { }) public isHibernated: boolean; - @Column('boolean', { - default: false, - }) - public requireSigninToViewContents: boolean; - - // in sec, マイナスで相対時間 - @Column('integer', { - nullable: true, - }) - public makeNotesFollowersOnlyBefore: number | null; - - // in sec, マイナスで相対時間 - @Column('integer', { - nullable: true, - }) - public makeNotesHiddenBefore: number | null; - // アカウントが削除されたかどうかのフラグだが、完全に削除される際は物理削除なので実質削除されるまでの「削除が進行しているかどうか」のフラグ @Column('boolean', { default: false, @@ -311,6 +289,5 @@ export const localUsernameSchema = { type: 'string', pattern: /^\w{1,20}$/.toStr export const passwordSchema = { type: 'string', minLength: 1 } as const; export const nameSchema = { type: 'string', minLength: 1, maxLength: 50 } as const; export const descriptionSchema = { type: 'string', minLength: 1, maxLength: 1500 } as const; -export const followedMessageSchema = { type: 'string', minLength: 1, maxLength: 256 } as const; export const locationSchema = { type: 'string', minLength: 1, maxLength: 50 } as const; export const birthdaySchema = { type: 'string', pattern: /^([0-9]{4})-([0-9]{2})-([0-9]{2})$/.toString().slice(1, -1) } as const; diff --git a/packages/backend/src/models/UserIp.ts b/packages/backend/src/models/UserIp.ts index 3e757fcf79..60a7bc8b01 100644 --- a/packages/backend/src/models/UserIp.ts +++ b/packages/backend/src/models/UserIp.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/UserKeypair.ts b/packages/backend/src/models/UserKeypair.ts index f5252d126c..a316dbaeb4 100644 --- a/packages/backend/src/models/UserKeypair.ts +++ b/packages/backend/src/models/UserKeypair.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/UserList.ts b/packages/backend/src/models/UserList.ts index 5fb991a87d..7ad15419d7 100644 --- a/packages/backend/src/models/UserList.ts +++ b/packages/backend/src/models/UserList.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/UserListFavorite.ts b/packages/backend/src/models/UserListFavorite.ts index 80b2d61eb7..a18ed9253a 100644 --- a/packages/backend/src/models/UserListFavorite.ts +++ b/packages/backend/src/models/UserListFavorite.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/UserListMembership.ts b/packages/backend/src/models/UserListMembership.ts index af659d071d..fa8287f17a 100644 --- a/packages/backend/src/models/UserListMembership.ts +++ b/packages/backend/src/models/UserListMembership.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/UserMemo.ts b/packages/backend/src/models/UserMemo.ts index 29e28d290a..ab5e812c44 100644 --- a/packages/backend/src/models/UserMemo.ts +++ b/packages/backend/src/models/UserMemo.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/UserNotePining.ts b/packages/backend/src/models/UserNotePining.ts index 92c5cd55d0..ae5977aa56 100644 --- a/packages/backend/src/models/UserNotePining.ts +++ b/packages/backend/src/models/UserNotePining.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/UserPending.ts b/packages/backend/src/models/UserPending.ts index 99f8a22a84..8b1f8f617f 100644 --- a/packages/backend/src/models/UserPending.ts +++ b/packages/backend/src/models/UserPending.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/UserProfile.ts b/packages/backend/src/models/UserProfile.ts index 5544555296..328dbeaa1c 100644 --- a/packages/backend/src/models/UserProfile.ts +++ b/packages/backend/src/models/UserProfile.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -42,14 +42,6 @@ export class MiUserProfile { }) public description: string | null; - // フォローされた際のメッセージ - @Column('varchar', { - length: 256, nullable: true, - }) - public followedMessage: string | null; - - // TODO: 鍵アカウントの場合の、フォローリクエスト受信時のメッセージも設定できるようにする - @Column('jsonb', { default: [], }) @@ -257,8 +249,6 @@ export class MiUserProfile { type: 'follower'; } | { type: 'mutualFollow'; - } | { - type: 'followingOrFollower'; } | { type: 'list'; userListId: MiUserList['id']; diff --git a/packages/backend/src/models/UserPublickey.ts b/packages/backend/src/models/UserPublickey.ts index 6bcd785304..33de73c636 100644 --- a/packages/backend/src/models/UserPublickey.ts +++ b/packages/backend/src/models/UserPublickey.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/UserSecurityKey.ts b/packages/backend/src/models/UserSecurityKey.ts index 0babbe1abe..02c29bfbb5 100644 --- a/packages/backend/src/models/UserSecurityKey.ts +++ b/packages/backend/src/models/UserSecurityKey.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/Webhook.ts b/packages/backend/src/models/Webhook.ts index b4cab4edc8..ec4e13cc76 100644 --- a/packages/backend/src/models/Webhook.ts +++ b/packages/backend/src/models/Webhook.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,7 +8,6 @@ import { id } from './util/id.js'; import { MiUser } from './User.js'; export const webhookEventTypes = ['mention', 'unfollow', 'follow', 'followed', 'note', 'reply', 'renote', 'reaction'] as const; -export type WebhookEventTypes = typeof webhookEventTypes[number]; @Entity('webhook') export class MiWebhook { diff --git a/packages/backend/src/models/_.ts b/packages/backend/src/models/_.ts index c72bdaa727..d7c327f164 100644 --- a/packages/backend/src/models/_.ts +++ b/packages/backend/src/models/_.ts @@ -1,17 +1,9 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { FindOneOptions, InsertQueryBuilder, ObjectLiteral, Repository, SelectQueryBuilder, TypeORMError } from 'typeorm'; -import { DriverUtils } from 'typeorm/driver/DriverUtils.js'; -import { RelationCountLoader } from 'typeorm/query-builder/relation-count/RelationCountLoader.js'; -import { RelationIdLoader } from 'typeorm/query-builder/relation-id/RelationIdLoader.js'; -import { RawSqlResultsToEntityTransformer } from 'typeorm/query-builder/transformer/RawSqlResultsToEntityTransformer.js'; -import { ObjectUtils } from 'typeorm/util/ObjectUtils.js'; -import { OrmUtils } from 'typeorm/util/OrmUtils.js'; import { MiAbuseUserReport } from '@/models/AbuseUserReport.js'; -import { MiAbuseReportNotificationRecipient } from '@/models/AbuseReportNotificationRecipient.js'; import { MiAccessToken } from '@/models/AccessToken.js'; import { MiAd } from '@/models/Ad.js'; import { MiAnnouncement } from '@/models/Announcement.js'; @@ -69,7 +61,6 @@ 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 { MiSystemWebhook } from '@/models/SystemWebhook.js'; import { MiChannel } from '@/models/Channel.js'; import { MiRetentionAggregation } from '@/models/RetentionAggregation.js'; import { MiRole } from '@/models/Role.js'; @@ -77,56 +68,10 @@ 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 { MiBubbleGameRecord } from '@/models/BubbleGameRecord.js'; -import { MiReversiGame } from '@/models/ReversiGame.js'; -import type { QueryDeepPartialEntity } from 'typeorm/query-builder/QueryPartialEntity.js'; - -export interface MiRepository { - createTableColumnNames(this: Repository & MiRepository): string[]; - insertOne(this: Repository & MiRepository, entity: QueryDeepPartialEntity, findOptions?: Pick, 'relations'>): Promise; - selectAliasColumnNames(this: Repository & MiRepository, queryBuilder: InsertQueryBuilder, builder: SelectQueryBuilder): void; -} - -export const miRepository = { - createTableColumnNames() { - return this.metadata.columns.filter(column => column.isSelect && !column.isVirtual).map(column => column.databaseName); - }, - async insertOne(entity, findOptions?) { - const queryBuilder = this.createQueryBuilder().insert().values(entity); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const mainAlias = queryBuilder.expressionMap.mainAlias!; - const name = mainAlias.name; - mainAlias.name = 't'; - const columnNames = this.createTableColumnNames(); - queryBuilder.returning(columnNames.reduce((a, c) => `${a}, ${queryBuilder.escape(c)}`, '').slice(2)); - const builder = this.createQueryBuilder().addCommonTableExpression(queryBuilder, 'cte', { columnNames }); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - builder.expressionMap.mainAlias!.tablePath = 'cte'; - this.selectAliasColumnNames(queryBuilder, builder); - if (findOptions) { - builder.setFindOptions(findOptions); - } - const raw = await builder.execute(); - mainAlias.name = name; - const relationId = await new RelationIdLoader(builder.connection, this.queryRunner, builder.expressionMap.relationIdAttributes).load(raw); - const relationCount = await new RelationCountLoader(builder.connection, this.queryRunner, builder.expressionMap.relationCountAttributes).load(raw); - const result = new RawSqlResultsToEntityTransformer(builder.expressionMap, builder.connection.driver, relationId, relationCount, this.queryRunner).transform(raw, mainAlias); - return result[0]; - }, - selectAliasColumnNames(queryBuilder, builder) { - let selectOrAddSelect = (selection: string, selectionAliasName?: string) => { - selectOrAddSelect = (selection, selectionAliasName) => builder.addSelect(selection, selectionAliasName); - return builder.select(selection, selectionAliasName); - }; - for (const columnName of this.createTableColumnNames()) { - selectOrAddSelect(`${builder.alias}.${columnName}`, `${builder.alias}_${columnName}`); - } - }, -} satisfies MiRepository; +import type { Repository } from 'typeorm'; export { MiAbuseUserReport, - MiAbuseReportNotificationRecipient, MiAccessToken, MiAd, MiAnnouncement, @@ -184,7 +129,6 @@ export { MiUserPublickey, MiUserSecurityKey, MiWebhook, - MiSystemWebhook, MiChannel, MiRetentionAggregation, MiRole, @@ -192,76 +136,70 @@ export { MiFlash, MiFlashLike, MiUserMemo, - MiBubbleGameRecord, - MiReversiGame, }; -export type AbuseUserReportsRepository = Repository & MiRepository; -export type AbuseReportNotificationRecipientRepository = Repository & MiRepository; -export type AccessTokensRepository = Repository & MiRepository; -export type AdsRepository = Repository & MiRepository; -export type AnnouncementsRepository = Repository & MiRepository; -export type AnnouncementReadsRepository = Repository & MiRepository; -export type AntennasRepository = Repository & MiRepository; -export type AppsRepository = Repository & MiRepository; -export type AvatarDecorationsRepository = Repository & MiRepository; -export type AuthSessionsRepository = Repository & MiRepository; -export type BlockingsRepository = Repository & MiRepository; -export type ChannelFollowingsRepository = Repository & MiRepository; -export type ChannelFavoritesRepository = Repository & MiRepository; -export type ClipsRepository = Repository & MiRepository; -export type ClipNotesRepository = Repository & MiRepository; -export type ClipFavoritesRepository = Repository & MiRepository; -export type DriveFilesRepository = Repository & MiRepository; -export type DriveFoldersRepository = Repository & MiRepository; -export type EmojisRepository = Repository & MiRepository; -export type FollowingsRepository = Repository & MiRepository; -export type FollowRequestsRepository = Repository & MiRepository; -export type GalleryLikesRepository = Repository & MiRepository; -export type GalleryPostsRepository = Repository & MiRepository; -export type HashtagsRepository = Repository & MiRepository; -export type InstancesRepository = Repository & MiRepository; -export type MetasRepository = Repository & MiRepository; -export type ModerationLogsRepository = Repository & MiRepository; -export type MutingsRepository = Repository & MiRepository; -export type RenoteMutingsRepository = Repository & MiRepository; -export type NotesRepository = Repository & MiRepository; -export type NoteFavoritesRepository = Repository & MiRepository; -export type NoteReactionsRepository = Repository & MiRepository; -export type NoteThreadMutingsRepository = Repository & MiRepository; -export type NoteUnreadsRepository = Repository & MiRepository; -export type PagesRepository = Repository & MiRepository; -export type PageLikesRepository = Repository & MiRepository; -export type PasswordResetRequestsRepository = Repository & MiRepository; -export type PollsRepository = Repository & MiRepository; -export type PollVotesRepository = Repository & MiRepository; -export type PromoNotesRepository = Repository & MiRepository; -export type PromoReadsRepository = Repository & MiRepository; -export type RegistrationTicketsRepository = Repository & MiRepository; -export type RegistryItemsRepository = Repository & MiRepository; -export type RelaysRepository = Repository & MiRepository; -export type SigninsRepository = Repository & MiRepository; -export type SwSubscriptionsRepository = Repository & MiRepository; -export type UsedUsernamesRepository = Repository & MiRepository; -export type UsersRepository = Repository & MiRepository; -export type UserIpsRepository = Repository & MiRepository; -export type UserKeypairsRepository = Repository & MiRepository; -export type UserListsRepository = Repository & MiRepository; -export type UserListFavoritesRepository = Repository & MiRepository; -export type UserListMembershipsRepository = Repository & MiRepository; -export type UserNotePiningsRepository = Repository & MiRepository; -export type UserPendingsRepository = Repository & MiRepository; -export type UserProfilesRepository = Repository & MiRepository; -export type UserPublickeysRepository = Repository & MiRepository; -export type UserSecurityKeysRepository = Repository & MiRepository; -export type WebhooksRepository = Repository & MiRepository; -export type SystemWebhooksRepository = Repository & MiRepository; -export type ChannelsRepository = Repository & MiRepository; -export type RetentionAggregationsRepository = Repository & MiRepository; -export type RolesRepository = Repository & MiRepository; -export type RoleAssignmentsRepository = Repository & MiRepository; -export type FlashsRepository = Repository & MiRepository; -export type FlashLikesRepository = Repository & MiRepository; -export type UserMemoRepository = Repository & MiRepository; -export type BubbleGameRecordsRepository = Repository & MiRepository; -export type ReversiGamesRepository = Repository & MiRepository; +export type AbuseUserReportsRepository = Repository; +export type AccessTokensRepository = Repository; +export type AdsRepository = Repository; +export type AnnouncementsRepository = Repository; +export type AnnouncementReadsRepository = Repository; +export type AntennasRepository = Repository; +export type AppsRepository = Repository; +export type AvatarDecorationsRepository = Repository; +export type AuthSessionsRepository = Repository; +export type BlockingsRepository = Repository; +export type ChannelFollowingsRepository = Repository; +export type ChannelFavoritesRepository = Repository; +export type ClipsRepository = Repository; +export type ClipNotesRepository = Repository; +export type ClipFavoritesRepository = Repository; +export type DriveFilesRepository = Repository; +export type DriveFoldersRepository = Repository; +export type EmojisRepository = Repository; +export type FollowingsRepository = Repository; +export type FollowRequestsRepository = Repository; +export type GalleryLikesRepository = Repository; +export type GalleryPostsRepository = Repository; +export type HashtagsRepository = Repository; +export type InstancesRepository = Repository; +export type MetasRepository = Repository; +export type ModerationLogsRepository = Repository; +export type MutingsRepository = Repository; +export type RenoteMutingsRepository = Repository; +export type NotesRepository = Repository; +export type NoteFavoritesRepository = Repository; +export type NoteReactionsRepository = Repository; +export type NoteThreadMutingsRepository = Repository; +export type NoteUnreadsRepository = Repository; +export type PagesRepository = Repository; +export type PageLikesRepository = Repository; +export type PasswordResetRequestsRepository = Repository; +export type PollsRepository = Repository; +export type PollVotesRepository = Repository; +export type PromoNotesRepository = Repository; +export type PromoReadsRepository = Repository; +export type RegistrationTicketsRepository = Repository; +export type RegistryItemsRepository = Repository; +export type RelaysRepository = Repository; +export type SigninsRepository = Repository; +export type SwSubscriptionsRepository = Repository; +export type UsedUsernamesRepository = Repository; +export type UsersRepository = Repository; +export type UserIpsRepository = Repository; +export type UserKeypairsRepository = Repository; +export type UserListsRepository = Repository; +export type UserListFavoritesRepository = Repository; +export type UserListMembershipsRepository = Repository; +export type UserNotePiningsRepository = Repository; +export type UserPendingsRepository = Repository; +export type UserProfilesRepository = Repository; +export type UserPublickeysRepository = Repository; +export type UserSecurityKeysRepository = Repository; +export type WebhooksRepository = Repository; +export type ChannelsRepository = Repository; +export type RetentionAggregationsRepository = Repository; +export type RolesRepository = Repository; +export type RoleAssignmentsRepository = Repository; +export type FlashsRepository = Repository; +export type FlashLikesRepository = Repository; +export type UserMemoRepository = Repository; diff --git a/packages/backend/src/models/json-schema/abuse-report-notification-recipient.ts b/packages/backend/src/models/json-schema/abuse-report-notification-recipient.ts deleted file mode 100644 index 6215f0f5a2..0000000000 --- a/packages/backend/src/models/json-schema/abuse-report-notification-recipient.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export const packedAbuseReportNotificationRecipientSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - }, - isActive: { - type: 'boolean', - optional: false, nullable: false, - }, - updatedAt: { - type: 'string', - format: 'date-time', - optional: false, nullable: false, - }, - name: { - type: 'string', - optional: false, nullable: false, - }, - method: { - type: 'string', - optional: false, nullable: false, - enum: ['email', 'webhook'], - }, - userId: { - type: 'string', - optional: true, nullable: false, - }, - user: { - type: 'object', - optional: true, nullable: false, - ref: 'UserLite', - }, - systemWebhookId: { - type: 'string', - optional: true, nullable: false, - }, - systemWebhook: { - type: 'object', - optional: true, nullable: false, - ref: 'SystemWebhook', - }, - }, -} as const; diff --git a/packages/backend/src/models/json-schema/ad.ts b/packages/backend/src/models/json-schema/ad.ts index b01b39a38b..649ffcd4dc 100644 --- a/packages/backend/src/models/json-schema/ad.ts +++ b/packages/backend/src/models/json-schema/ad.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/json-schema/announcement.ts b/packages/backend/src/models/json-schema/announcement.ts index b9352bd31e..78a98872b2 100644 --- a/packages/backend/src/models/json-schema/announcement.ts +++ b/packages/backend/src/models/json-schema/announcement.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -37,12 +37,10 @@ export const packedAnnouncementSchema = { icon: { type: 'string', optional: false, nullable: false, - enum: ['info', 'warning', 'error', 'success'], }, display: { type: 'string', optional: false, nullable: false, - enum: ['dialog', 'normal', 'banner'], }, needConfirmationToRead: { type: 'boolean', diff --git a/packages/backend/src/models/json-schema/antenna.ts b/packages/backend/src/models/json-schema/antenna.ts index b5b9a5b42c..4a9f0ed355 100644 --- a/packages/backend/src/models/json-schema/antenna.ts +++ b/packages/backend/src/models/json-schema/antenna.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -72,10 +72,9 @@ export const packedAntennaSchema = { optional: false, nullable: false, default: false, }, - excludeBots: { + notify: { type: 'boolean', optional: false, nullable: false, - default: false, }, withReplies: { type: 'boolean', @@ -95,10 +94,5 @@ export const packedAntennaSchema = { optional: false, nullable: false, default: false, }, - notify: { - type: 'boolean', - optional: false, nullable: false, - default: false, - }, }, } as const; diff --git a/packages/backend/src/models/json-schema/app.ts b/packages/backend/src/models/json-schema/app.ts index 6148232224..9e0916299c 100644 --- a/packages/backend/src/models/json-schema/app.ts +++ b/packages/backend/src/models/json-schema/app.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/json-schema/blocking.ts b/packages/backend/src/models/json-schema/blocking.ts index 2d02ba6a70..0b58f1f8d7 100644 --- a/packages/backend/src/models/json-schema/blocking.ts +++ b/packages/backend/src/models/json-schema/blocking.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -25,7 +25,7 @@ export const packedBlockingSchema = { blockee: { type: 'object', optional: false, nullable: false, - ref: 'UserDetailedNotMe', + ref: 'UserDetailed', }, }, } as const; diff --git a/packages/backend/src/models/json-schema/channel.ts b/packages/backend/src/models/json-schema/channel.ts index d233f7858d..5b0fa0f15d 100644 --- a/packages/backend/src/models/json-schema/channel.ts +++ b/packages/backend/src/models/json-schema/channel.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/json-schema/clip.ts b/packages/backend/src/models/json-schema/clip.ts index c4e7055cd8..1ab96c2b3b 100644 --- a/packages/backend/src/models/json-schema/clip.ts +++ b/packages/backend/src/models/json-schema/clip.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -52,9 +52,5 @@ export const packedClipSchema = { type: 'boolean', optional: true, nullable: false, }, - notesCount: { - type: 'integer', - optional: true, nullable: false, - }, }, } as const; diff --git a/packages/backend/src/models/json-schema/drive-file.ts b/packages/backend/src/models/json-schema/drive-file.ts index 5ee1561c50..79f242a711 100644 --- a/packages/backend/src/models/json-schema/drive-file.ts +++ b/packages/backend/src/models/json-schema/drive-file.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -20,7 +20,7 @@ export const packedDriveFileSchema = { name: { type: 'string', optional: false, nullable: false, - example: '192.jpg', + example: 'lenna.jpg', }, type: { type: 'string', diff --git a/packages/backend/src/models/json-schema/drive-folder.ts b/packages/backend/src/models/json-schema/drive-folder.ts index 12012a7e12..aaad301303 100644 --- a/packages/backend/src/models/json-schema/drive-folder.ts +++ b/packages/backend/src/models/json-schema/drive-folder.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/json-schema/emoji.ts b/packages/backend/src/models/json-schema/emoji.ts index 62686ad5ae..99a58f8773 100644 --- a/packages/backend/src/models/json-schema/emoji.ts +++ b/packages/backend/src/models/json-schema/emoji.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -27,10 +27,6 @@ export const packedEmojiSimpleSchema = { type: 'string', optional: false, nullable: false, }, - localOnly: { - type: 'boolean', - optional: true, nullable: false, - }, isSensitive: { type: 'boolean', optional: true, nullable: false, diff --git a/packages/backend/src/models/json-schema/federation-instance.ts b/packages/backend/src/models/json-schema/federation-instance.ts index 912a0399d8..3417314272 100644 --- a/packages/backend/src/models/json-schema/federation-instance.ts +++ b/packages/backend/src/models/json-schema/federation-instance.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -45,11 +45,6 @@ export const packedFederationInstanceSchema = { type: 'boolean', optional: false, nullable: false, }, - suspensionState: { - type: 'string', - nullable: false, optional: false, - enum: ['none', 'manuallySuspended', 'goneSuspended', 'autoSuspendedForNotResponding'], - }, isBlocked: { type: 'boolean', optional: false, nullable: false, @@ -88,10 +83,6 @@ export const packedFederationInstanceSchema = { type: 'boolean', optional: false, nullable: false, }, - isMediaSilenced: { - type: 'boolean', - optional: false, nullable: false, - }, iconUrl: { type: 'string', optional: false, nullable: true, @@ -116,9 +107,5 @@ export const packedFederationInstanceSchema = { optional: false, nullable: true, format: 'date-time', }, - moderationNote: { - type: 'string', - optional: true, nullable: true, - }, }, } as const; diff --git a/packages/backend/src/models/json-schema/flash.ts b/packages/backend/src/models/json-schema/flash.ts index 42b2172409..f08fa7a279 100644 --- a/packages/backend/src/models/json-schema/flash.ts +++ b/packages/backend/src/models/json-schema/flash.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -44,11 +44,6 @@ export const packedFlashSchema = { type: 'string', optional: false, nullable: false, }, - visibility: { - type: 'string', - optional: false, nullable: false, - enum: ['private', 'public'], - }, likedCount: { type: 'number', optional: false, nullable: true, diff --git a/packages/backend/src/models/json-schema/following.ts b/packages/backend/src/models/json-schema/following.ts index c5295a5128..e92cff20a1 100644 --- a/packages/backend/src/models/json-schema/following.ts +++ b/packages/backend/src/models/json-schema/following.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -30,12 +30,12 @@ export const packedFollowingSchema = { followee: { type: 'object', optional: true, nullable: false, - ref: 'UserDetailedNotMe', + ref: 'UserDetailed', }, follower: { type: 'object', optional: true, nullable: false, - ref: 'UserDetailedNotMe', + ref: 'UserDetailed', }, }, } as const; diff --git a/packages/backend/src/models/json-schema/gallery-post.ts b/packages/backend/src/models/json-schema/gallery-post.ts index a46d5115c2..df7038950c 100644 --- a/packages/backend/src/models/json-schema/gallery-post.ts +++ b/packages/backend/src/models/json-schema/gallery-post.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/json-schema/hashtag.ts b/packages/backend/src/models/json-schema/hashtag.ts index 4fd136afed..a48e972a5d 100644 --- a/packages/backend/src/models/json-schema/hashtag.ts +++ b/packages/backend/src/models/json-schema/hashtag.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/json-schema/invite-code.ts b/packages/backend/src/models/json-schema/invite-code.ts index 08d1b8fd0c..cd8bf98d90 100644 --- a/packages/backend/src/models/json-schema/invite-code.ts +++ b/packages/backend/src/models/json-schema/invite-code.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/json-schema/meta.ts b/packages/backend/src/models/json-schema/meta.ts deleted file mode 100644 index e3fd63464a..0000000000 --- a/packages/backend/src/models/json-schema/meta.ts +++ /dev/null @@ -1,350 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export const packedMetaLiteSchema = { - type: 'object', - optional: false, nullable: false, - properties: { - maintainerName: { - type: 'string', - optional: false, nullable: true, - }, - maintainerEmail: { - type: 'string', - optional: false, nullable: true, - }, - version: { - type: 'string', - optional: false, nullable: false, - }, - providesTarball: { - type: 'boolean', - optional: false, nullable: false, - }, - name: { - type: 'string', - optional: false, nullable: true, - }, - shortName: { - type: 'string', - optional: false, nullable: true, - }, - uri: { - type: 'string', - optional: false, nullable: false, - format: 'url', - example: 'https://misskey.example.com', - }, - description: { - type: 'string', - optional: false, nullable: true, - }, - langs: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - optional: false, nullable: false, - }, - }, - tosUrl: { - type: 'string', - optional: false, nullable: true, - }, - repositoryUrl: { - type: 'string', - optional: false, nullable: true, - default: 'https://github.com/misskey-dev/misskey', - }, - feedbackUrl: { - type: 'string', - optional: false, nullable: true, - default: 'https://github.com/misskey-dev/misskey/issues/new', - }, - defaultDarkTheme: { - type: 'string', - optional: false, nullable: true, - }, - defaultLightTheme: { - type: 'string', - optional: false, nullable: true, - }, - disableRegistration: { - type: 'boolean', - optional: false, nullable: false, - }, - emailRequiredForSignup: { - type: 'boolean', - optional: false, nullable: false, - }, - enableHcaptcha: { - type: 'boolean', - optional: false, nullable: false, - }, - hcaptchaSiteKey: { - type: 'string', - optional: false, nullable: true, - }, - enableMcaptcha: { - type: 'boolean', - optional: false, nullable: false, - }, - mcaptchaSiteKey: { - type: 'string', - optional: false, nullable: true, - }, - mcaptchaInstanceUrl: { - type: 'string', - optional: false, nullable: true, - }, - enableRecaptcha: { - type: 'boolean', - optional: false, nullable: false, - }, - recaptchaSiteKey: { - type: 'string', - optional: false, nullable: true, - }, - enableTurnstile: { - type: 'boolean', - optional: false, nullable: false, - }, - turnstileSiteKey: { - type: 'string', - optional: false, nullable: true, - }, - enableTestcaptcha: { - type: 'boolean', - optional: false, nullable: false, - }, - swPublickey: { - type: 'string', - optional: false, nullable: true, - }, - mascotImageUrl: { - type: 'string', - optional: false, nullable: false, - default: '/assets/ai.png', - }, - bannerUrl: { - type: 'string', - optional: false, nullable: true, - }, - serverErrorImageUrl: { - type: 'string', - optional: false, nullable: true, - }, - infoImageUrl: { - type: 'string', - optional: false, nullable: true, - }, - notFoundImageUrl: { - type: 'string', - optional: false, nullable: true, - }, - iconUrl: { - type: 'string', - optional: false, nullable: true, - }, - maxNoteTextLength: { - type: 'number', - optional: false, nullable: false, - }, - ads: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'object', - optional: false, nullable: false, - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - url: { - type: 'string', - optional: false, nullable: false, - format: 'url', - }, - place: { - type: 'string', - optional: false, nullable: false, - }, - ratio: { - type: 'number', - optional: false, nullable: false, - }, - imageUrl: { - type: 'string', - optional: false, nullable: false, - format: 'url', - }, - dayOfWeek: { - type: 'integer', - optional: false, nullable: false, - }, - }, - }, - }, - notesPerOneAd: { - type: 'number', - optional: false, nullable: false, - default: 0, - }, - enableEmail: { - type: 'boolean', - optional: false, nullable: false, - }, - enableServiceWorker: { - type: 'boolean', - optional: false, nullable: false, - }, - translatorAvailable: { - type: 'boolean', - optional: false, nullable: false, - }, - mediaProxy: { - type: 'string', - optional: false, nullable: false, - }, - enableUrlPreview: { - type: 'boolean', - optional: false, nullable: false, - }, - backgroundImageUrl: { - type: 'string', - optional: false, nullable: true, - }, - impressumUrl: { - type: 'string', - optional: false, nullable: true, - }, - logoImageUrl: { - type: 'string', - optional: false, nullable: true, - }, - privacyPolicyUrl: { - type: 'string', - optional: false, nullable: true, - }, - inquiryUrl: { - type: 'string', - optional: false, nullable: true, - }, - serverRules: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - }, - }, - themeColor: { - type: 'string', - optional: false, nullable: true, - }, - policies: { - type: 'object', - optional: false, nullable: false, - ref: 'RolePolicies', - }, - noteSearchableScope: { - type: 'string', - enum: ['local', 'global'], - optional: false, nullable: false, - default: 'local', - }, - maxFileSize: { - type: 'number', - optional: false, nullable: false, - }, - }, -} as const; - -export const packedMetaDetailedOnlySchema = { - type: 'object', - optional: false, nullable: false, - properties: { - features: { - type: 'object', - optional: true, nullable: false, - properties: { - registration: { - type: 'boolean', - optional: false, nullable: false, - }, - emailRequiredForSignup: { - type: 'boolean', - optional: false, nullable: false, - }, - localTimeline: { - type: 'boolean', - optional: false, nullable: false, - }, - globalTimeline: { - type: 'boolean', - optional: false, nullable: false, - }, - hcaptcha: { - type: 'boolean', - optional: false, nullable: false, - }, - turnstile: { - type: 'boolean', - optional: false, nullable: false, - }, - recaptcha: { - type: 'boolean', - optional: false, nullable: false, - }, - objectStorage: { - type: 'boolean', - optional: false, nullable: false, - }, - serviceWorker: { - type: 'boolean', - optional: false, nullable: false, - }, - miauth: { - type: 'boolean', - optional: true, nullable: false, - default: true, - }, - }, - }, - proxyAccountName: { - type: 'string', - optional: false, nullable: true, - }, - requireSetup: { - type: 'boolean', - optional: false, nullable: false, - example: false, - }, - cacheRemoteFiles: { - type: 'boolean', - optional: false, nullable: false, - }, - cacheRemoteSensitiveFiles: { - type: 'boolean', - optional: false, nullable: false, - }, - }, -} as const; - -export const packedMetaDetailedSchema = { - type: 'object', - allOf: [ - { - type: 'object', - ref: 'MetaLite', - }, - { - type: 'object', - ref: 'MetaDetailedOnly', - }, - ], -} as const; diff --git a/packages/backend/src/models/json-schema/muting.ts b/packages/backend/src/models/json-schema/muting.ts index b5fab013ef..dde9dc0288 100644 --- a/packages/backend/src/models/json-schema/muting.ts +++ b/packages/backend/src/models/json-schema/muting.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -30,7 +30,7 @@ export const packedMutingSchema = { mutee: { type: 'object', optional: false, nullable: false, - ref: 'UserDetailedNotMe', + ref: 'UserDetailed', }, }, } as const; diff --git a/packages/backend/src/models/json-schema/note-favorite.ts b/packages/backend/src/models/json-schema/note-favorite.ts index d2a3745f4b..3f0007d917 100644 --- a/packages/backend/src/models/json-schema/note-favorite.ts +++ b/packages/backend/src/models/json-schema/note-favorite.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/json-schema/note-reaction.ts b/packages/backend/src/models/json-schema/note-reaction.ts index 95658ace1f..e3335f426e 100644 --- a/packages/backend/src/models/json-schema/note-reaction.ts +++ b/packages/backend/src/models/json-schema/note-reaction.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/json-schema/note.ts b/packages/backend/src/models/json-schema/note.ts index 432c096e48..aa749943f0 100644 --- a/packages/backend/src/models/json-schema/note.ts +++ b/packages/backend/src/models/json-schema/note.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -69,7 +69,6 @@ export const packedNoteSchema = { visibility: { type: 'string', optional: false, nullable: false, - enum: ['public', 'home', 'followers', 'specified'], }, mentions: { type: 'array', @@ -118,48 +117,6 @@ export const packedNoteSchema = { poll: { type: 'object', optional: true, nullable: true, - properties: { - expiresAt: { - type: 'string', - optional: true, nullable: true, - format: 'date-time', - }, - multiple: { - type: 'boolean', - optional: false, nullable: false, - }, - choices: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'object', - optional: false, nullable: false, - properties: { - isVoted: { - type: 'boolean', - optional: false, nullable: false, - }, - text: { - type: 'string', - optional: false, nullable: false, - }, - votes: { - type: 'number', - optional: false, nullable: false, - }, - }, - }, - }, - }, - }, - emojis: { - type: 'object', - optional: true, nullable: false, - additionalProperties: { - anyOf: [{ - type: 'string', - }], - }, }, channelId: { type: 'string', @@ -191,10 +148,6 @@ export const packedNoteSchema = { type: 'boolean', optional: false, nullable: false, }, - userId: { - type: 'string', - optional: false, nullable: true, - }, }, }, localOnly: { @@ -204,29 +157,10 @@ export const packedNoteSchema = { reactionAcceptance: { type: 'string', optional: false, nullable: true, - enum: ['likeOnly', 'likeOnlyForRemote', 'nonSensitiveOnly', 'nonSensitiveOnlyForLocalLikeOnlyForRemote', null], - }, - reactionEmojis: { - type: 'object', - optional: false, nullable: false, - additionalProperties: { - anyOf: [{ - type: 'string', - }], - }, }, reactions: { type: 'object', optional: false, nullable: false, - additionalProperties: { - anyOf: [{ - type: 'number', - }], - }, - }, - reactionCount: { - type: 'number', - optional: false, nullable: false, }, renoteCount: { type: 'number', @@ -258,7 +192,7 @@ export const packedNoteSchema = { }, myReaction: { - type: 'string', + type: 'object', optional: true, nullable: true, }, }, diff --git a/packages/backend/src/models/json-schema/notification.ts b/packages/backend/src/models/json-schema/notification.ts index cddaf4bc83..c6d6e84317 100644 --- a/packages/backend/src/models/json-schema/notification.ts +++ b/packages/backend/src/models/json-schema/notification.ts @@ -1,12 +1,11 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { ACHIEVEMENT_TYPES } from '@/core/AchievementService.js'; -import { notificationTypes, userExportableEntities } from '@/types.js'; +import { notificationTypes } from '@/types.js'; -const baseSchema = { +export const packedNotificationSchema = { type: 'object', properties: { id: { @@ -24,403 +23,68 @@ const baseSchema = { optional: false, nullable: false, enum: [...notificationTypes, 'reaction:grouped', 'renote:grouped'], }, + user: { + type: 'object', + ref: 'UserLite', + optional: true, nullable: true, + }, + userId: { + type: 'string', + optional: true, nullable: true, + format: 'id', + }, + note: { + type: 'object', + ref: 'Note', + optional: true, nullable: true, + }, + reaction: { + type: 'string', + optional: true, nullable: true, + }, + achievement: { + type: 'string', + optional: true, nullable: false, + }, + body: { + type: 'string', + optional: true, nullable: true, + }, + header: { + type: 'string', + optional: true, nullable: true, + }, + icon: { + type: 'string', + optional: true, nullable: true, + }, + reactions: { + type: 'array', + optional: true, nullable: true, + items: { + type: 'object', + properties: { + user: { + type: 'object', + ref: 'UserLite', + optional: false, nullable: false, + }, + reaction: { + type: 'string', + optional: false, nullable: false, + }, + }, + required: ['user', 'reaction'], + }, + }, + users: { + type: 'array', + optional: true, nullable: true, + items: { + type: 'object', + ref: 'UserLite', + optional: false, nullable: false, + }, + }, }, } as const; - -export const packedNotificationSchema = { - type: 'object', - oneOf: [{ - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['note'], - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - note: { - type: 'object', - ref: 'Note', - optional: false, nullable: false, - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['mention'], - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - note: { - type: 'object', - ref: 'Note', - optional: false, nullable: false, - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['reply'], - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - note: { - type: 'object', - ref: 'Note', - optional: false, nullable: false, - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['renote'], - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - note: { - type: 'object', - ref: 'Note', - optional: false, nullable: false, - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['quote'], - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - note: { - type: 'object', - ref: 'Note', - optional: false, nullable: false, - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['reaction'], - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - note: { - type: 'object', - ref: 'Note', - optional: false, nullable: false, - }, - reaction: { - type: 'string', - optional: false, nullable: false, - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['pollEnded'], - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - note: { - type: 'object', - ref: 'Note', - optional: false, nullable: false, - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['follow'], - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['receiveFollowRequest'], - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['followRequestAccepted'], - }, - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - userId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - message: { - type: 'string', - optional: false, nullable: true, - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['roleAssigned'], - }, - role: { - type: 'object', - ref: 'Role', - optional: false, nullable: false, - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['achievementEarned'], - }, - achievement: { - type: 'string', - optional: false, nullable: false, - enum: ACHIEVEMENT_TYPES, - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['exportCompleted'], - }, - exportedEntity: { - type: 'string', - optional: false, nullable: false, - enum: userExportableEntities, - }, - fileId: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['login'], - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['app'], - }, - body: { - type: 'string', - optional: false, nullable: false, - }, - header: { - type: 'string', - optional: false, nullable: true, - }, - icon: { - type: 'string', - optional: false, nullable: true, - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['reaction:grouped'], - }, - note: { - type: 'object', - ref: 'Note', - optional: false, nullable: false, - }, - reactions: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'object', - properties: { - user: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - reaction: { - type: 'string', - optional: false, nullable: false, - }, - }, - required: ['user', 'reaction'], - }, - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['renote:grouped'], - }, - note: { - type: 'object', - ref: 'Note', - optional: false, nullable: false, - }, - users: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'object', - ref: 'UserLite', - optional: false, nullable: false, - }, - }, - }, - }, { - type: 'object', - properties: { - ...baseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['test'], - }, - }, - }], -} as const; diff --git a/packages/backend/src/models/json-schema/page.ts b/packages/backend/src/models/json-schema/page.ts index 748d6f1245..9baacd6884 100644 --- a/packages/backend/src/models/json-schema/page.ts +++ b/packages/backend/src/models/json-schema/page.ts @@ -1,110 +1,8 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -const blockBaseSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - }, - type: { - type: 'string', - optional: false, nullable: false, - }, - }, -} as const; - -const textBlockSchema = { - type: 'object', - properties: { - ...blockBaseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['text'], - }, - text: { - type: 'string', - optional: false, nullable: false, - }, - }, -} as const; - -const sectionBlockSchema = { - type: 'object', - properties: { - ...blockBaseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['section'], - }, - title: { - type: 'string', - optional: false, nullable: false, - }, - children: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'object', - optional: false, nullable: false, - ref: 'PageBlock', - selfRef: true, - }, - }, - }, -} as const; - -const imageBlockSchema = { - type: 'object', - properties: { - ...blockBaseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['image'], - }, - fileId: { - type: 'string', - optional: false, nullable: true, - }, - }, -} as const; - -const noteBlockSchema = { - type: 'object', - properties: { - ...blockBaseSchema.properties, - type: { - type: 'string', - optional: false, nullable: false, - enum: ['note'], - }, - detailed: { - type: 'boolean', - optional: false, nullable: false, - }, - note: { - type: 'string', - optional: false, nullable: true, - }, - }, -} as const; - -export const packedPageBlockSchema = { - type: 'object', - oneOf: [ - textBlockSchema, - sectionBlockSchema, - imageBlockSchema, - noteBlockSchema, - ], -} as const; - export const packedPageSchema = { type: 'object', properties: { @@ -140,7 +38,6 @@ export const packedPageSchema = { items: { type: 'object', optional: false, nullable: false, - ref: 'PageBlock', }, }, variables: { diff --git a/packages/backend/src/models/json-schema/queue.ts b/packages/backend/src/models/json-schema/queue.ts index 2ecf5c831f..43da6e605d 100644 --- a/packages/backend/src/models/json-schema/queue.ts +++ b/packages/backend/src/models/json-schema/queue.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/json-schema/renote-muting.ts b/packages/backend/src/models/json-schema/renote-muting.ts index 344d6c7c00..feed1ceb09 100644 --- a/packages/backend/src/models/json-schema/renote-muting.ts +++ b/packages/backend/src/models/json-schema/renote-muting.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -25,7 +25,7 @@ export const packedRenoteMutingSchema = { mutee: { type: 'object', optional: false, nullable: false, - ref: 'UserDetailedNotMe', + ref: 'UserDetailed', }, }, } as const; diff --git a/packages/backend/src/models/json-schema/reversi-game.ts b/packages/backend/src/models/json-schema/reversi-game.ts deleted file mode 100644 index cb37200384..0000000000 --- a/packages/backend/src/models/json-schema/reversi-game.ts +++ /dev/null @@ -1,243 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export const packedReversiGameLiteSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - startedAt: { - type: 'string', - optional: false, nullable: true, - format: 'date-time', - }, - endedAt: { - type: 'string', - optional: false, nullable: true, - format: 'date-time', - }, - isStarted: { - type: 'boolean', - optional: false, nullable: false, - }, - isEnded: { - type: 'boolean', - optional: false, nullable: false, - }, - user1Id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - user2Id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - user1: { - type: 'object', - optional: false, nullable: false, - ref: 'UserLite', - }, - user2: { - type: 'object', - optional: false, nullable: false, - ref: 'UserLite', - }, - winnerId: { - type: 'string', - optional: false, nullable: true, - format: 'id', - }, - winner: { - type: 'object', - optional: false, nullable: true, - ref: 'UserLite', - }, - surrenderedUserId: { - type: 'string', - optional: false, nullable: true, - format: 'id', - }, - timeoutUserId: { - type: 'string', - optional: false, nullable: true, - format: 'id', - }, - black: { - type: 'number', - optional: false, nullable: true, - }, - bw: { - type: 'string', - optional: false, nullable: false, - }, - noIrregularRules: { - type: 'boolean', - optional: false, nullable: false, - }, - isLlotheo: { - type: 'boolean', - optional: false, nullable: false, - }, - canPutEverywhere: { - type: 'boolean', - optional: false, nullable: false, - }, - loopedBoard: { - type: 'boolean', - optional: false, nullable: false, - }, - timeLimitForEachTurn: { - type: 'number', - optional: false, nullable: false, - }, - }, -} as const; - -export const packedReversiGameDetailedSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - startedAt: { - type: 'string', - optional: false, nullable: true, - format: 'date-time', - }, - endedAt: { - type: 'string', - optional: false, nullable: true, - format: 'date-time', - }, - isStarted: { - type: 'boolean', - optional: false, nullable: false, - }, - isEnded: { - type: 'boolean', - optional: false, nullable: false, - }, - form1: { - type: 'object', - optional: false, nullable: true, - }, - form2: { - type: 'object', - optional: false, nullable: true, - }, - user1Ready: { - type: 'boolean', - optional: false, nullable: false, - }, - user2Ready: { - type: 'boolean', - optional: false, nullable: false, - }, - user1Id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - user2Id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - user1: { - type: 'object', - optional: false, nullable: false, - ref: 'UserLite', - }, - user2: { - type: 'object', - optional: false, nullable: false, - ref: 'UserLite', - }, - winnerId: { - type: 'string', - optional: false, nullable: true, - format: 'id', - }, - winner: { - type: 'object', - optional: false, nullable: true, - ref: 'UserLite', - }, - surrenderedUserId: { - type: 'string', - optional: false, nullable: true, - format: 'id', - }, - timeoutUserId: { - type: 'string', - optional: false, nullable: true, - format: 'id', - }, - black: { - type: 'number', - optional: false, nullable: true, - }, - bw: { - type: 'string', - optional: false, nullable: false, - }, - noIrregularRules: { - type: 'boolean', - optional: false, nullable: false, - }, - isLlotheo: { - type: 'boolean', - optional: false, nullable: false, - }, - canPutEverywhere: { - type: 'boolean', - optional: false, nullable: false, - }, - loopedBoard: { - type: 'boolean', - optional: false, nullable: false, - }, - timeLimitForEachTurn: { - type: 'number', - optional: false, nullable: false, - }, - logs: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'number', - }, - }, - }, - map: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - optional: false, nullable: false, - }, - }, - }, -} as const; diff --git a/packages/backend/src/models/json-schema/role.ts b/packages/backend/src/models/json-schema/role.ts index 3537de94c8..b0c6804bb8 100644 --- a/packages/backend/src/models/json-schema/role.ts +++ b/packages/backend/src/models/json-schema/role.ts @@ -1,294 +1,23 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export const packedRoleCondFormulaLogicsSchema = { +const rolePolicyValue = { type: 'object', properties: { - id: { - type: 'string', optional: false, - }, - type: { - type: 'string', - nullable: false, optional: false, - enum: ['and', 'or'], - }, - values: { - type: 'array', - nullable: false, optional: false, - items: { - ref: 'RoleCondFormulaValue', - }, - }, - }, -} as const; - -export const packedRoleCondFormulaValueNot = { - type: 'object', - properties: { - id: { - type: 'string', optional: false, - }, - type: { - type: 'string', - nullable: false, optional: false, - enum: ['not'], - }, value: { - type: 'object', - optional: false, - ref: 'RoleCondFormulaValue', - }, - }, -} as const; - -export const packedRoleCondFormulaValueIsLocalOrRemoteSchema = { - type: 'object', - properties: { - id: { - type: 'string', optional: false, - }, - type: { - type: 'string', - nullable: false, optional: false, - enum: ['isLocal', 'isRemote'], - }, - }, -} as const; - -export const packedRoleCondFormulaValueUserSettingBooleanSchema = { - type: 'object', - properties: { - id: { - type: 'string', optional: false, - }, - type: { - type: 'string', - nullable: false, optional: false, - enum: ['isSuspended', 'isLocked', 'isBot', 'isCat', 'isExplorable'], - }, - }, -} as const; - -export const packedRoleCondFormulaValueAssignedRoleSchema = { - type: 'object', - properties: { - id: { - type: 'string', optional: false, - }, - type: { - type: 'string', - nullable: false, optional: false, - enum: ['roleAssignedTo'], - }, - roleId: { - type: 'string', - nullable: false, optional: false, - format: 'id', - example: 'xxxxxxxxxx', - }, - }, -} as const; - -export const packedRoleCondFormulaValueCreatedSchema = { - type: 'object', - properties: { - id: { - type: 'string', optional: false, - }, - type: { - type: 'string', - nullable: false, optional: false, - enum: [ - 'createdLessThan', - 'createdMoreThan', + oneOf: [ + { + type: 'integer', + optional: false, nullable: false, + }, + { + type: 'boolean', + optional: false, nullable: false, + }, ], }, - sec: { - type: 'number', - nullable: false, optional: false, - }, - }, -} as const; - -export const packedRoleCondFormulaFollowersOrFollowingOrNotesSchema = { - type: 'object', - properties: { - id: { - type: 'string', optional: false, - }, - type: { - type: 'string', - nullable: false, optional: false, - enum: [ - 'followersLessThanOrEq', - 'followersMoreThanOrEq', - 'followingLessThanOrEq', - 'followingMoreThanOrEq', - 'notesLessThanOrEq', - 'notesMoreThanOrEq', - ], - }, - value: { - type: 'number', - nullable: false, optional: false, - }, - }, -} as const; - -export const packedRoleCondFormulaValueSchema = { - type: 'object', - oneOf: [ - { - ref: 'RoleCondFormulaLogics', - }, - { - ref: 'RoleCondFormulaValueNot', - }, - { - ref: 'RoleCondFormulaValueIsLocalOrRemote', - }, - { - ref: 'RoleCondFormulaValueUserSettingBooleanSchema', - }, - { - ref: 'RoleCondFormulaValueAssignedRole', - }, - { - ref: 'RoleCondFormulaValueCreated', - }, - { - ref: 'RoleCondFormulaFollowersOrFollowingOrNotes', - }, - ], -} as const; - -export const packedRolePoliciesSchema = { - type: 'object', - optional: false, nullable: false, - properties: { - gtlAvailable: { - type: 'boolean', - optional: false, nullable: false, - }, - ltlAvailable: { - type: 'boolean', - optional: false, nullable: false, - }, - canPublicNote: { - type: 'boolean', - optional: false, nullable: false, - }, - mentionLimit: { + priority: { type: 'integer', optional: false, nullable: false, }, - canInvite: { - type: 'boolean', - optional: false, nullable: false, - }, - inviteLimit: { - type: 'integer', - optional: false, nullable: false, - }, - inviteLimitCycle: { - type: 'integer', - optional: false, nullable: false, - }, - inviteExpirationTime: { - type: 'integer', - optional: false, nullable: false, - }, - canManageCustomEmojis: { - type: 'boolean', - optional: false, nullable: false, - }, - canManageAvatarDecorations: { - type: 'boolean', - optional: false, nullable: false, - }, - canSearchNotes: { - type: 'boolean', - optional: false, nullable: false, - }, - canUseTranslator: { - type: 'boolean', - optional: false, nullable: false, - }, - canHideAds: { - type: 'boolean', - optional: false, nullable: false, - }, - driveCapacityMb: { - type: 'integer', - optional: false, nullable: false, - }, - alwaysMarkNsfw: { - type: 'boolean', - optional: false, nullable: false, - }, - canUpdateBioMedia: { - type: 'boolean', - optional: false, nullable: false, - }, - pinLimit: { - type: 'integer', - optional: false, nullable: false, - }, - antennaLimit: { - type: 'integer', - optional: false, nullable: false, - }, - wordMuteLimit: { - type: 'integer', - optional: false, nullable: false, - }, - webhookLimit: { - type: 'integer', - optional: false, nullable: false, - }, - clipLimit: { - type: 'integer', - optional: false, nullable: false, - }, - noteEachClipsLimit: { - type: 'integer', - optional: false, nullable: false, - }, - userListLimit: { - type: 'integer', - optional: false, nullable: false, - }, - userEachUserListsLimit: { - type: 'integer', - optional: false, nullable: false, - }, - rateLimitFactor: { - type: 'integer', - optional: false, nullable: false, - }, - avatarDecorationLimit: { - type: 'integer', - optional: false, nullable: false, - }, - canImportAntennas: { - type: 'boolean', - optional: false, nullable: false, - }, - canImportBlocking: { - type: 'boolean', - optional: false, nullable: false, - }, - canImportFollowing: { - type: 'boolean', - optional: false, nullable: false, - }, - canImportMuting: { - type: 'boolean', - optional: false, nullable: false, - }, - canImportUserLists: { + useDefault: { type: 'boolean', optional: false, nullable: false, }, @@ -368,7 +97,6 @@ export const packedRoleSchema = { condFormula: { type: 'object', optional: false, nullable: false, - ref: 'RoleCondFormulaValue', }, isPublic: { type: 'boolean', @@ -393,28 +121,31 @@ export const packedRoleSchema = { policies: { type: 'object', optional: false, nullable: false, - additionalProperties: { - anyOf: [{ - type: 'object', - properties: { - value: { - oneOf: [ - { - type: 'integer', - }, - { - type: 'boolean', - }, - ], - }, - priority: { - type: 'integer', - }, - useDefault: { - type: 'boolean', - }, - }, - }], + properties: { + pinLimit: rolePolicyValue, + canInvite: rolePolicyValue, + clipLimit: rolePolicyValue, + canHideAds: rolePolicyValue, + inviteLimit: rolePolicyValue, + antennaLimit: rolePolicyValue, + gtlAvailable: rolePolicyValue, + ltlAvailable: rolePolicyValue, + webhookLimit: rolePolicyValue, + canPublicNote: rolePolicyValue, + userListLimit: rolePolicyValue, + wordMuteLimit: rolePolicyValue, + alwaysMarkNsfw: rolePolicyValue, + canSearchNotes: rolePolicyValue, + driveCapacityMb: rolePolicyValue, + rateLimitFactor: rolePolicyValue, + inviteLimitCycle: rolePolicyValue, + noteEachClipsLimit: rolePolicyValue, + inviteExpirationTime: rolePolicyValue, + canManageCustomEmojis: rolePolicyValue, + userEachUserListsLimit: rolePolicyValue, + canManageAvatarDecorations: rolePolicyValue, + canUseTranslator: rolePolicyValue, + avatarDecorationLimit: rolePolicyValue, }, }, usersCount: { diff --git a/packages/backend/src/models/json-schema/signin.ts b/packages/backend/src/models/json-schema/signin.ts index 45732a742b..d27d2490c5 100644 --- a/packages/backend/src/models/json-schema/signin.ts +++ b/packages/backend/src/models/json-schema/signin.ts @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - export const packedSigninSchema = { type: 'object', properties: { diff --git a/packages/backend/src/models/json-schema/system-webhook.ts b/packages/backend/src/models/json-schema/system-webhook.ts deleted file mode 100644 index d83065a743..0000000000 --- a/packages/backend/src/models/json-schema/system-webhook.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { systemWebhookEventTypes } from '@/models/SystemWebhook.js'; - -export const packedSystemWebhookSchema = { - type: 'object', - properties: { - id: { - type: 'string', - optional: false, nullable: false, - }, - isActive: { - type: 'boolean', - optional: false, nullable: false, - }, - updatedAt: { - type: 'string', - format: 'date-time', - optional: false, nullable: false, - }, - latestSentAt: { - type: 'string', - format: 'date-time', - optional: false, nullable: true, - }, - latestStatus: { - type: 'number', - optional: false, nullable: true, - }, - name: { - type: 'string', - optional: false, nullable: false, - }, - on: { - type: 'array', - items: { - type: 'string', - optional: false, nullable: false, - enum: systemWebhookEventTypes, - }, - }, - url: { - type: 'string', - optional: false, nullable: false, - }, - secret: { - type: 'string', - optional: false, nullable: false, - }, - }, -} as const; diff --git a/packages/backend/src/models/json-schema/user-list.ts b/packages/backend/src/models/json-schema/user-list.ts index dc9af25602..e257d9984c 100644 --- a/packages/backend/src/models/json-schema/user-list.ts +++ b/packages/backend/src/models/json-schema/user-list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts index 38631f907d..6a0d43b1ac 100644 --- a/packages/backend/src/models/json-schema/user.ts +++ b/packages/backend/src/models/json-schema/user.ts @@ -1,40 +1,18 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -export const notificationRecieveConfig = { +const notificationRecieveConfig = { type: 'object', - oneOf: [ - { - type: 'object', - nullable: false, - properties: { - type: { - type: 'string', - nullable: false, - enum: ['all', 'following', 'follower', 'mutualFollow', 'followingOrFollower', 'never'], - }, - }, - required: ['type'], + nullable: false, optional: true, + properties: { + type: { + type: 'string', + nullable: false, optional: false, + enum: ['all', 'following', 'follower', 'mutualFollow', 'list', 'never'], }, - { - type: 'object', - nullable: false, - properties: { - type: { - type: 'string', - nullable: false, - enum: ['list'], - }, - userListId: { - type: 'string', - format: 'misskey:id', - }, - }, - required: ['type', 'userListId'], - }, - ], + }, } as const; export const packedUserLiteSchema = { @@ -115,18 +93,6 @@ export const packedUserLiteSchema = { type: 'boolean', nullable: false, optional: true, }, - requireSigninToViewContents: { - type: 'boolean', - nullable: false, optional: true, - }, - makeNotesFollowersOnlyBefore: { - type: 'number', - nullable: true, optional: true, - }, - makeNotesHiddenBefore: { - type: 'number', - nullable: true, optional: true, - }, instance: { type: 'object', nullable: false, optional: true, @@ -160,9 +126,6 @@ export const packedUserLiteSchema = { emojis: { type: 'object', nullable: false, optional: false, - additionalProperties: { - type: 'string', - }, }, onlineStatus: { type: 'string', @@ -358,6 +321,21 @@ export const packedUserDetailedNotMeOnlySchema = { nullable: false, optional: false, enum: ['public', 'followers', 'private'], }, + twoFactorEnabled: { + type: 'boolean', + nullable: false, optional: false, + default: false, + }, + usePasswordLessLogin: { + type: 'boolean', + nullable: false, optional: false, + default: false, + }, + securityKeys: { + type: 'boolean', + nullable: false, optional: false, + default: false, + }, roles: { type: 'array', nullable: false, optional: false, @@ -367,10 +345,6 @@ export const packedUserDetailedNotMeOnlySchema = { ref: 'RoleLite', }, }, - followedMessage: { - type: 'string', - nullable: true, optional: true, - }, memo: { type: 'string', nullable: true, optional: false, @@ -379,18 +353,6 @@ export const packedUserDetailedNotMeOnlySchema = { type: 'string', nullable: false, optional: true, }, - twoFactorEnabled: { - type: 'boolean', - nullable: false, optional: true, - }, - usePasswordLessLogin: { - type: 'boolean', - nullable: false, optional: true, - }, - securityKeys: { - type: 'boolean', - nullable: false, optional: true, - }, //#region relations isFollowing: { type: 'boolean', @@ -450,10 +412,6 @@ export const packedMeDetailedOnlySchema = { nullable: true, optional: false, format: 'id', }, - followedMessage: { - type: 'string', - nullable: true, optional: false, - }, isModerator: { type: 'boolean', nullable: true, optional: false, @@ -588,20 +546,15 @@ export const packedMeDetailedOnlySchema = { type: 'object', nullable: false, optional: false, properties: { - note: { optional: true, ...notificationRecieveConfig }, - follow: { optional: true, ...notificationRecieveConfig }, - mention: { optional: true, ...notificationRecieveConfig }, - reply: { optional: true, ...notificationRecieveConfig }, - renote: { optional: true, ...notificationRecieveConfig }, - quote: { optional: true, ...notificationRecieveConfig }, - reaction: { optional: true, ...notificationRecieveConfig }, - pollEnded: { optional: true, ...notificationRecieveConfig }, - receiveFollowRequest: { optional: true, ...notificationRecieveConfig }, - followRequestAccepted: { optional: true, ...notificationRecieveConfig }, - roleAssigned: { optional: true, ...notificationRecieveConfig }, - achievementEarned: { optional: true, ...notificationRecieveConfig }, - app: { optional: true, ...notificationRecieveConfig }, - test: { optional: true, ...notificationRecieveConfig }, + app: notificationRecieveConfig, + quote: notificationRecieveConfig, + reply: notificationRecieveConfig, + follow: notificationRecieveConfig, + renote: notificationRecieveConfig, + mention: notificationRecieveConfig, + reaction: notificationRecieveConfig, + pollEnded: notificationRecieveConfig, + receiveFollowRequest: notificationRecieveConfig, }, }, emailNotificationTypes: { @@ -637,22 +590,104 @@ export const packedMeDetailedOnlySchema = { policies: { type: 'object', nullable: false, optional: false, - ref: 'RolePolicies', - }, - twoFactorEnabled: { - type: 'boolean', - nullable: false, optional: false, - default: false, - }, - usePasswordLessLogin: { - type: 'boolean', - nullable: false, optional: false, - default: false, - }, - securityKeys: { - type: 'boolean', - nullable: false, optional: false, - default: false, + properties: { + gtlAvailable: { + type: 'boolean', + nullable: false, optional: false, + }, + ltlAvailable: { + type: 'boolean', + nullable: false, optional: false, + }, + canPublicNote: { + type: 'boolean', + nullable: false, optional: false, + }, + canInvite: { + type: 'boolean', + nullable: false, optional: false, + }, + inviteLimit: { + type: 'number', + nullable: false, optional: false, + }, + inviteLimitCycle: { + type: 'number', + nullable: false, optional: false, + }, + inviteExpirationTime: { + type: 'number', + nullable: false, optional: false, + }, + canManageCustomEmojis: { + type: 'boolean', + nullable: false, optional: false, + }, + canManageAvatarDecorations: { + type: 'boolean', + nullable: false, optional: false, + }, + canSearchNotes: { + type: 'boolean', + nullable: false, optional: false, + }, + canUseTranslator: { + type: 'boolean', + nullable: false, optional: false, + }, + canHideAds: { + type: 'boolean', + nullable: false, optional: false, + }, + driveCapacityMb: { + type: 'number', + nullable: false, optional: false, + }, + alwaysMarkNsfw: { + type: 'boolean', + nullable: false, optional: false, + }, + pinLimit: { + type: 'number', + nullable: false, optional: false, + }, + antennaLimit: { + type: 'number', + nullable: false, optional: false, + }, + wordMuteLimit: { + type: 'number', + nullable: false, optional: false, + }, + webhookLimit: { + type: 'number', + nullable: false, optional: false, + }, + clipLimit: { + type: 'number', + nullable: false, optional: false, + }, + noteEachClipsLimit: { + type: 'number', + nullable: false, optional: false, + }, + userListLimit: { + type: 'number', + nullable: false, optional: false, + }, + userEachUserListsLimit: { + type: 'number', + nullable: false, optional: false, + }, + rateLimitFactor: { + type: 'number', + nullable: false, optional: false, + }, + avatarDecorationLimit: { + type: 'number', + nullable: false, optional: false, + }, + }, }, //#region secrets email: { @@ -747,5 +782,13 @@ export const packedUserSchema = { type: 'object', ref: 'UserDetailed', }, + { + type: 'object', + ref: 'UserDetailedNotMe', + }, + { + type: 'object', + ref: 'MeDetailed', + }, ], } as const; diff --git a/packages/backend/src/models/util/id.ts b/packages/backend/src/models/util/id.ts index 2d742702c7..81e83b8db9 100644 --- a/packages/backend/src/models/util/id.ts +++ b/packages/backend/src/models/util/id.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/postgres.ts b/packages/backend/src/postgres.ts index 251a03c303..cd611839a4 100644 --- a/packages/backend/src/postgres.ts +++ b/packages/backend/src/postgres.ts @@ -1,16 +1,17 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ // https://github.com/typeorm/typeorm/issues/2400 import pg from 'pg'; +pg.types.setTypeParser(20, Number); + import { DataSource, Logger } from 'typeorm'; import * as highlight from 'cli-highlight'; import { entities as charts } from '@/core/chart/entities.js'; import { MiAbuseUserReport } from '@/models/AbuseUserReport.js'; -import { MiAbuseReportNotificationRecipient } from '@/models/AbuseReportNotificationRecipient.js'; import { MiAccessToken } from '@/models/AccessToken.js'; import { MiAd } from '@/models/Ad.js'; import { MiAnnouncement } from '@/models/Announcement.js'; @@ -68,7 +69,6 @@ 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 { MiSystemWebhook } from '@/models/SystemWebhook.js'; import { MiChannel } from '@/models/Channel.js'; import { MiRetentionAggregation } from '@/models/RetentionAggregation.js'; import { MiRole } from '@/models/Role.js'; @@ -76,18 +76,14 @@ 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 { MiBubbleGameRecord } from '@/models/BubbleGameRecord.js'; -import { MiReversiGame } from '@/models/ReversiGame.js'; import { Config } from '@/config.js'; import MisskeyLogger from '@/logger.js'; import { bindThis } from '@/decorators.js'; -pg.types.setTypeParser(20, Number); - export const dbLogger = new MisskeyLogger('db'); -const sqlLogger = dbLogger.createSubLogger('sql', 'gray'); +const sqlLogger = dbLogger.createSubLogger('sql', 'gray', false); class MyCustomLogger implements Logger { @bindThis @@ -169,7 +165,6 @@ export const entities = [ MiHashtag, MiSwSubscription, MiAbuseUserReport, - MiAbuseReportNotificationRecipient, MiRegistrationTicket, MiSignin, MiModerationLog, @@ -188,7 +183,6 @@ export const entities = [ MiPasswordResetRequest, MiUserPending, MiWebhook, - MiSystemWebhook, MiUserIp, MiRetentionAggregation, MiRole, @@ -196,8 +190,6 @@ export const entities = [ MiFlash, MiFlashLike, MiUserMemo, - MiBubbleGameRecord, - MiReversiGame, ...charts, ]; @@ -215,24 +207,22 @@ export function createPostgresDataSource(config: Config) { statement_timeout: 1000 * 10, ...config.db.extra, }, - ...(config.dbReplications ? { - replication: { - master: { - host: config.db.host, - port: config.db.port, - username: config.db.user, - password: config.db.pass, - database: config.db.db, - }, - slaves: config.dbSlaves!.map(rep => ({ - host: rep.host, - port: rep.port, - username: rep.user, - password: rep.pass, - database: rep.db, - })), + replication: config.dbReplications ? { + master: { + host: config.db.host, + port: config.db.port, + username: config.db.user, + password: config.db.pass, + database: config.db.db, }, - } : {}), + slaves: config.dbSlaves!.map(rep => ({ + host: rep.host, + port: rep.port, + username: rep.user, + password: rep.pass, + database: rep.db, + })), + } : undefined, synchronize: process.env.NODE_ENV === 'test', dropSchema: process.env.NODE_ENV === 'test', cache: !config.db.disableCache && process.env.NODE_ENV !== 'test' ? { // dbをcloseしても何故かredisのコネクションが内部的に残り続けるようで、テストの際に支障が出るため無効にする(キャッシュも含めてテストしたいため本当は有効にしたいが...) diff --git a/packages/backend/src/queue/QueueLoggerService.ts b/packages/backend/src/queue/QueueLoggerService.ts index 65869afd46..618d1d5c2f 100644 --- a/packages/backend/src/queue/QueueLoggerService.ts +++ b/packages/backend/src/queue/QueueLoggerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/queue/QueueProcessorModule.ts b/packages/backend/src/queue/QueueProcessorModule.ts index 9044285bf6..e6327002c5 100644 --- a/packages/backend/src/queue/QueueProcessorModule.ts +++ b/packages/backend/src/queue/QueueProcessorModule.ts @@ -1,21 +1,18 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Module } from '@nestjs/common'; import { CoreModule } from '@/core/CoreModule.js'; import { GlobalModule } from '@/GlobalModule.js'; -import { CheckModeratorsActivityProcessorService } from '@/queue/processors/CheckModeratorsActivityProcessorService.js'; import { QueueLoggerService } from './QueueLoggerService.js'; import { QueueProcessorService } from './QueueProcessorService.js'; import { DeliverProcessorService } from './processors/DeliverProcessorService.js'; import { EndedPollNotificationProcessorService } from './processors/EndedPollNotificationProcessorService.js'; import { InboxProcessorService } from './processors/InboxProcessorService.js'; -import { UserWebhookDeliverProcessorService } from './processors/UserWebhookDeliverProcessorService.js'; -import { SystemWebhookDeliverProcessorService } from './processors/SystemWebhookDeliverProcessorService.js'; +import { WebhookDeliverProcessorService } from './processors/WebhookDeliverProcessorService.js'; import { CheckExpiredMutingsProcessorService } from './processors/CheckExpiredMutingsProcessorService.js'; -import { BakeBufferedReactionsProcessorService } from './processors/BakeBufferedReactionsProcessorService.js'; import { CleanChartsProcessorService } from './processors/CleanChartsProcessorService.js'; import { CleanProcessorService } from './processors/CleanProcessorService.js'; import { CleanRemoteFilesProcessorService } from './processors/CleanRemoteFilesProcessorService.js'; @@ -27,7 +24,6 @@ import { ExportCustomEmojisProcessorService } from './processors/ExportCustomEmo import { ExportFollowingProcessorService } from './processors/ExportFollowingProcessorService.js'; import { ExportMutingProcessorService } from './processors/ExportMutingProcessorService.js'; import { ExportNotesProcessorService } from './processors/ExportNotesProcessorService.js'; -import { ExportClipsProcessorService } from './processors/ExportClipsProcessorService.js'; import { ExportUserListsProcessorService } from './processors/ExportUserListsProcessorService.js'; import { ExportAntennasProcessorService } from './processors/ExportAntennasProcessorService.js'; import { ImportBlockingProcessorService } from './processors/ImportBlockingProcessorService.js'; @@ -53,12 +49,10 @@ import { RelationshipProcessorService } from './processors/RelationshipProcessor ResyncChartsProcessorService, CleanChartsProcessorService, CheckExpiredMutingsProcessorService, - BakeBufferedReactionsProcessorService, CleanProcessorService, DeleteDriveFilesProcessorService, ExportCustomEmojisProcessorService, ExportNotesProcessorService, - ExportClipsProcessorService, ExportFavoritesProcessorService, ExportFollowingProcessorService, ExportMutingProcessorService, @@ -75,14 +69,11 @@ import { RelationshipProcessorService } from './processors/RelationshipProcessor DeleteFileProcessorService, CleanRemoteFilesProcessorService, RelationshipProcessorService, - UserWebhookDeliverProcessorService, - SystemWebhookDeliverProcessorService, + WebhookDeliverProcessorService, EndedPollNotificationProcessorService, DeliverProcessorService, InboxProcessorService, AggregateRetentionProcessorService, - CheckExpiredMutingsProcessorService, - CheckModeratorsActivityProcessorService, QueueProcessorService, ], exports: [ diff --git a/packages/backend/src/queue/QueueProcessorService.ts b/packages/backend/src/queue/QueueProcessorService.ts index 6940e1c188..b872dd65f7 100644 --- a/packages/backend/src/queue/QueueProcessorService.ts +++ b/packages/backend/src/queue/QueueProcessorService.ts @@ -1,25 +1,21 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; import * as Bull from 'bullmq'; -import * as Sentry from '@sentry/node'; import type { Config } from '@/config.js'; import { DI } from '@/di-symbols.js'; import type Logger from '@/logger.js'; import { bindThis } from '@/decorators.js'; -import { CheckModeratorsActivityProcessorService } from '@/queue/processors/CheckModeratorsActivityProcessorService.js'; -import { UserWebhookDeliverProcessorService } from './processors/UserWebhookDeliverProcessorService.js'; -import { SystemWebhookDeliverProcessorService } from './processors/SystemWebhookDeliverProcessorService.js'; +import { WebhookDeliverProcessorService } from './processors/WebhookDeliverProcessorService.js'; import { EndedPollNotificationProcessorService } from './processors/EndedPollNotificationProcessorService.js'; import { DeliverProcessorService } from './processors/DeliverProcessorService.js'; import { InboxProcessorService } from './processors/InboxProcessorService.js'; import { DeleteDriveFilesProcessorService } from './processors/DeleteDriveFilesProcessorService.js'; import { ExportCustomEmojisProcessorService } from './processors/ExportCustomEmojisProcessorService.js'; import { ExportNotesProcessorService } from './processors/ExportNotesProcessorService.js'; -import { ExportClipsProcessorService } from './processors/ExportClipsProcessorService.js'; import { ExportFollowingProcessorService } from './processors/ExportFollowingProcessorService.js'; import { ExportMutingProcessorService } from './processors/ExportMutingProcessorService.js'; import { ExportBlockingProcessorService } from './processors/ExportBlockingProcessorService.js'; @@ -40,7 +36,6 @@ import { TickChartsProcessorService } from './processors/TickChartsProcessorServ import { ResyncChartsProcessorService } from './processors/ResyncChartsProcessorService.js'; import { CleanChartsProcessorService } from './processors/CleanChartsProcessorService.js'; import { CheckExpiredMutingsProcessorService } from './processors/CheckExpiredMutingsProcessorService.js'; -import { BakeBufferedReactionsProcessorService } from './processors/BakeBufferedReactionsProcessorService.js'; import { CleanProcessorService } from './processors/CleanProcessorService.js'; import { AggregateRetentionProcessorService } from './processors/AggregateRetentionProcessorService.js'; import { QueueLoggerService } from './QueueLoggerService.js'; @@ -67,7 +62,7 @@ function getJobInfo(job: Bull.Job | undefined, increment = false): string { // onActiveとかonCompletedのattemptsMadeがなぜか0始まりなのでインクリメントする const currentAttempts = job.attemptsMade + (increment ? 1 : 0); - const maxAttempts = job.opts.attempts ?? 0; + const maxAttempts = job.opts ? job.opts.attempts : 0; return `id=${job.id} attempts=${currentAttempts}/${maxAttempts} age=${formated}`; } @@ -79,8 +74,7 @@ export class QueueProcessorService implements OnApplicationShutdown { private dbQueueWorker: Bull.Worker; private deliverQueueWorker: Bull.Worker; private inboxQueueWorker: Bull.Worker; - private userWebhookDeliverQueueWorker: Bull.Worker; - private systemWebhookDeliverQueueWorker: Bull.Worker; + private webhookDeliverQueueWorker: Bull.Worker; private relationshipQueueWorker: Bull.Worker; private objectStorageQueueWorker: Bull.Worker; private endedPollNotificationQueueWorker: Bull.Worker; @@ -90,15 +84,13 @@ export class QueueProcessorService implements OnApplicationShutdown { private config: Config, private queueLoggerService: QueueLoggerService, - private userWebhookDeliverProcessorService: UserWebhookDeliverProcessorService, - private systemWebhookDeliverProcessorService: SystemWebhookDeliverProcessorService, + private webhookDeliverProcessorService: WebhookDeliverProcessorService, private endedPollNotificationProcessorService: EndedPollNotificationProcessorService, private deliverProcessorService: DeliverProcessorService, private inboxProcessorService: InboxProcessorService, private deleteDriveFilesProcessorService: DeleteDriveFilesProcessorService, private exportCustomEmojisProcessorService: ExportCustomEmojisProcessorService, private exportNotesProcessorService: ExportNotesProcessorService, - private exportClipsProcessorService: ExportClipsProcessorService, private exportFavoritesProcessorService: ExportFavoritesProcessorService, private exportFollowingProcessorService: ExportFollowingProcessorService, private exportMutingProcessorService: ExportMutingProcessorService, @@ -120,402 +112,219 @@ export class QueueProcessorService implements OnApplicationShutdown { private cleanChartsProcessorService: CleanChartsProcessorService, private aggregateRetentionProcessorService: AggregateRetentionProcessorService, private checkExpiredMutingsProcessorService: CheckExpiredMutingsProcessorService, - private bakeBufferedReactionsProcessorService: BakeBufferedReactionsProcessorService, - private checkModeratorsActivityProcessorService: CheckModeratorsActivityProcessorService, private cleanProcessorService: CleanProcessorService, ) { this.logger = this.queueLoggerService.logger; - function renderError(e?: Error) { - // 何故かeがundefinedで来ることがある - if (!e) return '?'; - - if (e instanceof Bull.UnrecoverableError || e.name === 'AbortError') { - return `${e.name}: ${e.message}`; + function renderError(e: Error): any { + if (e) { // 何故かeがundefinedで来ることがある + return { + stack: e.stack, + message: e.message, + name: e.name, + }; + } else { + return { + stack: '?', + message: '?', + name: '?', + }; } - - return { - stack: e.stack, - message: e.message, - name: e.name, - }; - } - - function renderJob(job?: Bull.Job) { - if (!job) return '?'; - - return { - name: job.name || undefined, - info: getJobInfo(job), - failedReason: job.failedReason || undefined, - data: job.data, - }; } //#region system - { - const processer = (job: Bull.Job) => { - switch (job.name) { - case 'tickCharts': return this.tickChartsProcessorService.process(); - case 'resyncCharts': return this.resyncChartsProcessorService.process(); - case 'cleanCharts': return this.cleanChartsProcessorService.process(); - case 'aggregateRetention': return this.aggregateRetentionProcessorService.process(); - case 'checkExpiredMutings': return this.checkExpiredMutingsProcessorService.process(); - case 'bakeBufferedReactions': return this.bakeBufferedReactionsProcessorService.process(); - case 'checkModeratorsActivity': return this.checkModeratorsActivityProcessorService.process(); - case 'clean': return this.cleanProcessorService.process(); - default: throw new Error(`unrecognized job type ${job.name} for system`); - } - }; + this.systemQueueWorker = new Bull.Worker(QUEUE.SYSTEM, (job) => { + switch (job.name) { + case 'tickCharts': return this.tickChartsProcessorService.process(); + case 'resyncCharts': return this.resyncChartsProcessorService.process(); + case 'cleanCharts': return this.cleanChartsProcessorService.process(); + case 'aggregateRetention': return this.aggregateRetentionProcessorService.process(); + case 'checkExpiredMutings': return this.checkExpiredMutingsProcessorService.process(); + case 'clean': return this.cleanProcessorService.process(); + default: throw new Error(`unrecognized job type ${job.name} for system`); + } + }, { + ...baseQueueOptions(this.config, QUEUE.SYSTEM), + autorun: false, + }); - this.systemQueueWorker = new Bull.Worker(QUEUE.SYSTEM, (job) => { - if (this.config.sentryForBackend) { - return Sentry.startSpan({ name: 'Queue: System: ' + job.name }, () => processer(job)); - } else { - return processer(job); - } - }, { - ...baseQueueOptions(this.config, QUEUE.SYSTEM), - autorun: false, - }); + const systemLogger = this.logger.createSubLogger('system'); - const logger = this.logger.createSubLogger('system'); - - this.systemQueueWorker - .on('active', (job) => logger.debug(`active id=${job.id}`)) - .on('completed', (job, result) => logger.debug(`completed(${result}) id=${job.id}`)) - .on('failed', (job, err: Error) => { - logger.error(`failed(${err.name}: ${err.message}) id=${job?.id ?? '?'}`, { job: renderJob(job), e: renderError(err) }); - if (config.sentryForBackend) { - Sentry.captureMessage(`Queue: System: ${job?.name ?? '?'}: ${err.name}: ${err.message}`, { - level: 'error', - extra: { job, err }, - }); - } - }) - .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) })) - .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); - } + this.systemQueueWorker + .on('active', (job) => systemLogger.debug(`active id=${job.id}`)) + .on('completed', (job, result) => systemLogger.debug(`completed(${result}) id=${job.id}`)) + .on('failed', (job, err) => systemLogger.warn(`failed(${err.stack}) id=${job ? job.id : '-'}`, { job, e: renderError(err) })) + .on('error', (err: Error) => systemLogger.error(`error ${err.stack}`, { e: renderError(err) })) + .on('stalled', (jobId) => systemLogger.warn(`stalled id=${jobId}`)); //#endregion //#region db - { - const processer = (job: Bull.Job) => { - switch (job.name) { - case 'deleteDriveFiles': return this.deleteDriveFilesProcessorService.process(job); - case 'exportCustomEmojis': return this.exportCustomEmojisProcessorService.process(job); - case 'exportNotes': return this.exportNotesProcessorService.process(job); - case 'exportClips': return this.exportClipsProcessorService.process(job); - case 'exportFavorites': return this.exportFavoritesProcessorService.process(job); - case 'exportFollowing': return this.exportFollowingProcessorService.process(job); - case 'exportMuting': return this.exportMutingProcessorService.process(job); - case 'exportBlocking': return this.exportBlockingProcessorService.process(job); - case 'exportUserLists': return this.exportUserListsProcessorService.process(job); - case 'exportAntennas': return this.exportAntennasProcessorService.process(job); - case 'importFollowing': return this.importFollowingProcessorService.process(job); - case 'importFollowingToDb': return this.importFollowingProcessorService.processDb(job); - case 'importMuting': return this.importMutingProcessorService.process(job); - case 'importBlocking': return this.importBlockingProcessorService.process(job); - case 'importBlockingToDb': return this.importBlockingProcessorService.processDb(job); - case 'importUserLists': return this.importUserListsProcessorService.process(job); - case 'importCustomEmojis': return this.importCustomEmojisProcessorService.process(job); - case 'importAntennas': return this.importAntennasProcessorService.process(job); - case 'deleteAccount': return this.deleteAccountProcessorService.process(job); - default: throw new Error(`unrecognized job type ${job.name} for db`); - } - }; + this.dbQueueWorker = new Bull.Worker(QUEUE.DB, (job) => { + switch (job.name) { + case 'deleteDriveFiles': return this.deleteDriveFilesProcessorService.process(job); + case 'exportCustomEmojis': return this.exportCustomEmojisProcessorService.process(job); + case 'exportNotes': return this.exportNotesProcessorService.process(job); + case 'exportFavorites': return this.exportFavoritesProcessorService.process(job); + case 'exportFollowing': return this.exportFollowingProcessorService.process(job); + case 'exportMuting': return this.exportMutingProcessorService.process(job); + case 'exportBlocking': return this.exportBlockingProcessorService.process(job); + case 'exportUserLists': return this.exportUserListsProcessorService.process(job); + case 'exportAntennas': return this.exportAntennasProcessorService.process(job); + case 'importFollowing': return this.importFollowingProcessorService.process(job); + case 'importFollowingToDb': return this.importFollowingProcessorService.processDb(job); + case 'importMuting': return this.importMutingProcessorService.process(job); + case 'importBlocking': return this.importBlockingProcessorService.process(job); + case 'importBlockingToDb': return this.importBlockingProcessorService.processDb(job); + case 'importUserLists': return this.importUserListsProcessorService.process(job); + case 'importCustomEmojis': return this.importCustomEmojisProcessorService.process(job); + case 'importAntennas': return this.importAntennasProcessorService.process(job); + case 'deleteAccount': return this.deleteAccountProcessorService.process(job); + default: throw new Error(`unrecognized job type ${job.name} for db`); + } + }, { + ...baseQueueOptions(this.config, QUEUE.DB), + autorun: false, + }); - this.dbQueueWorker = new Bull.Worker(QUEUE.DB, (job) => { - if (this.config.sentryForBackend) { - return Sentry.startSpan({ name: 'Queue: DB: ' + job.name }, () => processer(job)); - } else { - return processer(job); - } - }, { - ...baseQueueOptions(this.config, QUEUE.DB), - autorun: false, - }); + const dbLogger = this.logger.createSubLogger('db'); - const logger = this.logger.createSubLogger('db'); - - this.dbQueueWorker - .on('active', (job) => logger.debug(`active id=${job.id}`)) - .on('completed', (job, result) => logger.debug(`completed(${result}) id=${job.id}`)) - .on('failed', (job, err) => { - logger.error(`failed(${err.name}: ${err.message}) id=${job?.id ?? '?'}`, { job: renderJob(job), e: renderError(err) }); - if (config.sentryForBackend) { - Sentry.captureMessage(`Queue: DB: ${job?.name ?? '?'}: ${err.name}: ${err.message}`, { - level: 'error', - extra: { job, err }, - }); - } - }) - .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) })) - .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); - } + this.dbQueueWorker + .on('active', (job) => dbLogger.debug(`active id=${job.id}`)) + .on('completed', (job, result) => dbLogger.debug(`completed(${result}) id=${job.id}`)) + .on('failed', (job, err) => dbLogger.warn(`failed(${err.stack}) id=${job ? job.id : '-'}`, { job, e: renderError(err) })) + .on('error', (err: Error) => dbLogger.error(`error ${err.stack}`, { e: renderError(err) })) + .on('stalled', (jobId) => dbLogger.warn(`stalled id=${jobId}`)); //#endregion //#region deliver - { - this.deliverQueueWorker = new Bull.Worker(QUEUE.DELIVER, (job) => { - if (this.config.sentryForBackend) { - return Sentry.startSpan({ name: 'Queue: Deliver' }, () => this.deliverProcessorService.process(job)); - } else { - return this.deliverProcessorService.process(job); - } - }, { - ...baseQueueOptions(this.config, QUEUE.DELIVER), - autorun: false, - concurrency: this.config.deliverJobConcurrency ?? 128, - limiter: { - max: this.config.deliverJobPerSec ?? 128, - duration: 1000, - }, - settings: { - backoffStrategy: httpRelatedBackoff, - }, - }); + this.deliverQueueWorker = new Bull.Worker(QUEUE.DELIVER, (job) => this.deliverProcessorService.process(job), { + ...baseQueueOptions(this.config, QUEUE.DELIVER), + autorun: false, + concurrency: this.config.deliverJobConcurrency ?? 128, + limiter: { + max: this.config.deliverJobPerSec ?? 128, + duration: 1000, + }, + settings: { + backoffStrategy: httpRelatedBackoff, + }, + }); - const logger = this.logger.createSubLogger('deliver'); + const deliverLogger = this.logger.createSubLogger('deliver'); - this.deliverQueueWorker - .on('active', (job) => logger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`)) - .on('completed', (job, result) => logger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`)) - .on('failed', (job, err) => { - logger.error(`failed(${err.name}: ${err.message}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`); - if (config.sentryForBackend) { - Sentry.captureMessage(`Queue: Deliver: ${err.name}: ${err.message}`, { - level: 'error', - extra: { job, err }, - }); - } - }) - .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) })) - .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); - } + this.deliverQueueWorker + .on('active', (job) => deliverLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`)) + .on('completed', (job, result) => deliverLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`)) + .on('failed', (job, err) => deliverLogger.warn(`failed(${err.stack}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`)) + .on('error', (err: Error) => deliverLogger.error(`error ${err.stack}`, { e: renderError(err) })) + .on('stalled', (jobId) => deliverLogger.warn(`stalled id=${jobId}`)); //#endregion //#region inbox - { - this.inboxQueueWorker = new Bull.Worker(QUEUE.INBOX, (job) => { - if (this.config.sentryForBackend) { - return Sentry.startSpan({ name: 'Queue: Inbox' }, () => this.inboxProcessorService.process(job)); - } else { - return this.inboxProcessorService.process(job); - } - }, { - ...baseQueueOptions(this.config, QUEUE.INBOX), - autorun: false, - concurrency: this.config.inboxJobConcurrency ?? 16, - limiter: { - max: this.config.inboxJobPerSec ?? 32, - duration: 1000, - }, - settings: { - backoffStrategy: httpRelatedBackoff, - }, - }); + this.inboxQueueWorker = new Bull.Worker(QUEUE.INBOX, (job) => this.inboxProcessorService.process(job), { + ...baseQueueOptions(this.config, QUEUE.INBOX), + autorun: false, + concurrency: this.config.inboxJobConcurrency ?? 16, + limiter: { + max: this.config.inboxJobPerSec ?? 32, + duration: 1000, + }, + settings: { + backoffStrategy: httpRelatedBackoff, + }, + }); - const logger = this.logger.createSubLogger('inbox'); + const inboxLogger = this.logger.createSubLogger('inbox'); - this.inboxQueueWorker - .on('active', (job) => logger.debug(`active ${getJobInfo(job, true)}`)) - .on('completed', (job, result) => logger.debug(`completed(${result}) ${getJobInfo(job, true)}`)) - .on('failed', (job, err) => { - logger.error(`failed(${err.name}: ${err.message}) ${getJobInfo(job)} activity=${job ? (job.data.activity ? job.data.activity.id : 'none') : '-'}`, { job: renderJob(job), e: renderError(err) }); - if (config.sentryForBackend) { - Sentry.captureMessage(`Queue: Inbox: ${err.name}: ${err.message}`, { - level: 'error', - extra: { job, err }, - }); - } - }) - .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) })) - .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); - } + this.inboxQueueWorker + .on('active', (job) => inboxLogger.debug(`active ${getJobInfo(job, true)}`)) + .on('completed', (job, result) => inboxLogger.debug(`completed(${result}) ${getJobInfo(job, true)}`)) + .on('failed', (job, err) => inboxLogger.warn(`failed(${err.stack}) ${getJobInfo(job)} activity=${job ? (job.data.activity ? job.data.activity.id : 'none') : '-'}`, { job, e: renderError(err) })) + .on('error', (err: Error) => inboxLogger.error(`error ${err.stack}`, { e: renderError(err) })) + .on('stalled', (jobId) => inboxLogger.warn(`stalled id=${jobId}`)); //#endregion - //#region user-webhook deliver - { - this.userWebhookDeliverQueueWorker = new Bull.Worker(QUEUE.USER_WEBHOOK_DELIVER, (job) => { - if (this.config.sentryForBackend) { - return Sentry.startSpan({ name: 'Queue: UserWebhookDeliver' }, () => this.userWebhookDeliverProcessorService.process(job)); - } else { - return this.userWebhookDeliverProcessorService.process(job); - } - }, { - ...baseQueueOptions(this.config, QUEUE.USER_WEBHOOK_DELIVER), - autorun: false, - concurrency: 64, - limiter: { - max: 64, - duration: 1000, - }, - settings: { - backoffStrategy: httpRelatedBackoff, - }, - }); + //#region webhook deliver + this.webhookDeliverQueueWorker = new Bull.Worker(QUEUE.WEBHOOK_DELIVER, (job) => this.webhookDeliverProcessorService.process(job), { + ...baseQueueOptions(this.config, QUEUE.WEBHOOK_DELIVER), + autorun: false, + concurrency: 64, + limiter: { + max: 64, + duration: 1000, + }, + settings: { + backoffStrategy: httpRelatedBackoff, + }, + }); - const logger = this.logger.createSubLogger('user-webhook'); + const webhookLogger = this.logger.createSubLogger('webhook'); - this.userWebhookDeliverQueueWorker - .on('active', (job) => logger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`)) - .on('completed', (job, result) => logger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`)) - .on('failed', (job, err) => { - logger.error(`failed(${err.name}: ${err.message}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`); - if (config.sentryForBackend) { - Sentry.captureMessage(`Queue: UserWebhookDeliver: ${err.name}: ${err.message}`, { - level: 'error', - extra: { job, err }, - }); - } - }) - .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) })) - .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); - } - //#endregion - - //#region system-webhook deliver - { - this.systemWebhookDeliverQueueWorker = new Bull.Worker(QUEUE.SYSTEM_WEBHOOK_DELIVER, (job) => { - if (this.config.sentryForBackend) { - return Sentry.startSpan({ name: 'Queue: SystemWebhookDeliver' }, () => this.systemWebhookDeliverProcessorService.process(job)); - } else { - return this.systemWebhookDeliverProcessorService.process(job); - } - }, { - ...baseQueueOptions(this.config, QUEUE.SYSTEM_WEBHOOK_DELIVER), - autorun: false, - concurrency: 16, - limiter: { - max: 16, - duration: 1000, - }, - settings: { - backoffStrategy: httpRelatedBackoff, - }, - }); - - const logger = this.logger.createSubLogger('system-webhook'); - - this.systemWebhookDeliverQueueWorker - .on('active', (job) => logger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`)) - .on('completed', (job, result) => logger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`)) - .on('failed', (job, err) => { - logger.error(`failed(${err.name}: ${err.message}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`); - if (config.sentryForBackend) { - Sentry.captureMessage(`Queue: SystemWebhookDeliver: ${err.name}: ${err.message}`, { - level: 'error', - extra: { job, err }, - }); - } - }) - .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) })) - .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); - } + this.webhookDeliverQueueWorker + .on('active', (job) => webhookLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`)) + .on('completed', (job, result) => webhookLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`)) + .on('failed', (job, err) => webhookLogger.warn(`failed(${err.stack}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`)) + .on('error', (err: Error) => webhookLogger.error(`error ${err.stack}`, { e: renderError(err) })) + .on('stalled', (jobId) => webhookLogger.warn(`stalled id=${jobId}`)); //#endregion //#region relationship - { - const processer = (job: Bull.Job) => { - switch (job.name) { - case 'follow': return this.relationshipProcessorService.processFollow(job); - case 'unfollow': return this.relationshipProcessorService.processUnfollow(job); - case 'block': return this.relationshipProcessorService.processBlock(job); - case 'unblock': return this.relationshipProcessorService.processUnblock(job); - default: throw new Error(`unrecognized job type ${job.name} for relationship`); - } - }; + this.relationshipQueueWorker = new Bull.Worker(QUEUE.RELATIONSHIP, (job) => { + switch (job.name) { + case 'follow': return this.relationshipProcessorService.processFollow(job); + case 'unfollow': return this.relationshipProcessorService.processUnfollow(job); + case 'block': return this.relationshipProcessorService.processBlock(job); + case 'unblock': return this.relationshipProcessorService.processUnblock(job); + default: throw new Error(`unrecognized job type ${job.name} for relationship`); + } + }, { + ...baseQueueOptions(this.config, QUEUE.RELATIONSHIP), + autorun: false, + concurrency: this.config.relashionshipJobConcurrency ?? 16, + limiter: { + max: this.config.relashionshipJobPerSec ?? 64, + duration: 1000, + }, + }); - this.relationshipQueueWorker = new Bull.Worker(QUEUE.RELATIONSHIP, (job) => { - if (this.config.sentryForBackend) { - return Sentry.startSpan({ name: 'Queue: Relationship: ' + job.name }, () => processer(job)); - } else { - return processer(job); - } - }, { - ...baseQueueOptions(this.config, QUEUE.RELATIONSHIP), - autorun: false, - concurrency: this.config.relationshipJobConcurrency ?? 16, - limiter: { - max: this.config.relationshipJobPerSec ?? 64, - duration: 1000, - }, - }); + const relationshipLogger = this.logger.createSubLogger('relationship'); - const logger = this.logger.createSubLogger('relationship'); - - this.relationshipQueueWorker - .on('active', (job) => logger.debug(`active id=${job.id}`)) - .on('completed', (job, result) => logger.debug(`completed(${result}) id=${job.id}`)) - .on('failed', (job, err) => { - logger.error(`failed(${err.name}: ${err.message}) id=${job?.id ?? '?'}`, { job: renderJob(job), e: renderError(err) }); - if (config.sentryForBackend) { - Sentry.captureMessage(`Queue: Relationship: ${job?.name ?? '?'}: ${err.name}: ${err.message}`, { - level: 'error', - extra: { job, err }, - }); - } - }) - .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) })) - .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); - } + this.relationshipQueueWorker + .on('active', (job) => relationshipLogger.debug(`active id=${job.id}`)) + .on('completed', (job, result) => relationshipLogger.debug(`completed(${result}) id=${job.id}`)) + .on('failed', (job, err) => relationshipLogger.warn(`failed(${err.stack}) id=${job ? job.id : '-'}`, { job, e: renderError(err) })) + .on('error', (err: Error) => relationshipLogger.error(`error ${err.stack}`, { e: renderError(err) })) + .on('stalled', (jobId) => relationshipLogger.warn(`stalled id=${jobId}`)); //#endregion //#region object storage - { - const processer = (job: Bull.Job) => { - switch (job.name) { - case 'deleteFile': return this.deleteFileProcessorService.process(job); - case 'cleanRemoteFiles': return this.cleanRemoteFilesProcessorService.process(job); - default: throw new Error(`unrecognized job type ${job.name} for objectStorage`); - } - }; + this.objectStorageQueueWorker = new Bull.Worker(QUEUE.OBJECT_STORAGE, (job) => { + switch (job.name) { + case 'deleteFile': return this.deleteFileProcessorService.process(job); + case 'cleanRemoteFiles': return this.cleanRemoteFilesProcessorService.process(job); + default: throw new Error(`unrecognized job type ${job.name} for objectStorage`); + } + }, { + ...baseQueueOptions(this.config, QUEUE.OBJECT_STORAGE), + autorun: false, + concurrency: 16, + }); - this.objectStorageQueueWorker = new Bull.Worker(QUEUE.OBJECT_STORAGE, (job) => { - if (this.config.sentryForBackend) { - return Sentry.startSpan({ name: 'Queue: ObjectStorage: ' + job.name }, () => processer(job)); - } else { - return processer(job); - } - }, { - ...baseQueueOptions(this.config, QUEUE.OBJECT_STORAGE), - autorun: false, - concurrency: 16, - }); + const objectStorageLogger = this.logger.createSubLogger('objectStorage'); - const logger = this.logger.createSubLogger('objectStorage'); - - this.objectStorageQueueWorker - .on('active', (job) => logger.debug(`active id=${job.id}`)) - .on('completed', (job, result) => logger.debug(`completed(${result}) id=${job.id}`)) - .on('failed', (job, err) => { - logger.error(`failed(${err.name}: ${err.message}) id=${job?.id ?? '?'}`, { job: renderJob(job), e: renderError(err) }); - if (config.sentryForBackend) { - Sentry.captureMessage(`Queue: ObjectStorage: ${job?.name ?? '?'}: ${err.name}: ${err.message}`, { - level: 'error', - extra: { job, err }, - }); - } - }) - .on('error', (err: Error) => logger.error(`error ${err.name}: ${err.message}`, { e: renderError(err) })) - .on('stalled', (jobId) => logger.warn(`stalled id=${jobId}`)); - } + this.objectStorageQueueWorker + .on('active', (job) => objectStorageLogger.debug(`active id=${job.id}`)) + .on('completed', (job, result) => objectStorageLogger.debug(`completed(${result}) id=${job.id}`)) + .on('failed', (job, err) => objectStorageLogger.warn(`failed(${err.stack}) id=${job ? job.id : '-'}`, { job, e: renderError(err) })) + .on('error', (err: Error) => objectStorageLogger.error(`error ${err.stack}`, { e: renderError(err) })) + .on('stalled', (jobId) => objectStorageLogger.warn(`stalled id=${jobId}`)); //#endregion //#region ended poll notification - { - this.endedPollNotificationQueueWorker = new Bull.Worker(QUEUE.ENDED_POLL_NOTIFICATION, (job) => { - if (this.config.sentryForBackend) { - return Sentry.startSpan({ name: 'Queue: EndedPollNotification' }, () => this.endedPollNotificationProcessorService.process(job)); - } else { - return this.endedPollNotificationProcessorService.process(job); - } - }, { - ...baseQueueOptions(this.config, QUEUE.ENDED_POLL_NOTIFICATION), - autorun: false, - }); - } + this.endedPollNotificationQueueWorker = new Bull.Worker(QUEUE.ENDED_POLL_NOTIFICATION, (job) => this.endedPollNotificationProcessorService.process(job), { + ...baseQueueOptions(this.config, QUEUE.ENDED_POLL_NOTIFICATION), + autorun: false, + }); //#endregion } @@ -526,8 +335,7 @@ export class QueueProcessorService implements OnApplicationShutdown { this.dbQueueWorker.run(), this.deliverQueueWorker.run(), this.inboxQueueWorker.run(), - this.userWebhookDeliverQueueWorker.run(), - this.systemWebhookDeliverQueueWorker.run(), + this.webhookDeliverQueueWorker.run(), this.relationshipQueueWorker.run(), this.objectStorageQueueWorker.run(), this.endedPollNotificationQueueWorker.run(), @@ -541,8 +349,7 @@ export class QueueProcessorService implements OnApplicationShutdown { this.dbQueueWorker.close(), this.deliverQueueWorker.close(), this.inboxQueueWorker.close(), - this.userWebhookDeliverQueueWorker.close(), - this.systemWebhookDeliverQueueWorker.close(), + this.webhookDeliverQueueWorker.close(), this.relationshipQueueWorker.close(), this.objectStorageQueueWorker.close(), this.endedPollNotificationQueueWorker.close(), diff --git a/packages/backend/src/queue/const.ts b/packages/backend/src/queue/const.ts index 67f689b618..87d075304d 100644 --- a/packages/backend/src/queue/const.ts +++ b/packages/backend/src/queue/const.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -14,8 +14,7 @@ export const QUEUE = { DB: 'db', RELATIONSHIP: 'relationship', OBJECT_STORAGE: 'objectStorage', - USER_WEBHOOK_DELIVER: 'userWebhookDeliver', - SYSTEM_WEBHOOK_DELIVER: 'systemWebhookDeliver', + WEBHOOK_DELIVER: 'webhookDeliver', }; export function baseQueueOptions(config: Config, queueName: typeof QUEUE[keyof typeof QUEUE]): Bull.QueueOptions { diff --git a/packages/backend/src/queue/processors/AggregateRetentionProcessorService.ts b/packages/backend/src/queue/processors/AggregateRetentionProcessorService.ts index 4769cccabf..9f49d85c7f 100644 --- a/packages/backend/src/queue/processors/AggregateRetentionProcessorService.ts +++ b/packages/backend/src/queue/processors/AggregateRetentionProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/queue/processors/BakeBufferedReactionsProcessorService.ts b/packages/backend/src/queue/processors/BakeBufferedReactionsProcessorService.ts deleted file mode 100644 index d49c99f694..0000000000 --- a/packages/backend/src/queue/processors/BakeBufferedReactionsProcessorService.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import type Logger from '@/logger.js'; -import { bindThis } from '@/decorators.js'; -import { ReactionsBufferingService } from '@/core/ReactionsBufferingService.js'; -import { QueueLoggerService } from '../QueueLoggerService.js'; -import type * as Bull from 'bullmq'; -import { MiMeta } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; - -@Injectable() -export class BakeBufferedReactionsProcessorService { - private logger: Logger; - - constructor( - @Inject(DI.meta) - private meta: MiMeta, - - private reactionsBufferingService: ReactionsBufferingService, - private queueLoggerService: QueueLoggerService, - ) { - this.logger = this.queueLoggerService.logger.createSubLogger('bake-buffered-reactions'); - } - - @bindThis - public async process(): Promise { - if (!this.meta.enableReactionsBuffering) { - this.logger.info('Reactions buffering is disabled. Skipping...'); - return; - } - - this.logger.info('Baking buffered reactions...'); - - await this.reactionsBufferingService.bake(); - - this.logger.succ('All buffered reactions baked.'); - } -} diff --git a/packages/backend/src/queue/processors/CheckExpiredMutingsProcessorService.ts b/packages/backend/src/queue/processors/CheckExpiredMutingsProcessorService.ts index 448fc9c763..9b07389dc3 100644 --- a/packages/backend/src/queue/processors/CheckExpiredMutingsProcessorService.ts +++ b/packages/backend/src/queue/processors/CheckExpiredMutingsProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/queue/processors/CheckModeratorsActivityProcessorService.ts b/packages/backend/src/queue/processors/CheckModeratorsActivityProcessorService.ts deleted file mode 100644 index 87183cb342..0000000000 --- a/packages/backend/src/queue/processors/CheckModeratorsActivityProcessorService.ts +++ /dev/null @@ -1,292 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { In } from 'typeorm'; -import type Logger from '@/logger.js'; -import { bindThis } from '@/decorators.js'; -import { MetaService } from '@/core/MetaService.js'; -import { RoleService } from '@/core/RoleService.js'; -import { EmailService } from '@/core/EmailService.js'; -import { MiUser, type UserProfilesRepository } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; -import { AnnouncementService } from '@/core/AnnouncementService.js'; -import { QueueLoggerService } from '../QueueLoggerService.js'; - -// モデレーターが不在と判断する日付の閾値 -const MODERATOR_INACTIVITY_LIMIT_DAYS = 7; -// 警告通知やログ出力を行う残日数の閾値 -const MODERATOR_INACTIVITY_WARNING_REMAINING_DAYS = 2; -// 期限から6時間ごとに通知を行う -const MODERATOR_INACTIVITY_WARNING_NOTIFY_INTERVAL_HOURS = 6; -const ONE_HOUR_MILLI_SEC = 1000 * 60 * 60; -const ONE_DAY_MILLI_SEC = ONE_HOUR_MILLI_SEC * 24; - -export type ModeratorInactivityEvaluationResult = { - isModeratorsInactive: boolean; - inactiveModerators: MiUser[]; - remainingTime: ModeratorInactivityRemainingTime; -} - -export type ModeratorInactivityRemainingTime = { - time: number; - asHours: number; - asDays: number; -}; - -function generateModeratorInactivityMail(remainingTime: ModeratorInactivityRemainingTime) { - const subject = 'Moderator Inactivity Warning / モデレーター不在の通知'; - - const timeVariant = remainingTime.asDays === 0 ? `${remainingTime.asHours} hours` : `${remainingTime.asDays} days`; - const timeVariantJa = remainingTime.asDays === 0 ? `${remainingTime.asHours} 時間` : `${remainingTime.asDays} 日間`; - const message = [ - 'To Moderators,', - '', - `A moderator has been inactive for a period of time. If there are ${timeVariant} of inactivity left, it will switch to invitation only.`, - 'If you do not wish to move to invitation only, you must log into Misskey and update your last active date and time.', - '', - '---------------', - '', - 'To モデレーター各位', - '', - `モデレーターが一定期間活動していないようです。あと${timeVariantJa}活動していない状態が続くと招待制に切り替わります。`, - '招待制に切り替わることを望まない場合は、Misskeyにログインして最終アクティブ日時を更新してください。', - '', - ]; - - const html = message.join('
'); - const text = message.join('\n'); - - return { - subject, - html, - text, - }; -} - -function generateInvitationOnlyChangedMail() { - const subject = 'Change to Invitation-Only / 招待制に変更されました'; - - const message = [ - 'To Moderators,', - '', - `Changed to invitation only because no moderator activity was detected for ${MODERATOR_INACTIVITY_LIMIT_DAYS} days.`, - 'To cancel the invitation only, you need to access the control panel.', - '', - '---------------', - '', - 'To モデレーター各位', - '', - `モデレーターの活動が${MODERATOR_INACTIVITY_LIMIT_DAYS}日間検出されなかったため、招待制に変更されました。`, - '招待制を解除するには、コントロールパネルにアクセスする必要があります。', - '', - ]; - - const html = message.join('
'); - const text = message.join('\n'); - - return { - subject, - html, - text, - }; -} - -@Injectable() -export class CheckModeratorsActivityProcessorService { - private logger: Logger; - - constructor( - @Inject(DI.userProfilesRepository) - private userProfilesRepository: UserProfilesRepository, - private metaService: MetaService, - private roleService: RoleService, - private emailService: EmailService, - private announcementService: AnnouncementService, - private systemWebhookService: SystemWebhookService, - private queueLoggerService: QueueLoggerService, - ) { - this.logger = this.queueLoggerService.logger.createSubLogger('check-moderators-activity'); - } - - @bindThis - public async process(): Promise { - this.logger.info('start.'); - - const meta = await this.metaService.fetch(false); - if (!meta.disableRegistration) { - await this.processImpl(); - } else { - this.logger.info('is already invitation only.'); - } - - this.logger.succ('finish.'); - } - - @bindThis - private async processImpl() { - const evaluateResult = await this.evaluateModeratorsInactiveDays(); - if (evaluateResult.isModeratorsInactive) { - this.logger.warn(`The moderator has been inactive for ${MODERATOR_INACTIVITY_LIMIT_DAYS} days. We will move to invitation only.`); - - await this.changeToInvitationOnly(); - await this.notifyChangeToInvitationOnly(); - } else { - const remainingTime = evaluateResult.remainingTime; - if (remainingTime.asDays <= MODERATOR_INACTIVITY_WARNING_REMAINING_DAYS) { - const timeVariant = remainingTime.asDays === 0 ? `${remainingTime.asHours} hours` : `${remainingTime.asDays} days`; - this.logger.warn(`A moderator has been inactive for a period of time. If you are inactive for an additional ${timeVariant}, it will switch to invitation only.`); - - if (remainingTime.asHours % MODERATOR_INACTIVITY_WARNING_NOTIFY_INTERVAL_HOURS === 0) { - // ジョブの実行頻度と同等だと通知が多すぎるため期限から6時間ごとに通知する - // つまり、のこり2日を切ったら6時間ごとに通知が送られる - await this.notifyInactiveModeratorsWarning(remainingTime); - } - } - } - } - - /** - * モデレーターが不在であるかどうかを確認する。trueの場合はモデレーターが不在である。 - * isModerator, isAdministrator, isRootのいずれかがtrueのユーザを対象に、 - * {@link MiUser.lastActiveDate}の値が実行日時の{@link MODERATOR_INACTIVITY_LIMIT_DAYS}日前よりも古いユーザがいるかどうかを確認する。 - * {@link MiUser.lastActiveDate}がnullの場合は、そのユーザは確認の対象外とする。 - * - * ----- - * - * ### サンプルパターン - * - 実行日時: 2022-01-30 12:00:00 - * - 判定基準: 2022-01-23 12:00:00(実行日時の{@link MODERATOR_INACTIVITY_LIMIT_DAYS}日前) - * - * #### パターン① - * - モデレータA: lastActiveDate = 2022-01-20 00:00:00 ※アウト - * - モデレータB: lastActiveDate = 2022-01-23 12:00:00 ※セーフ(判定基準と同値なのでギリギリ残り0日) - * - モデレータC: lastActiveDate = 2022-01-23 11:59:59 ※アウト(残り-1日) - * - モデレータD: lastActiveDate = null - * - * この場合、モデレータBのアクティビティのみ判定基準日よりも古くないため、モデレーターが在席と判断される。 - * - * #### パターン② - * - モデレータA: lastActiveDate = 2022-01-20 00:00:00 ※アウト - * - モデレータB: lastActiveDate = 2022-01-22 12:00:00 ※アウト(残り-1日) - * - モデレータC: lastActiveDate = 2022-01-23 11:59:59 ※アウト(残り-1日) - * - モデレータD: lastActiveDate = null - * - * この場合、モデレータA, B, Cのアクティビティは判定基準日よりも古いため、モデレーターが不在と判断される。 - */ - @bindThis - public async evaluateModeratorsInactiveDays(): Promise { - const today = new Date(); - const inactivePeriod = new Date(today); - inactivePeriod.setDate(today.getDate() - MODERATOR_INACTIVITY_LIMIT_DAYS); - - const moderators = await this.fetchModerators() - .then(it => it.filter(it => it.lastActiveDate != null)); - const inactiveModerators = moderators - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - .filter(it => it.lastActiveDate!.getTime() < inactivePeriod.getTime()); - - // 残りの猶予を示したいので、最終アクティブ日時が一番若いモデレータの日数を基準に猶予を計算する - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const newestLastActiveDate = new Date(Math.max(...moderators.map(it => it.lastActiveDate!.getTime()))); - const remainingTime = newestLastActiveDate.getTime() - inactivePeriod.getTime(); - const remainingTimeAsDays = Math.floor(remainingTime / ONE_DAY_MILLI_SEC); - const remainingTimeAsHours = Math.floor((remainingTime / ONE_HOUR_MILLI_SEC)); - - return { - isModeratorsInactive: inactiveModerators.length === moderators.length, - inactiveModerators, - remainingTime: { - time: remainingTime, - asHours: remainingTimeAsHours, - asDays: remainingTimeAsDays, - }, - }; - } - - @bindThis - private async changeToInvitationOnly() { - await this.metaService.update({ disableRegistration: true }); - } - - @bindThis - public async notifyInactiveModeratorsWarning(remainingTime: ModeratorInactivityRemainingTime) { - // -- モデレータへのメール送信 - - const moderators = await this.fetchModerators(); - const moderatorProfiles = await this.userProfilesRepository - .findBy({ userId: In(moderators.map(it => it.id)) }) - .then(it => new Map(it.map(it => [it.userId, it]))); - - const mail = generateModeratorInactivityMail(remainingTime); - for (const moderator of moderators) { - const profile = moderatorProfiles.get(moderator.id); - if (profile && profile.email && profile.emailVerified) { - this.emailService.sendEmail(profile.email, mail.subject, mail.html, mail.text); - } - } - - // -- SystemWebhook - - const systemWebhooks = await this.systemWebhookService.fetchActiveSystemWebhooks() - .then(it => it.filter(it => it.on.includes('inactiveModeratorsWarning'))); - for (const systemWebhook of systemWebhooks) { - this.systemWebhookService.enqueueSystemWebhook( - systemWebhook, - 'inactiveModeratorsWarning', - { remainingTime: remainingTime }, - ); - } - } - - @bindThis - public async notifyChangeToInvitationOnly() { - // -- モデレータへのメールとお知らせ(個人向け)送信 - - const moderators = await this.fetchModerators(); - const moderatorProfiles = await this.userProfilesRepository - .findBy({ userId: In(moderators.map(it => it.id)) }) - .then(it => new Map(it.map(it => [it.userId, it]))); - - const mail = generateInvitationOnlyChangedMail(); - for (const moderator of moderators) { - this.announcementService.create({ - title: mail.subject, - text: mail.text, - forExistingUsers: true, - needConfirmationToRead: true, - userId: moderator.id, - }); - - const profile = moderatorProfiles.get(moderator.id); - if (profile && profile.email && profile.emailVerified) { - this.emailService.sendEmail(profile.email, mail.subject, mail.html, mail.text); - } - } - - // -- SystemWebhook - - const systemWebhooks = await this.systemWebhookService.fetchActiveSystemWebhooks() - .then(it => it.filter(it => it.on.includes('inactiveModeratorsInvitationOnlyChanged'))); - for (const systemWebhook of systemWebhooks) { - this.systemWebhookService.enqueueSystemWebhook( - systemWebhook, - 'inactiveModeratorsInvitationOnlyChanged', - {}, - ); - } - } - - @bindThis - private async fetchModerators() { - // TODO: モデレーター以外にも特別な権限を持つユーザーがいる場合は考慮する - return this.roleService.getModerators({ - includeAdmins: true, - includeRoot: true, - excludeExpire: true, - }); - } -} diff --git a/packages/backend/src/queue/processors/CleanChartsProcessorService.ts b/packages/backend/src/queue/processors/CleanChartsProcessorService.ts index 110468801c..55c444eee6 100644 --- a/packages/backend/src/queue/processors/CleanChartsProcessorService.ts +++ b/packages/backend/src/queue/processors/CleanChartsProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/queue/processors/CleanProcessorService.ts b/packages/backend/src/queue/processors/CleanProcessorService.ts index a26b69cd2b..e252c5d8a1 100644 --- a/packages/backend/src/queue/processors/CleanProcessorService.ts +++ b/packages/backend/src/queue/processors/CleanProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -11,7 +11,6 @@ import type Logger from '@/logger.js'; import { bindThis } from '@/decorators.js'; import { IdService } from '@/core/IdService.js'; import type { Config } from '@/config.js'; -import { ReversiService } from '@/core/ReversiService.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type * as Bull from 'bullmq'; @@ -33,7 +32,6 @@ export class CleanProcessorService { private roleAssignmentsRepository: RoleAssignmentsRepository, private queueLoggerService: QueueLoggerService, - private reversiService: ReversiService, private idService: IdService, ) { this.logger = this.queueLoggerService.logger.createSubLogger('clean'); @@ -67,8 +65,6 @@ export class CleanProcessorService { }); } - this.reversiService.cleanOutdatedGames(); - this.logger.succ('Cleaned.'); } } diff --git a/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts b/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts index 728fc9e72b..b62cc8a8fd 100644 --- a/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts +++ b/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -63,7 +63,7 @@ export class CleanRemoteFilesProcessorService { isLink: false, }); - job.updateProgress(100 / total * deletedCount); + job.updateProgress(deletedCount / total); } this.logger.succ('All cached remote files has been deleted.'); diff --git a/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts b/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts index 14a53e0c42..39967165d4 100644 --- a/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts +++ b/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/queue/processors/DeleteDriveFilesProcessorService.ts b/packages/backend/src/queue/processors/DeleteDriveFilesProcessorService.ts index 291fa4a6d8..6d0a45bcc0 100644 --- a/packages/backend/src/queue/processors/DeleteDriveFilesProcessorService.ts +++ b/packages/backend/src/queue/processors/DeleteDriveFilesProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/queue/processors/DeleteFileProcessorService.ts b/packages/backend/src/queue/processors/DeleteFileProcessorService.ts index fc1dd93ce7..a4638bfaaf 100644 --- a/packages/backend/src/queue/processors/DeleteFileProcessorService.ts +++ b/packages/backend/src/queue/processors/DeleteFileProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/queue/processors/DeliverProcessorService.ts b/packages/backend/src/queue/processors/DeliverProcessorService.ts index 5a16496011..4a1d9f28b4 100644 --- a/packages/backend/src/queue/processors/DeliverProcessorService.ts +++ b/packages/backend/src/queue/processors/DeliverProcessorService.ts @@ -1,14 +1,14 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; import * as Bull from 'bullmq'; -import { Not } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { InstancesRepository, MiMeta } from '@/models/_.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'; @@ -30,12 +30,10 @@ export class DeliverProcessorService { private latest: string | null; constructor( - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.instancesRepository) private instancesRepository: InstancesRepository, + private metaService: MetaService, private utilityService: UtilityService, private federatedInstanceService: FederatedInstanceService, private fetchInstanceMetadataService: FetchInstanceMetadataService, @@ -46,14 +44,16 @@ export class DeliverProcessorService { private queueLoggerService: QueueLoggerService, ) { this.logger = this.queueLoggerService.logger.createSubLogger('deliver'); - this.suspendedHostsCache = new MemorySingleCache(1000 * 60 * 60); // 1h + this.suspendedHostsCache = new MemorySingleCache(1000 * 60 * 60); } @bindThis public async process(job: Bull.Job): Promise { const { host } = new URL(job.data.to); - if (!this.utilityService.isFederationAllowedUri(job.data.to)) { + // ブロックしてたら中断 + const meta = await this.metaService.fetch(); + if (this.utilityService.isBlockedHost(meta.blockedHosts, this.utilityService.toPuny(host))) { return 'skip (blocked)'; } @@ -62,7 +62,7 @@ export class DeliverProcessorService { if (suspendedHosts == null) { suspendedHosts = await this.instancesRepository.find({ where: { - suspensionState: Not('none'), + isSuspended: true, }, }); this.suspendedHostsCache.set(suspendedHosts); @@ -72,75 +72,51 @@ export class DeliverProcessorService { } try { - await this.apRequestService.signedPost(job.data.user, job.data.to, job.data.content, job.data.digest); - - this.apRequestChart.deliverSucc(); - this.federationChart.deliverd(host, true); - - // Update instance stats - process.nextTick(async () => { - const i = await (this.meta.enableStatsForFederatedInstances - ? this.federatedInstanceService.fetchOrRegister(host) - : this.federatedInstanceService.fetch(host)); - - if (i == null) return; + await this.apRequestService.signedPost(job.data.user, job.data.to, job.data.content); + // Update stats + this.federatedInstanceService.fetch(host).then(i => { if (i.isNotResponding) { this.federatedInstanceService.update(i.id, { isNotResponding: false, - notRespondingSince: null, }); } - if (this.meta.enableStatsForFederatedInstances) { - this.fetchInstanceMetadataService.fetchInstanceMetadata(i); - } + this.fetchInstanceMetadataService.fetchInstanceMetadata(i); + this.apRequestChart.deliverSucc(); + this.federationChart.deliverd(i.host, true); - if (this.meta.enableChartsForFederatedInstances) { + if (meta.enableChartsForFederatedInstances) { this.instanceChart.requestSent(i.host, true); } }); return 'Success'; } catch (res) { - this.apRequestChart.deliverFail(); - this.federationChart.deliverd(host, false); - - // Update instance stats - this.federatedInstanceService.fetchOrRegister(host).then(i => { + // Update stats + this.federatedInstanceService.fetch(host).then(i => { if (!i.isNotResponding) { this.federatedInstanceService.update(i.id, { isNotResponding: true, - notRespondingSince: new Date(), - }); - } else if (i.notRespondingSince) { - // 1週間以上不通ならサスペンド - if (i.suspensionState === 'none' && i.notRespondingSince.getTime() <= Date.now() - 1000 * 60 * 60 * 24 * 7) { - this.federatedInstanceService.update(i.id, { - suspensionState: 'autoSuspendedForNotResponding', - }); - } - } else { - // isNotRespondingがtrueでnotRespondingSinceがnullの場合はnotRespondingSinceをセット - // notRespondingSinceは新たな機能なので、それ以前のデータにはnotRespondingSinceがない場合がある - this.federatedInstanceService.update(i.id, { - notRespondingSince: new Date(), }); } - if (this.meta.enableChartsForFederatedInstances) { + this.apRequestChart.deliverFail(); + this.federationChart.deliverd(i.host, false); + + if (meta.enableChartsForFederatedInstances) { this.instanceChart.requestSent(i.host, false); } }); if (res instanceof StatusError) { // 4xx - if (!res.isRetryable) { + if (res.isClientError) { // 相手が閉鎖していることを明示しているため、配送停止する if (job.data.isSharedInbox && res.statusCode === 410) { - this.federatedInstanceService.fetchOrRegister(host).then(i => { + this.federatedInstanceService.fetch(host).then(i => { this.federatedInstanceService.update(i.id, { - suspensionState: 'goneSuspended', + isSuspended: true, }); }); throw new Bull.UnrecoverableError(`${host} is gone`); diff --git a/packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts b/packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts index 34180e5f2b..4a48084436 100644 --- a/packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts +++ b/packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,7 +7,6 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; import type { PollVotesRepository, NotesRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; -import { CacheService } from '@/core/CacheService.js'; import { NotificationService } from '@/core/NotificationService.js'; import { bindThis } from '@/decorators.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; @@ -25,7 +24,6 @@ export class EndedPollNotificationProcessorService { @Inject(DI.pollVotesRepository) private pollVotesRepository: PollVotesRepository, - private cacheService: CacheService, private notificationService: NotificationService, private queueLoggerService: QueueLoggerService, ) { @@ -49,12 +47,9 @@ export class EndedPollNotificationProcessorService { const userIds = [...new Set([note.userId, ...votes.map(v => v.userId)])]; for (const userId of userIds) { - const profile = await this.cacheService.userProfileCache.fetch(userId); - if (profile.userHost === null) { - this.notificationService.createNotification(userId, 'pollEnded', { - noteId: note.id, - }); - } + this.notificationService.createNotification(userId, 'pollEnded', { + noteId: note.id, + }); } } } diff --git a/packages/backend/src/queue/processors/ExportAntennasProcessorService.ts b/packages/backend/src/queue/processors/ExportAntennasProcessorService.ts index b3111865ad..d0968d2923 100644 --- a/packages/backend/src/queue/processors/ExportAntennasProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportAntennasProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -14,7 +14,6 @@ import { DriveService } from '@/core/DriveService.js'; import { bindThis } from '@/decorators.js'; import { createTemp } from '@/misc/create-temp.js'; import { UtilityService } from '@/core/UtilityService.js'; -import { NotificationService } from '@/core/NotificationService.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type { DBExportAntennasData } from '../types.js'; import type * as Bull from 'bullmq'; @@ -36,7 +35,6 @@ export class ExportAntennasProcessorService { private driveService: DriveService, private utilityService: UtilityService, private queueLoggerService: QueueLoggerService, - private notificationService: NotificationService, ) { this.logger = this.queueLoggerService.logger.createSubLogger('export-antennas'); } @@ -83,9 +81,9 @@ export class ExportAntennasProcessorService { }) : null, caseSensitive: antenna.caseSensitive, localOnly: antenna.localOnly, - excludeBots: antenna.excludeBots, withReplies: antenna.withReplies, withFile: antenna.withFile, + notify: antenna.notify, })); if (antennas.length - 1 !== index) { write(', '); @@ -97,11 +95,6 @@ export class ExportAntennasProcessorService { const fileName = 'antennas-' + DateFormat(new Date(), 'yyyy-MM-dd-HH-mm-ss') + '.json'; const driveFile = await this.driveService.addFile({ user, path, name: fileName, force: true, ext: 'json' }); this.logger.succ('Exported to: ' + driveFile.id); - - this.notificationService.createNotification(user.id, 'exportCompleted', { - exportedEntity: 'antenna', - fileId: driveFile.id, - }); } finally { cleanup(); } diff --git a/packages/backend/src/queue/processors/ExportBlockingProcessorService.ts b/packages/backend/src/queue/processors/ExportBlockingProcessorService.ts index ecc439db69..0a37e3ca1e 100644 --- a/packages/backend/src/queue/processors/ExportBlockingProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportBlockingProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -13,7 +13,6 @@ import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { createTemp } from '@/misc/create-temp.js'; import { UtilityService } from '@/core/UtilityService.js'; -import { NotificationService } from '@/core/NotificationService.js'; import { bindThis } from '@/decorators.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type * as Bull from 'bullmq'; @@ -31,7 +30,6 @@ export class ExportBlockingProcessorService { private blockingsRepository: BlockingsRepository, private utilityService: UtilityService, - private notificationService: NotificationService, private driveService: DriveService, private queueLoggerService: QueueLoggerService, ) { @@ -111,11 +109,6 @@ export class ExportBlockingProcessorService { const driveFile = await this.driveService.addFile({ user, path, name: fileName, force: true, ext: 'csv' }); this.logger.succ(`Exported to: ${driveFile.id}`); - - this.notificationService.createNotification(user.id, 'exportCompleted', { - exportedEntity: 'blocking', - fileId: driveFile.id, - }); } finally { cleanup(); } diff --git a/packages/backend/src/queue/processors/ExportClipsProcessorService.ts b/packages/backend/src/queue/processors/ExportClipsProcessorService.ts deleted file mode 100644 index 583ddbb745..0000000000 --- a/packages/backend/src/queue/processors/ExportClipsProcessorService.ts +++ /dev/null @@ -1,213 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import * as fs from 'node:fs'; -import { Writable } from 'node:stream'; -import { Inject, Injectable, StreamableFile } from '@nestjs/common'; -import { MoreThan } from 'typeorm'; -import { format as dateFormat } from 'date-fns'; -import { DI } from '@/di-symbols.js'; -import type { ClipNotesRepository, ClipsRepository, MiClip, MiClipNote, MiUser, 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/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'; -import { IdService } from '@/core/IdService.js'; -import { NotificationService } from '@/core/NotificationService.js'; -import { QueueLoggerService } from '../QueueLoggerService.js'; -import type * as Bull from 'bullmq'; -import type { DbJobDataWithUser } from '../types.js'; - -@Injectable() -export class ExportClipsProcessorService { - private logger: Logger; - - constructor( - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - - @Inject(DI.pollsRepository) - private pollsRepository: PollsRepository, - - @Inject(DI.clipsRepository) - private clipsRepository: ClipsRepository, - - @Inject(DI.clipNotesRepository) - private clipNotesRepository: ClipNotesRepository, - - private driveService: DriveService, - private queueLoggerService: QueueLoggerService, - private idService: IdService, - private notificationService: NotificationService, - ) { - this.logger = this.queueLoggerService.logger.createSubLogger('export-clips'); - } - - @bindThis - public async process(job: Bull.Job): Promise { - this.logger.info(`Exporting clips of ${job.data.user.id} ...`); - - const user = await this.usersRepository.findOneBy({ id: job.data.user.id }); - if (user == null) { - return; - } - - // Create temp file - const [path, cleanup] = await createTemp(); - - this.logger.info(`Temp file is ${path}`); - - try { - const stream = Writable.toWeb(fs.createWriteStream(path, { flags: 'a' })); - const writer = stream.getWriter(); - writer.closed.catch(this.logger.error); - - await writer.write('['); - - await this.processClips(writer, user, job); - - await writer.write(']'); - await writer.close(); - - this.logger.succ(`Exported to: ${path}`); - - const fileName = 'clips-' + dateFormat(new Date(), 'yyyy-MM-dd-HH-mm-ss') + '.json'; - const driveFile = await this.driveService.addFile({ user, path, name: fileName, force: true, ext: 'json' }); - - this.logger.succ(`Exported to: ${driveFile.id}`); - - this.notificationService.createNotification(user.id, 'exportCompleted', { - exportedEntity: 'clip', - fileId: driveFile.id, - }); - } finally { - cleanup(); - } - } - - async processClips(writer: WritableStreamDefaultWriter, user: MiUser, job: Bull.Job) { - let exportedClipsCount = 0; - let cursor: MiClip['id'] | null = null; - - while (true) { - const clips = await this.clipsRepository.find({ - where: { - userId: user.id, - ...(cursor ? { id: MoreThan(cursor) } : {}), - }, - take: 100, - order: { - id: 1, - }, - }); - - if (clips.length === 0) { - job.updateProgress(100); - break; - } - - cursor = clips.at(-1)?.id ?? null; - - for (const clip of clips) { - // Stringify but remove the last `]}` - const content = JSON.stringify(this.serializeClip(clip)).slice(0, -2); - const isFirst = exportedClipsCount === 0; - await writer.write(isFirst ? content : ',\n' + content); - - await this.processClipNotes(writer, clip.id); - - await writer.write(']}'); - exportedClipsCount++; - } - - const total = await this.clipsRepository.countBy({ - userId: user.id, - }); - - job.updateProgress(exportedClipsCount / total); - } - } - - async processClipNotes(writer: WritableStreamDefaultWriter, clipId: string): Promise { - let exportedClipNotesCount = 0; - let cursor: MiClipNote['id'] | null = null; - - while (true) { - const clipNotes = await this.clipNotesRepository.find({ - where: { - clipId, - ...(cursor ? { id: MoreThan(cursor) } : {}), - }, - take: 100, - order: { - id: 1, - }, - relations: ['note', 'note.user'], - }) as (MiClipNote & { note: MiNote & { user: MiUser } })[]; - - if (clipNotes.length === 0) { - break; - } - - cursor = clipNotes.at(-1)?.id ?? null; - - for (const clipNote of clipNotes) { - let poll: MiPoll | undefined; - if (clipNote.note.hasPoll) { - poll = await this.pollsRepository.findOneByOrFail({ noteId: clipNote.note.id }); - } - const content = JSON.stringify(this.serializeClipNote(clipNote, poll)); - const isFirst = exportedClipNotesCount === 0; - await writer.write(isFirst ? content : ',\n' + content); - - exportedClipNotesCount++; - } - } - } - - private serializeClip(clip: MiClip): Record { - return { - id: clip.id, - name: clip.name, - description: clip.description, - lastClippedAt: clip.lastClippedAt?.toISOString(), - clipNotes: [], - }; - } - - private serializeClipNote(clip: MiClipNote & { note: MiNote & { user: MiUser } }, poll: MiPoll | undefined): Record { - return { - id: clip.id, - createdAt: this.idService.parse(clip.id).date.toISOString(), - note: { - id: clip.note.id, - text: clip.note.text, - createdAt: this.idService.parse(clip.note.id).date.toISOString(), - fileIds: clip.note.fileIds, - replyId: clip.note.replyId, - renoteId: clip.note.renoteId, - poll: poll, - cw: clip.note.cw, - visibility: clip.note.visibility, - visibleUserIds: clip.note.visibleUserIds, - localOnly: clip.note.localOnly, - reactionAcceptance: clip.note.reactionAcceptance, - uri: clip.note.uri, - url: clip.note.url, - user: { - id: clip.note.user.id, - name: clip.note.user.name, - username: clip.note.user.username, - host: clip.note.user.host, - uri: clip.note.user.uri, - }, - }, - }; - } -} diff --git a/packages/backend/src/queue/processors/ExportCustomEmojisProcessorService.ts b/packages/backend/src/queue/processors/ExportCustomEmojisProcessorService.ts index e237cd4975..d5387fe42e 100644 --- a/packages/backend/src/queue/processors/ExportCustomEmojisProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportCustomEmojisProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -16,7 +16,6 @@ import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { createTemp, createTempDir } from '@/misc/create-temp.js'; import { DownloadService } from '@/core/DownloadService.js'; -import { NotificationService } from '@/core/NotificationService.js'; import { bindThis } from '@/decorators.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type * as Bull from 'bullmq'; @@ -38,7 +37,6 @@ export class ExportCustomEmojisProcessorService { private driveService: DriveService, private downloadService: DownloadService, private queueLoggerService: QueueLoggerService, - private notificationService: NotificationService, ) { this.logger = this.queueLoggerService.logger.createSubLogger('export-custom-emojis'); } @@ -136,12 +134,6 @@ export class ExportCustomEmojisProcessorService { const driveFile = await this.driveService.addFile({ user, path: archivePath, name: fileName, force: true }); this.logger.succ(`Exported to: ${driveFile.id}`); - - this.notificationService.createNotification(user.id, 'exportCompleted', { - exportedEntity: 'customEmoji', - fileId: driveFile.id, - }); - cleanup(); archiveCleanup(); resolve(); diff --git a/packages/backend/src/queue/processors/ExportFavoritesProcessorService.ts b/packages/backend/src/queue/processors/ExportFavoritesProcessorService.ts index b81feece01..af2a3434a9 100644 --- a/packages/backend/src/queue/processors/ExportFavoritesProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportFavoritesProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -16,7 +16,6 @@ import type { MiPoll } from '@/models/Poll.js'; import type { MiNote } from '@/models/Note.js'; import { bindThis } from '@/decorators.js'; import { IdService } from '@/core/IdService.js'; -import { NotificationService } from '@/core/NotificationService.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type * as Bull from 'bullmq'; import type { DbJobDataWithUser } from '../types.js'; @@ -38,7 +37,6 @@ export class ExportFavoritesProcessorService { private driveService: DriveService, private queueLoggerService: QueueLoggerService, private idService: IdService, - private notificationService: NotificationService, ) { this.logger = this.queueLoggerService.logger.createSubLogger('export-favorites'); } @@ -125,11 +123,6 @@ export class ExportFavoritesProcessorService { const driveFile = await this.driveService.addFile({ user, path, name: fileName, force: true, ext: 'json' }); this.logger.succ(`Exported to: ${driveFile.id}`); - - this.notificationService.createNotification(user.id, 'exportCompleted', { - exportedEntity: 'favorite', - fileId: driveFile.id, - }); } finally { cleanup(); } diff --git a/packages/backend/src/queue/processors/ExportFollowingProcessorService.ts b/packages/backend/src/queue/processors/ExportFollowingProcessorService.ts index 903f962515..c9739eb1cb 100644 --- a/packages/backend/src/queue/processors/ExportFollowingProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportFollowingProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -14,7 +14,6 @@ import { DriveService } from '@/core/DriveService.js'; import { createTemp } from '@/misc/create-temp.js'; import type { MiFollowing } from '@/models/Following.js'; import { UtilityService } from '@/core/UtilityService.js'; -import { NotificationService } from '@/core/NotificationService.js'; import { bindThis } from '@/decorators.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type * as Bull from 'bullmq'; @@ -37,7 +36,6 @@ export class ExportFollowingProcessorService { private utilityService: UtilityService, private driveService: DriveService, private queueLoggerService: QueueLoggerService, - private notificationService: NotificationService, ) { this.logger = this.queueLoggerService.logger.createSubLogger('export-following'); } @@ -115,11 +113,6 @@ export class ExportFollowingProcessorService { const driveFile = await this.driveService.addFile({ user, path, name: fileName, force: true, ext: 'csv' }); this.logger.succ(`Exported to: ${driveFile.id}`); - - this.notificationService.createNotification(user.id, 'exportCompleted', { - exportedEntity: 'following', - fileId: driveFile.id, - }); } finally { cleanup(); } diff --git a/packages/backend/src/queue/processors/ExportMutingProcessorService.ts b/packages/backend/src/queue/processors/ExportMutingProcessorService.ts index f9867ade29..c8425c1f2d 100644 --- a/packages/backend/src/queue/processors/ExportMutingProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportMutingProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -13,7 +13,6 @@ import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { createTemp } from '@/misc/create-temp.js'; import { UtilityService } from '@/core/UtilityService.js'; -import { NotificationService } from '@/core/NotificationService.js'; import { bindThis } from '@/decorators.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type * as Bull from 'bullmq'; @@ -33,7 +32,6 @@ export class ExportMutingProcessorService { private utilityService: UtilityService, private driveService: DriveService, private queueLoggerService: QueueLoggerService, - private notificationService: NotificationService, ) { this.logger = this.queueLoggerService.logger.createSubLogger('export-muting'); } @@ -112,11 +110,6 @@ export class ExportMutingProcessorService { const driveFile = await this.driveService.addFile({ user, path, name: fileName, force: true, ext: 'csv' }); this.logger.succ(`Exported to: ${driveFile.id}`); - - this.notificationService.createNotification(user.id, 'exportCompleted', { - exportedEntity: 'muting', - fileId: driveFile.id, - }); } finally { cleanup(); } diff --git a/packages/backend/src/queue/processors/ExportNotesProcessorService.ts b/packages/backend/src/queue/processors/ExportNotesProcessorService.ts index 9e2b678219..cd4ccb0b07 100644 --- a/packages/backend/src/queue/processors/ExportNotesProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportNotesProcessorService.ts @@ -1,9 +1,9 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { ReadableStream, TextEncoderStream } from 'node:stream/web'; +import * as fs from 'node:fs'; import { Inject, Injectable } from '@nestjs/common'; import { MoreThan } from 'typeorm'; import { format as dateFormat } from 'date-fns'; @@ -18,83 +18,10 @@ import { bindThis } from '@/decorators.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; import { Packed } from '@/misc/json-schema.js'; import { IdService } from '@/core/IdService.js'; -import { NotificationService } from '@/core/NotificationService.js'; -import { JsonArrayStream } from '@/misc/JsonArrayStream.js'; -import { FileWriterStream } from '@/misc/FileWriterStream.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type * as Bull from 'bullmq'; import type { DbJobDataWithUser } from '../types.js'; -class NoteStream extends ReadableStream> { - constructor( - job: Bull.Job, - notesRepository: NotesRepository, - pollsRepository: PollsRepository, - driveFileEntityService: DriveFileEntityService, - idService: IdService, - userId: string, - ) { - let exportedNotesCount = 0; - let cursor: MiNote['id'] | null = null; - - const serialize = ( - note: MiNote, - poll: MiPoll | null, - files: Packed<'DriveFile'>[], - ): Record => { - return { - id: note.id, - text: note.text, - createdAt: idService.parse(note.id).date.toISOString(), - fileIds: note.fileIds, - files: files, - replyId: note.replyId, - renoteId: note.renoteId, - poll: poll, - cw: note.cw, - visibility: note.visibility, - visibleUserIds: note.visibleUserIds, - localOnly: note.localOnly, - reactionAcceptance: note.reactionAcceptance, - }; - }; - - super({ - async pull(controller): Promise { - const notes = await notesRepository.find({ - where: { - userId, - ...(cursor !== null ? { id: MoreThan(cursor) } : {}), - }, - take: 100, // 100件ずつ取得 - order: { id: 1 }, - }); - - if (notes.length === 0) { - job.updateProgress(100); - controller.close(); - } - - cursor = notes.at(-1)?.id ?? null; - - for (const note of notes) { - const poll = note.hasPoll - ? await pollsRepository.findOneByOrFail({ noteId: note.id }) // N+1 - : null; - const files = await driveFileEntityService.packManyByIds(note.fileIds); // N+1 - const content = serialize(note, poll, files); - - controller.enqueue(content); - exportedNotesCount++; - } - - const total = await notesRepository.countBy({ userId }); - job.updateProgress(exportedNotesCount / total); - }, - }); - } -} - @Injectable() export class ExportNotesProcessorService { private logger: Logger; @@ -113,7 +40,6 @@ export class ExportNotesProcessorService { private queueLoggerService: QueueLoggerService, private driveFileEntityService: DriveFileEntityService, private idService: IdService, - private notificationService: NotificationService, ) { this.logger = this.queueLoggerService.logger.createSubLogger('export-notes'); } @@ -133,32 +59,93 @@ export class ExportNotesProcessorService { this.logger.info(`Temp file is ${path}`); try { - // メモリが足りなくならないようにストリームで処理する - await new NoteStream( - job, - this.notesRepository, - this.pollsRepository, - this.driveFileEntityService, - this.idService, - user.id, - ) - .pipeThrough(new JsonArrayStream()) - .pipeThrough(new TextEncoderStream()) - .pipeTo(new FileWriterStream(path)); + const stream = fs.createWriteStream(path, { flags: 'a' }); + const write = (text: string): Promise => { + return new Promise((res, rej) => { + stream.write(text, err => { + if (err) { + this.logger.error(err); + rej(err); + } else { + res(); + } + }); + }); + }; + + await write('['); + + let exportedNotesCount = 0; + let cursor: MiNote['id'] | null = null; + + while (true) { + const notes = await this.notesRepository.find({ + where: { + userId: user.id, + ...(cursor ? { id: MoreThan(cursor) } : {}), + }, + take: 100, + order: { + id: 1, + }, + }) as MiNote[]; + + if (notes.length === 0) { + job.updateProgress(100); + break; + } + + cursor = notes.at(-1)?.id ?? null; + + for (const note of notes) { + let poll: MiPoll | undefined; + if (note.hasPoll) { + poll = await this.pollsRepository.findOneByOrFail({ noteId: note.id }); + } + const files = await this.driveFileEntityService.packManyByIds(note.fileIds); + const content = JSON.stringify(this.serialize(note, poll, files)); + const isFirst = exportedNotesCount === 0; + await write(isFirst ? content : ',\n' + content); + exportedNotesCount++; + } + + const total = await this.notesRepository.countBy({ + userId: user.id, + }); + + job.updateProgress(exportedNotesCount / total); + } + + await write(']'); + + stream.end(); this.logger.succ(`Exported to: ${path}`); const fileName = 'notes-' + dateFormat(new Date(), 'yyyy-MM-dd-HH-mm-ss') + '.json'; const driveFile = await this.driveService.addFile({ user, path, name: fileName, force: true, ext: 'json' }); this.logger.succ(`Exported to: ${driveFile.id}`); - - this.notificationService.createNotification(user.id, 'exportCompleted', { - exportedEntity: 'note', - fileId: driveFile.id, - }); } finally { cleanup(); } } + + private serialize(note: MiNote, poll: MiPoll | null = null, files: Packed<'DriveFile'>[]): Record { + return { + id: note.id, + text: note.text, + createdAt: this.idService.parse(note.id).date.toISOString(), + fileIds: note.fileIds, + files: files, + replyId: note.replyId, + renoteId: note.renoteId, + poll: poll, + cw: note.cw, + visibility: note.visibility, + visibleUserIds: note.visibleUserIds, + localOnly: note.localOnly, + reactionAcceptance: note.reactionAcceptance, + }; + } } diff --git a/packages/backend/src/queue/processors/ExportUserListsProcessorService.ts b/packages/backend/src/queue/processors/ExportUserListsProcessorService.ts index c483d79854..a3f9441dc2 100644 --- a/packages/backend/src/queue/processors/ExportUserListsProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportUserListsProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -13,7 +13,6 @@ import type Logger from '@/logger.js'; import { DriveService } from '@/core/DriveService.js'; import { createTemp } from '@/misc/create-temp.js'; import { UtilityService } from '@/core/UtilityService.js'; -import { NotificationService } from '@/core/NotificationService.js'; import { bindThis } from '@/decorators.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type * as Bull from 'bullmq'; @@ -36,7 +35,6 @@ export class ExportUserListsProcessorService { private utilityService: UtilityService, private driveService: DriveService, private queueLoggerService: QueueLoggerService, - private notificationService: NotificationService, ) { this.logger = this.queueLoggerService.logger.createSubLogger('export-user-lists'); } @@ -91,11 +89,6 @@ export class ExportUserListsProcessorService { const driveFile = await this.driveService.addFile({ user, path, name: fileName, force: true, ext: 'csv' }); this.logger.succ(`Exported to: ${driveFile.id}`); - - this.notificationService.createNotification(user.id, 'exportCompleted', { - exportedEntity: 'userList', - fileId: driveFile.id, - }); } finally { cleanup(); } diff --git a/packages/backend/src/queue/processors/ImportAntennasProcessorService.ts b/packages/backend/src/queue/processors/ImportAntennasProcessorService.ts index 9c033b73e2..291ea14b67 100644 --- a/packages/backend/src/queue/processors/ImportAntennasProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportAntennasProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -44,11 +44,11 @@ const validate = new Ajv().compile({ } }, caseSensitive: { type: 'boolean' }, localOnly: { type: 'boolean' }, - excludeBots: { type: 'boolean' }, withReplies: { type: 'boolean' }, withFile: { type: 'boolean' }, + notify: { type: 'boolean' }, }, - required: ['name', 'src', 'keywords', 'excludeKeywords', 'users', 'caseSensitive', 'withReplies', 'withFile'], + required: ['name', 'src', 'keywords', 'excludeKeywords', 'users', 'caseSensitive', 'withReplies', 'withFile', 'notify'], }); @Injectable() @@ -76,7 +76,7 @@ export class ImportAntennasProcessorService { this.logger.warn('Validation Failed'); continue; } - const result = await this.antennasRepository.insertOne({ + const result = await this.antennasRepository.insert({ id: this.idService.gen(now.getTime()), lastUsedAt: now, userId: job.data.user.id, @@ -88,10 +88,10 @@ export class ImportAntennasProcessorService { users: (antenna.src === 'list' && antenna.userListAccts !== null ? antenna.userListAccts : antenna.users).filter(Boolean), caseSensitive: antenna.caseSensitive, localOnly: antenna.localOnly, - excludeBots: antenna.excludeBots, withReplies: antenna.withReplies, withFile: antenna.withFile, - }); + notify: antenna.notify, + }).then(x => this.antennasRepository.findOneByOrFail(x.identifiers[0])); this.logger.succ('Antenna created: ' + result.id); this.globalEventService.publishInternalEvent('antennaCreated', result); } diff --git a/packages/backend/src/queue/processors/ImportBlockingProcessorService.ts b/packages/backend/src/queue/processors/ImportBlockingProcessorService.ts index b78229c648..64520b770b 100644 --- a/packages/backend/src/queue/processors/ImportBlockingProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportBlockingProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/queue/processors/ImportCustomEmojisProcessorService.ts b/packages/backend/src/queue/processors/ImportCustomEmojisProcessorService.ts index 9e1b8fee70..a52af54a39 100644 --- a/packages/backend/src/queue/processors/ImportCustomEmojisProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportCustomEmojisProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -87,30 +87,23 @@ export class ImportCustomEmojisProcessorService { await this.emojisRepository.delete({ name: emojiInfo.name, }); - try { - const driveFile = await this.driveService.addFile({ - user: null, - path: emojiPath, - name: record.fileName, - force: true, - }); - await this.customEmojiService.add({ - name: emojiInfo.name, - category: emojiInfo.category, - host: null, - aliases: emojiInfo.aliases, - driveFile, - license: emojiInfo.license, - isSensitive: emojiInfo.isSensitive, - localOnly: emojiInfo.localOnly, - roleIdsThatCanBeUsedThisEmojiAsReaction: [], - }); - } catch (e) { - if (e instanceof Error || typeof e === 'string') { - this.logger.error(`couldn't import ${emojiPath} for ${emojiInfo.name}: ${e}`); - } - continue; - } + const driveFile = await this.driveService.addFile({ + user: null, + path: emojiPath, + name: record.fileName, + force: true, + }); + await this.customEmojiService.add({ + name: emojiInfo.name, + category: emojiInfo.category, + host: null, + aliases: emojiInfo.aliases, + driveFile, + license: emojiInfo.license, + isSensitive: emojiInfo.isSensitive, + localOnly: emojiInfo.localOnly, + roleIdsThatCanBeUsedThisEmojiAsReaction: [], + }); } cleanup(); diff --git a/packages/backend/src/queue/processors/ImportFollowingProcessorService.ts b/packages/backend/src/queue/processors/ImportFollowingProcessorService.ts index 70c9f3a096..e75499a56f 100644 --- a/packages/backend/src/queue/processors/ImportFollowingProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportFollowingProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/queue/processors/ImportMutingProcessorService.ts b/packages/backend/src/queue/processors/ImportMutingProcessorService.ts index ec9d2b6c4c..9db4e5d8e0 100644 --- a/packages/backend/src/queue/processors/ImportMutingProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportMutingProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/queue/processors/ImportUserListsProcessorService.ts b/packages/backend/src/queue/processors/ImportUserListsProcessorService.ts index db9255b35d..5dd3fbe887 100644 --- a/packages/backend/src/queue/processors/ImportUserListsProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportUserListsProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -79,11 +79,11 @@ export class ImportUserListsProcessorService { }); if (list == null) { - list = await this.userListsRepository.insertOne({ + list = await this.userListsRepository.insert({ id: this.idService.gen(), userId: user.id, name: listName, - }); + }).then(x => this.userListsRepository.findOneByOrFail(x.identifiers[0])); } let target = this.utilityService.isSelfHost(host!) ? await this.usersRepository.findOneBy({ diff --git a/packages/backend/src/queue/processors/InboxProcessorService.ts b/packages/backend/src/queue/processors/InboxProcessorService.ts index 95d764e4d8..89d4ea503e 100644 --- a/packages/backend/src/queue/processors/InboxProcessorService.ts +++ b/packages/backend/src/queue/processors/InboxProcessorService.ts @@ -1,56 +1,43 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { URL } from 'node:url'; -import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import httpSignature from '@peertube/http-signature'; import * as Bull from 'bullmq'; import type Logger from '@/logger.js'; +import { MetaService } from '@/core/MetaService.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 { IActivity } from '@/core/activitypub/type.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'; import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js'; -import { JsonLdService } from '@/core/activitypub/JsonLdService.js'; +import { LdSignatureService } from '@/core/activitypub/LdSignatureService.js'; import { ApInboxService } from '@/core/activitypub/ApInboxService.js'; import { bindThis } from '@/decorators.js'; -import { IdentifiableError } from '@/misc/identifiable-error.js'; -import { CollapsedQueue } from '@/misc/collapsed-queue.js'; -import { MiNote } from '@/models/Note.js'; -import { MiMeta } from '@/models/Meta.js'; -import { DI } from '@/di-symbols.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type { InboxJobData } from '../types.js'; -type UpdateInstanceJob = { - latestRequestReceivedAt: Date, - shouldUnsuspend: boolean, -}; - @Injectable() -export class InboxProcessorService implements OnApplicationShutdown { +export class InboxProcessorService { private logger: Logger; - private updateInstanceQueue: CollapsedQueue; constructor( - @Inject(DI.meta) - private meta: MiMeta, - private utilityService: UtilityService, + private metaService: MetaService, private apInboxService: ApInboxService, private federatedInstanceService: FederatedInstanceService, private fetchInstanceMetadataService: FetchInstanceMetadataService, - private jsonLdService: JsonLdService, + private ldSignatureService: LdSignatureService, private apPersonService: ApPersonService, private apDbResolverService: ApDbResolverService, private instanceChart: InstanceChart, @@ -59,13 +46,12 @@ export class InboxProcessorService implements OnApplicationShutdown { private queueLoggerService: QueueLoggerService, ) { this.logger = this.queueLoggerService.logger.createSubLogger('inbox'); - this.updateInstanceQueue = new CollapsedQueue(process.env.NODE_ENV !== 'test' ? 60 * 1000 * 5 : 0, this.collapseUpdateInstanceJobs, this.performUpdateInstance); } @bindThis public async process(job: Bull.Job): Promise { const signature = job.data.signature; // HTTP-signature - let activity = job.data.activity; + const activity = job.data.activity; //#region Log const info = Object.assign({}, activity); @@ -75,7 +61,9 @@ export class InboxProcessorService implements OnApplicationShutdown { const host = this.utilityService.toPuny(new URL(signature.keyId).hostname); - if (!this.utilityService.isFederationAllowedHost(host)) { + // ブロックしてたら中断 + const meta = await this.metaService.fetch(); + if (this.utilityService.isBlockedHost(meta.blockedHosts, host)) { return `Blocked request: ${host}`; } @@ -97,7 +85,7 @@ export class InboxProcessorService implements OnApplicationShutdown { } catch (err) { // 対象が4xxならスキップ if (err instanceof StatusError) { - if (!err.isRetryable) { + if (err.isClientError) { throw new Bull.UnrecoverableError(`skip: Ignored deleted actors on both ends ${activity.actor} - ${err.statusCode}`); } throw new Error(`Error in actor ${activity.actor} - ${err.statusCode}`); @@ -121,21 +109,20 @@ export class InboxProcessorService implements OnApplicationShutdown { // また、signatureのsignerは、activity.actorと一致する必要がある if (!httpSignatureValidated || authUser.user.uri !== activity.actor) { // 一致しなくても、でもLD-Signatureがありそうならそっちも見る - const ldSignature = activity.signature; - if (ldSignature) { - if (ldSignature.type !== 'RsaSignature2017') { - throw new Bull.UnrecoverableError(`skip: unsupported LD-signature type ${ldSignature.type}`); + if (activity.signature) { + if (activity.signature.type !== 'RsaSignature2017') { + throw new Bull.UnrecoverableError(`skip: unsupported LD-signature type ${activity.signature.type}`); } - // ldSignature.creator: https://example.oom/users/user#main-key + // activity.signature.creator: https://example.oom/users/user#main-key // みたいになっててUserを引っ張れば公開キーも入ることを期待する - if (ldSignature.creator) { - const candicate = ldSignature.creator.replace(/#.*/, ''); + if (activity.signature.creator) { + const candicate = activity.signature.creator.replace(/#.*/, ''); await this.apPersonService.resolvePerson(candicate).catch(() => null); } // keyIdからLD-Signatureのユーザーを取得 - authUser = await this.apDbResolverService.getAuthUserFromKeyId(ldSignature.creator); + authUser = await this.apDbResolverService.getAuthUserFromKeyId(activity.signature.creator); if (authUser == null) { throw new Bull.UnrecoverableError('skip: LD-Signatureのユーザーが取得できませんでした'); } @@ -144,38 +131,21 @@ export class InboxProcessorService implements OnApplicationShutdown { throw new Bull.UnrecoverableError('skip: LD-SignatureのユーザーはpublicKeyを持っていませんでした'); } - const jsonLd = this.jsonLdService.use(); - // LD-Signature検証 - const verified = await jsonLd.verifyRsaSignature2017(activity, authUser.key.keyPem).catch(() => false); + const ldSignature = this.ldSignatureService.use(); + const verified = await ldSignature.verifyRsaSignature2017(activity, authUser.key.keyPem).catch(() => false); if (!verified) { throw new Bull.UnrecoverableError('skip: LD-Signatureの検証に失敗しました'); } - // アクティビティを正規化 - delete activity.signature; - try { - activity = await jsonLd.compact(activity) as IActivity; - } catch (e) { - throw new Bull.UnrecoverableError(`skip: failed to compact activity: ${e}`); - } - // TODO: 元のアクティビティと非互換な形に正規化される場合は転送をスキップする - // https://github.com/mastodon/mastodon/blob/664b0ca/app/services/activitypub/process_collection_service.rb#L24-L29 - activity.signature = ldSignature; - - //#region Log - const compactedInfo = Object.assign({}, activity); - delete compactedInfo['@context']; - this.logger.debug(`compacted: ${JSON.stringify(compactedInfo, null, 2)}`); - //#endregion - // もう一度actorチェック if (authUser.user.uri !== activity.actor) { throw new Bull.UnrecoverableError(`skip: LD-Signature user(${authUser.user.uri}) !== activity.actor(${activity.actor})`); } + // ブロックしてたら中断 const ldHost = this.utilityService.extractDbHost(authUser.user.uri); - if (!this.utilityService.isFederationAllowedHost(ldHost)) { + if (this.utilityService.isBlockedHost(meta.blockedHosts, ldHost)) { throw new Bull.UnrecoverableError(`Blocked request: ${ldHost}`); } } else { @@ -192,82 +162,25 @@ export class InboxProcessorService implements OnApplicationShutdown { } } - this.apRequestChart.inbox(); - this.federationChart.inbox(authUser.user.host); - - // Update instance stats - process.nextTick(async () => { - const i = await (this.meta.enableStatsForFederatedInstances - ? this.federatedInstanceService.fetchOrRegister(authUser.user.host) - : this.federatedInstanceService.fetch(authUser.user.host)); - - if (i == null) return; - - this.updateInstanceQueue.enqueue(i.id, { + // Update stats + this.federatedInstanceService.fetch(authUser.user.host).then(i => { + this.federatedInstanceService.update(i.id, { latestRequestReceivedAt: new Date(), - shouldUnsuspend: i.suspensionState === 'autoSuspendedForNotResponding', + isNotResponding: false, }); - if (this.meta.enableChartsForFederatedInstances) { + this.fetchInstanceMetadataService.fetchInstanceMetadata(i); + + this.apRequestChart.inbox(); + this.federationChart.inbox(i.host); + + if (meta.enableChartsForFederatedInstances) { this.instanceChart.requestReceived(i.host); } - - this.fetchInstanceMetadataService.fetchInstanceMetadata(i); }); // アクティビティを処理 - try { - const result = await this.apInboxService.performActivity(authUser.user, activity); - if (result && !result.startsWith('ok')) { - this.logger.warn(`inbox activity ignored (maybe): id=${activity.id} reason=${result}`); - return result; - } - } catch (e) { - if (e instanceof IdentifiableError) { - if (e.id === '689ee33f-f97c-479a-ac49-1b9f8140af99') { - return 'blocked notes with prohibited words'; - } - if (e.id === '85ab9bd7-3a41-4530-959d-f07073900109') { - return 'actor has been suspended'; - } - if (e.id === 'd450b8a9-48e4-4dab-ae36-f4db763fda7c') { // invalid Note - return e.message; - } - } - throw e; - } + await this.apInboxService.performActivity(authUser.user, activity); return 'ok'; } - - @bindThis - public collapseUpdateInstanceJobs(oldJob: UpdateInstanceJob, newJob: UpdateInstanceJob) { - const latestRequestReceivedAt = oldJob.latestRequestReceivedAt < newJob.latestRequestReceivedAt - ? newJob.latestRequestReceivedAt - : oldJob.latestRequestReceivedAt; - const shouldUnsuspend = oldJob.shouldUnsuspend || newJob.shouldUnsuspend; - return { - latestRequestReceivedAt, - shouldUnsuspend, - }; - } - - @bindThis - public async performUpdateInstance(id: string, job: UpdateInstanceJob) { - await this.federatedInstanceService.update(id, { - latestRequestReceivedAt: new Date(), - isNotResponding: false, - // もしサーバーが死んでるために配信が止まっていた場合には自動的に復活させてあげる - suspensionState: job.shouldUnsuspend ? 'none' : undefined, - }); - } - - @bindThis - public async dispose(): Promise { - await this.updateInstanceQueue.performAllNow(); - } - - @bindThis - async onApplicationShutdown(signal?: string) { - await this.dispose(); - } } diff --git a/packages/backend/src/queue/processors/RelationshipProcessorService.ts b/packages/backend/src/queue/processors/RelationshipProcessorService.ts index 408b02fb38..b2d8e3631f 100644 --- a/packages/backend/src/queue/processors/RelationshipProcessorService.ts +++ b/packages/backend/src/queue/processors/RelationshipProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/queue/processors/ResyncChartsProcessorService.ts b/packages/backend/src/queue/processors/ResyncChartsProcessorService.ts index 570cdf9a75..b3b055ef8c 100644 --- a/packages/backend/src/queue/processors/ResyncChartsProcessorService.ts +++ b/packages/backend/src/queue/processors/ResyncChartsProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/queue/processors/SystemWebhookDeliverProcessorService.ts b/packages/backend/src/queue/processors/SystemWebhookDeliverProcessorService.ts deleted file mode 100644 index f6bef52684..0000000000 --- a/packages/backend/src/queue/processors/SystemWebhookDeliverProcessorService.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import * as Bull from 'bullmq'; -import { DI } from '@/di-symbols.js'; -import type { SystemWebhooksRepository } from '@/models/_.js'; -import type { Config } from '@/config.js'; -import type Logger from '@/logger.js'; -import { HttpRequestService } from '@/core/HttpRequestService.js'; -import { StatusError } from '@/misc/status-error.js'; -import { bindThis } from '@/decorators.js'; -import { QueueLoggerService } from '../QueueLoggerService.js'; -import { SystemWebhookDeliverJobData } from '../types.js'; - -@Injectable() -export class SystemWebhookDeliverProcessorService { - private logger: Logger; - - constructor( - @Inject(DI.config) - private config: Config, - - @Inject(DI.systemWebhooksRepository) - private systemWebhooksRepository: SystemWebhooksRepository, - - private httpRequestService: HttpRequestService, - private queueLoggerService: QueueLoggerService, - ) { - this.logger = this.queueLoggerService.logger.createSubLogger('webhook'); - } - - @bindThis - public async process(job: Bull.Job): Promise { - try { - this.logger.debug(`delivering ${job.data.webhookId}`); - - const res = await this.httpRequestService.send(job.data.to, { - method: 'POST', - headers: { - 'User-Agent': 'Misskey-Hooks', - 'X-Misskey-Host': this.config.host, - 'X-Misskey-Hook-Id': job.data.webhookId, - 'X-Misskey-Hook-Secret': job.data.secret, - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ - server: this.config.url, - hookId: job.data.webhookId, - eventId: job.data.eventId, - createdAt: job.data.createdAt, - type: job.data.type, - body: job.data.content, - }), - }); - - this.systemWebhooksRepository.update({ id: job.data.webhookId }, { - latestSentAt: new Date(), - latestStatus: res.status, - }); - - return 'Success'; - } catch (res) { - this.logger.error(res as Error); - - this.systemWebhooksRepository.update({ id: job.data.webhookId }, { - latestSentAt: new Date(), - latestStatus: res instanceof StatusError ? res.statusCode : 1, - }); - - if (res instanceof StatusError) { - // 4xx - if (!res.isRetryable) { - throw new Bull.UnrecoverableError(`${res.statusCode} ${res.statusMessage}`); - } - - // 5xx etc. - throw new Error(`${res.statusCode} ${res.statusMessage}`); - } else { - // DNS error, socket error, timeout ... - throw res; - } - } - } -} diff --git a/packages/backend/src/queue/processors/TickChartsProcessorService.ts b/packages/backend/src/queue/processors/TickChartsProcessorService.ts index 93ec34162d..7b1efb71e0 100644 --- a/packages/backend/src/queue/processors/TickChartsProcessorService.ts +++ b/packages/backend/src/queue/processors/TickChartsProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/queue/processors/UserWebhookDeliverProcessorService.ts b/packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts similarity index 88% rename from packages/backend/src/queue/processors/UserWebhookDeliverProcessorService.ts rename to packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts index 9ec630ef70..a41f5565c8 100644 --- a/packages/backend/src/queue/processors/UserWebhookDeliverProcessorService.ts +++ b/packages/backend/src/queue/processors/WebhookDeliverProcessorService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -13,10 +13,10 @@ import { HttpRequestService } from '@/core/HttpRequestService.js'; import { StatusError } from '@/misc/status-error.js'; import { bindThis } from '@/decorators.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; -import { UserWebhookDeliverJobData } from '../types.js'; +import type { WebhookDeliverJobData } from '../types.js'; @Injectable() -export class UserWebhookDeliverProcessorService { +export class WebhookDeliverProcessorService { private logger: Logger; constructor( @@ -33,7 +33,7 @@ export class UserWebhookDeliverProcessorService { } @bindThis - public async process(job: Bull.Job): Promise { + public async process(job: Bull.Job): Promise { try { this.logger.debug(`delivering ${job.data.webhookId}`); @@ -71,7 +71,7 @@ export class UserWebhookDeliverProcessorService { if (res instanceof StatusError) { // 4xx - if (!res.isRetryable) { + if (res.isClientError) { throw new Bull.UnrecoverableError(`${res.statusCode} ${res.statusMessage}`); } diff --git a/packages/backend/src/queue/types.ts b/packages/backend/src/queue/types.ts index a4077a0547..9330c01528 100644 --- a/packages/backend/src/queue/types.ts +++ b/packages/backend/src/queue/types.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -15,9 +15,7 @@ export type DeliverJobData = { /** Actor */ user: ThinUser; /** Activity */ - content: string; - /** Digest header */ - digest: string; + content: unknown; /** inbox URL to deliver */ to: string; /** whether it is sharedInbox */ @@ -106,17 +104,7 @@ export type EndedPollNotificationJobData = { noteId: MiNote['id']; }; -export type SystemWebhookDeliverJobData = { - type: string; - content: unknown; - webhookId: MiWebhook['id']; - to: string; - secret: string; - createdAt: number; - eventId: string; -}; - -export type UserWebhookDeliverJobData = { +export type WebhookDeliverJobData = { type: string; content: unknown; webhookId: MiWebhook['id']; diff --git a/packages/backend/src/server/ActivityPubServerService.ts b/packages/backend/src/server/ActivityPubServerService.ts index ba2342b630..68e426b5bc 100644 --- a/packages/backend/src/server/ActivityPubServerService.ts +++ b/packages/backend/src/server/ActivityPubServerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -28,8 +28,7 @@ import { UtilityService } from '@/core/UtilityService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; import { IActivity } from '@/core/activitypub/type.js'; -import { isQuote, isRenote } from '@/misc/is-renote.js'; -import * as Acct from '@/misc/acct.js'; +import { isPureRenote } from '@/misc/is-pure-renote.js'; import type { FastifyInstance, FastifyRequest, FastifyReply, FastifyPluginOptions, FastifyBodyParser } from 'fastify'; import type { FindOptionsWhere } from 'typeorm'; @@ -92,7 +91,7 @@ export class ActivityPubServerService { */ @bindThis private async packActivity(note: MiNote): Promise { - if (isRenote(note) && !isQuote(note)) { + if (isPureRenote(note)) { const renote = await this.notesRepository.findOneByOrFail({ id: note.renoteId }); return this.apRendererService.renderAnnounce(renote.uri ? renote.uri : `${this.config.url}/notes/${renote.id}`, note); } @@ -487,16 +486,6 @@ export class ActivityPubServerService { return; } - // リモートだったらリダイレクト - if (user.host != null) { - if (user.uri == null || this.utilityService.isSelfHost(user.host)) { - reply.code(500); - return; - } - reply.redirect(user.uri, 301); - return; - } - reply.header('Cache-Control', 'public, max-age=180'); this.setResponseType(request, reply); return (this.apRendererService.addContext(await this.apRendererService.renderPerson(user as MiLocalUser))); @@ -659,26 +648,21 @@ export class ActivityPubServerService { }); fastify.get<{ Params: { user: string; } }>('/users/:user', { constraints: { apOrHtml: 'ap' } }, async (request, reply) => { - vary(reply.raw, 'Accept'); - const userId = request.params.user; const user = await this.usersRepository.findOneBy({ id: userId, + host: IsNull(), isSuspended: false, }); return await this.userInfo(request, reply, user); }); - fastify.get<{ Params: { acct: string; } }>('/@:acct', { constraints: { apOrHtml: 'ap' } }, async (request, reply) => { - vary(reply.raw, 'Accept'); - - const acct = Acct.parse(request.params.acct); - + fastify.get<{ Params: { user: string; } }>('/@:user', { constraints: { apOrHtml: 'ap' } }, async (request, reply) => { const user = await this.usersRepository.findOneBy({ - usernameLower: acct.username, - host: acct.host ?? IsNull(), + usernameLower: request.params.user.toLowerCase(), + host: IsNull(), isSuspended: false, }); diff --git a/packages/backend/src/server/FileServerService.ts b/packages/backend/src/server/FileServerService.ts index bf0a011699..0c7fc8cefe 100644 --- a/packages/backend/src/server/FileServerService.ts +++ b/packages/backend/src/server/FileServerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -9,7 +9,7 @@ import { dirname } from 'node:path'; import { Inject, Injectable } from '@nestjs/common'; import rename from 'rename'; import sharp from 'sharp'; -import { sharpBmp } from '@misskey-dev/sharp-read-bmp'; +import { sharpBmp } from 'sharp-read-bmp'; import type { Config } from '@/config.js'; import type { MiDriveFile, DriveFilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; @@ -27,7 +27,6 @@ import { LoggerService } from '@/core/LoggerService.js'; import { bindThis } from '@/decorators.js'; import { isMimeImage } from '@/misc/is-mime-image.js'; import { correctFilename } from '@/misc/correct-filename.js'; -import { handleRequestRedirectToOmitSearch } from '@/misc/fastify-hook-handlers.js'; import type { FastifyInstance, FastifyRequest, FastifyReply, FastifyPluginOptions } from 'fastify'; const _filename = fileURLToPath(import.meta.url); @@ -53,7 +52,7 @@ export class FileServerService { private internalStorageService: InternalStorageService, private loggerService: LoggerService, ) { - this.logger = this.loggerService.getLogger('server', 'gray'); + this.logger = this.loggerService.getLogger('server', 'gray', false); //this.createServer = this.createServer.bind(this); } @@ -68,23 +67,20 @@ export class FileServerService { done(); }); - fastify.register((fastify, options, done) => { - fastify.addHook('onRequest', handleRequestRedirectToOmitSearch); - fastify.get('/files/app-default.jpg', (request, reply) => { - const file = fs.createReadStream(`${_dirname}/assets/dummy.png`); - reply.header('Content-Type', 'image/jpeg'); - reply.header('Cache-Control', 'max-age=31536000, immutable'); - return reply.send(file); - }); + fastify.get('/files/app-default.jpg', (request, reply) => { + const file = fs.createReadStream(`${_dirname}/assets/dummy.png`); + reply.header('Content-Type', 'image/jpeg'); + reply.header('Cache-Control', 'max-age=31536000, immutable'); + return reply.send(file); + }); - fastify.get<{ Params: { key: string; } }>('/files/:key', async (request, reply) => { - return await this.sendDriveFile(request, reply) - .catch(err => this.errorHandler(request, reply, err)); - }); - fastify.get<{ Params: { key: string; } }>('/files/:key/*', async (request, reply) => { - return await reply.redirect(`${this.config.url}/files/${request.params.key}`, 301); - }); - done(); + fastify.get<{ Params: { key: string; } }>('/files/:key', async (request, reply) => { + return await this.sendDriveFile(request, reply) + .catch(err => this.errorHandler(request, reply, err)); + }); + fastify.get<{ Params: { key: string; } }>('/files/:key/*', async (request, reply) => { + return await this.sendDriveFile(request, reply) + .catch(err => this.errorHandler(request, reply, err)); }); fastify.get<{ @@ -147,12 +143,12 @@ export class FileServerService { url.searchParams.set('static', '1'); file.cleanup(); - return await reply.redirect(url.toString(), 301); + return await reply.redirect(301, url.toString()); } else if (file.mime.startsWith('video/')) { const externalThumbnail = this.videoProcessingService.getExternalVideoThumbnailUrl(file.url); if (externalThumbnail) { file.cleanup(); - return await reply.redirect(externalThumbnail, 301); + return await reply.redirect(301, externalThumbnail); } image = await this.videoProcessingService.generateVideoThumbnail(file.path); @@ -167,41 +163,16 @@ export class FileServerService { url.searchParams.set('url', file.url); file.cleanup(); - return await reply.redirect(url.toString(), 301); + return await reply.redirect(301, url.toString()); } } if (!image) { - if (request.headers.range && file.file.size > 0) { - const range = request.headers.range as string; - const parts = range.replace(/bytes=/, '').split('-'); - const start = parseInt(parts[0], 10); - let end = parts[1] ? parseInt(parts[1], 10) : file.file.size - 1; - if (end > file.file.size) { - end = file.file.size - 1; - } - const chunksize = end - start + 1; - - image = { - data: fs.createReadStream(file.path, { - start, - end, - }), - ext: file.ext, - type: file.mime, - }; - - reply.header('Content-Range', `bytes ${start}-${end}/${file.file.size}`); - reply.header('Accept-Ranges', 'bytes'); - reply.header('Content-Length', chunksize); - reply.code(206); - } else { - image = { - data: fs.createReadStream(file.path), - ext: file.ext, - type: file.mime, - }; - } + image = { + data: fs.createReadStream(file.path), + ext: file.ext, + type: file.mime, + }; } if ('pipe' in image.data && typeof image.data.pipe === 'function') { @@ -214,8 +185,6 @@ export class FileServerService { } reply.header('Content-Type', FILE_TYPE_BROWSERSAFE.includes(image.type) ? image.type : 'application/octet-stream'); - reply.header('Content-Length', file.file.size); - reply.header('Cache-Control', 'max-age=31536000, immutable'); reply.header('Content-Disposition', contentDisposition( 'inline', @@ -234,54 +203,11 @@ export class FileServerService { reply.header('Content-Type', FILE_TYPE_BROWSERSAFE.includes(file.mime) ? file.mime : 'application/octet-stream'); reply.header('Cache-Control', 'max-age=31536000, immutable'); reply.header('Content-Disposition', contentDisposition('inline', filename)); - - if (request.headers.range && file.file.size > 0) { - const range = request.headers.range as string; - const parts = range.replace(/bytes=/, '').split('-'); - const start = parseInt(parts[0], 10); - let end = parts[1] ? parseInt(parts[1], 10) : file.file.size - 1; - if (end > file.file.size) { - end = file.file.size - 1; - } - const chunksize = end - start + 1; - const fileStream = fs.createReadStream(file.path, { - start, - end, - }); - reply.header('Content-Range', `bytes ${start}-${end}/${file.file.size}`); - reply.header('Accept-Ranges', 'bytes'); - reply.header('Content-Length', chunksize); - reply.code(206); - return fileStream; - } - return fs.createReadStream(file.path); } else { reply.header('Content-Type', FILE_TYPE_BROWSERSAFE.includes(file.file.type) ? file.file.type : 'application/octet-stream'); - reply.header('Content-Length', file.file.size); reply.header('Cache-Control', 'max-age=31536000, immutable'); reply.header('Content-Disposition', contentDisposition('inline', file.filename)); - - if (request.headers.range && file.file.size > 0) { - const range = request.headers.range as string; - const parts = range.replace(/bytes=/, '').split('-'); - const start = parseInt(parts[0], 10); - let end = parts[1] ? parseInt(parts[1], 10) : file.file.size - 1; - if (end > file.file.size) { - end = file.file.size - 1; - } - const chunksize = end - start + 1; - const fileStream = fs.createReadStream(file.path, { - start, - end, - }); - reply.header('Content-Range', `bytes ${start}-${end}/${file.file.size}`); - reply.header('Accept-Ranges', 'bytes'); - reply.header('Content-Length', chunksize); - reply.code(206); - return fileStream; - } - return fs.createReadStream(file.path); } } catch (e) { @@ -314,17 +240,11 @@ export class FileServerService { } return await reply.redirect( - url.toString(), 301, + url.toString(), ); } - if (!request.headers['user-agent']) { - throw new StatusError('User-Agent is required', 400, 'User-Agent is required'); - } else if (request.headers['user-agent'].toLowerCase().indexOf('misskey/') !== -1) { - throw new StatusError('Refusing to proxy a request from another proxy', 403, 'Proxy is recursive'); - } - // Create temp file const file = await this.getStreamAndTypeFromUrl(url); if (file === '404') { @@ -420,36 +340,11 @@ export class FileServerService { } if (!image) { - if (request.headers.range && file.file && file.file.size > 0) { - const range = request.headers.range as string; - const parts = range.replace(/bytes=/, '').split('-'); - const start = parseInt(parts[0], 10); - let end = parts[1] ? parseInt(parts[1], 10) : file.file.size - 1; - if (end > file.file.size) { - end = file.file.size - 1; - } - const chunksize = end - start + 1; - - image = { - data: fs.createReadStream(file.path, { - start, - end, - }), - ext: file.ext, - type: file.mime, - }; - - reply.header('Content-Range', `bytes ${start}-${end}/${file.file.size}`); - reply.header('Accept-Ranges', 'bytes'); - reply.header('Content-Length', chunksize); - reply.code(206); - } else { - image = { - data: fs.createReadStream(file.path), - ext: file.ext, - type: file.mime, - }; - } + image = { + data: fs.createReadStream(file.path), + ext: file.ext, + type: file.mime, + }; } if ('cleanup' in file) { @@ -539,7 +434,6 @@ export class FileServerService { if (!file.storedInternal) { if (!(file.isLink && file.uri)) return '204'; const result = await this.downloadAndDetectTypeFromUrl(file.uri); - file.size = (await fs.promises.stat(result.path)).size; // DB file.sizeは正確とは限らないので return { ...result, url: file.uri, diff --git a/packages/backend/src/server/HealthServerService.ts b/packages/backend/src/server/HealthServerService.ts deleted file mode 100644 index 5980609f02..0000000000 --- a/packages/backend/src/server/HealthServerService.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import * as Redis from 'ioredis'; -import { DataSource } from 'typeorm'; -import { bindThis } from '@/decorators.js'; -import { DI } from '@/di-symbols.js'; -import { readyRef } from '@/boot/ready.js'; -import type { FastifyInstance, FastifyPluginOptions } from 'fastify'; -import type { MeiliSearch } from 'meilisearch'; - -@Injectable() -export class HealthServerService { - constructor( - @Inject(DI.redis) - private redis: Redis.Redis, - - @Inject(DI.redisForPub) - private redisForPub: Redis.Redis, - - @Inject(DI.redisForSub) - private redisForSub: Redis.Redis, - - @Inject(DI.redisForTimelines) - private redisForTimelines: Redis.Redis, - - @Inject(DI.redisForReactions) - private redisForReactions: Redis.Redis, - - @Inject(DI.db) - private db: DataSource, - - @Inject(DI.meilisearch) - private meilisearch: MeiliSearch | null, - ) {} - - @bindThis - public createServer(fastify: FastifyInstance, options: FastifyPluginOptions, done: (err?: Error) => void) { - fastify.get('/', async (request, reply) => { - reply.code(await Promise.all([ - new Promise((resolve, reject) => readyRef.value ? resolve() : reject()), - this.redis.ping(), - this.redisForPub.ping(), - this.redisForSub.ping(), - this.redisForTimelines.ping(), - this.redisForReactions.ping(), - this.db.query('SELECT 1'), - ...(this.meilisearch ? [this.meilisearch.health()] : []), - ]).then(() => 200, () => 503)); - reply.header('Cache-Control', 'no-store'); - }); - - done(); - } -} diff --git a/packages/backend/src/server/NodeinfoServerService.ts b/packages/backend/src/server/NodeinfoServerService.ts index 9a641007ee..4d94fcdd54 100644 --- a/packages/backend/src/server/NodeinfoServerService.ts +++ b/packages/backend/src/server/NodeinfoServerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -37,12 +37,12 @@ export class NodeinfoServerService { @bindThis public getLinks() { 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, - }]; + 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, + }]; } @bindThis @@ -108,7 +108,6 @@ export class NodeinfoServerService { langs: meta.langs, tosUrl: meta.termsOfServiceUrl, privacyPolicyUrl: meta.privacyPolicyUrl, - inquiryUrl: meta.inquiryUrl, impressumUrl: meta.impressumUrl, repositoryUrl: meta.repositoryUrl, feedbackUrl: meta.feedbackUrl, @@ -118,8 +117,6 @@ export class NodeinfoServerService { emailRequiredForSignup: meta.emailRequiredForSignup, enableHcaptcha: meta.enableHcaptcha, enableRecaptcha: meta.enableRecaptcha, - enableMcaptcha: meta.enableMcaptcha, - enableTurnstile: meta.enableTurnstile, maxNoteTextLength: MAX_NOTE_TEXT_LENGTH, enableEmail: meta.enableEmail, enableServiceWorker: meta.enableServiceWorker, @@ -134,7 +131,7 @@ export class NodeinfoServerService { return document; }; - const cache = new MemorySingleCache>>(1000 * 60 * 10); // 10m + const cache = new MemorySingleCache>>(1000 * 60 * 10); fastify.get(nodeinfo2_1path, async (request, reply) => { const base = await cache.fetch(() => nodeinfo2(21)); diff --git a/packages/backend/src/server/ServerModule.ts b/packages/backend/src/server/ServerModule.ts index 3ab0b815f2..fa81380f01 100644 --- a/packages/backend/src/server/ServerModule.ts +++ b/packages/backend/src/server/ServerModule.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,7 +8,6 @@ import { EndpointsModule } from '@/server/api/EndpointsModule.js'; import { CoreModule } from '@/core/CoreModule.js'; import { ApiCallService } from './api/ApiCallService.js'; import { FileServerService } from './FileServerService.js'; -import { HealthServerService } from './HealthServerService.js'; import { NodeinfoServerService } from './NodeinfoServerService.js'; import { ServerService } from './ServerService.js'; import { WellKnownServerService } from './WellKnownServerService.js'; @@ -23,13 +22,9 @@ import { SigninApiService } from './api/SigninApiService.js'; import { SigninService } from './api/SigninService.js'; import { SignupApiService } from './api/SignupApiService.js'; import { StreamingApiServerService } from './api/StreamingApiServerService.js'; -import { OpenApiServerService } from './api/openapi/OpenApiServerService.js'; import { ClientServerService } from './web/ClientServerService.js'; import { FeedService } from './web/FeedService.js'; import { UrlPreviewService } from './web/UrlPreviewService.js'; -import { ClientLoggerService } from './web/ClientLoggerService.js'; -import { OAuth2ProviderService } from './oauth/OAuth2ProviderService.js'; - import { MainChannelService } from './api/stream/channels/main.js'; import { AdminChannelService } from './api/stream/channels/admin.js'; import { AntennaChannelService } from './api/stream/channels/antenna.js'; @@ -43,10 +38,10 @@ import { LocalTimelineChannelService } from './api/stream/channels/local-timelin import { QueueStatsChannelService } from './api/stream/channels/queue-stats.js'; import { ServerStatsChannelService } from './api/stream/channels/server-stats.js'; 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 { ReversiChannelService } from './api/stream/channels/reversi.js'; -import { ReversiGameChannelService } from './api/stream/channels/reversi-game.js'; -import { SigninWithPasskeyApiService } from './api/SigninWithPasskeyApiService.js'; +import { OAuth2ProviderService } from './oauth/OAuth2ProviderService.js'; @Module({ imports: [ @@ -57,7 +52,6 @@ import { SigninWithPasskeyApiService } from './api/SigninWithPasskeyApiService.j ClientServerService, ClientLoggerService, FeedService, - HealthServerService, UrlPreviewService, ActivityPubServerService, FileServerService, @@ -72,7 +66,6 @@ import { SigninWithPasskeyApiService } from './api/SigninWithPasskeyApiService.j AuthenticateService, RateLimiterService, SigninApiService, - SigninWithPasskeyApiService, SigninService, SignupApiService, StreamingApiServerService, @@ -84,8 +77,6 @@ import { SigninWithPasskeyApiService } from './api/SigninWithPasskeyApiService.j GlobalTimelineChannelService, HashtagChannelService, RoleTimelineChannelService, - ReversiChannelService, - ReversiGameChannelService, HomeTimelineChannelService, HybridTimelineChannelService, LocalTimelineChannelService, diff --git a/packages/backend/src/server/ServerService.ts b/packages/backend/src/server/ServerService.ts index fd2bd3267d..632a7692cd 100644 --- a/packages/backend/src/server/ServerService.ts +++ b/packages/backend/src/server/ServerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -13,21 +13,22 @@ import fastifyRawBody from 'fastify-raw-body'; import { IsNull } from 'typeorm'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import type { Config } from '@/config.js'; -import type { EmojisRepository, MiMeta, UserProfilesRepository, UsersRepository } from '@/models/_.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'; import { genIdenticon } from '@/misc/gen-identicon.js'; +import { createTemp } from '@/misc/create-temp.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { LoggerService } from '@/core/LoggerService.js'; import { bindThis } from '@/decorators.js'; +import { MetaService } from '@/core/MetaService.js'; import { ActivityPubServerService } from './ActivityPubServerService.js'; import { NodeinfoServerService } from './NodeinfoServerService.js'; import { ApiServerService } from './api/ApiServerService.js'; import { StreamingApiServerService } from './api/StreamingApiServerService.js'; import { WellKnownServerService } from './WellKnownServerService.js'; import { FileServerService } from './FileServerService.js'; -import { HealthServerService } from './HealthServerService.js'; import { ClientServerService } from './web/ClientServerService.js'; import { OpenApiServerService } from './api/openapi/OpenApiServerService.js'; import { OAuth2ProviderService } from './oauth/OAuth2ProviderService.js'; @@ -43,9 +44,6 @@ export class ServerService implements OnApplicationShutdown { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -55,6 +53,7 @@ export class ServerService implements OnApplicationShutdown { @Inject(DI.emojisRepository) private emojisRepository: EmojisRepository, + private metaService: MetaService, private userEntityService: UserEntityService, private apiServerService: ApiServerService, private openApiServerService: OpenApiServerService, @@ -63,13 +62,12 @@ export class ServerService implements OnApplicationShutdown { private wellKnownServerService: WellKnownServerService, private nodeinfoServerService: NodeinfoServerService, private fileServerService: FileServerService, - private healthServerService: HealthServerService, private clientServerService: ClientServerService, private globalEventService: GlobalEventService, private loggerService: LoggerService, private oauth2ProviderService: OAuth2ProviderService, ) { - this.logger = this.loggerService.getLogger('server', 'gray'); + this.logger = this.loggerService.getLogger('server', 'gray', false); } @bindThis @@ -111,7 +109,6 @@ export class ServerService implements OnApplicationShutdown { fastify.register(this.wellKnownServerService.createServer); fastify.register(this.oauth2ProviderService.createServer, { prefix: '/oauth' }); fastify.register(this.oauth2ProviderService.createTokenServer, { prefix: '/oauth/token' }); - fastify.register(this.healthServerService.createServer, { prefix: '/healthz' }); fastify.get<{ Params: { path: string }; Querystring: { static?: any; badge?: any; }; }>('/emoji/:path(.*)', async (request, reply) => { const path = request.params.path; @@ -123,20 +120,12 @@ export class ServerService implements OnApplicationShutdown { return; } - const emojiPath = path.replace(/\.webp$/i, ''); - const pathChunks = emojiPath.split('@'); - - if (pathChunks.length > 2) { - reply.code(400); - return; - } - - const name = pathChunks.shift(); - const host = pathChunks.pop(); + const name = path.split('@')[0].replace(/\.webp$/i, ''); + const host = path.split('@')[1]?.replace(/\.webp$/i, ''); const emoji = await this.emojisRepository.findOneBy({ // `@.` is the spec of ReactionService.decodeReaction - host: (host === undefined || host === '.') ? IsNull() : host, + host: (host == null || host === '.') ? IsNull() : host, name: name, }); @@ -166,8 +155,8 @@ export class ServerService implements OnApplicationShutdown { } return await reply.redirect( - url.toString(), 301, + url.toString(), ); }); @@ -194,8 +183,10 @@ export class ServerService implements OnApplicationShutdown { reply.header('Content-Type', 'image/png'); reply.header('Cache-Control', 'public, max-age=86400'); - if (this.meta.enableIdenticonGeneration) { - return await genIdenticon(request.params.x); + if ((await this.metaService.fetch()).enableIdenticonGeneration) { + const [temp, cleanup] = await createTemp(); + await genIdenticon(request.params.x, fs.createWriteStream(temp)); + return fs.createReadStream(temp).on('close', () => cleanup()); } else { return reply.redirect('/static-assets/avatar.png'); } @@ -213,7 +204,7 @@ export class ServerService implements OnApplicationShutdown { }); this.globalEventService.publishMainStream(profile.userId, 'meUpdated', await this.userEntityService.pack(profile.userId, { id: profile.userId }, { - schema: 'MeDetailed', + detail: true, includeSecrets: true, })); diff --git a/packages/backend/src/server/WellKnownServerService.ts b/packages/backend/src/server/WellKnownServerService.ts index 8e326da89a..c3eaf53a14 100644 --- a/packages/backend/src/server/WellKnownServerService.ts +++ b/packages/backend/src/server/WellKnownServerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/ApiCallService.ts b/packages/backend/src/server/api/ApiCallService.ts index aad833f126..56f804dee8 100644 --- a/packages/backend/src/server/api/ApiCallService.ts +++ b/packages/backend/src/server/api/ApiCallService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,17 +7,16 @@ import { randomUUID } from 'node:crypto'; import * as fs from 'node:fs'; import * as stream from 'node:stream/promises'; import { Inject, Injectable } from '@nestjs/common'; -import * as Sentry from '@sentry/node'; import { DI } from '@/di-symbols.js'; import { getIpHash } from '@/misc/get-ip-hash.js'; import type { MiLocalUser, MiUser } from '@/models/User.js'; import type { MiAccessToken } from '@/models/AccessToken.js'; import type Logger from '@/logger.js'; -import type { MiMeta, UserIpsRepository } from '@/models/_.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'; import { RoleService } from '@/core/RoleService.js'; -import type { Config } from '@/config.js'; import { ApiError } from './error.js'; import { RateLimiterService } from './RateLimiterService.js'; import { ApiLoggerService } from './ApiLoggerService.js'; @@ -39,15 +38,10 @@ export class ApiCallService implements OnApplicationShutdown { private userIpHistoriesClearIntervalId: NodeJS.Timeout; constructor( - @Inject(DI.meta) - private meta: MiMeta, - - @Inject(DI.config) - private config: Config, - @Inject(DI.userIpsRepository) private userIpsRepository: UserIpsRepository, + private metaService: MetaService, private authenticateService: AuthenticateService, private rateLimiterService: RateLimiterService, private roleService: RoleService, @@ -65,16 +59,6 @@ export class ApiCallService implements OnApplicationShutdown { let statusCode = err.httpStatusCode; if (err.httpStatusCode === 401) { reply.header('WWW-Authenticate', 'Bearer realm="Misskey"'); - } else if (err.code === 'RATE_LIMIT_EXCEEDED') { - const info: unknown = err.info; - const unixEpochInSeconds = Date.now(); - if (typeof(info) === 'object' && info && 'resetMs' in info && typeof(info.resetMs) === 'number') { - const cooldownInSeconds = Math.ceil((info.resetMs - unixEpochInSeconds) / 1000); - // もしかするとマイナスになる可能性がなくはないのでマイナスだったら0にしておく - reply.header('Retry-After', Math.max(cooldownInSeconds, 0).toString(10)); - } else { - this.logger.warn(`rate limit information has unexpected type ${typeof(err.info?.reset)}`); - } } else if (err.kind === 'client') { reply.header('WWW-Authenticate', `Bearer realm="Misskey", error="invalid_request", error_description="${err.message}"`); statusCode = statusCode ?? 400; @@ -104,51 +88,6 @@ export class ApiCallService implements OnApplicationShutdown { } } - #onExecError(ep: IEndpoint, data: any, err: Error, userId?: MiUser['id']): void { - if (err instanceof ApiError || err instanceof AuthenticationError) { - throw err; - } else { - const errId = randomUUID(); - this.logger.error(`Internal error occurred in ${ep.name}: ${err.message}`, { - ep: ep.name, - ps: data, - e: { - message: err.message, - code: err.name, - stack: err.stack, - id: errId, - }, - }); - - if (this.config.sentryForBackend) { - Sentry.captureMessage(`Internal error occurred in ${ep.name}: ${err.message}`, { - level: 'error', - user: { - id: userId, - }, - extra: { - ep: ep.name, - ps: data, - e: { - message: err.message, - code: err.name, - stack: err.stack, - id: errId, - }, - }, - }); - } - - throw new ApiError(null, { - e: { - message: err.message, - code: err.name, - id: errId, - }, - }); - } - } - @bindThis public handleRequest( endpoint: IEndpoint & { exec: any }, @@ -200,18 +139,9 @@ export class ApiCallService implements OnApplicationShutdown { return; } - const [path, cleanup] = await createTemp(); + const [path] = await createTemp(); await stream.pipeline(multipartData.file, fs.createWriteStream(path)); - // ファイルサイズが制限を超えていた場合 - // なお truncated はストリームを読み切ってからでないと機能しないため、stream.pipeline より後にある必要がある - if (multipartData.file.truncated) { - cleanup(); - reply.code(413); - reply.send(); - return; - } - const fields = {} as Record; for (const [k, v] of Object.entries(multipartData.fields)) { fields[k] = typeof v === 'object' && 'value' in v ? v.value : undefined; @@ -266,8 +196,9 @@ export class ApiCallService implements OnApplicationShutdown { } @bindThis - private logIp(request: FastifyRequest, user: MiLocalUser) { - if (!this.meta.enableIpLogging) return; + private async logIp(request: FastifyRequest, user: MiLocalUser) { + const meta = await this.metaService.fetch(); + if (!meta.enableIpLogging) return; const ip = request.ip; const ips = this.userIpHistories.get(user.id); if (ips == null || !ips.has(ip)) { @@ -327,17 +258,12 @@ export class ApiCallService implements OnApplicationShutdown { if (factor > 0) { // Rate limit await this.rateLimiterService.limit(limit as IEndpointMeta['limit'] & { key: NonNullable }, limitActor, factor).catch(err => { - if ('info' in err) { - // errはLimiter.LimiterInfoであることが期待される - throw new ApiError({ - message: 'Rate limit exceeded. Please try again later.', - code: 'RATE_LIMIT_EXCEEDED', - id: 'd5826d14-3982-4d2e-8011-b9e9f02499ef', - httpStatusCode: 429, - }, err.info); - } else { - throw new TypeError('information must be a rate-limiter information.'); - } + throw new ApiError({ + message: 'Rate limit exceeded. Please try again later.', + code: 'RATE_LIMIT_EXCEEDED', + id: 'd5826d14-3982-4d2e-8011-b9e9f02499ef', + httpStatusCode: 429, + }); }); } } @@ -436,15 +362,31 @@ export class ApiCallService implements OnApplicationShutdown { } // API invoking - if (this.config.sentryForBackend) { - return await Sentry.startSpan({ - name: 'API: ' + ep.name, - }, () => ep.exec(data, user, token, file, request.ip, request.headers) - .catch((err: Error) => this.#onExecError(ep, data, err, user?.id))); - } else { - return await ep.exec(data, user, token, file, request.ip, request.headers) - .catch((err: Error) => this.#onExecError(ep, data, err, user?.id)); - } + return await ep.exec(data, user, token, file, request.ip, request.headers).catch((err: Error) => { + if (err instanceof ApiError || err instanceof AuthenticationError) { + throw err; + } else { + const errId = randomUUID(); + this.logger.error(`Internal error occurred in ${ep.name}: ${err.message}`, { + ep: ep.name, + ps: data, + e: { + message: err.message, + code: err.name, + stack: err.stack, + id: errId, + }, + }); + console.error(err, errId); + throw new ApiError(null, { + e: { + message: err.message, + code: err.name, + id: errId, + }, + }); + } + }); } @bindThis diff --git a/packages/backend/src/server/api/ApiLoggerService.ts b/packages/backend/src/server/api/ApiLoggerService.ts index 72b71c0b5c..2339366a5d 100644 --- a/packages/backend/src/server/api/ApiLoggerService.ts +++ b/packages/backend/src/server/api/ApiLoggerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/ApiServerService.ts b/packages/backend/src/server/api/ApiServerService.ts index 3a8cb19f01..1758c03aca 100644 --- a/packages/backend/src/server/api/ApiServerService.ts +++ b/packages/backend/src/server/api/ApiServerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,7 +8,6 @@ import cors from '@fastify/cors'; import multipart from '@fastify/multipart'; import fastifyCookie from '@fastify/cookie'; import { ModuleRef } from '@nestjs/core'; -import { AuthenticationResponseJSON } from '@simplewebauthn/types'; import type { Config } from '@/config.js'; import type { InstancesRepository, AccessTokensRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; @@ -18,7 +17,6 @@ import endpoints from './endpoints.js'; import { ApiCallService } from './ApiCallService.js'; import { SignupApiService } from './SignupApiService.js'; import { SigninApiService } from './SigninApiService.js'; -import { SigninWithPasskeyApiService } from './SigninWithPasskeyApiService.js'; import type { FastifyInstance, FastifyPluginOptions } from 'fastify'; @Injectable() @@ -39,7 +37,6 @@ export class ApiServerService { private apiCallService: ApiCallService, private signupApiService: SignupApiService, private signinApiService: SigninApiService, - private signinWithPasskeyApiService: SigninWithPasskeyApiService, ) { //this.createServer = this.createServer.bind(this); } @@ -52,7 +49,7 @@ export class ApiServerService { fastify.register(multipart, { limits: { - fileSize: this.config.maxFileSize, + fileSize: this.config.maxFileSize ?? 262144000, files: 1, }, }); @@ -118,31 +115,21 @@ export class ApiServerService { 'hcaptcha-response'?: string; 'g-recaptcha-response'?: string; 'turnstile-response'?: string; - 'm-captcha-response'?: string; - 'testcaptcha-response'?: string; } }>('/signup', (request, reply) => this.signupApiService.signup(request, reply)); fastify.post<{ Body: { username: string; - password?: string; + password: string; token?: string; - credential?: AuthenticationResponseJSON; - 'hcaptcha-response'?: string; - 'g-recaptcha-response'?: string; - 'turnstile-response'?: string; - 'm-captcha-response'?: string; - 'testcaptcha-response'?: string; + signature?: string; + authenticatorData?: string; + clientDataJSON?: string; + credentialId?: string; + challengeId?: string; }; - }>('/signin-flow', (request, reply) => this.signinApiService.signin(request, reply)); - - fastify.post<{ - Body: { - credential?: AuthenticationResponseJSON; - context?: string; - }; - }>('/signin-with-passkey', (request, reply) => this.signinWithPasskeyApiService.signin(request, reply)); + }>('/signin', (request, reply) => this.signinApiService.signin(request, reply)); fastify.post<{ Body: { code: string; } }>('/signup-pending', (request, reply) => this.signupApiService.signupPending(request, reply)); @@ -150,7 +137,7 @@ export class ApiServerService { const instances = await this.instancesRepository.find({ select: ['host'], where: { - suspensionState: 'none', + isSuspended: false, }, }); @@ -170,7 +157,7 @@ export class ApiServerService { return { ok: true, token: token.token, - user: await this.userEntityService.pack(token.userId, null, { schema: 'UserDetailedNotMe' }), + user: await this.userEntityService.pack(token.userId, null, { detail: true }), }; } else { return { diff --git a/packages/backend/src/server/api/AuthenticateService.ts b/packages/backend/src/server/api/AuthenticateService.ts index 690ff2e022..f075688194 100644 --- a/packages/backend/src/server/api/AuthenticateService.ts +++ b/packages/backend/src/server/api/AuthenticateService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -37,7 +37,7 @@ export class AuthenticateService implements OnApplicationShutdown { private cacheService: CacheService, ) { - this.appCache = new MemoryKVCache(1000 * 60 * 60 * 24 * 7); // 1w + this.appCache = new MemoryKVCache(Infinity); } @bindThis diff --git a/packages/backend/src/server/api/EndpointsModule.ts b/packages/backend/src/server/api/EndpointsModule.ts index 3557fa40a5..86a64d7121 100644 --- a/packages/backend/src/server/api/EndpointsModule.ts +++ b/packages/backend/src/server/api/EndpointsModule.ts @@ -1,18 +1,13 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Module } from '@nestjs/common'; import { CoreModule } from '@/core/CoreModule.js'; -import * as ep___admin_abuseReport_notificationRecipient_list from '@/server/api/endpoints/admin/abuse-report/notification-recipient/list.js'; -import * as ep___admin_abuseReport_notificationRecipient_show from '@/server/api/endpoints/admin/abuse-report/notification-recipient/show.js'; -import * as ep___admin_abuseReport_notificationRecipient_create from '@/server/api/endpoints/admin/abuse-report/notification-recipient/create.js'; -import * as ep___admin_abuseReport_notificationRecipient_update from '@/server/api/endpoints/admin/abuse-report/notification-recipient/update.js'; -import * as ep___admin_abuseReport_notificationRecipient_delete from '@/server/api/endpoints/admin/abuse-report/notification-recipient/delete.js'; -import * as ep___admin_abuseUserReports from './endpoints/admin/abuse-user-reports.js'; import * as ep___admin_meta from './endpoints/admin/meta.js'; +import * as ep___admin_abuseUserReports from './endpoints/admin/abuse-user-reports.js'; import * as ep___admin_accounts_create from './endpoints/admin/accounts/create.js'; import * as ep___admin_accounts_delete from './endpoints/admin/accounts/delete.js'; import * as ep___admin_accounts_findByEmail from './endpoints/admin/accounts/find-by-email.js'; @@ -68,8 +63,6 @@ import * as ep___admin_relays_list from './endpoints/admin/relays/list.js'; import * as ep___admin_relays_remove from './endpoints/admin/relays/remove.js'; import * as ep___admin_resetPassword from './endpoints/admin/reset-password.js'; import * as ep___admin_resolveAbuseUserReport from './endpoints/admin/resolve-abuse-user-report.js'; -import * as ep___admin_forwardAbuseUserReport from './endpoints/admin/forward-abuse-user-report.js'; -import * as ep___admin_updateAbuseUserReport from './endpoints/admin/update-abuse-user-report.js'; import * as ep___admin_sendEmail from './endpoints/admin/send-email.js'; import * as ep___admin_serverInfo from './endpoints/admin/server-info.js'; import * as ep___admin_showModerationLogs from './endpoints/admin/show-moderation-logs.js'; @@ -89,14 +82,7 @@ import * as ep___admin_roles_assign from './endpoints/admin/roles/assign.js'; import * as ep___admin_roles_unassign from './endpoints/admin/roles/unassign.js'; import * as ep___admin_roles_updateDefaultPolicies from './endpoints/admin/roles/update-default-policies.js'; import * as ep___admin_roles_users from './endpoints/admin/roles/users.js'; -import * as ep___admin_systemWebhook_create from './endpoints/admin/system-webhook/create.js'; -import * as ep___admin_systemWebhook_delete from './endpoints/admin/system-webhook/delete.js'; -import * as ep___admin_systemWebhook_list from './endpoints/admin/system-webhook/list.js'; -import * as ep___admin_systemWebhook_show from './endpoints/admin/system-webhook/show.js'; -import * as ep___admin_systemWebhook_update from './endpoints/admin/system-webhook/update.js'; -import * as ep___admin_systemWebhook_test from './endpoints/admin/system-webhook/test.js'; import * as ep___announcements from './endpoints/announcements.js'; -import * as ep___announcements_show from './endpoints/announcements/show.js'; import * as ep___antennas_create from './endpoints/antennas/create.js'; import * as ep___antennas_delete from './endpoints/antennas/delete.js'; import * as ep___antennas_list from './endpoints/antennas/list.js'; @@ -222,7 +208,6 @@ import * as ep___i_exportBlocking from './endpoints/i/export-blocking.js'; import * as ep___i_exportFollowing from './endpoints/i/export-following.js'; import * as ep___i_exportMute from './endpoints/i/export-mute.js'; import * as ep___i_exportNotes from './endpoints/i/export-notes.js'; -import * as ep___i_exportClips from './endpoints/i/export-clips.js'; import * as ep___i_exportFavorites from './endpoints/i/export-favorites.js'; import * as ep___i_exportUserLists from './endpoints/i/export-user-lists.js'; import * as ep___i_exportAntennas from './endpoints/i/export-antennas.js'; @@ -261,7 +246,6 @@ import * as ep___i_webhooks_show from './endpoints/i/webhooks/show.js'; import * as ep___i_webhooks_list from './endpoints/i/webhooks/list.js'; import * as ep___i_webhooks_update from './endpoints/i/webhooks/update.js'; import * as ep___i_webhooks_delete from './endpoints/i/webhooks/delete.js'; -import * as ep___i_webhooks_test from './endpoints/i/webhooks/test.js'; import * as ep___invite_create from './endpoints/invite/create.js'; import * as ep___invite_delete from './endpoints/invite/delete.js'; import * as ep___invite_list from './endpoints/invite/list.js'; @@ -308,7 +292,6 @@ import * as ep___notes_translate from './endpoints/notes/translate.js'; 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_flush from './endpoints/notifications/flush.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'; @@ -380,26 +363,12 @@ import * as ep___users_updateMemo from './endpoints/users/update-memo.js'; import * as ep___fetchRss from './endpoints/fetch-rss.js'; import * as ep___fetchExternalResources from './endpoints/fetch-external-resources.js'; import * as ep___retention from './endpoints/retention.js'; -import * as ep___bubbleGame_register from './endpoints/bubble-game/register.js'; -import * as ep___bubbleGame_ranking from './endpoints/bubble-game/ranking.js'; -import * as ep___reversi_cancelMatch from './endpoints/reversi/cancel-match.js'; -import * as ep___reversi_games from './endpoints/reversi/games.js'; -import * as ep___reversi_match from './endpoints/reversi/match.js'; -import * as ep___reversi_invitations from './endpoints/reversi/invitations.js'; -import * as ep___reversi_showGame from './endpoints/reversi/show-game.js'; -import * as ep___reversi_surrender from './endpoints/reversi/surrender.js'; -import * as ep___reversi_verify from './endpoints/reversi/verify.js'; import { GetterService } from './GetterService.js'; import { ApiLoggerService } from './ApiLoggerService.js'; import type { Provider } from '@nestjs/common'; const $admin_meta: Provider = { provide: 'ep:admin/meta', useClass: ep___admin_meta.default }; const $admin_abuseUserReports: Provider = { provide: 'ep:admin/abuse-user-reports', useClass: ep___admin_abuseUserReports.default }; -const $admin_abuseReport_notificationRecipient_list: Provider = { provide: 'ep:admin/abuse-report/notification-recipient/list', useClass: ep___admin_abuseReport_notificationRecipient_list.default }; -const $admin_abuseReport_notificationRecipient_show: Provider = { provide: 'ep:admin/abuse-report/notification-recipient/show', useClass: ep___admin_abuseReport_notificationRecipient_show.default }; -const $admin_abuseReport_notificationRecipient_create: Provider = { provide: 'ep:admin/abuse-report/notification-recipient/create', useClass: ep___admin_abuseReport_notificationRecipient_create.default }; -const $admin_abuseReport_notificationRecipient_update: Provider = { provide: 'ep:admin/abuse-report/notification-recipient/update', useClass: ep___admin_abuseReport_notificationRecipient_update.default }; -const $admin_abuseReport_notificationRecipient_delete: Provider = { provide: 'ep:admin/abuse-report/notification-recipient/delete', useClass: ep___admin_abuseReport_notificationRecipient_delete.default }; const $admin_accounts_create: Provider = { provide: 'ep:admin/accounts/create', useClass: ep___admin_accounts_create.default }; const $admin_accounts_delete: Provider = { provide: 'ep:admin/accounts/delete', useClass: ep___admin_accounts_delete.default }; const $admin_accounts_findByEmail: Provider = { provide: 'ep:admin/accounts/find-by-email', useClass: ep___admin_accounts_findByEmail.default }; @@ -455,8 +424,6 @@ const $admin_relays_list: Provider = { provide: 'ep:admin/relays/list', useClass const $admin_relays_remove: Provider = { provide: 'ep:admin/relays/remove', useClass: ep___admin_relays_remove.default }; const $admin_resetPassword: Provider = { provide: 'ep:admin/reset-password', useClass: ep___admin_resetPassword.default }; const $admin_resolveAbuseUserReport: Provider = { provide: 'ep:admin/resolve-abuse-user-report', useClass: ep___admin_resolveAbuseUserReport.default }; -const $admin_forwardAbuseUserReport: Provider = { provide: 'ep:admin/forward-abuse-user-report', useClass: ep___admin_forwardAbuseUserReport.default }; -const $admin_updateAbuseUserReport: Provider = { provide: 'ep:admin/update-abuse-user-report', useClass: ep___admin_updateAbuseUserReport.default }; const $admin_sendEmail: Provider = { provide: 'ep:admin/send-email', useClass: ep___admin_sendEmail.default }; const $admin_serverInfo: Provider = { provide: 'ep:admin/server-info', useClass: ep___admin_serverInfo.default }; const $admin_showModerationLogs: Provider = { provide: 'ep:admin/show-moderation-logs', useClass: ep___admin_showModerationLogs.default }; @@ -476,14 +443,7 @@ const $admin_roles_assign: Provider = { provide: 'ep:admin/roles/assign', useCla const $admin_roles_unassign: Provider = { provide: 'ep:admin/roles/unassign', useClass: ep___admin_roles_unassign.default }; const $admin_roles_updateDefaultPolicies: Provider = { provide: 'ep:admin/roles/update-default-policies', useClass: ep___admin_roles_updateDefaultPolicies.default }; const $admin_roles_users: Provider = { provide: 'ep:admin/roles/users', useClass: ep___admin_roles_users.default }; -const $admin_systemWebhook_create: Provider = { provide: 'ep:admin/system-webhook/create', useClass: ep___admin_systemWebhook_create.default }; -const $admin_systemWebhook_delete: Provider = { provide: 'ep:admin/system-webhook/delete', useClass: ep___admin_systemWebhook_delete.default }; -const $admin_systemWebhook_list: Provider = { provide: 'ep:admin/system-webhook/list', useClass: ep___admin_systemWebhook_list.default }; -const $admin_systemWebhook_show: Provider = { provide: 'ep:admin/system-webhook/show', useClass: ep___admin_systemWebhook_show.default }; -const $admin_systemWebhook_update: Provider = { provide: 'ep:admin/system-webhook/update', useClass: ep___admin_systemWebhook_update.default }; -const $admin_systemWebhook_test: Provider = { provide: 'ep:admin/system-webhook/test', useClass: ep___admin_systemWebhook_test.default }; const $announcements: Provider = { provide: 'ep:announcements', useClass: ep___announcements.default }; -const $announcements_show: Provider = { provide: 'ep:announcements/show', useClass: ep___announcements_show.default }; const $antennas_create: Provider = { provide: 'ep:antennas/create', useClass: ep___antennas_create.default }; const $antennas_delete: Provider = { provide: 'ep:antennas/delete', useClass: ep___antennas_delete.default }; const $antennas_list: Provider = { provide: 'ep:antennas/list', useClass: ep___antennas_list.default }; @@ -609,7 +569,6 @@ const $i_exportBlocking: Provider = { provide: 'ep:i/export-blocking', useClass: const $i_exportFollowing: Provider = { provide: 'ep:i/export-following', useClass: ep___i_exportFollowing.default }; const $i_exportMute: Provider = { provide: 'ep:i/export-mute', useClass: ep___i_exportMute.default }; const $i_exportNotes: Provider = { provide: 'ep:i/export-notes', useClass: ep___i_exportNotes.default }; -const $i_exportClips: Provider = { provide: 'ep:i/export-clips', useClass: ep___i_exportClips.default }; const $i_exportFavorites: Provider = { provide: 'ep:i/export-favorites', useClass: ep___i_exportFavorites.default }; const $i_exportUserLists: Provider = { provide: 'ep:i/export-user-lists', useClass: ep___i_exportUserLists.default }; const $i_exportAntennas: Provider = { provide: 'ep:i/export-antennas', useClass: ep___i_exportAntennas.default }; @@ -648,7 +607,6 @@ const $i_webhooks_list: Provider = { provide: 'ep:i/webhooks/list', useClass: ep const $i_webhooks_show: Provider = { provide: 'ep:i/webhooks/show', useClass: ep___i_webhooks_show.default }; const $i_webhooks_update: Provider = { provide: 'ep:i/webhooks/update', useClass: ep___i_webhooks_update.default }; const $i_webhooks_delete: Provider = { provide: 'ep:i/webhooks/delete', useClass: ep___i_webhooks_delete.default }; -const $i_webhooks_test: Provider = { provide: 'ep:i/webhooks/test', useClass: ep___i_webhooks_test.default }; const $invite_create: Provider = { provide: 'ep:invite/create', useClass: ep___invite_create.default }; const $invite_delete: Provider = { provide: 'ep:invite/delete', useClass: ep___invite_delete.default }; const $invite_list: Provider = { provide: 'ep:invite/list', useClass: ep___invite_list.default }; @@ -695,7 +653,6 @@ const $notes_translate: Provider = { provide: 'ep:notes/translate', useClass: ep const $notes_unrenote: Provider = { provide: 'ep:notes/unrenote', useClass: ep___notes_unrenote.default }; 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_flush: Provider = { provide: 'ep:notifications/flush', useClass: ep___notifications_flush.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 }; @@ -767,15 +724,6 @@ const $users_updateMemo: Provider = { provide: 'ep:users/update-memo', useClass: const $fetchRss: Provider = { provide: 'ep:fetch-rss', useClass: ep___fetchRss.default }; const $fetchExternalResources: Provider = { provide: 'ep:fetch-external-resources', useClass: ep___fetchExternalResources.default }; const $retention: Provider = { provide: 'ep:retention', useClass: ep___retention.default }; -const $bubbleGame_register: Provider = { provide: 'ep:bubble-game/register', useClass: ep___bubbleGame_register.default }; -const $bubbleGame_ranking: Provider = { provide: 'ep:bubble-game/ranking', useClass: ep___bubbleGame_ranking.default }; -const $reversi_cancelMatch: Provider = { provide: 'ep:reversi/cancel-match', useClass: ep___reversi_cancelMatch.default }; -const $reversi_games: Provider = { provide: 'ep:reversi/games', useClass: ep___reversi_games.default }; -const $reversi_match: Provider = { provide: 'ep:reversi/match', useClass: ep___reversi_match.default }; -const $reversi_invitations: Provider = { provide: 'ep:reversi/invitations', useClass: ep___reversi_invitations.default }; -const $reversi_showGame: Provider = { provide: 'ep:reversi/show-game', useClass: ep___reversi_showGame.default }; -const $reversi_surrender: Provider = { provide: 'ep:reversi/surrender', useClass: ep___reversi_surrender.default }; -const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep___reversi_verify.default }; @Module({ imports: [ @@ -786,11 +734,6 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__ ApiLoggerService, $admin_meta, $admin_abuseUserReports, - $admin_abuseReport_notificationRecipient_list, - $admin_abuseReport_notificationRecipient_show, - $admin_abuseReport_notificationRecipient_create, - $admin_abuseReport_notificationRecipient_update, - $admin_abuseReport_notificationRecipient_delete, $admin_accounts_create, $admin_accounts_delete, $admin_accounts_findByEmail, @@ -846,8 +789,6 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__ $admin_relays_remove, $admin_resetPassword, $admin_resolveAbuseUserReport, - $admin_forwardAbuseUserReport, - $admin_updateAbuseUserReport, $admin_sendEmail, $admin_serverInfo, $admin_showModerationLogs, @@ -867,14 +808,7 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__ $admin_roles_unassign, $admin_roles_updateDefaultPolicies, $admin_roles_users, - $admin_systemWebhook_create, - $admin_systemWebhook_delete, - $admin_systemWebhook_list, - $admin_systemWebhook_show, - $admin_systemWebhook_update, - $admin_systemWebhook_test, $announcements, - $announcements_show, $antennas_create, $antennas_delete, $antennas_list, @@ -1000,7 +934,6 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__ $i_exportFollowing, $i_exportMute, $i_exportNotes, - $i_exportClips, $i_exportFavorites, $i_exportUserLists, $i_exportAntennas, @@ -1039,7 +972,6 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__ $i_webhooks_show, $i_webhooks_update, $i_webhooks_delete, - $i_webhooks_test, $invite_create, $invite_delete, $invite_list, @@ -1086,7 +1018,6 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__ $notes_unrenote, $notes_userListTimeline, $notifications_create, - $notifications_flush, $notifications_markAllAsRead, $notifications_testNotification, $pagePush, @@ -1158,24 +1089,10 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__ $fetchRss, $fetchExternalResources, $retention, - $bubbleGame_register, - $bubbleGame_ranking, - $reversi_cancelMatch, - $reversi_games, - $reversi_match, - $reversi_invitations, - $reversi_showGame, - $reversi_surrender, - $reversi_verify, ], exports: [ $admin_meta, $admin_abuseUserReports, - $admin_abuseReport_notificationRecipient_list, - $admin_abuseReport_notificationRecipient_show, - $admin_abuseReport_notificationRecipient_create, - $admin_abuseReport_notificationRecipient_update, - $admin_abuseReport_notificationRecipient_delete, $admin_accounts_create, $admin_accounts_delete, $admin_accounts_findByEmail, @@ -1231,8 +1148,6 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__ $admin_relays_remove, $admin_resetPassword, $admin_resolveAbuseUserReport, - $admin_forwardAbuseUserReport, - $admin_updateAbuseUserReport, $admin_sendEmail, $admin_serverInfo, $admin_showModerationLogs, @@ -1252,14 +1167,7 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__ $admin_roles_unassign, $admin_roles_updateDefaultPolicies, $admin_roles_users, - $admin_systemWebhook_create, - $admin_systemWebhook_delete, - $admin_systemWebhook_list, - $admin_systemWebhook_show, - $admin_systemWebhook_update, - $admin_systemWebhook_test, $announcements, - $announcements_show, $antennas_create, $antennas_delete, $antennas_list, @@ -1385,7 +1293,6 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__ $i_exportFollowing, $i_exportMute, $i_exportNotes, - $i_exportClips, $i_exportFavorites, $i_exportUserLists, $i_exportAntennas, @@ -1424,7 +1331,6 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__ $i_webhooks_show, $i_webhooks_update, $i_webhooks_delete, - $i_webhooks_test, $invite_create, $invite_delete, $invite_list, @@ -1471,9 +1377,7 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__ $notes_unrenote, $notes_userListTimeline, $notifications_create, - $notifications_flush, $notifications_markAllAsRead, - $notifications_testNotification, $pagePush, $pages_create, $pages_delete, @@ -1541,15 +1445,6 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__ $fetchRss, $fetchExternalResources, $retention, - $bubbleGame_register, - $bubbleGame_ranking, - $reversi_cancelMatch, - $reversi_games, - $reversi_match, - $reversi_invitations, - $reversi_showGame, - $reversi_surrender, - $reversi_verify, ], }) export class EndpointsModule {} diff --git a/packages/backend/src/server/api/GetterService.ts b/packages/backend/src/server/api/GetterService.ts index 444e6db744..e2b98c34e7 100644 --- a/packages/backend/src/server/api/GetterService.ts +++ b/packages/backend/src/server/api/GetterService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -39,17 +39,6 @@ export class GetterService { return note; } - @bindThis - public async getNoteWithUser(noteId: MiNote['id']) { - const note = await this.notesRepository.findOne({ where: { id: noteId }, relations: ['user'] }); - - if (note == null) { - throw new IdentifiableError('9725d0ce-ba28-4dde-95a7-2cbb2c15de24', 'No such note.'); - } - - return note; - } - /** * Get user for API processing */ diff --git a/packages/backend/src/server/api/RateLimiterService.ts b/packages/backend/src/server/api/RateLimiterService.ts index 52d73baa0a..0e644aa091 100644 --- a/packages/backend/src/server/api/RateLimiterService.ts +++ b/packages/backend/src/server/api/RateLimiterService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -32,13 +32,11 @@ export class RateLimiterService { @bindThis public limit(limitation: IEndpointMeta['limit'] & { key: NonNullable }, actor: string, factor = 1) { - { - if (this.disabled) { - return Promise.resolve(); - } + return new Promise((ok, reject) => { + if (this.disabled) ok(); // Short-term limit - const min = new Promise((ok, reject) => { + const min = (): void => { const minIntervalLimiter = new Limiter({ id: `${actor}:${limitation.key}:min`, duration: limitation.minInterval! * factor, @@ -48,25 +46,25 @@ export class RateLimiterService { minIntervalLimiter.get((err, info) => { if (err) { - return reject({ code: 'ERR', info }); + return reject('ERR'); } this.logger.debug(`${actor} ${limitation.key} min remaining: ${info.remaining}`); if (info.remaining === 0) { - return reject({ code: 'BRIEF_REQUEST_INTERVAL', info }); + reject('BRIEF_REQUEST_INTERVAL'); } else { if (hasLongTermLimit) { - return max.then(ok, reject); + max(); } else { - return ok(); + ok(); } } }); - }); + }; // Long term limit - const max = new Promise((ok, reject) => { + const max = (): void => { const limiter = new Limiter({ id: `${actor}:${limitation.key}`, duration: limitation.duration! * factor, @@ -76,18 +74,18 @@ export class RateLimiterService { limiter.get((err, info) => { if (err) { - return reject({ code: 'ERR', info }); + return reject('ERR'); } this.logger.debug(`${actor} ${limitation.key} max remaining: ${info.remaining}`); if (info.remaining === 0) { - return reject({ code: 'RATE_LIMIT_EXCEEDED', info }); + reject('RATE_LIMIT_EXCEEDED'); } else { - return ok(); + ok(); } }); - }); + }; const hasShortTermLimit = typeof limitation.minInterval === 'number'; @@ -96,12 +94,12 @@ export class RateLimiterService { typeof limitation.max === 'number'; if (hasShortTermLimit) { - return min; + min(); } else if (hasLongTermLimit) { - return max; + max(); } else { - return Promise.resolve(); + ok(); } - } + }); } } diff --git a/packages/backend/src/server/api/SigninApiService.ts b/packages/backend/src/server/api/SigninApiService.ts index 1d983ca4bc..f3115690fe 100644 --- a/packages/backend/src/server/api/SigninApiService.ts +++ b/packages/backend/src/server/api/SigninApiService.ts @@ -1,18 +1,16 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; import bcrypt from 'bcryptjs'; +import * as OTPAuth from 'otpauth'; import { IsNull } from 'typeorm'; -import * as Misskey from 'misskey-js'; import { DI } from '@/di-symbols.js'; import type { - MiMeta, SigninsRepository, UserProfilesRepository, - UserSecurityKeysRepository, UsersRepository, } from '@/models/_.js'; import type { Config } from '@/config.js'; @@ -22,11 +20,9 @@ import { IdService } from '@/core/IdService.js'; import { bindThis } from '@/decorators.js'; import { WebAuthnService } from '@/core/WebAuthnService.js'; import { UserAuthService } from '@/core/UserAuthService.js'; -import { CaptchaService } from '@/core/CaptchaService.js'; -import { FastifyReplyError } from '@/misc/fastify-reply-error.js'; import { RateLimiterService } from './RateLimiterService.js'; import { SigninService } from './SigninService.js'; -import type { AuthenticationResponseJSON } from '@simplewebauthn/types'; +import type { AuthenticationResponseJSON } from '@simplewebauthn/typescript-types'; import type { FastifyReply, FastifyRequest } from 'fastify'; @Injectable() @@ -35,18 +31,12 @@ export class SigninApiService { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, - @Inject(DI.userSecurityKeysRepository) - private userSecurityKeysRepository: UserSecurityKeysRepository, - @Inject(DI.signinsRepository) private signinsRepository: SigninsRepository, @@ -55,7 +45,6 @@ export class SigninApiService { private signinService: SigninService, private userAuthService: UserAuthService, private webAuthnService: WebAuthnService, - private captchaService: CaptchaService, ) { } @@ -64,14 +53,9 @@ export class SigninApiService { request: FastifyRequest<{ Body: { username: string; - password?: string; + password: string; token?: string; credential?: AuthenticationResponseJSON; - 'hcaptcha-response'?: string; - 'g-recaptcha-response'?: string; - 'turnstile-response'?: string; - 'm-captcha-response'?: string; - 'testcaptcha-response'?: string; }; }>, reply: FastifyReply, @@ -108,6 +92,11 @@ export class SigninApiService { return; } + if (typeof password !== 'string') { + reply.code(400); + return; + } + if (token != null && typeof token !== 'string') { reply.code(400); return; @@ -132,32 +121,11 @@ export class SigninApiService { } const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id }); - const securityKeysAvailable = await this.userSecurityKeysRepository.countBy({ userId: user.id }).then(result => result >= 1); - - if (password == null) { - reply.code(200); - if (profile.twoFactorEnabled) { - return { - finished: false, - next: 'password', - } satisfies Misskey.entities.SigninFlowResponse; - } else { - return { - finished: false, - next: 'captcha', - } satisfies Misskey.entities.SigninFlowResponse; - } - } - - if (typeof password !== 'string') { - reply.code(400); - return; - } // Compare password const same = await bcrypt.compare(password, profile.password!); - const fail = async (status?: number, failure?: { id: string; }) => { + const fail = async (status?: number, failure?: { id: string }) => { // Append signin history await this.signinsRepository.insert({ id: this.idService.gen(), @@ -171,38 +139,6 @@ export class SigninApiService { }; if (!profile.twoFactorEnabled) { - if (process.env.NODE_ENV !== 'test') { - if (this.meta.enableHcaptcha && this.meta.hcaptchaSecretKey) { - await this.captchaService.verifyHcaptcha(this.meta.hcaptchaSecretKey, body['hcaptcha-response']).catch(err => { - throw new FastifyReplyError(400, err); - }); - } - - if (this.meta.enableMcaptcha && this.meta.mcaptchaSecretKey && this.meta.mcaptchaSitekey && this.meta.mcaptchaInstanceUrl) { - await this.captchaService.verifyMcaptcha(this.meta.mcaptchaSecretKey, this.meta.mcaptchaSitekey, this.meta.mcaptchaInstanceUrl, body['m-captcha-response']).catch(err => { - throw new FastifyReplyError(400, err); - }); - } - - if (this.meta.enableRecaptcha && this.meta.recaptchaSecretKey) { - await this.captchaService.verifyRecaptcha(this.meta.recaptchaSecretKey, body['g-recaptcha-response']).catch(err => { - throw new FastifyReplyError(400, err); - }); - } - - if (this.meta.enableTurnstile && this.meta.turnstileSecretKey) { - await this.captchaService.verifyTurnstile(this.meta.turnstileSecretKey, body['turnstile-response']).catch(err => { - throw new FastifyReplyError(400, err); - }); - } - - if (this.meta.enableTestcaptcha) { - await this.captchaService.verifyTestcaptcha(body['testcaptcha-response']).catch(err => { - throw new FastifyReplyError(400, err); - }); - } - } - if (same) { return this.signinService.signin(request, reply, user); } else { @@ -244,7 +180,7 @@ export class SigninApiService { id: '93b86c4b-72f9-40eb-9815-798928603d1e', }); } - } else if (securityKeysAvailable) { + } else { if (!same && !profile.usePasswordLessLogin) { return await fail(403, { id: '932c904e-9460-45b7-9ce6-7ed33be7eb2c', @@ -254,23 +190,7 @@ export class SigninApiService { const authRequest = await this.webAuthnService.initiateAuthentication(user.id); reply.code(200); - return { - finished: false, - next: 'passkey', - authRequest, - } satisfies Misskey.entities.SigninFlowResponse; - } else { - if (!same || !profile.twoFactorEnabled) { - return await fail(403, { - id: '932c904e-9460-45b7-9ce6-7ed33be7eb2c', - }); - } else { - reply.code(200); - return { - finished: false, - next: 'totp', - } satisfies Misskey.entities.SigninFlowResponse; - } + return authRequest; } // never get here } diff --git a/packages/backend/src/server/api/SigninService.ts b/packages/backend/src/server/api/SigninService.ts index 640356b50c..98e9027006 100644 --- a/packages/backend/src/server/api/SigninService.ts +++ b/packages/backend/src/server/api/SigninService.ts @@ -1,19 +1,16 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; -import * as Misskey from 'misskey-js'; import { DI } from '@/di-symbols.js'; -import type { SigninsRepository, UserProfilesRepository } from '@/models/_.js'; +import type { SigninsRepository } from '@/models/_.js'; import { IdService } from '@/core/IdService.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'; -import { EmailService } from '@/core/EmailService.js'; -import { NotificationService } from '@/core/NotificationService.js'; import type { FastifyRequest, FastifyReply } from 'fastify'; @Injectable() @@ -22,12 +19,7 @@ export class SigninService { @Inject(DI.signinsRepository) private signinsRepository: SigninsRepository, - @Inject(DI.userProfilesRepository) - private userProfilesRepository: UserProfilesRepository, - private signinEntityService: SigninEntityService, - private emailService: EmailService, - private notificationService: NotificationService, private idService: IdService, private globalEventService: GlobalEventService, ) { @@ -36,32 +28,24 @@ export class SigninService { @bindThis public signin(request: FastifyRequest, reply: FastifyReply, user: MiLocalUser) { setImmediate(async () => { - this.notificationService.createNotification(user.id, 'login', {}); - - const record = await this.signinsRepository.insertOne({ + // Append signin history + const record = await this.signinsRepository.insert({ id: this.idService.gen(), userId: user.id, ip: request.ip, headers: request.headers as any, success: true, - }); + }).then(x => this.signinsRepository.findOneByOrFail(x.identifiers[0])); + // Publish signin event this.globalEventService.publishMainStream(user.id, 'signin', await this.signinEntityService.pack(record)); - - const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id }); - if (profile.email && profile.emailVerified) { - this.emailService.sendEmail(profile.email, 'New login / ログインがありました', - 'There is a new login. If you do not recognize this login, update the security status of your account, including changing your password. / 新しいログインがありました。このログインに心当たりがない場合は、パスワードを変更するなど、アカウントのセキュリティ状態を更新してください。', - 'There is a new login. If you do not recognize this login, update the security status of your account, including changing your password. / 新しいログインがありました。このログインに心当たりがない場合は、パスワードを変更するなど、アカウントのセキュリティ状態を更新してください。'); - } }); reply.code(200); return { - finished: true, id: user.id, - i: user.token!, - } satisfies Misskey.entities.SigninFlowResponse; + i: user.token, + }; } } diff --git a/packages/backend/src/server/api/SigninWithPasskeyApiService.ts b/packages/backend/src/server/api/SigninWithPasskeyApiService.ts deleted file mode 100644 index 9ba23c54e2..0000000000 --- a/packages/backend/src/server/api/SigninWithPasskeyApiService.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { randomUUID } from 'crypto'; -import { Inject, Injectable } from '@nestjs/common'; -import { IsNull } from 'typeorm'; -import { DI } from '@/di-symbols.js'; -import type { - SigninsRepository, - UserProfilesRepository, - UsersRepository, -} from '@/models/_.js'; -import type { Config } from '@/config.js'; -import { getIpHash } from '@/misc/get-ip-hash.js'; -import type { MiLocalUser, MiUser } from '@/models/User.js'; -import { IdService } from '@/core/IdService.js'; -import { bindThis } from '@/decorators.js'; -import { WebAuthnService } from '@/core/WebAuthnService.js'; -import Logger from '@/logger.js'; -import { LoggerService } from '@/core/LoggerService.js'; -import type { IdentifiableError } from '@/misc/identifiable-error.js'; -import { RateLimiterService } from './RateLimiterService.js'; -import { SigninService } from './SigninService.js'; -import type { AuthenticationResponseJSON } from '@simplewebauthn/types'; -import type { FastifyReply, FastifyRequest } from 'fastify'; - -@Injectable() -export class SigninWithPasskeyApiService { - private logger: Logger; - constructor( - @Inject(DI.config) - private config: Config, - - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - - @Inject(DI.userProfilesRepository) - private userProfilesRepository: UserProfilesRepository, - - @Inject(DI.signinsRepository) - private signinsRepository: SigninsRepository, - - private idService: IdService, - private rateLimiterService: RateLimiterService, - private signinService: SigninService, - private webAuthnService: WebAuthnService, - private loggerService: LoggerService, - ) { - this.logger = this.loggerService.getLogger('PasskeyAuth'); - } - - @bindThis - public async signin( - request: FastifyRequest<{ - Body: { - credential?: AuthenticationResponseJSON; - context?: string; - }; - }>, - reply: FastifyReply, - ) { - reply.header('Access-Control-Allow-Origin', this.config.url); - reply.header('Access-Control-Allow-Credentials', 'true'); - - const body = request.body; - const credential = body['credential']; - - function error(status: number, error: { id: string }) { - reply.code(status); - return { error }; - } - - const fail = async (userId: MiUser['id'], status?: number, failure?: { id: string }) => { - // Append signin history - await this.signinsRepository.insert({ - id: this.idService.gen(), - userId: userId, - ip: request.ip, - headers: request.headers as any, - success: false, - }); - return error(status ?? 500, failure ?? { id: '4e30e80c-e338-45a0-8c8f-44455efa3b76' }); - }; - - try { - // Not more than 1 API call per 250ms and not more than 100 attempts per 30min - // NOTE: 1 Sign-in require 2 API calls - await this.rateLimiterService.limit({ key: 'signin-with-passkey', duration: 60 * 30 * 1000, max: 200, minInterval: 250 }, getIpHash(request.ip)); - } catch (err) { - reply.code(429); - return { - error: { - message: 'Too many failed attempts to sign in. Try again later.', - code: 'TOO_MANY_AUTHENTICATION_FAILURES', - id: '22d05606-fbcf-421a-a2db-b32610dcfd1b', - }, - }; - } - - // Initiate Passkey Auth challenge with context - if (!credential) { - const context = randomUUID(); - this.logger.info(`Initiate Passkey challenge: context: ${context}`); - const authChallengeOptions = { - option: await this.webAuthnService.initiateSignInWithPasskeyAuthentication(context), - context: context, - }; - reply.code(200); - return authChallengeOptions; - } - - const context = body.context; - if (!context || typeof context !== 'string') { - // If try Authentication without context - return error(400, { - id: '1658cc2e-4495-461f-aee4-d403cdf073c1', - }); - } - - this.logger.debug(`Try Sign-in with Passkey: context: ${context}`); - - let authorizedUserId: MiUser['id'] | null; - try { - authorizedUserId = await this.webAuthnService.verifySignInWithPasskeyAuthentication(context, credential); - } catch (err) { - this.logger.warn(`Passkey challenge Verify error! : ${err}`); - const errorId = (err as IdentifiableError).id; - return error(403, { - id: errorId, - }); - } - - if (!authorizedUserId) { - return error(403, { - id: '932c904e-9460-45b7-9ce6-7ed33be7eb2c', - }); - } - - // Fetch user - const user = await this.usersRepository.findOneBy({ - id: authorizedUserId, - host: IsNull(), - }) as MiLocalUser | null; - - if (user == null) { - return error(403, { - id: '652f899f-66d4-490e-993e-6606c8ec04c3', - }); - } - - if (user.isSuspended) { - return error(403, { - id: 'e03a5f46-d309-4865-9b69-56282d94e1eb', - }); - } - - const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id }); - - // Authentication was successful, but passwordless login is not enabled - if (!profile.usePasswordLessLogin) { - return await fail(user.id, 403, { - id: '2d84773e-f7b7-4d0b-8f72-bb69b584c912', - }); - } - - const signinResponse = this.signinService.signin(request, reply, user); - return { - signinResponse: signinResponse, - }; - } -} diff --git a/packages/backend/src/server/api/SignupApiService.ts b/packages/backend/src/server/api/SignupApiService.ts index 3ec5e5d3e6..753984ef52 100644 --- a/packages/backend/src/server/api/SignupApiService.ts +++ b/packages/backend/src/server/api/SignupApiService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,8 +7,9 @@ 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, MiMeta } from '@/models/_.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'; import { IdService } from '@/core/IdService.js'; import { SignupService } from '@/core/SignupService.js'; @@ -27,9 +28,6 @@ export class SignupApiService { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -47,6 +45,7 @@ export class SignupApiService { private userEntityService: UserEntityService, private idService: IdService, + private metaService: MetaService, private captchaService: CaptchaService, private signupService: SignupService, private signinService: SigninService, @@ -66,43 +65,31 @@ export class SignupApiService { 'hcaptcha-response'?: string; 'g-recaptcha-response'?: string; 'turnstile-response'?: string; - 'm-captcha-response'?: string; - 'testcaptcha-response'?: string; } }>, reply: FastifyReply, ) { const body = request.body; + const instance = await this.metaService.fetch(true); + // Verify *Captcha // ただしテスト時はこの機構は障害となるため無効にする if (process.env.NODE_ENV !== 'test') { - if (this.meta.enableHcaptcha && this.meta.hcaptchaSecretKey) { - await this.captchaService.verifyHcaptcha(this.meta.hcaptchaSecretKey, body['hcaptcha-response']).catch(err => { + if (instance.enableHcaptcha && instance.hcaptchaSecretKey) { + await this.captchaService.verifyHcaptcha(instance.hcaptchaSecretKey, body['hcaptcha-response']).catch(err => { throw new FastifyReplyError(400, err); }); } - if (this.meta.enableMcaptcha && this.meta.mcaptchaSecretKey && this.meta.mcaptchaSitekey && this.meta.mcaptchaInstanceUrl) { - await this.captchaService.verifyMcaptcha(this.meta.mcaptchaSecretKey, this.meta.mcaptchaSitekey, this.meta.mcaptchaInstanceUrl, body['m-captcha-response']).catch(err => { + if (instance.enableRecaptcha && instance.recaptchaSecretKey) { + await this.captchaService.verifyRecaptcha(instance.recaptchaSecretKey, body['g-recaptcha-response']).catch(err => { throw new FastifyReplyError(400, err); }); } - if (this.meta.enableRecaptcha && this.meta.recaptchaSecretKey) { - await this.captchaService.verifyRecaptcha(this.meta.recaptchaSecretKey, body['g-recaptcha-response']).catch(err => { - throw new FastifyReplyError(400, err); - }); - } - - if (this.meta.enableTurnstile && this.meta.turnstileSecretKey) { - await this.captchaService.verifyTurnstile(this.meta.turnstileSecretKey, body['turnstile-response']).catch(err => { - throw new FastifyReplyError(400, err); - }); - } - - if (this.meta.enableTestcaptcha) { - await this.captchaService.verifyTestcaptcha(body['testcaptcha-response']).catch(err => { + if (instance.enableTurnstile && instance.turnstileSecretKey) { + await this.captchaService.verifyTurnstile(instance.turnstileSecretKey, body['turnstile-response']).catch(err => { throw new FastifyReplyError(400, err); }); } @@ -114,7 +101,7 @@ export class SignupApiService { const invitationCode = body['invitationCode']; const emailAddress = body['emailAddress']; - if (this.meta.emailRequiredForSignup) { + if (instance.emailRequiredForSignup) { if (emailAddress == null || typeof emailAddress !== 'string') { reply.code(400); return; @@ -129,7 +116,7 @@ export class SignupApiService { let ticket: MiRegistrationTicket | null = null; - if (this.meta.disableRegistration) { + if (instance.disableRegistration) { if (invitationCode == null || typeof invitationCode !== 'string') { reply.code(400); return; @@ -150,7 +137,7 @@ export class SignupApiService { } // メアド認証が有効の場合 - if (this.meta.emailRequiredForSignup) { + if (instance.emailRequiredForSignup) { // メアド認証済みならエラー if (ticket.usedBy) { reply.code(400); @@ -168,17 +155,17 @@ export class SignupApiService { } } - if (this.meta.emailRequiredForSignup) { - if (await this.usersRepository.exists({ where: { usernameLower: username.toLowerCase(), host: IsNull() } })) { + if (instance.emailRequiredForSignup) { + if (await this.usersRepository.exist({ where: { usernameLower: username.toLowerCase(), host: IsNull() } })) { throw new FastifyReplyError(400, 'DUPLICATED_USERNAME'); } // Check deleted username duplication - if (await this.usedUsernamesRepository.exists({ where: { username: username.toLowerCase() } })) { + if (await this.usedUsernamesRepository.exist({ where: { username: username.toLowerCase() } })) { throw new FastifyReplyError(400, 'USED_USERNAME'); } - const isPreserved = this.meta.preservedUsernames.map(x => x.toLowerCase()).includes(username.toLowerCase()); + const isPreserved = instance.preservedUsernames.map(x => x.toLowerCase()).includes(username.toLowerCase()); if (isPreserved) { throw new FastifyReplyError(400, 'DENIED_USERNAME'); } @@ -189,13 +176,13 @@ export class SignupApiService { const salt = await bcrypt.genSalt(8); const hash = await bcrypt.hash(password, salt); - const pendingUser = await this.userPendingsRepository.insertOne({ + const pendingUser = await this.userPendingsRepository.insert({ id: this.idService.gen(), code, email: emailAddress!, username: username, password: hash, - }); + }).then(x => this.userPendingsRepository.findOneByOrFail(x.identifiers[0])); const link = `${this.config.url}/signup-complete/${code}`; @@ -219,7 +206,7 @@ export class SignupApiService { }); const res = await this.userEntityService.pack(account, account, { - schema: 'MeDetailed', + detail: true, includeSecrets: true, }); diff --git a/packages/backend/src/server/api/StreamingApiServerService.ts b/packages/backend/src/server/api/StreamingApiServerService.ts index b8f448477b..3b387d92ca 100644 --- a/packages/backend/src/server/api/StreamingApiServerService.ts +++ b/packages/backend/src/server/api/StreamingApiServerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoint-base.ts b/packages/backend/src/server/api/endpoint-base.ts index e061aa3a8e..d5279faa1c 100644 --- a/packages/backend/src/server/api/endpoint-base.ts +++ b/packages/backend/src/server/api/endpoint-base.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts index 49b07d6ced..41232091c6 100644 --- a/packages/backend/src/server/api/endpoints.ts +++ b/packages/backend/src/server/api/endpoints.ts @@ -1,23 +1,14 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ +import type { Schema } from '@/misc/json-schema.js'; import { permissions } from 'misskey-js'; -import type { KeyOf, Schema } from '@/misc/json-schema.js'; +import { RolePolicies } from '@/core/RoleService.js'; -import * as ep___admin_abuseReport_notificationRecipient_list - from '@/server/api/endpoints/admin/abuse-report/notification-recipient/list.js'; -import * as ep___admin_abuseReport_notificationRecipient_show - from '@/server/api/endpoints/admin/abuse-report/notification-recipient/show.js'; -import * as ep___admin_abuseReport_notificationRecipient_create - from '@/server/api/endpoints/admin/abuse-report/notification-recipient/create.js'; -import * as ep___admin_abuseReport_notificationRecipient_update - from '@/server/api/endpoints/admin/abuse-report/notification-recipient/update.js'; -import * as ep___admin_abuseReport_notificationRecipient_delete - from '@/server/api/endpoints/admin/abuse-report/notification-recipient/delete.js'; -import * as ep___admin_abuseUserReports from './endpoints/admin/abuse-user-reports.js'; import * as ep___admin_meta from './endpoints/admin/meta.js'; +import * as ep___admin_abuseUserReports from './endpoints/admin/abuse-user-reports.js'; import * as ep___admin_accounts_create from './endpoints/admin/accounts/create.js'; import * as ep___admin_accounts_delete from './endpoints/admin/accounts/delete.js'; import * as ep___admin_accounts_findByEmail from './endpoints/admin/accounts/find-by-email.js'; @@ -54,8 +45,7 @@ import * as ep___admin_emoji_setCategoryBulk from './endpoints/admin/emoji/set-c import * as ep___admin_emoji_setLicenseBulk from './endpoints/admin/emoji/set-license-bulk.js'; import * as ep___admin_emoji_update from './endpoints/admin/emoji/update.js'; import * as ep___admin_federation_deleteAllFiles from './endpoints/admin/federation/delete-all-files.js'; -import * as ep___admin_federation_refreshRemoteInstanceMetadata - from './endpoints/admin/federation/refresh-remote-instance-metadata.js'; +import * as ep___admin_federation_refreshRemoteInstanceMetadata from './endpoints/admin/federation/refresh-remote-instance-metadata.js'; import * as ep___admin_federation_removeAllFollowing from './endpoints/admin/federation/remove-all-following.js'; import * as ep___admin_federation_updateInstance from './endpoints/admin/federation/update-instance.js'; import * as ep___admin_getIndexStats from './endpoints/admin/get-index-stats.js'; @@ -74,8 +64,6 @@ import * as ep___admin_relays_list from './endpoints/admin/relays/list.js'; import * as ep___admin_relays_remove from './endpoints/admin/relays/remove.js'; import * as ep___admin_resetPassword from './endpoints/admin/reset-password.js'; import * as ep___admin_resolveAbuseUserReport from './endpoints/admin/resolve-abuse-user-report.js'; -import * as ep___admin_forwardAbuseUserReport from './endpoints/admin/forward-abuse-user-report.js'; -import * as ep___admin_updateAbuseUserReport from './endpoints/admin/update-abuse-user-report.js'; import * as ep___admin_sendEmail from './endpoints/admin/send-email.js'; import * as ep___admin_serverInfo from './endpoints/admin/server-info.js'; import * as ep___admin_showModerationLogs from './endpoints/admin/show-moderation-logs.js'; @@ -95,14 +83,7 @@ import * as ep___admin_roles_assign from './endpoints/admin/roles/assign.js'; import * as ep___admin_roles_unassign from './endpoints/admin/roles/unassign.js'; import * as ep___admin_roles_updateDefaultPolicies from './endpoints/admin/roles/update-default-policies.js'; import * as ep___admin_roles_users from './endpoints/admin/roles/users.js'; -import * as ep___admin_systemWebhook_create from './endpoints/admin/system-webhook/create.js'; -import * as ep___admin_systemWebhook_delete from './endpoints/admin/system-webhook/delete.js'; -import * as ep___admin_systemWebhook_list from './endpoints/admin/system-webhook/list.js'; -import * as ep___admin_systemWebhook_show from './endpoints/admin/system-webhook/show.js'; -import * as ep___admin_systemWebhook_update from './endpoints/admin/system-webhook/update.js'; -import * as ep___admin_systemWebhook_test from './endpoints/admin/system-webhook/test.js'; import * as ep___announcements from './endpoints/announcements.js'; -import * as ep___announcements_show from './endpoints/announcements/show.js'; import * as ep___antennas_create from './endpoints/antennas/create.js'; import * as ep___antennas_delete from './endpoints/antennas/delete.js'; import * as ep___antennas_list from './endpoints/antennas/list.js'; @@ -228,7 +209,6 @@ import * as ep___i_exportBlocking from './endpoints/i/export-blocking.js'; import * as ep___i_exportFollowing from './endpoints/i/export-following.js'; import * as ep___i_exportMute from './endpoints/i/export-mute.js'; import * as ep___i_exportNotes from './endpoints/i/export-notes.js'; -import * as ep___i_exportClips from './endpoints/i/export-clips.js'; import * as ep___i_exportFavorites from './endpoints/i/export-favorites.js'; import * as ep___i_exportUserLists from './endpoints/i/export-user-lists.js'; import * as ep___i_exportAntennas from './endpoints/i/export-antennas.js'; @@ -267,7 +247,6 @@ import * as ep___i_webhooks_show from './endpoints/i/webhooks/show.js'; import * as ep___i_webhooks_list from './endpoints/i/webhooks/list.js'; import * as ep___i_webhooks_update from './endpoints/i/webhooks/update.js'; import * as ep___i_webhooks_delete from './endpoints/i/webhooks/delete.js'; -import * as ep___i_webhooks_test from './endpoints/i/webhooks/test.js'; import * as ep___invite_create from './endpoints/invite/create.js'; import * as ep___invite_delete from './endpoints/invite/delete.js'; import * as ep___invite_list from './endpoints/invite/list.js'; @@ -314,7 +293,6 @@ import * as ep___notes_translate from './endpoints/notes/translate.js'; 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_flush from './endpoints/notifications/flush.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'; @@ -386,24 +364,10 @@ import * as ep___users_updateMemo from './endpoints/users/update-memo.js'; import * as ep___fetchRss from './endpoints/fetch-rss.js'; import * as ep___fetchExternalResources from './endpoints/fetch-external-resources.js'; import * as ep___retention from './endpoints/retention.js'; -import * as ep___bubbleGame_register from './endpoints/bubble-game/register.js'; -import * as ep___bubbleGame_ranking from './endpoints/bubble-game/ranking.js'; -import * as ep___reversi_cancelMatch from './endpoints/reversi/cancel-match.js'; -import * as ep___reversi_games from './endpoints/reversi/games.js'; -import * as ep___reversi_match from './endpoints/reversi/match.js'; -import * as ep___reversi_invitations from './endpoints/reversi/invitations.js'; -import * as ep___reversi_showGame from './endpoints/reversi/show-game.js'; -import * as ep___reversi_surrender from './endpoints/reversi/surrender.js'; -import * as ep___reversi_verify from './endpoints/reversi/verify.js'; const eps = [ ['admin/meta', ep___admin_meta], ['admin/abuse-user-reports', ep___admin_abuseUserReports], - ['admin/abuse-report/notification-recipient/list', ep___admin_abuseReport_notificationRecipient_list], - ['admin/abuse-report/notification-recipient/show', ep___admin_abuseReport_notificationRecipient_show], - ['admin/abuse-report/notification-recipient/create', ep___admin_abuseReport_notificationRecipient_create], - ['admin/abuse-report/notification-recipient/update', ep___admin_abuseReport_notificationRecipient_update], - ['admin/abuse-report/notification-recipient/delete', ep___admin_abuseReport_notificationRecipient_delete], ['admin/accounts/create', ep___admin_accounts_create], ['admin/accounts/delete', ep___admin_accounts_delete], ['admin/accounts/find-by-email', ep___admin_accounts_findByEmail], @@ -459,8 +423,6 @@ const eps = [ ['admin/relays/remove', ep___admin_relays_remove], ['admin/reset-password', ep___admin_resetPassword], ['admin/resolve-abuse-user-report', ep___admin_resolveAbuseUserReport], - ['admin/forward-abuse-user-report', ep___admin_forwardAbuseUserReport], - ['admin/update-abuse-user-report', ep___admin_updateAbuseUserReport], ['admin/send-email', ep___admin_sendEmail], ['admin/server-info', ep___admin_serverInfo], ['admin/show-moderation-logs', ep___admin_showModerationLogs], @@ -480,14 +442,7 @@ const eps = [ ['admin/roles/unassign', ep___admin_roles_unassign], ['admin/roles/update-default-policies', ep___admin_roles_updateDefaultPolicies], ['admin/roles/users', ep___admin_roles_users], - ['admin/system-webhook/create', ep___admin_systemWebhook_create], - ['admin/system-webhook/delete', ep___admin_systemWebhook_delete], - ['admin/system-webhook/list', ep___admin_systemWebhook_list], - ['admin/system-webhook/show', ep___admin_systemWebhook_show], - ['admin/system-webhook/update', ep___admin_systemWebhook_update], - ['admin/system-webhook/test', ep___admin_systemWebhook_test], ['announcements', ep___announcements], - ['announcements/show', ep___announcements_show], ['antennas/create', ep___antennas_create], ['antennas/delete', ep___antennas_delete], ['antennas/list', ep___antennas_list], @@ -613,7 +568,6 @@ const eps = [ ['i/export-following', ep___i_exportFollowing], ['i/export-mute', ep___i_exportMute], ['i/export-notes', ep___i_exportNotes], - ['i/export-clips', ep___i_exportClips], ['i/export-favorites', ep___i_exportFavorites], ['i/export-user-lists', ep___i_exportUserLists], ['i/export-antennas', ep___i_exportAntennas], @@ -652,7 +606,6 @@ const eps = [ ['i/webhooks/show', ep___i_webhooks_show], ['i/webhooks/update', ep___i_webhooks_update], ['i/webhooks/delete', ep___i_webhooks_delete], - ['i/webhooks/test', ep___i_webhooks_test], ['invite/create', ep___invite_create], ['invite/delete', ep___invite_delete], ['invite/list', ep___invite_list], @@ -699,7 +652,6 @@ const eps = [ ['notes/unrenote', ep___notes_unrenote], ['notes/user-list-timeline', ep___notes_userListTimeline], ['notifications/create', ep___notifications_create], - ['notifications/flush', ep___notifications_flush], ['notifications/mark-all-as-read', ep___notifications_markAllAsRead], ['notifications/test-notification', ep___notifications_testNotification], ['page-push', ep___pagePush], @@ -771,15 +723,6 @@ const eps = [ ['fetch-rss', ep___fetchRss], ['fetch-external-resources', ep___fetchExternalResources], ['retention', ep___retention], - ['bubble-game/register', ep___bubbleGame_register], - ['bubble-game/ranking', ep___bubbleGame_ranking], - ['reversi/cancel-match', ep___reversi_cancelMatch], - ['reversi/games', ep___reversi_games], - ['reversi/match', ep___reversi_match], - ['reversi/invitations', ep___reversi_invitations], - ['reversi/show-game', ep___reversi_showGame], - ['reversi/surrender', ep___reversi_surrender], - ['reversi/verify', ep___reversi_verify], ]; interface IEndpointMetaBase { @@ -813,7 +756,7 @@ interface IEndpointMetaBase { */ readonly requireAdmin?: boolean; - readonly requireRolePolicy?: KeyOf<'RolePolicies'>; + readonly requireRolePolicy?: keyof RolePolicies; /** * 引っ越し済みのユーザーによるリクエストを禁止するか @@ -907,12 +850,8 @@ export interface IEndpoint { const endpoints: IEndpoint[] = (eps as [string, any]).map(([name, ep]) => { return { name: name, - get meta() { - return ep.meta ?? {}; - }, - get params() { - return ep.paramDef; - }, + get meta() { return ep.meta ?? {}; }, + get params() { return ep.paramDef; }, }; }); diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/create.ts b/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/create.ts deleted file mode 100644 index bdfbcba518..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/create.ts +++ /dev/null @@ -1,122 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { ApiError } from '@/server/api/error.js'; -import { - AbuseReportNotificationRecipientEntityService, -} from '@/core/entities/AbuseReportNotificationRecipientEntityService.js'; -import { AbuseReportNotificationService } from '@/core/AbuseReportNotificationService.js'; -import { DI } from '@/di-symbols.js'; -import type { UserProfilesRepository } from '@/models/_.js'; - -export const meta = { - tags: ['admin', 'abuse-report', 'notification-recipient'], - - requireCredential: true, - requireModerator: true, - secure: true, - kind: 'write:admin:abuse-report:notification-recipient', - - res: { - type: 'object', - ref: 'AbuseReportNotificationRecipient', - }, - - errors: { - correlationCheckEmail: { - message: 'If "method" is email, "userId" must be set.', - code: 'CORRELATION_CHECK_EMAIL', - id: '348bb8ae-575a-6fe9-4327-5811999def8f', - httpStatusCode: 400, - }, - correlationCheckWebhook: { - message: 'If "method" is webhook, "systemWebhookId" must be set.', - code: 'CORRELATION_CHECK_WEBHOOK', - id: 'b0c15051-de2d-29ef-260c-9585cddd701a', - httpStatusCode: 400, - }, - emailAddressNotSet: { - message: 'Email address is not set.', - code: 'EMAIL_ADDRESS_NOT_SET', - id: '7cc1d85e-2f58-fc31-b644-3de8d0d3421f', - httpStatusCode: 400, - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - isActive: { - type: 'boolean', - }, - name: { - type: 'string', - minLength: 1, - maxLength: 255, - }, - method: { - type: 'string', - enum: ['email', 'webhook'], - }, - userId: { - type: 'string', - format: 'misskey:id', - }, - systemWebhookId: { - type: 'string', - format: 'misskey:id', - }, - }, - required: [ - 'isActive', - 'name', - 'method', - ], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - @Inject(DI.userProfilesRepository) - private userProfilesRepository: UserProfilesRepository, - private abuseReportNotificationService: AbuseReportNotificationService, - private abuseReportNotificationRecipientEntityService: AbuseReportNotificationRecipientEntityService, - ) { - super(meta, paramDef, async (ps, me) => { - if (ps.method === 'email') { - const userProfile = await this.userProfilesRepository.findOneBy({ userId: ps.userId }); - if (!ps.userId || !userProfile) { - throw new ApiError(meta.errors.correlationCheckEmail); - } - - if (!userProfile.email || !userProfile.emailVerified) { - throw new ApiError(meta.errors.emailAddressNotSet); - } - } - - if (ps.method === 'webhook' && !ps.systemWebhookId) { - throw new ApiError(meta.errors.correlationCheckWebhook); - } - - const userId = ps.method === 'email' ? ps.userId : null; - const systemWebhookId = ps.method === 'webhook' ? ps.systemWebhookId : null; - const result = await this.abuseReportNotificationService.createRecipient( - { - isActive: ps.isActive, - name: ps.name, - method: ps.method, - userId: userId ?? null, - systemWebhookId: systemWebhookId ?? null, - }, - me, - ); - - return this.abuseReportNotificationRecipientEntityService.pack(result); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/delete.ts b/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/delete.ts deleted file mode 100644 index b6dc44e09c..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/delete.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { AbuseReportNotificationService } from '@/core/AbuseReportNotificationService.js'; - -export const meta = { - tags: ['admin', 'abuse-report', 'notification-recipient'], - - requireCredential: true, - requireModerator: true, - secure: true, - kind: 'write:admin:abuse-report:notification-recipient', -} as const; - -export const paramDef = { - type: 'object', - properties: { - id: { - type: 'string', - format: 'misskey:id', - }, - }, - required: [ - 'id', - ], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private abuseReportNotificationService: AbuseReportNotificationService, - ) { - super(meta, paramDef, async (ps, me) => { - await this.abuseReportNotificationService.deleteRecipient( - ps.id, - me, - ); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/list.ts b/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/list.ts deleted file mode 100644 index dad9161a8a..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/list.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { - AbuseReportNotificationRecipientEntityService, -} from '@/core/entities/AbuseReportNotificationRecipientEntityService.js'; -import { AbuseReportNotificationService } from '@/core/AbuseReportNotificationService.js'; - -export const meta = { - tags: ['admin', 'abuse-report', 'notification-recipient'], - - requireCredential: true, - requireModerator: true, - secure: true, - kind: 'read:admin:abuse-report:notification-recipient', - - res: { - type: 'array', - items: { - type: 'object', - ref: 'AbuseReportNotificationRecipient', - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - method: { - type: 'array', - items: { - type: 'string', - enum: ['email', 'webhook'], - }, - }, - }, - required: [], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private abuseReportNotificationService: AbuseReportNotificationService, - private abuseReportNotificationRecipientEntityService: AbuseReportNotificationRecipientEntityService, - ) { - super(meta, paramDef, async (ps) => { - const recipients = await this.abuseReportNotificationService.fetchRecipients({ method: ps.method }); - return this.abuseReportNotificationRecipientEntityService.packMany(recipients); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/show.ts b/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/show.ts deleted file mode 100644 index 557798f946..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/show.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { - AbuseReportNotificationRecipientEntityService, -} from '@/core/entities/AbuseReportNotificationRecipientEntityService.js'; -import { AbuseReportNotificationService } from '@/core/AbuseReportNotificationService.js'; -import { ApiError } from '@/server/api/error.js'; - -export const meta = { - tags: ['admin', 'abuse-report', 'notification-recipient'], - - requireCredential: true, - requireModerator: true, - secure: true, - kind: 'read:admin:abuse-report:notification-recipient', - - res: { - type: 'object', - ref: 'AbuseReportNotificationRecipient', - }, - - errors: { - noSuchRecipient: { - message: 'No such recipient.', - code: 'NO_SUCH_RECIPIENT', - id: '013de6a8-f757-04cb-4d73-cc2a7e3368e4', - kind: 'server', - httpStatusCode: 404, - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - id: { - type: 'string', - format: 'misskey:id', - }, - }, - required: ['id'], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private abuseReportNotificationService: AbuseReportNotificationService, - private abuseReportNotificationRecipientEntityService: AbuseReportNotificationRecipientEntityService, - ) { - super(meta, paramDef, async (ps) => { - const recipients = await this.abuseReportNotificationService.fetchRecipients({ ids: [ps.id] }); - if (recipients.length === 0) { - throw new ApiError(meta.errors.noSuchRecipient); - } - - return this.abuseReportNotificationRecipientEntityService.pack(recipients[0]); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/update.ts b/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/update.ts deleted file mode 100644 index bd4b485217..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/abuse-report/notification-recipient/update.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { ApiError } from '@/server/api/error.js'; -import { - AbuseReportNotificationRecipientEntityService, -} from '@/core/entities/AbuseReportNotificationRecipientEntityService.js'; -import { AbuseReportNotificationService } from '@/core/AbuseReportNotificationService.js'; -import { DI } from '@/di-symbols.js'; -import type { UserProfilesRepository } from '@/models/_.js'; - -export const meta = { - tags: ['admin', 'abuse-report', 'notification-recipient'], - - requireCredential: true, - requireModerator: true, - secure: true, - kind: 'write:admin:abuse-report:notification-recipient', - - res: { - type: 'object', - ref: 'AbuseReportNotificationRecipient', - }, - - errors: { - correlationCheckEmail: { - message: 'If "method" is email, "userId" must be set.', - code: 'CORRELATION_CHECK_EMAIL', - id: '348bb8ae-575a-6fe9-4327-5811999def8f', - httpStatusCode: 400, - }, - correlationCheckWebhook: { - message: 'If "method" is webhook, "systemWebhookId" must be set.', - code: 'CORRELATION_CHECK_WEBHOOK', - id: 'b0c15051-de2d-29ef-260c-9585cddd701a', - httpStatusCode: 400, - }, - emailAddressNotSet: { - message: 'Email address is not set.', - code: 'EMAIL_ADDRESS_NOT_SET', - id: '7cc1d85e-2f58-fc31-b644-3de8d0d3421f', - httpStatusCode: 400, - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - id: { - type: 'string', - format: 'misskey:id', - }, - isActive: { - type: 'boolean', - }, - name: { - type: 'string', - minLength: 1, - maxLength: 255, - }, - method: { - type: 'string', - enum: ['email', 'webhook'], - }, - userId: { - type: 'string', - format: 'misskey:id', - }, - systemWebhookId: { - type: 'string', - format: 'misskey:id', - }, - }, - required: [ - 'id', - 'isActive', - 'name', - 'method', - ], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - @Inject(DI.userProfilesRepository) - private userProfilesRepository: UserProfilesRepository, - private abuseReportNotificationService: AbuseReportNotificationService, - private abuseReportNotificationRecipientEntityService: AbuseReportNotificationRecipientEntityService, - ) { - super(meta, paramDef, async (ps, me) => { - if (ps.method === 'email') { - const userProfile = await this.userProfilesRepository.findOneBy({ userId: ps.userId }); - if (!ps.userId || !userProfile) { - throw new ApiError(meta.errors.correlationCheckEmail); - } - - if (!userProfile.email || !userProfile.emailVerified) { - throw new ApiError(meta.errors.emailAddressNotSet); - } - } - - if (ps.method === 'webhook' && !ps.systemWebhookId) { - throw new ApiError(meta.errors.correlationCheckWebhook); - } - - const userId = ps.method === 'email' ? ps.userId : null; - const systemWebhookId = ps.method === 'webhook' ? ps.systemWebhookId : null; - const result = await this.abuseReportNotificationService.updateRecipient( - { - id: ps.id, - isActive: ps.isActive, - name: ps.name, - method: ps.method, - userId: userId ?? null, - systemWebhookId: systemWebhookId ?? null, - }, - me, - ); - - return this.abuseReportNotificationRecipientEntityService.pack(result); - }); - } -} 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 0dbfaae054..3484d6707a 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -62,30 +62,17 @@ export const meta = { reporter: { type: 'object', nullable: false, optional: false, - ref: 'UserDetailedNotMe', + ref: 'User', }, targetUser: { type: 'object', nullable: false, optional: false, - ref: 'UserDetailedNotMe', + ref: 'User', }, assignee: { type: 'object', - nullable: true, optional: false, - ref: 'UserDetailedNotMe', - }, - forwarded: { - type: 'boolean', - nullable: false, optional: false, - }, - resolvedAs: { - type: 'string', - nullable: true, optional: false, - enum: ['accept', 'reject', null], - }, - moderationNote: { - type: 'string', - nullable: false, optional: false, + nullable: true, optional: true, + ref: 'User', }, }, }, @@ -101,6 +88,7 @@ export const paramDef = { state: { type: 'string', nullable: true, default: null }, reporterOrigin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'combined' }, targetUserOrigin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'combined' }, + forwarded: { type: 'boolean', default: false }, }, required: [], } as const; 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 d30131a62f..f54d567fff 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -9,34 +9,16 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import type { UsersRepository } from '@/models/_.js'; import { SignupService } from '@/core/SignupService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import { InstanceActorService } from '@/core/InstanceActorService.js'; import { localUsernameSchema, passwordSchema } from '@/models/User.js'; import { DI } from '@/di-symbols.js'; -import type { Config } from '@/config.js'; -import { ApiError } from '@/server/api/error.js'; -import { Packed } from '@/misc/json-schema.js'; export const meta = { tags: ['admin'], - errors: { - accessDenied: { - message: 'Access denied.', - code: 'ACCESS_DENIED', - id: '1fb7cb09-d46a-4fff-b8df-057708cce513', - }, - - wrongInitialPassword: { - message: 'Initial password is incorrect.', - code: 'INCORRECT_INITIAL_PASSWORD', - id: '97147c55-1ae1-4f6f-91d6-e1c3e0e76d62', - }, - }, - res: { type: 'object', optional: false, nullable: false, - ref: 'MeDetailed', + ref: 'User', properties: { token: { type: 'string', @@ -51,7 +33,6 @@ export const paramDef = { properties: { username: localUsernameSchema, password: passwordSchema, - setupPassword: { type: 'string', nullable: true }, }, required: ['username', 'password'], } as const; @@ -59,36 +40,18 @@ export const paramDef = { @Injectable() 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, private userEntityService: UserEntityService, private signupService: SignupService, - private instanceActorService: InstanceActorService, ) { super(meta, paramDef, async (ps, _me, token) => { const me = _me ? await this.usersRepository.findOneByOrFail({ id: _me.id }) : null; - const realUsers = await this.instanceActorService.realLocalUsersPresent(); - - if (!realUsers && me == null && token == null) { - // 初回セットアップの場合 - if (this.config.setupPassword != null) { - // 初期パスワードが設定されている場合 - if (ps.setupPassword !== this.config.setupPassword) { - // 初期パスワードが違う場合 - throw new ApiError(meta.errors.wrongInitialPassword); - } - } else if (ps.setupPassword != null && ps.setupPassword.trim() !== '') { - // 初期パスワードが設定されていないのに初期パスワードが入力された場合 - throw new ApiError(meta.errors.wrongInitialPassword); - } - } else if ((realUsers && !me?.isRoot) || token !== null) { - // 初回セットアップではなく、管理者でない場合 or 外部トークンを使用している場合 - throw new ApiError(meta.errors.accessDenied); - } + const noUsers = (await this.usersRepository.countBy({ + host: IsNull(), + })) === 0; + if ((!noUsers && !me?.isRoot) || token !== null) throw new Error('access denied'); const { account, secret } = await this.signupService.signup({ username: ps.username, @@ -97,11 +60,11 @@ export default class extends Endpoint { // eslint- }); const res = await this.userEntityService.pack(account, account, { - schema: 'MeDetailed', + detail: true, includeSecrets: true, - }) as Packed<'MeDetailed'> & { token: string }; + }); - res.token = secret; + (res as any).token = secret; return res; }); 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 01dea703a3..52d8c8ce18 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,9 +7,9 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import type { UsersRepository } from '@/models/_.js'; import { QueueService } from '@/core/QueueService.js'; +import { UserSuspendService } from '@/core/UserSuspendService.js'; import { DI } from '@/di-symbols.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import { DeleteAccountService } from '@/core/DeleteAccountService.js'; export const meta = { tags: ['admin'], @@ -33,7 +33,9 @@ export default class extends Endpoint { // eslint- @Inject(DI.usersRepository) private usersRepository: UsersRepository, - private deleteAccoountService: DeleteAccountService, + private userEntityService: UserEntityService, + private queueService: QueueService, + private userSuspendService: UserSuspendService, ) { super(meta, paramDef, async (ps, me) => { const user = await this.usersRepository.findOneBy({ id: ps.userId }); @@ -46,7 +48,22 @@ export default class extends Endpoint { // eslint- throw new Error('cannot delete a root account'); } - await this.deleteAccoountService.deleteAccount(user); + if (this.userEntityService.isLocalUser(user)) { + // 物理削除する前にDelete activityを送信する + await this.userSuspendService.doPostSuspend(user).catch(err => {}); + + this.queueService.createDeleteAccountJob(user, { + soft: false, + }); + } else { + this.queueService.createDeleteAccountJob(user, { + soft: true, // リモートユーザーの削除は、完全にDBから物理削除してしまうと再度連合してきてアカウントが復活する可能性があるため、soft指定する + }); + } + + await this.usersRepository.update(user.id, { + isDeleted: true, + }); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/find-by-email.ts b/packages/backend/src/server/api/endpoints/admin/accounts/find-by-email.ts index 12cd5cf295..93673453d6 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/find-by-email.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/find-by-email.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -27,7 +27,7 @@ export const meta = { res: { type: 'object', optional: false, nullable: false, - ref: 'UserDetailedNotMe', + ref: 'User', }, } as const; @@ -58,7 +58,7 @@ export default class extends Endpoint { // eslint- } const res = await this.userEntityService.pack(profile.user!, null, { - schema: 'UserDetailedNotMe', + detail: true, }); return res; 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 955154f4fb..041b10f9f7 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -50,7 +50,7 @@ export default class extends Endpoint { // eslint- private moderationLogService: ModerationLogService, ) { super(meta, paramDef, async (ps, me) => { - const ad = await this.adsRepository.insertOne({ + const ad = await this.adsRepository.insert({ id: this.idService.gen(), expiresAt: new Date(ps.expiresAt), startsAt: new Date(ps.startsAt), @@ -61,7 +61,7 @@ export default class extends Endpoint { // eslint- ratio: ps.ratio, place: ps.place, memo: ps.memo, - }); + }).then(r => this.adsRepository.findOneByOrFail({ id: r.identifiers[0].id })); this.moderationLogService.log(me, 'createAd', { adId: ad.id, 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 501e13c6a7..5b18b347d3 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 6406709cda..586c1f44db 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 4e3d731aca..bf96e44b0c 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -40,7 +40,7 @@ export const paramDef = { startsAt: { type: 'integer' }, dayOfWeek: { type: 'integer' }, }, - required: ['id'], + required: ['id', 'memo', 'url', 'imageUrl', 'place', 'priority', 'ratio', 'expiresAt', 'startsAt', 'dayOfWeek'], } as const; @Injectable() @@ -63,8 +63,8 @@ export default class extends Endpoint { // eslint- ratio: ps.ratio, memo: ps.memo, imageUrl: ps.imageUrl, - expiresAt: ps.expiresAt ? new Date(ps.expiresAt) : undefined, - startsAt: ps.startsAt ? new Date(ps.startsAt) : undefined, + expiresAt: new Date(ps.expiresAt), + startsAt: new Date(ps.startsAt), dayOfWeek: ps.dayOfWeek, }); 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 2dae1df87d..c9df70c76b 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 6d1e1b0a10..939333345e 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 7596bf44e3..429b138599 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -69,7 +69,6 @@ export const paramDef = { sinceId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' }, userId: { type: 'string', format: 'misskey:id', nullable: true }, - status: { type: 'string', enum: ['all', 'active', 'archived'], default: 'active' }, }, required: [], } as const; @@ -88,13 +87,7 @@ export default class extends Endpoint { // eslint- ) { super(meta, paramDef, async (ps, me) => { const query = this.queryService.makePaginationQuery(this.announcementsRepository.createQueryBuilder('announcement'), ps.sinceId, ps.untilId); - - if (ps.status === 'archived') { - query.andWhere('announcement.isActive = false'); - } else if (ps.status === 'active') { - query.andWhere('announcement.isActive = true'); - } - + query.andWhere('announcement.isActive = true'); if (ps.userId) { query.andWhere('announcement.userId = :userId', { userId: ps.userId }); } else { 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 6fce6e4e0a..db6db8356d 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/create.ts b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/create.ts index 87d80cbe80..4ac74253cc 100644 --- a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/create.ts @@ -1,12 +1,11 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * 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 { AvatarDecorationService } from '@/core/AvatarDecorationService.js'; -import { IdService } from '@/core/IdService.js'; export const meta = { tags: ['admin'], @@ -14,49 +13,6 @@ export const meta = { requireCredential: true, requireRolePolicy: 'canManageAvatarDecorations', kind: 'write:admin:avatar-decorations', - - res: { - type: 'object', - optional: false, nullable: false, - properties: { - id: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - createdAt: { - type: 'string', - optional: false, nullable: false, - format: 'date-time', - }, - updatedAt: { - type: 'string', - optional: false, nullable: true, - format: 'date-time', - }, - name: { - type: 'string', - optional: false, nullable: false, - }, - description: { - type: 'string', - optional: false, nullable: false, - }, - url: { - type: 'string', - optional: false, nullable: false, - }, - roleIdsThatCanBeUsedThisDecoration: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - optional: false, nullable: false, - format: 'id', - }, - }, - }, - }, } as const; export const paramDef = { @@ -76,25 +32,14 @@ export const paramDef = { export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private avatarDecorationService: AvatarDecorationService, - private idService: IdService, ) { super(meta, paramDef, async (ps, me) => { - const created = await this.avatarDecorationService.create({ + await this.avatarDecorationService.create({ name: ps.name, description: ps.description, url: ps.url, roleIdsThatCanBeUsedThisDecoration: ps.roleIdsThatCanBeUsedThisDecoration, }, me); - - return { - id: created.id, - createdAt: this.idService.parse(created.id).date.toISOString(), - updatedAt: null, - name: created.name, - description: created.description, - url: created.url, - roleIdsThatCanBeUsedThisDecoration: created.roleIdsThatCanBeUsedThisDecoration, - }; }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/delete.ts b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/delete.ts index 3a5673d99d..88977f801a 100644 --- a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/list.ts b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/list.ts index d785f085ac..33122c3eef 100644 --- a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/list.ts @@ -1,10 +1,13 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 { QueryService } from '@/core/QueryService.js'; import { DI } from '@/di-symbols.js'; import { IdService } from '@/core/IdService.js'; import { AvatarDecorationService } from '@/core/AvatarDecorationService.js'; diff --git a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/update.ts b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/update.ts index 34b3b5a11f..6211345f96 100644 --- a/packages/backend/src/server/api/endpoints/admin/avatar-decorations/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/avatar-decorations/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 b6f0f22d60..2c82c2879d 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-account.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-account.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -15,6 +15,9 @@ export const meta = { requireCredential: true, requireAdmin: true, kind: 'write:admin:delete-account', + + res: { + }, } as const; export const paramDef = { 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 d8341b3ad7..7d33065f2e 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 d420a929bd..af2bb6b1ca 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 d612572e2e..a3b221284b 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 915d777e77..37fa439bcf 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/files.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 a7136d8c8c..3aeb3e45e3 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -61,7 +61,7 @@ export const meta = { name: { type: 'string', optional: false, nullable: false, - example: '192.jpg', + example: 'lenna.jpg', }, type: { type: 'string', @@ -84,24 +84,6 @@ export const meta = { properties: { type: 'object', optional: false, nullable: false, - properties: { - width: { - type: 'number', - optional: true, nullable: false, - }, - height: { - type: 'number', - optional: true, nullable: false, - }, - orientation: { - type: 'number', - optional: true, nullable: false, - }, - avgColor: { - type: 'string', - optional: true, nullable: false, - }, - }, }, storedInternal: { type: 'boolean', 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 a30a080e59..1cd8125c52 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 796f273330..4a9418d051 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/add.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -31,10 +31,7 @@ export const meta = { }, }, - res: { - type: 'object', - ref: 'EmojiDetailed', - }, + ref: 'EmojiDetailed', } as const; export const paramDef = { 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 975f892df9..476780b23f 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 cec9f700c3..450695984a 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 50c45b6ac5..e1e6e7c2c4 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 8e5f69c894..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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 0889ceb76f..f3e0c1ef1f 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 ffb5dbf4b5..59e87253f6 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 0fa119eabe..26dd43e926 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 d9ee18699c..18961976f9 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 dc25df2767..c680f2e2d4 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 4ba99faab7..47c692b613 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 212cba5c5d..550bb0052b 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts @@ -1,12 +1,12 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * 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 { CustomEmojiService } from '@/core/CustomEmojiService.js'; -import type { DriveFilesRepository, MiEmoji } from '@/models/_.js'; +import type { DriveFilesRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; @@ -57,10 +57,7 @@ export const paramDef = { type: 'string', } }, }, - anyOf: [ - { required: ['id'] }, - { required: ['name'] }, - ], + required: ['id', 'name', 'aliases'], } as const; @Injectable() @@ -73,34 +70,31 @@ export default class extends Endpoint { // eslint- ) { super(meta, paramDef, async (ps, me) => { let driveFile; + if (ps.fileId) { driveFile = await this.driveFilesRepository.findOneBy({ id: ps.fileId }); if (driveFile == null) throw new ApiError(meta.errors.noSuchFile); } + const emoji = await this.customEmojiService.getEmojiById(ps.id); + if (emoji != null) { + if (ps.name !== emoji.name) { + const isDuplicate = await this.customEmojiService.checkDuplicate(ps.name); + if (isDuplicate) throw new ApiError(meta.errors.sameNameEmojiExists); + } + } else { + throw new ApiError(meta.errors.noSuchEmoji); + } - // JSON schemeのanyOfの型変換がうまくいっていないらしい - const required = { id: ps.id, name: ps.name } as - | { id: MiEmoji['id']; name?: string } - | { id?: MiEmoji['id']; name: string }; - - const error = await this.customEmojiService.update({ - ...required, + await this.customEmojiService.update(ps.id, { driveFile, - category: ps.category, + name: ps.name, + category: ps.category ?? null, aliases: ps.aliases, - license: ps.license, + license: ps.license ?? null, isSensitive: ps.isSensitive, localOnly: ps.localOnly, roleIdsThatCanBeUsedThisEmojiAsReaction: ps.roleIdsThatCanBeUsedThisEmojiAsReaction, }, me); - - switch (error) { - case null: return; - case 'NO_SUCH_EMOJI': throw new ApiError(meta.errors.noSuchEmoji); - case 'SAME_NAME_EMOJI_EXISTS': throw new ApiError(meta.errors.sameNameEmojiExists); - } - // 網羅性チェック - const mustBeNever: never = error; }); } } 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 4a54c26009..57612850b4 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 556e291025..0d061c685f 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 9e93310746..c15fb83454 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 fed7bfbbde..f429949e16 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -24,9 +24,8 @@ export const paramDef = { properties: { host: { type: 'string' }, isSuspended: { type: 'boolean' }, - moderationNote: { type: 'string' }, }, - required: ['host'], + required: ['host', 'isSuspended'], } as const; @Injectable() @@ -46,19 +45,11 @@ export default class extends Endpoint { // eslint- throw new Error('instance not found'); } - const isSuspendedBefore = instance.suspensionState !== 'none'; - let suspensionState: undefined | 'manuallySuspended' | 'none'; - - if (ps.isSuspended != null && isSuspendedBefore !== ps.isSuspended) { - suspensionState = ps.isSuspended ? 'manuallySuspended' : 'none'; - } - await this.federatedInstanceService.update(instance.id, { - suspensionState, - moderationNote: ps.moderationNote, + isSuspended: ps.isSuspended, }); - if (ps.isSuspended != null && isSuspendedBefore !== ps.isSuspended) { + if (instance.isSuspended !== ps.isSuspended) { if (ps.isSuspended) { this.moderationLogService.log(me, 'suspendRemoteInstance', { id: instance.id, @@ -71,15 +62,6 @@ export default class extends Endpoint { // eslint- }); } } - - if (ps.moderationNote != null && instance.moderationNote !== ps.moderationNote) { - this.moderationLogService.log(me, 'updateRemoteInstanceNote', { - id: instance.id, - host: instance.host, - before: instance.moderationNote, - after: ps.moderationNote, - }); - } }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/forward-abuse-user-report.ts b/packages/backend/src/server/api/endpoints/admin/forward-abuse-user-report.ts deleted file mode 100644 index 3e42c91fed..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/forward-abuse-user-report.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AbuseUserReportsRepository } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; -import { ApiError } from '@/server/api/error.js'; -import { AbuseReportService } from '@/core/AbuseReportService.js'; - -export const meta = { - tags: ['admin'], - - requireCredential: true, - requireModerator: true, - kind: 'write:admin:resolve-abuse-user-report', - - errors: { - noSuchAbuseReport: { - message: 'No such abuse report.', - code: 'NO_SUCH_ABUSE_REPORT', - id: '8763e21b-d9bc-40be-acf6-54c1a6986493', - kind: 'server', - httpStatusCode: 404, - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - reportId: { type: 'string', format: 'misskey:id' }, - }, - required: ['reportId'], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - @Inject(DI.abuseUserReportsRepository) - private abuseUserReportsRepository: AbuseUserReportsRepository, - private abuseReportService: AbuseReportService, - ) { - super(meta, paramDef, async (ps, me) => { - const report = await this.abuseUserReportsRepository.findOneBy({ id: ps.reportId }); - if (!report) { - throw new ApiError(meta.errors.noSuchAbuseReport); - } - - await this.abuseReportService.forward(report.id, me); - }); - } -} 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 90a3fa0200..0b50212119 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 eb85fca179..0d44b288cb 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -18,18 +18,6 @@ export const meta = { res: { type: 'object', optional: false, nullable: false, - additionalProperties: { - type: 'object', - properties: { - count: { - type: 'number', - }, - size: { - type: 'number', - }, - }, - required: ['count', 'size'], - }, example: { migrations: { count: 66, 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 b7781b8c99..1b437f718b 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 5ecae3161a..396b84623f 100644 --- a/packages/backend/src/server/api/endpoints/admin/invite/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/invite/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -66,11 +66,11 @@ export default class extends Endpoint { // eslint- const ticketsPromises = []; for (let i = 0; i < ps.count; i++) { - ticketsPromises.push(this.registrationTicketsRepository.insertOne({ + ticketsPromises.push(this.registrationTicketsRepository.insert({ id: this.idService.gen(), expiresAt: ps.expiresAt ? new Date(ps.expiresAt) : null, code: generateInviteCode(), - })); + }).then(x => this.registrationTicketsRepository.findOneByOrFail(x.identifiers[0]))); } const tickets = await Promise.all(ticketsPromises); 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 e33a9a1aec..d293dcadc6 100644 --- a/packages/backend/src/server/api/endpoints/admin/invite/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/invite/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 64e3cc33bd..281f6c484c 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -41,18 +41,6 @@ export const meta = { type: 'string', optional: false, nullable: true, }, - enableMcaptcha: { - type: 'boolean', - optional: false, nullable: false, - }, - mcaptchaSiteKey: { - type: 'string', - optional: false, nullable: true, - }, - mcaptchaInstanceUrl: { - type: 'string', - optional: false, nullable: true, - }, enableRecaptcha: { type: 'boolean', optional: false, nullable: false, @@ -69,10 +57,6 @@ export const meta = { type: 'string', optional: false, nullable: true, }, - enableTestcaptcha: { - type: 'boolean', - optional: false, nullable: false, - }, swPublickey: { type: 'string', optional: false, nullable: true, @@ -132,16 +116,6 @@ export const meta = { nullable: false, }, }, - mediaSilencedHosts: { - type: 'array', - optional: false, - nullable: false, - items: { - type: 'string', - optional: false, - nullable: false, - }, - }, pinnedUsers: { type: 'array', optional: false, nullable: false, @@ -170,20 +144,6 @@ export const meta = { type: 'string', }, }, - prohibitedWords: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - }, - }, - prohibitedWordsForNameOfUser: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - }, - }, bannedEmailDomains: { type: 'array', optional: true, nullable: false, @@ -203,10 +163,6 @@ export const meta = { type: 'string', optional: false, nullable: true, }, - mcaptchaSecretKey: { - type: 'string', - optional: false, nullable: true, - }, recaptchaSecretKey: { type: 'string', optional: false, nullable: true, @@ -348,10 +304,6 @@ export const meta = { type: 'boolean', optional: false, nullable: false, }, - enableStatsForFederatedInstances: { - type: 'boolean', - optional: false, nullable: false, - }, enableServerMachineStats: { type: 'boolean', optional: false, nullable: false, @@ -392,10 +344,6 @@ export const meta = { type: 'number', optional: false, nullable: false, }, - enableReactionsBuffering: { - type: 'boolean', - optional: false, nullable: false, - }, notesPerOneAd: { type: 'number', optional: false, nullable: false, @@ -456,19 +404,13 @@ export const meta = { type: 'string', optional: false, nullable: true, }, - inquiryUrl: { - type: 'string', - optional: false, nullable: true, - }, repositoryUrl: { type: 'string', - optional: false, nullable: true, + optional: false, nullable: false, }, summalyProxy: { type: 'string', optional: false, nullable: true, - deprecated: true, - description: '[Deprecated] Use "urlPreviewSummaryProxyUrl" instead.', }, themeColor: { type: 'string', @@ -486,42 +428,6 @@ export const meta = { type: 'string', optional: false, nullable: false, }, - urlPreviewEnabled: { - type: 'boolean', - optional: false, nullable: false, - }, - urlPreviewTimeout: { - type: 'number', - optional: false, nullable: false, - }, - urlPreviewMaximumContentLength: { - type: 'number', - optional: false, nullable: false, - }, - urlPreviewRequireContentLength: { - type: 'boolean', - optional: false, nullable: false, - }, - urlPreviewUserAgent: { - type: 'string', - optional: false, nullable: true, - }, - urlPreviewSummaryProxyUrl: { - type: 'string', - optional: false, nullable: true, - }, - federation: { - type: 'string', - optional: false, nullable: false, - }, - federationHosts: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - optional: false, nullable: false, - }, - }, }, }, } as const; @@ -558,19 +464,14 @@ export default class extends Endpoint { // eslint- feedbackUrl: instance.feedbackUrl, impressumUrl: instance.impressumUrl, privacyPolicyUrl: instance.privacyPolicyUrl, - inquiryUrl: instance.inquiryUrl, disableRegistration: instance.disableRegistration, emailRequiredForSignup: instance.emailRequiredForSignup, enableHcaptcha: instance.enableHcaptcha, hcaptchaSiteKey: instance.hcaptchaSiteKey, - enableMcaptcha: instance.enableMcaptcha, - mcaptchaSiteKey: instance.mcaptchaSitekey, - mcaptchaInstanceUrl: instance.mcaptchaInstanceUrl, enableRecaptcha: instance.enableRecaptcha, recaptchaSiteKey: instance.recaptchaSiteKey, enableTurnstile: instance.enableTurnstile, turnstileSiteKey: instance.turnstileSiteKey, - enableTestcaptcha: instance.enableTestcaptcha, swPublickey: instance.swPublicKey, themeColor: instance.themeColor, mascotImageUrl: instance.mascotImageUrl, @@ -594,13 +495,9 @@ export default class extends Endpoint { // eslint- hiddenTags: instance.hiddenTags, blockedHosts: instance.blockedHosts, silencedHosts: instance.silencedHosts, - mediaSilencedHosts: instance.mediaSilencedHosts, sensitiveWords: instance.sensitiveWords, - prohibitedWords: instance.prohibitedWords, - prohibitedWordsForNameOfUser: instance.prohibitedWordsForNameOfUser, preservedUsernames: instance.preservedUsernames, hcaptchaSecretKey: instance.hcaptchaSecretKey, - mcaptchaSecretKey: instance.mcaptchaSecretKey, recaptchaSecretKey: instance.recaptchaSecretKey, turnstileSecretKey: instance.turnstileSecretKey, sensitiveMediaDetection: instance.sensitiveMediaDetection, @@ -608,6 +505,7 @@ export default class extends Endpoint { // eslint- setSensitiveFlagAutomatically: instance.setSensitiveFlagAutomatically, enableSensitiveMediaDetectionForVideos: instance.enableSensitiveMediaDetectionForVideos, proxyAccountId: instance.proxyAccountId, + summalyProxy: instance.summalyProxy, email: instance.email, smtpSecure: instance.smtpSecure, smtpHost: instance.smtpHost, @@ -639,7 +537,6 @@ export default class extends Endpoint { // eslint- truemailAuthKey: instance.truemailAuthKey, enableChartsForRemoteUser: instance.enableChartsForRemoteUser, enableChartsForFederatedInstances: instance.enableChartsForFederatedInstances, - enableStatsForFederatedInstances: instance.enableStatsForFederatedInstances, enableServerMachineStats: instance.enableServerMachineStats, enableIdenticonGeneration: instance.enableIdenticonGeneration, bannedEmailDomains: instance.bannedEmailDomains, @@ -651,17 +548,7 @@ export default class extends Endpoint { // eslint- perRemoteUserUserTimelineCacheMax: instance.perRemoteUserUserTimelineCacheMax, perUserHomeTimelineCacheMax: instance.perUserHomeTimelineCacheMax, perUserListTimelineCacheMax: instance.perUserListTimelineCacheMax, - enableReactionsBuffering: instance.enableReactionsBuffering, notesPerOneAd: instance.notesPerOneAd, - summalyProxy: instance.urlPreviewSummaryProxyUrl, - urlPreviewEnabled: instance.urlPreviewEnabled, - urlPreviewTimeout: instance.urlPreviewTimeout, - urlPreviewMaximumContentLength: instance.urlPreviewMaximumContentLength, - urlPreviewRequireContentLength: instance.urlPreviewRequireContentLength, - urlPreviewUserAgent: instance.urlPreviewUserAgent, - urlPreviewSummaryProxyUrl: instance.urlPreviewSummaryProxyUrl, - federation: instance.federation, - federationHosts: instance.federationHosts, }; }); } 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 1d32c6cc00..ab69dfba96 100644 --- a/packages/backend/src/server/api/endpoints/admin/promo/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/promo/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -55,7 +55,7 @@ export default class extends Endpoint { // eslint- throw e; }); - const exist = await this.promoNotesRepository.exists({ where: { noteId: note.id } }); + const exist = await this.promoNotesRepository.exist({ where: { noteId: note.id } }); if (exist) { throw new ApiError(meta.errors.alreadyPromoted); 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 3f7df0e63d..9912043c8b 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/clear.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/clear.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 f3e440b4cb..8473909103 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -21,15 +21,16 @@ export const meta = { items: { type: 'array', optional: false, nullable: false, - prefixItems: [ - { - type: 'string', - }, - { - type: 'number', - }, - ], - unevaluatedItems: false, + items: { + anyOf: [ + { + type: 'string', + }, + { + type: 'number', + }, + ], + }, }, example: [[ 'example.com', 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 e7589cba81..19f7cb85c0 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -21,15 +21,16 @@ export const meta = { items: { type: 'array', optional: false, nullable: false, - prefixItems: [ - { - type: 'string', - }, - { - type: 'number', - }, - ], - unevaluatedItems: false, + items: { + anyOf: [ + { + type: 'string', + }, + { + type: 'number', + }, + ], + }, }, example: [[ 'example.com', 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 7502d4e1f7..d06780e044 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/promote.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/promote.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 d7f9e4eaa3..189690b703 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/stats.ts @@ -1,11 +1,11 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * 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 type { DbQueue, DeliverQueue, EndedPollNotificationQueue, InboxQueue, ObjectStorageQueue, SystemQueue, UserWebhookDeliverQueue, SystemWebhookDeliverQueue } from '@/core/QueueModule.js'; +import type { DbQueue, DeliverQueue, EndedPollNotificationQueue, InboxQueue, ObjectStorageQueue, SystemQueue, WebhookDeliverQueue } from '@/core/QueueModule.js'; export const meta = { tags: ['admin'], @@ -53,8 +53,7 @@ export default class extends Endpoint { // eslint- @Inject('queue:inbox') public inboxQueue: InboxQueue, @Inject('queue:db') public dbQueue: DbQueue, @Inject('queue:objectStorage') public objectStorageQueue: ObjectStorageQueue, - @Inject('queue:userWebhookDeliver') public userWebhookDeliverQueue: UserWebhookDeliverQueue, - @Inject('queue:systemWebhookDeliver') public systemWebhookDeliverQueue: SystemWebhookDeliverQueue, + @Inject('queue:webhookDeliver') public webhookDeliverQueue: WebhookDeliverQueue, ) { super(meta, paramDef, async (ps, me) => { const deliverJobCounts = await this.deliverQueue.getJobCounts(); 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 3d7bc4567e..d55dff7b0c 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/add.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 587d5c3b03..61ea287bff 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 1f6e773cd4..8a6dd4e152 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/remove.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/remove.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 53db096c1d..1a402b4a4a 100644 --- a/packages/backend/src/server/api/endpoints/admin/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/admin/reset-password.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 554d324ff2..26c4038b98 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 @@ -1,14 +1,16 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * 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 type { AbuseUserReportsRepository } from '@/models/_.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'; import { DI } from '@/di-symbols.js'; -import { ApiError } from '@/server/api/error.js'; -import { AbuseReportService } from '@/core/AbuseReportService.js'; +import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin'], @@ -16,41 +18,58 @@ export const meta = { requireCredential: true, requireModerator: true, kind: 'write:admin:resolve-abuse-user-report', - - errors: { - noSuchAbuseReport: { - message: 'No such abuse report.', - code: 'NO_SUCH_ABUSE_REPORT', - id: 'ac3794dd-2ce4-d878-e546-73c60c06b398', - kind: 'server', - httpStatusCode: 404, - }, - }, } as const; export const paramDef = { type: 'object', properties: { reportId: { type: 'string', format: 'misskey:id' }, - resolvedAs: { type: 'string', enum: ['accept', 'reject', null], nullable: true }, + forward: { type: 'boolean', default: false }, }, required: ['reportId'], } as const; +// TODO: ロジックをサービスに切り出す + @Injectable() 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, - private abuseReportService: AbuseReportService, + + private queueService: QueueService, + private instanceActorService: InstanceActorService, + private apRendererService: ApRendererService, + private moderationLogService: ModerationLogService, ) { super(meta, paramDef, async (ps, me) => { const report = await this.abuseUserReportsRepository.findOneBy({ id: ps.reportId }); - if (!report) { - throw new ApiError(meta.errors.noSuchAbuseReport); + + if (report == null) { + throw new Error('report not found'); } - await this.abuseReportService.resolve([{ reportId: report.id, resolvedAs: ps.resolvedAs ?? null }], me); + if (ps.forward && report.targetUserHost != null) { + const actor = await this.instanceActorService.getInstanceActor(); + const targetUser = await this.usersRepository.findOneByOrFail({ id: report.targetUserId }); + + this.queueService.deliver(actor, this.apRendererService.addContext(this.apRendererService.renderFlag(actor, targetUser.uri!, report.comment)), targetUser.inbox, false); + } + + await this.abuseUserReportsRepository.update(report.id, { + resolved: true, + assigneeId: me.id, + forwarded: ps.forward && report.targetUserHost != null, + }); + + this.moderationLogService.log(me, 'resolveAbuseReport', { + reportId: report.id, + report: report, + forwarded: ps.forward && report.targetUserHost != null, + }); }); } } 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 b6c7953781..8eb3d2bf59 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/assign.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/assign.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 e0c02f7a5d..de23d2fb11 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 638e2b15b9..9e2968e317 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 333fac6aa6..d3d1a10a69 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 13e5cbb995..ad4345e5a5 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/show.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 e7da3384b1..c11265252c 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/unassign.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/unassign.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 5cf49670be..203f749a6e 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,7 +7,6 @@ import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { MetaService } from '@/core/MetaService.js'; -import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin', 'role'], @@ -34,22 +33,12 @@ export default class extends Endpoint { // eslint- constructor( private metaService: MetaService, private globalEventService: GlobalEventService, - private moderationLogService: ModerationLogService, ) { - super(meta, paramDef, async (ps, me) => { - const before = await this.metaService.fetch(true); - + super(meta, paramDef, async (ps) => { await this.metaService.update({ policies: ps.policies, }); - - const after = await this.metaService.fetch(true); - - this.globalEventService.publishInternalEvent('policiesUpdated', after.policies); - this.moderationLogService.log(me, 'updateServerSettings', { - before: before.policies, - after: after.policies, - }); + this.globalEventService.publishInternalEvent('policiesUpdated', ps.policies); }); } } 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 465ad7aaaf..74d5aae5d8 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/update.ts @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * 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 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'; @@ -49,6 +50,19 @@ export const paramDef = { }, required: [ 'roleId', + 'name', + 'description', + 'color', + 'iconUrl', + 'target', + 'condFormula', + 'isPublic', + 'isModerator', + 'isAdministrator', + 'asBadge', + 'canEditMembersByModerator', + 'displayOrder', + 'policies', ], } as const; 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 198166bec2..66f4d9d26b 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/users.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/users.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -17,7 +17,7 @@ export const meta = { tags: ['admin', 'role', 'users'], requireCredential: false, - requireModerator: true, + requireAdmin: true, kind: 'read:admin:roles', errors: { @@ -40,7 +40,7 @@ export const meta = { }, required: ['id', 'createdAt', 'user'], }, - }, + } } as const; export const paramDef = { @@ -89,13 +89,10 @@ export default class extends Endpoint { // eslint- .limit(ps.limit) .getMany(); - const _users = assigns.map(({ user, userId }) => user ?? userId); - const _userMap = await this.userEntityService.packMany(_users, me, { schema: 'UserDetailed' }) - .then(users => new Map(users.map(u => [u.id, u]))); return await Promise.all(assigns.map(async assign => ({ id: assign.id, createdAt: this.idService.parse(assign.id).date.toISOString(), - user: _userMap.get(assign.userId) ?? await this.userEntityService.pack(assign.user!, me, { schema: 'UserDetailed' }), + user: await this.userEntityService.pack(assign.user!, me, { detail: true }), expiresAt: assign.expiresAt?.toISOString() ?? null, }))); }); 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 f01a7778a8..d20aee656c 100644 --- a/packages/backend/src/server/api/endpoints/admin/send-email.ts +++ b/packages/backend/src/server/api/endpoints/admin/send-email.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 80b6a4d32e..374712f57d 100644 --- a/packages/backend/src/server/api/endpoints/admin/server-info.ts +++ b/packages/backend/src/server/api/endpoints/admin/server-info.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 58c5f1f60a..f3601be9bb 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -50,7 +50,7 @@ export const meta = { user: { type: 'object', optional: false, nullable: false, - ref: 'UserDetailedNotMe', + ref: 'UserDetailed', }, }, }, 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 655bd32bce..2b50354cef 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-user.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,7 +10,6 @@ import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; import { RoleEntityService } from '@/core/entities/RoleEntityService.js'; import { IdService } from '@/core/IdService.js'; -import { notificationRecieveConfig } from '@/models/json-schema/user.js'; export const meta = { tags: ['admin'], @@ -22,161 +21,6 @@ export const meta = { res: { type: 'object', nullable: false, optional: false, - properties: { - email: { - type: 'string', - optional: false, nullable: true, - }, - emailVerified: { - type: 'boolean', - optional: false, nullable: false, - }, - followedMessage: { - type: 'string', - optional: false, nullable: true, - }, - autoAcceptFollowed: { - type: 'boolean', - optional: false, nullable: false, - }, - noCrawle: { - type: 'boolean', - optional: false, nullable: false, - }, - preventAiLearning: { - type: 'boolean', - optional: false, nullable: false, - }, - alwaysMarkNsfw: { - type: 'boolean', - optional: false, nullable: false, - }, - autoSensitive: { - type: 'boolean', - optional: false, nullable: false, - }, - carefulBot: { - type: 'boolean', - optional: false, nullable: false, - }, - injectFeaturedNote: { - type: 'boolean', - optional: false, nullable: false, - }, - receiveAnnouncementEmail: { - type: 'boolean', - optional: false, nullable: false, - }, - mutedWords: { - type: 'array', - optional: false, nullable: false, - items: { - anyOf: [ - { - type: 'string', - }, - { - type: 'array', - items: { - type: 'string', - }, - }, - ], - }, - }, - mutedInstances: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'string', - }, - }, - notificationRecieveConfig: { - type: 'object', - optional: false, nullable: false, - properties: { - note: { optional: true, ...notificationRecieveConfig }, - follow: { optional: true, ...notificationRecieveConfig }, - mention: { optional: true, ...notificationRecieveConfig }, - reply: { optional: true, ...notificationRecieveConfig }, - renote: { optional: true, ...notificationRecieveConfig }, - quote: { optional: true, ...notificationRecieveConfig }, - reaction: { optional: true, ...notificationRecieveConfig }, - pollEnded: { optional: true, ...notificationRecieveConfig }, - receiveFollowRequest: { optional: true, ...notificationRecieveConfig }, - followRequestAccepted: { optional: true, ...notificationRecieveConfig }, - roleAssigned: { optional: true, ...notificationRecieveConfig }, - achievementEarned: { optional: true, ...notificationRecieveConfig }, - app: { optional: true, ...notificationRecieveConfig }, - test: { optional: true, ...notificationRecieveConfig }, - }, - }, - isModerator: { - type: 'boolean', - optional: false, nullable: false, - }, - isSilenced: { - type: 'boolean', - optional: false, nullable: false, - }, - isSuspended: { - type: 'boolean', - optional: false, nullable: false, - }, - isHibernated: { - type: 'boolean', - optional: false, nullable: false, - }, - lastActiveDate: { - type: 'string', - optional: false, nullable: true, - }, - moderationNote: { - type: 'string', - optional: false, nullable: false, - }, - signins: { - type: 'array', - optional: false, nullable: false, - items: { - ref: 'Signin', - }, - }, - policies: { - type: 'object', - optional: false, nullable: false, - ref: 'RolePolicies', - }, - roles: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'object', - ref: 'Role', - }, - }, - roleAssigns: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'object', - properties: { - createdAt: { - type: 'string', - optional: false, nullable: false, - }, - expiresAt: { - type: 'string', - optional: false, nullable: true, - }, - roleId: { - type: 'string', - optional: false, nullable: false, - }, - }, - }, - }, - }, }, } as const; @@ -230,7 +74,6 @@ export default class extends Endpoint { // eslint- return { email: profile.email, emailVerified: profile.emailVerified, - followedMessage: profile.followedMessage, autoAcceptFollowed: profile.autoAcceptFollowed, noCrawle: profile.noCrawle, preventAiLearning: profile.preventAiLearning, @@ -246,7 +89,7 @@ export default class extends Endpoint { // eslint- isSilenced: isSilenced, isSuspended: user.isSuspended, isHibernated: user.isHibernated, - lastActiveDate: user.lastActiveDate ? user.lastActiveDate.toISOString() : null, + lastActiveDate: user.lastActiveDate, moderationNote: profile.moderationNote ?? '', signins, policies: await this.roleService.getUserPolicies(user.id), 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 2b2c8c60ab..1d31e5e80f 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-users.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-users.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -16,7 +16,7 @@ export const meta = { requireCredential: true, requireModerator: true, - kind: 'read:admin:show-user', + kind: 'read:admin:show-users', res: { type: 'array', @@ -71,13 +71,13 @@ export default class extends Endpoint { // eslint- break; } case 'moderator': { - const moderatorIds = await this.roleService.getModeratorIds({ includeAdmins: false }); + const moderatorIds = await this.roleService.getModeratorIds(false); if (moderatorIds.length === 0) return []; query.where('user.id IN (:...moderatorIds)', { moderatorIds: moderatorIds }); break; } case 'adminOrModerator': { - const adminOrModeratorIds = await this.roleService.getModeratorIds({ includeAdmins: true }); + const adminOrModeratorIds = await this.roleService.getModeratorIds(); if (adminOrModeratorIds.length === 0) return []; query.where('user.id IN (:...adminOrModeratorIds)', { adminOrModeratorIds: adminOrModeratorIds }); break; @@ -114,7 +114,7 @@ export default class extends Endpoint { // eslint- const users = await query.getMany(); - return await this.userEntityService.packMany(users, me, { schema: 'UserDetailed' }); + return await this.userEntityService.packMany(users, me, { detail: true }); }); } } 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 bea1bdc4ed..a26fa81c13 100644 --- a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts @@ -1,14 +1,20 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ +import { IsNull, Not } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { UsersRepository } from '@/models/_.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'; import { DI } from '@/di-symbols.js'; +import { bindThis } from '@/decorators.js'; import { RoleService } from '@/core/RoleService.js'; +import { QueueService } from '@/core/QueueService.js'; export const meta = { tags: ['admin'], @@ -32,8 +38,13 @@ export default class extends Endpoint { // eslint- @Inject(DI.usersRepository) private usersRepository: UsersRepository, + @Inject(DI.followingsRepository) + private followingsRepository: FollowingsRepository, + private userSuspendService: UserSuspendService, private roleService: RoleService, + private moderationLogService: ModerationLogService, + private queueService: QueueService, ) { super(meta, paramDef, async (ps, me) => { const user = await this.usersRepository.findOneBy({ id: ps.userId }); @@ -46,7 +57,42 @@ export default class extends Endpoint { // eslint- throw new Error('cannot suspend moderator account'); } - await this.userSuspendService.suspend(user, me); + await this.usersRepository.update(user.id, { + isSuspended: true, + }); + + this.moderationLogService.log(me, 'suspend', { + userId: user.id, + userUsername: user.username, + userHost: user.host, + }); + + (async () => { + await this.userSuspendService.doPostSuspend(user).catch(e => {}); + await this.unFollowAll(user).catch(e => {}); + })(); }); } + + @bindThis + private async unFollowAll(follower: MiUser) { + const followings = await this.followingsRepository.find({ + where: { + followerId: follower.id, + followeeId: Not(IsNull()), + }, + }); + + const jobs: RelationshipJobData[] = []; + for (const following of followings) { + if (following.followeeId && following.followerId) { + jobs.push({ + from: { id: following.followerId }, + to: { id: following.followeeId }, + silent: true, + }); + } + } + this.queueService.createUnfollowJob(jobs); + } } diff --git a/packages/backend/src/server/api/endpoints/admin/system-webhook/create.ts b/packages/backend/src/server/api/endpoints/admin/system-webhook/create.ts deleted file mode 100644 index 28071e7a33..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/system-webhook/create.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { SystemWebhookEntityService } from '@/core/entities/SystemWebhookEntityService.js'; -import { systemWebhookEventTypes } from '@/models/SystemWebhook.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; - -export const meta = { - tags: ['admin', 'system-webhook'], - - requireCredential: true, - requireModerator: true, - secure: true, - kind: 'write:admin:system-webhook', - - res: { - type: 'object', - ref: 'SystemWebhook', - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - isActive: { - type: 'boolean', - }, - name: { - type: 'string', - minLength: 1, - maxLength: 255, - }, - on: { - type: 'array', - items: { - type: 'string', - enum: systemWebhookEventTypes, - }, - }, - url: { - type: 'string', - minLength: 1, - maxLength: 1024, - }, - secret: { - type: 'string', - minLength: 1, - maxLength: 1024, - }, - }, - required: [ - 'isActive', - 'name', - 'on', - 'url', - 'secret', - ], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private systemWebhookService: SystemWebhookService, - private systemWebhookEntityService: SystemWebhookEntityService, - ) { - super(meta, paramDef, async (ps, me) => { - const result = await this.systemWebhookService.createSystemWebhook( - { - isActive: ps.isActive, - name: ps.name, - on: ps.on, - url: ps.url, - secret: ps.secret, - }, - me, - ); - - return this.systemWebhookEntityService.pack(result); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/admin/system-webhook/delete.ts b/packages/backend/src/server/api/endpoints/admin/system-webhook/delete.ts deleted file mode 100644 index 9cdfc7e70f..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/system-webhook/delete.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; - -export const meta = { - tags: ['admin', 'system-webhook'], - - requireCredential: true, - requireModerator: true, - secure: true, - kind: 'write:admin:system-webhook', -} as const; - -export const paramDef = { - type: 'object', - properties: { - id: { - type: 'string', - format: 'misskey:id', - }, - }, - required: [ - 'id', - ], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private systemWebhookService: SystemWebhookService, - ) { - super(meta, paramDef, async (ps, me) => { - await this.systemWebhookService.deleteSystemWebhook( - ps.id, - me, - ); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/admin/system-webhook/list.ts b/packages/backend/src/server/api/endpoints/admin/system-webhook/list.ts deleted file mode 100644 index 7a440a774e..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/system-webhook/list.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { SystemWebhookEntityService } from '@/core/entities/SystemWebhookEntityService.js'; -import { systemWebhookEventTypes } from '@/models/SystemWebhook.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; - -export const meta = { - tags: ['admin', 'system-webhook'], - - requireCredential: true, - requireModerator: true, - secure: true, - kind: 'write:admin:system-webhook', - - res: { - type: 'array', - items: { - type: 'object', - ref: 'SystemWebhook', - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - isActive: { - type: 'boolean', - }, - on: { - type: 'array', - items: { - type: 'string', - enum: systemWebhookEventTypes, - }, - }, - }, - required: [], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private systemWebhookService: SystemWebhookService, - private systemWebhookEntityService: SystemWebhookEntityService, - ) { - super(meta, paramDef, async (ps) => { - const webhooks = await this.systemWebhookService.fetchSystemWebhooks({ - isActive: ps.isActive, - on: ps.on, - }); - return this.systemWebhookEntityService.packMany(webhooks); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/admin/system-webhook/show.ts b/packages/backend/src/server/api/endpoints/admin/system-webhook/show.ts deleted file mode 100644 index 75862c96a7..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/system-webhook/show.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { SystemWebhookEntityService } from '@/core/entities/SystemWebhookEntityService.js'; -import { ApiError } from '@/server/api/error.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; - -export const meta = { - tags: ['admin', 'system-webhook'], - - requireCredential: true, - requireModerator: true, - secure: true, - kind: 'write:admin:system-webhook', - - res: { - type: 'object', - ref: 'SystemWebhook', - }, - - errors: { - noSuchSystemWebhook: { - message: 'No such SystemWebhook.', - code: 'NO_SUCH_SYSTEM_WEBHOOK', - id: '38dd1ffe-04b4-6ff5-d8ba-4e6a6ae22c9d', - kind: 'server', - httpStatusCode: 404, - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - id: { - type: 'string', - format: 'misskey:id', - }, - }, - required: ['id'], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private systemWebhookService: SystemWebhookService, - private systemWebhookEntityService: SystemWebhookEntityService, - ) { - super(meta, paramDef, async (ps) => { - const webhooks = await this.systemWebhookService.fetchSystemWebhooks({ ids: [ps.id] }); - if (webhooks.length === 0) { - throw new ApiError(meta.errors.noSuchSystemWebhook); - } - - return this.systemWebhookEntityService.pack(webhooks[0]); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/admin/system-webhook/test.ts b/packages/backend/src/server/api/endpoints/admin/system-webhook/test.ts deleted file mode 100644 index fb2ddf4b44..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/system-webhook/test.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import ms from 'ms'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { WebhookTestService } from '@/core/WebhookTestService.js'; -import { ApiError } from '@/server/api/error.js'; -import { systemWebhookEventTypes } from '@/models/SystemWebhook.js'; - -export const meta = { - tags: ['webhooks'], - - requireCredential: true, - requireModerator: true, - secure: true, - kind: 'read:admin:system-webhook', - - limit: { - duration: ms('15min'), - max: 60, - }, - - errors: { - noSuchWebhook: { - message: 'No such webhook.', - code: 'NO_SUCH_WEBHOOK', - id: '0c52149c-e913-18f8-5dc7-74870bfe0cf9', - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - webhookId: { - type: 'string', - format: 'misskey:id', - }, - type: { - type: 'string', - enum: systemWebhookEventTypes, - }, - override: { - type: 'object', - properties: { - url: { type: 'string', nullable: false }, - secret: { type: 'string', nullable: false }, - }, - }, - }, - required: ['webhookId', 'type'], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private webhookTestService: WebhookTestService, - ) { - super(meta, paramDef, async (ps) => { - try { - await this.webhookTestService.testSystemWebhook({ - webhookId: ps.webhookId, - type: ps.type, - override: ps.override, - }); - } catch (e) { - if (e instanceof WebhookTestService.NoSuchWebhookError) { - throw new ApiError(meta.errors.noSuchWebhook); - } - throw e; - } - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/admin/system-webhook/update.ts b/packages/backend/src/server/api/endpoints/admin/system-webhook/update.ts deleted file mode 100644 index 8d68bb8f87..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/system-webhook/update.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { SystemWebhookEntityService } from '@/core/entities/SystemWebhookEntityService.js'; -import { systemWebhookEventTypes } from '@/models/SystemWebhook.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; - -export const meta = { - tags: ['admin', 'system-webhook'], - - requireCredential: true, - requireModerator: true, - secure: true, - kind: 'write:admin:system-webhook', - - res: { - type: 'object', - ref: 'SystemWebhook', - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - id: { - type: 'string', - format: 'misskey:id', - }, - isActive: { - type: 'boolean', - }, - name: { - type: 'string', - minLength: 1, - maxLength: 255, - }, - on: { - type: 'array', - items: { - type: 'string', - enum: systemWebhookEventTypes, - }, - }, - url: { - type: 'string', - minLength: 1, - maxLength: 1024, - }, - secret: { - type: 'string', - minLength: 1, - maxLength: 1024, - }, - }, - required: [ - 'id', - 'isActive', - 'name', - 'on', - 'url', - 'secret', - ], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private systemWebhookService: SystemWebhookService, - private systemWebhookEntityService: SystemWebhookEntityService, - ) { - super(meta, paramDef, async (ps, me) => { - const result = await this.systemWebhookService.updateSystemWebhook( - { - id: ps.id, - isActive: ps.isActive, - name: ps.name, - on: ps.on, - url: ps.url, - secret: ps.secret, - }, - me, - ); - - return this.systemWebhookEntityService.pack(result); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/admin/unset-user-avatar.ts b/packages/backend/src/server/api/endpoints/admin/unset-user-avatar.ts index ddab6f3a9d..8b22fad1d4 100644 --- a/packages/backend/src/server/api/endpoints/admin/unset-user-avatar.ts +++ b/packages/backend/src/server/api/endpoints/admin/unset-user-avatar.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/admin/unset-user-banner.ts b/packages/backend/src/server/api/endpoints/admin/unset-user-banner.ts index e16dad719c..5ec359c0ef 100644 --- a/packages/backend/src/server/api/endpoints/admin/unset-user-banner.ts +++ b/packages/backend/src/server/api/endpoints/admin/unset-user-banner.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 b52c638cdb..9c896f0e64 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * 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 type { UsersRepository } from '@/models/_.js'; +import { ModerationLogService } from '@/core/ModerationLogService.js'; import { UserSuspendService } from '@/core/UserSuspendService.js'; import { DI } from '@/di-symbols.js'; @@ -32,6 +33,7 @@ export default class extends Endpoint { // eslint- private usersRepository: UsersRepository, private userSuspendService: UserSuspendService, + private moderationLogService: ModerationLogService, ) { super(meta, paramDef, async (ps, me) => { const user = await this.usersRepository.findOneBy({ id: ps.userId }); @@ -40,7 +42,17 @@ export default class extends Endpoint { // eslint- throw new Error('user not found'); } - await this.userSuspendService.unsuspend(user, me); + await this.usersRepository.update(user.id, { + isSuspended: false, + }); + + this.moderationLogService.log(me, 'unsuspend', { + userId: user.id, + userUsername: user.username, + userHost: user.host, + }); + + this.userSuspendService.doPostUnsuspend(user); }); } } diff --git a/packages/backend/src/server/api/endpoints/admin/update-abuse-user-report.ts b/packages/backend/src/server/api/endpoints/admin/update-abuse-user-report.ts deleted file mode 100644 index 73d4b843f0..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/update-abuse-user-report.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { AbuseUserReportsRepository } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; -import { ApiError } from '@/server/api/error.js'; -import { AbuseReportService } from '@/core/AbuseReportService.js'; - -export const meta = { - tags: ['admin'], - - requireCredential: true, - requireModerator: true, - kind: 'write:admin:resolve-abuse-user-report', - - errors: { - noSuchAbuseReport: { - message: 'No such abuse report.', - code: 'NO_SUCH_ABUSE_REPORT', - id: '15f51cf5-46d1-4b1d-a618-b35bcbed0662', - kind: 'server', - httpStatusCode: 404, - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - reportId: { type: 'string', format: 'misskey:id' }, - moderationNote: { type: 'string' }, - }, - required: ['reportId'], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - @Inject(DI.abuseUserReportsRepository) - private abuseUserReportsRepository: AbuseUserReportsRepository, - private abuseReportService: AbuseReportService, - ) { - super(meta, paramDef, async (ps, me) => { - const report = await this.abuseUserReportsRepository.findOneBy({ id: ps.reportId }); - if (!report) { - throw new ApiError(meta.errors.noSuchAbuseReport); - } - - await this.abuseReportService.update(report.id, { - moderationNote: ps.moderationNote, - }, me); - }); - } -} 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 38ef0d1de8..3a6426435d 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -41,16 +41,6 @@ export const paramDef = { type: 'string', }, }, - prohibitedWords: { - type: 'array', nullable: true, items: { - type: 'string', - }, - }, - prohibitedWordsForNameOfUser: { - type: 'array', nullable: true, items: { - type: 'string', - }, - }, themeColor: { type: 'string', nullable: true, pattern: '^#[0-9a-fA-F]{6}$' }, mascotImageUrl: { type: 'string', nullable: true }, bannerUrl: { type: 'string', nullable: true }, @@ -73,17 +63,12 @@ export const paramDef = { enableHcaptcha: { type: 'boolean' }, hcaptchaSiteKey: { type: 'string', nullable: true }, hcaptchaSecretKey: { type: 'string', nullable: true }, - enableMcaptcha: { type: 'boolean' }, - mcaptchaSiteKey: { type: 'string', nullable: true }, - mcaptchaInstanceUrl: { type: 'string', nullable: true }, - mcaptchaSecretKey: { type: 'string', nullable: true }, enableRecaptcha: { type: 'boolean' }, recaptchaSiteKey: { type: 'string', nullable: true }, recaptchaSecretKey: { type: 'string', nullable: true }, enableTurnstile: { type: 'boolean' }, turnstileSiteKey: { type: 'string', nullable: true }, turnstileSecretKey: { type: 'string', nullable: true }, - enableTestcaptcha: { type: 'boolean' }, sensitiveMediaDetection: { type: 'string', enum: ['none', 'all', 'local', 'remote'] }, sensitiveMediaDetectionSensitivity: { type: 'string', enum: ['medium', 'low', 'high', 'veryLow', 'veryHigh'] }, setSensitiveFlagAutomatically: { type: 'boolean' }, @@ -96,6 +81,7 @@ export const paramDef = { type: 'string', }, }, + summalyProxy: { type: 'string', nullable: true }, deeplAuthKey: { type: 'string', nullable: true }, deeplIsPro: { type: 'boolean' }, enableEmail: { type: 'boolean' }, @@ -109,11 +95,10 @@ export const paramDef = { swPublicKey: { type: 'string', nullable: true }, swPrivateKey: { type: 'string', nullable: true }, tosUrl: { type: 'string', nullable: true }, - repositoryUrl: { type: 'string', nullable: true }, - feedbackUrl: { type: 'string', nullable: true }, + repositoryUrl: { type: 'string' }, + feedbackUrl: { type: 'string' }, impressumUrl: { type: 'string', nullable: true }, privacyPolicyUrl: { type: 'string', nullable: true }, - inquiryUrl: { type: 'string', nullable: true }, useObjectStorage: { type: 'boolean' }, objectStorageBaseUrl: { type: 'string', nullable: true }, objectStorageBucket: { type: 'string', nullable: true }, @@ -136,7 +121,6 @@ export const paramDef = { truemailAuthKey: { type: 'string', nullable: true }, enableChartsForRemoteUser: { type: 'boolean' }, enableChartsForFederatedInstances: { type: 'boolean' }, - enableStatsForFederatedInstances: { type: 'boolean' }, enableServerMachineStats: { type: 'boolean' }, enableIdenticonGeneration: { type: 'boolean' }, serverRules: { type: 'array', items: { type: 'string' } }, @@ -149,7 +133,6 @@ export const paramDef = { perRemoteUserUserTimelineCacheMax: { type: 'integer' }, perUserHomeTimelineCacheMax: { type: 'integer' }, perUserListTimelineCacheMax: { type: 'integer' }, - enableReactionsBuffering: { type: 'boolean' }, notesPerOneAd: { type: 'integer' }, silencedHosts: { type: 'array', @@ -158,33 +141,6 @@ export const paramDef = { type: 'string', }, }, - mediaSilencedHosts: { - type: 'array', - nullable: true, - items: { - type: 'string', - }, - }, - summalyProxy: { - type: 'string', nullable: true, - description: '[Deprecated] Use "urlPreviewSummaryProxyUrl" instead.', - }, - urlPreviewEnabled: { type: 'boolean' }, - urlPreviewTimeout: { type: 'integer' }, - urlPreviewMaximumContentLength: { type: 'integer' }, - urlPreviewRequireContentLength: { type: 'boolean' }, - urlPreviewUserAgent: { type: 'string', nullable: true }, - urlPreviewSummaryProxyUrl: { type: 'string', nullable: true }, - federation: { - type: 'string', - enum: ['all', 'none', 'specified'], - }, - federationHosts: { - type: 'array', - items: { - type: 'string', - }, - }, }, required: [], } as const; @@ -217,12 +173,6 @@ export default class extends Endpoint { // eslint- if (Array.isArray(ps.sensitiveWords)) { set.sensitiveWords = ps.sensitiveWords.filter(Boolean); } - if (Array.isArray(ps.prohibitedWords)) { - set.prohibitedWords = ps.prohibitedWords.filter(Boolean); - } - if (Array.isArray(ps.prohibitedWordsForNameOfUser)) { - set.prohibitedWordsForNameOfUser = ps.prohibitedWordsForNameOfUser.filter(Boolean); - } if (Array.isArray(ps.silencedHosts)) { let lastValue = ''; set.silencedHosts = ps.silencedHosts.sort().filter((h) => { @@ -231,14 +181,6 @@ export default class extends Endpoint { // eslint- return h !== '' && h !== lv && !set.blockedHosts?.includes(h); }); } - if (Array.isArray(ps.mediaSilencedHosts)) { - let lastValue = ''; - set.mediaSilencedHosts = ps.mediaSilencedHosts.sort().filter((h) => { - const lv = lastValue; - lastValue = h; - return h !== '' && h !== lv && !set.blockedHosts?.includes(h); - }); - } if (ps.themeColor !== undefined) { set.themeColor = ps.themeColor; } @@ -327,22 +269,6 @@ export default class extends Endpoint { // eslint- set.hcaptchaSecretKey = ps.hcaptchaSecretKey; } - if (ps.enableMcaptcha !== undefined) { - set.enableMcaptcha = ps.enableMcaptcha; - } - - if (ps.mcaptchaSiteKey !== undefined) { - set.mcaptchaSitekey = ps.mcaptchaSiteKey; - } - - if (ps.mcaptchaInstanceUrl !== undefined) { - set.mcaptchaInstanceUrl = ps.mcaptchaInstanceUrl; - } - - if (ps.mcaptchaSecretKey !== undefined) { - set.mcaptchaSecretKey = ps.mcaptchaSecretKey; - } - if (ps.enableRecaptcha !== undefined) { set.enableRecaptcha = ps.enableRecaptcha; } @@ -367,10 +293,6 @@ export default class extends Endpoint { // eslint- set.turnstileSecretKey = ps.turnstileSecretKey; } - if (ps.enableTestcaptcha !== undefined) { - set.enableTestcaptcha = ps.enableTestcaptcha; - } - if (ps.sensitiveMediaDetection !== undefined) { set.sensitiveMediaDetection = ps.sensitiveMediaDetection; } @@ -403,6 +325,10 @@ export default class extends Endpoint { // eslint- set.langs = ps.langs.filter(Boolean); } + if (ps.summalyProxy !== undefined) { + set.summalyProxy = ps.summalyProxy; + } + if (ps.enableEmail !== undefined) { set.enableEmail = ps.enableEmail; } @@ -448,7 +374,7 @@ export default class extends Endpoint { // eslint- } if (ps.repositoryUrl !== undefined) { - set.repositoryUrl = URL.canParse(ps.repositoryUrl!) ? ps.repositoryUrl : null; + set.repositoryUrl = ps.repositoryUrl; } if (ps.feedbackUrl !== undefined) { @@ -463,10 +389,6 @@ export default class extends Endpoint { // eslint- set.privacyPolicyUrl = ps.privacyPolicyUrl; } - if (ps.inquiryUrl !== undefined) { - set.inquiryUrl = ps.inquiryUrl; - } - if (ps.useObjectStorage !== undefined) { set.useObjectStorage = ps.useObjectStorage; } @@ -550,7 +472,7 @@ export default class extends Endpoint { // eslint- set.verifymailAuthKey = ps.verifymailAuthKey; } } - + if (ps.enableTruemailApi !== undefined) { set.enableTruemailApi = ps.enableTruemailApi; } @@ -579,10 +501,6 @@ export default class extends Endpoint { // eslint- set.enableChartsForFederatedInstances = ps.enableChartsForFederatedInstances; } - if (ps.enableStatsForFederatedInstances !== undefined) { - set.enableStatsForFederatedInstances = ps.enableStatsForFederatedInstances; - } - if (ps.enableServerMachineStats !== undefined) { set.enableServerMachineStats = ps.enableServerMachineStats; } @@ -627,10 +545,6 @@ export default class extends Endpoint { // eslint- set.perUserListTimelineCacheMax = ps.perUserListTimelineCacheMax; } - if (ps.enableReactionsBuffering !== undefined) { - set.enableReactionsBuffering = ps.enableReactionsBuffering; - } - if (ps.notesPerOneAd !== undefined) { set.notesPerOneAd = ps.notesPerOneAd; } @@ -639,40 +553,6 @@ export default class extends Endpoint { // eslint- set.bannedEmailDomains = ps.bannedEmailDomains; } - if (ps.urlPreviewEnabled !== undefined) { - set.urlPreviewEnabled = ps.urlPreviewEnabled; - } - - if (ps.urlPreviewTimeout !== undefined) { - set.urlPreviewTimeout = ps.urlPreviewTimeout; - } - - if (ps.urlPreviewMaximumContentLength !== undefined) { - set.urlPreviewMaximumContentLength = ps.urlPreviewMaximumContentLength; - } - - if (ps.urlPreviewRequireContentLength !== undefined) { - set.urlPreviewRequireContentLength = ps.urlPreviewRequireContentLength; - } - - if (ps.urlPreviewUserAgent !== undefined) { - const value = (ps.urlPreviewUserAgent ?? '').trim(); - set.urlPreviewUserAgent = value === '' ? null : ps.urlPreviewUserAgent; - } - - if (ps.summalyProxy !== undefined || ps.urlPreviewSummaryProxyUrl !== undefined) { - const value = ((ps.urlPreviewSummaryProxyUrl ?? ps.summalyProxy) ?? '').trim(); - set.urlPreviewSummaryProxyUrl = value === '' ? null : value; - } - - if (ps.federation !== undefined) { - set.federation = ps.federation; - } - - if (Array.isArray(ps.federationHosts)) { - set.federationHosts = ps.federationHosts.filter(Boolean).map(x => x.toLowerCase()); - } - const before = await this.metaService.fetch(true); await this.metaService.update(set); 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 e9930422c0..e582147e72 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/announcements.ts b/packages/backend/src/server/api/endpoints/announcements.ts index ff8dd73605..7c242dbcd5 100644 --- a/packages/backend/src/server/api/endpoints/announcements.ts +++ b/packages/backend/src/server/api/endpoints/announcements.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,9 +7,9 @@ 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 { AnnouncementEntityService } from '@/core/entities/AnnouncementEntityService.js'; +import { AnnouncementService } from '@/core/AnnouncementService.js'; import { DI } from '@/di-symbols.js'; -import type { AnnouncementsRepository } from '@/models/_.js'; +import type { AnnouncementReadsRepository, AnnouncementsRepository } from '@/models/_.js'; export const meta = { tags: ['meta'], @@ -44,8 +44,11 @@ export default class extends Endpoint { // eslint- @Inject(DI.announcementsRepository) private announcementsRepository: AnnouncementsRepository, + @Inject(DI.announcementReadsRepository) + private announcementReadsRepository: AnnouncementReadsRepository, + private queryService: QueryService, - private announcementEntityService: AnnouncementEntityService, + private announcementService: AnnouncementService, ) { super(meta, paramDef, async (ps, me) => { const query = this.queryService.makePaginationQuery(this.announcementsRepository.createQueryBuilder('announcement'), ps.sinceId, ps.untilId) @@ -57,7 +60,7 @@ export default class extends Endpoint { // eslint- const announcements = await query.limit(ps.limit).getMany(); - return this.announcementEntityService.packMany(announcements, me); + return this.announcementService.packMany(announcements, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/announcements/show.ts b/packages/backend/src/server/api/endpoints/announcements/show.ts deleted file mode 100644 index 6312a0a54c..0000000000 --- a/packages/backend/src/server/api/endpoints/announcements/show.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { EntityNotFoundError } from 'typeorm'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { AnnouncementService } from '@/core/AnnouncementService.js'; -import { ApiError } from '../../error.js'; - -export const meta = { - tags: ['meta'], - - requireCredential: false, - - res: { - type: 'object', - optional: false, nullable: false, - ref: 'Announcement', - }, - - errors: { - noSuchAnnouncement: { - message: 'No such announcement.', - code: 'NO_SUCH_ANNOUNCEMENT', - id: 'b57b5e1d-4f49-404a-9edb-46b00268f121', - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - announcementId: { type: 'string', format: 'misskey:id' }, - }, - required: ['announcementId'], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private announcementService: AnnouncementService, - ) { - super(meta, paramDef, async (ps, me) => { - try { - return await this.announcementService.getAnnouncement(ps.announcementId, me); - } catch (err) { - if (err instanceof EntityNotFoundError) throw new ApiError(meta.errors.noSuchAnnouncement); - throw err; - } - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/antennas/create.ts b/packages/backend/src/server/api/endpoints/antennas/create.ts index e0c8ddcc84..b029493d3a 100644 --- a/packages/backend/src/server/api/endpoints/antennas/create.ts +++ b/packages/backend/src/server/api/endpoints/antennas/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -34,12 +34,6 @@ export const meta = { code: 'TOO_MANY_ANTENNAS', id: 'faf47050-e8b5-438c-913c-db2b1576fde4', }, - - emptyKeyword: { - message: 'Either keywords or excludeKeywords is required.', - code: 'EMPTY_KEYWORD', - id: '53ee222e-1ddd-4f9a-92e5-9fb82ddb463a', - }, }, res: { @@ -70,11 +64,11 @@ export const paramDef = { } }, caseSensitive: { type: 'boolean' }, localOnly: { type: 'boolean' }, - excludeBots: { type: 'boolean' }, withReplies: { type: 'boolean' }, withFile: { type: 'boolean' }, + notify: { type: 'boolean' }, }, - required: ['name', 'src', 'keywords', 'excludeKeywords', 'users', 'caseSensitive', 'withReplies', 'withFile'], + required: ['name', 'src', 'keywords', 'excludeKeywords', 'users', 'caseSensitive', 'withReplies', 'withFile', 'notify'], } as const; @Injectable() @@ -93,13 +87,13 @@ export default class extends Endpoint { // eslint- ) { super(meta, paramDef, async (ps, me) => { if (ps.keywords.flat().every(x => x === '') && ps.excludeKeywords.flat().every(x => x === '')) { - throw new ApiError(meta.errors.emptyKeyword); + throw new Error('either keywords or excludeKeywords is required.'); } const currentAntennasCount = await this.antennasRepository.countBy({ userId: me.id, }); - if (currentAntennasCount >= (await this.roleService.getUserPolicies(me.id)).antennaLimit) { + if (currentAntennasCount > (await this.roleService.getUserPolicies(me.id)).antennaLimit) { throw new ApiError(meta.errors.tooManyAntennas); } @@ -118,7 +112,7 @@ export default class extends Endpoint { // eslint- const now = new Date(); - const antenna = await this.antennasRepository.insertOne({ + const antenna = await this.antennasRepository.insert({ id: this.idService.gen(now.getTime()), lastUsedAt: now, userId: me.id, @@ -130,10 +124,10 @@ export default class extends Endpoint { // eslint- users: ps.users, caseSensitive: ps.caseSensitive, localOnly: ps.localOnly, - excludeBots: ps.excludeBots, withReplies: ps.withReplies, withFile: ps.withFile, - }); + notify: ps.notify, + }).then(x => this.antennasRepository.findOneByOrFail(x.identifiers[0])); this.globalEventService.publishInternalEvent('antennaCreated', antenna); diff --git a/packages/backend/src/server/api/endpoints/antennas/delete.ts b/packages/backend/src/server/api/endpoints/antennas/delete.ts index 2258954b56..e6240aec65 100644 --- a/packages/backend/src/server/api/endpoints/antennas/delete.ts +++ b/packages/backend/src/server/api/endpoints/antennas/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/antennas/list.ts b/packages/backend/src/server/api/endpoints/antennas/list.ts index 83d29f9c8c..3a9f969d24 100644 --- a/packages/backend/src/server/api/endpoints/antennas/list.ts +++ b/packages/backend/src/server/api/endpoints/antennas/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/antennas/notes.ts b/packages/backend/src/server/api/endpoints/antennas/notes.ts index f4dfe1ecc4..0bf2688b4a 100644 --- a/packages/backend/src/server/api/endpoints/antennas/notes.ts +++ b/packages/backend/src/server/api/endpoints/antennas/notes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -14,7 +14,6 @@ import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { IdService } from '@/core/IdService.js'; import { FanoutTimelineService } from '@/core/FanoutTimelineService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; -import { trackPromise } from '@/misc/promise-tracker.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -93,7 +92,7 @@ export default class extends Endpoint { // eslint- antenna.isActive = true; antenna.lastUsedAt = new Date(); - trackPromise(this.antennasRepository.update(antenna.id, antenna)); + this.antennasRepository.update(antenna.id, antenna); if (needPublishEvent) { this.globalEventService.publishInternalEvent('antennaUpdated', antenna); @@ -124,7 +123,9 @@ export default class extends Endpoint { // eslint- notes.sort((a, b) => a.id > b.id ? -1 : 1); } - this.noteReadService.read(me.id, notes); + if (notes.length > 0) { + this.noteReadService.read(me.id, notes); + } return await this.noteEntityService.packMany(notes, me); }); diff --git a/packages/backend/src/server/api/endpoints/antennas/show.ts b/packages/backend/src/server/api/endpoints/antennas/show.ts index a40f187d0b..77c9b31763 100644 --- a/packages/backend/src/server/api/endpoints/antennas/show.ts +++ b/packages/backend/src/server/api/endpoints/antennas/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/antennas/update.ts b/packages/backend/src/server/api/endpoints/antennas/update.ts index 10f26b1912..3457bb6f66 100644 --- a/packages/backend/src/server/api/endpoints/antennas/update.ts +++ b/packages/backend/src/server/api/endpoints/antennas/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -32,12 +32,6 @@ export const meta = { code: 'NO_SUCH_USER_LIST', id: '1c6b35c9-943e-48c2-81e4-2844989407f7', }, - - emptyKeyword: { - message: 'Either keywords or excludeKeywords is required.', - code: 'EMPTY_KEYWORD', - id: '721aaff6-4e1b-4d88-8de6-877fae9f68c4', - }, }, res: { @@ -69,11 +63,11 @@ export const paramDef = { } }, caseSensitive: { type: 'boolean' }, localOnly: { type: 'boolean' }, - excludeBots: { type: 'boolean' }, withReplies: { type: 'boolean' }, withFile: { type: 'boolean' }, + notify: { type: 'boolean' }, }, - required: ['antennaId'], + required: ['antennaId', 'name', 'src', 'keywords', 'excludeKeywords', 'users', 'caseSensitive', 'withReplies', 'withFile', 'notify'], } as const; @Injectable() @@ -89,10 +83,8 @@ export default class extends Endpoint { // eslint- private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { - if (ps.keywords && ps.excludeKeywords) { - if (ps.keywords.flat().every(x => x === '') && ps.excludeKeywords.flat().every(x => x === '')) { - throw new ApiError(meta.errors.emptyKeyword); - } + 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({ @@ -106,7 +98,7 @@ export default class extends Endpoint { // eslint- let userList; - if ((ps.src === 'list' || antenna.src === 'list') && ps.userListId) { + if (ps.src === 'list' && ps.userListId) { userList = await this.userListsRepository.findOneBy({ id: ps.userListId, userId: me.id, @@ -120,15 +112,15 @@ export default class extends Endpoint { // eslint- await this.antennasRepository.update(antenna.id, { name: ps.name, src: ps.src, - userListId: ps.userListId !== undefined ? userList ? userList.id : null : undefined, + userListId: userList ? userList.id : null, keywords: ps.keywords, excludeKeywords: ps.excludeKeywords, users: ps.users, caseSensitive: ps.caseSensitive, localOnly: ps.localOnly, - excludeBots: ps.excludeBots, withReplies: ps.withReplies, withFile: ps.withFile, + notify: ps.notify, isActive: true, lastUsedAt: new Date(), }); diff --git a/packages/backend/src/server/api/endpoints/ap/get.ts b/packages/backend/src/server/api/endpoints/ap/get.ts index d8c55de7ec..e0ef5d413a 100644 --- a/packages/backend/src/server/api/endpoints/ap/get.ts +++ b/packages/backend/src/server/api/endpoints/ap/get.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/ap/show.ts b/packages/backend/src/server/api/endpoints/ap/show.ts index c52608cefb..7e5c7a917c 100644 --- a/packages/backend/src/server/api/endpoints/ap/show.ts +++ b/packages/backend/src/server/api/endpoints/ap/show.ts @@ -1,9 +1,9 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * 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 { MiNote } from '@/models/Note.js'; @@ -12,6 +12,7 @@ import { isActor, isPost, getApId } from '@/core/activitypub/type.js'; import type { SchemaType } from '@/misc/json-schema.js'; import { ApResolverService } from '@/core/activitypub/ApResolverService.js'; import { ApDbResolverService } from '@/core/activitypub/ApDbResolverService.js'; +import { MetaService } from '@/core/MetaService.js'; import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js'; import { ApNoteService } from '@/core/activitypub/models/ApNoteService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; @@ -90,6 +91,7 @@ export default class extends Endpoint { // eslint- private utilityService: UtilityService, private userEntityService: UserEntityService, private noteEntityService: NoteEntityService, + private metaService: MetaService, private apResolverService: ApResolverService, private apDbResolverService: ApDbResolverService, private apPersonService: ApPersonService, @@ -110,7 +112,9 @@ export default class extends Endpoint { // eslint- */ @bindThis private async fetchAny(uri: string, me: MiLocalUser | null | undefined): Promise | null> { - if (!this.utilityService.isFederationAllowedUri(uri)) return null; + // ブロックしてたら中断 + const fetchedMeta = await this.metaService.fetch(); + if (this.utilityService.isBlockedHost(fetchedMeta.blockedHosts, this.utilityService.extractDbHost(uri))) return null; let local = await this.mergePack(me, ...await Promise.all([ this.apDbResolverService.getUserFromApId(uri), @@ -144,7 +148,7 @@ export default class extends Endpoint { // eslint- if (user != null) { return { type: 'User', - object: await this.userEntityService.pack(user, me, { schema: 'UserDetailedNotMe' }), + object: await this.userEntityService.pack(user, me, { detail: true }), }; } else if (note != null) { try { diff --git a/packages/backend/src/server/api/endpoints/app/create.ts b/packages/backend/src/server/api/endpoints/app/create.ts index ba847fc4f0..f89d9823ba 100644 --- a/packages/backend/src/server/api/endpoints/app/create.ts +++ b/packages/backend/src/server/api/endpoints/app/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -54,7 +54,7 @@ export default class extends Endpoint { // eslint- const permission = unique(ps.permission.map(v => v.replace(/^(.+)(\/|-)(read|write)$/, '$3:$1'))); // Create account - const app = await this.appsRepository.insertOne({ + const app = await this.appsRepository.insert({ id: this.idService.gen(), userId: me ? me.id : null, name: ps.name, @@ -62,7 +62,7 @@ export default class extends Endpoint { // eslint- permission, callbackUrl: ps.callbackUrl, secret: secret, - }); + }).then(x => this.appsRepository.findOneByOrFail(x.identifiers[0])); return await this.appEntityService.pack(app, null, { detail: true, diff --git a/packages/backend/src/server/api/endpoints/app/show.ts b/packages/backend/src/server/api/endpoints/app/show.ts index 3db9a0d0d4..cb968a1c65 100644 --- a/packages/backend/src/server/api/endpoints/app/show.ts +++ b/packages/backend/src/server/api/endpoints/app/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/auth/accept.ts b/packages/backend/src/server/api/endpoints/auth/accept.ts index 2e62f04df0..e0baeb3565 100644 --- a/packages/backend/src/server/api/endpoints/auth/accept.ts +++ b/packages/backend/src/server/api/endpoints/auth/accept.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -62,7 +62,7 @@ export default class extends Endpoint { // eslint- const accessToken = secureRndstr(32); // Fetch exist access token - const exist = await this.accessTokensRepository.exists({ + const exist = await this.accessTokensRepository.exist({ where: { appId: session.appId, userId: me.id, 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 f8ddfdb75c..6e474c59e0 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/generate.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/generate.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -78,11 +78,11 @@ export default class extends Endpoint { // eslint- const token = randomUUID(); // Create session token document - const doc = await this.authSessionsRepository.insertOne({ + const doc = await this.authSessionsRepository.insert({ id: this.idService.gen(), appId: app.id, token: token, - }); + }).then(x => this.authSessionsRepository.findOneByOrFail(x.identifiers[0])); return { token: doc.token, 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 13e02a2541..0f5da0f252 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/show.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 b490c5832d..ffddda090b 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -112,7 +112,7 @@ export default class extends Endpoint { // eslint- return { accessToken: accessToken.token, user: await this.userEntityService.pack(session.userId, null, { - schema: 'UserDetailedNotMe', + detail: true, }), }; }); diff --git a/packages/backend/src/server/api/endpoints/blocking/create.ts b/packages/backend/src/server/api/endpoints/blocking/create.ts index 5066215749..3c7d7ac8cd 100644 --- a/packages/backend/src/server/api/endpoints/blocking/create.ts +++ b/packages/backend/src/server/api/endpoints/blocking/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -88,7 +88,7 @@ export default class extends Endpoint { // eslint- }); // Check if already blocking - const exist = await this.blockingsRepository.exists({ + const exist = await this.blockingsRepository.exist({ where: { blockerId: blocker.id, blockeeId: blockee.id, @@ -102,7 +102,7 @@ export default class extends Endpoint { // eslint- await this.userBlockingService.block(blocker, blockee); return await this.userEntityService.pack(blockee.id, blocker, { - schema: 'UserDetailedNotMe', + detail: true, }); }); } diff --git a/packages/backend/src/server/api/endpoints/blocking/delete.ts b/packages/backend/src/server/api/endpoints/blocking/delete.ts index cebb307338..0ce334d559 100644 --- a/packages/backend/src/server/api/endpoints/blocking/delete.ts +++ b/packages/backend/src/server/api/endpoints/blocking/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -88,7 +88,7 @@ export default class extends Endpoint { // eslint- }); // Check not blocking - const exist = await this.blockingsRepository.exists({ + const exist = await this.blockingsRepository.exist({ where: { blockerId: blocker.id, blockeeId: blockee.id, @@ -103,7 +103,7 @@ export default class extends Endpoint { // eslint- await this.userBlockingService.unblock(blocker, blockee); return await this.userEntityService.pack(blockee.id, blocker, { - schema: 'UserDetailedNotMe', + detail: true, }); }); } diff --git a/packages/backend/src/server/api/endpoints/blocking/list.ts b/packages/backend/src/server/api/endpoints/blocking/list.ts index 8431fa6b34..58d24540d1 100644 --- a/packages/backend/src/server/api/endpoints/blocking/list.ts +++ b/packages/backend/src/server/api/endpoints/blocking/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/bubble-game/ranking.ts b/packages/backend/src/server/api/endpoints/bubble-game/ranking.ts deleted file mode 100644 index ab877bbe20..0000000000 --- a/packages/backend/src/server/api/endpoints/bubble-game/ranking.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { MoreThan } from 'typeorm'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { BubbleGameRecordsRepository } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; - -export const meta = { - allowGet: true, - cacheSec: 60, - - errors: { - }, - - res: { - type: 'array', - optional: false, nullable: false, - items: { - type: 'object', - optional: false, nullable: false, - properties: { - id: { - type: 'string', format: 'misskey:id', - optional: false, nullable: false, - }, - score: { - type: 'integer', - optional: false, nullable: false, - }, - user: { - type: 'object', - optional: true, nullable: false, - ref: 'UserLite', - }, - }, - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - gameMode: { type: 'string' }, - }, - required: ['gameMode'], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - @Inject(DI.bubbleGameRecordsRepository) - private bubbleGameRecordsRepository: BubbleGameRecordsRepository, - - private userEntityService: UserEntityService, - ) { - super(meta, paramDef, async (ps) => { - const records = await this.bubbleGameRecordsRepository.find({ - where: { - gameMode: ps.gameMode, - seededAt: MoreThan(new Date(Date.now() - 1000 * 60 * 60 * 24 * 7)), - }, - order: { - score: 'DESC', - }, - take: 10, - relations: ['user'], - }); - - const users = await this.userEntityService.packMany(records.map(r => r.user!), null); - - return records.map(r => ({ - id: r.id, - score: r.score, - user: users.find(u => u.id === r.user!.id), - })); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/bubble-game/register.ts b/packages/backend/src/server/api/endpoints/bubble-game/register.ts deleted file mode 100644 index 0a999e42cd..0000000000 --- a/packages/backend/src/server/api/endpoints/bubble-game/register.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -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 { BubbleGameRecordsRepository } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; -import { ApiError } from '../../error.js'; - -export const meta = { - requireCredential: true, - - kind: 'write:account', - - limit: { - duration: ms('1hour'), - max: 120, - minInterval: ms('30sec'), - }, - - errors: { - invalidSeed: { - message: 'Provided seed is invalid.', - code: 'INVALID_SEED', - id: 'eb627bc7-574b-4a52-a860-3c3eae772b88', - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - score: { type: 'integer', minimum: 0 }, - seed: { type: 'string', minLength: 1, maxLength: 1024 }, - logs: { - type: 'array', - items: { - type: 'array', - items: { - type: 'number', - }, - }, - }, - gameMode: { type: 'string' }, - gameVersion: { type: 'integer' }, - }, - required: ['score', 'seed', 'logs', 'gameMode', 'gameVersion'], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - @Inject(DI.bubbleGameRecordsRepository) - private bubbleGameRecordsRepository: BubbleGameRecordsRepository, - - private idService: IdService, - ) { - super(meta, paramDef, async (ps, me) => { - const seedDate = new Date(parseInt(ps.seed, 10)); - const now = new Date(); - - // シードが未来なのは通常のプレイではありえないので弾く - if (seedDate.getTime() > now.getTime()) { - throw new ApiError(meta.errors.invalidSeed); - } - - // シードが古すぎる(5時間以上前)のも弾く - if (seedDate.getTime() < now.getTime() - 1000 * 60 * 60 * 5) { - throw new ApiError(meta.errors.invalidSeed); - } - - await this.bubbleGameRecordsRepository.insert({ - id: this.idService.gen(now.getTime()), - seed: ps.seed, - seededAt: seedDate, - userId: me.id, - score: ps.score, - logs: ps.logs, - gameMode: ps.gameMode, - gameVersion: ps.gameVersion, - isVerified: false, - }); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/channels/create.ts b/packages/backend/src/server/api/endpoints/channels/create.ts index e3a6d2d670..3dd1eddd01 100644 --- a/packages/backend/src/server/api/endpoints/channels/create.ts +++ b/packages/backend/src/server/api/endpoints/channels/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -80,7 +80,7 @@ export default class extends Endpoint { // eslint- } } - const channel = await this.channelsRepository.insertOne({ + const channel = await this.channelsRepository.insert({ id: this.idService.gen(), userId: me.id, name: ps.name, @@ -89,7 +89,7 @@ export default class extends Endpoint { // eslint- isSensitive: ps.isSensitive ?? false, ...(ps.color !== undefined ? { color: ps.color } : {}), allowRenoteToExternal: ps.allowRenoteToExternal ?? true, - } as MiChannel); + } as MiChannel).then(x => this.channelsRepository.findOneByOrFail(x.identifiers[0])); return await this.channelEntityService.pack(channel, me); }); diff --git a/packages/backend/src/server/api/endpoints/channels/favorite.ts b/packages/backend/src/server/api/endpoints/channels/favorite.ts index a1ae9b80a7..c175718919 100644 --- a/packages/backend/src/server/api/endpoints/channels/favorite.ts +++ b/packages/backend/src/server/api/endpoints/channels/favorite.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/channels/featured.ts b/packages/backend/src/server/api/endpoints/channels/featured.ts index a9a79ba8fc..412ea1bb16 100644 --- a/packages/backend/src/server/api/endpoints/channels/featured.ts +++ b/packages/backend/src/server/api/endpoints/channels/featured.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/channels/follow.ts b/packages/backend/src/server/api/endpoints/channels/follow.ts index 1812820ba2..bb5a477eb8 100644 --- a/packages/backend/src/server/api/endpoints/channels/follow.ts +++ b/packages/backend/src/server/api/endpoints/channels/follow.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/channels/followed.ts b/packages/backend/src/server/api/endpoints/channels/followed.ts index d2f36f251e..6514f1ea3c 100644 --- a/packages/backend/src/server/api/endpoints/channels/followed.ts +++ b/packages/backend/src/server/api/endpoints/channels/followed.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 d96e6c3ad2..057a438ac9 100644 --- a/packages/backend/src/server/api/endpoints/channels/my-favorites.ts +++ b/packages/backend/src/server/api/endpoints/channels/my-favorites.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/channels/owned.ts b/packages/backend/src/server/api/endpoints/channels/owned.ts index daab685f1b..b1dd693537 100644 --- a/packages/backend/src/server/api/endpoints/channels/owned.ts +++ b/packages/backend/src/server/api/endpoints/channels/owned.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/channels/search.ts b/packages/backend/src/server/api/endpoints/channels/search.ts index ae32203603..9c78a94844 100644 --- a/packages/backend/src/server/api/endpoints/channels/search.ts +++ b/packages/backend/src/server/api/endpoints/channels/search.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/channels/show.ts b/packages/backend/src/server/api/endpoints/channels/show.ts index 332ce2c9dc..3eaa83c7e8 100644 --- a/packages/backend/src/server/api/endpoints/channels/show.ts +++ b/packages/backend/src/server/api/endpoints/channels/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/channels/timeline.ts b/packages/backend/src/server/api/endpoints/channels/timeline.ts index d4fd75e049..006228ceee 100644 --- a/packages/backend/src/server/api/endpoints/channels/timeline.ts +++ b/packages/backend/src/server/api/endpoints/channels/timeline.ts @@ -1,16 +1,18 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * 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 type { ChannelsRepository, MiMeta, NotesRepository } from '@/models/_.js'; +import type { ChannelsRepository, 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'; import { DI } from '@/di-symbols.js'; import { IdService } from '@/core/IdService.js'; +import { CacheService } from '@/core/CacheService.js'; +import { MetaService } from '@/core/MetaService.js'; import { FanoutTimelineEndpointService } from '@/core/FanoutTimelineEndpointService.js'; import { MiLocalUser } from '@/models/User.js'; import { ApiError } from '../../error.js'; @@ -56,9 +58,6 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, - @Inject(DI.notesRepository) private notesRepository: NotesRepository, @@ -69,12 +68,16 @@ export default class extends Endpoint { // eslint- private noteEntityService: NoteEntityService, private queryService: QueryService, private fanoutTimelineEndpointService: FanoutTimelineEndpointService, + private cacheService: CacheService, private activeUsersChart: ActiveUsersChart, + private metaService: MetaService, ) { super(meta, paramDef, async (ps, me) => { const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null); const sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : null); + const serverSettings = await this.metaService.fetch(); + const channel = await this.channelsRepository.findOneBy({ id: ps.channelId, }); @@ -85,7 +88,7 @@ export default class extends Endpoint { // eslint- if (me) this.activeUsersChart.read(me); - if (!this.serverSettings.enableFanoutTimeline) { + if (!serverSettings.enableFanoutTimeline) { return await this.noteEntityService.packMany(await this.getFromDb({ untilId, sinceId, limit: ps.limit, channelId: channel.id }, me), me); } diff --git a/packages/backend/src/server/api/endpoints/channels/unfavorite.ts b/packages/backend/src/server/api/endpoints/channels/unfavorite.ts index fc6b75e295..b4c7af8154 100644 --- a/packages/backend/src/server/api/endpoints/channels/unfavorite.ts +++ b/packages/backend/src/server/api/endpoints/channels/unfavorite.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/channels/unfollow.ts b/packages/backend/src/server/api/endpoints/channels/unfollow.ts index 48c5261135..c95332c7f8 100644 --- a/packages/backend/src/server/api/endpoints/channels/unfollow.ts +++ b/packages/backend/src/server/api/endpoints/channels/unfollow.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/channels/update.ts b/packages/backend/src/server/api/endpoints/channels/update.ts index dba2938b39..93d02e4a12 100644 --- a/packages/backend/src/server/api/endpoints/channels/update.ts +++ b/packages/backend/src/server/api/endpoints/channels/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 fd21e3d9fe..e768923ce1 100644 --- a/packages/backend/src/server/api/endpoints/charts/active-users.ts +++ b/packages/backend/src/server/api/endpoints/charts/active-users.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 cbe792376b..f518ae41ca 100644 --- a/packages/backend/src/server/api/endpoints/charts/ap-request.ts +++ b/packages/backend/src/server/api/endpoints/charts/ap-request.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/charts/drive.ts b/packages/backend/src/server/api/endpoints/charts/drive.ts index d32bc765a4..94afab113e 100644 --- a/packages/backend/src/server/api/endpoints/charts/drive.ts +++ b/packages/backend/src/server/api/endpoints/charts/drive.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/charts/federation.ts b/packages/backend/src/server/api/endpoints/charts/federation.ts index dad21e9e8e..bc33930ca4 100644 --- a/packages/backend/src/server/api/endpoints/charts/federation.ts +++ b/packages/backend/src/server/api/endpoints/charts/federation.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/charts/instance.ts b/packages/backend/src/server/api/endpoints/charts/instance.ts index 68aa12ac0e..a432845b38 100644 --- a/packages/backend/src/server/api/endpoints/charts/instance.ts +++ b/packages/backend/src/server/api/endpoints/charts/instance.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/charts/notes.ts b/packages/backend/src/server/api/endpoints/charts/notes.ts index e1979cfe8b..e1e9d06311 100644 --- a/packages/backend/src/server/api/endpoints/charts/notes.ts +++ b/packages/backend/src/server/api/endpoints/charts/notes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 dcb72084b7..b4a58c9872 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/drive.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/drive.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 0a019ce4fb..c609c5a7fe 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/following.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/following.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 06b15bca18..ad6a342fb7 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/notes.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/notes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 d359b491e2..635a403d12 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/pv.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/pv.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 4355aa5348..92bc7028ad 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/reactions.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/reactions.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/charts/users.ts b/packages/backend/src/server/api/endpoints/charts/users.ts index 1f5f5fea54..3be3721e3a 100644 --- a/packages/backend/src/server/api/endpoints/charts/users.ts +++ b/packages/backend/src/server/api/endpoints/charts/users.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 d7c9ea3964..749593aa65 100644 --- a/packages/backend/src/server/api/endpoints/clips/add-note.ts +++ b/packages/backend/src/server/api/endpoints/clips/add-note.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/clips/create.ts b/packages/backend/src/server/api/endpoints/clips/create.ts index ceebc8ba5e..b4c7b52e72 100644 --- a/packages/backend/src/server/api/endpoints/clips/create.ts +++ b/packages/backend/src/server/api/endpoints/clips/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/clips/delete.ts b/packages/backend/src/server/api/endpoints/clips/delete.ts index ca8ff2e1f1..239945e8a4 100644 --- a/packages/backend/src/server/api/endpoints/clips/delete.ts +++ b/packages/backend/src/server/api/endpoints/clips/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/clips/favorite.ts b/packages/backend/src/server/api/endpoints/clips/favorite.ts index 11f8ec3e92..015b2cfa85 100644 --- a/packages/backend/src/server/api/endpoints/clips/favorite.ts +++ b/packages/backend/src/server/api/endpoints/clips/favorite.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -62,7 +62,7 @@ export default class extends Endpoint { // eslint- throw new ApiError(meta.errors.noSuchClip); } - const exist = await this.clipFavoritesRepository.exists({ + const exist = await this.clipFavoritesRepository.exist({ where: { clipId: clip.id, userId: me.id, diff --git a/packages/backend/src/server/api/endpoints/clips/list.ts b/packages/backend/src/server/api/endpoints/clips/list.ts index 2e4a3ff820..c124762e33 100644 --- a/packages/backend/src/server/api/endpoints/clips/list.ts +++ b/packages/backend/src/server/api/endpoints/clips/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 44719592d1..c58c16e25f 100644 --- a/packages/backend/src/server/api/endpoints/clips/my-favorites.ts +++ b/packages/backend/src/server/api/endpoints/clips/my-favorites.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/clips/notes.ts b/packages/backend/src/server/api/endpoints/clips/notes.ts index 943c31c894..1427d8d0a7 100644 --- a/packages/backend/src/server/api/endpoints/clips/notes.ts +++ b/packages/backend/src/server/api/endpoints/clips/notes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 33f9ecd25b..7b153cb555 100644 --- a/packages/backend/src/server/api/endpoints/clips/remove-note.ts +++ b/packages/backend/src/server/api/endpoints/clips/remove-note.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/clips/show.ts b/packages/backend/src/server/api/endpoints/clips/show.ts index 1078a1b176..03b1e09dfb 100644 --- a/packages/backend/src/server/api/endpoints/clips/show.ts +++ b/packages/backend/src/server/api/endpoints/clips/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/clips/unfavorite.ts b/packages/backend/src/server/api/endpoints/clips/unfavorite.ts index a458fda4a0..d1007f7a19 100644 --- a/packages/backend/src/server/api/endpoints/clips/unfavorite.ts +++ b/packages/backend/src/server/api/endpoints/clips/unfavorite.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/clips/update.ts b/packages/backend/src/server/api/endpoints/clips/update.ts index 603a3ccf3d..0b9878578c 100644 --- a/packages/backend/src/server/api/endpoints/clips/update.ts +++ b/packages/backend/src/server/api/endpoints/clips/update.ts @@ -1,9 +1,9 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { Injectable } from '@nestjs/common'; +import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { ClipEntityService } from '@/core/entities/ClipEntityService.js'; import { ClipService } from '@/core/ClipService.js'; @@ -41,7 +41,7 @@ export const paramDef = { isPublic: { type: 'boolean' }, description: { type: 'string', nullable: true, minLength: 1, maxLength: 2048 }, }, - required: ['clipId'], + required: ['clipId', 'name'], } as const; @Injectable() diff --git a/packages/backend/src/server/api/endpoints/drive.ts b/packages/backend/src/server/api/endpoints/drive.ts index eb45e29f9e..71d3ca5f14 100644 --- a/packages/backend/src/server/api/endpoints/drive.ts +++ b/packages/backend/src/server/api/endpoints/drive.ts @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * 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 { MetaService } from '@/core/MetaService.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; import { RoleService } from '@/core/RoleService.js'; @@ -40,10 +41,14 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( + private metaService: MetaService, private driveFileEntityService: DriveFileEntityService, private roleService: RoleService, ) { super(meta, paramDef, async (ps, me) => { + const instance = await this.metaService.fetch(true); + + // Calculate drive usage const usage = await this.driveFileEntityService.calcDriveUsageOf(me.id); const policies = await this.roleService.getUserPolicies(me.id); diff --git a/packages/backend/src/server/api/endpoints/drive/files.ts b/packages/backend/src/server/api/endpoints/drive/files.ts index 10c521332d..b7e9d12e94 100644 --- a/packages/backend/src/server/api/endpoints/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/drive/files.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -36,7 +36,7 @@ export const paramDef = { untilId: { type: 'string', format: 'misskey:id' }, folderId: { type: 'string', format: 'misskey:id', nullable: true, default: null }, type: { type: 'string', nullable: true, pattern: /^[a-zA-Z\/\-*]+$/.toString().slice(1, -1) }, - sort: { type: 'string', nullable: true, enum: ['+createdAt', '-createdAt', '+name', '-name', '+size', '-size', null] }, + sort: { type: 'string', nullable: true, enum: ['+createdAt', '-createdAt', '+name', '-name', '+size', '-size'] }, }, required: [], } as const; 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 b86059b5e7..14a13b09c9 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,7 +10,6 @@ import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; -import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['drive', 'notes'], @@ -62,13 +61,12 @@ export default class extends Endpoint { // eslint- private noteEntityService: NoteEntityService, private queryService: QueryService, - private roleService: RoleService, ) { super(meta, paramDef, async (ps, me) => { // Fetch file const file = await this.driveFilesRepository.findOneBy({ id: ps.fileId, - userId: await this.roleService.isModerator(me) ? undefined : me.id, + userId: me.id, }); if (file == null) { @@ -76,7 +74,7 @@ export default class extends Endpoint { // eslint- } const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId); - query.andWhere(':file <@ note.fileIds', { file: [file.id] }); + query.andWhere(':file = ANY(note.fileIds)', { file: file.id }); const notes = await query.limit(ps.limit).getMany(); 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 cc7920505f..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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -38,7 +38,7 @@ export default class extends Endpoint { // eslint- private driveFilesRepository: DriveFilesRepository, ) { super(meta, paramDef, async (ps, me) => { - const exist = await this.driveFilesRepository.exists({ + const exist = await this.driveFilesRepository.exist({ where: { md5: ps.md5, userId: me.id, 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 74eb4dded7..5e97588c99 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/create.ts @@ -1,18 +1,17 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * 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 { 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 { ApiError } from '../../../error.js'; -import { MiMeta } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; export const meta = { tags: ['drive'], @@ -74,10 +73,8 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, - private driveFileEntityService: DriveFileEntityService, + private metaService: MetaService, private driveService: DriveService, ) { super(meta, paramDef, async (ps, me, _, file, cleanup, ip, headers) => { @@ -94,6 +91,8 @@ export default class extends Endpoint { // eslint- } } + const instance = await this.metaService.fetch(); + try { // Create file const driveFile = await this.driveService.addFile({ @@ -104,8 +103,8 @@ export default class extends Endpoint { // eslint- folderId: ps.folderId, force: ps.force, sensitive: ps.isSensitive, - requestIp: this.serverSettings.enableIpLogging ? ip : null, - requestHeaders: this.serverSettings.enableIpLogging ? headers : null, + requestIp: instance.enableIpLogging ? ip : null, + requestHeaders: instance.enableIpLogging ? headers : null, }); return await this.driveFileEntityService.pack(driveFile, { self: true }); } catch (err) { 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 fa6e11da49..f46bf49965 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/delete.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 090cff6875..7b784f253e 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 502d42f9e0..0ceb31e58d 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/find.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -54,7 +54,7 @@ export default class extends Endpoint { // eslint- folderId: ps.folderId ?? IsNull(), }); - return await this.driveFileEntityService.packMany(files, { self: true }); + return await Promise.all(files.map(file => this.driveFileEntityService.pack(file, { self: true }))); }); } } 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 e8f4539d61..474c7f02d3 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/show.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 df1622cce0..c01f3de03c 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/update.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 b964ae95b8..bbe62063cf 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/drive/folders.ts b/packages/backend/src/server/api/endpoints/drive/folders.ts index 8c4848f8e1..3a09266591 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 08d9d9cdc3..d18199f19b 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -75,12 +75,12 @@ export default class extends Endpoint { // eslint- } // Create folder - const folder = await this.driveFoldersRepository.insertOne({ + const folder = await this.driveFoldersRepository.insert({ id: this.idService.gen(), name: ps.name, parentId: parent !== null ? parent.id : null, userId: me.id, - }); + }).then(x => this.driveFoldersRepository.findOneByOrFail(x.identifiers[0])); const folderObj = await this.driveFolderEntityService.pack(folder); 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 85d63873a4..46a00ca3dc 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/delete.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 eb45a30bc0..2f5cdcc648 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/find.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 a1c0df6697..dd44fc46c9 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/show.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 62b04e1df3..f8683132b2 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/update.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -95,14 +95,15 @@ export default class extends Endpoint { // eslint- // Check if the circular reference will occur const checkCircle = async (folderId: string): Promise => { - const folder2 = await this.driveFoldersRepository.findOneByOrFail({ + // Fetch folder + const folder2 = await this.driveFoldersRepository.findOneBy({ id: folderId, }); - if (folder2.id === folder.id) { + if (folder2!.id === folder!.id) { return true; - } else if (folder2.parentId) { - return await checkCircle(folder2.parentId); + } else if (folder2!.parentId) { + return await checkCircle(folder2!.parentId); } else { return false; } diff --git a/packages/backend/src/server/api/endpoints/drive/stream.ts b/packages/backend/src/server/api/endpoints/drive/stream.ts index f7c1ed39b5..27e1656f82 100644 --- a/packages/backend/src/server/api/endpoints/drive/stream.ts +++ b/packages/backend/src/server/api/endpoints/drive/stream.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 1d7dacd60e..787009f13c 100644 --- a/packages/backend/src/server/api/endpoints/email-address/available.ts +++ b/packages/backend/src/server/api/endpoints/email-address/available.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/emoji.ts b/packages/backend/src/server/api/endpoints/emoji.ts index ccfbda0d44..ead8c9979e 100644 --- a/packages/backend/src/server/api/endpoints/emoji.ts +++ b/packages/backend/src/server/api/endpoints/emoji.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/emojis.ts b/packages/backend/src/server/api/endpoints/emojis.ts index 46ef4eca1b..2adf0a21b3 100644 --- a/packages/backend/src/server/api/endpoints/emojis.ts +++ b/packages/backend/src/server/api/endpoints/emojis.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/endpoint.ts b/packages/backend/src/server/api/endpoints/endpoint.ts index fe7e9c36f3..66ac8f664f 100644 --- a/packages/backend/src/server/api/endpoints/endpoint.ts +++ b/packages/backend/src/server/api/endpoints/endpoint.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/endpoints.ts b/packages/backend/src/server/api/endpoints/endpoints.ts index 4aedf62a84..86def04aca 100644 --- a/packages/backend/src/server/api/endpoints/endpoints.ts +++ b/packages/backend/src/server/api/endpoints/endpoints.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 5ff099524d..7380c593e3 100644 --- a/packages/backend/src/server/api/endpoints/export-custom-emojis.ts +++ b/packages/backend/src/server/api/endpoints/export-custom-emojis.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/federation/followers.ts b/packages/backend/src/server/api/endpoints/federation/followers.ts index ce4dd13067..a92cf6a9d8 100644 --- a/packages/backend/src/server/api/endpoints/federation/followers.ts +++ b/packages/backend/src/server/api/endpoints/federation/followers.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/federation/following.ts b/packages/backend/src/server/api/endpoints/federation/following.ts index 1a793889c7..d72ceeeea2 100644 --- a/packages/backend/src/server/api/endpoints/federation/following.ts +++ b/packages/backend/src/server/api/endpoints/federation/following.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/federation/instances.ts b/packages/backend/src/server/api/endpoints/federation/instances.ts index 41954129e6..e5a90715f5 100644 --- a/packages/backend/src/server/api/endpoints/federation/instances.ts +++ b/packages/backend/src/server/api/endpoints/federation/instances.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -60,7 +60,6 @@ export const paramDef = { '-firstRetrievedAt', '+latestRequestReceivedAt', '-latestRequestReceivedAt', - null, ], }, }, @@ -117,9 +116,9 @@ export default class extends Endpoint { // eslint- if (typeof ps.suspended === 'boolean') { if (ps.suspended) { - query.andWhere('instance.suspensionState != \'none\''); + query.andWhere('instance.isSuspended = TRUE'); } else { - query.andWhere('instance.suspensionState = \'none\''); + query.andWhere('instance.isSuspended = FALSE'); } } @@ -170,7 +169,7 @@ export default class extends Endpoint { // eslint- const instances = await query.limit(ps.limit).offset(ps.offset).getMany(); - return await this.instanceEntityService.packMany(instances, me); + return await this.instanceEntityService.packMany(instances); }); } } 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 2972861a4b..781c15e742 100644 --- a/packages/backend/src/server/api/endpoints/federation/show-instance.ts +++ b/packages/backend/src/server/api/endpoints/federation/show-instance.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -43,7 +43,7 @@ export default class extends Endpoint { // eslint- const instance = await this.instancesRepository .findOneBy({ host: this.utilityService.toPuny(ps.host) }); - return instance ? await this.instanceEntityService.pack(instance, me) : null; + return instance ? await this.instanceEntityService.pack(instance) : null; }); } } diff --git a/packages/backend/src/server/api/endpoints/federation/stats.ts b/packages/backend/src/server/api/endpoints/federation/stats.ts index 69900bff9a..262aa68776 100644 --- a/packages/backend/src/server/api/endpoints/federation/stats.ts +++ b/packages/backend/src/server/api/endpoints/federation/stats.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -107,9 +107,9 @@ export default class extends Endpoint { // eslint- const gotPubCount = topPubInstances.map(x => x.followingCount).reduce((a, b) => a + b, 0); return await awaitAll({ - topSubInstances: this.instanceEntityService.packMany(topSubInstances, me), + topSubInstances: this.instanceEntityService.packMany(topSubInstances), otherFollowersCount: Math.max(0, allSubCount - gotSubCount), - topPubInstances: this.instanceEntityService.packMany(topPubInstances, me), + topPubInstances: this.instanceEntityService.packMany(topPubInstances), otherFollowingCount: Math.max(0, allPubCount - gotPubCount), }); }); 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 f8430ef431..e6198ff601 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/federation/users.ts b/packages/backend/src/server/api/endpoints/federation/users.ts index 71b1aeb07b..d97171865a 100644 --- a/packages/backend/src/server/api/endpoints/federation/users.ts +++ b/packages/backend/src/server/api/endpoints/federation/users.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -54,7 +54,7 @@ export default class extends Endpoint { // eslint- .limit(ps.limit) .getMany(); - return await this.userEntityService.packMany(users, me, { schema: 'UserDetailedNotMe' }); + return await this.userEntityService.packMany(users, me, { detail: true }); }); } } diff --git a/packages/backend/src/server/api/endpoints/fetch-external-resources.ts b/packages/backend/src/server/api/endpoints/fetch-external-resources.ts index f36136d53b..cbe579eb6b 100644 --- a/packages/backend/src/server/api/endpoints/fetch-external-resources.ts +++ b/packages/backend/src/server/api/endpoints/fetch-external-resources.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/fetch-rss.ts b/packages/backend/src/server/api/endpoints/fetch-rss.ts index ba48b0119e..b2dee83fe9 100644 --- a/packages/backend/src/server/api/endpoints/fetch-rss.ts +++ b/packages/backend/src/server/api/endpoints/fetch-rss.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -20,188 +20,13 @@ export const meta = { res: { type: 'object', properties: { - image: { - type: 'object', - optional: true, - properties: { - link: { - type: 'string', - optional: true, - }, - url: { - type: 'string', - optional: false, - }, - title: { - type: 'string', - optional: true, - }, - }, - }, - paginationLinks: { - type: 'object', - optional: true, - properties: { - self: { - type: 'string', - optional: true, - }, - first: { - type: 'string', - optional: true, - }, - next: { - type: 'string', - optional: true, - }, - last: { - type: 'string', - optional: true, - }, - prev: { - type: 'string', - optional: true, - }, - }, - }, - link: { - type: 'string', - optional: true, - }, - title: { - type: 'string', - optional: true, - }, items: { type: 'array', - optional: false, items: { type: 'object', - properties: { - link: { - type: 'string', - optional: true, - }, - guid: { - type: 'string', - optional: true, - }, - title: { - type: 'string', - optional: true, - }, - pubDate: { - type: 'string', - optional: true, - }, - creator: { - type: 'string', - optional: true, - }, - summary: { - type: 'string', - optional: true, - }, - content: { - type: 'string', - optional: true, - }, - isoDate: { - type: 'string', - optional: true, - }, - categories: { - type: 'array', - optional: true, - items: { - type: 'string', - }, - }, - contentSnippet: { - type: 'string', - optional: true, - }, - enclosure: { - type: 'object', - optional: true, - properties: { - url: { - type: 'string', - optional: false, - }, - length: { - type: 'number', - optional: true, - }, - type: { - type: 'string', - optional: true, - }, - }, - }, - }, }, - }, - feedUrl: { - type: 'string', - optional: true, - }, - description: { - type: 'string', - optional: true, - }, - itunes: { - type: 'object', - optional: true, - additionalProperties: true, - properties: { - image: { - type: 'string', - optional: true, - }, - owner: { - type: 'object', - optional: true, - properties: { - name: { - type: 'string', - optional: true, - }, - email: { - type: 'string', - optional: true, - }, - }, - }, - author: { - type: 'string', - optional: true, - }, - summary: { - type: 'string', - optional: true, - }, - explicit: { - type: 'string', - optional: true, - }, - categories: { - type: 'array', - optional: true, - items: { - type: 'string', - }, - }, - keywords: { - type: 'array', - optional: true, - items: { - type: 'string', - }, - }, - }, - }, - }, + } + } }, } as const; diff --git a/packages/backend/src/server/api/endpoints/flash/create.ts b/packages/backend/src/server/api/endpoints/flash/create.ts index 64f13a577e..674f323734 100644 --- a/packages/backend/src/server/api/endpoints/flash/create.ts +++ b/packages/backend/src/server/api/endpoints/flash/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -44,7 +44,6 @@ export const paramDef = { permissions: { type: 'array', items: { type: 'string', } }, - visibility: { type: 'string', enum: ['public', 'private'], default: 'public' }, }, required: ['title', 'summary', 'script', 'permissions'], } as const; @@ -59,7 +58,7 @@ export default class extends Endpoint { // eslint- private idService: IdService, ) { super(meta, paramDef, async (ps, me) => { - const flash = await this.flashsRepository.insertOne({ + const flash = await this.flashsRepository.insert({ id: this.idService.gen(), userId: me.id, updatedAt: new Date(), @@ -67,8 +66,7 @@ export default class extends Endpoint { // eslint- summary: ps.summary, script: ps.script, permissions: ps.permissions, - visibility: ps.visibility, - }); + }).then(x => this.flashsRepository.findOneByOrFail(x.identifiers[0])); return await this.flashEntityService.pack(flash); }); diff --git a/packages/backend/src/server/api/endpoints/flash/delete.ts b/packages/backend/src/server/api/endpoints/flash/delete.ts index 6912450abf..e5448c816a 100644 --- a/packages/backend/src/server/api/endpoints/flash/delete.ts +++ b/packages/backend/src/server/api/endpoints/flash/delete.ts @@ -1,14 +1,12 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; -import type { FlashsRepository, UsersRepository } from '@/models/_.js'; +import type { FlashsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; -import { ModerationLogService } from '@/core/ModerationLogService.js'; -import { RoleService } from '@/core/RoleService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -46,35 +44,17 @@ export default class extends Endpoint { // eslint- constructor( @Inject(DI.flashsRepository) private flashsRepository: FlashsRepository, - - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - - private moderationLogService: ModerationLogService, - private roleService: RoleService, ) { super(meta, paramDef, async (ps, me) => { const flash = await this.flashsRepository.findOneBy({ id: ps.flashId }); - if (flash == null) { throw new ApiError(meta.errors.noSuchFlash); } - - if (!await this.roleService.isModerator(me) && flash.userId !== me.id) { + if (flash.userId !== me.id) { throw new ApiError(meta.errors.accessDenied); } await this.flashsRepository.delete(flash.id); - - if (flash.userId !== me.id) { - const user = await this.usersRepository.findOneByOrFail({ id: flash.userId }); - this.moderationLogService.log(me, 'deleteFlash', { - flashId: flash.id, - flashUserId: flash.userId, - flashUserUsername: user.username, - flash, - }); - } }); } } diff --git a/packages/backend/src/server/api/endpoints/flash/featured.ts b/packages/backend/src/server/api/endpoints/flash/featured.ts index 9a0cb461f2..1fa5612ac4 100644 --- a/packages/backend/src/server/api/endpoints/flash/featured.ts +++ b/packages/backend/src/server/api/endpoints/flash/featured.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,7 +8,6 @@ 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'; -import { FlashService } from '@/core/FlashService.js'; export const meta = { tags: ['flash'], @@ -28,25 +27,26 @@ export const meta = { export const paramDef = { type: 'object', - properties: { - offset: { type: 'integer', minimum: 0, default: 0 }, - limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, - }, + properties: {}, required: [], } as const; @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - private flashService: FlashService, + @Inject(DI.flashsRepository) + private flashsRepository: FlashsRepository, + private flashEntityService: FlashEntityService, ) { super(meta, paramDef, async (ps, me) => { - const result = await this.flashService.featured({ - offset: ps.offset, - limit: ps.limit, - }); - return await this.flashEntityService.packMany(result, me); + const query = this.flashsRepository.createQueryBuilder('flash') + .andWhere('flash.likedCount > 0') + .orderBy('flash.likedCount', 'DESC'); + + const flashs = await query.limit(10).getMany(); + + return await this.flashEntityService.packMany(flashs, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/flash/like.ts b/packages/backend/src/server/api/endpoints/flash/like.ts index e4dc5b61c5..1003249c0c 100644 --- a/packages/backend/src/server/api/endpoints/flash/like.ts +++ b/packages/backend/src/server/api/endpoints/flash/like.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -70,7 +70,7 @@ export default class extends Endpoint { // eslint- } // if already liked - const exist = await this.flashLikesRepository.exists({ + const exist = await this.flashLikesRepository.exist({ where: { flashId: flash.id, userId: me.id, 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 755cc5acfc..e328bdbee5 100644 --- a/packages/backend/src/server/api/endpoints/flash/my-likes.ts +++ b/packages/backend/src/server/api/endpoints/flash/my-likes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/flash/my.ts b/packages/backend/src/server/api/endpoints/flash/my.ts index 5746096232..442d8dcd75 100644 --- a/packages/backend/src/server/api/endpoints/flash/my.ts +++ b/packages/backend/src/server/api/endpoints/flash/my.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/flash/show.ts b/packages/backend/src/server/api/endpoints/flash/show.ts index a6fbd8e76e..c41a27c925 100644 --- a/packages/backend/src/server/api/endpoints/flash/show.ts +++ b/packages/backend/src/server/api/endpoints/flash/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/flash/unlike.ts b/packages/backend/src/server/api/endpoints/flash/unlike.ts index 7869bcdf52..d5c20a1167 100644 --- a/packages/backend/src/server/api/endpoints/flash/unlike.ts +++ b/packages/backend/src/server/api/endpoints/flash/unlike.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/flash/update.ts b/packages/backend/src/server/api/endpoints/flash/update.ts index e378669f0a..8b5e1f99e9 100644 --- a/packages/backend/src/server/api/endpoints/flash/update.ts +++ b/packages/backend/src/server/api/endpoints/flash/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -51,7 +51,7 @@ export const paramDef = { } }, visibility: { type: 'string', enum: ['public', 'private'] }, }, - required: ['flashId'], + required: ['flashId', 'title', 'summary', 'script', 'permissions'], } as const; @Injectable() @@ -71,11 +71,11 @@ export default class extends Endpoint { // eslint- await this.flashsRepository.update(flash.id, { updatedAt: new Date(), - ...Object.fromEntries( - Object.entries(ps).filter( - ([key, val]) => (key !== 'flashId') && Object.hasOwn(paramDef.properties, key) - ) - ), + title: ps.title, + 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 db320e7129..9037944ef9 100644 --- a/packages/backend/src/server/api/endpoints/following/create.ts +++ b/packages/backend/src/server/api/endpoints/following/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -71,7 +71,7 @@ export const paramDef = { type: 'object', properties: { userId: { type: 'string', format: 'misskey:id' }, - withReplies: { type: 'boolean' }, + withReplies: { type: 'boolean' } }, required: ['userId'], } as const; @@ -100,11 +100,22 @@ export default class extends Endpoint { // eslint- throw err; }); + // Check if already following + const exist = await this.followingsRepository.exist({ + where: { + followerId: follower.id, + followeeId: followee.id, + }, + }); + + if (exist) { + throw new ApiError(meta.errors.alreadyFollowing); + } + try { await this.userFollowingService.follow(follower, followee, { withReplies: ps.withReplies }); } catch (e) { if (e instanceof IdentifiableError) { - if (e.id === 'ec3f65c0-a9d1-47d9-8791-b2e7b9dcdced') throw new ApiError(meta.errors.alreadyFollowing); if (e.id === '710e8fb0-b8c3-4922-be49-d5d93d8e6a6e') throw new ApiError(meta.errors.blocking); if (e.id === '3338392a-f764-498d-8855-db939dcf8c48') throw new ApiError(meta.errors.blocked); } diff --git a/packages/backend/src/server/api/endpoints/following/delete.ts b/packages/backend/src/server/api/endpoints/following/delete.ts index ba146b6703..f44692ba6d 100644 --- a/packages/backend/src/server/api/endpoints/following/delete.ts +++ b/packages/backend/src/server/api/endpoints/following/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -85,7 +85,7 @@ export default class extends Endpoint { // eslint- }); // Check not following - const exist = await this.followingsRepository.exists({ + const exist = await this.followingsRepository.exist({ where: { followerId: follower.id, followeeId: followee.id, diff --git a/packages/backend/src/server/api/endpoints/following/invalidate.ts b/packages/backend/src/server/api/endpoints/following/invalidate.ts index 8935c2c2da..53ef925b2f 100644 --- a/packages/backend/src/server/api/endpoints/following/invalidate.ts +++ b/packages/backend/src/server/api/endpoints/following/invalidate.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 2d1446681c..91fe922200 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/accept.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/accept.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 6d663d480c..d9d5c7041b 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/cancel.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/cancel.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 fa59e38976..c4faa88f65 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/list.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -71,7 +71,7 @@ export default class extends Endpoint { // eslint- .limit(ps.limit) .getMany(); - return await this.followRequestEntityService.packMany(requests, me); + return await Promise.all(requests.map(req => this.followRequestEntityService.pack(req))); }); } } 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 4f78eae677..35f047bcef 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/reject.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/reject.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/following/update-all.ts b/packages/backend/src/server/api/endpoints/following/update-all.ts index c953feb393..28734cfdbd 100644 --- a/packages/backend/src/server/api/endpoints/following/update-all.ts +++ b/packages/backend/src/server/api/endpoints/following/update-all.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/following/update.ts b/packages/backend/src/server/api/endpoints/following/update.ts index d62cf210ed..db17d151df 100644 --- a/packages/backend/src/server/api/endpoints/following/update.ts +++ b/packages/backend/src/server/api/endpoints/following/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/gallery/featured.ts b/packages/backend/src/server/api/endpoints/gallery/featured.ts index 7d2878e03f..cea4234065 100644 --- a/packages/backend/src/server/api/endpoints/gallery/featured.ts +++ b/packages/backend/src/server/api/endpoints/gallery/featured.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/gallery/popular.ts b/packages/backend/src/server/api/endpoints/gallery/popular.ts index 4ee252104a..c5d06f67dd 100644 --- a/packages/backend/src/server/api/endpoints/gallery/popular.ts +++ b/packages/backend/src/server/api/endpoints/gallery/popular.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/gallery/posts.ts b/packages/backend/src/server/api/endpoints/gallery/posts.ts index d398418ab4..3ca5f4989a 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 504a9c789e..71e0ad4141 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -69,13 +69,13 @@ export default class extends Endpoint { // eslint- id: fileId, userId: me.id, }), - ))).filter(x => x != null); + ))).filter((file): file is MiDriveFile => file != null); if (files.length === 0) { throw new Error(); } - const post = await this.galleryPostsRepository.insertOne(new MiGalleryPost({ + const post = await this.galleryPostsRepository.insert(new MiGalleryPost({ id: this.idService.gen(), updatedAt: new Date(), title: ps.title, @@ -83,7 +83,7 @@ export default class extends Endpoint { // eslint- userId: me.id, isSensitive: ps.isSensitive, fileIds: files.map(file => file.id), - })); + })).then(x => this.galleryPostsRepository.findOneByOrFail(x.identifiers[0])); return await this.galleryPostEntityService.pack(post, me); }); 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 b6b94db161..deef2912bb 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts @@ -1,14 +1,12 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * 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 type { GalleryPostsRepository, UsersRepository } from '@/models/_.js'; +import type { GalleryPostsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; -import { ModerationLogService } from '@/core/ModerationLogService.js'; -import { RoleService } from '@/core/RoleService.js'; import { ApiError } from '../../../error.js'; export const meta = { @@ -24,12 +22,6 @@ export const meta = { code: 'NO_SUCH_POST', id: 'ae52f367-4bd7-4ecd-afc6-5672fff427f5', }, - - accessDenied: { - message: 'Access denied.', - code: 'ACCESS_DENIED', - id: 'c86e09de-1c48-43ac-a435-1c7e42ed4496', - }, }, } as const; @@ -46,35 +38,18 @@ export default class extends Endpoint { // eslint- constructor( @Inject(DI.galleryPostsRepository) private galleryPostsRepository: GalleryPostsRepository, - - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - - private moderationLogService: ModerationLogService, - private roleService: RoleService, ) { super(meta, paramDef, async (ps, me) => { - const post = await this.galleryPostsRepository.findOneBy({ id: ps.postId }); + const post = await this.galleryPostsRepository.findOneBy({ + id: ps.postId, + userId: me.id, + }); if (post == null) { throw new ApiError(meta.errors.noSuchPost); } - if (!await this.roleService.isModerator(me) && post.userId !== me.id) { - throw new ApiError(meta.errors.accessDenied); - } - await this.galleryPostsRepository.delete(post.id); - - if (post.userId !== me.id) { - const user = await this.usersRepository.findOneByOrFail({ id: post.userId }); - this.moderationLogService.log(me, 'deleteGalleryPost', { - postId: post.id, - postUserId: post.userId, - postUserUsername: user.username, - post, - }); - } }); } } 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 91e49e6463..cc424261b4 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -72,7 +72,7 @@ export default class extends Endpoint { // eslint- } // if already liked - const exist = await this.galleryLikesRepository.exists({ + const exist = await this.galleryLikesRepository.exist({ where: { postId: post.id, userId: me.id, 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 bd69898229..b3eda1be52 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/show.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 f44e2c7afc..caa4d45553 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 5243ee9603..632214a0c2 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/update.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -47,7 +47,7 @@ export const paramDef = { } }, isSensitive: { type: 'boolean', default: false }, }, - required: ['postId'], + required: ['postId', 'title', 'fileIds'], } as const; @Injectable() @@ -62,19 +62,15 @@ export default class extends Endpoint { // eslint- private galleryPostEntityService: GalleryPostEntityService, ) { super(meta, paramDef, async (ps, me) => { - let files: Array | undefined; + const files = (await Promise.all(ps.fileIds.map(fileId => + this.driveFilesRepository.findOneBy({ + id: fileId, + userId: me.id, + }), + ))).filter((file): file is MiDriveFile => file != null); - if (ps.fileIds) { - files = (await Promise.all(ps.fileIds.map(fileId => - this.driveFilesRepository.findOneBy({ - id: fileId, - userId: me.id, - }), - ))).filter(x => x != null); - - if (files.length === 0) { - throw new Error(); - } + if (files.length === 0) { + throw new Error(); } await this.galleryPostsRepository.update({ @@ -85,7 +81,7 @@ export default class extends Endpoint { // eslint- title: ps.title, description: ps.description, isSensitive: ps.isSensitive, - fileIds: files ? files.map(file => file.id) : undefined, + fileIds: files.map(file => file.id), }); const post = await this.galleryPostsRepository.findOneByOrFail({ id: ps.postId }); diff --git a/packages/backend/src/server/api/endpoints/get-avatar-decorations.ts b/packages/backend/src/server/api/endpoints/get-avatar-decorations.ts index 52acee1cfb..dbe1626149 100644 --- a/packages/backend/src/server/api/endpoints/get-avatar-decorations.ts +++ b/packages/backend/src/server/api/endpoints/get-avatar-decorations.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 a57774be73..737d637b7e 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/hashtags/list.ts b/packages/backend/src/server/api/endpoints/hashtags/list.ts index 5cd3c6584d..21d863107d 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/list.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/hashtags/search.ts b/packages/backend/src/server/api/endpoints/hashtags/search.ts index d4eb851054..acfef16b11 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/search.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/search.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -43,7 +43,7 @@ export default class extends Endpoint { // eslint- super(meta, paramDef, async (ps, me) => { const hashtags = await this.hashtagsRepository.createQueryBuilder('tag') .where('tag.name like :q', { q: sqlLikeEscape(ps.query.toLowerCase()) + '%' }) - .orderBy('tag.mentionedLocalUsersCount', 'DESC') + .orderBy('tag.count', 'DESC') .groupBy('tag.id') .limit(ps.limit) .offset(ps.offset) diff --git a/packages/backend/src/server/api/endpoints/hashtags/show.ts b/packages/backend/src/server/api/endpoints/hashtags/show.ts index 940e3bd69d..3ba16fdc85 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/show.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/hashtags/trend.ts b/packages/backend/src/server/api/endpoints/hashtags/trend.ts index cb8065e3a6..8f382eb96b 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/trend.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/trend.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/hashtags/users.ts b/packages/backend/src/server/api/endpoints/hashtags/users.ts index 30f0c1b0c8..50aea79943 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/users.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/users.ts @@ -1,12 +1,11 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * 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 type { UsersRepository } from '@/models/_.js'; -import { safeForSql } from "@/misc/safe-for-sql.js"; import { normalizeForSearch } from '@/misc/normalize-for-search.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { DI } from '@/di-symbols.js'; @@ -48,9 +47,8 @@ export default class extends Endpoint { // eslint- private userEntityService: UserEntityService, ) { super(meta, paramDef, async (ps, me) => { - if (!safeForSql(normalizeForSearch(ps.tag))) throw new Error('Injection'); const query = this.usersRepository.createQueryBuilder('user') - .where(':tag <@ user.tags', { tag: [normalizeForSearch(ps.tag)] }) + .where(':tag = ANY(user.tags)', { tag: normalizeForSearch(ps.tag) }) .andWhere('user.isSuspended = FALSE'); const recent = new Date(Date.now() - (1000 * 60 * 60 * 24 * 5)); @@ -76,7 +74,7 @@ export default class extends Endpoint { // eslint- const users = await query.limit(ps.limit).getMany(); - return await this.userEntityService.packMany(users, me, { schema: 'UserDetailed' }); + return await this.userEntityService.packMany(users, me, { detail: true }); }); } } diff --git a/packages/backend/src/server/api/endpoints/i.ts b/packages/backend/src/server/api/endpoints/i.ts index d324e3e64a..c24e049180 100644 --- a/packages/backend/src/server/api/endpoints/i.ts +++ b/packages/backend/src/server/api/endpoints/i.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -71,8 +71,8 @@ export default class extends Endpoint { // eslint- userProfile.loggedInDates = [...userProfile.loggedInDates, today]; } - return await this.userEntityService.pack(userProfile.user!, userProfile.user!, { - schema: 'MeDetailed', + return await this.userEntityService.pack(userProfile.user!, userProfile.user!, { + detail: true, includeSecrets: isSecure, userProfile, }); 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 2a30e8b0c3..9f8e2894b8 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/done.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -15,19 +15,6 @@ export const meta = { requireCredential: true, secure: true, - - res: { - type: 'object', - properties: { - backupCodes: { - type: 'array', - optional: false, - items: { - type: 'string', - }, - }, - }, - }, } as const; export const paramDef = { @@ -77,7 +64,7 @@ export default class extends Endpoint { // eslint- // Publish meUpdated event this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, { - schema: 'MeDetailed', + detail: true, includeSecrets: true, })); 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 65eece5b97..a7be47fd0f 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -96,10 +96,10 @@ export default class extends Endpoint { } const keyInfo = await this.webAuthnService.verifyRegistration(me.id, ps.credential); - const keyId = keyInfo.credentialID; + const credentialId = Buffer.from(keyInfo.credentialID).toString('base64url'); await this.userSecurityKeysRepository.insert({ - id: keyId, + id: credentialId, userId: me.id, name: ps.name, publicKey: Buffer.from(keyInfo.credentialPublicKey).toString('base64url'), @@ -111,12 +111,12 @@ export default class extends Endpoint { // Publish meUpdated event this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, { - schema: 'MeDetailed', + detail: true, includeSecrets: true, })); return { - id: keyId, + id: credentialId, name: ps.name, }; }); 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 bf039ccd16..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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -74,7 +74,7 @@ export default class extends Endpoint { // eslint- // Publish meUpdated event this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, { - schema: 'MeDetailed', + detail: true, includeSecrets: true, })); }); 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 9391aee5e0..0fac96d58f 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -47,7 +47,7 @@ export const meta = { properties: { id: { type: 'string', - optional: true, + nullable: true, }, }, }, @@ -103,13 +103,13 @@ export const meta = { items: { type: 'string', enum: [ - 'ble', - 'cable', - 'hybrid', - 'internal', - 'nfc', - 'smart-card', - 'usb', + "ble", + "cable", + "hybrid", + "internal", + "nfc", + "smart-card", + "usb", ], }, }, @@ -123,8 +123,8 @@ export const meta = { authenticatorAttachment: { type: 'string', enum: [ - 'cross-platform', - 'platform', + "cross-platform", + "platform", ], }, requireResidentKey: { @@ -133,9 +133,9 @@ export const meta = { userVerification: { type: 'string', enum: [ - 'discouraged', - 'preferred', - 'required', + "discouraged", + "preferred", + "required", ], }, }, @@ -144,11 +144,10 @@ export const meta = { type: 'string', nullable: true, enum: [ - 'direct', - 'enterprise', - 'indirect', - 'none', - null, + "direct", + "enterprise", + "indirect", + "none", ], }, extensions: { 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 a54c598213..cc083cbf7b 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 c350136eae..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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -97,7 +97,7 @@ export default class extends Endpoint { // eslint- // Publish meUpdated event this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, { - schema: 'MeDetailed', + detail: true, includeSecrets: true, })); 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 b5a53cc889..338f12c5cd 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -76,7 +76,7 @@ export default class extends Endpoint { // eslint- // Publish meUpdated event this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, { - schema: 'MeDetailed', + detail: true, includeSecrets: true, })); }); 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 cfa07cc8d7..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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -69,7 +69,7 @@ export default class extends Endpoint { // eslint- // Publish meUpdated event this.globalEventService.publishMainStream(me.id, 'meUpdated', await this.userEntityService.pack(me.id, me, { - schema: 'MeDetailed', + detail: true, includeSecrets: true, })); diff --git a/packages/backend/src/server/api/endpoints/i/apps.ts b/packages/backend/src/server/api/endpoints/i/apps.ts index 91c8597b1b..ef89f93181 100644 --- a/packages/backend/src/server/api/endpoints/i/apps.ts +++ b/packages/backend/src/server/api/endpoints/i/apps.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -21,31 +21,26 @@ export const meta = { properties: { id: { type: 'string', - optional: false, format: 'misskey:id', }, name: { type: 'string', - optional: true, }, createdAt: { type: 'string', - optional: false, format: 'date-time', }, lastUsedAt: { type: 'string', - optional: true, format: 'date-time', }, permission: { type: 'array', - optional: false, uniqueItems: true, items: { - type: 'string', + type: 'string' }, - }, + } }, }, }, 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 0b4faf5ef8..a0ed371fb8 100644 --- a/packages/backend/src/server/api/endpoints/i/authorized-apps.ts +++ b/packages/backend/src/server/api/endpoints/i/authorized-apps.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -23,27 +23,23 @@ export const meta = { id: { type: 'string', format: 'misskey:id', - optional: false, }, name: { type: 'string', - optional: false, }, callbackUrl: { type: 'string', - optional: false, nullable: true, + nullable: true, }, permission: { type: 'array', - optional: false, uniqueItems: true, items: { - type: 'string', + type: 'string' }, }, isAuthorized: { type: 'boolean', - optional: true, }, }, }, 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 bb78d47149..a3c37ffdb7 100644 --- a/packages/backend/src/server/api/endpoints/i/change-password.ts +++ b/packages/backend/src/server/api/endpoints/i/change-password.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 e70905ef1b..57f680bd7e 100644 --- a/packages/backend/src/server/api/endpoints/i/claim-achievement.ts +++ b/packages/backend/src/server/api/endpoints/i/claim-achievement.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 bfa0b4605d..fbac845fda 100644 --- a/packages/backend/src/server/api/endpoints/i/delete-account.ts +++ b/packages/backend/src/server/api/endpoints/i/delete-account.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/i/export-antennas.ts b/packages/backend/src/server/api/endpoints/i/export-antennas.ts index 77fb4a895f..23b2f6b4ce 100644 --- a/packages/backend/src/server/api/endpoints/i/export-antennas.ts +++ b/packages/backend/src/server/api/endpoints/i/export-antennas.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 7573018bec..8068a3b305 100644 --- a/packages/backend/src/server/api/endpoints/i/export-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/export-blocking.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/i/export-clips.ts b/packages/backend/src/server/api/endpoints/i/export-clips.ts deleted file mode 100644 index 10d1fdac73..0000000000 --- a/packages/backend/src/server/api/endpoints/i/export-clips.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import ms from 'ms'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { QueueService } from '@/core/QueueService.js'; - -export const meta = { - secure: true, - requireCredential: true, - limit: { - duration: ms('1day'), - max: 1, - }, -} 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 queueService: QueueService, - ) { - super(meta, paramDef, async (ps, me) => { - this.queueService.createExportClipsJob(me); - }); - } -} 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 5e03f70170..c22905bc67 100644 --- a/packages/backend/src/server/api/endpoints/i/export-favorites.ts +++ b/packages/backend/src/server/api/endpoints/i/export-favorites.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 2e5ba14737..880833ab76 100644 --- a/packages/backend/src/server/api/endpoints/i/export-following.ts +++ b/packages/backend/src/server/api/endpoints/i/export-following.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 0384cf142b..8eb70a387a 100644 --- a/packages/backend/src/server/api/endpoints/i/export-mute.ts +++ b/packages/backend/src/server/api/endpoints/i/export-mute.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 db4e78f667..791f637790 100644 --- a/packages/backend/src/server/api/endpoints/i/export-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/export-notes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 6cd662102c..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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/i/favorites.ts b/packages/backend/src/server/api/endpoints/i/favorites.ts index 3558035eca..d6f13c535a 100644 --- a/packages/backend/src/server/api/endpoints/i/favorites.ts +++ b/packages/backend/src/server/api/endpoints/i/favorites.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 d492585ffa..7e37adc4ac 100644 --- a/packages/backend/src/server/api/endpoints/i/gallery/likes.ts +++ b/packages/backend/src/server/api/endpoints/i/gallery/likes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 73a6fcc98b..148d38aa54 100644 --- a/packages/backend/src/server/api/endpoints/i/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/i/gallery/posts.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 bdf6c065e8..71db8710af 100644 --- a/packages/backend/src/server/api/endpoints/i/import-antennas.ts +++ b/packages/backend/src/server/api/endpoints/i/import-antennas.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -16,7 +16,6 @@ import { ApiError } from '../../error.js'; export const meta = { secure: true, requireCredential: true, - requireRolePolicy: 'canImportAntennas', prohibitMoved: true, limit: { @@ -72,14 +71,14 @@ export default class extends Endpoint { private downloadService: DownloadService, ) { super(meta, paramDef, async (ps, me) => { - const userExist = await this.usersRepository.exists({ where: { id: me.id } }); + const userExist = await this.usersRepository.exist({ where: { id: me.id } }); if (!userExist) throw new ApiError(meta.errors.noSuchUser); const file = await this.driveFilesRepository.findOneBy({ id: ps.fileId }); if (file === null) throw new ApiError(meta.errors.noSuchFile); if (file.size === 0) throw new ApiError(meta.errors.emptyFile); const antennas: (_Antenna & { userListAccts: string[] | null })[] = JSON.parse(await this.downloadService.downloadTextFile(file.url)); const currentAntennasCount = await this.antennasRepository.countBy({ userId: me.id }); - if (currentAntennasCount + antennas.length >= (await this.roleService.getUserPolicies(me.id)).antennaLimit) { + if (currentAntennasCount + antennas.length > (await this.roleService.getUserPolicies(me.id)).antennaLimit) { throw new ApiError(meta.errors.tooManyAntennas); } this.queueService.createImportAntennasJob(me, antennas); 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 d7bb6bcd22..965ad30547 100644 --- a/packages/backend/src/server/api/endpoints/i/import-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/import-blocking.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -15,7 +15,6 @@ import { ApiError } from '../../error.js'; export const meta = { secure: true, requireCredential: true, - requireRolePolicy: 'canImportBlocking', prohibitMoved: true, limit: { @@ -76,7 +75,7 @@ export default class extends Endpoint { // eslint- const checkMoving = await this.accountMoveService.validateAlsoKnownAs( me, - (old, src) => !!src.movedAt && src.movedAt.getTime() + 1000 * 60 * 60 * 2 > Date.now(), + (old, src) => !!src.movedAt && src.movedAt.getTime() + 1000 * 60 * 60 * 2 > (new Date()).getTime(), true, ); if (checkMoving ? file.size > 32 * 1024 * 1024 : file.size > 64 * 1024) throw new ApiError(meta.errors.tooBigFile); 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 e03192d8c6..e5fa2ac96a 100644 --- a/packages/backend/src/server/api/endpoints/i/import-following.ts +++ b/packages/backend/src/server/api/endpoints/i/import-following.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -15,7 +15,6 @@ import { ApiError } from '../../error.js'; export const meta = { secure: true, requireCredential: true, - requireRolePolicy: 'canImportFollowing', prohibitMoved: true, limit: { duration: ms('1hour'), @@ -76,7 +75,7 @@ export default class extends Endpoint { // eslint- const checkMoving = await this.accountMoveService.validateAlsoKnownAs( me, - (old, src) => !!src.movedAt && src.movedAt.getTime() + 1000 * 60 * 60 * 2 > Date.now(), + (old, src) => !!src.movedAt && src.movedAt.getTime() + 1000 * 60 * 60 * 2 > (new Date()).getTime(), true, ); if (checkMoving ? file.size > 32 * 1024 * 1024 : file.size > 64 * 1024) throw new ApiError(meta.errors.tooBigFile); 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 76b285bb7e..926cf13d7f 100644 --- a/packages/backend/src/server/api/endpoints/i/import-muting.ts +++ b/packages/backend/src/server/api/endpoints/i/import-muting.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -15,7 +15,6 @@ import { ApiError } from '../../error.js'; export const meta = { secure: true, requireCredential: true, - requireRolePolicy: 'canImportMuting', prohibitMoved: true, limit: { @@ -76,7 +75,7 @@ export default class extends Endpoint { // eslint- const checkMoving = await this.accountMoveService.validateAlsoKnownAs( me, - (old, src) => !!src.movedAt && src.movedAt.getTime() + 1000 * 60 * 60 * 2 > Date.now(), + (old, src) => !!src.movedAt && src.movedAt.getTime() + 1000 * 60 * 60 * 2 > (new Date()).getTime(), true, ); if (checkMoving ? file.size > 32 * 1024 * 1024 : file.size > 64 * 1024) throw new ApiError(meta.errors.tooBigFile); 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 76ecfd082c..2167996435 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -15,7 +15,6 @@ import { ApiError } from '../../error.js'; export const meta = { secure: true, requireCredential: true, - requireRolePolicy: 'canImportUserLists', prohibitMoved: true, limit: { duration: ms('1hour'), @@ -75,7 +74,7 @@ export default class extends Endpoint { // eslint- const checkMoving = await this.accountMoveService.validateAlsoKnownAs( me, - (old, src) => !!src.movedAt && src.movedAt.getTime() + 1000 * 60 * 60 * 2 > Date.now(), + (old, src) => !!src.movedAt && src.movedAt.getTime() + 1000 * 60 * 60 * 2 > (new Date()).getTime(), true, ); if (checkMoving ? file.size > 32 * 1024 * 1024 : file.size > 64 * 1024) throw new ApiError(meta.errors.tooBigFile); diff --git a/packages/backend/src/server/api/endpoints/i/move.ts b/packages/backend/src/server/api/endpoints/i/move.ts index 1bd641232c..f3ba720c2b 100644 --- a/packages/backend/src/server/api/endpoints/i/move.ts +++ b/packages/backend/src/server/api/endpoints/i/move.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts b/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts index dc6ffd3e02..4ea94b07f6 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications-grouped.ts @@ -1,13 +1,13 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { In } from 'typeorm'; +import { Brackets, In } from 'typeorm'; import * as Redis from 'ioredis'; import { Inject, Injectable } from '@nestjs/common'; import type { NotesRepository } from '@/models/_.js'; -import { obsoleteNotificationTypes, groupedNotificationTypes, FilterUnionByProperty } from '@/types.js'; +import { obsoleteNotificationTypes, notificationTypes, FilterUnionByProperty } from '@/types.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteReadService } from '@/core/NoteReadService.js'; import { NotificationEntityService } from '@/core/entities/NotificationEntityService.js'; @@ -48,10 +48,10 @@ export const paramDef = { markAsRead: { type: 'boolean', default: true }, // 後方互換のため、廃止された通知タイプも受け付ける includeTypes: { type: 'array', items: { - type: 'string', enum: [...groupedNotificationTypes, ...obsoleteNotificationTypes], + type: 'string', enum: [...notificationTypes, ...obsoleteNotificationTypes], } }, excludeTypes: { type: 'array', items: { - type: 'string', enum: [...groupedNotificationTypes, ...obsoleteNotificationTypes], + type: 'string', enum: [...notificationTypes, ...obsoleteNotificationTypes], } }, }, required: [], @@ -79,12 +79,12 @@ export default class extends Endpoint { // eslint- return []; } // excludeTypes に全指定されている場合はクエリしない - if (groupedNotificationTypes.every(type => ps.excludeTypes?.includes(type))) { + if (notificationTypes.every(type => ps.excludeTypes?.includes(type))) { return []; } - const includeTypes = ps.includeTypes && ps.includeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof groupedNotificationTypes[number][]; - const excludeTypes = ps.excludeTypes && ps.excludeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof groupedNotificationTypes[number][]; + const includeTypes = ps.includeTypes && ps.includeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof notificationTypes[number][]; + const excludeTypes = ps.excludeTypes && ps.excludeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof notificationTypes[number][]; const limit = (ps.limit + EXTRA_LIMIT) + (ps.untilId ? 1 : 0) + (ps.sinceId ? 1 : 0); // untilIdに指定したものも含まれるため+1 const notificationsRes = await this.redisClient.xrevrange( @@ -162,6 +162,7 @@ export default class extends Endpoint { // eslint- } groupedNotifications = groupedNotifications.slice(0, ps.limit); + const noteIds = groupedNotifications .filter((notification): notification is FilterUnionByProperty => ['mention', 'reply', 'quote'].includes(notification.type)) .map(notification => notification.noteId!); diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts index 2f619380e9..039fd9454c 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications.ts @@ -1,13 +1,13 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { In } from 'typeorm'; +import { Brackets, In } from 'typeorm'; import * as Redis from 'ioredis'; import { Inject, Injectable } from '@nestjs/common'; import type { NotesRepository } from '@/models/_.js'; -import { FilterUnionByProperty, notificationTypes, obsoleteNotificationTypes } from '@/types.js'; +import { obsoleteNotificationTypes, notificationTypes, FilterUnionByProperty } from '@/types.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteReadService } from '@/core/NoteReadService.js'; import { NotificationEntityService } from '@/core/entities/NotificationEntityService.js'; @@ -84,51 +84,27 @@ export default class extends Endpoint { // eslint- const includeTypes = ps.includeTypes && ps.includeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof notificationTypes[number][]; const excludeTypes = ps.excludeTypes && ps.excludeTypes.filter(type => !(obsoleteNotificationTypes).includes(type as any)) as typeof notificationTypes[number][]; - let sinceTime = ps.sinceId ? this.idService.parse(ps.sinceId).date.getTime().toString() : null; - let untilTime = ps.untilId ? this.idService.parse(ps.untilId).date.getTime().toString() : null; + const limit = ps.limit + (ps.untilId ? 1 : 0) + (ps.sinceId ? 1 : 0); // untilIdに指定したものも含まれるため+1 + const notificationsRes = await this.redisClient.xrevrange( + `notificationTimeline:${me.id}`, + ps.untilId ? this.idService.parse(ps.untilId).date.getTime() : '+', + ps.sinceId ? this.idService.parse(ps.sinceId).date.getTime() : '-', + 'COUNT', limit); - let notifications: MiNotification[]; - for (;;) { - let notificationsRes: [id: string, fields: string[]][]; + if (notificationsRes.length === 0) { + return []; + } - // sinceidのみの場合は古い順、そうでない場合は新しい順。 QueryService.makePaginationQueryも参照 - if (sinceTime && !untilTime) { - notificationsRes = await this.redisClient.xrange( - `notificationTimeline:${me.id}`, - '(' + sinceTime, - '+', - 'COUNT', ps.limit); - } else { - notificationsRes = await this.redisClient.xrevrange( - `notificationTimeline:${me.id}`, - untilTime ? '(' + untilTime : '+', - sinceTime ? '(' + sinceTime : '-', - 'COUNT', ps.limit); - } + let notifications = notificationsRes.map(x => JSON.parse(x[1][1])).filter(x => x.id !== ps.untilId && x !== ps.sinceId) as MiNotification[]; - if (notificationsRes.length === 0) { - return []; - } + if (includeTypes && includeTypes.length > 0) { + notifications = notifications.filter(notification => includeTypes.includes(notification.type)); + } else if (excludeTypes && excludeTypes.length > 0) { + notifications = notifications.filter(notification => !excludeTypes.includes(notification.type)); + } - notifications = notificationsRes.map(x => JSON.parse(x[1][1])) as MiNotification[]; - - if (includeTypes && includeTypes.length > 0) { - notifications = notifications.filter(notification => includeTypes.includes(notification.type)); - } else if (excludeTypes && excludeTypes.length > 0) { - notifications = notifications.filter(notification => !excludeTypes.includes(notification.type)); - } - - if (notifications.length !== 0) { - // 通知が1件以上ある場合は返す - break; - } - - // フィルタしたことで通知が0件になった場合、次のページを取得する - if (ps.sinceId && !ps.untilId) { - sinceTime = notificationsRes[notificationsRes.length - 1][0]; - } else { - untilTime = notificationsRes[notificationsRes.length - 1][0]; - } + if (notifications.length === 0) { + return []; } // Mark all as read 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 d4c09426a7..6bf7e6aa9b 100644 --- a/packages/backend/src/server/api/endpoints/i/page-likes.ts +++ b/packages/backend/src/server/api/endpoints/i/page-likes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/i/pages.ts b/packages/backend/src/server/api/endpoints/i/pages.ts index 1b6359a633..b8082c018f 100644 --- a/packages/backend/src/server/api/endpoints/i/pages.ts +++ b/packages/backend/src/server/api/endpoints/i/pages.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/i/pin.ts b/packages/backend/src/server/api/endpoints/i/pin.ts index b7cafd74df..c89cdfa3a4 100644 --- a/packages/backend/src/server/api/endpoints/i/pin.ts +++ b/packages/backend/src/server/api/endpoints/i/pin.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -66,8 +66,8 @@ export default class extends Endpoint { // eslint- throw err; }); - return await this.userEntityService.pack(me.id, me, { - schema: 'MeDetailed', + return await this.userEntityService.pack(me.id, me, { + detail: true, }); }); } 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 d1a8eccb1d..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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 4db1ca73c1..ba7859d0d4 100644 --- a/packages/backend/src/server/api/endpoints/i/read-announcement.ts +++ b/packages/backend/src/server/api/endpoints/i/read-announcement.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 78f3cce9ad..b70dcfbace 100644 --- a/packages/backend/src/server/api/endpoints/i/regenerate-token.ts +++ b/packages/backend/src/server/api/endpoints/i/regenerate-token.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 f1797cfde7..79a81cb73f 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 d53c390460..d9b26cab2c 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -22,16 +22,7 @@ export const meta = { res: { type: 'object', - properties: { - updatedAt: { - type: 'string', - optional: false, - }, - value: { - optional: false, - }, - }, - }, + } } as const; export const paramDef = { @@ -59,7 +50,7 @@ export default class extends Endpoint { // eslint- } return { - updatedAt: item.updatedAt.toISOString(), + updatedAt: item.updatedAt, value: item.value, }; }); 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 d9a8fdd449..c373410256 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 3fe339606d..a91dcd9543 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -13,9 +13,6 @@ export const meta = { res: { type: 'object', - additionalProperties: { - type: 'string', - }, }, } as const; 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 28f158c62d..ad203d5203 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,13 +10,6 @@ import { RegistryApiService } from '@/core/RegistryApiService.js'; export const meta = { requireCredential: true, kind: 'read:account', - - res: { - type: 'array', - items: { - type: 'string', - }, - }, } as const; export const paramDef = { 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 cf965ba0cf..9cbe271b91 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/remove.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/remove.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/i/registry/scopes-with-domain.ts b/packages/backend/src/server/api/endpoints/i/registry/scopes-with-domain.ts index 67a99b028a..0aca2a26fe 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/scopes-with-domain.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/scopes-with-domain.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 8723035d84..c61d5b8727 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/set.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/set.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 c05ee93c6f..98d866f867 100644 --- a/packages/backend/src/server/api/endpoints/i/revoke-token.ts +++ b/packages/backend/src/server/api/endpoints/i/revoke-token.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -34,7 +34,7 @@ export default class extends Endpoint { // eslint- ) { super(meta, paramDef, async (ps, me) => { if (ps.tokenId) { - const tokenExist = await this.accessTokensRepository.exists({ where: { id: ps.tokenId } }); + const tokenExist = await this.accessTokensRepository.exist({ where: { id: ps.tokenId } }); if (tokenExist) { await this.accessTokensRepository.delete({ @@ -43,7 +43,7 @@ export default class extends Endpoint { // eslint- }); } } else if (ps.token) { - const tokenExist = await this.accessTokensRepository.exists({ where: { token: ps.token } }); + const tokenExist = await this.accessTokensRepository.exist({ where: { token: ps.token } }); if (tokenExist) { await this.accessTokensRepository.delete({ 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 76ad0bbe21..f82e3f9b28 100644 --- a/packages/backend/src/server/api/endpoints/i/signin-history.ts +++ b/packages/backend/src/server/api/endpoints/i/signin-history.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/i/unpin.ts b/packages/backend/src/server/api/endpoints/i/unpin.ts index 74825cf9f3..b59c0e954f 100644 --- a/packages/backend/src/server/api/endpoints/i/unpin.ts +++ b/packages/backend/src/server/api/endpoints/i/unpin.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -51,8 +51,8 @@ export default class extends Endpoint { // eslint- throw err; }); - return await this.userEntityService.pack(me.id, me, { - schema: 'MeDetailed', + return await this.userEntityService.pack(me.id, me, { + detail: true, }); }); } 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 da1faee30d..52977f5a07 100644 --- a/packages/backend/src/server/api/endpoints/i/update-email.ts +++ b/packages/backend/src/server/api/endpoints/i/update-email.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common'; import ms from 'ms'; import bcrypt from 'bcryptjs'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { MiMeta, UserProfilesRepository } from '@/models/_.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'; @@ -39,17 +39,11 @@ export const meta = { code: 'UNAVAILABLE', id: 'a2defefb-f220-8849-0af6-17f816099323', }, - - emailRequired: { - message: 'Email address is required.', - code: 'EMAIL_REQUIRED', - id: '324c7a88-59f2-492f-903f-89134f93e47e', - }, }, res: { type: 'object', - ref: 'MeDetailed', + ref: 'UserDetailed', }, } as const; @@ -69,9 +63,6 @@ export default class extends Endpoint { // eslint- @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private serverSettings: MiMeta, - @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, @@ -106,8 +97,6 @@ export default class extends Endpoint { // eslint- if (!res.available) { throw new ApiError(meta.errors.unavailable); } - } else if (this.serverSettings.emailRequiredForSignup) { - throw new ApiError(meta.errors.emailRequired); } await this.userProfilesRepository.update(me.id, { @@ -117,7 +106,7 @@ export default class extends Endpoint { // eslint- }); const iObj = await this.userEntityService.pack(me.id, me, { - schema: 'MeDetailed', + detail: true, includeSecrets: true, }); diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index d3eeb75b27..eed3082258 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -11,10 +11,11 @@ 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, MiMeta, UserProfilesRepository, PagesRepository } from '@/models/_.js'; +import type { UsersRepository, DriveFilesRepository, UserProfilesRepository, PagesRepository } from '@/models/_.js'; import type { MiLocalUser, MiUser } from '@/models/User.js'; -import { birthdaySchema, descriptionSchema, followedMessageSchema, locationSchema, nameSchema } 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'; import { Endpoint } from '@/server/api/endpoint-base.js'; @@ -22,10 +23,9 @@ import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { UserFollowingService } from '@/core/UserFollowingService.js'; import { AccountUpdateService } from '@/core/AccountUpdateService.js'; -import { UtilityService } from '@/core/UtilityService.js'; import { HashtagService } from '@/core/HashtagService.js'; import { DI } from '@/di-symbols.js'; -import { RolePolicies, RoleService } from '@/core/RoleService.js'; +import { RoleService } from '@/core/RoleService.js'; import { CacheService } from '@/core/CacheService.js'; import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; @@ -33,7 +33,6 @@ import { HttpRequestService } from '@/core/HttpRequestService.js'; import type { Config } from '@/config.js'; import { safeForSql } from '@/misc/safe-for-sql.js'; import { AvatarDecorationService } from '@/core/AvatarDecorationService.js'; -import { notificationRecieveConfig } from '@/models/json-schema/user.js'; import { ApiLoggerService } from '../../ApiLoggerService.js'; import { ApiError } from '../../error.js'; @@ -115,13 +114,6 @@ export const meta = { code: 'RESTRICTED_BY_ROLE', id: '8feff0ba-5ab5-585b-31f4-4df816663fad', }, - - nameContainsProhibitedWords: { - message: 'Your new name contains prohibited words.', - code: 'YOUR_NAME_CONTAINS_PROHIBITED_WORDS', - id: '0b3f9f6a-2f4d-4b1f-9fb4-49d3a2fd7191', - httpStatusCode: 422, - }, }, res: { @@ -141,7 +133,6 @@ export const paramDef = { properties: { name: { ...nameSchema, nullable: true }, description: { ...descriptionSchema, nullable: true }, - followedMessage: { ...followedMessageSchema, nullable: true }, location: { ...locationSchema, nullable: true }, birthday: { ...birthdaySchema, nullable: true }, lang: { type: 'string', enum: [null, ...Object.keys(langmap)] as string[], nullable: true }, @@ -179,9 +170,6 @@ export const paramDef = { autoAcceptFollowed: { type: 'boolean' }, noCrawle: { type: 'boolean' }, preventAiLearning: { type: 'boolean' }, - requireSigninToViewContents: { type: 'boolean' }, - makeNotesFollowersOnlyBefore: { type: 'integer', nullable: true }, - makeNotesHiddenBefore: { type: 'integer', nullable: true }, isBot: { type: 'boolean' }, isCat: { type: 'boolean' }, injectFeaturedNote: { type: 'boolean' }, @@ -196,26 +184,7 @@ export const paramDef = { mutedInstances: { type: 'array', items: { type: 'string', } }, - notificationRecieveConfig: { - type: 'object', - nullable: false, - properties: { - note: notificationRecieveConfig, - follow: notificationRecieveConfig, - mention: notificationRecieveConfig, - reply: notificationRecieveConfig, - renote: notificationRecieveConfig, - quote: notificationRecieveConfig, - reaction: notificationRecieveConfig, - pollEnded: notificationRecieveConfig, - receiveFollowRequest: notificationRecieveConfig, - followRequestAccepted: notificationRecieveConfig, - roleAssigned: notificationRecieveConfig, - achievementEarned: notificationRecieveConfig, - app: notificationRecieveConfig, - test: notificationRecieveConfig, - }, - }, + notificationRecieveConfig: { type: 'object' }, emailNotificationTypes: { type: 'array', items: { type: 'string', } }, @@ -234,9 +203,6 @@ export default class extends Endpoint { // eslint- @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private instanceMeta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -261,7 +227,6 @@ export default class extends Endpoint { // eslint- private cacheService: CacheService, private httpRequestService: HttpRequestService, private avatarDecorationService: AvatarDecorationService, - private utilityService: UtilityService, ) { super(meta, paramDef, async (ps, _user, token) => { const user = await this.usersRepository.findOneByOrFail({ id: _user.id }) as MiLocalUser; @@ -271,18 +236,9 @@ export default class extends Endpoint { // eslint- const profileUpdates = {} as Partial; const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id }); - let policies: RolePolicies | null = null; - if (ps.name !== undefined) { - if (ps.name === null) { - updates.name = null; - } else { - const trimmedName = ps.name.trim(); - updates.name = trimmedName === '' ? null : trimmedName; - } - } + if (ps.name !== undefined) updates.name = ps.name; if (ps.description !== undefined) profileUpdates.description = ps.description; - if (ps.followedMessage !== undefined) profileUpdates.followedMessage = ps.followedMessage; if (ps.lang !== undefined) profileUpdates.lang = ps.lang; if (ps.location !== undefined) profileUpdates.location = ps.location; if (ps.birthday !== undefined) profileUpdates.birthday = ps.birthday; @@ -313,16 +269,14 @@ export default class extends Endpoint { // eslint- } if (ps.mutedWords !== undefined) { - policies ??= await this.roleService.getUserPolicies(user.id); - checkMuteWordCount(ps.mutedWords, policies.wordMuteLimit); + checkMuteWordCount(ps.mutedWords, (await this.roleService.getUserPolicies(user.id)).wordMuteLimit); validateMuteWordRegex(ps.mutedWords); profileUpdates.mutedWords = ps.mutedWords; profileUpdates.enableWordMute = ps.mutedWords.length > 0; } if (ps.hardMutedWords !== undefined) { - policies ??= await this.roleService.getUserPolicies(user.id); - checkMuteWordCount(ps.hardMutedWords, policies.wordMuteLimit); + checkMuteWordCount(ps.hardMutedWords, (await this.roleService.getUserPolicies(user.id)).wordMuteLimit); validateMuteWordRegex(ps.hardMutedWords); profileUpdates.hardMutedWords = ps.hardMutedWords; } @@ -337,24 +291,17 @@ export default class extends Endpoint { // eslint- if (typeof ps.autoAcceptFollowed === 'boolean') profileUpdates.autoAcceptFollowed = ps.autoAcceptFollowed; if (typeof ps.noCrawle === 'boolean') profileUpdates.noCrawle = ps.noCrawle; if (typeof ps.preventAiLearning === 'boolean') profileUpdates.preventAiLearning = ps.preventAiLearning; - if (typeof ps.requireSigninToViewContents === 'boolean') updates.requireSigninToViewContents = ps.requireSigninToViewContents; - if ((typeof ps.makeNotesFollowersOnlyBefore === 'number') || (ps.makeNotesFollowersOnlyBefore === null)) updates.makeNotesFollowersOnlyBefore = ps.makeNotesFollowersOnlyBefore; - if ((typeof ps.makeNotesHiddenBefore === 'number') || (ps.makeNotesHiddenBefore === null)) updates.makeNotesHiddenBefore = ps.makeNotesHiddenBefore; if (typeof ps.isCat === 'boolean') updates.isCat = ps.isCat; if (typeof ps.injectFeaturedNote === 'boolean') profileUpdates.injectFeaturedNote = ps.injectFeaturedNote; if (typeof ps.receiveAnnouncementEmail === 'boolean') profileUpdates.receiveAnnouncementEmail = ps.receiveAnnouncementEmail; if (typeof ps.alwaysMarkNsfw === 'boolean') { - policies ??= await this.roleService.getUserPolicies(user.id); - if (policies.alwaysMarkNsfw) throw new ApiError(meta.errors.restrictedByRole); + if ((await roleService.getUserPolicies(user.id)).alwaysMarkNsfw) throw new ApiError(meta.errors.restrictedByRole); profileUpdates.alwaysMarkNsfw = ps.alwaysMarkNsfw; } if (typeof ps.autoSensitive === 'boolean') profileUpdates.autoSensitive = ps.autoSensitive; if (ps.emailNotificationTypes !== undefined) profileUpdates.emailNotificationTypes = ps.emailNotificationTypes; if (ps.avatarId) { - policies ??= await this.roleService.getUserPolicies(user.id); - if (!policies.canUpdateBioMedia) throw new ApiError(meta.errors.restrictedByRole); - const avatar = await this.driveFilesRepository.findOneBy({ id: ps.avatarId }); if (avatar == null || avatar.userId !== user.id) throw new ApiError(meta.errors.noSuchAvatar); @@ -370,9 +317,6 @@ export default class extends Endpoint { // eslint- } if (ps.bannerId) { - policies ??= await this.roleService.getUserPolicies(user.id); - if (!policies.canUpdateBioMedia) throw new ApiError(meta.errors.restrictedByRole); - const banner = await this.driveFilesRepository.findOneBy({ id: ps.bannerId }); if (banner == null || banner.userId !== user.id) throw new ApiError(meta.errors.noSuchBanner); @@ -388,15 +332,14 @@ export default class extends Endpoint { // eslint- } if (ps.avatarDecorations) { - policies ??= await this.roleService.getUserPolicies(user.id); const decorations = await this.avatarDecorationService.getAll(true); - const myRoles = await this.roleService.getUserRoles(user.id); + const [myRoles, myPolicies] = await Promise.all([this.roleService.getUserRoles(user.id), this.roleService.getUserPolicies(user.id)]); const allRoles = await this.roleService.getRoles(); const decorationIds = decorations .filter(d => d.roleIdsThatCanBeUsedThisDecoration.filter(roleId => allRoles.some(r => r.id === roleId)).length === 0 || myRoles.some(r => d.roleIdsThatCanBeUsedThisDecoration.includes(r.id))) .map(d => d.id); - if (ps.avatarDecorations.length > policies.avatarDecorationLimit) throw new ApiError(meta.errors.restrictedByRole); + if (ps.avatarDecorations.length > myPolicies.avatarDecorationLimit) throw new ApiError(meta.errors.restrictedByRole); updates.avatarDecorations = ps.avatarDecorations.filter(d => decorationIds.includes(d.id)).map(d => ({ id: d.id, @@ -465,17 +408,8 @@ export default class extends Endpoint { // eslint- const newName = updates.name === undefined ? user.name : updates.name; const newDescription = profileUpdates.description === undefined ? profile.description : profileUpdates.description; const newFields = profileUpdates.fields === undefined ? profile.fields : profileUpdates.fields; - const newFollowedMessage = profileUpdates.followedMessage === undefined ? profile.followedMessage : profileUpdates.followedMessage; if (newName != null) { - let hasProhibitedWords = false; - if (!await this.roleService.isModerator(user)) { - hasProhibitedWords = this.utilityService.isKeyWordIncluded(newName, this.instanceMeta.prohibitedWordsForNameOfUser); - } - if (hasProhibitedWords) { - throw new ApiError(meta.errors.nameContainsProhibitedWords); - } - const tokens = mfm.parseSimple(newName); emojis = emojis.concat(extractCustomEmojisFromMfm(tokens)); } @@ -495,11 +429,6 @@ export default class extends Endpoint { // eslint- ]); } - if (newFollowedMessage != null) { - const tokens = mfm.parse(newFollowedMessage); - emojis = emojis.concat(extractCustomEmojisFromMfm(tokens)); - } - updates.emojis = emojis; updates.tags = tags; @@ -507,9 +436,9 @@ export default class extends Endpoint { // eslint- this.hashtagService.updateUsertags(user, tags); //#endregion - if (Object.keys(updates).length > 0) { - await this.usersRepository.update(user.id, updates); - this.globalEventService.publishInternalEvent('localUserUpdated', { id: user.id }); + if (Object.keys(updates).length > 0) await this.usersRepository.update(user.id, updates); + if (Object.keys(updates).includes('alsoKnownAs')) { + this.cacheService.uriPersonCache.set(this.userEntityService.genLocalUserUri(user.id), { ...user, ...updates }); } await this.userProfilesRepository.update(user.id, { @@ -517,8 +446,8 @@ export default class extends Endpoint { // eslint- verifiedLinks: [], }); - const iObj = await this.userEntityService.pack(user.id, user, { - schema: 'MeDetailed', + const iObj = await this.userEntityService.pack(user.id, user, { + detail: true, includeSecrets: isSecure, }); @@ -549,32 +478,26 @@ export default class extends Endpoint { // eslint- private async verifyLink(url: string, user: MiLocalUser) { if (!safeForSql(url)) return; - try { - const html = await this.httpRequestService.getHtml(url); + const html = await this.httpRequestService.getHtml(url); - const { window } = new JSDOM(html); - const doc = window.document; + const { window } = new JSDOM(html); + const doc = window.document; - const myLink = `${this.config.url}/@${user.username}`; + const myLink = `${this.config.url}/@${user.username}`; - const aEls = Array.from(doc.getElementsByTagName('a')); - const linkEls = Array.from(doc.getElementsByTagName('link')); + const aEls = Array.from(doc.getElementsByTagName('a')); + const linkEls = Array.from(doc.getElementsByTagName('link')); - const includesMyLink = aEls.some(a => a.href === myLink); - const includesRelMeLinks = [...aEls, ...linkEls].some(link => link.rel === 'me' && link.href === myLink); + const includesMyLink = aEls.some(a => a.href === myLink); + const includesRelMeLinks = [...aEls, ...linkEls].some(link => link.rel === 'me' && link.href === myLink); - if (includesMyLink || includesRelMeLinks) { - await this.userProfilesRepository.createQueryBuilder('profile').update() - .where('userId = :userId', { userId: user.id }) - .set({ - verifiedLinks: () => `array_append("verifiedLinks", '${url}')`, // ここでSQLインジェクションされそうなのでとりあえず safeForSql で弾いている - }) - .execute(); - } - - window.close(); - } catch (err) { - // なにもしない + if (includesMyLink || includesRelMeLinks) { + 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 6e84603f7a..bdc9f9ea8b 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/create.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -13,7 +13,6 @@ import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; import { ApiError } from '@/server/api/error.js'; -// TODO: UserWebhook schemaの適用 export const meta = { tags: ['webhooks'], @@ -34,7 +33,7 @@ export const meta = { properties: { id: { type: 'string', - format: 'misskey:id', + format: 'misskey:id' }, userId: { type: 'string', @@ -46,7 +45,7 @@ export const meta = { items: { type: 'string', enum: webhookEventTypes, - }, + } }, url: { type: 'string' }, secret: { type: 'string' }, @@ -86,18 +85,18 @@ export default class extends Endpoint { // eslint- const currentWebhooksCount = await this.webhooksRepository.countBy({ userId: me.id, }); - if (currentWebhooksCount >= (await this.roleService.getUserPolicies(me.id)).webhookLimit) { + if (currentWebhooksCount > (await this.roleService.getUserPolicies(me.id)).webhookLimit) { throw new ApiError(meta.errors.tooManyWebhooks); } - const webhook = await this.webhooksRepository.insertOne({ + const webhook = await this.webhooksRepository.insert({ id: this.idService.gen(), userId: me.id, name: ps.name, url: ps.url, secret: ps.secret, on: ps.on, - }); + }).then(x => this.webhooksRepository.findOneByOrFail(x.identifiers[0])); this.globalEventService.publishInternalEvent('webhookCreated', webhook); @@ -109,7 +108,7 @@ export default class extends Endpoint { // eslint- url: webhook.url, secret: webhook.secret, active: webhook.active, - latestSentAt: webhook.latestSentAt ? webhook.latestSentAt.toISOString() : null, + latestSentAt: webhook.latestSentAt?.toISOString(), latestStatus: webhook.latestStatus, }; }); 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 1b1ac00670..db7d0db13c 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 394c178f2a..afb2d0509e 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/list.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -9,7 +9,6 @@ import { webhookEventTypes } from '@/models/Webhook.js'; import type { WebhooksRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; -// TODO: UserWebhook schemaの適用 export const meta = { tags: ['webhooks', 'account'], @@ -24,7 +23,7 @@ export const meta = { properties: { id: { type: 'string', - format: 'misskey:id', + format: 'misskey:id' }, userId: { type: 'string', @@ -36,7 +35,7 @@ export const meta = { items: { type: 'string', enum: webhookEventTypes, - }, + } }, url: { type: 'string' }, secret: { type: 'string' }, @@ -44,8 +43,8 @@ export const meta = { latestSentAt: { type: 'string', format: 'date-time', nullable: true }, latestStatus: { type: 'integer', nullable: true }, }, - }, - }, + } + } } as const; export const paramDef = { @@ -74,7 +73,7 @@ export default class extends Endpoint { // eslint- url: webhook.url, secret: webhook.secret, active: webhook.active, - latestSentAt: webhook.latestSentAt ? webhook.latestSentAt.toISOString() : null, + latestSentAt: webhook.latestSentAt?.toISOString(), latestStatus: webhook.latestStatus, } )); 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 4a0c09ff0c..5c6dd908b4 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/show.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,7 +10,6 @@ import type { WebhooksRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { ApiError } from '../../../error.js'; -// TODO: UserWebhook schemaの適用 export const meta = { tags: ['webhooks'], @@ -31,7 +30,7 @@ export const meta = { properties: { id: { type: 'string', - format: 'misskey:id', + format: 'misskey:id' }, userId: { type: 'string', @@ -43,7 +42,7 @@ export const meta = { items: { type: 'string', enum: webhookEventTypes, - }, + } }, url: { type: 'string' }, secret: { type: 'string' }, @@ -86,7 +85,7 @@ export default class extends Endpoint { // eslint- url: webhook.url, secret: webhook.secret, active: webhook.active, - latestSentAt: webhook.latestSentAt ? webhook.latestSentAt.toISOString() : null, + latestSentAt: webhook.latestSentAt?.toISOString(), latestStatus: webhook.latestStatus, }; }); diff --git a/packages/backend/src/server/api/endpoints/i/webhooks/test.ts b/packages/backend/src/server/api/endpoints/i/webhooks/test.ts deleted file mode 100644 index 2bf6df9ce2..0000000000 --- a/packages/backend/src/server/api/endpoints/i/webhooks/test.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import ms from 'ms'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { webhookEventTypes } from '@/models/Webhook.js'; -import { WebhookTestService } from '@/core/WebhookTestService.js'; -import { ApiError } from '@/server/api/error.js'; - -export const meta = { - tags: ['webhooks'], - - requireCredential: true, - secure: true, - kind: 'read:account', - - limit: { - duration: ms('15min'), - max: 60, - }, - - errors: { - noSuchWebhook: { - message: 'No such webhook.', - code: 'NO_SUCH_WEBHOOK', - id: '0c52149c-e913-18f8-5dc7-74870bfe0cf9', - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - webhookId: { - type: 'string', - format: 'misskey:id', - }, - type: { - type: 'string', - enum: webhookEventTypes, - }, - override: { - type: 'object', - properties: { - url: { type: 'string' }, - secret: { type: 'string' }, - }, - }, - }, - required: ['webhookId', 'type'], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private webhookTestService: WebhookTestService, - ) { - super(meta, paramDef, async (ps, me) => { - try { - await this.webhookTestService.testUserWebhook({ - webhookId: ps.webhookId, - type: ps.type, - override: ps.override, - }, me); - } catch (e) { - if (e instanceof WebhookTestService.NoSuchWebhookError) { - throw new ApiError(meta.errors.noSuchWebhook); - } - throw e; - } - }); - } -} 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 07a25bd82a..b3e000524d 100644 --- a/packages/backend/src/server/api/endpoints/i/webhooks/update.ts +++ b/packages/backend/src/server/api/endpoints/i/webhooks/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -34,13 +34,13 @@ 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', nullable: true, maxLength: 1024 }, + secret: { type: 'string', maxLength: 1024, default: '' }, on: { type: 'array', items: { type: 'string', enum: webhookEventTypes, } }, active: { type: 'boolean' }, }, - required: ['webhookId'], + required: ['webhookId', 'name', 'url', 'on', 'active'], } as const; // TODO: ロジックをサービスに切り出す @@ -66,7 +66,7 @@ export default class extends Endpoint { // eslint- await this.webhooksRepository.update(webhook.id, { name: ps.name, url: ps.url, - secret: ps.secret === null ? '' : ps.secret, + secret: ps.secret, on: ps.on, active: ps.active, }); diff --git a/packages/backend/src/server/api/endpoints/invite/create.ts b/packages/backend/src/server/api/endpoints/invite/create.ts index a70b587da7..4f37f2f4bb 100644 --- a/packages/backend/src/server/api/endpoints/invite/create.ts +++ b/packages/backend/src/server/api/endpoints/invite/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -66,13 +66,13 @@ export default class extends Endpoint { // eslint- } } - const ticket = await this.registrationTicketsRepository.insertOne({ + const ticket = await this.registrationTicketsRepository.insert({ id: this.idService.gen(), createdBy: me, createdById: me.id, expiresAt: policies.inviteExpirationTime ? new Date(Date.now() + (policies.inviteExpirationTime * 1000 * 60)) : null, code: generateInviteCode(), - }); + }).then(x => this.registrationTicketsRepository.findOneByOrFail(x.identifiers[0])); return await this.inviteCodeEntityService.pack(ticket, me); }); diff --git a/packages/backend/src/server/api/endpoints/invite/delete.ts b/packages/backend/src/server/api/endpoints/invite/delete.ts index e960ff9f4e..d84430a49f 100644 --- a/packages/backend/src/server/api/endpoints/invite/delete.ts +++ b/packages/backend/src/server/api/endpoints/invite/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/invite/limit.ts b/packages/backend/src/server/api/endpoints/invite/limit.ts index 2ffd41ae28..fc3bb9bdc2 100644 --- a/packages/backend/src/server/api/endpoints/invite/limit.ts +++ b/packages/backend/src/server/api/endpoints/invite/limit.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -49,7 +49,7 @@ export default class extends Endpoint { // eslint- const policies = await this.roleService.getUserPolicies(me.id); const count = policies.inviteLimit ? await this.registrationTicketsRepository.countBy({ - id: MoreThan(this.idService.gen(Date.now() - (policies.inviteLimitCycle * 60 * 1000))), + id: MoreThan(this.idService.gen(Date.now() - (policies.inviteExpirationTime * 60 * 1000))), createdById: me.id, }) : null; diff --git a/packages/backend/src/server/api/endpoints/invite/list.ts b/packages/backend/src/server/api/endpoints/invite/list.ts index 23aefe83a2..6734f27e14 100644 --- a/packages/backend/src/server/api/endpoints/invite/list.ts +++ b/packages/backend/src/server/api/endpoints/invite/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index 5460635e1d..f7c2962bc2 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -1,11 +1,19 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { Injectable } from '@nestjs/common'; +import { IsNull, LessThanOrEqual, MoreThan, Brackets } from 'typeorm'; +import { Inject, Injectable } from '@nestjs/common'; +import JSON5 from 'json5'; +import type { AdsRepository, UsersRepository } from '@/models/_.js'; +import { MAX_NOTE_TEXT_LENGTH } from '@/const.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import { MetaEntityService } from '@/core/entities/MetaEntityService.js'; +import { UserEntityService } from '@/core/entities/UserEntityService.js'; +import { MetaService } from '@/core/MetaService.js'; +import type { Config } from '@/config.js'; +import { DI } from '@/di-symbols.js'; +import { DEFAULT_POLICIES } from '@/core/RoleService.js'; export const meta = { tags: ['meta'], @@ -14,10 +22,276 @@ export const meta = { res: { type: 'object', - oneOf: [ - { type: 'object', ref: 'MetaLite' }, - { type: 'object', ref: 'MetaDetailed' }, - ], + optional: false, nullable: false, + properties: { + maintainerName: { + type: 'string', + optional: false, nullable: true, + }, + maintainerEmail: { + type: 'string', + optional: false, nullable: true, + }, + version: { + type: 'string', + optional: false, nullable: false, + }, + name: { + type: 'string', + optional: false, nullable: false, + }, + shortName: { + type: 'string', + optional: false, nullable: true, + }, + uri: { + type: 'string', + optional: false, nullable: false, + format: 'url', + example: 'https://misskey.example.com', + }, + description: { + type: 'string', + optional: false, nullable: true, + }, + langs: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'string', + optional: false, nullable: false, + }, + }, + tosUrl: { + type: 'string', + optional: false, nullable: true, + }, + repositoryUrl: { + type: 'string', + optional: false, nullable: false, + default: 'https://github.com/misskey-dev/misskey', + }, + feedbackUrl: { + type: 'string', + optional: false, nullable: false, + default: 'https://github.com/misskey-dev/misskey/issues/new', + }, + defaultDarkTheme: { + type: 'string', + optional: false, nullable: true, + }, + defaultLightTheme: { + type: 'string', + optional: false, nullable: true, + }, + disableRegistration: { + type: 'boolean', + optional: false, nullable: false, + }, + cacheRemoteFiles: { + type: 'boolean', + optional: false, nullable: false, + }, + cacheRemoteSensitiveFiles: { + type: 'boolean', + optional: false, nullable: false, + }, + emailRequiredForSignup: { + type: 'boolean', + optional: false, nullable: false, + }, + enableHcaptcha: { + type: 'boolean', + optional: false, nullable: false, + }, + hcaptchaSiteKey: { + type: 'string', + optional: false, nullable: true, + }, + enableRecaptcha: { + type: 'boolean', + optional: false, nullable: false, + }, + recaptchaSiteKey: { + type: 'string', + optional: false, nullable: true, + }, + enableTurnstile: { + type: 'boolean', + optional: false, nullable: false, + }, + turnstileSiteKey: { + type: 'string', + optional: false, nullable: true, + }, + swPublickey: { + type: 'string', + optional: false, nullable: true, + }, + mascotImageUrl: { + type: 'string', + optional: false, nullable: false, + default: '/assets/ai.png', + }, + bannerUrl: { + type: 'string', + optional: false, nullable: false, + }, + serverErrorImageUrl: { + type: 'string', + optional: false, nullable: true, + }, + infoImageUrl: { + type: 'string', + optional: false, nullable: true, + }, + notFoundImageUrl: { + type: 'string', + optional: false, nullable: true, + }, + iconUrl: { + type: 'string', + optional: false, nullable: true, + }, + maxNoteTextLength: { + type: 'number', + optional: false, nullable: false, + }, + ads: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'object', + optional: false, nullable: false, + properties: { + id: { + type: 'string', + optional: false, nullable: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + url: { + type: 'string', + optional: false, nullable: false, + format: 'url', + }, + place: { + type: 'string', + optional: false, nullable: false, + }, + ratio: { + type: 'number', + optional: false, nullable: false, + }, + imageUrl: { + type: 'string', + optional: false, nullable: false, + format: 'url', + }, + dayOfWeek: { + type: 'integer', + optional: false, nullable: false, + }, + }, + }, + }, + notesPerOneAd: { + type: 'number', + optional: false, nullable: false, + default: 0, + }, + requireSetup: { + type: 'boolean', + optional: false, nullable: false, + example: false, + }, + enableEmail: { + type: 'boolean', + optional: false, nullable: false, + }, + enableServiceWorker: { + type: 'boolean', + optional: false, nullable: false, + }, + translatorAvailable: { + type: 'boolean', + optional: false, nullable: false, + }, + proxyAccountName: { + type: 'string', + optional: false, nullable: true, + }, + mediaProxy: { + type: 'string', + optional: false, nullable: false, + }, + features: { + type: 'object', + optional: true, nullable: false, + properties: { + registration: { + type: 'boolean', + optional: false, nullable: false, + }, + localTimeline: { + type: 'boolean', + optional: false, nullable: false, + }, + globalTimeline: { + type: 'boolean', + optional: false, nullable: false, + }, + hcaptcha: { + type: 'boolean', + optional: false, nullable: false, + }, + recaptcha: { + type: 'boolean', + optional: false, nullable: false, + }, + objectStorage: { + type: 'boolean', + optional: false, nullable: false, + }, + serviceWorker: { + type: 'boolean', + optional: false, nullable: false, + }, + miauth: { + type: 'boolean', + optional: true, nullable: false, + default: true, + }, + }, + }, + backgroundImageUrl: { + type: 'string', + optional: false, nullable: true, + }, + impressumUrl: { + type: 'string', + optional: false, nullable: true, + }, + logoImageUrl: { + type: 'string', + optional: false, nullable: true, + }, + privacyPolicyUrl: { + type: 'string', + optional: false, nullable: true, + }, + serverRules: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'string', + }, + }, + themeColor: { + type: 'string', + optional: false, nullable: true, + }, + }, }, } as const; @@ -32,10 +306,115 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - private metaEntityService: MetaEntityService, + @Inject(DI.config) + private config: Config, + + @Inject(DI.usersRepository) + private usersRepository: UsersRepository, + + @Inject(DI.adsRepository) + private adsRepository: AdsRepository, + + private userEntityService: UserEntityService, + private metaService: MetaService, ) { super(meta, paramDef, async (ps, me) => { - return ps.detail ? await this.metaEntityService.packDetailed() : await this.metaEntityService.pack(); + const instance = await this.metaService.fetch(true); + + const ads = await this.adsRepository.createQueryBuilder('ads') + .where('ads.expiresAt > :now', { now: new Date() }) + .andWhere('ads.startsAt <= :now', { now: new Date() }) + .andWhere(new Brackets(qb => { + // 曜日のビットフラグを確認する + qb.where('ads.dayOfWeek & :dayOfWeek > 0', { dayOfWeek: 1 << new Date().getDay() }) + .orWhere('ads.dayOfWeek = 0'); + })) + .getMany(); + + const response: any = { + maintainerName: instance.maintainerName, + maintainerEmail: instance.maintainerEmail, + + version: this.config.version, + + name: instance.name, + shortName: instance.shortName, + uri: this.config.url, + description: instance.description, + langs: instance.langs, + tosUrl: instance.termsOfServiceUrl, + repositoryUrl: instance.repositoryUrl, + feedbackUrl: instance.feedbackUrl, + impressumUrl: instance.impressumUrl, + privacyPolicyUrl: instance.privacyPolicyUrl, + disableRegistration: instance.disableRegistration, + emailRequiredForSignup: instance.emailRequiredForSignup, + enableHcaptcha: instance.enableHcaptcha, + hcaptchaSiteKey: instance.hcaptchaSiteKey, + enableRecaptcha: instance.enableRecaptcha, + recaptchaSiteKey: instance.recaptchaSiteKey, + enableTurnstile: instance.enableTurnstile, + turnstileSiteKey: instance.turnstileSiteKey, + swPublickey: instance.swPublicKey, + themeColor: instance.themeColor, + mascotImageUrl: instance.mascotImageUrl, + bannerUrl: instance.bannerUrl, + infoImageUrl: instance.infoImageUrl, + serverErrorImageUrl: instance.serverErrorImageUrl, + notFoundImageUrl: instance.notFoundImageUrl, + iconUrl: instance.iconUrl, + backgroundImageUrl: instance.backgroundImageUrl, + logoImageUrl: instance.logoImageUrl, + maxNoteTextLength: MAX_NOTE_TEXT_LENGTH, + // クライアントの手間を減らすためあらかじめJSONに変換しておく + defaultLightTheme: instance.defaultLightTheme ? JSON.stringify(JSON5.parse(instance.defaultLightTheme)) : null, + defaultDarkTheme: instance.defaultDarkTheme ? JSON.stringify(JSON5.parse(instance.defaultDarkTheme)) : null, + ads: ads.map(ad => ({ + id: ad.id, + url: ad.url, + place: ad.place, + ratio: ad.ratio, + imageUrl: ad.imageUrl, + dayOfWeek: ad.dayOfWeek, + })), + notesPerOneAd: instance.notesPerOneAd, + enableEmail: instance.enableEmail, + enableServiceWorker: instance.enableServiceWorker, + + translatorAvailable: instance.deeplAuthKey != null, + + serverRules: instance.serverRules, + + policies: { ...DEFAULT_POLICIES, ...instance.policies }, + + mediaProxy: this.config.mediaProxy, + + ...(ps.detail ? { + cacheRemoteFiles: instance.cacheRemoteFiles, + cacheRemoteSensitiveFiles: instance.cacheRemoteSensitiveFiles, + requireSetup: (await this.usersRepository.countBy({ + host: IsNull(), + })) === 0, + } : {}), + }; + + if (ps.detail) { + const proxyAccount = instance.proxyAccountId ? await this.userEntityService.pack(instance.proxyAccountId).catch(() => null) : null; + + response.proxyAccountName = proxyAccount ? proxyAccount.username : null; + response.features = { + registration: !instance.disableRegistration, + emailRequiredForSignup: instance.emailRequiredForSignup, + hcaptcha: instance.enableHcaptcha, + recaptcha: instance.enableRecaptcha, + turnstile: instance.enableTurnstile, + objectStorage: instance.useObjectStorage, + serviceWorker: instance.enableServiceWorker, + miauth: true, + }; + } + + return response; }); } } 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 fc9a8f3ebe..cac8f41f8e 100644 --- a/packages/backend/src/server/api/endpoints/miauth/gen-token.ts +++ b/packages/backend/src/server/api/endpoints/miauth/gen-token.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/mute/create.ts b/packages/backend/src/server/api/endpoints/mute/create.ts index e39c133b43..49c2b5707d 100644 --- a/packages/backend/src/server/api/endpoints/mute/create.ts +++ b/packages/backend/src/server/api/endpoints/mute/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -83,7 +83,7 @@ export default class extends Endpoint { // eslint- }); // Check if already muting - const exist = await this.mutingsRepository.exists({ + const exist = await this.mutingsRepository.exist({ where: { muterId: muter.id, muteeId: mutee.id, diff --git a/packages/backend/src/server/api/endpoints/mute/delete.ts b/packages/backend/src/server/api/endpoints/mute/delete.ts index d11832858e..a3fd2dd82f 100644 --- a/packages/backend/src/server/api/endpoints/mute/delete.ts +++ b/packages/backend/src/server/api/endpoints/mute/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/mute/list.ts b/packages/backend/src/server/api/endpoints/mute/list.ts index 23204f2829..2a41182ebc 100644 --- a/packages/backend/src/server/api/endpoints/mute/list.ts +++ b/packages/backend/src/server/api/endpoints/mute/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/my/apps.ts b/packages/backend/src/server/api/endpoints/my/apps.ts index c04a92626f..1b70b85b07 100644 --- a/packages/backend/src/server/api/endpoints/my/apps.ts +++ b/packages/backend/src/server/api/endpoints/my/apps.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/notes.ts b/packages/backend/src/server/api/endpoints/notes.ts index 9938322a2a..95ba5e8b64 100644 --- a/packages/backend/src/server/api/endpoints/notes.ts +++ b/packages/backend/src/server/api/endpoints/notes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/notes/children.ts b/packages/backend/src/server/api/endpoints/notes/children.ts index 0c6533d336..1e569d9806 100644 --- a/packages/backend/src/server/api/endpoints/notes/children.ts +++ b/packages/backend/src/server/api/endpoints/notes/children.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/notes/clips.ts b/packages/backend/src/server/api/endpoints/notes/clips.ts index 29cab9f212..677c0ea307 100644 --- a/packages/backend/src/server/api/endpoints/notes/clips.ts +++ b/packages/backend/src/server/api/endpoints/notes/clips.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/notes/conversation.ts b/packages/backend/src/server/api/endpoints/notes/conversation.ts index d13fd5e82e..b94a019da4 100644 --- a/packages/backend/src/server/api/endpoints/notes/conversation.ts +++ b/packages/backend/src/server/api/endpoints/notes/conversation.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/notes/create.test.ts b/packages/backend/src/server/api/endpoints/notes/create.test.ts index 6097f9c562..6086f99c92 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.test.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.test.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -34,10 +34,11 @@ describe('api:notes/create', () => { .toBe(VALID); }); - test('null post', () => { - expect(v({ text: null })) - .toBe(INVALID); - }); + // TODO + //test('null post', () => { + // expect(v({ text: null })) + // .toBe(INVALID); + //}); test('0 characters post', () => { expect(v({ text: '' })) @@ -48,11 +49,6 @@ describe('api:notes/create', () => { expect(v({ text: await tooLong })) .toBe(INVALID); }); - - test('whitespace-only post', () => { - expect(v({ text: ' ' })) - .toBe(INVALID); - }); }); describe('cw', () => { diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index 253a360815..c5d42dabe4 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -16,8 +16,7 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { NoteCreateService } from '@/core/NoteCreateService.js'; import { DI } from '@/di-symbols.js'; -import { isQuote, isRenote } from '@/misc/is-renote.js'; -import { IdentifiableError } from '@/misc/identifiable-error.js'; +import { isPureRenote } from '@/misc/is-pure-renote.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -83,12 +82,6 @@ export const meta = { id: '3ac74a84-8fd5-4bb0-870f-01804f82ce15', }, - cannotReplyToSpecifiedVisibilityNoteWithExtendedVisibility: { - message: 'You cannot reply to a specified visibility note with extended visibility.', - code: 'CANNOT_REPLY_TO_SPECIFIED_VISIBILITY_NOTE_WITH_EXTENDED_VISIBILITY', - id: 'ed940410-535c-4d5e-bfa3-af798671e93c', - }, - cannotCreateAlreadyExpiredPoll: { message: 'Poll is already expired.', code: 'CANNOT_CREATE_ALREADY_EXPIRED_POLL', @@ -118,18 +111,6 @@ export const meta = { code: 'CANNOT_RENOTE_OUTSIDE_OF_CHANNEL', id: '33510210-8452-094c-6227-4a6c05d99f00', }, - - containsProhibitedWords: { - message: 'Cannot post because it contains prohibited words.', - code: 'CONTAINS_PROHIBITED_WORDS', - id: 'aa6e01d3-a85c-669d-758a-76aab43af334', - }, - - containsTooManyMentions: { - message: 'Cannot post because it exceeds the allowed number of mentions.', - code: 'CONTAINS_TOO_MANY_MENTIONS', - id: '4de0363a-3046-481b-9b0f-feff3e211025', - }, }, } as const; @@ -191,33 +172,13 @@ export const paramDef = { }, }, // (re)note with text, files and poll are optional - if: { - properties: { - renoteId: { - type: 'null', - }, - fileIds: { - type: 'null', - }, - mediaIds: { - type: 'null', - }, - poll: { - type: 'null', - }, - }, - }, - then: { - properties: { - text: { - type: 'string', - minLength: 1, - maxLength: MAX_NOTE_TEXT_LENGTH, - pattern: '[^\\s]+', - }, - }, - required: ['text'], - }, + anyOf: [ + { required: ['text'] }, + { required: ['renoteId'] }, + { required: ['fileIds'] }, + { required: ['mediaIds'] }, + { required: ['poll'] }, + ], } as const; @Injectable() @@ -273,13 +234,13 @@ export default class extends Endpoint { // eslint- if (renote == null) { throw new ApiError(meta.errors.noSuchRenoteTarget); - } else if (isRenote(renote) && !isQuote(renote)) { + } else if (isPureRenote(renote)) { throw new ApiError(meta.errors.cannotReRenote); } // Check blocking if (renote.userId !== me.id) { - const blockExist = await this.blockingsRepository.exists({ + const blockExist = await this.blockingsRepository.exist({ where: { blockerId: renote.userId, blockeeId: me.id, @@ -319,17 +280,15 @@ export default class extends Endpoint { // eslint- if (reply == null) { throw new ApiError(meta.errors.noSuchReplyTarget); - } else if (isRenote(reply) && !isQuote(reply)) { + } else if (isPureRenote(reply)) { throw new ApiError(meta.errors.cannotReplyToPureRenote); } else if (!await this.noteEntityService.isVisibleForMe(reply, me.id)) { throw new ApiError(meta.errors.cannotReplyToInvisibleNote); - } else if (reply.visibility === 'specified' && ps.visibility !== 'specified') { - throw new ApiError(meta.errors.cannotReplyToSpecifiedVisibilityNoteWithExtendedVisibility); } // Check blocking if (reply.userId !== me.id) { - const blockExist = await this.blockingsRepository.exists({ + const blockExist = await this.blockingsRepository.exist({ where: { blockerId: reply.userId, blockeeId: me.id, @@ -361,43 +320,31 @@ export default class extends Endpoint { // eslint- } // 投稿を作成 - try { - const note = await this.noteCreateService.create(me, { - createdAt: new Date(), - files: files, - poll: ps.poll ? { - choices: ps.poll.choices, - multiple: ps.poll.multiple ?? false, - expiresAt: ps.poll.expiresAt ? new Date(ps.poll.expiresAt) : null, - } : undefined, - text: ps.text ?? undefined, - reply, - renote, - cw: ps.cw, - localOnly: ps.localOnly, - reactionAcceptance: ps.reactionAcceptance, - visibility: ps.visibility, - visibleUsers, - channel, - apMentions: ps.noExtractMentions ? [] : undefined, - apHashtags: ps.noExtractHashtags ? [] : undefined, - apEmojis: ps.noExtractEmojis ? [] : undefined, - }); + const note = await this.noteCreateService.create(me, { + createdAt: new Date(), + files: files, + poll: ps.poll ? { + choices: ps.poll.choices, + multiple: ps.poll.multiple ?? false, + expiresAt: ps.poll.expiresAt ? new Date(ps.poll.expiresAt) : null, + } : undefined, + text: ps.text ?? undefined, + reply, + renote, + cw: ps.cw, + localOnly: ps.localOnly, + reactionAcceptance: ps.reactionAcceptance, + visibility: ps.visibility, + visibleUsers, + channel, + apMentions: ps.noExtractMentions ? [] : undefined, + apHashtags: ps.noExtractHashtags ? [] : undefined, + apEmojis: ps.noExtractEmojis ? [] : undefined, + }); - return { - createdNote: await this.noteEntityService.pack(note, me), - }; - } catch (e) { - // TODO: 他のErrorもここでキャッチしてエラーメッセージを当てるようにしたい - if (e instanceof IdentifiableError) { - if (e.id === '689ee33f-f97c-479a-ac49-1b9f8140af99') { - throw new ApiError(meta.errors.containsProhibitedWords); - } else if (e.id === '9f466dab-c856-48cd-9e65-ff90ff750580') { - throw new ApiError(meta.errors.containsTooManyMentions); - } - } - throw e; - } + return { + createdNote: await this.noteEntityService.pack(note, me), + }; }); } } diff --git a/packages/backend/src/server/api/endpoints/notes/delete.ts b/packages/backend/src/server/api/endpoints/notes/delete.ts index 9d7c9a9081..55aaaf4f78 100644 --- a/packages/backend/src/server/api/endpoints/notes/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 804071b3d4..ed3dce7f35 100644 --- a/packages/backend/src/server/api/endpoints/notes/favorites/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/favorites/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -67,7 +67,7 @@ export default class extends Endpoint { // eslint- }); // if already favorited - const exist = await this.noteFavoritesRepository.exists({ + const exist = await this.noteFavoritesRepository.exist({ where: { noteId: note.id, userId: me.id, 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 2036facdba..8ab9775a2c 100644 --- a/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/notes/featured.ts b/packages/backend/src/server/api/endpoints/notes/featured.ts index dcd971360d..31b8d1ad2d 100644 --- a/packages/backend/src/server/api/endpoints/notes/featured.ts +++ b/packages/backend/src/server/api/endpoints/notes/featured.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 258a0bfb8f..68fefa5b58 100644 --- a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 aed9065bf9..01adfec7d3 100644 --- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -1,11 +1,11 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository, ChannelFollowingsRepository, MiMeta } from '@/models/_.js'; +import type { NotesRepository, ChannelFollowingsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import ActiveUsersChart from '@/core/chart/charts/active-users.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; @@ -16,6 +16,7 @@ import { CacheService } from '@/core/CacheService.js'; import { FanoutTimelineName } from '@/core/FanoutTimelineService.js'; import { QueryService } from '@/core/QueryService.js'; import { UserFollowingService } from '@/core/UserFollowingService.js'; +import { MetaService } from '@/core/MetaService.js'; import { MiLocalUser } from '@/models/User.js'; import { FanoutTimelineEndpointService } from '@/core/FanoutTimelineEndpointService.js'; import { ApiError } from '../../error.js'; @@ -73,9 +74,6 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, - @Inject(DI.notesRepository) private notesRepository: NotesRepository, @@ -89,6 +87,7 @@ export default class extends Endpoint { // eslint- private cacheService: CacheService, private queryService: QueryService, private userFollowingService: UserFollowingService, + private metaService: MetaService, private fanoutTimelineEndpointService: FanoutTimelineEndpointService, ) { super(meta, paramDef, async (ps, me) => { @@ -102,7 +101,9 @@ export default class extends Endpoint { // eslint- if (ps.withReplies && ps.withFiles) throw new ApiError(meta.errors.bothWithRepliesAndWithFiles); - if (!this.serverSettings.enableFanoutTimeline) { + const serverSettings = await this.metaService.fetch(); + + if (!serverSettings.enableFanoutTimeline) { const timeline = await this.getFromDb({ untilId, sinceId, @@ -138,16 +139,9 @@ export default class extends Endpoint { // eslint- timelineConfig = [ `homeTimeline:${me.id}`, 'localTimeline', - `localTimelineWithReplyTo:${me.id}`, ]; } - const [ - followings, - ] = await Promise.all([ - this.cacheService.userFollowingsCache.fetch(me.id), - ]); - const redisTimeline = await this.fanoutTimelineEndpointService.timeline({ untilId, sinceId, @@ -155,16 +149,9 @@ export default class extends Endpoint { // eslint- allowPartial: ps.allowPartial, me, redisTimelines: timelineConfig, - useDbFallback: this.serverSettings.enableFanoutTimelineDbFallback, + useDbFallback: serverSettings.enableFanoutTimelineDbFallback, alwaysIncludeMyNotes: true, excludePureRenotes: !ps.withRenotes, - noteFilter: note => { - if (note.reply && note.reply.visibility === 'followers') { - if (!Object.hasOwn(followings, note.reply.userId) && note.reply.userId !== me.id) return false; - } - - return true; - }, dbFallback: async (untilId, sinceId, limit) => await this.getFromDb({ untilId, sinceId, 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 0b48f2c78b..3fd4dc83fb 100644 --- a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts @@ -1,18 +1,20 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { MiMeta, NotesRepository } from '@/models/_.js'; +import type { NotesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import ActiveUsersChart from '@/core/chart/charts/active-users.js'; import { DI } from '@/di-symbols.js'; import { RoleService } from '@/core/RoleService.js'; import { IdService } from '@/core/IdService.js'; +import { CacheService } from '@/core/CacheService.js'; import { QueryService } from '@/core/QueryService.js'; +import { MetaService } from '@/core/MetaService.js'; import { MiLocalUser } from '@/models/User.js'; import { FanoutTimelineEndpointService } from '@/core/FanoutTimelineEndpointService.js'; import { ApiError } from '../../error.js'; @@ -64,9 +66,6 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, - @Inject(DI.notesRepository) private notesRepository: NotesRepository, @@ -74,8 +73,10 @@ export default class extends Endpoint { // eslint- private roleService: RoleService, private activeUsersChart: ActiveUsersChart, private idService: IdService, + private cacheService: CacheService, private fanoutTimelineEndpointService: FanoutTimelineEndpointService, private queryService: QueryService, + private metaService: MetaService, ) { super(meta, paramDef, async (ps, me) => { const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null); @@ -88,7 +89,9 @@ export default class extends Endpoint { // eslint- if (ps.withReplies && ps.withFiles) throw new ApiError(meta.errors.bothWithRepliesAndWithFiles); - if (!this.serverSettings.enableFanoutTimeline) { + const serverSettings = await this.metaService.fetch(); + + if (!serverSettings.enableFanoutTimeline) { const timeline = await this.getFromDb({ untilId, sinceId, @@ -112,7 +115,7 @@ export default class extends Endpoint { // eslint- limit: ps.limit, allowPartial: ps.allowPartial, me, - useDbFallback: this.serverSettings.enableFanoutTimelineDbFallback, + useDbFallback: serverSettings.enableFanoutTimelineDbFallback, redisTimelines: ps.withFiles ? ['localTimelineWithFiles'] : ps.withReplies ? ['localTimeline', 'localTimelineWithReplies'] diff --git a/packages/backend/src/server/api/endpoints/notes/mentions.ts b/packages/backend/src/server/api/endpoints/notes/mentions.ts index 5558dd3a8b..2317f8f7b2 100644 --- a/packages/backend/src/server/api/endpoints/notes/mentions.ts +++ b/packages/backend/src/server/api/endpoints/notes/mentions.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -61,9 +61,9 @@ export default class extends Endpoint { // eslint- const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId) .andWhere(new Brackets(qb => { - qb // このmeIdAsListパラメータはqueryServiceのgenerateVisibilityQueryでセットされる - .where(':meIdAsList <@ note.mentions') - .orWhere(':meIdAsList <@ note.visibleUserIds'); + qb + .where(`'{"${me.id}"}' <@ note.mentions`) + .orWhere(`'{"${me.id}"}' <@ note.visibleUserIds`); })) // Avoid scanning primary key index .orderBy('CONCAT(note.id)', 'DESC') 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 4fd6f8682d..90af29a695 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -32,7 +32,6 @@ export const paramDef = { properties: { limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, offset: { type: 'integer', default: 0 }, - excludeChannels: { type: 'boolean', default: false }, }, required: [], } as const; @@ -87,12 +86,6 @@ export default class extends Endpoint { // eslint- query.setParameters(mutingQuery.getParameters()); //#endregion - //#region exclude channels - if (ps.excludeChannels) { - query.andWhere('poll.channelId IS NULL'); - } - //#endregion - const polls = await query .orderBy('poll.noteId', 'DESC') .limit(ps.limit) 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 f33f49075b..734c3f0e63 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/vote.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/vote.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -144,12 +144,12 @@ export default class extends Endpoint { // eslint- } // Create vote - const vote = await this.pollVotesRepository.insertOne({ + const vote = await this.pollVotesRepository.insert({ id: this.idService.gen(createdAt.getTime()), noteId: note.id, userId: me.id, choice: ps.choice, - }); + }).then(x => this.pollVotesRepository.findOneByOrFail(x.identifiers[0])); // Increment votes count const index = ps.choice + 1; // In SQL, array index is 1 based diff --git a/packages/backend/src/server/api/endpoints/notes/reactions.ts b/packages/backend/src/server/api/endpoints/notes/reactions.ts index 97b12ab7f7..a2c1778199 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -76,7 +76,7 @@ export default class extends Endpoint { // eslint- const reactions = await query.limit(ps.limit).getMany(); - return await this.noteReactionEntityService.packMany(reactions, me); + return await Promise.all(reactions.map(reaction => this.noteReactionEntityService.pack(reaction, 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 0f0dcca605..ff22ef1322 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -36,12 +36,6 @@ export const meta = { code: 'YOU_HAVE_BEEN_BLOCKED', id: '20ef5475-9f38-4e4c-bd33-de6d979498ec', }, - - cannotReactToRenote: { - message: 'You cannot react to Renote.', - code: 'CANNOT_REACT_TO_RENOTE', - id: 'eaccdc08-ddef-43fe-908f-d108faad57f5', - }, }, } as const; @@ -68,7 +62,6 @@ export default class extends Endpoint { // eslint- await this.reactionService.create(me, note, ps.reaction).catch(err => { if (err.id === '51c42bb4-931a-456b-bff7-e5a8a70dd298') throw new ApiError(meta.errors.alreadyReacted); if (err.id === 'e70412a4-7197-4726-8e74-f3e0deb92aa7') throw new ApiError(meta.errors.youHaveBeenBlocked); - if (err.id === '12c35529-3c79-4327-b1cc-e2cf63a71925') throw new ApiError(meta.errors.cannotReactToRenote); throw err; }); return; 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 e6c3bbbcf5..b43ab044fa 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/notes/renotes.ts b/packages/backend/src/server/api/endpoints/notes/renotes.ts index ffe1ee6eb8..9f16181a30 100644 --- a/packages/backend/src/server/api/endpoints/notes/renotes.ts +++ b/packages/backend/src/server/api/endpoints/notes/renotes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/notes/replies.ts b/packages/backend/src/server/api/endpoints/notes/replies.ts index 5f32332a6a..70142c9818 100644 --- a/packages/backend/src/server/api/endpoints/notes/replies.ts +++ b/packages/backend/src/server/api/endpoints/notes/replies.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 626ff080c7..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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -87,14 +87,14 @@ export default class extends Endpoint { // eslint- try { if (ps.tag) { if (!safeForSql(normalizeForSearch(ps.tag))) throw new Error('Injection'); - query.andWhere(':tag <@ note.tags', { tag: [normalizeForSearch(ps.tag)] }); + query.andWhere(`'{"${normalizeForSearch(ps.tag)}"}' <@ note.tags`); } else { query.andWhere(new Brackets(qb => { for (const tags of ps.query!) { qb.orWhere(new Brackets(qb => { for (const tag of tags) { if (!safeForSql(normalizeForSearch(tag))) throw new Error('Injection'); - qb.andWhere(':tag <@ note.tags', { tag: [normalizeForSearch(tag)] }); + qb.andWhere(`'{"${normalizeForSearch(tag)}"}' <@ note.tags`); } })); } diff --git a/packages/backend/src/server/api/endpoints/notes/search.ts b/packages/backend/src/server/api/endpoints/notes/search.ts index 3fe19806e3..4425d4593c 100644 --- a/packages/backend/src/server/api/endpoints/notes/search.ts +++ b/packages/backend/src/server/api/endpoints/notes/search.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/notes/show.ts b/packages/backend/src/server/api/endpoints/notes/show.ts index 11839bce36..5bb8196543 100644 --- a/packages/backend/src/server/api/endpoints/notes/show.ts +++ b/packages/backend/src/server/api/endpoints/notes/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -26,12 +26,6 @@ export const meta = { code: 'NO_SUCH_NOTE', id: '24fcbfc6-2e37-42b6-8388-c29b3861a08d', }, - - signinRequired: { - message: 'Signin required.', - code: 'SIGNIN_REQUIRED', - id: '8e75455b-738c-471d-9f80-62693f33372e', - }, }, } as const; @@ -50,15 +44,11 @@ export default class extends Endpoint { // eslint- private getterService: GetterService, ) { super(meta, paramDef, async (ps, me) => { - const note = await this.getterService.getNoteWithUser(ps.noteId).catch(err => { + 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; }); - if (note.user!.requireSigninToViewContents && me == null) { - throw new ApiError(meta.errors.signinRequired); - } - return await this.noteEntityService.pack(note, me, { detail: true, }); diff --git a/packages/backend/src/server/api/endpoints/notes/state.ts b/packages/backend/src/server/api/endpoints/notes/state.ts index 4c1eb86542..20faea566d 100644 --- a/packages/backend/src/server/api/endpoints/notes/state.ts +++ b/packages/backend/src/server/api/endpoints/notes/state.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 732d644a29..b2cdaa00ac 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 d94d6cd652..d3f1787ee4 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index 7cb11cc1eb..e90d6ec198 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -1,11 +1,11 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { NotesRepository, ChannelFollowingsRepository, MiMeta } from '@/models/_.js'; +import type { NotesRepository, ChannelFollowingsRepository } 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'; @@ -15,6 +15,7 @@ import { IdService } from '@/core/IdService.js'; import { CacheService } from '@/core/CacheService.js'; import { UserFollowingService } from '@/core/UserFollowingService.js'; import { MiLocalUser } from '@/models/User.js'; +import { MetaService } from '@/core/MetaService.js'; import { FanoutTimelineEndpointService } from '@/core/FanoutTimelineEndpointService.js'; export const meta = { @@ -55,9 +56,6 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, - @Inject(DI.notesRepository) private notesRepository: NotesRepository, @@ -71,12 +69,15 @@ export default class extends Endpoint { // eslint- private fanoutTimelineEndpointService: FanoutTimelineEndpointService, private userFollowingService: UserFollowingService, private queryService: QueryService, + private metaService: MetaService, ) { super(meta, paramDef, async (ps, me) => { const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null); const sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : null); - if (!this.serverSettings.enableFanoutTimeline) { + const serverSettings = await this.metaService.fetch(); + + if (!serverSettings.enableFanoutTimeline) { const timeline = await this.getFromDb({ untilId, sinceId, @@ -107,13 +108,13 @@ export default class extends Endpoint { // eslint- limit: ps.limit, allowPartial: ps.allowPartial, me, - useDbFallback: this.serverSettings.enableFanoutTimelineDbFallback, + useDbFallback: serverSettings.enableFanoutTimelineDbFallback, redisTimelines: ps.withFiles ? [`homeTimelineWithFiles:${me.id}`] : [`homeTimeline:${me.id}`], alwaysIncludeMyNotes: true, excludePureRenotes: !ps.withRenotes, noteFilter: note => { if (note.reply && note.reply.visibility === 'followers') { - if (!Object.hasOwn(followings, note.reply.userId) && note.reply.userId !== me.id) return false; + if (!Object.hasOwn(followings, note.reply.userId)) return false; } return true; diff --git a/packages/backend/src/server/api/endpoints/notes/translate.ts b/packages/backend/src/server/api/endpoints/notes/translate.ts index e9a6a36b02..698c37b616 100644 --- a/packages/backend/src/server/api/endpoints/notes/translate.ts +++ b/packages/backend/src/server/api/endpoints/notes/translate.ts @@ -1,18 +1,17 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { URLSearchParams } from 'node:url'; -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; +import { MetaService } from '@/core/MetaService.js'; import { HttpRequestService } from '@/core/HttpRequestService.js'; import { GetterService } from '@/server/api/GetterService.js'; import { RoleService } from '@/core/RoleService.js'; import { ApiError } from '../../error.js'; -import { MiMeta } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; export const meta = { tags: ['notes'], @@ -22,7 +21,7 @@ export const meta = { res: { type: 'object', - optional: true, nullable: false, + optional: false, nullable: false, properties: { sourceLang: { type: 'string' }, text: { type: 'string' }, @@ -40,11 +39,6 @@ export const meta = { code: 'NO_SUCH_NOTE', id: 'bea9b03f-36e0-49c5-a4db-627a029f8971', }, - cannotTranslateInvisibleNote: { - message: 'Cannot translate invisible note.', - code: 'CANNOT_TRANSLATE_INVISIBLE_NOTE', - id: 'ea29f2ca-c368-43b3-aaf1-5ac3e74bbe5d', - }, }, } as const; @@ -60,11 +54,9 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, - private noteEntityService: NoteEntityService, private getterService: GetterService, + private metaService: MetaService, private httpRequestService: HttpRequestService, private roleService: RoleService, ) { @@ -80,26 +72,28 @@ export default class extends Endpoint { // eslint- }); if (!(await this.noteEntityService.isVisibleForMe(note, me.id))) { - throw new ApiError(meta.errors.cannotTranslateInvisibleNote); + return 204; // TODO: 良い感じのエラー返す } if (note.text == null) { - return; + return 204; } - if (this.serverSettings.deeplAuthKey == null) { - throw new ApiError(meta.errors.unavailable); + const instance = await this.metaService.fetch(); + + if (instance.deeplAuthKey == null) { + return 204; // TODO: 良い感じのエラー返す } let targetLang = ps.targetLang; if (targetLang.includes('-')) targetLang = targetLang.split('-')[0]; const params = new URLSearchParams(); - params.append('auth_key', this.serverSettings.deeplAuthKey); + params.append('auth_key', instance.deeplAuthKey); params.append('text', note.text); params.append('target_lang', targetLang); - const endpoint = this.serverSettings.deeplIsPro ? 'https://api.deepl.com/v2/translate' : 'https://api-free.deepl.com/v2/translate'; + const endpoint = instance.deeplIsPro ? 'https://api.deepl.com/v2/translate' : 'https://api-free.deepl.com/v2/translate'; const res = await this.httpRequestService.send(endpoint, { method: 'POST', diff --git a/packages/backend/src/server/api/endpoints/notes/unrenote.ts b/packages/backend/src/server/api/endpoints/notes/unrenote.ts index 73e70cfde4..f67e9365fc 100644 --- a/packages/backend/src/server/api/endpoints/notes/unrenote.ts +++ b/packages/backend/src/server/api/endpoints/notes/unrenote.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 87f9b322a6..71c2b8054e 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 @@ -1,18 +1,20 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; import { Brackets } from 'typeorm'; -import type { MiMeta, MiUserList, NotesRepository, UserListMembershipsRepository, UserListsRepository } from '@/models/_.js'; +import type { MiUserList, NotesRepository, UserListMembershipsRepository, UserListsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import ActiveUsersChart from '@/core/chart/charts/active-users.js'; import { DI } from '@/di-symbols.js'; +import { CacheService } from '@/core/CacheService.js'; import { IdService } from '@/core/IdService.js'; import { QueryService } from '@/core/QueryService.js'; import { MiLocalUser } from '@/models/User.js'; +import { MetaService } from '@/core/MetaService.js'; import { FanoutTimelineEndpointService } from '@/core/FanoutTimelineEndpointService.js'; import { ApiError } from '../../error.js'; @@ -67,9 +69,6 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, - @Inject(DI.notesRepository) private notesRepository: NotesRepository, @@ -81,9 +80,11 @@ export default class extends Endpoint { // eslint- private noteEntityService: NoteEntityService, private activeUsersChart: ActiveUsersChart, + private cacheService: CacheService, private idService: IdService, private fanoutTimelineEndpointService: FanoutTimelineEndpointService, private queryService: QueryService, + private metaService: MetaService, ) { super(meta, paramDef, async (ps, me) => { const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null); @@ -98,7 +99,9 @@ export default class extends Endpoint { // eslint- throw new ApiError(meta.errors.noSuchList); } - if (!this.serverSettings.enableFanoutTimeline) { + const serverSettings = await this.metaService.fetch(); + + if (!serverSettings.enableFanoutTimeline) { const timeline = await this.getFromDb(list, { untilId, sinceId, @@ -112,7 +115,7 @@ export default class extends Endpoint { // eslint- this.activeUsersChart.read(me); - return await this.noteEntityService.packMany(timeline, me); + await this.noteEntityService.packMany(timeline, me); } const timeline = await this.fanoutTimelineEndpointService.timeline({ @@ -121,7 +124,7 @@ export default class extends Endpoint { // eslint- limit: ps.limit, allowPartial: ps.allowPartial, me, - useDbFallback: this.serverSettings.enableFanoutTimelineDbFallback, + useDbFallback: serverSettings.enableFanoutTimelineDbFallback, redisTimelines: ps.withFiles ? [`userListTimelineWithFiles:${list.id}`] : [`userListTimeline:${list.id}`], alwaysIncludeMyNotes: true, excludePureRenotes: !ps.withRenotes, diff --git a/packages/backend/src/server/api/endpoints/notifications/create.ts b/packages/backend/src/server/api/endpoints/notifications/create.ts index 7671b58e6b..7c6a979160 100644 --- a/packages/backend/src/server/api/endpoints/notifications/create.ts +++ b/packages/backend/src/server/api/endpoints/notifications/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/notifications/flush.ts b/packages/backend/src/server/api/endpoints/notifications/flush.ts deleted file mode 100644 index 47c0642fd1..0000000000 --- a/packages/backend/src/server/api/endpoints/notifications/flush.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * 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', 'account'], - - requireCredential: true, - - kind: 'write:notifications', -} 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, me) => { - this.notificationService.flushAllNotifications(me.id); - }); - } -} 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 6565125c00..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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/notifications/test-notification.ts b/packages/backend/src/server/api/endpoints/notifications/test-notification.ts index 50b850a519..8f5f8485c3 100644 --- a/packages/backend/src/server/api/endpoints/notifications/test-notification.ts +++ b/packages/backend/src/server/api/endpoints/notifications/test-notification.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/page-push.ts b/packages/backend/src/server/api/endpoints/page-push.ts index ce454ab24a..0a68516586 100644 --- a/packages/backend/src/server/api/endpoints/page-push.ts +++ b/packages/backend/src/server/api/endpoints/page-push.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -55,7 +55,7 @@ export default class extends Endpoint { // eslint- var: ps.var, userId: me.id, user: await this.userEntityService.pack(me.id, { id: page.userId }, { - schema: 'UserDetailed', + detail: true, }), }); }); diff --git a/packages/backend/src/server/api/endpoints/pages/create.ts b/packages/backend/src/server/api/endpoints/pages/create.ts index fa03b0b457..4c2ef516e5 100644 --- a/packages/backend/src/server/api/endpoints/pages/create.ts +++ b/packages/backend/src/server/api/endpoints/pages/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -102,7 +102,7 @@ export default class extends Endpoint { // eslint- } }); - const page = await this.pagesRepository.insertOne(new MiPage({ + const page = await this.pagesRepository.insert(new MiPage({ id: this.idService.gen(), updatedAt: new Date(), title: ps.title, @@ -117,7 +117,7 @@ export default class extends Endpoint { // eslint- alignCenter: ps.alignCenter, hideTitleWhenPinned: ps.hideTitleWhenPinned, font: ps.font, - })); + })).then(x => this.pagesRepository.findOneByOrFail(x.identifiers[0])); return await this.pageEntityService.pack(page); }); diff --git a/packages/backend/src/server/api/endpoints/pages/delete.ts b/packages/backend/src/server/api/endpoints/pages/delete.ts index f2bc946788..1291c0d209 100644 --- a/packages/backend/src/server/api/endpoints/pages/delete.ts +++ b/packages/backend/src/server/api/endpoints/pages/delete.ts @@ -1,14 +1,12 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; -import type { PagesRepository, UsersRepository } from '@/models/_.js'; +import type { PagesRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; -import { ModerationLogService } from '@/core/ModerationLogService.js'; -import { RoleService } from '@/core/RoleService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -46,35 +44,17 @@ export default class extends Endpoint { // eslint- constructor( @Inject(DI.pagesRepository) private pagesRepository: PagesRepository, - - @Inject(DI.usersRepository) - private usersRepository: UsersRepository, - - private moderationLogService: ModerationLogService, - private roleService: RoleService, ) { super(meta, paramDef, async (ps, me) => { const page = await this.pagesRepository.findOneBy({ id: ps.pageId }); - if (page == null) { throw new ApiError(meta.errors.noSuchPage); } - - if (!await this.roleService.isModerator(me) && page.userId !== me.id) { + if (page.userId !== me.id) { throw new ApiError(meta.errors.accessDenied); } await this.pagesRepository.delete(page.id); - - if (page.userId !== me.id) { - const user = await this.usersRepository.findOneByOrFail({ id: page.userId }); - this.moderationLogService.log(me, 'deletePage', { - pageId: page.id, - pageUserId: page.userId, - pageUserUsername: user.username, - page, - }); - } }); } } diff --git a/packages/backend/src/server/api/endpoints/pages/featured.ts b/packages/backend/src/server/api/endpoints/pages/featured.ts index a47b69e56e..1f43d6606c 100644 --- a/packages/backend/src/server/api/endpoints/pages/featured.ts +++ b/packages/backend/src/server/api/endpoints/pages/featured.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/pages/like.ts b/packages/backend/src/server/api/endpoints/pages/like.ts index 11eed693ad..8c18982b50 100644 --- a/packages/backend/src/server/api/endpoints/pages/like.ts +++ b/packages/backend/src/server/api/endpoints/pages/like.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -70,7 +70,7 @@ export default class extends Endpoint { // eslint- } // if already liked - const exist = await this.pageLikesRepository.exists({ + const exist = await this.pageLikesRepository.exist({ where: { pageId: page.id, userId: me.id, diff --git a/packages/backend/src/server/api/endpoints/pages/show.ts b/packages/backend/src/server/api/endpoints/pages/show.ts index e08b832a3f..efb0bd0677 100644 --- a/packages/backend/src/server/api/endpoints/pages/show.ts +++ b/packages/backend/src/server/api/endpoints/pages/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/pages/unlike.ts b/packages/backend/src/server/api/endpoints/pages/unlike.ts index 70c965e0ad..7a76cd7408 100644 --- a/packages/backend/src/server/api/endpoints/pages/unlike.ts +++ b/packages/backend/src/server/api/endpoints/pages/unlike.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/pages/update.ts b/packages/backend/src/server/api/endpoints/pages/update.ts index f11bbbcb1a..aaea1efa87 100644 --- a/packages/backend/src/server/api/endpoints/pages/update.ts +++ b/packages/backend/src/server/api/endpoints/pages/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -70,7 +70,7 @@ export const paramDef = { alignCenter: { type: 'boolean' }, hideTitleWhenPinned: { type: 'boolean' }, }, - required: ['pageId'], + required: ['pageId', 'title', 'name', 'content', 'variables', 'script'], } as const; @Injectable() @@ -91,8 +91,9 @@ export default class extends Endpoint { // eslint- throw new ApiError(meta.errors.accessDenied); } + let eyeCatchingImage = null; if (ps.eyeCatchingImageId != null) { - const eyeCatchingImage = await this.driveFilesRepository.findOneBy({ + eyeCatchingImage = await this.driveFilesRepository.findOneBy({ id: ps.eyeCatchingImageId, userId: me.id, }); @@ -115,15 +116,23 @@ export default class extends Endpoint { // eslint- await this.pagesRepository.update(page.id, { updatedAt: new Date(), title: ps.title, - name: ps.name, + // 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, - alignCenter: ps.alignCenter, - hideTitleWhenPinned: ps.hideTitleWhenPinned, - font: ps.font, - eyeCatchingImageId: ps.eyeCatchingImageId, + // 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 + : ps.eyeCatchingImageId === undefined + ? page.eyeCatchingImageId + : eyeCatchingImage!.id, }); }); } diff --git a/packages/backend/src/server/api/endpoints/ping.ts b/packages/backend/src/server/api/endpoints/ping.ts index e218a8f755..ee2fe48834 100644 --- a/packages/backend/src/server/api/endpoints/ping.ts +++ b/packages/backend/src/server/api/endpoints/ping.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/pinned-users.ts b/packages/backend/src/server/api/endpoints/pinned-users.ts index 5b0b656c63..390042c815 100644 --- a/packages/backend/src/server/api/endpoints/pinned-users.ts +++ b/packages/backend/src/server/api/endpoints/pinned-users.ts @@ -1,14 +1,15 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { MiMeta, UsersRepository } from '@/models/_.js'; +import type { UsersRepository } from '@/models/_.js'; import * as Acct from '@/misc/acct.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'; import { DI } from '@/di-symbols.js'; @@ -37,21 +38,21 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, + private metaService: MetaService, private userEntityService: UserEntityService, ) { super(meta, paramDef, async (ps, me) => { - const users = await Promise.all(this.serverSettings.pinnedUsers.map(acct => Acct.parse(acct)).map(acct => this.usersRepository.findOneBy({ + const meta = await this.metaService.fetch(); + + const users = await Promise.all(meta.pinnedUsers.map(acct => Acct.parse(acct)).map(acct => this.usersRepository.findOneBy({ usernameLower: acct.username.toLowerCase(), host: acct.host ?? IsNull(), }))); - return await this.userEntityService.packMany(users.filter(x => x != null), me, { schema: 'UserDetailed' }); + return await this.userEntityService.packMany(users.filter(x => x !== null) as MiUser[], me, { detail: true }); }); } } diff --git a/packages/backend/src/server/api/endpoints/promo/read.ts b/packages/backend/src/server/api/endpoints/promo/read.ts index 9f7d078014..f427939a7a 100644 --- a/packages/backend/src/server/api/endpoints/promo/read.ts +++ b/packages/backend/src/server/api/endpoints/promo/read.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -49,7 +49,7 @@ export default class extends Endpoint { // eslint- throw err; }); - const exist = await this.promoReadsRepository.exists({ + const exist = await this.promoReadsRepository.exist({ where: { noteId: note.id, userId: me.id, 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 84a1f010d4..7ff7b5de3a 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/create.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/create.ts @@ -1,16 +1,17 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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/_.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'; -import { UserRenoteMutingService } from "@/core/UserRenoteMutingService.js"; -import type { RenoteMutingsRepository } from '@/models/_.js'; export const meta = { tags: ['account'], @@ -61,7 +62,7 @@ export default class extends Endpoint { // eslint- private renoteMutingsRepository: RenoteMutingsRepository, private getterService: GetterService, - private userRenoteMutingService: UserRenoteMutingService, + private idService: IdService, ) { super(meta, paramDef, async (ps, me) => { const muter = me; @@ -72,25 +73,27 @@ export default class extends Endpoint { // eslint- } // Get mutee - const mutee = await this.getterService.getUser(ps.userId).catch(err => { + const mutee = await getterService.getUser(ps.userId).catch(err => { if (err.id === '15348ddd-432d-49c2-8a5a-8069753becff') throw new ApiError(meta.errors.noSuchUser); throw err; }); // Check if already muting - const exist = await this.renoteMutingsRepository.exists({ - where: { - muterId: muter.id, - muteeId: mutee.id, - }, + const exist = await this.renoteMutingsRepository.findOneBy({ + muterId: muter.id, + muteeId: mutee.id, }); - if (exist === true) { + if (exist != null) { throw new ApiError(meta.errors.alreadyMuting); } // Create mute - await this.userRenoteMutingService.mute(muter, mutee); + await this.renoteMutingsRepository.insert({ + id: this.idService.gen(), + muterId: muter.id, + muteeId: mutee.id, + } as MiRenoteMuting); }); } } 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 1a584b8404..f4969896d9 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/delete.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/delete.ts @@ -1,15 +1,14 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * 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 type { RenoteMutingsRepository } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { GetterService } from '@/server/api/GetterService.js'; import { ApiError } from '../../error.js'; -import { UserRenoteMutingService } from "@/core/UserRenoteMutingService.js"; -import type { RenoteMutingsRepository } from '@/models/_.js'; export const meta = { tags: ['account'], @@ -54,7 +53,6 @@ export default class extends Endpoint { // eslint- private renoteMutingsRepository: RenoteMutingsRepository, private getterService: GetterService, - private userRenoteMutingService: UserRenoteMutingService, ) { super(meta, paramDef, async (ps, me) => { const muter = me; @@ -81,7 +79,9 @@ export default class extends Endpoint { // eslint- } // Delete mute - await this.userRenoteMutingService.unmute([exist]); + await this.renoteMutingsRepository.delete({ + id: exist.id, + }); }); } } 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 3be01f989a..493593ae2d 100644 --- a/packages/backend/src/server/api/endpoints/renote-mute/list.ts +++ b/packages/backend/src/server/api/endpoints/renote-mute/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 86fe6a2e6e..f13710e1dd 100644 --- a/packages/backend/src/server/api/endpoints/request-reset-password.ts +++ b/packages/backend/src/server/api/endpoints/request-reset-password.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/reset-db.ts b/packages/backend/src/server/api/endpoints/reset-db.ts index 67d5fabd86..0eeee81580 100644 --- a/packages/backend/src/server/api/endpoints/reset-db.ts +++ b/packages/backend/src/server/api/endpoints/reset-db.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/reset-password.ts b/packages/backend/src/server/api/endpoints/reset-password.ts index 9693892637..3a6dc14bcd 100644 --- a/packages/backend/src/server/api/endpoints/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/reset-password.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/retention.ts b/packages/backend/src/server/api/endpoints/retention.ts index 4695f32042..dac6d65407 100644 --- a/packages/backend/src/server/api/endpoints/retention.ts +++ b/packages/backend/src/server/api/endpoints/retention.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -14,32 +14,6 @@ export const meta = { requireCredential: false, res: { - type: 'array', - items: { - type: 'object', - properties: { - createdAt: { - type: 'string', - format: 'date-time', - }, - users: { - type: 'number', - }, - data: { - type: 'object', - additionalProperties: { - anyOf: [{ - type: 'number', - }], - }, - }, - }, - required: [ - 'createdAt', - 'users', - 'data', - ], - }, }, allowGet: true, diff --git a/packages/backend/src/server/api/endpoints/reversi/cancel-match.ts b/packages/backend/src/server/api/endpoints/reversi/cancel-match.ts deleted file mode 100644 index dd6f273e01..0000000000 --- a/packages/backend/src/server/api/endpoints/reversi/cancel-match.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { ReversiService } from '@/core/ReversiService.js'; - -export const meta = { - requireCredential: true, - - kind: 'write:account', - - errors: { - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - userId: { type: 'string', format: 'misskey:id', nullable: true }, - }, - required: [], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private reversiService: ReversiService, - ) { - super(meta, paramDef, async (ps, me) => { - if (ps.userId) { - await this.reversiService.matchSpecificUserCancel(me, ps.userId); - return; - } else { - await this.reversiService.matchAnyUserCancel(me); - } - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/reversi/games.ts b/packages/backend/src/server/api/endpoints/reversi/games.ts deleted file mode 100644 index 6b06068727..0000000000 --- a/packages/backend/src/server/api/endpoints/reversi/games.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { Brackets } from 'typeorm'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { ReversiGameEntityService } from '@/core/entities/ReversiGameEntityService.js'; -import { DI } from '@/di-symbols.js'; -import type { ReversiGamesRepository } from '@/models/_.js'; -import { QueryService } from '@/core/QueryService.js'; - -export const meta = { - requireCredential: false, - - res: { - type: 'array', - optional: false, nullable: false, - items: { ref: 'ReversiGameLite' }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, - sinceId: { type: 'string', format: 'misskey:id' }, - untilId: { type: 'string', format: 'misskey:id' }, - my: { type: 'boolean', default: false }, - }, - required: [], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - @Inject(DI.reversiGamesRepository) - private reversiGamesRepository: ReversiGamesRepository, - - private reversiGameEntityService: ReversiGameEntityService, - private queryService: QueryService, - ) { - super(meta, paramDef, async (ps, me) => { - const query = this.queryService.makePaginationQuery(this.reversiGamesRepository.createQueryBuilder('game'), ps.sinceId, ps.untilId) - .innerJoinAndSelect('game.user1', 'user1') - .innerJoinAndSelect('game.user2', 'user2'); - - if (ps.my && me) { - query.andWhere(new Brackets(qb => { - qb - .where('game.user1Id = :userId', { userId: me.id }) - .orWhere('game.user2Id = :userId', { userId: me.id }); - })); - } else { - query.andWhere('game.isStarted = TRUE'); - } - - const games = await query.take(ps.limit).getMany(); - - return await this.reversiGameEntityService.packLiteMany(games); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/reversi/invitations.ts b/packages/backend/src/server/api/endpoints/reversi/invitations.ts deleted file mode 100644 index 5b3b9da75b..0000000000 --- a/packages/backend/src/server/api/endpoints/reversi/invitations.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { DI } from '@/di-symbols.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import { ReversiService } from '@/core/ReversiService.js'; - -export const meta = { - requireCredential: true, - - kind: 'read:account', - - res: { - type: 'array', - optional: false, nullable: false, - items: { ref: 'UserLite' }, - }, -} as const; - -export const paramDef = { -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private userEntityService: UserEntityService, - private reversiService: ReversiService, - ) { - super(meta, paramDef, async (ps, me) => { - const invitations = await this.reversiService.getInvitations(me); - - return await this.userEntityService.packMany(invitations, me); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/reversi/match.ts b/packages/backend/src/server/api/endpoints/reversi/match.ts deleted file mode 100644 index aa8b8a7d72..0000000000 --- a/packages/backend/src/server/api/endpoints/reversi/match.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { ReversiService } from '@/core/ReversiService.js'; -import { ReversiGameEntityService } from '@/core/entities/ReversiGameEntityService.js'; -import { ApiError } from '../../error.js'; -import { GetterService } from '../../GetterService.js'; - -export const meta = { - requireCredential: true, - - kind: 'write:account', - - errors: { - noSuchUser: { - message: 'No such user.', - code: 'NO_SUCH_USER', - id: '0b4f0559-b484-4e31-9581-3f73cee89b28', - }, - - isYourself: { - message: 'Target user is yourself.', - code: 'TARGET_IS_YOURSELF', - id: '96fd7bd6-d2bc-426c-a865-d055dcd2828e', - }, - }, - - res: { - type: 'object', - optional: true, - ref: 'ReversiGameDetailed', - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - userId: { type: 'string', format: 'misskey:id', nullable: true }, - noIrregularRules: { type: 'boolean', default: false }, - multiple: { type: 'boolean', default: false }, - }, - required: [], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private getterService: GetterService, - private reversiService: ReversiService, - private reversiGameEntityService: ReversiGameEntityService, - ) { - super(meta, paramDef, async (ps, me) => { - if (ps.userId === me.id) throw new ApiError(meta.errors.isYourself); - - const target = ps.userId ? await this.getterService.getUser(ps.userId).catch(err => { - if (err.id === '15348ddd-432d-49c2-8a5a-8069753becff') throw new ApiError(meta.errors.noSuchUser); - throw err; - }) : null; - - const game = target - ? await this.reversiService.matchSpecificUser(me, target, ps.multiple) - : await this.reversiService.matchAnyUser(me, { noIrregularRules: ps.noIrregularRules }, ps.multiple); - - if (game == null) return; - - return await this.reversiGameEntityService.packDetail(game); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/reversi/show-game.ts b/packages/backend/src/server/api/endpoints/reversi/show-game.ts deleted file mode 100644 index fc3b96eb51..0000000000 --- a/packages/backend/src/server/api/endpoints/reversi/show-game.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { ReversiService } from '@/core/ReversiService.js'; -import { ReversiGameEntityService } from '@/core/entities/ReversiGameEntityService.js'; -import { ApiError } from '../../error.js'; - -export const meta = { - requireCredential: false, - - errors: { - noSuchGame: { - message: 'No such game.', - code: 'NO_SUCH_GAME', - id: 'f13a03db-fae1-46c9-87f3-43c8165419e1', - }, - }, - - res: { - type: 'object', - optional: false, nullable: false, - ref: 'ReversiGameDetailed', - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - gameId: { type: 'string', format: 'misskey:id' }, - }, - required: ['gameId'], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private reversiService: ReversiService, - private reversiGameEntityService: ReversiGameEntityService, - ) { - super(meta, paramDef, async (ps, me) => { - const game = await this.reversiService.get(ps.gameId); - - if (game == null) { - throw new ApiError(meta.errors.noSuchGame); - } - - return await this.reversiGameEntityService.packDetail(game); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/reversi/surrender.ts b/packages/backend/src/server/api/endpoints/reversi/surrender.ts deleted file mode 100644 index 75e5372862..0000000000 --- a/packages/backend/src/server/api/endpoints/reversi/surrender.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { ReversiService } from '@/core/ReversiService.js'; -import { ApiError } from '../../error.js'; - -export const meta = { - requireCredential: true, - - kind: 'write:account', - - errors: { - noSuchGame: { - message: 'No such game.', - code: 'NO_SUCH_GAME', - id: 'ace0b11f-e0a6-4076-a30d-e8284c81b2df', - }, - - alreadyEnded: { - message: 'That game has already ended.', - code: 'ALREADY_ENDED', - id: '6c2ad4a6-cbf1-4a5b-b187-b772826cfc6d', - }, - - accessDenied: { - message: 'Access denied.', - code: 'ACCESS_DENIED', - id: '6e04164b-a992-4c93-8489-2123069973e1', - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - gameId: { type: 'string', format: 'misskey:id' }, - }, - required: ['gameId'], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private reversiService: ReversiService, - ) { - super(meta, paramDef, async (ps, me) => { - const game = await this.reversiService.get(ps.gameId); - - if (game == null) { - throw new ApiError(meta.errors.noSuchGame); - } - - if (game.isEnded) { - throw new ApiError(meta.errors.alreadyEnded); - } - - if ((game.user1Id !== me.id) && (game.user2Id !== me.id)) { - throw new ApiError(meta.errors.accessDenied); - } - - await this.reversiService.surrender(game.id, me); - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/reversi/verify.ts b/packages/backend/src/server/api/endpoints/reversi/verify.ts deleted file mode 100644 index 981735a3d7..0000000000 --- a/packages/backend/src/server/api/endpoints/reversi/verify.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { ReversiService } from '@/core/ReversiService.js'; -import { ReversiGameEntityService } from '@/core/entities/ReversiGameEntityService.js'; -import { ApiError } from '../../error.js'; - -export const meta = { - errors: { - noSuchGame: { - message: 'No such game.', - code: 'NO_SUCH_GAME', - id: '8fb05624-b525-43dd-90f7-511852bdfeee', - }, - }, - - res: { - type: 'object', - optional: false, nullable: false, - properties: { - desynced: { type: 'boolean' }, - game: { - type: 'object', - optional: true, nullable: true, - ref: 'ReversiGameDetailed', - }, - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - gameId: { type: 'string', format: 'misskey:id' }, - crc32: { type: 'string' }, - }, - required: ['gameId', 'crc32'], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - private reversiService: ReversiService, - private reversiGameEntityService: ReversiGameEntityService, - ) { - super(meta, paramDef, async (ps, me) => { - const game = await this.reversiService.checkCrc(ps.gameId, ps.crc32); - if (game) { - return { - desynced: true, - game: await this.reversiGameEntityService.packDetail(game), - }; - } else { - return { - desynced: false, - }; - } - }); - } -} diff --git a/packages/backend/src/server/api/endpoints/roles/list.ts b/packages/backend/src/server/api/endpoints/roles/list.ts index b087aa242b..d40e937d4e 100644 --- a/packages/backend/src/server/api/endpoints/roles/list.ts +++ b/packages/backend/src/server/api/endpoints/roles/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/roles/notes.ts b/packages/backend/src/server/api/endpoints/roles/notes.ts index 71f2782a5d..4ce3fc8908 100644 --- a/packages/backend/src/server/api/endpoints/roles/notes.ts +++ b/packages/backend/src/server/api/endpoints/roles/notes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/roles/show.ts b/packages/backend/src/server/api/endpoints/roles/show.ts index 38477c5e8e..6bfe52bb1a 100644 --- a/packages/backend/src/server/api/endpoints/roles/show.ts +++ b/packages/backend/src/server/api/endpoints/roles/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/roles/users.ts b/packages/backend/src/server/api/endpoints/roles/users.ts index 48d350af59..d304d075b2 100644 --- a/packages/backend/src/server/api/endpoints/roles/users.ts +++ b/packages/backend/src/server/api/endpoints/roles/users.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -33,11 +33,11 @@ export const meta = { properties: { id: { type: 'string', - format: 'misskey:id', + format: 'misskey:id' }, user: { type: 'object', - ref: 'UserDetailed', + ref: 'User' }, }, required: ['id', 'user'], @@ -92,12 +92,9 @@ export default class extends Endpoint { // eslint- .limit(ps.limit) .getMany(); - const _users = assigns.map(({ user, userId }) => user ?? userId); - const _userMap = await this.userEntityService.packMany(_users, me, { schema: 'UserDetailed' }) - .then(users => new Map(users.map(u => [u.id, u]))); return await Promise.all(assigns.map(async assign => ({ id: assign.id, - user: _userMap.get(assign.userId) ?? await this.userEntityService.pack(assign.user!, me, { schema: 'UserDetailed' }), + user: await this.userEntityService.pack(assign.user!, me, { detail: true }), }))); }); } diff --git a/packages/backend/src/server/api/endpoints/server-info.ts b/packages/backend/src/server/api/endpoints/server-info.ts index 8301c85f2e..079f2d7f1d 100644 --- a/packages/backend/src/server/api/endpoints/server-info.ts +++ b/packages/backend/src/server/api/endpoints/server-info.ts @@ -1,14 +1,13 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import * as os from 'node:os'; import si from 'systeminformation'; -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import { MiMeta } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; +import { MetaService } from '@/core/MetaService.js'; export const meta = { requireCredential: false, @@ -74,11 +73,10 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, + private metaService: MetaService, ) { super(meta, paramDef, async () => { - if (!this.serverSettings.enableServerMachineStats) return { + if (!(await this.metaService.fetch()).enableServerMachineStats) return { machine: '?', cpu: { model: '?', diff --git a/packages/backend/src/server/api/endpoints/stats.ts b/packages/backend/src/server/api/endpoints/stats.ts index 1e6983177f..05468240d3 100644 --- a/packages/backend/src/server/api/endpoints/stats.ts +++ b/packages/backend/src/server/api/endpoints/stats.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/sw/register.ts b/packages/backend/src/server/api/endpoints/sw/register.ts index fd76df2d3c..bb50048d94 100644 --- a/packages/backend/src/server/api/endpoints/sw/register.ts +++ b/packages/backend/src/server/api/endpoints/sw/register.ts @@ -1,14 +1,14 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; import { IdService } from '@/core/IdService.js'; -import type { MiMeta, SwSubscriptionsRepository } from '@/models/_.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'; -import { PushNotificationService } from '@/core/PushNotificationService.js'; export const meta = { tags: ['account'], @@ -61,14 +61,11 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, - @Inject(DI.swSubscriptionsRepository) private swSubscriptionsRepository: SwSubscriptionsRepository, private idService: IdService, - private pushNotificationService: PushNotificationService, + private metaService: MetaService, ) { super(meta, paramDef, async (ps, me) => { // if already subscribed @@ -79,10 +76,12 @@ export default class extends Endpoint { // eslint- publickey: ps.publickey, }); + const instance = await this.metaService.fetch(true); + if (exist != null) { return { state: 'already-subscribed' as const, - key: this.serverSettings.swPublicKey, + key: instance.swPublicKey, userId: me.id, endpoint: exist.endpoint, sendReadMessage: exist.sendReadMessage, @@ -98,11 +97,9 @@ export default class extends Endpoint { // eslint- sendReadMessage: ps.sendReadMessage, }); - this.pushNotificationService.refreshCache(me.id); - return { state: 'subscribed' as const, - key: this.serverSettings.swPublicKey, + key: instance.swPublicKey, userId: me.id, endpoint: ps.endpoint, sendReadMessage: ps.sendReadMessage, 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 797e4fd34d..15d3df8587 100644 --- a/packages/backend/src/server/api/endpoints/sw/show-registration.ts +++ b/packages/backend/src/server/api/endpoints/sw/show-registration.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/sw/unregister.ts b/packages/backend/src/server/api/endpoints/sw/unregister.ts index 2edf7fab1b..f00fdd6697 100644 --- a/packages/backend/src/server/api/endpoints/sw/unregister.ts +++ b/packages/backend/src/server/api/endpoints/sw/unregister.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,7 +7,6 @@ import { Inject, Injectable } from '@nestjs/common'; import type { SwSubscriptionsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; -import { PushNotificationService } from '@/core/PushNotificationService.js'; export const meta = { tags: ['account'], @@ -30,18 +29,12 @@ export default class extends Endpoint { // eslint- constructor( @Inject(DI.swSubscriptionsRepository) private swSubscriptionsRepository: SwSubscriptionsRepository, - - private pushNotificationService: PushNotificationService, ) { super(meta, paramDef, async (ps, me) => { await this.swSubscriptionsRepository.delete({ ...(me ? { userId: me.id } : {}), endpoint: ps.endpoint, }); - - if (me) { - this.pushNotificationService.refreshCache(me.id); - } }); } } 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 839a07c770..7bf59784a2 100644 --- a/packages/backend/src/server/api/endpoints/sw/update-registration.ts +++ b/packages/backend/src/server/api/endpoints/sw/update-registration.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,7 +7,6 @@ import { Inject, Injectable } from '@nestjs/common'; import type { SwSubscriptionsRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; -import { PushNotificationService } from '@/core/PushNotificationService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -59,8 +58,6 @@ export default class extends Endpoint { // eslint- constructor( @Inject(DI.swSubscriptionsRepository) private swSubscriptionsRepository: SwSubscriptionsRepository, - - private pushNotificationService: PushNotificationService, ) { super(meta, paramDef, async (ps, me) => { const swSubscription = await this.swSubscriptionsRepository.findOneBy({ @@ -80,8 +77,6 @@ export default class extends Endpoint { // eslint- sendReadMessage: swSubscription.sendReadMessage, }); - this.pushNotificationService.refreshCache(me.id); - return { userId: swSubscription.userId, endpoint: swSubscription.endpoint, diff --git a/packages/backend/src/server/api/endpoints/test.ts b/packages/backend/src/server/api/endpoints/test.ts index 9231f0ab94..949867c572 100644 --- a/packages/backend/src/server/api/endpoints/test.ts +++ b/packages/backend/src/server/api/endpoints/test.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -18,28 +18,24 @@ export const meta = { properties: { id: { type: 'string', - format: 'misskey:id', - optional: true, nullable: false, + format: 'misskey:id' }, required: { type: 'boolean', - optional: false, nullable: false, }, string: { type: 'string', - optional: true, nullable: false, }, default: { type: 'string', - optional: true, nullable: false, }, nullableDefault: { type: 'string', default: 'hello', - optional: true, nullable: true, + nullable: true, }, - }, - }, + } + } } as const; export const paramDef = { diff --git a/packages/backend/src/server/api/endpoints/username/available.ts b/packages/backend/src/server/api/endpoints/username/available.ts index 4944be9b05..e37df62c0c 100644 --- a/packages/backend/src/server/api/endpoints/username/available.ts +++ b/packages/backend/src/server/api/endpoints/username/available.ts @@ -1,14 +1,15 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { MiMeta, UsedUsernamesRepository, UsersRepository } from '@/models/_.js'; +import type { UsedUsernamesRepository, UsersRepository } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { localUsernameSchema } from '@/models/User.js'; import { DI } from '@/di-symbols.js'; +import { MetaService } from '@/core/MetaService.js'; export const meta = { tags: ['users'], @@ -38,14 +39,13 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @Inject(DI.usedUsernamesRepository) private usedUsernamesRepository: UsedUsernamesRepository, + + private metaService: MetaService, ) { super(meta, paramDef, async (ps, me) => { const exist = await this.usersRepository.countBy({ @@ -55,7 +55,8 @@ export default class extends Endpoint { // eslint- const exist2 = await this.usedUsernamesRepository.countBy({ username: ps.username.toLowerCase() }); - const isPreserved = this.serverSettings.preservedUsernames.map(x => x.toLowerCase()).includes(ps.username.toLowerCase()); + const meta = await this.metaService.fetch(); + const isPreserved = meta.preservedUsernames.map(x => x.toLowerCase()).includes(ps.username.toLowerCase()); return { available: exist === 0 && exist2 === 0 && !isPreserved, diff --git a/packages/backend/src/server/api/endpoints/users.ts b/packages/backend/src/server/api/endpoints/users.ts index e845853017..8dc5841314 100644 --- a/packages/backend/src/server/api/endpoints/users.ts +++ b/packages/backend/src/server/api/endpoints/users.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -89,7 +89,7 @@ export default class extends Endpoint { // eslint- const users = await query.getMany(); - return await this.userEntityService.packMany(users, me, { schema: 'UserDetailed' }); + return await this.userEntityService.packMany(users, me, { detail: true }); }); } } diff --git a/packages/backend/src/server/api/endpoints/users/achievements.ts b/packages/backend/src/server/api/endpoints/users/achievements.ts index f7139b3684..3a584a819a 100644 --- a/packages/backend/src/server/api/endpoints/users/achievements.ts +++ b/packages/backend/src/server/api/endpoints/users/achievements.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/users/clips.ts b/packages/backend/src/server/api/endpoints/users/clips.ts index 7f7d2ea8cc..725e07db39 100644 --- a/packages/backend/src/server/api/endpoints/users/clips.ts +++ b/packages/backend/src/server/api/endpoints/users/clips.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/users/featured-notes.ts b/packages/backend/src/server/api/endpoints/users/featured-notes.ts index e01f19ba7a..7243aa3b3e 100644 --- a/packages/backend/src/server/api/endpoints/users/featured-notes.ts +++ b/packages/backend/src/server/api/endpoints/users/featured-notes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/users/flashs.ts b/packages/backend/src/server/api/endpoints/users/flashs.ts index e5ea450215..18026dcefb 100644 --- a/packages/backend/src/server/api/endpoints/users/flashs.ts +++ b/packages/backend/src/server/api/endpoints/users/flashs.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/users/followers.ts b/packages/backend/src/server/api/endpoints/users/followers.ts index a8b4319a61..5706e46b96 100644 --- a/packages/backend/src/server/api/endpoints/users/followers.ts +++ b/packages/backend/src/server/api/endpoints/users/followers.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -11,7 +11,6 @@ import { QueryService } from '@/core/QueryService.js'; import { FollowingEntityService } from '@/core/entities/FollowingEntityService.js'; import { UtilityService } from '@/core/UtilityService.js'; import { DI } from '@/di-symbols.js'; -import { RoleService } from '@/core/RoleService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -82,7 +81,6 @@ export default class extends Endpoint { // eslint- private utilityService: UtilityService, private followingEntityService: FollowingEntityService, private queryService: QueryService, - private roleService: RoleService, ) { super(meta, paramDef, async (ps, me) => { const user = await this.usersRepository.findOneBy(ps.userId != null @@ -95,25 +93,23 @@ export default class extends Endpoint { // eslint- const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id }); - if (profile.followersVisibility !== 'public' && !await this.roleService.isModerator(me)) { - if (profile.followersVisibility === 'private') { - if (me == null || (me.id !== user.id)) { + if (profile.followersVisibility === 'private') { + if (me == null || (me.id !== user.id)) { + throw new ApiError(meta.errors.forbidden); + } + } else if (profile.followersVisibility === 'followers') { + if (me == null) { + throw new ApiError(meta.errors.forbidden); + } else if (me.id !== user.id) { + const isFollowing = await this.followingsRepository.exist({ + where: { + followeeId: user.id, + followerId: me.id, + }, + }); + if (!isFollowing) { throw new ApiError(meta.errors.forbidden); } - } else if (profile.followersVisibility === 'followers') { - if (me == null) { - throw new ApiError(meta.errors.forbidden); - } else if (me.id !== user.id) { - const isFollowing = await this.followingsRepository.exists({ - where: { - followeeId: user.id, - followerId: me.id, - }, - }); - if (!isFollowing) { - throw new ApiError(meta.errors.forbidden); - } - } } } diff --git a/packages/backend/src/server/api/endpoints/users/following.ts b/packages/backend/src/server/api/endpoints/users/following.ts index feda5bb353..794fb04f10 100644 --- a/packages/backend/src/server/api/endpoints/users/following.ts +++ b/packages/backend/src/server/api/endpoints/users/following.ts @@ -1,18 +1,16 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { IsNull } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; import type { UsersRepository, FollowingsRepository, UserProfilesRepository } from '@/models/_.js'; -import { birthdaySchema } from '@/models/User.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { FollowingEntityService } from '@/core/entities/FollowingEntityService.js'; import { UtilityService } from '@/core/UtilityService.js'; import { DI } from '@/di-symbols.js'; -import { RoleService } from '@/core/RoleService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -68,7 +66,7 @@ export const paramDef = { description: 'The local host is represented with `null`.', }, - birthday: { ...birthdaySchema, nullable: true }, + birthday: { type: 'string', nullable: true }, }, anyOf: [ { required: ['userId'] }, @@ -91,7 +89,6 @@ export default class extends Endpoint { // eslint- private utilityService: UtilityService, private followingEntityService: FollowingEntityService, private queryService: QueryService, - private roleService: RoleService, ) { super(meta, paramDef, async (ps, me) => { const user = await this.usersRepository.findOneBy(ps.userId != null @@ -104,25 +101,23 @@ export default class extends Endpoint { // eslint- const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id }); - if (profile.followingVisibility !== 'public' && !await this.roleService.isModerator(me)) { - if (profile.followingVisibility === 'private') { - if (me == null || (me.id !== user.id)) { + if (profile.followingVisibility === 'private') { + if (me == null || (me.id !== user.id)) { + throw new ApiError(meta.errors.forbidden); + } + } else if (profile.followingVisibility === 'followers') { + if (me == null) { + throw new ApiError(meta.errors.forbidden); + } else if (me.id !== user.id) { + const isFollowing = await this.followingsRepository.exist({ + where: { + followeeId: user.id, + followerId: me.id, + }, + }); + if (!isFollowing) { throw new ApiError(meta.errors.forbidden); } - } else if (profile.followingVisibility === 'followers') { - if (me == null) { - throw new ApiError(meta.errors.forbidden); - } else if (me.id !== user.id) { - const isFollowing = await this.followingsRepository.exists({ - where: { - followeeId: user.id, - followerId: me.id, - }, - }); - if (!isFollowing) { - throw new ApiError(meta.errors.forbidden); - } - } } } @@ -132,7 +127,9 @@ export default class extends Endpoint { // eslint- if (ps.birthday) { try { - const birthday = ps.birthday.substring(5, 10); + const d = new Date(ps.birthday); + d.setHours(0, 0, 0, 0); + const birthday = `${(d.getMonth() + 1).toString().padStart(2, '0')}-${d.getDate().toString().padStart(2, '0')}`; const birthdayUserQuery = this.userProfilesRepository.createQueryBuilder('user_profile'); birthdayUserQuery.select('user_profile.userId') .where(`SUBSTR(user_profile.birthday, 6, 5) = '${birthday}'`); 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 553886374c..757af98e00 100644 --- a/packages/backend/src/server/api/endpoints/users/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/users/gallery/posts.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 9248a2fa68..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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -118,14 +118,12 @@ export default class extends Endpoint { // eslint- const repliedUsersSorted = Object.keys(repliedUsers).sort((a, b) => repliedUsers[b] - repliedUsers[a]); // Extract top replied users - const topRepliedUserIds = repliedUsersSorted.slice(0, ps.limit); + const topRepliedUsers = repliedUsersSorted.slice(0, ps.limit); // Make replies object (includes weights) - const _userMap = await this.userEntityService.packMany(topRepliedUserIds, me, { schema: 'UserDetailed' }) - .then(users => new Map(users.map(u => [u.id, u]))); - const repliesObj = await Promise.all(topRepliedUserIds.map(async (userId) => ({ - user: _userMap.get(userId) ?? await this.userEntityService.pack(userId, me, { schema: 'UserDetailed' }), - weight: repliedUsers[userId] / peak, + const repliesObj = await Promise.all(topRepliedUsers.map(async (user) => ({ + user: await this.userEntityService.pack(user, me, { detail: true }), + weight: repliedUsers[user] / peak, }))); return repliesObj; 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 7e44d501ab..fa2e3338b8 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -90,7 +90,7 @@ export default class extends Endpoint { // eslint- private roleService: RoleService, ) { super(meta, paramDef, async (ps, me) => { - const listExist = await this.userListsRepository.exists({ + const listExist = await this.userListsRepository.exist({ where: { id: ps.listId, isPublic: true, @@ -100,15 +100,15 @@ export default class extends Endpoint { // eslint- const currentCount = await this.userListsRepository.countBy({ userId: me.id, }); - if (currentCount >= (await this.roleService.getUserPolicies(me.id)).userListLimit) { + if (currentCount > (await this.roleService.getUserPolicies(me.id)).userListLimit) { throw new ApiError(meta.errors.tooManyUserLists); } - const userList = await this.userListsRepository.insertOne({ + const userList = await this.userListsRepository.insert({ id: this.idService.gen(), userId: me.id, name: ps.name, - } as MiUserList); + } as MiUserList).then(x => this.userListsRepository.findOneByOrFail(x.identifiers[0])); const users = (await this.userListMembershipsRepository.findBy({ userListId: ps.listId, @@ -121,7 +121,7 @@ export default class extends Endpoint { // eslint- }); if (currentUser.id !== me.id) { - const blockExist = await this.blockingsRepository.exists({ + const blockExist = await this.blockingsRepository.exist({ where: { blockerId: currentUser.id, blockeeId: me.id, @@ -132,7 +132,7 @@ export default class extends Endpoint { // eslint- } } - const exist = await this.userListMembershipsRepository.exists({ + const exist = await this.userListMembershipsRepository.exist({ where: { userListId: userList.id, userId: currentUser.id, 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 7daf05ba4e..e86e4c0ded 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/create.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/create.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -61,15 +61,15 @@ export default class extends Endpoint { // eslint- const currentCount = await this.userListsRepository.countBy({ userId: me.id, }); - if (currentCount >= (await this.roleService.getUserPolicies(me.id)).userListLimit) { + if (currentCount > (await this.roleService.getUserPolicies(me.id)).userListLimit) { throw new ApiError(meta.errors.tooManyUserLists); } - const userList = await this.userListsRepository.insertOne({ + const userList = await this.userListsRepository.insert({ id: this.idService.gen(), userId: me.id, name: ps.name, - } as MiUserList); + } as MiUserList).then(x => this.userListsRepository.findOneByOrFail(x.identifiers[0])); return await this.userListEntityService.pack(userList); }); 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 dc0d28a0eb..763f5afd9d 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/delete.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/delete.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 fd142d5a01..864cdc2ee0 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/favorite.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/favorite.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -47,7 +47,7 @@ export default class extends Endpoint { private idService: IdService, ) { super(meta, paramDef, async (ps, me) => { - const userListExist = await this.userListsRepository.exists({ + const userListExist = await this.userListsRepository.exist({ where: { id: ps.listId, isPublic: true, @@ -58,7 +58,7 @@ export default class extends Endpoint { throw new ApiError(meta.errors.noSuchList); } - const exist = await this.userListFavoritesRepository.exists({ + const exist = await this.userListFavoritesRepository.exist({ where: { userId: me.id, userListId: ps.listId, diff --git a/packages/backend/src/server/api/endpoints/users/lists/get-memberships.ts b/packages/backend/src/server/api/endpoints/users/lists/get-memberships.ts index 6d6e8d34ea..985141515e 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/get-memberships.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/get-memberships.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -46,7 +46,7 @@ export const meta = { }, user: { type: 'object', - ref: 'UserLite', + ref: 'User', }, withReplies: { type: 'boolean', 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 4241ef1cd0..0e86dd3a68 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/list.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/list.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 94f06f3bea..e90122224c 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/pull.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/pull.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 c717b3959c..c4ceec575b 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/push.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/push.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -104,7 +104,7 @@ export default class extends Endpoint { // eslint- // Check blocking if (user.id !== me.id) { - const blockExist = await this.blockingsRepository.exists({ + const blockExist = await this.blockingsRepository.exist({ where: { blockerId: user.id, blockeeId: me.id, @@ -115,7 +115,7 @@ export default class extends Endpoint { // eslint- } } - const exist = await this.userListMembershipsRepository.exists({ + const exist = await this.userListMembershipsRepository.exist({ where: { userListId: userList.id, userId: user.id, 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 8756801fe4..df44870b04 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/show.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -74,7 +74,7 @@ export default class extends Endpoint { userListId: ps.listId, }); if (me !== null) { - additionalProperties.isLiked = await this.userListFavoritesRepository.exists({ + additionalProperties.isLiked = await this.userListFavoritesRepository.exist({ where: { userId: me.id, userListId: ps.listId, 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 3f4bd5af8c..d51d57343e 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/unfavorite.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/unfavorite.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -45,7 +45,7 @@ export default class extends Endpoint { private userListFavoritesRepository: UserListFavoritesRepository, ) { super(meta, paramDef, async (ps, me) => { - const userListExist = await this.userListsRepository.exists({ + const userListExist = await this.userListsRepository.exist({ where: { id: ps.listId, isPublic: true, diff --git a/packages/backend/src/server/api/endpoints/users/lists/update-membership.ts b/packages/backend/src/server/api/endpoints/users/lists/update-membership.ts index 3948ae1685..b69465b940 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/update-membership.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/update-membership.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ 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 a38f84d7b0..eb6cfbaf26 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/update.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/update.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index e9c334057e..b485126ed8 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -1,17 +1,18 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Brackets } from 'typeorm'; import { Inject, Injectable } from '@nestjs/common'; -import type { MiMeta, NotesRepository } from '@/models/_.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'; import { CacheService } from '@/core/CacheService.js'; import { IdService } from '@/core/IdService.js'; import { QueryService } from '@/core/QueryService.js'; +import { MetaService } from '@/core/MetaService.js'; import { MiLocalUser } from '@/models/User.js'; import { FanoutTimelineEndpointService } from '@/core/FanoutTimelineEndpointService.js'; import { FanoutTimelineName } from '@/core/FanoutTimelineService.js'; @@ -42,12 +43,6 @@ export const meta = { code: 'BOTH_WITH_REPLIES_AND_WITH_FILES', id: '91c8cb9f-36ed-46e7-9ca2-7df96ed6e222', }, - - signinRequired: { - message: 'Signin required.', - code: 'SIGNIN_REQUIRED', - id: 'd1588a9e-4b4d-4c07-807f-16f1486577a2', - }, }, } as const; @@ -72,9 +67,6 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, - @Inject(DI.notesRepository) private notesRepository: NotesRepository, @@ -83,12 +75,15 @@ export default class extends Endpoint { // eslint- private cacheService: CacheService, private idService: IdService, private fanoutTimelineEndpointService: FanoutTimelineEndpointService, + private metaService: MetaService, ) { super(meta, paramDef, async (ps, me) => { const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : null); const sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : null); const isSelf = me && (me.id === ps.userId); + const serverSettings = await this.metaService.fetch(); + if (ps.withReplies && ps.withFiles) throw new ApiError(meta.errors.bothWithRepliesAndWithFiles); // early return if me is blocked by requesting user @@ -99,7 +94,7 @@ export default class extends Endpoint { // eslint- } } - if (!this.serverSettings.enableFanoutTimeline) { + if (!serverSettings.enableFanoutTimeline) { const timeline = await this.getFromDb({ untilId, sinceId, diff --git a/packages/backend/src/server/api/endpoints/users/pages.ts b/packages/backend/src/server/api/endpoints/users/pages.ts index bb7de0e0b5..cf2f274c70 100644 --- a/packages/backend/src/server/api/endpoints/users/pages.ts +++ b/packages/backend/src/server/api/endpoints/users/pages.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/endpoints/users/reactions.ts b/packages/backend/src/server/api/endpoints/users/reactions.ts index 7805ae3288..372ab80c4c 100644 --- a/packages/backend/src/server/api/endpoints/users/reactions.ts +++ b/packages/backend/src/server/api/endpoints/users/reactions.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -9,10 +9,6 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteReactionEntityService } from '@/core/entities/NoteReactionEntityService.js'; import { DI } from '@/di-symbols.js'; -import { CacheService } from '@/core/CacheService.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import { RoleService } from '@/core/RoleService.js'; -import { isUserRelated } from '@/misc/is-user-related.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -38,11 +34,6 @@ export const meta = { code: 'REACTIONS_NOT_PUBLIC', id: '673a7dd2-6924-1093-e0c0-e68456ceae5c', }, - isRemoteUser: { - message: 'Currently unavailable to display reactions of remote users. See https://github.com/misskey-dev/misskey/issues/12964', - code: 'IS_REMOTE_USER', - id: '6b95fa98-8cf9-2350-e284-f0ffdb54a805', - }, }, } as const; @@ -68,34 +59,16 @@ export default class extends Endpoint { // eslint- @Inject(DI.noteReactionsRepository) private noteReactionsRepository: NoteReactionsRepository, - private cacheService: CacheService, - private userEntityService: UserEntityService, private noteReactionEntityService: NoteReactionEntityService, private queryService: QueryService, - private roleService: RoleService, ) { super(meta, paramDef, async (ps, me) => { - const userIdsWhoBlockingMe = me ? await this.cacheService.userBlockedCache.fetch(me.id) : new Set(); - const iAmModerator = me ? await this.roleService.isModerator(me) : false; // Moderators can see reactions of all users - if (!iAmModerator) { - const user = await this.cacheService.findUserById(ps.userId); - if (this.userEntityService.isRemoteUser(user)) { - throw new ApiError(meta.errors.isRemoteUser); - } + const profile = await this.userProfilesRepository.findOneByOrFail({ userId: ps.userId }); - const profile = await this.userProfilesRepository.findOneByOrFail({ userId: ps.userId }); - if ((me == null || me.id !== ps.userId) && !profile.publicReactions) { - throw new ApiError(meta.errors.reactionsNotPublic); - } - - // early return if me is blocked by requesting user - if (userIdsWhoBlockingMe.has(ps.userId)) { - return []; - } + if ((me == null || me.id !== ps.userId) && !profile.publicReactions) { + throw new ApiError(meta.errors.reactionsNotPublic); } - const userIdsWhoMeMuting = me ? await this.cacheService.userMutingsCache.fetch(me.id) : new Set(); - const query = this.queryService.makePaginationQuery(this.noteReactionsRepository.createQueryBuilder('reaction'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) .andWhere('reaction.userId = :userId', { userId: ps.userId }) @@ -103,17 +76,11 @@ export default class extends Endpoint { // eslint- this.queryService.generateVisibilityQuery(query, me); - const reactions = (await query + const reactions = await query .limit(ps.limit) - .getMany()).filter(reaction => { - if (reaction.note?.userId === ps.userId) return true; // we can see reactions to note of requesting user - if (me && isUserRelated(reaction.note, userIdsWhoBlockingMe)) return false; - if (me && isUserRelated(reaction.note, userIdsWhoMeMuting)) return false; + .getMany(); - return true; - }); - - return await this.noteReactionEntityService.packMany(reactions, me, { withNote: true }); + return await Promise.all(reactions.map(reaction => this.noteReactionEntityService.pack(reaction, me, { withNote: true }))); }); } } diff --git a/packages/backend/src/server/api/endpoints/users/recommendation.ts b/packages/backend/src/server/api/endpoints/users/recommendation.ts index 5b3b4527f7..1b30e99b15 100644 --- a/packages/backend/src/server/api/endpoints/users/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/users/recommendation.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -76,7 +76,7 @@ export default class extends Endpoint { // eslint- const users = await query.limit(ps.limit).offset(ps.offset).getMany(); - return await this.userEntityService.packMany(users, me, { schema: 'UserDetailed' }); + return await this.userEntityService.packMany(users, me, { detail: true }); }); } } diff --git a/packages/backend/src/server/api/endpoints/users/relation.ts b/packages/backend/src/server/api/endpoints/users/relation.ts index 1d75437b81..26b61c9fb2 100644 --- a/packages/backend/src/server/api/endpoints/users/relation.ts +++ b/packages/backend/src/server/api/endpoints/users/relation.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -132,9 +132,11 @@ export default class extends Endpoint { // eslint- private userEntityService: UserEntityService, ) { super(meta, paramDef, async (ps, me) => { - return Array.isArray(ps.userId) - ? await this.userEntityService.getRelations(me.id, ps.userId).then(it => [...it.values()]) - : await this.userEntityService.getRelation(me.id, ps.userId).then(it => [it]); + const ids = Array.isArray(ps.userId) ? ps.userId : [ps.userId]; + + const relations = await Promise.all(ids.map(id => this.userEntityService.getRelation(me.id, id))); + + return Array.isArray(ps.userId) ? relations : relations[0]; }); } } 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 5ff6de37d2..508497ccfb 100644 --- a/packages/backend/src/server/api/endpoints/users/report-abuse.ts +++ b/packages/backend/src/server/api/endpoints/users/report-abuse.ts @@ -1,13 +1,19 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { Injectable } from '@nestjs/common'; +import sanitizeHtml from 'sanitize-html'; +import { Inject, Injectable } from '@nestjs/common'; +import type { AbuseUserReportsRepository } from '@/models/_.js'; +import { IdService } from '@/core/IdService.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; +import { GlobalEventService } from '@/core/GlobalEventService.js'; +import { MetaService } from '@/core/MetaService.js'; +import { EmailService } from '@/core/EmailService.js'; +import { DI } from '@/di-symbols.js'; import { GetterService } from '@/server/api/GetterService.js'; import { RoleService } from '@/core/RoleService.js'; -import { AbuseReportService } from '@/core/AbuseReportService.js'; import { ApiError } from '../../error.js'; export const meta = { @@ -51,32 +57,60 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( + @Inject(DI.abuseUserReportsRepository) + private abuseUserReportsRepository: AbuseUserReportsRepository, + + private idService: IdService, + private metaService: MetaService, + private emailService: EmailService, private getterService: GetterService, private roleService: RoleService, - private abuseReportService: AbuseReportService, + private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, me) => { // Lookup user - const targetUser = await this.getterService.getUser(ps.userId).catch(err => { + const user = await this.getterService.getUser(ps.userId).catch(err => { if (err.id === '15348ddd-432d-49c2-8a5a-8069753becff') throw new ApiError(meta.errors.noSuchUser); throw err; }); - if (targetUser.id === me.id) { + if (user.id === me.id) { throw new ApiError(meta.errors.cannotReportYourself); } - if (await this.roleService.isAdministrator(targetUser)) { + if (await this.roleService.isAdministrator(user)) { throw new ApiError(meta.errors.cannotReportAdmin); } - await this.abuseReportService.report([{ - targetUserId: targetUser.id, - targetUserHost: targetUser.host, + const report = await this.abuseUserReportsRepository.insert({ + id: this.idService.gen(), + targetUserId: user.id, + targetUserHost: user.host, reporterId: me.id, reporterHost: null, comment: ps.comment, - }]); + }).then(x => this.abuseUserReportsRepository.findOneByOrFail(x.identifiers[0])); + + // Publish event to moderators + setImmediate(async () => { + const moderators = await this.roleService.getModerators(); + + for (const moderator of moderators) { + this.globalEventService.publishAdminStream(moderator.id, 'newAbuseUserReport', { + id: report.id, + targetUserId: report.targetUserId, + reporterId: report.reporterId, + comment: report.comment, + }); + } + + const meta = await this.metaService.fetch(); + if (meta.email) { + this.emailService.sendEmail(meta.email, 'New abuse report', + sanitizeHtml(ps.comment), + sanitizeHtml(ps.comment)); + } + }); }); } } 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 8ff952dcb5..4bf25d9fbb 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 @@ -1,11 +1,17 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { Injectable } from '@nestjs/common'; +import { Brackets } from 'typeorm'; +import { Inject, Injectable } from '@nestjs/common'; +import type { UsersRepository, FollowingsRepository } from '@/models/_.js'; +import type { Config } from '@/config.js'; +import type { MiUser } from '@/models/User.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import { UserSearchService } from '@/core/UserSearchService.js'; +import { UserEntityService } from '@/core/entities/UserEntityService.js'; +import { DI } from '@/di-symbols.js'; +import { sqlLikeEscape } from '@/misc/sql-like-escape.js'; export const meta = { tags: ['users'], @@ -43,16 +49,89 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - private userSearchService: UserSearchService, + @Inject(DI.config) + private config: Config, + + @Inject(DI.usersRepository) + private usersRepository: UsersRepository, + + @Inject(DI.followingsRepository) + private followingsRepository: FollowingsRepository, + + private userEntityService: UserEntityService, ) { - super(meta, paramDef, (ps, me) => { - return this.userSearchService.search({ - username: ps.username, - host: ps.host, - }, { - limit: ps.limit, - detail: ps.detail, - }, me); + super(meta, paramDef, async (ps, me) => { + const setUsernameAndHostQuery = (query = this.usersRepository.createQueryBuilder('user')) => { + if (ps.username) { + query.andWhere('user.usernameLower LIKE :username', { username: sqlLikeEscape(ps.username.toLowerCase()) + '%' }); + } + + if (ps.host) { + if (ps.host === this.config.hostname || ps.host === '.') { + query.andWhere('user.host IS NULL'); + } else { + query.andWhere('user.host LIKE :host', { + host: sqlLikeEscape(ps.host.toLowerCase()) + '%', + }); + } + } + + return query; + }; + + const activeThreshold = new Date(Date.now() - (1000 * 60 * 60 * 24 * 30)); // 30日 + + let users: MiUser[] = []; + + if (me) { + const followingQuery = this.followingsRepository.createQueryBuilder('following') + .select('following.followeeId') + .where('following.followerId = :followerId', { followerId: me.id }); + + const query = setUsernameAndHostQuery() + .andWhere(`user.id IN (${ followingQuery.getQuery() })`) + .andWhere('user.id != :meId', { meId: me.id }) + .andWhere('user.isSuspended = FALSE') + .andWhere(new Brackets(qb => { + qb + .where('user.updatedAt IS NULL') + .orWhere('user.updatedAt > :activeThreshold', { activeThreshold: activeThreshold }); + })); + + query.setParameters(followingQuery.getParameters()); + + users = await query + .orderBy('user.usernameLower', 'ASC') + .limit(ps.limit) + .getMany(); + + if (users.length < ps.limit) { + const otherQuery = setUsernameAndHostQuery() + .andWhere(`user.id NOT IN (${ followingQuery.getQuery() })`) + .andWhere('user.isSuspended = FALSE') + .andWhere('user.updatedAt IS NOT NULL'); + + otherQuery.setParameters(followingQuery.getParameters()); + + const otherUsers = await otherQuery + .orderBy('user.updatedAt', 'DESC') + .limit(ps.limit - users.length) + .getMany(); + + users = users.concat(otherUsers); + } + } else { + const query = setUsernameAndHostQuery() + .andWhere('user.isSuspended = FALSE') + .andWhere('user.updatedAt IS NOT NULL'); + + users = await query + .orderBy('user.updatedAt', 'DESC') + .limit(ps.limit - users.length) + .getMany(); + } + + return await this.userEntityService.packMany(users, me, { detail: !!ps.detail }); }); } } diff --git a/packages/backend/src/server/api/endpoints/users/search.ts b/packages/backend/src/server/api/endpoints/users/search.ts index 0b0136066d..32b5c12372 100644 --- a/packages/backend/src/server/api/endpoints/users/search.ts +++ b/packages/backend/src/server/api/endpoints/users/search.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -57,69 +57,91 @@ export default class extends Endpoint { // eslint- const activeThreshold = new Date(Date.now() - (1000 * 60 * 60 * 24 * 30)); // 30日 ps.query = ps.query.trim(); - const isUsername = ps.query.startsWith('@') && !ps.query.includes(' ') && ps.query.indexOf('@', 1) === -1; + const isUsername = ps.query.startsWith('@'); let users: MiUser[] = []; - const nameQuery = this.usersRepository.createQueryBuilder('user') - .where(new Brackets(qb => { - qb.where('user.name ILIKE :query', { query: '%' + sqlLikeEscape(ps.query) + '%' }); - - if (isUsername) { - qb.orWhere('user.usernameLower LIKE :username', { username: sqlLikeEscape(ps.query.replace('@', '').toLowerCase()) + '%' }); - } else if (this.userEntityService.validateLocalUsername(ps.query)) { // Also search username if it qualifies as username - qb.orWhere('user.usernameLower LIKE :username', { username: '%' + sqlLikeEscape(ps.query.toLowerCase()) + '%' }); - } - })) - .andWhere(new Brackets(qb => { - qb - .where('user.updatedAt IS NULL') - .orWhere('user.updatedAt > :activeThreshold', { activeThreshold: activeThreshold }); - })) - .andWhere('user.isSuspended = FALSE'); - - if (ps.origin === 'local') { - nameQuery.andWhere('user.host IS NULL'); - } else if (ps.origin === 'remote') { - nameQuery.andWhere('user.host IS NOT NULL'); - } - - users = await nameQuery - .orderBy('user.updatedAt', 'DESC', 'NULLS LAST') - .limit(ps.limit) - .offset(ps.offset) - .getMany(); - - if (users.length < ps.limit) { - const profQuery = this.userProfilesRepository.createQueryBuilder('prof') - .select('prof.userId') - .where('prof.description ILIKE :query', { query: '%' + sqlLikeEscape(ps.query) + '%' }); - - if (ps.origin === 'local') { - profQuery.andWhere('prof.userHost IS NULL'); - } else if (ps.origin === 'remote') { - profQuery.andWhere('prof.userHost IS NOT NULL'); - } - - const query = this.usersRepository.createQueryBuilder('user') - .where(`user.id IN (${ profQuery.getQuery() })`) + if (isUsername) { + const usernameQuery = this.usersRepository.createQueryBuilder('user') + .where('user.usernameLower LIKE :username', { username: sqlLikeEscape(ps.query.replace('@', '').toLowerCase()) + '%' }) .andWhere(new Brackets(qb => { qb .where('user.updatedAt IS NULL') .orWhere('user.updatedAt > :activeThreshold', { activeThreshold: activeThreshold }); })) - .andWhere('user.isSuspended = FALSE') - .setParameters(profQuery.getParameters()); + .andWhere('user.isSuspended = FALSE'); - users = users.concat(await query + if (ps.origin === 'local') { + usernameQuery.andWhere('user.host IS NULL'); + } else if (ps.origin === 'remote') { + usernameQuery.andWhere('user.host IS NOT NULL'); + } + + users = await usernameQuery .orderBy('user.updatedAt', 'DESC', 'NULLS LAST') .limit(ps.limit) .offset(ps.offset) - .getMany(), - ); + .getMany(); + } else { + const nameQuery = this.usersRepository.createQueryBuilder('user') + .where(new Brackets(qb => { + qb.where('user.name ILIKE :query', { query: '%' + sqlLikeEscape(ps.query) + '%' }); + + // Also search username if it qualifies as username + if (this.userEntityService.validateLocalUsername(ps.query)) { + qb.orWhere('user.usernameLower LIKE :username', { username: '%' + sqlLikeEscape(ps.query.toLowerCase()) + '%' }); + } + })) + .andWhere(new Brackets(qb => { + qb + .where('user.updatedAt IS NULL') + .orWhere('user.updatedAt > :activeThreshold', { activeThreshold: activeThreshold }); + })) + .andWhere('user.isSuspended = FALSE'); + + if (ps.origin === 'local') { + nameQuery.andWhere('user.host IS NULL'); + } else if (ps.origin === 'remote') { + nameQuery.andWhere('user.host IS NOT NULL'); + } + + users = await nameQuery + .orderBy('user.updatedAt', 'DESC', 'NULLS LAST') + .limit(ps.limit) + .offset(ps.offset) + .getMany(); + + if (users.length < ps.limit) { + const profQuery = this.userProfilesRepository.createQueryBuilder('prof') + .select('prof.userId') + .where('prof.description ILIKE :query', { query: '%' + sqlLikeEscape(ps.query) + '%' }); + + if (ps.origin === 'local') { + profQuery.andWhere('prof.userHost IS NULL'); + } else if (ps.origin === 'remote') { + profQuery.andWhere('prof.userHost IS NOT NULL'); + } + + const query = this.usersRepository.createQueryBuilder('user') + .where(`user.id IN (${ profQuery.getQuery() })`) + .andWhere(new Brackets(qb => { + qb + .where('user.updatedAt IS NULL') + .orWhere('user.updatedAt > :activeThreshold', { activeThreshold: activeThreshold }); + })) + .andWhere('user.isSuspended = FALSE') + .setParameters(profQuery.getParameters()); + + users = users.concat(await query + .orderBy('user.updatedAt', 'DESC', 'NULLS LAST') + .limit(ps.limit) + .offset(ps.offset) + .getMany(), + ); + } } - return await this.userEntityService.packMany(users, me, { schema: ps.detail ? 'UserDetailed' : 'UserLite' }); + return await this.userEntityService.packMany(users, me, { detail: ps.detail }); }); } } diff --git a/packages/backend/src/server/api/endpoints/users/show.ts b/packages/backend/src/server/api/endpoints/users/show.ts index 062326e28d..389497301d 100644 --- a/packages/backend/src/server/api/endpoints/users/show.ts +++ b/packages/backend/src/server/api/endpoints/users/show.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -110,16 +110,14 @@ export default class extends Endpoint { // eslint- }); // リクエストされた通りに並べ替え - // 順番は保持されるけど数は減ってる可能性がある const _users: MiUser[] = []; for (const id of ps.userIds) { - const user = users.find(x => x.id === id); - if (user != null) _users.push(user); + _users.push(users.find(x => x.id === id)!); } - const _userMap = await this.userEntityService.packMany(_users, me, { schema: 'UserDetailed' }) - .then(users => new Map(users.map(u => [u.id, u]))); - return _users.map(u => _userMap.get(u.id)!); + return await Promise.all(_users.map(u => this.userEntityService.pack(u, me, { + detail: true, + }))); } else { // Lookup user if (typeof ps.host === 'string' && typeof ps.username === 'string') { @@ -148,7 +146,7 @@ export default class extends Endpoint { // eslint- } return await this.userEntityService.pack(user, me, { - schema: 'UserDetailed', + detail: true, }); } }); 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 5a10de0c40..b3f67815ef 100644 --- a/packages/backend/src/server/api/endpoints/users/update-memo.ts +++ b/packages/backend/src/server/api/endpoints/users/update-memo.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/error.ts b/packages/backend/src/server/api/error.ts index 2f8322a568..6506565a0d 100644 --- a/packages/backend/src/server/api/error.ts +++ b/packages/backend/src/server/api/error.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/openapi/OpenApiServerService.ts b/packages/backend/src/server/api/openapi/OpenApiServerService.ts index f124aa9f39..cb22d0f7c9 100644 --- a/packages/backend/src/server/api/openapi/OpenApiServerService.ts +++ b/packages/backend/src/server/api/openapi/OpenApiServerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -25,7 +25,7 @@ export class OpenApiServerService { public createServer(fastify: FastifyInstance, _options: FastifyPluginOptions, done: (err?: Error) => void) { fastify.get('/api-doc', async (_request, reply) => { reply.header('Cache-Control', 'public, max-age=86400'); - return await reply.sendFile('/api-doc.html', staticAssets); + return await reply.sendFile('/redoc.html', staticAssets); }); fastify.get('/api.json', (_request, reply) => { reply.header('Cache-Control', 'public, max-age=600'); diff --git a/packages/backend/src/server/api/openapi/errors.ts b/packages/backend/src/server/api/openapi/errors.ts index 7c50122f90..84c3c638fa 100644 --- a/packages/backend/src/server/api/openapi/errors.ts +++ b/packages/backend/src/server/api/openapi/errors.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/api/openapi/gen-spec.ts b/packages/backend/src/server/api/openapi/gen-spec.ts index efa47a6986..0e71510b48 100644 --- a/packages/backend/src/server/api/openapi/gen-spec.ts +++ b/packages/backend/src/server/api/openapi/gen-spec.ts @@ -1,20 +1,21 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import type { Config } from '@/config.js'; import endpoints, { IEndpoint } from '../endpoints.js'; import { errors as basicErrors } from './errors.js'; -import { getSchemas, convertSchemaToOpenApiSchema } from './schemas.js'; +import { schemas, convertSchemaToOpenApiSchema } from './schemas.js'; -export function genOpenapiSpec(config: Config, includeSelfRef = false) { +export function genOpenapiSpec(config: Config) { const spec = { - openapi: '3.1.0', + openapi: '3.0.0', info: { version: config.version, title: 'Misskey API', + 'x-logo': { url: '/static-assets/api-doc.png' }, }, externalDocs: { @@ -29,7 +30,7 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) { paths: {} as any, components: { - schemas: getSchemas(includeSelfRef), + schemas: schemas, securitySchemes: { bearerAuth: { @@ -55,7 +56,7 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) { } } - const resSchema = endpoint.meta.res ? convertSchemaToOpenApiSchema(endpoint.meta.res, 'res', includeSelfRef) : {}; + const resSchema = endpoint.meta.res ? convertSchemaToOpenApiSchema(endpoint.meta.res) : {}; let desc = (endpoint.meta.description ? endpoint.meta.description : 'No description provided.') + '\n\n'; @@ -70,7 +71,7 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) { } const requestType = endpoint.meta.requireFile ? 'multipart/form-data' : 'application/json'; - const schema = { ...convertSchemaToOpenApiSchema(endpoint.params, 'param', false) }; + const schema = { ...endpoint.params }; if (endpoint.meta.requireFile) { schema.properties = { @@ -92,7 +93,7 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) { const hasBody = (schema.type === 'object' && schema.properties && Object.keys(schema.properties).length >= 1); const info = { - operationId: endpoint.name.replaceAll('/', '___'), // NOTE: スラッシュは使えない + operationId: endpoint.name, summary: endpoint.name, description: desc, externalDocs: { @@ -209,9 +210,7 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) { }; spec.paths['/' + endpoint.name] = { - ...(endpoint.meta.allowGet ? { - get: info, - } : {}), + ...(endpoint.meta.allowGet ? { get: info } : {}), post: info, }; } diff --git a/packages/backend/src/server/api/openapi/schemas.ts b/packages/backend/src/server/api/openapi/schemas.ts index eb854a7141..2716f5f162 100644 --- a/packages/backend/src/server/api/openapi/schemas.ts +++ b/packages/backend/src/server/api/openapi/schemas.ts @@ -1,40 +1,37 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import type { Schema } from '@/misc/json-schema.js'; import { refs } from '@/misc/json-schema.js'; -export function convertSchemaToOpenApiSchema(schema: Schema, type: 'param' | 'res', includeSelfRef: boolean): any { - // optional, nullable, refはスキーマ定義に含まれないので分離しておく +export function convertSchemaToOpenApiSchema(schema: Schema) { + // optional, refはスキーマ定義に含まれないので分離しておく // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { optional, nullable, ref, selfRef, ...res }: any = schema; + const { optional, ref, ...res }: any = schema; if (schema.type === 'object' && schema.properties) { - if (type === 'res') { - const required = Object.entries(schema.properties).filter(([k, v]) => !v.optional).map(([k]) => k); - if (required.length > 0) { + const required = Object.entries(schema.properties).filter(([k, v]) => !v.optional).map(([k]) => k); + if (required.length > 0) { // 空配列は許可されない - res.required = required; - } + res.required = required; } for (const k of Object.keys(schema.properties)) { - res.properties[k] = convertSchemaToOpenApiSchema(schema.properties[k], type, includeSelfRef); + res.properties[k] = convertSchemaToOpenApiSchema(schema.properties[k]); } } if (schema.type === 'array' && schema.items) { - res.items = convertSchemaToOpenApiSchema(schema.items, type, includeSelfRef); + res.items = convertSchemaToOpenApiSchema(schema.items); } - for (const o of ['anyOf', 'oneOf', 'allOf'] as const) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - if (o in schema) res[o] = schema[o]!.map(schema => convertSchemaToOpenApiSchema(schema, type, includeSelfRef)); - } + if (schema.anyOf) res.anyOf = schema.anyOf.map(convertSchemaToOpenApiSchema); + if (schema.oneOf) res.oneOf = schema.oneOf.map(convertSchemaToOpenApiSchema); + if (schema.allOf) res.allOf = schema.allOf.map(convertSchemaToOpenApiSchema); - if (type === 'res' && schema.ref && (!schema.selfRef || includeSelfRef)) { + if (schema.ref) { const $ref = `#/components/schemas/${schema.ref}`; if (schema.nullable || schema.optional) { res.allOf = [{ $ref }]; @@ -43,48 +40,38 @@ export function convertSchemaToOpenApiSchema(schema: Schema, type: 'param' | 're } } - if (schema.nullable) { - if (Array.isArray(schema.type) && !schema.type.includes('null')) { - res.type.push('null'); - } else if (typeof schema.type === 'string') { - res.type = [res.type, 'null']; - } - } - return res; } -export function getSchemas(includeSelfRef: boolean) { - return { - Error: { - type: 'object', - properties: { - error: { - type: 'object', - description: 'An error object.', - properties: { - code: { - type: 'string', - description: 'An error code. Unique within the endpoint.', - }, - message: { - type: 'string', - description: 'An error message.', - }, - id: { - type: 'string', - format: 'uuid', - description: 'An error ID. This ID is static.', - }, +export const schemas = { + Error: { + type: 'object', + properties: { + error: { + type: 'object', + description: 'An error object.', + properties: { + code: { + type: 'string', + description: 'An error code. Unique within the endpoint.', + }, + message: { + type: 'string', + description: 'An error message.', + }, + id: { + type: 'string', + format: 'uuid', + description: 'An error ID. This ID is static.', }, - required: ['code', 'id', 'message'], }, + required: ['code', 'id', 'message'], }, - required: ['error'], }, + required: ['error'], + }, - ...Object.fromEntries( - Object.entries(refs).map(([key, schema]) => [key, convertSchemaToOpenApiSchema(schema, 'res', includeSelfRef)]), - ), - }; -} + ...Object.fromEntries( + Object.entries(refs).map(([key, schema]) => [key, convertSchemaToOpenApiSchema(schema)]), + ), +}; diff --git a/packages/backend/src/server/api/stream/ChannelsService.ts b/packages/backend/src/server/api/stream/ChannelsService.ts index 253409259f..3bc5380132 100644 --- a/packages/backend/src/server/api/stream/ChannelsService.ts +++ b/packages/backend/src/server/api/stream/ChannelsService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -19,8 +19,6 @@ import { AntennaChannelService } from './channels/antenna.js'; import { DriveChannelService } from './channels/drive.js'; import { HashtagChannelService } from './channels/hashtag.js'; import { RoleTimelineChannelService } from './channels/role-timeline.js'; -import { ReversiChannelService } from './channels/reversi.js'; -import { ReversiGameChannelService } from './channels/reversi-game.js'; import { type MiChannelService } from './channel.js'; @Injectable() @@ -40,8 +38,6 @@ export class ChannelsService { private serverStatsChannelService: ServerStatsChannelService, private queueStatsChannelService: QueueStatsChannelService, private adminChannelService: AdminChannelService, - private reversiChannelService: ReversiChannelService, - private reversiGameChannelService: ReversiGameChannelService, ) { } @@ -62,8 +58,6 @@ export class ChannelsService { case 'serverStats': return this.serverStatsChannelService; case 'queueStats': return this.queueStatsChannelService; case 'admin': return this.adminChannelService; - case 'reversi': return this.reversiChannelService; - case 'reversiGame': return this.reversiGameChannelService; default: throw new Error(`no such channel: ${name}`); diff --git a/packages/backend/src/server/api/stream/Connection.ts b/packages/backend/src/server/api/stream/Connection.ts index 0fb5238c78..a89fbcc5e5 100644 --- a/packages/backend/src/server/api/stream/Connection.ts +++ b/packages/backend/src/server/api/stream/Connection.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -14,14 +14,10 @@ import { CacheService } from '@/core/CacheService.js'; import { MiFollowing, MiUserProfile } from '@/models/_.js'; import type { StreamEventEmitter, GlobalEvents } from '@/core/GlobalEventService.js'; import { ChannelFollowingService } from '@/core/ChannelFollowingService.js'; -import { isJsonObject } from '@/misc/json-value.js'; -import type { JsonObject, JsonValue } from '@/misc/json-value.js'; import type { ChannelsService } from './ChannelsService.js'; import type { EventEmitter } from 'events'; import type Channel from './channel.js'; -const MAX_CHANNELS_PER_CONNECTION = 32; - /** * Main stream connection */ @@ -32,7 +28,7 @@ export default class Connection { private wsConnection: WebSocket.WebSocket; public subscriber: StreamEventEmitter; private channels: Channel[] = []; - private subscribingNotes: Partial> = {}; + private subscribingNotes: any = {}; private cachedNotes: Packed<'Note'>[] = []; public userProfile: MiUserProfile | null = null; public following: Record | undefined> = {}; @@ -105,7 +101,7 @@ export default class Connection { */ @bindThis private async onWsConnectionMessage(data: WebSocket.RawData) { - let obj: JsonObject; + let obj: Record; try { obj = JSON.parse(data.toString()); @@ -155,8 +151,7 @@ export default class Connection { } @bindThis - private readNote(body: JsonValue | undefined) { - if (!isJsonObject(body)) return; + private readNote(body: any) { const id = body.id; const note = this.cachedNotes.find(n => n.id === id); @@ -168,7 +163,7 @@ export default class Connection { } @bindThis - private onReadNotification(payload: JsonValue | undefined) { + private onReadNotification(payload: any) { this.notificationService.readAllNotification(this.user!.id); } @@ -176,15 +171,16 @@ export default class Connection { * 投稿購読要求時 */ @bindThis - private onSubscribeNote(payload: JsonValue | undefined) { - if (!isJsonObject(payload)) return; - if (!payload.id || typeof payload.id !== 'string') return; + private onSubscribeNote(payload: any) { + if (!payload.id) return; - const current = this.subscribingNotes[payload.id] ?? 0; - const updated = current + 1; - this.subscribingNotes[payload.id] = updated; + if (this.subscribingNotes[payload.id] == null) { + this.subscribingNotes[payload.id] = 0; + } - if (updated === 1) { + this.subscribingNotes[payload.id]++; + + if (this.subscribingNotes[payload.id] === 1) { this.subscriber.on(`noteStream:${payload.id}`, this.onNoteStreamMessage); } } @@ -193,15 +189,11 @@ export default class Connection { * 投稿購読解除要求時 */ @bindThis - private onUnsubscribeNote(payload: JsonValue | undefined) { - if (!isJsonObject(payload)) return; - if (!payload.id || typeof payload.id !== 'string') return; + private onUnsubscribeNote(payload: any) { + if (!payload.id) return; - const current = this.subscribingNotes[payload.id]; - if (current == null) return; - const updated = current - 1; - this.subscribingNotes[payload.id] = updated; - if (updated <= 0) { + this.subscribingNotes[payload.id]--; + if (this.subscribingNotes[payload.id] <= 0) { delete this.subscribingNotes[payload.id]; this.subscriber.off(`noteStream:${payload.id}`, this.onNoteStreamMessage); } @@ -220,24 +212,17 @@ export default class Connection { * チャンネル接続要求時 */ @bindThis - private onChannelConnectRequested(payload: JsonValue | undefined) { - if (!isJsonObject(payload)) return; + private onChannelConnectRequested(payload: any) { const { channel, id, params, pong } = payload; - if (typeof id !== 'string') return; - if (typeof channel !== 'string') return; - if (typeof pong !== 'boolean' && typeof pong !== 'undefined' && pong !== null) return; - if (typeof params !== 'undefined' && !isJsonObject(params)) return; - this.connectChannel(id, params, channel, pong ?? undefined); + this.connectChannel(id, params, channel, pong); } /** * チャンネル切断要求時 */ @bindThis - private onChannelDisconnectRequested(payload: JsonValue | undefined) { - if (!isJsonObject(payload)) return; + private onChannelDisconnectRequested(payload: any) { const { id } = payload; - if (typeof id !== 'string') return; this.disconnectChannel(id); } @@ -245,7 +230,7 @@ export default class Connection { * クライアントにメッセージ送信 */ @bindThis - public sendMessageToWs(type: string, payload: JsonObject) { + public sendMessageToWs(type: string, payload: any) { this.wsConnection.send(JSON.stringify({ type: type, body: payload, @@ -256,11 +241,7 @@ export default class Connection { * チャンネルに接続 */ @bindThis - public connectChannel(id: string, params: JsonObject | undefined, channel: string, pong = false) { - if (this.channels.length >= MAX_CHANNELS_PER_CONNECTION) { - return; - } - + public connectChannel(id: string, params: any, channel: string, pong = false) { const channelService = this.channelsService.getChannelService(channel); if (channelService.requireCredential && this.user == null) { @@ -307,12 +288,7 @@ export default class Connection { * @param data メッセージ */ @bindThis - private onChannelMessageRequested(data: JsonValue | undefined) { - if (!isJsonObject(data)) return; - if (typeof data.id !== 'string') return; - if (typeof data.type !== 'string') return; - if (typeof data.body === 'undefined') return; - + private onChannelMessageRequested(data: any) { const channel = this.channels.find(c => c.id === data.id); if (channel != null && channel.onMessage != null) { channel.onMessage(data.type, data.body); diff --git a/packages/backend/src/server/api/stream/channel.ts b/packages/backend/src/server/api/stream/channel.ts index 84cb552369..80df3803eb 100644 --- a/packages/backend/src/server/api/stream/channel.ts +++ b/packages/backend/src/server/api/stream/channel.ts @@ -1,14 +1,9 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { bindThis } from '@/decorators.js'; -import { isInstanceMuted } from '@/misc/is-instance-muted.js'; -import { isUserRelated } from '@/misc/is-user-related.js'; -import { isRenotePacked, isQuotePacked } from '@/misc/is-renote.js'; -import type { Packed } from '@/misc/json-schema.js'; -import type { JsonObject, JsonValue } from '@/misc/json-value.js'; import type Connection from './Connection.js'; /** @@ -59,35 +54,15 @@ export default abstract class Channel { return this.connection.subscriber; } - /* - * ミュートとブロックされてるを処理する - */ - protected isNoteMutedOrBlocked(note: Packed<'Note'>): boolean { - // 流れてきたNoteがインスタンスミュートしたインスタンスが関わる - if (isInstanceMuted(note, new Set(this.userProfile?.mutedInstances ?? []))) return true; - - // 流れてきたNoteがミュートしているユーザーが関わる - if (isUserRelated(note, this.userIdsWhoMeMuting)) return true; - // 流れてきたNoteがブロックされているユーザーが関わる - if (isUserRelated(note, this.userIdsWhoBlockingMe)) return true; - - // 流れてきたNoteがリノートをミュートしてるユーザが行ったもの - if (isRenotePacked(note) && !isQuotePacked(note) && this.userIdsWhoMeMutingRenotes.has(note.user.id)) return true; - - return false; - } - constructor(id: string, connection: Connection) { this.id = id; this.connection = connection; } - public send(payload: { type: string, body: JsonValue }): void - public send(type: string, payload: JsonValue): void @bindThis - public send(typeOrPayload: { type: string, body: JsonValue } | string, payload?: JsonValue) { - const type = payload === undefined ? (typeOrPayload as { type: string, body: JsonValue }).type : (typeOrPayload as string); - const body = payload === undefined ? (typeOrPayload as { type: string, body: JsonValue }).body : payload; + public send(typeOrPayload: any, payload?: any) { + const type = payload === undefined ? typeOrPayload.type : typeOrPayload; + const body = payload === undefined ? typeOrPayload.body : payload; this.connection.sendMessageToWs('channel', { id: this.id, @@ -96,11 +71,11 @@ export default abstract class Channel { }); } - public abstract init(params: JsonObject): void; + public abstract init(params: any): void; public dispose?(): void; - public onMessage?(type: string, body: JsonValue): void; + public onMessage?(type: string, body: any): void; } export type MiChannelService = { diff --git a/packages/backend/src/server/api/stream/channels/admin.ts b/packages/backend/src/server/api/stream/channels/admin.ts index 355d5dba21..b8f369ce84 100644 --- a/packages/backend/src/server/api/stream/channels/admin.ts +++ b/packages/backend/src/server/api/stream/channels/admin.ts @@ -1,11 +1,10 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Injectable } from '@nestjs/common'; import { bindThis } from '@/decorators.js'; -import type { JsonObject } from '@/misc/json-value.js'; import Channel, { type MiChannelService } from '../channel.js'; class AdminChannel extends Channel { @@ -15,7 +14,7 @@ class AdminChannel extends Channel { public static kind = 'read:admin:stream'; @bindThis - public async init(params: JsonObject) { + public async init(params: any) { // Subscribe admin stream this.subscriber.on(`adminStream:${this.user!.id}`, data => { this.send(data); diff --git a/packages/backend/src/server/api/stream/channels/antenna.ts b/packages/backend/src/server/api/stream/channels/antenna.ts index 53dc7f18b6..200db8eb0e 100644 --- a/packages/backend/src/server/api/stream/channels/antenna.ts +++ b/packages/backend/src/server/api/stream/channels/antenna.ts @@ -1,13 +1,13 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Injectable } from '@nestjs/common'; +import { isUserRelated } from '@/misc/is-user-related.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { bindThis } from '@/decorators.js'; import type { GlobalEvents } from '@/core/GlobalEventService.js'; -import type { JsonObject } from '@/misc/json-value.js'; import Channel, { type MiChannelService } from '../channel.js'; class AntennaChannel extends Channel { @@ -28,9 +28,8 @@ class AntennaChannel extends Channel { } @bindThis - public async init(params: JsonObject) { - if (typeof params.antennaId !== 'string') return; - this.antennaId = params.antennaId; + public async init(params: any) { + this.antennaId = params.antennaId as string; // Subscribe stream this.subscriber.on(`antennaStream:${this.antennaId}`, this.onEvent); @@ -41,7 +40,12 @@ class AntennaChannel extends Channel { if (data.type === 'note') { const note = await this.noteEntityService.pack(data.body.id, this.user, { detail: true }); - if (this.isNoteMutedOrBlocked(note)) return; + // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoMeMuting)) return; + // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoBlockingMe)) return; + + if (note.renote && !note.text && isUserRelated(note, this.userIdsWhoMeMutingRenotes)) return; this.connection.cacheNote(note); diff --git a/packages/backend/src/server/api/stream/channels/channel.ts b/packages/backend/src/server/api/stream/channels/channel.ts index 7108e0cd6e..20275249b8 100644 --- a/packages/backend/src/server/api/stream/channels/channel.ts +++ b/packages/backend/src/server/api/stream/channels/channel.ts @@ -1,14 +1,13 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Injectable } from '@nestjs/common'; +import { isUserRelated } from '@/misc/is-user-related.js'; import type { Packed } from '@/misc/json-schema.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { bindThis } from '@/decorators.js'; -import { isRenotePacked, isQuotePacked } from '@/misc/is-renote.js'; -import type { JsonObject } from '@/misc/json-value.js'; import Channel, { type MiChannelService } from '../channel.js'; class ChannelChannel extends Channel { @@ -28,9 +27,8 @@ class ChannelChannel extends Channel { } @bindThis - public async init(params: JsonObject) { - if (typeof params.channelId !== 'string') return; - this.channelId = params.channelId; + public async init(params: any) { + this.channelId = params.channelId as string; // Subscribe stream this.subscriber.on('notesStream', this.onNote); @@ -40,9 +38,14 @@ class ChannelChannel extends Channel { private async onNote(note: Packed<'Note'>) { if (note.channelId !== this.channelId) return; - if (this.isNoteMutedOrBlocked(note)) return; + // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoMeMuting)) return; + // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoBlockingMe)) return; - if (this.user && isRenotePacked(note) && !isQuotePacked(note)) { + if (note.renote && !note.text && isUserRelated(note, this.userIdsWhoMeMutingRenotes)) return; + + if (this.user && note.renoteId && !note.text) { if (note.renote && Object.keys(note.renote.reactions).length > 0) { const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renote, this.user.id); note.renote.myReaction = myRenoteReaction; diff --git a/packages/backend/src/server/api/stream/channels/drive.ts b/packages/backend/src/server/api/stream/channels/drive.ts index 03768f3d23..4bf34a72c9 100644 --- a/packages/backend/src/server/api/stream/channels/drive.ts +++ b/packages/backend/src/server/api/stream/channels/drive.ts @@ -1,11 +1,10 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Injectable } from '@nestjs/common'; import { bindThis } from '@/decorators.js'; -import type { JsonObject } from '@/misc/json-value.js'; import Channel, { type MiChannelService } from '../channel.js'; class DriveChannel extends Channel { @@ -15,7 +14,7 @@ class DriveChannel extends Channel { public static kind = 'read:account'; @bindThis - public async init(params: JsonObject) { + public async init(params: any) { // Subscribe drive stream this.subscriber.on(`driveStream:${this.user!.id}`, data => { this.send(data); diff --git a/packages/backend/src/server/api/stream/channels/global-timeline.ts b/packages/backend/src/server/api/stream/channels/global-timeline.ts index ed56fe0d40..8df13da8a9 100644 --- a/packages/backend/src/server/api/stream/channels/global-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts @@ -1,16 +1,17 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Injectable } from '@nestjs/common'; +import { checkWordMute } from '@/misc/check-word-mute.js'; +import { isInstanceMuted } from '@/misc/is-instance-muted.js'; +import { isUserRelated } from '@/misc/is-user-related.js'; import type { Packed } from '@/misc/json-schema.js'; import { MetaService } from '@/core/MetaService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { bindThis } from '@/decorators.js'; import { RoleService } from '@/core/RoleService.js'; -import { isRenotePacked, isQuotePacked } from '@/misc/is-renote.js'; -import type { JsonObject } from '@/misc/json-value.js'; import Channel, { type MiChannelService } from '../channel.js'; class GlobalTimelineChannel extends Channel { @@ -33,12 +34,12 @@ class GlobalTimelineChannel extends Channel { } @bindThis - public async init(params: JsonObject) { + public async init(params: any) { const policies = await this.roleService.getUserPolicies(this.user ? this.user.id : null); if (!policies.gtlAvailable) return; - this.withRenotes = !!(params.withRenotes ?? true); - this.withFiles = !!(params.withFiles ?? false); + this.withRenotes = params.withRenotes ?? true; + this.withFiles = params.withFiles ?? false; // Subscribe events this.subscriber.on('notesStream', this.onNote); @@ -51,11 +52,26 @@ class GlobalTimelineChannel extends Channel { if (note.visibility !== 'public') return; if (note.channelId != null) return; - if (isRenotePacked(note) && !isQuotePacked(note) && !this.withRenotes) return; + // 関係ない返信は除外 + if (note.reply && !this.following[note.userId]?.withReplies) { + const reply = note.reply; + // 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合 + if (reply.userId !== this.user!.id && note.userId !== this.user!.id && reply.userId !== note.userId) return; + } - if (this.isNoteMutedOrBlocked(note)) return; + if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return; - if (this.user && isRenotePacked(note) && !isQuotePacked(note)) { + // Ignore notes from instances the user has muted + if (isInstanceMuted(note, new Set(this.userProfile?.mutedInstances ?? []))) return; + + // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoMeMuting)) return; + // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoBlockingMe)) return; + + if (note.renote && !note.text && isUserRelated(note, this.userIdsWhoMeMutingRenotes)) return; + + if (this.user && note.renoteId && !note.text) { if (note.renote && Object.keys(note.renote.reactions).length > 0) { const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renote, this.user.id); note.renote.myReaction = myRenoteReaction; diff --git a/packages/backend/src/server/api/stream/channels/hashtag.ts b/packages/backend/src/server/api/stream/channels/hashtag.ts index 8105f15cb1..3d4f2fc528 100644 --- a/packages/backend/src/server/api/stream/channels/hashtag.ts +++ b/packages/backend/src/server/api/stream/channels/hashtag.ts @@ -1,15 +1,14 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Injectable } from '@nestjs/common'; import { normalizeForSearch } from '@/misc/normalize-for-search.js'; +import { isUserRelated } from '@/misc/is-user-related.js'; import type { Packed } from '@/misc/json-schema.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { bindThis } from '@/decorators.js'; -import { isRenotePacked, isQuotePacked } from '@/misc/is-renote.js'; -import type { JsonObject } from '@/misc/json-value.js'; import Channel, { type MiChannelService } from '../channel.js'; class HashtagChannel extends Channel { @@ -29,11 +28,11 @@ class HashtagChannel extends Channel { } @bindThis - public async init(params: JsonObject) { - if (!Array.isArray(params.q)) return; - if (!params.q.every(x => Array.isArray(x) && x.every(y => typeof y === 'string'))) return; + public async init(params: any) { this.q = params.q; + if (this.q == null) return; + // Subscribe stream this.subscriber.on('notesStream', this.onNote); } @@ -44,9 +43,14 @@ class HashtagChannel extends Channel { const matched = this.q.some(tags => tags.every(tag => noteTags.includes(normalizeForSearch(tag)))); if (!matched) return; - if (this.isNoteMutedOrBlocked(note)) return; + // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoMeMuting)) return; + // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoBlockingMe)) return; - if (this.user && isRenotePacked(note) && !isQuotePacked(note)) { + if (note.renote && !note.text && isUserRelated(note, this.userIdsWhoMeMutingRenotes)) return; + + if (this.user && note.renoteId && !note.text) { if (note.renote && Object.keys(note.renote.reactions).length > 0) { const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renote, this.user.id); note.renote.myReaction = myRenoteReaction; diff --git a/packages/backend/src/server/api/stream/channels/home-timeline.ts b/packages/backend/src/server/api/stream/channels/home-timeline.ts index 66644ed58c..6c9f52ba70 100644 --- a/packages/backend/src/server/api/stream/channels/home-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts @@ -1,14 +1,15 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Injectable } from '@nestjs/common'; +import { checkWordMute } from '@/misc/check-word-mute.js'; +import { isUserRelated } from '@/misc/is-user-related.js'; +import { isInstanceMuted } from '@/misc/is-instance-muted.js'; import type { Packed } from '@/misc/json-schema.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { bindThis } from '@/decorators.js'; -import { isRenotePacked, isQuotePacked } from '@/misc/is-renote.js'; -import type { JsonObject } from '@/misc/json-value.js'; import Channel, { type MiChannelService } from '../channel.js'; class HomeTimelineChannel extends Channel { @@ -30,9 +31,9 @@ class HomeTimelineChannel extends Channel { } @bindThis - public async init(params: JsonObject) { - this.withRenotes = !!(params.withRenotes ?? true); - this.withFiles = !!(params.withFiles ?? false); + public async init(params: any) { + this.withRenotes = params.withRenotes ?? true; + this.withFiles = params.withFiles ?? false; this.subscriber.on('notesStream', this.onNote); } @@ -50,6 +51,9 @@ class HomeTimelineChannel extends Channel { if (!isMe && !Object.hasOwn(this.following, note.userId)) return; } + // Ignore notes from instances the user has muted + if (isInstanceMuted(note, new Set(this.userProfile!.mutedInstances))) return; + if (note.visibility === 'followers') { if (!isMe && !Object.hasOwn(this.following, note.userId)) return; } else if (note.visibility === 'specified') { @@ -60,26 +64,23 @@ class HomeTimelineChannel extends Channel { const reply = note.reply; if (this.following[note.userId]?.withReplies) { // 自分のフォローしていないユーザーの visibility: followers な投稿への返信は弾く - if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId) && reply.userId !== this.user!.id) return; + if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId)) return; } else { // 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合 if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return; } } - // 純粋なリノート(引用リノートでないリノート)の場合 - if (isRenotePacked(note) && !isQuotePacked(note) && note.renote) { - if (!this.withRenotes) return; - if (note.renote.reply) { - const reply = note.renote.reply; - // 自分のフォローしていないユーザーの visibility: followers な投稿への返信のリノートは弾く - if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId) && reply.userId !== this.user!.id) return; - } - } + if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return; - if (this.isNoteMutedOrBlocked(note)) return; + // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoMeMuting)) return; + // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoBlockingMe)) return; - if (this.user && isRenotePacked(note) && !isQuotePacked(note)) { + if (note.renote && !note.text && isUserRelated(note, this.userIdsWhoMeMutingRenotes)) return; + + if (this.user && note.renoteId && !note.text) { if (note.renote && Object.keys(note.renote.reactions).length > 0) { const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renote, this.user.id); note.renote.myReaction = myRenoteReaction; diff --git a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts index 75bd13221f..957d8b6d41 100644 --- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts @@ -1,16 +1,17 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Injectable } from '@nestjs/common'; +import { checkWordMute } from '@/misc/check-word-mute.js'; +import { isUserRelated } from '@/misc/is-user-related.js'; +import { isInstanceMuted } from '@/misc/is-instance-muted.js'; import type { Packed } from '@/misc/json-schema.js'; import { MetaService } from '@/core/MetaService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { bindThis } from '@/decorators.js'; import { RoleService } from '@/core/RoleService.js'; -import { isRenotePacked, isQuotePacked } from '@/misc/is-renote.js'; -import type { JsonObject } from '@/misc/json-value.js'; import Channel, { type MiChannelService } from '../channel.js'; class HybridTimelineChannel extends Channel { @@ -35,13 +36,13 @@ class HybridTimelineChannel extends Channel { } @bindThis - public async init(params: JsonObject): Promise { + public async init(params: any): Promise { const policies = await this.roleService.getUserPolicies(this.user ? this.user.id : null); if (!policies.ltlAvailable) return; - this.withRenotes = !!(params.withRenotes ?? true); - this.withReplies = !!(params.withReplies ?? false); - this.withFiles = !!(params.withFiles ?? false); + this.withRenotes = params.withRenotes ?? true; + this.withReplies = params.withReplies ?? false; + this.withFiles = params.withFiles ?? false; // Subscribe events this.subscriber.on('notesStream', this.onNote); @@ -70,28 +71,28 @@ class HybridTimelineChannel extends Channel { if (!isMe && !note.visibleUserIds!.includes(this.user!.id)) return; } - if (this.isNoteMutedOrBlocked(note)) return; + // Ignore notes from instances the user has muted + if (isInstanceMuted(note, new Set(this.userProfile!.mutedInstances))) return; if (note.reply) { const reply = note.reply; if ((this.following[note.userId]?.withReplies ?? false) || this.withReplies) { // 自分のフォローしていないユーザーの visibility: followers な投稿への返信は弾く - if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId) && reply.userId !== this.user!.id) return; + if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId)) return; } else { // 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合 if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return; } } - // 純粋なリノート(引用リノートでないリノート)の場合 - if (isRenotePacked(note) && !isQuotePacked(note) && note.renote) { - if (!this.withRenotes) return; - if (note.renote.reply) { - const reply = note.renote.reply; - // 自分のフォローしていないユーザーの visibility: followers な投稿への返信のリノートは弾く - if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId) && reply.userId !== this.user!.id) return; - } - } + if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return; + + // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoMeMuting)) return; + // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoBlockingMe)) return; + + if (note.renote && !note.text && isUserRelated(note, this.userIdsWhoMeMutingRenotes)) return; if (this.user && note.renoteId && !note.text) { if (note.renote && Object.keys(note.renote.reactions).length > 0) { diff --git a/packages/backend/src/server/api/stream/channels/local-timeline.ts b/packages/backend/src/server/api/stream/channels/local-timeline.ts index 491029f5de..888d268d56 100644 --- a/packages/backend/src/server/api/stream/channels/local-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/local-timeline.ts @@ -1,16 +1,16 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Injectable } from '@nestjs/common'; +import { checkWordMute } from '@/misc/check-word-mute.js'; +import { isUserRelated } from '@/misc/is-user-related.js'; import type { Packed } from '@/misc/json-schema.js'; import { MetaService } from '@/core/MetaService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { bindThis } from '@/decorators.js'; import { RoleService } from '@/core/RoleService.js'; -import { isQuotePacked, isRenotePacked } from '@/misc/is-renote.js'; -import type { JsonObject } from '@/misc/json-value.js'; import Channel, { type MiChannelService } from '../channel.js'; class LocalTimelineChannel extends Channel { @@ -34,13 +34,13 @@ class LocalTimelineChannel extends Channel { } @bindThis - public async init(params: JsonObject) { + public async init(params: any) { const policies = await this.roleService.getUserPolicies(this.user ? this.user.id : null); if (!policies.ltlAvailable) return; - this.withRenotes = !!(params.withRenotes ?? true); - this.withReplies = !!(params.withReplies ?? false); - this.withFiles = !!(params.withFiles ?? false); + this.withRenotes = params.withRenotes ?? true; + this.withReplies = params.withReplies ?? false; + this.withFiles = params.withFiles ?? false; // Subscribe events this.subscriber.on('notesStream', this.onNote); @@ -61,11 +61,16 @@ class LocalTimelineChannel extends Channel { if (reply.userId !== this.user.id && note.userId !== this.user.id && reply.userId !== note.userId) return; } - if (isRenotePacked(note) && !isQuotePacked(note) && !this.withRenotes) return; + if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return; - if (this.isNoteMutedOrBlocked(note)) return; + // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoMeMuting)) return; + // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoBlockingMe)) return; - if (this.user && isRenotePacked(note) && !isQuotePacked(note)) { + if (note.renote && !note.text && isUserRelated(note, this.userIdsWhoMeMutingRenotes)) return; + + if (this.user && note.renoteId && !note.text) { if (note.renote && Object.keys(note.renote.reactions).length > 0) { const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renote, this.user.id); note.renote.myReaction = myRenoteReaction; diff --git a/packages/backend/src/server/api/stream/channels/main.ts b/packages/backend/src/server/api/stream/channels/main.ts index 863d7f4c4e..ab605e3ec5 100644 --- a/packages/backend/src/server/api/stream/channels/main.ts +++ b/packages/backend/src/server/api/stream/channels/main.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,7 +7,6 @@ import { Injectable } from '@nestjs/common'; import { isInstanceMuted, isUserFromMutedInstance } from '@/misc/is-instance-muted.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { bindThis } from '@/decorators.js'; -import type { JsonObject } from '@/misc/json-value.js'; import Channel, { type MiChannelService } from '../channel.js'; class MainChannel extends Channel { @@ -26,7 +25,7 @@ class MainChannel extends Channel { } @bindThis - public async init(params: JsonObject) { + public async init(params: any) { // Subscribe main stream channel this.subscriber.on(`mainStream:${this.user!.id}`, async data => { switch (data.type) { diff --git a/packages/backend/src/server/api/stream/channels/queue-stats.ts b/packages/backend/src/server/api/stream/channels/queue-stats.ts index 91b62255b4..5ceb2c3bbc 100644 --- a/packages/backend/src/server/api/stream/channels/queue-stats.ts +++ b/packages/backend/src/server/api/stream/channels/queue-stats.ts @@ -1,13 +1,11 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import Xev from 'xev'; import { Injectable } from '@nestjs/common'; import { bindThis } from '@/decorators.js'; -import { isJsonObject } from '@/misc/json-value.js'; -import type { JsonObject, JsonValue } from '@/misc/json-value.js'; import Channel, { type MiChannelService } from '../channel.js'; const ev = new Xev(); @@ -24,22 +22,19 @@ class QueueStatsChannel extends Channel { } @bindThis - public async init(params: JsonObject) { + public async init(params: any) { ev.addListener('queueStats', this.onStats); } @bindThis - private onStats(stats: JsonObject) { + private onStats(stats: any) { this.send('stats', stats); } @bindThis - public onMessage(type: string, body: JsonValue) { + public onMessage(type: string, body: any) { switch (type) { case 'requestLog': - if (!isJsonObject(body)) return; - if (typeof body.id !== 'string') return; - if (typeof body.length !== 'number') return; ev.once(`queueStatsLog:${body.id}`, statsLog => { this.send('statsLog', statsLog); }); diff --git a/packages/backend/src/server/api/stream/channels/reversi-game.ts b/packages/backend/src/server/api/stream/channels/reversi-game.ts deleted file mode 100644 index 7597a1cfa3..0000000000 --- a/packages/backend/src/server/api/stream/channels/reversi-game.ts +++ /dev/null @@ -1,131 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import type { MiReversiGame } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; -import { bindThis } from '@/decorators.js'; -import { ReversiService } from '@/core/ReversiService.js'; -import { ReversiGameEntityService } from '@/core/entities/ReversiGameEntityService.js'; -import { isJsonObject } from '@/misc/json-value.js'; -import type { JsonObject, JsonValue } from '@/misc/json-value.js'; -import Channel, { type MiChannelService } from '../channel.js'; -import { reversiUpdateKeys } from 'misskey-js'; - -class ReversiGameChannel extends Channel { - public readonly chName = 'reversiGame'; - public static shouldShare = false; - public static requireCredential = false as const; - private gameId: MiReversiGame['id'] | null = null; - - constructor( - private reversiService: ReversiService, - private reversiGameEntityService: ReversiGameEntityService, - - id: string, - connection: Channel['connection'], - ) { - super(id, connection); - } - - @bindThis - public async init(params: JsonObject) { - if (typeof params.gameId !== 'string') return; - this.gameId = params.gameId; - - this.subscriber.on(`reversiGameStream:${this.gameId}`, this.send); - } - - @bindThis - public onMessage(type: string, body: JsonValue) { - switch (type) { - case 'ready': - if (typeof body !== 'boolean') return; - this.ready(body); - break; - case 'updateSettings': - if (!isJsonObject(body)) return; - if (!this.reversiService.isValidReversiUpdateKey(body.key)) return; - if (!this.reversiService.isValidReversiUpdateValue(body.key, body.value)) return; - - this.updateSettings(body.key, body.value); - break; - case 'cancel': - this.cancelGame(); - break; - case 'putStone': - if (!isJsonObject(body)) return; - if (typeof body.pos !== 'number') return; - if (typeof body.id !== 'string') return; - this.putStone(body.pos, body.id); - break; - case 'claimTimeIsUp': this.claimTimeIsUp(); break; - } - } - - @bindThis - private async updateSettings(key: K, value: MiReversiGame[K]) { - if (this.user == null) return; - - this.reversiService.updateSettings(this.gameId!, this.user, key, value); - } - - @bindThis - private async ready(ready: boolean) { - if (this.user == null) return; - - this.reversiService.gameReady(this.gameId!, this.user, ready); - } - - @bindThis - private async cancelGame() { - if (this.user == null) return; - - this.reversiService.cancelGame(this.gameId!, this.user); - } - - @bindThis - private async putStone(pos: number, id: string) { - if (this.user == null) return; - - this.reversiService.putStoneToGame(this.gameId!, this.user, pos, id); - } - - @bindThis - private async claimTimeIsUp() { - if (this.user == null) return; - - this.reversiService.checkTimeout(this.gameId!); - } - - @bindThis - public dispose() { - // Unsubscribe events - this.subscriber.off(`reversiGameStream:${this.gameId}`, this.send); - } -} - -@Injectable() -export class ReversiGameChannelService implements MiChannelService { - public readonly shouldShare = ReversiGameChannel.shouldShare; - public readonly requireCredential = ReversiGameChannel.requireCredential; - public readonly kind = ReversiGameChannel.kind; - - constructor( - private reversiService: ReversiService, - private reversiGameEntityService: ReversiGameEntityService, - ) { - } - - @bindThis - public create(id: string, connection: Channel['connection']): ReversiGameChannel { - return new ReversiGameChannel( - this.reversiService, - this.reversiGameEntityService, - id, - connection, - ); - } -} diff --git a/packages/backend/src/server/api/stream/channels/reversi.ts b/packages/backend/src/server/api/stream/channels/reversi.ts deleted file mode 100644 index 6e88939724..0000000000 --- a/packages/backend/src/server/api/stream/channels/reversi.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Injectable } from '@nestjs/common'; -import { bindThis } from '@/decorators.js'; -import type { JsonObject } from '@/misc/json-value.js'; -import Channel, { type MiChannelService } from '../channel.js'; - -class ReversiChannel extends Channel { - public readonly chName = 'reversi'; - public static shouldShare = true; - public static requireCredential = true as const; - public static kind = 'read:account'; - - constructor( - id: string, - connection: Channel['connection'], - ) { - super(id, connection); - } - - @bindThis - public async init(params: JsonObject) { - this.subscriber.on(`reversiStream:${this.user!.id}`, this.send); - } - - @bindThis - public dispose() { - // Unsubscribe events - this.subscriber.off(`reversiStream:${this.user!.id}`, this.send); - } -} - -@Injectable() -export class ReversiChannelService implements MiChannelService { - public readonly shouldShare = ReversiChannel.shouldShare; - public readonly requireCredential = ReversiChannel.requireCredential; - public readonly kind = ReversiChannel.kind; - - constructor( - ) { - } - - @bindThis - public create(id: string, connection: Channel['connection']): ReversiChannel { - return new ReversiChannel( - id, - connection, - ); - } -} diff --git a/packages/backend/src/server/api/stream/channels/role-timeline.ts b/packages/backend/src/server/api/stream/channels/role-timeline.ts index fcfa26c38b..b3bbb77dbf 100644 --- a/packages/backend/src/server/api/stream/channels/role-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/role-timeline.ts @@ -1,14 +1,15 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Injectable } from '@nestjs/common'; +import { isUserRelated } from '@/misc/is-user-related.js'; +import type { Packed } from '@/misc/json-schema.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { bindThis } from '@/decorators.js'; import { RoleService } from '@/core/RoleService.js'; import type { GlobalEvents } from '@/core/GlobalEventService.js'; -import type { JsonObject } from '@/misc/json-value.js'; import Channel, { type MiChannelService } from '../channel.js'; class RoleTimelineChannel extends Channel { @@ -29,9 +30,8 @@ class RoleTimelineChannel extends Channel { } @bindThis - public async init(params: JsonObject) { - if (typeof params.roleId !== 'string') return; - this.roleId = params.roleId; + public async init(params: any) { + this.roleId = params.roleId as string; this.subscriber.on(`roleTimelineStream:${this.roleId}`, this.onEvent); } @@ -46,7 +46,12 @@ class RoleTimelineChannel extends Channel { } if (note.visibility !== 'public') return; - if (this.isNoteMutedOrBlocked(note)) return; + // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoMeMuting)) return; + // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoBlockingMe)) return; + + if (note.renote && !note.text && isUserRelated(note, this.userIdsWhoMeMutingRenotes)) return; this.send('note', note); } else { diff --git a/packages/backend/src/server/api/stream/channels/server-stats.ts b/packages/backend/src/server/api/stream/channels/server-stats.ts index ec5352d12d..615b6946cc 100644 --- a/packages/backend/src/server/api/stream/channels/server-stats.ts +++ b/packages/backend/src/server/api/stream/channels/server-stats.ts @@ -1,13 +1,11 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import Xev from 'xev'; import { Injectable } from '@nestjs/common'; import { bindThis } from '@/decorators.js'; -import { isJsonObject } from '@/misc/json-value.js'; -import type { JsonObject, JsonValue } from '@/misc/json-value.js'; import Channel, { type MiChannelService } from '../channel.js'; const ev = new Xev(); @@ -24,20 +22,19 @@ class ServerStatsChannel extends Channel { } @bindThis - public async init(params: JsonObject) { + public async init(params: any) { ev.addListener('serverStats', this.onStats); } @bindThis - private onStats(stats: JsonObject) { + private onStats(stats: any) { this.send('stats', stats); } @bindThis - public onMessage(type: string, body: JsonValue) { + public onMessage(type: string, body: any) { switch (type) { case 'requestLog': - if (!isJsonObject(body)) return; ev.once(`serverStatsLog:${body.id}`, statsLog => { this.send('statsLog', statsLog); }); 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 4f38351e94..909b5a5e03 100644 --- a/packages/backend/src/server/api/stream/channels/user-list.ts +++ b/packages/backend/src/server/api/stream/channels/user-list.ts @@ -1,16 +1,16 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; import type { MiUserListMembership, UserListMembershipsRepository, UserListsRepository } from '@/models/_.js'; +import { isUserRelated } from '@/misc/is-user-related.js'; import type { Packed } from '@/misc/json-schema.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; -import { isRenotePacked, isQuotePacked } from '@/misc/is-renote.js'; -import type { JsonObject } from '@/misc/json-value.js'; +import { isInstanceMuted } from '@/misc/is-instance-muted.js'; import Channel, { type MiChannelService } from '../channel.js'; class UserListChannel extends Channel { @@ -21,7 +21,6 @@ class UserListChannel extends Channel { private membershipsMap: Record | undefined> = {}; private listUsersClock: NodeJS.Timeout; private withFiles: boolean; - private withRenotes: boolean; constructor( private userListsRepository: UserListsRepository, @@ -37,14 +36,12 @@ class UserListChannel extends Channel { } @bindThis - public async init(params: JsonObject) { - if (typeof params.listId !== 'string') return; - this.listId = params.listId; - this.withFiles = !!(params.withFiles ?? false); - this.withRenotes = !!(params.withRenotes ?? true); + public async init(params: any) { + this.listId = params.listId as string; + this.withFiles = params.withFiles ?? false; // Check existence and owner - const listExist = await this.userListsRepository.exists({ + const listExist = await this.userListsRepository.exist({ where: { id: this.listId, userId: this.user!.id, @@ -107,17 +104,23 @@ class UserListChannel extends Channel { } } - if (isRenotePacked(note) && !isQuotePacked(note) && !this.withRenotes) return; + // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoMeMuting)) return; + // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する + if (isUserRelated(note, this.userIdsWhoBlockingMe)) return; - if (this.isNoteMutedOrBlocked(note)) return; + if (note.renote && !note.text && isUserRelated(note, this.userIdsWhoMeMutingRenotes)) return; - if (this.user && isRenotePacked(note) && !isQuotePacked(note)) { + if (this.user && note.renoteId && !note.text) { if (note.renote && Object.keys(note.renote.reactions).length > 0) { const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renote, this.user.id); note.renote.myReaction = myRenoteReaction; } } + // 流れてきたNoteがミュートしているインスタンスに関わるものだったら無視する + if (isInstanceMuted(note, this.userMutedInstances)) return; + this.connection.cacheNote(note); this.send('note', note); diff --git a/packages/backend/src/server/oauth/OAuth2ProviderService.ts b/packages/backend/src/server/oauth/OAuth2ProviderService.ts index e065c451f1..2253078582 100644 --- a/packages/backend/src/server/oauth/OAuth2ProviderService.ts +++ b/packages/backend/src/server/oauth/OAuth2ProviderService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/web/ClientLoggerService.ts b/packages/backend/src/server/web/ClientLoggerService.ts index 83d8b5bc38..213266f59c 100644 --- a/packages/backend/src/server/web/ClientLoggerService.ts +++ b/packages/backend/src/server/web/ClientLoggerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index 5ebec4ffd0..3e35d5415e 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -9,7 +9,7 @@ import { fileURLToPath } from 'node:url'; import { Inject, Injectable } from '@nestjs/common'; import { createBullBoard } from '@bull-board/api'; import { BullMQAdapter } from '@bull-board/api/bullMQAdapter.js'; -import { FastifyAdapter as BullBoardFastifyAdapter } from '@bull-board/fastify'; +import { FastifyAdapter } from '@bull-board/fastify'; import ms from 'ms'; import sharp from 'sharp'; import pug from 'pug'; @@ -19,49 +19,24 @@ import fastifyView from '@fastify/view'; import fastifyCookie from '@fastify/cookie'; import fastifyProxy from '@fastify/http-proxy'; import vary from 'vary'; -import htmlSafeJsonStringify from 'htmlescape'; import type { Config } from '@/config.js'; import { getNoteSummary } from '@/misc/get-note-summary.js'; import { DI } from '@/di-symbols.js'; import * as Acct from '@/misc/acct.js'; -import type { - DbQueue, - DeliverQueue, - EndedPollNotificationQueue, - InboxQueue, - ObjectStorageQueue, - RelationshipQueue, - SystemQueue, - UserWebhookDeliverQueue, - SystemWebhookDeliverQueue, -} from '@/core/QueueModule.js'; +import { MetaService } from '@/core/MetaService.js'; +import type { DbQueue, DeliverQueue, EndedPollNotificationQueue, InboxQueue, ObjectStorageQueue, SystemQueue, WebhookDeliverQueue } from '@/core/QueueModule.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { PageEntityService } from '@/core/entities/PageEntityService.js'; -import { MetaEntityService } from '@/core/entities/MetaEntityService.js'; import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js'; import { ClipEntityService } from '@/core/entities/ClipEntityService.js'; import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js'; -import type { - AnnouncementsRepository, - ChannelsRepository, - ClipsRepository, - FlashsRepository, - GalleryPostsRepository, - MiMeta, - NotesRepository, - PagesRepository, - ReversiGamesRepository, - UserProfilesRepository, - UsersRepository, -} from '@/models/_.js'; +import type { ChannelsRepository, ClipsRepository, FlashsRepository, GalleryPostsRepository, MiMeta, NotesRepository, PagesRepository, UserProfilesRepository, UsersRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; -import { handleRequestRedirectToOmitSearch } from '@/misc/fastify-hook-handlers.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 { ReversiGameEntityService } from '@/core/entities/ReversiGameEntityService.js'; -import { AnnouncementEntityService } from '@/core/entities/AnnouncementEntityService.js'; import { FeedService } from './FeedService.js'; import { UrlPreviewService } from './UrlPreviewService.js'; import { ClientLoggerService } from './ClientLoggerService.js'; @@ -74,9 +49,7 @@ const staticAssets = `${_dirname}/../../../assets/`; const clientAssets = `${_dirname}/../../../../frontend/assets/`; const assets = `${_dirname}/../../../../../built/_frontend_dist_/`; const swAssets = `${_dirname}/../../../../../built/_sw_dist_/`; -const frontendViteOut = `${_dirname}/../../../../../built/_frontend_vite_/`; -const frontendEmbedViteOut = `${_dirname}/../../../../../built/_frontend_embed_vite_/`; -const tarball = `${_dirname}/../../../../../built/tarball/`; +const viteOut = `${_dirname}/../../../../../built/_vite_/`; @Injectable() export class ClientServerService { @@ -86,9 +59,6 @@ export class ClientServerService { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @@ -113,22 +83,14 @@ export class ClientServerService { @Inject(DI.flashsRepository) private flashsRepository: FlashsRepository, - @Inject(DI.reversiGamesRepository) - private reversiGamesRepository: ReversiGamesRepository, - - @Inject(DI.announcementsRepository) - private announcementsRepository: AnnouncementsRepository, - private flashEntityService: FlashEntityService, private userEntityService: UserEntityService, private noteEntityService: NoteEntityService, private pageEntityService: PageEntityService, - private metaEntityService: MetaEntityService, private galleryPostEntityService: GalleryPostEntityService, private clipEntityService: ClipEntityService, private channelEntityService: ChannelEntityService, - private reversiGameEntityService: ReversiGameEntityService, - private announcementEntityService: AnnouncementEntityService, + private metaService: MetaService, private urlPreviewService: UrlPreviewService, private feedService: FeedService, private roleService: RoleService, @@ -139,40 +101,40 @@ export class ClientServerService { @Inject('queue:deliver') public deliverQueue: DeliverQueue, @Inject('queue:inbox') public inboxQueue: InboxQueue, @Inject('queue:db') public dbQueue: DbQueue, - @Inject('queue:relationship') public relationshipQueue: RelationshipQueue, @Inject('queue:objectStorage') public objectStorageQueue: ObjectStorageQueue, - @Inject('queue:userWebhookDeliver') public userWebhookDeliverQueue: UserWebhookDeliverQueue, - @Inject('queue:systemWebhookDeliver') public systemWebhookDeliverQueue: SystemWebhookDeliverQueue, + @Inject('queue:webhookDeliver') public webhookDeliverQueue: WebhookDeliverQueue, ) { //this.createServer = this.createServer.bind(this); } @bindThis private async manifestHandler(reply: FastifyReply) { + const instance = await this.metaService.fetch(true); + let manifest = { // 空文字列の場合右辺を使いたいため // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - 'short_name': this.meta.shortName || this.meta.name || this.config.host, + 'short_name': instance.shortName || instance.name || this.config.host, // 空文字列の場合右辺を使いたいため // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - 'name': this.meta.name || this.config.host, + 'name': instance.name || this.config.host, 'start_url': '/', 'display': 'standalone', 'background_color': '#313a42', // 空文字列の場合右辺を使いたいため // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - 'theme_color': this.meta.themeColor || '#86b300', + 'theme_color': instance.themeColor || '#86b300', 'icons': [{ // 空文字列の場合右辺を使いたいため // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - 'src': this.meta.app192IconUrl || '/static-assets/icons/192.png', + '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': this.meta.app512IconUrl || '/static-assets/icons/512.png', + 'src': instance.app512IconUrl || '/static-assets/icons/512.png', 'sizes': '512x512', 'type': 'image/png', 'purpose': 'maskable', @@ -196,7 +158,7 @@ export class ClientServerService { manifest = { ...manifest, - ...JSON.parse(this.meta.manifestJsonOverride === '' ? '{}' : this.meta.manifestJsonOverride), + ...JSON.parse(instance.manifestJsonOverride === '' ? '{}' : instance.manifestJsonOverride), }; reply.header('Cache-Control', 'max-age=300'); @@ -204,7 +166,7 @@ export class ClientServerService { } @bindThis - private async generateCommonPugData(meta: MiMeta) { + private generateCommonPugData(meta: MiMeta) { return { instanceName: meta.name ?? 'Misskey', icon: meta.iconUrl, @@ -214,8 +176,6 @@ export class ClientServerService { infoImageUrl: meta.infoImageUrl ?? 'https://xn--931a.moe/assets/info.jpg', notFoundImageUrl: meta.notFoundImageUrl ?? 'https://xn--931a.moe/assets/not-found.jpg', instanceUrl: this.config.url, - metaJson: htmlSafeJsonStringify(await this.metaEntityService.packDetailed(meta)), - now: Date.now(), }; } @@ -228,18 +188,9 @@ export class ClientServerService { // Authenticate fastify.addHook('onRequest', async (request, reply) => { - if (request.routeOptions.url == null) { - reply.code(404).send('Not found'); - return; - } - // %71ueueとかでリクエストされたら困るため const url = decodeURI(request.routeOptions.url); if (url === bullBoardPath || url.startsWith(bullBoardPath + '/')) { - if (!url.startsWith(bullBoardPath + '/static/')) { - reply.header('Cache-Control', 'private, max-age=0, must-revalidate'); - } - const token = request.cookies.token; if (token == null) { reply.code(401).send('Login required'); @@ -258,7 +209,7 @@ export class ClientServerService { } }); - const bullBoardServerAdapter = new BullBoardFastifyAdapter(); + const serverAdapter = new FastifyAdapter(); createBullBoard({ queues: [ @@ -267,16 +218,14 @@ export class ClientServerService { this.deliverQueue, this.inboxQueue, this.dbQueue, - this.relationshipQueue, this.objectStorageQueue, - this.userWebhookDeliverQueue, - this.systemWebhookDeliverQueue, + this.webhookDeliverQueue, ].map(q => new BullMQAdapter(q)), - serverAdapter: bullBoardServerAdapter, + serverAdapter, }); - bullBoardServerAdapter.setBasePath(bullBoardPath); - (fastify.register as any)(bullBoardServerAdapter.registerPlugin(), { prefix: bullBoardPath }); + serverAdapter.setBasePath(bullBoardPath); + (fastify.register as any)(serverAdapter.registerPlugin(), { prefix: bullBoardPath }); //#endregion fastify.register(fastifyView, { @@ -297,24 +246,12 @@ export class ClientServerService { }); //#region vite assets - if (this.config.frontendEmbedManifestExists) { - fastify.register((fastify, options, done) => { - fastify.register(fastifyStatic, { - root: frontendViteOut, - prefix: '/vite/', - maxAge: ms('30 days'), - immutable: true, - decorateReply: false, - }); - fastify.register(fastifyStatic, { - root: frontendEmbedViteOut, - prefix: '/embed_vite/', - maxAge: ms('30 days'), - immutable: true, - decorateReply: false, - }); - fastify.addHook('onRequest', handleRequestRedirectToOmitSearch); - done(); + if (this.config.clientManifestExists) { + fastify.register(fastifyStatic, { + root: viteOut, + prefix: '/vite/', + maxAge: ms('30 days'), + decorateReply: false, }); } else { const port = (process.env.VITE_PORT ?? '5173'); @@ -323,13 +260,6 @@ export class ClientServerService { prefix: '/vite', rewritePrefix: '/vite', }); - - const embedPort = (process.env.EMBED_VITE_PORT ?? '5174'); - fastify.register(fastifyProxy, { - upstream: 'http://localhost:' + embedPort, - prefix: '/embed_vite', - rewritePrefix: '/embed_vite', - }); } //#endregion @@ -356,18 +286,6 @@ export class ClientServerService { decorateReply: false, }); - fastify.register((fastify, options, done) => { - fastify.register(fastifyStatic, { - root: tarball, - prefix: '/tarball/', - maxAge: ms('30 days'), - immutable: true, - decorateReply: false, - }); - fastify.addHook('onRequest', handleRequestRedirectToOmitSearch); - done(); - }); - fastify.get('/favicon.ico', async (request, reply) => { return reply.sendFile('/favicon.ico', staticAssets); }); @@ -459,20 +377,15 @@ export class ClientServerService { // Manifest fastify.get('/manifest.json', async (request, reply) => await this.manifestHandler(reply)); - // Embed Javascript - fastify.get('/embed.js', async (request, reply) => { - return await reply.sendFile('/embed.js', staticAssets, { - maxAge: ms('1 day'), - }); - }); - fastify.get('/robots.txt', async (request, reply) => { return await reply.sendFile('/robots.txt', staticAssets); }); // OpenSearch XML fastify.get('/opensearch.xml', async (request, reply) => { - const name = this.meta.name ?? 'Misskey'; + const meta = await this.metaService.fetch(); + + const name = meta.name ?? 'Misskey'; let content = ''; content += ''; content += `${name}`; @@ -488,15 +401,15 @@ export class ClientServerService { //#endregion - const renderBase = async (reply: FastifyReply, data: { [key: string]: any } = {}) => { + const renderBase = async (reply: FastifyReply) => { + const meta = await this.metaService.fetch(); reply.header('Cache-Control', 'public, max-age=30'); return await reply.view('base', { - img: this.meta.bannerUrl, + img: meta.bannerUrl, url: this.config.url, - title: this.meta.name ?? 'Misskey', - desc: this.meta.description, - ...await this.generateCommonPugData(this.meta), - ...data, + title: meta.name ?? 'Misskey', + desc: meta.description, + ...this.generateCommonPugData(meta), }); }; @@ -515,9 +428,7 @@ export class ClientServerService { }; // Atom - fastify.get<{ Params: { user?: string; } }>('/@:user.atom', async (request, reply) => { - if (request.params.user == null) return await renderBase(reply); - + fastify.get<{ Params: { user: string; } }>('/@:user.atom', async (request, reply) => { const feed = await getFeed(request.params.user); if (feed) { @@ -530,9 +441,7 @@ export class ClientServerService { }); // RSS - fastify.get<{ Params: { user?: string; } }>('/@:user.rss', async (request, reply) => { - if (request.params.user == null) return await renderBase(reply); - + fastify.get<{ Params: { user: string; } }>('/@:user.rss', async (request, reply) => { const feed = await getFeed(request.params.user); if (feed) { @@ -545,9 +454,7 @@ export class ClientServerService { }); // JSON - fastify.get<{ Params: { user?: string; } }>('/@:user.json', async (request, reply) => { - if (request.params.user == null) return await renderBase(reply); - + fastify.get<{ Params: { user: string; } }>('/@:user.json', async (request, reply) => { const feed = await getFeed(request.params.user); if (feed) { @@ -569,10 +476,9 @@ export class ClientServerService { isSuspended: false, }); - vary(reply.raw, 'Accept'); - if (user != null) { const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id }); + const meta = await this.metaService.fetch(); const me = profile.fields ? profile.fields .filter(filed => filed.value != null && filed.value.match(/^https?:/)) @@ -588,7 +494,7 @@ export class ClientServerService { user, profile, me, avatarUrl: user.avatarUrl ?? this.userEntityService.getIdenticonUrl(user), sub: request.params.sub, - ...await this.generateCommonPugData(this.meta), + ...this.generateCommonPugData(meta), }); } else { // リモートユーザーなので @@ -609,8 +515,6 @@ export class ClientServerService { return; } - vary(reply.raw, 'Accept'); - reply.redirect(`/@${user.username}${ user.host == null ? '' : '@' + user.host}`); }); @@ -618,17 +522,15 @@ export class ClientServerService { fastify.get<{ Params: { note: string; } }>('/notes/:note', async (request, reply) => { vary(reply.raw, 'Accept'); - const note = await this.notesRepository.findOne({ - where: { - id: request.params.note, - visibility: In(['public', 'home']), - }, - relations: ['user'], + const note = await this.notesRepository.findOneBy({ + id: request.params.note, + visibility: In(['public', 'home']), }); - if (note && !note.user!.requireSigninToViewContents) { + if (note) { const _note = await this.noteEntityService.pack(note); const profile = await this.userProfilesRepository.findOneByOrFail({ userId: note.userId }); + const meta = await this.metaService.fetch(); reply.header('Cache-Control', 'public, max-age=15'); if (profile.preventAiLearning) { reply.header('X-Robots-Tag', 'noimageai'); @@ -640,7 +542,7 @@ export class ClientServerService { avatarUrl: _note.user.avatarUrl, // TODO: Let locale changeable by instance setting summary: getNoteSummary(_note), - ...await this.generateCommonPugData(this.meta), + ...this.generateCommonPugData(meta), }); } else { return await renderBase(reply); @@ -665,6 +567,7 @@ export class ClientServerService { if (page) { const _page = await this.pageEntityService.pack(page); const profile = await this.userProfilesRepository.findOneByOrFail({ userId: page.userId }); + const meta = await this.metaService.fetch(); if (['public'].includes(page.visibility)) { reply.header('Cache-Control', 'public, max-age=15'); } else { @@ -678,7 +581,7 @@ export class ClientServerService { page: _page, profile, avatarUrl: _page.user.avatarUrl, - ...await this.generateCommonPugData(this.meta), + ...this.generateCommonPugData(meta), }); } else { return await renderBase(reply); @@ -694,6 +597,7 @@ export class ClientServerService { if (flash) { const _flash = await this.flashEntityService.pack(flash); const profile = await this.userProfilesRepository.findOneByOrFail({ userId: flash.userId }); + const meta = await this.metaService.fetch(); reply.header('Cache-Control', 'public, max-age=15'); if (profile.preventAiLearning) { reply.header('X-Robots-Tag', 'noimageai'); @@ -703,7 +607,7 @@ export class ClientServerService { flash: _flash, profile, avatarUrl: _flash.user.avatarUrl, - ...await this.generateCommonPugData(this.meta), + ...this.generateCommonPugData(meta), }); } else { return await renderBase(reply); @@ -719,6 +623,7 @@ export class ClientServerService { if (clip && clip.isPublic) { const _clip = await this.clipEntityService.pack(clip); const profile = await this.userProfilesRepository.findOneByOrFail({ userId: clip.userId }); + const meta = await this.metaService.fetch(); reply.header('Cache-Control', 'public, max-age=15'); if (profile.preventAiLearning) { reply.header('X-Robots-Tag', 'noimageai'); @@ -728,7 +633,7 @@ export class ClientServerService { clip: _clip, profile, avatarUrl: _clip.user.avatarUrl, - ...await this.generateCommonPugData(this.meta), + ...this.generateCommonPugData(meta), }); } else { return await renderBase(reply); @@ -742,6 +647,7 @@ export class ClientServerService { if (post) { const _post = await this.galleryPostEntityService.pack(post); const profile = await this.userProfilesRepository.findOneByOrFail({ userId: post.userId }); + const meta = await this.metaService.fetch(); reply.header('Cache-Control', 'public, max-age=15'); if (profile.preventAiLearning) { reply.header('X-Robots-Tag', 'noimageai'); @@ -751,7 +657,7 @@ export class ClientServerService { post: _post, profile, avatarUrl: _post.user.avatarUrl, - ...await this.generateCommonPugData(this.meta), + ...this.generateCommonPugData(meta), }); } else { return await renderBase(reply); @@ -766,46 +672,11 @@ export class ClientServerService { if (channel) { const _channel = await this.channelEntityService.pack(channel); + const meta = await this.metaService.fetch(); reply.header('Cache-Control', 'public, max-age=15'); return await reply.view('channel', { channel: _channel, - ...await this.generateCommonPugData(this.meta), - }); - } else { - return await renderBase(reply); - } - }); - - // Reversi game - fastify.get<{ Params: { game: string; } }>('/reversi/g/:game', async (request, reply) => { - const game = await this.reversiGamesRepository.findOneBy({ - id: request.params.game, - }); - - if (game) { - const _game = await this.reversiGameEntityService.packDetail(game); - reply.header('Cache-Control', 'public, max-age=3600'); - return await reply.view('reversi-game', { - game: _game, - ...await this.generateCommonPugData(this.meta), - }); - } else { - return await renderBase(reply); - } - }); - - // 個別お知らせページ - fastify.get<{ Params: { announcementId: string; } }>('/announcements/:announcementId', async (request, reply) => { - const announcement = await this.announcementsRepository.findOneBy({ - id: request.params.announcementId, - }); - - if (announcement) { - const _announcement = await this.announcementEntityService.pack(announcement); - reply.header('Cache-Control', 'public, max-age=3600'); - return await reply.view('announcement', { - announcement: _announcement, - ...await this.generateCommonPugData(this.meta), + ...this.generateCommonPugData(meta), }); } else { return await renderBase(reply); @@ -813,107 +684,19 @@ export class ClientServerService { }); //#endregion - //#region noindex pages - // Tags - fastify.get<{ Params: { clip: string; } }>('/tags/:tag', async (request, reply) => { - return await renderBase(reply, { noindex: true }); - }); - - // User with Tags - fastify.get<{ Params: { clip: string; } }>('/user-tags/:tag', async (request, reply) => { - return await renderBase(reply, { noindex: true }); - }); - //#endregion - - //#region embed pages - fastify.get<{ Params: { user: string; } }>('/embed/user-timeline/:user', async (request, reply) => { - reply.removeHeader('X-Frame-Options'); - - const user = await this.usersRepository.findOneBy({ - id: request.params.user, - }); - - if (user == null) return; - if (user.host != null) return; - - const _user = await this.userEntityService.pack(user); - - reply.header('Cache-Control', 'public, max-age=3600'); - return await reply.view('base-embed', { - title: this.meta.name ?? 'Misskey', - ...await this.generateCommonPugData(this.meta), - embedCtx: htmlSafeJsonStringify({ - user: _user, - }), - }); - }); - - fastify.get<{ Params: { note: string; } }>('/embed/notes/:note', async (request, reply) => { - reply.removeHeader('X-Frame-Options'); - - const note = await this.notesRepository.findOneBy({ - id: request.params.note, - }); - - if (note == null) return; - if (note.visibility !== 'public') return; - if (note.userHost != null) return; - - const _note = await this.noteEntityService.pack(note, null, { detail: true }); - - reply.header('Cache-Control', 'public, max-age=3600'); - return await reply.view('base-embed', { - title: this.meta.name ?? 'Misskey', - ...await this.generateCommonPugData(this.meta), - embedCtx: htmlSafeJsonStringify({ - note: _note, - }), - }); - }); - - fastify.get<{ Params: { clip: string; } }>('/embed/clips/:clip', async (request, reply) => { - reply.removeHeader('X-Frame-Options'); - - const clip = await this.clipsRepository.findOneBy({ - id: request.params.clip, - }); - - if (clip == null) return; - - const _clip = await this.clipEntityService.pack(clip); - - reply.header('Cache-Control', 'public, max-age=3600'); - return await reply.view('base-embed', { - title: this.meta.name ?? 'Misskey', - ...await this.generateCommonPugData(this.meta), - embedCtx: htmlSafeJsonStringify({ - clip: _clip, - }), - }); - }); - - fastify.get('/embed/*', async (request, reply) => { - reply.removeHeader('X-Frame-Options'); - - reply.header('Cache-Control', 'public, max-age=3600'); - return await reply.view('base-embed', { - title: this.meta.name ?? 'Misskey', - ...await this.generateCommonPugData(this.meta), - }); - }); - fastify.get('/_info_card_', async (request, reply) => { + const meta = await this.metaService.fetch(true); + reply.removeHeader('X-Frame-Options'); return await reply.view('info-card', { version: this.config.version, host: this.config.host, - meta: this.meta, + meta: meta, originalUsersCount: await this.usersRepository.countBy({ host: IsNull() }), originalNotesCount: await this.notesRepository.countBy({ userHost: IsNull() }), }); }); - //#endregion fastify.get('/bios', async (request, reply) => { return await reply.view('bios', { diff --git a/packages/backend/src/server/web/FeedService.ts b/packages/backend/src/server/web/FeedService.ts index 9d810ddc84..dfda85aac9 100644 --- a/packages/backend/src/server/web/FeedService.ts +++ b/packages/backend/src/server/web/FeedService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -14,8 +14,6 @@ import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; import { bindThis } from '@/decorators.js'; import { IdService } from '@/core/IdService.js'; -import { MfmService } from "@/core/MfmService.js"; -import { parse as mfmParse } from 'mfm-js'; @Injectable() export class FeedService { @@ -35,7 +33,6 @@ export class FeedService { private userEntityService: UserEntityService, private driveFileEntityService: DriveFileEntityService, private idService: IdService, - private mfmService: MfmService, ) { } @@ -79,14 +76,13 @@ export class FeedService { id: In(note.fileIds), }) : []; const file = files.find(file => file.type.startsWith('image/')); - const text = note.text; feed.addItem({ title: `New note by ${author.name}`, link: `${this.config.url}/notes/${note.id}`, date: this.idService.parse(note.id).date, description: note.cw ?? undefined, - content: text ? this.mfmService.toHtml(mfmParse(text), JSON.parse(note.mentionedRemoteUsers)) ?? undefined : undefined, + content: note.text ?? undefined, image: file ? this.driveFileEntityService.getPublicUrl(file) : undefined, }); } diff --git a/packages/backend/src/server/web/UrlPreviewService.ts b/packages/backend/src/server/web/UrlPreviewService.ts index 5d493c2c46..d590244e34 100644 --- a/packages/backend/src/server/web/UrlPreviewService.ts +++ b/packages/backend/src/server/web/UrlPreviewService.ts @@ -1,20 +1,19 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { Inject, Injectable } from '@nestjs/common'; -import { summaly } from '@misskey-dev/summaly'; -import { SummalyResult } from '@misskey-dev/summaly/built/summary.js'; +import { summaly } from 'summaly'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; +import { MetaService } from '@/core/MetaService.js'; import { HttpRequestService } from '@/core/HttpRequestService.js'; import type Logger from '@/logger.js'; import { query } from '@/misc/prelude/url.js'; import { LoggerService } from '@/core/LoggerService.js'; import { bindThis } from '@/decorators.js'; import { ApiError } from '@/server/api/error.js'; -import { MiMeta } from '@/models/Meta.js'; import type { FastifyRequest, FastifyReply } from 'fastify'; @Injectable() @@ -25,9 +24,7 @@ export class UrlPreviewService { @Inject(DI.config) private config: Config, - @Inject(DI.meta) - private meta: MiMeta, - + private metaService: MetaService, private httpRequestService: HttpRequestService, private loggerService: LoggerService, ) { @@ -63,25 +60,26 @@ export class UrlPreviewService { return; } - if (!this.meta.urlPreviewEnabled) { - reply.code(403); - return { - error: new ApiError({ - message: 'URL preview is disabled', - code: 'URL_PREVIEW_DISABLED', - id: '58b36e13-d2f5-0323-b0c6-76aa9dabefb8', - }), - }; - } + const meta = await this.metaService.fetch(); - this.logger.info(this.meta.urlPreviewSummaryProxyUrl + this.logger.info(meta.summalyProxy ? `(Proxy) Getting preview of ${url}@${lang} ...` : `Getting preview of ${url}@${lang} ...`); - try { - const summary = this.meta.urlPreviewSummaryProxyUrl - ? await this.fetchSummaryFromProxy(url, this.meta, lang) - : await this.fetchSummary(url, this.meta, lang); + const summary = meta.summalyProxy ? + await this.httpRequestService.getJson>(`${meta.summalyProxy}?${query({ + url: url, + lang: lang ?? 'ja-JP', + })}`) + : + await summaly(url, { + followRedirects: false, + lang: lang ?? 'ja-JP', + agent: this.config.proxy ? { + http: this.httpRequestService.httpAgent, + https: this.httpRequestService.httpsAgent, + } : undefined, + }); this.logger.succ(`Got preview of ${url}: ${summary.title}`); @@ -102,7 +100,6 @@ export class UrlPreviewService { return summary; } catch (err) { this.logger.warn(`Failed to get preview of ${url}: ${err}`); - reply.code(422); reply.header('Cache-Control', 'max-age=86400, immutable'); return { @@ -114,37 +111,4 @@ export class UrlPreviewService { }; } } - - private fetchSummary(url: string, meta: MiMeta, lang?: string): Promise { - const agent = this.config.proxy - ? { - http: this.httpRequestService.httpAgent, - https: this.httpRequestService.httpsAgent, - } - : undefined; - - return summaly(url, { - followRedirects: false, - lang: lang ?? 'ja-JP', - agent: agent, - userAgent: meta.urlPreviewUserAgent ?? undefined, - operationTimeout: meta.urlPreviewTimeout, - contentLengthLimit: meta.urlPreviewMaximumContentLength, - contentLengthRequired: meta.urlPreviewRequireContentLength, - }); - } - - private fetchSummaryFromProxy(url: string, meta: MiMeta, lang?: string): Promise { - const proxy = meta.urlPreviewSummaryProxyUrl!; - const queryStr = query({ - url: url, - lang: lang ?? 'ja-JP', - userAgent: meta.urlPreviewUserAgent ?? undefined, - operationTimeout: meta.urlPreviewTimeout, - contentLengthLimit: meta.urlPreviewMaximumContentLength, - contentLengthRequired: meta.urlPreviewRequireContentLength, - }); - - return this.httpRequestService.getJson(`${proxy}?${queryStr}`); - } } diff --git a/packages/backend/src/server/web/bios.css b/packages/backend/src/server/web/bios.css index 91d1af10b4..c934a55fa9 100644 --- a/packages/backend/src/server/web/bios.css +++ b/packages/backend/src/server/web/bios.css @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/web/bios.js b/packages/backend/src/server/web/bios.js index 9ff5dca72a..029eb92aad 100644 --- a/packages/backend/src/server/web/bios.js +++ b/packages/backend/src/server/web/bios.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/web/boot.embed.js b/packages/backend/src/server/web/boot.embed.js deleted file mode 100644 index 48d1cd262b..0000000000 --- a/packages/backend/src/server/web/boot.embed.js +++ /dev/null @@ -1,219 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -'use strict'; - -// ブロックの中に入れないと、定義した変数がブラウザのグローバルスコープに登録されてしまい邪魔なので -(async () => { - window.onerror = (e) => { - console.error(e); - renderError('SOMETHING_HAPPENED'); - }; - window.onunhandledrejection = (e) => { - console.error(e); - renderError('SOMETHING_HAPPENED_IN_PROMISE'); - }; - - let forceError = localStorage.getItem('forceError'); - if (forceError != null) { - renderError('FORCED_ERROR', 'This error is forced by having forceError in local storage.'); - return; - } - - // パラメータに応じてsplashのスタイルを変更 - const params = new URLSearchParams(location.search); - if (params.has('rounded') && params.get('rounded') === 'false') { - document.documentElement.classList.add('norounded'); - } - if (params.has('border') && params.get('border') === 'false') { - document.documentElement.classList.add('noborder'); - } - - //#region Detect language & fetch translations - if (!localStorage.hasOwnProperty('locale')) { - const supportedLangs = LANGS; - let lang = localStorage.getItem('lang'); - if (lang == null || !supportedLangs.includes(lang)) { - if (supportedLangs.includes(navigator.language)) { - lang = navigator.language; - } else { - lang = supportedLangs.find(x => x.split('-')[0] === navigator.language); - - // Fallback - if (lang == null) lang = 'en-US'; - } - } - - const metaRes = await window.fetch('/api/meta', { - method: 'POST', - body: JSON.stringify({}), - credentials: 'omit', - cache: 'no-cache', - headers: { - 'Content-Type': 'application/json', - }, - }); - if (metaRes.status !== 200) { - renderError('META_FETCH'); - return; - } - const meta = await metaRes.json(); - const v = meta.version; - if (v == null) { - renderError('META_FETCH_V'); - return; - } - - // for https://github.com/misskey-dev/misskey/issues/10202 - if (lang == null || lang.toString == null || lang.toString() === 'null') { - console.error('invalid lang value detected!!!', typeof lang, lang); - lang = 'en-US'; - } - - const localRes = await window.fetch(`/assets/locales/${lang}.${v}.json`); - if (localRes.status === 200) { - localStorage.setItem('lang', lang); - localStorage.setItem('locale', await localRes.text()); - localStorage.setItem('localeVersion', v); - } else { - renderError('LOCALE_FETCH'); - return; - } - } - //#endregion - - //#region Script - async function importAppScript() { - await import(`/embed_vite/${CLIENT_ENTRY}`) - .catch(async e => { - console.error(e); - renderError('APP_IMPORT'); - }); - } - - // タイミングによっては、この時点でDOMの構築が済んでいる場合とそうでない場合とがある - if (document.readyState !== 'loading') { - importAppScript(); - } else { - window.addEventListener('DOMContentLoaded', () => { - importAppScript(); - }); - } - //#endregion - - async function addStyle(styleText) { - let css = document.createElement('style'); - css.appendChild(document.createTextNode(styleText)); - document.head.appendChild(css); - } - - async function renderError(code) { - // Cannot set property 'innerHTML' of null を回避 - if (document.readyState === 'loading') { - await new Promise(resolve => window.addEventListener('DOMContentLoaded', resolve)); - } - document.body.innerHTML = ` -

-
Failed to initialize Misskey
-
Error Code: ${code}
- `; - addStyle(` - #misskey_app, - #splash { - display: none !important; - } - - html, - body { - margin: 0; - } - - body { - position: relative; - color: #dee7e4; - font-family: Hiragino Maru Gothic Pro, BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif; - line-height: 1.35; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - min-height: 100vh; - margin: 0; - padding: 24px; - box-sizing: border-box; - overflow: hidden; - - border-radius: var(--radius, 12px); - border: 1px solid rgba(231, 255, 251, 0.14); - } - - body::before { - content: ''; - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: #192320; - border-radius: var(--radius, 12px); - z-index: -1; - } - - html.embed.norounded body, - html.embed.norounded body::before { - border-radius: 0; - } - - html.embed.noborder body { - border: none; - } - - .icon { - max-width: 60px; - width: 100%; - height: auto; - margin-bottom: 20px; - color: #dec340; - } - - .message { - text-align: center; - font-size: 20px; - font-weight: 700; - margin-bottom: 20px; - } - - .submessage { - text-align: center; - font-size: 90%; - margin-bottom: 7.5px; - } - - .submessage:last-of-type { - margin-bottom: 20px; - } - - button { - padding: 7px 14px; - min-width: 100px; - font-weight: 700; - font-family: Hiragino Maru Gothic Pro, BIZ UDGothic, Roboto, HelveticaNeue, Arial, sans-serif; - line-height: 1.35; - border-radius: 99rem; - background-color: #b4e900; - color: #192320; - border: none; - cursor: pointer; - -webkit-tap-highlight-color: transparent; - } - - button:hover { - background-color: #c6ff03; - }`); - } -})(); diff --git a/packages/backend/src/server/web/boot.js b/packages/backend/src/server/web/boot.js index a04640d993..c6b52a7a6b 100644 --- a/packages/backend/src/server/web/boot.js +++ b/packages/backend/src/server/web/boot.js @@ -1,8 +1,19 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ +/** + * BOOT LOADER + * サーバーからレスポンスされるHTMLに埋め込まれるスクリプトで、以下の役割を持ちます。 + * - 翻訳ファイルをフェッチする。 + * - バージョンに基づいて適切なメインスクリプトを読み込む。 + * - キャッシュされたコンパイル済みテーマを適用する。 + * - クライアントの設定値に基づいて対応するHTMLクラス等を設定する。 + * テーマをこの段階で設定するのは、メインスクリプトが読み込まれる間もテーマを適用したいためです。 + * 注: webpackは介さないため、このファイルではrequireやimportは使えません。 + */ + 'use strict'; // ブロックの中に入れないと、定義した変数がブラウザのグローバルスコープに登録されてしまい邪魔なので @@ -18,8 +29,7 @@ let forceError = localStorage.getItem('forceError'); if (forceError != null) { - renderError('FORCED_ERROR', 'This error is forced by having forceError in local storage.'); - return; + renderError('FORCED_ERROR', 'This error is forced by having forceError in local storage.') } //#region Detect language & fetch translations @@ -76,8 +86,8 @@ //#endregion //#region Script - async function importAppScript() { - await import(`/vite/${CLIENT_ENTRY}`) + function importAppScript() { + import(`/vite/${CLIENT_ENTRY}`) .catch(async e => { console.error(e); renderError('APP_IMPORT', e); @@ -98,7 +108,7 @@ const theme = localStorage.getItem('theme'); if (theme) { for (const [k, v] of Object.entries(JSON.parse(theme))) { - document.documentElement.style.setProperty(`--MI_THEME-${k}`, v.toString()); + document.documentElement.style.setProperty(`--${k}`, v.toString()); // HTMLの theme-color 適用 if (k === 'htmlThemeColor') { @@ -145,17 +155,12 @@ document.head.appendChild(css); } - async function renderError(code, details) { - // Cannot set property 'innerHTML' of null を回避 - if (document.readyState === 'loading') { - await new Promise(resolve => window.addEventListener('DOMContentLoaded', resolve)); - } - + function renderError(code, details) { let errorsElement = document.getElementById('errors'); if (!errorsElement) { document.body.innerHTML = ` - + @@ -165,10 +170,10 @@ Reload / リロード

The following actions may solve the problem. / 以下を行うと解決する可能性があります。

+

Clear the browser cache / ブラウザのキャッシュをクリアする

Update your os and browser / ブラウザおよびOSを最新バージョンに更新する

Disable an adblocker / アドブロッカーを無効にする

-

Clear the browser cache / ブラウザのキャッシュをクリアする

-

(Tor Browser) Set dom.webaudio.enabled to true / dom.webaudio.enabledをtrueに設定する

+

(Tor Browser) Set dom.webaudio.enabled to true / dom.webaudio.enabledをtrueに設定する

Other options / その他のオプション @@ -201,7 +206,7 @@ ERROR CODE: ${code} - ${details.toString()} ${JSON.stringify(details)}`; + ${JSON.stringify(details)}`; errorsElement.appendChild(detailsElement); addStyle(` * { @@ -309,6 +314,6 @@ #errorInfo { width: 50%; } - }`); + `) } })(); diff --git a/packages/backend/src/server/web/cli.css b/packages/backend/src/server/web/cli.css index 4e6136d59c..b7737c3f21 100644 --- a/packages/backend/src/server/web/cli.css +++ b/packages/backend/src/server/web/cli.css @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/web/cli.js b/packages/backend/src/server/web/cli.js index 30ee77f4d9..e63a80327c 100644 --- a/packages/backend/src/server/web/cli.js +++ b/packages/backend/src/server/web/cli.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/server/web/error.css b/packages/backend/src/server/web/error.css index f2b63296eb..ea3056bdaf 100644 --- a/packages/backend/src/server/web/error.css +++ b/packages/backend/src/server/web/error.css @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -113,4 +113,4 @@ summary > * { details { width: 50%; } -} +} \ No newline at end of file diff --git a/packages/backend/src/server/web/style.css b/packages/backend/src/server/web/style.css index 5d81f2bed0..952be9bf0b 100644 --- a/packages/backend/src/server/web/style.css +++ b/packages/backend/src/server/web/style.css @@ -1,12 +1,12 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * * SPDX-License-Identifier: AGPL-3.0-only */ html { - background-color: var(--MI_THEME-bg); - color: var(--MI_THEME-fg); + background-color: var(--bg); + color: var(--fg); } #splash { @@ -17,7 +17,7 @@ html { width: 100vw; height: 100vh; cursor: wait; - background-color: var(--MI_THEME-bg); + background-color: var(--bg); opacity: 1; transition: opacity 0.5s ease; } @@ -45,9 +45,8 @@ html { width: 28px; height: 28px; transform: translateY(70px); - color: var(--MI_THEME-accent); + color: var(--accent); } - #splashSpinner > .spinner { position: absolute; top: 0; diff --git a/packages/backend/src/server/web/style.embed.css b/packages/backend/src/server/web/style.embed.css deleted file mode 100644 index 5e8786cc4e..0000000000 --- a/packages/backend/src/server/web/style.embed.css +++ /dev/null @@ -1,99 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * - * SPDX-License-Identifier: AGPL-3.0-only - */ - -html { - background-color: var(--MI_THEME-bg); - color: var(--MI_THEME-fg); -} - -html.embed { - box-sizing: border-box; - background-color: transparent; - color-scheme: light dark; - max-width: 500px; -} - -#splash { - position: fixed; - z-index: 10000; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - cursor: wait; - background-color: var(--MI_THEME-bg); - opacity: 1; - transition: opacity 0.5s ease; -} - -html.embed #splash { - box-sizing: border-box; - min-height: 300px; - border-radius: var(--radius, 12px); - border: 1px solid var(--MI_THEME-divider, #e8e8e8); -} - -html.embed.norounded #splash { - border-radius: 0; -} - -html.embed.noborder #splash { - border: none; -} - -#splashIcon { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - margin: auto; - width: 64px; - height: 64px; - pointer-events: none; -} - -#splashSpinner { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - margin: auto; - display: inline-block; - width: 28px; - height: 28px; - transform: translateY(70px); - color: var(--MI_THEME-accent); -} - -#splashSpinner > .spinner { - position: absolute; - top: 0; - left: 0; - width: 28px; - height: 28px; - fill-rule: evenodd; - clip-rule: evenodd; - stroke-linecap: round; - stroke-linejoin: round; - stroke-miterlimit: 1.5; -} -#splashSpinner > .spinner.bg { - opacity: 0.275; -} -#splashSpinner > .spinner.fg { - animation: splashSpinner 0.5s linear infinite; -} - -@keyframes splashSpinner { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } -} diff --git a/packages/backend/src/server/web/views/announcement.pug b/packages/backend/src/server/web/views/announcement.pug deleted file mode 100644 index 7a4052e8a4..0000000000 --- a/packages/backend/src/server/web/views/announcement.pug +++ /dev/null @@ -1,21 +0,0 @@ -extends ./base - -block vars - - const title = announcement.title; - - const description = announcement.text.length > 100 ? announcement.text.slice(0, 100) + '…' : announcement.text; - - const url = `${config.url}/announcements/${announcement.id}`; - -block title - = `${title} | ${instanceName}` - -block desc - meta(name='description' content=description) - -block og - meta(property='og:type' content='article') - meta(property='og:title' content= title) - meta(property='og:description' content= description) - meta(property='og:url' content= url) - if announcement.imageUrl - meta(property='og:image' content=announcement.imageUrl) - meta(property='twitter:card' content='summary_large_image') diff --git a/packages/backend/src/server/web/views/base-embed.pug b/packages/backend/src/server/web/views/base-embed.pug deleted file mode 100644 index baa0909676..0000000000 --- a/packages/backend/src/server/web/views/base-embed.pug +++ /dev/null @@ -1,72 +0,0 @@ -block vars - -block loadClientEntry - - const entry = config.frontendEmbedEntry; - -doctype html - -html(class='embed') - - head - meta(charset='utf-8') - meta(name='application-name' content='Misskey') - meta(name='referrer' content='origin') - meta(name='theme-color' content= themeColor || '#86b300') - meta(name='theme-color-orig' content= themeColor || '#86b300') - meta(property='og:site_name' content= instanceName || 'Misskey') - meta(property='instance_url' content= instanceUrl) - meta(name='viewport' content='width=device-width, initial-scale=1') - meta(name='format-detection' content='telephone=no,date=no,address=no,email=no,url=no') - link(rel='icon' href= icon || '/favicon.ico') - link(rel='apple-touch-icon' href= appleTouchIcon || '/apple-touch-icon.png') - link(rel='modulepreload' href=`/embed_vite/${entry.file}`) - - if !config.frontendEmbedManifestExists - script(type="module" src="/embed_vite/@vite/client") - - if Array.isArray(entry.css) - each href in entry.css - link(rel='stylesheet' href=`/embed_vite/${href}`) - - title - block title - = title || 'Misskey' - - block meta - meta(name='robots' content='noindex') - - style - include ../style.embed.css - - script. - var VERSION = "#{version}"; - var CLIENT_ENTRY = "#{entry.file}"; - - script(type='application/json' id='misskey_meta' data-generated-at=now) - != metaJson - - script(type='application/json' id='misskey_embedCtx' data-generated-at=now) - != embedCtx - - script - include ../boot.embed.js - - body - noscript: p - | JavaScriptを有効にしてください - br - | Please turn on your JavaScript - div#splash - img#splashIcon(src= icon || '/static-assets/splash.png') - div#splashSpinner - - - - - - - - - - - block content diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index 280a5923c2..d167afe1e8 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -1,8 +1,7 @@ block vars block loadClientEntry - - const entry = config.frontendEntry; - - const baseUrl = config.url; + - const clientEntry = config.clientEntry; doctype html @@ -29,30 +28,28 @@ html meta(property='og:site_name' content= instanceName || 'Misskey') meta(property='instance_url' content= instanceUrl) meta(name='viewport' content='width=device-width, initial-scale=1') - meta(name='format-detection' content='telephone=no,date=no,address=no,email=no,url=no') link(rel='icon' href= icon || '/favicon.ico') 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=`${baseUrl}/opensearch.xml`) + 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) - link(rel='modulepreload' href=`/vite/${entry.file}`) + //- https://github.com/misskey-dev/misskey/issues/9842 + link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.min.css?v2.44.0') + link(rel='modulepreload' href=`/vite/${clientEntry.file}`) - if !config.frontendManifestExists + if !config.clientManifestExists script(type="module" src="/vite/@vite/client") - if Array.isArray(entry.css) - each href in entry.css + if Array.isArray(clientEntry.css) + each href in clientEntry.css link(rel='stylesheet' href=`/vite/${href}`) title block title = title || 'Misskey' - if noindex - meta(name='robots' content='noindex') - block desc meta(name='description' content= desc || '✨🌎✨ A interplanetary communication platform ✨🚀✨') @@ -69,10 +66,7 @@ html script. var VERSION = "#{version}"; - var CLIENT_ENTRY = "#{entry.file}"; - - script(type='application/json' id='misskey_meta' data-generated-at=now) - != metaJson + var CLIENT_ENTRY = "#{clientEntry.file}"; script include ../boot.js diff --git a/packages/backend/src/server/web/views/note.pug b/packages/backend/src/server/web/views/note.pug index fb659ce171..9bc652b6a1 100644 --- a/packages/backend/src/server/web/views/note.pug +++ b/packages/backend/src/server/web/views/note.pug @@ -2,7 +2,7 @@ extends ./base block vars - const user = note.user; - - const title = user.name ? `${user.name} (@${user.username}${user.host ? `@${user.host}` : ''})` : `@${user.username}${user.host ? `@${user.host}` : ''}`; + - const title = user.name ? `${user.name} (@${user.username})` : `@${user.username}`; - const url = `${config.url}/notes/${note.id}`; - const isRenote = note.renote && note.text == null && note.fileIds.length == 0 && note.poll == null; - const images = (note.files || []).filter(file => file.type.startsWith('image/') && !file.isSensitive) @@ -28,7 +28,7 @@ block og // FIXME: add embed player for Twitter if images.length meta(property='twitter:card' content='summary_large_image') - each image in images + each image in images meta(property='og:image' content= image.url) else meta(property='twitter:card' content='summary') diff --git a/packages/backend/src/server/web/views/page.pug b/packages/backend/src/server/web/views/page.pug index 03c50eca8a..08bb08ffe7 100644 --- a/packages/backend/src/server/web/views/page.pug +++ b/packages/backend/src/server/web/views/page.pug @@ -3,7 +3,7 @@ extends ./base block vars - const user = page.user; - const title = page.title; - - const url = `${config.url}/@${user.username}/pages/${page.name}`; + - const url = `${config.url}/@${user.username}/${page.name}`; block title = `${title} | ${instanceName}` diff --git a/packages/backend/src/server/web/views/reversi-game.pug b/packages/backend/src/server/web/views/reversi-game.pug deleted file mode 100644 index 0b5ffb2bb0..0000000000 --- a/packages/backend/src/server/web/views/reversi-game.pug +++ /dev/null @@ -1,20 +0,0 @@ -extends ./base - -block vars - - const user1 = game.user1; - - const user2 = game.user2; - - const title = `${user1.username} vs ${user2.username}`; - - const url = `${config.url}/reversi/g/${game.id}`; - -block title - = `${title} | ${instanceName}` - -block desc - meta(name='description' content='⚫⚪Misskey Reversi⚪⚫') - -block og - meta(property='og:type' content='article') - meta(property='og:title' content= title) - meta(property='og:description' content='⚫⚪Misskey Reversi⚪⚫') - meta(property='og:url' content= url) - meta(property='twitter:card' content='summary') diff --git a/packages/backend/src/server/web/views/user.pug b/packages/backend/src/server/web/views/user.pug index 2b0a7bab5c..83d57349a6 100644 --- a/packages/backend/src/server/web/views/user.pug +++ b/packages/backend/src/server/web/views/user.pug @@ -1,7 +1,7 @@ extends ./base block vars - - const title = user.name ? `${user.name} (@${user.username}${user.host ? `@${user.host}` : ''})` : `@${user.username}${user.host ? `@${user.host}` : ''}`; + - const title = user.name ? `${user.name} (@${user.username})` : `@${user.username}`; - const url = `${config.url}/@${(user.host ? `${user.username}@${user.host}` : user.username)}`; block title diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts index df3cfee171..361a4931eb 100644 --- a/packages/backend/src/types.ts +++ b/packages/backend/src/types.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -16,8 +16,6 @@ * followRequestAccepted - 自分の送ったフォローリクエストが承認された * roleAssigned - ロールが付与された * achievementEarned - 実績を獲得 - * exportCompleted - エクスポートが完了 - * login - ログイン * app - アプリ通知 * test - テスト通知(サーバー側) */ @@ -34,18 +32,8 @@ export const notificationTypes = [ 'followRequestAccepted', 'roleAssigned', 'achievementEarned', - 'exportCompleted', - 'login', 'app', - 'test', -] as const; - -export const groupedNotificationTypes = [ - ...notificationTypes, - 'reaction:grouped', - 'renote:grouped', -] as const; - + 'test'] as const; export const obsoleteNotificationTypes = ['pollVote', 'groupInvited'] as const; export const noteVisibilities = ['public', 'home', 'followers', 'specified'] as const; @@ -55,20 +43,6 @@ export const mutedNoteReasons = ['word', 'manual', 'spam', 'other'] as const; export const followingVisibilities = ['public', 'followers', 'private'] as const; export const followersVisibilities = ['public', 'followers', 'private'] as const; -/** - * ユーザーがエクスポートできるものの種類 - * - * (主にエクスポート完了通知で使用するものであり、既存のDBの名称等と必ずしも一致しない) - */ -export const userExportableEntities = ['antenna', 'blocking', 'clip', 'customEmoji', 'favorite', 'following', 'muting', 'note', 'userList'] as const; - -/** - * ユーザーがインポートできるものの種類 - * - * (主にインポート完了通知で使用するものであり、既存のDBの名称等と必ずしも一致しない) - */ -export const userImportableEntities = ['antenna', 'blocking', 'customEmoji', 'following', 'muting', 'userList'] as const; - export const moderationLogTypes = [ 'updateServerSettings', 'suspend', @@ -95,12 +69,9 @@ export const moderationLogTypes = [ 'resetPassword', 'suspendRemoteInstance', 'unsuspendRemoteInstance', - 'updateRemoteInstanceNote', 'markSensitiveDriveFile', 'unmarkSensitiveDriveFile', 'resolveAbuseReport', - 'forwardAbuseReport', - 'updateAbuseReportNote', 'createInvitation', 'createAd', 'updateAd', @@ -110,16 +81,6 @@ export const moderationLogTypes = [ 'deleteAvatarDecoration', 'unsetUserAvatar', 'unsetUserBanner', - 'createSystemWebhook', - 'updateSystemWebhook', - 'deleteSystemWebhook', - 'createAbuseReportNotificationRecipient', - 'updateAbuseReportNotificationRecipient', - 'deleteAbuseReportNotificationRecipient', - 'deleteAccount', - 'deletePage', - 'deleteFlash', - 'deleteGalleryPost', ] as const; export type ModerationLogPayloads = { @@ -248,12 +209,6 @@ export type ModerationLogPayloads = { id: string; host: string; }; - updateRemoteInstanceNote: { - id: string; - host: string; - before: string | null; - after: string | null; - }; markSensitiveDriveFile: { fileId: string; fileUserId: string | null; @@ -269,18 +224,7 @@ export type ModerationLogPayloads = { resolveAbuseReport: { reportId: string; report: any; - forwarded?: boolean; - resolvedAs?: string | null; - }; - forwardAbuseReport: { - reportId: string; - report: any; - }; - updateAbuseReportNote: { - reportId: string; - report: any; - before: string; - after: string; + forwarded: boolean; }; createInvitation: { invitations: any[]; @@ -323,55 +267,6 @@ export type ModerationLogPayloads = { userHost: string | null; fileId: string; }; - createSystemWebhook: { - systemWebhookId: string; - webhook: any; - }; - updateSystemWebhook: { - systemWebhookId: string; - before: any; - after: any; - }; - deleteSystemWebhook: { - systemWebhookId: string; - webhook: any; - }; - createAbuseReportNotificationRecipient: { - recipientId: string; - recipient: any; - }; - updateAbuseReportNotificationRecipient: { - recipientId: string; - before: any; - after: any; - }; - deleteAbuseReportNotificationRecipient: { - recipientId: string; - recipient: any; - }; - deleteAccount: { - userId: string; - userUsername: string; - userHost: string | null; - }; - deletePage: { - pageId: string; - pageUserId: string; - pageUserUsername: string; - page: any; - }; - deleteFlash: { - flashId: string; - flashUserId: string; - flashUserUsername: string; - flash: any; - }; - deleteGalleryPost: { - postId: string; - postUserId: string; - postUserUsername: string; - post: any; - }; }; export type Serialized = { @@ -382,11 +277,7 @@ export type Serialized = { ? (string | null) : T[K] extends Record ? Serialized - : T[K] extends (Record | null) - ? (Serialized | null) - : T[K] extends (Record | undefined) - ? (Serialized | undefined) - : T[K]; + : T[K]; }; export type FilterUnionByProperty< diff --git a/packages/backend/test-federation/.config/example.conf b/packages/backend/test-federation/.config/example.conf deleted file mode 100644 index 83d04eb39d..0000000000 --- a/packages/backend/test-federation/.config/example.conf +++ /dev/null @@ -1,70 +0,0 @@ -# based on https://github.com/misskey-dev/misskey-hub/blob/7071f63a1c80ee35c71f0fd8a6d8722c118c7574/src/docs/admin/nginx.md - -# For WebSocket -map $http_upgrade $connection_upgrade { - default upgrade; - '' close; -} - -proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=cache1:16m max_size=1g inactive=720m use_temp_path=off; - -server { - listen 80; - listen [::]:80; - server_name ${HOST}; - - # For SSL domain validation - root /var/www/html; - location /.well-known/acme-challenge/ { allow all; } - location /.well-known/pki-validation/ { allow all; } - location / { return 301 https://$server_name$request_uri; } -} - -server { - listen 443 ssl; - listen [::]:443 ssl; - http2 on; - server_name ${HOST}; - - ssl_session_timeout 1d; - ssl_session_cache shared:ssl_session_cache:10m; - ssl_session_tickets off; - - ssl_trusted_certificate /etc/nginx/certificates/rootCA.crt; - ssl_certificate /etc/nginx/certificates/$server_name.crt; - ssl_certificate_key /etc/nginx/certificates/$server_name.key; - - # SSL protocol settings - ssl_protocols TLSv1.2 TLSv1.3; - ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; - ssl_prefer_server_ciphers off; - ssl_stapling on; - ssl_stapling_verify on; - - # Change to your upload limit - client_max_body_size 80m; - - # Proxy to Node - location / { - proxy_pass http://misskey.${HOST}:3000; - proxy_set_header Host $host; - proxy_http_version 1.1; - proxy_redirect off; - - # If it's behind another reverse proxy or CDN, remove the following. - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto https; - - # For WebSocket - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - - # Cache settings - proxy_cache cache1; - proxy_cache_lock on; - proxy_cache_use_stale updating; - proxy_force_ranges on; - add_header X-Cache $upstream_cache_status; - } -} diff --git a/packages/backend/test-federation/.config/example.default.yml b/packages/backend/test-federation/.config/example.default.yml deleted file mode 100644 index ff1760a5a6..0000000000 --- a/packages/backend/test-federation/.config/example.default.yml +++ /dev/null @@ -1,25 +0,0 @@ -url: https://${HOST}/ -port: 3000 -db: - host: db.${HOST} - port: 5432 - db: misskey - user: postgres - pass: postgres -dbReplications: false -redis: - host: redis.test - port: 6379 -id: 'aidx' -proxyBypassHosts: - - api.deepl.com - - api-free.deepl.com - - www.recaptcha.net - - hcaptcha.com - - challenges.cloudflare.com -proxyRemoteFiles: true -signToActivityPubGet: true -allowedPrivateNetworks: [ - '127.0.0.1/32', - '172.20.0.0/16' -] diff --git a/packages/backend/test-federation/.config/example.docker.env b/packages/backend/test-federation/.config/example.docker.env deleted file mode 100644 index a8af7cce49..0000000000 --- a/packages/backend/test-federation/.config/example.docker.env +++ /dev/null @@ -1,5 +0,0 @@ -NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/rootCA.crt -POSTGRES_DB=misskey -POSTGRES_USER=postgres -POSTGRES_PASSWORD=postgres -MK_VERBOSE=true diff --git a/packages/backend/test-federation/.gitignore b/packages/backend/test-federation/.gitignore deleted file mode 100644 index e00f952cb5..0000000000 --- a/packages/backend/test-federation/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -certificates -volumes -.env -docker.env -*.test.conf -*.test.default.yml diff --git a/packages/backend/test-federation/README.md b/packages/backend/test-federation/README.md deleted file mode 100644 index 967d51f085..0000000000 --- a/packages/backend/test-federation/README.md +++ /dev/null @@ -1,24 +0,0 @@ -## test-federation -Test federation between two Misskey servers: `a.test` and `b.test`. - -Before testing, you need to build the entire project, and change working directory to here: -```sh -pnpm build -cd packages/backend/test-federation -``` - -First, you need to start servers by executing following commands: -```sh -bash ./setup.sh -docker compose up --scale tester=0 -``` - -Then you can run all tests by a following command: -```sh -docker compose run --no-deps --rm tester -``` - -For testing a specific file, run a following command: -```sh -docker compose run --no-deps --rm tester -- pnpm -F backend test:fed packages/backend/test-federation/test/user.test.ts -``` diff --git a/packages/backend/test-federation/compose.a.yml b/packages/backend/test-federation/compose.a.yml deleted file mode 100644 index 6a305b404c..0000000000 --- a/packages/backend/test-federation/compose.a.yml +++ /dev/null @@ -1,64 +0,0 @@ -services: - a.test: - extends: - file: ./compose.tpl.yml - service: nginx - depends_on: - misskey.a.test: - condition: service_healthy - networks: - - internal_network_a - volumes: - - type: bind - source: ./.config/a.test.conf - target: /etc/nginx/conf.d/a.test.conf - read_only: true - - type: bind - source: ./certificates/a.test.crt - target: /etc/nginx/certificates/a.test.crt - read_only: true - - type: bind - source: ./certificates/a.test.key - target: /etc/nginx/certificates/a.test.key - read_only: true - - misskey.a.test: - extends: - file: ./compose.tpl.yml - service: misskey - depends_on: - db.a.test: - condition: service_healthy - redis.test: - condition: service_healthy - setup: - condition: service_completed_successfully - networks: - - internal_network_a - volumes: - - type: bind - source: ./.config/a.test.default.yml - target: /misskey/.config/default.yml - read_only: true - - db.a.test: - extends: - file: ./compose.tpl.yml - service: db - networks: - - internal_network_a - volumes: - - type: bind - source: ./volumes/db.a - target: /var/lib/postgresql/data - bind: - create_host_path: true - -networks: - internal_network_a: - internal: true - driver: bridge - ipam: - config: - - subnet: 172.21.0.0/16 - ip_range: 172.21.0.0/24 diff --git a/packages/backend/test-federation/compose.b.yml b/packages/backend/test-federation/compose.b.yml deleted file mode 100644 index 1158b53bae..0000000000 --- a/packages/backend/test-federation/compose.b.yml +++ /dev/null @@ -1,64 +0,0 @@ -services: - b.test: - extends: - file: ./compose.tpl.yml - service: nginx - depends_on: - misskey.b.test: - condition: service_healthy - networks: - - internal_network_b - volumes: - - type: bind - source: ./.config/b.test.conf - target: /etc/nginx/conf.d/b.test.conf - read_only: true - - type: bind - source: ./certificates/b.test.crt - target: /etc/nginx/certificates/b.test.crt - read_only: true - - type: bind - source: ./certificates/b.test.key - target: /etc/nginx/certificates/b.test.key - read_only: true - - misskey.b.test: - extends: - file: ./compose.tpl.yml - service: misskey - depends_on: - db.b.test: - condition: service_healthy - redis.test: - condition: service_healthy - setup: - condition: service_completed_successfully - networks: - - internal_network_b - volumes: - - type: bind - source: ./.config/b.test.default.yml - target: /misskey/.config/default.yml - read_only: true - - db.b.test: - extends: - file: ./compose.tpl.yml - service: db - networks: - - internal_network_b - volumes: - - type: bind - source: ./volumes/db.b - target: /var/lib/postgresql/data - bind: - create_host_path: true - -networks: - internal_network_b: - internal: true - driver: bridge - ipam: - config: - - subnet: 172.22.0.0/16 - ip_range: 172.22.0.0/24 diff --git a/packages/backend/test-federation/compose.override.yaml b/packages/backend/test-federation/compose.override.yaml deleted file mode 100644 index 60a7631ab5..0000000000 --- a/packages/backend/test-federation/compose.override.yaml +++ /dev/null @@ -1,117 +0,0 @@ -services: - setup: - volumes: - - type: volume - source: node_modules - target: /misskey/node_modules - - type: volume - source: node_modules_backend - target: /misskey/packages/backend/node_modules - - type: volume - source: node_modules_misskey-js - target: /misskey/packages/misskey-js/node_modules - - type: volume - source: node_modules_misskey-reversi - target: /misskey/packages/misskey-reversi/node_modules - - tester: - networks: - external_network: - internal_network: - ipv4_address: 172.20.1.1 - volumes: - - type: volume - source: node_modules_dev - target: /misskey/node_modules - - type: volume - source: node_modules_backend_dev - target: /misskey/packages/backend/node_modules - - type: volume - source: node_modules_misskey-js_dev - target: /misskey/packages/misskey-js/node_modules - - daemon: - networks: - - external_network - - internal_network_a - - internal_network_b - volumes: - - type: volume - source: node_modules_dev - target: /misskey/node_modules - - type: volume - source: node_modules_backend_dev - target: /misskey/packages/backend/node_modules - - redis.test: - networks: - - internal_network_a - - internal_network_b - - a.test: - networks: - - internal_network - - misskey.a.test: - networks: - - external_network - - internal_network - volumes: - - type: volume - source: node_modules - target: /misskey/node_modules - - type: volume - source: node_modules_backend - target: /misskey/packages/backend/node_modules - - type: volume - source: node_modules_misskey-js - target: /misskey/packages/misskey-js/node_modules - - type: volume - source: node_modules_misskey-reversi - target: /misskey/packages/misskey-reversi/node_modules - - b.test: - networks: - - internal_network - - misskey.b.test: - networks: - - external_network - - internal_network - volumes: - - type: volume - source: node_modules - target: /misskey/node_modules - - type: volume - source: node_modules_backend - target: /misskey/packages/backend/node_modules - - type: volume - source: node_modules_misskey-js - target: /misskey/packages/misskey-js/node_modules - - type: volume - source: node_modules_misskey-reversi - target: /misskey/packages/misskey-reversi/node_modules - -networks: - external_network: - driver: bridge - ipam: - config: - - subnet: 172.23.0.0/16 - ip_range: 172.23.0.0/24 - internal_network: - internal: true - driver: bridge - ipam: - config: - - subnet: 172.20.0.0/16 - ip_range: 172.20.0.0/24 - -volumes: - node_modules: - node_modules_dev: - node_modules_backend: - node_modules_backend_dev: - node_modules_misskey-js: - node_modules_misskey-js_dev: - node_modules_misskey-reversi: diff --git a/packages/backend/test-federation/compose.tpl.yml b/packages/backend/test-federation/compose.tpl.yml deleted file mode 100644 index 8c38f16919..0000000000 --- a/packages/backend/test-federation/compose.tpl.yml +++ /dev/null @@ -1,101 +0,0 @@ -services: - nginx: - image: nginx:1.27 - volumes: - - type: bind - source: ./certificates/rootCA.crt - target: /etc/nginx/certificates/rootCA.crt - read_only: true - healthcheck: - test: service nginx status - interval: 5s - retries: 20 - - misskey: - image: node:20 - env_file: - - ./.config/docker.env - environment: - - NODE_ENV=production - volumes: - - type: bind - source: ../../../built - target: /misskey/built - read_only: true - - type: bind - source: ../assets - target: /misskey/packages/backend/assets - read_only: true - - type: bind - source: ../built - target: /misskey/packages/backend/built - read_only: true - - type: bind - source: ../migration - target: /misskey/packages/backend/migration - read_only: true - - type: bind - source: ../ormconfig.js - target: /misskey/packages/backend/ormconfig.js - read_only: true - - type: bind - source: ../package.json - target: /misskey/packages/backend/package.json - read_only: true - - type: bind - source: ../../misskey-js/built - target: /misskey/packages/misskey-js/built - read_only: true - - type: bind - source: ../../misskey-js/package.json - target: /misskey/packages/misskey-js/package.json - read_only: true - - type: bind - source: ../../misskey-reversi/built - target: /misskey/packages/misskey-reversi/built - read_only: true - - type: bind - source: ../../misskey-reversi/package.json - target: /misskey/packages/misskey-reversi/package.json - read_only: true - - type: bind - source: ../../../healthcheck.sh - target: /misskey/healthcheck.sh - read_only: true - - type: bind - source: ../../../package.json - target: /misskey/package.json - read_only: true - - type: bind - source: ../../../pnpm-lock.yaml - target: /misskey/pnpm-lock.yaml - read_only: true - - type: bind - source: ../../../pnpm-workspace.yaml - target: /misskey/pnpm-workspace.yaml - read_only: true - - type: bind - source: ./certificates/rootCA.crt - target: /usr/local/share/ca-certificates/rootCA.crt - read_only: true - working_dir: /misskey - command: > - bash -c " - corepack enable && corepack prepare - pnpm -F backend migrate - pnpm -F backend start - " - healthcheck: - test: bash /misskey/healthcheck.sh - interval: 5s - retries: 20 - - db: - image: postgres:15-alpine - env_file: - - ./.config/docker.env - volumes: - healthcheck: - test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB - interval: 5s - retries: 20 diff --git a/packages/backend/test-federation/compose.yml b/packages/backend/test-federation/compose.yml deleted file mode 100644 index 62d7e977c0..0000000000 --- a/packages/backend/test-federation/compose.yml +++ /dev/null @@ -1,133 +0,0 @@ -include: - - ./compose.a.yml - - ./compose.b.yml - -services: - setup: - extends: - file: ./compose.tpl.yml - service: misskey - command: > - bash -c " - corepack enable && corepack prepare - pnpm -F backend i - pnpm -F misskey-js i - pnpm -F misskey-reversi i - " - - tester: - image: node:20 - depends_on: - a.test: - condition: service_healthy - b.test: - condition: service_healthy - environment: - - NODE_ENV=development - - NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/rootCA.crt - volumes: - - type: bind - source: ../package.json - target: /misskey/packages/backend/package.json - read_only: true - - type: bind - source: ../test/resources - target: /misskey/packages/backend/test/resources - read_only: true - - type: bind - source: ./test - target: /misskey/packages/backend/test-federation/test - read_only: true - - type: bind - source: ../jest.config.cjs - target: /misskey/packages/backend/jest.config.cjs - read_only: true - - type: bind - source: ../jest.config.fed.cjs - target: /misskey/packages/backend/jest.config.fed.cjs - read_only: true - - type: bind - source: ../../misskey-js/built - target: /misskey/packages/misskey-js/built - read_only: true - - type: bind - source: ../../misskey-js/package.json - target: /misskey/packages/misskey-js/package.json - read_only: true - - type: bind - source: ../../../package.json - target: /misskey/package.json - read_only: true - - type: bind - source: ../../../pnpm-lock.yaml - target: /misskey/pnpm-lock.yaml - read_only: true - - type: bind - source: ../../../pnpm-workspace.yaml - target: /misskey/pnpm-workspace.yaml - read_only: true - - type: bind - source: ./certificates/rootCA.crt - target: /usr/local/share/ca-certificates/rootCA.crt - read_only: true - working_dir: /misskey - entrypoint: > - bash -c ' - corepack enable && corepack prepare - pnpm -F misskey-js i --frozen-lockfile - pnpm -F backend i --frozen-lockfile - exec "$0" "$@" - ' - command: pnpm -F backend test:fed - - daemon: - image: node:20 - depends_on: - redis.test: - condition: service_healthy - volumes: - - type: bind - source: ../package.json - target: /misskey/packages/backend/package.json - read_only: true - - type: bind - source: ./daemon.ts - target: /misskey/packages/backend/test-federation/daemon.ts - read_only: true - - type: bind - source: ./tsconfig.json - target: /misskey/packages/backend/test-federation/tsconfig.json - read_only: true - - type: bind - source: ../../../package.json - target: /misskey/package.json - read_only: true - - type: bind - source: ../../../pnpm-lock.yaml - target: /misskey/pnpm-lock.yaml - read_only: true - - type: bind - source: ../../../pnpm-workspace.yaml - target: /misskey/pnpm-workspace.yaml - read_only: true - working_dir: /misskey - command: > - bash -c " - corepack enable && corepack prepare - pnpm -F backend i --frozen-lockfile - pnpm exec tsc -p ./packages/backend/test-federation - node ./packages/backend/test-federation/built/daemon.js - " - - redis.test: - image: redis:7-alpine - volumes: - - type: bind - source: ./volumes/redis - target: /data - bind: - create_host_path: true - healthcheck: - test: redis-cli ping - interval: 5s - retries: 20 diff --git a/packages/backend/test-federation/daemon.ts b/packages/backend/test-federation/daemon.ts deleted file mode 100644 index 46b6963c79..0000000000 --- a/packages/backend/test-federation/daemon.ts +++ /dev/null @@ -1,38 +0,0 @@ -import IPCIDR from 'ip-cidr'; -import { Redis } from 'ioredis'; - -const TESTER_IP_ADDRESS = '172.20.1.1'; - -/** - * This should be same as {@link file://./../src/misc/get-ip-hash.ts}. - */ -function getIpHash(ip: string) { - const prefix = IPCIDR.createAddress(ip).mask(64); - return `ip-${BigInt('0b' + prefix).toString(36)}`; -} - -/** - * This prevents hitting rate limit when login. - */ -export async function purgeLimit(host: string, client: Redis) { - const ipHash = getIpHash(TESTER_IP_ADDRESS); - const key = `${host}:limit:${ipHash}:signin`; - const res = await client.zrange(key, 0, -1); - if (res.length !== 0) { - console.log(`${key} - ${JSON.stringify(res)}`); - await client.del(key); - } -} - -console.log('Daemon started running'); - -{ - const redisClient = new Redis({ - host: 'redis.test', - }); - - setInterval(() => { - purgeLimit('a.test', redisClient); - purgeLimit('b.test', redisClient); - }, 200); -} diff --git a/packages/backend/test-federation/eslint.config.js b/packages/backend/test-federation/eslint.config.js deleted file mode 100644 index e3bcf4c0fe..0000000000 --- a/packages/backend/test-federation/eslint.config.js +++ /dev/null @@ -1,21 +0,0 @@ -import globals from 'globals'; -import tsParser from '@typescript-eslint/parser'; -import sharedConfig from '../../shared/eslint.config.js'; - -export default [ - ...sharedConfig, - { - files: ['**/*.ts', '**/*.tsx'], - languageOptions: { - globals: { - ...globals.node, - }, - parserOptions: { - parser: tsParser, - project: ['./tsconfig.json'], - sourceType: 'module', - tsconfigRootDir: import.meta.dirname, - }, - }, - }, -]; diff --git a/packages/backend/test-federation/setup.sh b/packages/backend/test-federation/setup.sh deleted file mode 100644 index 1bc3a2a87c..0000000000 --- a/packages/backend/test-federation/setup.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -mkdir certificates - -# rootCA -openssl genrsa -des3 \ - -passout pass:rootCA \ - -out certificates/rootCA.key 4096 -openssl req -x509 -new -nodes -batch \ - -key certificates/rootCA.key \ - -sha256 \ - -days 1024 \ - -passin pass:rootCA \ - -out certificates/rootCA.crt - -# domain -function generate { - openssl req -new -newkey rsa:2048 -sha256 -nodes \ - -keyout certificates/$1.key \ - -subj "/CN=$1/emailAddress=admin@$1/C=JP/ST=/L=/O=Misskey Tester/OU=Some Unit" \ - -out certificates/$1.csr - openssl x509 -req -sha256 \ - -in certificates/$1.csr \ - -CA certificates/rootCA.crt \ - -CAkey certificates/rootCA.key \ - -CAcreateserial \ - -passin pass:rootCA \ - -out certificates/$1.crt \ - -days 500 - if [ ! -f .config/docker.env ]; then cp .config/example.docker.env .config/docker.env; fi - if [ ! -f .config/$1.conf ]; then sed "s/\${HOST}/$1/g" .config/example.conf > .config/$1.conf; fi - if [ ! -f .config/$1.default.yml ]; then sed "s/\${HOST}/$1/g" .config/example.default.yml > .config/$1.default.yml; fi -} - -generate a.test -generate b.test diff --git a/packages/backend/test-federation/test/abuse-report.test.ts b/packages/backend/test-federation/test/abuse-report.test.ts deleted file mode 100644 index b54d6222b4..0000000000 --- a/packages/backend/test-federation/test/abuse-report.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { rejects, strictEqual } from 'node:assert'; -import * as Misskey from 'misskey-js'; -import { createAccount, createModerator, resolveRemoteUser, sleep, type LoginUser } from './utils.js'; - -describe('Abuse report', () => { - describe('Forwarding report', () => { - let alice: LoginUser, bob: LoginUser, aModerator: LoginUser, bModerator: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [aModerator, bModerator] = await Promise.all([ - createModerator('a.test'), - createModerator('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - }); - - test('Alice reports Bob, moderator in A forwards it, and B moderator receives it', async () => { - const comment = crypto.randomUUID(); - await alice.client.request('users/report-abuse', { userId: bobInA.id, comment }); - const reports = await aModerator.client.request('admin/abuse-user-reports', {}); - const report = reports.filter(report => report.comment === comment)[0]; - await aModerator.client.request('admin/forward-abuse-user-report', { reportId: report.id }); - await sleep(); - - const reportsInB = await bModerator.client.request('admin/abuse-user-reports', {}); - const reportInB = reportsInB.filter(report => report.comment.includes(comment))[0]; - // NOTE: reporter is not Alice, and is not moderator in A - strictEqual(reportInB.reporter.url, 'https://a.test/@instance.actor'); - strictEqual(reportInB.targetUserId, bob.id); - - // NOTE: cannot forward multiple times - await rejects( - async () => await aModerator.client.request('admin/forward-abuse-user-report', { reportId: report.id }), - (err: any) => { - strictEqual(err.code, 'INTERNAL_ERROR'); - strictEqual(err.info.e.message, 'The report has already been forwarded.'); - return true; - }, - ); - }); - }); -}); diff --git a/packages/backend/test-federation/test/block.test.ts b/packages/backend/test-federation/test/block.test.ts deleted file mode 100644 index ef910eeaea..0000000000 --- a/packages/backend/test-federation/test/block.test.ts +++ /dev/null @@ -1,224 +0,0 @@ -import { deepStrictEqual, rejects, strictEqual } from 'node:assert'; -import * as Misskey from 'misskey-js'; -import { assertNotificationReceived, createAccount, type LoginUser, resolveRemoteNote, resolveRemoteUser, sleep } from './utils.js'; - -describe('Block', () => { - describe('Check follow', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - }); - - test('Cannot follow if blocked', async () => { - await alice.client.request('blocking/create', { userId: bobInA.id }); - await sleep(); - await rejects( - async () => await bob.client.request('following/create', { userId: aliceInB.id }), - (err: any) => { - strictEqual(err.code, 'BLOCKED'); - return true; - }, - ); - - const following = await bob.client.request('users/following', { userId: bob.id }); - strictEqual(following.length, 0); - const followers = await alice.client.request('users/followers', { userId: alice.id }); - strictEqual(followers.length, 0); - }); - - // FIXME: this is invalid case - test('Cannot follow even if unblocked', async () => { - // unblock here - await alice.client.request('blocking/delete', { userId: bobInA.id }); - await sleep(); - - // TODO: why still being blocked? - await rejects( - async () => await bob.client.request('following/create', { userId: aliceInB.id }), - (err: any) => { - strictEqual(err.code, 'BLOCKED'); - return true; - }, - ); - }); - - test.skip('Can follow if unblocked', async () => { - await alice.client.request('blocking/delete', { userId: bobInA.id }); - await sleep(); - - await bob.client.request('following/create', { userId: aliceInB.id }); - await sleep(); - - const following = await bob.client.request('users/following', { userId: bob.id }); - strictEqual(following.length, 1); - const followers = await alice.client.request('users/followers', { userId: alice.id }); - strictEqual(followers.length, 1); - }); - - test.skip('Remove follower when block them', async () => { - test('before block', async () => { - const following = await bob.client.request('users/following', { userId: bob.id }); - strictEqual(following.length, 1); - const followers = await alice.client.request('users/followers', { userId: alice.id }); - strictEqual(followers.length, 1); - }); - - await alice.client.request('blocking/create', { userId: bobInA.id }); - await sleep(); - - test('after block', async () => { - const following = await bob.client.request('users/following', { userId: bob.id }); - strictEqual(following.length, 0); - const followers = await alice.client.request('users/followers', { userId: alice.id }); - strictEqual(followers.length, 0); - }); - }); - }); - - describe('Check reply', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - }); - - test('Cannot reply if blocked', async () => { - await alice.client.request('blocking/create', { userId: bobInA.id }); - await sleep(); - - const note = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - const resolvedNote = await resolveRemoteNote('a.test', note.id, bob); - await rejects( - async () => await bob.client.request('notes/create', { text: 'b', replyId: resolvedNote.id }), - (err: any) => { - strictEqual(err.code, 'YOU_HAVE_BEEN_BLOCKED'); - return true; - }, - ); - }); - - test('Can reply if unblocked', async () => { - await alice.client.request('blocking/delete', { userId: bobInA.id }); - await sleep(); - - const note = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - const resolvedNote = await resolveRemoteNote('a.test', note.id, bob); - const reply = (await bob.client.request('notes/create', { text: 'b', replyId: resolvedNote.id })).createdNote; - - await resolveRemoteNote('b.test', reply.id, alice); - }); - }); - - describe('Check reaction', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - }); - - test('Cannot reaction if blocked', async () => { - await alice.client.request('blocking/create', { userId: bobInA.id }); - await sleep(); - - const note = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - const resolvedNote = await resolveRemoteNote('a.test', note.id, bob); - await rejects( - async () => await bob.client.request('notes/reactions/create', { noteId: resolvedNote.id, reaction: '😅' }), - (err: any) => { - strictEqual(err.code, 'YOU_HAVE_BEEN_BLOCKED'); - return true; - }, - ); - }); - - // FIXME: this is invalid case - test('Cannot reaction even if unblocked', async () => { - // unblock here - await alice.client.request('blocking/delete', { userId: bobInA.id }); - await sleep(); - - const note = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - const resolvedNote = await resolveRemoteNote('a.test', note.id, bob); - - // TODO: why still being blocked? - await rejects( - async () => await bob.client.request('notes/reactions/create', { noteId: resolvedNote.id, reaction: '😅' }), - (err: any) => { - strictEqual(err.code, 'YOU_HAVE_BEEN_BLOCKED'); - return true; - }, - ); - }); - - test.skip('Can reaction if unblocked', async () => { - await alice.client.request('blocking/delete', { userId: bobInA.id }); - await sleep(); - - const note = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - const resolvedNote = await resolveRemoteNote('a.test', note.id, bob); - await bob.client.request('notes/reactions/create', { noteId: resolvedNote.id, reaction: '😅' }); - - const _note = await alice.client.request('notes/show', { noteId: note.id }); - deepStrictEqual(_note.reactions, { '😅': 1 }); - }); - }); - - describe('Check mention', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - }); - - /** NOTE: You should mute the target to stop receiving notifications */ - test('Can mention and notified even if blocked', async () => { - await alice.client.request('blocking/create', { userId: bobInA.id }); - await sleep(); - - const text = `@${alice.username}@a.test plz unblock me!`; - await assertNotificationReceived( - 'a.test', alice, - async () => await bob.client.request('notes/create', { text }), - notification => notification.type === 'mention' && notification.userId === bobInA.id && notification.note.text === text, - true, - ); - }); - }); -}); diff --git a/packages/backend/test-federation/test/drive.test.ts b/packages/backend/test-federation/test/drive.test.ts deleted file mode 100644 index f755183b4d..0000000000 --- a/packages/backend/test-federation/test/drive.test.ts +++ /dev/null @@ -1,175 +0,0 @@ -import assert, { strictEqual } from 'node:assert'; -import * as Misskey from 'misskey-js'; -import { createAccount, deepStrictEqualWithExcludedFields, fetchAdmin, type LoginUser, resolveRemoteNote, resolveRemoteUser, sleep, uploadFile } from './utils.js'; - -const bAdmin = await fetchAdmin('b.test'); - -describe('Drive', () => { - describe('Upload image in a.test and resolve from b.test', () => { - let uploader: LoginUser; - - beforeAll(async () => { - uploader = await createAccount('a.test'); - }); - - let image: Misskey.entities.DriveFile, imageInB: Misskey.entities.DriveFile; - - describe('Upload', () => { - beforeAll(async () => { - image = await uploadFile('a.test', uploader); - const noteWithImage = (await uploader.client.request('notes/create', { fileIds: [image.id] })).createdNote; - const noteInB = await resolveRemoteNote('a.test', noteWithImage.id, bAdmin); - assert(noteInB.files != null); - strictEqual(noteInB.files.length, 1); - imageInB = noteInB.files[0]; - }); - - test('Check consistency of DriveFile', () => { - // console.log(`a.test: ${JSON.stringify(image, null, '\t')}`); - // console.log(`b.test: ${JSON.stringify(imageInB, null, '\t')}`); - - deepStrictEqualWithExcludedFields(image, imageInB, [ - 'id', - 'createdAt', - 'size', - 'url', - 'thumbnailUrl', - 'userId', - ]); - }); - }); - - let updatedImage: Misskey.entities.DriveFile, updatedImageInB: Misskey.entities.DriveFile; - - describe('Update', () => { - beforeAll(async () => { - updatedImage = await uploader.client.request('drive/files/update', { - fileId: image.id, - name: 'updated_192.jpg', - isSensitive: true, - }); - - updatedImageInB = await bAdmin.client.request('drive/files/show', { - fileId: imageInB.id, - }); - }); - - test('Check consistency', () => { - // console.log(`a.test: ${JSON.stringify(updatedImage, null, '\t')}`); - // console.log(`b.test: ${JSON.stringify(updatedImageInB, null, '\t')}`); - - // FIXME: not updated with `drive/files/update` - strictEqual(updatedImage.isSensitive, true); - strictEqual(updatedImage.name, 'updated_192.jpg'); - strictEqual(updatedImageInB.isSensitive, false); - strictEqual(updatedImageInB.name, '192.jpg'); - }); - }); - - let reupdatedImageInB: Misskey.entities.DriveFile; - - describe('Re-update with attaching to Note', () => { - beforeAll(async () => { - const noteWithUpdatedImage = (await uploader.client.request('notes/create', { fileIds: [updatedImage.id] })).createdNote; - const noteWithUpdatedImageInB = await resolveRemoteNote('a.test', noteWithUpdatedImage.id, bAdmin); - assert(noteWithUpdatedImageInB.files != null); - strictEqual(noteWithUpdatedImageInB.files.length, 1); - reupdatedImageInB = noteWithUpdatedImageInB.files[0]; - }); - - test('Check consistency', () => { - // console.log(`b.test: ${JSON.stringify(reupdatedImageInB, null, '\t')}`); - - // `isSensitive` is updated - strictEqual(reupdatedImageInB.isSensitive, true); - // FIXME: but `name` is not updated - strictEqual(reupdatedImageInB.name, '192.jpg'); - }); - }); - }); - - describe('Sensitive flag', () => { - describe('isSensitive is federated in delivering to followers', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - - await bob.client.request('following/create', { userId: aliceInB.id }); - await sleep(); - }); - - test('Alice uploads sensitive image and it is shown as sensitive from Bob', async () => { - const file = await uploadFile('a.test', alice); - await alice.client.request('drive/files/update', { fileId: file.id, isSensitive: true }); - await alice.client.request('notes/create', { text: 'sensitive', fileIds: [file.id] }); - await sleep(); - - const notes = await bob.client.request('notes/timeline', {}); - strictEqual(notes.length, 1); - const noteInB = notes[0]; - assert(noteInB.files != null); - strictEqual(noteInB.files.length, 1); - strictEqual(noteInB.files[0].isSensitive, true); - }); - }); - - describe('isSensitive is federated in resolving', () => { - let alice: LoginUser, bob: LoginUser; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - }); - - test('Alice uploads sensitive image and it is shown as sensitive from Bob', async () => { - const file = await uploadFile('a.test', alice); - await alice.client.request('drive/files/update', { fileId: file.id, isSensitive: true }); - const note = (await alice.client.request('notes/create', { text: 'sensitive', fileIds: [file.id] })).createdNote; - - const noteInB = await resolveRemoteNote('a.test', note.id, bob); - assert(noteInB.files != null); - strictEqual(noteInB.files.length, 1); - strictEqual(noteInB.files[0].isSensitive, true); - }); - }); - - /** @see https://github.com/misskey-dev/misskey/issues/12208 */ - describe('isSensitive is federated in replying', () => { - let alice: LoginUser, bob: LoginUser; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - }); - - test('Alice uploads sensitive image and it is shown as sensitive from Bob', async () => { - const bobNote = (await bob.client.request('notes/create', { text: 'I\'m Bob' })).createdNote; - - const file = await uploadFile('a.test', alice); - await alice.client.request('drive/files/update', { fileId: file.id, isSensitive: true }); - const bobNoteInA = await resolveRemoteNote('b.test', bobNote.id, alice); - const note = (await alice.client.request('notes/create', { text: 'sensitive', fileIds: [file.id], replyId: bobNoteInA.id })).createdNote; - await sleep(); - - const noteInB = await resolveRemoteNote('a.test', note.id, bob); - assert(noteInB.files != null); - strictEqual(noteInB.files.length, 1); - strictEqual(noteInB.files[0].isSensitive, true); - }); - }); - }); -}); diff --git a/packages/backend/test-federation/test/emoji.test.ts b/packages/backend/test-federation/test/emoji.test.ts deleted file mode 100644 index 3119ca6e4d..0000000000 --- a/packages/backend/test-federation/test/emoji.test.ts +++ /dev/null @@ -1,97 +0,0 @@ -import assert, { deepStrictEqual, strictEqual } from 'assert'; -import * as Misskey from 'misskey-js'; -import { addCustomEmoji, createAccount, type LoginUser, resolveRemoteUser, sleep } from './utils.js'; - -describe('Emoji', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - - await bob.client.request('following/create', { userId: aliceInB.id }); - await sleep(); - }); - - test('Custom emoji are delivered with Note delivery', async () => { - const emoji = await addCustomEmoji('a.test'); - await alice.client.request('notes/create', { text: `I love :${emoji.name}:` }); - await sleep(); - - const notes = await bob.client.request('notes/timeline', {}); - const noteInB = notes[0]; - - strictEqual(noteInB.text, `I love \u200b:${emoji.name}:\u200b`); - assert(noteInB.emojis != null); - assert(emoji.name in noteInB.emojis); - strictEqual(noteInB.emojis[emoji.name], emoji.url); - }); - - test('Custom emoji are delivered with Reaction delivery', async () => { - const emoji = await addCustomEmoji('a.test'); - const note = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - await sleep(); - - await alice.client.request('notes/reactions/create', { noteId: note.id, reaction: `:${emoji.name}:` }); - await sleep(); - - const noteInB = (await bob.client.request('notes/timeline', {}))[0]; - deepStrictEqual(noteInB.reactions[`:${emoji.name}@a.test:`], 1); - deepStrictEqual(noteInB.reactionEmojis[`${emoji.name}@a.test`], emoji.url); - }); - - test('Custom emoji are delivered with Profile delivery', async () => { - const emoji = await addCustomEmoji('a.test'); - const renewedAlice = await alice.client.request('i/update', { name: `:${emoji.name}:` }); - await sleep(); - - const renewedaliceInB = await bob.client.request('users/show', { userId: aliceInB.id }); - strictEqual(renewedaliceInB.name, renewedAlice.name); - assert(emoji.name in renewedaliceInB.emojis); - strictEqual(renewedaliceInB.emojis[emoji.name], emoji.url); - }); - - test('Local-only custom emoji aren\'t delivered with Note delivery', async () => { - const emoji = await addCustomEmoji('a.test', { localOnly: true }); - await alice.client.request('notes/create', { text: `I love :${emoji.name}:` }); - await sleep(); - - const notes = await bob.client.request('notes/timeline', {}); - const noteInB = notes[0]; - - strictEqual(noteInB.text, `I love \u200b:${emoji.name}:\u200b`); - // deepStrictEqual(noteInB.emojis, {}); // TODO: this fails (why?) - deepStrictEqual({ ...noteInB.emojis }, {}); - }); - - test('Local-only custom emoji aren\'t delivered with Reaction delivery', async () => { - const emoji = await addCustomEmoji('a.test', { localOnly: true }); - const note = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - await sleep(); - - await alice.client.request('notes/reactions/create', { noteId: note.id, reaction: `:${emoji.name}:` }); - await sleep(); - - const noteInB = (await bob.client.request('notes/timeline', {}))[0]; - deepStrictEqual({ ...noteInB.reactions }, { '❤': 1 }); - deepStrictEqual({ ...noteInB.reactionEmojis }, {}); - }); - - test('Local-only custom emoji aren\'t delivered with Profile delivery', async () => { - const emoji = await addCustomEmoji('a.test', { localOnly: true }); - const renewedAlice = await alice.client.request('i/update', { name: `:${emoji.name}:` }); - await sleep(); - - const renewedaliceInB = await bob.client.request('users/show', { userId: aliceInB.id }); - strictEqual(renewedaliceInB.name, renewedAlice.name); - deepStrictEqual({ ...renewedaliceInB.emojis }, {}); - }); -}); diff --git a/packages/backend/test-federation/test/move.test.ts b/packages/backend/test-federation/test/move.test.ts deleted file mode 100644 index 56a57de8a4..0000000000 --- a/packages/backend/test-federation/test/move.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -import assert, { strictEqual } from 'node:assert'; -import { createAccount, type LoginUser, sleep } from './utils.js'; - -describe('Move', () => { - test('Minimum move', async () => { - const [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - await bob.client.request('i/update', { alsoKnownAs: [`@${alice.username}@a.test`] }); - await alice.client.request('i/move', { moveToAccount: `@${bob.username}@b.test` }); - }); - - /** @see https://github.com/misskey-dev/misskey/issues/11320 */ - describe('Following relation is transferred after move', () => { - let alice: LoginUser, bob: LoginUser, carol: LoginUser; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - carol = await createAccount('a.test'); - - // Follow @carol@a.test ==> @alice@a.test - await carol.client.request('following/create', { userId: alice.id }); - - // Move @alice@a.test ==> @bob@b.test - await bob.client.request('i/update', { alsoKnownAs: [`@${alice.username}@a.test`] }); - await alice.client.request('i/move', { moveToAccount: `@${bob.username}@b.test` }); - await sleep(); - }); - - test('Check from follower', async () => { - const following = await carol.client.request('users/following', { userId: carol.id }); - strictEqual(following.length, 2); - const followees = following.map(({ followee }) => followee); - assert(followees.every(followee => followee != null)); - assert(followees.some(({ id, url }) => id === alice.id && url === null)); - assert(followees.some(({ url }) => url === `https://b.test/@${bob.username}`)); - }); - - test('Check from followee', async () => { - const followers = await bob.client.request('users/followers', { userId: bob.id }); - strictEqual(followers.length, 1); - const follower = followers[0].follower; - assert(follower != null); - strictEqual(follower.url, `https://a.test/@${carol.username}`); - }); - }); -}); diff --git a/packages/backend/test-federation/test/note.test.ts b/packages/backend/test-federation/test/note.test.ts deleted file mode 100644 index bacc4cc54f..0000000000 --- a/packages/backend/test-federation/test/note.test.ts +++ /dev/null @@ -1,317 +0,0 @@ -import assert, { rejects, strictEqual } from 'node:assert'; -import * as Misskey from 'misskey-js'; -import { addCustomEmoji, createAccount, createModerator, deepStrictEqualWithExcludedFields, type LoginUser, resolveRemoteNote, resolveRemoteUser, sleep, uploadFile } from './utils.js'; - -describe('Note', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - }); - - describe('Note content', () => { - test('Consistency of Public Note', async () => { - const image = await uploadFile('a.test', alice); - const note = (await alice.client.request('notes/create', { - text: 'I am Alice!', - fileIds: [image.id], - poll: { - choices: ['neko', 'inu'], - multiple: false, - expiredAfter: 60 * 60 * 1000, - }, - })).createdNote; - - const resolvedNote = await resolveRemoteNote('a.test', note.id, bob); - deepStrictEqualWithExcludedFields(note, resolvedNote, [ - 'id', - 'emojis', - /** Consistency of files is checked at {@link file://./drive.test.ts}, so let's skip. */ - 'fileIds', - 'files', - /** @see https://github.com/misskey-dev/misskey/issues/12409 */ - 'reactionAcceptance', - 'userId', - 'user', - 'uri', - ]); - strictEqual(aliceInB.id, resolvedNote.userId); - }); - - test('Consistency of reply', async () => { - const _replyedNote = (await alice.client.request('notes/create', { - text: 'a', - })).createdNote; - const note = (await alice.client.request('notes/create', { - text: 'b', - replyId: _replyedNote.id, - })).createdNote; - // NOTE: the repliedCount is incremented, so fetch again - const replyedNote = await alice.client.request('notes/show', { noteId: _replyedNote.id }); - strictEqual(replyedNote.repliesCount, 1); - - const resolvedNote = await resolveRemoteNote('a.test', note.id, bob); - deepStrictEqualWithExcludedFields(note, resolvedNote, [ - 'id', - 'emojis', - 'reactionAcceptance', - 'replyId', - 'reply', - 'userId', - 'user', - 'uri', - ]); - assert(resolvedNote.replyId != null); - assert(resolvedNote.reply != null); - deepStrictEqualWithExcludedFields(replyedNote, resolvedNote.reply, [ - 'id', - // TODO: why clippedCount loses consistency? - 'clippedCount', - 'emojis', - 'userId', - 'user', - 'uri', - // flaky because this is parallelly incremented, so let's check it below - 'repliesCount', - ]); - strictEqual(aliceInB.id, resolvedNote.userId); - - await sleep(); - - const resolvedReplyedNote = await bob.client.request('notes/show', { noteId: resolvedNote.replyId }); - strictEqual(resolvedReplyedNote.repliesCount, 1); - }); - - test('Consistency of Renote', async () => { - // NOTE: the renoteCount is not incremented, so no need to fetch again - const renotedNote = (await alice.client.request('notes/create', { - text: 'a', - })).createdNote; - const note = (await alice.client.request('notes/create', { - text: 'b', - renoteId: renotedNote.id, - })).createdNote; - - const resolvedNote = await resolveRemoteNote('a.test', note.id, bob); - deepStrictEqualWithExcludedFields(note, resolvedNote, [ - 'id', - 'emojis', - 'reactionAcceptance', - 'renoteId', - 'renote', - 'userId', - 'user', - 'uri', - ]); - assert(resolvedNote.renoteId != null); - assert(resolvedNote.renote != null); - deepStrictEqualWithExcludedFields(renotedNote, resolvedNote.renote, [ - 'id', - 'emojis', - 'userId', - 'user', - 'uri', - ]); - strictEqual(aliceInB.id, resolvedNote.userId); - }); - }); - - describe('Other props', () => { - test('localOnly', async () => { - const note = (await alice.client.request('notes/create', { text: 'a', localOnly: true })).createdNote; - rejects( - async () => await bob.client.request('ap/show', { uri: `https://a.test/notes/${note.id}` }), - (err: any) => { - /** - * FIXME: this error is not handled - * @see https://github.com/misskey-dev/misskey/issues/12736 - */ - strictEqual(err.code, 'INTERNAL_ERROR'); - return true; - }, - ); - }); - }); - - describe('Deletion', () => { - describe('Check Delete consistency', () => { - let carol: LoginUser; - - beforeAll(async () => { - carol = await createAccount('a.test'); - - await carol.client.request('following/create', { userId: bobInA.id }); - await sleep(); - }); - - test('Delete is derivered to followers', async () => { - const note = (await bob.client.request('notes/create', { text: 'I\'m Bob.' })).createdNote; - const noteInA = await resolveRemoteNote('b.test', note.id, carol); - await bob.client.request('notes/delete', { noteId: note.id }); - await sleep(); - - await rejects( - async () => await carol.client.request('notes/show', { noteId: noteInA.id }), - (err: any) => { - strictEqual(err.code, 'NO_SUCH_NOTE'); - return true; - }, - ); - }); - }); - - describe('Deletion of remote user\'s note for moderation', () => { - let note: Misskey.entities.Note; - - test('Alice post is deleted in B', async () => { - note = (await alice.client.request('notes/create', { text: 'Hello' })).createdNote; - const noteInB = await resolveRemoteNote('a.test', note.id, bob); - const bMod = await createModerator('b.test'); - await bMod.client.request('notes/delete', { noteId: noteInB.id }); - await rejects( - async () => await bob.client.request('notes/show', { noteId: noteInB.id }), - (err: any) => { - strictEqual(err.code, 'NO_SUCH_NOTE'); - return true; - }, - ); - }); - - /** - * FIXME: implement soft deletion as well as user? - * @see https://github.com/misskey-dev/misskey/issues/11437 - */ - test.failing('Not found even if resolve again', async () => { - const noteInB = await resolveRemoteNote('a.test', note.id, bob); - await rejects( - async () => await bob.client.request('notes/show', { noteId: noteInB.id }), - (err: any) => { - strictEqual(err.code, 'NO_SUCH_NOTE'); - return true; - }, - ); - }); - }); - }); - - describe('Reaction', () => { - describe('Consistency', () => { - test('Unicode reaction', async () => { - const note = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - const resolvedNote = await resolveRemoteNote('a.test', note.id, bob); - const reaction = '😅'; - await bob.client.request('notes/reactions/create', { noteId: resolvedNote.id, reaction }); - await sleep(); - - const reactions = await alice.client.request('notes/reactions', { noteId: note.id }); - strictEqual(reactions.length, 1); - strictEqual(reactions[0].type, reaction); - strictEqual(reactions[0].user.id, bobInA.id); - }); - - test('Custom emoji reaction', async () => { - const note = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - const resolvedNote = await resolveRemoteNote('a.test', note.id, bob); - const emoji = await addCustomEmoji('b.test'); - await bob.client.request('notes/reactions/create', { noteId: resolvedNote.id, reaction: `:${emoji.name}:` }); - await sleep(); - - const reactions = await alice.client.request('notes/reactions', { noteId: note.id }); - strictEqual(reactions.length, 1); - strictEqual(reactions[0].type, `:${emoji.name}@b.test:`); - strictEqual(reactions[0].user.id, bobInA.id); - }); - }); - - describe('Acceptance', () => { - test('Even if likeOnly, remote users can react with custom emoji, but it is converted to like', async () => { - const note = (await alice.client.request('notes/create', { text: 'a', reactionAcceptance: 'likeOnly' })).createdNote; - const noteInB = await resolveRemoteNote('a.test', note.id, bob); - const emoji = await addCustomEmoji('b.test'); - await bob.client.request('notes/reactions/create', { noteId: noteInB.id, reaction: `:${emoji.name}:` }); - await sleep(); - - const reactions = await alice.client.request('notes/reactions', { noteId: note.id }); - strictEqual(reactions.length, 1); - strictEqual(reactions[0].type, '❤'); - }); - - /** - * TODO: this may be unexpected behavior? - * @see https://github.com/misskey-dev/misskey/issues/12409 - */ - test('Even if nonSensitiveOnly, remote users can react with sensitive emoji, and it is not converted', async () => { - const note = (await alice.client.request('notes/create', { text: 'a', reactionAcceptance: 'nonSensitiveOnly' })).createdNote; - const noteInB = await resolveRemoteNote('a.test', note.id, bob); - const emoji = await addCustomEmoji('b.test', { isSensitive: true }); - await bob.client.request('notes/reactions/create', { noteId: noteInB.id, reaction: `:${emoji.name}:` }); - await sleep(); - - const reactions = await alice.client.request('notes/reactions', { noteId: note.id }); - strictEqual(reactions.length, 1); - strictEqual(reactions[0].type, `:${emoji.name}@b.test:`); - }); - }); - }); - - describe('Poll', () => { - describe('Any remote user\'s vote is delivered to the author', () => { - let carol: LoginUser; - - beforeAll(async () => { - carol = await createAccount('a.test'); - }); - - test('Bob creates poll and receives a vote from Carol', async () => { - const note = (await bob.client.request('notes/create', { poll: { choices: ['inu', 'neko'] } })).createdNote; - const noteInA = await resolveRemoteNote('b.test', note.id, carol); - await carol.client.request('notes/polls/vote', { noteId: noteInA.id, choice: 0 }); - await sleep(); - - const noteAfterVote = await bob.client.request('notes/show', { noteId: note.id }); - assert(noteAfterVote.poll != null); - strictEqual(noteAfterVote.poll.choices[0].votes, 1); - strictEqual(noteAfterVote.poll.choices[1].votes, 0); - }); - }); - - describe('Local user\'s vote is delivered to the author\'s remote followers', () => { - let bobRemoteFollower: LoginUser, localVoter: LoginUser; - - beforeAll(async () => { - [ - bobRemoteFollower, - localVoter, - ] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - await bobRemoteFollower.client.request('following/create', { userId: bobInA.id }); - await sleep(); - }); - - test('A vote in Bob\'s server is delivered to Bob\'s remote followers', async () => { - const note = (await bob.client.request('notes/create', { poll: { choices: ['inu', 'neko'] } })).createdNote; - // NOTE: resolve before voting - const noteInA = await resolveRemoteNote('b.test', note.id, bobRemoteFollower); - await localVoter.client.request('notes/polls/vote', { noteId: note.id, choice: 0 }); - await sleep(); - - const noteAfterVote = await bobRemoteFollower.client.request('notes/show', { noteId: noteInA.id }); - assert(noteAfterVote.poll != null); - strictEqual(noteAfterVote.poll.choices[0].votes, 1); - strictEqual(noteAfterVote.poll.choices[1].votes, 0); - }); - }); - }); -}); diff --git a/packages/backend/test-federation/test/notification.test.ts b/packages/backend/test-federation/test/notification.test.ts deleted file mode 100644 index 6d55353653..0000000000 --- a/packages/backend/test-federation/test/notification.test.ts +++ /dev/null @@ -1,107 +0,0 @@ -import * as Misskey from 'misskey-js'; -import { assertNotificationReceived, createAccount, type LoginUser, resolveRemoteNote, resolveRemoteUser, sleep } from './utils.js'; - -describe('Notification', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - }); - - describe('Follow', () => { - test('Get notification when follow', async () => { - await assertNotificationReceived( - 'b.test', bob, - async () => await bob.client.request('following/create', { userId: aliceInB.id }), - notification => notification.type === 'followRequestAccepted' && notification.userId === aliceInB.id, - true, - ); - - await bob.client.request('following/delete', { userId: aliceInB.id }); - await sleep(); - }); - - test('Get notification when get followed', async () => { - await assertNotificationReceived( - 'a.test', alice, - async () => await bob.client.request('following/create', { userId: aliceInB.id }), - notification => notification.type === 'follow' && notification.userId === bobInA.id, - true, - ); - }); - - afterAll(async () => await bob.client.request('following/delete', { userId: aliceInB.id })); - }); - - describe('Note', () => { - test('Get notification when get a reaction', async () => { - const note = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - const noteInB = await resolveRemoteNote('a.test', note.id, bob); - const reaction = '😅'; - await assertNotificationReceived( - 'a.test', alice, - async () => await bob.client.request('notes/reactions/create', { noteId: noteInB.id, reaction }), - notification => - notification.type === 'reaction' && notification.note.id === note.id && notification.userId === bobInA.id && notification.reaction === reaction, - true, - ); - }); - - test('Get notification when replied', async () => { - const note = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - const noteInB = await resolveRemoteNote('a.test', note.id, bob); - const text = crypto.randomUUID(); - await assertNotificationReceived( - 'a.test', alice, - async () => await bob.client.request('notes/create', { text, replyId: noteInB.id }), - notification => - notification.type === 'reply' && notification.note.reply!.id === note.id && notification.userId === bobInA.id && notification.note.text === text, - true, - ); - }); - - test('Get notification when renoted', async () => { - const note = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - const noteInB = await resolveRemoteNote('a.test', note.id, bob); - await assertNotificationReceived( - 'a.test', alice, - async () => await bob.client.request('notes/create', { renoteId: noteInB.id }), - notification => - notification.type === 'renote' && notification.note.renote!.id === note.id && notification.userId === bobInA.id, - true, - ); - }); - - test('Get notification when quoted', async () => { - const note = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - const noteInB = await resolveRemoteNote('a.test', note.id, bob); - const text = crypto.randomUUID(); - await assertNotificationReceived( - 'a.test', alice, - async () => await bob.client.request('notes/create', { text, renoteId: noteInB.id }), - notification => - notification.type === 'quote' && notification.note.renote!.id === note.id && notification.userId === bobInA.id && notification.note.text === text, - true, - ); - }); - - test('Get notification when mentioned', async () => { - const text = `@${alice.username}@a.test`; - await assertNotificationReceived( - 'a.test', alice, - async () => await bob.client.request('notes/create', { text }), - notification => notification.type === 'mention' && notification.userId === bobInA.id && notification.note.text === text, - true, - ); - }); - }); -}); diff --git a/packages/backend/test-federation/test/timeline.test.ts b/packages/backend/test-federation/test/timeline.test.ts deleted file mode 100644 index 2250bf4a42..0000000000 --- a/packages/backend/test-federation/test/timeline.test.ts +++ /dev/null @@ -1,328 +0,0 @@ -import { strictEqual } from 'assert'; -import * as Misskey from 'misskey-js'; -import { createAccount, fetchAdmin, isNoteUpdatedEventFired, isFired, type LoginUser, type Request, resolveRemoteUser, sleep, createRole } from './utils.js'; - -const bAdmin = await fetchAdmin('b.test'); - -describe('Timeline', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - - await bob.client.request('following/create', { userId: aliceInB.id }); - await sleep(); - }); - - type TimelineChannel = keyof Misskey.Channels & (`${string}Timeline` | 'antenna' | 'userList' | 'hashtag'); - type TimelineEndpoint = keyof Misskey.Endpoints & (`${string}timeline` | 'antennas/notes' | 'roles/notes' | 'notes/search-by-tag'); - const timelineMap = new Map([ - ['antenna', 'antennas/notes'], - ['globalTimeline', 'notes/global-timeline'], - ['homeTimeline', 'notes/timeline'], - ['hybridTimeline', 'notes/hybrid-timeline'], - ['localTimeline', 'notes/local-timeline'], - ['roleTimeline', 'roles/notes'], - ['hashtag', 'notes/search-by-tag'], - ['userList', 'notes/user-list-timeline'], - ]); - - async function postAndCheckReception( - timelineChannel: C, - expect: boolean, - noteParams: Misskey.entities.NotesCreateRequest = {}, - channelParams: Misskey.Channels[C]['params'] = {}, - ) { - let note: Misskey.entities.Note | undefined; - const text = noteParams.text ?? crypto.randomUUID(); - const streamingFired = await isFired( - 'b.test', bob, timelineChannel, - async () => { - note = (await alice.client.request('notes/create', { text, ...noteParams })).createdNote; - }, - 'note', msg => msg.text === text, - channelParams, - ); - strictEqual(streamingFired, expect); - - const endpoint = timelineMap.get(timelineChannel)!; - const params: Misskey.Endpoints[typeof endpoint]['req'] = - endpoint === 'antennas/notes' ? { antennaId: (channelParams as Misskey.Channels['antenna']['params']).antennaId } : - endpoint === 'notes/user-list-timeline' ? { listId: (channelParams as Misskey.Channels['userList']['params']).listId } : - endpoint === 'notes/search-by-tag' ? { query: (channelParams as Misskey.Channels['hashtag']['params']).q } : - endpoint === 'roles/notes' ? { roleId: (channelParams as Misskey.Channels['roleTimeline']['params']).roleId } : - {}; - - await sleep(); - const notes = await (bob.client.request as Request)(endpoint, params); - const noteInB = notes.filter(({ uri }) => uri === `https://a.test/notes/${note!.id}`).pop(); - const endpointFired = noteInB != null; - strictEqual(endpointFired, expect); - - // Let's check Delete reception - if (expect) { - const streamingFired = await isNoteUpdatedEventFired( - 'b.test', bob, noteInB!.id, - async () => await alice.client.request('notes/delete', { noteId: note!.id }), - msg => msg.type === 'deleted' && msg.id === noteInB!.id, - ); - strictEqual(streamingFired, true); - - await sleep(); - const notes = await (bob.client.request as Request)(endpoint, params); - const endpointFired = notes.every(({ uri }) => uri !== `https://a.test/notes/${note!.id}`); - strictEqual(endpointFired, true); - } - } - - describe('homeTimeline', () => { - // NOTE: narrowing scope intentionally to prevent mistakes by copy-and-paste - const homeTimeline = 'homeTimeline'; - - describe('Check reception of remote followee\'s Note', () => { - test('Receive remote followee\'s Note', async () => { - await postAndCheckReception(homeTimeline, true); - }); - - test('Receive remote followee\'s home-only Note', async () => { - await postAndCheckReception(homeTimeline, true, { visibility: 'home' }); - }); - - test('Receive remote followee\'s followers-only Note', async () => { - await postAndCheckReception(homeTimeline, true, { visibility: 'followers' }); - }); - - test('Receive remote followee\'s visible specified-only Note', async () => { - await postAndCheckReception(homeTimeline, true, { visibility: 'specified', visibleUserIds: [bobInA.id] }); - }); - - test('Don\'t receive remote followee\'s localOnly Note', async () => { - await postAndCheckReception(homeTimeline, false, { localOnly: true }); - }); - - test('Don\'t receive remote followee\'s invisible specified-only Note', async () => { - await postAndCheckReception(homeTimeline, false, { visibility: 'specified' }); - }); - - /** - * FIXME: can receive this - * @see https://github.com/misskey-dev/misskey/issues/14083 - */ - test.failing('Don\'t receive remote followee\'s invisible and mentioned specified-only Note', async () => { - await postAndCheckReception(homeTimeline, false, { text: `@${bob.username}@b.test Hello`, visibility: 'specified' }); - }); - - /** - * FIXME: cannot receive this - * @see https://github.com/misskey-dev/misskey/issues/14084 - */ - test.failing('Receive remote followee\'s visible specified-only reply to invisible specified-only Note', async () => { - const note = (await alice.client.request('notes/create', { text: 'a', visibility: 'specified' })).createdNote; - await postAndCheckReception(homeTimeline, true, { replyId: note.id, visibility: 'specified', visibleUserIds: [bobInA.id] }); - }); - }); - }); - - describe('localTimeline', () => { - const localTimeline = 'localTimeline'; - - describe('Check reception of remote followee\'s Note', () => { - test('Don\'t receive remote followee\'s Note', async () => { - await postAndCheckReception(localTimeline, false); - }); - }); - }); - - describe('hybridTimeline', () => { - const hybridTimeline = 'hybridTimeline'; - - describe('Check reception of remote followee\'s Note', () => { - test('Receive remote followee\'s Note', async () => { - await postAndCheckReception(hybridTimeline, true); - }); - - test('Receive remote followee\'s home-only Note', async () => { - await postAndCheckReception(hybridTimeline, true, { visibility: 'home' }); - }); - - test('Receive remote followee\'s followers-only Note', async () => { - await postAndCheckReception(hybridTimeline, true, { visibility: 'followers' }); - }); - - test('Receive remote followee\'s visible specified-only Note', async () => { - await postAndCheckReception(hybridTimeline, true, { visibility: 'specified', visibleUserIds: [bobInA.id] }); - }); - }); - }); - - describe('globalTimeline', () => { - const globalTimeline = 'globalTimeline'; - - describe('Check reception of remote followee\'s Note', () => { - test('Receive remote followee\'s Note', async () => { - await postAndCheckReception(globalTimeline, true); - }); - - test('Don\'t receive remote followee\'s home-only Note', async () => { - await postAndCheckReception(globalTimeline, false, { visibility: 'home' }); - }); - - test('Don\'t receive remote followee\'s followers-only Note', async () => { - await postAndCheckReception(globalTimeline, false, { visibility: 'followers' }); - }); - - test('Don\'t receive remote followee\'s visible specified-only Note', async () => { - await postAndCheckReception(globalTimeline, false, { visibility: 'specified', visibleUserIds: [bobInA.id] }); - }); - }); - }); - - describe('userList', () => { - const userList = 'userList'; - - let list: Misskey.entities.UserList; - - beforeAll(async () => { - list = await bob.client.request('users/lists/create', { name: 'Bob\'s List' }); - await bob.client.request('users/lists/push', { listId: list.id, userId: aliceInB.id }); - await sleep(); - }); - - describe('Check reception of remote followee\'s Note', () => { - test('Receive remote followee\'s Note', async () => { - await postAndCheckReception(userList, true, {}, { listId: list.id }); - }); - - test('Receive remote followee\'s home-only Note', async () => { - await postAndCheckReception(userList, true, { visibility: 'home' }, { listId: list.id }); - }); - - test('Receive remote followee\'s followers-only Note', async () => { - await postAndCheckReception(userList, true, { visibility: 'followers' }, { listId: list.id }); - }); - - test('Receive remote followee\'s visible specified-only Note', async () => { - await postAndCheckReception(userList, true, { visibility: 'specified', visibleUserIds: [bobInA.id] }, { listId: list.id }); - }); - }); - }); - - describe('hashtag', () => { - const hashtag = 'hashtag'; - - describe('Check reception of remote followee\'s Note', () => { - test('Receive remote followee\'s Note', async () => { - const tag = crypto.randomUUID(); - await postAndCheckReception(hashtag, true, { text: `#${tag}` }, { q: [[tag]] }); - }); - - test('Receive remote followee\'s home-only Note', async () => { - const tag = crypto.randomUUID(); - await postAndCheckReception(hashtag, true, { text: `#${tag}`, visibility: 'home' }, { q: [[tag]] }); - }); - - test('Receive remote followee\'s followers-only Note', async () => { - const tag = crypto.randomUUID(); - await postAndCheckReception(hashtag, true, { text: `#${tag}`, visibility: 'followers' }, { q: [[tag]] }); - }); - - test('Receive remote followee\'s visible specified-only Note', async () => { - const tag = crypto.randomUUID(); - await postAndCheckReception(hashtag, true, { text: `#${tag}`, visibility: 'specified', visibleUserIds: [bobInA.id] }, { q: [[tag]] }); - }); - }); - }); - - describe('roleTimeline', () => { - const roleTimeline = 'roleTimeline'; - - let role: Misskey.entities.Role; - - beforeAll(async () => { - role = await createRole('b.test', { - name: 'Remote Users', - description: 'Remote users are assigned to this role.', - condFormula: { - /** TODO: @see https://github.com/misskey-dev/misskey/issues/14169 */ - type: 'isRemote' as never, - }, - }); - await sleep(); - }); - - describe('Check reception of remote followee\'s Note', () => { - test('Receive remote followee\'s Note', async () => { - await postAndCheckReception(roleTimeline, true, {}, { roleId: role.id }); - }); - - test('Don\'t receive remote followee\'s home-only Note', async () => { - await postAndCheckReception(roleTimeline, false, { visibility: 'home' }, { roleId: role.id }); - }); - - test('Don\'t receive remote followee\'s followers-only Note', async () => { - await postAndCheckReception(roleTimeline, false, { visibility: 'followers' }, { roleId: role.id }); - }); - - test('Don\'t receive remote followee\'s visible specified-only Note', async () => { - await postAndCheckReception(roleTimeline, false, { visibility: 'specified', visibleUserIds: [bobInA.id] }, { roleId: role.id }); - }); - }); - - afterAll(async () => { - await bAdmin.client.request('admin/roles/delete', { roleId: role.id }); - }); - }); - - // TODO: Cannot test - describe.skip('antenna', () => { - const antenna = 'antenna'; - - let bobAntenna: Misskey.entities.Antenna; - - beforeAll(async () => { - bobAntenna = await bob.client.request('antennas/create', { - name: 'Bob\'s Egosurfing Antenna', - src: 'all', - keywords: [['Bob']], - excludeKeywords: [], - users: [], - caseSensitive: false, - localOnly: false, - withReplies: true, - withFile: true, - }); - await sleep(); - }); - - describe('Check reception of remote followee\'s Note', () => { - test('Receive remote followee\'s Note', async () => { - await postAndCheckReception(antenna, true, { text: 'I love Bob (1)' }, { antennaId: bobAntenna.id }); - }); - - test('Don\'t receive remote followee\'s home-only Note', async () => { - await postAndCheckReception(antenna, false, { text: 'I love Bob (2)', visibility: 'home' }, { antennaId: bobAntenna.id }); - }); - - test('Don\'t receive remote followee\'s followers-only Note', async () => { - await postAndCheckReception(antenna, false, { text: 'I love Bob (3)', visibility: 'followers' }, { antennaId: bobAntenna.id }); - }); - - test('Don\'t receive remote followee\'s visible specified-only Note', async () => { - await postAndCheckReception(antenna, false, { text: 'I love Bob (4)', visibility: 'specified', visibleUserIds: [bobInA.id] }, { antennaId: bobAntenna.id }); - }); - }); - - afterAll(async () => { - await bob.client.request('antennas/delete', { antennaId: bobAntenna.id }); - }); - }); -}); diff --git a/packages/backend/test-federation/test/user.test.ts b/packages/backend/test-federation/test/user.test.ts deleted file mode 100644 index 76605e61d4..0000000000 --- a/packages/backend/test-federation/test/user.test.ts +++ /dev/null @@ -1,560 +0,0 @@ -import assert, { rejects, strictEqual } from 'node:assert'; -import * as Misskey from 'misskey-js'; -import { createAccount, deepStrictEqualWithExcludedFields, fetchAdmin, type LoginUser, resolveRemoteNote, resolveRemoteUser, sleep } from './utils.js'; - -const [aAdmin, bAdmin] = await Promise.all([ - fetchAdmin('a.test'), - fetchAdmin('b.test'), -]); - -describe('User', () => { - describe('Profile', () => { - describe('Consistency of profile', () => { - let alice: LoginUser; - let aliceWatcher: LoginUser; - let aliceWatcherInB: LoginUser; - - beforeAll(async () => { - alice = await createAccount('a.test'); - [ - aliceWatcher, - aliceWatcherInB, - ] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - }); - - test('Check consistency', async () => { - const aliceInA = await aliceWatcher.client.request('users/show', { userId: alice.id }); - const resolved = await resolveRemoteUser('a.test', aliceInA.id, aliceWatcherInB); - const aliceInB = await aliceWatcherInB.client.request('users/show', { userId: resolved.id }); - - // console.log(`a.test: ${JSON.stringify(aliceInA, null, '\t')}`); - // console.log(`b.test: ${JSON.stringify(aliceInB, null, '\t')}`); - - deepStrictEqualWithExcludedFields(aliceInA, aliceInB, [ - 'id', - 'host', - 'avatarUrl', - 'instance', - 'badgeRoles', - 'url', - 'uri', - 'createdAt', - 'lastFetchedAt', - 'publicReactions', - ]); - }); - }); - - describe('ffVisibility is federated', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - - // NOTE: follow each other - await Promise.all([ - alice.client.request('following/create', { userId: bobInA.id }), - bob.client.request('following/create', { userId: aliceInB.id }), - ]); - await sleep(); - }); - - test('Visibility set public by default', async () => { - for (const user of await Promise.all([ - alice.client.request('users/show', { userId: bobInA.id }), - bob.client.request('users/show', { userId: aliceInB.id }), - ])) { - strictEqual(user.followersVisibility, 'public'); - strictEqual(user.followingVisibility, 'public'); - } - }); - - /** FIXME: not working */ - test.skip('Setting private for followersVisibility is federated', async () => { - await Promise.all([ - alice.client.request('i/update', { followersVisibility: 'private' }), - bob.client.request('i/update', { followersVisibility: 'private' }), - ]); - await sleep(); - - for (const user of await Promise.all([ - alice.client.request('users/show', { userId: bobInA.id }), - bob.client.request('users/show', { userId: aliceInB.id }), - ])) { - strictEqual(user.followersVisibility, 'private'); - strictEqual(user.followingVisibility, 'public'); - } - }); - - test.skip('Setting private for followingVisibility is federated', async () => { - await Promise.all([ - alice.client.request('i/update', { followingVisibility: 'private' }), - bob.client.request('i/update', { followingVisibility: 'private' }), - ]); - await sleep(); - - for (const user of await Promise.all([ - alice.client.request('users/show', { userId: bobInA.id }), - bob.client.request('users/show', { userId: aliceInB.id }), - ])) { - strictEqual(user.followersVisibility, 'private'); - strictEqual(user.followingVisibility, 'private'); - } - }); - }); - - describe('isCat is federated', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - }); - - test('Not isCat for default', () => { - strictEqual(aliceInB.isCat, false); - }); - - test('Becoming a cat is sent to their followers', async () => { - await bob.client.request('following/create', { userId: aliceInB.id }); - await sleep(); - - await alice.client.request('i/update', { isCat: true }); - await sleep(); - - const res = await bob.client.request('users/show', { userId: aliceInB.id }); - strictEqual(res.isCat, true); - }); - }); - - describe('Pinning Notes', () => { - let alice: LoginUser, bob: LoginUser; - let aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - aliceInB = await resolveRemoteUser('a.test', alice.id, bob); - - await bob.client.request('following/create', { userId: aliceInB.id }); - }); - - test('Pinning localOnly Note is not delivered', async () => { - const note = (await alice.client.request('notes/create', { text: 'a', localOnly: true })).createdNote; - await alice.client.request('i/pin', { noteId: note.id }); - await sleep(); - - const _aliceInB = await bob.client.request('users/show', { userId: aliceInB.id }); - strictEqual(_aliceInB.pinnedNoteIds.length, 0); - }); - - test('Pinning followers-only Note is not delivered', async () => { - const note = (await alice.client.request('notes/create', { text: 'a', visibility: 'followers' })).createdNote; - await alice.client.request('i/pin', { noteId: note.id }); - await sleep(); - - const _aliceInB = await bob.client.request('users/show', { userId: aliceInB.id }); - strictEqual(_aliceInB.pinnedNoteIds.length, 0); - }); - - let pinnedNote: Misskey.entities.Note; - - test('Pinning normal Note is delivered', async () => { - pinnedNote = (await alice.client.request('notes/create', { text: 'a' })).createdNote; - await alice.client.request('i/pin', { noteId: pinnedNote.id }); - await sleep(); - - const _aliceInB = await bob.client.request('users/show', { userId: aliceInB.id }); - strictEqual(_aliceInB.pinnedNoteIds.length, 1); - const pinnedNoteInB = await resolveRemoteNote('a.test', pinnedNote.id, bob); - strictEqual(_aliceInB.pinnedNotes[0].id, pinnedNoteInB.id); - }); - - test('Unpinning normal Note is delivered', async () => { - await alice.client.request('i/unpin', { noteId: pinnedNote.id }); - await sleep(); - - const _aliceInB = await bob.client.request('users/show', { userId: aliceInB.id }); - strictEqual(_aliceInB.pinnedNoteIds.length, 0); - }); - }); - }); - - describe('Follow / Unfollow', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - }); - - describe('Follow a.test ==> b.test', () => { - beforeAll(async () => { - await alice.client.request('following/create', { userId: bobInA.id }); - - await sleep(); - }); - - test('Check consistency with `users/following` and `users/followers` endpoints', async () => { - await Promise.all([ - strictEqual( - (await alice.client.request('users/following', { userId: alice.id })) - .some(v => v.followeeId === bobInA.id), - true, - ), - strictEqual( - (await bob.client.request('users/followers', { userId: bob.id })) - .some(v => v.followerId === aliceInB.id), - true, - ), - ]); - }); - }); - - describe('Unfollow a.test ==> b.test', () => { - beforeAll(async () => { - await alice.client.request('following/delete', { userId: bobInA.id }); - - await sleep(); - }); - - test('Check consistency with `users/following` and `users/followers` endpoints', async () => { - await Promise.all([ - strictEqual( - (await alice.client.request('users/following', { userId: alice.id })) - .some(v => v.followeeId === bobInA.id), - false, - ), - strictEqual( - (await bob.client.request('users/followers', { userId: bob.id })) - .some(v => v.followerId === aliceInB.id), - false, - ), - ]); - }); - }); - }); - - describe('Follow requests', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - - await alice.client.request('i/update', { isLocked: true }); - }); - - describe('Send follow request from Bob to Alice and cancel', () => { - describe('Bob sends follow request to Alice', () => { - beforeAll(async () => { - await bob.client.request('following/create', { userId: aliceInB.id }); - await sleep(); - }); - - test('Alice should have a request', async () => { - const requests = await alice.client.request('following/requests/list', {}); - strictEqual(requests.length, 1); - strictEqual(requests[0].followee.id, alice.id); - strictEqual(requests[0].follower.id, bobInA.id); - }); - }); - - describe('Alice cancels it', () => { - beforeAll(async () => { - await bob.client.request('following/requests/cancel', { userId: aliceInB.id }); - await sleep(); - }); - - test('Alice should have no requests', async () => { - const requests = await alice.client.request('following/requests/list', {}); - strictEqual(requests.length, 0); - }); - }); - }); - - describe('Send follow request from Bob to Alice and reject', () => { - beforeAll(async () => { - await bob.client.request('following/create', { userId: aliceInB.id }); - await sleep(); - - await alice.client.request('following/requests/reject', { userId: bobInA.id }); - await sleep(); - }); - - test('Bob should have no requests', async () => { - await rejects( - async () => await bob.client.request('following/requests/cancel', { userId: aliceInB.id }), - (err: any) => { - strictEqual(err.code, 'FOLLOW_REQUEST_NOT_FOUND'); - return true; - }, - ); - }); - - test('Bob doesn\'t follow Alice', async () => { - const following = await bob.client.request('users/following', { userId: bob.id }); - strictEqual(following.length, 0); - }); - }); - - describe('Send follow request from Bob to Alice and accept', () => { - beforeAll(async () => { - await bob.client.request('following/create', { userId: aliceInB.id }); - await sleep(); - - await alice.client.request('following/requests/accept', { userId: bobInA.id }); - await sleep(); - }); - - test('Bob follows Alice', async () => { - const following = await bob.client.request('users/following', { userId: bob.id }); - strictEqual(following.length, 1); - strictEqual(following[0].followeeId, aliceInB.id); - strictEqual(following[0].followerId, bob.id); - }); - }); - }); - - describe('Deletion', () => { - describe('Check Delete consistency', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - }); - - test('Bob follows Alice, and Alice deleted themself', async () => { - await bob.client.request('following/create', { userId: aliceInB.id }); - await sleep(); - - const followers = await alice.client.request('users/followers', { userId: alice.id }); - strictEqual(followers.length, 1); // followed by Bob - - await alice.client.request('i/delete-account', { password: alice.password }); - await sleep(); - - const following = await bob.client.request('users/following', { userId: bob.id }); - strictEqual(following.length, 0); // no following relation - - await rejects( - async () => await bob.client.request('following/create', { userId: aliceInB.id }), - (err: any) => { - strictEqual(err.code, 'NO_SUCH_USER'); - return true; - }, - ); - }); - }); - - describe('Deletion of remote user for moderation', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - }); - - test('Bob follows Alice, then Alice gets deleted in B server', async () => { - await bob.client.request('following/create', { userId: aliceInB.id }); - await sleep(); - - const followers = await alice.client.request('users/followers', { userId: alice.id }); - strictEqual(followers.length, 1); // followed by Bob - - await bAdmin.client.request('admin/delete-account', { userId: aliceInB.id }); - await sleep(); - - /** - * FIXME: remote account is not deleted! - * @see https://github.com/misskey-dev/misskey/issues/14728 - */ - const deletedAlice = await bob.client.request('users/show', { userId: aliceInB.id }); - assert(deletedAlice.id, aliceInB.id); - - // TODO: why still following relation? - const following = await bob.client.request('users/following', { userId: bob.id }); - strictEqual(following.length, 1); - await rejects( - async () => await bob.client.request('following/create', { userId: aliceInB.id }), - (err: any) => { - strictEqual(err.code, 'ALREADY_FOLLOWING'); - return true; - }, - ); - }); - - test('Alice tries to follow Bob, but it is not processed', async () => { - await alice.client.request('following/create', { userId: bobInA.id }); - await sleep(); - - const following = await alice.client.request('users/following', { userId: alice.id }); - strictEqual(following.length, 0); // Not following Bob because B server doesn't return Accept - - const followers = await bob.client.request('users/followers', { userId: bob.id }); - strictEqual(followers.length, 0); // Alice's Follow is not processed - }); - }); - }); - - describe('Suspension', () => { - describe('Check suspend/unsuspend consistency', () => { - let alice: LoginUser, bob: LoginUser; - let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; - - beforeAll(async () => { - [alice, bob] = await Promise.all([ - createAccount('a.test'), - createAccount('b.test'), - ]); - - [bobInA, aliceInB] = await Promise.all([ - resolveRemoteUser('b.test', bob.id, alice), - resolveRemoteUser('a.test', alice.id, bob), - ]); - }); - - test('Bob follows Alice, and Alice gets suspended, there is no following relation, and Bob fails to follow again', async () => { - await bob.client.request('following/create', { userId: aliceInB.id }); - await sleep(); - - const followers = await alice.client.request('users/followers', { userId: alice.id }); - strictEqual(followers.length, 1); // followed by Bob - - await aAdmin.client.request('admin/suspend-user', { userId: alice.id }); - await sleep(); - - const following = await bob.client.request('users/following', { userId: bob.id }); - strictEqual(following.length, 0); // no following relation - - await rejects( - async () => await bob.client.request('following/create', { userId: aliceInB.id }), - (err: any) => { - strictEqual(err.code, 'NO_SUCH_USER'); - return true; - }, - ); - }); - - test('Alice gets unsuspended, Bob succeeds in following Alice', async () => { - await aAdmin.client.request('admin/unsuspend-user', { userId: alice.id }); - await sleep(); - - const followers = await alice.client.request('users/followers', { userId: alice.id }); - strictEqual(followers.length, 1); // FIXME: followers are not deleted?? - - /** - * FIXME: still rejected! - * seems to can't process Undo Delete activity because it is not implemented - * related @see https://github.com/misskey-dev/misskey/issues/13273 - */ - await rejects( - async () => await bob.client.request('following/create', { userId: aliceInB.id }), - (err: any) => { - strictEqual(err.code, 'NO_SUCH_USER'); - return true; - }, - ); - - // FIXME: resolving also fails - await rejects( - async () => await resolveRemoteUser('a.test', alice.id, bob), - (err: any) => { - strictEqual(err.code, 'INTERNAL_ERROR'); - return true; - }, - ); - }); - - /** - * instead of simple unsuspension, let's tell existence by following from Alice - */ - test('Alice can follow Bob', async () => { - await alice.client.request('following/create', { userId: bobInA.id }); - await sleep(); - - const bobFollowers = await bob.client.request('users/followers', { userId: bob.id }); - strictEqual(bobFollowers.length, 1); // followed by Alice - assert(bobFollowers[0].follower != null); - const renewedaliceInB = bobFollowers[0].follower; - assert(aliceInB.username === renewedaliceInB.username); - assert(aliceInB.host === renewedaliceInB.host); - assert(aliceInB.id !== renewedaliceInB.id); // TODO: Same username and host, but their ids are different! Is it OK? - - const following = await bob.client.request('users/following', { userId: bob.id }); - strictEqual(following.length, 0); // following are deleted - - // Bob tries to follow Alice - await bob.client.request('following/create', { userId: renewedaliceInB.id }); - await sleep(); - - const aliceFollowers = await alice.client.request('users/followers', { userId: alice.id }); - strictEqual(aliceFollowers.length, 1); - - // FIXME: but resolving still fails ... - await rejects( - async () => await resolveRemoteUser('a.test', alice.id, bob), - (err: any) => { - strictEqual(err.code, 'INTERNAL_ERROR'); - return true; - }, - ); - }); - }); - }); -}); diff --git a/packages/backend/test-federation/test/utils.ts b/packages/backend/test-federation/test/utils.ts deleted file mode 100644 index 093277cdb4..0000000000 --- a/packages/backend/test-federation/test/utils.ts +++ /dev/null @@ -1,307 +0,0 @@ -import { deepStrictEqual, strictEqual } from 'assert'; -import { readFile } from 'fs/promises'; -import { dirname, join } from 'path'; -import { fileURLToPath } from 'url'; -import * as Misskey from 'misskey-js'; -import { WebSocket } from 'ws'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); - -export const ADMIN_PARAMS = { username: 'admin', password: 'admin' }; -const ADMIN_CACHE = new Map(); - -await Promise.all([ - fetchAdmin('a.test'), - fetchAdmin('b.test'), -]); - -type SigninResponse = Omit; - -export type LoginUser = SigninResponse & { - client: Misskey.api.APIClient; - username: string; - password: string; -} - -/** used for avoiding overload and some endpoints */ -export type Request = < - E extends keyof Misskey.Endpoints, - P extends Misskey.Endpoints[E]['req'], ->( - endpoint: E, - params: P, - credential?: string | null, -) => Promise>; - -type Host = 'a.test' | 'b.test'; - -export async function sleep(ms = 200): Promise { - return new Promise(resolve => setTimeout(resolve, ms)); -} - -async function signin( - host: Host, - params: Misskey.entities.SigninFlowRequest, -): Promise { - // wait for a second to prevent hit rate limit - await sleep(1000); - - return await (new Misskey.api.APIClient({ origin: `https://${host}` }).request as Request)('signin-flow', params) - .then(res => { - strictEqual(res.finished, true); - if (params.username === ADMIN_PARAMS.username) ADMIN_CACHE.set(host, res); - return res; - }) - .then(({ id, i }) => ({ id, i })) - .catch(async err => { - if (err.code === 'TOO_MANY_AUTHENTICATION_FAILURES') { - await sleep(Math.random() * 2000); - return await signin(host, params); - } - throw err; - }); -} - -async function createAdmin(host: Host): Promise { - const client = new Misskey.api.APIClient({ origin: `https://${host}` }); - return await client.request('admin/accounts/create', ADMIN_PARAMS).then(res => { - ADMIN_CACHE.set(host, { - id: res.id, - // @ts-expect-error FIXME: openapi-typescript generates incorrect response type for this endpoint, so ignore this - i: res.token, - }); - return res as Misskey.entities.SignupResponse; - }).then(async res => { - await client.request('admin/roles/update-default-policies', { - policies: { - /** TODO: @see https://github.com/misskey-dev/misskey/issues/14169 */ - rateLimitFactor: 0 as never, - }, - }, res.token); - return res; - }).catch(err => { - if (err.info.e.message === 'access denied') return undefined; - throw err; - }); -} - -export async function fetchAdmin(host: Host): Promise { - const admin = ADMIN_CACHE.get(host) ?? await signin(host, ADMIN_PARAMS) - .catch(async err => { - if (err.id === '6cc579cc-885d-43d8-95c2-b8c7fc963280') { - await createAdmin(host); - return await signin(host, ADMIN_PARAMS); - } - throw err; - }); - - return { - ...admin, - client: new Misskey.api.APIClient({ origin: `https://${host}`, credential: admin.i }), - ...ADMIN_PARAMS, - }; -} - -export async function createAccount(host: Host): Promise { - const username = crypto.randomUUID().replaceAll('-', '').substring(0, 20); - const password = crypto.randomUUID().replaceAll('-', ''); - const admin = await fetchAdmin(host); - await admin.client.request('admin/accounts/create', { username, password }); - const signinRes = await signin(host, { username, password }); - - return { - ...signinRes, - client: new Misskey.api.APIClient({ origin: `https://${host}`, credential: signinRes.i }), - username, - password, - }; -} - -export async function createModerator(host: Host): Promise { - const user = await createAccount(host); - const role = await createRole(host, { - name: 'Moderator', - isModerator: true, - }); - const admin = await fetchAdmin(host); - await admin.client.request('admin/roles/assign', { roleId: role.id, userId: user.id }); - return user; -} - -export async function createRole( - host: Host, - params: Partial = {}, -): Promise { - const admin = await fetchAdmin(host); - return await admin.client.request('admin/roles/create', { - name: 'Some role', - description: 'Role for testing', - color: null, - iconUrl: null, - target: 'conditional', - condFormula: {}, - isPublic: true, - isModerator: false, - isAdministrator: false, - isExplorable: true, - asBadge: false, - canEditMembersByModerator: false, - displayOrder: 0, - policies: {}, - ...params, - }); -} - -export async function resolveRemoteUser( - host: Host, - id: string, - from: LoginUser, -): Promise { - const uri = `https://${host}/users/${id}`; - return await from.client.request('ap/show', { uri }) - .then(res => { - strictEqual(res.type, 'User'); - strictEqual(res.object.uri, uri); - return res.object; - }); -} - -export async function resolveRemoteNote( - host: Host, - id: string, - from: LoginUser, -): Promise { - const uri = `https://${host}/notes/${id}`; - return await from.client.request('ap/show', { uri }) - .then(res => { - strictEqual(res.type, 'Note'); - strictEqual(res.object.uri, uri); - return res.object; - }); -} - -export async function uploadFile( - host: Host, - user: { i: string }, - path = '../../test/resources/192.jpg', -): Promise { - const filename = path.split('/').pop() ?? 'untitled'; - const blob = new Blob([await readFile(join(__dirname, path))]); - - const body = new FormData(); - body.append('i', user.i); - body.append('force', 'true'); - body.append('file', blob); - body.append('name', filename); - - return await fetch(`https://${host}/api/drive/files/create`, { method: 'POST', body }) - .then(async res => await res.json()); -} - -export async function addCustomEmoji( - host: Host, - param?: Partial, - path?: string, -): Promise { - const admin = await fetchAdmin(host); - const name = crypto.randomUUID().replaceAll('-', ''); - const file = await uploadFile(host, admin, path); - return await admin.client.request('admin/emoji/add', { name, fileId: file.id, ...param }); -} - -export function deepStrictEqualWithExcludedFields(actual: T, expected: T, excludedFields: (keyof T)[]) { - const _actual = structuredClone(actual); - const _expected = structuredClone(expected); - for (const obj of [_actual, _expected]) { - for (const field of excludedFields) { - delete obj[field]; - } - } - deepStrictEqual(_actual, _expected); -} - -export async function isFired( - host: Host, - user: { i: string }, - channel: C, - trigger: () => Promise, - type: T, - // @ts-expect-error TODO: why getting error here? - cond: (msg: Parameters[0]) => boolean, - params?: Misskey.Channels[C]['params'], -): Promise { - return new Promise(async (resolve, reject) => { - const stream = new Misskey.Stream(`wss://${host}`, { token: user.i }, { WebSocket }); - const connection = stream.useChannel(channel, params); - connection.on(type as any, ((msg: any) => { - if (cond(msg)) { - stream.close(); - clearTimeout(timer); - resolve(true); - } - }) as any); - - let timer: NodeJS.Timeout | undefined; - - await trigger().then(() => { - timer = setTimeout(() => { - stream.close(); - resolve(false); - }, 500); - }).catch(err => { - stream.close(); - clearTimeout(timer); - reject(err); - }); - }); -}; - -export async function isNoteUpdatedEventFired( - host: Host, - user: { i: string }, - noteId: string, - trigger: () => Promise, - cond: (msg: Parameters[0]) => boolean, -): Promise { - return new Promise(async (resolve, reject) => { - const stream = new Misskey.Stream(`wss://${host}`, { token: user.i }, { WebSocket }); - stream.send('s', { id: noteId }); - stream.on('noteUpdated', msg => { - if (cond(msg)) { - stream.close(); - clearTimeout(timer); - resolve(true); - } - }); - - let timer: NodeJS.Timeout | undefined; - - await trigger().then(() => { - timer = setTimeout(() => { - stream.close(); - resolve(false); - }, 500); - }).catch(err => { - stream.close(); - clearTimeout(timer); - reject(err); - }); - }); -}; - -export async function assertNotificationReceived( - receiverHost: Host, - receiver: LoginUser, - trigger: () => Promise, - cond: (notification: Misskey.entities.Notification) => boolean, - expect: boolean, -) { - const streamingFired = await isFired(receiverHost, receiver, 'main', trigger, 'notification', cond); - strictEqual(streamingFired, expect); - - const endpointFired = await receiver.client.request('i/notifications', {}) - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - .then(([notification]) => notification != null ? cond(notification) : false); - strictEqual(endpointFired, expect); -} diff --git a/packages/backend/test-federation/tsconfig.json b/packages/backend/test-federation/tsconfig.json deleted file mode 100644 index 3a1cb3b9f3..0000000000 --- a/packages/backend/test-federation/tsconfig.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "NodeNext", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ - // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ - // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ - // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./built", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ - // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - }, - "include": [ - "daemon.ts", - "./test/**/*.ts" - ] -} diff --git a/packages/backend/test-server/.swcrc b/packages/backend/test-server/.swcrc deleted file mode 100644 index e3d6935169..0000000000 --- a/packages/backend/test-server/.swcrc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/swcrc", - "jsc": { - "parser": { - "syntax": "typescript", - "dynamicImport": true, - "decorators": true - }, - "transform": { - "legacyDecorator": true, - "decoratorMetadata": true - }, - "experimental": { - "keepImportAssertions": true - }, - "baseUrl": "../built", - "paths": { - "@/*": ["*"] - }, - "target": "es2022" - }, - "minify": false -} diff --git a/packages/backend/test-server/entry.ts b/packages/backend/test-server/entry.ts deleted file mode 100644 index 04bf62d209..0000000000 --- a/packages/backend/test-server/entry.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { portToPid } from 'pid-port'; -import fkill from 'fkill'; -import Fastify from 'fastify'; -import { NestFactory } from '@nestjs/core'; -import { MainModule } from '@/MainModule.js'; -import { ServerService } from '@/server/ServerService.js'; -import { loadConfig } from '@/config.js'; -import { NestLogger } from '@/NestLogger.js'; -import { INestApplicationContext } from '@nestjs/common'; - -const config = loadConfig(); -const originEnv = JSON.stringify(process.env); - -process.env.NODE_ENV = 'test'; - -let app: INestApplicationContext; -let serverService: ServerService; - -/** - * テスト用のサーバインスタンスを起動する - */ -async function launch() { - await killTestServer(); - - console.log('starting application...'); - - app = await NestFactory.createApplicationContext(MainModule, { - logger: new NestLogger(), - }); - serverService = app.get(ServerService); - await serverService.launch(); - - await startControllerEndpoints(); - - // ジョブキューは必要な時にテストコード側で起動する - // ジョブキューが動くとテスト結果の確認に支障が出ることがあるので意図的に動かさないでいる - - console.log('application initialized.'); -} - -/** - * 既に重複したポートで待ち受けしているサーバがある場合はkillする - */ -async function killTestServer() { - // - try { - const pid = await portToPid(config.port); - if (pid) { - await fkill(pid, { force: true }); - } - } catch { - // NOP; - } -} - -/** - * 別プロセスに切り離してしまったが故に出来なくなった環境変数の書き換え等を実現するためのエンドポイントを作る - * @param port - */ -async function startControllerEndpoints(port = config.port + 1000) { - const fastify = Fastify(); - - fastify.post<{ Body: { key?: string, value?: string } }>('/env', async (req, res) => { - console.log(req.body); - const key = req.body['key']; - if (!key) { - res.code(400).send({ success: false }); - return; - } - - process.env[key] = req.body['value']; - - res.code(200).send({ success: true }); - }); - - fastify.post<{ Body: { key?: string, value?: string } }>('/env-reset', async (req, res) => { - process.env = JSON.parse(originEnv); - - await serverService.dispose(); - await app.close(); - - await killTestServer(); - - console.log('starting application...'); - - app = await NestFactory.createApplicationContext(MainModule, { - logger: new NestLogger(), - }); - serverService = app.get(ServerService); - await serverService.launch(); - - res.code(200).send({ success: true }); - }); - - await fastify.listen({ port: port, host: 'localhost' }); -} - -export default launch; diff --git a/packages/backend/test-server/eslint.config.js b/packages/backend/test-server/eslint.config.js deleted file mode 100644 index b9c16d469f..0000000000 --- a/packages/backend/test-server/eslint.config.js +++ /dev/null @@ -1,43 +0,0 @@ -import tsParser from '@typescript-eslint/parser'; -import sharedConfig from '../../shared/eslint.config.js'; - -export default [ - ...sharedConfig, - { - files: ['**/*.ts', '**/*.tsx'], - languageOptions: { - parserOptions: { - parser: tsParser, - project: ['./tsconfig.json'], - sourceType: 'module', - tsconfigRootDir: import.meta.dirname, - }, - }, - rules: { - 'import/order': ['warn', { - groups: [ - 'builtin', - 'external', - 'internal', - 'parent', - 'sibling', - 'index', - 'object', - 'type', - ], - pathGroups: [{ - pattern: '@/**', - group: 'external', - position: 'after', - }], - }], - 'no-restricted-globals': ['error', { - name: '__dirname', - message: 'Not in ESModule. Use `import.meta.url` instead.', - }, { - name: '__filename', - message: 'Not in ESModule. Use `import.meta.url` instead.', - }], - }, - }, -]; diff --git a/packages/backend/test-server/tsconfig.json b/packages/backend/test-server/tsconfig.json deleted file mode 100644 index 10313699c2..0000000000 --- a/packages/backend/test-server/tsconfig.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "compilerOptions": { - "allowJs": true, - "noEmitOnError": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noUnusedParameters": false, - "noUnusedLocals": false, - "noFallthroughCasesInSwitch": true, - "declaration": false, - "sourceMap": true, - "target": "ES2022", - "module": "nodenext", - "moduleResolution": "nodenext", - "allowSyntheticDefaultImports": true, - "removeComments": false, - "noLib": false, - "strict": true, - "strictNullChecks": true, - "strictPropertyInitialization": false, - "skipLibCheck": true, - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "resolveJsonModule": true, - "isolatedModules": true, - "rootDir": "../src", - "baseUrl": "./", - "paths": { - "@/*": ["../src/*"] - }, - "outDir": "../built-test", - "types": [ - "node" - ], - "typeRoots": [ - "../src/@types", - "../node_modules/@types", - "../node_modules" - ], - "lib": [ - "esnext" - ] - }, - "compileOnSave": false, - "include": [ - "./**/*.ts", - "../src/**/*.ts" - ], - "exclude": [ - "../src/**/*.test.ts" - ] -} diff --git a/packages/backend/test/.eslintrc.cjs b/packages/backend/test/.eslintrc.cjs new file mode 100644 index 0000000000..41ecea0c3f --- /dev/null +++ b/packages/backend/test/.eslintrc.cjs @@ -0,0 +1,11 @@ +module.exports = { + parserOptions: { + tsconfigRootDir: __dirname, + project: ['./tsconfig.json'], + }, + extends: ['../.eslintrc.cjs'], + env: { + node: true, + jest: true, + }, +}; diff --git a/packages/backend/test/compose.yml b/packages/backend/test/docker-compose.yml similarity index 94% rename from packages/backend/test/compose.yml rename to packages/backend/test/docker-compose.yml index 6593fc33dd..f2d8990758 100644 --- a/packages/backend/test/compose.yml +++ b/packages/backend/test/docker-compose.yml @@ -1,3 +1,5 @@ +version: "3" + services: redistest: image: redis:7 diff --git a/packages/backend/test/e2e/2fa.ts b/packages/backend/test/e2e/2fa.ts index 48e1bababb..ed967d2620 100644 --- a/packages/backend/test/e2e/2fa.ts +++ b/packages/backend/test/e2e/2fa.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,7 +10,7 @@ import * as crypto from 'node:crypto'; import cbor from 'cbor'; import * as OTPAuth from 'otpauth'; import { loadConfig } from '@/config.js'; -import { api, signup } from '../utils.js'; +import { api, signup, startServer } from '../utils.js'; import type { AuthenticationResponseJSON, AuthenticatorAssertionResponseJSON, @@ -18,11 +18,13 @@ import type { PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON, RegistrationResponseJSON, -} from '@simplewebauthn/types'; +} from '@simplewebauthn/typescript-types'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; describe('2要素認証', () => { - let alice: misskey.entities.SignupResponse; + let app: INestApplicationContext; + let alice: misskey.entities.MeSignup; const config = loadConfig(); const password = 'test'; @@ -136,7 +138,13 @@ describe('2要素認証', () => { keyName: string, credentialId: Buffer, requestOptions: PublicKeyCredentialRequestOptionsJSON, - }): misskey.entities.SigninFlowRequest => { + }): { + username: string, + password: string, + credential: AuthenticationResponseJSON, + 'g-recaptcha-response'?: string | null, + 'hcaptcha-response'?: string | null, + } => { // AuthenticatorAssertionResponse.authenticatorData // https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAssertionResponse/authenticatorData const authenticatorData = Buffer.concat([ @@ -177,11 +185,16 @@ describe('2要素認証', () => { }; beforeAll(async () => { + app = await startServer(); alice = await signup({ username, password }); }, 1000 * 60 * 2); + afterAll(async () => { + await app.close(); + }); + test('が設定でき、OTPでログインできる。', async () => { - const registerResponse = await api('i/2fa/register', { + const registerResponse = await api('/i/2fa/register', { password, }, alice); assert.strictEqual(registerResponse.status, 200); @@ -191,47 +204,43 @@ describe('2要素認証', () => { assert.strictEqual(registerResponse.body.label, username); assert.strictEqual(registerResponse.body.issuer, config.host); - const doneResponse = await api('i/2fa/done', { + const doneResponse = await api('/i/2fa/done', { token: otpToken(registerResponse.body.secret), }, alice); assert.strictEqual(doneResponse.status, 200); - const signinWithoutTokenResponse = await api('signin-flow', { - ...signinParam(), - }); - assert.strictEqual(signinWithoutTokenResponse.status, 200); - assert.deepStrictEqual(signinWithoutTokenResponse.body, { - finished: false, - next: 'totp', - }); + const usersShowResponse = await api('/users/show', { + username, + }, alice); + assert.strictEqual(usersShowResponse.status, 200); + assert.strictEqual(usersShowResponse.body.twoFactorEnabled, true); - const signinResponse = await api('signin-flow', { + const signinResponse = await api('/signin', { ...signinParam(), token: otpToken(registerResponse.body.secret), }); assert.strictEqual(signinResponse.status, 200); - assert.strictEqual(signinResponse.body.finished, true); assert.notEqual(signinResponse.body.i, undefined); // 後片付け - await api('i/2fa/unregister', { + await api('/i/2fa/unregister', { password, token: otpToken(registerResponse.body.secret), }, alice); }); test('が設定でき、セキュリティキーでログインできる。', async () => { - const registerResponse = await api('i/2fa/register', { + const registerResponse = await api('/i/2fa/register', { password, }, alice); assert.strictEqual(registerResponse.status, 200); - const doneResponse = await api('i/2fa/done', { + const doneResponse = await api('/i/2fa/done', { token: otpToken(registerResponse.body.secret), }, alice); assert.strictEqual(doneResponse.status, 200); - const registerKeyResponse = await api('i/2fa/register-key', { + const registerKeyResponse = await api('/i/2fa/register-key', { password, token: otpToken(registerResponse.body.secret), }, alice); @@ -241,54 +250,58 @@ describe('2要素認証', () => { const keyName = 'example-key'; const credentialId = crypto.randomBytes(0x41); - const keyDoneResponse = await api('i/2fa/key-done', keyDoneParam({ + const keyDoneResponse = await api('/i/2fa/key-done', keyDoneParam({ token: otpToken(registerResponse.body.secret), keyName, credentialId, creationOptions: registerKeyResponse.body, - } as any) as any, alice); + }), alice); assert.strictEqual(keyDoneResponse.status, 200); assert.strictEqual(keyDoneResponse.body.id, credentialId.toString('base64url')); assert.strictEqual(keyDoneResponse.body.name, keyName); - const signinResponse = await api('signin-flow', { + const usersShowResponse = await api('/users/show', { + username, + }); + assert.strictEqual(usersShowResponse.status, 200); + assert.strictEqual(usersShowResponse.body.securityKeys, true); + + const signinResponse = await api('/signin', { ...signinParam(), }); assert.strictEqual(signinResponse.status, 200); - assert.strictEqual(signinResponse.body.finished, false); - assert.strictEqual(signinResponse.body.next, 'passkey'); - assert.notEqual(signinResponse.body.authRequest.challenge, undefined); - assert.notEqual(signinResponse.body.authRequest.allowCredentials, undefined); - assert.strictEqual(signinResponse.body.authRequest.allowCredentials && signinResponse.body.authRequest.allowCredentials[0]?.id, credentialId.toString('base64url')); + assert.strictEqual(signinResponse.body.i, undefined); + assert.notEqual(signinResponse.body.challenge, undefined); + assert.notEqual(signinResponse.body.allowCredentials, undefined); + assert.strictEqual(signinResponse.body.allowCredentials[0].id, credentialId.toString('base64url')); - const signinResponse2 = await api('signin-flow', signinWithSecurityKeyParam({ + const signinResponse2 = await api('/signin', signinWithSecurityKeyParam({ keyName, credentialId, - requestOptions: signinResponse.body.authRequest, + requestOptions: signinResponse.body, })); assert.strictEqual(signinResponse2.status, 200); - assert.strictEqual(signinResponse2.body.finished, true); assert.notEqual(signinResponse2.body.i, undefined); // 後片付け - await api('i/2fa/unregister', { + await api('/i/2fa/unregister', { password, token: otpToken(registerResponse.body.secret), }, alice); }); test('が設定でき、セキュリティキーでパスワードレスログインできる。', async () => { - const registerResponse = await api('i/2fa/register', { + const registerResponse = await api('/i/2fa/register', { password, }, alice); assert.strictEqual(registerResponse.status, 200); - const doneResponse = await api('i/2fa/done', { + const doneResponse = await api('/i/2fa/done', { token: otpToken(registerResponse.body.secret), }, alice); assert.strictEqual(doneResponse.status, 200); - const registerKeyResponse = await api('i/2fa/register-key', { + const registerKeyResponse = await api('/i/2fa/register-key', { token: otpToken(registerResponse.body.secret), password, }, alice); @@ -296,64 +309,62 @@ describe('2要素認証', () => { const keyName = 'example-key'; const credentialId = crypto.randomBytes(0x41); - const keyDoneResponse = await api('i/2fa/key-done', keyDoneParam({ + const keyDoneResponse = await api('/i/2fa/key-done', keyDoneParam({ token: otpToken(registerResponse.body.secret), keyName, credentialId, creationOptions: registerKeyResponse.body, - } as any) as any, alice); + }), alice); assert.strictEqual(keyDoneResponse.status, 200); - const passwordLessResponse = await api('i/2fa/password-less', { + const passwordLessResponse = await api('/i/2fa/password-less', { value: true, }, alice); assert.strictEqual(passwordLessResponse.status, 204); - const iResponse = await api('i', {}, alice); - assert.strictEqual(iResponse.status, 200); - assert.strictEqual(iResponse.body.usePasswordLessLogin, true); + const usersShowResponse = await api('/users/show', { + username, + }); + assert.strictEqual(usersShowResponse.status, 200); + assert.strictEqual(usersShowResponse.body.usePasswordLessLogin, true); - const signinResponse = await api('signin-flow', { + const signinResponse = await api('/signin', { ...signinParam(), password: '', }); assert.strictEqual(signinResponse.status, 200); - assert.strictEqual(signinResponse.body.finished, false); - assert.strictEqual(signinResponse.body.next, 'passkey'); - assert.notEqual(signinResponse.body.authRequest.challenge, undefined); - assert.notEqual(signinResponse.body.authRequest.allowCredentials, undefined); + assert.strictEqual(signinResponse.body.i, undefined); - const signinResponse2 = await api('signin-flow', { + const signinResponse2 = await api('/signin', { ...signinWithSecurityKeyParam({ keyName, credentialId, - requestOptions: signinResponse.body.authRequest, - } as any), + requestOptions: signinResponse.body, + }), password: '', }); assert.strictEqual(signinResponse2.status, 200); - assert.strictEqual(signinResponse2.body.finished, true); assert.notEqual(signinResponse2.body.i, undefined); // 後片付け - await api('i/2fa/unregister', { + await api('/i/2fa/unregister', { password, token: otpToken(registerResponse.body.secret), }, alice); }); test('が設定でき、設定したセキュリティキーの名前を変更できる。', async () => { - const registerResponse = await api('i/2fa/register', { + const registerResponse = await api('/i/2fa/register', { password, }, alice); assert.strictEqual(registerResponse.status, 200); - const doneResponse = await api('i/2fa/done', { + const doneResponse = await api('/i/2fa/done', { token: otpToken(registerResponse.body.secret), }, alice); assert.strictEqual(doneResponse.status, 200); - const registerKeyResponse = await api('i/2fa/register-key', { + const registerKeyResponse = await api('/i/2fa/register-key', { token: otpToken(registerResponse.body.secret), password, }, alice); @@ -361,49 +372,48 @@ describe('2要素認証', () => { const keyName = 'example-key'; const credentialId = crypto.randomBytes(0x41); - const keyDoneResponse = await api('i/2fa/key-done', keyDoneParam({ + const keyDoneResponse = await api('/i/2fa/key-done', keyDoneParam({ token: otpToken(registerResponse.body.secret), keyName, credentialId, creationOptions: registerKeyResponse.body, - } as any) as any, alice); + }), alice); assert.strictEqual(keyDoneResponse.status, 200); const renamedKey = 'other-key'; - const updateKeyResponse = await api('i/2fa/update-key', { + const updateKeyResponse = await api('/i/2fa/update-key', { name: renamedKey, credentialId: credentialId.toString('base64url'), }, alice); assert.strictEqual(updateKeyResponse.status, 200); - const iResponse = await api('i', { + const iResponse = await api('/i', { }, alice); assert.strictEqual(iResponse.status, 200); - assert.ok(iResponse.body.securityKeysList); const securityKeys = iResponse.body.securityKeysList.filter((s: { id: string; }) => s.id === credentialId.toString('base64url')); assert.strictEqual(securityKeys.length, 1); assert.strictEqual(securityKeys[0].name, renamedKey); assert.notEqual(securityKeys[0].lastUsed, undefined); // 後片付け - await api('i/2fa/unregister', { + await api('/i/2fa/unregister', { password, token: otpToken(registerResponse.body.secret), }, alice); }); test('が設定でき、設定したセキュリティキーを削除できる。', async () => { - const registerResponse = await api('i/2fa/register', { + const registerResponse = await api('/i/2fa/register', { password, }, alice); assert.strictEqual(registerResponse.status, 200); - const doneResponse = await api('i/2fa/done', { + const doneResponse = await api('/i/2fa/done', { token: otpToken(registerResponse.body.secret), }, alice); assert.strictEqual(doneResponse.status, 200); - const registerKeyResponse = await api('i/2fa/register-key', { + const registerKeyResponse = await api('/i/2fa/register-key', { token: otpToken(registerResponse.body.secret), password, }, alice); @@ -411,21 +421,20 @@ describe('2要素認証', () => { const keyName = 'example-key'; const credentialId = crypto.randomBytes(0x41); - const keyDoneResponse = await api('i/2fa/key-done', keyDoneParam({ + const keyDoneResponse = await api('/i/2fa/key-done', keyDoneParam({ token: otpToken(registerResponse.body.secret), keyName, credentialId, creationOptions: registerKeyResponse.body, - } as any) as any, alice); + }), alice); assert.strictEqual(keyDoneResponse.status, 200); // テストの実行順によっては複数残ってるので全部消す - const beforeIResponse = await api('i', { + const iResponse = await api('/i', { }, alice); - assert.strictEqual(beforeIResponse.status, 200); - assert.ok(beforeIResponse.body.securityKeysList); - for (const key of beforeIResponse.body.securityKeysList) { - const removeKeyResponse = await api('i/2fa/remove-key', { + 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, @@ -433,55 +442,57 @@ describe('2要素認証', () => { assert.strictEqual(removeKeyResponse.status, 200); } - const afterIResponse = await api('i', {}, alice); - assert.strictEqual(afterIResponse.status, 200); - assert.strictEqual(afterIResponse.body.securityKeys, false); + const usersShowResponse = await api('/users/show', { + username, + }); + assert.strictEqual(usersShowResponse.status, 200); + assert.strictEqual(usersShowResponse.body.securityKeys, false); - const signinResponse = await api('signin-flow', { + const signinResponse = await api('/signin', { ...signinParam(), token: otpToken(registerResponse.body.secret), }); assert.strictEqual(signinResponse.status, 200); - assert.strictEqual(signinResponse.body.finished, true); assert.notEqual(signinResponse.body.i, undefined); // 後片付け - await api('i/2fa/unregister', { + await api('/i/2fa/unregister', { password, token: otpToken(registerResponse.body.secret), }, alice); }); test('が設定でき、設定解除できる。(パスワードのみでログインできる。)', async () => { - const registerResponse = await api('i/2fa/register', { + const registerResponse = await api('/i/2fa/register', { password, }, alice); assert.strictEqual(registerResponse.status, 200); - const doneResponse = await api('i/2fa/done', { + const doneResponse = await api('/i/2fa/done', { token: otpToken(registerResponse.body.secret), }, alice); assert.strictEqual(doneResponse.status, 200); - const iResponse = await api('i', {}, alice); - assert.strictEqual(iResponse.status, 200); - assert.strictEqual(iResponse.body.twoFactorEnabled, true); + const usersShowResponse = await api('/users/show', { + username, + }); + assert.strictEqual(usersShowResponse.status, 200); + assert.strictEqual(usersShowResponse.body.twoFactorEnabled, true); - const unregisterResponse = await api('i/2fa/unregister', { + const unregisterResponse = await api('/i/2fa/unregister', { token: otpToken(registerResponse.body.secret), password, }, alice); assert.strictEqual(unregisterResponse.status, 204); - const signinResponse = await api('signin-flow', { + const signinResponse = await api('/signin', { ...signinParam(), }); assert.strictEqual(signinResponse.status, 200); - assert.strictEqual(signinResponse.body.finished, true); assert.notEqual(signinResponse.body.i, undefined); // 後片付け - await api('i/2fa/unregister', { + await api('/i/2fa/unregister', { password, token: otpToken(registerResponse.body.secret), }, alice); diff --git a/packages/backend/test/e2e/antennas.ts b/packages/backend/test/e2e/antennas.ts index a544db955a..c0317f1435 100644 --- a/packages/backend/test/e2e/antennas.ts +++ b/packages/backend/test/e2e/antennas.ts @@ -1,24 +1,29 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; +import { inspect } from 'node:util'; import { DEFAULT_POLICIES } from '@/core/RoleService.js'; +import type { Packed } from '@/misc/json-schema.js'; import { - api, - failedApiCall, - post, - role, signup, - successfulApiCall, - testPaginationConsistency, - uploadFile, + post, userList, + page, + role, + startServer, + api, + successfulApiCall, + failedApiCall, + uploadFile, + testPaginationConsistency, } from '../utils.js'; import type * as misskey from 'misskey-js'; +import type { INestApplicationContext } from '@nestjs/common'; const compareBy = (selector: (s: T) => string = (s: T): string => s.id) => (a: T, b: T): number => { return selector(a).localeCompare(selector(b)); @@ -28,8 +33,11 @@ describe('アンテナ', () => { // エンティティとしてのアンテナを主眼においたテストを記述する // (Antennaを返すエンドポイント、Antennaエンティティを書き換えるエンドポイント、Antennaからノートを取得するエンドポイントをテストする) - type Antenna = misskey.entities.Antenna; - type User = misskey.entities.SignupResponse; + // BUG misskey-jsとjson-schemaが一致していない。 + // - srcのenumにgroupが残っている + // - userGroupIdが残っている, isActiveがない + type Antenna = misskey.entities.Antenna | Packed<'Antenna'>; + type User = misskey.entities.MeSignup; type Note = misskey.entities.Note; // アンテナを作成できる最小のパラメタ @@ -38,14 +46,16 @@ describe('アンテナ', () => { excludeKeywords: [['']], keywords: [['keyword']], name: 'test', + notify: false, src: 'all' as const, userListId: null, users: [''], withFile: false, withReplies: false, - excludeBots: false, }; + let app: INestApplicationContext; + let root: User; let alice: User; let bob: User; @@ -69,6 +79,10 @@ describe('アンテナ', () => { let userMutingAlice: User; let userMutedByAlice: User; + beforeAll(async () => { + app = await startServer(); + }, 1000 * 60 * 2); + beforeAll(async () => { root = await signup({ username: 'root' }); alice = await signup({ username: 'alice' }); @@ -76,7 +90,7 @@ describe('アンテナ', () => { aliceList = await userList(alice, {}); bob = await signup({ username: 'bob' }); aliceList = await userList(alice, {}); - bobFile = (await uploadFile(bob)).body!; + bobFile = (await uploadFile(bob)).body; bobList = await userList(bob); carol = await signup({ username: 'carol' }); await api('users/lists/push', { listId: aliceList.id, userId: bob.id }, alice); @@ -122,12 +136,16 @@ describe('アンテナ', () => { await api('mute/create', { userId: userMutedByAlice.id }, alice); }, 1000 * 60 * 10); + afterAll(async () => { + await app.close(); + }); + beforeEach(async () => { // テスト間で影響し合わないように毎回全部消す。 for (const user of [alice, bob]) { - const list = await api('antennas/list', {}, user); + const list = await api('/antennas/list', {}, user); for (const antenna of list.body) { - await api('antennas/delete', { antennaId: antenna.id }, user); + await api('/antennas/delete', { antennaId: antenna.id }, user); } } }); @@ -137,11 +155,11 @@ describe('アンテナ', () => { test('が作成できること、キーが過不足なく入っていること。', async () => { const response = await successfulApiCall({ endpoint: 'antennas/create', - parameters: defaultParam, + parameters: { ...defaultParam }, user: alice, }); assert.match(response.id, /[0-9a-z]{10}/); - const expected: Antenna = { + const expected = { id: response.id, caseSensitive: false, createdAt: new Date(response.createdAt).toISOString(), @@ -150,20 +168,20 @@ describe('アンテナ', () => { isActive: true, keywords: [['keyword']], name: 'test', + notify: false, src: 'all', userListId: null, users: [''], withFile: false, withReplies: false, - excludeBots: false, localOnly: false, - notify: false, - }; + } as Antenna; assert.deepStrictEqual(response, expected); }); test('が上限いっぱいまで作成できること', async () => { - const response = await Promise.all([...Array(DEFAULT_POLICIES.antennaLimit)].map(() => successfulApiCall({ + // antennaLimit + 1まで作れるのがキモ + const response = await Promise.all([...Array(DEFAULT_POLICIES.antennaLimit + 1)].map(() => successfulApiCall({ endpoint: 'antennas/create', parameters: { ...defaultParam }, user: alice, @@ -198,25 +216,27 @@ describe('アンテナ', () => { }); const antennaParamPattern = [ - { parameters: () => ({ name: 'x'.repeat(100) }) }, - { parameters: () => ({ name: 'x' }) }, - { parameters: () => ({ src: 'home' as const }) }, - { parameters: () => ({ src: 'all' as const }) }, - { parameters: () => ({ src: 'users' as const }) }, - { parameters: () => ({ src: 'list' as const }) }, - { parameters: () => ({ userListId: null }) }, - { parameters: () => ({ src: 'list' as const, userListId: aliceList.id }) }, - { parameters: () => ({ keywords: [['x']] }) }, - { parameters: () => ({ keywords: [['a', 'b', 'c'], ['x'], ['y'], ['z']] }) }, - { parameters: () => ({ excludeKeywords: [['a', 'b', 'c'], ['x'], ['y'], ['z']] }) }, - { parameters: () => ({ users: [alice.username] }) }, - { parameters: () => ({ users: [alice.username, bob.username, carol.username] }) }, - { parameters: () => ({ caseSensitive: false }) }, - { parameters: () => ({ caseSensitive: true }) }, - { parameters: () => ({ withReplies: false }) }, - { parameters: () => ({ withReplies: true }) }, - { parameters: () => ({ withFile: false }) }, - { parameters: () => ({ withFile: true }) }, + { parameters: (): object => ({ name: 'x'.repeat(100) }) }, + { parameters: (): object => ({ name: 'x' }) }, + { parameters: (): object => ({ src: 'home' }) }, + { parameters: (): object => ({ src: 'all' }) }, + { parameters: (): object => ({ src: 'users' }) }, + { parameters: (): object => ({ src: 'list' }) }, + { parameters: (): object => ({ userListId: null }) }, + { parameters: (): object => ({ src: 'list', userListId: aliceList.id }) }, + { parameters: (): object => ({ keywords: [['x']] }) }, + { parameters: (): object => ({ keywords: [['a', 'b', 'c'], ['x'], ['y'], ['z']] }) }, + { parameters: (): object => ({ excludeKeywords: [['a', 'b', 'c'], ['x'], ['y'], ['z']] }) }, + { parameters: (): object => ({ users: [alice.username] }) }, + { parameters: (): object => ({ users: [alice.username, bob.username, carol.username] }) }, + { parameters: (): object => ({ caseSensitive: false }) }, + { parameters: (): object => ({ caseSensitive: true }) }, + { parameters: (): object => ({ withReplies: false }) }, + { parameters: (): object => ({ withReplies: true }) }, + { parameters: (): object => ({ withFile: false }) }, + { parameters: (): object => ({ withFile: true }) }, + { parameters: (): object => ({ notify: false }) }, + { parameters: (): object => ({ notify: true }) }, ]; test.each(antennaParamPattern)('を作成できること($#)', async ({ parameters }) => { const response = await successfulApiCall({ @@ -228,17 +248,6 @@ describe('アンテナ', () => { assert.deepStrictEqual(response, expected); }); - test('を作成する時キーワードが指定されていないとエラーになる', async () => { - await failedApiCall({ - endpoint: 'antennas/create', - parameters: { ...defaultParam, keywords: [[]], excludeKeywords: [[]] }, - user: alice - }, { - status: 400, - code: 'EMPTY_KEYWORD', - id: '53ee222e-1ddd-4f9a-92e5-9fb82ddb463a' - }) - }); //#endregion //#region 更新(antennas/update) @@ -266,18 +275,6 @@ describe('アンテナ', () => { id: '1c6b35c9-943e-48c2-81e4-2844989407f7', }); }); - test('を変更する時キーワードが指定されていないとエラーになる', async () => { - const antenna = await successfulApiCall({ endpoint: 'antennas/create', parameters: defaultParam, user: alice }); - await failedApiCall({ - endpoint: 'antennas/update', - parameters: { ...defaultParam, antennaId: antenna.id, keywords: [[]], excludeKeywords: [[]] }, - user: alice - }, { - status: 400, - code: 'EMPTY_KEYWORD', - id: '721aaff6-4e1b-4d88-8de6-877fae9f68c4' - }) - }); //#endregion //#region 表示(antennas/show) @@ -352,7 +349,7 @@ describe('アンテナ', () => { test.each([ { label: '全体から', - parameters: () => ({ src: 'all' }), + parameters: (): object => ({ src: 'all' }), posts: [ { note: (): Promise => post(alice, { text: `${keyword}` }), included: true }, { note: (): Promise => post(userFollowedByAlice, { text: `${keyword}` }), included: true }, @@ -363,7 +360,7 @@ describe('アンテナ', () => { { // BUG e4144a1 以降home指定は壊れている(allと同じ) label: 'ホーム指定はallと同じ', - parameters: () => ({ src: 'home' }), + parameters: (): object => ({ src: 'home' }), posts: [ { note: (): Promise => post(alice, { text: `${keyword}` }), included: true }, { note: (): Promise => post(userFollowedByAlice, { text: `${keyword}` }), included: true }, @@ -374,7 +371,7 @@ describe('アンテナ', () => { { // https://github.com/misskey-dev/misskey/issues/9025 label: 'ただし、フォロワー限定投稿とDM投稿を含まない。フォロワーであっても。', - parameters: () => ({}), + parameters: (): object => ({}), posts: [ { note: (): Promise => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'public' }), included: true }, { note: (): Promise => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'home' }), included: true }, @@ -384,56 +381,56 @@ describe('アンテナ', () => { }, { label: 'ブロックしているユーザーのノートは含む', - parameters: () => ({}), + parameters: (): object => ({}), posts: [ { note: (): Promise => post(userBlockedByAlice, { text: `${keyword}` }), included: true }, ], }, { label: 'ブロックされているユーザーのノートは含まない', - parameters: () => ({}), + parameters: (): object => ({}), posts: [ { note: (): Promise => post(userBlockingAlice, { text: `${keyword}` }) }, ], }, { label: 'ミュートしているユーザーのノートは含まない', - parameters: () => ({}), + parameters: (): object => ({}), posts: [ { note: (): Promise => post(userMutedByAlice, { text: `${keyword}` }) }, ], }, { label: 'ミュートされているユーザーのノートは含む', - parameters: () => ({}), + parameters: (): object => ({}), posts: [ { note: (): Promise => post(userMutingAlice, { text: `${keyword}` }), included: true }, ], }, { label: '「見つけやすくする」がOFFのユーザーのノートも含まれる', - parameters: () => ({}), + parameters: (): object => ({}), posts: [ { note: (): Promise => post(userNotExplorable, { text: `${keyword}` }), included: true }, ], }, { label: '鍵付きユーザーのノートも含まれる', - parameters: () => ({}), + parameters: (): object => ({}), posts: [ { note: (): Promise => post(userLocking, { text: `${keyword}` }), included: true }, ], }, { label: 'サイレンスのノートも含まれる', - parameters: () => ({}), + parameters: (): object => ({}), posts: [ { note: (): Promise => post(userSilenced, { text: `${keyword}` }), included: true }, ], }, { label: '削除ユーザーのノートも含まれる', - parameters: () => ({}), + parameters: (): object => ({}), posts: [ { note: (): Promise => post(userDeletedBySelf, { text: `${keyword}` }), included: true }, { note: (): Promise => post(userDeletedByAdmin, { text: `${keyword}` }), included: true }, @@ -441,7 +438,7 @@ describe('アンテナ', () => { }, { label: 'ユーザー指定で', - parameters: () => ({ src: 'users', users: [`@${bob.username}`, `@${carol.username}`] }), + parameters: (): object => ({ src: 'users', users: [`@${bob.username}`, `@${carol.username}`] }), posts: [ { note: (): Promise => post(alice, { text: `test ${keyword}` }) }, { note: (): Promise => post(bob, { text: `test ${keyword}` }), included: true }, @@ -450,7 +447,7 @@ describe('アンテナ', () => { }, { label: 'リスト指定で', - parameters: () => ({ src: 'list', userListId: aliceList.id }), + parameters: (): object => ({ src: 'list', userListId: aliceList.id }), posts: [ { note: (): Promise => post(alice, { text: `test ${keyword}` }) }, { note: (): Promise => post(bob, { text: `test ${keyword}` }), included: true }, @@ -459,14 +456,14 @@ describe('アンテナ', () => { }, { label: 'CWにもマッチする', - parameters: () => ({ keywords: [[keyword]] }), + parameters: (): object => ({ keywords: [[keyword]] }), posts: [ { note: (): Promise => post(bob, { text: 'test', cw: `cw ${keyword}` }), included: true }, ], }, { label: 'キーワード1つ', - parameters: () => ({ keywords: [[keyword]] }), + parameters: (): object => ({ keywords: [[keyword]] }), posts: [ { note: (): Promise => post(alice, { text: 'test' }) }, { note: (): Promise => post(bob, { text: `test ${keyword}` }), included: true }, @@ -475,7 +472,7 @@ describe('アンテナ', () => { }, { label: 'キーワード3つ(AND)', - parameters: () => ({ keywords: [['A', 'B', 'C']] }), + parameters: (): object => ({ keywords: [['A', 'B', 'C']] }), posts: [ { note: (): Promise => post(bob, { text: 'test A' }) }, { note: (): Promise => post(bob, { text: 'test A B' }) }, @@ -486,7 +483,7 @@ describe('アンテナ', () => { }, { label: 'キーワード3つ(OR)', - parameters: () => ({ keywords: [['A'], ['B'], ['C']] }), + parameters: (): object => ({ keywords: [['A'], ['B'], ['C']] }), posts: [ { note: (): Promise => post(bob, { text: 'test' }) }, { note: (): Promise => post(bob, { text: 'test A' }), included: true }, @@ -499,7 +496,7 @@ describe('アンテナ', () => { }, { label: '除外ワード3つ(AND)', - parameters: () => ({ excludeKeywords: [['A', 'B', 'C']] }), + parameters: (): object => ({ excludeKeywords: [['A', 'B', 'C']] }), posts: [ { note: (): Promise => post(bob, { text: `test ${keyword}` }), included: true }, { note: (): Promise => post(bob, { text: `test ${keyword} A` }), included: true }, @@ -512,7 +509,7 @@ describe('アンテナ', () => { }, { label: '除外ワード3つ(OR)', - parameters: () => ({ excludeKeywords: [['A'], ['B'], ['C']] }), + parameters: (): object => ({ excludeKeywords: [['A'], ['B'], ['C']] }), posts: [ { note: (): Promise => post(bob, { text: `test ${keyword}` }), included: true }, { note: (): Promise => post(bob, { text: `test ${keyword} A` }) }, @@ -525,7 +522,7 @@ describe('アンテナ', () => { }, { label: 'キーワード1つ(大文字小文字区別する)', - parameters: () => ({ keywords: [['KEYWORD']], caseSensitive: true }), + parameters: (): object => ({ keywords: [['KEYWORD']], caseSensitive: true }), posts: [ { note: (): Promise => post(bob, { text: 'keyword' }) }, { note: (): Promise => post(bob, { text: 'kEyWoRd' }) }, @@ -534,7 +531,7 @@ describe('アンテナ', () => { }, { label: 'キーワード1つ(大文字小文字区別しない)', - parameters: () => ({ keywords: [['KEYWORD']], caseSensitive: false }), + parameters: (): object => ({ keywords: [['KEYWORD']], caseSensitive: false }), posts: [ { note: (): Promise => post(bob, { text: 'keyword' }), included: true }, { note: (): Promise => post(bob, { text: 'kEyWoRd' }), included: true }, @@ -543,7 +540,7 @@ describe('アンテナ', () => { }, { label: '除外ワード1つ(大文字小文字区別する)', - parameters: () => ({ excludeKeywords: [['KEYWORD']], caseSensitive: true }), + parameters: (): object => ({ excludeKeywords: [['KEYWORD']], caseSensitive: true }), posts: [ { note: (): Promise => post(bob, { text: `${keyword}` }), included: true }, { note: (): Promise => post(bob, { text: `${keyword} keyword` }), included: true }, @@ -553,7 +550,7 @@ describe('アンテナ', () => { }, { label: '除外ワード1つ(大文字小文字区別しない)', - parameters: () => ({ excludeKeywords: [['KEYWORD']], caseSensitive: false }), + parameters: (): object => ({ excludeKeywords: [['KEYWORD']], caseSensitive: false }), posts: [ { note: (): Promise => post(bob, { text: `${keyword}` }), included: true }, { note: (): Promise => post(bob, { text: `${keyword} keyword` }) }, @@ -563,7 +560,7 @@ describe('アンテナ', () => { }, { label: '添付ファイルを問わない', - parameters: () => ({ withFile: false }), + parameters: (): object => ({ withFile: false }), posts: [ { note: (): Promise => post(bob, { text: `${keyword}`, fileIds: [bobFile.id] }), included: true }, { note: (): Promise => post(bob, { text: `${keyword}` }), included: true }, @@ -571,7 +568,7 @@ describe('アンテナ', () => { }, { label: '添付ファイル付きのみ', - parameters: () => ({ withFile: true }), + parameters: (): object => ({ withFile: true }), posts: [ { note: (): Promise => post(bob, { text: `${keyword}`, fileIds: [bobFile.id] }), included: true }, { note: (): Promise => post(bob, { text: `${keyword}` }) }, @@ -579,7 +576,7 @@ describe('アンテナ', () => { }, { label: 'リプライ以外', - parameters: () => ({ withReplies: false }), + parameters: (): object => ({ withReplies: false }), posts: [ { note: (): Promise => post(bob, { text: `${keyword}`, replyId: alicePost.id }) }, { note: (): Promise => post(bob, { text: `${keyword}` }), included: true }, @@ -587,7 +584,7 @@ describe('アンテナ', () => { }, { label: 'リプライも含む', - parameters: () => ({ withReplies: true }), + parameters: (): object => ({ withReplies: true }), posts: [ { note: (): Promise => post(bob, { text: `${keyword}`, replyId: alicePost.id }), included: true }, { note: (): Promise => post(bob, { text: `${keyword}` }), included: true }, @@ -650,7 +647,7 @@ describe('アンテナ', () => { endpoint: 'antennas/notes', parameters: { antennaId: antenna.id, ...paginationParam }, user: alice, - }); + }) as any as Note[]; }, offsetBy, 'desc'); }); diff --git a/packages/backend/test/e2e/api-visibility.ts b/packages/backend/test/e2e/api-visibility.ts index 2dd645d97a..33c8d03fdb 100644 --- a/packages/backend/test/e2e/api-visibility.ts +++ b/packages/backend/test/e2e/api-visibility.ts @@ -1,61 +1,72 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; -import { UserToken, api, post, signup } from '../utils.js'; +import { signup, api, post, startServer } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; describe('API visibility', () => { + let app: INestApplicationContext; + + beforeAll(async () => { + app = await startServer(); + }, 1000 * 60 * 2); + + afterAll(async () => { + await app.close(); + }); + describe('Note visibility', () => { //#region vars /** ヒロイン */ - let alice: misskey.entities.SignupResponse; + let alice: misskey.entities.MeSignup; /** フォロワー */ - let follower: misskey.entities.SignupResponse; + let follower: misskey.entities.MeSignup; /** 非フォロワー */ - let other: misskey.entities.SignupResponse; + let other: misskey.entities.MeSignup; /** 非フォロワーでもリプライやメンションをされた人 */ - let target: misskey.entities.SignupResponse; + let target: misskey.entities.MeSignup; /** specified mentionでmentionを飛ばされる人 */ - let target2: misskey.entities.SignupResponse; + let target2: misskey.entities.MeSignup; /** public-post */ - let pub: misskey.entities.Note; + let pub: any; /** home-post */ - let home: misskey.entities.Note; + let home: any; /** followers-post */ - let fol: misskey.entities.Note; + let fol: any; /** specified-post */ - let spe: misskey.entities.Note; + let spe: any; /** public-reply to target's post */ - let pubR: misskey.entities.Note; + let pubR: any; /** home-reply to target's post */ - let homeR: misskey.entities.Note; + let homeR: any; /** followers-reply to target's post */ - let folR: misskey.entities.Note; + let folR: any; /** specified-reply to target's post */ - let speR: misskey.entities.Note; + let speR: any; /** public-mention to target */ - let pubM: misskey.entities.Note; + let pubM: any; /** home-mention to target */ - let homeM: misskey.entities.Note; + let homeM: any; /** followers-mention to target */ - let folM: misskey.entities.Note; + let folM: any; /** specified-mention to target */ - let speM: misskey.entities.Note; + let speM: any; /** reply target post */ - let tgt: misskey.entities.Note; + let tgt: any; //#endregion - const show = async (noteId: misskey.entities.Note['id'], by?: UserToken) => { - return await api('notes/show', { + const show = async (noteId: any, by: any) => { + return await api('/notes/show', { noteId, }, by); }; @@ -70,7 +81,7 @@ describe('API visibility', () => { target2 = await signup({ username: 'target2' }); // follow alice <= follower - await api('following/create', { userId: alice.id }, follower); + await api('/following/create', { userId: alice.id }, follower); // normal posts pub = await post(alice, { text: 'x', visibility: 'public' }); @@ -111,7 +122,7 @@ describe('API visibility', () => { }); test('[show] public-postを未認証が見れる', async () => { - const res = await show(pub.id); + const res = await show(pub.id, null); assert.strictEqual(res.body.text, 'x'); }); @@ -132,7 +143,7 @@ describe('API visibility', () => { }); test('[show] home-postを未認証が見れる', async () => { - const res = await show(home.id); + const res = await show(home.id, null); assert.strictEqual(res.body.text, 'x'); }); @@ -153,7 +164,7 @@ describe('API visibility', () => { }); test('[show] followers-postを未認証が見れない', async () => { - const res = await show(fol.id); + const res = await show(fol.id, null); assert.strictEqual(res.body.isHidden, true); }); @@ -179,7 +190,7 @@ describe('API visibility', () => { }); test('[show] specified-postを未認証が見れない', async () => { - const res = await show(spe.id); + const res = await show(spe.id, null); assert.strictEqual(res.body.isHidden, true); }); //#endregion @@ -207,7 +218,7 @@ describe('API visibility', () => { }); test('[show] public-replyを未認証が見れる', async () => { - const res = await show(pubR.id); + const res = await show(pubR.id, null); assert.strictEqual(res.body.text, 'x'); }); @@ -233,7 +244,7 @@ describe('API visibility', () => { }); test('[show] home-replyを未認証が見れる', async () => { - const res = await show(homeR.id); + const res = await show(homeR.id, null); assert.strictEqual(res.body.text, 'x'); }); @@ -259,7 +270,7 @@ describe('API visibility', () => { }); test('[show] followers-replyを未認証が見れない', async () => { - const res = await show(folR.id); + const res = await show(folR.id, null); assert.strictEqual(res.body.isHidden, true); }); @@ -290,7 +301,7 @@ describe('API visibility', () => { }); test('[show] specified-replyを未認証が見れない', async () => { - const res = await show(speR.id); + const res = await show(speR.id, null); assert.strictEqual(res.body.isHidden, true); }); //#endregion @@ -318,7 +329,7 @@ describe('API visibility', () => { }); test('[show] public-mentionを未認証が見れる', async () => { - const res = await show(pubM.id); + const res = await show(pubM.id, null); assert.strictEqual(res.body.text, '@target x'); }); @@ -344,7 +355,7 @@ describe('API visibility', () => { }); test('[show] home-mentionを未認証が見れる', async () => { - const res = await show(homeM.id); + const res = await show(homeM.id, null); assert.strictEqual(res.body.text, '@target x'); }); @@ -370,7 +381,7 @@ describe('API visibility', () => { }); test('[show] followers-mentionを未認証が見れない', async () => { - const res = await show(folM.id); + const res = await show(folM.id, null); assert.strictEqual(res.body.isHidden, true); }); @@ -401,69 +412,69 @@ describe('API visibility', () => { }); test('[show] specified-mentionを未認証が見れない', async () => { - const res = await show(speM.id); + const res = await show(speM.id, null); assert.strictEqual(res.body.isHidden, true); }); //#endregion //#region HTL test('[HTL] public-post が 自分が見れる', async () => { - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); assert.strictEqual(res.status, 200); - const notes = res.body.filter(n => n.id === pub.id); + const notes = res.body.filter((n: any) => n.id === pub.id); assert.strictEqual(notes[0].text, 'x'); }); test('[HTL] public-post が 非フォロワーから見れない', async () => { - const res = await api('notes/timeline', { limit: 100 }, other); + const res = await api('/notes/timeline', { limit: 100 }, other); assert.strictEqual(res.status, 200); - const notes = res.body.filter(n => n.id === pub.id); + const notes = res.body.filter((n: any) => n.id === pub.id); assert.strictEqual(notes.length, 0); }); test('[HTL] followers-post が フォロワーから見れる', async () => { - const res = await api('notes/timeline', { limit: 100 }, follower); + const res = await api('/notes/timeline', { limit: 100 }, follower); assert.strictEqual(res.status, 200); - const notes = res.body.filter(n => n.id === fol.id); + const notes = res.body.filter((n: any) => n.id === fol.id); assert.strictEqual(notes[0].text, 'x'); }); //#endregion //#region RTL test('[replies] followers-reply が フォロワーから見れる', async () => { - const res = await api('notes/replies', { noteId: tgt.id, limit: 100 }, follower); + const res = await api('/notes/replies', { noteId: tgt.id, limit: 100 }, follower); assert.strictEqual(res.status, 200); - const notes = res.body.filter(n => n.id === folR.id); + const notes = res.body.filter((n: any) => n.id === folR.id); assert.strictEqual(notes[0].text, 'x'); }); test('[replies] followers-reply が 非フォロワー (リプライ先ではない) から見れない', async () => { - const res = await api('notes/replies', { noteId: tgt.id, limit: 100 }, other); + const res = await api('/notes/replies', { noteId: tgt.id, limit: 100 }, other); assert.strictEqual(res.status, 200); - const notes = res.body.filter(n => n.id === folR.id); + const notes = res.body.filter((n: any) => n.id === folR.id); assert.strictEqual(notes.length, 0); }); test('[replies] followers-reply が 非フォロワー (リプライ先である) から見れる', async () => { - const res = await api('notes/replies', { noteId: tgt.id, limit: 100 }, target); + const res = await api('/notes/replies', { noteId: tgt.id, limit: 100 }, target); assert.strictEqual(res.status, 200); - const notes = res.body.filter(n => n.id === folR.id); + const notes = res.body.filter((n: any) => n.id === folR.id); assert.strictEqual(notes[0].text, 'x'); }); //#endregion //#region MTL test('[mentions] followers-reply が 非フォロワー (リプライ先である) から見れる', async () => { - const res = await api('notes/mentions', { limit: 100 }, target); + const res = await api('/notes/mentions', { limit: 100 }, target); assert.strictEqual(res.status, 200); - const notes = res.body.filter(n => n.id === folR.id); + const notes = res.body.filter((n: any) => n.id === folR.id); assert.strictEqual(notes[0].text, 'x'); }); test('[mentions] followers-mention が 非フォロワー (メンション先である) から見れる', async () => { - const res = await api('notes/mentions', { limit: 100 }, target); + const res = await api('/notes/mentions', { limit: 100 }, target); assert.strictEqual(res.status, 200); - const notes = res.body.filter(n => n.id === folM.id); + const notes = res.body.filter((n: any) => n.id === folM.id); assert.strictEqual(notes[0].text, '@target x'); }); //#endregion diff --git a/packages/backend/test/e2e/api.ts b/packages/backend/test/e2e/api.ts index 49c6a0636b..cf24228b83 100644 --- a/packages/backend/test/e2e/api.ts +++ b/packages/backend/test/e2e/api.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,48 +7,45 @@ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; import { IncomingMessage } from 'http'; -import { - api, - connectStream, - createAppToken, - failedApiCall, - relativeFetch, - signup, - successfulApiCall, - uploadFile, - waitFire, -} from '../utils.js'; +import { signup, api, startServer, successfulApiCall, failedApiCall, uploadFile, waitFire, connectStream, relativeFetch, createAppToken } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; describe('API', () => { - let alice: misskey.entities.SignupResponse; - let bob: misskey.entities.SignupResponse; + let app: INestApplicationContext; + let alice: misskey.entities.MeSignup; + let bob: misskey.entities.MeSignup; + let carol: misskey.entities.MeSignup; beforeAll(async () => { + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); + carol = await signup({ username: 'carol' }); }, 1000 * 60 * 2); + afterAll(async () => { + await app.close(); + }); + describe('General validation', () => { test('wrong type', async () => { - const res = await api('test', { + const res = await api('/test', { required: true, - // @ts-expect-error string must be string string: 42, }); assert.strictEqual(res.status, 400); }); test('missing require param', async () => { - // @ts-expect-error required is required - const res = await api('test', { + const res = await api('/test', { string: 'a', }); assert.strictEqual(res.status, 400); }); test('invalid misskey:id (empty string)', async () => { - const res = await api('test', { + const res = await api('/test', { required: true, id: '', }); @@ -56,7 +53,7 @@ describe('API', () => { }); test('valid misskey:id', async () => { - const res = await api('test', { + const res = await api('/test', { required: true, id: '8wvhjghbxu', }); @@ -64,7 +61,7 @@ describe('API', () => { }); test('default value', async () => { - const res = await api('test', { + const res = await api('/test', { required: true, string: 'a', }); @@ -73,7 +70,7 @@ describe('API', () => { }); test('can set null even if it has default value', async () => { - const res = await api('test', { + const res = await api('/test', { required: true, nullableDefault: null, }); @@ -82,7 +79,7 @@ describe('API', () => { }); test('cannot set undefined if it has default value', async () => { - const res = await api('test', { + const res = await api('/test', { required: true, nullableDefault: undefined, }); @@ -99,14 +96,14 @@ describe('API', () => { // aliceは管理者、APIを使える await successfulApiCall({ - endpoint: 'admin/get-index-stats', + endpoint: '/admin/get-index-stats', parameters: {}, user: alice, }); // bobは一般ユーザーだからダメ await failedApiCall({ - endpoint: 'admin/get-index-stats', + endpoint: '/admin/get-index-stats', parameters: {}, user: bob, }, { @@ -117,7 +114,7 @@ describe('API', () => { // publicアクセスももちろんダメ await failedApiCall({ - endpoint: 'admin/get-index-stats', + endpoint: '/admin/get-index-stats', parameters: {}, user: undefined, }, { @@ -128,7 +125,7 @@ describe('API', () => { // ごまがしもダメ await failedApiCall({ - endpoint: 'admin/get-index-stats', + endpoint: '/admin/get-index-stats', parameters: {}, user: { token: 'tsukawasete' }, }, { @@ -138,13 +135,13 @@ describe('API', () => { }); await successfulApiCall({ - endpoint: 'admin/get-index-stats', + endpoint: '/admin/get-index-stats', parameters: {}, user: { token: application2 }, }); await failedApiCall({ - endpoint: 'admin/get-index-stats', + endpoint: '/admin/get-index-stats', parameters: {}, user: { token: application }, }, { @@ -154,7 +151,7 @@ describe('API', () => { }); await failedApiCall({ - endpoint: 'admin/get-index-stats', + endpoint: '/admin/get-index-stats', parameters: {}, user: { token: application3 }, }, { @@ -164,7 +161,7 @@ describe('API', () => { }); await failedApiCall({ - endpoint: 'admin/get-index-stats', + endpoint: '/admin/get-index-stats', parameters: {}, user: { token: application4 }, }, { @@ -177,7 +174,7 @@ describe('API', () => { describe('Authentication header', () => { test('一般リクエスト', async () => { await successfulApiCall({ - endpoint: 'admin/get-index-stats', + endpoint: '/admin/get-index-stats', parameters: {}, user: { token: alice.token, @@ -211,7 +208,7 @@ describe('API', () => { describe('tokenエラー応答でWWW-Authenticate headerを送る', () => { describe('invalid_token', () => { test('一般リクエスト', async () => { - const result = await api('admin/get-index-stats', {}, { + const result = await api('/admin/get-index-stats', {}, { token: 'syuilo', bearer: true, }); @@ -246,7 +243,7 @@ describe('API', () => { describe('tokenがないとrealmだけおくる', () => { test('一般リクエスト', async () => { - const result = await api('admin/get-index-stats', {}); + const result = await api('/admin/get-index-stats', {}); assert.strictEqual(result.status, 401); assert.strictEqual(result.headers.get('WWW-Authenticate'), 'Bearer realm="Misskey"'); }); @@ -259,8 +256,7 @@ describe('API', () => { }); test('invalid_request', async () => { - // @ts-expect-error text must be string - const result = await api('notes/create', { text: true }, { + const result = await api('/notes/create', { text: true }, { token: alice.token, bearer: true, }); diff --git a/packages/backend/test/e2e/block.ts b/packages/backend/test/e2e/block.ts index 35b0e59383..4445d9036c 100644 --- a/packages/backend/test/e2e/block.ts +++ b/packages/backend/test/e2e/block.ts @@ -1,28 +1,36 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; -import { api, castAsError, post, signup } from '../utils.js'; +import { signup, api, post, startServer } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; describe('Block', () => { + let app: INestApplicationContext; + // alice blocks bob - let alice: misskey.entities.SignupResponse; - let bob: misskey.entities.SignupResponse; - let carol: misskey.entities.SignupResponse; + let alice: misskey.entities.MeSignup; + let bob: misskey.entities.MeSignup; + let carol: misskey.entities.MeSignup; beforeAll(async () => { + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); carol = await signup({ username: 'carol' }); }, 1000 * 60 * 2); + afterAll(async () => { + await app.close(); + }); + test('Block作成', async () => { - const res = await api('blocking/create', { + const res = await api('/blocking/create', { userId: bob.id, }, alice); @@ -30,39 +38,37 @@ describe('Block', () => { }); test('ブロックされているユーザーをフォローできない', async () => { - const res = await api('following/create', { userId: alice.id }, bob); + const res = await api('/following/create', { userId: alice.id }, bob); assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.id, 'c4ab57cc-4e41-45e9-bfd9-584f61e35ce0'); + assert.strictEqual(res.body.error.id, 'c4ab57cc-4e41-45e9-bfd9-584f61e35ce0'); }); test('ブロックされているユーザーにリアクションできない', async () => { const note = await post(alice, { text: 'hello' }); - const res = await api('notes/reactions/create', { noteId: note.id, reaction: '👍' }, bob); + const res = await api('/notes/reactions/create', { noteId: note.id, reaction: '👍' }, bob); assert.strictEqual(res.status, 400); - assert.ok(res.body); - assert.strictEqual(castAsError(res.body).error.id, '20ef5475-9f38-4e4c-bd33-de6d979498ec'); + assert.strictEqual(res.body.error.id, '20ef5475-9f38-4e4c-bd33-de6d979498ec'); }); test('ブロックされているユーザーに返信できない', async () => { const note = await post(alice, { text: 'hello' }); - const res = await api('notes/create', { replyId: note.id, text: 'yo' }, bob); + const res = await api('/notes/create', { replyId: note.id, text: 'yo' }, bob); assert.strictEqual(res.status, 400); - assert.ok(res.body); - assert.strictEqual(castAsError(res.body).error.id, 'b390d7e1-8a5e-46ed-b625-06271cafd3d3'); + assert.strictEqual(res.body.error.id, 'b390d7e1-8a5e-46ed-b625-06271cafd3d3'); }); test('ブロックされているユーザーのノートをRenoteできない', async () => { const note = await post(alice, { text: 'hello' }); - const res = await api('notes/create', { renoteId: note.id, text: 'yo' }, bob); + const res = await api('/notes/create', { renoteId: note.id, text: 'yo' }, bob); assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.id, 'b390d7e1-8a5e-46ed-b625-06271cafd3d3'); + assert.strictEqual(res.body.error.id, 'b390d7e1-8a5e-46ed-b625-06271cafd3d3'); }); // TODO: ユーザーリストに入れられないテスト @@ -74,13 +80,12 @@ describe('Block', () => { const bobNote = await post(bob, { text: 'hi' }); const carolNote = await post(carol, { text: 'hi' }); - const res = await api('notes/local-timeline', {}, bob); - const body = res.body as misskey.entities.Note[]; + const res = await api('/notes/local-timeline', {}, bob); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(body.some(note => note.id === aliceNote.id), false); - assert.strictEqual(body.some(note => note.id === bobNote.id), true); - assert.strictEqual(body.some(note => note.id === carolNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true); }); }); diff --git a/packages/backend/test/e2e/clips.ts b/packages/backend/test/e2e/clips.ts index a130c3698d..49092fba63 100644 --- a/packages/backend/test/e2e/clips.ts +++ b/packages/backend/test/e2e/clips.ts @@ -1,39 +1,64 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; +import { JTDDataType } from 'ajv/dist/jtd'; import { DEFAULT_POLICIES } from '@/core/RoleService.js'; -import { api, ApiRequest, failedApiCall, hiddenNote, post, signup, successfulApiCall } from '../utils.js'; -import type * as Misskey from 'misskey-js'; - -type Optional = Pick, K> & Omit; +import type { Packed } from '@/misc/json-schema.js'; +import { paramDef as CreateParamDef } from '@/server/api/endpoints/clips/create.js'; +import { paramDef as UpdateParamDef } from '@/server/api/endpoints/clips/update.js'; +import { paramDef as DeleteParamDef } from '@/server/api/endpoints/clips/delete.js'; +import { paramDef as ShowParamDef } from '@/server/api/endpoints/clips/show.js'; +import { paramDef as FavoriteParamDef } from '@/server/api/endpoints/clips/favorite.js'; +import { paramDef as UnfavoriteParamDef } from '@/server/api/endpoints/clips/unfavorite.js'; +import { paramDef as AddNoteParamDef } from '@/server/api/endpoints/clips/add-note.js'; +import { paramDef as RemoveNoteParamDef } from '@/server/api/endpoints/clips/remove-note.js'; +import { paramDef as NotesParamDef } from '@/server/api/endpoints/clips/notes.js'; +import { + signup, + post, + startServer, + api, + successfulApiCall, + failedApiCall, + ApiRequest, + hiddenNote, +} from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; describe('クリップ', () => { - let alice: Misskey.entities.SignupResponse; - let bob: Misskey.entities.SignupResponse; - let aliceNote: Misskey.entities.Note; - let aliceHomeNote: Misskey.entities.Note; - let aliceFollowersNote: Misskey.entities.Note; - let aliceSpecifiedNote: Misskey.entities.Note; - let bobNote: Misskey.entities.Note; - let bobHomeNote: Misskey.entities.Note; - let bobFollowersNote: Misskey.entities.Note; - let bobSpecifiedNote: Misskey.entities.Note; + type User = Packed<'User'>; + type Note = Packed<'Note'>; + type Clip = Packed<'Clip'>; + + let app: INestApplicationContext; + + let alice: User; + let bob: User; + let aliceNote: Note; + let aliceHomeNote: Note; + let aliceFollowersNote: Note; + let aliceSpecifiedNote: Note; + let bobNote: Note; + let bobHomeNote: Note; + let bobFollowersNote: Note; + let bobSpecifiedNote: Note; const compareBy = (selector: (s: T) => string = (s: T): string => s.id) => (a: T, b: T): number => { return selector(a).localeCompare(selector(b)); }; - const defaultCreate = (): Pick => ({ + type CreateParam = JTDDataType; + const defaultCreate = (): Partial => ({ name: 'test', }); - const create = async (parameters: Partial = {}, request: Partial> = {}): Promise => { - const clip = await successfulApiCall({ - endpoint: 'clips/create', + const create = async (parameters: Partial = {}, request: Partial = {}): Promise => { + const clip = await successfulApiCall({ + endpoint: '/clips/create', parameters: { ...defaultCreate(), ...parameters, @@ -51,16 +76,17 @@ describe('クリップ', () => { return clip; }; - const createMany = async (parameters: Partial, count = 10, user = alice): Promise => { + const createMany = async (parameters: Partial, count = 10, user = alice): Promise => { return await Promise.all([...Array(count)].map((_, i) => create({ name: `test${i}`, ...parameters, }, { user }))); }; - const update = async (parameters: Optional, request: Partial> = {}): Promise => { - const clip = await successfulApiCall({ - endpoint: 'clips/update', + type UpdateParam = JTDDataType; + const update = async (parameters: Partial, request: Partial = {}): Promise => { + const clip = await successfulApiCall({ + endpoint: '/clips/update', parameters: { name: 'updated', ...parameters, @@ -78,9 +104,10 @@ describe('クリップ', () => { return clip; }; - const deleteClip = async (parameters: Misskey.entities.ClipsDeleteRequest, request: Partial> = {}): Promise => { - await successfulApiCall({ - endpoint: 'clips/delete', + type DeleteParam = JTDDataType; + const deleteClip = async (parameters: DeleteParam, request: Partial = {}): Promise => { + return await successfulApiCall({ + endpoint: '/clips/delete', parameters, user: alice, ...request, @@ -89,53 +116,60 @@ describe('クリップ', () => { }); }; - const show = async (parameters: Misskey.entities.ClipsShowRequest, request: Partial> = {}): Promise => { - return await successfulApiCall({ - endpoint: 'clips/show', + type ShowParam = JTDDataType; + const show = async (parameters: ShowParam, request: Partial = {}): Promise => { + return await successfulApiCall({ + endpoint: '/clips/show', parameters, user: alice, ...request, }); }; - const list = async (request: Partial>): Promise => { - return successfulApiCall({ - endpoint: 'clips/list', + const list = async (request: Partial): Promise => { + return successfulApiCall({ + endpoint: '/clips/list', parameters: {}, user: alice, ...request, }); }; - const usersClips = async (parameters: Misskey.entities.UsersClipsRequest, request: Partial> = {}): Promise => { - return await successfulApiCall({ - endpoint: 'users/clips', - parameters, + const usersClips = async (request: Partial): Promise => { + return await successfulApiCall({ + endpoint: '/users/clips', + parameters: {}, user: alice, ...request, }); }; beforeAll(async () => { + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); - aliceNote = await post(alice, { text: 'test' }); - aliceHomeNote = await post(alice, { text: 'home only', visibility: 'home' }); - aliceFollowersNote = await post(alice, { text: 'followers only', visibility: 'followers' }); - aliceSpecifiedNote = await post(alice, { text: 'specified only', visibility: 'specified' }); - bobNote = await post(bob, { text: 'test' }); - bobHomeNote = await post(bob, { text: 'home only', visibility: 'home' }); - bobFollowersNote = await post(bob, { text: 'followers only', visibility: 'followers' }); - bobSpecifiedNote = await post(bob, { text: 'specified only', visibility: 'specified' }); + // FIXME: misskey-jsのNoteはoutdatedなので直接変換できない + aliceNote = await post(alice, { text: 'test' }) as any; + aliceHomeNote = await post(alice, { text: 'home only', visibility: 'home' }) as any; + aliceFollowersNote = await post(alice, { text: 'followers only', visibility: 'followers' }) as any; + aliceSpecifiedNote = await post(alice, { text: 'specified only', visibility: 'specified' }) as any; + bobNote = await post(bob, { text: 'test' }) as any; + bobHomeNote = await post(bob, { text: 'home only', visibility: 'home' }) as any; + bobFollowersNote = await post(bob, { text: 'followers only', visibility: 'followers' }) as any; + bobSpecifiedNote = await post(bob, { text: 'specified only', visibility: 'specified' }) as any; }, 1000 * 60 * 2); + afterAll(async () => { + await app.close(); + }); + afterEach(async () => { // テスト間で影響し合わないように毎回全部消す。 for (const user of [alice, bob]) { - const list = await api('clips/list', { limit: 11 }, user); + const list = await api('/clips/list', { limit: 11 }, user); for (const clip of list.body) { - await api('clips/delete', { clipId: clip.id }, user); + await api('/clips/delete', { clipId: clip.id }, user); } } }); @@ -153,13 +187,14 @@ describe('クリップ', () => { }); test('の作成はポリシーで定められた数以上はできない。', async () => { - const clipLimit = DEFAULT_POLICIES.clipLimit; + // ポリシー + 1まで作れるという所がミソ + const clipLimit = DEFAULT_POLICIES.clipLimit + 1; for (let i = 0; i < clipLimit; i++) { await create(); } await failedApiCall({ - endpoint: 'clips/create', + endpoint: '/clips/create', parameters: defaultCreate(), user: alice, }, { @@ -186,8 +221,7 @@ describe('クリップ', () => { { label: 'descriptionが最大長+1', parameters: { description: 'a'.repeat(2049) } }, ]; test.each(createClipDenyPattern)('の作成は$labelならできない', async ({ parameters }) => failedApiCall({ - endpoint: 'clips/create', - // @ts-expect-error invalid params + endpoint: '/clips/create', parameters: { ...defaultCreate(), ...parameters, @@ -229,15 +263,15 @@ describe('クリップ', () => { code: 'NO_SUCH_CLIP', id: 'b4d92d70-b216-46fa-9a3f-a8c811699257', } }, - { label: '他人のクリップ', user: () => bob, assertion: { + { label: '他人のクリップ', user: (): User => bob, assertion: { code: 'NO_SUCH_CLIP', id: 'b4d92d70-b216-46fa-9a3f-a8c811699257', } }, ...createClipDenyPattern as any, ])('の更新は$labelならできない', async ({ parameters, user, assertion }) => failedApiCall({ - endpoint: 'clips/update', + endpoint: '/clips/update', parameters: { - clipId: (await create({}, { user: (user ?? (() => alice))() })).id, + clipId: (await create({}, { user: (user ?? ((): User => alice))() })).id, name: 'updated', ...parameters, }, @@ -262,15 +296,14 @@ describe('クリップ', () => { code: 'NO_SUCH_CLIP', id: '70ca08ba-6865-4630-b6fb-8494759aa754', } }, - { label: '他人のクリップ', user: () => bob, assertion: { + { label: '他人のクリップ', user: (): User => bob, assertion: { code: 'NO_SUCH_CLIP', id: '70ca08ba-6865-4630-b6fb-8494759aa754', } }, ])('の削除は$labelならできない', async ({ parameters, user, assertion }) => failedApiCall({ - endpoint: 'clips/delete', + endpoint: '/clips/delete', parameters: { - // @ts-expect-error clipId must not be null - clipId: (await create({}, { user: (user ?? (() => alice))() })).id, + clipId: (await create({}, { user: (user ?? ((): User => alice))() })).id, ...parameters, }, user: alice, @@ -290,7 +323,7 @@ describe('クリップ', () => { test('のID指定取得は他人のPrivateなクリップは取得できない', async () => { const clip = await create({ isPublic: false }, { user: bob } ); failedApiCall({ - endpoint: 'clips/show', + endpoint: '/clips/show', parameters: { clipId: clip.id }, user: alice, }, { @@ -307,8 +340,7 @@ describe('クリップ', () => { id: 'c3c5fe33-d62c-44d2-9ea5-d997703f5c20', } }, ])('のID指定取得は$labelならできない', async ({ parameters, assetion }) => failedApiCall({ - endpoint: 'clips/show', - // @ts-expect-error clipId must not be undefined + endpoint: '/clips/show', parameters: { ...parameters, }, @@ -326,7 +358,7 @@ describe('クリップ', () => { }); test('の一覧(clips/list)が取得できる(上限いっぱい)', async () => { - const clipLimit = DEFAULT_POLICIES.clipLimit; + const clipLimit = DEFAULT_POLICIES.clipLimit + 1; const clips = await createMany({}, clipLimit); const res = await list({ parameters: { limit: 1 }, // FIXME: 無視されて11全部返ってくる @@ -341,23 +373,27 @@ describe('クリップ', () => { test('の一覧が取得できる(空)', async () => { const res = await usersClips({ - userId: alice.id, + parameters: { + userId: alice.id, + }, }); assert.deepStrictEqual(res, []); }); test.each([ { label: '' }, - { label: '他人アカウントから', user: () => bob }, + { label: '他人アカウントから', user: (): User => bob }, ])('の一覧が$label取得できる', async () => { const clips = await createMany({ isPublic: true }); const res = await usersClips({ - userId: alice.id, + parameters: { + userId: alice.id, + }, }); // 返ってくる配列には順序保障がないのでidでソートして厳密比較 assert.deepStrictEqual( - res.sort(compareBy(s => s.id)), + res.sort(compareBy(s => s.id)), clips.sort(compareBy(s => s.id))); // 認証状態で見たときだけisFavoritedが入っている @@ -367,16 +403,17 @@ describe('クリップ', () => { }); test.each([ - { label: '未認証', user: () => undefined }, + { label: '未認証', user: (): undefined => undefined }, { label: '存在しないユーザーのもの', parameters: { userId: 'xxxxxxx' } }, ])('の一覧は$labelでも取得できる', async ({ parameters, user }) => { const clips = await createMany({ isPublic: true }); const res = await usersClips({ - userId: alice.id, - limit: clips.length, - ...parameters, - }, { - user: (user ?? (() => alice))(), + parameters: { + userId: alice.id, + limit: clips.length, + ...parameters, + }, + user: (user ?? ((): User => alice))(), }); // 未認証で見たときはisFavoritedは入らない @@ -389,8 +426,10 @@ describe('クリップ', () => { await create({ isPublic: false }); const aliceClip = await create({ isPublic: true }); const res = await usersClips({ - userId: alice.id, - limit: 2, + parameters: { + userId: alice.id, + limit: 2, + }, }); assert.deepStrictEqual(res, [aliceClip]); }); @@ -399,15 +438,17 @@ describe('クリップ', () => { const clips = await createMany({ isPublic: true }, 7); clips.sort(compareBy(s => s.id)); const res = await usersClips({ - userId: alice.id, - sinceId: clips[1].id, - untilId: clips[5].id, - limit: 4, + parameters: { + userId: alice.id, + sinceId: clips[1].id, + untilId: clips[5].id, + limit: 4, + }, }); // Promise.allで返ってくる配列には順序保障がないのでidでソートして厳密比較 assert.deepStrictEqual( - res.sort(compareBy(s => s.id)), + res.sort(compareBy(s => s.id)), [clips[2], clips[3], clips[4]], // sinceIdとuntilId自体は結果に含まれない clips[1].id + ' ... ' + clips[3].id + ' with ' + clips.map(s => s.id) + ' vs. ' + res.map(s => s.id)); }); @@ -417,9 +458,8 @@ describe('クリップ', () => { { label: 'limitゼロ', parameters: { limit: 0 } }, { label: 'limit最大+1', parameters: { limit: 101 } }, ])('の一覧は$labelだと取得できない', async ({ parameters }) => failedApiCall({ - endpoint: 'users/clips', + endpoint: '/users/clips', parameters: { - // @ts-expect-error userId must not be undefined userId: alice.id, ...parameters, }, @@ -431,15 +471,15 @@ describe('クリップ', () => { })); test.each([ - { label: '作成', endpoint: 'clips/create' as const }, - { label: '更新', endpoint: 'clips/update' as const }, - { label: '削除', endpoint: 'clips/delete' as const }, - { label: '取得', endpoint: 'clips/list' as const }, - { label: 'お気に入り設定', endpoint: 'clips/favorite' as const }, - { label: 'お気に入り解除', endpoint: 'clips/unfavorite' as const }, - { label: 'お気に入り取得', endpoint: 'clips/my-favorites' as const }, - { label: 'ノート追加', endpoint: 'clips/add-note' as const }, - { label: 'ノート削除', endpoint: 'clips/remove-note' as const }, + { label: '作成', endpoint: '/clips/create' }, + { label: '更新', endpoint: '/clips/update' }, + { label: '削除', endpoint: '/clips/delete' }, + { label: '取得', endpoint: '/clips/list' }, + { label: 'お気に入り設定', endpoint: '/clips/favorite' }, + { label: 'お気に入り解除', endpoint: '/clips/unfavorite' }, + { label: 'お気に入り取得', endpoint: '/clips/my-favorites' }, + { label: 'ノート追加', endpoint: '/clips/add-note' }, + { label: 'ノート削除', endpoint: '/clips/remove-note' }, ])('の$labelは未認証ではできない', async ({ endpoint }) => await failedApiCall({ endpoint: endpoint, parameters: {}, @@ -451,11 +491,12 @@ describe('クリップ', () => { })); describe('のお気に入り', () => { - let aliceClip: Misskey.entities.Clip; + let aliceClip: Clip; - const favorite = async (parameters: Misskey.entities.ClipsFavoriteRequest, request: Partial> = {}): Promise => { - await successfulApiCall({ - endpoint: 'clips/favorite', + type FavoriteParam = JTDDataType; + const favorite = async (parameters: FavoriteParam, request: Partial = {}): Promise => { + return successfulApiCall({ + endpoint: '/clips/favorite', parameters, user: alice, ...request, @@ -464,9 +505,10 @@ describe('クリップ', () => { }); }; - const unfavorite = async (parameters: Misskey.entities.ClipsUnfavoriteRequest, request: Partial> = {}): Promise => { - await successfulApiCall({ - endpoint: 'clips/unfavorite', + type UnfavoriteParam = JTDDataType; + const unfavorite = async (parameters: UnfavoriteParam, request: Partial = {}): Promise => { + return successfulApiCall({ + endpoint: '/clips/unfavorite', parameters, user: alice, ...request, @@ -475,9 +517,9 @@ describe('クリップ', () => { }); }; - const myFavorites = async (request: Partial> = {}): Promise => { - return successfulApiCall({ - endpoint: 'clips/my-favorites', + const myFavorites = async (request: Partial = {}): Promise => { + return successfulApiCall({ + endpoint: '/clips/my-favorites', parameters: {}, user: alice, ...request, @@ -543,7 +585,7 @@ describe('クリップ', () => { test('は同じクリップに対して二回設定できない。', async () => { await favorite({ clipId: aliceClip.id }); await failedApiCall({ - endpoint: 'clips/favorite', + endpoint: '/clips/favorite', parameters: { clipId: aliceClip.id, }, @@ -561,15 +603,14 @@ describe('クリップ', () => { code: 'NO_SUCH_CLIP', id: '4c2aaeae-80d8-4250-9606-26cb1fdb77a5', } }, - { label: '他人のクリップ', user: () => bob, assertion: { + { label: '他人のクリップ', user: (): User => bob, assertion: { code: 'NO_SUCH_CLIP', id: '4c2aaeae-80d8-4250-9606-26cb1fdb77a5', } }, ])('の設定は$labelならできない', async ({ parameters, user, assertion }) => failedApiCall({ - endpoint: 'clips/favorite', + endpoint: '/clips/favorite', parameters: { - // @ts-expect-error clipId must not be null - clipId: (await create({}, { user: (user ?? (() => alice))() })).id, + clipId: (await create({}, { user: (user ?? ((): User => alice))() })).id, ...parameters, }, user: alice, @@ -595,7 +636,7 @@ describe('クリップ', () => { code: 'NO_SUCH_CLIP', id: '2603966e-b865-426c-94a7-af4a01241dc1', } }, - { label: '他人のクリップ', user: () => bob, assertion: { + { label: '他人のクリップ', user: (): User => bob, assertion: { code: 'NOT_FAVORITED', id: '90c3a9e8-b321-4dae-bf57-2bf79bbcc187', } }, @@ -604,10 +645,9 @@ describe('クリップ', () => { id: '90c3a9e8-b321-4dae-bf57-2bf79bbcc187', } }, ])('の設定解除は$labelならできない', async ({ parameters, user, assertion }) => failedApiCall({ - endpoint: 'clips/unfavorite', + endpoint: '/clips/unfavorite', parameters: { - // @ts-expect-error clipId must not be null - clipId: (await create({}, { user: (user ?? (() => alice))() })).id, + clipId: (await create({}, { user: (user ?? ((): User => alice))() })).id, ...parameters, }, user: alice, @@ -632,38 +672,41 @@ describe('クリップ', () => { }); describe('に紐づくノート', () => { - let aliceClip: Misskey.entities.Clip; + let aliceClip: Clip; - const sampleNotes = (): Misskey.entities.Note[] => [ + const sampleNotes = (): Note[] => [ aliceNote, aliceHomeNote, aliceFollowersNote, aliceSpecifiedNote, bobNote, bobHomeNote, bobFollowersNote, bobSpecifiedNote, ]; - const addNote = async (parameters: Misskey.entities.ClipsAddNoteRequest, request: Partial> = {}): Promise => { - return successfulApiCall({ - endpoint: 'clips/add-note', + type AddNoteParam = JTDDataType; + const addNote = async (parameters: AddNoteParam, request: Partial = {}): Promise => { + return successfulApiCall({ + endpoint: '/clips/add-note', parameters, user: alice, ...request, }, { status: 204, - }) as any as void; + }); }; - const removeNote = async (parameters: Misskey.entities.ClipsRemoveNoteRequest, request: Partial> = {}): Promise => { - return successfulApiCall({ - endpoint: 'clips/remove-note', + type RemoveNoteParam = JTDDataType; + const removeNote = async (parameters: RemoveNoteParam, request: Partial = {}): Promise => { + return successfulApiCall({ + endpoint: '/clips/remove-note', parameters, user: alice, ...request, }, { status: 204, - }) as any as void; + }); }; - const notes = async (parameters: Misskey.entities.ClipsNotesRequest, request: Partial> = {}): Promise => { - return successfulApiCall({ - endpoint: 'clips/notes', + type NotesParam = JTDDataType; + const notes = async (parameters: Partial, request: Partial = {}): Promise => { + return successfulApiCall({ + endpoint: '/clips/notes', parameters, user: alice, ...request, @@ -689,7 +732,7 @@ describe('クリップ', () => { test('として同じノートを二回紐づけることはできない', async () => { await addNote({ clipId: aliceClip.id, noteId: aliceNote.id }); await failedApiCall({ - endpoint: 'clips/add-note', + endpoint: '/clips/add-note', parameters: { clipId: aliceClip.id, noteId: aliceNote.id, @@ -704,14 +747,14 @@ describe('クリップ', () => { // TODO: 17000msくらいかかる... test('をポリシーで定められた上限いっぱい(200)を超えて追加はできない。', async () => { - const noteLimit = DEFAULT_POLICIES.noteEachClipsLimit; + const noteLimit = DEFAULT_POLICIES.noteEachClipsLimit + 1; const noteList = await Promise.all([...Array(noteLimit)].map((_, i) => post(alice, { text: `test ${i}`, - }) as unknown)) as Misskey.entities.Note[]; + }) as unknown)) as Note[]; await Promise.all(noteList.map(s => addNote({ clipId: aliceClip.id, noteId: s.id }))); await failedApiCall({ - endpoint: 'clips/add-note', + endpoint: '/clips/add-note', parameters: { clipId: aliceClip.id, noteId: aliceNote.id, @@ -725,7 +768,7 @@ describe('クリップ', () => { }); test('は他人のクリップへ追加できない。', async () => await failedApiCall({ - endpoint: 'clips/add-note', + endpoint: '/clips/add-note', parameters: { clipId: aliceClip.id, noteId: aliceNote.id, @@ -748,20 +791,18 @@ describe('クリップ', () => { code: 'NO_SUCH_NOTE', id: 'fc8c0b49-c7a3-4664-a0a6-b418d386bb8b', } }, - { label: '他人のクリップ', user: () => bob, assetion: { + { label: '他人のクリップ', user: (): object => bob, assetion: { code: 'NO_SUCH_CLIP', id: 'd6e76cc0-a1b5-4c7c-a287-73fa9c716dcf', } }, ])('の追加は$labelだとできない', async ({ parameters, user, assetion }) => failedApiCall({ - endpoint: 'clips/add-note', + endpoint: '/clips/add-note', parameters: { - // @ts-expect-error clipId must not be undefined clipId: aliceClip.id, - // @ts-expect-error noteId must not be undefined noteId: aliceNote.id, ...parameters, }, - user: (user ?? (() => alice))(), + user: (user ?? ((): User => alice))(), }, { status: 400, code: 'INVALID_PARAM', @@ -786,20 +827,18 @@ describe('クリップ', () => { code: 'NO_SUCH_NOTE', id: 'aff017de-190e-434b-893e-33a9ff5049d8', // add-noteと異なる } }, - { label: '他人のクリップ', user: () => bob, assetion: { + { label: '他人のクリップ', user: (): object => bob, assetion: { code: 'NO_SUCH_CLIP', id: 'b80525c6-97f7-49d7-a42d-ebccd49cfd52', // add-noteと異なる } }, ])('の削除は$labelだとできない', async ({ parameters, user, assetion }) => failedApiCall({ - endpoint: 'clips/remove-note', + endpoint: '/clips/remove-note', parameters: { - // @ts-expect-error clipId must not be undefined clipId: aliceClip.id, - // @ts-expect-error noteId must not be undefined noteId: aliceNote.id, ...parameters, }, - user: (user ?? (() => alice))(), + user: (user ?? ((): User => alice))(), }, { status: 400, code: 'INVALID_PARAM', @@ -903,22 +942,21 @@ describe('クリップ', () => { code: 'NO_SUCH_CLIP', id: '1d7645e6-2b6d-4635-b0fe-fe22b0e72e00', } }, - { label: '他人のPrivateなクリップから', user: () => bob, assertion: { + { label: '他人のPrivateなクリップから', user: (): object => bob, assertion: { code: 'NO_SUCH_CLIP', id: '1d7645e6-2b6d-4635-b0fe-fe22b0e72e00', } }, - { label: '未認証でPrivateなクリップから', user: () => undefined, assertion: { + { label: '未認証でPrivateなクリップから', user: (): undefined => undefined, assertion: { code: 'NO_SUCH_CLIP', id: '1d7645e6-2b6d-4635-b0fe-fe22b0e72e00', } }, ])('は$labelだと取得できない', async ({ parameters, user, assertion }) => failedApiCall({ - endpoint: 'clips/notes', + endpoint: '/clips/notes', parameters: { - // @ts-expect-error clipId must not be undefined clipId: aliceClip.id, ...parameters, }, - user: (user ?? (() => alice))(), + user: (user ?? ((): User => alice))(), }, { status: 400, code: 'INVALID_PARAM', diff --git a/packages/backend/test/e2e/drive.ts b/packages/backend/test/e2e/drive.ts deleted file mode 100644 index 43a73163eb..0000000000 --- a/packages/backend/test/e2e/drive.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import { api, makeStreamCatcher, post, signup, uploadFile } from '../utils.js'; -import type * as misskey from 'misskey-js'; - -describe('Drive', () => { - let alice: misskey.entities.SignupResponse; - let bob: misskey.entities.SignupResponse; - - beforeAll(async () => { - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - }, 1000 * 60 * 2); - - test('ファイルURLからアップロードできる', async () => { - // utils.js uploadUrl の処理だがAPIレスポンスも見るためここで同様の処理を書いている - - const marker = Math.random().toString(); - - const url = 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/192.jpg'; - - const catcher = makeStreamCatcher( - alice, - 'main', - (msg) => msg.type === 'urlUploadFinished' && msg.body.marker === marker, - (msg) => msg.body.file, - 10 * 1000); - - const res = await api('drive/files/upload-from-url', { - url, - marker, - force: true, - }, alice); - - const file = await catcher; - - assert.strictEqual(res.status, 204); - assert.strictEqual(file.name, '192.jpg'); - assert.strictEqual(file.type, 'image/jpeg'); - }); - - test('ローカルからアップロードできる', async () => { - // APIレスポンスを直接使用するので utils.js uploadFile が通過することで成功とする - - const res = await uploadFile(alice, { path: '192.jpg', name: 'テスト画像' }); - - assert.strictEqual(res.body?.name, 'テスト画像.jpg'); - assert.strictEqual(res.body.type, 'image/jpeg'); - }); - - test('添付ノート一覧を取得できる', async () => { - const ids = (await Promise.all([uploadFile(alice), uploadFile(alice), uploadFile(alice)])).map(elm => elm.body!.id); - - const note0 = await post(alice, { fileIds: [ids[0]] }); - const note1 = await post(alice, { fileIds: [ids[0], ids[1]] }); - - const attached0 = await api('drive/files/attached-notes', { fileId: ids[0] }, alice); - assert.strictEqual(attached0.body.length, 2); - assert.strictEqual(attached0.body[0].id, note1.id); - assert.strictEqual(attached0.body[1].id, note0.id); - - const attached1 = await api('drive/files/attached-notes', { fileId: ids[1] }, alice); - assert.strictEqual(attached1.body.length, 1); - assert.strictEqual(attached1.body[0].id, note1.id); - - const attached2 = await api('drive/files/attached-notes', { fileId: ids[2] }, alice); - assert.strictEqual(attached2.body.length, 0); - }); - - test('添付ノート一覧は他の人から見えない', async () => { - const file = await uploadFile(alice); - - await post(alice, { fileIds: [file.body!.id] }); - - const res = await api('drive/files/attached-notes', { fileId: file.body!.id }, bob); - assert.strictEqual(res.status, 400); - assert.strictEqual('error' in res.body, true); - }); -}); diff --git a/packages/backend/test/e2e/endpoints.ts b/packages/backend/test/e2e/endpoints.ts index b91d77c398..2ef3434bca 100644 --- a/packages/backend/test/e2e/endpoints.ts +++ b/packages/backend/test/e2e/endpoints.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,22 +10,30 @@ import * as assert from 'assert'; // https://github.com/node-fetch/node-fetch/pull/1664 import { Blob } from 'node-fetch'; import { MiUser } from '@/models/_.js'; -import { api, castAsError, initTestDb, post, signup, simpleGet, uploadFile } from '../utils.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'; describe('Endpoints', () => { - let alice: misskey.entities.SignupResponse; - let bob: misskey.entities.SignupResponse; - let carol: misskey.entities.SignupResponse; - let dave: misskey.entities.SignupResponse; + let app: INestApplicationContext; + + let alice: misskey.entities.MeSignup; + let bob: misskey.entities.MeSignup; + let carol: misskey.entities.MeSignup; + let dave: misskey.entities.MeSignup; beforeAll(async () => { + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); carol = await signup({ username: 'carol' }); dave = await signup({ username: 'dave' }); }, 1000 * 60 * 2); + afterAll(async () => { + await app.close(); + }); + describe('signup', () => { test('不正なユーザー名でアカウントが作成できない', async () => { const res = await api('signup', { @@ -66,9 +74,9 @@ describe('Endpoints', () => { }); }); - describe('signin-flow', () => { + describe('signin', () => { test('間違ったパスワードでサインインできない', async () => { - const res = await api('signin-flow', { + const res = await api('signin', { username: 'test1', password: 'bar', }); @@ -77,9 +85,8 @@ describe('Endpoints', () => { }); test('クエリをインジェクションできない', async () => { - const res = await api('signin-flow', { + const res = await api('signin', { username: 'test1', - // @ts-expect-error password must be string password: { $gt: '', }, @@ -89,7 +96,7 @@ describe('Endpoints', () => { }); test('正しい情報でサインインできる', async () => { - const res = await api('signin-flow', { + const res = await api('signin', { username: 'test1', password: 'test1', }); @@ -104,7 +111,7 @@ describe('Endpoints', () => { const myLocation = '七森中'; const myBirthday = '2000-09-07'; - const res = await api('i/update', { + const res = await api('/i/update', { name: myName, location: myLocation, birthday: myBirthday, @@ -117,29 +124,20 @@ describe('Endpoints', () => { assert.strictEqual(res.body.birthday, myBirthday); }); - test('名前を空白のみにした場合nullになる', async () => { - const res = await api('i/update', { + test('名前を空白にできる', async () => { + const res = await api('/i/update', { name: ' ', }, alice); assert.strictEqual(res.status, 200); - assert.strictEqual(res.body.name, null); - }); - - test('名前の前後に空白(ホワイトスペース)を入れてもトリムされる', async () => { - const res = await api('i/update', { - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#white_space - name: ' あ い う \u0009\u000b\u000c\u0020\u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\ufeff', - }, alice); - assert.strictEqual(res.status, 200); - assert.strictEqual(res.body.name, 'あ い う'); + assert.strictEqual(res.body.name, ' '); }); test('誕生日の設定を削除できる', async () => { - await api('i/update', { + await api('/i/update', { birthday: '2000-09-07', }, alice); - const res = await api('i/update', { + const res = await api('/i/update', { birthday: null, }, alice); @@ -149,7 +147,7 @@ describe('Endpoints', () => { }); test('不正な誕生日の形式で怒られる', async () => { - const res = await api('i/update', { + const res = await api('/i/update', { birthday: '2000/09/07', }, alice); assert.strictEqual(res.status, 400); @@ -158,24 +156,24 @@ describe('Endpoints', () => { describe('users/show', () => { test('ユーザーが取得できる', async () => { - const res = await api('users/show', { + const res = await api('/users/show', { userId: alice.id, }, alice); assert.strictEqual(res.status, 200); assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual((res.body as unknown as { id: string }).id, alice.id); + assert.strictEqual(res.body.id, alice.id); }); test('ユーザーが存在しなかったら怒る', async () => { - const res = await api('users/show', { + const res = await api('/users/show', { userId: '000000000000000000000000', }); assert.strictEqual(res.status, 404); }); test('間違ったIDで怒られる', async () => { - const res = await api('users/show', { + const res = await api('/users/show', { userId: 'kyoppie', }); assert.strictEqual(res.status, 404); @@ -188,7 +186,7 @@ describe('Endpoints', () => { text: 'test', }); - const res = await api('notes/show', { + const res = await api('/notes/show', { noteId: myPost.id, }, alice); @@ -199,14 +197,14 @@ describe('Endpoints', () => { }); test('投稿が存在しなかったら怒る', async () => { - const res = await api('notes/show', { + const res = await api('/notes/show', { noteId: '000000000000000000000000', }); assert.strictEqual(res.status, 400); }); test('間違ったIDで怒られる', async () => { - const res = await api('notes/show', { + const res = await api('/notes/show', { noteId: 'kyoppie', }); assert.strictEqual(res.status, 400); @@ -217,14 +215,14 @@ describe('Endpoints', () => { test('リアクションできる', async () => { const bobPost = await post(bob, { text: 'hi' }); - const res = await api('notes/reactions/create', { + const res = await api('/notes/reactions/create', { noteId: bobPost.id, reaction: '🚀', }, alice); assert.strictEqual(res.status, 204); - const resNote = await api('notes/show', { + const resNote = await api('/notes/show', { noteId: bobPost.id, }, alice); @@ -235,7 +233,7 @@ describe('Endpoints', () => { test('自分の投稿にもリアクションできる', async () => { const myPost = await post(alice, { text: 'hi' }); - const res = await api('notes/reactions/create', { + const res = await api('/notes/reactions/create', { noteId: myPost.id, reaction: '🚀', }, alice); @@ -246,19 +244,19 @@ describe('Endpoints', () => { test('二重にリアクションすると上書きされる', async () => { const bobPost = await post(bob, { text: 'hi' }); - await api('notes/reactions/create', { + await api('/notes/reactions/create', { noteId: bobPost.id, reaction: '🥰', }, alice); - const res = await api('notes/reactions/create', { + const res = await api('/notes/reactions/create', { noteId: bobPost.id, reaction: '🚀', }, alice); assert.strictEqual(res.status, 204); - const resNote = await api('notes/show', { + const resNote = await api('/notes/show', { noteId: bobPost.id, }, alice); @@ -267,7 +265,7 @@ describe('Endpoints', () => { }); test('存在しない投稿にはリアクションできない', async () => { - const res = await api('notes/reactions/create', { + const res = await api('/notes/reactions/create', { noteId: '000000000000000000000000', reaction: '🚀', }, alice); @@ -275,77 +273,14 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 400); }); - test('リノートにリアクションできない', async () => { - const bobNote = await post(bob, { text: 'hi' }); - const bobRenote = await post(bob, { renoteId: bobNote.id }); - - const res = await api('notes/reactions/create', { - noteId: bobRenote.id, - reaction: '🚀', - }, alice); - - assert.strictEqual(res.status, 400); - assert.ok(res.body); - assert.strictEqual(castAsError(res.body).error.code, 'CANNOT_REACT_TO_RENOTE'); - }); - - test('引用にリアクションできる', async () => { - const bobNote = await post(bob, { text: 'hi' }); - const bobRenote = await post(bob, { text: 'hi again', renoteId: bobNote.id }); - - const res = await api('notes/reactions/create', { - noteId: bobRenote.id, - reaction: '🚀', - }, alice); - - assert.strictEqual(res.status, 204); - }); - - test('空文字列のリアクションは\u2764にフォールバックされる', async () => { - const bobNote = await post(bob, { text: 'hi' }); - - const res = await api('notes/reactions/create', { - noteId: bobNote.id, - reaction: '', - }, alice); - - assert.strictEqual(res.status, 204); - - const reaction = await api('notes/reactions', { - noteId: bobNote.id, - }); - - assert.strictEqual(reaction.body.length, 1); - assert.strictEqual(reaction.body[0].type, '\u2764'); - }); - - test('絵文字ではない文字列のリアクションは\u2764にフォールバックされる', async () => { - const bobNote = await post(bob, { text: 'hi' }); - - const res = await api('notes/reactions/create', { - noteId: bobNote.id, - reaction: 'Hello!', - }, alice); - - assert.strictEqual(res.status, 204); - - const reaction = await api('notes/reactions', { - noteId: bobNote.id, - }); - - assert.strictEqual(reaction.body.length, 1); - assert.strictEqual(reaction.body[0].type, '\u2764'); - }); - test('空のパラメータで怒られる', async () => { - // @ts-expect-error param must not be empty - const res = await api('notes/reactions/create', {}, alice); + const res = await api('/notes/reactions/create', {}, alice); assert.strictEqual(res.status, 400); }); test('間違ったIDで怒られる', async () => { - const res = await api('notes/reactions/create', { + const res = await api('/notes/reactions/create', { noteId: 'kyoppie', reaction: '🚀', }, alice); @@ -356,7 +291,7 @@ describe('Endpoints', () => { describe('following/create', () => { test('フォローできる', async () => { - const res = await api('following/create', { + const res = await api('/following/create', { userId: alice.id, }, bob); @@ -374,7 +309,7 @@ describe('Endpoints', () => { }); test('既にフォローしている場合は怒る', async () => { - const res = await api('following/create', { + const res = await api('/following/create', { userId: alice.id, }, bob); @@ -382,7 +317,7 @@ describe('Endpoints', () => { }); test('存在しないユーザーはフォローできない', async () => { - const res = await api('following/create', { + const res = await api('/following/create', { userId: '000000000000000000000000', }, alice); @@ -390,7 +325,7 @@ describe('Endpoints', () => { }); test('自分自身はフォローできない', async () => { - const res = await api('following/create', { + const res = await api('/following/create', { userId: alice.id, }, alice); @@ -398,14 +333,13 @@ describe('Endpoints', () => { }); test('空のパラメータで怒られる', async () => { - // @ts-expect-error params must not be empty - const res = await api('following/create', {}, alice); + const res = await api('/following/create', {}, alice); assert.strictEqual(res.status, 400); }); test('間違ったIDで怒られる', async () => { - const res = await api('following/create', { + const res = await api('/following/create', { userId: 'foo', }, alice); @@ -415,11 +349,11 @@ describe('Endpoints', () => { describe('following/delete', () => { test('フォロー解除できる', async () => { - await api('following/create', { + await api('/following/create', { userId: alice.id, }, bob); - const res = await api('following/delete', { + const res = await api('/following/delete', { userId: alice.id, }, bob); @@ -437,7 +371,7 @@ describe('Endpoints', () => { }); test('フォローしていない場合は怒る', async () => { - const res = await api('following/delete', { + const res = await api('/following/delete', { userId: alice.id, }, bob); @@ -445,7 +379,7 @@ describe('Endpoints', () => { }); test('存在しないユーザーはフォロー解除できない', async () => { - const res = await api('following/delete', { + const res = await api('/following/delete', { userId: '000000000000000000000000', }, alice); @@ -453,7 +387,7 @@ describe('Endpoints', () => { }); test('自分自身はフォロー解除できない', async () => { - const res = await api('following/delete', { + const res = await api('/following/delete', { userId: alice.id, }, alice); @@ -461,14 +395,13 @@ describe('Endpoints', () => { }); test('空のパラメータで怒られる', async () => { - // @ts-expect-error params must not be empty - const res = await api('following/delete', {}, alice); + const res = await api('/following/delete', {}, alice); assert.strictEqual(res.status, 400); }); test('間違ったIDで怒られる', async () => { - const res = await api('following/delete', { + const res = await api('/following/delete', { userId: 'kyoppie', }, alice); @@ -478,20 +411,20 @@ describe('Endpoints', () => { describe('channels/search', () => { test('空白検索で一覧を取得できる', async () => { - await api('channels/create', { + await api('/channels/create', { name: 'aaa', description: 'bbb', }, bob); - await api('channels/create', { + await api('/channels/create', { name: 'ccc1', description: 'ddd1', }, bob); - await api('channels/create', { + await api('/channels/create', { name: 'ccc2', description: 'ddd2', }, bob); - const res = await api('channels/search', { + const res = await api('/channels/search', { query: '', }, bob); @@ -500,7 +433,7 @@ describe('Endpoints', () => { assert.strictEqual(res.body.length, 3); }); test('名前のみの検索で名前を検索できる', async () => { - const res = await api('channels/search', { + const res = await api('/channels/search', { query: 'aaa', type: 'nameOnly', }, bob); @@ -511,7 +444,7 @@ describe('Endpoints', () => { assert.strictEqual(res.body[0].name, 'aaa'); }); test('名前のみの検索で名前を複数検索できる', async () => { - const res = await api('channels/search', { + const res = await api('/channels/search', { query: 'ccc', type: 'nameOnly', }, bob); @@ -521,7 +454,7 @@ describe('Endpoints', () => { assert.strictEqual(res.body.length, 2); }); test('名前のみの検索で説明は検索できない', async () => { - const res = await api('channels/search', { + const res = await api('/channels/search', { query: 'bbb', type: 'nameOnly', }, bob); @@ -531,7 +464,7 @@ describe('Endpoints', () => { assert.strictEqual(res.body.length, 0); }); test('名前と説明の検索で名前を検索できる', async () => { - const res = await api('channels/search', { + const res = await api('/channels/search', { query: 'ccc1', }, bob); @@ -541,7 +474,7 @@ describe('Endpoints', () => { assert.strictEqual(res.body[0].name, 'ccc1'); }); test('名前と説明での検索で説明を検索できる', async () => { - const res = await api('channels/search', { + const res = await api('/channels/search', { query: 'ddd1', }, bob); @@ -551,7 +484,7 @@ describe('Endpoints', () => { assert.strictEqual(res.body[0].name, 'ccc1'); }); test('名前と説明の検索で名前を複数検索できる', async () => { - const res = await api('channels/search', { + const res = await api('/channels/search', { query: 'ccc', }, bob); @@ -560,7 +493,7 @@ describe('Endpoints', () => { assert.strictEqual(res.body.length, 2); }); test('名前と説明での検索で説明を複数検索できる', async () => { - const res = await api('channels/search', { + const res = await api('/channels/search', { query: 'ddd', }, bob); @@ -581,7 +514,7 @@ describe('Endpoints', () => { await uploadFile(alice, { blob: new Blob([new Uint8Array(1024)]), }); - const res = await api('drive', {}, alice); + const res = await api('/drive', {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); expect(res.body).toHaveProperty('usage', 1792); @@ -594,7 +527,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 200); assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body!.name, '192.jpg'); + assert.strictEqual(res.body.name, 'Lenna.jpg'); }); test('ファイルに名前を付けられる', async () => { @@ -602,7 +535,7 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 200); assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body!.name, 'Belmond.jpg'); + assert.strictEqual(res.body.name, 'Belmond.jpg'); }); test('ファイルに名前を付けられるが、拡張子は正しいものになる', async () => { @@ -610,12 +543,11 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 200); assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body!.name, 'Belmond.png.jpg'); + assert.strictEqual(res.body.name, 'Belmond.png.jpg'); }); test('ファイル無しで怒られる', async () => { - // @ts-expect-error params must not be empty - const res = await api('drive/files/create', {}, alice); + const res = await api('/drive/files/create', {}, alice); assert.strictEqual(res.status, 400); }); @@ -625,14 +557,14 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 200); assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.strictEqual(res.body!.name, 'image.svg'); - assert.strictEqual(res.body!.type, 'image/svg+xml'); + assert.strictEqual(res.body.name, 'image.svg'); + assert.strictEqual(res.body.type, 'image/svg+xml'); }); for (const type of ['webp', 'avif']) { const mediaType = `image/${type}`; - const getWebpublicType = async (user: misskey.entities.SignupResponse, fileId: string): Promise => { + const getWebpublicType = async (user: any, fileId: string): Promise => { // drive/files/create does not expose webpublicType directly, so get it by posting it const res = await post(user, { text: mediaType, @@ -649,10 +581,10 @@ describe('Endpoints', () => { const res = await uploadFile(alice, { path }); assert.strictEqual(res.status, 200); - assert.strictEqual(res.body!.name, path); - assert.strictEqual(res.body!.type, mediaType); + assert.strictEqual(res.body.name, path); + assert.strictEqual(res.body.type, mediaType); - const webpublicType = await getWebpublicType(alice, res.body!.id); + const webpublicType = await getWebpublicType(alice, res.body.id); assert.strictEqual(webpublicType, 'image/webp'); }); @@ -660,10 +592,10 @@ describe('Endpoints', () => { const path = `without-alpha.${type}`; const res = await uploadFile(alice, { path }); assert.strictEqual(res.status, 200); - assert.strictEqual(res.body!.name, path); - assert.strictEqual(res.body!.type, mediaType); + assert.strictEqual(res.body.name, path); + assert.strictEqual(res.body.type, mediaType); - const webpublicType = await getWebpublicType(alice, res.body!.id); + const webpublicType = await getWebpublicType(alice, res.body.id); assert.strictEqual(webpublicType, 'image/webp'); }); } @@ -674,8 +606,8 @@ describe('Endpoints', () => { const file = (await uploadFile(alice)).body; const newName = 'いちごパスタ.png'; - const res = await api('drive/files/update', { - fileId: file!.id, + const res = await api('/drive/files/update', { + fileId: file.id, name: newName, }, alice); @@ -687,8 +619,8 @@ describe('Endpoints', () => { test('他人のファイルは更新できない', async () => { const file = (await uploadFile(alice)).body; - const res = await api('drive/files/update', { - fileId: file!.id, + const res = await api('/drive/files/update', { + fileId: file.id, name: 'いちごパスタ.png', }, bob); @@ -697,12 +629,12 @@ describe('Endpoints', () => { test('親フォルダを更新できる', async () => { const file = (await uploadFile(alice)).body; - const folder = (await api('drive/folders/create', { + const folder = (await api('/drive/folders/create', { name: 'test', }, alice)).body; - const res = await api('drive/files/update', { - fileId: file!.id, + const res = await api('/drive/files/update', { + fileId: file.id, folderId: folder.id, }, alice); @@ -714,17 +646,17 @@ describe('Endpoints', () => { test('親フォルダを無しにできる', async () => { const file = (await uploadFile(alice)).body; - const folder = (await api('drive/folders/create', { + const folder = (await api('/drive/folders/create', { name: 'test', }, alice)).body; - await api('drive/files/update', { - fileId: file!.id, + await api('/drive/files/update', { + fileId: file.id, folderId: folder.id, }, alice); - const res = await api('drive/files/update', { - fileId: file!.id, + const res = await api('/drive/files/update', { + fileId: file.id, folderId: null, }, alice); @@ -735,12 +667,12 @@ describe('Endpoints', () => { test('他人のフォルダには入れられない', async () => { const file = (await uploadFile(alice)).body; - const folder = (await api('drive/folders/create', { + const folder = (await api('/drive/folders/create', { name: 'test', }, bob)).body; - const res = await api('drive/files/update', { - fileId: file!.id, + const res = await api('/drive/files/update', { + fileId: file.id, folderId: folder.id, }, alice); @@ -750,8 +682,8 @@ describe('Endpoints', () => { test('存在しないフォルダで怒られる', async () => { const file = (await uploadFile(alice)).body; - const res = await api('drive/files/update', { - fileId: file!.id, + const res = await api('/drive/files/update', { + fileId: file.id, folderId: '000000000000000000000000', }, alice); @@ -761,8 +693,8 @@ describe('Endpoints', () => { test('不正なフォルダIDで怒られる', async () => { const file = (await uploadFile(alice)).body; - const res = await api('drive/files/update', { - fileId: file!.id, + const res = await api('/drive/files/update', { + fileId: file.id, folderId: 'foo', }, alice); @@ -770,7 +702,7 @@ describe('Endpoints', () => { }); test('ファイルが存在しなかったら怒る', async () => { - const res = await api('drive/files/update', { + const res = await api('/drive/files/update', { fileId: '000000000000000000000000', name: 'いちごパスタ.png', }, alice); @@ -778,20 +710,8 @@ describe('Endpoints', () => { assert.strictEqual(res.status, 400); }); - test('不正なファイル名で怒られる', async () => { - const file = (await uploadFile(alice)).body; - const newName = ''; - - const res = await api('drive/files/update', { - fileId: file!.id, - name: newName, - }, alice); - - assert.strictEqual(res.status, 400); - }); - test('間違ったIDで怒られる', async () => { - const res = await api('drive/files/update', { + const res = await api('/drive/files/update', { fileId: 'kyoppie', name: 'いちごパスタ.png', }, alice); @@ -802,7 +722,7 @@ describe('Endpoints', () => { describe('drive/folders/create', () => { test('フォルダを作成できる', async () => { - const res = await api('drive/folders/create', { + const res = await api('/drive/folders/create', { name: 'test', }, alice); @@ -814,11 +734,11 @@ describe('Endpoints', () => { describe('drive/folders/update', () => { test('名前を更新できる', async () => { - const folder = (await api('drive/folders/create', { + const folder = (await api('/drive/folders/create', { name: 'test', }, alice)).body; - const res = await api('drive/folders/update', { + const res = await api('/drive/folders/update', { folderId: folder.id, name: 'new name', }, alice); @@ -829,11 +749,11 @@ describe('Endpoints', () => { }); test('他人のフォルダを更新できない', async () => { - const folder = (await api('drive/folders/create', { + const folder = (await api('/drive/folders/create', { name: 'test', }, bob)).body; - const res = await api('drive/folders/update', { + const res = await api('/drive/folders/update', { folderId: folder.id, name: 'new name', }, alice); @@ -842,14 +762,14 @@ describe('Endpoints', () => { }); test('親フォルダを更新できる', async () => { - const folder = (await api('drive/folders/create', { + const folder = (await api('/drive/folders/create', { name: 'test', }, alice)).body; - const parentFolder = (await api('drive/folders/create', { + const parentFolder = (await api('/drive/folders/create', { name: 'parent', }, alice)).body; - const res = await api('drive/folders/update', { + const res = await api('/drive/folders/update', { folderId: folder.id, parentId: parentFolder.id, }, alice); @@ -860,18 +780,18 @@ describe('Endpoints', () => { }); test('親フォルダを無しに更新できる', async () => { - const folder = (await api('drive/folders/create', { + const folder = (await api('/drive/folders/create', { name: 'test', }, alice)).body; - const parentFolder = (await api('drive/folders/create', { + const parentFolder = (await api('/drive/folders/create', { name: 'parent', }, alice)).body; - await api('drive/folders/update', { + await api('/drive/folders/update', { folderId: folder.id, parentId: parentFolder.id, }, alice); - const res = await api('drive/folders/update', { + const res = await api('/drive/folders/update', { folderId: folder.id, parentId: null, }, alice); @@ -882,14 +802,14 @@ describe('Endpoints', () => { }); test('他人のフォルダを親フォルダに設定できない', async () => { - const folder = (await api('drive/folders/create', { + const folder = (await api('/drive/folders/create', { name: 'test', }, alice)).body; - const parentFolder = (await api('drive/folders/create', { + const parentFolder = (await api('/drive/folders/create', { name: 'parent', }, bob)).body; - const res = await api('drive/folders/update', { + const res = await api('/drive/folders/update', { folderId: folder.id, parentId: parentFolder.id, }, alice); @@ -898,18 +818,18 @@ describe('Endpoints', () => { }); test('フォルダが循環するような構造にできない', async () => { - const folder = (await api('drive/folders/create', { + const folder = (await api('/drive/folders/create', { name: 'test', }, alice)).body; - const parentFolder = (await api('drive/folders/create', { + const parentFolder = (await api('/drive/folders/create', { name: 'parent', }, alice)).body; - await api('drive/folders/update', { + await api('/drive/folders/update', { folderId: parentFolder.id, parentId: folder.id, }, alice); - const res = await api('drive/folders/update', { + const res = await api('/drive/folders/update', { folderId: folder.id, parentId: parentFolder.id, }, alice); @@ -918,25 +838,25 @@ describe('Endpoints', () => { }); test('フォルダが循環するような構造にできない(再帰的)', async () => { - const folderA = (await api('drive/folders/create', { + const folderA = (await api('/drive/folders/create', { name: 'test', }, alice)).body; - const folderB = (await api('drive/folders/create', { + const folderB = (await api('/drive/folders/create', { name: 'test', }, alice)).body; - const folderC = (await api('drive/folders/create', { + const folderC = (await api('/drive/folders/create', { name: 'test', }, alice)).body; - await api('drive/folders/update', { + await api('/drive/folders/update', { folderId: folderB.id, parentId: folderA.id, }, alice); - await api('drive/folders/update', { + await api('/drive/folders/update', { folderId: folderC.id, parentId: folderB.id, }, alice); - const res = await api('drive/folders/update', { + const res = await api('/drive/folders/update', { folderId: folderA.id, parentId: folderC.id, }, alice); @@ -945,11 +865,11 @@ describe('Endpoints', () => { }); test('フォルダが循環するような構造にできない(自身)', async () => { - const folderA = (await api('drive/folders/create', { + const folderA = (await api('/drive/folders/create', { name: 'test', }, alice)).body; - const res = await api('drive/folders/update', { + const res = await api('/drive/folders/update', { folderId: folderA.id, parentId: folderA.id, }, alice); @@ -958,11 +878,11 @@ describe('Endpoints', () => { }); test('存在しない親フォルダを設定できない', async () => { - const folder = (await api('drive/folders/create', { + const folder = (await api('/drive/folders/create', { name: 'test', }, alice)).body; - const res = await api('drive/folders/update', { + const res = await api('/drive/folders/update', { folderId: folder.id, parentId: '000000000000000000000000', }, alice); @@ -971,11 +891,11 @@ describe('Endpoints', () => { }); test('不正な親フォルダIDで怒られる', async () => { - const folder = (await api('drive/folders/create', { + const folder = (await api('/drive/folders/create', { name: 'test', }, alice)).body; - const res = await api('drive/folders/update', { + const res = await api('/drive/folders/update', { folderId: folder.id, parentId: 'foo', }, alice); @@ -984,7 +904,7 @@ describe('Endpoints', () => { }); test('存在しないフォルダを更新できない', async () => { - const res = await api('drive/folders/update', { + const res = await api('/drive/folders/update', { folderId: '000000000000000000000000', }, alice); @@ -992,7 +912,7 @@ describe('Endpoints', () => { }); test('不正なフォルダIDで怒られる', async () => { - const res = await api('drive/folders/update', { + const res = await api('/drive/folders/update', { folderId: 'foo', }, alice); @@ -1013,7 +933,7 @@ describe('Endpoints', () => { visibleUserIds: [alice.id], }); - const res = await api('notes/replies', { + const res = await api('/notes/replies', { noteId: alicePost.id, }, carol); @@ -1025,7 +945,7 @@ describe('Endpoints', () => { describe('notes/timeline', () => { test('フォロワー限定投稿が含まれる', async () => { - await api('following/create', { + await api('/following/create', { userId: carol.id, }, dave); @@ -1034,7 +954,7 @@ describe('Endpoints', () => { visibility: 'followers', }); - const res = await api('notes/timeline', {}, dave); + const res = await api('/notes/timeline', {}, dave); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); @@ -1055,52 +975,52 @@ describe('Endpoints', () => { test('他者に関するメモを更新できる', async () => { const memo = '10月まで低浮上とのこと。'; - const res1 = await api('users/update-memo', { + const res1 = await api('/users/update-memo', { memo, userId: bob.id, }, alice); - const res2 = await api('users/show', { + const res2 = await api('/users/show', { userId: bob.id, }, alice); assert.strictEqual(res1.status, 204); - assert.strictEqual((res2.body as unknown as { memo: string })?.memo, memo); + assert.strictEqual(res2.body?.memo, memo); }); test('自分に関するメモを更新できる', async () => { const memo = 'チケットを月末までに買う。'; - const res1 = await api('users/update-memo', { + const res1 = await api('/users/update-memo', { memo, userId: alice.id, }, alice); - const res2 = await api('users/show', { + const res2 = await api('/users/show', { userId: alice.id, }, alice); assert.strictEqual(res1.status, 204); - assert.strictEqual((res2.body as unknown as { memo: string })?.memo, memo); + assert.strictEqual(res2.body?.memo, memo); }); test('メモを削除できる', async () => { const memo = '10月まで低浮上とのこと。'; - await api('users/update-memo', { + await api('/users/update-memo', { memo, userId: bob.id, }, alice); - await api('users/update-memo', { + await api('/users/update-memo', { memo: '', userId: bob.id, }, alice); - const res = await api('users/show', { + const res = await api('/users/show', { userId: bob.id, }, alice); // memoには常に文字列かnullが入っている(5cac151) - assert.strictEqual((res.body as unknown as { memo: string | null }).memo, null); + assert.strictEqual(res.body.memo, null); }); test('メモは個人ごとに独立して保存される', async () => { @@ -1108,27 +1028,27 @@ describe('Endpoints', () => { const memoCarolToBob = '例の件について今度問いただす。'; await Promise.all([ - api('users/update-memo', { + api('/users/update-memo', { memo: memoAliceToBob, userId: bob.id, }, alice), - api('users/update-memo', { + api('/users/update-memo', { memo: memoCarolToBob, userId: bob.id, }, carol), ]); const [resAlice, resCarol] = await Promise.all([ - api('users/show', { + api('/users/show', { userId: bob.id, }, alice), - api('users/show', { + api('/users/show', { userId: bob.id, }, carol), ]); - assert.strictEqual((resAlice.body as unknown as { memo: string }).memo, memoAliceToBob); - assert.strictEqual((resCarol.body as unknown as { memo: string }).memo, memoCarolToBob); + assert.strictEqual(resAlice.body.memo, memoAliceToBob); + assert.strictEqual(resCarol.body.memo, memoCarolToBob); }); }); }); diff --git a/packages/backend/test/e2e/exports.ts b/packages/backend/test/e2e/exports.ts deleted file mode 100644 index 4bcecc9716..0000000000 --- a/packages/backend/test/e2e/exports.ts +++ /dev/null @@ -1,199 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import { api, port, post, signup, startJobQueue } from '../utils.js'; -import type { INestApplicationContext } from '@nestjs/common'; -import type * as misskey from 'misskey-js'; - -describe('export-clips', () => { - let queue: INestApplicationContext; - let alice: misskey.entities.SignupResponse; - let bob: misskey.entities.SignupResponse; - - // XXX: Any better way to get the result? - async function pollFirstDriveFile() { - while (true) { - const files = (await api('drive/files', {}, alice)).body; - if (!files.length) { - await new Promise(r => setTimeout(r, 100)); - continue; - } - if (files.length > 1) { - throw new Error('Too many files?'); - } - const file = (await api('drive/files/show', { fileId: files[0].id }, alice)).body; - const res = await fetch(new URL(new URL(file.url).pathname, `http://127.0.0.1:${port}`)); - return await res.json(); - } - } - - beforeAll(async () => { - queue = await startJobQueue(); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - }, 1000 * 60 * 2); - - afterAll(async () => { - await queue.close(); - }); - - beforeEach(async () => { - // Clean all clips and files of alice - const clips = (await api('clips/list', {}, alice)).body; - for (const clip of clips) { - const res = await api('clips/delete', { clipId: clip.id }, alice); - if (res.status !== 204) { - throw new Error('Failed to delete clip'); - } - } - const files = (await api('drive/files', {}, alice)).body; - for (const file of files) { - const res = await api('drive/files/delete', { fileId: file.id }, alice); - if (res.status !== 204) { - throw new Error('Failed to delete file'); - } - } - }); - - test('basic export', async () => { - const res1 = await api('clips/create', { - name: 'foo', - description: 'bar', - }, alice); - assert.strictEqual(res1.status, 200); - - const res2 = await api('i/export-clips', {}, alice); - assert.strictEqual(res2.status, 204); - - const exported = await pollFirstDriveFile(); - assert.strictEqual(exported[0].name, 'foo'); - assert.strictEqual(exported[0].description, 'bar'); - assert.strictEqual(exported[0].clipNotes.length, 0); - }); - - test('export with notes', async () => { - const res = await api('clips/create', { - name: 'foo', - description: 'bar', - }, alice); - assert.strictEqual(res.status, 200); - const clip = res.body; - - const note1 = await post(alice, { - text: 'baz1', - }); - - const note2 = await post(alice, { - text: 'baz2', - poll: { - choices: ['sakura', 'izumi', 'ako'], - }, - }); - - for (const note of [note1, note2]) { - const res2 = await api('clips/add-note', { - clipId: clip.id, - noteId: note.id, - }, alice); - assert.strictEqual(res2.status, 204); - } - - const res3 = await api('i/export-clips', {}, alice); - assert.strictEqual(res3.status, 204); - - const exported = await pollFirstDriveFile(); - assert.strictEqual(exported[0].name, 'foo'); - assert.strictEqual(exported[0].description, 'bar'); - assert.strictEqual(exported[0].clipNotes.length, 2); - assert.strictEqual(exported[0].clipNotes[0].note.text, 'baz1'); - assert.strictEqual(exported[0].clipNotes[1].note.text, 'baz2'); - assert.deepStrictEqual(exported[0].clipNotes[1].note.poll.choices[0], 'sakura'); - }); - - test('multiple clips', async () => { - const res1 = await api('clips/create', { - name: 'kawaii', - description: 'kawaii', - }, alice); - assert.strictEqual(res1.status, 200); - const clip1 = res1.body; - - const res2 = await api('clips/create', { - name: 'yuri', - description: 'yuri', - }, alice); - assert.strictEqual(res2.status, 200); - const clip2 = res2.body; - - const note1 = await post(alice, { - text: 'baz1', - }); - - const note2 = await post(alice, { - text: 'baz2', - }); - - { - const res = await api('clips/add-note', { - clipId: clip1.id, - noteId: note1.id, - }, alice); - assert.strictEqual(res.status, 204); - } - - { - const res = await api('clips/add-note', { - clipId: clip2.id, - noteId: note2.id, - }, alice); - assert.strictEqual(res.status, 204); - } - - { - const res = await api('i/export-clips', {}, alice); - assert.strictEqual(res.status, 204); - } - - const exported = await pollFirstDriveFile(); - assert.strictEqual(exported[0].name, 'kawaii'); - assert.strictEqual(exported[0].clipNotes.length, 1); - assert.strictEqual(exported[0].clipNotes[0].note.text, 'baz1'); - assert.strictEqual(exported[1].name, 'yuri'); - assert.strictEqual(exported[1].clipNotes.length, 1); - assert.strictEqual(exported[1].clipNotes[0].note.text, 'baz2'); - }); - - test('Clipping other user\'s note', async () => { - const res = await api('clips/create', { - name: 'kawaii', - description: 'kawaii', - }, alice); - assert.strictEqual(res.status, 200); - const clip = res.body; - - const note = await post(bob, { - text: 'baz', - visibility: 'followers', - }); - - const res2 = await api('clips/add-note', { - clipId: clip.id, - noteId: note.id, - }, alice); - assert.strictEqual(res2.status, 204); - - const res3 = await api('i/export-clips', {}, alice); - assert.strictEqual(res3.status, 204); - - const exported = await pollFirstDriveFile(); - assert.strictEqual(exported[0].name, 'kawaii'); - assert.strictEqual(exported[0].clipNotes.length, 1); - assert.strictEqual(exported[0].clipNotes[0].note.text, 'baz'); - assert.strictEqual(exported[0].clipNotes[0].note.user.username, 'bob'); - }); -}); diff --git a/packages/backend/test/e2e/fetch-resource.ts b/packages/backend/test/e2e/fetch-resource.ts index 8ea4cb9800..251d662760 100644 --- a/packages/backend/test/e2e/fetch-resource.ts +++ b/packages/backend/test/e2e/fetch-resource.ts @@ -1,13 +1,14 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; -import { channel, clip, cookie, galleryPost, page, play, post, signup, simpleGet, uploadFile } from '../utils.js'; +import { startServer, channel, clip, cookie, galleryPost, signup, page, play, post, simpleGet, uploadFile } from '../utils.js'; import type { SimpleGetResponse } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; // Request Accept @@ -22,16 +23,18 @@ const HTML = 'text/html; charset=utf-8'; const JSON_UTF8 = 'application/json; charset=utf-8'; describe('Webリソース', () => { - let alice: misskey.entities.SignupResponse; - let aliceUploadedFile: misskey.entities.DriveFile | null; - let alicesPost: misskey.entities.Note; - let alicePage: misskey.entities.Page; - let alicePlay: misskey.entities.Flash; - let aliceClip: misskey.entities.Clip; - let aliceGalleryPost: misskey.entities.GalleryPost; - let aliceChannel: misskey.entities.Channel; + let app: INestApplicationContext; - let bob: misskey.entities.SignupResponse; + let alice: misskey.entities.MeSignup; + let aliceUploadedFile: any; + let alicesPost: any; + let alicePage: any; + let alicePlay: any; + let aliceClip: any; + let aliceGalleryPost: any; + let aliceChannel: any; + + let bob: misskey.entities.MeSignup; type Request = { path: string, @@ -76,8 +79,9 @@ describe('Webリソース', () => { }; beforeAll(async () => { + app = await startServer(); alice = await signup({ username: 'alice' }); - aliceUploadedFile = (await uploadFile(alice)).body; + aliceUploadedFile = await uploadFile(alice); alicesPost = await post(alice, { text: 'test', }); @@ -85,13 +89,17 @@ describe('Webリソース', () => { alicePlay = await play(alice, {}); aliceClip = await clip(alice, {}); aliceGalleryPost = await galleryPost(alice, { - fileIds: [aliceUploadedFile!.id], + fileIds: [aliceUploadedFile.body.id], }); aliceChannel = await channel(alice, {}); bob = await signup({ username: 'bob' }); }, 1000 * 60 * 2); + afterAll(async () => { + await app.close(); + }); + describe.each([ { path: '/', type: HTML }, { path: '/docs/ja-JP/about', type: HTML }, // "指定されたURLに該当するページはありませんでした。" @@ -153,23 +161,6 @@ describe('Webリソース', () => { path: path('nonexisting'), status: 404, })); - - describe(' has entry such ', () => { - beforeEach(() => { - post(alice, { text: "**a**" }) - }); - - test('MFMを含まない。', async () => { - const content = await simpleGet(path(alice.username), "*/*", undefined, res => res.text()); - const _body: unknown = content.body; - // JSONフィードのときは改めて文字列化する - const body: string = typeof (_body) === "object" ? JSON.stringify(_body) : _body as string; - - if (body.includes("**a**")) { - throw new Error("MFM shouldn't be included"); - } - }); - }) }); describe.each([{ path: '/api/foo' }])('$path', ({ path }) => { @@ -230,7 +221,6 @@ describe('Webリソース', () => { path: path('xxxxxxxxxx'), type: HTML, })); - test.todo('HTMLとしてGETできる。(リモートユーザーでもリダイレクトせず)'); }); describe.each([ @@ -250,7 +240,6 @@ describe('Webリソース', () => { path: path('xxxxxxxxxx'), accept, })); - test.todo('はオリジナルにリダイレクトされる。(リモートユーザー)'); }); }); diff --git a/packages/backend/test/e2e/fetch-validate-ap-deny.ts b/packages/backend/test/e2e/fetch-validate-ap-deny.ts deleted file mode 100644 index 434a9fe209..0000000000 --- a/packages/backend/test/e2e/fetch-validate-ap-deny.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -process.env.NODE_ENV = 'test'; - -import { validateContentTypeSetAsActivityPub, validateContentTypeSetAsJsonLD } from '@/core/activitypub/misc/validator.js'; -import { signup, uploadFile, relativeFetch } from '../utils.js'; -import type * as misskey from 'misskey-js'; - -describe('validateContentTypeSetAsActivityPub/JsonLD (deny case)', () => { - let alice: misskey.entities.SignupResponse; - let aliceUploadedFile: any; - - beforeAll(async () => { - alice = await signup({ username: 'alice' }); - aliceUploadedFile = await uploadFile(alice); - }, 1000 * 60 * 2); - - test('ActivityStreams: ファイルはエラーになる', async () => { - const res = await relativeFetch(aliceUploadedFile.webpublicUrl); - - function doValidate() { - validateContentTypeSetAsActivityPub(res); - } - - expect(doValidate).toThrow('Content type is not'); - }); - - test('JSON-LD: ファイルはエラーになる', async () => { - const res = await relativeFetch(aliceUploadedFile.webpublicUrl); - - function doValidate() { - validateContentTypeSetAsJsonLD(res); - } - - expect(doValidate).toThrow('Content type is not'); - }); -}); diff --git a/packages/backend/test/e2e/ff-visibility.ts b/packages/backend/test/e2e/ff-visibility.ts index 5d0c70a3c2..1fbd45c741 100644 --- a/packages/backend/test/e2e/ff-visibility.ts +++ b/packages/backend/test/e2e/ff-visibility.ts @@ -1,33 +1,41 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; -import { api, signup, simpleGet } from '../utils.js'; +import { signup, api, startServer, simpleGet } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; describe('FF visibility', () => { - let alice: misskey.entities.SignupResponse; - let bob: misskey.entities.SignupResponse; + let app: INestApplicationContext; + + let alice: misskey.entities.MeSignup; + let bob: misskey.entities.MeSignup; beforeAll(async () => { + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); }, 1000 * 60 * 2); + afterAll(async () => { + await app.close(); + }); + test('followingVisibility, followersVisibility がともに public なユーザーのフォロー/フォロワーを誰でも見れる', async () => { - await api('i/update', { + await api('/i/update', { followingVisibility: 'public', followersVisibility: 'public', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); @@ -39,36 +47,36 @@ describe('FF visibility', () => { test('followingVisibility が public であれば followersVisibility の設定に関わらずユーザーのフォローを誰でも見れる', async () => { { - await api('i/update', { + await api('/i/update', { followingVisibility: 'public', followersVisibility: 'public', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); assert.strictEqual(followingRes.status, 200); assert.strictEqual(Array.isArray(followingRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'public', followersVisibility: 'followers', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); assert.strictEqual(followingRes.status, 200); assert.strictEqual(Array.isArray(followingRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'public', followersVisibility: 'private', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); assert.strictEqual(followingRes.status, 200); @@ -78,36 +86,36 @@ describe('FF visibility', () => { test('followersVisibility が public であれば followingVisibility の設定に関わらずユーザーのフォロワーを誰でも見れる', async () => { { - await api('i/update', { + await api('/i/update', { followingVisibility: 'public', followersVisibility: 'public', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); assert.strictEqual(followersRes.status, 200); assert.strictEqual(Array.isArray(followersRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'public', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); assert.strictEqual(followersRes.status, 200); assert.strictEqual(Array.isArray(followersRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'public', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); assert.strictEqual(followersRes.status, 200); @@ -116,15 +124,15 @@ describe('FF visibility', () => { }); test('followingVisibility, followersVisibility がともに followers なユーザーのフォロー/フォロワーを自分で見れる', async () => { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'followers', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, alice); @@ -136,36 +144,36 @@ describe('FF visibility', () => { test('followingVisibility が followers なユーザーのフォローを followersVisibility の設定に関わらず自分で見れる', async () => { { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'public', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, alice); assert.strictEqual(followingRes.status, 200); assert.strictEqual(Array.isArray(followingRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'followers', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, alice); assert.strictEqual(followingRes.status, 200); assert.strictEqual(Array.isArray(followingRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'private', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, alice); assert.strictEqual(followingRes.status, 200); @@ -175,36 +183,36 @@ describe('FF visibility', () => { test('followersVisibility が followers なユーザーのフォロワーを followingVisibility の設定に関わらず自分で見れる', async () => { { - await api('i/update', { + await api('/i/update', { followingVisibility: 'public', followersVisibility: 'followers', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, alice); assert.strictEqual(followersRes.status, 200); assert.strictEqual(Array.isArray(followersRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'followers', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, alice); assert.strictEqual(followersRes.status, 200); assert.strictEqual(Array.isArray(followersRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'followers', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, alice); assert.strictEqual(followersRes.status, 200); @@ -213,15 +221,15 @@ describe('FF visibility', () => { }); test('followingVisibility, followersVisibility がともに followers なユーザーのフォロー/フォロワーを非フォロワーが見れない', async () => { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'followers', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); @@ -231,34 +239,34 @@ describe('FF visibility', () => { test('followingVisibility が followers なユーザーのフォローを followersVisibility の設定に関わらず非フォロワーが見れない', async () => { { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'public', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); assert.strictEqual(followingRes.status, 400); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'followers', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); assert.strictEqual(followingRes.status, 400); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'private', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); assert.strictEqual(followingRes.status, 400); @@ -267,34 +275,34 @@ describe('FF visibility', () => { test('followersVisibility が followers なユーザーのフォロワーを followingVisibility の設定に関わらず非フォロワーが見れない', async () => { { - await api('i/update', { + await api('/i/update', { followingVisibility: 'public', followersVisibility: 'followers', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); assert.strictEqual(followersRes.status, 400); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'followers', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); assert.strictEqual(followersRes.status, 400); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'followers', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); assert.strictEqual(followersRes.status, 400); @@ -302,19 +310,19 @@ describe('FF visibility', () => { }); test('followingVisibility, followersVisibility がともに followers なユーザーのフォロー/フォロワーをフォロワーが見れる', async () => { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'followers', }, alice); - await api('following/create', { + await api('/following/create', { userId: alice.id, }, bob); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); @@ -326,45 +334,45 @@ describe('FF visibility', () => { test('followingVisibility が followers なユーザーのフォローを followersVisibility の設定に関わらずフォロワーが見れる', async () => { { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'public', }, alice); - await api('following/create', { + await api('/following/create', { userId: alice.id, }, bob); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); assert.strictEqual(followingRes.status, 200); assert.strictEqual(Array.isArray(followingRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'followers', }, alice); - await api('following/create', { + await api('/following/create', { userId: alice.id, }, bob); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); assert.strictEqual(followingRes.status, 200); assert.strictEqual(Array.isArray(followingRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'private', }, alice); - await api('following/create', { + await api('/following/create', { userId: alice.id, }, bob); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); assert.strictEqual(followingRes.status, 200); @@ -374,45 +382,45 @@ describe('FF visibility', () => { test('followersVisibility が followers なユーザーのフォロワーを followingVisibility の設定に関わらずフォロワーが見れる', async () => { { - await api('i/update', { + await api('/i/update', { followingVisibility: 'public', followersVisibility: 'followers', }, alice); - await api('following/create', { + await api('/following/create', { userId: alice.id, }, bob); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); assert.strictEqual(followersRes.status, 200); assert.strictEqual(Array.isArray(followersRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'followers', }, alice); - await api('following/create', { + await api('/following/create', { userId: alice.id, }, bob); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); assert.strictEqual(followersRes.status, 200); assert.strictEqual(Array.isArray(followersRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'followers', }, alice); - await api('following/create', { + await api('/following/create', { userId: alice.id, }, bob); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); assert.strictEqual(followersRes.status, 200); @@ -421,15 +429,15 @@ describe('FF visibility', () => { }); test('followingVisibility, followersVisibility がともに private なユーザーのフォロー/フォロワーを自分で見れる', async () => { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'private', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, alice); @@ -441,36 +449,36 @@ describe('FF visibility', () => { test('followingVisibility が private なユーザーのフォローを followersVisibility の設定に関わらず自分で見れる', async () => { { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'public', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, alice); assert.strictEqual(followingRes.status, 200); assert.strictEqual(Array.isArray(followingRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'followers', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, alice); assert.strictEqual(followingRes.status, 200); assert.strictEqual(Array.isArray(followingRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'private', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, alice); assert.strictEqual(followingRes.status, 200); @@ -480,36 +488,36 @@ describe('FF visibility', () => { test('followersVisibility が private なユーザーのフォロワーを followingVisibility の設定に関わらず自分で見れる', async () => { { - await api('i/update', { + await api('/i/update', { followingVisibility: 'public', followersVisibility: 'private', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, alice); assert.strictEqual(followersRes.status, 200); assert.strictEqual(Array.isArray(followersRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'private', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, alice); assert.strictEqual(followersRes.status, 200); assert.strictEqual(Array.isArray(followersRes.body), true); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'private', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, alice); assert.strictEqual(followersRes.status, 200); @@ -518,15 +526,15 @@ describe('FF visibility', () => { }); test('followingVisibility, followersVisibility がともに private なユーザーのフォロー/フォロワーを他人が見れない', async () => { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'private', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); @@ -536,34 +544,34 @@ describe('FF visibility', () => { test('followingVisibility が private なユーザーのフォローを followersVisibility の設定に関わらず他人が見れない', async () => { { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'public', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); assert.strictEqual(followingRes.status, 400); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'followers', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); assert.strictEqual(followingRes.status, 400); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'private', }, alice); - const followingRes = await api('users/following', { + const followingRes = await api('/users/following', { userId: alice.id, }, bob); assert.strictEqual(followingRes.status, 400); @@ -572,34 +580,34 @@ describe('FF visibility', () => { test('followersVisibility が private なユーザーのフォロワーを followingVisibility の設定に関わらず他人が見れない', async () => { { - await api('i/update', { + await api('/i/update', { followingVisibility: 'public', followersVisibility: 'private', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); assert.strictEqual(followersRes.status, 400); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', followersVisibility: 'private', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); assert.strictEqual(followersRes.status, 400); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', followersVisibility: 'private', }, alice); - const followersRes = await api('users/followers', { + const followersRes = await api('/users/followers', { userId: alice.id, }, bob); assert.strictEqual(followersRes.status, 400); @@ -609,7 +617,7 @@ describe('FF visibility', () => { describe('AP', () => { test('followingVisibility が public 以外ならばAPからはフォローを取得できない', async () => { { - await api('i/update', { + await api('/i/update', { followingVisibility: 'public', }, alice); @@ -617,7 +625,7 @@ describe('FF visibility', () => { assert.strictEqual(followingRes.status, 200); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'followers', }, alice); @@ -625,7 +633,7 @@ describe('FF visibility', () => { assert.strictEqual(followingRes.status, 403); } { - await api('i/update', { + await api('/i/update', { followingVisibility: 'private', }, alice); @@ -636,7 +644,7 @@ describe('FF visibility', () => { test('followersVisibility が public 以外ならばAPからはフォロワーを取得できない', async () => { { - await api('i/update', { + await api('/i/update', { followersVisibility: 'public', }, alice); @@ -644,7 +652,7 @@ describe('FF visibility', () => { assert.strictEqual(followersRes.status, 200); } { - await api('i/update', { + await api('/i/update', { followersVisibility: 'followers', }, alice); @@ -652,7 +660,7 @@ describe('FF visibility', () => { assert.strictEqual(followersRes.status, 403); } { - await api('i/update', { + await api('/i/update', { followersVisibility: 'private', }, alice); diff --git a/packages/backend/test/e2e/move.ts b/packages/backend/test/e2e/move.ts index fd798bdb25..b009ef124a 100644 --- a/packages/backend/test/e2e/move.ts +++ b/packages/backend/test/e2e/move.ts @@ -1,38 +1,37 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { INestApplicationContext } from '@nestjs/common'; - process.env.NODE_ENV = 'test'; -import { setTimeout } from 'node:timers/promises'; import * as assert from 'assert'; import { loadConfig } from '@/config.js'; -import { MiRepository, MiUser, UsersRepository, miRepository } from '@/models/_.js'; -import { secureRndstr } from '@/misc/secure-rndstr.js'; +import { MiUser, UsersRepository } from '@/models/_.js'; import { jobQueue } from '@/boot/common.js'; -import { api, castAsError, initTestDb, signup, successfulApiCall, uploadFile } from '../utils.js'; +import { secureRndstr } from '@/misc/secure-rndstr.js'; +import { uploadFile, signup, startServer, initTestDb, api, sleep, successfulApiCall } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; describe('Account Move', () => { + let app: INestApplicationContext; let jq: INestApplicationContext; let url: URL; - let root: misskey.entities.SignupResponse; - let alice: misskey.entities.SignupResponse; - let bob: misskey.entities.SignupResponse; - let carol: misskey.entities.SignupResponse; - let dave: misskey.entities.SignupResponse; - let eve: misskey.entities.SignupResponse; - let frank: misskey.entities.SignupResponse; + let root: any; + let alice: misskey.entities.MeSignup; + let bob: misskey.entities.MeSignup; + let carol: misskey.entities.MeSignup; + let dave: misskey.entities.MeSignup; + let eve: misskey.entities.MeSignup; + let frank: misskey.entities.MeSignup; let Users: UsersRepository; beforeAll(async () => { + app = await startServer(); jq = await jobQueue(); - const config = loadConfig(); url = new URL(config.url); const connection = await initTestDb(false); @@ -43,11 +42,11 @@ describe('Account Move', () => { dave = await signup({ username: 'dave' }); eve = await signup({ username: 'eve' }); frank = await signup({ username: 'frank' }); - Users = connection.getRepository(MiUser).extend(miRepository as MiRepository); + Users = connection.getRepository(MiUser); }, 1000 * 60 * 2); afterAll(async () => { - await jq.close(); + await Promise.all([app.close(), jq.close()]); }); describe('Create Alias', () => { @@ -56,7 +55,7 @@ describe('Account Move', () => { }, 1000 * 10); test('Able to create an alias', async () => { - const res = await api('i/update', { + const res = await api('/i/update', { alsoKnownAs: [`@alice@${url.hostname}`], }, bob); @@ -68,7 +67,7 @@ describe('Account Move', () => { }); test('Able to create a local alias without hostname', async () => { - await api('i/update', { + await api('/i/update', { alsoKnownAs: ['@alice'], }, bob); @@ -78,7 +77,7 @@ describe('Account Move', () => { }); test('Able to create a local alias without @', async () => { - await api('i/update', { + await api('/i/update', { alsoKnownAs: ['alice'], }, bob); @@ -88,55 +87,55 @@ describe('Account Move', () => { }); test('Able to set remote user (but may fail)', async () => { - const res = await api('i/update', { + const res = await api('/i/update', { alsoKnownAs: ['@syuilo@example.com'], }, bob); assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.code, 'NO_SUCH_USER'); - assert.strictEqual(castAsError(res.body).error.id, 'fcd2eef9-a9b2-4c4f-8624-038099e90aa5'); + assert.strictEqual(res.body.error.code, 'NO_SUCH_USER'); + assert.strictEqual(res.body.error.id, 'fcd2eef9-a9b2-4c4f-8624-038099e90aa5'); }); test('Unable to add duplicated aliases to alsoKnownAs', async () => { - const res = await api('i/update', { + const res = await api('/i/update', { alsoKnownAs: [`@alice@${url.hostname}`, `@alice@${url.hostname}`], }, bob); assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.code, 'INVALID_PARAM'); - assert.strictEqual(castAsError(res.body).error.id, '3d81ceae-475f-4600-b2a8-2bc116157532'); + assert.strictEqual(res.body.error.code, 'INVALID_PARAM'); + assert.strictEqual(res.body.error.id, '3d81ceae-475f-4600-b2a8-2bc116157532'); }); test('Unable to add itself', async () => { - const res = await api('i/update', { + const res = await api('/i/update', { alsoKnownAs: [`@bob@${url.hostname}`], }, bob); assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.code, 'FORBIDDEN_TO_SET_YOURSELF'); - assert.strictEqual(castAsError(res.body).error.id, '25c90186-4ab0-49c8-9bba-a1fa6c202ba4'); + assert.strictEqual(res.body.error.code, 'FORBIDDEN_TO_SET_YOURSELF'); + assert.strictEqual(res.body.error.id, '25c90186-4ab0-49c8-9bba-a1fa6c202ba4'); }); test('Unable to add a nonexisting local account to alsoKnownAs', async () => { - const res1 = await api('i/update', { + const res1 = await api('/i/update', { alsoKnownAs: [`@nonexist@${url.hostname}`], }, bob); assert.strictEqual(res1.status, 400); - assert.strictEqual(castAsError(res1.body).error.code, 'NO_SUCH_USER'); - assert.strictEqual(castAsError(res1.body).error.id, 'fcd2eef9-a9b2-4c4f-8624-038099e90aa5'); + assert.strictEqual(res1.body.error.code, 'NO_SUCH_USER'); + assert.strictEqual(res1.body.error.id, 'fcd2eef9-a9b2-4c4f-8624-038099e90aa5'); - const res2 = await api('i/update', { + const res2 = await api('/i/update', { alsoKnownAs: ['@alice', 'nonexist'], }, bob); assert.strictEqual(res2.status, 400); - assert.strictEqual(castAsError(res2.body).error.code, 'NO_SUCH_USER'); - assert.strictEqual(castAsError(res2.body).error.id, 'fcd2eef9-a9b2-4c4f-8624-038099e90aa5'); + assert.strictEqual(res2.body.error.code, 'NO_SUCH_USER'); + assert.strictEqual(res2.body.error.id, 'fcd2eef9-a9b2-4c4f-8624-038099e90aa5'); }); test('Able to add two existing local account to alsoKnownAs', async () => { - await api('i/update', { + await api('/i/update', { alsoKnownAs: [`@alice@${url.hostname}`, `@carol@${url.hostname}`], }, bob); @@ -147,10 +146,10 @@ describe('Account Move', () => { }); test('Able to properly overwrite alsoKnownAs', async () => { - await api('i/update', { + await api('/i/update', { alsoKnownAs: [`@alice@${url.hostname}`], }, bob); - await api('i/update', { + await api('/i/update', { alsoKnownAs: [`@carol@${url.hostname}`, `@dave@${url.hostname}`], }, bob); @@ -165,171 +164,164 @@ describe('Account Move', () => { let antennaId = ''; beforeAll(async () => { - await api('i/update', { + await api('/i/update', { alsoKnownAs: [`@alice@${url.hostname}`], }, root); - const listRoot = await api('users/lists/create', { + const listRoot = await api('/users/lists/create', { name: secureRndstr(8), }, root); - await api('users/lists/push', { + await api('/users/lists/push', { listId: listRoot.body.id, userId: alice.id, }, root); - await api('following/create', { + await api('/following/create', { userId: root.id, }, alice); - await api('following/create', { + await api('/following/create', { userId: eve.id, }, alice); - const antenna = await api('antennas/create', { + const antenna = await api('/antennas/create', { name: secureRndstr(8), src: 'home', - keywords: [[secureRndstr(8)]], + keywords: [secureRndstr(8)], excludeKeywords: [], users: [], caseSensitive: false, localOnly: false, withReplies: false, withFile: false, + notify: false, }, alice); antennaId = antenna.body.id; - await api('i/update', { + await api('/i/update', { alsoKnownAs: [`@alice@${url.hostname}`], }, bob); - await api('following/create', { + await api('/following/create', { userId: alice.id, }, carol); - await api('mute/create', { + await api('/mute/create', { userId: alice.id, }, dave); - await api('blocking/create', { + await api('/blocking/create', { userId: alice.id, }, dave); - await api('following/create', { + await api('/following/create', { userId: eve.id, }, dave); - await api('following/create', { + await api('/following/create', { userId: dave.id, }, eve); - const listEve = await api('users/lists/create', { + const listEve = await api('/users/lists/create', { name: secureRndstr(8), }, eve); - await api('users/lists/push', { + await api('/users/lists/push', { listId: listEve.body.id, userId: bob.id, }, eve); - await api('i/update', { + await api('/i/update', { isLocked: true, }, frank); - await api('following/create', { + await api('/following/create', { userId: frank.id, }, alice); - await api('following/requests/accept', { + await api('/following/requests/accept', { userId: alice.id, }, frank); }, 1000 * 10); test('Prohibit the root account from moving', async () => { - const res = await api('i/move', { + const res = await api('/i/move', { moveToAccount: `@bob@${url.hostname}`, }, root); assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.code, 'NOT_ROOT_FORBIDDEN'); - assert.strictEqual(castAsError(res.body).error.id, '4362e8dc-731f-4ad8-a694-be2a88922a24'); + assert.strictEqual(res.body.error.code, 'NOT_ROOT_FORBIDDEN'); + assert.strictEqual(res.body.error.id, '4362e8dc-731f-4ad8-a694-be2a88922a24'); }); test('Unable to move to a nonexisting local account', async () => { - const res = await api('i/move', { + const res = await api('/i/move', { moveToAccount: `@nonexist@${url.hostname}`, }, alice); assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.code, 'NO_SUCH_USER'); - assert.strictEqual(castAsError(res.body).error.id, 'fcd2eef9-a9b2-4c4f-8624-038099e90aa5'); + assert.strictEqual(res.body.error.code, 'NO_SUCH_USER'); + assert.strictEqual(res.body.error.id, 'fcd2eef9-a9b2-4c4f-8624-038099e90aa5'); }); test('Unable to move if alsoKnownAs is invalid', async () => { - const res = await api('i/move', { + const res = await api('/i/move', { moveToAccount: `@carol@${url.hostname}`, }, alice); assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.code, 'DESTINATION_ACCOUNT_FORBIDS'); - assert.strictEqual(castAsError(res.body).error.id, 'b5c90186-4ab0-49c8-9bba-a1f766282ba4'); + assert.strictEqual(res.body.error.code, 'DESTINATION_ACCOUNT_FORBIDS'); + assert.strictEqual(res.body.error.id, 'b5c90186-4ab0-49c8-9bba-a1f766282ba4'); }); test('Relationships have been properly migrated', async () => { - const move = await api('i/move', { + const move = await api('/i/move', { moveToAccount: `@bob@${url.hostname}`, }, alice); assert.strictEqual(move.status, 200); - await setTimeout(1000 * 3); // wait for jobs to finish + await sleep(1000 * 3); // wait for jobs to finish // Unfollow delayed? - const aliceFollowings = await api('users/following', { + const aliceFollowings = await api('/users/following', { userId: alice.id, }, alice); assert.strictEqual(aliceFollowings.status, 200); - assert.ok(aliceFollowings); assert.strictEqual(aliceFollowings.body.length, 3); - const carolFollowings = await api('users/following', { + const carolFollowings = await api('/users/following', { userId: carol.id, }, carol); assert.strictEqual(carolFollowings.status, 200); - assert.ok(carolFollowings); assert.strictEqual(carolFollowings.body.length, 2); assert.strictEqual(carolFollowings.body[0].followeeId, bob.id); assert.strictEqual(carolFollowings.body[1].followeeId, alice.id); - const blockings = await api('blocking/list', {}, dave); + const blockings = await api('/blocking/list', {}, dave); assert.strictEqual(blockings.status, 200); - assert.ok(blockings); assert.strictEqual(blockings.body.length, 2); assert.strictEqual(blockings.body[0].blockeeId, bob.id); assert.strictEqual(blockings.body[1].blockeeId, alice.id); - const mutings = await api('mute/list', {}, dave); + const mutings = await api('/mute/list', {}, dave); assert.strictEqual(mutings.status, 200); - assert.ok(mutings); assert.strictEqual(mutings.body.length, 2); assert.strictEqual(mutings.body[0].muteeId, bob.id); assert.strictEqual(mutings.body[1].muteeId, alice.id); - const rootLists = await api('users/lists/list', {}, root); + const rootLists = await api('/users/lists/list', {}, root); assert.strictEqual(rootLists.status, 200); - assert.ok(rootLists); - assert.ok(rootLists.body[0].userIds); assert.strictEqual(rootLists.body[0].userIds.length, 2); assert.ok(rootLists.body[0].userIds.find((id: string) => id === bob.id)); assert.ok(rootLists.body[0].userIds.find((id: string) => id === alice.id)); - const eveLists = await api('users/lists/list', {}, eve); + const eveLists = await api('/users/lists/list', {}, eve); assert.strictEqual(eveLists.status, 200); - assert.ok(eveLists); - assert.ok(eveLists.body[0].userIds); assert.strictEqual(eveLists.body[0].userIds.length, 1); assert.ok(eveLists.body[0].userIds.find((id: string) => id === bob.id)); }); test('A locked account automatically accept the follow request if it had already accepted the old account.', async () => { await successfulApiCall({ - endpoint: 'following/create', + endpoint: '/following/create', parameters: { userId: frank.id, }, user: bob, }); - const followers = await api('users/followers', { + const followers = await api('/users/followers', { userId: frank.id, }, frank); @@ -339,9 +331,9 @@ describe('Account Move', () => { }); test('Unfollowed after 10 sec (24 hours in production).', async () => { - await setTimeout(1000 * 8); + await sleep(1000 * 8); - const following = await api('users/following', { + const following = await api('/users/following', { userId: alice.id, }, alice); @@ -350,17 +342,17 @@ describe('Account Move', () => { }); test('Unable to move if the destination account has already moved.', async () => { - const res = await api('i/move', { + const res = await api('/i/move', { moveToAccount: `@alice@${url.hostname}`, }, bob); assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.code, 'DESTINATION_ACCOUNT_FORBIDS'); - assert.strictEqual(castAsError(res.body).error.id, 'b5c90186-4ab0-49c8-9bba-a1f766282ba4'); + assert.strictEqual(res.body.error.code, 'DESTINATION_ACCOUNT_FORBIDS'); + assert.strictEqual(res.body.error.id, 'b5c90186-4ab0-49c8-9bba-a1f766282ba4'); }); test('Follow and follower counts are properly adjusted', async () => { - await api('following/create', { + await api('/following/create', { userId: alice.id, }, eve); const newAlice = await Users.findOneByOrFail({ id: alice.id }); @@ -373,7 +365,7 @@ describe('Account Move', () => { assert.strictEqual(newEve.followingCount, 1); assert.strictEqual(newEve.followersCount, 1); - await api('following/delete', { + await api('/following/delete', { userId: alice.id, }, eve); newEve = await Users.findOneByOrFail({ id: eve.id }); @@ -382,94 +374,91 @@ describe('Account Move', () => { }); test.each([ - 'antennas/create', - 'channels/create', - 'channels/favorite', - 'channels/follow', - 'channels/unfavorite', - 'channels/unfollow', - 'clips/add-note', - 'clips/create', - 'clips/favorite', - 'clips/remove-note', - 'clips/unfavorite', - 'clips/update', - 'drive/files/upload-from-url', - 'flash/create', - 'flash/like', - 'flash/unlike', - 'flash/update', - 'following/create', - 'gallery/posts/create', - 'gallery/posts/like', - 'gallery/posts/unlike', - 'gallery/posts/update', - 'i/claim-achievement', - 'i/move', - 'i/import-blocking', - 'i/import-following', - 'i/import-muting', - 'i/import-user-lists', - 'i/pin', - 'mute/create', - 'notes/create', - 'notes/favorites/create', - 'notes/polls/vote', - 'notes/reactions/create', - 'pages/create', - 'pages/like', - 'pages/unlike', - 'pages/update', - 'renote-mute/create', - 'users/lists/create', - 'users/lists/pull', - 'users/lists/push', - ] as const)('Prohibit access after moving: %s', async (endpoint) => { + '/antennas/create', + '/channels/create', + '/channels/favorite', + '/channels/follow', + '/channels/unfavorite', + '/channels/unfollow', + '/clips/add-note', + '/clips/create', + '/clips/favorite', + '/clips/remove-note', + '/clips/unfavorite', + '/clips/update', + '/drive/files/upload-from-url', + '/flash/create', + '/flash/like', + '/flash/unlike', + '/flash/update', + '/following/create', + '/gallery/posts/create', + '/gallery/posts/like', + '/gallery/posts/unlike', + '/gallery/posts/update', + '/i/claim-achievement', + '/i/move', + '/i/import-blocking', + '/i/import-following', + '/i/import-muting', + '/i/import-user-lists', + '/i/pin', + '/mute/create', + '/notes/create', + '/notes/favorites/create', + '/notes/polls/vote', + '/notes/reactions/create', + '/pages/create', + '/pages/like', + '/pages/unlike', + '/pages/update', + '/renote-mute/create', + '/users/lists/create', + '/users/lists/pull', + '/users/lists/push', + ])('Prohibit access after moving: %s', async (endpoint) => { const res = await api(endpoint, {}, alice); assert.strictEqual(res.status, 403); - assert.ok(res.body); - assert.strictEqual(castAsError(res.body).error.code, 'YOUR_ACCOUNT_MOVED'); - assert.strictEqual(castAsError(res.body).error.id, '56f20ec9-fd06-4fa5-841b-edd6d7d4fa31'); + assert.strictEqual(res.body.error.code, 'YOUR_ACCOUNT_MOVED'); + assert.strictEqual(res.body.error.id, '56f20ec9-fd06-4fa5-841b-edd6d7d4fa31'); }); test('Prohibit access after moving: /antennas/update', async () => { - const res = await api('antennas/update', { + const res = await api('/antennas/update', { antennaId, name: secureRndstr(8), src: 'users', - keywords: [[secureRndstr(8)]], + keywords: [secureRndstr(8)], excludeKeywords: [], users: [eve.id], caseSensitive: false, localOnly: false, withReplies: false, withFile: false, + notify: false, }, alice); assert.strictEqual(res.status, 403); - assert.ok(res.body); - assert.strictEqual(castAsError(res.body).error.code, 'YOUR_ACCOUNT_MOVED'); - assert.strictEqual(castAsError(res.body).error.id, '56f20ec9-fd06-4fa5-841b-edd6d7d4fa31'); + assert.strictEqual(res.body.error.code, 'YOUR_ACCOUNT_MOVED'); + assert.strictEqual(res.body.error.id, '56f20ec9-fd06-4fa5-841b-edd6d7d4fa31'); }); test('Prohibit access after moving: /drive/files/create', async () => { - // FIXME: 一旦逃げておく const res = await uploadFile(alice); assert.strictEqual(res.status, 403); - assert.ok(res.body); - assert.strictEqual(castAsError(res.body).error.code, 'YOUR_ACCOUNT_MOVED'); - assert.strictEqual(castAsError(res.body).error.id, '56f20ec9-fd06-4fa5-841b-edd6d7d4fa31'); + assert.strictEqual(res.body.error.code, 'YOUR_ACCOUNT_MOVED'); + assert.strictEqual(res.body.error.id, '56f20ec9-fd06-4fa5-841b-edd6d7d4fa31'); }); test('Prohibit updating alsoKnownAs after moving', async () => { - const res = await api('i/update', { + const res = await api('/i/update', { alsoKnownAs: [`@eve@${url.hostname}`], }, alice); assert.strictEqual(res.status, 403); - assert.strictEqual(castAsError(res.body).error.code, 'YOUR_ACCOUNT_MOVED'); - assert.strictEqual(castAsError(res.body).error.id, '56f20ec9-fd06-4fa5-841b-edd6d7d4fa31'); + assert.strictEqual(res.body.error.code, 'YOUR_ACCOUNT_MOVED'); + assert.strictEqual(res.body.error.id, '56f20ec9-fd06-4fa5-841b-edd6d7d4fa31'); }); }); }); diff --git a/packages/backend/test/e2e/mute.ts b/packages/backend/test/e2e/mute.ts index f37da288b7..a4b57a1eba 100644 --- a/packages/backend/test/e2e/mute.ts +++ b/packages/backend/test/e2e/mute.ts @@ -1,63 +1,61 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; -import { api, post, react, signup, waitFire } from '../utils.js'; +import { signup, api, post, react, startServer, waitFire } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; describe('Mute', () => { + let app: INestApplicationContext; + // alice mutes carol - let alice: misskey.entities.SignupResponse; - let bob: misskey.entities.SignupResponse; - let carol: misskey.entities.SignupResponse; + let alice: misskey.entities.MeSignup; + let bob: misskey.entities.MeSignup; + let carol: misskey.entities.MeSignup; beforeAll(async () => { + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); carol = await signup({ username: 'carol' }); - - // Mute: alice ==> carol - await api('mute/create', { - userId: carol.id, - }, alice); }, 1000 * 60 * 2); + afterAll(async () => { + await app.close(); + }); + test('ミュート作成', async () => { - const res = await api('mute/create', { - userId: bob.id, + const res = await api('/mute/create', { + userId: carol.id, }, alice); assert.strictEqual(res.status, 204); - - // 単体でも走らせられるように副作用消す - await api('mute/delete', { - userId: bob.id, - }, alice); }); test('「自分宛ての投稿」にミュートしているユーザーの投稿が含まれない', async () => { const bobNote = await post(bob, { text: '@alice hi' }); const carolNote = await post(carol, { text: '@alice hi' }); - const res = await api('notes/mentions', {}, alice); + const res = await api('/notes/mentions', {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test('ミュートしているユーザーからメンションされても、hasUnreadMentions が true にならない', async () => { // 状態リセット - await api('i/read-all-unread-notes', {}, alice); + await api('/i/read-all-unread-notes', {}, alice); await post(carol, { text: '@alice hi' }); - const res = await api('i', {}, alice); + const res = await api('/i', {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(res.body.hasUnreadMentions, false); @@ -65,7 +63,7 @@ describe('Mute', () => { test('ミュートしているユーザーからメンションされても、ストリームに unreadMention イベントが流れてこない', async () => { // 状態リセット - await api('i/read-all-unread-notes', {}, alice); + await api('/i/read-all-unread-notes', {}, alice); const fired = await waitFire(alice, 'main', () => post(carol, { text: '@alice hi' }), msg => msg.type === 'unreadMention'); @@ -74,8 +72,8 @@ describe('Mute', () => { test('ミュートしているユーザーからメンションされても、ストリームに unreadNotification イベントが流れてこない', async () => { // 状態リセット - await api('i/read-all-unread-notes', {}, alice); - await api('notifications/mark-all-as-read', {}, alice); + await api('/i/read-all-unread-notes', {}, alice); + await api('/notifications/mark-all-as-read', {}, alice); const fired = await waitFire(alice, 'main', () => post(carol, { text: '@alice hi' }), msg => msg.type === 'unreadNotification'); @@ -88,13 +86,13 @@ describe('Mute', () => { const bobNote = await post(bob, { text: 'hi' }); const carolNote = await post(carol, { text: 'hi' }); - const res = await api('notes/local-timeline', {}, alice); + const res = await api('/notes/local-timeline', {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test('タイムラインにミュートしているユーザーの投稿のRenoteが含まれない', async () => { @@ -104,13 +102,13 @@ describe('Mute', () => { renoteId: carolNote.id, }); - const res = await api('notes/local-timeline', {}, alice); + const res = await api('/notes/local-timeline', {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); }); @@ -120,201 +118,12 @@ describe('Mute', () => { await react(bob, aliceNote, 'like'); await react(carol, aliceNote, 'like'); - const res = await api('i/notifications', {}, alice); + const res = await api('/i/notifications', {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); - }); - - test('通知にミュートしているユーザーからのリプライが含まれない', async () => { - const aliceNote = await post(alice, { text: 'hi' }); - await post(bob, { text: '@alice hi', replyId: aliceNote.id }); - await post(carol, { text: '@alice hi', replyId: aliceNote.id }); - - const res = await api('i/notifications', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); - }); - - test('通知にミュートしているユーザーからのリプライが含まれない', async () => { - await post(alice, { text: 'hi' }); - await post(bob, { text: '@alice hi' }); - await post(carol, { text: '@alice hi' }); - - const res = await api('i/notifications', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); - }); - - test('通知にミュートしているユーザーからの引用リノートが含まれない', async () => { - const aliceNote = await post(alice, { text: 'hi' }); - await post(bob, { text: 'hi', renoteId: aliceNote.id }); - await post(carol, { text: 'hi', renoteId: aliceNote.id }); - - const res = await api('i/notifications', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); - }); - - test('通知にミュートしているユーザーからのリノートが含まれない', async () => { - const aliceNote = await post(alice, { text: 'hi' }); - await post(bob, { renoteId: aliceNote.id }); - await post(carol, { renoteId: aliceNote.id }); - - const res = await api('i/notifications', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); - }); - - test('通知にミュートしているユーザーからのフォロー通知が含まれない', async () => { - await api('following/create', { userId: alice.id }, bob); - await api('following/create', { userId: alice.id }, carol); - - const res = await api('i/notifications', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); - - await api('following/delete', { userId: alice.id }, bob); - await api('following/delete', { userId: alice.id }, carol); - }); - - test('通知にミュートしているユーザーからのフォローリクエストが含まれない', async () => { - await api('i/update', { isLocked: true }, alice); - await api('following/create', { userId: alice.id }, bob); - await api('following/create', { userId: alice.id }, carol); - - const res = await api('i/notifications', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); - - await api('following/delete', { userId: alice.id }, bob); - await api('following/delete', { userId: alice.id }, carol); - }); - }); - - describe('Notification (Grouped)', () => { - test('通知にミュートしているユーザーの通知が含まれない(リアクション)', async () => { - const aliceNote = await post(alice, { text: 'hi' }); - await react(bob, aliceNote, 'like'); - await react(carol, aliceNote, 'like'); - - const res = await api('i/notifications-grouped', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); - }); - test('通知にミュートしているユーザーからのリプライが含まれない', async () => { - const aliceNote = await post(alice, { text: 'hi' }); - await post(bob, { text: '@alice hi', replyId: aliceNote.id }); - await post(carol, { text: '@alice hi', replyId: aliceNote.id }); - - const res = await api('i/notifications-grouped', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); - }); - - test('通知にミュートしているユーザーからのリプライが含まれない', async () => { - await post(alice, { text: 'hi' }); - await post(bob, { text: '@alice hi' }); - await post(carol, { text: '@alice hi' }); - - const res = await api('i/notifications-grouped', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); - }); - - test('通知にミュートしているユーザーからの引用リノートが含まれない', async () => { - const aliceNote = await post(alice, { text: 'hi' }); - await post(bob, { text: 'hi', renoteId: aliceNote.id }); - await post(carol, { text: 'hi', renoteId: aliceNote.id }); - - const res = await api('i/notifications-grouped', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); - }); - - test('通知にミュートしているユーザーからのリノートが含まれない', async () => { - const aliceNote = await post(alice, { text: 'hi' }); - await post(bob, { renoteId: aliceNote.id }); - await post(carol, { renoteId: aliceNote.id }); - - const res = await api('i/notifications-grouped', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); - }); - - test('通知にミュートしているユーザーからのフォロー通知が含まれない', async () => { - await api('following/create', { userId: alice.id }, bob); - await api('following/create', { userId: alice.id }, carol); - - const res = await api('i/notifications-grouped', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); - - await api('following/delete', { userId: alice.id }, bob); - await api('following/delete', { userId: alice.id }, carol); - }); - - test('通知にミュートしているユーザーからのフォローリクエストが含まれない', async () => { - await api('i/update', { isLocked: true }, alice); - await api('following/create', { userId: alice.id }, bob); - await api('following/create', { userId: alice.id }, carol); - - const res = await api('i/notifications-grouped', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === bob.id), true); - assert.strictEqual(res.body.some(notification => 'userId' in notification && notification.userId === carol.id), false); + assert.strictEqual(res.body.some((notification: any) => notification.userId === bob.id), true); + assert.strictEqual(res.body.some((notification: any) => notification.userId === carol.id), false); }); }); }); diff --git a/packages/backend/test/e2e/nodeinfo.ts b/packages/backend/test/e2e/nodeinfo.ts index 28b96fe8c8..7eed39c5ed 100644 --- a/packages/backend/test/e2e/nodeinfo.ts +++ b/packages/backend/test/e2e/nodeinfo.ts @@ -1,14 +1,25 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; -import { relativeFetch } from '../utils.js'; +import { relativeFetch, startServer } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; describe('nodeinfo', () => { + let app: INestApplicationContext; + + beforeAll(async () => { + app = await startServer(); + }, 1000 * 60 * 2); + + afterAll(async () => { + await app.close(); + }); + test('nodeinfo 2.1', async () => { const res = await relativeFetch('nodeinfo/2.1'); assert.ok(res.ok); diff --git a/packages/backend/test/e2e/note.ts b/packages/backend/test/e2e/note.ts index 5937eb9b49..961df99cc2 100644 --- a/packages/backend/test/e2e/note.ts +++ b/packages/backend/test/e2e/note.ts @@ -1,41 +1,42 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import type { Repository } from "typeorm"; - process.env.NODE_ENV = 'test'; import * as assert from 'assert'; import { MiNote } from '@/models/Note.js'; import { MAX_NOTE_TEXT_LENGTH } from '@/const.js'; -import { api, castAsError, initTestDb, post, role, signup, uploadFile, uploadUrl } from '../utils.js'; +import { signup, post, uploadUrl, startServer, initTestDb, api, uploadFile } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; describe('Note', () => { - let Notes: Repository; + let app: INestApplicationContext; + let Notes: any; - let root: misskey.entities.SignupResponse; - let alice: misskey.entities.SignupResponse; - let bob: misskey.entities.SignupResponse; - let tom: misskey.entities.SignupResponse; + let alice: misskey.entities.MeSignup; + let bob: misskey.entities.MeSignup; beforeAll(async () => { + app = await startServer(); const connection = await initTestDb(true); Notes = connection.getRepository(MiNote); - root = await signup({ username: 'root' }); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); - tom = await signup({ username: 'tom', host: 'example.com' }); }, 1000 * 60 * 2); + afterAll(async () => { + await app.close(); + }); + test('投稿できる', async () => { const post = { text: 'test', }; - const res = await api('notes/create', post, alice); + const res = await api('/notes/create', post, alice); assert.strictEqual(res.status, 200); assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); @@ -43,9 +44,9 @@ describe('Note', () => { }); test('ファイルを添付できる', async () => { - const file = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/192.jpg'); + const file = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); - const res = await api('notes/create', { + const res = await api('/notes/create', { fileIds: [file.id], }, alice); @@ -55,36 +56,36 @@ describe('Note', () => { }, 1000 * 10); test('他人のファイルで怒られる', async () => { - const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/192.jpg'); + const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); - const res = await api('notes/create', { + const res = await api('/notes/create', { text: 'test', fileIds: [file.id], }, alice); assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.code, 'NO_SUCH_FILE'); - assert.strictEqual(castAsError(res.body).error.id, 'b6992544-63e7-67f0-fa7f-32444b1b5306'); + assert.strictEqual(res.body.error.code, 'NO_SUCH_FILE'); + assert.strictEqual(res.body.error.id, 'b6992544-63e7-67f0-fa7f-32444b1b5306'); }, 1000 * 10); test('存在しないファイルで怒られる', async () => { - const res = await api('notes/create', { + const res = await api('/notes/create', { text: 'test', fileIds: ['000000000000000000000000'], }, alice); assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.code, 'NO_SUCH_FILE'); - assert.strictEqual(castAsError(res.body).error.id, 'b6992544-63e7-67f0-fa7f-32444b1b5306'); + assert.strictEqual(res.body.error.code, 'NO_SUCH_FILE'); + assert.strictEqual(res.body.error.id, 'b6992544-63e7-67f0-fa7f-32444b1b5306'); }); test('不正なファイルIDで怒られる', async () => { - const res = await api('notes/create', { + const res = await api('/notes/create', { fileIds: ['kyoppie'], }, alice); assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.code, 'NO_SUCH_FILE'); - assert.strictEqual(castAsError(res.body).error.id, 'b6992544-63e7-67f0-fa7f-32444b1b5306'); + assert.strictEqual(res.body.error.code, 'NO_SUCH_FILE'); + assert.strictEqual(res.body.error.id, 'b6992544-63e7-67f0-fa7f-32444b1b5306'); }); test('返信できる', async () => { @@ -97,13 +98,12 @@ describe('Note', () => { replyId: bobPost.id, }; - const res = await api('notes/create', alicePost, alice); + const res = await api('/notes/create', alicePost, alice); assert.strictEqual(res.status, 200); assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); assert.strictEqual(res.body.createdNote.text, alicePost.text); assert.strictEqual(res.body.createdNote.replyId, alicePost.replyId); - assert.ok(res.body.createdNote.reply); assert.strictEqual(res.body.createdNote.reply.text, bobPost.text); }); @@ -116,12 +116,11 @@ describe('Note', () => { renoteId: bobPost.id, }; - const res = await api('notes/create', alicePost, alice); + const res = await api('/notes/create', alicePost, alice); assert.strictEqual(res.status, 200); assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); assert.strictEqual(res.body.createdNote.renoteId, alicePost.renoteId); - assert.ok(res.body.createdNote.renote); assert.strictEqual(res.body.createdNote.renote.text, bobPost.text); }); @@ -135,31 +134,17 @@ describe('Note', () => { renoteId: bobPost.id, }; - const res = await api('notes/create', alicePost, alice); + const res = await api('/notes/create', alicePost, alice); assert.strictEqual(res.status, 200); assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); assert.strictEqual(res.body.createdNote.text, alicePost.text); assert.strictEqual(res.body.createdNote.renoteId, alicePost.renoteId); - assert.ok(res.body.createdNote.renote); assert.strictEqual(res.body.createdNote.renote.text, bobPost.text); }); - test('引用renoteで空白文字のみで構成されたtextにするとレスポンスがtext: nullになる', async () => { - const bobPost = await post(bob, { - text: 'test', - }); - const res = await api('notes/create', { - text: ' ', - renoteId: bobPost.id, - }, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(res.body.createdNote.text, null); - }); - test('visibility: followersでrenoteできる', async () => { - const createRes = await api('notes/create', { + const createRes = await api('/notes/create', { text: 'test', visibility: 'followers', }, alice); @@ -167,7 +152,7 @@ describe('Note', () => { assert.strictEqual(createRes.status, 200); const renoteId = createRes.body.createdNote.id; - const renoteRes = await api('notes/create', { + const renoteRes = await api('/notes/create', { visibility: 'followers', renoteId, }, alice); @@ -176,99 +161,18 @@ describe('Note', () => { assert.strictEqual(renoteRes.body.createdNote.renoteId, renoteId); assert.strictEqual(renoteRes.body.createdNote.visibility, 'followers'); - const deleteRes = await api('notes/delete', { + const deleteRes = await api('/notes/delete', { noteId: renoteRes.body.createdNote.id, }, alice); assert.strictEqual(deleteRes.status, 204); }); - test('visibility: followersなノートに対してフォロワーはリプライできる', async () => { - await api('following/create', { - userId: alice.id, - }, bob); - - const aliceNote = await api('notes/create', { - text: 'direct note to bob', - visibility: 'followers', - }, alice); - - assert.strictEqual(aliceNote.status, 200); - - const replyId = aliceNote.body.createdNote.id; - const bobReply = await api('notes/create', { - text: 'reply to alice note', - replyId, - }, bob); - - assert.strictEqual(bobReply.status, 200); - assert.strictEqual(bobReply.body.createdNote.replyId, replyId); - - await api('following/delete', { - userId: alice.id, - }, bob); - }); - - test('visibility: followersなノートに対してフォロワーでないユーザーがリプライしようとすると怒られる', async () => { - const aliceNote = await api('notes/create', { - text: 'direct note to bob', - visibility: 'followers', - }, alice); - - assert.strictEqual(aliceNote.status, 200); - - const bobReply = await api('notes/create', { - text: 'reply to alice note', - replyId: aliceNote.body.createdNote.id, - }, bob); - - assert.strictEqual(bobReply.status, 400); - assert.strictEqual(castAsError(bobReply.body).error.code, 'CANNOT_REPLY_TO_AN_INVISIBLE_NOTE'); - }); - - test('visibility: specifiedなノートに対してvisibility: specifiedで返信できる', async () => { - const aliceNote = await api('notes/create', { - text: 'direct note to bob', - visibility: 'specified', - visibleUserIds: [bob.id], - }, alice); - - assert.strictEqual(aliceNote.status, 200); - - const bobReply = await api('notes/create', { - text: 'reply to alice note', - replyId: aliceNote.body.createdNote.id, - visibility: 'specified', - visibleUserIds: [alice.id], - }, bob); - - assert.strictEqual(bobReply.status, 200); - }); - - test('visibility: specifiedなノートに対してvisibility: follwersで返信しようとすると怒られる', async () => { - const aliceNote = await api('notes/create', { - text: 'direct note to bob', - visibility: 'specified', - visibleUserIds: [bob.id], - }, alice); - - assert.strictEqual(aliceNote.status, 200); - - const bobReply = await api('notes/create', { - text: 'reply to alice note with visibility: followers', - replyId: aliceNote.body.createdNote.id, - visibility: 'followers', - }, bob); - - assert.strictEqual(bobReply.status, 400); - assert.strictEqual(castAsError(bobReply.body).error.code, 'CANNOT_REPLY_TO_SPECIFIED_VISIBILITY_NOTE_WITH_EXTENDED_VISIBILITY'); - }); - test('文字数ぎりぎりで怒られない', async () => { const post = { text: '!'.repeat(MAX_NOTE_TEXT_LENGTH), // 3000文字 }; - const res = await api('notes/create', post, alice); + const res = await api('/notes/create', post, alice); assert.strictEqual(res.status, 200); }); @@ -276,7 +180,7 @@ describe('Note', () => { const post = { text: '!'.repeat(MAX_NOTE_TEXT_LENGTH + 1), // 3001文字 }; - const res = await api('notes/create', post, alice); + const res = await api('/notes/create', post, alice); assert.strictEqual(res.status, 400); }); @@ -285,7 +189,7 @@ describe('Note', () => { text: 'test', replyId: '000000000000000000000000', }; - const res = await api('notes/create', post, alice); + const res = await api('/notes/create', post, alice); assert.strictEqual(res.status, 400); }); @@ -293,7 +197,7 @@ describe('Note', () => { const post = { renoteId: '000000000000000000000000', }; - const res = await api('notes/create', post, alice); + const res = await api('/notes/create', post, alice); assert.strictEqual(res.status, 400); }); @@ -302,7 +206,7 @@ describe('Note', () => { text: 'test', replyId: 'foo', }; - const res = await api('notes/create', post, alice); + const res = await api('/notes/create', post, alice); assert.strictEqual(res.status, 400); }); @@ -310,7 +214,7 @@ describe('Note', () => { const post = { renoteId: 'foo', }; - const res = await api('notes/create', post, alice); + const res = await api('/notes/create', post, alice); assert.strictEqual(res.status, 400); }); @@ -319,7 +223,7 @@ describe('Note', () => { text: '@ghost yo', }; - const res = await api('notes/create', post, alice); + const res = await api('/notes/create', post, alice); assert.strictEqual(res.status, 200); assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); @@ -331,139 +235,129 @@ describe('Note', () => { text: '@bob @bob @bob yo', }; - const res = await api('notes/create', post, alice); + const res = await api('/notes/create', post, alice); assert.strictEqual(res.status, 200); assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); assert.strictEqual(res.body.createdNote.text, post.text); const noteDoc = await Notes.findOneBy({ id: res.body.createdNote.id }); - assert.ok(noteDoc); assert.deepStrictEqual(noteDoc.mentions, [bob.id]); }); describe('添付ファイル情報', () => { test('ファイルを添付した場合、投稿成功時にファイル情報入りのレスポンスが帰ってくる', async () => { const file = await uploadFile(alice); - const res = await api('notes/create', { - fileIds: [file.body!.id], + const res = await api('/notes/create', { + fileIds: [file.body.id], }, alice); assert.strictEqual(res.status, 200); assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); - assert.ok(res.body.createdNote.files); assert.strictEqual(res.body.createdNote.files.length, 1); - assert.strictEqual(res.body.createdNote.files[0].id, file.body!.id); + assert.strictEqual(res.body.createdNote.files[0].id, file.body.id); }); test('ファイルを添付した場合、タイムラインでファイル情報入りのレスポンスが帰ってくる', async () => { const file = await uploadFile(alice); - const createdNote = await api('notes/create', { - fileIds: [file.body!.id], + const createdNote = await api('/notes/create', { + fileIds: [file.body.id], }, alice); assert.strictEqual(createdNote.status, 200); - const res = await api('notes', { + const res = await api('/notes', { withFiles: true, }, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - const myNote = res.body.find(note => note.id === createdNote.body.createdNote.id); - assert.ok(myNote); - assert.ok(myNote.files); + const myNote = res.body.find((note: { id: string; files: { id: string }[] }) => note.id === createdNote.body.createdNote.id); + assert.notEqual(myNote, null); assert.strictEqual(myNote.files.length, 1); - assert.strictEqual(myNote.files[0].id, file.body!.id); + assert.strictEqual(myNote.files[0].id, file.body.id); }); test('ファイルが添付されたノートをリノートした場合、タイムラインでファイル情報入りのレスポンスが帰ってくる', async () => { const file = await uploadFile(alice); - const createdNote = await api('notes/create', { - fileIds: [file.body!.id], + const createdNote = await api('/notes/create', { + fileIds: [file.body.id], }, alice); assert.strictEqual(createdNote.status, 200); - const renoted = await api('notes/create', { + const renoted = await api('/notes/create', { renoteId: createdNote.body.createdNote.id, }, alice); assert.strictEqual(renoted.status, 200); - const res = await api('notes', { + const res = await api('/notes', { renote: true, }, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); const myNote = res.body.find((note: { id: string }) => note.id === renoted.body.createdNote.id); - assert.ok(myNote); - assert.ok(myNote.renote); - assert.ok(myNote.renote.files); + assert.notEqual(myNote, null); assert.strictEqual(myNote.renote.files.length, 1); - assert.strictEqual(myNote.renote.files[0].id, file.body!.id); + assert.strictEqual(myNote.renote.files[0].id, file.body.id); }); test('ファイルが添付されたノートに返信した場合、タイムラインでファイル情報入りのレスポンスが帰ってくる', async () => { const file = await uploadFile(alice); - const createdNote = await api('notes/create', { - fileIds: [file.body!.id], + const createdNote = await api('/notes/create', { + fileIds: [file.body.id], }, alice); assert.strictEqual(createdNote.status, 200); - const reply = await api('notes/create', { + const reply = await api('/notes/create', { replyId: createdNote.body.createdNote.id, text: 'this is reply', }, alice); assert.strictEqual(reply.status, 200); - const res = await api('notes', { + const res = await api('/notes', { reply: true, }, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); const myNote = res.body.find((note: { id: string }) => note.id === reply.body.createdNote.id); - assert.ok(myNote); - assert.ok(myNote.reply); - assert.ok(myNote.reply.files); + assert.notEqual(myNote, null); assert.strictEqual(myNote.reply.files.length, 1); - assert.strictEqual(myNote.reply.files[0].id, file.body!.id); + assert.strictEqual(myNote.reply.files[0].id, file.body.id); }); test('ファイルが添付されたノートへの返信をリノートした場合、タイムラインでファイル情報入りのレスポンスが帰ってくる', async () => { const file = await uploadFile(alice); - const createdNote = await api('notes/create', { - fileIds: [file.body!.id], + const createdNote = await api('/notes/create', { + fileIds: [file.body.id], }, alice); assert.strictEqual(createdNote.status, 200); - const reply = await api('notes/create', { + const reply = await api('/notes/create', { replyId: createdNote.body.createdNote.id, text: 'this is reply', }, alice); assert.strictEqual(reply.status, 200); - const renoted = await api('notes/create', { + const renoted = await api('/notes/create', { renoteId: reply.body.createdNote.id, }, alice); assert.strictEqual(renoted.status, 200); - const res = await api('notes', { + const res = await api('/notes', { renote: true, }, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); const myNote = res.body.find((note: { id: string }) => note.id === renoted.body.createdNote.id); - assert.ok(myNote); - assert.ok(myNote.renote); - assert.ok(myNote.renote.reply); - assert.ok(myNote.renote.reply.files); + assert.notEqual(myNote, null); assert.strictEqual(myNote.renote.reply.files.length, 1); - assert.strictEqual(myNote.renote.reply.files[0].id, file.body!.id); + assert.strictEqual(myNote.renote.reply.files[0].id, file.body.id); }); test('NSFWが強制されている場合変更できない', async () => { @@ -490,33 +384,33 @@ describe('Note', () => { value: true, }, }, - }, root); + }, alice); assert.strictEqual(res.status, 200); const assign = await api('admin/roles/assign', { userId: alice.id, roleId: res.body.id, - }, root); + }, alice); assert.strictEqual(assign.status, 204); - assert.strictEqual(file.body!.isSensitive, false); + assert.strictEqual(file.body.isSensitive, false); const nsfwfile = await uploadFile(alice); assert.strictEqual(nsfwfile.status, 200); - assert.strictEqual(nsfwfile.body!.isSensitive, true); + assert.strictEqual(nsfwfile.body.isSensitive, true); const liftnsfw = await api('drive/files/update', { - fileId: nsfwfile.body!.id, + fileId: nsfwfile.body.id, isSensitive: false, }, alice); assert.strictEqual(liftnsfw.status, 400); - assert.strictEqual(castAsError(liftnsfw.body).error.code, 'RESTRICTED_BY_ROLE'); + assert.strictEqual(liftnsfw.body.error.code, 'RESTRICTED_BY_ROLE'); const oldaddnsfw = await api('drive/files/update', { - fileId: file.body!.id, + fileId: file.body.id, isSensitive: true, }, alice); @@ -525,17 +419,17 @@ describe('Note', () => { await api('admin/roles/unassign', { userId: alice.id, roleId: res.body.id, - }, root); + }); await api('admin/roles/delete', { roleId: res.body.id, - }, root); + }, alice); }); }); describe('notes/create', () => { test('投票を添付できる', async () => { - const res = await api('notes/create', { + const res = await api('/notes/create', { text: 'test', poll: { choices: ['foo', 'bar'], @@ -548,15 +442,14 @@ describe('Note', () => { }); test('投票の選択肢が無くて怒られる', async () => { - const res = await api('notes/create', { - // @ts-expect-error poll must not be empty + const res = await api('/notes/create', { poll: {}, }, alice); assert.strictEqual(res.status, 400); }); test('投票の選択肢が無くて怒られる (空の配列)', async () => { - const res = await api('notes/create', { + const res = await api('/notes/create', { poll: { choices: [], }, @@ -565,7 +458,7 @@ describe('Note', () => { }); test('投票の選択肢が1つで怒られる', async () => { - const res = await api('notes/create', { + const res = await api('/notes/create', { poll: { choices: ['Strawberry Pasta'], }, @@ -574,14 +467,14 @@ describe('Note', () => { }); test('投票できる', async () => { - const { body } = await api('notes/create', { + const { body } = await api('/notes/create', { text: 'test', poll: { choices: ['sakura', 'izumi', 'ako'], }, }, alice); - const res = await api('notes/polls/vote', { + const res = await api('/notes/polls/vote', { noteId: body.createdNote.id, choice: 1, }, alice); @@ -590,19 +483,19 @@ describe('Note', () => { }); test('複数投票できない', async () => { - const { body } = await api('notes/create', { + const { body } = await api('/notes/create', { text: 'test', poll: { choices: ['sakura', 'izumi', 'ako'], }, }, alice); - await api('notes/polls/vote', { + await api('/notes/polls/vote', { noteId: body.createdNote.id, choice: 0, }, alice); - const res = await api('notes/polls/vote', { + const res = await api('/notes/polls/vote', { noteId: body.createdNote.id, choice: 2, }, alice); @@ -611,7 +504,7 @@ describe('Note', () => { }); test('許可されている場合は複数投票できる', async () => { - const { body } = await api('notes/create', { + const { body } = await api('/notes/create', { text: 'test', poll: { choices: ['sakura', 'izumi', 'ako'], @@ -619,17 +512,17 @@ describe('Note', () => { }, }, alice); - await api('notes/polls/vote', { + await api('/notes/polls/vote', { noteId: body.createdNote.id, choice: 0, }, alice); - await api('notes/polls/vote', { + await api('/notes/polls/vote', { noteId: body.createdNote.id, choice: 1, }, alice); - const res = await api('notes/polls/vote', { + const res = await api('/notes/polls/vote', { noteId: body.createdNote.id, choice: 2, }, alice); @@ -638,7 +531,7 @@ describe('Note', () => { }); test('締め切られている場合は投票できない', async () => { - const { body } = await api('notes/create', { + const { body } = await api('/notes/create', { text: 'test', poll: { choices: ['sakura', 'izumi', 'ako'], @@ -648,7 +541,7 @@ describe('Note', () => { await new Promise(x => setTimeout(x, 2)); - const res = await api('notes/polls/vote', { + const res = await api('/notes/polls/vote', { noteId: body.createdNote.id, choice: 1, }, alice); @@ -661,13 +554,13 @@ describe('Note', () => { sensitiveWords: [ 'test', ], - }, root); + }, alice); assert.strictEqual(sensitive.status, 204); await new Promise(x => setTimeout(x, 2)); - const note1 = await api('notes/create', { + const note1 = await api('/notes/create', { text: 'hogetesthuge', }, alice); @@ -680,11 +573,11 @@ describe('Note', () => { sensitiveWords: [ '/Test/i', ], - }, root); + }, alice); assert.strictEqual(sensitive.status, 204); - const note2 = await api('notes/create', { + const note2 = await api('/notes/create', { text: 'hogetesthuge', }, alice); @@ -697,253 +590,17 @@ describe('Note', () => { sensitiveWords: [ 'Test hoge', ], - }, root); + }, alice); assert.strictEqual(sensitive.status, 204); - const note2 = await api('notes/create', { + const note2 = await api('/notes/create', { text: 'hogeTesthuge', }, alice); assert.strictEqual(note2.status, 200); assert.strictEqual(note2.body.createdNote.visibility, 'home'); }); - - test('禁止ワードを含む投稿はエラーになる (単語指定)', async () => { - const prohibited = await api('admin/update-meta', { - prohibitedWords: [ - 'test', - ], - }, root); - - assert.strictEqual(prohibited.status, 204); - - await new Promise(x => setTimeout(x, 2)); - - const note1 = await api('notes/create', { - text: 'hogetesthuge', - }, alice); - - assert.strictEqual(note1.status, 400); - assert.strictEqual(castAsError(note1.body).error.code, 'CONTAINS_PROHIBITED_WORDS'); - }); - - test('禁止ワードを含む投稿はエラーになる (正規表現)', async () => { - const prohibited = await api('admin/update-meta', { - prohibitedWords: [ - '/Test/i', - ], - }, root); - - assert.strictEqual(prohibited.status, 204); - - const note2 = await api('notes/create', { - text: 'hogetesthuge', - }, alice); - - assert.strictEqual(note2.status, 400); - assert.strictEqual(castAsError(note2.body).error.code, 'CONTAINS_PROHIBITED_WORDS'); - }); - - test('禁止ワードを含む投稿はエラーになる (スペースアンド)', async () => { - const prohibited = await api('admin/update-meta', { - prohibitedWords: [ - 'Test hoge', - ], - }, root); - - assert.strictEqual(prohibited.status, 204); - - const note2 = await api('notes/create', { - text: 'hogeTesthuge', - }, alice); - - assert.strictEqual(note2.status, 400); - assert.strictEqual(castAsError(note2.body).error.code, 'CONTAINS_PROHIBITED_WORDS'); - }); - - test('禁止ワードを含んでるリモートノートもエラーになる', async () => { - const prohibited = await api('admin/update-meta', { - prohibitedWords: [ - 'test', - ], - }, root); - - assert.strictEqual(prohibited.status, 204); - - await new Promise(x => setTimeout(x, 2)); - - const note1 = await api('notes/create', { - text: 'hogetesthuge', - }, tom); - - assert.strictEqual(note1.status, 400); - }); - - test('メンションの数が上限を超えるとエラーになる', async () => { - const res = await api('admin/roles/create', { - name: 'test', - description: '', - color: null, - iconUrl: null, - displayOrder: 0, - target: 'manual', - condFormula: {}, - isAdministrator: false, - isModerator: false, - isPublic: false, - isExplorable: false, - asBadge: false, - canEditMembersByModerator: false, - policies: { - mentionLimit: { - useDefault: false, - priority: 1, - value: 0, - }, - }, - }, root); - - assert.strictEqual(res.status, 200); - - await new Promise(x => setTimeout(x, 2)); - - const assign = await api('admin/roles/assign', { - userId: alice.id, - roleId: res.body.id, - }, root); - - assert.strictEqual(assign.status, 204); - - await new Promise(x => setTimeout(x, 2)); - - const note = await api('notes/create', { - text: '@bob potentially annoying text', - }, alice); - - assert.strictEqual(note.status, 400); - assert.strictEqual(castAsError(note.body).error.code, 'CONTAINS_TOO_MANY_MENTIONS'); - - await api('admin/roles/unassign', { - userId: alice.id, - roleId: res.body.id, - }, root); - - await api('admin/roles/delete', { - roleId: res.body.id, - }, root); - }); - - test('ダイレクト投稿もエラーになる', async () => { - const res = await api('admin/roles/create', { - name: 'test', - description: '', - color: null, - iconUrl: null, - displayOrder: 0, - target: 'manual', - condFormula: {}, - isAdministrator: false, - isModerator: false, - isPublic: false, - isExplorable: false, - asBadge: false, - canEditMembersByModerator: false, - policies: { - mentionLimit: { - useDefault: false, - priority: 1, - value: 0, - }, - }, - }, root); - - assert.strictEqual(res.status, 200); - - await new Promise(x => setTimeout(x, 2)); - - const assign = await api('admin/roles/assign', { - userId: alice.id, - roleId: res.body.id, - }, root); - - assert.strictEqual(assign.status, 204); - - await new Promise(x => setTimeout(x, 2)); - - const note = await api('notes/create', { - text: 'potentially annoying text', - visibility: 'specified', - visibleUserIds: [bob.id], - }, alice); - - assert.strictEqual(note.status, 400); - assert.strictEqual(castAsError(note.body).error.code, 'CONTAINS_TOO_MANY_MENTIONS'); - - await api('admin/roles/unassign', { - userId: alice.id, - roleId: res.body.id, - }, root); - - await api('admin/roles/delete', { - roleId: res.body.id, - }, root); - }); - - test('ダイレクトの宛先とメンションが同じ場合は重複してカウントしない', async () => { - const res = await api('admin/roles/create', { - name: 'test', - description: '', - color: null, - iconUrl: null, - displayOrder: 0, - target: 'manual', - condFormula: {}, - isAdministrator: false, - isModerator: false, - isPublic: false, - isExplorable: false, - asBadge: false, - canEditMembersByModerator: false, - policies: { - mentionLimit: { - useDefault: false, - priority: 1, - value: 1, - }, - }, - }, root); - - assert.strictEqual(res.status, 200); - - await new Promise(x => setTimeout(x, 2)); - - const assign = await api('admin/roles/assign', { - userId: alice.id, - roleId: res.body.id, - }, root); - - assert.strictEqual(assign.status, 204); - - await new Promise(x => setTimeout(x, 2)); - - const note = await api('notes/create', { - text: '@bob potentially annoying text', - visibility: 'specified', - visibleUserIds: [bob.id], - }, alice); - - assert.strictEqual(note.status, 200); - - await api('admin/roles/unassign', { - userId: alice.id, - roleId: res.body.id, - }, root); - - await api('admin/roles/delete', { - roleId: res.body.id, - }, root); - }); }); describe('notes/delete', () => { @@ -966,7 +623,6 @@ describe('Note', () => { assert.strictEqual(deleteOneRes.status, 204); let mainNote = await Notes.findOneBy({ id: mainNoteRes.body.createdNote.id }); - assert.ok(mainNote); assert.strictEqual(mainNote.repliesCount, 1); const deleteTwoRes = await api('notes/delete', { @@ -975,65 +631,7 @@ describe('Note', () => { assert.strictEqual(deleteTwoRes.status, 204); mainNote = await Notes.findOneBy({ id: mainNoteRes.body.createdNote.id }); - assert.ok(mainNote); assert.strictEqual(mainNote.repliesCount, 0); }); }); - - describe('notes/translate', () => { - describe('翻訳機能の利用が許可されていない場合', () => { - let cannotTranslateRole: misskey.entities.Role; - - beforeAll(async () => { - cannotTranslateRole = await role(root, {}, { canUseTranslator: false }); - await api('admin/roles/assign', { roleId: cannotTranslateRole.id, userId: alice.id }, root); - }); - - test('翻訳機能の利用が許可されていない場合翻訳できない', async () => { - const aliceNote = await post(alice, { text: 'Hello' }); - const res = await api('notes/translate', { - noteId: aliceNote.id, - targetLang: 'ja', - }, alice); - - assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.code, 'UNAVAILABLE'); - }); - - afterAll(async () => { - await api('admin/roles/unassign', { roleId: cannotTranslateRole.id, userId: alice.id }, root); - }); - }); - - test('存在しないノートは翻訳できない', async () => { - const res = await api('notes/translate', { noteId: 'foo', targetLang: 'ja' }, alice); - - assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.code, 'NO_SUCH_NOTE'); - }); - - test('不可視なノートは翻訳できない', async () => { - const aliceNote = await post(alice, { visibility: 'followers', text: 'Hello' }); - const bobTranslateAttempt = await api('notes/translate', { noteId: aliceNote.id, targetLang: 'ja' }, bob); - - assert.strictEqual(bobTranslateAttempt.status, 400); - assert.strictEqual(castAsError(bobTranslateAttempt.body).error.code, 'CANNOT_TRANSLATE_INVISIBLE_NOTE'); - }); - - test('text: null なノートを翻訳すると空のレスポンスが返ってくる', async () => { - const aliceNote = await post(alice, { text: null, poll: { choices: ['kinoko', 'takenoko'] } }); - const res = await api('notes/translate', { noteId: aliceNote.id, targetLang: 'ja' }, alice); - - assert.strictEqual(res.status, 204); - }); - - test('サーバーに DeepL 認証キーが登録されていない場合翻訳できない', async () => { - const aliceNote = await post(alice, { text: 'Hello' }); - const res = await api('notes/translate', { noteId: aliceNote.id, targetLang: 'ja' }, alice); - - // NOTE: デフォルトでは登録されていないので落ちる - assert.strictEqual(res.status, 400); - assert.strictEqual(castAsError(res.body).error.code, 'UNAVAILABLE'); - }); - }); }); diff --git a/packages/backend/test/e2e/oauth.ts b/packages/backend/test/e2e/oauth.ts index ef7a6a579d..3a5e4ebdae 100644 --- a/packages/backend/test/e2e/oauth.ts +++ b/packages/backend/test/e2e/oauth.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -11,18 +11,13 @@ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; -import { - AuthorizationCode, - type AuthorizationTokenConfig, - ClientCredentials, - ModuleOptions, - ResourceOwnerPassword, -} from 'simple-oauth2'; +import { AuthorizationCode, ResourceOwnerPassword, type AuthorizationTokenConfig, ClientCredentials, ModuleOptions } from 'simple-oauth2'; import pkceChallenge from 'pkce-challenge'; import { JSDOM } from 'jsdom'; -import Fastify, { type FastifyInstance, type FastifyReply } from 'fastify'; -import { api, port, sendEnvUpdateRequest, signup } from '../utils.js'; +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}`; @@ -80,7 +75,7 @@ function getMeta(html: string): { transactionId: string | undefined, clientName: }; } -function fetchDecision(transactionId: string, user: misskey.entities.SignupResponse, { cancel }: { cancel?: boolean } = {}): Promise { +function fetchDecision(transactionId: string, user: misskey.entities.MeSignup, { cancel }: { cancel?: boolean } = {}): Promise { return fetch(new URL('/oauth/decision', host), { method: 'post', body: new URLSearchParams({ @@ -95,14 +90,14 @@ function fetchDecision(transactionId: string, user: misskey.entities.SignupRespo }); } -async function fetchDecisionFromResponse(response: Response, user: misskey.entities.SignupResponse, { cancel }: { cancel?: boolean } = {}): Promise { +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.SignupResponse, scope: string, code_challenge: string): Promise<{ client: AuthorizationCode, code: string }> { +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({ @@ -152,14 +147,16 @@ async function assertDirectError(response: Response, status: number, error: stri } describe('OAuth', () => { + let app: INestApplicationContext; let fastify: FastifyInstance; - let alice: misskey.entities.SignupResponse; - let bob: misskey.entities.SignupResponse; + 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' }); @@ -171,7 +168,7 @@ describe('OAuth', () => { }, 1000 * 60 * 2); beforeEach(async () => { - await sendEnvUpdateRequest({ key: 'MISSKEY_TEST_CHECK_IP_RANGE', value: '' }); + process.env.MISSKEY_TEST_CHECK_IP_RANGE = ''; sender = (reply): void => { reply.send(` @@ -183,6 +180,7 @@ describe('OAuth', () => { afterAll(async () => { await fastify.close(); + await app.close(); }); test('Full flow', async () => { @@ -883,7 +881,7 @@ describe('OAuth', () => { }); test('Disallow loopback', async () => { - await sendEnvUpdateRequest({ key: 'MISSKEY_TEST_CHECK_IP_RANGE', value: '1' }); + process.env.MISSKEY_TEST_CHECK_IP_RANGE = '1'; const client = new AuthorizationCode(clientConfig); const response = await fetch(client.authorizeURL({ diff --git a/packages/backend/test/e2e/renote-mute.ts b/packages/backend/test/e2e/renote-mute.ts index 0f636b9ae2..7d57ba17b6 100644 --- a/packages/backend/test/e2e/renote-mute.ts +++ b/packages/backend/test/e2e/renote-mute.ts @@ -1,29 +1,36 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; -import { setTimeout } from 'node:timers/promises'; -import { api, post, signup, waitFire } from '../utils.js'; +import { signup, api, post, react, startServer, waitFire, sleep } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; describe('Renote Mute', () => { + let app: INestApplicationContext; + // alice mutes carol - let alice: misskey.entities.SignupResponse; - let bob: misskey.entities.SignupResponse; - let carol: misskey.entities.SignupResponse; + let alice: misskey.entities.MeSignup; + let bob: misskey.entities.MeSignup; + let carol: misskey.entities.MeSignup; beforeAll(async () => { + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); carol = await signup({ username: 'carol' }); }, 1000 * 60 * 2); + afterAll(async () => { + await app.close(); + }); + test('ミュート作成', async () => { - const res = await api('renote-mute/create', { + const res = await api('/renote-mute/create', { userId: carol.id, }, alice); @@ -36,15 +43,15 @@ describe('Renote Mute', () => { const carolNote = await post(carol, { text: 'hi' }); // redisに追加されるのを待つ - await setTimeout(100); + await sleep(100); - const res = await api('notes/local-timeline', {}, alice); + const res = await api('/notes/local-timeline', {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolRenote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolRenote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true); }); test('タイムラインにリノートミュートしているユーザーの引用が含まれる', async () => { @@ -53,31 +60,15 @@ describe('Renote Mute', () => { const carolNote = await post(carol, { text: 'hi' }); // redisに追加されるのを待つ - await setTimeout(100); + await sleep(100); - const res = await api('notes/local-timeline', {}, alice); + const res = await api('/notes/local-timeline', {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolRenote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), true); - }); - - // #12956 - test('タイムラインにリノートミュートしているユーザーの通常ノートのリノートが含まれる', async () => { - const carolNote = await post(carol, { text: 'hi' }); - const bobRenote = await post(bob, { renoteId: carolNote.id }); - - // redisに追加されるのを待つ - await setTimeout(100); - - const res = await api('notes/local-timeline', {}, alice); - - assert.strictEqual(res.status, 200); - assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), true); - assert.strictEqual(res.body.some(note => note.id === bobRenote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolRenote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true); }); test('ストリームにリノートミュートしているユーザーのリノートが流れない', async () => { @@ -103,17 +94,4 @@ describe('Renote Mute', () => { assert.strictEqual(fired, true); }); - - // #12956 - test('ストリームにリノートミュートしているユーザーの通常ノートのリノートが流れてくる', async () => { - const carolbNote = await post(carol, { text: 'hi' }); - - const fired = await waitFire( - alice, 'localTimeline', - () => api('notes/create', { renoteId: carolbNote.id }, bob), - msg => msg.type === 'note' && msg.body.userId === bob.id, - ); - - assert.strictEqual(fired, true); - }); }); diff --git a/packages/backend/test/e2e/reversi-game.ts b/packages/backend/test/e2e/reversi-game.ts deleted file mode 100644 index 788255beac..0000000000 --- a/packages/backend/test/e2e/reversi-game.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -process.env.NODE_ENV = 'test'; - -import * as assert from 'assert'; -import { ReversiMatchResponse } from 'misskey-js/entities.js'; -import { api, signup } from '../utils.js'; -import type * as misskey from 'misskey-js'; - -describe('ReversiGame', () => { - let alice: misskey.entities.SignupResponse; - let bob: misskey.entities.SignupResponse; - - beforeAll(async () => { - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - }, 1000 * 60 * 2); - - test('matches when alice invites bob and bob accepts', async () => { - const response1 = await api('reversi/match', { userId: bob.id }, alice); - assert.strictEqual(response1.status, 204); - assert.strictEqual(response1.body, null); - const response2 = await api('reversi/match', { userId: alice.id }, bob); - assert.strictEqual(response2.status, 200); - assert.notStrictEqual(response2.body, null); - const body = response2.body as ReversiMatchResponse; - assert.strictEqual(body.user1.id, alice.id); - assert.strictEqual(body.user2.id, bob.id); - }); -}); diff --git a/packages/backend/test/e2e/streaming.ts b/packages/backend/test/e2e/streaming.ts index 72f26a38e0..288c54bdbc 100644 --- a/packages/backend/test/e2e/streaming.ts +++ b/packages/backend/test/e2e/streaming.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,10 +8,12 @@ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; import { WebSocket } from 'ws'; import { MiFollowing } from '@/models/Following.js'; -import { api, createAppToken, initTestDb, port, post, signup, waitFire } from '../utils.js'; +import { signup, api, post, startServer, initTestDb, waitFire, createAppToken, port } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; describe('Streaming', () => { + let app: INestApplicationContext; let Followings: any; const follow = async (follower: any, followee: any) => { @@ -30,23 +32,23 @@ describe('Streaming', () => { describe('Streaming', () => { // Local users - let ayano: misskey.entities.SignupResponse; - let kyoko: misskey.entities.SignupResponse; - let chitose: misskey.entities.SignupResponse; - let kanako: misskey.entities.SignupResponse; - let erin: misskey.entities.SignupResponse; + let ayano: misskey.entities.MeSignup; + let kyoko: misskey.entities.MeSignup; + let chitose: misskey.entities.MeSignup; + let kanako: misskey.entities.MeSignup; // Remote users - let akari: misskey.entities.SignupResponse; - let chinatsu: misskey.entities.SignupResponse; - let takumi: misskey.entities.SignupResponse; + let akari: misskey.entities.MeSignup; + let chinatsu: misskey.entities.MeSignup; + let takumi: misskey.entities.MeSignup; - let kyokoNote: misskey.entities.Note; - let kanakoNote: misskey.entities.Note; - let takumiNote: misskey.entities.Note; + let kyokoNote: any; + let kanakoNote: any; + let takumiNote: any; let list: any; beforeAll(async () => { + app = await startServer(); const connection = await initTestDb(true); Followings = connection.getRepository(MiFollowing); @@ -54,7 +56,6 @@ describe('Streaming', () => { kyoko = await signup({ username: 'kyoko' }); chitose = await signup({ username: 'chitose' }); kanako = await signup({ username: 'kanako' }); - erin = await signup({ username: 'erin' }); // erin: A generic fifth participant akari = await signup({ username: 'akari', host: 'example.com' }); chinatsu = await signup({ username: 'chinatsu', host: 'example.com' }); @@ -65,20 +66,11 @@ describe('Streaming', () => { takumiNote = await post(takumi, { text: 'piyo' }); // Follow: ayano => kyoko - await api('following/create', { userId: kyoko.id, withReplies: false }, ayano); + await api('following/create', { userId: kyoko.id }, ayano); // Follow: ayano => akari await follow(ayano, akari); - // Follow: kyoko => chitose - await api('following/create', { userId: chitose.id }, kyoko); - - // Follow: erin <=> ayano each other. - // erin => ayano: withReplies: true - await api('following/create', { userId: ayano.id, withReplies: true }, erin); - // ayano => erin: withReplies: false - await api('following/create', { userId: erin.id, withReplies: false }, ayano); - // Mute: chitose => kanako await api('mute/create', { userId: kanako.id }, chitose); @@ -103,6 +95,10 @@ describe('Streaming', () => { }, chitose); }, 1000 * 60 * 2); + afterAll(async () => { + await app.close(); + }); + describe('Events', () => { test('mention event', async () => { const fired = await waitFire( @@ -166,41 +162,22 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); + /* なんか失敗する test('フォローしているユーザーの visibility: followers な投稿への返信が流れる', async () => { - const note = await post(kyoko, { text: 'foo', visibility: 'followers' }); + const note = await api('notes/create', { text: 'foo', visibility: 'followers' }, kyoko); const fired = await waitFire( ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'bar', visibility: 'followers', replyId: note.id }, kyoko), // kyoko posts + () => api('notes/create', { text: 'bar', visibility: 'followers', replyId: note.body.id }, kyoko), // kyoko posts msg => msg.type === 'note' && msg.body.userId === kyoko.id && msg.body.reply.text === 'foo', ); assert.strictEqual(fired, true); }); + */ test('フォローしているユーザーのフォローしていないユーザーの visibility: followers な投稿への返信が流れない', async () => { - const chitoseNote = await post(chitose, { text: 'followers-only post', visibility: 'followers' }); - - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'reply to chitose\'s followers-only post', replyId: chitoseNote.id }, kyoko), // kyoko's reply to chitose's followers-only post - msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko - ); - - assert.strictEqual(fired, false); - }); - - test('フォローしているユーザーのフォローしていないユーザーの visibility: followers な投稿への返信のリノートが流れない', async () => { - const chitoseNote = await post(chitose, { text: 'followers-only post', visibility: 'followers' }); - const kyokoReply = await post(kyoko, { text: 'reply to followers-only post', replyId: chitoseNote.id }); - - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { renoteId: kyokoReply.id }, kyoko), // kyoko's renote of kyoko's reply to chitose's followers-only post - msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko - ); - - assert.strictEqual(fired, false); + // TODO }); test('フォローしていないユーザーの投稿は流れない', async () => { @@ -232,101 +209,6 @@ describe('Streaming', () => { assert.strictEqual(fired, false); }); - - /** - * TODO: 落ちる - * @see https://github.com/misskey-dev/misskey/issues/13474 - test('visibility: specified なノートで visibleUserIds に自分が含まれているときそのノートへのリプライが流れてくる', async () => { - const chitoseToKyokoAndAyano = await post(chitose, { text: 'direct note from chitose to kyoko and ayano', visibility: 'specified', visibleUserIds: [kyoko.id, ayano.id] }); - - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'direct reply from kyoko to chitose and ayano', replyId: chitoseToKyokoAndAyano.id, visibility: 'specified', visibleUserIds: [chitose.id, ayano.id] }, kyoko), - msg => msg.type === 'note' && msg.body.userId === kyoko.id, - ); - - assert.strictEqual(fired, true); - }); - */ - - test('visibility: specified な投稿に対するリプライで visibleUserIds が拡張されたとき、その拡張されたユーザーの HTL にはそのリプライが流れない', async () => { - const chitoseToKyoko = await post(chitose, { text: 'direct note from chitose to kyoko', visibility: 'specified', visibleUserIds: [kyoko.id] }); - - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'direct reply from kyoko to chitose and ayano', replyId: chitoseToKyoko.id, visibility: 'specified', visibleUserIds: [chitose.id, ayano.id] }, kyoko), - msg => msg.type === 'note' && msg.body.userId === kyoko.id, - ); - - assert.strictEqual(fired, false); - }); - - test('visibility: specified な投稿に対するリプライで visibleUserIds が収縮されたとき、その収縮されたユーザーの HTL にはそのリプライが流れない', async () => { - const chitoseToKyokoAndAyano = await post(chitose, { text: 'direct note from chitose to kyoko and ayano', visibility: 'specified', visibleUserIds: [kyoko.id, ayano.id] }); - - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'direct reply from kyoko to chitose', replyId: chitoseToKyokoAndAyano.id, visibility: 'specified', visibleUserIds: [chitose.id] }, kyoko), - msg => msg.type === 'note' && msg.body.userId === kyoko.id, - ); - - assert.strictEqual(fired, false); - }); - - test('withRenotes: false のときリノートが流れない', async () => { - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { renoteId: kyokoNote.id }, kyoko), // kyoko renote - msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko - { withRenotes: false }, - ); - - assert.strictEqual(fired, false); - }); - - test('withRenotes: false のとき引用リノートが流れる', async () => { - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'quote', renoteId: kyokoNote.id }, kyoko), // kyoko quote - msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko - { withRenotes: false }, - ); - - assert.strictEqual(fired, true); - }); - - test('withRenotes: false のとき投票のみのリノートが流れる', async () => { - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { poll: { choices: ['kinoko', 'takenoko'] }, renoteId: kyokoNote.id }, kyoko), // kyoko renote with poll - msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko - { withRenotes: false }, - ); - - assert.strictEqual(fired, true); - }); - - test('withReplies: true のとき自分のfollowers投稿に対するリプライが流れる', async () => { - const erinNote = await post(erin, { text: 'hi', visibility: 'followers' }); - const fired = await waitFire( - erin, 'homeTimeline', // erin:home - () => api('notes/create', { text: 'hello', replyId: erinNote.id }, ayano), // ayano reply to erin's followers post - msg => msg.type === 'note' && msg.body.userId === ayano.id, // wait ayano - ); - - assert.strictEqual(fired, true); - }); - - test('withReplies: false でも自分の投稿に対するリプライが流れる', async () => { - const ayanoNote = await post(ayano, { text: 'hi', visibility: 'followers' }); - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'hello', replyId: ayanoNote.id }, erin), // erin reply to ayano's followers post - msg => msg.type === 'note' && msg.body.userId === erin.id, // wait erin - ); - - assert.strictEqual(fired, true); - }); }); // Home describe('Local Timeline', () => { @@ -505,38 +387,6 @@ describe('Streaming', () => { assert.strictEqual(fired, false); }); - - test('withReplies: true のとき自分のfollowers投稿に対するリプライが流れる', async () => { - const erinNote = await post(erin, { text: 'hi', visibility: 'followers' }); - const fired = await waitFire( - erin, 'homeTimeline', // erin:home - () => api('notes/create', { text: 'hello', replyId: erinNote.id }, ayano), // ayano reply to erin's followers post - msg => msg.type === 'note' && msg.body.userId === ayano.id, // wait ayano - ); - - assert.strictEqual(fired, true); - }); - - test('withReplies: false でも自分の投稿に対するリプライが流れる', async () => { - const ayanoNote = await post(ayano, { text: 'hi', visibility: 'followers' }); - const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'hello', replyId: ayanoNote.id }, erin), // erin reply to ayano's followers post - msg => msg.type === 'note' && msg.body.userId === erin.id, // wait erin - ); - - assert.strictEqual(fired, true); - }); - - test('withReplies: true のフォローしていない人のfollowersノートに対するリプライが流れない', async () => { - const fired = await waitFire( - erin, 'homeTimeline', // erin:home - () => api('notes/create', { text: 'hello', replyId: chitose.id }, ayano), // ayano reply to chitose's post - msg => msg.type === 'note' && msg.body.userId === ayano.id, // wait ayano - ); - - assert.strictEqual(fired, false); - }); }); describe('Global Timeline', () => { @@ -571,16 +421,6 @@ describe('Streaming', () => { assert.strictEqual(fired, false); }); - - test('withReplies = falseでフォローしてる人によるリプライが流れてくる', async () => { - const fired = await waitFire( - ayano, 'globalTimeline', // ayano:Global - () => api('notes/create', { text: 'foo', replyId: kanakoNote.id }, kyoko), // kyoko posts - msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko - ); - - assert.strictEqual(fired, true); - }); }); describe('UserList Timeline', () => { @@ -671,7 +511,7 @@ describe('Streaming', () => { // #10443 test('ミュートしているサーバのノートがリストTLに流れない', async () => { - await api('i/update', { + await api('/i/update', { mutedInstances: ['example.com'], }, chitose); @@ -688,7 +528,7 @@ describe('Streaming', () => { // #10443 test('ミュートしているサーバのノートに対するリプライがリストTLに流れない', async () => { - await api('i/update', { + await api('/i/update', { mutedInstances: ['example.com'], }, chitose); @@ -705,7 +545,7 @@ describe('Streaming', () => { // #10443 test('ミュートしているサーバのノートに対するリノートがリストTLに流れない', async () => { - await api('i/update', { + await api('/i/update', { mutedInstances: ['example.com'], }, chitose); diff --git a/packages/backend/test/e2e/synalio/abuse-report.ts b/packages/backend/test/e2e/synalio/abuse-report.ts deleted file mode 100644 index c98d199f35..0000000000 --- a/packages/backend/test/e2e/synalio/abuse-report.ts +++ /dev/null @@ -1,354 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { entities } from 'misskey-js'; -import { beforeEach, describe, test } from '@jest/globals'; -import { - api, - captureWebhook, - randomString, - role, - signup, - startJobQueue, - UserToken, - WEBHOOK_HOST, -} from '../../utils.js'; -import type { INestApplicationContext } from '@nestjs/common'; - -describe('[シナリオ] ユーザ通報', () => { - let queue: INestApplicationContext; - let admin: entities.SignupResponse; - let alice: entities.SignupResponse; - let bob: entities.SignupResponse; - - async function createSystemWebhook(args?: Partial, credential?: UserToken): Promise { - const res = await api( - 'admin/system-webhook/create', - { - isActive: true, - name: randomString(), - on: ['abuseReport'], - url: WEBHOOK_HOST, - secret: randomString(), - ...args, - }, - credential ?? admin, - ); - return res.body; - } - - async function createAbuseReportNotificationRecipient(args?: Partial, credential?: UserToken): Promise { - const res = await api( - 'admin/abuse-report/notification-recipient/create', - { - isActive: true, - name: randomString(), - method: 'webhook', - ...args, - }, - credential ?? admin, - ); - return res.body; - } - - async function createAbuseReport(args?: Partial, credential?: UserToken): Promise { - const res = await api( - 'users/report-abuse', - { - userId: alice.id, - comment: randomString(), - ...args, - }, - credential ?? admin, - ); - return res.body; - } - - async function resolveAbuseReport(args?: Partial, credential?: UserToken): Promise { - const res = await api( - 'admin/resolve-abuse-user-report', - { - reportId: admin.id, - ...args, - }, - credential ?? admin, - ); - return res.body; - } - - // ------------------------------------------------------------------------------------------- - - beforeAll(async () => { - queue = await startJobQueue(); - admin = await signup({ username: 'admin' }); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - - await role(admin, { isAdministrator: true }); - }, 1000 * 60 * 2); - - afterAll(async () => { - await queue.close(); - }); - - // ------------------------------------------------------------------------------------------- - - describe('SystemWebhook', () => { - beforeEach(async () => { - const webhooks = await api('admin/system-webhook/list', {}, admin); - for (const webhook of webhooks.body) { - await api('admin/system-webhook/delete', { id: webhook.id }, admin); - } - }); - - test('通報を受けた -> abuseReportが送出される', async () => { - const webhook = await createSystemWebhook({ - on: ['abuseReport'], - isActive: true, - }); - await createAbuseReportNotificationRecipient({ systemWebhookId: webhook.id }); - - // 通報(bob -> alice) - const abuse = { - userId: alice.id, - comment: randomString(), - }; - const webhookBody = await captureWebhook(async () => { - await createAbuseReport(abuse, bob); - }); - - console.log(JSON.stringify(webhookBody, null, 2)); - - expect(webhookBody.hookId).toBe(webhook.id); - expect(webhookBody.type).toBe('abuseReport'); - expect(webhookBody.body.targetUserId).toBe(alice.id); - expect(webhookBody.body.reporterId).toBe(bob.id); - expect(webhookBody.body.comment).toBe(abuse.comment); - }); - - test('通報を受けた -> abuseReportが送出される -> 解決 -> abuseReportResolvedが送出される', async () => { - const webhook = await createSystemWebhook({ - on: ['abuseReport', 'abuseReportResolved'], - isActive: true, - }); - await createAbuseReportNotificationRecipient({ systemWebhookId: webhook.id }); - - // 通報(bob -> alice) - const abuse = { - userId: alice.id, - comment: randomString(), - }; - const webhookBody1 = await captureWebhook(async () => { - await createAbuseReport(abuse, bob); - }); - - console.log(JSON.stringify(webhookBody1, null, 2)); - expect(webhookBody1.hookId).toBe(webhook.id); - expect(webhookBody1.type).toBe('abuseReport'); - expect(webhookBody1.body.targetUserId).toBe(alice.id); - expect(webhookBody1.body.reporterId).toBe(bob.id); - expect(webhookBody1.body.assigneeId).toBeNull(); - expect(webhookBody1.body.resolved).toBe(false); - expect(webhookBody1.body.comment).toBe(abuse.comment); - - // 解決 - const webhookBody2 = await captureWebhook(async () => { - await resolveAbuseReport({ - reportId: webhookBody1.body.id, - }, admin); - }); - - console.log(JSON.stringify(webhookBody2, null, 2)); - expect(webhookBody2.hookId).toBe(webhook.id); - expect(webhookBody2.type).toBe('abuseReportResolved'); - expect(webhookBody2.body.targetUserId).toBe(alice.id); - expect(webhookBody2.body.reporterId).toBe(bob.id); - expect(webhookBody2.body.assigneeId).toBe(admin.id); - expect(webhookBody2.body.resolved).toBe(true); - expect(webhookBody2.body.comment).toBe(abuse.comment); - }); - - test('通報を受けた -> abuseReportが未許可の場合は送出されない', async () => { - const webhook = await createSystemWebhook({ - on: [], - isActive: true, - }); - await createAbuseReportNotificationRecipient({ systemWebhookId: webhook.id }); - - // 通報(bob -> alice) - const abuse = { - userId: alice.id, - comment: randomString(), - }; - const webhookBody = await captureWebhook(async () => { - await createAbuseReport(abuse, bob); - }).catch(e => e.message); - - expect(webhookBody).toBe('timeout'); - }); - - test('通報を受けた -> abuseReportが未許可の場合は送出されない -> 解決 -> abuseReportResolvedが送出される', async () => { - const webhook = await createSystemWebhook({ - on: ['abuseReportResolved'], - isActive: true, - }); - await createAbuseReportNotificationRecipient({ systemWebhookId: webhook.id }); - - // 通報(bob -> alice) - const abuse = { - userId: alice.id, - comment: randomString(), - }; - const webhookBody1 = await captureWebhook(async () => { - await createAbuseReport(abuse, bob); - }).catch(e => e.message); - - expect(webhookBody1).toBe('timeout'); - - const abuseReportId = (await api('admin/abuse-user-reports', {}, admin)).body[0].id; - - // 解決 - const webhookBody2 = await captureWebhook(async () => { - await resolveAbuseReport({ - reportId: abuseReportId, - }, admin); - }); - - console.log(JSON.stringify(webhookBody2, null, 2)); - expect(webhookBody2.hookId).toBe(webhook.id); - expect(webhookBody2.type).toBe('abuseReportResolved'); - expect(webhookBody2.body.targetUserId).toBe(alice.id); - expect(webhookBody2.body.reporterId).toBe(bob.id); - expect(webhookBody2.body.assigneeId).toBe(admin.id); - expect(webhookBody2.body.resolved).toBe(true); - expect(webhookBody2.body.comment).toBe(abuse.comment); - }); - - test('通報を受けた -> abuseReportが送出される -> 解決 -> abuseReportResolvedが未許可の場合は送出されない', async () => { - const webhook = await createSystemWebhook({ - on: ['abuseReport'], - isActive: true, - }); - await createAbuseReportNotificationRecipient({ systemWebhookId: webhook.id }); - - // 通報(bob -> alice) - const abuse = { - userId: alice.id, - comment: randomString(), - }; - const webhookBody1 = await captureWebhook(async () => { - await createAbuseReport(abuse, bob); - }); - - console.log(JSON.stringify(webhookBody1, null, 2)); - expect(webhookBody1.hookId).toBe(webhook.id); - expect(webhookBody1.type).toBe('abuseReport'); - expect(webhookBody1.body.targetUserId).toBe(alice.id); - expect(webhookBody1.body.reporterId).toBe(bob.id); - expect(webhookBody1.body.assigneeId).toBeNull(); - expect(webhookBody1.body.resolved).toBe(false); - expect(webhookBody1.body.comment).toBe(abuse.comment); - - // 解決 - const webhookBody2 = await captureWebhook(async () => { - await resolveAbuseReport({ - reportId: webhookBody1.body.id, - }, admin); - }).catch(e => e.message); - - expect(webhookBody2).toBe('timeout'); - }); - - test('通報を受けた -> abuseReportが未許可の場合は送出されない -> 解決 -> abuseReportResolvedが未許可の場合は送出されない', async () => { - const webhook = await createSystemWebhook({ - on: [], - isActive: true, - }); - await createAbuseReportNotificationRecipient({ systemWebhookId: webhook.id }); - - // 通報(bob -> alice) - const abuse = { - userId: alice.id, - comment: randomString(), - }; - const webhookBody1 = await captureWebhook(async () => { - await createAbuseReport(abuse, bob); - }).catch(e => e.message); - - expect(webhookBody1).toBe('timeout'); - - const abuseReportId = (await api('admin/abuse-user-reports', {}, admin)).body[0].id; - - // 解決 - const webhookBody2 = await captureWebhook(async () => { - await resolveAbuseReport({ - reportId: abuseReportId, - }, admin); - }).catch(e => e.message); - - expect(webhookBody2).toBe('timeout'); - }); - - test('通報を受けた -> Webhookが無効の場合は送出されない', async () => { - const webhook = await createSystemWebhook({ - on: ['abuseReport', 'abuseReportResolved'], - isActive: false, - }); - await createAbuseReportNotificationRecipient({ systemWebhookId: webhook.id }); - - // 通報(bob -> alice) - const abuse = { - userId: alice.id, - comment: randomString(), - }; - const webhookBody1 = await captureWebhook(async () => { - await createAbuseReport(abuse, bob); - }).catch(e => e.message); - - expect(webhookBody1).toBe('timeout'); - - const abuseReportId = (await api('admin/abuse-user-reports', {}, admin)).body[0].id; - - // 解決 - const webhookBody2 = await captureWebhook(async () => { - await resolveAbuseReport({ - reportId: abuseReportId, - }, admin); - }).catch(e => e.message); - - expect(webhookBody2).toBe('timeout'); - }); - - test('通報を受けた -> 通知設定が無効の場合は送出されない', async () => { - const webhook = await createSystemWebhook({ - on: ['abuseReport', 'abuseReportResolved'], - isActive: true, - }); - await createAbuseReportNotificationRecipient({ systemWebhookId: webhook.id, isActive: false }); - - // 通報(bob -> alice) - const abuse = { - userId: alice.id, - comment: randomString(), - }; - const webhookBody1 = await captureWebhook(async () => { - await createAbuseReport(abuse, bob); - }).catch(e => e.message); - - expect(webhookBody1).toBe('timeout'); - - const abuseReportId = (await api('admin/abuse-user-reports', {}, admin)).body[0].id; - - // 解決 - const webhookBody2 = await captureWebhook(async () => { - await resolveAbuseReport({ - reportId: abuseReportId, - }, admin); - }).catch(e => e.message); - - expect(webhookBody2).toBe('timeout'); - }); - }); -}); diff --git a/packages/backend/test/e2e/synalio/user-create.ts b/packages/backend/test/e2e/synalio/user-create.ts deleted file mode 100644 index cb0f68dfea..0000000000 --- a/packages/backend/test/e2e/synalio/user-create.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { setTimeout } from 'node:timers/promises'; -import { entities } from 'misskey-js'; -import { beforeEach, describe, test } from '@jest/globals'; -import { - api, - captureWebhook, - randomString, - role, - signup, - startJobQueue, - UserToken, - WEBHOOK_HOST, -} from '../../utils.js'; -import type { INestApplicationContext } from '@nestjs/common'; - -describe('[シナリオ] ユーザ作成', () => { - let queue: INestApplicationContext; - let admin: entities.SignupResponse; - - async function createSystemWebhook(args?: Partial, credential?: UserToken): Promise { - const res = await api( - 'admin/system-webhook/create', - { - isActive: true, - name: randomString(), - on: ['userCreated'], - url: WEBHOOK_HOST, - secret: randomString(), - ...args, - }, - credential ?? admin, - ); - return res.body; - } - - // ------------------------------------------------------------------------------------------- - - beforeAll(async () => { - queue = await startJobQueue(); - admin = await signup({ username: 'admin' }); - - await role(admin, { isAdministrator: true }); - }, 1000 * 60 * 2); - - afterAll(async () => { - await queue.close(); - }); - - // ------------------------------------------------------------------------------------------- - - describe('SystemWebhook', () => { - beforeEach(async () => { - const webhooks = await api('admin/system-webhook/list', {}, admin); - for (const webhook of webhooks.body) { - await api('admin/system-webhook/delete', { id: webhook.id }, admin); - } - }); - - test('ユーザが作成された -> userCreatedが送出される', async () => { - const webhook = await createSystemWebhook({ - on: ['userCreated'], - isActive: true, - }); - - let alice: any = null; - const webhookBody = await captureWebhook(async () => { - alice = await signup({ username: 'alice' }); - }); - - // webhookの送出後にいろいろやってるのでちょっと待つ必要がある - await setTimeout(2000); - - console.log(alice); - console.log(JSON.stringify(webhookBody, null, 2)); - - expect(webhookBody.hookId).toBe(webhook.id); - expect(webhookBody.type).toBe('userCreated'); - - const body = webhookBody.body as entities.UserLite; - expect(alice.id).toBe(body.id); - expect(alice.name).toBe(body.name); - expect(alice.username).toBe(body.username); - expect(alice.host).toBe(body.host); - expect(alice.avatarUrl).toBe(body.avatarUrl); - expect(alice.avatarBlurhash).toBe(body.avatarBlurhash); - expect(alice.avatarDecorations).toEqual(body.avatarDecorations); - expect(alice.isBot).toBe(body.isBot); - expect(alice.isCat).toBe(body.isCat); - expect(alice.instance).toEqual(body.instance); - expect(alice.emojis).toEqual(body.emojis); - expect(alice.onlineStatus).toBe(body.onlineStatus); - expect(alice.badgeRoles).toEqual(body.badgeRoles); - }); - - test('ユーザ作成 -> userCreatedが未許可の場合は送出されない', async () => { - await createSystemWebhook({ - on: [], - isActive: true, - }); - - let alice: any = null; - const webhookBody = await captureWebhook(async () => { - alice = await signup({ username: 'alice' }); - }).catch(e => e.message); - - expect(webhookBody).toBe('timeout'); - expect(alice.id).not.toBeNull(); - }); - - test('ユーザ作成 -> Webhookが無効の場合は送出されない', async () => { - await createSystemWebhook({ - on: ['userCreated'], - isActive: false, - }); - - let alice: any = null; - const webhookBody = await captureWebhook(async () => { - alice = await signup({ username: 'alice' }); - }).catch(e => e.message); - - expect(webhookBody).toBe('timeout'); - expect(alice.id).not.toBeNull(); - }); - }); -}); diff --git a/packages/backend/test/e2e/thread-mute.ts b/packages/backend/test/e2e/thread-mute.ts index 1ac99df884..0e487976dc 100644 --- a/packages/backend/test/e2e/thread-mute.ts +++ b/packages/backend/test/e2e/thread-mute.ts @@ -1,54 +1,62 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; -import { api, connectStream, post, signup } from '../utils.js'; +import { signup, api, post, connectStream, startServer } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; describe('Note thread mute', () => { - let alice: misskey.entities.SignupResponse; - let bob: misskey.entities.SignupResponse; - let carol: misskey.entities.SignupResponse; + let app: INestApplicationContext; + + let alice: misskey.entities.MeSignup; + let bob: misskey.entities.MeSignup; + let carol: misskey.entities.MeSignup; beforeAll(async () => { + app = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); carol = await signup({ username: 'carol' }); }, 1000 * 60 * 2); + afterAll(async () => { + await app.close(); + }); + test('notes/mentions にミュートしているスレッドの投稿が含まれない', async () => { const bobNote = await post(bob, { text: '@alice @carol root note' }); const aliceReply = await post(alice, { replyId: bobNote.id, text: '@bob @carol child note' }); - await api('notes/thread-muting/create', { noteId: bobNote.id }, alice); + await api('/notes/thread-muting/create', { noteId: bobNote.id }, alice); const carolReply = await post(carol, { replyId: bobNote.id, text: '@bob @alice child note' }); const carolReplyWithoutMention = await post(carol, { replyId: aliceReply.id, text: 'child note' }); - const res = await api('notes/mentions', {}, alice); + const res = await api('/notes/mentions', {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolReply.id), false); - assert.strictEqual(res.body.some(note => note.id === carolReplyWithoutMention.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolReply.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolReplyWithoutMention.id), false); }); test('ミュートしているスレッドからメンションされても、hasUnreadMentions が true にならない', async () => { // 状態リセット - await api('i/read-all-unread-notes', {}, alice); + await api('/i/read-all-unread-notes', {}, alice); const bobNote = await post(bob, { text: '@alice @carol root note' }); - await api('notes/thread-muting/create', { noteId: bobNote.id }, alice); + await api('/notes/thread-muting/create', { noteId: bobNote.id }, alice); const carolReply = await post(carol, { replyId: bobNote.id, text: '@bob @alice child note' }); - const res = await api('i', {}, alice); + const res = await api('/i', {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(res.body.hasUnreadMentions, false); @@ -56,11 +64,11 @@ describe('Note thread mute', () => { test('ミュートしているスレッドからメンションされても、ストリームに unreadMention イベントが流れてこない', () => new Promise(async done => { // 状態リセット - await api('i/read-all-unread-notes', {}, alice); + await api('/i/read-all-unread-notes', {}, alice); const bobNote = await post(bob, { text: '@alice @carol root note' }); - await api('notes/thread-muting/create', { noteId: bobNote.id }, alice); + await api('/notes/thread-muting/create', { noteId: bobNote.id }, alice); let fired = false; @@ -84,17 +92,17 @@ describe('Note thread mute', () => { const bobNote = await post(bob, { text: '@alice @carol root note' }); const aliceReply = await post(alice, { replyId: bobNote.id, text: '@bob @carol child note' }); - await api('notes/thread-muting/create', { noteId: bobNote.id }, alice); + await api('/notes/thread-muting/create', { noteId: bobNote.id }, alice); const carolReply = await post(carol, { replyId: bobNote.id, text: '@bob @alice child note' }); const carolReplyWithoutMention = await post(carol, { replyId: aliceReply.id, text: 'child note' }); - const res = await api('i/notifications', {}, alice); + const res = await api('/i/notifications', {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some(notification => 'note' in notification && notification.note.id === carolReply.id), false); - assert.strictEqual(res.body.some(notification => 'note' in notification && notification.note.id === carolReplyWithoutMention.id), false); + assert.strictEqual(res.body.some((notification: any) => notification.note.id === carolReply.id), false); + assert.strictEqual(res.body.some((notification: any) => notification.note.id === carolReplyWithoutMention.id), false); // NOTE: bobの投稿はスレッドミュート前に行われたため通知に含まれていてもよい }); diff --git a/packages/backend/test/e2e/timelines.ts b/packages/backend/test/e2e/timelines.ts index d12be2a9ac..cb9558b416 100644 --- a/packages/backend/test/e2e/timelines.ts +++ b/packages/backend/test/e2e/timelines.ts @@ -1,32 +1,37 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ // How to run: // pnpm jest -- e2e/timelines.ts +process.env.NODE_ENV = 'test'; +process.env.FORCE_FOLLOW_REMOTE_USER_FOR_TESTING = 'true'; + import * as assert from 'assert'; -import { setTimeout } from 'node:timers/promises'; -import { Redis } from 'ioredis'; -import { api, post, randomString, sendEnvUpdateRequest, signup, uploadUrl } from '../utils.js'; -import { loadConfig } from '@/config.js'; +import { api, post, randomString, signup, sleep, startServer, uploadUrl } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; function genHost() { return randomString() + '.example.com'; } function waitForPushToTl() { - return setTimeout(500); + return sleep(500); } -let redisForTimelines: Redis; +let app: INestApplicationContext; + +beforeAll(async () => { + app = await startServer(); +}, 1000 * 60 * 2); + +afterAll(async () => { + await app.close(); +}); describe('Timelines', () => { - beforeAll(() => { - redisForTimelines = new Redis(loadConfig().redisForTimelines); - }); - describe('Home TL', () => { test.concurrent('自分の visibility: followers なノートが含まれる', async () => { const [alice] = await Promise.all([signup()]); @@ -35,199 +40,180 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.find(note => note.id === aliceNote.id)?.text, 'hi'); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.find((note: any) => note.id === aliceNote.id).text, 'hi'); }); test.concurrent('フォローしているユーザーのノートが含まれる', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi' }); const carolNote = await post(carol, { text: 'hi' }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('フォローしているユーザーの visibility: followers なノートが含まれる', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'followers' }); const carolNote = await post(carol, { text: 'hi' }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.find(note => note.id === bobNote.id)?.text, 'hi'); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.find((note: any) => note.id === bobNote.id).text, 'hi'); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('withReplies: false でフォローしているユーザーの他人への返信が含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', replyId: carolNote.id }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('withReplies: true でフォローしているユーザーの他人への返信が含まれる', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await api('following/update', { userId: bob.id, withReplies: true }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await api('/following/update', { userId: bob.id, withReplies: true }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', replyId: carolNote.id }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('withReplies: true でフォローしているユーザーの他人へのDM返信が含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await api('following/update', { userId: bob.id, withReplies: true }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await api('/following/update', { userId: bob.id, withReplies: true }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', replyId: carolNote.id, visibility: 'specified', visibleUserIds: [carolNote.id] }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('withReplies: true でフォローしているユーザーの他人の visibility: followers な投稿への返信が含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: carol.id }, bob); - await api('following/create', { userId: bob.id }, alice); - await api('following/update', { userId: bob.id, withReplies: true }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await api('/following/update', { userId: bob.id, withReplies: true }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi', visibility: 'followers' }); const bobNote = await post(bob, { text: 'hi', replyId: carolNote.id }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('withReplies: true でフォローしているユーザーの行った別のフォローしているユーザーの visibility: followers な投稿への返信が含まれる', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await api('following/create', { userId: carol.id }, alice); - await api('following/create', { userId: carol.id }, bob); - await api('following/update', { userId: bob.id, withReplies: true }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await api('/following/create', { userId: carol.id }, alice); + await api('/following/create', { userId: carol.id }, bob); + await api('/following/update', { userId: bob.id, withReplies: true }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi', visibility: 'followers' }); const bobNote = await post(bob, { text: 'hi', replyId: carolNote.id }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); - - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), true); - assert.strictEqual(res.body.find(note => note.id === carolNote.id)?.text, 'hi'); - }); - - test.concurrent('withReplies: true でフォローしているユーザーの自分の visibility: followers な投稿への返信が含まれる', async () => { - const [alice, bob] = await Promise.all([signup(), signup()]); - - await api('following/create', { userId: bob.id }, alice); - await api('following/create', { userId: alice.id }, bob); - await api('following/update', { userId: bob.id, withReplies: true }, alice); - await setTimeout(1000); - const aliceNote = await post(alice, { text: 'hi', visibility: 'followers' }); - const bobNote = await post(bob, { text: 'hi', replyId: aliceNote.id }); - - await waitForPushToTl(); - - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); - assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true); + assert.strictEqual(res.body.find((note: any) => note.id === carolNote.id).text, 'hi'); }); test.concurrent('withReplies: true でフォローしているユーザーの行った別のフォローしているユーザーの投稿への visibility: specified な返信が含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await api('following/create', { userId: carol.id }, alice); - await api('following/update', { userId: bob.id, withReplies: true }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await api('/following/create', { userId: carol.id }, alice); + await api('/following/update', { userId: bob.id, withReplies: true }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', replyId: carolNote.id, visibility: 'specified', visibleUserIds: [carolNote.id] }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true); }); test.concurrent('withReplies: false でフォローしているユーザーのそのユーザー自身への返信が含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote1 = await post(bob, { text: 'hi' }); const bobNote2 = await post(bob, { text: 'hi', replyId: bobNote1.id }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote1.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote2.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true); }); test.concurrent('withReplies: false でフォローしているユーザーからの自分への返信が含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const aliceNote = await post(alice, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', replyId: aliceNote.id }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('自分の他人への返信が含まれる', async () => { @@ -238,148 +224,146 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); }); test.concurrent('フォローしているユーザーの他人の投稿のリノートが含まれる', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { renoteId: carolNote.id }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('[withRenotes: false] フォローしているユーザーの他人の投稿のリノートが含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { renoteId: carolNote.id }); await waitForPushToTl(); - const res = await api('notes/timeline', { + const res = await api('/notes/timeline', { withRenotes: false, }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('[withRenotes: false] フォローしているユーザーの他人の投稿の引用が含まれる', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', renoteId: carolNote.id }); await waitForPushToTl(); - const res = await api('notes/timeline', { + const res = await api('/notes/timeline', { withRenotes: false, }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('フォローしているユーザーの他人への visibility: specified なノートが含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'specified', visibleUserIds: [carol.id] }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('フォローしているユーザーが行ったミュートしているユーザーのリノートが含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await api('mute/create', { userId: carol.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await api('/mute/create', { userId: carol.id }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', renoteId: carolNote.id }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('withReplies: true でフォローしているユーザーが行ったミュートしているユーザーの投稿への返信が含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await api('following/update', { userId: bob.id, withReplies: true }, alice); - await api('mute/create', { userId: carol.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await api('/following/update', { userId: bob.id, withReplies: true }, alice); + await api('/mute/create', { userId: carol.id }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', replyId: carolNote.id }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('フォローしているリモートユーザーのノートが含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup({ host: genHost() })]); - await sendEnvUpdateRequest({ key: 'FORCE_FOLLOW_REMOTE_USER_FOR_TESTING', value: 'true' }); - await api('following/create', { userId: bob.id }, alice); - + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi' }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('フォローしているリモートユーザーの visibility: home なノートが含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup({ host: genHost() })]); - await sendEnvUpdateRequest({ key: 'FORCE_FOLLOW_REMOTE_USER_FOR_TESTING', value: 'true' }); - await api('following/create', { userId: bob.id }, alice); - + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'home' }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('[withFiles: true] フォローしているユーザーのファイル付きノートのみ含まれる', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const [bobFile, carolFile] = await Promise.all([ uploadUrl(bob, 'https://raw.githubusercontent.com/misskey-dev/assets/main/public/icon.png'), uploadUrl(carol, 'https://raw.githubusercontent.com/misskey-dev/assets/main/public/icon.png'), @@ -391,27 +375,27 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100, withFiles: true }, alice); + const res = await api('/notes/timeline', { limit: 100, withFiles: true }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote1.id), false); - assert.strictEqual(res.body.some(note => note.id === bobNote2.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote1.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote2.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote1.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote2.id), false); }, 1000 * 10); test.concurrent('フォローしているユーザーのチャンネル投稿が含まれない', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - const channel = await api('channels/create', { name: 'channel' }, bob).then(x => x.body); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + const channel = await api('/channels/create', { name: 'channel' }, bob).then(x => x.body); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', channelId: channel.id }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('自分の visibility: specified なノートが含まれる', async () => { @@ -421,25 +405,25 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.find(note => note.id === aliceNote.id)?.text, 'hi'); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.find((note: any) => note.id === aliceNote.id).text, 'hi'); }); test.concurrent('フォローしているユーザーの自身を visibleUserIds に指定した visibility: specified なノートが含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'specified', visibleUserIds: [alice.id] }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.find(note => note.id === bobNote.id)?.text, 'hi'); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.find((note: any) => note.id === bobNote.id).text, 'hi'); }); test.concurrent('フォローしていないユーザーの自身を visibleUserIds に指定した visibility: specified なノートが含まれない', async () => { @@ -449,23 +433,23 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('フォローしているユーザーの自身を visibleUserIds に指定していない visibility: specified なノートが含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'specified', visibleUserIds: [carol.id] }); await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('フォローしていないユーザーからの visibility: specified なノートに返信したときの自身のノートが含まれる', async () => { @@ -476,10 +460,10 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.find(note => note.id === aliceNote.id)?.text, 'ok'); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.find((note: any) => note.id === aliceNote.id).text, 'ok'); }); /* TODO @@ -491,10 +475,10 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.find(note => note.id === bobNote.id).text, 'ok'); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.find((note: any) => note.id === bobNote.id).text, 'ok'); }); */ @@ -507,47 +491,9 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/timeline', { limit: 100 }, alice); + const res = await api('/notes/timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - }); - - test.concurrent('FTT: ローカルユーザーの HTL にはプッシュされる', async () => { - const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - - await api('following/create', { - userId: alice.id, - }, bob); - - const aliceNote = await post(alice, { text: 'I\'m Alice.' }); - const bobNote = await post(bob, { text: 'I\'m Bob.' }); - const carolNote = await post(carol, { text: 'I\'m Carol.' }); - - await waitForPushToTl(); - - // NOTE: notes/timeline だと DB へのフォールバックが効くので Redis を直接見て確かめる - assert.strictEqual(await redisForTimelines.exists(`list:homeTimeline:${bob.id}`), 1); - - const bobHTL = await redisForTimelines.lrange(`list:homeTimeline:${bob.id}`, 0, -1); - assert.strictEqual(bobHTL.includes(aliceNote.id), true); - assert.strictEqual(bobHTL.includes(bobNote.id), true); - assert.strictEqual(bobHTL.includes(carolNote.id), false); - }); - - test.concurrent('FTT: リモートユーザーの HTL にはプッシュされない', async () => { - const [alice, bob] = await Promise.all([signup(), signup({ host: genHost() })]); - - await api('following/create', { - userId: alice.id, - }, bob); - - await post(alice, { text: 'I\'m Alice.' }); - await post(bob, { text: 'I\'m Bob.' }); - - await waitForPushToTl(); - - // NOTE: notes/timeline だと DB へのフォールバックが効くので Redis を直接見て確かめる - assert.strictEqual(await redisForTimelines.exists(`list:homeTimeline:${bob.id}`), 0); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); }); @@ -560,10 +506,10 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/local-timeline', { limit: 100 }, alice); + const res = await api('/notes/local-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('他人の他人への返信が含まれない', async () => { @@ -574,10 +520,10 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/local-timeline', { limit: 100 }, alice); + const res = await api('/notes/local-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true); }); test.concurrent('他人のその人自身への返信が含まれる', async () => { @@ -588,23 +534,23 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/local-timeline', { limit: 100 }, alice); + const res = await api('/notes/local-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote1.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote2.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true); }); test.concurrent('チャンネル投稿が含まれない', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - const channel = await api('channels/create', { name: 'channel' }, bob).then(x => x.body); + const channel = await api('/channels/create', { name: 'channel' }, bob).then(x => x.body); const bobNote = await post(bob, { text: 'hi', channelId: channel.id }); await waitForPushToTl(); - const res = await api('notes/local-timeline', { limit: 100 }, alice); + const res = await api('/notes/local-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('リモートユーザーのノートが含まれない', async () => { @@ -614,108 +560,93 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/local-timeline', { limit: 100 }, alice); + const res = await api('/notes/local-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); // 含まれても良いと思うけど実装が面倒なので含まれない test.concurrent('フォローしているユーザーの visibility: home なノートが含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: carol.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: carol.id }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi', visibility: 'home' }); const bobNote = await post(bob, { text: 'hi' }); await waitForPushToTl(); - const res = await api('notes/local-timeline', { limit: 100 }, alice); + const res = await api('/notes/local-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('ミュートしているユーザーのノートが含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('mute/create', { userId: carol.id }, alice); - await setTimeout(1000); + await api('/mute/create', { userId: carol.id }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi' }); await waitForPushToTl(); - const res = await api('notes/local-timeline', { limit: 100 }, alice); + const res = await api('/notes/local-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('フォローしているユーザーが行ったミュートしているユーザーのリノートが含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await api('mute/create', { userId: carol.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await api('/mute/create', { userId: carol.id }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', renoteId: carolNote.id }); await waitForPushToTl(); - const res = await api('notes/local-timeline', { limit: 100 }, alice); + const res = await api('/notes/local-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('withReplies: true でフォローしているユーザーが行ったミュートしているユーザーの投稿への返信が含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await api('following/update', { userId: bob.id, withReplies: true }, alice); - await api('mute/create', { userId: carol.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await api('/following/update', { userId: bob.id, withReplies: true }, alice); + await api('/mute/create', { userId: carol.id }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', replyId: carolNote.id }); await waitForPushToTl(); - const res = await api('notes/local-timeline', { limit: 100 }, alice); + const res = await api('/notes/local-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); }); test.concurrent('withReplies: false でフォローしているユーザーからの自分への返信が含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const aliceNote = await post(alice, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', replyId: aliceNote.id }); await waitForPushToTl(); - const res = await api('notes/local-timeline', { limit: 100 }, alice); + const res = await api('/notes/local-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - }); - - test.concurrent('withReplies: false でフォローしていないユーザーからの自分への返信が含まれる', async () => { - const [alice, bob] = await Promise.all([signup(), signup()]); - - await setTimeout(1000); - const aliceNote = await post(alice, { text: 'hi' }); - const bobNote = await post(bob, { text: 'hi', replyId: aliceNote.id }); - - await waitForPushToTl(); - - const res = await api('notes/local-timeline', { limit: 100 }, alice); - - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('[withReplies: true] 他人の他人への返信が含まれる', async () => { @@ -726,9 +657,9 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/local-timeline', { limit: 100, withReplies: true }, alice); + const res = await api('/notes/local-timeline', { limit: 100, withReplies: true }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('[withFiles: true] ファイル付きノートのみ含まれる', async () => { @@ -740,10 +671,10 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/local-timeline', { limit: 100, withFiles: true }, alice); + const res = await api('/notes/local-timeline', { limit: 100, withFiles: true }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote1.id), false); - assert.strictEqual(res.body.some(note => note.id === bobNote2.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true); }, 1000 * 10); }); @@ -755,9 +686,9 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/hybrid-timeline', { limit: 100 }, alice); + const res = await api('/notes/hybrid-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('ローカルユーザーの visibility: home なノートが含まれない', async () => { @@ -767,95 +698,39 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/hybrid-timeline', { limit: 100 }, alice); + const res = await api('/notes/hybrid-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('フォローしているローカルユーザーの visibility: home なノートが含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'home' }); await waitForPushToTl(); - const res = await api('notes/hybrid-timeline', { limit: 100 }, alice); + const res = await api('/notes/hybrid-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('withReplies: false でフォローしているユーザーからの自分への返信が含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const aliceNote = await post(alice, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', replyId: aliceNote.id }); await waitForPushToTl(); - const res = await api('notes/hybrid-timeline', { limit: 100 }, alice); + const res = await api('/notes/hybrid-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - }); - - test.concurrent('withReplies: true でフォローしているユーザーの他人の visibility: followers な投稿への返信が含まれない', async () => { - const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - - await api('following/create', { userId: carol.id }, bob); - await api('following/create', { userId: bob.id }, alice); - await api('following/update', { userId: bob.id, withReplies: true }, alice); - await setTimeout(1000); - const carolNote = await post(carol, { text: 'hi', visibility: 'followers' }); - const bobNote = await post(bob, { text: 'hi', replyId: carolNote.id }); - - await waitForPushToTl(); - - const res = await api('notes/hybrid-timeline', { limit: 100 }, alice); - - assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); - assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); - }); - - test.concurrent('withReplies: true でフォローしているユーザーの行った別のフォローしているユーザーの visibility: followers な投稿への返信が含まれる', async () => { - const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - - await api('following/create', { userId: bob.id }, alice); - await api('following/create', { userId: carol.id }, alice); - await api('following/create', { userId: carol.id }, bob); - await api('following/update', { userId: bob.id, withReplies: true }, alice); - await setTimeout(1000); - const carolNote = await post(carol, { text: 'hi', visibility: 'followers' }); - const bobNote = await post(bob, { text: 'hi', replyId: carolNote.id }); - - await waitForPushToTl(); - - const res = await api('notes/hybrid-timeline', { limit: 100 }, alice); - - assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); - assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true); - assert.strictEqual(res.body.find((note: any) => note.id === carolNote.id)?.text, 'hi'); - }); - - test.concurrent('withReplies: true でフォローしているユーザーの自分の visibility: followers な投稿への返信が含まれる', async () => { - const [alice, bob] = await Promise.all([signup(), signup()]); - - await api('following/create', { userId: bob.id }, alice); - await api('following/create', { userId: alice.id }, bob); - await api('following/update', { userId: bob.id, withReplies: true }, alice); - await setTimeout(1000); - const aliceNote = await post(alice, { text: 'hi', visibility: 'followers' }); - const bobNote = await post(bob, { text: 'hi', replyId: aliceNote.id }); - - await waitForPushToTl(); - - const res = await api('notes/hybrid-timeline', { limit: 100 }, alice); - - assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('他人の他人への返信が含まれない', async () => { @@ -866,10 +741,10 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/hybrid-timeline', { limit: 100 }, alice); + const res = await api('/notes/hybrid-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - assert.strictEqual(res.body.some(note => note.id === carolNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true); }); test.concurrent('リモートユーザーのノートが含まれない', async () => { @@ -879,54 +754,37 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/local-timeline', { limit: 100 }, alice); + const res = await api('/notes/local-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('フォローしているリモートユーザーのノートが含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup({ host: genHost() })]); - await sendEnvUpdateRequest({ key: 'FORCE_FOLLOW_REMOTE_USER_FOR_TESTING', value: 'true' }); - await api('following/create', { userId: bob.id }, alice); - + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi' }); await waitForPushToTl(); - const res = await api('notes/hybrid-timeline', { limit: 100 }, alice); + const res = await api('/notes/hybrid-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('フォローしているリモートユーザーの visibility: home なノートが含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup({ host: genHost() })]); - await sendEnvUpdateRequest({ key: 'FORCE_FOLLOW_REMOTE_USER_FOR_TESTING', value: 'true' }); - await api('following/create', { userId: bob.id }, alice); - + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'home' }); await waitForPushToTl(); - const res = await api('notes/hybrid-timeline', { limit: 100 }, alice); + const res = await api('/notes/hybrid-timeline', { limit: 100 }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - }); - - test.concurrent('withReplies: false でフォローしていないユーザーからの自分への返信が含まれる', async () => { - const [alice, bob] = await Promise.all([signup(), signup()]); - - await setTimeout(1000); - const aliceNote = await post(alice, { text: 'hi' }); - const bobNote = await post(bob, { text: 'hi', replyId: aliceNote.id }); - - await waitForPushToTl(); - - const res = await api('notes/local-timeline', { limit: 100 }, alice); - - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('[withReplies: true] 他人の他人への返信が含まれる', async () => { @@ -937,9 +795,9 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/hybrid-timeline', { limit: 100, withReplies: true }, alice); + const res = await api('/notes/hybrid-timeline', { limit: 100, withReplies: true }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('[withFiles: true] ファイル付きノートのみ含まれる', async () => { @@ -951,10 +809,10 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('notes/hybrid-timeline', { limit: 100, withFiles: true }, alice); + const res = await api('/notes/hybrid-timeline', { limit: 100, withFiles: true }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote1.id), false); - assert.strictEqual(res.body.some(note => note.id === bobNote2.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true); }, 1000 * 10); }); @@ -962,244 +820,226 @@ describe('Timelines', () => { test.concurrent('リスインしているフォローしていないユーザーのノートが含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); - await setTimeout(1000); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi' }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('リスインしているフォローしていないユーザーの visibility: home なノートが含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); - await setTimeout(1000); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'home' }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('リスインしているフォローしていないユーザーの visibility: followers なノートが含まれない', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); - await setTimeout(1000); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'followers' }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('リスインしているフォローしていないユーザーの他人への返信が含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); - await setTimeout(1000); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', replyId: carolNote.id }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('リスインしているフォローしていないユーザーのユーザー自身への返信が含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); - await setTimeout(1000); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); + await sleep(1000); const bobNote1 = await post(bob, { text: 'hi' }); const bobNote2 = await post(bob, { text: 'hi', replyId: bobNote1.id }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote1.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote2.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true); }); test.concurrent('withReplies: false でリスインしているフォローしていないユーザーからの自分への返信が含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); - await api('users/lists/update-membership', { listId: list.id, userId: bob.id, withReplies: false }, alice); - await setTimeout(1000); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); + await sleep(1000); const aliceNote = await post(alice, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', replyId: aliceNote.id }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id, withReplies: false }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - }); - - test.concurrent('withReplies: false でリスインしているフォローしていないユーザーの他人への返信が含まれない', async () => { - const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); - await api('users/lists/update-membership', { listId: list.id, userId: bob.id, withReplies: false }, alice); - await setTimeout(1000); - const carolNote = await post(carol, { text: 'hi' }); - const bobNote = await post(bob, { text: 'hi', replyId: carolNote.id }); - - await waitForPushToTl(); - - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); - - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('withReplies: true でリスインしているフォローしていないユーザーの他人への返信が含まれる', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); - await api('users/lists/update-membership', { listId: list.id, userId: bob.id, withReplies: true }, alice); - await setTimeout(1000); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); + await api('/users/lists/update-membership', { listId: list.id, userId: bob.id, withReplies: true }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', replyId: carolNote.id }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('リスインしているフォローしているユーザーの visibility: home なノートが含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'home' }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('リスインしているフォローしているユーザーの visibility: followers なノートが含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'followers' }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.find(note => note.id === bobNote.id)?.text, 'hi'); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.find((note: any) => note.id === bobNote.id).text, 'hi'); }); test.concurrent('リスインしている自分の visibility: followers なノートが含まれる', async () => { const [alice] = await Promise.all([signup(), signup()]); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: alice.id }, alice); - await setTimeout(1000); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: alice.id }, alice); + await sleep(1000); const aliceNote = await post(alice, { text: 'hi', visibility: 'followers' }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.find(note => note.id === aliceNote.id)?.text, 'hi'); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.find((note: any) => note.id === aliceNote.id).text, 'hi'); }); test.concurrent('リスインしているユーザーのチャンネルノートが含まれない', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - const channel = await api('channels/create', { name: 'channel' }, bob).then(x => x.body); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); - await setTimeout(1000); + const channel = await api('/channels/create', { name: 'channel' }, bob).then(x => x.body); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', channelId: channel.id }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('[withFiles: true] リスインしているユーザーのファイル付きノートのみ含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/misskey-dev/assets/main/public/icon.png'); const bobNote1 = await post(bob, { text: 'hi' }); const bobNote2 = await post(bob, { fileIds: [file.id] }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id, withFiles: true }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id, withFiles: true }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote1.id), false); - assert.strictEqual(res.body.some(note => note.id === bobNote2.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true); }, 1000 * 10); test.concurrent('リスインしているユーザーの自身宛ての visibility: specified なノートが含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); - await setTimeout(1000); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'specified', visibleUserIds: [alice.id] }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.find(note => note.id === bobNote.id)?.text, 'hi'); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.find((note: any) => note.id === bobNote.id).text, 'hi'); }); test.concurrent('リスインしているユーザーの自身宛てではない visibility: specified なノートが含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - const list = await api('users/lists/create', { name: 'list' }, alice).then(res => res.body); - await api('users/lists/push', { listId: list.id, userId: bob.id }, alice); - await api('users/lists/push', { listId: list.id, userId: carol.id }, alice); - await setTimeout(1000); + const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); + await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); + await api('/users/lists/push', { listId: list.id, userId: carol.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'specified', visibleUserIds: [carol.id] }); await waitForPushToTl(); - const res = await api('notes/user-list-timeline', { listId: list.id }, alice); + const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); }); @@ -1211,9 +1051,9 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id }, alice); + const res = await api('/users/notes', { userId: bob.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('フォローしていないユーザーの visibility: followers なノートが含まれない', async () => { @@ -1223,24 +1063,24 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id }, alice); + const res = await api('/users/notes', { userId: bob.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('フォローしているユーザーの visibility: followers なノートが含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - await api('following/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/following/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote = await post(bob, { text: 'hi', visibility: 'followers' }); await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id }, alice); + const res = await api('/users/notes', { userId: bob.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); - assert.strictEqual(res.body.find(note => note.id === bobNote.id)?.text, 'hi'); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); + assert.strictEqual(res.body.find((note: any) => note.id === bobNote.id).text, 'hi'); }); test.concurrent('自身の visibility: followers なノートが含まれる', async () => { @@ -1250,23 +1090,23 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('users/notes', { userId: alice.id }, alice); + const res = await api('/users/notes', { userId: alice.id }, alice); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); - assert.strictEqual(res.body.find(note => note.id === aliceNote.id)?.text, 'hi'); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); + assert.strictEqual(res.body.find((note: any) => note.id === aliceNote.id).text, 'hi'); }); test.concurrent('チャンネル投稿が含まれない', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - const channel = await api('channels/create', { name: 'channel' }, bob).then(x => x.body); + const channel = await api('/channels/create', { name: 'channel' }, bob).then(x => x.body); const bobNote = await post(bob, { text: 'hi', channelId: channel.id }); await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id }, alice); + const res = await api('/users/notes', { userId: bob.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('[withReplies: false] 他人への返信が含まれない', async () => { @@ -1278,10 +1118,10 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id }, alice); + const res = await api('/users/notes', { userId: bob.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote1.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote2.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), false); }); test.concurrent('[withReplies: true] 他人への返信が含まれる', async () => { @@ -1293,10 +1133,10 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id, withReplies: true }, alice); + const res = await api('/users/notes', { userId: bob.id, withReplies: true }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote1.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote2.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true); }); test.concurrent('[withReplies: true] 他人への visibility: specified な返信が含まれない', async () => { @@ -1308,10 +1148,10 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id, withReplies: true }, alice); + const res = await api('/users/notes', { userId: bob.id, withReplies: true }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote1.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote2.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), false); }); test.concurrent('[withFiles: true] ファイル付きノートのみ含まれる', async () => { @@ -1323,82 +1163,82 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id, withFiles: true }, alice); + const res = await api('/users/notes', { userId: bob.id, withFiles: true }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote1.id), false); - assert.strictEqual(res.body.some(note => note.id === bobNote2.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true); }, 1000 * 10); test.concurrent('[withChannelNotes: true] チャンネル投稿が含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - const channel = await api('channels/create', { name: 'channel' }, bob).then(x => x.body); + const channel = await api('/channels/create', { name: 'channel' }, bob).then(x => x.body); const bobNote = await post(bob, { text: 'hi', channelId: channel.id }); await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id, withChannelNotes: true }, alice); + const res = await api('/users/notes', { userId: bob.id, withChannelNotes: true }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('[withChannelNotes: true] 他人が取得した場合センシティブチャンネル投稿が含まれない', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - const channel = await api('channels/create', { name: 'channel', isSensitive: true }, bob).then(x => x.body); + const channel = await api('/channels/create', { name: 'channel', isSensitive: true }, bob).then(x => x.body); const bobNote = await post(bob, { text: 'hi', channelId: channel.id }); await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id, withChannelNotes: true }, alice); + const res = await api('/users/notes', { userId: bob.id, withChannelNotes: true }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('[withChannelNotes: true] 自分が取得した場合センシティブチャンネル投稿が含まれる', async () => { const [bob] = await Promise.all([signup()]); - const channel = await api('channels/create', { name: 'channel', isSensitive: true }, bob).then(x => x.body); + const channel = await api('/channels/create', { name: 'channel', isSensitive: true }, bob).then(x => x.body); const bobNote = await post(bob, { text: 'hi', channelId: channel.id }); await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id, withChannelNotes: true }, bob); + const res = await api('/users/notes', { userId: bob.id, withChannelNotes: true }, bob); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); }); test.concurrent('ミュートしているユーザーに関連する投稿が含まれない', async () => { const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]); - await api('mute/create', { userId: carol.id }, alice); - await setTimeout(1000); + await api('/mute/create', { userId: carol.id }, alice); + await sleep(1000); const carolNote = await post(carol, { text: 'hi' }); const bobNote = await post(bob, { text: 'hi', renoteId: carolNote.id }); await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id }, alice); + const res = await api('/users/notes', { userId: bob.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); test.concurrent('ミュートしていても userId に指定したユーザーの投稿が含まれる', async () => { const [alice, bob] = await Promise.all([signup(), signup()]); - await api('mute/create', { userId: bob.id }, alice); - await setTimeout(1000); + await api('/mute/create', { userId: bob.id }, alice); + await sleep(1000); const bobNote1 = await post(bob, { text: 'hi' }); const bobNote2 = await post(bob, { text: 'hi', replyId: bobNote1.id }); const bobNote3 = await post(bob, { text: 'hi', renoteId: bobNote1.id }); await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id }, alice); + const res = await api('/users/notes', { userId: bob.id }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote1.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote2.id), true); - assert.strictEqual(res.body.some(note => note.id === bobNote3.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote1.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote2.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote3.id), true); }); test.concurrent('自身の visibility: specified なノートが含まれる', async () => { @@ -1408,9 +1248,9 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('users/notes', { userId: alice.id, withReplies: true }, alice); + const res = await api('/users/notes', { userId: alice.id, withReplies: true }, alice); - assert.strictEqual(res.body.some(note => note.id === aliceNote.id), true); + assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); }); test.concurrent('visibleUserIds に指定されてない visibility: specified なノートが含まれない', async () => { @@ -1420,36 +1260,9 @@ describe('Timelines', () => { await waitForPushToTl(); - const res = await api('users/notes', { userId: bob.id, withReplies: true }, alice); + const res = await api('/users/notes', { userId: bob.id, withReplies: true }, alice); - assert.strictEqual(res.body.some(note => note.id === bobNote.id), false); - }); - - /** @see https://github.com/misskey-dev/misskey/issues/14000 */ - test.concurrent('FTT: sinceId にキャッシュより古いノートを指定しても、sinceId による絞り込みが正しく動作する', async () => { - const alice = await signup(); - const noteSince = await post(alice, { text: 'Note where id will be `sinceId`.' }); - const note1 = await post(alice, { text: '1' }); - const note2 = await post(alice, { text: '2' }); - await redisForTimelines.del('list:userTimeline:' + alice.id); - const note3 = await post(alice, { text: '3' }); - - const res = await api('users/notes', { userId: alice.id, sinceId: noteSince.id }); - assert.deepStrictEqual(res.body, [note1, note2, note3]); - }); - - test.concurrent('FTT: sinceId にキャッシュより古いノートを指定しても、sinceId と untilId による絞り込みが正しく動作する', async () => { - const alice = await signup(); - const noteSince = await post(alice, { text: 'Note where id will be `sinceId`.' }); - const note1 = await post(alice, { text: '1' }); - const note2 = await post(alice, { text: '2' }); - await redisForTimelines.del('list:userTimeline:' + alice.id); - const note3 = await post(alice, { text: '3' }); - const noteUntil = await post(alice, { text: 'Note where id will be `untilId`.' }); - await post(alice, { text: '4' }); - - const res = await api('users/notes', { userId: alice.id, sinceId: noteSince.id, untilId: noteUntil.id }); - assert.deepStrictEqual(res.body, [note3, note2, note1]); + assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); }); }); diff --git a/packages/backend/test/e2e/user-notes.ts b/packages/backend/test/e2e/user-notes.ts index cc07c5ae71..b5f00a6327 100644 --- a/packages/backend/test/e2e/user-notes.ts +++ b/packages/backend/test/e2e/user-notes.ts @@ -1,24 +1,28 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; -import { api, post, signup, uploadUrl } from '../utils.js'; +import { signup, api, post, uploadUrl, startServer } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; describe('users/notes', () => { - let alice: misskey.entities.SignupResponse; - let jpgNote: misskey.entities.Note; - let pngNote: misskey.entities.Note; - let jpgPngNote: misskey.entities.Note; + let app: INestApplicationContext; + + let alice: misskey.entities.MeSignup; + let jpgNote: any; + let pngNote: any; + let jpgPngNote: any; beforeAll(async () => { + app = await startServer(); alice = await signup({ username: 'alice' }); - const jpg = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/192.jpg'); - const png = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/192.png'); + const jpg = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); + const png = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.png'); jpgNote = await post(alice, { fileIds: [jpg.id], }); @@ -30,8 +34,12 @@ describe('users/notes', () => { }); }, 1000 * 60 * 2); + afterAll(async() => { + await app.close(); + }); + test('withFiles', async () => { - const res = await api('users/notes', { + const res = await api('/users/notes', { userId: alice.id, withFiles: true, }, alice); diff --git a/packages/backend/test/e2e/users.ts b/packages/backend/test/e2e/users.ts index 822ca14ae6..9c4cbac368 100644 --- a/packages/backend/test/e2e/users.ts +++ b/packages/backend/test/e2e/users.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -7,9 +7,21 @@ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; import { inspect } from 'node:util'; -import { api, post, role, signup, successfulApiCall, uploadFile } from '../utils.js'; -import type * as misskey from 'misskey-js'; import { DEFAULT_POLICIES } from '@/core/RoleService.js'; +import type { Packed } from '@/misc/json-schema.js'; +import { + signup, + post, + page, + role, + startServer, + api, + successfulApiCall, + failedApiCall, + uploadFile, +} from '../utils.js'; +import type * as misskey from 'misskey-js'; +import type { INestApplicationContext } from '@nestjs/common'; describe('ユーザー', () => { // エンティティとしてのユーザーを主眼においたテストを記述する @@ -24,12 +36,31 @@ describe('ユーザー', () => { }, {}); }; - const show = async (id: string, me = root): Promise => { - return successfulApiCall({ endpoint: 'users/show', parameters: { userId: id }, user: me }); + // BUG misskey-jsとjson-schemaと実際に返ってくるデータが全部違う + type UserLite = misskey.entities.UserLite & { + badgeRoles: any[], + }; + + type UserDetailedNotMe = UserLite & + misskey.entities.UserDetailed & { + roles: any[], + }; + + type MeDetailed = UserDetailedNotMe & + misskey.entities.MeDetailed & { + achievements: object[], + loggedInDays: number, + policies: object, + }; + + type User = MeDetailed & { token: string }; + + const show = async (id: string, me = root): Promise => { + return successfulApiCall({ endpoint: 'users/show', parameters: { userId: id }, user: me }) as any; }; // UserLiteのキーが過不足なく入っている? - const userLite = (user: misskey.entities.UserLite): Partial => { + const userLite = (user: User): Partial => { return stripUndefined({ id: user.id, name: user.name, @@ -52,7 +83,7 @@ describe('ユーザー', () => { }; // UserDetailedNotMeのキーが過不足なく入っている? - const userDetailedNotMe = (user: misskey.entities.SignupResponse): Partial => { + const userDetailedNotMe = (user: User): Partial => { return stripUndefined({ ...userLite(user), url: user.url, @@ -83,13 +114,16 @@ describe('ユーザー', () => { publicReactions: user.publicReactions, followingVisibility: user.followingVisibility, followersVisibility: user.followersVisibility, + twoFactorEnabled: user.twoFactorEnabled, + usePasswordLessLogin: user.usePasswordLessLogin, + securityKeys: user.securityKeys, roles: user.roles, memo: user.memo, }); }; // Relations関連のキーが過不足なく入っている? - const userDetailedNotMeWithRelations = (user: misskey.entities.SignupResponse): Partial => { + const userDetailedNotMeWithRelations = (user: User): Partial => { return stripUndefined({ ...userDetailedNotMe(user), isFollowing: user.isFollowing ?? false, @@ -102,17 +136,15 @@ describe('ユーザー', () => { isRenoteMuted: user.isRenoteMuted ?? false, notify: user.notify ?? 'none', withReplies: user.withReplies ?? false, - followedMessage: user.isFollowing ? (user.followedMessage ?? null) : undefined, }); }; // MeDetailedのキーが過不足なく入っている? - const meDetailed = (user: misskey.entities.SignupResponse, security = false): Partial => { + const meDetailed = (user: User, security = false): Partial => { return stripUndefined({ ...userDetailedNotMe(user), avatarId: user.avatarId, bannerId: user.bannerId, - followedMessage: user.followedMessage, isModerator: user.isModerator, isAdmin: user.isAdmin, injectFeaturedNote: user.injectFeaturedNote, @@ -139,16 +171,12 @@ describe('ユーザー', () => { mutedWords: user.mutedWords, hardMutedWords: user.hardMutedWords, mutedInstances: user.mutedInstances, - // @ts-expect-error 後方互換性 mutingNotificationTypes: user.mutingNotificationTypes, notificationRecieveConfig: user.notificationRecieveConfig, emailNotificationTypes: user.emailNotificationTypes, achievements: user.achievements, loggedInDays: user.loggedInDays, policies: user.policies, - twoFactorEnabled: user.twoFactorEnabled, - usePasswordLessLogin: user.usePasswordLessLogin, - securityKeys: user.securityKeys, ...(security ? { email: user.email, emailVerified: user.emailVerified, @@ -157,53 +185,67 @@ describe('ユーザー', () => { }); }; - let root: misskey.entities.SignupResponse; - let alice: misskey.entities.SignupResponse; + let app: INestApplicationContext; + + let root: User; + let alice: User; let aliceNote: misskey.entities.Note; + let alicePage: misskey.entities.Page; + let aliceList: misskey.entities.UserList; - let bob: misskey.entities.SignupResponse; + let bob: User; + let bobNote: misskey.entities.Note; - // NOTE: これがないと落ちる(bob の updatedAt が null になってしまうため?) - let bobNote: misskey.entities.Note; // eslint-disable-line @typescript-eslint/no-unused-vars + let carol: User; + let dave: User; + let ellen: User; + let frank: User; - let carol: misskey.entities.SignupResponse; + let usersReplying: User[]; - let usersReplying: misskey.entities.SignupResponse[]; + let userNoNote: User; + let userNotExplorable: User; + let userLocking: User; + let userAdmin: User; + let roleAdmin: any; + let userModerator: User; + let roleModerator: any; + let userRolePublic: User; + let rolePublic: any; + let userRoleBadge: User; + let roleBadge: any; + let userSilenced: User; + let roleSilenced: any; + let userSuspended: User; + let userDeletedBySelf: User; + let userDeletedByAdmin: User; + let userFollowingAlice: User; + let userFollowedByAlice: User; + let userBlockingAlice: User; + let userBlockedByAlice: User; + let userMutingAlice: User; + let userMutedByAlice: User; + let userRnMutingAlice: User; + let userRnMutedByAlice: User; + let userFollowRequesting: User; + let userFollowRequested: User; - let userNoNote: misskey.entities.SignupResponse; - let userNotExplorable: misskey.entities.SignupResponse; - let userLocking: misskey.entities.SignupResponse; - let userAdmin: misskey.entities.SignupResponse; - let roleAdmin: misskey.entities.Role; - let userModerator: misskey.entities.SignupResponse; - let roleModerator: misskey.entities.Role; - let userRolePublic: misskey.entities.SignupResponse; - let rolePublic: misskey.entities.Role; - let userRoleBadge: misskey.entities.SignupResponse; - let roleBadge: misskey.entities.Role; - let userSilenced: misskey.entities.SignupResponse; - let roleSilenced: misskey.entities.Role; - let userSuspended: misskey.entities.SignupResponse; - let userDeletedBySelf: misskey.entities.SignupResponse; - let userDeletedByAdmin: misskey.entities.SignupResponse; - let userFollowingAlice: misskey.entities.SignupResponse; - let userFollowedByAlice: misskey.entities.SignupResponse; - let userBlockingAlice: misskey.entities.SignupResponse; - let userBlockedByAlice: misskey.entities.SignupResponse; - let userMutingAlice: misskey.entities.SignupResponse; - let userMutedByAlice: misskey.entities.SignupResponse; - let userRnMutingAlice: misskey.entities.SignupResponse; - let userRnMutedByAlice: misskey.entities.SignupResponse; - let userFollowRequesting: misskey.entities.SignupResponse; - let userFollowRequested: misskey.entities.SignupResponse; + beforeAll(async () => { + app = await startServer(); + }, 1000 * 60 * 2); beforeAll(async () => { root = await signup({ username: 'root' }); alice = await signup({ username: 'alice' }); - aliceNote = await post(alice, { text: 'test' }); + aliceNote = await post(alice, { text: 'test' }) as any; + alicePage = await page(alice); + aliceList = (await api('users/list/create', { name: 'aliceList' }, alice)).body; bob = await signup({ username: 'bob' }); - bobNote = await post(bob, { text: 'test' }); + bobNote = await post(bob, { text: 'test' }) as any; carol = await signup({ username: 'carol' }); + dave = await signup({ username: 'dave' }); + ellen = await signup({ username: 'ellen' }); + frank = await signup({ username: 'frank' }); // @alice -> @replyingへのリプライ。Promise.allで一気に作るとtimeoutしてしまうのでreduceで一つ一つawaitする usersReplying = await [...Array(10)].map((_, i) => i).reduce(async (acc, i) => { @@ -214,7 +256,7 @@ describe('ユーザー', () => { } return (await acc).concat(u); - }, Promise.resolve([] as misskey.entities.SignupResponse[])); + }, Promise.resolve([] as User[])); userNoNote = await signup({ username: 'userNoNote' }); userNotExplorable = await signup({ username: 'userNotExplorable' }); @@ -233,7 +275,7 @@ describe('ユーザー', () => { rolePublic = await role(root, { isPublic: true, name: 'Public Role' }); await api('admin/roles/assign', { userId: userRolePublic.id, roleId: rolePublic.id }, root); userRoleBadge = await signup({ username: 'userRoleBadge' }); - roleBadge = await role(root, { asBadge: true, name: 'Badge Role', isPublic: true }); + roleBadge = await role(root, { asBadge: true, name: 'Badge Role' }); await api('admin/roles/assign', { userId: userRoleBadge.id, roleId: roleBadge.id }, root); userSilenced = await signup({ username: 'userSilenced' }); await post(userSilenced, { text: 'test' }); @@ -279,10 +321,14 @@ describe('ユーザー', () => { await api('following/create', { userId: userFollowRequested.id }, userFollowRequesting); }, 1000 * 60 * 10); + afterAll(async () => { + await app.close(); + }); + beforeEach(async () => { alice = { ...alice, - ...await successfulApiCall({ endpoint: 'i', parameters: {}, user: alice }), + ...await successfulApiCall({ endpoint: 'i', parameters: {}, user: alice }) as any, }; aliceNote = await successfulApiCall({ endpoint: 'notes/show', parameters: { noteId: aliceNote.id }, user: alice }); }); @@ -295,7 +341,7 @@ describe('ユーザー', () => { endpoint: 'signup', parameters: { username: 'zoe', password: 'password' }, user: undefined, - }) as unknown as misskey.entities.SignupResponse; // BUG MeDetailedに足りないキーがある + }) as unknown as User; // BUG MeDetailedに足りないキーがある // signupの時はtokenが含まれる特別なMeDetailedが返ってくる assert.match(response.token, /[a-zA-Z0-9]{16}/); @@ -305,7 +351,7 @@ describe('ユーザー', () => { assert.strictEqual(response.name, null); assert.strictEqual(response.username, 'zoe'); assert.strictEqual(response.host, null); - response.avatarUrl && assert.match(response.avatarUrl, /^[-a-zA-Z0-9@:%._\+~#&?=\/]+$/); + assert.match(response.avatarUrl, /^[-a-zA-Z0-9@:%._\+~#&?=\/]+$/); assert.strictEqual(response.avatarBlurhash, null); assert.deepStrictEqual(response.avatarDecorations, []); assert.strictEqual(response.isBot, false); @@ -343,13 +389,15 @@ describe('ユーザー', () => { assert.strictEqual(response.publicReactions, true); assert.strictEqual(response.followingVisibility, 'public'); assert.strictEqual(response.followersVisibility, 'public'); + assert.strictEqual(response.twoFactorEnabled, false); + assert.strictEqual(response.usePasswordLessLogin, false); + assert.strictEqual(response.securityKeys, false); assert.deepStrictEqual(response.roles, []); assert.strictEqual(response.memo, null); // MeDetailedOnly assert.strictEqual(response.avatarId, null); assert.strictEqual(response.bannerId, null); - assert.strictEqual(response.followedMessage, null); assert.strictEqual(response.isModerator, false); assert.strictEqual(response.isAdmin, false); assert.strictEqual(response.injectFeaturedNote, true); @@ -375,16 +423,12 @@ describe('ユーザー', () => { assert.deepStrictEqual(response.unreadAnnouncements, []); assert.deepStrictEqual(response.mutedWords, []); assert.deepStrictEqual(response.mutedInstances, []); - // @ts-expect-error 後方互換のため assert.deepStrictEqual(response.mutingNotificationTypes, []); assert.deepStrictEqual(response.notificationRecieveConfig, {}); assert.deepStrictEqual(response.emailNotificationTypes, ['follow', 'receiveFollowRequest']); assert.deepStrictEqual(response.achievements, []); assert.deepStrictEqual(response.loggedInDays, 0); assert.deepStrictEqual(response.policies, DEFAULT_POLICIES); - assert.strictEqual(response.twoFactorEnabled, false); - assert.strictEqual(response.usePasswordLessLogin, false); - assert.strictEqual(response.securityKeys, false); assert.notStrictEqual(response.email, undefined); assert.strictEqual(response.emailVerified, false); assert.deepStrictEqual(response.securityKeysList, []); @@ -408,68 +452,66 @@ describe('ユーザー', () => { //#region 自分の情報の更新(i/update) test.each([ - { parameters: () => ({ name: null }) }, - { parameters: () => ({ name: 'x'.repeat(50) }) }, - { parameters: () => ({ name: 'x' }) }, - { parameters: () => ({ name: 'My name' }) }, - { parameters: () => ({ description: null }) }, - { parameters: () => ({ description: 'x'.repeat(1500) }) }, - { parameters: () => ({ description: 'x' }) }, - { parameters: () => ({ description: 'My description' }) }, - { parameters: () => ({ followedMessage: null }) }, - { parameters: () => ({ followedMessage: 'Thank you' }) }, - { parameters: () => ({ location: null }) }, - { parameters: () => ({ location: 'x'.repeat(50) }) }, - { parameters: () => ({ location: 'x' }) }, - { parameters: () => ({ location: 'My location' }) }, - { parameters: () => ({ birthday: '0000-00-00' }) }, - { parameters: () => ({ birthday: '9999-99-99' }) }, - { parameters: () => ({ lang: 'en-US' as const }) }, - { parameters: () => ({ fields: [] }) }, - { parameters: () => ({ fields: [{ name: 'x', value: 'x' }] }) }, - { parameters: () => ({ fields: [{ name: 'x'.repeat(3000), value: 'x'.repeat(3000) }] }) }, // BUG? fieldには制限がない - { parameters: () => ({ fields: Array(16).fill({ name: 'x', value: 'y' }) }) }, - { parameters: () => ({ isLocked: true }) }, - { parameters: () => ({ isLocked: false }) }, - { parameters: () => ({ isExplorable: false }) }, - { parameters: () => ({ isExplorable: true }) }, - { parameters: () => ({ hideOnlineStatus: true }) }, - { parameters: () => ({ hideOnlineStatus: false }) }, - { parameters: () => ({ publicReactions: false }) }, - { parameters: () => ({ publicReactions: true }) }, - { parameters: () => ({ autoAcceptFollowed: true }) }, - { parameters: () => ({ autoAcceptFollowed: false }) }, - { parameters: () => ({ noCrawle: true }) }, - { parameters: () => ({ noCrawle: false }) }, - { parameters: () => ({ preventAiLearning: false }) }, - { parameters: () => ({ preventAiLearning: true }) }, - { parameters: () => ({ isBot: true }) }, - { parameters: () => ({ isBot: false }) }, - { parameters: () => ({ isCat: true }) }, - { parameters: () => ({ isCat: false }) }, - { parameters: () => ({ injectFeaturedNote: true }) }, - { parameters: () => ({ injectFeaturedNote: false }) }, - { parameters: () => ({ receiveAnnouncementEmail: true }) }, - { parameters: () => ({ receiveAnnouncementEmail: false }) }, - { parameters: () => ({ alwaysMarkNsfw: true }) }, - { parameters: () => ({ alwaysMarkNsfw: false }) }, - { parameters: () => ({ autoSensitive: true }) }, - { parameters: () => ({ autoSensitive: false }) }, - { parameters: () => ({ followingVisibility: 'private' as const }) }, - { parameters: () => ({ followingVisibility: 'followers' as const }) }, - { parameters: () => ({ followingVisibility: 'public' as const }) }, - { parameters: () => ({ followersVisibility: 'private' as const }) }, - { parameters: () => ({ followersVisibility: 'followers' as const }) }, - { parameters: () => ({ followersVisibility: 'public' as const }) }, - { parameters: () => ({ mutedWords: Array(19).fill(['xxxxx']) }) }, - { parameters: () => ({ mutedWords: [['x'.repeat(194)]] }) }, - { parameters: () => ({ mutedWords: [] }) }, - { parameters: () => ({ mutedInstances: ['xxxx.xxxxx'] }) }, - { parameters: () => ({ mutedInstances: [] }) }, - { parameters: () => ({ notificationRecieveConfig: { mention: { type: 'following' } } }) }, - { parameters: () => ({ notificationRecieveConfig: {} }) }, - { parameters: () => ({ emailNotificationTypes: ['mention', 'reply', 'quote', 'follow', 'receiveFollowRequest'] }) }, - { parameters: () => ({ emailNotificationTypes: [] }) }, + { parameters: (): object => ({ name: null }) }, + { parameters: (): object => ({ name: 'x'.repeat(50) }) }, + { parameters: (): object => ({ name: 'x' }) }, + { parameters: (): object => ({ name: 'My name' }) }, + { parameters: (): object => ({ description: null }) }, + { parameters: (): object => ({ description: 'x'.repeat(1500) }) }, + { parameters: (): object => ({ description: 'x' }) }, + { parameters: (): object => ({ description: 'My description' }) }, + { parameters: (): object => ({ location: null }) }, + { parameters: (): object => ({ location: 'x'.repeat(50) }) }, + { parameters: (): object => ({ location: 'x' }) }, + { parameters: (): object => ({ location: 'My location' }) }, + { parameters: (): object => ({ birthday: '0000-00-00' }) }, + { parameters: (): object => ({ birthday: '9999-99-99' }) }, + { parameters: (): object => ({ lang: 'en-US' }) }, + { parameters: (): object => ({ fields: [] }) }, + { parameters: (): object => ({ fields: [{ name: 'x', value: 'x' }] }) }, + { parameters: (): object => ({ fields: [{ name: 'x'.repeat(3000), value: 'x'.repeat(3000) }] }) }, // BUG? fieldには制限がない + { parameters: (): object => ({ fields: Array(16).fill({ name: 'x', value: 'y' }) }) }, + { parameters: (): object => ({ isLocked: true }) }, + { parameters: (): object => ({ isLocked: false }) }, + { parameters: (): object => ({ isExplorable: false }) }, + { parameters: (): object => ({ isExplorable: true }) }, + { parameters: (): object => ({ hideOnlineStatus: true }) }, + { parameters: (): object => ({ hideOnlineStatus: false }) }, + { parameters: (): object => ({ publicReactions: false }) }, + { parameters: (): object => ({ publicReactions: true }) }, + { parameters: (): object => ({ autoAcceptFollowed: true }) }, + { parameters: (): object => ({ autoAcceptFollowed: false }) }, + { parameters: (): object => ({ noCrawle: true }) }, + { parameters: (): object => ({ noCrawle: false }) }, + { parameters: (): object => ({ preventAiLearning: false }) }, + { parameters: (): object => ({ preventAiLearning: true }) }, + { parameters: (): object => ({ isBot: true }) }, + { parameters: (): object => ({ isBot: false }) }, + { parameters: (): object => ({ isCat: true }) }, + { parameters: (): object => ({ isCat: false }) }, + { parameters: (): object => ({ injectFeaturedNote: true }) }, + { parameters: (): object => ({ injectFeaturedNote: false }) }, + { parameters: (): object => ({ receiveAnnouncementEmail: true }) }, + { parameters: (): object => ({ receiveAnnouncementEmail: false }) }, + { parameters: (): object => ({ alwaysMarkNsfw: true }) }, + { parameters: (): object => ({ alwaysMarkNsfw: false }) }, + { parameters: (): object => ({ autoSensitive: true }) }, + { parameters: (): object => ({ autoSensitive: false }) }, + { parameters: (): object => ({ followingVisibility: 'private' }) }, + { parameters: (): object => ({ followingVisibility: 'followers' }) }, + { parameters: (): object => ({ followingVisibility: 'public' }) }, + { parameters: (): object => ({ followersVisibility: 'private' }) }, + { parameters: (): object => ({ followersVisibility: 'followers' }) }, + { parameters: (): object => ({ followersVisibility: 'public' }) }, + { parameters: (): object => ({ mutedWords: Array(19).fill(['xxxxx']) }) }, + { parameters: (): object => ({ mutedWords: [['x'.repeat(194)]] }) }, + { parameters: (): object => ({ mutedWords: [] }) }, + { parameters: (): object => ({ mutedInstances: ['xxxx.xxxxx'] }) }, + { parameters: (): object => ({ mutedInstances: [] }) }, + { parameters: (): object => ({ notificationRecieveConfig: { mention: { type: 'following' } } }) }, + { parameters: (): object => ({ notificationRecieveConfig: {} }) }, + { parameters: (): object => ({ emailNotificationTypes: ['mention', 'reply', 'quote', 'follow', 'receiveFollowRequest'] }) }, + { parameters: (): object => ({ emailNotificationTypes: [] }) }, ] as const)('を書き換えることができる($#)', async ({ parameters }) => { const response = await successfulApiCall({ endpoint: 'i/update', parameters: parameters(), user: alice }); const expected = { ...meDetailed(alice, true), ...parameters() }; @@ -478,13 +520,13 @@ describe('ユーザー', () => { test('を書き換えることができる(Avatar)', async () => { const aliceFile = (await uploadFile(alice)).body; - const parameters = { avatarId: aliceFile!.id }; + const parameters = { avatarId: aliceFile.id }; const response = await successfulApiCall({ endpoint: 'i/update', parameters: parameters, user: alice }); assert.match(response.avatarUrl ?? '.', /^[-a-zA-Z0-9@:%._\+~#&?=\/]+$/); assert.match(response.avatarBlurhash ?? '.', /[ -~]{54}/); const expected = { ...meDetailed(alice, true), - avatarId: aliceFile!.id, + avatarId: aliceFile.id, avatarBlurhash: response.avatarBlurhash, avatarUrl: response.avatarUrl, }; @@ -503,13 +545,13 @@ describe('ユーザー', () => { test('を書き換えることができる(Banner)', async () => { const aliceFile = (await uploadFile(alice)).body; - const parameters = { bannerId: aliceFile!.id }; + const parameters = { bannerId: aliceFile.id }; const response = await successfulApiCall({ endpoint: 'i/update', parameters: parameters, user: alice }); assert.match(response.bannerUrl ?? '.', /^[-a-zA-Z0-9@:%._\+~#&?=\/]+$/); assert.match(response.bannerBlurhash ?? '.', /[ -~]{54}/); const expected = { ...meDetailed(alice, true), - bannerId: aliceFile!.id, + bannerId: aliceFile.id, bannerBlurhash: response.bannerBlurhash, bannerUrl: response.bannerUrl, }; @@ -559,13 +601,13 @@ describe('ユーザー', () => { //#region ユーザー(users) test.each([ - { label: 'ID昇順', parameters: { limit: 5 }, selector: (u: misskey.entities.UserLite): string => u.id }, - { label: 'フォロワー昇順', parameters: { sort: '+follower' }, selector: (u: misskey.entities.UserDetailedNotMe): string => String(u.followersCount) }, - { label: 'フォロワー降順', parameters: { sort: '-follower' }, selector: (u: misskey.entities.UserDetailedNotMe): string => String(u.followersCount) }, - { label: '登録日時昇順', parameters: { sort: '+createdAt' }, selector: (u: misskey.entities.UserDetailedNotMe): string => u.createdAt }, - { label: '登録日時降順', parameters: { sort: '-createdAt' }, selector: (u: misskey.entities.UserDetailedNotMe): string => u.createdAt }, - { label: '投稿日時昇順', parameters: { sort: '+updatedAt' }, selector: (u: misskey.entities.UserDetailedNotMe): string => String(u.updatedAt) }, - { label: '投稿日時降順', parameters: { sort: '-updatedAt' }, selector: (u: misskey.entities.UserDetailedNotMe): string => String(u.updatedAt) }, + { label: 'ID昇順', parameters: { limit: 5 }, selector: (u: UserLite): string => u.id }, + { label: 'フォロワー昇順', parameters: { sort: '+follower' }, selector: (u: UserDetailedNotMe): string => String(u.followersCount) }, + { label: 'フォロワー降順', parameters: { sort: '-follower' }, selector: (u: UserDetailedNotMe): string => String(u.followersCount) }, + { label: '登録日時昇順', parameters: { sort: '+createdAt' }, selector: (u: UserDetailedNotMe): string => u.createdAt }, + { label: '登録日時降順', parameters: { sort: '-createdAt' }, selector: (u: UserDetailedNotMe): string => u.createdAt }, + { label: '投稿日時昇順', parameters: { sort: '+updatedAt' }, selector: (u: UserDetailedNotMe): string => String(u.updatedAt) }, + { label: '投稿日時降順', parameters: { sort: '-updatedAt' }, selector: (u: UserDetailedNotMe): string => String(u.updatedAt) }, ] as const)('をリスト形式で取得することができる($label)', async ({ parameters, selector }) => { const response = await successfulApiCall({ endpoint: 'users', parameters, user: alice }); @@ -578,15 +620,15 @@ describe('ユーザー', () => { assert.deepStrictEqual(response, expected); }); test.each([ - { label: '「見つけやすくする」がOFFのユーザーが含まれない', user: () => userNotExplorable, excluded: true }, - { label: 'ミュートユーザーが含まれない', user: () => userMutedByAlice, excluded: true }, - { label: 'ブロックされているユーザーが含まれない', user: () => userBlockedByAlice, excluded: true }, - { label: 'ブロックしてきているユーザーが含まれる', user: () => userBlockingAlice, excluded: true }, - { label: '承認制ユーザーが含まれる', user: () => userLocking }, - { label: 'サイレンスユーザーが含まれる', user: () => userSilenced }, - { label: 'サスペンドユーザーが含まれない', user: () => userSuspended, excluded: true }, - { label: '削除済ユーザーが含まれる', user: () => userDeletedBySelf }, - { label: '削除済(byAdmin)ユーザーが含まれる', user: () => userDeletedByAdmin }, + { label: '「見つけやすくする」がOFFのユーザーが含まれない', user: (): User => userNotExplorable, excluded: true }, + { label: 'ミュートユーザーが含まれない', user: (): User => userMutedByAlice, excluded: true }, + { label: 'ブロックされているユーザーが含まれない', user: (): User => userBlockedByAlice, excluded: true }, + { label: 'ブロックしてきているユーザーが含まれる', user: (): User => userBlockingAlice, excluded: true }, + { label: '承認制ユーザーが含まれる', user: (): User => userLocking }, + { label: 'サイレンスユーザーが含まれる', user: (): User => userSilenced }, + { label: 'サスペンドユーザーが含まれない', user: (): User => userSuspended, excluded: true }, + { label: '削除済ユーザーが含まれる', user: (): User => userDeletedBySelf }, + { label: '削除済(byAdmin)ユーザーが含まれる', user: (): User => userDeletedByAdmin }, ] as const)('をリスト形式で取得することができ、結果に$label', async ({ user, excluded }) => { const parameters = { limit: 100 }; const response = await successfulApiCall({ endpoint: 'users', parameters, user: alice }); @@ -600,47 +642,39 @@ describe('ユーザー', () => { //#region ユーザー情報(users/show) test.each([ - { label: 'ID指定で自分自身を', parameters: () => ({ userId: alice.id }), user: () => alice, type: meDetailed }, - { label: 'ID指定で他人を', parameters: () => ({ userId: alice.id }), user: () => bob, type: userDetailedNotMeWithRelations }, - { label: 'ID指定かつ未認証', parameters: () => ({ userId: alice.id }), user: undefined, type: userDetailedNotMe }, - { label: '@指定で自分自身を', parameters: () => ({ username: alice.username }), user: () => alice, type: meDetailed }, - { label: '@指定で他人を', parameters: () => ({ username: alice.username }), user: () => bob, type: userDetailedNotMeWithRelations }, - { label: '@指定かつ未認証', parameters: () => ({ username: alice.username }), user: undefined, type: userDetailedNotMe }, + { label: 'ID指定で自分自身を', parameters: (): object => ({ userId: alice.id }), user: (): User => alice, type: meDetailed }, + { label: 'ID指定で他人を', parameters: (): object => ({ userId: alice.id }), user: (): User => bob, type: userDetailedNotMeWithRelations }, + { label: 'ID指定かつ未認証', parameters: (): object => ({ userId: alice.id }), user: undefined, type: userDetailedNotMe }, + { label: '@指定で自分自身を', parameters: (): object => ({ username: alice.username }), user: (): User => alice, type: meDetailed }, + { label: '@指定で他人を', parameters: (): object => ({ username: alice.username }), user: (): User => bob, type: userDetailedNotMeWithRelations }, + { label: '@指定かつ未認証', parameters: (): object => ({ username: alice.username }), user: undefined, type: userDetailedNotMe }, ] as const)('を取得することができる($label)', async ({ parameters, user, type }) => { const response = await successfulApiCall({ endpoint: 'users/show', parameters: parameters(), user: user?.() }); const expected = type(alice); assert.deepStrictEqual(response, expected); }); test.each([ - { label: 'Administratorになっている', user: () => userAdmin, me: () => userAdmin, selector: (user: misskey.entities.MeDetailed) => user.isAdmin }, - // @ts-expect-error UserDetailedNotMe doesn't include isAdmin - { label: '自分以外から見たときはAdministratorか判定できない', user: () => userAdmin, selector: (user: misskey.entities.UserDetailedNotMe) => user.isAdmin, expected: () => undefined }, - { label: 'Moderatorになっている', user: () => userModerator, me: () => userModerator, selector: (user: misskey.entities.MeDetailed) => user.isModerator }, - // @ts-expect-error UserDetailedNotMe doesn't include isModerator - { label: '自分以外から見たときはModeratorか判定できない', user: () => userModerator, selector: (user: misskey.entities.UserDetailedNotMe) => user.isModerator, expected: () => undefined }, - { label: '自分から見た場合に二要素認証関連のプロパティがセットされている', user: () => alice, me: () => alice, selector: (user: misskey.entities.MeDetailed) => user.twoFactorEnabled, expected: () => false }, - { label: '自分以外から見た場合に二要素認証関連のプロパティがセットされていない', user: () => alice, me: () => bob, selector: (user: misskey.entities.UserDetailedNotMe) => user.twoFactorEnabled, expected: () => undefined }, - { label: 'モデレーターから見た場合に二要素認証関連のプロパティがセットされている', user: () => alice, me: () => userModerator, selector: (user: misskey.entities.UserDetailedNotMe) => user.twoFactorEnabled, expected: () => false }, - { label: 'サイレンスになっている', user: () => userSilenced, selector: (user: misskey.entities.UserDetailed) => user.isSilenced }, - // FIXME: 落ちる - //{ label: 'サスペンドになっている', user: () => userSuspended, selector: (user: misskey.entities.UserDetailed) => user.isSuspended }, - { label: '削除済みになっている', user: () => userDeletedBySelf, me: () => userDeletedBySelf, selector: (user: misskey.entities.MeDetailed) => user.isDeleted }, - // @ts-expect-error UserDetailedNotMe doesn't include isDeleted - { label: '自分以外から見たときは削除済みか判定できない', user: () => userDeletedBySelf, selector: (user: misskey.entities.UserDetailedNotMe) => user.isDeleted, expected: () => undefined }, - { label: '削除済み(byAdmin)になっている', user: () => userDeletedByAdmin, me: () => userDeletedByAdmin, selector: (user: misskey.entities.MeDetailed) => user.isDeleted }, - // @ts-expect-error UserDetailedNotMe doesn't include isDeleted - { label: '自分以外から見たときは削除済み(byAdmin)か判定できない', user: () => userDeletedByAdmin, selector: (user: misskey.entities.UserDetailedNotMe) => user.isDeleted, expected: () => undefined }, - { label: 'フォロー中になっている', user: () => userFollowedByAlice, selector: (user: misskey.entities.UserDetailed) => user.isFollowing }, - { label: 'フォローされている', user: () => userFollowingAlice, selector: (user: misskey.entities.UserDetailed) => user.isFollowed }, - { label: 'ブロック中になっている', user: () => userBlockedByAlice, selector: (user: misskey.entities.UserDetailed) => user.isBlocking }, - { label: 'ブロックされている', user: () => userBlockingAlice, selector: (user: misskey.entities.UserDetailed) => user.isBlocked }, - { label: 'ミュート中になっている', user: () => userMutedByAlice, selector: (user: misskey.entities.UserDetailed) => user.isMuted }, - { label: 'リノートミュート中になっている', user: () => userRnMutedByAlice, selector: (user: misskey.entities.UserDetailed) => user.isRenoteMuted }, - { label: 'フォローリクエスト中になっている', user: () => userFollowRequested, me: () => userFollowRequesting, selector: (user: misskey.entities.UserDetailed) => user.hasPendingFollowRequestFromYou }, - { label: 'フォローリクエストされている', user: () => userFollowRequesting, me: () => userFollowRequested, selector: (user: misskey.entities.UserDetailed) => user.hasPendingFollowRequestToYou }, + { label: 'Administratorになっている', user: (): User => userAdmin, me: (): User => userAdmin, selector: (user: User): unknown => user.isAdmin }, + { label: '自分以外から見たときはAdministratorか判定できない', user: (): User => userAdmin, selector: (user: User): unknown => user.isAdmin, expected: (): undefined => undefined }, + { label: 'Moderatorになっている', user: (): User => userModerator, me: (): User => userModerator, selector: (user: User): unknown => user.isModerator }, + { label: '自分以外から見たときはModeratorか判定できない', user: (): User => userModerator, selector: (user: User): unknown => user.isModerator, expected: (): undefined => undefined }, + { label: 'サイレンスになっている', user: (): User => userSilenced, selector: (user: User): unknown => user.isSilenced }, + //{ label: 'サスペンドになっている', user: (): User => userSuspended, selector: (user: User): unknown => user.isSuspended }, + { label: '削除済みになっている', user: (): User => userDeletedBySelf, me: (): User => userDeletedBySelf, selector: (user: User): unknown => user.isDeleted }, + { label: '自分以外から見たときは削除済みか判定できない', user: (): User => userDeletedBySelf, selector: (user: User): unknown => user.isDeleted, expected: (): undefined => undefined }, + { label: '削除済み(byAdmin)になっている', user: (): User => userDeletedByAdmin, me: (): User => userDeletedByAdmin, selector: (user: User): unknown => user.isDeleted }, + { label: '自分以外から見たときは削除済み(byAdmin)か判定できない', user: (): User => userDeletedByAdmin, selector: (user: User): unknown => user.isDeleted, expected: (): undefined => undefined }, + { label: 'フォロー中になっている', user: (): User => userFollowedByAlice, selector: (user: User): unknown => user.isFollowing }, + { label: 'フォローされている', user: (): User => userFollowingAlice, selector: (user: User): unknown => user.isFollowed }, + { label: 'ブロック中になっている', user: (): User => userBlockedByAlice, selector: (user: User): unknown => user.isBlocking }, + { label: 'ブロックされている', user: (): User => userBlockingAlice, selector: (user: User): unknown => user.isBlocked }, + { label: 'ミュート中になっている', user: (): User => userMutedByAlice, selector: (user: User): unknown => user.isMuted }, + { label: 'リノートミュート中になっている', user: (): User => userRnMutedByAlice, selector: (user: User): unknown => user.isRenoteMuted }, + { label: 'フォローリクエスト中になっている', user: (): User => userFollowRequested, me: (): User => userFollowRequesting, selector: (user: User): unknown => user.hasPendingFollowRequestFromYou }, + { label: 'フォローリクエストされている', user: (): User => userFollowRequesting, me: (): User => userFollowRequested, selector: (user: User): unknown => user.hasPendingFollowRequestToYou }, ] as const)('を取得することができ、$labelこと', async ({ user, me, selector, expected }) => { const response = await successfulApiCall({ endpoint: 'users/show', parameters: { userId: user().id }, user: me?.() ?? alice }); - assert.strictEqual(selector(response as any), (expected ?? ((): true => true))()); + assert.strictEqual(selector(response), (expected ?? ((): true => true))()); }); test('を取得することができ、Publicなロールがセットされていること', async () => { const response = await successfulApiCall({ endpoint: 'users/show', parameters: { userId: userRolePublic.id }, user: alice }); @@ -663,16 +697,7 @@ describe('ユーザー', () => { iconUrl: roleBadge.iconUrl, displayOrder: roleBadge.displayOrder, }]); - assert.deepStrictEqual(response.roles, [{ - id: roleBadge.id, - name: roleBadge.name, - color: roleBadge.color, - iconUrl: roleBadge.iconUrl, - description: roleBadge.description, - isModerator: roleBadge.isModerator, - isAdministrator: roleBadge.isAdministrator, - displayOrder: roleBadge.displayOrder, - }]); + assert.deepStrictEqual(response.roles, []); // バッヂだからといってrolesが取れるとは限らない }); test('をID指定のリスト形式で取得することができる(空)', async () => { const parameters = { userIds: [] }; @@ -691,18 +716,17 @@ describe('ユーザー', () => { assert.deepStrictEqual(response, expected); }); test.each([ - { label: '「見つけやすくする」がOFFのユーザーが含まれる', user: () => userNotExplorable }, - { label: 'ミュートユーザーが含まれる', user: () => userMutedByAlice }, - { label: 'ブロックされているユーザーが含まれる', user: () => userBlockedByAlice }, - { label: 'ブロックしてきているユーザーが含まれる', user: () => userBlockingAlice }, - { label: '承認制ユーザーが含まれる', user: () => userLocking }, - { label: 'サイレンスユーザーが含まれる', user: () => userSilenced }, - { label: 'サスペンドユーザーが(モデレーターが見るときは)含まれる', user: () => userSuspended, me: () => root }, + { label: '「見つけやすくする」がOFFのユーザーが含まれる', user: (): User => userNotExplorable }, + { label: 'ミュートユーザーが含まれる', user: (): User => userMutedByAlice }, + { label: 'ブロックされているユーザーが含まれる', user: (): User => userBlockedByAlice }, + { label: 'ブロックしてきているユーザーが含まれる', user: (): User => userBlockingAlice }, + { label: '承認制ユーザーが含まれる', user: (): User => userLocking }, + { label: 'サイレンスユーザーが含まれる', user: (): User => userSilenced }, + { label: 'サスペンドユーザーが(モデレーターが見るときは)含まれる', user: (): User => userSuspended, me: (): User => root }, // BUG サスペンドユーザーを一般ユーザーから見るとrootユーザーが返ってくる - //{ label: 'サスペンドユーザーが(一般ユーザーが見るときは)含まれない', user: () => userSuspended, me: () => bob, excluded: true }, - { label: '削除済ユーザーが含まれる', user: () => userDeletedBySelf }, - { label: '削除済(byAdmin)ユーザーが含まれる', user: () => userDeletedByAdmin }, - // @ts-expect-error excluded は上でコメントアウトされているので + //{ label: 'サスペンドユーザーが(一般ユーザーが見るときは)含まれない', user: (): User => userSuspended, me: (): User => bob, excluded: true }, + { label: '削除済ユーザーが含まれる', user: (): User => userDeletedBySelf }, + { label: '削除済(byAdmin)ユーザーが含まれる', user: (): User => userDeletedByAdmin }, ] as const)('をID指定のリスト形式で取得することができ、結果に$label', async ({ user, me, excluded }) => { const parameters = { userIds: [user().id] }; const response = await successfulApiCall({ endpoint: 'users/show', parameters, user: me?.() ?? alice }); @@ -727,15 +751,15 @@ describe('ユーザー', () => { assert.deepStrictEqual(response, expected); }); test.each([ - { label: '「見つけやすくする」がOFFのユーザーが含まれる', user: () => userNotExplorable }, - { label: 'ミュートユーザーが含まれる', user: () => userMutedByAlice }, - { label: 'ブロックされているユーザーが含まれる', user: () => userBlockedByAlice }, - { label: 'ブロックしてきているユーザーが含まれる', user: () => userBlockingAlice }, - { label: '承認制ユーザーが含まれる', user: () => userLocking }, - { label: 'サイレンスユーザーが含まれる', user: () => userSilenced }, - { label: 'サスペンドユーザーが含まれない', user: () => userSuspended, excluded: true }, - { label: '削除済ユーザーが含まれる', user: () => userDeletedBySelf }, - { label: '削除済(byAdmin)ユーザーが含まれる', user: () => userDeletedByAdmin }, + { label: '「見つけやすくする」がOFFのユーザーが含まれる', user: (): User => userNotExplorable }, + { label: 'ミュートユーザーが含まれる', user: (): User => userMutedByAlice }, + { label: 'ブロックされているユーザーが含まれる', user: (): User => userBlockedByAlice }, + { label: 'ブロックしてきているユーザーが含まれる', user: (): User => userBlockingAlice }, + { label: '承認制ユーザーが含まれる', user: (): User => userLocking }, + { label: 'サイレンスユーザーが含まれる', user: (): User => userSilenced }, + { label: 'サスペンドユーザーが含まれない', user: (): User => userSuspended, excluded: true }, + { label: '削除済ユーザーが含まれる', user: (): User => userDeletedBySelf }, + { label: '削除済(byAdmin)ユーザーが含まれる', user: (): User => userDeletedByAdmin }, ] as const)('を検索することができ、結果に$labelが含まれる', async ({ user, excluded }) => { const parameters = { query: user().username, limit: 1 }; const response = await successfulApiCall({ endpoint: 'users/search', parameters, user: alice }); @@ -749,30 +773,30 @@ describe('ユーザー', () => { //#region ID指定検索(users/search-by-username-and-host) test.each([ - { label: '自分', parameters: { username: 'alice' }, user: () => [alice] }, - { label: '自分かつusernameが大文字', parameters: { username: 'ALICE' }, user: () => [alice] }, - { label: 'ローカルのフォロイーでノートなし', parameters: { username: 'userFollowedByAlice' }, user: () => [userFollowedByAlice] }, - { label: 'ローカルでノートなしは検索に載らない', parameters: { username: 'userNoNote' }, user: () => [] }, - { label: 'ローカルの他人1', parameters: { username: 'bob' }, user: () => [bob] }, - { label: 'ローカルの他人2', parameters: { username: 'bob', host: null }, user: () => [bob] }, - { label: 'ローカルの他人3', parameters: { username: 'bob', host: '.' }, user: () => [bob] }, - { label: 'ローカル', parameters: { host: null, limit: 1 }, user: () => [userFollowedByAlice] }, - { label: 'ローカル', parameters: { host: '.', limit: 1 }, user: () => [userFollowedByAlice] }, + { label: '自分', parameters: { username: 'alice' }, user: (): User[] => [alice] }, + { label: '自分かつusernameが大文字', parameters: { username: 'ALICE' }, user: (): User[] => [alice] }, + { label: 'ローカルのフォロイーでノートなし', parameters: { username: 'userFollowedByAlice' }, user: (): User[] => [userFollowedByAlice] }, + { label: 'ローカルでノートなしは検索に載らない', parameters: { username: 'userNoNote' }, user: (): User[] => [] }, + { label: 'ローカルの他人1', parameters: { username: 'bob' }, user: (): User[] => [bob] }, + { label: 'ローカルの他人2', parameters: { username: 'bob', host: null }, user: (): User[] => [bob] }, + { label: 'ローカルの他人3', parameters: { username: 'bob', host: '.' }, user: (): User[] => [bob] }, + { label: 'ローカル', parameters: { host: null, limit: 1 }, user: (): User[] => [userFollowedByAlice] }, + { label: 'ローカル', parameters: { host: '.', limit: 1 }, user: (): User[] => [userFollowedByAlice] }, ])('をID&ホスト指定で検索できる($label)', async ({ parameters, user }) => { const response = await successfulApiCall({ endpoint: 'users/search-by-username-and-host', parameters, user: alice }); const expected = await Promise.all(user().map(u => show(u.id, alice))); assert.deepStrictEqual(response, expected); }); test.each([ - { label: '「見つけやすくする」がOFFのユーザーが含まれる', user: () => userNotExplorable }, - { label: 'ミュートユーザーが含まれる', user: () => userMutedByAlice }, - { label: 'ブロックされているユーザーが含まれる', user: () => userBlockedByAlice }, - { label: 'ブロックしてきているユーザーが含まれる', user: () => userBlockingAlice }, - { label: '承認制ユーザーが含まれる', user: () => userLocking }, - { label: 'サイレンスユーザーが含まれる', user: () => userSilenced }, - { label: 'サスペンドユーザーが含まれない', user: () => userSuspended, excluded: true }, - { label: '削除済ユーザーが含まれる', user: () => userDeletedBySelf }, - { label: '削除済(byAdmin)ユーザーが含まれる', user: () => userDeletedByAdmin }, + { label: '「見つけやすくする」がOFFのユーザーが含まれる', user: (): User => userNotExplorable }, + { label: 'ミュートユーザーが含まれる', user: (): User => userMutedByAlice }, + { label: 'ブロックされているユーザーが含まれる', user: (): User => userBlockedByAlice }, + { label: 'ブロックしてきているユーザーが含まれる', user: (): User => userBlockingAlice }, + { label: '承認制ユーザーが含まれる', user: (): User => userLocking }, + { label: 'サイレンスユーザーが含まれる', user: (): User => userSilenced }, + { label: 'サスペンドユーザーが含まれない', user: (): User => userSuspended, excluded: true }, + { label: '削除済ユーザーが含まれる', user: (): User => userDeletedBySelf }, + { label: '削除済(byAdmin)ユーザーが含まれる', user: (): User => userDeletedByAdmin }, ] as const)('をID&ホスト指定で検索でき、結果に$label', async ({ user, excluded }) => { const parameters = { username: user().username }; const response = await successfulApiCall({ endpoint: 'users/search-by-username-and-host', parameters, user: alice }); @@ -794,15 +818,15 @@ describe('ユーザー', () => { assert.deepStrictEqual(response, expected); }); test.each([ - { label: '「見つけやすくする」がOFFのユーザーが含まれる', user: () => userNotExplorable }, - { label: 'ミュートユーザーが含まれる', user: () => userMutedByAlice }, - { label: 'ブロックされているユーザーが含まれる', user: () => userBlockedByAlice }, - { label: 'ブロックしてきているユーザーが含まれない', user: () => userBlockingAlice, excluded: true }, - { label: '承認制ユーザーが含まれる', user: () => userLocking }, - { label: 'サイレンスユーザーが含まれる', user: () => userSilenced }, - //{ label: 'サスペンドユーザーが含まれない', user: () => userSuspended, excluded: true }, - { label: '削除済ユーザーが含まれる', user: () => userDeletedBySelf }, - { label: '削除済(byAdmin)ユーザーが含まれる', user: () => userDeletedByAdmin }, + { label: '「見つけやすくする」がOFFのユーザーが含まれる', user: (): User => userNotExplorable }, + { label: 'ミュートユーザーが含まれる', user: (): User => userMutedByAlice }, + { label: 'ブロックされているユーザーが含まれる', user: (): User => userBlockedByAlice }, + { label: 'ブロックしてきているユーザーが含まれない', user: (): User => userBlockingAlice, excluded: true }, + { label: '承認制ユーザーが含まれる', user: (): User => userLocking }, + { label: 'サイレンスユーザーが含まれる', user: (): User => userSilenced }, + //{ label: 'サスペンドユーザーが含まれない', user: (): User => userSuspended, excluded: true }, + { label: '削除済ユーザーが含まれる', user: (): User => userDeletedBySelf }, + { label: '削除済(byAdmin)ユーザーが含まれる', user: (): User => userDeletedByAdmin }, ] as const)('がよくリプライをするユーザーのリストを取得でき、結果に$label', async ({ user, excluded }) => { const replyTo = (await successfulApiCall({ endpoint: 'users/notes', parameters: { userId: user().id }, user: undefined }))[0]; await post(alice, { text: `@${user().username} test`, replyId: replyTo.id }); @@ -816,12 +840,12 @@ describe('ユーザー', () => { //#region ハッシュタグ(hashtags/users) test.each([ - { label: 'フォロワー昇順', sort: { sort: '+follower' }, selector: (u: misskey.entities.UserDetailedNotMe): string => String(u.followersCount) }, - { label: 'フォロワー降順', sort: { sort: '-follower' }, selector: (u: misskey.entities.UserDetailedNotMe): string => String(u.followersCount) }, - { label: '登録日時昇順', sort: { sort: '+createdAt' }, selector: (u: misskey.entities.UserDetailedNotMe): string => u.createdAt }, - { label: '登録日時降順', sort: { sort: '-createdAt' }, selector: (u: misskey.entities.UserDetailedNotMe): string => u.createdAt }, - { label: '投稿日時昇順', sort: { sort: '+updatedAt' }, selector: (u: misskey.entities.UserDetailedNotMe): string => String(u.updatedAt) }, - { label: '投稿日時降順', sort: { sort: '-updatedAt' }, selector: (u: misskey.entities.UserDetailedNotMe): string => String(u.updatedAt) }, + { label: 'フォロワー昇順', sort: { sort: '+follower' }, selector: (u: UserDetailedNotMe): string => String(u.followersCount) }, + { label: 'フォロワー降順', sort: { sort: '-follower' }, selector: (u: UserDetailedNotMe): string => String(u.followersCount) }, + { label: '登録日時昇順', sort: { sort: '+createdAt' }, selector: (u: UserDetailedNotMe): string => u.createdAt }, + { label: '登録日時降順', sort: { sort: '-createdAt' }, selector: (u: UserDetailedNotMe): string => u.createdAt }, + { label: '投稿日時昇順', sort: { sort: '+updatedAt' }, selector: (u: UserDetailedNotMe): string => String(u.updatedAt) }, + { label: '投稿日時降順', sort: { sort: '-updatedAt' }, selector: (u: UserDetailedNotMe): string => String(u.updatedAt) }, ] as const)('をハッシュタグ指定で取得することができる($label)', async ({ sort, selector }) => { const hashtag = 'test_hashtag'; await successfulApiCall({ endpoint: 'i/update', parameters: { description: `#${hashtag}` }, user: alice }); @@ -835,15 +859,15 @@ describe('ユーザー', () => { assert.deepStrictEqual(response, expected); }); test.each([ - { label: '「見つけやすくする」がOFFのユーザーが含まれる', user: () => userNotExplorable }, - { label: 'ミュートユーザーが含まれる', user: () => userMutedByAlice }, - { label: 'ブロックされているユーザーが含まれる', user: () => userBlockedByAlice }, - { label: 'ブロックしてきているユーザーが含まれる', user: () => userBlockingAlice }, - { label: '承認制ユーザーが含まれる', user: () => userLocking }, - { label: 'サイレンスユーザーが含まれる', user: () => userSilenced }, - { label: 'サスペンドユーザーが含まれない', user: () => userSuspended, excluded: true }, - { label: '削除済ユーザーが含まれる', user: () => userDeletedBySelf }, - { label: '削除済(byAdmin)ユーザーが含まれる', user: () => userDeletedByAdmin }, + { label: '「見つけやすくする」がOFFのユーザーが含まれる', user: (): User => userNotExplorable }, + { label: 'ミュートユーザーが含まれる', user: (): User => userMutedByAlice }, + { label: 'ブロックされているユーザーが含まれる', user: (): User => userBlockedByAlice }, + { label: 'ブロックしてきているユーザーが含まれる', user: (): User => userBlockingAlice }, + { label: '承認制ユーザーが含まれる', user: (): User => userLocking }, + { label: 'サイレンスユーザーが含まれる', user: (): User => userSilenced }, + { label: 'サスペンドユーザーが含まれない', user: (): User => userSuspended, excluded: true }, + { label: '削除済ユーザーが含まれる', user: (): User => userDeletedBySelf }, + { label: '削除済(byAdmin)ユーザーが含まれる', user: (): User => userDeletedByAdmin }, ] as const)('をハッシュタグ指定で取得することができ、結果に$label', async ({ user, excluded }) => { const hashtag = `user_test${user().username}`; if (user() !== userSuspended) { diff --git a/packages/backend/test/e2e/well-known.ts b/packages/backend/test/e2e/well-known.ts index bdb298dfe4..14e32e1627 100644 --- a/packages/backend/test/e2e/well-known.ts +++ b/packages/backend/test/e2e/well-known.ts @@ -1,21 +1,29 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; -import { host, origin, relativeFetch, signup } from '../utils.js'; +import { host, origin, relativeFetch, signup, startServer } from '../utils.js'; +import type { INestApplicationContext } from '@nestjs/common'; import type * as misskey from 'misskey-js'; describe('.well-known', () => { + let app: INestApplicationContext; let alice: misskey.entities.User; beforeAll(async () => { + app = await startServer(); + alice = await signup({ username: 'alice' }); }, 1000 * 60 * 2); + afterAll(async () => { + await app.close(); + }); + test('nodeinfo', async () => { const res = await relativeFetch('.well-known/nodeinfo'); assert.ok(res.ok); diff --git a/packages/backend/test/eslint.config.js b/packages/backend/test/eslint.config.js deleted file mode 100644 index a0f43babad..0000000000 --- a/packages/backend/test/eslint.config.js +++ /dev/null @@ -1,22 +0,0 @@ -import globals from 'globals'; -import tsParser from '@typescript-eslint/parser'; -import sharedConfig from '../../shared/eslint.config.js'; - -export default [ - ...sharedConfig, - { - files: ['**/*.ts', '**/*.tsx'], - languageOptions: { - globals: { - ...globals.node, - ...globals.jest, - }, - parserOptions: { - parser: tsParser, - project: ['./tsconfig.json'], - sourceType: 'module', - tsconfigRootDir: import.meta.dirname, - }, - }, - }, -]; diff --git a/packages/backend/test/global.d.ts b/packages/backend/test/global.d.ts deleted file mode 100644 index 0363073356..0000000000 --- a/packages/backend/test/global.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -type FIXME = any; diff --git a/packages/backend/test/jest.setup.ts b/packages/backend/test/jest.setup.ts deleted file mode 100644 index 7c6dd6a55f..0000000000 --- a/packages/backend/test/jest.setup.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { initTestDb, sendEnvResetRequest } from './utils.js'; - -beforeAll(async () => { - await initTestDb(false); - await sendEnvResetRequest(); -}); diff --git a/packages/backend/test/misc/mock-resolver.ts b/packages/backend/test/misc/mock-resolver.ts index c8f3db8aac..7cba7a2aa8 100644 --- a/packages/backend/test/misc/mock-resolver.ts +++ b/packages/backend/test/misc/mock-resolver.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -15,14 +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 { - FollowRequestsRepository, - MiMeta, - NoteReactionsRepository, - NotesRepository, - PollsRepository, - UsersRepository, -} from '@/models/_.js'; +import type { NoteReactionsRepository, NotesRepository, PollsRepository, UsersRepository, FollowRequestsRepository } from '@/models/_.js'; type MockResponse = { type: string; @@ -36,7 +29,6 @@ export class MockResolver extends Resolver { constructor(loggerService: LoggerService) { super( {} as Config, - {} as MiMeta, {} as UsersRepository, {} as NotesRepository, {} as PollsRepository, @@ -44,6 +36,7 @@ export class MockResolver extends Resolver { {} as FollowRequestsRepository, {} as UtilityService, {} as InstanceActorService, + {} as MetaService, {} as ApRequestService, {} as HttpRequestService, {} as ApRendererService, diff --git a/packages/backend/test/prelude/get-api-validator.ts b/packages/backend/test/prelude/get-api-validator.ts index 7aa7a92702..cccd63299a 100644 --- a/packages/backend/test/prelude/get-api-validator.ts +++ b/packages/backend/test/prelude/get-api-validator.ts @@ -1,13 +1,13 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import Ajv from 'ajv'; -import { Schema } from '@/misc/json-schema.js'; +import { Schema } from '@/misc/schema'; export const getValidator = (paramDef: Schema) => { - const ajv = new Ajv.default({ + const ajv = new Ajv({ useDefaults: true, }); ajv.addFormat('misskey:id', /^[a-zA-Z0-9]+$/); diff --git a/packages/backend/test/prelude/maybe.ts b/packages/backend/test/prelude/maybe.ts new file mode 100644 index 0000000000..37ccfbf7fe --- /dev/null +++ b/packages/backend/test/prelude/maybe.ts @@ -0,0 +1,23 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import * as assert from 'assert'; +import { just, nothing } from '../../src/misc/prelude/maybe.js'; + +describe('just', () => { + test('has a value', () => { + assert.deepStrictEqual(just(3).isJust(), true); + }); + + test('has the inverse called get', () => { + assert.deepStrictEqual(just(3).get(), 3); + }); +}); + +describe('nothing', () => { + test('has no value', () => { + assert.deepStrictEqual(nothing().isJust(), false); + }); +}); diff --git a/packages/backend/test/prelude/url.ts b/packages/backend/test/prelude/url.ts index b26ae09444..340c6451ce 100644 --- a/packages/backend/test/prelude/url.ts +++ b/packages/backend/test/prelude/url.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/test/resources/192.jpg b/packages/backend/test/resources/192.jpg deleted file mode 100644 index 76374628e0..0000000000 Binary files a/packages/backend/test/resources/192.jpg and /dev/null differ diff --git a/packages/backend/test/resources/192.png b/packages/backend/test/resources/192.png deleted file mode 100644 index 15fd1e3731..0000000000 Binary files a/packages/backend/test/resources/192.png and /dev/null differ diff --git a/packages/backend/test/resources/Lenna.jpg b/packages/backend/test/resources/Lenna.jpg new file mode 100644 index 0000000000..6b5b32281c Binary files /dev/null and b/packages/backend/test/resources/Lenna.jpg differ diff --git a/packages/backend/test/resources/Lenna.png b/packages/backend/test/resources/Lenna.png new file mode 100644 index 0000000000..59ef68aabd Binary files /dev/null and b/packages/backend/test/resources/Lenna.png differ diff --git a/packages/backend/test/resources/kick_gaba7.m4a b/packages/backend/test/resources/kick_gaba7.m4a deleted file mode 100644 index 321df6349f..0000000000 Binary files a/packages/backend/test/resources/kick_gaba7.m4a and /dev/null differ diff --git a/packages/backend/test/tsconfig.json b/packages/backend/test/tsconfig.json index 2b562acda8..4597ff8780 100644 --- a/packages/backend/test/tsconfig.json +++ b/packages/backend/test/tsconfig.json @@ -5,7 +5,7 @@ "noImplicitAny": true, "noImplicitReturns": true, "noUnusedParameters": false, - "noUnusedLocals": false, + "noUnusedLocals": true, "noFallthroughCasesInSwitch": true, "declaration": false, "sourceMap": true, @@ -18,7 +18,6 @@ "strict": true, "strictNullChecks": true, "strictPropertyInitialization": false, - "skipLibCheck": true, "experimentalDecorators": true, "emitDecoratorMetadata": true, "resolveJsonModule": true, diff --git a/packages/backend/test/unit/AbuseReportNotificationService.ts b/packages/backend/test/unit/AbuseReportNotificationService.ts deleted file mode 100644 index 235af29f0d..0000000000 --- a/packages/backend/test/unit/AbuseReportNotificationService.ts +++ /dev/null @@ -1,347 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { jest } from '@jest/globals'; -import { Test, TestingModule } from '@nestjs/testing'; -import { randomString } from '../utils.js'; -import { AbuseReportNotificationService } from '@/core/AbuseReportNotificationService.js'; -import { - AbuseReportNotificationRecipientRepository, - MiAbuseReportNotificationRecipient, - MiSystemWebhook, - MiUser, - SystemWebhooksRepository, - UserProfilesRepository, - UsersRepository, -} from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; -import { GlobalModule } from '@/GlobalModule.js'; -import { IdService } from '@/core/IdService.js'; -import { EmailService } from '@/core/EmailService.js'; -import { RoleService } from '@/core/RoleService.js'; -import { MetaService } from '@/core/MetaService.js'; -import { ModerationLogService } from '@/core/ModerationLogService.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; -import { RecipientMethod } from '@/models/AbuseReportNotificationRecipient.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; - -process.env.NODE_ENV = 'test'; - -describe('AbuseReportNotificationService', () => { - let app: TestingModule; - let service: AbuseReportNotificationService; - - // -------------------------------------------------------------------------------------- - - let usersRepository: UsersRepository; - let userProfilesRepository: UserProfilesRepository; - let systemWebhooksRepository: SystemWebhooksRepository; - let abuseReportNotificationRecipientRepository: AbuseReportNotificationRecipientRepository; - let idService: IdService; - let roleService: jest.Mocked; - let emailService: jest.Mocked; - let webhookService: jest.Mocked; - - // -------------------------------------------------------------------------------------- - - let root: MiUser; - let alice: MiUser; - let bob: MiUser; - let systemWebhook1: MiSystemWebhook; - let systemWebhook2: MiSystemWebhook; - - // -------------------------------------------------------------------------------------- - - async function createUser(data: Partial = {}) { - const user = await usersRepository - .insert({ - id: idService.gen(), - ...data, - }) - .then(x => usersRepository.findOneByOrFail(x.identifiers[0])); - - await userProfilesRepository.insert({ - userId: user.id, - }); - - return user; - } - - async function createWebhook(data: Partial = {}) { - return systemWebhooksRepository - .insert({ - id: idService.gen(), - name: randomString(), - on: ['abuseReport'], - url: 'https://example.com', - secret: randomString(), - ...data, - }) - .then(x => systemWebhooksRepository.findOneByOrFail(x.identifiers[0])); - } - - async function createRecipient(data: Partial = {}) { - return abuseReportNotificationRecipientRepository - .insert({ - id: idService.gen(), - isActive: true, - name: randomString(), - ...data, - }) - .then(x => abuseReportNotificationRecipientRepository.findOneByOrFail(x.identifiers[0])); - } - - // -------------------------------------------------------------------------------------- - - beforeAll(async () => { - app = await Test - .createTestingModule({ - imports: [ - GlobalModule, - ], - providers: [ - AbuseReportNotificationService, - IdService, - { - provide: RoleService, useFactory: () => ({ getModeratorIds: jest.fn() }), - }, - { - provide: SystemWebhookService, useFactory: () => ({ enqueueSystemWebhook: jest.fn() }), - }, - { - provide: UserEntityService, useFactory: () => ({ pack: (v: any) => v }), - }, - { - provide: EmailService, useFactory: () => ({ sendEmail: jest.fn() }), - }, - { - provide: MetaService, useFactory: () => ({ fetch: jest.fn() }), - }, - { - provide: ModerationLogService, useFactory: () => ({ log: () => Promise.resolve() }), - }, - { - provide: GlobalEventService, useFactory: () => ({ publishAdminStream: jest.fn() }), - }, - ], - }) - .compile(); - - usersRepository = app.get(DI.usersRepository); - userProfilesRepository = app.get(DI.userProfilesRepository); - systemWebhooksRepository = app.get(DI.systemWebhooksRepository); - abuseReportNotificationRecipientRepository = app.get(DI.abuseReportNotificationRecipientRepository); - - service = app.get(AbuseReportNotificationService); - idService = app.get(IdService); - roleService = app.get(RoleService) as jest.Mocked; - emailService = app.get(EmailService) as jest.Mocked; - webhookService = app.get(SystemWebhookService) as jest.Mocked; - - app.enableShutdownHooks(); - }); - - beforeEach(async () => { - root = await createUser({ username: 'root', usernameLower: 'root', isRoot: true }); - alice = await createUser({ username: 'alice', usernameLower: 'alice', isRoot: false }); - bob = await createUser({ username: 'bob', usernameLower: 'bob', isRoot: false }); - systemWebhook1 = await createWebhook(); - systemWebhook2 = await createWebhook(); - - roleService.getModeratorIds.mockResolvedValue([root.id, alice.id, bob.id]); - }); - - afterEach(async () => { - emailService.sendEmail.mockClear(); - webhookService.enqueueSystemWebhook.mockClear(); - - await usersRepository.delete({}); - await userProfilesRepository.delete({}); - await systemWebhooksRepository.delete({}); - await abuseReportNotificationRecipientRepository.delete({}); - }); - - afterAll(async () => { - await app.close(); - }); - - // -------------------------------------------------------------------------------------- - - describe('createRecipient', () => { - test('作成成功1', async () => { - const params = { - isActive: true, - name: randomString(), - method: 'email' as RecipientMethod, - userId: alice.id, - systemWebhookId: null, - }; - - const recipient1 = await service.createRecipient(params, root); - expect(recipient1).toMatchObject(params); - }); - - test('作成成功2', async () => { - const params = { - isActive: true, - name: randomString(), - method: 'webhook' as RecipientMethod, - userId: null, - systemWebhookId: systemWebhook1.id, - }; - - const recipient1 = await service.createRecipient(params, root); - expect(recipient1).toMatchObject(params); - }); - }); - - describe('updateRecipient', () => { - test('更新成功1', async () => { - const recipient1 = await createRecipient({ - method: 'email', - userId: alice.id, - }); - - const params = { - id: recipient1.id, - isActive: false, - name: randomString(), - method: 'email' as RecipientMethod, - userId: bob.id, - systemWebhookId: null, - }; - - const recipient2 = await service.updateRecipient(params, root); - expect(recipient2).toMatchObject(params); - }); - - test('更新成功2', async () => { - const recipient1 = await createRecipient({ - method: 'webhook', - systemWebhookId: systemWebhook1.id, - }); - - const params = { - id: recipient1.id, - isActive: false, - name: randomString(), - method: 'webhook' as RecipientMethod, - userId: null, - systemWebhookId: systemWebhook2.id, - }; - - const recipient2 = await service.updateRecipient(params, root); - expect(recipient2).toMatchObject(params); - }); - }); - - describe('deleteRecipient', () => { - test('削除成功1', async () => { - const recipient1 = await createRecipient({ - method: 'email', - userId: alice.id, - }); - - await service.deleteRecipient(recipient1.id, root); - - await expect(abuseReportNotificationRecipientRepository.findOneBy({ id: recipient1.id })).resolves.toBeNull(); - }); - }); - - describe('fetchRecipients', () => { - async function create() { - const recipient1 = await createRecipient({ - method: 'email', - userId: alice.id, - }); - const recipient2 = await createRecipient({ - method: 'email', - userId: bob.id, - }); - - const recipient3 = await createRecipient({ - method: 'webhook', - systemWebhookId: systemWebhook1.id, - }); - const recipient4 = await createRecipient({ - method: 'webhook', - systemWebhookId: systemWebhook2.id, - }); - - return [recipient1, recipient2, recipient3, recipient4]; - } - - test('フィルタなし', async () => { - const [recipient1, recipient2, recipient3, recipient4] = await create(); - - const recipients = await service.fetchRecipients({}); - expect(recipients).toEqual([recipient1, recipient2, recipient3, recipient4]); - }); - - test('フィルタなし(非モデレータは除外される)', async () => { - roleService.getModeratorIds.mockClear(); - roleService.getModeratorIds.mockResolvedValue([root.id, bob.id]); - - const [recipient1, recipient2, recipient3, recipient4] = await create(); - - const recipients = await service.fetchRecipients({}); - // aliceはモデレータではないので除外される - expect(recipients).toEqual([recipient2, recipient3, recipient4]); - }); - - test('フィルタなし(非モデレータでも除外されないオプション設定)', async () => { - roleService.getModeratorIds.mockClear(); - roleService.getModeratorIds.mockResolvedValue([root.id, bob.id]); - - const [recipient1, recipient2, recipient3, recipient4] = await create(); - - const recipients = await service.fetchRecipients({}, { removeUnauthorized: false }); - expect(recipients).toEqual([recipient1, recipient2, recipient3, recipient4]); - }); - - test('emailのみ', async () => { - const [recipient1, recipient2, recipient3, recipient4] = await create(); - - const recipients = await service.fetchRecipients({ method: ['email'] }); - expect(recipients).toEqual([recipient1, recipient2]); - }); - - test('webhookのみ', async () => { - const [recipient1, recipient2, recipient3, recipient4] = await create(); - - const recipients = await service.fetchRecipients({ method: ['webhook'] }); - expect(recipients).toEqual([recipient3, recipient4]); - }); - - test('すべて', async () => { - const [recipient1, recipient2, recipient3, recipient4] = await create(); - - const recipients = await service.fetchRecipients({ method: ['email', 'webhook'] }); - expect(recipients).toEqual([recipient1, recipient2, recipient3, recipient4]); - }); - - test('ID指定', async () => { - const [recipient1, recipient2, recipient3, recipient4] = await create(); - - const recipients = await service.fetchRecipients({ ids: [recipient1.id, recipient3.id] }); - expect(recipients).toEqual([recipient1, recipient3]); - }); - - test('ID指定(method=emailではないIDが混ざりこまない)', async () => { - const [recipient1, recipient2, recipient3, recipient4] = await create(); - - const recipients = await service.fetchRecipients({ ids: [recipient1.id, recipient3.id], method: ['email'] }); - expect(recipients).toEqual([recipient1]); - }); - - test('ID指定(method=webhookではないIDが混ざりこまない)', async () => { - const [recipient1, recipient2, recipient3, recipient4] = await create(); - - const recipients = await service.fetchRecipients({ ids: [recipient1.id, recipient3.id], method: ['webhook'] }); - expect(recipients).toEqual([recipient3]); - }); - }); -}); diff --git a/packages/backend/test/unit/AnnouncementService.ts b/packages/backend/test/unit/AnnouncementService.ts index 81da0fac31..f2aa5d35e4 100644 --- a/packages/backend/test/unit/AnnouncementService.ts +++ b/packages/backend/test/unit/AnnouncementService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,14 +10,7 @@ import { ModuleMocker } from 'jest-mock'; import { Test } from '@nestjs/testing'; import { GlobalModule } from '@/GlobalModule.js'; import { AnnouncementService } from '@/core/AnnouncementService.js'; -import { AnnouncementEntityService } from '@/core/entities/AnnouncementEntityService.js'; -import type { - AnnouncementReadsRepository, - AnnouncementsRepository, - MiAnnouncement, - MiUser, - UsersRepository, -} from '@/models/_.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'; @@ -52,7 +45,7 @@ describe('AnnouncementService', () => { function createAnnouncement(data: Partial = {}) { return announcementsRepository.insert({ - id: genAidx(data.createdAt?.getTime() ?? Date.now()), + id: genAidx(data.createdAt ?? new Date()), updatedAt: null, title: 'Title', text: 'Text', @@ -68,7 +61,6 @@ describe('AnnouncementService', () => { ], providers: [ AnnouncementService, - AnnouncementEntityService, CacheService, IdService, ], diff --git a/packages/backend/test/unit/ApMfmService.ts b/packages/backend/test/unit/ApMfmService.ts deleted file mode 100644 index e81a321c9b..0000000000 --- a/packages/backend/test/unit/ApMfmService.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import * as assert from 'assert'; -import { Test } from '@nestjs/testing'; - -import { CoreModule } from '@/core/CoreModule.js'; -import { ApMfmService } from '@/core/activitypub/ApMfmService.js'; -import { GlobalModule } from '@/GlobalModule.js'; -import { MiNote } from '@/models/Note.js'; - -describe('ApMfmService', () => { - let apMfmService: ApMfmService; - - beforeAll(async () => { - const app = await Test.createTestingModule({ - imports: [GlobalModule, CoreModule], - }).compile(); - apMfmService = app.get(ApMfmService); - }); - - describe('getNoteHtml', () => { - test('Do not provide _misskey_content for simple text', () => { - const note = { - text: 'テキスト #タグ @mention 🍊 :emoji: https://example.com', - mentionedRemoteUsers: '[]', - }; - - const { content, noMisskeyContent } = apMfmService.getNoteHtml(note); - - assert.equal(noMisskeyContent, true, 'noMisskeyContent'); - assert.equal(content, '

テキスト @mention 🍊 ​:emoji:​ https://example.com

', 'content'); - }); - - test('Provide _misskey_content for MFM', () => { - const note = { - text: '$[tada foo]', - mentionedRemoteUsers: '[]', - }; - - const { content, noMisskeyContent } = apMfmService.getNoteHtml(note); - - assert.equal(noMisskeyContent, false, 'noMisskeyContent'); - assert.equal(content, '

foo

', 'content'); - }); - }); -}); diff --git a/packages/backend/test/unit/DriveService.ts b/packages/backend/test/unit/DriveService.ts index 964c65ccaa..7234da2e36 100644 --- a/packages/backend/test/unit/DriveService.ts +++ b/packages/backend/test/unit/DriveService.ts @@ -1,18 +1,12 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import { Test } from '@nestjs/testing'; -import { - DeleteObjectCommand, - DeleteObjectCommandOutput, - InvalidObjectState, - NoSuchKey, - S3Client, -} from '@aws-sdk/client-s3'; +import { DeleteObjectCommandOutput, DeleteObjectCommand, NoSuchKey, InvalidObjectState, S3Client } from '@aws-sdk/client-s3'; import { mockClient } from 'aws-sdk-client-mock'; import { GlobalModule } from '@/GlobalModule.js'; import { DriveService } from '@/core/DriveService.js'; diff --git a/packages/backend/test/unit/FetchInstanceMetadataService.ts b/packages/backend/test/unit/FetchInstanceMetadataService.ts index 1e3605aafc..34200899d4 100644 --- a/packages/backend/test/unit/FetchInstanceMetadataService.ts +++ b/packages/backend/test/unit/FetchInstanceMetadataService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -8,7 +8,6 @@ process.env.NODE_ENV = 'test'; import { jest } from '@jest/globals'; import { Test } from '@nestjs/testing'; import { Redis } from 'ioredis'; -import type { TestingModule } from '@nestjs/testing'; import { GlobalModule } from '@/GlobalModule.js'; import { FetchInstanceMetadataService } from '@/core/FetchInstanceMetadataService.js'; import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; @@ -17,10 +16,11 @@ import { LoggerService } from '@/core/LoggerService.js'; import { UtilityService } from '@/core/UtilityService.js'; import { IdService } from '@/core/IdService.js'; import { DI } from '@/di-symbols.js'; +import type { TestingModule } from '@nestjs/testing'; function mockRedis() { - const hash = {} as any; - const set = jest.fn((key: string, value) => { + const hash = {}; + const set = jest.fn((key, value) => { const ret = hash[key]; hash[key] = value; return ret; @@ -52,17 +52,15 @@ describe('FetchInstanceMetadataService', () => { if (token === HttpRequestService) { return { getJson: jest.fn(), getHtml: jest.fn(), send: jest.fn() }; } else if (token === FederatedInstanceService) { - return { fetchOrRegister: jest.fn() }; + return { fetch: jest.fn() }; } else if (token === DI.redis) { return mockRedis; - } - return null; - }) + }}) .compile(); app.enableShutdownHooks(); - fetchInstanceMetadataService = app.get(FetchInstanceMetadataService) as jest.Mocked; + fetchInstanceMetadataService = app.get(FetchInstanceMetadataService); federatedInstanceService = app.get(FederatedInstanceService) as jest.Mocked; redisClient = app.get(DI.redis) as jest.Mocked; httpRequestService = app.get(HttpRequestService) as jest.Mocked; @@ -75,62 +73,42 @@ describe('FetchInstanceMetadataService', () => { test('Lock and update', async () => { redisClient.set = mockRedis(); const now = Date.now(); - federatedInstanceService.fetchOrRegister.mockResolvedValue({ infoUpdatedAt: { getTime: () => { return now - 10 * 1000 * 60 * 60 * 24; } } } as any); + federatedInstanceService.fetch.mockReturnValue({ infoUpdatedAt: { getTime: () => { return now - 10 * 1000 * 60 * 60 * 24; } } }); httpRequestService.getJson.mockImplementation(() => { throw Error(); }); const tryLockSpy = jest.spyOn(fetchInstanceMetadataService, 'tryLock'); const unlockSpy = jest.spyOn(fetchInstanceMetadataService, 'unlock'); - - await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' } as any); + await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' }); expect(tryLockSpy).toHaveBeenCalledTimes(1); expect(unlockSpy).toHaveBeenCalledTimes(1); - expect(federatedInstanceService.fetchOrRegister).toHaveBeenCalledTimes(1); + expect(federatedInstanceService.fetch).toHaveBeenCalledTimes(1); expect(httpRequestService.getJson).toHaveBeenCalled(); }); test('Lock and don\'t update', async () => { redisClient.set = mockRedis(); const now = Date.now(); - federatedInstanceService.fetchOrRegister.mockResolvedValue({ infoUpdatedAt: { getTime: () => now } } as any); + federatedInstanceService.fetch.mockReturnValue({ infoUpdatedAt: { getTime: () => now } }); httpRequestService.getJson.mockImplementation(() => { throw Error(); }); const tryLockSpy = jest.spyOn(fetchInstanceMetadataService, 'tryLock'); const unlockSpy = jest.spyOn(fetchInstanceMetadataService, 'unlock'); - - await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' } as any); + await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' }); expect(tryLockSpy).toHaveBeenCalledTimes(1); expect(unlockSpy).toHaveBeenCalledTimes(1); - expect(federatedInstanceService.fetchOrRegister).toHaveBeenCalledTimes(1); + expect(federatedInstanceService.fetch).toHaveBeenCalledTimes(1); expect(httpRequestService.getJson).toHaveBeenCalledTimes(0); }); test('Do nothing when lock not acquired', async () => { redisClient.set = mockRedis(); - const now = Date.now(); - federatedInstanceService.fetchOrRegister.mockResolvedValue({ infoUpdatedAt: { getTime: () => now - 10 * 1000 * 60 * 60 * 24 } } as any); + federatedInstanceService.fetch.mockReturnValue({ infoUpdatedAt: { getTime: () => now - 10 * 1000 * 60 * 60 * 24 } }); httpRequestService.getJson.mockImplementation(() => { throw Error(); }); - await fetchInstanceMetadataService.tryLock('example.com'); const tryLockSpy = jest.spyOn(fetchInstanceMetadataService, 'tryLock'); const unlockSpy = jest.spyOn(fetchInstanceMetadataService, 'unlock'); - - await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' } as any); - expect(tryLockSpy).toHaveBeenCalledTimes(1); + await fetchInstanceMetadataService.tryLock('example.com'); + await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' }); + expect(tryLockSpy).toHaveBeenCalledTimes(2); expect(unlockSpy).toHaveBeenCalledTimes(0); - expect(federatedInstanceService.fetchOrRegister).toHaveBeenCalledTimes(0); + expect(federatedInstanceService.fetch).toHaveBeenCalledTimes(0); expect(httpRequestService.getJson).toHaveBeenCalledTimes(0); }); - - test('Do when lock not acquired but forced', async () => { - redisClient.set = mockRedis(); - const now = Date.now(); - federatedInstanceService.fetchOrRegister.mockResolvedValue({ infoUpdatedAt: { getTime: () => now - 10 * 1000 * 60 * 60 * 24 } } as any); - httpRequestService.getJson.mockImplementation(() => { throw Error(); }); - await fetchInstanceMetadataService.tryLock('example.com'); - const tryLockSpy = jest.spyOn(fetchInstanceMetadataService, 'tryLock'); - const unlockSpy = jest.spyOn(fetchInstanceMetadataService, 'unlock'); - - await fetchInstanceMetadataService.fetchInstanceMetadata({ host: 'example.com' } as any, true); - expect(tryLockSpy).toHaveBeenCalledTimes(0); - expect(unlockSpy).toHaveBeenCalledTimes(1); - expect(federatedInstanceService.fetchOrRegister).toHaveBeenCalledTimes(0); - expect(httpRequestService.getJson).toHaveBeenCalled(); - }); }); diff --git a/packages/backend/test/unit/FileInfoService.ts b/packages/backend/test/unit/FileInfoService.ts index 29bd03a201..de0b31488c 100644 --- a/packages/backend/test/unit/FileInfoService.ts +++ b/packages/backend/test/unit/FileInfoService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -10,12 +10,11 @@ import { fileURLToPath } from 'node:url'; import { dirname } from 'node:path'; import { ModuleMocker } from 'jest-mock'; import { Test } from '@nestjs/testing'; -import { afterAll, beforeAll, describe, test } from '@jest/globals'; +import { describe, beforeAll, afterAll, test } from '@jest/globals'; import { GlobalModule } from '@/GlobalModule.js'; -import { FileInfo, FileInfoService } from '@/core/FileInfoService.js'; +import { FileInfoService } from '@/core/FileInfoService.js'; //import { DI } from '@/di-symbols.js'; import { AiService } from '@/core/AiService.js'; -import { LoggerService } from '@/core/LoggerService.js'; import type { TestingModule } from '@nestjs/testing'; import type { MockFunctionMetadata } from 'jest-mock'; @@ -28,15 +27,6 @@ const moduleMocker = new ModuleMocker(global); describe('FileInfoService', () => { let app: TestingModule; let fileInfoService: FileInfoService; - const strip = (fileInfo: FileInfo): Omit, 'warnings' | 'blurhash' | 'sensitive' | 'porn'> => { - const fi: Partial = fileInfo; - delete fi.warnings; - delete fi.sensitive; - delete fi.blurhash; - delete fi.porn; - - return fi; - } beforeAll(async () => { app = await Test.createTestingModule({ @@ -45,7 +35,6 @@ describe('FileInfoService', () => { ], providers: [ AiService, - LoggerService, FileInfoService, ], }) @@ -72,7 +61,11 @@ describe('FileInfoService', () => { test('Empty file', async () => { const path = `${resources}/emptyfile`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; assert.deepStrictEqual(info, { size: 0, md5: 'd41d8cd98f00b204e9800998ecf8427e', @@ -88,24 +81,32 @@ describe('FileInfoService', () => { describe('IMAGE', () => { test('Generic JPEG', async () => { - const path = `${resources}/192.jpg`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const path = `${resources}/Lenna.jpg`; + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; assert.deepStrictEqual(info, { - size: 5131, - md5: '8c9ed0677dd2b8f9f7472c3af247e5e3', + size: 25360, + md5: '091b3f259662aa31e2ffef4519951168', type: { mime: 'image/jpeg', ext: 'jpg', }, - width: 192, - height: 192, + width: 512, + height: 512, orientation: undefined, }); }); test('Generic APNG', async () => { const path = `${resources}/anime.png`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; assert.deepStrictEqual(info, { size: 1868, md5: '08189c607bea3b952704676bb3c979e0', @@ -121,7 +122,11 @@ describe('FileInfoService', () => { test('Generic AGIF', async () => { const path = `${resources}/anime.gif`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; assert.deepStrictEqual(info, { size: 2248, md5: '32c47a11555675d9267aee1a86571e7e', @@ -137,7 +142,11 @@ describe('FileInfoService', () => { test('PNG with alpha', async () => { const path = `${resources}/with-alpha.png`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; assert.deepStrictEqual(info, { size: 3772, md5: 'f73535c3e1e27508885b69b10cf6e991', @@ -153,7 +162,11 @@ describe('FileInfoService', () => { test('Generic SVG', async () => { const path = `${resources}/image.svg`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; assert.deepStrictEqual(info, { size: 505, md5: 'b6f52b4b021e7b92cdd04509c7267965', @@ -170,7 +183,11 @@ describe('FileInfoService', () => { test('SVG with XML definition', async () => { // https://github.com/misskey-dev/misskey/issues/4413 const path = `${resources}/with-xml-def.svg`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; assert.deepStrictEqual(info, { size: 544, md5: '4b7a346cde9ccbeb267e812567e33397', @@ -186,7 +203,11 @@ describe('FileInfoService', () => { test('Dimension limit', async () => { const path = `${resources}/25000x25000.png`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; assert.deepStrictEqual(info, { size: 75933, md5: '268c5dde99e17cf8fe09f1ab3f97df56', @@ -202,7 +223,11 @@ describe('FileInfoService', () => { test('Rotate JPEG', async () => { const path = `${resources}/rotate.jpg`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; assert.deepStrictEqual(info, { size: 12624, md5: '68d5b2d8d1d1acbbce99203e3ec3857e', @@ -220,7 +245,11 @@ describe('FileInfoService', () => { describe('AUDIO', () => { test('MP3', async () => { const path = `${resources}/kick_gaba7.mp3`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; delete info.width; delete info.height; delete info.orientation; @@ -236,7 +265,11 @@ describe('FileInfoService', () => { test('WAV', async () => { const path = `${resources}/kick_gaba7.wav`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; delete info.width; delete info.height; delete info.orientation; @@ -252,7 +285,11 @@ describe('FileInfoService', () => { test('AAC', async () => { const path = `${resources}/kick_gaba7.aac`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; delete info.width; delete info.height; delete info.orientation; @@ -268,7 +305,11 @@ describe('FileInfoService', () => { test('FLAC', async () => { const path = `${resources}/kick_gaba7.flac`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; delete info.width; delete info.height; delete info.orientation; @@ -282,36 +323,27 @@ describe('FileInfoService', () => { }); }); - test('MPEG-4 AUDIO (M4A)', async () => { - const path = `${resources}/kick_gaba7.m4a`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); - delete info.width; - delete info.height; - delete info.orientation; - assert.deepStrictEqual(info, { - size: 9817, - md5: '74c9279a4abe98789565f1dc1a541a42', - type: { - mime: 'audio/mp4', - ext: 'm4a', - }, - }); - }); - + /* + * video/webmとして検出されてしまう test('WEBM AUDIO', async () => { const path = `${resources}/kick_gaba7.webm`; - const info = strip(await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true })); + const info = await fileInfoService.getFileInfo(path, { skipSensitiveDetection: true }) as any; + delete info.warnings; + delete info.blurhash; + delete info.sensitive; + delete info.porn; delete info.width; delete info.height; delete info.orientation; assert.deepStrictEqual(info, { size: 8879, - md5: '53bc1adcb6acbbda67ff9bd484896438', + md5: '3350083dec312419cfdc06c16413aca7', type: { mime: 'audio/webm', ext: 'webm', }, }); }); + */ }); }); diff --git a/packages/backend/test/unit/FlashService.ts b/packages/backend/test/unit/FlashService.ts deleted file mode 100644 index 12ffaf3421..0000000000 --- a/packages/backend/test/unit/FlashService.ts +++ /dev/null @@ -1,152 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Test, TestingModule } from '@nestjs/testing'; -import { FlashService } from '@/core/FlashService.js'; -import { IdService } from '@/core/IdService.js'; -import { FlashsRepository, MiFlash, MiUser, UserProfilesRepository, UsersRepository } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; -import { GlobalModule } from '@/GlobalModule.js'; - -describe('FlashService', () => { - let app: TestingModule; - let service: FlashService; - - // -------------------------------------------------------------------------------------- - - let flashsRepository: FlashsRepository; - let usersRepository: UsersRepository; - let userProfilesRepository: UserProfilesRepository; - let idService: IdService; - - // -------------------------------------------------------------------------------------- - - let root: MiUser; - let alice: MiUser; - let bob: MiUser; - - // -------------------------------------------------------------------------------------- - - async function createFlash(data: Partial) { - return flashsRepository.insert({ - id: idService.gen(), - updatedAt: new Date(), - userId: root.id, - title: 'title', - summary: 'summary', - script: 'script', - permissions: [], - likedCount: 0, - ...data, - }).then(x => flashsRepository.findOneByOrFail(x.identifiers[0])); - } - - async function createUser(data: Partial = {}) { - const user = await usersRepository - .insert({ - id: idService.gen(), - ...data, - }) - .then(x => usersRepository.findOneByOrFail(x.identifiers[0])); - - await userProfilesRepository.insert({ - userId: user.id, - }); - - return user; - } - - // -------------------------------------------------------------------------------------- - - beforeEach(async () => { - app = await Test.createTestingModule({ - imports: [ - GlobalModule, - ], - providers: [ - FlashService, - IdService, - ], - }).compile(); - - service = app.get(FlashService); - - flashsRepository = app.get(DI.flashsRepository); - usersRepository = app.get(DI.usersRepository); - userProfilesRepository = app.get(DI.userProfilesRepository); - idService = app.get(IdService); - - root = await createUser({ username: 'root', usernameLower: 'root', isRoot: true }); - alice = await createUser({ username: 'alice', usernameLower: 'alice', isRoot: false }); - bob = await createUser({ username: 'bob', usernameLower: 'bob', isRoot: false }); - }); - - afterEach(async () => { - await usersRepository.delete({}); - await userProfilesRepository.delete({}); - await flashsRepository.delete({}); - }); - - afterAll(async () => { - await app.close(); - }); - - // -------------------------------------------------------------------------------------- - - describe('featured', () => { - test('should return featured flashes', async () => { - const flash1 = await createFlash({ likedCount: 1 }); - const flash2 = await createFlash({ likedCount: 2 }); - const flash3 = await createFlash({ likedCount: 3 }); - - const result = await service.featured({ - offset: 0, - limit: 10, - }); - - expect(result).toEqual([flash3, flash2, flash1]); - }); - - test('should return featured flashes public visibility only', async () => { - const flash1 = await createFlash({ likedCount: 1, visibility: 'public' }); - const flash2 = await createFlash({ likedCount: 2, visibility: 'public' }); - const flash3 = await createFlash({ likedCount: 3, visibility: 'private' }); - - const result = await service.featured({ - offset: 0, - limit: 10, - }); - - expect(result).toEqual([flash2, flash1]); - }); - - test('should return featured flashes with offset', async () => { - const flash1 = await createFlash({ likedCount: 1 }); - const flash2 = await createFlash({ likedCount: 2 }); - const flash3 = await createFlash({ likedCount: 3 }); - - const result = await service.featured({ - offset: 1, - limit: 10, - }); - - expect(result).toEqual([flash2, flash1]); - }); - - test('should return featured flashes with limit', async () => { - const flash1 = await createFlash({ likedCount: 1 }); - const flash2 = await createFlash({ likedCount: 2 }); - const flash3 = await createFlash({ likedCount: 3 }); - - const result = await service.featured({ - offset: 0, - limit: 2, - }); - - expect(result).toEqual([flash3, flash2]); - }); - }); -}); diff --git a/packages/backend/test/unit/MetaService.ts b/packages/backend/test/unit/MetaService.ts index 19c98eab3d..ab30f48283 100644 --- a/packages/backend/test/unit/MetaService.ts +++ b/packages/backend/test/unit/MetaService.ts @@ -1,18 +1,20 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; 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/_.js'; import { DI } from '@/di-symbols.js'; import { MetaService } from '@/core/MetaService.js'; import { CoreModule } from '@/core/CoreModule.js'; -import type { TestingModule } from '@nestjs/testing'; import type { DataSource } from 'typeorm'; +import type { TestingModule } from '@nestjs/testing'; describe('MetaService', () => { let app: TestingModule; diff --git a/packages/backend/test/unit/MfmService.ts b/packages/backend/test/unit/MfmService.ts index fd4a03413b..bb8e6981d5 100644 --- a/packages/backend/test/unit/MfmService.ts +++ b/packages/backend/test/unit/MfmService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -33,18 +33,6 @@ describe('MfmService', () => { const output = '

foo
bar
baz

'; assert.equal(mfmService.toHtml(mfm.parse(input)), output); }); - - test('Do not generate unnecessary span', () => { - const input = 'foo $[tada bar]'; - const output = '

foo bar

'; - assert.equal(mfmService.toHtml(mfm.parse(input)), output); - }); - - test('escape', () => { - const input = '```\n

Hello, world!

\n```'; - const output = '

<p>Hello, world!</p>

'; - assert.equal(mfmService.toHtml(mfm.parse(input)), output); - }); }); describe('fromHtml', () => { diff --git a/packages/backend/test/unit/NoteCreateService.ts b/packages/backend/test/unit/NoteCreateService.ts deleted file mode 100644 index f2d4c8ffbb..0000000000 --- a/packages/backend/test/unit/NoteCreateService.ts +++ /dev/null @@ -1,144 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Test } from '@nestjs/testing'; - -import { CoreModule } from '@/core/CoreModule.js'; -import { NoteCreateService } from '@/core/NoteCreateService.js'; -import { GlobalModule } from '@/GlobalModule.js'; -import { MiNote } from '@/models/Note.js'; -import { IPoll } from '@/models/Poll.js'; -import { MiDriveFile } from '@/models/DriveFile.js'; - -describe('NoteCreateService', () => { - let noteCreateService: NoteCreateService; - - beforeAll(async () => { - const app = await Test.createTestingModule({ - imports: [GlobalModule, CoreModule], - }).compile(); - noteCreateService = app.get(NoteCreateService); - }); - - describe('is-renote', () => { - const base: MiNote = { - id: 'some-note-id', - replyId: null, - reply: null, - renoteId: null, - renote: null, - threadId: null, - text: null, - name: null, - cw: null, - userId: 'some-user-id', - user: null, - localOnly: false, - reactionAcceptance: null, - renoteCount: 0, - repliesCount: 0, - clippedCount: 0, - reactions: {}, - visibility: 'public', - uri: null, - url: null, - fileIds: [], - attachedFileTypes: [], - visibleUserIds: [], - mentions: [], - mentionedRemoteUsers: '', - reactionAndUserPairCache: [], - emojis: [], - tags: [], - hasPoll: false, - channelId: null, - channel: null, - userHost: null, - replyUserId: null, - replyUserHost: null, - renoteUserId: null, - renoteUserHost: null, - }; - - const poll: IPoll = { - choices: ['kinoko', 'takenoko'], - multiple: false, - expiresAt: null, - }; - - const file: MiDriveFile = { - id: 'some-file-id', - userId: null, - user: null, - userHost: null, - md5: '', - name: '', - type: '', - size: 0, - comment: null, - blurhash: null, - properties: {}, - storedInternal: false, - url: '', - thumbnailUrl: null, - webpublicUrl: null, - webpublicType: null, - accessKey: null, - thumbnailAccessKey: null, - webpublicAccessKey: null, - uri: null, - src: null, - folderId: null, - folder: null, - isSensitive: false, - maybeSensitive: false, - maybePorn: false, - isLink: false, - requestHeaders: null, - requestIp: null, - }; - - test('note without renote should not be Renote', () => { - const note = { renote: null }; - expect(noteCreateService['isRenote'](note)).toBe(false); - }); - - test('note with renote should be Renote and not be Quote', () => { - const note = { renote: base }; - expect(noteCreateService['isRenote'](note)).toBe(true); - expect(noteCreateService['isQuote'](note)).toBe(false); - }); - - test('note with renote and text should be Quote', () => { - const note = { renote: base, text: 'some-text' }; - expect(noteCreateService['isRenote'](note)).toBe(true); - expect(noteCreateService['isQuote'](note)).toBe(true); - }); - - test('note with renote and cw should be Quote', () => { - const note = { renote: base, cw: 'some-cw' }; - expect(noteCreateService['isRenote'](note)).toBe(true); - expect(noteCreateService['isQuote'](note)).toBe(true); - }); - - test('note with renote and reply should be Quote', () => { - const note = { renote: base, reply: { ...base, id: 'another-note-id' } }; - expect(noteCreateService['isRenote'](note)).toBe(true); - expect(noteCreateService['isQuote'](note)).toBe(true); - }); - - test('note with renote and poll should be Quote', () => { - const note = { renote: base, poll }; - expect(noteCreateService['isRenote'](note)).toBe(true); - expect(noteCreateService['isQuote'](note)).toBe(true); - }); - - test('note with renote and non-empty files should be Quote', () => { - const note = { renote: base, files: [file] }; - expect(noteCreateService['isRenote'](note)).toBe(true); - expect(noteCreateService['isQuote'](note)).toBe(true); - }); - }); -}); diff --git a/packages/backend/test/unit/ReactionService.ts b/packages/backend/test/unit/ReactionService.ts index 1957f4544c..7b5bf7d0a0 100644 --- a/packages/backend/test/unit/ReactionService.ts +++ b/packages/backend/test/unit/ReactionService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -90,45 +90,4 @@ describe('ReactionService', () => { assert.strictEqual(await reactionService.normalize('unknown'), '❤'); }); }); - - describe('convertLegacyReactions', () => { - test('空の入力に対しては何もしない', () => { - const input = {}; - assert.deepStrictEqual(reactionService.convertLegacyReactions(input), input); - }); - - test('Unicode絵文字リアクションを変換してしまわない', () => { - const input = { '👍': 1, '🍮': 2 }; - assert.deepStrictEqual(reactionService.convertLegacyReactions(input), input); - }); - - test('カスタム絵文字リアクションを変換してしまわない', () => { - const input = { ':like@.:': 1, ':pudding@example.tld:': 2 }; - assert.deepStrictEqual(reactionService.convertLegacyReactions(input), input); - }); - - test('文字列によるレガシーなリアクションを変換する', () => { - const input = { 'like': 1, 'pudding': 2 }; - const output = { '👍': 1, '🍮': 2 }; - assert.deepStrictEqual(reactionService.convertLegacyReactions(input), output); - }); - - test('host部分が省略されたレガシーなカスタム絵文字リアクションを変換する', () => { - const input = { ':custom_emoji:': 1 }; - const output = { ':custom_emoji@.:': 1 }; - assert.deepStrictEqual(reactionService.convertLegacyReactions(input), output); - }); - - test('「0個のリアクション」情報を削除する', () => { - const input = { 'angry': 0 }; - const output = {}; - assert.deepStrictEqual(reactionService.convertLegacyReactions(input), output); - }); - - test('host部分の有無によりデコードすると同じ表記になるカスタム絵文字リアクションの個数情報を正しく足し合わせる', () => { - const input = { ':custom_emoji:': 1, ':custom_emoji@.:': 2 }; - const output = { ':custom_emoji@.:': 3 }; - assert.deepStrictEqual(reactionService.convertLegacyReactions(input), output); - }); - }); }); diff --git a/packages/backend/test/unit/RelayService.ts b/packages/backend/test/unit/RelayService.ts index 9676abf07b..f780a25388 100644 --- a/packages/backend/test/unit/RelayService.ts +++ b/packages/backend/test/unit/RelayService.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -90,8 +90,7 @@ describe('RelayService', () => { expect(queueService.deliver).toHaveBeenCalled(); expect(queueService.deliver.mock.lastCall![1]?.type).toBe('Undo'); - expect(typeof queueService.deliver.mock.lastCall![1]?.object).toBe('object'); - expect((queueService.deliver.mock.lastCall![1]?.object as any).type).toBe('Follow'); + expect(queueService.deliver.mock.lastCall![1]?.object.type).toBe('Follow'); expect(queueService.deliver.mock.lastCall![2]).toBe('https://example.com'); //expect(queueService.deliver.mock.lastCall![0].username).toBe('relay.actor'); diff --git a/packages/backend/test/unit/RoleService.ts b/packages/backend/test/unit/RoleService.ts index 9c1b1008d6..9879eb8e3e 100644 --- a/packages/backend/test/unit/RoleService.ts +++ b/packages/backend/test/unit/RoleService.ts @@ -1,28 +1,17 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; -import { setTimeout } from 'node:timers/promises'; import { jest } from '@jest/globals'; import { ModuleMocker } from 'jest-mock'; import { Test } from '@nestjs/testing'; import * as lolex from '@sinonjs/fake-timers'; -import type { TestingModule } from '@nestjs/testing'; -import type { MockFunctionMetadata } from 'jest-mock'; import { GlobalModule } from '@/GlobalModule.js'; import { RoleService } from '@/core/RoleService.js'; -import { - MiMeta, - MiRole, - MiRoleAssignment, - MiUser, - RoleAssignmentsRepository, - RolesRepository, - UsersRepository, -} from '@/models/_.js'; +import type { MiRole, RolesRepository, RoleAssignmentsRepository, UsersRepository, MiUser } from '@/models/_.js'; import { DI } from '@/di-symbols.js'; import { MetaService } from '@/core/MetaService.js'; import { genAidx } from '@/misc/id/aidx.js'; @@ -31,8 +20,9 @@ import { IdService } from '@/core/IdService.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { secureRndstr } from '@/misc/secure-rndstr.js'; import { NotificationService } from '@/core/NotificationService.js'; -import { RoleCondFormulaValue } from '@/models/Role.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; +import { sleep } from '../utils.js'; +import type { TestingModule } from '@nestjs/testing'; +import type { MockFunctionMetadata } from 'jest-mock'; const moduleMocker = new ModuleMocker(global); @@ -42,58 +32,30 @@ describe('RoleService', () => { let usersRepository: UsersRepository; let rolesRepository: RolesRepository; let roleAssignmentsRepository: RoleAssignmentsRepository; - let meta: jest.Mocked; + let metaService: jest.Mocked; let notificationService: jest.Mocked; let clock: lolex.InstalledClock; - async function createUser(data: Partial = {}) { + function createUser(data: Partial = {}) { const un = secureRndstr(16); - const x = await usersRepository.insert({ + return usersRepository.insert({ id: genAidx(Date.now()), username: un, usernameLower: un, ...data, - }); - return await usersRepository.findOneByOrFail(x.identifiers[0]); + }) + .then(x => usersRepository.findOneByOrFail(x.identifiers[0])); } - async function createRole(data: Partial = {}) { - const x = await rolesRepository.insert({ + function createRole(data: Partial = {}) { + return rolesRepository.insert({ id: genAidx(Date.now()), updatedAt: new Date(), lastUsedAt: new Date(), - name: '', description: '', ...data, - }); - return await rolesRepository.findOneByOrFail(x.identifiers[0]); - } - - function createConditionalRole(condFormula: RoleCondFormulaValue, data: Partial = {}) { - return createRole({ - name: `[conditional] ${condFormula.type}`, - target: 'conditional', - condFormula: condFormula, - ...data, - }); - } - - async function assignRole(args: Partial) { - const id = genAidx(Date.now()); - const expiresAt = new Date(); - expiresAt.setDate(expiresAt.getDate() + 1); - - await roleAssignmentsRepository.insert({ - id, - expiresAt, - ...args, - }); - - return await roleAssignmentsRepository.findOneByOrFail({ id }); - } - - function aidx() { - return genAidx(Date.now()); + }) + .then(x => rolesRepository.findOneByOrFail(x.identifiers[0])); } beforeEach(async () => { @@ -111,7 +73,6 @@ describe('RoleService', () => { CacheService, IdService, GlobalEventService, - UserEntityService, { provide: NotificationService, useFactory: () => ({ @@ -143,7 +104,7 @@ describe('RoleService', () => { rolesRepository = app.get(DI.rolesRepository); roleAssignmentsRepository = app.get(DI.roleAssignmentsRepository); - meta = app.get(DI.meta) as jest.Mocked; + metaService = app.get(MetaService) as jest.Mocked; notificationService = app.get(NotificationService) as jest.Mocked; await roleService.onModuleInit(); @@ -165,9 +126,11 @@ describe('RoleService', () => { describe('getUserPolicies', () => { test('instance default policies', async () => { const user = await createUser(); - meta.policies = { - canManageCustomEmojis: false, - }; + metaService.fetch.mockResolvedValue({ + policies: { + canManageCustomEmojis: false, + }, + } as any); const result = await roleService.getUserPolicies(user.id); @@ -176,9 +139,11 @@ describe('RoleService', () => { test('instance default policies 2', async () => { const user = await createUser(); - meta.policies = { - canManageCustomEmojis: true, - }; + metaService.fetch.mockResolvedValue({ + policies: { + canManageCustomEmojis: true, + }, + } as any); const result = await roleService.getUserPolicies(user.id); @@ -198,9 +163,11 @@ describe('RoleService', () => { }, }); await roleService.assign(user.id, role.id); - meta.policies = { - canManageCustomEmojis: false, - }; + metaService.fetch.mockResolvedValue({ + policies: { + canManageCustomEmojis: false, + }, + } as any); const result = await roleService.getUserPolicies(user.id); @@ -231,15 +198,59 @@ describe('RoleService', () => { }); await roleService.assign(user.id, role1.id); await roleService.assign(user.id, role2.id); - meta.policies = { - driveCapacityMb: 50, - }; + metaService.fetch.mockResolvedValue({ + policies: { + driveCapacityMb: 50, + }, + } as any); const result = await roleService.getUserPolicies(user.id); expect(result.driveCapacityMb).toBe(100); }); + test('conditional role', async () => { + const user1 = await createUser({ + id: genAidx(Date.now() - (1000 * 60 * 60 * 24 * 365)), + }); + const user2 = await createUser({ + id: genAidx(Date.now() - (1000 * 60 * 60 * 24 * 365)), + followersCount: 10, + }); + await createRole({ + name: 'a', + policies: { + canManageCustomEmojis: { + useDefault: false, + priority: 0, + value: true, + }, + }, + target: 'conditional', + condFormula: { + type: 'and', + values: [{ + type: 'followersMoreThanOrEq', + value: 10, + }, { + type: 'createdMoreThan', + sec: 60 * 60 * 24 * 7, + }], + }, + }); + + metaService.fetch.mockResolvedValue({ + policies: { + canManageCustomEmojis: false, + }, + } as any); + + const user1Policies = await roleService.getUserPolicies(user1.id); + const user2Policies = await roleService.getUserPolicies(user2.id); + expect(user1Policies.canManageCustomEmojis).toBe(false); + expect(user2Policies.canManageCustomEmojis).toBe(true); + }); + test('expired role', async () => { const user = await createUser(); const role = await createRole({ @@ -253,9 +264,11 @@ describe('RoleService', () => { }, }); await roleService.assign(user.id, role.id, new Date(Date.now() + (1000 * 60 * 60 * 24))); - meta.policies = { - canManageCustomEmojis: false, - }; + metaService.fetch.mockResolvedValue({ + policies: { + canManageCustomEmojis: false, + }, + } as any); const result = await roleService.getUserPolicies(user.id); expect(result.canManageCustomEmojis).toBe(true); @@ -269,638 +282,13 @@ describe('RoleService', () => { // ストリーミング経由で反映されるまでちょっと待つ clock.uninstall(); - await setTimeout(100); + await sleep(100); const resultAfter25hAgain = await roleService.getUserPolicies(user.id); expect(resultAfter25hAgain.canManageCustomEmojis).toBe(true); }); }); - describe('getModeratorIds', () => { - test('includeAdmins = false, includeRoot = false, excludeExpire = false', async () => { - const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2, rootUser] = await Promise.all([ - createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser({ isRoot: true }), - ]); - - const role1 = await createRole({ name: 'admin', isAdministrator: true }); - const role2 = await createRole({ name: 'moderator', isModerator: true }); - const role3 = await createRole({ name: 'normal' }); - - await Promise.all([ - assignRole({ userId: adminUser1.id, roleId: role1.id }), - assignRole({ userId: adminUser2.id, roleId: role1.id, expiresAt: new Date(Date.now() - 1000) }), - assignRole({ userId: modeUser1.id, roleId: role2.id }), - assignRole({ userId: modeUser2.id, roleId: role2.id, expiresAt: new Date(Date.now() - 1000) }), - assignRole({ userId: normalUser1.id, roleId: role3.id }), - assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }), - ]); - - const result = await roleService.getModeratorIds({ - includeAdmins: false, - includeRoot: false, - excludeExpire: false, - }); - expect(result).toEqual([modeUser1.id, modeUser2.id]); - }); - - test('includeAdmins = false, includeRoot = false, excludeExpire = true', async () => { - const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2, rootUser] = await Promise.all([ - createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser({ isRoot: true }), - ]); - - const role1 = await createRole({ name: 'admin', isAdministrator: true }); - const role2 = await createRole({ name: 'moderator', isModerator: true }); - const role3 = await createRole({ name: 'normal' }); - - await Promise.all([ - assignRole({ userId: adminUser1.id, roleId: role1.id }), - assignRole({ userId: adminUser2.id, roleId: role1.id, expiresAt: new Date(Date.now() - 1000) }), - assignRole({ userId: modeUser1.id, roleId: role2.id }), - assignRole({ userId: modeUser2.id, roleId: role2.id, expiresAt: new Date(Date.now() - 1000) }), - assignRole({ userId: normalUser1.id, roleId: role3.id }), - assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }), - ]); - - const result = await roleService.getModeratorIds({ - includeAdmins: false, - includeRoot: false, - excludeExpire: true, - }); - expect(result).toEqual([modeUser1.id]); - }); - - test('includeAdmins = true, includeRoot = false, excludeExpire = false', async () => { - const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2, rootUser] = await Promise.all([ - createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser({ isRoot: true }), - ]); - - const role1 = await createRole({ name: 'admin', isAdministrator: true }); - const role2 = await createRole({ name: 'moderator', isModerator: true }); - const role3 = await createRole({ name: 'normal' }); - - await Promise.all([ - assignRole({ userId: adminUser1.id, roleId: role1.id }), - assignRole({ userId: adminUser2.id, roleId: role1.id, expiresAt: new Date(Date.now() - 1000) }), - assignRole({ userId: modeUser1.id, roleId: role2.id }), - assignRole({ userId: modeUser2.id, roleId: role2.id, expiresAt: new Date(Date.now() - 1000) }), - assignRole({ userId: normalUser1.id, roleId: role3.id }), - assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }), - ]); - - const result = await roleService.getModeratorIds({ - includeAdmins: true, - includeRoot: false, - excludeExpire: false, - }); - expect(result).toEqual([adminUser1.id, adminUser2.id, modeUser1.id, modeUser2.id]); - }); - - test('includeAdmins = true, includeRoot = false, excludeExpire = true', async () => { - const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2, rootUser] = await Promise.all([ - createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser({ isRoot: true }), - ]); - - const role1 = await createRole({ name: 'admin', isAdministrator: true }); - const role2 = await createRole({ name: 'moderator', isModerator: true }); - const role3 = await createRole({ name: 'normal' }); - - await Promise.all([ - assignRole({ userId: adminUser1.id, roleId: role1.id }), - assignRole({ userId: adminUser2.id, roleId: role1.id, expiresAt: new Date(Date.now() - 1000) }), - assignRole({ userId: modeUser1.id, roleId: role2.id }), - assignRole({ userId: modeUser2.id, roleId: role2.id, expiresAt: new Date(Date.now() - 1000) }), - assignRole({ userId: normalUser1.id, roleId: role3.id }), - assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }), - ]); - - const result = await roleService.getModeratorIds({ - includeAdmins: true, - includeRoot: false, - excludeExpire: true, - }); - expect(result).toEqual([adminUser1.id, modeUser1.id]); - }); - - test('includeAdmins = false, includeRoot = true, excludeExpire = false', async () => { - const [adminUser1, adminUser2, modeUser1, modeUser2, normalUser1, normalUser2, rootUser] = await Promise.all([ - createUser(), createUser(), createUser(), createUser(), createUser(), createUser(), createUser({ isRoot: true }), - ]); - - const role1 = await createRole({ name: 'admin', isAdministrator: true }); - const role2 = await createRole({ name: 'moderator', isModerator: true }); - const role3 = await createRole({ name: 'normal' }); - - await Promise.all([ - assignRole({ userId: adminUser1.id, roleId: role1.id }), - assignRole({ userId: adminUser2.id, roleId: role1.id, expiresAt: new Date(Date.now() - 1000) }), - assignRole({ userId: modeUser1.id, roleId: role2.id }), - assignRole({ userId: modeUser2.id, roleId: role2.id, expiresAt: new Date(Date.now() - 1000) }), - assignRole({ userId: normalUser1.id, roleId: role3.id }), - assignRole({ userId: normalUser2.id, roleId: role3.id, expiresAt: new Date(Date.now() - 1000) }), - ]); - - const result = await roleService.getModeratorIds({ - includeAdmins: false, - includeRoot: true, - excludeExpire: false, - }); - expect(result).toEqual([modeUser1.id, modeUser2.id, rootUser.id]); - }); - - test('root has moderator role', async () => { - const [adminUser1, modeUser1, normalUser1, rootUser] = await Promise.all([ - createUser(), createUser(), createUser(), createUser({ isRoot: true }), - ]); - - const role1 = await createRole({ name: 'admin', isAdministrator: true }); - const role2 = await createRole({ name: 'moderator', isModerator: true }); - const role3 = await createRole({ name: 'normal' }); - - await Promise.all([ - assignRole({ userId: adminUser1.id, roleId: role1.id }), - assignRole({ userId: modeUser1.id, roleId: role2.id }), - assignRole({ userId: rootUser.id, roleId: role2.id }), - assignRole({ userId: normalUser1.id, roleId: role3.id }), - ]); - - const result = await roleService.getModeratorIds({ - includeAdmins: false, - includeRoot: true, - excludeExpire: false, - }); - expect(result).toEqual([modeUser1.id, rootUser.id]); - }); - - test('root has administrator role', async () => { - const [adminUser1, modeUser1, normalUser1, rootUser] = await Promise.all([ - createUser(), createUser(), createUser(), createUser({ isRoot: true }), - ]); - - const role1 = await createRole({ name: 'admin', isAdministrator: true }); - const role2 = await createRole({ name: 'moderator', isModerator: true }); - const role3 = await createRole({ name: 'normal' }); - - await Promise.all([ - assignRole({ userId: adminUser1.id, roleId: role1.id }), - assignRole({ userId: rootUser.id, roleId: role1.id }), - assignRole({ userId: modeUser1.id, roleId: role2.id }), - assignRole({ userId: normalUser1.id, roleId: role3.id }), - ]); - - const result = await roleService.getModeratorIds({ - includeAdmins: true, - includeRoot: true, - excludeExpire: false, - }); - expect(result).toEqual([adminUser1.id, modeUser1.id, rootUser.id]); - }); - - test('root has moderator role(expire)', async () => { - const [adminUser1, modeUser1, normalUser1, rootUser] = await Promise.all([ - createUser(), createUser(), createUser(), createUser({ isRoot: true }), - ]); - - const role1 = await createRole({ name: 'admin', isAdministrator: true }); - const role2 = await createRole({ name: 'moderator', isModerator: true }); - const role3 = await createRole({ name: 'normal' }); - - await Promise.all([ - assignRole({ userId: adminUser1.id, roleId: role1.id }), - assignRole({ userId: modeUser1.id, roleId: role2.id, expiresAt: new Date(Date.now() - 1000) }), - assignRole({ userId: rootUser.id, roleId: role2.id, expiresAt: new Date(Date.now() - 1000) }), - assignRole({ userId: normalUser1.id, roleId: role3.id }), - ]); - - const result = await roleService.getModeratorIds({ - includeAdmins: false, - includeRoot: true, - excludeExpire: true, - }); - expect(result).toEqual([rootUser.id]); - }); - }); - - describe('conditional role', () => { - test('~かつ~', async () => { - const [user1, user2, user3, user4] = await Promise.all([ - createUser({ isBot: true, isCat: false, isSuspended: false }), - createUser({ isBot: false, isCat: true, isSuspended: false }), - createUser({ isBot: true, isCat: true, isSuspended: false }), - createUser({ isBot: false, isCat: false, isSuspended: true }), - ]); - const role1 = await createConditionalRole({ - id: aidx(), - type: 'isBot', - }); - const role2 = await createConditionalRole({ - id: aidx(), - type: 'isCat', - }); - const role3 = await createConditionalRole({ - id: aidx(), - type: 'isSuspended', - }); - const role4 = await createConditionalRole({ - id: aidx(), - type: 'and', - values: [role1.condFormula, role2.condFormula], - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - const actual3 = await roleService.getUserRoles(user3.id); - const actual4 = await roleService.getUserRoles(user4.id); - expect(actual1.some(r => r.id === role4.id)).toBe(false); - expect(actual2.some(r => r.id === role4.id)).toBe(false); - expect(actual3.some(r => r.id === role4.id)).toBe(true); - expect(actual4.some(r => r.id === role4.id)).toBe(false); - }); - - test('~または~', async () => { - const [user1, user2, user3, user4] = await Promise.all([ - createUser({ isBot: true, isCat: false, isSuspended: false }), - createUser({ isBot: false, isCat: true, isSuspended: false }), - createUser({ isBot: true, isCat: true, isSuspended: false }), - createUser({ isBot: false, isCat: false, isSuspended: true }), - ]); - const role1 = await createConditionalRole({ - id: aidx(), - type: 'isBot', - }); - const role2 = await createConditionalRole({ - id: aidx(), - type: 'isCat', - }); - const role3 = await createConditionalRole({ - id: aidx(), - type: 'isSuspended', - }); - const role4 = await createConditionalRole({ - id: aidx(), - type: 'or', - values: [role1.condFormula, role2.condFormula], - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - const actual3 = await roleService.getUserRoles(user3.id); - const actual4 = await roleService.getUserRoles(user4.id); - expect(actual1.some(r => r.id === role4.id)).toBe(true); - expect(actual2.some(r => r.id === role4.id)).toBe(true); - expect(actual3.some(r => r.id === role4.id)).toBe(true); - expect(actual4.some(r => r.id === role4.id)).toBe(false); - }); - - test('~ではない', async () => { - const [user1, user2, user3] = await Promise.all([ - createUser({ isBot: true, isCat: false, isSuspended: false }), - createUser({ isBot: false, isCat: true, isSuspended: false }), - createUser({ isBot: true, isCat: true, isSuspended: false }), - ]); - const role1 = await createConditionalRole({ - id: aidx(), - type: 'isBot', - }); - const role2 = await createConditionalRole({ - id: aidx(), - type: 'isCat', - }); - const role4 = await createConditionalRole({ - id: aidx(), - type: 'not', - value: role1.condFormula, - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - const actual3 = await roleService.getUserRoles(user3.id); - expect(actual1.some(r => r.id === role4.id)).toBe(false); - expect(actual2.some(r => r.id === role4.id)).toBe(true); - expect(actual3.some(r => r.id === role4.id)).toBe(false); - }); - - test('マニュアルロールにアサイン済み', async () => { - const [user1, user2, role1] = await Promise.all([ - createUser(), - createUser(), - createRole({ - name: 'manual role', - }), - ]); - const role2 = await createConditionalRole({ - id: aidx(), - type: 'roleAssignedTo', - roleId: role1.id, - }); - await roleService.assign(user2.id, role1.id); - - const [u1role, u2role] = await Promise.all([ - roleService.getUserRoles(user1.id), - roleService.getUserRoles(user2.id), - ]); - expect(u1role.some(r => r.id === role2.id)).toBe(false); - expect(u2role.some(r => r.id === role2.id)).toBe(true); - }); - - test('ローカルユーザのみ', async () => { - const [user1, user2] = await Promise.all([ - createUser({ host: null }), - createUser({ host: 'example.com' }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'isLocal', - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - expect(actual1.some(r => r.id === role.id)).toBe(true); - expect(actual2.some(r => r.id === role.id)).toBe(false); - }); - - test('リモートユーザのみ', async () => { - const [user1, user2] = await Promise.all([ - createUser({ host: null }), - createUser({ host: 'example.com' }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'isRemote', - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - expect(actual1.some(r => r.id === role.id)).toBe(false); - expect(actual2.some(r => r.id === role.id)).toBe(true); - }); - - test('サスペンド済みユーザである', async () => { - const [user1, user2] = await Promise.all([ - createUser({ isSuspended: false }), - createUser({ isSuspended: true }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'isSuspended', - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - expect(actual1.some(r => r.id === role.id)).toBe(false); - expect(actual2.some(r => r.id === role.id)).toBe(true); - }); - - test('鍵アカウントユーザである', async () => { - const [user1, user2] = await Promise.all([ - createUser({ isLocked: false }), - createUser({ isLocked: true }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'isLocked', - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - expect(actual1.some(r => r.id === role.id)).toBe(false); - expect(actual2.some(r => r.id === role.id)).toBe(true); - }); - - test('botユーザである', async () => { - const [user1, user2] = await Promise.all([ - createUser({ isBot: false }), - createUser({ isBot: true }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'isBot', - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - expect(actual1.some(r => r.id === role.id)).toBe(false); - expect(actual2.some(r => r.id === role.id)).toBe(true); - }); - - test('猫である', async () => { - const [user1, user2] = await Promise.all([ - createUser({ isCat: false }), - createUser({ isCat: true }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'isCat', - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - expect(actual1.some(r => r.id === role.id)).toBe(false); - expect(actual2.some(r => r.id === role.id)).toBe(true); - }); - - test('「ユーザを見つけやすくする」が有効なアカウント', async () => { - const [user1, user2] = await Promise.all([ - createUser({ isExplorable: false }), - createUser({ isExplorable: true }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'isExplorable', - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - expect(actual1.some(r => r.id === role.id)).toBe(false); - expect(actual2.some(r => r.id === role.id)).toBe(true); - }); - - test('ユーザが作成されてから指定期間経過した', async () => { - const base = new Date(); - base.setMinutes(base.getMinutes() - 5); - - const d1 = new Date(base); - const d2 = new Date(base); - const d3 = new Date(base); - d1.setSeconds(d1.getSeconds() - 1); - d3.setSeconds(d3.getSeconds() + 1); - - const [user1, user2, user3] = await Promise.all([ - // 4:59 - createUser({ id: genAidx(d1.getTime()) }), - // 5:00 - createUser({ id: genAidx(d2.getTime()) }), - // 5:01 - createUser({ id: genAidx(d3.getTime()) }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'createdLessThan', - // 5 minutes - sec: 300, - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - const actual3 = await roleService.getUserRoles(user3.id); - expect(actual1.some(r => r.id === role.id)).toBe(false); - expect(actual2.some(r => r.id === role.id)).toBe(false); - expect(actual3.some(r => r.id === role.id)).toBe(true); - }); - - test('ユーザが作成されてから指定期間経っていない', async () => { - const base = new Date(); - base.setMinutes(base.getMinutes() - 5); - - const d1 = new Date(base); - const d2 = new Date(base); - const d3 = new Date(base); - d1.setSeconds(d1.getSeconds() - 1); - d3.setSeconds(d3.getSeconds() + 1); - - const [user1, user2, user3] = await Promise.all([ - // 4:59 - createUser({ id: genAidx(d1.getTime()) }), - // 5:00 - createUser({ id: genAidx(d2.getTime()) }), - // 5:01 - createUser({ id: genAidx(d3.getTime()) }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'createdMoreThan', - // 5 minutes - sec: 300, - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - const actual3 = await roleService.getUserRoles(user3.id); - expect(actual1.some(r => r.id === role.id)).toBe(true); - expect(actual2.some(r => r.id === role.id)).toBe(false); - expect(actual3.some(r => r.id === role.id)).toBe(false); - }); - - test('フォロワー数が指定値以下', async () => { - const [user1, user2, user3] = await Promise.all([ - createUser({ followersCount: 99 }), - createUser({ followersCount: 100 }), - createUser({ followersCount: 101 }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'followersLessThanOrEq', - value: 100, - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - const actual3 = await roleService.getUserRoles(user3.id); - expect(actual1.some(r => r.id === role.id)).toBe(true); - expect(actual2.some(r => r.id === role.id)).toBe(true); - expect(actual3.some(r => r.id === role.id)).toBe(false); - }); - - test('フォロワー数が指定値以下', async () => { - const [user1, user2, user3] = await Promise.all([ - createUser({ followersCount: 99 }), - createUser({ followersCount: 100 }), - createUser({ followersCount: 101 }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'followersMoreThanOrEq', - value: 100, - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - const actual3 = await roleService.getUserRoles(user3.id); - expect(actual1.some(r => r.id === role.id)).toBe(false); - expect(actual2.some(r => r.id === role.id)).toBe(true); - expect(actual3.some(r => r.id === role.id)).toBe(true); - }); - - test('フォロー数が指定値以下', async () => { - const [user1, user2, user3] = await Promise.all([ - createUser({ followingCount: 99 }), - createUser({ followingCount: 100 }), - createUser({ followingCount: 101 }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'followingLessThanOrEq', - value: 100, - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - const actual3 = await roleService.getUserRoles(user3.id); - expect(actual1.some(r => r.id === role.id)).toBe(true); - expect(actual2.some(r => r.id === role.id)).toBe(true); - expect(actual3.some(r => r.id === role.id)).toBe(false); - }); - - test('フォロー数が指定値以上', async () => { - const [user1, user2, user3] = await Promise.all([ - createUser({ followingCount: 99 }), - createUser({ followingCount: 100 }), - createUser({ followingCount: 101 }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'followingMoreThanOrEq', - value: 100, - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - const actual3 = await roleService.getUserRoles(user3.id); - expect(actual1.some(r => r.id === role.id)).toBe(false); - expect(actual2.some(r => r.id === role.id)).toBe(true); - expect(actual3.some(r => r.id === role.id)).toBe(true); - }); - - test('ノート数が指定値以下', async () => { - const [user1, user2, user3] = await Promise.all([ - createUser({ notesCount: 9 }), - createUser({ notesCount: 10 }), - createUser({ notesCount: 11 }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'notesLessThanOrEq', - value: 10, - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - const actual3 = await roleService.getUserRoles(user3.id); - expect(actual1.some(r => r.id === role.id)).toBe(true); - expect(actual2.some(r => r.id === role.id)).toBe(true); - expect(actual3.some(r => r.id === role.id)).toBe(false); - }); - - test('ノート数が指定値以上', async () => { - const [user1, user2, user3] = await Promise.all([ - createUser({ notesCount: 9 }), - createUser({ notesCount: 10 }), - createUser({ notesCount: 11 }), - ]); - const role = await createConditionalRole({ - id: aidx(), - type: 'notesMoreThanOrEq', - value: 10, - }); - - const actual1 = await roleService.getUserRoles(user1.id); - const actual2 = await roleService.getUserRoles(user2.id); - const actual3 = await roleService.getUserRoles(user3.id); - expect(actual1.some(r => r.id === role.id)).toBe(false); - expect(actual2.some(r => r.id === role.id)).toBe(true); - expect(actual3.some(r => r.id === role.id)).toBe(true); - }); - }); - describe('assign', () => { test('公開ロールの場合は通知される', async () => { const user = await createUser(); @@ -912,7 +300,7 @@ describe('RoleService', () => { await roleService.assign(user.id, role.id); clock.uninstall(); - await setTimeout(100); + await sleep(100); const assignments = await roleAssignmentsRepository.find({ where: { @@ -940,7 +328,7 @@ describe('RoleService', () => { await roleService.assign(user.id, role.id); clock.uninstall(); - await setTimeout(100); + await sleep(100); const assignments = await roleAssignmentsRepository.find({ where: { diff --git a/packages/backend/test/unit/S3Service.ts b/packages/backend/test/unit/S3Service.ts index 151f3b826a..c1eafc96b7 100644 --- a/packages/backend/test/unit/S3Service.ts +++ b/packages/backend/test/unit/S3Service.ts @@ -1,18 +1,12 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ process.env.NODE_ENV = 'test'; import { Test } from '@nestjs/testing'; -import { - CompleteMultipartUploadCommand, - CreateMultipartUploadCommand, - PutObjectCommand, - S3Client, - UploadPartCommand, -} from '@aws-sdk/client-s3'; +import { UploadPartCommand, CompleteMultipartUploadCommand, CreateMultipartUploadCommand, S3Client, PutObjectCommand } from '@aws-sdk/client-s3'; import { mockClient } from 'aws-sdk-client-mock'; import { GlobalModule } from '@/GlobalModule.js'; import { CoreModule } from '@/core/CoreModule.js'; diff --git a/packages/backend/test/unit/SigninWithPasskeyApiService.ts b/packages/backend/test/unit/SigninWithPasskeyApiService.ts deleted file mode 100644 index bae2b88c60..0000000000 --- a/packages/backend/test/unit/SigninWithPasskeyApiService.ts +++ /dev/null @@ -1,182 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { IncomingHttpHeaders } from 'node:http'; -import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, jest, test } from '@jest/globals'; -import { Test, TestingModule } from '@nestjs/testing'; -import { FastifyReply, FastifyRequest } from 'fastify'; -import { AuthenticationResponseJSON } from '@simplewebauthn/types'; -import { HttpHeader } from 'fastify/types/utils.js'; -import { MockFunctionMetadata, ModuleMocker } from 'jest-mock'; -import { MiUser } from '@/models/User.js'; -import { MiUserProfile, UserProfilesRepository, UsersRepository } from '@/models/_.js'; -import { IdService } from '@/core/IdService.js'; -import { GlobalModule } from '@/GlobalModule.js'; -import { DI } from '@/di-symbols.js'; -import { CoreModule } from '@/core/CoreModule.js'; -import { SigninWithPasskeyApiService } from '@/server/api/SigninWithPasskeyApiService.js'; -import { RateLimiterService } from '@/server/api/RateLimiterService.js'; -import { WebAuthnService } from '@/core/WebAuthnService.js'; -import { SigninService } from '@/server/api/SigninService.js'; -import { IdentifiableError } from '@/misc/identifiable-error.js'; - -const moduleMocker = new ModuleMocker(global); - -class FakeLimiter { - public async limit() { - return; - } -} - -class FakeSigninService { - public signin(..._args: any): any { - return true; - } -} - -class DummyFastifyReply { - public statusCode: number; - code(num: number): void { - this.statusCode = num; - } - header(_key: HttpHeader, _value: any): void { - } -} -class DummyFastifyRequest { - public ip: string; - public body: {credential: any, context: string}; - public headers: IncomingHttpHeaders = { 'accept': 'application/json' }; - constructor(body?: any) { - this.ip = '0.0.0.0'; - this.body = body; - } -} - -type ApiFastifyRequestType = FastifyRequest<{ - Body: { - credential?: AuthenticationResponseJSON; - context?: string; - }; -}>; - -describe('SigninWithPasskeyApiService', () => { - let app: TestingModule; - let passkeyApiService: SigninWithPasskeyApiService; - let usersRepository: UsersRepository; - let userProfilesRepository: UserProfilesRepository; - let webAuthnService: WebAuthnService; - let idService: IdService; - let FakeWebauthnVerify: ()=>Promise; - - async function createUser(data: Partial = {}) { - const user = await usersRepository - .save({ - ...data, - }); - return user; - } - - async function createUserProfile(data: Partial = {}) { - const userProfile = await userProfilesRepository - .save({ ...data }, - ); - return userProfile; - } - - beforeAll(async () => { - app = await Test.createTestingModule({ - imports: [GlobalModule, CoreModule], - providers: [ - SigninWithPasskeyApiService, - { provide: RateLimiterService, useClass: FakeLimiter }, - { provide: SigninService, useClass: FakeSigninService }, - ], - }).useMocker((token) => { - if (typeof token === 'function') { - const mockMetadata = moduleMocker.getMetadata(token) as MockFunctionMetadata; - const Mock = moduleMocker.generateFromMetadata(mockMetadata); - return new Mock(); - } - }).compile(); - passkeyApiService = app.get(SigninWithPasskeyApiService); - usersRepository = app.get(DI.usersRepository); - userProfilesRepository = app.get(DI.userProfilesRepository); - webAuthnService = app.get(WebAuthnService); - idService = app.get(IdService); - }); - - beforeEach(async () => { - const uid = idService.gen(); - FakeWebauthnVerify = async () => { - return uid; - }; - jest.spyOn(webAuthnService, 'verifySignInWithPasskeyAuthentication').mockImplementation(FakeWebauthnVerify); - - const dummyUser = { - id: uid, username: uid, usernameLower: uid.toLocaleLowerCase(), uri: null, host: null, - }; - const dummyProfile = { - userId: uid, - password: 'qwerty', - usePasswordLessLogin: true, - }; - await createUser(dummyUser); - await createUserProfile(dummyProfile); - }); - - afterAll(async () => { - await app.close(); - }); - - describe('Get Passkey Options', () => { - it('Should return passkey Auth Options', async () => { - const req = new DummyFastifyRequest({}) as ApiFastifyRequestType; - const res = new DummyFastifyReply() as unknown as FastifyReply; - const res_body = await passkeyApiService.signin(req, res); - expect(res.statusCode).toBe(200); - expect((res_body as any).option).toBeDefined(); - expect(typeof (res_body as any).context).toBe('string'); - }); - }); - describe('Try Passkey Auth', () => { - it('Should Success', async () => { - const req = new DummyFastifyRequest({ context: 'auth-context', credential: { dummy: [] } }) as ApiFastifyRequestType; - const res = new DummyFastifyReply() as FastifyReply; - const res_body = await passkeyApiService.signin(req, res); - expect((res_body as any).signinResponse).toBeDefined(); - }); - - it('Should return 400 Without Auth Context', async () => { - const req = new DummyFastifyRequest({ credential: { dummy: [] } }) as ApiFastifyRequestType; - const res = new DummyFastifyReply() as FastifyReply; - const res_body = await passkeyApiService.signin(req, res); - expect(res.statusCode).toBe(400); - expect((res_body as any).error?.id).toStrictEqual('1658cc2e-4495-461f-aee4-d403cdf073c1'); - }); - - it('Should return 403 When Challenge Verify fail', async () => { - const req = new DummyFastifyRequest({ context: 'misskey-1234', credential: { dummy: [] } }) as ApiFastifyRequestType; - const res = new DummyFastifyReply() as FastifyReply; - jest.spyOn(webAuthnService, 'verifySignInWithPasskeyAuthentication') - .mockImplementation(async () => { - throw new IdentifiableError('THIS_ERROR_CODE_SHOULD_BE_FORWARDED'); - }); - const res_body = await passkeyApiService.signin(req, res); - expect(res.statusCode).toBe(403); - expect((res_body as any).error?.id).toStrictEqual('THIS_ERROR_CODE_SHOULD_BE_FORWARDED'); - }); - - it('Should return 403 When The user not Enabled Passwordless login', async () => { - const req = new DummyFastifyRequest({ context: 'misskey-1234', credential: { dummy: [] } }) as ApiFastifyRequestType; - const res = new DummyFastifyReply() as FastifyReply; - const userId = await FakeWebauthnVerify(); - const data = { userId: userId, usePasswordLessLogin: false }; - await userProfilesRepository.update({ userId: userId }, data); - const res_body = await passkeyApiService.signin(req, res); - expect(res.statusCode).toBe(403); - expect((res_body as any).error?.id).toStrictEqual('2d84773e-f7b7-4d0b-8f72-bb69b584c912'); - }); - }); -}); diff --git a/packages/backend/test/unit/SystemWebhookService.ts b/packages/backend/test/unit/SystemWebhookService.ts deleted file mode 100644 index 5401dd74d8..0000000000 --- a/packages/backend/test/unit/SystemWebhookService.ts +++ /dev/null @@ -1,517 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { setTimeout } from 'node:timers/promises'; -import { afterEach, beforeEach, describe, expect, jest } from '@jest/globals'; -import { Test, TestingModule } from '@nestjs/testing'; -import { randomString } from '../utils.js'; -import { MiUser } from '@/models/User.js'; -import { MiSystemWebhook, SystemWebhookEventType } from '@/models/SystemWebhook.js'; -import { SystemWebhooksRepository, UsersRepository } from '@/models/_.js'; -import { IdService } from '@/core/IdService.js'; -import { GlobalModule } from '@/GlobalModule.js'; -import { ModerationLogService } from '@/core/ModerationLogService.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; -import { DI } from '@/di-symbols.js'; -import { QueueService } from '@/core/QueueService.js'; -import { LoggerService } from '@/core/LoggerService.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; - -describe('SystemWebhookService', () => { - let app: TestingModule; - let service: SystemWebhookService; - - // -------------------------------------------------------------------------------------- - - let usersRepository: UsersRepository; - let systemWebhooksRepository: SystemWebhooksRepository; - let idService: IdService; - let queueService: jest.Mocked; - - // -------------------------------------------------------------------------------------- - - let root: MiUser; - - // -------------------------------------------------------------------------------------- - - async function createUser(data: Partial = {}) { - return await usersRepository - .insert({ - id: idService.gen(), - ...data, - }) - .then(x => usersRepository.findOneByOrFail(x.identifiers[0])); - } - - async function createWebhook(data: Partial = {}) { - return systemWebhooksRepository - .insert({ - id: idService.gen(), - name: randomString(), - on: ['abuseReport'], - url: 'https://example.com', - secret: randomString(), - ...data, - }) - .then(x => systemWebhooksRepository.findOneByOrFail(x.identifiers[0])); - } - - // -------------------------------------------------------------------------------------- - - async function beforeAllImpl() { - app = await Test - .createTestingModule({ - imports: [ - GlobalModule, - ], - providers: [ - SystemWebhookService, - IdService, - LoggerService, - GlobalEventService, - { - provide: QueueService, useFactory: () => ({ systemWebhookDeliver: jest.fn() }), - }, - { - provide: ModerationLogService, useFactory: () => ({ log: () => Promise.resolve() }), - }, - ], - }) - .compile(); - - usersRepository = app.get(DI.usersRepository); - systemWebhooksRepository = app.get(DI.systemWebhooksRepository); - - service = app.get(SystemWebhookService); - idService = app.get(IdService); - queueService = app.get(QueueService) as jest.Mocked; - - app.enableShutdownHooks(); - } - - async function afterAllImpl() { - await app.close(); - } - - async function beforeEachImpl() { - root = await createUser({ isRoot: true, username: 'root', usernameLower: 'root' }); - } - - async function afterEachImpl() { - await usersRepository.delete({}); - await systemWebhooksRepository.delete({}); - } - - // -------------------------------------------------------------------------------------- - - describe('アプリを毎回作り直す必要のないグループ', () => { - beforeAll(beforeAllImpl); - afterAll(afterAllImpl); - beforeEach(beforeEachImpl); - afterEach(afterEachImpl); - - describe('fetchSystemWebhooks', () => { - test('フィルタなし', async () => { - const webhook1 = await createWebhook({ - isActive: true, - on: ['abuseReport'], - }); - const webhook2 = await createWebhook({ - isActive: false, - on: ['abuseReport'], - }); - const webhook3 = await createWebhook({ - isActive: true, - on: ['abuseReportResolved'], - }); - const webhook4 = await createWebhook({ - isActive: false, - on: [], - }); - - const fetchedWebhooks = await service.fetchSystemWebhooks(); - expect(fetchedWebhooks).toEqual([webhook1, webhook2, webhook3, webhook4]); - }); - - test('activeのみ', async () => { - const webhook1 = await createWebhook({ - isActive: true, - on: ['abuseReport'], - }); - const webhook2 = await createWebhook({ - isActive: false, - on: ['abuseReport'], - }); - const webhook3 = await createWebhook({ - isActive: true, - on: ['abuseReportResolved'], - }); - const webhook4 = await createWebhook({ - isActive: false, - on: [], - }); - - const fetchedWebhooks = await service.fetchSystemWebhooks({ isActive: true }); - expect(fetchedWebhooks).toEqual([webhook1, webhook3]); - }); - - test('特定のイベントのみ', async () => { - const webhook1 = await createWebhook({ - isActive: true, - on: ['abuseReport'], - }); - const webhook2 = await createWebhook({ - isActive: false, - on: ['abuseReport'], - }); - const webhook3 = await createWebhook({ - isActive: true, - on: ['abuseReportResolved'], - }); - const webhook4 = await createWebhook({ - isActive: false, - on: [], - }); - - const fetchedWebhooks = await service.fetchSystemWebhooks({ on: ['abuseReport'] }); - expect(fetchedWebhooks).toEqual([webhook1, webhook2]); - }); - - test('activeな特定のイベントのみ', async () => { - const webhook1 = await createWebhook({ - isActive: true, - on: ['abuseReport'], - }); - const webhook2 = await createWebhook({ - isActive: false, - on: ['abuseReport'], - }); - const webhook3 = await createWebhook({ - isActive: true, - on: ['abuseReportResolved'], - }); - const webhook4 = await createWebhook({ - isActive: false, - on: [], - }); - - const fetchedWebhooks = await service.fetchSystemWebhooks({ on: ['abuseReport'], isActive: true }); - expect(fetchedWebhooks).toEqual([webhook1]); - }); - - test('ID指定', async () => { - const webhook1 = await createWebhook({ - isActive: true, - on: ['abuseReport'], - }); - const webhook2 = await createWebhook({ - isActive: false, - on: ['abuseReport'], - }); - const webhook3 = await createWebhook({ - isActive: true, - on: ['abuseReportResolved'], - }); - const webhook4 = await createWebhook({ - isActive: false, - on: [], - }); - - const fetchedWebhooks = await service.fetchSystemWebhooks({ ids: [webhook1.id, webhook4.id] }); - expect(fetchedWebhooks).toEqual([webhook1, webhook4]); - }); - - test('ID指定(他条件とANDになるか見たい)', async () => { - const webhook1 = await createWebhook({ - isActive: true, - on: ['abuseReport'], - }); - const webhook2 = await createWebhook({ - isActive: false, - on: ['abuseReport'], - }); - const webhook3 = await createWebhook({ - isActive: true, - on: ['abuseReportResolved'], - }); - const webhook4 = await createWebhook({ - isActive: false, - on: [], - }); - - const fetchedWebhooks = await service.fetchSystemWebhooks({ ids: [webhook1.id, webhook4.id], isActive: false }); - expect(fetchedWebhooks).toEqual([webhook4]); - }); - }); - - describe('createSystemWebhook', () => { - test('作成成功 ', async () => { - const params = { - isActive: true, - name: randomString(), - on: ['abuseReport'] as SystemWebhookEventType[], - url: 'https://example.com', - secret: randomString(), - }; - - const webhook = await service.createSystemWebhook(params, root); - expect(webhook).toMatchObject(params); - }); - }); - - describe('updateSystemWebhook', () => { - test('更新成功', async () => { - const webhook = await createWebhook({ - isActive: true, - on: ['abuseReport'], - }); - - const params = { - id: webhook.id, - isActive: false, - name: randomString(), - on: ['abuseReport'] as SystemWebhookEventType[], - url: randomString(), - secret: randomString(), - }; - - const updatedWebhook = await service.updateSystemWebhook(params, root); - expect(updatedWebhook).toMatchObject(params); - }); - }); - - describe('deleteSystemWebhook', () => { - test('削除成功', async () => { - const webhook = await createWebhook({ - isActive: true, - on: ['abuseReport'], - }); - - await service.deleteSystemWebhook(webhook.id, root); - - await expect(systemWebhooksRepository.findOneBy({ id: webhook.id })).resolves.toBeNull(); - }); - }); - }); - - describe('アプリを毎回作り直す必要があるグループ', () => { - beforeEach(async () => { - await beforeAllImpl(); - await beforeEachImpl(); - }); - - afterEach(async () => { - await afterEachImpl(); - await afterAllImpl(); - }); - - describe('enqueueSystemWebhook', () => { - test('キューに追加成功', async () => { - const webhook = await createWebhook({ - isActive: true, - on: ['abuseReport'], - }); - await service.enqueueSystemWebhook(webhook.id, 'abuseReport', { foo: 'bar' } as any); - - expect(queueService.systemWebhookDeliver).toHaveBeenCalled(); - }); - - test('非アクティブなWebhookはキューに追加されない', async () => { - const webhook = await createWebhook({ - isActive: false, - on: ['abuseReport'], - }); - await service.enqueueSystemWebhook(webhook.id, 'abuseReport', { foo: 'bar' } as any); - - expect(queueService.systemWebhookDeliver).not.toHaveBeenCalled(); - }); - - test('未許可のイベント種別が渡された場合はWebhookはキューに追加されない', async () => { - const webhook1 = await createWebhook({ - isActive: true, - on: [], - }); - const webhook2 = await createWebhook({ - isActive: true, - on: ['abuseReportResolved'], - }); - await service.enqueueSystemWebhook(webhook1.id, 'abuseReport', { foo: 'bar' } as any); - await service.enqueueSystemWebhook(webhook2.id, 'abuseReport', { foo: 'bar' } as any); - - expect(queueService.systemWebhookDeliver).not.toHaveBeenCalled(); - }); - }); - - describe('fetchActiveSystemWebhooks', () => { - describe('systemWebhookCreated', () => { - test('ActiveなWebhookが追加された時、キャッシュに追加されている', async () => { - const webhook = await service.createSystemWebhook( - { - isActive: true, - name: randomString(), - on: ['abuseReport'], - url: 'https://example.com', - secret: randomString(), - }, - root, - ); - - // redisでの配信経由で更新されるのでちょっと待つ - await setTimeout(500); - - const fetchedWebhooks = await service.fetchActiveSystemWebhooks(); - expect(fetchedWebhooks).toEqual([webhook]); - }); - - test('NotActiveなWebhookが追加された時、キャッシュに追加されていない', async () => { - const webhook = await service.createSystemWebhook( - { - isActive: false, - name: randomString(), - on: ['abuseReport'], - url: 'https://example.com', - secret: randomString(), - }, - root, - ); - - // redisでの配信経由で更新されるのでちょっと待つ - await setTimeout(500); - - const fetchedWebhooks = await service.fetchActiveSystemWebhooks(); - expect(fetchedWebhooks).toEqual([]); - }); - }); - - describe('systemWebhookUpdated', () => { - test('ActiveなWebhookが編集された時、キャッシュに反映されている', async () => { - const id = idService.gen(); - await createWebhook({ id }); - // キャッシュ作成 - const webhook1 = await service.fetchActiveSystemWebhooks(); - // 読み込まれていることをチェック - expect(webhook1.length).toEqual(1); - expect(webhook1[0].id).toEqual(id); - - const webhook2 = await service.updateSystemWebhook( - { - id, - isActive: true, - name: randomString(), - on: ['abuseReport'], - url: 'https://example.com', - secret: randomString(), - }, - root, - ); - - // redisでの配信経由で更新されるのでちょっと待つ - await setTimeout(500); - - const fetchedWebhooks = await service.fetchActiveSystemWebhooks(); - expect(fetchedWebhooks).toEqual([webhook2]); - }); - - test('NotActiveなWebhookが編集された時、キャッシュに追加されない', async () => { - const id = idService.gen(); - await createWebhook({ id, isActive: false }); - // キャッシュ作成 - const webhook1 = await service.fetchActiveSystemWebhooks(); - // 読み込まれていないことをチェック - expect(webhook1.length).toEqual(0); - - const webhook2 = await service.updateSystemWebhook( - { - id, - isActive: false, - name: randomString(), - on: ['abuseReport'], - url: 'https://example.com', - secret: randomString(), - }, - root, - ); - - // redisでの配信経由で更新されるのでちょっと待つ - await setTimeout(500); - - const fetchedWebhooks = await service.fetchActiveSystemWebhooks(); - expect(fetchedWebhooks.length).toEqual(0); - }); - - test('NotActiveなWebhookがActiveにされた時、キャッシュに追加されている', async () => { - const id = idService.gen(); - const baseWebhook = await createWebhook({ id, isActive: false }); - // キャッシュ作成 - const webhook1 = await service.fetchActiveSystemWebhooks(); - // 読み込まれていないことをチェック - expect(webhook1.length).toEqual(0); - - const webhook2 = await service.updateSystemWebhook( - { - ...baseWebhook, - isActive: true, - }, - root, - ); - - // redisでの配信経由で更新されるのでちょっと待つ - await setTimeout(500); - - const fetchedWebhooks = await service.fetchActiveSystemWebhooks(); - expect(fetchedWebhooks).toEqual([webhook2]); - }); - - test('ActiveなWebhookがNotActiveにされた時、キャッシュから削除されている', async () => { - const id = idService.gen(); - const baseWebhook = await createWebhook({ id, isActive: true }); - // キャッシュ作成 - const webhook1 = await service.fetchActiveSystemWebhooks(); - // 読み込まれていることをチェック - expect(webhook1.length).toEqual(1); - expect(webhook1[0].id).toEqual(id); - - const webhook2 = await service.updateSystemWebhook( - { - ...baseWebhook, - isActive: false, - }, - root, - ); - - // redisでの配信経由で更新されるのでちょっと待つ - await setTimeout(500); - - const fetchedWebhooks = await service.fetchActiveSystemWebhooks(); - expect(fetchedWebhooks.length).toEqual(0); - }); - }); - - describe('systemWebhookDeleted', () => { - test('キャッシュから削除されている', async () => { - const id = idService.gen(); - const baseWebhook = await createWebhook({ id, isActive: true }); - // キャッシュ作成 - const webhook1 = await service.fetchActiveSystemWebhooks(); - // 読み込まれていることをチェック - expect(webhook1.length).toEqual(1); - expect(webhook1[0].id).toEqual(id); - - const webhook2 = await service.deleteSystemWebhook( - id, - root, - ); - - // redisでの配信経由で更新されるのでちょっと待つ - await setTimeout(500); - - const fetchedWebhooks = await service.fetchActiveSystemWebhooks(); - expect(fetchedWebhooks.length).toEqual(0); - }); - }); - }); - }); -}); diff --git a/packages/backend/test/unit/UserSearchService.ts b/packages/backend/test/unit/UserSearchService.ts deleted file mode 100644 index 7ea325d420..0000000000 --- a/packages/backend/test/unit/UserSearchService.ts +++ /dev/null @@ -1,265 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Test, TestingModule } from '@nestjs/testing'; -import { describe, jest, test } from '@jest/globals'; -import { In } from 'typeorm'; -import { UserSearchService } from '@/core/UserSearchService.js'; -import { FollowingsRepository, MiUser, UserProfilesRepository, UsersRepository } from '@/models/_.js'; -import { IdService } from '@/core/IdService.js'; -import { GlobalModule } from '@/GlobalModule.js'; -import { DI } from '@/di-symbols.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; - -describe('UserSearchService', () => { - let app: TestingModule; - let service: UserSearchService; - - let usersRepository: UsersRepository; - let followingsRepository: FollowingsRepository; - let idService: IdService; - let userProfilesRepository: UserProfilesRepository; - - let root: MiUser; - let alice: MiUser; - let alyce: MiUser; - let alycia: MiUser; - let alysha: MiUser; - let alyson: MiUser; - let alyssa: MiUser; - let bob: MiUser; - let bobbi: MiUser; - let bobbie: MiUser; - let bobby: MiUser; - - async function createUser(data: Partial = {}) { - const user = await usersRepository - .insert({ - id: idService.gen(), - ...data, - }) - .then(x => usersRepository.findOneByOrFail(x.identifiers[0])); - - await userProfilesRepository.insert({ - userId: user.id, - }); - - return user; - } - - async function createFollowings(follower: MiUser, followees: MiUser[]) { - for (const followee of followees) { - await followingsRepository.insert({ - id: idService.gen(), - followerId: follower.id, - followeeId: followee.id, - }); - } - } - - async function setActive(users: MiUser[]) { - for (const user of users) { - await usersRepository.update(user.id, { - updatedAt: new Date(), - }); - } - } - - async function setInactive(users: MiUser[]) { - for (const user of users) { - await usersRepository.update(user.id, { - updatedAt: new Date(0), - }); - } - } - - async function setSuspended(users: MiUser[]) { - for (const user of users) { - await usersRepository.update(user.id, { - isSuspended: true, - }); - } - } - - beforeAll(async () => { - app = await Test - .createTestingModule({ - imports: [ - GlobalModule, - ], - providers: [ - UserSearchService, - { - provide: UserEntityService, useFactory: jest.fn(() => ({ - // とりあえずIDが返れば確認が出来るので - packMany: (value: any) => value, - })), - }, - IdService, - ], - }) - .compile(); - - await app.init(); - - usersRepository = app.get(DI.usersRepository); - userProfilesRepository = app.get(DI.userProfilesRepository); - followingsRepository = app.get(DI.followingsRepository); - - service = app.get(UserSearchService); - idService = app.get(IdService); - }); - - beforeEach(async () => { - root = await createUser({ username: 'root', usernameLower: 'root', isRoot: true }); - alice = await createUser({ username: 'Alice', usernameLower: 'alice' }); - alyce = await createUser({ username: 'Alyce', usernameLower: 'alyce' }); - alycia = await createUser({ username: 'Alycia', usernameLower: 'alycia' }); - alysha = await createUser({ username: 'Alysha', usernameLower: 'alysha' }); - alyson = await createUser({ username: 'Alyson', usernameLower: 'alyson', host: 'example.com' }); - alyssa = await createUser({ username: 'Alyssa', usernameLower: 'alyssa', host: 'example.com' }); - bob = await createUser({ username: 'Bob', usernameLower: 'bob' }); - bobbi = await createUser({ username: 'Bobbi', usernameLower: 'bobbi' }); - bobbie = await createUser({ username: 'Bobbie', usernameLower: 'bobbie', host: 'example.com' }); - bobby = await createUser({ username: 'Bobby', usernameLower: 'bobby', host: 'example.com' }); - }); - - afterEach(async () => { - await usersRepository.delete({}); - }); - - afterAll(async () => { - await app.close(); - }); - - describe('search', () => { - test('フォロー中のアクティブユーザのうち、"al"から始まる人が全員ヒットする', async () => { - await createFollowings(root, [alice, alyce, alycia, alysha, alyson, alyssa, bob, bobbi, bobbie, bobby]); - await setActive([alice, alyce, alyssa, bob, bobbi, bobbie, bobby]); - await setInactive([alycia, alysha, alyson]); - - const result = await service.search( - { username: 'al' }, - { limit: 100 }, - root, - ); - - // alycia, alysha, alysonは非アクティブなので後ろに行く - expect(result).toEqual([alice, alyce, alyssa, alycia, alysha, alyson].map(x => x.id)); - }); - - test('フォロー中の非アクティブユーザのうち、"al"から始まる人が全員ヒットする', async () => { - await createFollowings(root, [alycia, alysha, alyson, alyssa, bob, bobbi, bobbie, bobby]); - await setInactive([alice, alyce, alycia, alysha, alyson, alyssa, bob, bobbi, bobbie, bobby]); - - const result = await service.search( - { username: 'al' }, - { limit: 100 }, - root, - ); - - // alice, alyceはフォローしていないので後ろに行く - expect(result).toEqual([alycia, alysha, alyson, alyssa, alice, alyce].map(x => x.id)); - }); - - test('フォローしていないアクティブユーザのうち、"al"から始まる人が全員ヒットする', async () => { - await setActive([alysha, alyson, alyssa, bob, bobbi, bobbie, bobby]); - await setInactive([alice, alyce, alycia]); - - const result = await service.search( - { username: 'al' }, - { limit: 100 }, - root, - ); - - // alice, alyce, alyciaは非アクティブなので後ろに行く - expect(result).toEqual([alysha, alyson, alyssa, alice, alyce, alycia].map(x => x.id)); - }); - - test('フォローしていない非アクティブユーザのうち、"al"から始まる人が全員ヒットする', async () => { - await setInactive([alice, alyce, alycia, alysha, alyson, alyssa, bob, bobbi, bobbie, bobby]); - - const result = await service.search( - { username: 'al' }, - { limit: 100 }, - root, - ); - - expect(result).toEqual([alice, alyce, alycia, alysha, alyson, alyssa].map(x => x.id)); - }); - - test('フォロー(アクティブ)、フォロー(非アクティブ)、非フォロー(アクティブ)、非フォロー(非アクティブ)混在時の優先順位度確認', async () => { - await createFollowings(root, [alyson, alyssa, bob, bobbi, bobbie]); - await setActive([root, alyssa, bob, bobbi, alyce, alycia]); - await setInactive([alyson, alice, alysha, bobbie, bobby]); - - const result = await service.search( - { }, - { limit: 100 }, - root, - ); - - // 見る用 - // const users = await usersRepository.findBy({ id: In(result) }).then(it => new Map(it.map(x => [x.id, x]))); - // console.log(result.map(x => users.get(x as any)).map(it => it?.username)); - - // フォローしててアクティブなので先頭: alyssa, bob, bobbi - // フォローしてて非アクティブなので次: alyson, bobbie - // フォローしてないけどアクティブなので次: alyce, alycia, root(アルファベット順的にここになる) - // フォローしてないし非アクティブなので最後: alice, alysha, bobby - expect(result).toEqual([alyssa, bob, bobbi, alyson, bobbie, alyce, alycia, root, alice, alysha, bobby].map(x => x.id)); - }); - - test('[非ログイン] アクティブユーザのうち、"al"から始まる人が全員ヒットする', async () => { - await setActive([alysha, alyson, alyssa, bob, bobbi, bobbie, bobby]); - await setInactive([alice, alyce, alycia]); - - const result = await service.search( - { username: 'al' }, - { limit: 100 }, - ); - - // alice, alyce, alyciaは非アクティブなので後ろに行く - expect(result).toEqual([alysha, alyson, alyssa, alice, alyce, alycia].map(x => x.id)); - }); - - test('[非ログイン] 非アクティブユーザのうち、"al"から始まる人が全員ヒットする', async () => { - await setInactive([alice, alyce, alycia, alysha, alyson, alyssa, bob, bobbi, bobbie, bobby]); - - const result = await service.search( - { username: 'al' }, - { limit: 100 }, - ); - - expect(result).toEqual([alice, alyce, alycia, alysha, alyson, alyssa].map(x => x.id)); - }); - - test('フォロー中のアクティブユーザのうち、"al"から始まり"example.com"にいる人が全員ヒットする', async () => { - await createFollowings(root, [alice, alyce, alycia, alysha, alyson, alyssa, bob, bobbi, bobbie, bobby]); - await setActive([alice, alyce, alycia, alysha, alyson, alyssa, bob, bobbi, bobbie, bobby]); - - const result = await service.search( - { username: 'al', host: 'exam' }, - { limit: 100 }, - root, - ); - - expect(result).toEqual([alyson, alyssa].map(x => x.id)); - }); - - test('サスペンド済みユーザは出ない', async () => { - await setActive([alice, alyce, alycia, alysha, alyson, alyssa, bob, bobbi, bobbie, bobby]); - await setSuspended([alice, alyce, alycia]); - - const result = await service.search( - { username: 'al' }, - { limit: 100 }, - root, - ); - - expect(result).toEqual([alysha, alyson, alyssa].map(x => x.id)); - }); - }); -}); diff --git a/packages/backend/test/unit/UserWebhookService.ts b/packages/backend/test/unit/UserWebhookService.ts deleted file mode 100644 index 0e88835a02..0000000000 --- a/packages/backend/test/unit/UserWebhookService.ts +++ /dev/null @@ -1,245 +0,0 @@ - -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { afterEach, beforeEach, describe, expect, jest } from '@jest/globals'; -import { Test, TestingModule } from '@nestjs/testing'; -import { randomString } from '../utils.js'; -import { MiUser } from '@/models/User.js'; -import { MiWebhook, UsersRepository, WebhooksRepository } from '@/models/_.js'; -import { IdService } from '@/core/IdService.js'; -import { GlobalModule } from '@/GlobalModule.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; -import { DI } from '@/di-symbols.js'; -import { QueueService } from '@/core/QueueService.js'; -import { LoggerService } from '@/core/LoggerService.js'; -import { UserWebhookService } from '@/core/UserWebhookService.js'; - -describe('UserWebhookService', () => { - let app: TestingModule; - let service: UserWebhookService; - - // -------------------------------------------------------------------------------------- - - let usersRepository: UsersRepository; - let userWebhooksRepository: WebhooksRepository; - let idService: IdService; - let queueService: jest.Mocked; - - // -------------------------------------------------------------------------------------- - - let root: MiUser; - - // -------------------------------------------------------------------------------------- - - async function createUser(data: Partial = {}) { - return await usersRepository - .insert({ - id: idService.gen(), - ...data, - }) - .then(x => usersRepository.findOneByOrFail(x.identifiers[0])); - } - - async function createWebhook(data: Partial = {}) { - return userWebhooksRepository - .insert({ - id: idService.gen(), - name: randomString(), - on: ['mention'], - url: 'https://example.com', - secret: randomString(), - userId: root.id, - ...data, - }) - .then(x => userWebhooksRepository.findOneByOrFail(x.identifiers[0])); - } - - // -------------------------------------------------------------------------------------- - - async function beforeAllImpl() { - app = await Test - .createTestingModule({ - imports: [ - GlobalModule, - ], - providers: [ - UserWebhookService, - IdService, - LoggerService, - GlobalEventService, - { - provide: QueueService, useFactory: () => ({ systemWebhookDeliver: jest.fn() }), - }, - ], - }) - .compile(); - - usersRepository = app.get(DI.usersRepository); - userWebhooksRepository = app.get(DI.webhooksRepository); - - service = app.get(UserWebhookService); - idService = app.get(IdService); - queueService = app.get(QueueService) as jest.Mocked; - - app.enableShutdownHooks(); - } - - async function afterAllImpl() { - await app.close(); - } - - async function beforeEachImpl() { - root = await createUser({ isRoot: true, username: 'root', usernameLower: 'root' }); - } - - async function afterEachImpl() { - await usersRepository.delete({}); - await userWebhooksRepository.delete({}); - } - - // -------------------------------------------------------------------------------------- - - describe('アプリを毎回作り直す必要のないグループ', () => { - beforeAll(beforeAllImpl); - afterAll(afterAllImpl); - beforeEach(beforeEachImpl); - afterEach(afterEachImpl); - - describe('fetchSystemWebhooks', () => { - test('フィルタなし', async () => { - const webhook1 = await createWebhook({ - active: true, - on: ['mention'], - }); - const webhook2 = await createWebhook({ - active: false, - on: ['mention'], - }); - const webhook3 = await createWebhook({ - active: true, - on: ['reply'], - }); - const webhook4 = await createWebhook({ - active: false, - on: [], - }); - - const fetchedWebhooks = await service.fetchWebhooks(); - expect(fetchedWebhooks).toEqual([webhook1, webhook2, webhook3, webhook4]); - }); - - test('activeのみ', async () => { - const webhook1 = await createWebhook({ - active: true, - on: ['mention'], - }); - const webhook2 = await createWebhook({ - active: false, - on: ['mention'], - }); - const webhook3 = await createWebhook({ - active: true, - on: ['reply'], - }); - const webhook4 = await createWebhook({ - active: false, - on: [], - }); - - const fetchedWebhooks = await service.fetchWebhooks({ isActive: true }); - expect(fetchedWebhooks).toEqual([webhook1, webhook3]); - }); - - test('特定のイベントのみ', async () => { - const webhook1 = await createWebhook({ - active: true, - on: ['mention'], - }); - const webhook2 = await createWebhook({ - active: false, - on: ['mention'], - }); - const webhook3 = await createWebhook({ - active: true, - on: ['reply'], - }); - const webhook4 = await createWebhook({ - active: false, - on: [], - }); - - const fetchedWebhooks = await service.fetchWebhooks({ on: ['mention'] }); - expect(fetchedWebhooks).toEqual([webhook1, webhook2]); - }); - - test('activeな特定のイベントのみ', async () => { - const webhook1 = await createWebhook({ - active: true, - on: ['mention'], - }); - const webhook2 = await createWebhook({ - active: false, - on: ['mention'], - }); - const webhook3 = await createWebhook({ - active: true, - on: ['reply'], - }); - const webhook4 = await createWebhook({ - active: false, - on: [], - }); - - const fetchedWebhooks = await service.fetchWebhooks({ on: ['mention'], isActive: true }); - expect(fetchedWebhooks).toEqual([webhook1]); - }); - - test('ID指定', async () => { - const webhook1 = await createWebhook({ - active: true, - on: ['mention'], - }); - const webhook2 = await createWebhook({ - active: false, - on: ['mention'], - }); - const webhook3 = await createWebhook({ - active: true, - on: ['reply'], - }); - const webhook4 = await createWebhook({ - active: false, - on: [], - }); - - const fetchedWebhooks = await service.fetchWebhooks({ ids: [webhook1.id, webhook4.id] }); - expect(fetchedWebhooks).toEqual([webhook1, webhook4]); - }); - - test('ID指定(他条件とANDになるか見たい)', async () => { - const webhook1 = await createWebhook({ - active: true, - on: ['mention'], - }); - const webhook2 = await createWebhook({ - active: false, - on: ['mention'], - }); - const webhook3 = await createWebhook({ - active: true, - on: ['reply'], - }); - const webhook4 = await createWebhook({ - active: false, - on: [], - }); - - const fetchedWebhooks = await service.fetchWebhooks({ ids: [webhook1.id, webhook4.id], isActive: false }); - expect(fetchedWebhooks).toEqual([webhook4]); - }); - }); - }); -}); diff --git a/packages/backend/test/unit/WebhookTestService.ts b/packages/backend/test/unit/WebhookTestService.ts deleted file mode 100644 index be84ae9b84..0000000000 --- a/packages/backend/test/unit/WebhookTestService.ts +++ /dev/null @@ -1,225 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Test, TestingModule } from '@nestjs/testing'; -import { beforeAll, describe, jest } from '@jest/globals'; -import { WebhookTestService } from '@/core/WebhookTestService.js'; -import { UserWebhookPayload, UserWebhookService } from '@/core/UserWebhookService.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; -import { GlobalModule } from '@/GlobalModule.js'; -import { MiSystemWebhook, MiUser, MiWebhook, UserProfilesRepository, UsersRepository } from '@/models/_.js'; -import { IdService } from '@/core/IdService.js'; -import { DI } from '@/di-symbols.js'; -import { QueueService } from '@/core/QueueService.js'; - -describe('WebhookTestService', () => { - let app: TestingModule; - let service: WebhookTestService; - - // -------------------------------------------------------------------------------------- - - let usersRepository: UsersRepository; - let userProfilesRepository: UserProfilesRepository; - let queueService: jest.Mocked; - let userWebhookService: jest.Mocked; - let systemWebhookService: jest.Mocked; - let idService: IdService; - - let root: MiUser; - let alice: MiUser; - - async function createUser(data: Partial = {}) { - const user = await usersRepository - .insert({ - id: idService.gen(), - ...data, - }) - .then(x => usersRepository.findOneByOrFail(x.identifiers[0])); - - await userProfilesRepository.insert({ - userId: user.id, - }); - - return user; - } - - // -------------------------------------------------------------------------------------- - - beforeAll(async () => { - app = await Test.createTestingModule({ - imports: [ - GlobalModule, - ], - providers: [ - WebhookTestService, - IdService, - { - provide: QueueService, useFactory: () => ({ - systemWebhookDeliver: jest.fn(), - userWebhookDeliver: jest.fn(), - }), - }, - { - provide: UserWebhookService, useFactory: () => ({ - fetchWebhooks: jest.fn(), - }), - }, - { - provide: SystemWebhookService, useFactory: () => ({ - fetchSystemWebhooks: jest.fn(), - }), - }, - ], - }).compile(); - - usersRepository = app.get(DI.usersRepository); - userProfilesRepository = app.get(DI.userProfilesRepository); - - service = app.get(WebhookTestService); - idService = app.get(IdService); - queueService = app.get(QueueService) as jest.Mocked; - userWebhookService = app.get(UserWebhookService) as jest.Mocked; - systemWebhookService = app.get(SystemWebhookService) as jest.Mocked; - - app.enableShutdownHooks(); - }); - - beforeEach(async () => { - root = await createUser({ username: 'root', usernameLower: 'root', isRoot: true }); - alice = await createUser({ username: 'alice', usernameLower: 'alice', isRoot: false }); - - userWebhookService.fetchWebhooks.mockReturnValue(Promise.resolve([ - { id: 'dummy-webhook', active: true, userId: alice.id } as MiWebhook, - ])); - systemWebhookService.fetchSystemWebhooks.mockReturnValue(Promise.resolve([ - { id: 'dummy-webhook', isActive: true } as MiSystemWebhook, - ])); - }); - - afterEach(async () => { - queueService.systemWebhookDeliver.mockClear(); - queueService.userWebhookDeliver.mockClear(); - userWebhookService.fetchWebhooks.mockClear(); - systemWebhookService.fetchSystemWebhooks.mockClear(); - - await usersRepository.delete({}); - await userProfilesRepository.delete({}); - }); - - afterAll(async () => { - await app.close(); - }); - - // -------------------------------------------------------------------------------------- - - describe('testUserWebhook', () => { - test('note', async () => { - await service.testUserWebhook({ webhookId: 'dummy-webhook', type: 'note' }, alice); - - const calls = queueService.userWebhookDeliver.mock.calls[0]; - expect((calls[0] as any).id).toBe('dummy-webhook'); - expect(calls[1]).toBe('note'); - expect((calls[2] as UserWebhookPayload<'note'>).note.id).toBe('dummy-note-1'); - }); - - test('reply', async () => { - await service.testUserWebhook({ webhookId: 'dummy-webhook', type: 'reply' }, alice); - - const calls = queueService.userWebhookDeliver.mock.calls[0]; - expect((calls[0] as any).id).toBe('dummy-webhook'); - expect(calls[1]).toBe('reply'); - expect((calls[2] as UserWebhookPayload<'reply'>).note.id).toBe('dummy-reply-1'); - }); - - test('renote', async () => { - await service.testUserWebhook({ webhookId: 'dummy-webhook', type: 'renote' }, alice); - - const calls = queueService.userWebhookDeliver.mock.calls[0]; - expect((calls[0] as any).id).toBe('dummy-webhook'); - expect(calls[1]).toBe('renote'); - expect((calls[2] as UserWebhookPayload<'renote'>).note.id).toBe('dummy-renote-1'); - }); - - test('mention', async () => { - await service.testUserWebhook({ webhookId: 'dummy-webhook', type: 'mention' }, alice); - - const calls = queueService.userWebhookDeliver.mock.calls[0]; - expect((calls[0] as any).id).toBe('dummy-webhook'); - expect(calls[1]).toBe('mention'); - expect((calls[2] as UserWebhookPayload<'mention'>).note.id).toBe('dummy-mention-1'); - }); - - test('follow', async () => { - await service.testUserWebhook({ webhookId: 'dummy-webhook', type: 'follow' }, alice); - - const calls = queueService.userWebhookDeliver.mock.calls[0]; - expect((calls[0] as any).id).toBe('dummy-webhook'); - expect(calls[1]).toBe('follow'); - expect((calls[2] as UserWebhookPayload<'follow'>).user.id).toBe('dummy-user-1'); - }); - - test('followed', async () => { - await service.testUserWebhook({ webhookId: 'dummy-webhook', type: 'followed' }, alice); - - const calls = queueService.userWebhookDeliver.mock.calls[0]; - expect((calls[0] as any).id).toBe('dummy-webhook'); - expect(calls[1]).toBe('followed'); - expect((calls[2] as UserWebhookPayload<'followed'>).user.id).toBe('dummy-user-2'); - }); - - test('unfollow', async () => { - await service.testUserWebhook({ webhookId: 'dummy-webhook', type: 'unfollow' }, alice); - - const calls = queueService.userWebhookDeliver.mock.calls[0]; - expect((calls[0] as any).id).toBe('dummy-webhook'); - expect(calls[1]).toBe('unfollow'); - expect((calls[2] as UserWebhookPayload<'unfollow'>).user.id).toBe('dummy-user-3'); - }); - - describe('NoSuchWebhookError', () => { - test('user not match', async () => { - userWebhookService.fetchWebhooks.mockClear(); - userWebhookService.fetchWebhooks.mockReturnValue(Promise.resolve([ - { id: 'dummy-webhook', active: true } as MiWebhook, - ])); - - await expect(service.testUserWebhook({ webhookId: 'dummy-webhook', type: 'note' }, root)) - .rejects.toThrow(WebhookTestService.NoSuchWebhookError); - }); - }); - }); - - describe('testSystemWebhook', () => { - test('abuseReport', async () => { - await service.testSystemWebhook({ webhookId: 'dummy-webhook', type: 'abuseReport' }); - - const calls = queueService.systemWebhookDeliver.mock.calls[0]; - expect((calls[0] as any).id).toBe('dummy-webhook'); - expect(calls[1]).toBe('abuseReport'); - expect((calls[2] as any).id).toBe('dummy-abuse-report1'); - expect((calls[2] as any).resolved).toBe(false); - }); - - test('abuseReportResolved', async () => { - await service.testSystemWebhook({ webhookId: 'dummy-webhook', type: 'abuseReportResolved' }); - - const calls = queueService.systemWebhookDeliver.mock.calls[0]; - expect((calls[0] as any).id).toBe('dummy-webhook'); - expect(calls[1]).toBe('abuseReportResolved'); - expect((calls[2] as any).id).toBe('dummy-abuse-report1'); - expect((calls[2] as any).resolved).toBe(true); - }); - - test('userCreated', async () => { - await service.testSystemWebhook({ webhookId: 'dummy-webhook', type: 'userCreated' }); - - const calls = queueService.systemWebhookDeliver.mock.calls[0]; - expect((calls[0] as any).id).toBe('dummy-webhook'); - expect(calls[1]).toBe('userCreated'); - expect((calls[2] as any).id).toBe('dummy-user-1'); - }); - }); -}); diff --git a/packages/backend/test/unit/activitypub.ts b/packages/backend/test/unit/activitypub.ts index 2fc08aec91..63952e6434 100644 --- a/packages/backend/test/unit/activitypub.ts +++ b/packages/backend/test/unit/activitypub.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -13,17 +13,15 @@ import { ApImageService } from '@/core/activitypub/models/ApImageService.js'; import { ApNoteService } from '@/core/activitypub/models/ApNoteService.js'; import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; -import { JsonLdService } from '@/core/activitypub/JsonLdService.js'; -import { CONTEXT } from '@/core/activitypub/misc/contexts.js'; import { GlobalModule } from '@/GlobalModule.js'; import { CoreModule } from '@/core/CoreModule.js'; import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; import { LoggerService } from '@/core/LoggerService.js'; -import type { IActor, IApDocument, ICollection, IObject, IPost } from '@/core/activitypub/type.js'; -import { MiMeta, MiNote, UserProfilesRepository } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; +import type { IActor, IApDocument, ICollection, IPost } from '@/core/activitypub/type.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/User.js'; import { genAidx } from '@/misc/id/aidx.js'; import { MockResolver } from '../misc/mock-resolver.js'; @@ -86,12 +84,10 @@ async function createRandomRemoteUser( } describe('ActivityPub', () => { - let userProfilesRepository: UserProfilesRepository; let imageService: ApImageService; let noteService: ApNoteService; let personService: ApPersonService; let rendererService: ApRendererService; - let jsonLdService: JsonLdService; let resolver: MockResolver; const metaInitial = { @@ -104,16 +100,8 @@ describe('ActivityPub', () => { perRemoteUserUserTimelineCacheMax: 100, blockedHosts: [] as string[], sensitiveWords: [] as string[], - prohibitedWords: [] as string[], } as MiMeta; - const meta = { ...metaInitial }; - - function updateMeta(newMeta: Partial): void { - for (const key in meta) { - delete (meta as any)[key]; - } - Object.assign(meta, newMeta); - } + let meta = metaInitial; beforeAll(async () => { const app = await Test.createTestingModule({ @@ -126,19 +114,19 @@ describe('ActivityPub', () => { }; }, }) - .overrideProvider(DI.meta).useFactory({ factory: () => meta }) - .compile(); + .overrideProvider(MetaService).useValue({ + async fetch(): Promise { + return meta; + }, + }).compile(); await app.init(); app.enableShutdownHooks(); - userProfilesRepository = app.get(DI.userProfilesRepository); - noteService = app.get(ApNoteService); personService = app.get(ApPersonService); rendererService = app.get(ApRendererService); imageService = app.get(ApImageService); - jsonLdService = app.get(JsonLdService); resolver = new MockResolver(await app.resolve(LoggerService)); // Prevent ApPersonService from fetching instance, as it causes Jest import-after-test error @@ -212,56 +200,9 @@ describe('ActivityPub', () => { }); }); - describe('Collection visibility', () => { - test('Public following/followers', async () => { - const actor = createRandomActor(); - actor.following = { - id: `${actor.id}/following`, - type: 'OrderedCollection', - totalItems: 0, - first: `${actor.id}/following?page=1`, - }; - actor.followers = `${actor.id}/followers`; - - resolver.register(actor.id, actor); - resolver.register(actor.followers, { - id: actor.followers, - type: 'OrderedCollection', - totalItems: 0, - first: `${actor.followers}?page=1`, - }); - - const user = await personService.createPerson(actor.id, resolver); - const userProfile = await userProfilesRepository.findOneByOrFail({ userId: user.id }); - - assert.deepStrictEqual(userProfile.followingVisibility, 'public'); - assert.deepStrictEqual(userProfile.followersVisibility, 'public'); - }); - - test('Private following/followers', async () => { - const actor = createRandomActor(); - actor.following = { - id: `${actor.id}/following`, - type: 'OrderedCollection', - totalItems: 0, - // first: … - }; - actor.followers = `${actor.id}/followers`; - - resolver.register(actor.id, actor); - //resolver.register(actor.followers, { … }); - - const user = await personService.createPerson(actor.id, resolver); - const userProfile = await userProfilesRepository.findOneByOrFail({ userId: user.id }); - - assert.deepStrictEqual(userProfile.followingVisibility, 'private'); - assert.deepStrictEqual(userProfile.followersVisibility, 'private'); - }); - }); - describe('Renderer', () => { test('Render an announce with visibility: followers', () => { - rendererService.renderAnnounce('https://example.com/notes/00example', { + rendererService.renderAnnounce(null, { id: genAidx(Date.now()), visibility: 'followers', } as MiNote); @@ -353,7 +294,7 @@ describe('ActivityPub', () => { await createRandomRemoteUser(resolver, personService), imageObject, ); - assert.ok(driveFile && !driveFile.isLink); + assert.ok(!driveFile.isLink); const sensitiveImageObject: IApDocument = { type: 'Document', @@ -366,11 +307,11 @@ describe('ActivityPub', () => { await createRandomRemoteUser(resolver, personService), sensitiveImageObject, ); - assert.ok(sensitiveDriveFile && !sensitiveDriveFile.isLink); + assert.ok(!sensitiveDriveFile.isLink); }); test('cacheRemoteFiles=false disables caching', async () => { - updateMeta({ ...metaInitial, cacheRemoteFiles: false }); + meta = { ...metaInitial, cacheRemoteFiles: false }; const imageObject: IApDocument = { type: 'Document', @@ -382,7 +323,7 @@ describe('ActivityPub', () => { await createRandomRemoteUser(resolver, personService), imageObject, ); - assert.ok(driveFile && driveFile.isLink); + assert.ok(driveFile.isLink); const sensitiveImageObject: IApDocument = { type: 'Document', @@ -395,11 +336,11 @@ describe('ActivityPub', () => { await createRandomRemoteUser(resolver, personService), sensitiveImageObject, ); - assert.ok(sensitiveDriveFile && sensitiveDriveFile.isLink); + assert.ok(sensitiveDriveFile.isLink); }); test('cacheRemoteSensitiveFiles=false only affects sensitive files', async () => { - updateMeta({ ...metaInitial, cacheRemoteSensitiveFiles: false }); + meta = { ...metaInitial, cacheRemoteSensitiveFiles: false }; const imageObject: IApDocument = { type: 'Document', @@ -411,7 +352,7 @@ describe('ActivityPub', () => { await createRandomRemoteUser(resolver, personService), imageObject, ); - assert.ok(driveFile && !driveFile.isLink); + assert.ok(!driveFile.isLink); const sensitiveImageObject: IApDocument = { type: 'Document', @@ -424,57 +365,7 @@ describe('ActivityPub', () => { await createRandomRemoteUser(resolver, personService), sensitiveImageObject, ); - assert.ok(sensitiveDriveFile && sensitiveDriveFile.isLink); - }); - - test('Link is not an attachment files', async () => { - const linkObject: IObject = { - type: 'Link', - href: 'https://example.com/', - }; - const driveFile = await imageService.createImage( - await createRandomRemoteUser(resolver, personService), - linkObject, - ); - assert.strictEqual(driveFile, null); - }); - }); - - describe('JSON-LD', () =>{ - test('Compaction', async () => { - const jsonLd = jsonLdService.use(); - - const object = { - '@context': [ - 'https://www.w3.org/ns/activitystreams', - { - _misskey_quote: 'https://misskey-hub.net/ns#_misskey_quote', - unknown: 'https://example.org/ns#unknown', - undefined: null, - }, - ], - id: 'https://example.com/notes/42', - type: 'Note', - attributedTo: 'https://example.com/users/1', - to: ['https://www.w3.org/ns/activitystreams#Public'], - content: 'test test foo', - _misskey_quote: 'https://example.com/notes/1', - unknown: 'test test bar', - undefined: 'test test baz', - }; - const compacted = await jsonLd.compact(object); - - assert.deepStrictEqual(compacted, { - '@context': CONTEXT, - id: 'https://example.com/notes/42', - type: 'Note', - attributedTo: 'https://example.com/users/1', - to: 'as:Public', - content: 'test test foo', - _misskey_quote: 'https://example.com/notes/1', - 'https://example.org/ns#unknown': 'test test bar', - // undefined: 'test test baz', - }); + assert.ok(sensitiveDriveFile.isLink); }); }); }); diff --git a/packages/backend/test/unit/ap-request.ts b/packages/backend/test/unit/ap-request.ts index d3d39240dc..9edd53d274 100644 --- a/packages/backend/test/unit/ap-request.ts +++ b/packages/backend/test/unit/ap-request.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/test/unit/chart.ts b/packages/backend/test/unit/chart.ts index 9dedd3a79d..036e73fd5e 100644 --- a/packages/backend/test/unit/chart.ts +++ b/packages/backend/test/unit/chart.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/test/unit/entities/UserEntityService.ts b/packages/backend/test/unit/entities/UserEntityService.ts deleted file mode 100644 index e4f42809f8..0000000000 --- a/packages/backend/test/unit/entities/UserEntityService.ts +++ /dev/null @@ -1,530 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Test, TestingModule } from '@nestjs/testing'; -import type { MiUser } from '@/models/User.js'; -import { UserEntityService } from '@/core/entities/UserEntityService.js'; -import { GlobalModule } from '@/GlobalModule.js'; -import { CoreModule } from '@/core/CoreModule.js'; -import { secureRndstr } from '@/misc/secure-rndstr.js'; -import { genAidx } from '@/misc/id/aidx.js'; -import { - BlockingsRepository, - FollowingsRepository, FollowRequestsRepository, - MiUserProfile, MutingsRepository, RenoteMutingsRepository, - UserMemoRepository, - UserProfilesRepository, - UsersRepository, -} from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; -import { AvatarDecorationService } from '@/core/AvatarDecorationService.js'; -import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js'; -import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; -import { PageEntityService } from '@/core/entities/PageEntityService.js'; -import { CustomEmojiService } from '@/core/CustomEmojiService.js'; -import { AnnouncementService } from '@/core/AnnouncementService.js'; -import { RoleService } from '@/core/RoleService.js'; -import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; -import { IdService } from '@/core/IdService.js'; -import { UtilityService } from '@/core/UtilityService.js'; -import { EmojiEntityService } from '@/core/entities/EmojiEntityService.js'; -import { ModerationLogService } from '@/core/ModerationLogService.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; -import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; -import { MetaService } from '@/core/MetaService.js'; -import { FetchInstanceMetadataService } from '@/core/FetchInstanceMetadataService.js'; -import { CacheService } from '@/core/CacheService.js'; -import { ApResolverService } from '@/core/activitypub/ApResolverService.js'; -import { ApNoteService } from '@/core/activitypub/models/ApNoteService.js'; -import { ApImageService } from '@/core/activitypub/models/ApImageService.js'; -import { ApMfmService } from '@/core/activitypub/ApMfmService.js'; -import { MfmService } from '@/core/MfmService.js'; -import { HashtagService } from '@/core/HashtagService.js'; -import UsersChart from '@/core/chart/charts/users.js'; -import { ChartLoggerService } from '@/core/chart/ChartLoggerService.js'; -import InstanceChart from '@/core/chart/charts/instance.js'; -import { ApLoggerService } from '@/core/activitypub/ApLoggerService.js'; -import { AccountMoveService } from '@/core/AccountMoveService.js'; -import { ReactionService } from '@/core/ReactionService.js'; -import { NotificationService } from '@/core/NotificationService.js'; -import { ReactionsBufferingService } from '@/core/ReactionsBufferingService.js'; - -process.env.NODE_ENV = 'test'; - -describe('UserEntityService', () => { - describe('pack/packMany', () => { - let app: TestingModule; - let service: UserEntityService; - let usersRepository: UsersRepository; - let userProfileRepository: UserProfilesRepository; - let userMemosRepository: UserMemoRepository; - let followingRepository: FollowingsRepository; - let followingRequestRepository: FollowRequestsRepository; - let blockingRepository: BlockingsRepository; - let mutingRepository: MutingsRepository; - let renoteMutingsRepository: RenoteMutingsRepository; - - async function createUser(userData: Partial = {}, profileData: Partial = {}) { - const un = secureRndstr(16); - const user = await usersRepository - .insert({ - ...userData, - id: genAidx(Date.now()), - username: un, - usernameLower: un, - }) - .then(x => usersRepository.findOneByOrFail(x.identifiers[0])); - - await userProfileRepository.insert({ - ...profileData, - userId: user.id, - }); - - return user; - } - - async function memo(writer: MiUser, target: MiUser, memo: string) { - await userMemosRepository.insert({ - id: genAidx(Date.now()), - userId: writer.id, - targetUserId: target.id, - memo, - }); - } - - async function follow(follower: MiUser, followee: MiUser) { - await followingRepository.insert({ - id: genAidx(Date.now()), - followerId: follower.id, - followeeId: followee.id, - }); - } - - async function requestFollow(requester: MiUser, requestee: MiUser) { - await followingRequestRepository.insert({ - id: genAidx(Date.now()), - followerId: requester.id, - followeeId: requestee.id, - }); - } - - async function block(blocker: MiUser, blockee: MiUser) { - await blockingRepository.insert({ - id: genAidx(Date.now()), - blockerId: blocker.id, - blockeeId: blockee.id, - }); - } - - async function mute(mutant: MiUser, mutee: MiUser) { - await mutingRepository.insert({ - id: genAidx(Date.now()), - muterId: mutant.id, - muteeId: mutee.id, - }); - } - - async function muteRenote(mutant: MiUser, mutee: MiUser) { - await renoteMutingsRepository.insert({ - id: genAidx(Date.now()), - muterId: mutant.id, - muteeId: mutee.id, - }); - } - - function randomIntRange(weight = 10) { - return [...Array(Math.floor(Math.random() * weight))].map((it, idx) => idx); - } - - beforeAll(async () => { - const services = [ - UserEntityService, - ApPersonService, - NoteEntityService, - PageEntityService, - CustomEmojiService, - AnnouncementService, - RoleService, - FederatedInstanceService, - IdService, - AvatarDecorationService, - UtilityService, - EmojiEntityService, - ModerationLogService, - GlobalEventService, - DriveFileEntityService, - MetaService, - FetchInstanceMetadataService, - CacheService, - ApResolverService, - ApNoteService, - ApImageService, - ApMfmService, - MfmService, - HashtagService, - UsersChart, - ChartLoggerService, - InstanceChart, - ApLoggerService, - AccountMoveService, - ReactionService, - ReactionsBufferingService, - NotificationService, - ]; - - app = await Test.createTestingModule({ - imports: [GlobalModule, CoreModule], - providers: [ - ...services, - ...services.map(x => ({ provide: x.name, useExisting: x })), - ], - }).compile(); - await app.init(); - app.enableShutdownHooks(); - - service = app.get(UserEntityService); - usersRepository = app.get(DI.usersRepository); - userProfileRepository = app.get(DI.userProfilesRepository); - userMemosRepository = app.get(DI.userMemosRepository); - followingRepository = app.get(DI.followingsRepository); - followingRequestRepository = app.get(DI.followRequestsRepository); - blockingRepository = app.get(DI.blockingsRepository); - mutingRepository = app.get(DI.mutingsRepository); - renoteMutingsRepository = app.get(DI.renoteMutingsRepository); - }); - - afterAll(async () => { - await app.close(); - }); - - test('UserLite', async() => { - const me = await createUser(); - const who = await createUser(); - - await memo(me, who, 'memo'); - - const actual = await service.pack(who, me, { schema: 'UserLite' }) as any; - // no detail - expect(actual.memo).toBeUndefined(); - // no detail and me - expect(actual.birthday).toBeUndefined(); - // no detail and me - expect(actual.achievements).toBeUndefined(); - }); - - test('UserDetailedNotMe', async() => { - const me = await createUser(); - const who = await createUser({}, { birthday: '2000-01-01' }); - - await memo(me, who, 'memo'); - - const actual = await service.pack(who, me, { schema: 'UserDetailedNotMe' }) as any; - // is detail - expect(actual.memo).toBe('memo'); - // is detail - expect(actual.birthday).toBe('2000-01-01'); - // no detail and me - expect(actual.achievements).toBeUndefined(); - }); - - test('MeDetailed', async() => { - const achievements = [{ name: 'achievement', unlockedAt: new Date().getTime() }]; - const me = await createUser({}, { - birthday: '2000-01-01', - achievements: achievements, - }); - await memo(me, me, 'memo'); - - const actual = await service.pack(me, me, { schema: 'MeDetailed' }) as any; - // is detail - expect(actual.memo).toBe('memo'); - // is detail - expect(actual.birthday).toBe('2000-01-01'); - // is detail and me - expect(actual.achievements).toEqual(achievements); - }); - - describe('packManyによるpreloadがある時、preloadが無い時とpackの結果が同じになるか見たい', () => { - test('no-preload', async() => { - const me = await createUser(); - // meがフォローしてる人たち - const followeeMe = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of followeeMe) { - await follow(me, who); - const actual = await service.pack(who, me, { schema: 'UserDetailed' }) as any; - expect(actual.isFollowing).toBe(true); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(false); - } - - // meをフォローしてる人たち - const followerMe = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of followerMe) { - await follow(who, me); - const actual = await service.pack(who, me, { schema: 'UserDetailed' }) as any; - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(true); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(false); - } - - // meがフォローリクエストを送った人たち - const requestsFromYou = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of requestsFromYou) { - await requestFollow(me, who); - const actual = await service.pack(who, me, { schema: 'UserDetailed' }) as any; - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(true); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(false); - } - - // meにフォローリクエストを送った人たち - const requestsToYou = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of requestsToYou) { - await requestFollow(who, me); - const actual = await service.pack(who, me, { schema: 'UserDetailed' }) as any; - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(true); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(false); - } - - // meがブロックしてる人たち - const blockingYou = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of blockingYou) { - await block(me, who); - const actual = await service.pack(who, me, { schema: 'UserDetailed' }) as any; - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(true); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(false); - } - - // meをブロックしてる人たち - const blockingMe = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of blockingMe) { - await block(who, me); - const actual = await service.pack(who, me, { schema: 'UserDetailed' }) as any; - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(true); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(false); - } - - // meがミュートしてる人たち - const muters = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of muters) { - await mute(me, who); - const actual = await service.pack(who, me, { schema: 'UserDetailed' }) as any; - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(true); - expect(actual.isRenoteMuted).toBe(false); - } - - // meがリノートミュートしてる人たち - const renoteMuters = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of renoteMuters) { - await muteRenote(me, who); - const actual = await service.pack(who, me, { schema: 'UserDetailed' }) as any; - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(true); - } - }); - - test('preload', async() => { - const me = await createUser(); - - { - // meがフォローしてる人たち - const followeeMe = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of followeeMe) { - await follow(me, who); - } - const actualList = await service.packMany(followeeMe, me, { schema: 'UserDetailed' }) as any; - for (const actual of actualList) { - expect(actual.isFollowing).toBe(true); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(false); - } - } - - { - // meをフォローしてる人たち - const followerMe = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of followerMe) { - await follow(who, me); - } - const actualList = await service.packMany(followerMe, me, { schema: 'UserDetailed' }) as any; - for (const actual of actualList) { - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(true); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(false); - } - } - - { - // meがフォローリクエストを送った人たち - const requestsFromYou = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of requestsFromYou) { - await requestFollow(me, who); - } - const actualList = await service.packMany(requestsFromYou, me, { schema: 'UserDetailed' }) as any; - for (const actual of actualList) { - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(true); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(false); - } - } - - { - // meにフォローリクエストを送った人たち - const requestsToYou = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of requestsToYou) { - await requestFollow(who, me); - } - const actualList = await service.packMany(requestsToYou, me, { schema: 'UserDetailed' }) as any; - for (const actual of actualList) { - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(true); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(false); - } - } - - { - // meがブロックしてる人たち - const blockingYou = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of blockingYou) { - await block(me, who); - } - const actualList = await service.packMany(blockingYou, me, { schema: 'UserDetailed' }) as any; - for (const actual of actualList) { - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(true); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(false); - } - } - - { - // meをブロックしてる人たち - const blockingMe = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of blockingMe) { - await block(who, me); - } - const actualList = await service.packMany(blockingMe, me, { schema: 'UserDetailed' }) as any; - for (const actual of actualList) { - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(true); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(false); - } - } - - { - // meがミュートしてる人たち - const muters = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of muters) { - await mute(me, who); - } - const actualList = await service.packMany(muters, me, { schema: 'UserDetailed' }) as any; - for (const actual of actualList) { - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(true); - expect(actual.isRenoteMuted).toBe(false); - } - } - - { - // meがリノートミュートしてる人たち - const renoteMuters = await Promise.all(randomIntRange().map(() => createUser())); - for (const who of renoteMuters) { - await muteRenote(me, who); - } - const actualList = await service.packMany(renoteMuters, me, { schema: 'UserDetailed' }) as any; - for (const actual of actualList) { - expect(actual.isFollowing).toBe(false); - expect(actual.isFollowed).toBe(false); - expect(actual.hasPendingFollowRequestFromYou).toBe(false); - expect(actual.hasPendingFollowRequestToYou).toBe(false); - expect(actual.isBlocking).toBe(false); - expect(actual.isBlocked).toBe(false); - expect(actual.isMuted).toBe(false); - expect(actual.isRenoteMuted).toBe(true); - } - } - }); - }); - }); -}); diff --git a/packages/backend/test/unit/extract-mentions.ts b/packages/backend/test/unit/extract-mentions.ts index 3403387e30..5901f33fdc 100644 --- a/packages/backend/test/unit/extract-mentions.ts +++ b/packages/backend/test/unit/extract-mentions.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/test/unit/misc/check-word-mute.ts b/packages/backend/test/unit/misc/check-word-mute.ts index eb0ca0f6cf..12bfca8bd7 100644 --- a/packages/backend/test/unit/misc/check-word-mute.ts +++ b/packages/backend/test/unit/misc/check-word-mute.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/test/unit/misc/correct-filename.ts b/packages/backend/test/unit/misc/correct-filename.ts index c76fb4c494..0c4482e0bf 100644 --- a/packages/backend/test/unit/misc/correct-filename.ts +++ b/packages/backend/test/unit/misc/correct-filename.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/test/unit/misc/id.ts b/packages/backend/test/unit/misc/id.ts index d14efb10a6..59783a9fa1 100644 --- a/packages/backend/test/unit/misc/id.ts +++ b/packages/backend/test/unit/misc/id.ts @@ -1,16 +1,16 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import { ulid } from 'ulid'; -import { describe, expect, test } from '@jest/globals'; +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'; -import { parseUlid, ulidRegExp } from '@/misc/id/ulid.js'; +import { ulidRegExp, parseUlid } from '@/misc/id/ulid.js'; describe('misc:id', () => { test('aid', () => { diff --git a/packages/backend/test/unit/misc/is-renote.ts b/packages/backend/test/unit/misc/is-renote.ts deleted file mode 100644 index 0b713e8bf6..0000000000 --- a/packages/backend/test/unit/misc/is-renote.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { isQuote, isRenote } from '@/misc/is-renote.js'; -import { MiNote } from '@/models/Note.js'; - -const base: MiNote = { - id: 'some-note-id', - replyId: null, - reply: null, - renoteId: null, - renote: null, - threadId: null, - text: null, - name: null, - cw: null, - userId: 'some-user-id', - user: null, - localOnly: false, - reactionAcceptance: null, - renoteCount: 0, - repliesCount: 0, - clippedCount: 0, - reactions: {}, - visibility: 'public', - uri: null, - url: null, - fileIds: [], - attachedFileTypes: [], - visibleUserIds: [], - mentions: [], - mentionedRemoteUsers: '', - reactionAndUserPairCache: [], - emojis: [], - tags: [], - hasPoll: false, - channelId: null, - channel: null, - userHost: null, - replyUserId: null, - replyUserHost: null, - renoteUserId: null, - renoteUserHost: null, -}; - -describe('misc:is-renote', () => { - test('note without renoteId should not be Renote', () => { - expect(isRenote(base)).toBe(false); - }); - - test('note with renoteId should be Renote and not be Quote', () => { - const note: MiNote = { ...base, renoteId: 'some-renote-id' }; - expect(isRenote(note)).toBe(true); - expect(isQuote(note as any)).toBe(false); - }); - - test('note with renoteId and text should be Quote', () => { - const note: MiNote = { ...base, renoteId: 'some-renote-id', text: 'some-text' }; - expect(isRenote(note)).toBe(true); - expect(isQuote(note as any)).toBe(true); - }); - - test('note with renoteId and cw should be Quote', () => { - const note: MiNote = { ...base, renoteId: 'some-renote-id', cw: 'some-cw' }; - expect(isRenote(note)).toBe(true); - expect(isQuote(note as any)).toBe(true); - }); - - test('note with renoteId and replyId should be Quote', () => { - const note: MiNote = { ...base, renoteId: 'some-renote-id', replyId: 'some-reply-id' }; - expect(isRenote(note)).toBe(true); - expect(isQuote(note as any)).toBe(true); - }); - - test('note with renoteId and poll should be Quote', () => { - const note: MiNote = { ...base, renoteId: 'some-renote-id', hasPoll: true }; - expect(isRenote(note)).toBe(true); - expect(isQuote(note as any)).toBe(true); - }); - - test('note with renoteId and non-empty fileIds should be Quote', () => { - const note: MiNote = { ...base, renoteId: 'some-renote-id', fileIds: ['some-file-id'] }; - expect(isRenote(note)).toBe(true); - expect(isQuote(note as any)).toBe(true); - }); -}); diff --git a/packages/backend/test/unit/misc/loader.ts b/packages/backend/test/unit/misc/loader.ts index 2cf54e1555..fa37950951 100644 --- a/packages/backend/test/unit/misc/loader.ts +++ b/packages/backend/test/unit/misc/loader.ts @@ -1,8 +1,3 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - import { DebounceLoader } from '@/misc/loader.js'; class Mock { diff --git a/packages/backend/test/unit/misc/others.ts b/packages/backend/test/unit/misc/others.ts index 3bc134a2b8..b16d26d866 100644 --- a/packages/backend/test/unit/misc/others.ts +++ b/packages/backend/test/unit/misc/others.ts @@ -1,9 +1,9 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { describe, expect, test } from '@jest/globals'; +import { describe, test, expect } from '@jest/globals'; import { contentDisposition } from '@/misc/content-disposition.js'; describe('misc:content-disposition', () => { diff --git a/packages/backend/test/unit/queue/processors/CheckModeratorsActivityProcessorService.ts b/packages/backend/test/unit/queue/processors/CheckModeratorsActivityProcessorService.ts deleted file mode 100644 index 1506283a3c..0000000000 --- a/packages/backend/test/unit/queue/processors/CheckModeratorsActivityProcessorService.ts +++ /dev/null @@ -1,379 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { jest } from '@jest/globals'; -import { Test, TestingModule } from '@nestjs/testing'; -import * as lolex from '@sinonjs/fake-timers'; -import { addHours, addSeconds, subDays, subHours, subSeconds } from 'date-fns'; -import { CheckModeratorsActivityProcessorService } from '@/queue/processors/CheckModeratorsActivityProcessorService.js'; -import { MiSystemWebhook, MiUser, MiUserProfile, UserProfilesRepository, UsersRepository } from '@/models/_.js'; -import { IdService } from '@/core/IdService.js'; -import { RoleService } from '@/core/RoleService.js'; -import { GlobalModule } from '@/GlobalModule.js'; -import { MetaService } from '@/core/MetaService.js'; -import { DI } from '@/di-symbols.js'; -import { QueueLoggerService } from '@/queue/QueueLoggerService.js'; -import { EmailService } from '@/core/EmailService.js'; -import { SystemWebhookService } from '@/core/SystemWebhookService.js'; -import { AnnouncementService } from '@/core/AnnouncementService.js'; - -const baseDate = new Date(Date.UTC(2000, 11, 15, 12, 0, 0)); - -describe('CheckModeratorsActivityProcessorService', () => { - let app: TestingModule; - let clock: lolex.InstalledClock; - let service: CheckModeratorsActivityProcessorService; - - // -------------------------------------------------------------------------------------- - - let usersRepository: UsersRepository; - let userProfilesRepository: UserProfilesRepository; - let idService: IdService; - let roleService: jest.Mocked; - let announcementService: jest.Mocked; - let emailService: jest.Mocked; - let systemWebhookService: jest.Mocked; - - let systemWebhook1: MiSystemWebhook; - let systemWebhook2: MiSystemWebhook; - let systemWebhook3: MiSystemWebhook; - - // -------------------------------------------------------------------------------------- - - async function createUser(data: Partial = {}, profile: Partial = {}): Promise { - const id = idService.gen(); - const user = await usersRepository - .insert({ - id: id, - username: `user_${id}`, - usernameLower: `user_${id}`.toLowerCase(), - ...data, - }) - .then(x => usersRepository.findOneByOrFail(x.identifiers[0])); - - await userProfilesRepository.insert({ - userId: user.id, - ...profile, - }); - - return user; - } - - function crateSystemWebhook(data: Partial = {}): MiSystemWebhook { - return { - id: idService.gen(), - isActive: true, - updatedAt: new Date(), - latestSentAt: null, - latestStatus: null, - name: 'test', - url: 'https://example.com', - secret: 'test', - on: [], - ...data, - }; - } - - function mockModeratorRole(users: MiUser[]) { - roleService.getModerators.mockReset(); - roleService.getModerators.mockResolvedValue(users); - } - - // -------------------------------------------------------------------------------------- - - beforeAll(async () => { - app = await Test - .createTestingModule({ - imports: [ - GlobalModule, - ], - providers: [ - CheckModeratorsActivityProcessorService, - IdService, - { - provide: RoleService, useFactory: () => ({ getModerators: jest.fn() }), - }, - { - provide: MetaService, useFactory: () => ({ fetch: jest.fn() }), - }, - { - provide: AnnouncementService, useFactory: () => ({ create: jest.fn() }), - }, - { - provide: EmailService, useFactory: () => ({ sendEmail: jest.fn() }), - }, - { - provide: SystemWebhookService, useFactory: () => ({ - fetchActiveSystemWebhooks: jest.fn(), - enqueueSystemWebhook: jest.fn(), - }), - }, - { - provide: QueueLoggerService, useFactory: () => ({ - logger: ({ - createSubLogger: () => ({ - info: jest.fn(), - warn: jest.fn(), - succ: jest.fn(), - }), - }), - }), - }, - ], - }) - .compile(); - - usersRepository = app.get(DI.usersRepository); - userProfilesRepository = app.get(DI.userProfilesRepository); - - service = app.get(CheckModeratorsActivityProcessorService); - idService = app.get(IdService); - roleService = app.get(RoleService) as jest.Mocked; - announcementService = app.get(AnnouncementService) as jest.Mocked; - emailService = app.get(EmailService) as jest.Mocked; - systemWebhookService = app.get(SystemWebhookService) as jest.Mocked; - - app.enableShutdownHooks(); - }); - - beforeEach(async () => { - clock = lolex.install({ - now: new Date(baseDate), - shouldClearNativeTimers: true, - }); - - systemWebhook1 = crateSystemWebhook({ on: ['inactiveModeratorsWarning'] }); - systemWebhook2 = crateSystemWebhook({ on: ['inactiveModeratorsWarning', 'inactiveModeratorsInvitationOnlyChanged'] }); - systemWebhook3 = crateSystemWebhook({ on: ['abuseReport'] }); - - emailService.sendEmail.mockReturnValue(Promise.resolve()); - announcementService.create.mockReturnValue(Promise.resolve({} as never)); - systemWebhookService.fetchActiveSystemWebhooks.mockResolvedValue([systemWebhook1, systemWebhook2, systemWebhook3]); - systemWebhookService.enqueueSystemWebhook.mockReturnValue(Promise.resolve({} as never)); - }); - - afterEach(async () => { - clock.uninstall(); - await usersRepository.delete({}); - await userProfilesRepository.delete({}); - roleService.getModerators.mockReset(); - announcementService.create.mockReset(); - emailService.sendEmail.mockReset(); - systemWebhookService.enqueueSystemWebhook.mockReset(); - }); - - afterAll(async () => { - await app.close(); - }); - - // -------------------------------------------------------------------------------------- - - describe('evaluateModeratorsInactiveDays', () => { - test('[isModeratorsInactive] inactiveなモデレーターがいても他のモデレーターがアクティブなら"運営が非アクティブ"としてみなされない', async () => { - const [user1, user2, user3, user4] = await Promise.all([ - // 期限よりも1秒新しいタイミングでアクティブ化(セーフ) - createUser({ lastActiveDate: subDays(addSeconds(baseDate, 1), 7) }), - // 期限ちょうどにアクティブ化(セーフ) - createUser({ lastActiveDate: subDays(baseDate, 7) }), - // 期限よりも1秒古いタイミングでアクティブ化(アウト) - createUser({ lastActiveDate: subDays(subSeconds(baseDate, 1), 7) }), - // 対象外 - createUser({ lastActiveDate: null }), - ]); - - mockModeratorRole([user1, user2, user3, user4]); - - const result = await service.evaluateModeratorsInactiveDays(); - expect(result.isModeratorsInactive).toBe(false); - expect(result.inactiveModerators).toEqual([user3]); - }); - - test('[isModeratorsInactive] 全員非アクティブなら"運営が非アクティブ"としてみなされる', async () => { - const [user1, user2] = await Promise.all([ - // 期限よりも1秒古いタイミングでアクティブ化(アウト) - createUser({ lastActiveDate: subDays(subSeconds(baseDate, 1), 7) }), - // 対象外 - createUser({ lastActiveDate: null }), - ]); - - mockModeratorRole([user1, user2]); - - const result = await service.evaluateModeratorsInactiveDays(); - expect(result.isModeratorsInactive).toBe(true); - expect(result.inactiveModerators).toEqual([user1]); - }); - - test('[remainingTime] 猶予まで24時間ある場合、猶予1日として計算される', async () => { - const [user1, user2] = await Promise.all([ - createUser({ lastActiveDate: subDays(baseDate, 8) }), - // 猶予はこのユーザ基準で計算される想定。 - // 期限まで残り24時間->猶予1日として計算されるはずである - createUser({ lastActiveDate: subDays(baseDate, 6) }), - ]); - - mockModeratorRole([user1, user2]); - - const result = await service.evaluateModeratorsInactiveDays(); - expect(result.isModeratorsInactive).toBe(false); - expect(result.inactiveModerators).toEqual([user1]); - expect(result.remainingTime.asDays).toBe(1); - expect(result.remainingTime.asHours).toBe(24); - }); - - test('[remainingTime] 猶予まで25時間ある場合、猶予1日として計算される', async () => { - const [user1, user2] = await Promise.all([ - createUser({ lastActiveDate: subDays(baseDate, 8) }), - // 猶予はこのユーザ基準で計算される想定。 - // 期限まで残り25時間->猶予1日として計算されるはずである - createUser({ lastActiveDate: subDays(addHours(baseDate, 1), 6) }), - ]); - - mockModeratorRole([user1, user2]); - - const result = await service.evaluateModeratorsInactiveDays(); - expect(result.isModeratorsInactive).toBe(false); - expect(result.inactiveModerators).toEqual([user1]); - expect(result.remainingTime.asDays).toBe(1); - expect(result.remainingTime.asHours).toBe(25); - }); - - test('[remainingTime] 猶予まで23時間ある場合、猶予0日として計算される', async () => { - const [user1, user2] = await Promise.all([ - createUser({ lastActiveDate: subDays(baseDate, 8) }), - // 猶予はこのユーザ基準で計算される想定。 - // 期限まで残り23時間->猶予0日として計算されるはずである - createUser({ lastActiveDate: subDays(subHours(baseDate, 1), 6) }), - ]); - - mockModeratorRole([user1, user2]); - - const result = await service.evaluateModeratorsInactiveDays(); - expect(result.isModeratorsInactive).toBe(false); - expect(result.inactiveModerators).toEqual([user1]); - expect(result.remainingTime.asDays).toBe(0); - expect(result.remainingTime.asHours).toBe(23); - }); - - test('[remainingTime] 期限ちょうどの場合、猶予0日として計算される', async () => { - const [user1, user2] = await Promise.all([ - createUser({ lastActiveDate: subDays(baseDate, 8) }), - // 猶予はこのユーザ基準で計算される想定。 - // 期限ちょうど->猶予0日として計算されるはずである - createUser({ lastActiveDate: subDays(baseDate, 7) }), - ]); - - mockModeratorRole([user1, user2]); - - const result = await service.evaluateModeratorsInactiveDays(); - expect(result.isModeratorsInactive).toBe(false); - expect(result.inactiveModerators).toEqual([user1]); - expect(result.remainingTime.asDays).toBe(0); - expect(result.remainingTime.asHours).toBe(0); - }); - - test('[remainingTime] 期限より1時間超過している場合、猶予-1日として計算される', async () => { - const [user1, user2] = await Promise.all([ - createUser({ lastActiveDate: subDays(baseDate, 8) }), - // 猶予はこのユーザ基準で計算される想定。 - // 期限より1時間超過->猶予-1日として計算されるはずである - createUser({ lastActiveDate: subDays(subHours(baseDate, 1), 7) }), - ]); - - mockModeratorRole([user1, user2]); - - const result = await service.evaluateModeratorsInactiveDays(); - expect(result.isModeratorsInactive).toBe(true); - expect(result.inactiveModerators).toEqual([user1, user2]); - expect(result.remainingTime.asDays).toBe(-1); - expect(result.remainingTime.asHours).toBe(-1); - }); - - test('[remainingTime] 期限より25時間超過している場合、猶予-2日として計算される', async () => { - const [user1, user2] = await Promise.all([ - createUser({ lastActiveDate: subDays(baseDate, 10) }), - // 猶予はこのユーザ基準で計算される想定。 - // 期限より1時間超過->猶予-1日として計算されるはずである - createUser({ lastActiveDate: subDays(subHours(baseDate, 25), 7) }), - ]); - - mockModeratorRole([user1, user2]); - - const result = await service.evaluateModeratorsInactiveDays(); - expect(result.isModeratorsInactive).toBe(true); - expect(result.inactiveModerators).toEqual([user1, user2]); - expect(result.remainingTime.asDays).toBe(-2); - expect(result.remainingTime.asHours).toBe(-25); - }); - }); - - describe('notifyInactiveModeratorsWarning', () => { - test('[notification + mail] 通知はモデレータ全員に発信され、メールはメールアドレスが存在+認証済みの場合のみ', async () => { - const [user1, user2, user3, user4, root] = await Promise.all([ - createUser({}, { email: 'user1@example.com', emailVerified: true }), - createUser({}, { email: 'user2@example.com', emailVerified: false }), - createUser({}, { email: null, emailVerified: false }), - createUser({}, { email: 'user4@example.com', emailVerified: true }), - createUser({ isRoot: true }, { email: 'root@example.com', emailVerified: true }), - ]); - - mockModeratorRole([user1, user2, user3, root]); - await service.notifyInactiveModeratorsWarning({ time: 1, asDays: 0, asHours: 0 }); - - expect(emailService.sendEmail).toHaveBeenCalledTimes(2); - expect(emailService.sendEmail.mock.calls[0][0]).toBe('user1@example.com'); - expect(emailService.sendEmail.mock.calls[1][0]).toBe('root@example.com'); - }); - - test('[systemWebhook] "inactiveModeratorsWarning"が有効なSystemWebhookに対して送信される', async () => { - const [user1] = await Promise.all([ - createUser({}, { email: 'user1@example.com', emailVerified: true }), - ]); - - mockModeratorRole([user1]); - await service.notifyInactiveModeratorsWarning({ time: 1, asDays: 0, asHours: 0 }); - - expect(systemWebhookService.enqueueSystemWebhook).toHaveBeenCalledTimes(2); - expect(systemWebhookService.enqueueSystemWebhook.mock.calls[0][0]).toEqual(systemWebhook1); - expect(systemWebhookService.enqueueSystemWebhook.mock.calls[1][0]).toEqual(systemWebhook2); - }); - }); - - describe('notifyChangeToInvitationOnly', () => { - test('[notification + mail] 通知はモデレータ全員に発信され、メールはメールアドレスが存在+認証済みの場合のみ', async () => { - const [user1, user2, user3, user4, root] = await Promise.all([ - createUser({}, { email: 'user1@example.com', emailVerified: true }), - createUser({}, { email: 'user2@example.com', emailVerified: false }), - createUser({}, { email: null, emailVerified: false }), - createUser({}, { email: 'user4@example.com', emailVerified: true }), - createUser({ isRoot: true }, { email: 'root@example.com', emailVerified: true }), - ]); - - mockModeratorRole([user1, user2, user3, root]); - await service.notifyChangeToInvitationOnly(); - - expect(announcementService.create).toHaveBeenCalledTimes(4); - expect(announcementService.create.mock.calls[0][0].userId).toBe(user1.id); - expect(announcementService.create.mock.calls[1][0].userId).toBe(user2.id); - expect(announcementService.create.mock.calls[2][0].userId).toBe(user3.id); - expect(announcementService.create.mock.calls[3][0].userId).toBe(root.id); - - expect(emailService.sendEmail).toHaveBeenCalledTimes(2); - expect(emailService.sendEmail.mock.calls[0][0]).toBe('user1@example.com'); - expect(emailService.sendEmail.mock.calls[1][0]).toBe('root@example.com'); - }); - - test('[systemWebhook] "inactiveModeratorsInvitationOnlyChanged"が有効なSystemWebhookに対して送信される', async () => { - const [user1] = await Promise.all([ - createUser({}, { email: 'user1@example.com', emailVerified: true }), - ]); - - mockModeratorRole([user1]); - await service.notifyChangeToInvitationOnly(); - - expect(systemWebhookService.enqueueSystemWebhook).toHaveBeenCalledTimes(1); - expect(systemWebhookService.enqueueSystemWebhook.mock.calls[0][0]).toEqual(systemWebhook2); - }); - }); -}); diff --git a/packages/backend/test/utils.ts b/packages/backend/test/utils.ts index 26de19eaf1..46b8ea9cdd 100644 --- a/packages/backend/test/utils.ts +++ b/packages/backend/test/utils.ts @@ -1,90 +1,74 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ import * as assert from 'node:assert'; import { readFile } from 'node:fs/promises'; -import { basename, isAbsolute } from 'node:path'; +import { isAbsolute, basename } from 'node:path'; import { randomUUID } from 'node:crypto'; import { inspect } from 'node:util'; import WebSocket, { ClientOptions } from 'ws'; -import fetch, { File, RequestInit, type Headers } from 'node-fetch'; +import fetch, { File, RequestInit } from 'node-fetch'; import { DataSource } from 'typeorm'; import { JSDOM } from 'jsdom'; -import { type Response } from 'node-fetch'; -import Fastify from 'fastify'; +import { DEFAULT_POLICIES } from '@/core/RoleService.js'; import { entities } from '../src/postgres.js'; import { loadConfig } from '../src/config.js'; import type * as misskey from 'misskey-js'; -import { DEFAULT_POLICIES } from '@/core/RoleService.js'; -import { validateContentTypeSetAsActivityPub } from '@/core/activitypub/misc/validator.js'; -import { ApiError } from '@/server/api/error.js'; -export { server as startServer, jobQueue as startJobQueue } from '@/boot/common.js'; +export { server as startServer } from '@/boot/common.js'; -export interface UserToken { +interface UserToken { token: string; bearer?: boolean; } -export type SystemWebhookPayload = { - server: string; - hookId: string; - eventId: string; - createdAt: string; - type: string; - body: any; -} - const config = loadConfig(); export const port = config.port; export const origin = config.url; export const host = new URL(config.url).host; -export const WEBHOOK_HOST = 'http://localhost:15080'; -export const WEBHOOK_PORT = 15080; - export const cookie = (me: UserToken): string => { return `token=${me.token};`; }; -export type ApiRequest = { - endpoint: E, - parameters: P, +export const api = async (endpoint: string, params: any, me?: UserToken) => { + const normalized = endpoint.replace(/^\//, ''); + return await request(`api/${normalized}`, params, me); +}; + +export type ApiRequest = { + endpoint: string, + parameters: object, user: UserToken | undefined, }; -export const successfulApiCall = async (request: ApiRequest, assertion: { +export const successfulApiCall = async (request: ApiRequest, assertion: { status?: number, -} = {}): Promise> => { +} = {}): Promise => { const { endpoint, parameters, user } = request; const res = await api(endpoint, parameters, user); const status = assertion.status ?? (res.body == null ? 204 : 200); assert.strictEqual(res.status, status, inspect(res.body, { depth: 5, colors: true })); - - return res.body as misskey.api.SwitchCaseResponseType; + return res.body; }; -export const failedApiCall = async (request: ApiRequest, assertion: { +export const failedApiCall = async (request: ApiRequest, assertion: { status: number, code: string, id: string -}): Promise => { +}): Promise => { const { endpoint, parameters, user } = request; const { status, code, id } = assertion; const res = await api(endpoint, parameters, user); assert.strictEqual(res.status, status, inspect(res.body)); - assert.ok(res.body); - assert.strictEqual(castAsError(res.body as any).error.code, code, inspect(res.body)); - assert.strictEqual(castAsError(res.body as any).error.id, id, inspect(res.body)); + assert.strictEqual(res.body.error.code, code, inspect(res.body)); + assert.strictEqual(res.body.error.id, id, inspect(res.body)); + return res.body; }; -export const api = async (path: E, params: P, me?: UserToken): Promise<{ - status: number, - headers: Headers, - body: misskey.api.SwitchCaseResponseType -}> => { +const request = async (path: string, params: any, me?: UserToken): Promise<{ status: number, headers: Headers, body: any }> => { const bodyAuth: Record = {}; const headers: Record = { 'Content-Type': 'application/json', @@ -96,7 +80,7 @@ export const api = async + ? await res.json() : null; return { status: res.status, headers: res.headers, - // FIXME: removing this non-null assertion: requires better typing around empty response. - body: body!, + body, }; }; @@ -127,20 +110,6 @@ export function randomString(chars = 'abcdefghijklmnopqrstuvwxyz0123456789', len return randomString; } -/** - * @brief プロミスにタイムアウト追加 - * @param p 待ち対象プロミス - * @param timeout 待機ミリ秒 - */ -function timeoutPromise(p: Promise, timeout: number): Promise { - return Promise.race([ - p, - new Promise((reject) => { - setTimeout(() => { reject(new Error('timed out')); }, timeout); - }) as never, - ]); -} - export const signup = async (params?: Partial): Promise> => { const q = Object.assign({ username: randomString(), @@ -152,13 +121,12 @@ export const signup = async (params?: Partial => { +export const post = async (user: UserToken, params?: misskey.Endpoints['notes/create']['req']): Promise => { const q = params; const res = await api('notes/create', q, user); - // FIXME: the return type should reflect this fact. - return (res.body ? res.body.createdNote : null)!; + return res.body ? res.body.createdNote : null; }; export const createAppToken = async (user: UserToken, permissions: (typeof misskey.permissions)[number][]) => { @@ -171,8 +139,8 @@ export const createAppToken = async (user: UserToken, permissions: (typeof missk }; // 非公開ノートをAPI越しに見たときのノート NoteEntityService.ts -export const hiddenNote = (note: misskey.entities.Note): misskey.entities.Note => { - const temp: misskey.entities.Note = { +export const hiddenNote = (note: any): any => { + const temp = { ...note, fileIds: [], files: [], @@ -185,22 +153,21 @@ export const hiddenNote = (note: misskey.entities.Note): misskey.entities.Note = return temp; }; -export const react = async (user: UserToken, note: misskey.entities.Note, reaction: string): Promise => { +export const react = async (user: UserToken, note: any, reaction: string): Promise => { await api('notes/reactions/create', { noteId: note.id, reaction: reaction, }, user); }; -export const userList = async (user: UserToken, userList: Partial = {}): Promise => { +export const userList = async (user: UserToken, userList: any = {}): Promise => { const res = await api('users/lists/create', { name: 'test', - ...userList, }, user); return res.body; }; -export const page = async (user: UserToken, page: Partial = {}): Promise => { +export const page = async (user: UserToken, page: any = {}): Promise => { const res = await api('pages/create', { alignCenter: false, content: [ @@ -211,7 +178,7 @@ export const page = async (user: UserToken, page: Partial }, ], eyeCatchingImageId: null, - font: 'sans-serif' as any, + font: 'sans-serif', hideTitleWhenPinned: false, name: '1678594845072', script: '', @@ -223,7 +190,7 @@ export const page = async (user: UserToken, page: Partial return res.body; }; -export const play = async (user: UserToken, play: Partial = {}): Promise => { +export const play = async (user: UserToken, play: any = {}): Promise => { const res = await api('flash/create', { permissions: [], script: 'test', @@ -234,7 +201,7 @@ export const play = async (user: UserToken, play: Partial = {}): Promise => { +export const clip = async (user: UserToken, clip: any = {}): Promise => { const res = await api('clips/create', { description: null, isPublic: true, @@ -244,18 +211,18 @@ export const clip = async (user: UserToken, clip: Partial return res.body; }; -export const galleryPost = async (user: UserToken, galleryPost: Partial = {}): Promise => { +export const galleryPost = async (user: UserToken, channel: any = {}): Promise => { const res = await api('gallery/posts/create', { description: null, fileIds: [], isSensitive: false, title: 'test', - ...galleryPost, + ...channel, }, user); return res.body; }; -export const channel = async (user: UserToken, channel: Partial = {}): Promise => { +export const channel = async (user: UserToken, channel: any = {}): Promise => { const res = await api('channels/create', { bannerId: null, description: null, @@ -265,7 +232,7 @@ export const channel = async (user: UserToken, channel: Partial = {}, policies: any = {}): Promise => { +export const role = async (user: UserToken, role: any = {}, policies: any = {}): Promise => { const res = await api('admin/roles/create', { asBadge: false, canEditMembersByModerator: false, @@ -273,7 +240,7 @@ export const role = async (user: UserToken, role: Partial condFormula: { id: 'ebef1684-672d-49b6-ad82-1b3ec3784f85', type: 'isRemote', - } as any, + }, description: '', displayOrder: 0, iconUrl: null, @@ -308,13 +275,9 @@ interface UploadOptions { * Upload file * @param user User */ -export const uploadFile = async (user?: UserToken, { path, name, blob }: UploadOptions = {}): Promise<{ - status: number, - headers: Headers, - body: misskey.entities.DriveFile | null -}> => { +export const uploadFile = async (user?: UserToken, { path, name, blob }: UploadOptions = {}): Promise<{ status: number, headers: Headers, body: misskey.Endpoints['drive/files/create']['res'] | null }> => { const absPath = path == null - ? new URL('resources/192.jpg', import.meta.url) + ? new URL('resources/Lenna.jpg', import.meta.url) : isAbsolute(path.toString()) ? new URL(path) : new URL(path, new URL('resources/', import.meta.url)); @@ -341,6 +304,7 @@ export const uploadFile = async (user?: UserToken, { path, name, blob }: UploadO }); const body = res.status !== 204 ? await res.json() as misskey.Endpoints['drive/files/create']['res'] : null; + return { status: res.status, headers: res.headers, @@ -348,16 +312,17 @@ export const uploadFile = async (user?: UserToken, { path, name, blob }: UploadO }; }; -export const uploadUrl = async (user: UserToken, url: string): Promise => { +export const uploadUrl = async (user: UserToken, url: string) => { + let resolve: unknown; + const file = new Promise(ok => resolve = ok); const marker = Math.random().toString(); - const catcher = makeStreamCatcher( - user, - 'main', - (msg) => msg.type === 'urlUploadFinished' && msg.body.marker === marker, - (msg) => msg.body.file, - 60 * 1000, - ); + const ws = await connectStream(user, 'main', (msg) => { + if (msg.type === 'urlUploadFinished' && msg.body.marker === marker) { + ws.close(); + resolve(msg.body.file); + } + }); await api('drive/files/upload-from-url', { url, @@ -365,10 +330,10 @@ export const uploadUrl = async (user: UserToken, url: string): Promise(user: UserToken, channel: C, listener: (message: Record) => any, params?: misskey.Channels[C]['params']): Promise { +export function connectStream(user: UserToken, channel: string, listener: (message: Record) => any, params?: any): Promise { return new Promise((res, rej) => { const url = new URL(`ws://127.0.0.1:${port}/streaming`); const options: ClientOptions = {}; @@ -403,7 +368,7 @@ export function connectStream(user: UserToken, }); } -export const waitFire = async (user: UserToken, channel: C, trgr: () => any, cond: (msg: Record) => boolean, params?: misskey.Channels[C]['params']) => { +export const waitFire = async (user: UserToken, channel: string, trgr: () => any, cond: (msg: Record) => boolean, params?: any) => { return new Promise(async (res, rej) => { let timer: NodeJS.Timeout | null = null; @@ -437,42 +402,13 @@ export const waitFire = async (user: UserToken }); }; -/** - * @brief WebSocketストリームから特定条件の通知を拾うプロミスを生成 - * @param user ユーザー認証情報 - * @param channel チャンネル - * @param cond 条件 - * @param extractor 取り出し処理 - * @param timeout ミリ秒タイムアウト - * @returns 時間内に正常に処理できた場合に通知からextractorを通した値を得る - */ -export function makeStreamCatcher( - user: UserToken, - channel: keyof misskey.Channels, - cond: (message: Record) => boolean, - extractor: (message: Record) => T, - timeout = 60 * 1000): Promise { - let ws: WebSocket; - const p = new Promise(async (resolve) => { - ws = await connectStream(user, channel, (msg) => { - if (cond(msg)) { - resolve(extractor(msg)); - } - }); - }).finally(() => { - ws.close(); - }); - - return timeoutPromise(p, timeout); -} - export type SimpleGetResponse = { status: number, body: any | JSDOM | null, type: string | null, location: string | null }; -export const simpleGet = async (path: string, accept = '*/*', cookie: any = undefined, bodyExtractor: (res: Response) => Promise = _ => Promise.resolve(null)): Promise => { +export const simpleGet = async (path: string, accept = '*/*', cookie: any = undefined): Promise => { const res = await relativeFetch(path, { headers: { Accept: accept, @@ -489,18 +425,10 @@ export const simpleGet = async (path: string, accept = '*/*', cookie: any = unde 'text/html; charset=utf-8', ]; - if (res.ok && ( - accept.startsWith('application/activity+json') || - (accept.startsWith('application/ld+json') && accept.includes('https://www.w3.org/ns/activitystreams')) - )) { - // validateContentTypeSetAsActivityPubのテストを兼ねる - validateContentTypeSetAsActivityPub(res); - } - const body = - jsonTypes.includes(res.headers.get('content-type') ?? '') ? await res.json() : - htmlTypes.includes(res.headers.get('content-type') ?? '') ? new JSDOM(await res.text()) : - await bodyExtractor(res); + jsonTypes.includes(res.headers.get('content-type') ?? '') ? await res.json() : + htmlTypes.includes(res.headers.get('content-type') ?? '') ? new JSDOM(await res.text()) : + null; return { status: res.status, @@ -622,73 +550,10 @@ export async function initTestDb(justBorrow = false, initEntities?: any[]) { return db; } -export async function sendEnvUpdateRequest(params: { key: string, value?: string }) { - const res = await fetch( - `http://localhost:${port + 1000}/env`, - { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(params), - }, - ); - - if (res.status !== 200) { - throw new Error('server env update failed.'); - } -} - -export async function sendEnvResetRequest() { - const res = await fetch( - `http://localhost:${port + 1000}/env-reset`, - { - method: 'POST', - body: JSON.stringify({}), - }, - ); - - if (res.status !== 200) { - throw new Error('server env update failed.'); - } -} - -// 与えられた値を強制的にエラーとみなす。この関数は型安全性を破壊するため、異常系のアサーション以外で用いられるべきではない。 -// FIXME(misskey-js): misskey-jsがエラー情報を公開するようになったらこの関数を廃止する -export function castAsError(obj: Record): { error: ApiError } { - return obj as { error: ApiError }; -} - -export async function captureWebhook(postAction: () => Promise, port = WEBHOOK_PORT): Promise { - const fastify = Fastify(); - - let timeoutHandle: NodeJS.Timeout | null = null; - const result = await new Promise(async (resolve, reject) => { - fastify.all('/', async (req, res) => { - timeoutHandle && clearTimeout(timeoutHandle); - - const body = JSON.stringify(req.body); - res.status(200).send('ok'); - await fastify.close(); - resolve(body); - }); - - await fastify.listen({ port }); - - timeoutHandle = setTimeout(async () => { - await fastify.close(); - reject(new Error('timeout')); - }, 3000); - - try { - await postAction(); - } catch (e) { - await fastify.close(); - reject(e); - } +export function sleep(msec: number) { + return new Promise(res => { + setTimeout(() => { + res(); + }, msec); }); - - await fastify.close(); - - return JSON.parse(result) as T; } diff --git a/packages/backend/scripts/watch.mjs b/packages/backend/watch.mjs similarity index 89% rename from packages/backend/scripts/watch.mjs rename to packages/backend/watch.mjs index a0ccea3b16..81c23a0f50 100644 --- a/packages/backend/scripts/watch.mjs +++ b/packages/backend/watch.mjs @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/frontend-embed/.gitignore b/packages/frontend-embed/.gitignore deleted file mode 100644 index 1aa0ac14e8..0000000000 --- a/packages/frontend-embed/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/storybook-static diff --git a/packages/frontend-embed/@types/global.d.ts b/packages/frontend-embed/@types/global.d.ts deleted file mode 100644 index 1025d1bedb..0000000000 --- a/packages/frontend-embed/@types/global.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -type FIXME = any; - -declare const _LANGS_: string[][]; -declare const _VERSION_: string; -declare const _ENV_: string; -declare const _DEV_: boolean; -declare const _PERF_PREFIX_: string; -declare const _DATA_TRANSFER_DRIVE_FILE_: string; -declare const _DATA_TRANSFER_DRIVE_FOLDER_: string; -declare const _DATA_TRANSFER_DECK_COLUMN_: string; - -// for dev-mode -declare const _LANGS_FULL_: string[][]; - -// TagCanvas -interface Window { - TagCanvas: any; -} diff --git a/packages/frontend-embed/@types/theme.d.ts b/packages/frontend-embed/@types/theme.d.ts deleted file mode 100644 index 6ac1037493..0000000000 --- a/packages/frontend-embed/@types/theme.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -declare module '@@/themes/*.json5' { - import { Theme } from '@/theme.js'; - - const theme: Theme; - - export default theme; -} diff --git a/packages/frontend-embed/assets/dummy.png b/packages/frontend-embed/assets/dummy.png deleted file mode 100644 index 39332b0c1b..0000000000 Binary files a/packages/frontend-embed/assets/dummy.png and /dev/null differ diff --git a/packages/frontend-embed/eslint.config.js b/packages/frontend-embed/eslint.config.js deleted file mode 100644 index dd8f03dac5..0000000000 --- a/packages/frontend-embed/eslint.config.js +++ /dev/null @@ -1,95 +0,0 @@ -import globals from 'globals'; -import tsParser from '@typescript-eslint/parser'; -import parser from 'vue-eslint-parser'; -import pluginVue from 'eslint-plugin-vue'; -import pluginMisskey from '@misskey-dev/eslint-plugin'; -import sharedConfig from '../shared/eslint.config.js'; - -export default [ - ...sharedConfig, - { - files: ['src/**/*.vue'], - ...pluginMisskey.configs.typescript, - }, - ...pluginVue.configs['flat/recommended'], - { - files: ['src/**/*.{ts,vue}'], - languageOptions: { - globals: { - ...Object.fromEntries(Object.entries(globals.node).map(([key]) => [key, 'off'])), - ...globals.browser, - - // Node.js - module: false, - require: false, - __dirname: false, - - // Misskey - _DEV_: false, - _LANGS_: false, - _VERSION_: false, - _ENV_: false, - _PERF_PREFIX_: false, - _DATA_TRANSFER_DRIVE_FILE_: false, - _DATA_TRANSFER_DRIVE_FOLDER_: false, - _DATA_TRANSFER_DECK_COLUMN_: false, - }, - parser, - parserOptions: { - extraFileExtensions: ['.vue'], - parser: tsParser, - project: ['./tsconfig.json'], - sourceType: 'module', - tsconfigRootDir: import.meta.dirname, - }, - }, - rules: { - '@typescript-eslint/no-empty-interface': ['error', { - allowSingleExtends: true, - }], - // window の禁止理由: グローバルスコープと衝突し、予期せぬ結果を招くため - // e の禁止理由: error や event など、複数のキーワードの頭文字であり分かりにくいため - 'id-denylist': ['error', 'window', 'e'], - 'no-shadow': ['warn'], - 'vue/attributes-order': ['error', { - alphabetical: false, - }], - 'vue/no-use-v-if-with-v-for': ['error', { - allowUsingIterationVar: false, - }], - 'vue/no-ref-as-operand': 'error', - 'vue/no-multi-spaces': ['error', { - ignoreProperties: false, - }], - 'vue/no-v-html': 'warn', - 'vue/order-in-components': 'error', - 'vue/html-indent': ['warn', 'tab', { - attribute: 1, - baseIndent: 0, - closeBracket: 0, - alignAttributesVertically: true, - ignores: [], - }], - 'vue/html-closing-bracket-spacing': ['warn', { - startTag: 'never', - endTag: 'never', - selfClosingTag: 'never', - }], - 'vue/multi-word-component-names': 'warn', - 'vue/require-v-for-key': 'warn', - 'vue/no-unused-components': 'warn', - 'vue/no-unused-vars': 'warn', - 'vue/no-dupe-keys': 'warn', - 'vue/valid-v-for': 'warn', - 'vue/return-in-computed-property': 'warn', - 'vue/no-setup-props-reactivity-loss': 'warn', - 'vue/max-attributes-per-line': 'off', - 'vue/html-self-closing': 'off', - 'vue/singleline-html-element-content-newline': 'off', - 'vue/v-on-event-hyphenation': ['error', 'never', { - autofix: true, - }], - 'vue/attribute-hyphenation': ['error', 'never'], - }, - }, -]; diff --git a/packages/frontend-embed/package.json b/packages/frontend-embed/package.json deleted file mode 100644 index cb62191c3b..0000000000 --- a/packages/frontend-embed/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "frontend-embed", - "private": true, - "type": "module", - "scripts": { - "watch": "vite", - "dev": "vite --config vite.config.local-dev.ts --debug hmr", - "build": "vite build", - "typecheck": "vue-tsc --noEmit", - "eslint": "eslint --quiet \"src/**/*.{ts,vue}\"", - "lint": "pnpm typecheck && pnpm eslint" - }, - "dependencies": { - "@discordapp/twemoji": "15.1.0", - "@rollup/plugin-json": "6.1.0", - "@rollup/plugin-replace": "5.0.7", - "@rollup/pluginutils": "5.1.2", - "@tabler/icons-webfont": "3.3.0", - "@twemoji/parser": "15.1.1", - "@vitejs/plugin-vue": "5.1.4", - "@vue/compiler-sfc": "3.5.11", - "astring": "1.9.0", - "buraha": "0.0.1", - "estree-walker": "3.0.3", - "mfm-js": "0.24.0", - "misskey-js": "workspace:*", - "frontend-shared": "workspace:*", - "punycode": "2.3.1", - "rollup": "4.22.5", - "sass": "1.79.4", - "shiki": "1.21.0", - "tinycolor2": "1.6.0", - "tsc-alias": "1.8.10", - "tsconfig-paths": "4.2.0", - "typescript": "5.6.2", - "uuid": "10.0.0", - "json5": "2.2.3", - "vite": "5.4.8", - "vue": "3.5.11" - }, - "devDependencies": { - "@misskey-dev/summaly": "5.1.0", - "@testing-library/vue": "8.1.0", - "@types/estree": "1.0.6", - "@types/micromatch": "4.0.9", - "@types/node": "20.14.12", - "@types/punycode": "2.1.4", - "@types/tinycolor2": "1.4.6", - "@types/uuid": "10.0.0", - "@types/ws": "8.5.12", - "@typescript-eslint/eslint-plugin": "7.17.0", - "@typescript-eslint/parser": "7.17.0", - "@vitest/coverage-v8": "1.6.0", - "@vue/runtime-core": "3.5.11", - "acorn": "8.12.1", - "cross-env": "7.0.3", - "eslint-plugin-import": "2.31.0", - "eslint-plugin-vue": "9.28.0", - "fast-glob": "3.3.2", - "happy-dom": "10.0.3", - "intersection-observer": "0.12.2", - "micromatch": "4.0.8", - "msw": "2.3.4", - "nodemon": "3.1.7", - "prettier": "3.3.3", - "start-server-and-test": "2.0.8", - "vite-plugin-turbosnap": "1.0.3", - "vue-component-type-helpers": "2.1.6", - "vue-eslint-parser": "9.4.3", - "vue-tsc": "2.1.6" - } -} diff --git a/packages/frontend-embed/src/boot.ts b/packages/frontend-embed/src/boot.ts deleted file mode 100644 index 8ab4ab32e6..0000000000 --- a/packages/frontend-embed/src/boot.ts +++ /dev/null @@ -1,163 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -// https://vitejs.dev/config/build-options.html#build-modulepreload -import 'vite/modulepreload-polyfill'; - -import '@tabler/icons-webfont/dist/tabler-icons.scss'; - -import '@/style.scss'; -import { createApp, defineAsyncComponent } from 'vue'; -import defaultLightTheme from '@@/themes/l-light.json5'; -import defaultDarkTheme from '@@/themes/d-dark.json5'; -import { MediaProxy } from '@@/js/media-proxy.js'; -import { applyTheme, assertIsTheme } from '@/theme.js'; -import { fetchCustomEmojis } from '@/custom-emojis.js'; -import { DI } from '@/di.js'; -import { serverMetadata } from '@/server-metadata.js'; -import { url } from '@@/js/config.js'; -import { parseEmbedParams } from '@@/js/embed-page.js'; -import { postMessageToParentWindow, setIframeId } from '@/post-message.js'; -import { serverContext } from '@/server-context.js'; -import { i18n } from '@/i18n.js'; - -import type { Theme } from '@/theme.js'; - -console.log('Misskey Embed'); - -//#region Embedパラメータの取得・パース -const params = new URLSearchParams(location.search); -const embedParams = parseEmbedParams(params); -if (_DEV_) console.log(embedParams); -//#endregion - -//#region テーマ -function parseThemeOrNull(theme: string | null): Theme | null { - if (theme == null) return null; - try { - const parsed = JSON.parse(theme); - if (assertIsTheme(parsed)) { - return parsed; - } else { - return null; - } - } catch (err) { - return null; - } -} - -const lightTheme = parseThemeOrNull(serverMetadata.defaultLightTheme) ?? defaultLightTheme; -const darkTheme = parseThemeOrNull(serverMetadata.defaultDarkTheme) ?? defaultDarkTheme; - -if (embedParams.colorMode === 'dark') { - applyTheme(darkTheme); -} else if (embedParams.colorMode === 'light') { - applyTheme(lightTheme); -} else { - if (window.matchMedia('(prefers-color-scheme: dark)').matches) { - applyTheme(darkTheme); - } else { - applyTheme(lightTheme); - } - window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (mql) => { - if (mql.matches) { - applyTheme(darkTheme); - } else { - applyTheme(lightTheme); - } - }); -} -//#endregion - -// サイズの制限 -document.documentElement.style.maxWidth = '500px'; - -// iframeIdの設定 -function setIframeIdHandler(event: MessageEvent) { - if (event.data?.type === 'misskey:embedParent:registerIframeId' && event.data.payload?.iframeId != null) { - setIframeId(event.data.payload.iframeId); - window.removeEventListener('message', setIframeIdHandler); - } -} - -window.addEventListener('message', setIframeIdHandler); - -try { - await fetchCustomEmojis(); -} catch (err) { /* empty */ } - -const app = createApp( - defineAsyncComponent(() => import('@/ui.vue')), -); - -app.provide(DI.mediaProxy, new MediaProxy(serverMetadata, url)); - -app.provide(DI.serverMetadata, serverMetadata); - -app.provide(DI.serverContext, serverContext); - -app.provide(DI.embedParams, embedParams); - -// https://github.com/misskey-dev/misskey/pull/8575#issuecomment-1114239210 -// なぜか2回実行されることがあるため、mountするdivを1つに制限する -const rootEl = ((): HTMLElement => { - const MISSKEY_MOUNT_DIV_ID = 'misskey_app'; - - const currentRoot = document.getElementById(MISSKEY_MOUNT_DIV_ID); - - if (currentRoot) { - console.warn('multiple import detected'); - return currentRoot; - } - - const root = document.createElement('div'); - root.id = MISSKEY_MOUNT_DIV_ID; - document.body.appendChild(root); - return root; -})(); - -postMessageToParentWindow('misskey:embed:ready'); - -app.mount(rootEl); - -// boot.jsのやつを解除 -window.onerror = null; -window.onunhandledrejection = null; - -removeSplash(); - -//#region Self-XSS 対策メッセージ -console.log( - `%c${i18n.ts._selfXssPrevention.warning}`, - 'color: #f00; background-color: #ff0; font-size: 36px; padding: 4px;', -); -console.log( - `%c${i18n.ts._selfXssPrevention.title}`, - 'color: #f00; font-weight: 900; font-family: "Hiragino Sans W9", "Hiragino Kaku Gothic ProN", sans-serif; font-size: 24px;', -); -console.log( - `%c${i18n.ts._selfXssPrevention.description1}`, - 'font-size: 16px; font-weight: 700;', -); -console.log( - `%c${i18n.ts._selfXssPrevention.description2}`, - 'font-size: 16px;', - 'font-size: 20px; font-weight: 700; color: #f00;', -); -console.log(i18n.tsx._selfXssPrevention.description3({ link: 'https://misskey-hub.net/docs/for-users/resources/self-xss/' })); -//#endregion - -function removeSplash() { - const splash = document.getElementById('splash'); - if (splash) { - splash.style.opacity = '0'; - splash.style.pointerEvents = 'none'; - - // transitionendイベントが発火しない場合があるため - window.setTimeout(() => { - splash.remove(); - }, 1000); - } -} diff --git a/packages/frontend-embed/src/components/EmA.vue b/packages/frontend-embed/src/components/EmA.vue deleted file mode 100644 index 1c236b9a35..0000000000 --- a/packages/frontend-embed/src/components/EmA.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/packages/frontend-embed/src/components/EmAcct.vue b/packages/frontend-embed/src/components/EmAcct.vue deleted file mode 100644 index 6856b8272e..0000000000 --- a/packages/frontend-embed/src/components/EmAcct.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/packages/frontend-embed/src/components/EmAvatar.vue b/packages/frontend-embed/src/components/EmAvatar.vue deleted file mode 100644 index 58c35c8ef0..0000000000 --- a/packages/frontend-embed/src/components/EmAvatar.vue +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmCustomEmoji.vue b/packages/frontend-embed/src/components/EmCustomEmoji.vue deleted file mode 100644 index 59b670cdc6..0000000000 --- a/packages/frontend-embed/src/components/EmCustomEmoji.vue +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmEmoji.vue b/packages/frontend-embed/src/components/EmEmoji.vue deleted file mode 100644 index 224979707b..0000000000 --- a/packages/frontend-embed/src/components/EmEmoji.vue +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmError.vue b/packages/frontend-embed/src/components/EmError.vue deleted file mode 100644 index d376b29a7f..0000000000 --- a/packages/frontend-embed/src/components/EmError.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmImgWithBlurhash.vue b/packages/frontend-embed/src/components/EmImgWithBlurhash.vue deleted file mode 100644 index bf976c71ae..0000000000 --- a/packages/frontend-embed/src/components/EmImgWithBlurhash.vue +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - - diff --git a/packages/frontend-embed/src/components/EmInstanceTicker.vue b/packages/frontend-embed/src/components/EmInstanceTicker.vue deleted file mode 100644 index 4a116e317a..0000000000 --- a/packages/frontend-embed/src/components/EmInstanceTicker.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmLink.vue b/packages/frontend-embed/src/components/EmLink.vue deleted file mode 100644 index aec9b33072..0000000000 --- a/packages/frontend-embed/src/components/EmLink.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmLoading.vue b/packages/frontend-embed/src/components/EmLoading.vue deleted file mode 100644 index 47d797606b..0000000000 --- a/packages/frontend-embed/src/components/EmLoading.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmMediaBanner.vue b/packages/frontend-embed/src/components/EmMediaBanner.vue deleted file mode 100644 index cf4a4c53b5..0000000000 --- a/packages/frontend-embed/src/components/EmMediaBanner.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmMediaImage.vue b/packages/frontend-embed/src/components/EmMediaImage.vue deleted file mode 100644 index d711020a74..0000000000 --- a/packages/frontend-embed/src/components/EmMediaImage.vue +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmMediaList.vue b/packages/frontend-embed/src/components/EmMediaList.vue deleted file mode 100644 index 0b2d835abe..0000000000 --- a/packages/frontend-embed/src/components/EmMediaList.vue +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmMediaVideo.vue b/packages/frontend-embed/src/components/EmMediaVideo.vue deleted file mode 100644 index e2779bdee4..0000000000 --- a/packages/frontend-embed/src/components/EmMediaVideo.vue +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmMention.vue b/packages/frontend-embed/src/components/EmMention.vue deleted file mode 100644 index a71364237d..0000000000 --- a/packages/frontend-embed/src/components/EmMention.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmMfm.ts b/packages/frontend-embed/src/components/EmMfm.ts deleted file mode 100644 index cae2feb8fb..0000000000 --- a/packages/frontend-embed/src/components/EmMfm.ts +++ /dev/null @@ -1,454 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { VNode, h, SetupContext, provide } from 'vue'; -import * as mfm from 'mfm-js'; -import * as Misskey from 'misskey-js'; -import { host } from '@@/js/config.js'; -import EmUrl from '@/components/EmUrl.vue'; -import EmTime from '@/components/EmTime.vue'; -import EmLink from '@/components/EmLink.vue'; -import EmMention from '@/components/EmMention.vue'; -import EmEmoji from '@/components/EmEmoji.vue'; -import EmCustomEmoji from '@/components/EmCustomEmoji.vue'; -import EmA from '@/components/EmA.vue'; - -function safeParseFloat(str: unknown): number | null { - if (typeof str !== 'string' || str === '') return null; - const num = parseFloat(str); - if (isNaN(num)) return null; - return num; -} - -const QUOTE_STYLE = ` -display: block; -margin: 8px; -padding: 6px 0 6px 12px; -color: var(--MI_THEME-fg); -border-left: solid 3px var(--MI_THEME-fg); -opacity: 0.7; -`.split('\n').join(' '); - -type MfmProps = { - text: string; - plain?: boolean; - nowrap?: boolean; - author?: Misskey.entities.UserLite; - isNote?: boolean; - emojiUrls?: Record; - rootScale?: number; - nyaize?: boolean | 'respect'; - parsedNodes?: mfm.MfmNode[] | null; -}; - -type MfmEvents = { - clickEv(id: string): void; -}; - -// eslint-disable-next-line import/no-default-export -export default function (props: MfmProps, { emit }: { emit: SetupContext['emit'] }) { - const isNote = props.isNote ?? true; - const shouldNyaize = props.nyaize ? props.nyaize === 'respect' ? props.author?.isCat : false : false; - - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (props.text == null || props.text === '') return; - - const rootAst = props.parsedNodes ?? (props.plain ? mfm.parseSimple : mfm.parse)(props.text); - - const validTime = (t: string | boolean | null | undefined) => { - if (t == null) return null; - if (typeof t === 'boolean') return null; - return t.match(/^\-?[0-9.]+s$/) ? t : null; - }; - - const validColor = (c: unknown): string | null => { - if (typeof c !== 'string') return null; - return c.match(/^[0-9a-f]{3,6}$/i) ? c : null; - }; - - const useAnim = true; - - /** - * Gen Vue Elements from MFM AST - * @param ast MFM AST - * @param scale How times large the text is - * @param disableNyaize Whether nyaize is disabled or not - */ - const genEl = (ast: mfm.MfmNode[], scale: number, disableNyaize = false) => ast.map((token): VNode | string | (VNode | string)[] => { - switch (token.type) { - case 'text': { - let text = token.props.text.replace(/(\r\n|\n|\r)/g, '\n'); - if (!disableNyaize && shouldNyaize) { - text = Misskey.nyaize(text); - } - - if (!props.plain) { - const res: (VNode | string)[] = []; - for (const t of text.split('\n')) { - res.push(h('br')); - res.push(t); - } - res.shift(); - return res; - } else { - return [text.replace(/\n/g, ' ')]; - } - } - - case 'bold': { - return [h('b', genEl(token.children, scale))]; - } - - case 'strike': { - return [h('del', genEl(token.children, scale))]; - } - - case 'italic': { - return h('i', { - style: 'font-style: oblique;', - }, genEl(token.children, scale)); - } - - case 'fn': { - // TODO: CSSを文字列で組み立てていくと token.props.args.~~~ 経由でCSSインジェクションできるのでよしなにやる - let style: string | undefined; - switch (token.props.name) { - case 'tada': { - const speed = validTime(token.props.args.speed) ?? '1s'; - const delay = validTime(token.props.args.delay) ?? '0s'; - style = 'font-size: 150%;' + (useAnim ? `animation: global-tada ${speed} linear infinite both; animation-delay: ${delay};` : ''); - break; - } - case 'jelly': { - const speed = validTime(token.props.args.speed) ?? '1s'; - const delay = validTime(token.props.args.delay) ?? '0s'; - style = (useAnim ? `animation: mfm-rubberBand ${speed} linear infinite both; animation-delay: ${delay};` : ''); - break; - } - case 'twitch': { - const speed = validTime(token.props.args.speed) ?? '0.5s'; - const delay = validTime(token.props.args.delay) ?? '0s'; - style = useAnim ? `animation: mfm-twitch ${speed} ease infinite; animation-delay: ${delay};` : ''; - break; - } - case 'shake': { - const speed = validTime(token.props.args.speed) ?? '0.5s'; - const delay = validTime(token.props.args.delay) ?? '0s'; - style = useAnim ? `animation: mfm-shake ${speed} ease infinite; animation-delay: ${delay};` : ''; - break; - } - case 'spin': { - const direction = - token.props.args.left ? 'reverse' : - token.props.args.alternate ? 'alternate' : - 'normal'; - const anime = - token.props.args.x ? 'mfm-spinX' : - token.props.args.y ? 'mfm-spinY' : - 'mfm-spin'; - const speed = validTime(token.props.args.speed) ?? '1.5s'; - const delay = validTime(token.props.args.delay) ?? '0s'; - style = useAnim ? `animation: ${anime} ${speed} linear infinite; animation-direction: ${direction}; animation-delay: ${delay};` : ''; - break; - } - case 'jump': { - const speed = validTime(token.props.args.speed) ?? '0.75s'; - const delay = validTime(token.props.args.delay) ?? '0s'; - style = useAnim ? `animation: mfm-jump ${speed} linear infinite; animation-delay: ${delay};` : ''; - break; - } - case 'bounce': { - const speed = validTime(token.props.args.speed) ?? '0.75s'; - const delay = validTime(token.props.args.delay) ?? '0s'; - style = useAnim ? `animation: mfm-bounce ${speed} linear infinite; transform-origin: center bottom; animation-delay: ${delay};` : ''; - break; - } - case 'flip': { - const transform = - (token.props.args.h && token.props.args.v) ? 'scale(-1, -1)' : - token.props.args.v ? 'scaleY(-1)' : - 'scaleX(-1)'; - style = `transform: ${transform};`; - break; - } - case 'x2': { - return h('span', { - class: 'mfm-x2', - }, genEl(token.children, scale * 2)); - } - case 'x3': { - return h('span', { - class: 'mfm-x3', - }, genEl(token.children, scale * 3)); - } - case 'x4': { - return h('span', { - class: 'mfm-x4', - }, genEl(token.children, scale * 4)); - } - case 'font': { - const family = - token.props.args.serif ? 'serif' : - token.props.args.monospace ? 'monospace' : - token.props.args.cursive ? 'cursive' : - token.props.args.fantasy ? 'fantasy' : - token.props.args.emoji ? 'emoji' : - token.props.args.math ? 'math' : - null; - if (family) style = `font-family: ${family};`; - break; - } - case 'blur': { - return h('span', { - class: '_mfm_blur_', - }, genEl(token.children, scale)); - } - case 'rainbow': { - if (!useAnim) { - return h('span', { - class: '_mfm_rainbow_fallback_', - }, genEl(token.children, scale)); - } - const speed = validTime(token.props.args.speed) ?? '1s'; - const delay = validTime(token.props.args.delay) ?? '0s'; - style = `animation: mfm-rainbow ${speed} linear infinite; animation-delay: ${delay};`; - break; - } - case 'sparkle': { - return genEl(token.children, scale); - } - case 'rotate': { - const degrees = safeParseFloat(token.props.args.deg) ?? 90; - style = `transform: rotate(${degrees}deg); transform-origin: center center;`; - break; - } - case 'position': { - const x = safeParseFloat(token.props.args.x) ?? 0; - const y = safeParseFloat(token.props.args.y) ?? 0; - style = `transform: translateX(${x}em) translateY(${y}em);`; - break; - } - case 'scale': { - const x = Math.min(safeParseFloat(token.props.args.x) ?? 1, 5); - const y = Math.min(safeParseFloat(token.props.args.y) ?? 1, 5); - style = `transform: scale(${x}, ${y});`; - scale = scale * Math.max(x, y); - break; - } - case 'fg': { - let color = validColor(token.props.args.color); - color = color ?? 'f00'; - style = `color: #${color}; overflow-wrap: anywhere;`; - break; - } - case 'bg': { - let color = validColor(token.props.args.color); - color = color ?? 'f00'; - style = `background-color: #${color}; overflow-wrap: anywhere;`; - break; - } - case 'border': { - let color = validColor(token.props.args.color); - color = color ? `#${color}` : 'var(--MI_THEME-accent)'; - let b_style = token.props.args.style; - if ( - typeof b_style !== 'string' || - !['hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'] - .includes(b_style) - ) b_style = 'solid'; - const width = safeParseFloat(token.props.args.width) ?? 1; - const radius = safeParseFloat(token.props.args.radius) ?? 0; - style = `border: ${width}px ${b_style} ${color}; border-radius: ${radius}px;${token.props.args.noclip ? '' : ' overflow: clip;'}`; - break; - } - case 'ruby': { - if (token.children.length === 1) { - const child = token.children[0]; - let text = child.type === 'text' ? child.props.text : ''; - if (!disableNyaize && shouldNyaize) { - text = Misskey.nyaize(text); - } - return h('ruby', {}, [text.split(' ')[0], h('rt', text.split(' ')[1])]); - } else { - const rt = token.children.at(-1)!; - let text = rt.type === 'text' ? rt.props.text : ''; - if (!disableNyaize && shouldNyaize) { - text = Misskey.nyaize(text); - } - return h('ruby', {}, [...genEl(token.children.slice(0, token.children.length - 1), scale), h('rt', text.trim())]); - } - } - case 'unixtime': { - const child = token.children[0]; - const unixtime = parseInt(child.type === 'text' ? child.props.text : ''); - return h('span', { - style: 'display: inline-block; font-size: 90%; border: solid 1px var(--MI_THEME-divider); border-radius: 999px; padding: 4px 10px 4px 6px;', - }, [ - h('i', { - class: 'ti ti-clock', - style: 'margin-right: 0.25em;', - }), - h(EmTime, { - key: Math.random(), - time: unixtime * 1000, - mode: 'detail', - }), - ]); - } - case 'clickable': { - return h('span', { onClick(ev: MouseEvent): void { - ev.stopPropagation(); - ev.preventDefault(); - const clickEv = typeof token.props.args.ev === 'string' ? token.props.args.ev : ''; - emit('clickEv', clickEv); - } }, genEl(token.children, scale)); - } - } - if (style === undefined) { - return h('span', {}, ['$[', token.props.name, ' ', ...genEl(token.children, scale), ']']); - } else { - return h('span', { - style: 'display: inline-block; ' + style, - }, genEl(token.children, scale)); - } - } - - case 'small': { - return [h('small', { - style: 'opacity: 0.7;', - }, genEl(token.children, scale))]; - } - - case 'center': { - return [h('div', { - style: 'text-align:center;', - }, genEl(token.children, scale))]; - } - - case 'url': { - return [h(EmUrl, { - key: Math.random(), - url: token.props.url, - rel: 'nofollow noopener', - })]; - } - - case 'link': { - return [h(EmLink, { - key: Math.random(), - url: token.props.url, - rel: 'nofollow noopener', - }, genEl(token.children, scale, true))]; - } - - case 'mention': { - return [h(EmMention, { - key: Math.random(), - host: (token.props.host == null && props.author && props.author.host != null ? props.author.host : token.props.host) ?? host, - username: token.props.username, - })]; - } - - case 'hashtag': { - return [h(EmA, { - key: Math.random(), - to: isNote ? `/tags/${encodeURIComponent(token.props.hashtag)}` : `/user-tags/${encodeURIComponent(token.props.hashtag)}`, - style: 'color:var(--MI_THEME-hashtag);', - }, `#${token.props.hashtag}`)]; - } - - case 'blockCode': { - return [h('code', { - key: Math.random(), - lang: token.props.lang ?? undefined, - }, token.props.code)]; - } - - case 'inlineCode': { - return [h('code', { - key: Math.random(), - }, token.props.code)]; - } - - case 'quote': { - if (!props.nowrap) { - return [h('div', { - style: QUOTE_STYLE, - }, genEl(token.children, scale, true))]; - } else { - return [h('span', { - style: QUOTE_STYLE, - }, genEl(token.children, scale, true))]; - } - } - - case 'emojiCode': { - if (props.author?.host == null) { - return [h(EmCustomEmoji, { - key: Math.random(), - name: token.props.name, - normal: props.plain, - host: null, - useOriginalSize: scale >= 2.5, - fallbackToImage: false, - })]; - } else { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (props.emojiUrls && (props.emojiUrls[token.props.name] == null)) { - return [h('span', `:${token.props.name}:`)]; - } else { - return [h(EmCustomEmoji, { - key: Math.random(), - name: token.props.name, - url: props.emojiUrls && props.emojiUrls[token.props.name], - normal: props.plain, - host: props.author.host, - useOriginalSize: scale >= 2.5, - })]; - } - } - } - - case 'unicodeEmoji': { - return [h(EmEmoji, { - key: Math.random(), - emoji: token.props.emoji, - menu: props.enableEmojiMenu, - menuReaction: props.enableEmojiMenuReaction, - })]; - } - - case 'mathInline': { - return [h('code', token.props.formula)]; - } - - case 'mathBlock': { - return [h('code', token.props.formula)]; - } - - case 'search': { - return [h('div', { - key: Math.random(), - }, token.props.query)]; - } - - case 'plain': { - return [h('span', genEl(token.children, scale, true))]; - } - - default: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - console.error('unrecognized ast type:', (token as any).type); - - return []; - } - } - }).flat(Infinity) as (VNode | string)[]; - - return h('span', { - // https://codeday.me/jp/qa/20190424/690106.html - style: props.nowrap ? 'white-space: pre; word-wrap: normal; overflow: hidden; text-overflow: ellipsis;' : 'white-space: pre-wrap;', - }, genEl(rootAst, props.rootScale ?? 1)); -} diff --git a/packages/frontend-embed/src/components/EmNote.vue b/packages/frontend-embed/src/components/EmNote.vue deleted file mode 100644 index f5b064c293..0000000000 --- a/packages/frontend-embed/src/components/EmNote.vue +++ /dev/null @@ -1,605 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmNoteDetailed.vue b/packages/frontend-embed/src/components/EmNoteDetailed.vue deleted file mode 100644 index b39b47c065..0000000000 --- a/packages/frontend-embed/src/components/EmNoteDetailed.vue +++ /dev/null @@ -1,490 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmNoteHeader.vue b/packages/frontend-embed/src/components/EmNoteHeader.vue deleted file mode 100644 index 85b4aac071..0000000000 --- a/packages/frontend-embed/src/components/EmNoteHeader.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmNoteSimple.vue b/packages/frontend-embed/src/components/EmNoteSimple.vue deleted file mode 100644 index b9aaf3fa4a..0000000000 --- a/packages/frontend-embed/src/components/EmNoteSimple.vue +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmNoteSub.vue b/packages/frontend-embed/src/components/EmNoteSub.vue deleted file mode 100644 index 59be8608e0..0000000000 --- a/packages/frontend-embed/src/components/EmNoteSub.vue +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmNotes.vue b/packages/frontend-embed/src/components/EmNotes.vue deleted file mode 100644 index 4211261e19..0000000000 --- a/packages/frontend-embed/src/components/EmNotes.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmPagination.vue b/packages/frontend-embed/src/components/EmPagination.vue deleted file mode 100644 index 5d5317a912..0000000000 --- a/packages/frontend-embed/src/components/EmPagination.vue +++ /dev/null @@ -1,504 +0,0 @@ - - - - - - - - diff --git a/packages/frontend-embed/src/components/EmPoll.vue b/packages/frontend-embed/src/components/EmPoll.vue deleted file mode 100644 index d197e094c6..0000000000 --- a/packages/frontend-embed/src/components/EmPoll.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmReactionIcon.vue b/packages/frontend-embed/src/components/EmReactionIcon.vue deleted file mode 100644 index 5c38ecb0ed..0000000000 --- a/packages/frontend-embed/src/components/EmReactionIcon.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - - - diff --git a/packages/frontend-embed/src/components/EmReactionsViewer.reaction.vue b/packages/frontend-embed/src/components/EmReactionsViewer.reaction.vue deleted file mode 100644 index 2ebff489fd..0000000000 --- a/packages/frontend-embed/src/components/EmReactionsViewer.reaction.vue +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmReactionsViewer.vue b/packages/frontend-embed/src/components/EmReactionsViewer.vue deleted file mode 100644 index 014dd1c935..0000000000 --- a/packages/frontend-embed/src/components/EmReactionsViewer.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmSubNoteContent.vue b/packages/frontend-embed/src/components/EmSubNoteContent.vue deleted file mode 100644 index 61815ddfd8..0000000000 --- a/packages/frontend-embed/src/components/EmSubNoteContent.vue +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmTime.vue b/packages/frontend-embed/src/components/EmTime.vue deleted file mode 100644 index 7902e18483..0000000000 --- a/packages/frontend-embed/src/components/EmTime.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmTimelineContainer.vue b/packages/frontend-embed/src/components/EmTimelineContainer.vue deleted file mode 100644 index 60fd67ced9..0000000000 --- a/packages/frontend-embed/src/components/EmTimelineContainer.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmUrl.vue b/packages/frontend-embed/src/components/EmUrl.vue deleted file mode 100644 index 94424cab28..0000000000 --- a/packages/frontend-embed/src/components/EmUrl.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/components/EmUserName.vue b/packages/frontend-embed/src/components/EmUserName.vue deleted file mode 100644 index c0c7c443ca..0000000000 --- a/packages/frontend-embed/src/components/EmUserName.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/packages/frontend-embed/src/components/I18n.vue b/packages/frontend-embed/src/components/I18n.vue deleted file mode 100644 index b621110ec9..0000000000 --- a/packages/frontend-embed/src/components/I18n.vue +++ /dev/null @@ -1,51 +0,0 @@ - - - - - diff --git a/packages/frontend-embed/src/custom-emojis.ts b/packages/frontend-embed/src/custom-emojis.ts deleted file mode 100644 index d5b40885c1..0000000000 --- a/packages/frontend-embed/src/custom-emojis.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { shallowRef, watch } from 'vue'; -import * as Misskey from 'misskey-js'; -import { misskeyApi, misskeyApiGet } from '@/misskey-api.js'; - -function get(key: string) { - const value = localStorage.getItem(key); - if (value === null) return null; - return JSON.parse(value); -} - -function set(key: string, value: any) { - localStorage.setItem(key, JSON.stringify(value)); -} - -const storageCache = await get('emojis'); -export const customEmojis = shallowRef(Array.isArray(storageCache) ? storageCache : []); - -export const customEmojisMap = new Map(); -watch(customEmojis, emojis => { - customEmojisMap.clear(); - for (const emoji of emojis) { - customEmojisMap.set(emoji.name, emoji); - } -}, { immediate: true }); - -export async function fetchCustomEmojis(force = false) { - const now = Date.now(); - - let res; - if (force) { - res = await misskeyApi('emojis', {}); - } else { - const lastFetchedAt = await get('lastEmojisFetchedAt'); - if (lastFetchedAt && (now - lastFetchedAt) < 1000 * 60 * 60) return; - res = await misskeyApiGet('emojis', {}); - } - - customEmojis.value = res.emojis; - set('emojis', res.emojis); - set('lastEmojisFetchedAt', now); -} - -let cachedTags; -export function getCustomEmojiTags() { - if (cachedTags) return cachedTags; - - const tags = new Set(); - for (const emoji of customEmojis.value) { - for (const tag of emoji.aliases) { - tags.add(tag); - } - } - const res = Array.from(tags); - cachedTags = res; - return res; -} diff --git a/packages/frontend-embed/src/di.ts b/packages/frontend-embed/src/di.ts deleted file mode 100644 index 22f6276630..0000000000 --- a/packages/frontend-embed/src/di.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import type { InjectionKey } from 'vue'; -import * as Misskey from 'misskey-js'; -import { MediaProxy } from '@@/js/media-proxy.js'; -import type { ParsedEmbedParams } from '@@/js/embed-page.js'; -import type { ServerContext } from '@/server-context.js'; - -export const DI = { - serverMetadata: Symbol() as InjectionKey, - embedParams: Symbol() as InjectionKey, - serverContext: Symbol() as InjectionKey, - mediaProxy: Symbol() as InjectionKey, -}; diff --git a/packages/frontend-embed/src/i18n.ts b/packages/frontend-embed/src/i18n.ts deleted file mode 100644 index 6ad503b089..0000000000 --- a/packages/frontend-embed/src/i18n.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { markRaw } from 'vue'; -import { I18n } from '@@/js/i18n.js'; -import type { Locale } from '../../../locales/index.js'; -import { locale } from '@@/js/config.js'; - -export const i18n = markRaw(new I18n(locale, _DEV_)); - -export function updateI18n(newLocale: Locale) { - i18n.locale = newLocale; -} diff --git a/packages/frontend-embed/src/index.html b/packages/frontend-embed/src/index.html deleted file mode 100644 index 47b0b0e84e..0000000000 --- a/packages/frontend-embed/src/index.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - [DEV] Loading... - - - - - - - -
- - - diff --git a/packages/frontend-embed/src/pages/clip.vue b/packages/frontend-embed/src/pages/clip.vue deleted file mode 100644 index f4d4e8cf6f..0000000000 --- a/packages/frontend-embed/src/pages/clip.vue +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/pages/not-found.vue b/packages/frontend-embed/src/pages/not-found.vue deleted file mode 100644 index bbb03b4e64..0000000000 --- a/packages/frontend-embed/src/pages/not-found.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/packages/frontend-embed/src/pages/note.vue b/packages/frontend-embed/src/pages/note.vue deleted file mode 100644 index e879430286..0000000000 --- a/packages/frontend-embed/src/pages/note.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/pages/tag.vue b/packages/frontend-embed/src/pages/tag.vue deleted file mode 100644 index 4b00ae7c2d..0000000000 --- a/packages/frontend-embed/src/pages/tag.vue +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/pages/user-timeline.vue b/packages/frontend-embed/src/pages/user-timeline.vue deleted file mode 100644 index 348b1a7622..0000000000 --- a/packages/frontend-embed/src/pages/user-timeline.vue +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/post-message.ts b/packages/frontend-embed/src/post-message.ts deleted file mode 100644 index fd8eb8a5d2..0000000000 --- a/packages/frontend-embed/src/post-message.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export const postMessageEventTypes = [ - 'misskey:embed:ready', - 'misskey:embed:changeHeight', -] as const; - -export type PostMessageEventType = typeof postMessageEventTypes[number]; - -export interface PostMessageEventPayload extends Record { - 'misskey:embed:ready': undefined; - 'misskey:embed:changeHeight': { - height: number; - }; -} - -export type MiPostMessageEvent = { - type: T; - iframeId?: string; - payload?: PostMessageEventPayload[T]; -} - -let defaultIframeId: string | null = null; - -export function setIframeId(id: string): void { - if (defaultIframeId != null) return; - - if (_DEV_) console.log('setIframeId', id); - defaultIframeId = id; -} - -/** - * 親フレームにイベントを送信 - */ -export function postMessageToParentWindow(type: T, payload?: PostMessageEventPayload[T], iframeId: string | null = null): void { - let _iframeId = iframeId; - if (_iframeId == null) { - _iframeId = defaultIframeId; - } - if (_DEV_) console.log('postMessageToParentWindow', type, _iframeId, payload); - window.parent.postMessage({ - type, - iframeId: _iframeId, - payload, - }, '*'); -} diff --git a/packages/frontend-embed/src/server-context.ts b/packages/frontend-embed/src/server-context.ts deleted file mode 100644 index a84a1a726a..0000000000 --- a/packages/frontend-embed/src/server-context.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ -import * as Misskey from 'misskey-js'; - -const providedContextEl = document.getElementById('misskey_embedCtx'); - -export type ServerContext = { - clip?: Misskey.entities.Clip; - note?: Misskey.entities.Note; - user?: Misskey.entities.UserLite; -} | null; - -// NOTE: devモードのときしか embedCtx が null になることは無い -export const serverContext: ServerContext = (providedContextEl && providedContextEl.textContent) ? JSON.parse(providedContextEl.textContent) : null; - -export function assertServerContext>(ctx: ServerContext, entity: K): ctx is Required, K>> { - if (ctx == null) return false; - return entity in ctx; -} diff --git a/packages/frontend-embed/src/server-metadata.ts b/packages/frontend-embed/src/server-metadata.ts deleted file mode 100644 index 6c94aacd48..0000000000 --- a/packages/frontend-embed/src/server-metadata.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import * as Misskey from 'misskey-js'; -import { misskeyApi } from '@/misskey-api.js'; - -const providedMetaEl = document.getElementById('misskey_meta'); - -const _serverMetadata: Misskey.entities.MetaDetailed | null = (providedMetaEl && providedMetaEl.textContent) ? JSON.parse(providedMetaEl.textContent) : null; - -// NOTE: devモードのときしか _serverMetadata が null になることは無い -export const serverMetadata: Misskey.entities.MetaDetailed = _serverMetadata ?? await misskeyApi('meta', { - detail: true, -}); diff --git a/packages/frontend-embed/src/style.scss b/packages/frontend-embed/src/style.scss deleted file mode 100644 index 2e43cfd20a..0000000000 --- a/packages/frontend-embed/src/style.scss +++ /dev/null @@ -1,453 +0,0 @@ -@charset "utf-8"; - -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * - * SPDX-License-Identifier: AGPL-3.0-only - */ - -:root { - --MI-radius: 12px; - --MI-marginFull: 14px; - --MI-marginHalf: 10px; - - --MI-margin: var(--MI-marginFull); -} - -html { - background-color: transparent; - color-scheme: light dark; - color: var(--MI_THEME-fg); - accent-color: var(--MI_THEME-accent); - overflow: clip; - overflow-wrap: break-word; - font-family: 'Hiragino Maru Gothic Pro', "BIZ UDGothic", Roboto, HelveticaNeue, Arial, sans-serif; - font-size: 14px; - line-height: 1.35; - text-size-adjust: 100%; - tab-size: 2; - -webkit-text-size-adjust: 100%; - - &, * { - scrollbar-color: var(--MI_THEME-scrollbarHandle) transparent; - scrollbar-width: thin; - - &::-webkit-scrollbar { - width: 6px; - height: 6px; - } - - &::-webkit-scrollbar-track { - background: inherit; - } - - &::-webkit-scrollbar-thumb { - background: var(--MI_THEME-scrollbarHandle); - - &:hover { - background: var(--MI_THEME-scrollbarHandleHover); - } - - &:active { - background: var(--MI_THEME-accent); - } - } - } -} - -html, body { - height: 100%; - touch-action: manipulation; - margin: 0; - padding: 0; - scroll-behavior: smooth; -} - -#misskey_app { - height: 100%; -} - -a { - text-decoration: none; - cursor: pointer; - color: inherit; - tap-highlight-color: transparent; - -webkit-tap-highlight-color: transparent; - -webkit-touch-callout: none; - - &:focus-visible { - outline-offset: 2px; - } - - &:hover { - text-decoration: underline; - } - - &[target="_blank"] { - -webkit-touch-callout: default; - } -} - -rt { - white-space: initial; -} - -:focus-visible { - outline: var(--MI_THEME-focus) solid 2px; - outline-offset: -2px; - - &:hover { - text-decoration: none; - } -} - -.ti { - width: 1.28em; - vertical-align: -12%; - line-height: 1em; - - &::before { - font-size: 128%; - } -} - -.ti-fw { - display: inline-block; - text-align: center; -} - -._nowrap { - white-space: pre !important; - word-wrap: normal !important; // https://codeday.me/jp/qa/20190424/690106.html - overflow: hidden; - text-overflow: ellipsis; -} - -._button { - user-select: none; - -webkit-user-select: none; - -webkit-touch-callout: none; - appearance: none; - display: inline-block; - padding: 0; - margin: 0; // for Safari - background: none; - border: none; - cursor: pointer; - color: inherit; - touch-action: manipulation; - tap-highlight-color: transparent; - -webkit-tap-highlight-color: transparent; - font-size: 1em; - font-family: inherit; - line-height: inherit; - max-width: 100%; - - &:disabled { - opacity: 0.5; - cursor: default; - } -} - -._buttonGray { - @extend ._button; - background: var(--MI_THEME-buttonBg); - - &:not(:disabled):hover { - background: var(--MI_THEME-buttonHoverBg); - } -} - -._buttonPrimary { - @extend ._button; - color: var(--MI_THEME-fgOnAccent); - background: var(--MI_THEME-accent); - - &:not(:disabled):hover { - background: hsl(from var(--MI_THEME-accent) h s calc(l + 5)); - } - - &:not(:disabled):active { - background: hsl(from var(--MI_THEME-accent) h s calc(l - 5)); - } -} - -._buttonGradate { - @extend ._buttonPrimary; - color: var(--MI_THEME-fgOnAccent); - background: linear-gradient(90deg, var(--MI_THEME-buttonGradateA), var(--MI_THEME-buttonGradateB)); - - &:not(:disabled):hover { - background: linear-gradient(90deg, hsl(from var(--MI_THEME-accent) h s calc(l + 5)), hsl(from var(--MI_THEME-accent) h s calc(l + 5))); - } - - &:not(:disabled):active { - background: linear-gradient(90deg, hsl(from var(--MI_THEME-accent) h s calc(l + 5)), hsl(from var(--MI_THEME-accent) h s calc(l + 5))); - } -} - -._buttonRounded { - font-size: 0.95em; - padding: 0.5em 1em; - min-width: 100px; - border-radius: 99rem; - - &._buttonPrimary, - &._buttonGradate { - font-weight: 700; - } -} - -._help { - color: var(--MI_THEME-accent); - cursor: help; -} - -._textButton { - @extend ._button; - color: var(--MI_THEME-accent); - - &:focus-visible { - outline-offset: 2px; - } - - &:not(:disabled):hover { - text-decoration: underline; - } -} - -._panel { - background: var(--MI_THEME-panel); - border-radius: var(--MI-radius); - overflow: clip; -} - -._margin { - margin: var(--MI-margin) 0; -} - -._gaps_m { - display: flex; - flex-direction: column; - gap: 1.5em; -} - -._gaps_s { - display: flex; - flex-direction: column; - gap: 0.75em; -} - -._gaps { - display: flex; - flex-direction: column; - gap: var(--MI-margin); -} - -._buttons { - display: flex; - gap: 8px; - flex-wrap: wrap; -} - -._buttonsCenter { - @extend ._buttons; - - justify-content: center; -} - -._borderButton { - @extend ._button; - display: block; - width: 100%; - padding: 10px; - box-sizing: border-box; - text-align: center; - border: solid 0.5px var(--MI_THEME-divider); - border-radius: var(--MI-radius); - - &:active { - border-color: var(--MI_THEME-accent); - } -} - -._popup { - background: var(--MI_THEME-popup); - border-radius: var(--MI-radius); - contain: content; -} - -._acrylic { - background: var(--MI_THEME-acrylicPanel); - -webkit-backdrop-filter: var(--MI-blur, blur(15px)); - backdrop-filter: var(--MI-blur, blur(15px)); -} - -._fullinfo { - padding: 64px 32px; - text-align: center; - - > img { - vertical-align: bottom; - height: 128px; - margin-bottom: 16px; - border-radius: 16px; - } -} - -._link { - color: var(--MI_THEME-link); -} - -._caption { - font-size: 0.8em; - opacity: 0.7; -} - -._monospace { - font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace !important; -} - -// MFM ----------------------------- - -._mfm_blur_ { - filter: blur(6px); - transition: filter 0.3s; - - &:hover { - filter: blur(0px); - } -} - -.mfm-x2 { - --mfm-zoom-size: 200%; -} - -.mfm-x3 { - --mfm-zoom-size: 400%; -} - -.mfm-x4 { - --mfm-zoom-size: 600%; -} - -.mfm-x2, .mfm-x3, .mfm-x4 { - font-size: var(--mfm-zoom-size); - - .mfm-x2, .mfm-x3, .mfm-x4 { - /* only half effective */ - font-size: calc(var(--mfm-zoom-size) / 2 + 50%); - - .mfm-x2, .mfm-x3, .mfm-x4 { - /* disabled */ - font-size: 100%; - } - } -} - -._mfm_rainbow_fallback_ { - background-image: linear-gradient(to right, rgb(255, 0, 0) 0%, rgb(255, 165, 0) 17%, rgb(255, 255, 0) 33%, rgb(0, 255, 0) 50%, rgb(0, 255, 255) 67%, rgb(0, 0, 255) 83%, rgb(255, 0, 255) 100%); - -webkit-background-clip: text; - background-clip: text; - color: transparent; -} - -@keyframes mfm-spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } -} - -@keyframes mfm-spinX { - 0% { transform: perspective(128px) rotateX(0deg); } - 100% { transform: perspective(128px) rotateX(360deg); } -} - -@keyframes mfm-spinY { - 0% { transform: perspective(128px) rotateY(0deg); } - 100% { transform: perspective(128px) rotateY(360deg); } -} - -@keyframes mfm-jump { - 0% { transform: translateY(0); } - 25% { transform: translateY(-16px); } - 50% { transform: translateY(0); } - 75% { transform: translateY(-8px); } - 100% { transform: translateY(0); } -} - -@keyframes mfm-bounce { - 0% { transform: translateY(0) scale(1, 1); } - 25% { transform: translateY(-16px) scale(1, 1); } - 50% { transform: translateY(0) scale(1, 1); } - 75% { transform: translateY(0) scale(1.5, 0.75); } - 100% { transform: translateY(0) scale(1, 1); } -} - -// const val = () => `translate(${Math.floor(Math.random() * 20) - 10}px, ${Math.floor(Math.random() * 20) - 10}px)`; -// let css = ''; -// for (let i = 0; i <= 100; i += 5) { css += `${i}% { transform: ${val()} }\n`; } -@keyframes mfm-twitch { - 0% { transform: translate(7px, -2px) } - 5% { transform: translate(-3px, 1px) } - 10% { transform: translate(-7px, -1px) } - 15% { transform: translate(0px, -1px) } - 20% { transform: translate(-8px, 6px) } - 25% { transform: translate(-4px, -3px) } - 30% { transform: translate(-4px, -6px) } - 35% { transform: translate(-8px, -8px) } - 40% { transform: translate(4px, 6px) } - 45% { transform: translate(-3px, 1px) } - 50% { transform: translate(2px, -10px) } - 55% { transform: translate(-7px, 0px) } - 60% { transform: translate(-2px, 4px) } - 65% { transform: translate(3px, -8px) } - 70% { transform: translate(6px, 7px) } - 75% { transform: translate(-7px, -2px) } - 80% { transform: translate(-7px, -8px) } - 85% { transform: translate(9px, 3px) } - 90% { transform: translate(-3px, -2px) } - 95% { transform: translate(-10px, 2px) } - 100% { transform: translate(-2px, -6px) } -} - -// const val = () => `translate(${Math.floor(Math.random() * 6) - 3}px, ${Math.floor(Math.random() * 6) - 3}px) rotate(${Math.floor(Math.random() * 24) - 12}deg)`; -// let css = ''; -// for (let i = 0; i <= 100; i += 5) { css += `${i}% { transform: ${val()} }\n`; } -@keyframes mfm-shake { - 0% { transform: translate(-3px, -1px) rotate(-8deg) } - 5% { transform: translate(0px, -1px) rotate(-10deg) } - 10% { transform: translate(1px, -3px) rotate(0deg) } - 15% { transform: translate(1px, 1px) rotate(11deg) } - 20% { transform: translate(-2px, 1px) rotate(1deg) } - 25% { transform: translate(-1px, -2px) rotate(-2deg) } - 30% { transform: translate(-1px, 2px) rotate(-3deg) } - 35% { transform: translate(2px, 1px) rotate(6deg) } - 40% { transform: translate(-2px, -3px) rotate(-9deg) } - 45% { transform: translate(0px, -1px) rotate(-12deg) } - 50% { transform: translate(1px, 2px) rotate(10deg) } - 55% { transform: translate(0px, -3px) rotate(8deg) } - 60% { transform: translate(1px, -1px) rotate(8deg) } - 65% { transform: translate(0px, -1px) rotate(-7deg) } - 70% { transform: translate(-1px, -3px) rotate(6deg) } - 75% { transform: translate(0px, -2px) rotate(4deg) } - 80% { transform: translate(-2px, -1px) rotate(3deg) } - 85% { transform: translate(1px, -3px) rotate(-10deg) } - 90% { transform: translate(1px, 0px) rotate(3deg) } - 95% { transform: translate(-2px, 0px) rotate(-3deg) } - 100% { transform: translate(2px, 1px) rotate(2deg) } -} - -@keyframes mfm-rubberBand { - from { transform: scale3d(1, 1, 1); } - 30% { transform: scale3d(1.25, 0.75, 1); } - 40% { transform: scale3d(0.75, 1.25, 1); } - 50% { transform: scale3d(1.15, 0.85, 1); } - 65% { transform: scale3d(0.95, 1.05, 1); } - 75% { transform: scale3d(1.05, 0.95, 1); } - to { transform: scale3d(1, 1, 1); } -} - -@keyframes mfm-rainbow { - 0% { filter: hue-rotate(0deg) contrast(150%) saturate(150%); } - 100% { filter: hue-rotate(360deg) contrast(150%) saturate(150%); } -} diff --git a/packages/frontend-embed/src/theme.ts b/packages/frontend-embed/src/theme.ts deleted file mode 100644 index 4664ad4880..0000000000 --- a/packages/frontend-embed/src/theme.ts +++ /dev/null @@ -1,108 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import tinycolor from 'tinycolor2'; -import lightTheme from '@@/themes/_light.json5'; -import darkTheme from '@@/themes/_dark.json5'; -import type { BundledTheme } from 'shiki/themes'; - -export type Theme = { - id: string; - name: string; - author: string; - desc?: string; - base?: 'dark' | 'light'; - props: Record; - codeHighlighter?: { - base: BundledTheme; - overrides?: Record; - } | { - base: '_none_'; - overrides: Record; - }; -}; - -let timeout: number | null = null; - -export function assertIsTheme(theme: Record): theme is Theme { - return typeof theme === 'object' && theme !== null && 'id' in theme && 'name' in theme && 'author' in theme && 'props' in theme; -} - -export function applyTheme(theme: Theme, persist = true) { - if (timeout) window.clearTimeout(timeout); - - document.documentElement.classList.add('_themeChanging_'); - - timeout = window.setTimeout(() => { - document.documentElement.classList.remove('_themeChanging_'); - }, 1000); - - const colorScheme = theme.base === 'dark' ? 'dark' : 'light'; - - document.documentElement.dataset.colorScheme = colorScheme; - - // Deep copy - const _theme = JSON.parse(JSON.stringify(theme)); - - if (_theme.base) { - const base = [lightTheme, darkTheme].find(x => x.id === _theme.base); - if (base) _theme.props = Object.assign({}, base.props, _theme.props); - } - - const props = compile(_theme); - - for (const tag of document.head.children) { - if (tag.tagName === 'META' && tag.getAttribute('name') === 'theme-color') { - tag.setAttribute('content', props['htmlThemeColor']); - break; - } - } - - for (const [k, v] of Object.entries(props)) { - document.documentElement.style.setProperty(`--MI_THEME-${k}`, v.toString()); - } - - // iframeを正常に透過させるために、cssのcolor-schemeは `light dark;` 固定にしてある。style.scss参照 -} - -function compile(theme: Theme): Record { - function getColor(val: string): tinycolor.Instance { - if (val[0] === '@') { // ref (prop) - return getColor(theme.props[val.substring(1)]); - } else if (val[0] === '$') { // ref (const) - return getColor(theme.props[val]); - } else if (val[0] === ':') { // func - const parts = val.split('<'); - const func = parts.shift().substring(1); - const arg = parseFloat(parts.shift()); - const color = getColor(parts.join('<')); - - switch (func) { - case 'darken': return color.darken(arg); - case 'lighten': return color.lighten(arg); - case 'alpha': return color.setAlpha(arg); - case 'hue': return color.spin(arg); - case 'saturate': return color.saturate(arg); - } - } - - // other case - return tinycolor(val); - } - - const props = {}; - - for (const [k, v] of Object.entries(theme.props)) { - if (k.startsWith('$')) continue; // ignore const - - props[k] = v.startsWith('"') ? v.replace(/^"\s*/, '') : genValue(getColor(v)); - } - - return props; -} - -function genValue(c: tinycolor.Instance): string { - return c.toRgbString(); -} diff --git a/packages/frontend-embed/src/ui.vue b/packages/frontend-embed/src/ui.vue deleted file mode 100644 index 4ba5968a91..0000000000 --- a/packages/frontend-embed/src/ui.vue +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - diff --git a/packages/frontend-embed/src/utils.ts b/packages/frontend-embed/src/utils.ts deleted file mode 100644 index 939648aa38..0000000000 --- a/packages/frontend-embed/src/utils.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import * as Misskey from 'misskey-js'; -import { url } from '@@/js/config.js'; - -export const acct = (user: Misskey.Acct) => { - return Misskey.acct.toString(user); -}; - -export const userName = (user: Misskey.entities.User) => { - return user.name || user.username; -}; - -export const userPage = (user: Misskey.Acct, path?: string, absolute = false) => { - return `${absolute ? url : ''}/@${acct(user)}${(path ? `/${path}` : '')}`; -}; - -export const notePage = (note: Misskey.entities.Note) => { - return `/notes/${note.id}`; -}; diff --git a/packages/frontend-embed/src/workers/draw-blurhash.ts b/packages/frontend-embed/src/workers/draw-blurhash.ts deleted file mode 100644 index 22de6cd3a8..0000000000 --- a/packages/frontend-embed/src/workers/draw-blurhash.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { render } from 'buraha'; - -const canvas = new OffscreenCanvas(64, 64); - -onmessage = (event) => { - // console.log(event.data); - if (!('id' in event.data && typeof event.data.id === 'string')) { - return; - } - if (!('hash' in event.data && typeof event.data.hash === 'string')) { - return; - } - - render(event.data.hash, canvas); - const bitmap = canvas.transferToImageBitmap(); - postMessage({ id: event.data.id, bitmap }); -}; diff --git a/packages/frontend-embed/src/workers/test-webgl2.ts b/packages/frontend-embed/src/workers/test-webgl2.ts deleted file mode 100644 index b203ebe666..0000000000 --- a/packages/frontend-embed/src/workers/test-webgl2.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -const canvas = globalThis.OffscreenCanvas && new OffscreenCanvas(1, 1); -// 環境によってはOffscreenCanvasが存在しないため -// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -const gl = canvas?.getContext('webgl2'); -if (gl) { - postMessage({ result: true }); -} else { - postMessage({ result: false }); -} diff --git a/packages/frontend-embed/src/workers/tsconfig.json b/packages/frontend-embed/src/workers/tsconfig.json deleted file mode 100644 index 8ee8930465..0000000000 --- a/packages/frontend-embed/src/workers/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "lib": ["esnext", "webworker"], - } -} diff --git a/packages/frontend-embed/tsconfig.json b/packages/frontend-embed/tsconfig.json deleted file mode 100644 index 3701343623..0000000000 --- a/packages/frontend-embed/tsconfig.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "compilerOptions": { - "allowJs": true, - "noEmitOnError": false, - "noImplicitAny": false, - "noImplicitReturns": true, - "noUnusedParameters": false, - "noUnusedLocals": false, - "noFallthroughCasesInSwitch": true, - "declaration": false, - "sourceMap": false, - "target": "ES2022", - "module": "nodenext", - "moduleResolution": "nodenext", - "removeComments": false, - "noLib": false, - "strict": true, - "strictNullChecks": true, - "experimentalDecorators": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "useDefineForClassFields": true, - "baseUrl": ".", - "paths": { - "@/*": ["./src/*"], - "@@/*": ["../frontend-shared/*"] - }, - "typeRoots": [ - "./@types", - "./node_modules/@types", - "./node_modules/@vue-macros", - "./node_modules" - ], - "types": [ - "vite/client", - ], - "lib": [ - "esnext", - "dom", - "dom.iterable" - ], - "jsx": "preserve" - }, - "compileOnSave": false, - "include": [ - "./**/*.ts", - "./**/*.vue" - ], - "exclude": [ - ".storybook/**/*" - ] -} diff --git a/packages/frontend-embed/vite.config.local-dev.ts b/packages/frontend-embed/vite.config.local-dev.ts deleted file mode 100644 index bf2f478887..0000000000 --- a/packages/frontend-embed/vite.config.local-dev.ts +++ /dev/null @@ -1,96 +0,0 @@ -import dns from 'dns'; -import { readFile } from 'node:fs/promises'; -import type { IncomingMessage } from 'node:http'; -import { defineConfig } from 'vite'; -import type { UserConfig } from 'vite'; -import * as yaml from 'js-yaml'; -import locales from '../../locales/index.js'; -import { getConfig } from './vite.config.js'; - -dns.setDefaultResultOrder('ipv4first'); - -const defaultConfig = getConfig(); - -const { port } = yaml.load(await readFile('../../.config/default.yml', 'utf-8')); - -const httpUrl = `http://localhost:${port}/`; -const websocketUrl = `ws://localhost:${port}/`; - -// activitypubリクエストはProxyを通し、それ以外はViteの開発サーバーを返す -function varyHandler(req: IncomingMessage) { - if (req.headers.accept?.includes('application/activity+json')) { - return null; - } - return '/index.html'; -} - -const devConfig: UserConfig = { - // 基本の設定は vite.config.js から引き継ぐ - ...defaultConfig, - root: 'src', - publicDir: '../assets', - base: '/embed', - server: { - host: 'localhost', - port: 5174, - proxy: { - '/api': { - changeOrigin: true, - target: httpUrl, - }, - '/assets': httpUrl, - '/static-assets': httpUrl, - '/client-assets': httpUrl, - '/files': httpUrl, - '/twemoji': httpUrl, - '/fluent-emoji': httpUrl, - '/sw.js': httpUrl, - '/streaming': { - target: websocketUrl, - ws: true, - }, - '/favicon.ico': httpUrl, - '/robots.txt': httpUrl, - '/embed.js': httpUrl, - '/identicon': { - target: httpUrl, - rewrite(path) { - return path.replace('@localhost:5173', ''); - }, - }, - '/url': httpUrl, - '/proxy': httpUrl, - '/_info_card_': httpUrl, - '/bios': httpUrl, - '/cli': httpUrl, - '/inbox': httpUrl, - '/emoji/': httpUrl, - '/notes': { - target: httpUrl, - bypass: varyHandler, - }, - '/users': { - target: httpUrl, - bypass: varyHandler, - }, - '/.well-known': { - target: httpUrl, - }, - }, - }, - build: { - ...defaultConfig.build, - rollupOptions: { - ...defaultConfig.build?.rollupOptions, - input: 'index.html', - }, - }, - - define: { - ...defaultConfig.define, - _LANGS_FULL_: JSON.stringify(Object.entries(locales)), - }, -}; - -export default defineConfig(({ command, mode }) => devConfig); - diff --git a/packages/frontend-embed/vite.config.ts b/packages/frontend-embed/vite.config.ts deleted file mode 100644 index 2dbee488c5..0000000000 --- a/packages/frontend-embed/vite.config.ts +++ /dev/null @@ -1,161 +0,0 @@ -import path from 'path'; -import pluginVue from '@vitejs/plugin-vue'; -import { type UserConfig, defineConfig } from 'vite'; - -import locales from '../../locales/index.js'; -import meta from '../../package.json'; -import packageInfo from './package.json' with { type: 'json' }; -import pluginJson5 from './vite.json5.js'; - -const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.json', '.json5', '.svg', '.sass', '.scss', '.css', '.vue']; - -/** - * Misskeyのフロントエンドにバンドルせず、CDNなどから別途読み込むリソースを記述する。 - * CDNを使わずにバンドルしたい場合、以下の配列から該当要素を削除orコメントアウトすればOK - */ -const externalPackages = [ - // shiki(コードブロックのシンタックスハイライトで使用中)はテーマ・言語の定義の容量が大きいため、それらはCDNから読み込む - { - name: 'shiki', - match: /^shiki\/(?(langs|themes))$/, - path(id: string, pattern: RegExp): string { - const match = pattern.exec(id)?.groups; - return match - ? `https://esm.sh/shiki@${packageInfo.dependencies.shiki}/${match['subPkg']}` - : id; - }, - }, -]; - -const hash = (str: string, seed = 0): number => { - let h1 = 0xdeadbeef ^ seed, - h2 = 0x41c6ce57 ^ seed; - for (let i = 0, ch; i < str.length; i++) { - ch = str.charCodeAt(i); - h1 = Math.imul(h1 ^ ch, 2654435761); - h2 = Math.imul(h2 ^ ch, 1597334677); - } - - h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909); - h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909); - - return 4294967296 * (2097151 & h2) + (h1 >>> 0); -}; - -const BASE62_DIGITS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - -function toBase62(n: number): string { - if (n === 0) { - return '0'; - } - let result = ''; - while (n > 0) { - result = BASE62_DIGITS[n % BASE62_DIGITS.length] + result; - n = Math.floor(n / BASE62_DIGITS.length); - } - - return result; -} - -export function getConfig(): UserConfig { - return { - base: '/embed_vite/', - - server: { - port: 5174, - }, - - plugins: [ - pluginVue(), - pluginJson5(), - ], - - resolve: { - extensions, - alias: { - '@/': __dirname + '/src/', - '@@/': __dirname + '/../frontend-shared/', - '/client-assets/': __dirname + '/assets/', - '/static-assets/': __dirname + '/../backend/assets/' - }, - }, - - css: { - modules: { - generateScopedName(name, filename, _css): string { - const id = (path.relative(__dirname, filename.split('?')[0]) + '-' + name).replace(/[\\\/\.\?&=]/g, '-').replace(/(src-|vue-)/g, ''); - if (process.env.NODE_ENV === 'production') { - return 'x' + toBase62(hash(id)).substring(0, 4); - } else { - return id; - } - }, - }, - preprocessorOptions: { - scss: { - api: 'modern-compiler', - }, - }, - }, - - define: { - _VERSION_: JSON.stringify(meta.version), - _LANGS_: JSON.stringify(Object.entries(locales).map(([k, v]) => [k, v._lang_])), - _ENV_: JSON.stringify(process.env.NODE_ENV), - _DEV_: process.env.NODE_ENV !== 'production', - _PERF_PREFIX_: JSON.stringify('Misskey:'), - __VUE_OPTIONS_API__: false, - __VUE_PROD_DEVTOOLS__: false, - }, - - build: { - target: [ - 'chrome116', - 'firefox116', - 'safari16', - ], - manifest: 'manifest.json', - rollupOptions: { - input: { - app: './src/boot.ts', - }, - external: externalPackages.map(p => p.match), - output: { - manualChunks: { - vue: ['vue'], - }, - chunkFileNames: process.env.NODE_ENV === 'production' ? '[hash:8].js' : '[name]-[hash:8].js', - assetFileNames: process.env.NODE_ENV === 'production' ? '[hash:8][extname]' : '[name]-[hash:8][extname]', - paths(id) { - for (const p of externalPackages) { - if (p.match.test(id)) { - return p.path(id, p.match); - } - } - - return id; - }, - }, - }, - cssCodeSplit: true, - outDir: __dirname + '/../../built/_frontend_embed_vite_', - assetsDir: '.', - emptyOutDir: false, - sourcemap: process.env.NODE_ENV === 'development', - reportCompressedSize: false, - - // https://vitejs.dev/guide/dep-pre-bundling.html#monorepos-and-linked-dependencies - commonjsOptions: { - include: [/misskey-js/, /node_modules/], - }, - }, - - worker: { - format: 'es', - }, - }; -} - -const config = defineConfig(({ command, mode }) => getConfig()); - -export default config; diff --git a/packages/frontend-embed/vite.json5.ts b/packages/frontend-embed/vite.json5.ts deleted file mode 100644 index 87b67c2142..0000000000 --- a/packages/frontend-embed/vite.json5.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Original: https://github.com/rollup/plugins/tree/8835dd2aed92f408d7dc72d7cc25a9728e16face/packages/json - -import JSON5 from 'json5'; -import { Plugin } from 'rollup'; -import { createFilter, dataToEsm } from '@rollup/pluginutils'; -import { RollupJsonOptions } from '@rollup/plugin-json'; - -// json5 extends SyntaxError with additional fields (without subclassing) -// https://github.com/json5/json5/blob/de344f0619bda1465a6e25c76f1c0c3dda8108d9/lib/parse.js#L1111-L1112 -interface Json5SyntaxError extends SyntaxError { - lineNumber: number; - columnNumber: number; -} - -export default function json5(options: RollupJsonOptions = {}): Plugin { - const filter = createFilter(options.include, options.exclude); - const indent = 'indent' in options ? options.indent : '\t'; - - return { - name: 'json5', - - // eslint-disable-next-line no-shadow - transform(json, id) { - if (id.slice(-6) !== '.json5' || !filter(id)) return null; - - try { - const parsed = JSON5.parse(json); - return { - code: dataToEsm(parsed, { - preferConst: options.preferConst, - compact: options.compact, - namedExports: options.namedExports, - indent, - }), - map: { mappings: '' }, - }; - } catch (err) { - if (!(err instanceof SyntaxError)) { - throw err; - } - const message = 'Could not parse JSON5 file'; - const { lineNumber, columnNumber } = err as Json5SyntaxError; - this.warn({ message, id, loc: { line: lineNumber, column: columnNumber } }); - return null; - } - }, - }; -} diff --git a/packages/frontend-embed/vue-shims.d.ts b/packages/frontend-embed/vue-shims.d.ts deleted file mode 100644 index eba994772d..0000000000 --- a/packages/frontend-embed/vue-shims.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* eslint-disable */ -declare module "*.vue" { - import { defineComponent } from "vue"; - const component: ReturnType; - export default component; -} diff --git a/packages/frontend-shared/.gitignore b/packages/frontend-shared/.gitignore deleted file mode 100644 index 5f6be09d7c..0000000000 --- a/packages/frontend-shared/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/storybook-static -js-built diff --git a/packages/frontend-shared/@types/global.d.ts b/packages/frontend-shared/@types/global.d.ts deleted file mode 100644 index 4b8d679e75..0000000000 --- a/packages/frontend-shared/@types/global.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -type FIXME = any; - -declare const _LANGS_: string[][]; -declare const _VERSION_: string; -declare const _ENV_: string; -declare const _DEV_: boolean; -declare const _PERF_PREFIX_: string; -declare const _DATA_TRANSFER_DRIVE_FILE_: string; -declare const _DATA_TRANSFER_DRIVE_FOLDER_: string; -declare const _DATA_TRANSFER_DECK_COLUMN_: string; - -// for dev-mode -declare const _LANGS_FULL_: string[][]; - -// TagCanvas -interface Window { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - TagCanvas: any; -} diff --git a/packages/frontend-shared/build.js b/packages/frontend-shared/build.js deleted file mode 100644 index 17b6da8d30..0000000000 --- a/packages/frontend-shared/build.js +++ /dev/null @@ -1,106 +0,0 @@ -import fs from 'node:fs'; -import { fileURLToPath } from 'node:url'; -import { dirname } from 'node:path'; -import * as esbuild from 'esbuild'; -import { build } from 'esbuild'; -import { globSync } from 'glob'; -import { execa } from 'execa'; - -const _filename = fileURLToPath(import.meta.url); -const _dirname = dirname(_filename); -const _package = JSON.parse(fs.readFileSync(_dirname + '/package.json', 'utf-8')); - -const entryPoints = globSync('./js/**/**.{ts,tsx}'); - -/** @type {import('esbuild').BuildOptions} */ -const options = { - entryPoints, - minify: process.env.NODE_ENV === 'production', - outdir: './js-built', - target: 'es2022', - platform: 'browser', - format: 'esm', - sourcemap: 'linked', -}; - -// js-built配下をすべて削除する -fs.rmSync('./js-built', { recursive: true, force: true }); - -if (process.argv.map(arg => arg.toLowerCase()).includes('--watch')) { - await watchSrc(); -} else { - await buildSrc(); -} - -async function buildSrc() { - console.log(`[${_package.name}] start building...`); - - await build(options) - .then(() => { - console.log(`[${_package.name}] build succeeded.`); - }) - .catch((err) => { - process.stderr.write(err.stderr); - process.exit(1); - }); - - if (process.env.NODE_ENV === 'production') { - console.log(`[${_package.name}] skip building d.ts because NODE_ENV is production.`); - } else { - await buildDts(); - } - - fs.copyFileSync('./js/emojilist.json', './js-built/emojilist.json'); - - console.log(`[${_package.name}] finish building.`); -} - -function buildDts() { - return execa( - 'tsc', - [ - '--project', 'tsconfig.json', - '--outDir', 'js-built', - '--declaration', 'true', - '--emitDeclarationOnly', 'true', - ], - { - stdout: process.stdout, - stderr: process.stderr, - }, - ); -} - -async function watchSrc() { - const plugins = [{ - name: 'gen-dts', - setup(build) { - build.onStart(() => { - console.log(`[${_package.name}] detect changed...`); - }); - build.onEnd(async result => { - if (result.errors.length > 0) { - console.error(`[${_package.name}] watch build failed:`, result); - return; - } - await buildDts(); - }); - }, - }]; - - console.log(`[${_package.name}] start watching...`); - - const context = await esbuild.context({ ...options, plugins }); - await context.watch(); - - await new Promise((resolve, reject) => { - process.on('SIGHUP', resolve); - process.on('SIGINT', resolve); - process.on('SIGTERM', resolve); - process.on('uncaughtException', reject); - process.on('exit', resolve); - }).finally(async () => { - await context.dispose(); - console.log(`[${_package.name}] finish watching.`); - }); -} diff --git a/packages/frontend-shared/eslint.config.js b/packages/frontend-shared/eslint.config.js deleted file mode 100644 index cd4641a270..0000000000 --- a/packages/frontend-shared/eslint.config.js +++ /dev/null @@ -1,100 +0,0 @@ -import globals from 'globals'; -import tsParser from '@typescript-eslint/parser'; -import parser from 'vue-eslint-parser'; -import pluginVue from 'eslint-plugin-vue'; -import pluginMisskey from '@misskey-dev/eslint-plugin'; -import sharedConfig from '../shared/eslint.config.js'; - -// eslint-disable-next-line import/no-default-export -export default [ - ...sharedConfig, - { - files: ['**/*.vue'], - ...pluginMisskey.configs.typescript, - }, - ...pluginVue.configs['flat/recommended'], - { - files: [ - '@types/**/*.ts', - 'js/**/*.ts', - '**/*.vue', - ], - languageOptions: { - globals: { - ...Object.fromEntries(Object.entries(globals.node).map(([key]) => [key, 'off'])), - ...globals.browser, - - // Node.js - module: false, - require: false, - __dirname: false, - - // Misskey - _DEV_: false, - _LANGS_: false, - _VERSION_: false, - _ENV_: false, - _PERF_PREFIX_: false, - _DATA_TRANSFER_DRIVE_FILE_: false, - _DATA_TRANSFER_DRIVE_FOLDER_: false, - _DATA_TRANSFER_DECK_COLUMN_: false, - }, - parser, - parserOptions: { - extraFileExtensions: ['.vue'], - parser: tsParser, - project: ['./tsconfig.json'], - sourceType: 'module', - tsconfigRootDir: import.meta.dirname, - }, - }, - rules: { - '@typescript-eslint/no-empty-interface': ['error', { - allowSingleExtends: true, - }], - // window の禁止理由: グローバルスコープと衝突し、予期せぬ結果を招くため - // e の禁止理由: error や event など、複数のキーワードの頭文字であり分かりにくいため - 'id-denylist': ['error', 'window', 'e'], - 'no-shadow': ['warn'], - 'vue/attributes-order': ['error', { - alphabetical: false, - }], - 'vue/no-use-v-if-with-v-for': ['error', { - allowUsingIterationVar: false, - }], - 'vue/no-ref-as-operand': 'error', - 'vue/no-multi-spaces': ['error', { - ignoreProperties: false, - }], - 'vue/no-v-html': 'warn', - 'vue/order-in-components': 'error', - 'vue/html-indent': ['warn', 'tab', { - attribute: 1, - baseIndent: 0, - closeBracket: 0, - alignAttributesVertically: true, - ignores: [], - }], - 'vue/html-closing-bracket-spacing': ['warn', { - startTag: 'never', - endTag: 'never', - selfClosingTag: 'never', - }], - 'vue/multi-word-component-names': 'warn', - 'vue/require-v-for-key': 'warn', - 'vue/no-unused-components': 'warn', - 'vue/no-unused-vars': 'warn', - 'vue/no-dupe-keys': 'warn', - 'vue/valid-v-for': 'warn', - 'vue/return-in-computed-property': 'warn', - 'vue/no-setup-props-reactivity-loss': 'warn', - 'vue/max-attributes-per-line': 'off', - 'vue/html-self-closing': 'off', - 'vue/singleline-html-element-content-newline': 'off', - 'vue/v-on-event-hyphenation': ['error', 'never', { - autofix: true, - }], - 'vue/attribute-hyphenation': ['error', 'never'], - }, - }, -]; diff --git a/packages/frontend-shared/js/collapsed.ts b/packages/frontend-shared/js/collapsed.ts deleted file mode 100644 index af1f88cb73..0000000000 --- a/packages/frontend-shared/js/collapsed.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import * as Misskey from 'misskey-js'; - -export function shouldCollapsed(note: Misskey.entities.Note, urls: string[]): boolean { - const collapsed = note.cw == null && ( - (note.text != null && ( - (note.text.includes('$[x2')) || - (note.text.includes('$[x3')) || - (note.text.includes('$[x4')) || - (note.text.includes('$[scale')) || - (note.text.split('\n').length > 9) || - (note.text.length > 500) || - (urls.length >= 4) - )) || (note.files != null && note.files.length >= 5) - ); - - return collapsed; -} diff --git a/packages/frontend-shared/js/config.ts b/packages/frontend-shared/js/config.ts deleted file mode 100644 index ae1dcae10b..0000000000 --- a/packages/frontend-shared/js/config.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import type { Locale } from '../../../locales/index.js'; - -// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -const address = new URL(document.querySelector('meta[property="instance_url"]')?.content || location.href); -const siteName = document.querySelector('meta[property="og:site_name"]')?.content; - -export const host = address.host; -export const hostname = address.hostname; -export const url = address.origin; -export const apiUrl = location.origin + '/api'; -export const wsOrigin = location.origin; -export const lang = localStorage.getItem('lang') ?? 'en-US'; -export const langs = _LANGS_; -const preParseLocale = localStorage.getItem('locale'); -export let locale: Locale = preParseLocale ? JSON.parse(preParseLocale) : null; -export const version = _VERSION_; -export const instanceName = (siteName === 'Misskey' || siteName == null) ? host : siteName; -export const ui = localStorage.getItem('ui'); -export const debug = localStorage.getItem('debug') === 'true'; - -export function updateLocale(newLocale: Locale): void { - locale = newLocale; -} diff --git a/packages/frontend-shared/js/embed-page.ts b/packages/frontend-shared/js/embed-page.ts deleted file mode 100644 index d5555a98c3..0000000000 --- a/packages/frontend-shared/js/embed-page.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -//#region Embed関連の定義 - -/** 埋め込みの対象となるエンティティ(/embed/xxx の xxx の部分と対応させる) */ -const embeddableEntities = [ - 'notes', - 'user-timeline', - 'clips', - 'tags', -] as const; - -/** 埋め込みの対象となるエンティティ */ -export type EmbeddableEntity = typeof embeddableEntities[number]; - -/** 内部でスクロールがあるページ */ -export const embedRouteWithScrollbar: EmbeddableEntity[] = [ - 'clips', - 'tags', - 'user-timeline', -]; - -/** 埋め込みコードのパラメータ */ -export type EmbedParams = { - maxHeight?: number; - colorMode?: 'light' | 'dark'; - rounded?: boolean; - border?: boolean; - autoload?: boolean; - header?: boolean; -}; - -/** 正規化されたパラメータ */ -export type ParsedEmbedParams = Required> & Pick; - -/** パラメータのデフォルトの値 */ -export const defaultEmbedParams = { - maxHeight: undefined, - colorMode: undefined, - rounded: true, - border: true, - autoload: false, - header: true, -} as const satisfies EmbedParams; - -//#endregion - -/** - * パラメータを正規化する(埋め込みページ初期化用) - * @param searchParams URLSearchParamsもしくはクエリ文字列 - * @returns 正規化されたパラメータ - */ -export function parseEmbedParams(searchParams: URLSearchParams | string): ParsedEmbedParams { - let _searchParams: URLSearchParams; - if (typeof searchParams === 'string') { - _searchParams = new URLSearchParams(searchParams); - } else if (searchParams instanceof URLSearchParams) { - _searchParams = searchParams; - } else { - throw new Error('searchParams must be URLSearchParams or string'); - } - - function convertBoolean(value: string | null): boolean | undefined { - if (value === 'true') { - return true; - } else if (value === 'false') { - return false; - } - return undefined; - } - - function convertNumber(value: string | null): number | undefined { - if (value != null && !isNaN(Number(value))) { - return Number(value); - } - return undefined; - } - - function convertColorMode(value: string | null): 'light' | 'dark' | undefined { - if (value != null && ['light', 'dark'].includes(value)) { - return value as 'light' | 'dark'; - } - return undefined; - } - - return { - maxHeight: convertNumber(_searchParams.get('maxHeight')) ?? defaultEmbedParams.maxHeight, - colorMode: convertColorMode(_searchParams.get('colorMode')) ?? defaultEmbedParams.colorMode, - rounded: convertBoolean(_searchParams.get('rounded')) ?? defaultEmbedParams.rounded, - border: convertBoolean(_searchParams.get('border')) ?? defaultEmbedParams.border, - autoload: convertBoolean(_searchParams.get('autoload')) ?? defaultEmbedParams.autoload, - header: convertBoolean(_searchParams.get('header')) ?? defaultEmbedParams.header, - }; -} diff --git a/packages/frontend-shared/js/emojilist.ts b/packages/frontend-shared/js/emojilist.ts deleted file mode 100644 index bde30a864f..0000000000 --- a/packages/frontend-shared/js/emojilist.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export const unicodeEmojiCategories = ['face', 'people', 'animals_and_nature', 'food_and_drink', 'activity', 'travel_and_places', 'objects', 'symbols', 'flags'] as const; - -export type UnicodeEmojiDef = { - name: string; - char: string; - category: typeof unicodeEmojiCategories[number]; -} - -// initial converted from https://github.com/muan/emojilib/commit/242fe68be86ed6536843b83f7e32f376468b38fb -import _emojilist from './emojilist.json'; - -export const emojilist: UnicodeEmojiDef[] = _emojilist.map(x => ({ - name: x[1] as string, - char: x[0] as string, - category: unicodeEmojiCategories[x[2] as number], -})); - -const unicodeEmojisMap = new Map( - emojilist.map(x => [x.char, x]), -); - -const _indexByChar = new Map(); -const _charGroupByCategory = new Map(); -for (let i = 0; i < emojilist.length; i++) { - const emo = emojilist[i]; - _indexByChar.set(emo.char, i); - - if (_charGroupByCategory.has(emo.category)) { - _charGroupByCategory.get(emo.category)?.push(emo.char); - } else { - _charGroupByCategory.set(emo.category, [emo.char]); - } -} - -export const emojiCharByCategory = _charGroupByCategory; - -export function getUnicodeEmoji(char: string): UnicodeEmojiDef | string { - // Colorize it because emojilist.json assumes that - return unicodeEmojisMap.get(colorizeEmoji(char)) - // カラースタイル絵文字がjsonに無い場合はテキストスタイル絵文字にフォールバックする - ?? unicodeEmojisMap.get(char) - // それでも見つからない場合はそのまま返す(絵文字情報がjsonに無い場合、このフォールバックが無いとレンダリングに失敗する) - ?? char; -} - -export function getEmojiName(char: string): string { - // Colorize it because emojilist.json assumes that - const idx = _indexByChar.get(colorizeEmoji(char)) ?? _indexByChar.get(char); - if (idx === undefined) { - // 絵文字情報がjsonに無い場合は名前の取得が出来ないのでそのまま返すしか無い - return char; - } else { - return emojilist[idx].name; - } -} - -/** - * テキストスタイル絵文字(U+260Eなどの1文字で表現される絵文字)をカラースタイル絵文字に変換します(VS16:U+FE0Fを付与)。 - */ -export function colorizeEmoji(char: string) { - return char.length === 1 ? `${char}\uFE0F` : char; -} - -export interface CustomEmojiFolderTree { - value: string; - category: string; - children: CustomEmojiFolderTree[]; -} diff --git a/packages/frontend-shared/js/i18n.ts b/packages/frontend-shared/js/i18n.ts deleted file mode 100644 index 18232691fa..0000000000 --- a/packages/frontend-shared/js/i18n.ts +++ /dev/null @@ -1,251 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ -import type { ILocale, ParameterizedString } from '../../../locales/index.js'; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -type TODO = any; - -type FlattenKeys = keyof { - [K in keyof T as T[K] extends ILocale - ? FlattenKeys extends infer C extends string - ? `${K & string}.${C}` - : never - : T[K] extends TPrediction - ? K - : never]: T[K]; -}; - -type ParametersOf> = TKey extends `${infer K}.${infer C}` - // @ts-expect-error -- C は明らかに FlattenKeys になるが、型システムはここでは TKey がドット区切りであることのコンテキストを持たないので、型システムに合法にて示すことはできない。 - ? ParametersOf - : TKey extends keyof T - ? T[TKey] extends ParameterizedString - ? P - : never - : never; - -type Tsx = { - readonly [K in keyof T as T[K] extends string ? never : K]: T[K] extends ParameterizedString - ? (arg: { readonly [_ in P]: string | number }) => string - // @ts-expect-error -- 証明省略 - : Tsx; -}; - -export class I18n { - private tsxCache?: Tsx; - private devMode: boolean; - - constructor(public locale: T, devMode = false) { - this.devMode = devMode; - - //#region BIND - this.t = this.t.bind(this); - //#endregion - } - - public get ts(): T { - if (this.devMode) { - class Handler implements ProxyHandler { - get(target: TTarget, p: string | symbol): unknown { - const value = target[p as keyof TTarget]; - - if (typeof value === 'object') { - return new Proxy(value, new Handler()); - } - - if (typeof value === 'string') { - const parameters = Array.from(value.matchAll(/\{(\w+)\}/g), ([, parameter]) => parameter); - - if (parameters.length) { - console.error(`Missing locale parameters: ${parameters.join(', ')} at ${String(p)}`); - } - - return value; - } - - console.error(`Unexpected locale key: ${String(p)}`); - - return p; - } - } - - return new Proxy(this.locale, new Handler()); - } - - return this.locale; - } - - public get tsx(): Tsx { - if (this.devMode) { - if (this.tsxCache) { - return this.tsxCache; - } - - class Handler implements ProxyHandler { - get(target: TTarget, p: string | symbol): unknown { - const value = target[p as keyof TTarget]; - - if (typeof value === 'object') { - return new Proxy(value, new Handler()); - } - - if (typeof value === 'string') { - const quasis: string[] = []; - const expressions: string[] = []; - let cursor = 0; - - while (~cursor) { - const start = value.indexOf('{', cursor); - - if (!~start) { - quasis.push(value.slice(cursor)); - break; - } - - quasis.push(value.slice(cursor, start)); - - const end = value.indexOf('}', start); - - expressions.push(value.slice(start + 1, end)); - - cursor = end + 1; - } - - if (!expressions.length) { - console.error(`Unexpected locale key: ${String(p)}`); - - return () => value; - } - - return (arg: TODO) => { - let str = quasis[0]; - - for (let i = 0; i < expressions.length; i++) { - if (!Object.hasOwn(arg, expressions[i])) { - console.error(`Missing locale parameters: ${expressions[i]} at ${String(p)}`); - } - - str += arg[expressions[i]] + quasis[i + 1]; - } - - return str; - }; - } - - console.error(`Unexpected locale key: ${String(p)}`); - - return p; - } - } - - return this.tsxCache = new Proxy(this.locale, new Handler()) as unknown as Tsx; - } - - if (this.tsxCache) { - return this.tsxCache; - } - - function build(target: ILocale): Tsx { - const result = {} as Tsx; - - for (const k in target) { - if (!Object.hasOwn(target, k)) { - continue; - } - - const value = target[k as keyof typeof target]; - - if (typeof value === 'object') { - (result as TODO)[k] = build(value as ILocale); - } else if (typeof value === 'string') { - const quasis: string[] = []; - const expressions: string[] = []; - let cursor = 0; - - while (~cursor) { - const start = value.indexOf('{', cursor); - - if (!~start) { - quasis.push(value.slice(cursor)); - break; - } - - quasis.push(value.slice(cursor, start)); - - const end = value.indexOf('}', start); - - expressions.push(value.slice(start + 1, end)); - - cursor = end + 1; - } - - if (!expressions.length) { - continue; - } - - (result as TODO)[k] = (arg: TODO) => { - let str = quasis[0]; - - for (let i = 0; i < expressions.length; i++) { - str += arg[expressions[i]] + quasis[i + 1]; - } - - return str; - }; - } - } - return result; - } - - return this.tsxCache = build(this.locale); - } - - /** - * @deprecated なるべくこのメソッド使うよりも ts 直接参照の方が vue のキャッシュ効いてパフォーマンスが良いかも - */ - public t>(key: TKey): string; - /** - * @deprecated なるべくこのメソッド使うよりも tsx 直接参照の方が vue のキャッシュ効いてパフォーマンスが良いかも - */ - public t>(key: TKey, args: { readonly [_ in ParametersOf]: string | number }): string; - public t(key: string, args?: { readonly [_: string]: string | number }) { - let str: string | ParameterizedString | ILocale = this.locale; - - for (const k of key.split('.')) { - str = (str as TODO)[k]; - - if (this.devMode) { - if (typeof str === 'undefined') { - console.error(`Unexpected locale key: ${key}`); - return key; - } - } - } - - if (args) { - if (this.devMode) { - const missing = Array.from((str as string).matchAll(/\{(\w+)\}/g), ([, parameter]) => parameter).filter(parameter => !Object.hasOwn(args, parameter)); - - if (missing.length) { - console.error(`Missing locale parameters: ${missing.join(', ')} at ${key}`); - } - } - - for (const [k, v] of Object.entries(args)) { - const search = `{${k}}`; - - if (this.devMode) { - if (!(str as string).includes(search)) { - console.error(`Unexpected locale parameter: ${k} at ${key}`); - } - } - - str = (str as string).replace(search, v.toString()); - } - } - - return str; - } -} diff --git a/packages/frontend-shared/js/intl-const.ts b/packages/frontend-shared/js/intl-const.ts deleted file mode 100644 index 33b65b6e9b..0000000000 --- a/packages/frontend-shared/js/intl-const.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { lang } from '@@/js/config.js'; - -// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -export const versatileLang = (lang ?? 'ja-JP').replace('ja-KS', 'ja-JP'); - -let _dateTimeFormat: Intl.DateTimeFormat; -try { - _dateTimeFormat = new Intl.DateTimeFormat(versatileLang, { - year: 'numeric', - month: 'numeric', - day: 'numeric', - hour: 'numeric', - minute: 'numeric', - second: 'numeric', - }); -} catch (err) { - console.warn(err); - if (_DEV_) console.log('[Intl] Fallback to en-US'); - - // Fallback to en-US - _dateTimeFormat = new Intl.DateTimeFormat('en-US', { - year: 'numeric', - month: 'numeric', - day: 'numeric', - hour: 'numeric', - minute: 'numeric', - second: 'numeric', - }); -} -export const dateTimeFormat = _dateTimeFormat; - -export const timeZone = dateTimeFormat.resolvedOptions().timeZone; - -export const hemisphere = /^(australia|pacific|antarctica|indian)\//i.test(timeZone) ? 'S' : 'N'; - -let _numberFormat: Intl.NumberFormat; -try { - _numberFormat = new Intl.NumberFormat(versatileLang); -} catch (err) { - console.warn(err); - if (_DEV_) console.log('[Intl] Fallback to en-US'); - - // Fallback to en-US - _numberFormat = new Intl.NumberFormat('en-US'); -} -export const numberFormat = _numberFormat; diff --git a/packages/frontend-shared/js/is-link.ts b/packages/frontend-shared/js/is-link.ts deleted file mode 100644 index 946f86400e..0000000000 --- a/packages/frontend-shared/js/is-link.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export function isLink(el: HTMLElement) { - if (el.tagName === 'A') return true; - if (el.parentElement) { - return isLink(el.parentElement); - } - return false; -} diff --git a/packages/frontend-shared/js/media-proxy.ts b/packages/frontend-shared/js/media-proxy.ts deleted file mode 100644 index 2837870c9a..0000000000 --- a/packages/frontend-shared/js/media-proxy.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import * as Misskey from 'misskey-js'; -import { query } from './url.js'; - -export class MediaProxy { - private serverMetadata: Misskey.entities.MetaDetailed; - private url: string; - - constructor(serverMetadata: Misskey.entities.MetaDetailed, url: string) { - this.serverMetadata = serverMetadata; - this.url = url; - } - - public getProxiedImageUrl(imageUrl: string, type?: 'preview' | 'emoji' | 'avatar', mustOrigin = false, noFallback = false): string { - const localProxy = `${this.url}/proxy`; - let _imageUrl = imageUrl; - - if (imageUrl.startsWith(this.serverMetadata.mediaProxy + '/') || imageUrl.startsWith('/proxy/') || imageUrl.startsWith(localProxy + '/')) { - // もう既にproxyっぽそうだったらurlを取り出す - _imageUrl = (new URL(imageUrl)).searchParams.get('url') ?? imageUrl; - } - - return `${mustOrigin ? localProxy : this.serverMetadata.mediaProxy}/${ - type === 'preview' ? 'preview.webp' - : 'image.webp' - }?${query({ - url: _imageUrl, - ...(!noFallback ? { 'fallback': '1' } : {}), - ...(type ? { [type]: '1' } : {}), - ...(mustOrigin ? { origin: '1' } : {}), - })}`; - } - - public getProxiedImageUrlNullable(imageUrl: string | null | undefined, type?: 'preview'): string | null { - if (imageUrl == null) return null; - return this.getProxiedImageUrl(imageUrl, type); - } - - public getStaticImageUrl(baseUrl: string): string { - const u = baseUrl.startsWith('http') ? new URL(baseUrl) : new URL(baseUrl, this.url); - - if (u.href.startsWith(`${this.url}/emoji/`)) { - // もう既にemojiっぽそうだったらsearchParams付けるだけ - u.searchParams.set('static', '1'); - return u.href; - } - - if (u.href.startsWith(this.serverMetadata.mediaProxy + '/')) { - // もう既にproxyっぽそうだったらsearchParams付けるだけ - u.searchParams.set('static', '1'); - return u.href; - } - - return `${this.serverMetadata.mediaProxy}/static.webp?${query({ - url: u.href, - static: '1', - })}`; - } -} diff --git a/packages/frontend-shared/package.json b/packages/frontend-shared/package.json deleted file mode 100644 index 9981d10dd2..0000000000 --- a/packages/frontend-shared/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "frontend-shared", - "type": "module", - "main": "./js-built/index.js", - "types": "./js-built/index.d.ts", - "exports": { - ".": { - "import": "./js-built/index.js", - "types": "./js-built/index.d.ts" - }, - "./*": { - "import": "./js-built/*", - "types": "./js-built/*" - } - }, - "scripts": { - "build": "node ./build.js", - "watch": "nodemon -w package.json -e json --exec \"node ./build.js --watch\"", - "eslint": "eslint './**/*.{js,jsx,ts,tsx}'", - "typecheck": "tsc --noEmit", - "lint": "pnpm typecheck && pnpm eslint" - }, - "devDependencies": { - "@types/node": "20.14.12", - "@typescript-eslint/eslint-plugin": "7.17.0", - "@typescript-eslint/parser": "7.17.0", - "esbuild": "0.23.0", - "eslint-plugin-vue": "9.27.0", - "typescript": "5.5.4", - "vue-eslint-parser": "9.4.3" - }, - "files": [ - "js-built" - ], - "dependencies": { - "misskey-js": "workspace:*", - "vue": "3.4.37" - } -} diff --git a/packages/frontend-shared/tsconfig.json b/packages/frontend-shared/tsconfig.json deleted file mode 100644 index 09a8ff76aa..0000000000 --- a/packages/frontend-shared/tsconfig.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "compilerOptions": { - "target": "ES2022", - "module": "nodenext", - "moduleResolution": "nodenext", - "declaration": true, - "declarationMap": true, - "sourceMap": false, - "outDir": "./js-built/", - "removeComments": true, - "resolveJsonModule": true, - "strict": true, - "strictFunctionTypes": true, - "strictNullChecks": true, - "experimentalDecorators": true, - "noImplicitReturns": true, - "esModuleInterop": true, - "baseUrl": ".", - "paths": { - "@/*": ["./*"], - "@@/*": ["./*"] - }, - "typeRoots": [ - "./@types", - "./node_modules/@types" - ], - "lib": [ - "esnext", - "dom" - ] - }, - "include": [ - "@types/**/*.ts", - "js/**/*" - ], - "exclude": [ - "node_modules", - "test/**/*" - ] -} diff --git a/packages/frontend/.eslintrc.cjs b/packages/frontend/.eslintrc.cjs new file mode 100644 index 0000000000..20f88dc078 --- /dev/null +++ b/packages/frontend/.eslintrc.cjs @@ -0,0 +1,82 @@ +module.exports = { + root: true, + env: { + 'node': false, + }, + parser: 'vue-eslint-parser', + parserOptions: { + 'parser': '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: ['./tsconfig.json'], + extraFileExtensions: ['.vue'], + }, + extends: [ + '../shared/.eslintrc.js', + 'plugin:vue/vue3-recommended', + ], + rules: { + '@typescript-eslint/no-empty-interface': [ + 'error', + { + 'allowSingleExtends': true, + }, + ], + // window の禁止理由: グローバルスコープと衝突し、予期せぬ結果を招くため + // e の禁止理由: error や event など、複数のキーワードの頭文字であり分かりにくいため + 'id-denylist': ['error', 'window', 'e'], + 'no-shadow': ['warn'], + 'vue/attributes-order': ['error', { + 'alphabetical': false, + }], + 'vue/no-use-v-if-with-v-for': ['error', { + 'allowUsingIterationVar': false, + }], + 'vue/no-ref-as-operand': 'error', + 'vue/no-multi-spaces': ['error', { + 'ignoreProperties': false, + }], + 'vue/no-v-html': 'warn', + 'vue/order-in-components': 'error', + 'vue/html-indent': ['warn', 'tab', { + 'attribute': 1, + 'baseIndent': 0, + 'closeBracket': 0, + 'alignAttributesVertically': true, + 'ignores': [], + }], + 'vue/html-closing-bracket-spacing': ['warn', { + 'startTag': 'never', + 'endTag': 'never', + 'selfClosingTag': 'never', + }], + 'vue/multi-word-component-names': 'warn', + 'vue/require-v-for-key': 'warn', + 'vue/no-unused-components': 'warn', + 'vue/no-unused-vars': 'warn', + 'vue/no-dupe-keys': 'warn', + 'vue/valid-v-for': 'warn', + 'vue/return-in-computed-property': 'warn', + 'vue/no-setup-props-destructure': 'warn', + 'vue/max-attributes-per-line': 'off', + 'vue/html-self-closing': 'off', + 'vue/singleline-html-element-content-newline': 'off', + 'vue/v-on-event-hyphenation': ['error', 'never', { autofix: true }], + 'vue/attribute-hyphenation': ['error', 'never'], + }, + globals: { + // Node.js + 'module': false, + 'require': false, + '__dirname': false, + + // Misskey + '_DEV_': false, + '_LANGS_': false, + '_VERSION_': false, + '_ENV_': false, + '_PERF_PREFIX_': false, + '_DATA_TRANSFER_DRIVE_FILE_': false, + '_DATA_TRANSFER_DRIVE_FOLDER_': false, + '_DATA_TRANSFER_DECK_COLUMN_': false, + }, +}; diff --git a/packages/frontend/.storybook/changes.ts b/packages/frontend/.storybook/changes.ts index 1299910499..0cc648fbae 100644 --- a/packages/frontend/.storybook/changes.ts +++ b/packages/frontend/.storybook/changes.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -47,12 +47,14 @@ await fs.readFile( ) ) .map((path) => path.replace(/(?:(?<=\.stories)\.(?:impl|meta)|\.msw)(?=\.ts$)/g, '')) + .map((path) => (path.startsWith('.') ? path : `./${path}`)) ); if ( micromatch(Array.from(modules), [ '../../assets/**', '../../fluent-emojis/**', '../../locales/ja-JP.yml', + '../../misskey-assets/**', 'assets/**', 'public/**', '../../pnpm-lock.yaml', diff --git a/packages/frontend/.storybook/charts.ts b/packages/frontend/.storybook/charts.ts deleted file mode 100644 index 5015012a82..0000000000 --- a/packages/frontend/.storybook/charts.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { DefaultBodyType, HttpResponse, HttpResponseResolver, JsonBodyType, PathParams, http } from 'msw'; -import seedrandom from 'seedrandom'; -import { action } from '@storybook/addon-actions'; - -function getChartArray(seed: string, limit: number, option?: { accumulate?: boolean, mul?: number }): number[] { - const rng = seedrandom(seed); - const max = Math.floor(option?.mul ?? 250 * rng()); - let accumulation = 0; - const array: number[] = []; - for (let i = 0; i < limit; i++) { - const num = Math.floor((max + 1) * rng()); - if (option?.accumulate) { - accumulation += num; - array.unshift(accumulation); - } else { - array.push(num); - } - } - return array; -} - -export function getChartResolver(fields: string[], option?: { accumulate?: boolean, mulMap?: Record }): HttpResponseResolver { - return ({ request }) => { - action(`GET ${request.url}`)(); - const limitParam = new URL(request.url).searchParams.get('limit'); - const limit = limitParam ? parseInt(limitParam) : 30; - const res = {}; - for (const field of fields) { - const layers = field.split('.'); - let current = res; - while (layers.length > 1) { - const currentKey = layers.shift()!; - if (current[currentKey] == null) current[currentKey] = {}; - current = current[currentKey]; - } - current[layers[0]] = getChartArray(field, limit, { - accumulate: option?.accumulate, - mul: option?.mulMap != null && field in option.mulMap ? option.mulMap[field] : undefined, - }); - } - return HttpResponse.json(res); - }; -} diff --git a/packages/frontend/.storybook/fakes.ts b/packages/frontend/.storybook/fakes.ts index fc3b0334e4..2960489c77 100644 --- a/packages/frontend/.storybook/fakes.ts +++ b/packages/frontend/.storybook/fakes.ts @@ -1,9 +1,8 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { AISCRIPT_VERSION } from '@syuilo/aiscript'; import type { entities } from 'misskey-js' export function abuseUserReport() { @@ -23,61 +22,12 @@ export function abuseUserReport() { }; } -export function channel(id = 'somechannelid', name = 'Some Channel', bannerUrl: string | null = 'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/fedi.jpg?raw=true'): entities.Channel { - return { - id, - createdAt: '2016-12-28T22:49:51.000Z', - lastNotedAt: '2016-12-28T22:49:51.000Z', - name, - description: null, - userId: null, - bannerUrl, - pinnedNoteIds: [], - color: '#000', - isArchived: false, - usersCount: 1, - notesCount: 1, - isSensitive: false, - allowRenoteToExternal: false, - }; -} - -export function clip(id = 'someclipid', name = 'Some Clip'): entities.Clip { - return { - id, - createdAt: '2016-12-28T22:49:51.000Z', - lastClippedAt: null, - userId: 'someuserid', - user: userLite(), - notesCount: undefined, - name, - description: 'Some clip description', - isPublic: false, - favoritedCount: 0, - }; -} - -export function emojiDetailed(id = 'someemojiid', name = 'some_emoji'): entities.EmojiDetailed { - return { - id, - aliases: ['alias1', 'alias2'], - name, - category: 'emojiCategory', - host: null, - url: '/client-assets/about-icon.png', - license: null, - isSensitive: false, - localOnly: false, - roleIdsThatCanBeUsedThisEmojiAsReaction: ['roleId1', 'roleId2'], - }; -} - export function galleryPost(isSensitive = false) { return { id: 'somepostid', createdAt: '2016-12-28T22:49:51.000Z', updatedAt: '2016-12-28T22:49:51.000Z', - userId: 'someuserid', + userid: 'someuserid', user: userDetailed(), title: 'Some post title', description: 'Some post description', @@ -115,99 +65,7 @@ export function file(isSensitive = false) { }; } -const script = `/// @ ${AISCRIPT_VERSION} - -var name = "" - -Ui:render([ - Ui:C:textInput({ - label: "Your name" - onInput: @(v) { name = v } - }) - Ui:C:button({ - text: "Hello" - onClick: @() { - Mk:dialog(null, \`Hello, {name}!\`) - } - }) -]) -`; - -export function flash(): entities.Flash { - return { - id: 'someflashid', - createdAt: '2016-12-28T22:49:51.000Z', - updatedAt: '2016-12-28T22:49:51.000Z', - userId: 'someuserid', - user: userLite(), - title: 'Some Play title', - summary: 'Some Play summary', - script, - visibility: 'public', - likedCount: 0, - isLiked: false, - }; -} - -export function folder(id = 'somefolderid', name = 'Some Folder', parentId: string | null = null): entities.DriveFolder { - return { - id, - createdAt: '2016-12-28T22:49:51.000Z', - name, - parentId, - }; -} - -export function federationInstance(): entities.FederationInstance { - return { - id: 'someinstanceid', - firstRetrievedAt: '2021-01-01T00:00:00.000Z', - host: 'misskey-hub.net', - usersCount: 10, - notesCount: 20, - followingCount: 5, - followersCount: 15, - isNotResponding: false, - isSuspended: false, - suspensionState: 'none', - isBlocked: false, - softwareName: 'misskey', - softwareVersion: '2024.5.0', - openRegistrations: false, - name: 'Misskey Hub', - description: '', - maintainerName: '', - maintainerEmail: '', - isSilenced: false, - iconUrl: 'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/about-icon.png?raw=true', - faviconUrl: '', - themeColor: '', - infoUpdatedAt: '', - latestRequestReceivedAt: '', - }; -} - -export function note(id = 'somenoteid'): entities.Note { - return { - id, - createdAt: '2016-12-28T22:49:51.000Z', - deletedAt: null, - text: 'some note', - cw: null, - userId: 'someuserid', - user: userLite(), - visibility: 'public', - reactionAcceptance: 'nonSensitiveOnly', - reactionEmojis: {}, - reactions: {}, - myReaction: null, - reactionCount: 0, - renoteCount: 0, - repliesCount: 0, - }; -} - -export function userLite(id = 'someuserid', username = 'miskist', host: entities.UserDetailed['host'] = 'misskey-hub.net', name: entities.UserDetailed['name'] = 'Misskey User'): entities.UserLite { +export function userDetailed(id = 'someuserid', username = 'miskist', host = 'misskey-hub.net', name = 'Misskey User'): entities.UserDetailed { return { id, username, @@ -217,14 +75,9 @@ export function userLite(id = 'someuserid', username = 'miskist', host: entities avatarUrl: 'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/about-icon.png?raw=true', avatarBlurhash: 'eQFRshof5NWBRi},juayfPju53WB?0ofs;s*a{ofjuay^SoMEJR%ay', avatarDecorations: [], - emojis: {}, - }; -} - -export function userDetailed(id = 'someuserid', username = 'miskist', host: entities.UserDetailed['host'] = 'misskey-hub.net', name: entities.UserDetailed['name'] = 'Misskey User'): entities.UserDetailed { - return { - ...userLite(id, username, host, name), + emojis: [], bannerBlurhash: 'eQA^IW^-MH8w9tE8I=S^o{$*R4RikXtSxutRozjEnNR.RQadoyozog', + bannerColor: '#000000', bannerUrl: 'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/fedi.jpg?raw=true', birthday: '2014-06-20', createdAt: '2016-12-28T22:49:51.000Z', @@ -265,16 +118,11 @@ export function userDetailed(id = 'someuserid', username = 'miskist', host: enti publicReactions: false, securityKeys: false, twoFactorEnabled: false, - usePasswordLessLogin: false, twoFactorBackupCodesStock: 'none', updatedAt: null, - lastFetchedAt: null, uri: null, url: null, - movedTo: null, - alsoKnownAs: null, notify: 'none', - memo: null, }; } diff --git a/packages/frontend/.storybook/generate.tsx b/packages/frontend/.storybook/generate.tsx index f2bdc631d2..d61df9e7be 100644 --- a/packages/frontend/.storybook/generate.tsx +++ b/packages/frontend/.storybook/generate.tsx @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -82,16 +82,23 @@ function h( return Object.assign(props || {}, { type }) as T; } -declare namespace h.JSX { - type Element = estree.Node; - type IntrinsicElements = { - [T in keyof typeof generator as ToKebab>>]: { - [K in keyof Omit< - Parameters<(typeof generator)[T]>[0], - 'type' - >]?: Parameters<(typeof generator)[T]>[0][K]; +declare global { + namespace JSX { + type Element = estree.Node; + type ElementClass = never; + type ElementAttributesProperty = never; + type ElementChildrenAttribute = never; + type IntrinsicAttributes = never; + type IntrinsicClassAttributes = never; + type IntrinsicElements = { + [T in keyof typeof generator as ToKebab>>]: { + [K in keyof Omit< + Parameters<(typeof generator)[T]>[0], + 'type' + >]?: Parameters<(typeof generator)[T]>[0][K]; + }; }; - }; + } } function toStories(component: string): Promise { @@ -381,7 +388,6 @@ function toStories(component: string): Promise { '/* eslint-disable @typescript-eslint/explicit-function-return-type */\n' + '/* eslint-disable import/no-default-export */\n' + '/* eslint-disable import/no-duplicates */\n' + - '/* eslint-disable import/order */\n' + generate(program, { generator }) + (hasImplStories ? readFileSync(`${implStories}.ts`, 'utf-8') : ''), { @@ -395,30 +401,15 @@ function toStories(component: string): Promise { // glob('src/{components,pages,ui,widgets}/**/*.vue') (async () => { const globs = await Promise.all([ - glob('src/components/global/Mk*.vue'), - glob('src/components/global/RouterView.vue'), - glob('src/components/MkAbuseReportWindow.vue'), - glob('src/components/MkAccountMoved.vue'), - glob('src/components/MkAchievements.vue'), - glob('src/components/MkAnalogClock.vue'), - glob('src/components/MkAnimBg.vue'), - glob('src/components/MkAnnouncementDialog.vue'), - glob('src/components/MkAntennaEditor.vue'), - glob('src/components/MkAntennaEditorDialog.vue'), - glob('src/components/MkAsUi.vue'), - glob('src/components/MkAutocomplete.vue'), - glob('src/components/MkAvatars.vue'), - glob('src/components/Mk[B-E]*.vue'), - glob('src/components/MkFlashPreview.vue'), + glob('src/components/global/*.vue'), + glob('src/components/Mk{A,B}*.vue'), + glob('src/components/MkDigitalClock.vue'), glob('src/components/MkGalleryPostPreview.vue'), glob('src/components/MkSignupServerRules.vue'), glob('src/components/MkUserSetupDialog.vue'), glob('src/components/MkUserSetupDialog.*.vue'), - glob('src/components/MkInstanceCardMini.vue'), glob('src/components/MkInviteCode.vue'), - glob('src/pages/admin/overview.ap-requests.vue'), glob('src/pages/user/home.vue'), - glob('src/pages/search.vue'), ]); const components = globs.flat(); await Promise.all(components.map(async (component) => { diff --git a/packages/frontend/.storybook/main.ts b/packages/frontend/.storybook/main.ts index 9f318cf449..a450f8b46b 100644 --- a/packages/frontend/.storybook/main.ts +++ b/packages/frontend/.storybook/main.ts @@ -1,31 +1,27 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { createRequire } from 'node:module'; -import { dirname, join, resolve } from 'node:path'; +import { resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; import type { StorybookConfig } from '@storybook/vue3-vite'; import { type Plugin, mergeConfig } from 'vite'; import turbosnap from 'vite-plugin-turbosnap'; -const require = createRequire(import.meta.url); -const _dirname = fileURLToPath(new URL('.', import.meta.url)); +const dirname = fileURLToPath(new URL('.', import.meta.url)); const config = { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], - staticDirs: [{ from: '../assets', to: '/client-assets' }], addons: [ - getAbsolutePath('@storybook/addon-essentials'), - getAbsolutePath('@storybook/addon-interactions'), - getAbsolutePath('@storybook/addon-links'), - getAbsolutePath('@storybook/addon-storysource'), - getAbsolutePath('@storybook/addon-mdx-gfm'), - resolve(_dirname, '../node_modules/storybook-addon-misskey-theme'), + '@storybook/addon-essentials', + '@storybook/addon-interactions', + '@storybook/addon-links', + '@storybook/addon-storysource', + resolve(dirname, '../node_modules/storybook-addon-misskey-theme'), ], framework: { - name: getAbsolutePath('@storybook/vue3-vite') as '@storybook/vue3-vite', + name: '@storybook/vue3-vite', options: {}, }, docs: { @@ -35,19 +31,16 @@ const config = { disableTelemetry: true, }, async viteFinal(config) { - const replacePluginForIsChromatic = config.plugins?.findIndex((plugin: Plugin) => plugin && plugin.name === 'replace') ?? -1; + const replacePluginForIsChromatic = config.plugins?.findIndex((plugin) => plugin && (plugin as Partial)?.name === 'replace') ?? -1; if (~replacePluginForIsChromatic) { config.plugins?.splice(replacePluginForIsChromatic, 1); } return mergeConfig(config, { plugins: [ - { - // XXX: https://github.com/IanVS/vite-plugin-turbosnap/issues/8 - ...(turbosnap as any as typeof turbosnap['default'])({ - rootDir: config.root ?? process.cwd(), - }), - name: 'fake-turbosnap', - }, + // XXX: https://github.com/IanVS/vite-plugin-turbosnap/issues/8 + (turbosnap as any as typeof turbosnap['default'])({ + rootDir: config.root ?? process.cwd(), + }), ], build: { target: [ @@ -60,7 +53,3 @@ const config = { }, } satisfies StorybookConfig; export default config; - -function getAbsolutePath(value: string): string { - return dirname(require.resolve(join(value, 'package.json'))); -} diff --git a/packages/frontend/.storybook/manager.ts b/packages/frontend/.storybook/manager.ts index 7375a1f2a9..8f501111d0 100644 --- a/packages/frontend/.storybook/manager.ts +++ b/packages/frontend/.storybook/manager.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/frontend/.storybook/mocks.ts b/packages/frontend/.storybook/mocks.ts index 29cb112ccb..80e5157c5a 100644 --- a/packages/frontend/.storybook/mocks.ts +++ b/packages/frontend/.storybook/mocks.ts @@ -1,44 +1,31 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ -import { type SharedOptions, http, HttpResponse } from 'msw'; +import { type SharedOptions, rest } from 'msw'; export const onUnhandledRequest = ((req, print) => { - const url = new URL(req.url); - if (url.hostname !== 'localhost' || /^\/(?:client-assets\/|fluent-emojis?\/|iframe.html$|node_modules\/|src\/|sb-|static-assets\/|vite\/)/.test(url.pathname)) { + if (req.url.hostname !== 'localhost' || /^\/(?:client-assets\/|fluent-emojis?\/|iframe.html$|node_modules\/|src\/|sb-|static-assets\/|vite\/)/.test(req.url.pathname)) { return } print.warning() }) satisfies SharedOptions['onUnhandledRequest']; export const commonHandlers = [ - http.get('/fluent-emoji/:codepoints.png', async ({ params }) => { - const { codepoints } = params; + rest.get('/fluent-emoji/:codepoints.png', async (req, res, ctx) => { + const { codepoints } = req.params; const value = await fetch(`https://raw.githubusercontent.com/misskey-dev/emojis/main/dist/${codepoints}.png`).then((response) => response.blob()); - return new HttpResponse(value, { - headers: { - 'Content-Type': 'image/png', - }, - }); + return res(ctx.set('Content-Type', 'image/png'), ctx.body(value)); }), - http.get('/fluent-emojis/:codepoints.png', async ({ params }) => { - const { codepoints } = params; + rest.get('/fluent-emojis/:codepoints.png', async (req, res, ctx) => { + const { codepoints } = req.params; const value = await fetch(`https://raw.githubusercontent.com/misskey-dev/emojis/main/dist/${codepoints}.png`).then((response) => response.blob()); - return new HttpResponse(value, { - headers: { - 'Content-Type': 'image/png', - }, - }); + return res(ctx.set('Content-Type', 'image/png'), ctx.body(value)); }), - http.get('/twemoji/:codepoints.svg', async ({ params }) => { - const { codepoints } = params; + rest.get('/twemoji/:codepoints.svg', async (req, res, ctx) => { + const { codepoints } = req.params; const value = await fetch(`https://unpkg.com/@discordapp/twemoji@15.0.2/dist/svg/${codepoints}.svg`).then((response) => response.blob()); - return new HttpResponse(value, { - headers: { - 'Content-Type': 'image/svg+xml', - }, - }); + return res(ctx.set('Content-Type', 'image/svg+xml'), ctx.body(value)); }), ]; diff --git a/packages/frontend/.storybook/preload-locale.ts b/packages/frontend/.storybook/preload-locale.ts index c823ff9bee..349cc13508 100644 --- a/packages/frontend/.storybook/preload-locale.ts +++ b/packages/frontend/.storybook/preload-locale.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/frontend/.storybook/preload-theme.ts b/packages/frontend/.storybook/preload-theme.ts index e5573f2ac3..ad2cf18a35 100644 --- a/packages/frontend/.storybook/preload-theme.ts +++ b/packages/frontend/.storybook/preload-theme.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ @@ -30,7 +30,7 @@ const keys = [ 'd-u0', ] -await Promise.all(keys.map((key) => readFile(new URL(`../../frontend-shared/themes/${key}.json5`, import.meta.url), 'utf8'))).then((sources) => { +await Promise.all(keys.map((key) => readFile(new URL(`../src/themes/${key}.json5`, import.meta.url), 'utf8'))).then((sources) => { writeFile( new URL('./themes.ts', import.meta.url), `export default ${JSON.stringify( diff --git a/packages/frontend/.storybook/preview-head.html b/packages/frontend/.storybook/preview-head.html index ae42fd49bc..30f3ebfb64 100644 --- a/packages/frontend/.storybook/preview-head.html +++ b/packages/frontend/.storybook/preview-head.html @@ -1,11 +1,6 @@ - - - + diff --git a/packages/frontend/src/components/MkAbuseReportWindow.stories.impl.ts b/packages/frontend/src/components/MkAbuseReportWindow.stories.impl.ts index 9df957f3ec..dc842b3d1b 100644 --- a/packages/frontend/src/components/MkAbuseReportWindow.stories.impl.ts +++ b/packages/frontend/src/components/MkAbuseReportWindow.stories.impl.ts @@ -1,12 +1,12 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ /* eslint-disable @typescript-eslint/explicit-function-return-type */ import { action } from '@storybook/addon-actions'; import { StoryObj } from '@storybook/vue3'; -import { HttpResponse, http } from 'msw'; +import { rest } from 'msw'; import { userDetailed } from '../../.storybook/fakes.js'; import { commonHandlers } from '../../.storybook/mocks.js'; import MkAbuseReportWindow from './MkAbuseReportWindow.vue'; @@ -44,9 +44,9 @@ export const Default = { msw: { handlers: [ ...commonHandlers, - http.post('/api/users/report-abuse', async ({ request }) => { - action('POST /api/users/report-abuse')(await request.json()); - return HttpResponse.json({}); + rest.post('/api/users/report-abuse', async (req, res, ctx) => { + action('POST /api/users/report-abuse')(await req.json()); + return res(ctx.json({})); }), ], }, diff --git a/packages/frontend/src/components/MkAbuseReportWindow.vue b/packages/frontend/src/components/MkAbuseReportWindow.vue index a634a748e9..7814681ea2 100644 --- a/packages/frontend/src/components/MkAbuseReportWindow.vue +++ b/packages/frontend/src/components/MkAbuseReportWindow.vue @@ -1,5 +1,5 @@ @@ -39,7 +39,7 @@ import * as os from '@/os.js'; import { i18n } from '@/i18n.js'; const props = defineProps<{ - user: Misskey.entities.UserLite; + user: Misskey.entities.User; initialComment?: string; }>(); diff --git a/packages/frontend/src/components/MkAccountMoved.stories.impl.ts b/packages/frontend/src/components/MkAccountMoved.stories.impl.ts index cad26de6e2..33c6c24631 100644 --- a/packages/frontend/src/components/MkAccountMoved.stories.impl.ts +++ b/packages/frontend/src/components/MkAccountMoved.stories.impl.ts @@ -1,13 +1,10 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ /* eslint-disable @typescript-eslint/explicit-function-return-type */ -import { action } from '@storybook/addon-actions'; import { StoryObj } from '@storybook/vue3'; -import { HttpResponse, http } from 'msw'; -import { commonHandlers } from '../../.storybook/mocks.js'; import { userDetailed } from '../../.storybook/fakes.js'; import MkAccountMoved from './MkAccountMoved.vue'; export const Default = { @@ -32,18 +29,10 @@ export const Default = { }; }, args: { - movedTo: userDetailed().id, + username: userDetailed().username, + host: userDetailed().host, }, parameters: { layout: 'centered', - msw: { - handlers: [ - ...commonHandlers, - http.post('/api/users/show', async ({ request }) => { - action('POST /api/users/show')(await request.json()); - return HttpResponse.json(userDetailed()); - }), - ], - }, }, } satisfies StoryObj; diff --git a/packages/frontend/src/components/MkAccountMoved.vue b/packages/frontend/src/components/MkAccountMoved.vue index 0839955d9d..155d9fe3a9 100644 --- a/packages/frontend/src/components/MkAccountMoved.vue +++ b/packages/frontend/src/components/MkAccountMoved.vue @@ -1,5 +1,5 @@ @@ -16,8 +16,8 @@ import { ref } from 'vue'; import * as Misskey from 'misskey-js'; import MkMention from './MkMention.vue'; import { i18n } from '@/i18n.js'; -import { host as localHost } from '@@/js/config.js'; -import { misskeyApi } from '@/scripts/misskey-api.js'; +import { host as localHost } from '@/config.js'; +import { api } from '@/os.js'; const user = ref(); @@ -25,16 +25,16 @@ const props = defineProps<{ movedTo: string; // user id }>(); -misskeyApi('users/show', { userId: props.movedTo }).then(u => user.value = u); +api('users/show', { userId: props.movedTo }).then(u => user.value = u); diff --git a/packages/frontend/src/components/MkAuthConfirm.stories.impl.ts b/packages/frontend/src/components/MkAuthConfirm.stories.impl.ts deleted file mode 100644 index 0adc44e204..0000000000 --- a/packages/frontend/src/components/MkAuthConfirm.stories.impl.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import MkAuthConfirm from './MkAuthConfirm.vue'; -void MkAuthConfirm; diff --git a/packages/frontend/src/components/MkAuthConfirm.vue b/packages/frontend/src/components/MkAuthConfirm.vue deleted file mode 100644 index f78d2d38f0..0000000000 --- a/packages/frontend/src/components/MkAuthConfirm.vue +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - diff --git a/packages/frontend/src/components/MkAutocomplete.stories.impl.ts b/packages/frontend/src/components/MkAutocomplete.stories.impl.ts index ec24b8c240..969519386f 100644 --- a/packages/frontend/src/components/MkAutocomplete.stories.impl.ts +++ b/packages/frontend/src/components/MkAutocomplete.stories.impl.ts @@ -1,13 +1,14 @@ /* - * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only */ /* eslint-disable @typescript-eslint/explicit-function-return-type */ import { action } from '@storybook/addon-actions'; -import { expect, userEvent, waitFor, within } from '@storybook/test'; +import { expect } from '@storybook/jest'; +import { userEvent, waitFor, within } from '@storybook/testing-library'; import { StoryObj } from '@storybook/vue3'; -import { HttpResponse, http } from 'msw'; +import { rest } from 'msw'; import { userDetailed } from '../../.storybook/fakes.js'; import { commonHandlers } from '../../.storybook/mocks.js'; import MkAutocomplete from './MkAutocomplete.vue'; @@ -98,11 +99,11 @@ export const User = { msw: { handlers: [ ...commonHandlers, - http.post('/api/users/search-by-username-and-host', () => { - return HttpResponse.json([ + rest.post('/api/users/search-by-username-and-host', (req, res, ctx) => { + return res(ctx.json([ userDetailed('44', 'mizuki', 'misskey-hub.net', 'Mizuki'), userDetailed('49', 'momoko', 'misskey-hub.net', 'Momoko'), - ]); + ])); }), ], }, @@ -131,12 +132,12 @@ export const Hashtag = { msw: { handlers: [ ...commonHandlers, - http.post('/api/hashtags/search', () => { - return HttpResponse.json([ + rest.post('/api/hashtags/search', (req, res, ctx) => { + return res(ctx.json([ '気象警報注意報', '気象警報', '気象情報', - ]); + ])); }), ], }, diff --git a/packages/frontend/src/components/MkAutocomplete.vue b/packages/frontend/src/components/MkAutocomplete.vue index 0ea4566d4e..494d120a93 100644 --- a/packages/frontend/src/components/MkAutocomplete.vue +++ b/packages/frontend/src/components/MkAutocomplete.vue @@ -1,5 +1,5 @@ @@ -22,7 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only
  1. - + @@ -35,29 +35,34 @@ SPDX-License-Identifier: AGPL-3.0-only {{ tag }}
-
    -
  1. - {{ param }} -
  2. -
- diff --git a/packages/frontend/src/components/MkCode.stories.impl.ts b/packages/frontend/src/components/MkCode.stories.impl.ts deleted file mode 100644 index b7e53e8e35..0000000000 --- a/packages/frontend/src/components/MkCode.stories.impl.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -/* eslint-disable @typescript-eslint/explicit-function-return-type */ -/* eslint-disable import/no-default-export */ -import { StoryObj } from '@storybook/vue3'; -import MkCode from './MkCode.vue'; -const code = `for (let i, 100) { - <: if (i % 15 == 0) "FizzBuzz" - elif (i % 3 == 0) "Fizz" - elif (i % 5 == 0) "Buzz" - else i -}`; -export const Default = { - render(args) { - return { - components: { - MkCode, - }, - setup() { - return { - args, - }; - }, - computed: { - props() { - return { - ...this.args, - }; - }, - }, - template: '', - }; - }, - args: { - code, - lang: 'is', - }, - parameters: { - layout: 'centered', - }, -} satisfies StoryObj; diff --git a/packages/frontend/src/components/MkCode.vue b/packages/frontend/src/components/MkCode.vue index cb82bfd98b..2c016e4d7c 100644 --- a/packages/frontend/src/components/MkCode.vue +++ b/packages/frontend/src/components/MkCode.vue @@ -1,77 +1,58 @@ diff --git a/packages/frontend/src/components/MkCodeInline.stories.impl.ts b/packages/frontend/src/components/MkCodeInline.stories.impl.ts deleted file mode 100644 index 51d4d106ff..0000000000 --- a/packages/frontend/src/components/MkCodeInline.stories.impl.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -/* eslint-disable @typescript-eslint/explicit-function-return-type */ -/* eslint-disable import/no-default-export */ -import { StoryObj } from '@storybook/vue3'; -import MkCodeInline from './MkCodeInline.vue'; -export const Default = { - render(args) { - return { - components: { - MkCodeInline, - }, - setup() { - return { - args, - }; - }, - computed: { - props() { - return { - ...this.args, - }; - }, - }, - template: '', - }; - }, - args: { - code: '<: "Hello, world!"', - }, - parameters: { - layout: 'centered', - }, -} satisfies StoryObj; diff --git a/packages/frontend/src/components/MkCodeInline.vue b/packages/frontend/src/components/MkCodeInline.vue deleted file mode 100644 index 04b6e54108..0000000000 --- a/packages/frontend/src/components/MkCodeInline.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - diff --git a/packages/frontend/src/components/MkColorInput.stories.impl.ts b/packages/frontend/src/components/MkColorInput.stories.impl.ts deleted file mode 100644 index 61383e2cae..0000000000 --- a/packages/frontend/src/components/MkColorInput.stories.impl.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -/* eslint-disable @typescript-eslint/explicit-function-return-type */ -/* eslint-disable import/no-default-export */ -import { StoryObj } from '@storybook/vue3'; -import { action } from '@storybook/addon-actions'; -import MkColorInput from './MkColorInput.vue'; -export const Default = { - render(args) { - return { - components: { - MkColorInput, - }, - data() { - return { - color: '#cccccc', - }; - }, - setup() { - return { - args, - }; - }, - computed: { - props() { - return { - ...this.args, - }; - }, - events() { - return { - 'update:modelValue': action('update:modelValue'), - }; - }, - }, - template: '', - }; - }, - parameters: { - layout: 'fullscreen', - }, - decorators: [ - () => ({ - template: '
', - }), - ], -} satisfies StoryObj; diff --git a/packages/frontend/src/components/MkColorInput.vue b/packages/frontend/src/components/MkColorInput.vue index 55a32664de..a7a3eff5af 100644 --- a/packages/frontend/src/components/MkColorInput.vue +++ b/packages/frontend/src/components/MkColorInput.vue @@ -1,5 +1,5 @@ @@ -41,8 +41,8 @@ const { modelValue } = toRefs(props); const v = ref(modelValue.value); const inputEl = shallowRef(); -const onInput = () => { - emit('update:modelValue', v.value ?? ''); +const onInput = (ev: KeyboardEvent) => { + emit('update:modelValue', v.value); }; @@ -60,7 +60,7 @@ const onInput = () => { .caption { font-size: 0.85em; padding: 8px 0 0 0; - color: var(--MI_THEME-fgTransparentWeak); + color: var(--fgTransparentWeak); &:empty { display: none; @@ -72,8 +72,8 @@ const onInput = () => { &.focused { > .inputCore { - border-color: var(--MI_THEME-accent) !important; - //box-shadow: 0 0 0 4px var(--MI_THEME-focus); + border-color: var(--accent) !important; + //box-shadow: 0 0 0 4px var(--focus); } } @@ -98,9 +98,9 @@ const onInput = () => { font: inherit; font-weight: normal; font-size: 1em; - color: var(--MI_THEME-fg); - background: var(--MI_THEME-panel); - border: solid 1px var(--MI_THEME-panel); + color: var(--fg); + background: var(--panel); + border: solid 1px var(--panel); border-radius: 6px; outline: none; box-shadow: none; @@ -108,7 +108,7 @@ const onInput = () => { transition: border-color 0.1s ease-out; &:hover { - border-color: var(--MI_THEME-inputBorderHover) !important; + border-color: var(--inputBorderHover) !important; } } diff --git a/packages/frontend/src/components/MkContainer.stories.impl.ts b/packages/frontend/src/components/MkContainer.stories.impl.ts deleted file mode 100644 index 72a7659521..0000000000 --- a/packages/frontend/src/components/MkContainer.stories.impl.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import MkContainer from './MkContainer.vue'; -void MkContainer; diff --git a/packages/frontend/src/components/MkContainer.vue b/packages/frontend/src/components/MkContainer.vue index f513795c56..659f3a909e 100644 --- a/packages/frontend/src/components/MkContainer.vue +++ b/packages/frontend/src/components/MkContainer.vue @@ -1,5 +1,5 @@ @@ -64,30 +64,26 @@ const showBody = ref(props.expanded); const ignoreOmit = ref(false); const omitted = ref(false); -function enter(el: Element) { - if (!(el instanceof HTMLElement)) return; +function enter(el) { const elementHeight = el.getBoundingClientRect().height; - el.style.height = '0'; + el.style.height = 0; el.offsetHeight; // reflow - el.style.height = `${Math.min(elementHeight, props.maxHeight ?? Infinity)}px`; + el.style.height = Math.min(elementHeight, props.maxHeight ?? Infinity) + 'px'; } -function afterEnter(el: Element) { - if (!(el instanceof HTMLElement)) return; - el.style.height = ''; +function afterEnter(el) { + el.style.height = null; } -function leave(el: Element) { - if (!(el instanceof HTMLElement)) return; +function leave(el) { const elementHeight = el.getBoundingClientRect().height; - el.style.height = `${elementHeight}px`; + el.style.height = elementHeight + 'px'; el.offsetHeight; // reflow - el.style.height = '0'; + el.style.height = 0; } -function afterLeave(el: Element) { - if (!(el instanceof HTMLElement)) return; - el.style.height = ''; +function afterLeave(el) { + el.style.height = null; } const calcOmit = () => { @@ -169,11 +165,11 @@ onUnmounted(() => { .header { position: sticky; - top: var(--MI-stickyTop, 0px); + top: var(--stickyTop, 0px); left: 0; - color: var(--MI_THEME-panelHeaderFg); - background: var(--MI_THEME-panelHeaderBg); - border-bottom: solid 0.5px var(--MI_THEME-panelHeaderDivider); + color: var(--panelHeaderFg); + background: var(--panelHeaderBg); + border-bottom: solid 0.5px var(--panelHeaderDivider); z-index: 2; line-height: 1.4em; } @@ -205,7 +201,7 @@ onUnmounted(() => { } .content { - --MI-stickyTop: 0px; + --stickyTop: 0px; &.omitted { position: relative; @@ -220,11 +216,11 @@ onUnmounted(() => { left: 0; width: 100%; height: 64px; - background: linear-gradient(0deg, var(--MI_THEME-panel), color(from var(--MI_THEME-panel) srgb r g b / 0)); + background: linear-gradient(0deg, var(--panel), var(--X15)); > .fadeLabel { display: inline-block; - background: var(--MI_THEME-panel); + background: var(--panel); padding: 6px 10px; font-size: 0.8em; border-radius: 999px; @@ -233,7 +229,7 @@ onUnmounted(() => { &:hover { > .fadeLabel { - background: var(--MI_THEME-panelHighlight); + background: var(--panelHighlight); } } } diff --git a/packages/frontend/src/components/MkContextMenu.stories.impl.ts b/packages/frontend/src/components/MkContextMenu.stories.impl.ts deleted file mode 100644 index 1ff0f51bd4..0000000000 --- a/packages/frontend/src/components/MkContextMenu.stories.impl.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -/* eslint-disable @typescript-eslint/explicit-function-return-type */ -/* eslint-disable import/no-default-export */ -import { StoryObj } from '@storybook/vue3'; -import { userEvent, within } from '@storybook/test'; -import MkContextMenu from './MkContextMenu.vue'; -import * as os from '@/os.js'; -export const Empty = { - render(args) { - return { - setup() { - return { - args, - }; - }, - computed: { - props() { - return { - ...this.args, - }; - }, - }, - methods: { - onContextmenu(ev: MouseEvent) { - os.contextMenu(args.items, ev); - }, - }, - template: '
Right Click Here
', - }; - }, - args: { - items: [], - }, - async play({ canvasElement }) { - const canvas = within(canvasElement); - const target = canvas.getByText('Right Click Here'); - await userEvent.pointer({ keys: '[MouseRight>]', target }); - }, - parameters: { - layout: 'centered', - }, -} satisfies StoryObj; -export const SomeTabs = { - ...Empty, - args: { - items: [ - { - text: 'Home', - icon: 'ti ti-home', - action() {}, - }, - ], - }, -} satisfies StoryObj; diff --git a/packages/frontend/src/components/MkContextMenu.vue b/packages/frontend/src/components/MkContextMenu.vue index f51fefa0c0..e29cf472f7 100644 --- a/packages/frontend/src/components/MkContextMenu.vue +++ b/packages/frontend/src/components/MkContextMenu.vue @@ -1,5 +1,5 @@ @@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only :leaveToClass="defaultStore.state.animation ? $style.transition_fade_leaveTo : ''" >
- +
@@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only - - diff --git a/packages/frontend/src/components/MkCwButton.stories.impl.ts b/packages/frontend/src/components/MkCwButton.stories.impl.ts deleted file mode 100644 index 5d6ea56da9..0000000000 --- a/packages/frontend/src/components/MkCwButton.stories.impl.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -/* eslint-disable @typescript-eslint/explicit-function-return-type */ -/* eslint-disable import/no-default-export */ -import { StoryObj } from '@storybook/vue3'; -import { action } from '@storybook/addon-actions'; -import { expect, userEvent, within } from '@storybook/test'; -import { file } from '../../.storybook/fakes.js'; -import MkCwButton from './MkCwButton.vue'; -import { i18n } from '@/i18n.js'; - -export const Default = { - render(args) { - return { - components: { - MkCwButton, - }, - data() { - return { - showContent: false, - }; - }, - setup() { - return { - args, - }; - }, - computed: { - props() { - return { - ...this.args, - }; - }, - events() { - return { - 'update:modelValue': action('update:modelValue'), - }; - }, - }, - template: '', - }; - }, - args: { - text: 'Some CW content', - }, - async play({ canvasElement }) { - const canvas = within(canvasElement); - const buttonElement = canvas.getByRole('button'); - await expect(buttonElement).toHaveTextContent(i18n.ts._cw.show); - await expect(buttonElement).toHaveTextContent(i18n.tsx._cw.chars({ count: 15 })); - await userEvent.click(buttonElement); - await expect(buttonElement).toHaveTextContent(i18n.ts._cw.hide); - await userEvent.click(buttonElement); - }, - parameters: { - chromatic: { - // NOTE: テストが終わるまで待つ - delay: 5000, - }, - layout: 'centered', - }, -} satisfies StoryObj; -export const IncludesTextAndDriveFile = { - ...Default, - args: { - text: 'Some CW content', - files: [file()], - }, - async play({ canvasElement }) { - const canvas = within(canvasElement); - const buttonElement = canvas.getByRole('button'); - await expect(buttonElement).toHaveTextContent(i18n.tsx._cw.chars({ count: 15 })); - await expect(buttonElement).toHaveTextContent(' / '); - await expect(buttonElement).toHaveTextContent(i18n.tsx._cw.files({ count: 1 })); - }, -} satisfies StoryObj; diff --git a/packages/frontend/src/components/MkCwButton.vue b/packages/frontend/src/components/MkCwButton.vue index b5f6e78b6c..4a6d2dfba2 100644 --- a/packages/frontend/src/components/MkCwButton.vue +++ b/packages/frontend/src/components/MkCwButton.vue @@ -1,5 +1,5 @@ @@ -10,7 +10,6 @@ SPDX-License-Identifier: AGPL-3.0-only @@ -185,7 +173,7 @@ export default defineComponent({ } &:not(.date-separated-list-nogap) > *:not(:last-child) { - margin-bottom: var(--MI-margin); + margin-bottom: var(--margin); } } @@ -197,7 +185,7 @@ export default defineComponent({ box-shadow: none; &:not(:last-child) { - border-bottom: solid 0.5px var(--MI_THEME-divider); + border-bottom: solid 0.5px var(--divider); } } } @@ -238,7 +226,7 @@ export default defineComponent({ line-height: 32px; text-align: center; font-size: 12px; - color: var(--MI_THEME-dateLabelFg); + color: var(--dateLabelFg); } .date-1 { @@ -256,11 +244,5 @@ export default defineComponent({ .date-2-icon { margin-left: 8px; } - -.ad-wrapper { - padding: 8px; - background-size: auto auto; - background-image: repeating-linear-gradient(45deg, transparent, transparent 8px, var(--MI_THEME-bg) 8px, var(--MI_THEME-bg) 14px); -} diff --git a/packages/frontend/src/components/MkDialog.stories.impl.ts b/packages/frontend/src/components/MkDialog.stories.impl.ts deleted file mode 100644 index 2d8d3661f2..0000000000 --- a/packages/frontend/src/components/MkDialog.stories.impl.ts +++ /dev/null @@ -1,159 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { action } from '@storybook/addon-actions'; -import { expect, userEvent, waitFor, within } from '@storybook/test'; -import { StoryObj } from '@storybook/vue3'; -import { i18n } from '@/i18n.js'; -import MkDialog from './MkDialog.vue'; -const Base = { - render(args) { - return { - components: { - MkDialog, - }, - setup() { - return { - args, - }; - }, - computed: { - props() { - return { - ...this.args, - }; - }, - events() { - return { - done: action('done'), - closed: action('closed'), - }; - }, - }, - template: '', - }; - }, - args: { - text: 'Hello, world!', - }, - parameters: { - layout: 'centered', - }, -} satisfies StoryObj; -export const Success = { - ...Base, - args: { - ...Base.args, - type: 'success', - }, -} satisfies StoryObj; -export const Error = { - ...Base, - args: { - ...Base.args, - type: 'error', - }, -} satisfies StoryObj; -export const Warning = { - ...Base, - args: { - ...Base.args, - type: 'warning', - }, -} satisfies StoryObj; -export const Info = { - ...Base, - args: { - ...Base.args, - type: 'info', - }, -} satisfies StoryObj; -export const Question = { - ...Base, - args: { - ...Base.args, - type: 'question', - }, -} satisfies StoryObj; -export const Waiting = { - ...Base, - args: { - ...Base.args, - type: 'waiting', - }, -} satisfies StoryObj; -export const DialogWithActions = { - ...Question, - args: { - ...Question.args, - text: i18n.ts.areYouSure, - actions: [ - { - text: i18n.ts.yes, - primary: true, - callback() { - action('YES')(); - }, - }, - { - text: i18n.ts.no, - callback() { - action('NO')(); - }, - }, - ], - }, -} satisfies StoryObj; -export const DialogWithDangerActions = { - ...Warning, - args: { - ...Warning.args, - text: i18n.ts.resetAreYouSure, - actions: [ - { - text: i18n.ts.yes, - danger: true, - primary: true, - callback() { - action('YES')(); - }, - }, - { - text: i18n.ts.no, - callback() { - action('NO')(); - }, - }, - ], - }, -} satisfies StoryObj; -export const DialogWithInput = { - ...Question, - args: { - ...Question.args, - title: 'Hello, world!', - text: undefined, - input: { - placeholder: i18n.ts.inputMessageHere, - type: 'text', - default: null, - minLength: 2, - maxLength: 3, - }, - }, - async play({ canvasElement }) { - const canvas = within(canvasElement); - await expect(canvasElement).toHaveTextContent(i18n.tsx._dialog.charactersBelow({ current: 0, min: 2 })); - const okButton = canvas.getByRole('button', { name: i18n.ts.ok }); - await expect(okButton).toBeDisabled(); - const input = canvas.getByRole('combobox'); - await waitFor(() => userEvent.hover(input)); - await waitFor(() => userEvent.click(input)); - await waitFor(() => userEvent.type(input, 'M')); - await expect(canvasElement).toHaveTextContent(i18n.tsx._dialog.charactersBelow({ current: 1, min: 2 })); - await waitFor(() => userEvent.type(input, 'i')); - await expect(okButton).toBeEnabled(); - }, -} satisfies StoryObj; diff --git a/packages/frontend/src/components/MkDialog.vue b/packages/frontend/src/components/MkDialog.vue index b095a1cd4a..3c1f83d335 100644 --- a/packages/frontend/src/components/MkDialog.vue +++ b/packages/frontend/src/components/MkDialog.vue @@ -1,10 +1,10 @@ diff --git a/packages/frontend/src/components/MkDonation.stories.impl.ts b/packages/frontend/src/components/MkDonation.stories.impl.ts deleted file mode 100644 index 27d6b7df6c..0000000000 --- a/packages/frontend/src/components/MkDonation.stories.impl.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { action } from '@storybook/addon-actions'; -import { StoryObj } from '@storybook/vue3'; -import { onBeforeUnmount } from 'vue'; -import MkDonation from './MkDonation.vue'; -import { instance } from '@/instance.js'; -export const Default = { - render(args) { - return { - components: { - MkDonation, - }, - setup() { - return { - args, - }; - }, - computed: { - props() { - return { - ...this.args, - }; - }, - events() { - return { - closed: action('closed'), - }; - }, - }, - template: '', - }; - }, - args: { - // @ts-expect-error name is used for mocking instance - name: 'Misskey Hub', - }, - decorators: [ - (_, { args }) => ({ - setup() { - // @ts-expect-error name is used for mocking instance - instance.name = args.name; - onBeforeUnmount(() => instance.name = null); - }, - template: '', - }), - ], - parameters: { - layout: 'centered', - }, -} satisfies StoryObj; diff --git a/packages/frontend/src/components/MkDonation.vue b/packages/frontend/src/components/MkDonation.vue index 0e0da64750..3a1bab5f98 100644 --- a/packages/frontend/src/components/MkDonation.vue +++ b/packages/frontend/src/components/MkDonation.vue @@ -1,5 +1,5 @@ @@ -38,7 +38,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkDriveWindow.stories.impl.ts b/packages/frontend/src/components/MkDriveWindow.stories.impl.ts deleted file mode 100644 index faa1f7fd5f..0000000000 --- a/packages/frontend/src/components/MkDriveWindow.stories.impl.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import MkDriveWindow from './MkDriveWindow.vue'; -void MkDriveWindow; diff --git a/packages/frontend/src/components/MkDriveWindow.vue b/packages/frontend/src/components/MkDriveWindow.vue index c0142ec76e..72aa79b153 100644 --- a/packages/frontend/src/components/MkDriveWindow.vue +++ b/packages/frontend/src/components/MkDriveWindow.vue @@ -1,5 +1,5 @@ diff --git a/packages/frontend/src/components/MkEmbedCodeGenDialog.vue b/packages/frontend/src/components/MkEmbedCodeGenDialog.vue deleted file mode 100644 index 6e9eb75920..0000000000 --- a/packages/frontend/src/components/MkEmbedCodeGenDialog.vue +++ /dev/null @@ -1,414 +0,0 @@ - - - - - - - diff --git a/packages/frontend/src/components/MkEmojiPicker.section.stories.impl.ts b/packages/frontend/src/components/MkEmojiPicker.section.stories.impl.ts deleted file mode 100644 index 69aef577de..0000000000 --- a/packages/frontend/src/components/MkEmojiPicker.section.stories.impl.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import MkEmojiPicker_section from './MkEmojiPicker.section.vue'; -void MkEmojiPicker_section; diff --git a/packages/frontend/src/components/MkEmojiPicker.section.vue b/packages/frontend/src/components/MkEmojiPicker.section.vue index b418ed3ae6..14f3f5770f 100644 --- a/packages/frontend/src/components/MkEmojiPicker.section.vue +++ b/packages/frontend/src/components/MkEmojiPicker.section.vue @@ -1,12 +1,12 @@