Merge branch 'develop' into fix-msg-room
This commit is contained in:
commit
dbbc75008d
64
.github/workflows/lint.yml
vendored
64
.github/workflows/lint.yml
vendored
@ -1,25 +1,39 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.x
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
- run: yarn install
|
||||
- run: yarn lint
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
backend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18.x
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: |
|
||||
packages/backend/yarn.lock
|
||||
- run: yarn install
|
||||
- run: yarn --cwd ./packages/backend lint
|
||||
|
||||
client:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18.x
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: |
|
||||
packages/client/yarn.lock
|
||||
- run: yarn install
|
||||
- run: yarn --cwd ./packages/client lint
|
||||
|
20
.github/workflows/test.yml
vendored
20
.github/workflows/test.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [16.x]
|
||||
node-version: [18.x]
|
||||
|
||||
services:
|
||||
postgres:
|
||||
@ -33,9 +33,13 @@ jobs:
|
||||
with:
|
||||
submodules: true
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: |
|
||||
packages/backend/yarn.lock
|
||||
packages/client/yarn.lock
|
||||
- name: Install dependencies
|
||||
run: yarn install
|
||||
- name: Check yarn.lock
|
||||
@ -53,7 +57,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [16.x]
|
||||
node-version: [18.x]
|
||||
browser: [chrome]
|
||||
|
||||
services:
|
||||
@ -80,13 +84,13 @@ jobs:
|
||||
#- uses: browser-actions/setup-firefox@latest
|
||||
# if: ${{ matrix.browser == 'firefox' }}
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: |
|
||||
packages/backend/yarn.lock
|
||||
packages/client/yarn.lock
|
||||
- name: Install dependencies
|
||||
run: yarn install
|
||||
- name: Check yarn.lock
|
||||
|
@ -1 +1 @@
|
||||
v16.14.0
|
||||
v18.0.0
|
||||
|
74
CHANGELOG.md
74
CHANGELOG.md
@ -2,7 +2,6 @@
|
||||
## 12.x.x (unreleased)
|
||||
|
||||
### Improvements
|
||||
-
|
||||
|
||||
### Bugfixes
|
||||
-
|
||||
@ -10,6 +9,79 @@
|
||||
You should also include the user name that made the change.
|
||||
-->
|
||||
|
||||
## 12.x.x (unreleased)
|
||||
### NOTE
|
||||
- From this version, Node 18.0.0 or later is required.
|
||||
|
||||
### Improvements
|
||||
- enhance: ドライブに画像ファイルをアップロードするときオリジナル画像を破棄してwebpublicのみ保持するオプション @tamaina
|
||||
- enhance: API: notifications/readは配列でも受け付けるように #7667 @tamaina
|
||||
- enhance: プッシュ通知を複数アカウント対応に #7667 @tamaina
|
||||
- enhance: プッシュ通知にクリックやactionを設定 #7667 @tamaina
|
||||
|
||||
### Bugfixes
|
||||
- Client: fix settings page @tamaina
|
||||
- Client: fix profile tabs @futchitwo
|
||||
- Server: await promises when following or unfollowing users @Johann150
|
||||
- Client: fix abuse reports page to be able to show all reports @Johann150
|
||||
- Federation: Add rel attribute to host-meta @mei23
|
||||
|
||||
## 12.110.1 (2022/04/23)
|
||||
|
||||
### Bugfixes
|
||||
- Fix GOP rendering @syuilo
|
||||
- Improve performance of antenna, clip, and list @xianonn
|
||||
|
||||
## 12.110.0 (2022/04/11)
|
||||
|
||||
### Improvements
|
||||
- Improve webhook @syuilo
|
||||
- Client: Show loading icon on splash screen @syuilo
|
||||
|
||||
### Bugfixes
|
||||
- API: parameter validation of users/show was wrong
|
||||
- Federation: リモートインスタンスへのダイレクト投稿が届かない問題を修正 @syuilo
|
||||
|
||||
## 12.109.2 (2022/04/03)
|
||||
|
||||
### Bugfixes
|
||||
- API: admin/update-meta was not working @syuilo
|
||||
- Client: テーマを切り替えたり読み込んだりするとmeta[name="theme-color"]のcontentがundefinedになる問題を修正 @tamaina
|
||||
|
||||
## 12.109.1 (2022/04/02)
|
||||
|
||||
### Bugfixes
|
||||
- API: Renoteが行えない問題を修正
|
||||
|
||||
## 12.109.0 (2022/04/02)
|
||||
|
||||
### Improvements
|
||||
- Webhooks @syuilo
|
||||
- Bull Dashboardを組み込み、ジョブキューの確認や操作を行えるように @syuilo
|
||||
- Bull Dashboardを開くには、最初だけ一旦ログアウトしてから再度管理者権限を持つアカウントでログインする必要があります
|
||||
- Check that installed Node.js version fulfills version requirement @ThatOneCalculator
|
||||
- Server: overall performance improvements @syuilo
|
||||
- Federation: avoid duplicate activity delivery @Johann150
|
||||
- Federation: limit federation of reactions on direct notes @Johann150
|
||||
- Client: タッチパッド・タッチスクリーンでのデッキの操作性を向上 @tamaina
|
||||
|
||||
### Bugfixes
|
||||
- email address validation was not working @ybw2016v
|
||||
- API: fix endpoint endpoint @Johann150
|
||||
- API: fix admin/meta endpoint @syuilo
|
||||
- API: improved validation and documentation for endpoints that accept different variants of input @Johann150
|
||||
- API: `notes/create`: The `mediaIds` property is now deprecated. @Johann150
|
||||
- Use `fileIds` instead, it has the same behaviour.
|
||||
- Client: URIエンコーディングが異常でdecodeURIComponentが失敗するとURLが表示できなくなる問題を修正 @tamaina
|
||||
|
||||
## 12.108.1 (2022/03/12)
|
||||
|
||||
### Bugfixes
|
||||
- リレーが動作しない問題を修正 @xianonn
|
||||
- ulidを使用していると動作しない問題を修正 @syuilo
|
||||
- 外部からOGPが正しく取得できない問題を修正 @syuilo
|
||||
- instance can not get the files from other instance when there are items in allowedPrivateNetworks in .config/default.yml @ybw2016v
|
||||
|
||||
## 12.108.0 (2022/03/09)
|
||||
|
||||
### NOTE
|
||||
|
@ -6,6 +6,9 @@ Also, you might receive comments on your Issue/PR in Japanese, but you do not ne
|
||||
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.
|
||||
It will also allow the reader to use the translation tool of their preference if necessary.
|
||||
|
||||
## Roadmap
|
||||
See [ROADMAP.md](./ROADMAP.md)
|
||||
|
||||
## Issues
|
||||
Before creating an issue, please check the following:
|
||||
- To avoid duplication, please search for similar issues before creating a new issue.
|
||||
@ -59,6 +62,21 @@ Be willing to comment on the good points and not just the things you want fixed
|
||||
- Are there any omissions or gaps?
|
||||
- Does it check for anomalies?
|
||||
|
||||
## Merge
|
||||
For now, basically only @syuilo has the authority to merge PRs into develop because he is most familiar with the codebase.
|
||||
However, minor fixes, refactoring, and urgent changes may be merged at the discretion of a contributor.
|
||||
|
||||
## Release
|
||||
For now, basically only @syuilo has the authority to release Misskey.
|
||||
However, in case of emergency, a release can be made at the discretion of a contributor.
|
||||
|
||||
### Release Instructions
|
||||
1. commit version changes in the `develop` branch ([package.json](https://github.com/misskey-dev/misskey/blob/develop/package.json))
|
||||
2. follow the `master` branch to the `develop` branch.
|
||||
3. Create a [release of GitHub](https://github.com/misskey-dev/misskey/releases)
|
||||
- The target branch must be `master`
|
||||
- The tag name must be the version
|
||||
|
||||
## Localization (l10n)
|
||||
Misskey uses [Crowdin](https://crowdin.com/project/misskey) for localization management.
|
||||
You can improve our translations with your Crowdin account.
|
||||
@ -198,11 +216,13 @@ MongoDBの時とは違い、findOneでレコードを取得する時に対象レ
|
||||
MongoDBは`null`で返してきてたので、その感覚で`if (x === null)`とか書くとバグる。代わりに`if (x == null)`と書いてください
|
||||
|
||||
### Migration作成方法
|
||||
```
|
||||
npx ts-node ./node_modules/typeorm/cli.js migration:generate -n 変更の名前 -o
|
||||
packages/backendで:
|
||||
```sh
|
||||
npx typeorm migration:generate -d ormconfig.js -o <migration name>
|
||||
```
|
||||
|
||||
作成されたスクリプトは不必要な変更を含むため除去してください。
|
||||
- 生成後、ファイルをmigration下に移してください
|
||||
- 作成されたスクリプトは不必要な変更を含むため除去してください
|
||||
|
||||
### コネクションには`markRaw`せよ
|
||||
**Vueのコンポーネントのdataオプションとして**misskey.jsのコネクションを設定するとき、必ず`markRaw`でラップしてください。インスタンスが不必要にリアクティブ化されることで、misskey.js内の処理で不具合が発生するとともに、パフォーマンス上の問題にも繋がる。なお、Composition APIを使う場合はこの限りではない(リアクティブ化はマニュアルなため)。
|
||||
|
14
Dockerfile
14
Dockerfile
@ -1,4 +1,4 @@
|
||||
FROM node:16.14.0-alpine3.15 AS base
|
||||
FROM node:18.0.0-alpine3.15 AS base
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
@ -11,16 +11,16 @@ FROM base AS builder
|
||||
COPY . ./
|
||||
|
||||
RUN apk add --no-cache $BUILD_DEPS && \
|
||||
git submodule update --init && \
|
||||
yarn install && \
|
||||
yarn build && \
|
||||
rm -rf .git
|
||||
git submodule update --init && \
|
||||
yarn install && \
|
||||
yarn build && \
|
||||
rm -rf .git
|
||||
|
||||
FROM base AS runner
|
||||
|
||||
RUN apk add --no-cache \
|
||||
ffmpeg \
|
||||
tini
|
||||
ffmpeg \
|
||||
tini
|
||||
|
||||
ENTRYPOINT ["/sbin/tini", "--"]
|
||||
|
||||
|
116
README.md
116
README.md
@ -50,119 +50,3 @@
|
||||
<div align="center">
|
||||
<a class="rss3" title="RSS3" href="https://rss3.io/" target="_blank"><img src="https://rss3.mypinata.cloud/ipfs/QmUG6H3Z7D5P511shn7sB4CPmpjH5uZWu4m5mWX7U3Gqbu" alt="RSS3" height="60"></a>
|
||||
</div>
|
||||
|
||||
## Backers
|
||||
<!-- PATREON_START -->
|
||||
<table><tr>
|
||||
<td><img src="https://c8.patreon.com/2/200/20832595" alt="Roujo " width="100"></td>
|
||||
<td><img src="https://c8.patreon.com/2/200/27956229" alt="Oliver Maximilian Seidel" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12190916/fb7fa7983c14425f890369535b1506a4/3.png?token-time=2145916800&token-hash=oH_i7gJjNT7Ot6j9JiVwy7ZJIBqACVnzLqlz4YrDAZA%3D" alt="weepjp " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/19045173/cb91c0f345c24d4ebfd05f19906d5e26/1.png?token-time=2145916800&token-hash=o_zKBytJs_AxHwSYw_5R8eD0eSJe3RoTR3kR3Q0syN0%3D" alt="kiritan " width="100"></td>
|
||||
<td><img src="https://c8.patreon.com/2/200/27648259" alt="みなしま " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/24430516/b1964ac5b9f746d2a12ff53dbc9aa40a/1.jpg?token-time=2145916800&token-hash=bmEiMGYpp3bS7hCCbymjGGsHBZM3AXuBOFO3Kro37PU%3D" alt="Eduardo Quiros" width="100"></td>
|
||||
</tr><tr>
|
||||
<td><a href="https://www.patreon.com/user?u=20832595">Roujo </a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=27956229">Oliver Maximilian Seidel</a></td>
|
||||
<td><a href="https://www.patreon.com/weepjp">weepjp </a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=19045173">kiritan </a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=27648259">みなしま </a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=24430516">Eduardo Quiros</a></td>
|
||||
</tr></table>
|
||||
<table><tr>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/14215107/1cbe1912c26143919fa0faca16f12ce1/4.jpg?token-time=2145916800&token-hash=BslMqDjTjz8KYANLvxL87agHTugHa0dMPUzT-hwR6Vk%3D" alt="Nesakko" width="100"></td>
|
||||
<td><img src="https://c8.patreon.com/2/200/776209" alt="Demogrognard" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/3075183/c2ae575c604e420297f000ccc396e395/1.jpeg?token-time=2145916800&token-hash=O9qmPtpo6wWb0OuvnkEekhk_1WO2MTdytLr7ZgsAr80%3D" alt="Liaizon Wakest" width="100"></td>
|
||||
<td><img src="https://c8.patreon.com/2/200/557245" alt="mkatze " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/23915207/25428766ecd745478e600b3d7f871eb2/1.png?token-time=2145916800&token-hash=urCLLA4KjJZX92Y1CxcBP4d8bVTHGkiaPnQZp-Tqz68%3D" alt="kabo2468y " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/8249688/4aacf36b6b244ab1bc6653591b6640df/2.png?token-time=2145916800&token-hash=1ZEf2w6L34253cZXS_HlVevLEENWS9QqrnxGUAYblPo%3D" alt="AureoleArk " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/5670915/ee175f0bfb6347ffa4ea101a8c097bff/1.jpg?token-time=2145916800&token-hash=mPLM9CA-riFHx-myr3bLZJuH2xBRHA9se5VbHhLIOuA%3D" alt="osapon " width="100"></td>
|
||||
<td><img src="https://c8.patreon.com/2/200/16869916" alt="見当かなみ " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/36813045/29876ea679d443bcbba3c3f16edab8c2/2.jpeg?token-time=2145916800&token-hash=YCKWnIhrV9rjUCV9KqtJnEqjy_uGYF3WMXftjUdpi7o%3D" alt="Wataru Manji (manji0)" width="100"></td>
|
||||
</tr><tr>
|
||||
<td><a href="https://www.patreon.com/Nesakko">Nesakko</a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=776209">Demogrognard</a></td>
|
||||
<td><a href="https://www.patreon.com/wakest">Liaizon Wakest</a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=557245">mkatze </a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=23915207">kabo2468y </a></td>
|
||||
<td><a href="https://www.patreon.com/AureoleArk">AureoleArk </a></td>
|
||||
<td><a href="https://www.patreon.com/osapon">osapon </a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=16869916">見当かなみ </a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=36813045">Wataru Manji (manji0)</a></td>
|
||||
</tr></table>
|
||||
<table><tr>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/18899730/6a22797f68254034a854d69ea2445fc8/1.png?token-time=2145916800&token-hash=b_uj57yxo5VzkSOUS7oXE_762dyOTB_oxzbO6lFNG3k%3D" alt="YuzuRyo61 " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/5788159/af42076ab3354bb49803cfba65f94bee/1.jpg?token-time=2145916800&token-hash=iSaxp_Yr2-ZiU2YVi9rcpZZj9mj3UvNSMrZr4CU4qtA%3D" alt="mewl hayabusa" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/28779508/3cd4cb7f017f4ee0864341e3464d42f9/1.png?token-time=2145916800&token-hash=eGQtR15be44kgvh8fw2Jx8Db4Bv15YBp2ldxh0EKRxA%3D" alt="S Y" width="100"></td>
|
||||
<td><img src="https://c8.patreon.com/2/200/16542964" alt="Takumi Sugita" width="100"></td>
|
||||
<td><img src="https://c8.patreon.com/2/200/17866454" alt="sikyosyounin " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/5881381/6235ca5d3fb04c8e95ef5b4ff2abcc18/3.png?token-time=2145916800&token-hash=KjfQL8nf3AIf6WqzLshBYAyX44piAqOAZiYXgZS_H6A%3D" alt="YUKIMOCHI" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/38837364/9421361c54c645ac8f5fc442a40c32e9/1.png?token-time=2145916800&token-hash=TUZB48Nem3BeUPLBH6s3P6WyKBnQOy0xKaDSTBBUNzA%3D" alt="xianon" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/26340354/08834cf767b3449e93098ef73a434e2f/2.png?token-time=2145916800&token-hash=nyM8DnKRL8hR47HQ619mUzsqVRpkWZjgtgBU9RY15Uc%3D" alt="totokoro " width="100"></td>
|
||||
</tr><tr>
|
||||
<td><a href="https://www.patreon.com/Yuzulia">YuzuRyo61 </a></td>
|
||||
<td><a href="https://www.patreon.com/hs_sh_net">mewl hayabusa</a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=28779508">S Y</a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=16542964">Takumi Sugita</a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=17866454">sikyosyounin </a></td>
|
||||
<td><a href="https://www.patreon.com/yukimochi">YUKIMOCHI</a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=38837364">xianon</a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=26340354">totokoro </a></td>
|
||||
</tr></table>
|
||||
<table><tr>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/19356899/496b4681d33b4520bd7688e0fd19c04d/2.jpeg?token-time=2145916800&token-hash=_sTj3dUBOhn9qwiJ7F19Qd-yWWfUqJC_0jG1h0agEqQ%3D" alt="sheeta.s " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/5827393/59893c191dda408f9cabd0f20a3a5627/1.jpeg?token-time=2145916800&token-hash=i9N05vOph-eP1LTLb9_npATjYOpntL0ZsHNaZFSsPmE%3D" alt="motcha " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/20494440/540beaf2445f408ea6597bc61e077bb3/1.png?token-time=2145916800&token-hash=UJ0JQge64Bx9XmN_qYA1inMQhrWf4U91fqz7VAKJeSg%3D" alt="axtuki1 " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/13737140/1adf7835017d479280d90fe8d30aade2/1.png?token-time=2145916800&token-hash=0pdle8h5pDZrww0BDOjdz6zO-HudeGTh36a3qi1biVU%3D" alt="Satsuki Yanagi" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/17880724/311738c8a48f4a6b9443c2445a75adde/1.jpg?token-time=2145916800&token-hash=nVAntpybQrznE0rg05keLrSE6ogPKJXB13rmrJng42c%3D" alt="takimura " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/13100201/fc5be4fa90444f09a9c8a06f72385272/1.png?token-time=2145916800&token-hash=i8PjlgfOB2LPEdbtWyx8ZPsBKhGcNZqcw_FQmH71UGU%3D" alt="aqz tamaina" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/9109588/e3cffc48d20a4e43afe04123e696781d/3.png?token-time=2145916800&token-hash=T_VIUA0IFIbleZv4pIjiszZGnQonwn34sLCYFIhakBo%3D" alt="nafuchoco " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/16900731/619ab87cc08448439222631ebb26802f/1.gif?token-time=2145916800&token-hash=o27K7M02s1z-LkDUEO5Oa7cu-GviRXeOXxryi4o_6VU%3D" alt="Atsuko Tominaga" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/4389829/9f709180ac714651a70f74a82f3ffdb9/3.png?token-time=2145916800&token-hash=FTm3WVom4dJ9NwWMU4OpCL_8Yc13WiwEbKrDPyTZTPs%3D" alt="natalie" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/26144593/9514b10a5c1b42a3af58621aee213d1d/1.png?token-time=2145916800&token-hash=v1PYRsjzu4c_mndN4Hvi_dlispZJsuGRCQeNS82pUSM%3D" alt="EBISUME" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/5923936/2a743cbfbff946c2af3f09026047c0da/2.png?token-time=2145916800&token-hash=h6yphW1qnM0n_NOWaf8qtszMRLXEwIxfk5beu4RxdT0%3D" alt="noellabo " width="100"></td>
|
||||
</tr><tr>
|
||||
<td><a href="https://www.patreon.com/user?u=19356899">sheeta.s </a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=5827393">motcha </a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=20494440">axtuki1 </a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=13737140">Satsuki Yanagi</a></td>
|
||||
<td><a href="https://www.patreon.com/takimura">takimura </a></td>
|
||||
<td><a href="https://www.patreon.com/aqz">aqz tamaina</a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=9109588">nafuchoco </a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=16900731">Atsuko Tominaga</a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=4389829">natalie</a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=26144593">EBISUME</a></td>
|
||||
<td><a href="https://www.patreon.com/noellabo">noellabo </a></td>
|
||||
</tr></table>
|
||||
<table><tr>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/2384390/5681180e1efb46a8b28e0e8d4c8b9037/1.jpg?token-time=2145916800&token-hash=SJcMy-Q1BcS940-LFUVOMfR7-5SgrzsEQGhYb3yowFk%3D" alt="CG " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/18072312/98e894d960314fa7bc236a72a39488fe/1.jpg?token-time=2145916800&token-hash=7bkMqTwHPRsJPGAq42PYdDXDZBVGLqdgr1ZmBxX8GFQ%3D" alt="Hekovic " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/24641572/b4fd175424814f15b0ca9178d2d2d2e4/1.png?token-time=2145916800&token-hash=e2fyqdbuJbpCckHcwux7rbuW6OPkKdERcus0u2wIEWU%3D" alt="uroco @99" width="100"></td>
|
||||
<td><img src="https://c8.patreon.com/2/200/14661394" alt="Chandler " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/5731881/4b6038e6cda34c04b83a5fcce3806a93/1.png?token-time=2145916800&token-hash=hBayGfOmQH3kRMdNnDe4oCZD_9fsJWSt29xXR3KRMVk%3D" alt="Nokotaro Takeda" width="100"></td>
|
||||
<td><img src="https://c8.patreon.com/2/200/23932002" alt="nenohi " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/9481273/7fa89168e72943859c3d3c96e424ed31/4.jpeg?token-time=2145916800&token-hash=5w1QV1qXe-NdWbdFmp1H7O_-QBsSiV0haumk3XTHIEg%3D" alt="Efertone " width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12531784/93a45137841849329ba692da92ac7c60/1.jpeg?token-time=2145916800&token-hash=vGe7wXGqmA8Q7m-kDNb6fyGdwk-Dxk4F-ut8ZZu51RM%3D" alt="Takashi Shibuya" width="100"></td>
|
||||
</tr><tr>
|
||||
<td><a href="https://www.patreon.com/Corset">CG </a></td>
|
||||
<td><a href="https://www.patreon.com/hekovic">Hekovic </a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=24641572">uroco @99</a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=14661394">Chandler </a></td>
|
||||
<td><a href="https://www.patreon.com/takenoko">Nokotaro Takeda</a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=23932002">nenohi </a></td>
|
||||
<td><a href="https://www.patreon.com/efertone">Efertone </a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=12531784">Takashi Shibuya</a></td>
|
||||
</tr></table>
|
||||
|
||||
**Last updated:** Sun, 26 Jul 2020 07:00:10 UTC
|
||||
<!-- PATREON_END -->
|
||||
|
||||
[backer-url]: #backers
|
||||
[backer-badge]: https://opencollective.com/misskey/backers/badge.svg
|
||||
[backers-image]: https://opencollective.com/misskey/backers.svg
|
||||
[sponsor-url]: #sponsors
|
||||
[sponsor-badge]: https://opencollective.com/misskey/sponsors/badge.svg
|
||||
[sponsors-image]: https://opencollective.com/misskey/sponsors.svg
|
||||
[support-url]: https://opencollective.com/misskey#support
|
||||
|
||||
[syuilo-link]: https://syuilo.com
|
||||
[syuilo-icon]: https://avatars2.githubusercontent.com/u/4439005?v=3&s=70
|
||||
|
36
ROADMAP.md
Normal file
36
ROADMAP.md
Normal file
@ -0,0 +1,36 @@
|
||||
# Roadmap
|
||||
The order of individual tasks is a guide only and is subject to change depending on the situation.
|
||||
Also, the later tasks are more indefinite and are subject to change as development progresses.
|
||||
|
||||
## (1) Improve maintainability \<current phase\>
|
||||
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)
|
||||
- Probably need to switch some libraries to others that make it difficult to reduce type errors
|
||||
- e.g. koa to fastify https://github.com/misskey-dev/misskey/issues/7537
|
||||
- Improve CI
|
||||
- Fix tests
|
||||
- mocha, jest, etc. do not support the combination of `TypeScript + ESM + Path alias`, and the tests currently do not work.
|
||||
- Fix random test failures - https://github.com/misskey-dev/misskey/issues/7985 and https://github.com/misskey-dev/misskey/issues/7986
|
||||
- Add more tests
|
||||
- May need to implement a mechanism that allows for DI
|
||||
- Improve documentation
|
||||
|
||||
## (2) Improve functionality
|
||||
Once Phase 1 is complete and an environment conducive to the development of a stable system is in place, the implementation of new functions can begin gradually.
|
||||
|
||||
- OAuth2 support https://github.com/misskey-dev/misskey/issues/8262
|
||||
- GraphQL support?
|
||||
|
||||
## (3) Improve scalability
|
||||
Once the development of the feature has settled down, this may be an opportunity to make larger modifications.
|
||||
|
||||
- Rewriting in Rust?
|
||||
|
||||
## (4) Change the world
|
||||
It is time to promote Misskey and change the world.
|
||||
|
||||
- Become more major than services such as Twitter and become critical infrastructure for the world
|
||||
- MiOS will be developed and integrated into various systems - What is MiOS?
|
||||
- Letting Ai-chan interfere with the real world
|
||||
- Make Misskey a member of GAFA; Misskey's office must be a reinforced concrete brutalist building with a courtyard.
|
@ -37,7 +37,6 @@ gulp.task('copy:client:locales', cb => {
|
||||
|
||||
gulp.task('build:backend:script', () => {
|
||||
return gulp.src(['./packages/backend/src/server/web/boot.js', './packages/backend/src/server/web/bios.js', './packages/backend/src/server/web/cli.js'])
|
||||
.pipe(replace('VERSION', JSON.stringify(meta.version)))
|
||||
.pipe(replace('LANGS', JSON.stringify(Object.keys(locales))))
|
||||
.pipe(terser({
|
||||
toplevel: true
|
||||
|
@ -189,7 +189,7 @@ clearCachedFiles: "امسح التخزين المؤقت"
|
||||
clearCachedFilesConfirm: "أتريد حذف التخزين المؤقت للملفات البعيدة؟"
|
||||
blockedInstances: "المثلاء المحجوبون"
|
||||
blockedInstancesDescription: "قائمة بالمثلاء التي تريد حظرها بحيث كل نطاق في سطر لوحده. بعد إدراجهم لن يتمكنوا من التفاعل مع هذا المثيل."
|
||||
muteAndBlock: "تم كتمها / تم حجبها"
|
||||
muteAndBlock: "المكتومون والمحجوبون"
|
||||
mutedUsers: "الحسابات المكتومة"
|
||||
blockedUsers: "الحسابات المحجوبة"
|
||||
noUsers: "ليس هناك مستخدمون"
|
||||
@ -490,7 +490,7 @@ none: "لا شيء"
|
||||
showInPage: "اعرض في الصفحة"
|
||||
popout: "منبثقة"
|
||||
volume: "مستوى الصوت"
|
||||
masterVolume: "القرص الرئيسي"
|
||||
masterVolume: "حجم الصوت الرئيس"
|
||||
details: "التفاصيل"
|
||||
chooseEmoji: "اختر إيموجي"
|
||||
unableToProcess: "يتعذر إكمال العملية"
|
||||
@ -521,6 +521,7 @@ divider: "فاصل"
|
||||
addItem: "إضافة عنصر"
|
||||
relays: "المُرَحلات"
|
||||
addRelay: "إضافة مُرحّل"
|
||||
inboxUrl: "رابط صندوق الوارد"
|
||||
addedRelays: "المرحلات المضافة"
|
||||
serviceworkerInfo: "يجب أن يفعل لإرسال الإشعارات."
|
||||
deletedNote: "ملاحظة محذوفة"
|
||||
@ -533,6 +534,8 @@ enablePlayer: "افتح مشغل الفيديو"
|
||||
disablePlayer: "أغلق مشغل الفيديو"
|
||||
themeEditor: "مصمم القوالب"
|
||||
description: "الوصف"
|
||||
describeFile: "أضف تعليقًا توضيحيًا"
|
||||
enterFileDescription: "أدخل تعليقًا توضيحيًا"
|
||||
author: "الكاتب"
|
||||
leaveConfirm: "لديك تغييرات غير محفوظة. أتريد المتابعة دون حفظها؟"
|
||||
manage: "إدارة "
|
||||
@ -564,6 +567,9 @@ smtpPass: "الكلمة السرية"
|
||||
emptyToDisableSmtpAuth: "اترك اسم المستخدم وكلمة المرور فارغين لتعطيل التحقق من SMTP"
|
||||
smtpSecureInfo: "عطل هذا الخيار عند استخدام STARTTLS"
|
||||
wordMute: "حظر الكلمات"
|
||||
regexpError: "خطأ في التعبير النمطي"
|
||||
instanceMute: "المثلاء المكتومون"
|
||||
userSaysSomething: "كتب {name} شيءً"
|
||||
makeActive: "تفعيل"
|
||||
display: "المظهر"
|
||||
copy: "نسخ"
|
||||
@ -590,10 +596,16 @@ reportAbuse: "أبلغ"
|
||||
reportAbuseOf: "أبلغ عن {name}"
|
||||
fillAbuseReportDescription: "أكتب بالتفصيل سبب البلاغ، إذا كنت تبلغ عن ملاحظة أرفق رابط لها."
|
||||
abuseReported: "أُرسل البلاغ، شكرًا لك"
|
||||
reporter: "المُبلّغ"
|
||||
reporteeOrigin: "أصل البلاغ"
|
||||
reporterOrigin: "أصل المُبلّغ"
|
||||
forwardReport: "وجّه البلاغ إلى المثيل البعيد"
|
||||
forwardReportIsAnonymous: "في المثيل البعيد سيظهر المبلّغ كحساب مجهول."
|
||||
send: "أرسل"
|
||||
abuseMarkAsResolved: "علّم البلاغ كمحلول"
|
||||
openInNewTab: "افتح في لسان جديد"
|
||||
defaultNavigationBehaviour: "سلوك الملاحة الافتراضي"
|
||||
editTheseSettingsMayBreakAccount: "تعديل هذه الإعدادات قد يسبب عطبًا لحسابك"
|
||||
instanceTicker: "معلومات المثيل الأصلي للملاحظات"
|
||||
waitingFor: "في انتظار {x}"
|
||||
random: "عشوائي"
|
||||
@ -624,10 +636,15 @@ no: "لا"
|
||||
driveFilesCount: "عدد الملفات في قرص التخزين"
|
||||
driveUsage: "المستغل من قرص التخزين"
|
||||
noCrawleDescription: "يطلب من محركات البحث ألّا يُفهرسوا ملفك الشخصي وملاحظات وصفحاتك وما شابه."
|
||||
alwaysMarkSensitive: "علّم افتراضيًا جميع ملاحظاتي كذات محتوى حساس"
|
||||
loadRawImages: "حمّل الصور الأصلية بدلًا من المصغرات"
|
||||
disableShowingAnimatedImages: "لا تشغّل الصور المتحركة"
|
||||
verificationEmailSent: "أُرسل بريد التحقق. أنقر على الرابط المضمن لإكمال التحقق."
|
||||
notSet: "لم يعيّن"
|
||||
emailVerified: "تُحقّق من بريدك الإلكتروني"
|
||||
noteFavoritesCount: "عدد الملاحظات المفضلة"
|
||||
pageLikesCount: "عدد الصفحات التي أعجبت بها"
|
||||
pageLikedCount: "عدد صفحاتك المُعجب بها"
|
||||
contact: "التواصل"
|
||||
useSystemFont: "استخدم الخط الافتراضية للنظام"
|
||||
clips: "مشابك"
|
||||
@ -635,6 +652,7 @@ experimentalFeatures: "ميّزات اختبارية"
|
||||
developer: "المطور"
|
||||
makeExplorable: "أظهر الحساب في صفحة \"استكشاف\""
|
||||
makeExplorableDescription: "بتعطيل هذا الخيار لن يظهر حسابك في صفحة \"استكشاف\""
|
||||
showGapBetweenNotesInTimeline: "أظهر فجوات بين المشاركات في الخيط الزمني"
|
||||
wide: "عريض"
|
||||
narrow: "رفيع"
|
||||
reloadToApplySetting: "سيُطبق هذا الإعداد بعد إعادة تحميل الصفحة، أتريد إعادة تحميلها الآن؟"
|
||||
@ -782,6 +800,7 @@ tenMinutes: "10 دقائق"
|
||||
oneHour: "ساعة"
|
||||
oneDay: "يوم"
|
||||
oneWeek: "أسبوع"
|
||||
failedToFetchAccountInformation: "تعذر جلب معلومات الحساب"
|
||||
_emailUnavailable:
|
||||
used: "هذا البريد الإلكتروني مستخدم"
|
||||
format: "صيغة البريد الإلكتروني غير صالحة"
|
||||
@ -860,6 +879,7 @@ _mfm:
|
||||
centerDescription: "يمركز المحتوى في الوَسَط."
|
||||
quote: "اقتبس"
|
||||
emoji: "إيموجي مخصص"
|
||||
emojiDescription: "إحاطة اسم الإيموجي بنقطتي تفسير سيستبدله بصورة الإيموجي."
|
||||
search: "البحث"
|
||||
flip: "اقلب"
|
||||
flipDescription: "يقلب المحتوى عموديًا أو أفقيًا"
|
||||
@ -871,15 +891,28 @@ _mfm:
|
||||
jumpDescription: "يمنح للمحتوى حركة قفز."
|
||||
bounce: "تأثير (ارتداد)"
|
||||
bounceDescription: "يمنح للمحتوى حركة ارتدادية"
|
||||
shake: "تأثير (اهتزاز)"
|
||||
shakeDescription: "يمنح المحتوى حركة اهتزازية."
|
||||
spin: "تأثير (دوران)"
|
||||
spinDescription: "يمنح المحتوى حركة دورانية."
|
||||
x2: "كبير"
|
||||
x2Description: "يُكبر المحتوى"
|
||||
x3: "كبير جداً"
|
||||
x3Description: "يُضخم المحتوى"
|
||||
x4: "هائل"
|
||||
x4Description: "يُضخم المحتوى أكثر مما سبق."
|
||||
blur: "طمس"
|
||||
blurDescription: "يطمس المحتوى، لكن بالتمرير فوقه سيظهر بوضوح."
|
||||
font: "الخط"
|
||||
fontDescription: "الخط المستخدم لعرض المحتوى."
|
||||
rainbow: "قوس قزح"
|
||||
rainbowDescription: "اجعل المحتوى يظهر بألوان الطيف"
|
||||
rotate: "تدوير"
|
||||
rotateDescription: "يُدير المحتوى بزاوية معيّنة."
|
||||
_instanceTicker:
|
||||
none: "لا تظهره بتاتًا"
|
||||
remote: "أظهر للمستخدمين البِعاد"
|
||||
always: "أظهره دائمًا"
|
||||
_serverDisconnectedBehavior:
|
||||
reload: "إعادة تحميل تلقائية"
|
||||
dialog: "أظهر مربع حوار التحذيرات"
|
||||
@ -899,12 +932,18 @@ _menuDisplay:
|
||||
hide: "إخفاء"
|
||||
_wordMute:
|
||||
muteWords: "الكلمات المحظورة"
|
||||
muteWordsDescription: "افصل بينهم بمسافة لاستخدام معامل \"و\" أو بسطر لاستخدام معامل \"أو\"."
|
||||
muteWordsDescription2: "احصر الكلمات المفتاحية بين بين شرطتين مائلتين لاستخدامها كتعابير نمطية"
|
||||
softDescription: "اخف الملاحظات التي تستوف الشروط من الخيط الزمني."
|
||||
hardDescription: "اخف الملاحظات التي تستوف الشروط من الخيط الزمني.بالإضافة إلى أن هذه الملاحظات ستبقى مخفية حتى وإن تغيرت الشروط."
|
||||
soft: "لينة"
|
||||
hard: "قاسية"
|
||||
mutedNotes: "الملاحظات المكتومة"
|
||||
_instanceMute:
|
||||
instanceMuteDescription: "هذه سيحجب كل ملاحظات الخوادم المحجوبة ومشاركاتها والردود على تلك الملاحظات حتى وإن كانت من خادم غير محجوب."
|
||||
instanceMuteDescription2: "مدخلة لكل سطر"
|
||||
title: "يخفي ملاحظات الخوادم المسرودة."
|
||||
heading: "قائمة الخوادم المحجوبة"
|
||||
_theme:
|
||||
explore: "استكشف قوالب المظهر"
|
||||
install: "تنصيب قالب"
|
||||
@ -1198,6 +1237,8 @@ _pages:
|
||||
font: "الخط"
|
||||
fontSerif: "Serif"
|
||||
fontSansSerif: "Sans Serif"
|
||||
eyeCatchingImageSet: "عيّن صورة مصغّرة"
|
||||
eyeCatchingImageRemove: "احذف صورة مصغّرة"
|
||||
chooseBlock: "إضافة كتلة"
|
||||
selectType: "اختر النوع"
|
||||
enterVariableName: "أدخل اسم المتغيّر"
|
||||
@ -1458,6 +1499,7 @@ _notification:
|
||||
pollVote: "مصوِت شارك في الاستطلاع"
|
||||
receiveFollowRequest: "طلبات المتابعة المتلقاة"
|
||||
followRequestAccepted: "طلبات المتابعة المقبولة"
|
||||
groupInvited: "دعوات الفريق"
|
||||
app: "إشعارات التطبيقات المرتبطة"
|
||||
_deck:
|
||||
alwaysShowMainColumn: "أظهر العمود الرئيسي دائمًا"
|
||||
|
@ -832,6 +832,10 @@ size: "আকার"
|
||||
numberOfColumn: "কলামের সংখ্যা"
|
||||
searchByGoogle: "গুগল"
|
||||
indefinitely: "অনির্দিষ্ট"
|
||||
tenMinutes: "১০ মিনিট"
|
||||
oneHour: "১ ঘণ্টা"
|
||||
oneDay: "একদিন"
|
||||
oneWeek: "এক সপ্তাহ"
|
||||
_emailUnavailable:
|
||||
used: "এই ইমেইল ঠিকানাটি ইতোমধ্যে ব্যবহৃত হয়েছে"
|
||||
format: "এই ইমেল ঠিকানাটি সঠিকভাবে লিখা হয়নি"
|
||||
|
@ -12,6 +12,7 @@ gotIt: "Ho he entès!"
|
||||
cancel: "Cancel·lar"
|
||||
smtpUser: "Nom d'usuari"
|
||||
smtpPass: "Contrasenya"
|
||||
searchByGoogle: "Cercar"
|
||||
_mfm:
|
||||
search: "Cercar"
|
||||
_sfx:
|
||||
|
@ -449,6 +449,7 @@ clearCache: "Vyprázdnit mezipaměť"
|
||||
info: "Informace"
|
||||
user: "Uživatelé"
|
||||
administration: "Administrace"
|
||||
searchByGoogle: "Vyhledávání"
|
||||
_email:
|
||||
_follow:
|
||||
title: "Máte nového následovníka"
|
||||
|
@ -478,8 +478,8 @@ promote: "Werbung schalten"
|
||||
numberOfDays: "Anzahl der Tage"
|
||||
hideThisNote: "Diese Notiz verstecken"
|
||||
showFeaturedNotesInTimeline: "Beliebte Notizen in der Chronik anzeigen"
|
||||
objectStorage: "Objektspeicher"
|
||||
useObjectStorage: "Objektspeicher verwenden"
|
||||
objectStorage: "Object Storage"
|
||||
useObjectStorage: "Object Storage verwenden"
|
||||
objectStorageBaseUrl: "Basis-URL"
|
||||
objectStorageBaseUrlDesc: "Die als Referenz verwendete URL. Verwendest du einen CDN oder Proxy, gib dessen URL an. Für S3 verwende 'https://<bucket>.s3.amazonaws.com'. Für GCS o.ä. verwende 'https://storage.googleapis.com/<bucket>'."
|
||||
objectStorageBucket: "Bucket"
|
||||
@ -827,7 +827,7 @@ overridedDeviceKind: "Gerätetyp"
|
||||
smartphone: "Smartphone"
|
||||
tablet: "Tablet"
|
||||
auto: "Automatisch"
|
||||
themeColor: "Instanzfarbe"
|
||||
themeColor: "Farbe der Instanz-Information"
|
||||
size: "Größe"
|
||||
numberOfColumn: "Spaltenanzahl"
|
||||
searchByGoogle: "Googlen"
|
||||
@ -840,6 +840,8 @@ tenMinutes: "10 Minuten"
|
||||
oneHour: "Eine Stunde"
|
||||
oneDay: "Einen Tag"
|
||||
oneWeek: "Eine Woche"
|
||||
reflectMayTakeTime: "Es kann etwas dauern, bis sich dies widerspiegelt."
|
||||
failedToFetchAccountInformation: "Benutzerkontoinformationen konnten nicht abgefragt werden"
|
||||
_emailUnavailable:
|
||||
used: "Diese Email-Adresse wird bereits verwendet"
|
||||
format: "Das Format dieser Email-Adresse ist ungültig"
|
||||
|
@ -827,7 +827,7 @@ overridedDeviceKind: "Device type"
|
||||
smartphone: "Smartphone"
|
||||
tablet: "Tablet"
|
||||
auto: "Auto"
|
||||
themeColor: "Theme Color"
|
||||
themeColor: "Instance Ticker Color"
|
||||
size: "Size"
|
||||
numberOfColumn: "Number of columns"
|
||||
searchByGoogle: "Google"
|
||||
@ -840,6 +840,8 @@ tenMinutes: "10 minutes"
|
||||
oneHour: "One hour"
|
||||
oneDay: "One day"
|
||||
oneWeek: "One week"
|
||||
reflectMayTakeTime: "It may take some time for this to be reflected."
|
||||
failedToFetchAccountInformation: "Could not fetch account information"
|
||||
_emailUnavailable:
|
||||
used: "This email address is already being used"
|
||||
format: "The format of this email address is invalid"
|
||||
|
1138
locales/eo-UY.yml
1138
locales/eo-UY.yml
File diff suppressed because it is too large
Load Diff
@ -762,6 +762,7 @@ muteThread: "Ocultar hilo"
|
||||
unmuteThread: "Mostrar hilo"
|
||||
ffVisibility: "Visibilidad de seguidores y seguidos"
|
||||
hide: "Ocultar"
|
||||
searchByGoogle: "Buscar"
|
||||
indefinitely: "Sin límite de tiempo"
|
||||
_ffVisibility:
|
||||
public: "Publicar"
|
||||
|
@ -1216,7 +1216,7 @@ _poll:
|
||||
votesCount: "{n} votes"
|
||||
totalVotes: "{n} votes au total"
|
||||
vote: "Voter"
|
||||
showResult: "Voir les résultats"
|
||||
showResult: "Voir résultats"
|
||||
voted: "Déjà voté"
|
||||
closed: "Terminé"
|
||||
remainingDays: "{d} jours, {h} heures restantes"
|
||||
|
@ -592,6 +592,7 @@ smtpSecure: "Gunakan SSL/TLS implisit untuk koneksi SMTP"
|
||||
smtpSecureInfo: "Matikan ini ketika menggunakan STARTTLS"
|
||||
testEmail: "Tes pengiriman surel"
|
||||
wordMute: "Bisukan kata"
|
||||
regexpError: "Kesalahan ekspresi reguler"
|
||||
instanceMute: "Bisuka instansi"
|
||||
userSaysSomething: "{name} mengatakan sesuatu"
|
||||
makeActive: "Aktifkan"
|
||||
@ -825,7 +826,20 @@ overridedDeviceKind: "Tipe perangkat"
|
||||
smartphone: "Ponsel"
|
||||
tablet: "Tablet"
|
||||
auto: "Otomatis"
|
||||
themeColor: "Warna Tema"
|
||||
size: "Ukuran"
|
||||
numberOfColumn: "Jumlah per kolom"
|
||||
searchByGoogle: "Penelusuran"
|
||||
instanceDefaultLightTheme: "Bawaan instan tema terang"
|
||||
instanceDefaultDarkTheme: "Bawaan instan tema gelap"
|
||||
instanceDefaultThemeDescription: "Masukkan kode tema di format obyek."
|
||||
mutePeriod: "Batas waktu bisu"
|
||||
indefinitely: "Selamanya"
|
||||
tenMinutes: "10 Menit"
|
||||
oneHour: "1 Jam"
|
||||
oneDay: "1 Hari"
|
||||
oneWeek: "1 Bulan"
|
||||
failedToFetchAccountInformation: "Gagal untuk mendapatkan informasi akun"
|
||||
_emailUnavailable:
|
||||
used: "Alamat surel ini telah digunakan"
|
||||
format: "Format tidak valid."
|
||||
@ -1598,6 +1612,7 @@ _notification:
|
||||
youReceivedFollowRequest: "Kamu menerima permintaan mengikuti"
|
||||
yourFollowRequestAccepted: "Permintaan mengikuti kamu telah diterima"
|
||||
youWereInvitedToGroup: "Telah diundang ke grup"
|
||||
pollEnded: "Hasil Kuesioner telah keluar"
|
||||
_types:
|
||||
all: "Semua"
|
||||
follow: "Ikuti"
|
||||
@ -1607,6 +1622,7 @@ _notification:
|
||||
quote: "Kutip"
|
||||
reaction: "Reaksi"
|
||||
pollVote: "Memilih di angket"
|
||||
pollEnded: "Jajak pendapat berakhir"
|
||||
receiveFollowRequest: "Permintaan mengikuti diterima"
|
||||
followRequestAccepted: "Permintaan mengikuti disetujui"
|
||||
groupInvited: "Diundang ke grup"
|
||||
|
@ -19,7 +19,6 @@ const languages = [
|
||||
'da-DK',
|
||||
'de-DE',
|
||||
'en-US',
|
||||
'eo-UY',
|
||||
'es-ES',
|
||||
'fr-FR',
|
||||
'id-ID',
|
||||
|
@ -802,6 +802,7 @@ leaveGroupConfirm: "Uscire da「{name}」?"
|
||||
useDrawerReactionPickerForMobile: "Mostra sul drawer da dispositivo mobile"
|
||||
welcomeBackWithName: "Bentornato/a, {name}"
|
||||
clickToFinishEmailVerification: "Fai click su [{ok}] per completare la verifica dell'indirizzo email."
|
||||
searchByGoogle: "Cerca"
|
||||
indefinitely: "Non scade"
|
||||
_emailUnavailable:
|
||||
used: "Email già in uso"
|
||||
|
@ -356,7 +356,7 @@ antennaExcludeKeywords: "除外キーワード"
|
||||
antennaKeywordsDescription: "スペースで区切るとAND指定になり、改行で区切るとOR指定になります"
|
||||
notifyAntenna: "新しいノートを通知する"
|
||||
withFileAntenna: "ファイルが添付されたノートのみ"
|
||||
enableServiceworker: "ServiceWorkerを有効にする"
|
||||
enableServiceworker: "ブラウザへのプッシュ通知を有効にする"
|
||||
antennaUsersDescription: "ユーザー名を改行で区切って指定します"
|
||||
caseSensitive: "大文字小文字を区別する"
|
||||
withReplies: "返信を含む"
|
||||
@ -830,7 +830,7 @@ auto: "自動"
|
||||
themeColor: "テーマカラー"
|
||||
size: "サイズ"
|
||||
numberOfColumn: "列の数"
|
||||
searchByGoogle: "ググる"
|
||||
searchByGoogle: "検索"
|
||||
instanceDefaultLightTheme: "インスタンスデフォルトのライトテーマ"
|
||||
instanceDefaultDarkTheme: "インスタンスデフォルトのダークテーマ"
|
||||
instanceDefaultThemeDescription: "オブジェクト形式のテーマコードを記入します。"
|
||||
@ -840,6 +840,8 @@ tenMinutes: "10分"
|
||||
oneHour: "1時間"
|
||||
oneDay: "1日"
|
||||
oneWeek: "1週間"
|
||||
reflectMayTakeTime: "反映されるまで時間がかかる場合があります。"
|
||||
failedToFetchAccountInformation: "アカウント情報の取得に失敗しました"
|
||||
|
||||
_emailUnavailable:
|
||||
used: "既に使用されています"
|
||||
@ -1666,8 +1668,9 @@ _notification:
|
||||
youWereFollowed: "フォローされました"
|
||||
youReceivedFollowRequest: "フォローリクエストが来ました"
|
||||
yourFollowRequestAccepted: "フォローリクエストが承認されました"
|
||||
youWereInvitedToGroup: "グループに招待されました"
|
||||
youWereInvitedToGroup: "{userName}があなたをグループに招待しました"
|
||||
pollEnded: "アンケートの結果が出ました"
|
||||
emptyPushNotificationMessage: "プッシュ通知の更新をしました"
|
||||
|
||||
_types:
|
||||
all: "すべて"
|
||||
@ -1684,6 +1687,11 @@ _notification:
|
||||
groupInvited: "グループに招待された"
|
||||
app: "連携アプリからの通知"
|
||||
|
||||
_actions:
|
||||
followBack: "フォローバック"
|
||||
reply: "返信"
|
||||
renote: "Renote"
|
||||
|
||||
_deck:
|
||||
alwaysShowMainColumn: "常にメインカラムを表示"
|
||||
columnAlign: "カラムの寄せ"
|
||||
|
@ -655,6 +655,7 @@ global: "グローバル"
|
||||
sent: "送信"
|
||||
hashtags: "ハッシュタグ"
|
||||
hide: "隠す"
|
||||
searchByGoogle: "探す"
|
||||
indefinitely: "無期限"
|
||||
_ad:
|
||||
back: "戻る"
|
||||
|
@ -55,6 +55,7 @@ accountInfo: "Talɣut n umiḍan"
|
||||
emailNotification: "Ilɣa imayl"
|
||||
selectAccount: "Fren amiḍan"
|
||||
accounts: "Imiḍan"
|
||||
searchByGoogle: "Nadi"
|
||||
_email:
|
||||
_follow:
|
||||
title: "Yeṭṭafaṛ-ik·em-id"
|
||||
|
@ -59,6 +59,7 @@ remove: "ಅಳಿಸು"
|
||||
smtpUser: "ಬಳಕೆಹೆಸರು"
|
||||
smtpPass: "ಗುಪ್ತಪದ"
|
||||
user: "ಬಳಕೆದಾರ"
|
||||
searchByGoogle: "ಹುಡುಕು"
|
||||
_email:
|
||||
_follow:
|
||||
title: "ಹಿಂಬಾಲಿಸಿದರು"
|
||||
|
@ -825,6 +825,7 @@ overridedDeviceKind: "장치 유형"
|
||||
smartphone: "스마트폰"
|
||||
tablet: "태블릿"
|
||||
auto: "자동"
|
||||
searchByGoogle: "검색"
|
||||
indefinitely: "무기한"
|
||||
_emailUnavailable:
|
||||
used: "이 메일 주소는 사용중입니다"
|
||||
|
@ -119,6 +119,23 @@ unblock: "Deblokkeren"
|
||||
suspend: "Opschorten"
|
||||
unsuspend: "Heractiveren"
|
||||
blockConfirm: "Weet je zeker dat je dit account wil blokkeren?"
|
||||
unblockConfirm: "Ben je zeker dat je deze account wil blokkeren?"
|
||||
suspendConfirm: "Ben je zeker dat je deze account wil suspenderen?"
|
||||
unsuspendConfirm: "Ben je zeker dat je deze account wil opnieuw aanstellen?"
|
||||
flagAsBot: "Markeer dit account als een robot."
|
||||
flagAsBotDescription: "Als dit account van een programma wordt beheerd, zet deze vlag aan. Het aanzetten helpt andere ontwikkelaars om bijvoorbeeld onbedoelde feedback loops te doorbreken of om Misskey meer geschikt te maken."
|
||||
flagAsCat: "Markeer dit account als een kat."
|
||||
flagAsCatDescription: "Zet deze vlag aan als je wilt aangeven dat dit account een kat is."
|
||||
flagShowTimelineReplies: "Toon antwoorden op de tijdlijn."
|
||||
flagShowTimelineRepliesDescription: "Als je dit vlag aanzet, toont de tijdlijn ook antwoorden op andere en niet alleen jouw eigen notities."
|
||||
autoAcceptFollowed: "Accepteer verzoeken om jezelf te volgen vanzelf als je de verzoeker al volgt."
|
||||
addAccount: "Account toevoegen"
|
||||
loginFailed: "Aanmelding mislukt."
|
||||
showOnRemote: "Toon op de externe instantie."
|
||||
general: "Algemeen"
|
||||
wallpaper: "Achtergrond"
|
||||
setWallpaper: "Achtergrond instellen"
|
||||
removeWallpaper: "Achtergrond verwijderen"
|
||||
searchWith: "Zoeken: {q}"
|
||||
youHaveNoLists: "Je hebt geen lijsten"
|
||||
followConfirm: "Weet je zeker dat je {name} wilt volgen?"
|
||||
@ -205,6 +222,8 @@ resetAreYouSure: "Resetten?"
|
||||
saved: "Opgeslagen"
|
||||
messaging: "Chat"
|
||||
upload: "Uploaden"
|
||||
keepOriginalUploading: "Origineel beeld behouden."
|
||||
keepOriginalUploadingDescription: "Bewaar de originele versie bij het uploaden van afbeeldingen. Indien uitgeschakeld, wordt bij het uploaden een alternatieve versie voor webpublicatie genereert."
|
||||
fromDrive: "Van schijf"
|
||||
fromUrl: "Van URL"
|
||||
uploadFromUrl: "Uploaden vanaf een URL"
|
||||
@ -245,9 +264,36 @@ renameFile: "Wijzig bestandsnaam"
|
||||
folderName: "Mapnaam"
|
||||
createFolder: "Map aanmaken"
|
||||
renameFolder: "Map hernoemen"
|
||||
deleteFolder: "Map verwijderen"
|
||||
addFile: "Bestand toevoegen"
|
||||
emptyDrive: "Jouw Drive is leeg."
|
||||
emptyFolder: "Deze map is leeg"
|
||||
unableToDelete: "Kan niet worden verwijderd"
|
||||
inputNewFileName: "Voer een nieuwe naam in"
|
||||
copyUrl: "URL kopiëren"
|
||||
rename: "Hernoemen"
|
||||
avatar: "Avatar"
|
||||
banner: "Banner"
|
||||
nsfw: "NSFW"
|
||||
whenServerDisconnected: "Wanneer de verbinding met de server wordt onderbroken"
|
||||
disconnectedFromServer: "Verbinding met de server onderbroken."
|
||||
inMb: "in megabytes"
|
||||
pinnedNotes: "Vastgemaakte notitie"
|
||||
userList: "Lijsten"
|
||||
aboutMisskey: "Over Misskey"
|
||||
administrator: "Beheerder"
|
||||
token: "Token"
|
||||
securityKeyName: "Sleutelnaam"
|
||||
registerSecurityKey: "Zekerheids-Sleutel registreren"
|
||||
lastUsed: "Laatst gebruikt"
|
||||
unregister: "Uitschrijven"
|
||||
passwordLessLogin: "Inloggen zonder wachtwoord"
|
||||
resetPassword: "Wachtwoord terugzetten"
|
||||
newPasswordIs: "Het nieuwe wachtwoord is „{password}”."
|
||||
reduceUiAnimation: "Verminder beweging in de UI"
|
||||
share: "Delen"
|
||||
notFound: "Niet gevonden"
|
||||
cacheClear: "Cache verwijderen"
|
||||
smtpHost: "Server"
|
||||
smtpUser: "Gebruikersnaam"
|
||||
smtpPass: "Wachtwoord"
|
||||
@ -256,6 +302,7 @@ user: "Gebruikers"
|
||||
muteThread: "Discussies dempen "
|
||||
unmuteThread: "Dempen van discussie ongedaan maken"
|
||||
hide: "Verbergen"
|
||||
searchByGoogle: "Zoeken"
|
||||
_email:
|
||||
_follow:
|
||||
title: "volgde jou"
|
||||
|
@ -758,6 +758,7 @@ received: "Otrzymane"
|
||||
hashtags: "Hashtag"
|
||||
pubSub: "Konta Pub/Sub"
|
||||
hide: "Ukryj"
|
||||
searchByGoogle: "Szukaj"
|
||||
indefinitely: "Nigdy"
|
||||
_ffVisibility:
|
||||
public: "Publikuj"
|
||||
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
_lang_: "Português"
|
||||
headlineMisskey: "Rede conectada por notas"
|
||||
introMisskey: "Bem-vindo! Misskey é um serviço de microblogue descentralizado de código aberto.\nCria \"notas\" e partilha o que te ocorre com todos à tua volta. 📡\nCom \"reações\" podes também expressar logo o que sentes às notas de todos. 👍\nExploremos um novo mundo! 🚀"
|
||||
monthAndDay: "{day}/{month}"
|
||||
search: "Pesquisar"
|
||||
notifications: "Notificações"
|
||||
@ -22,6 +23,7 @@ otherSettings: "Outras configurações"
|
||||
openInWindow: "Abrir numa janela"
|
||||
profile: "Perfil"
|
||||
timeline: "Timeline"
|
||||
noAccountDescription: "Este usuário não tem uma descrição."
|
||||
login: "Iniciar sessão"
|
||||
loggingIn: "Iniciando sessão…"
|
||||
logout: "Sair"
|
||||
@ -29,8 +31,12 @@ signup: "Registrar-se"
|
||||
uploading: "Enviando…"
|
||||
save: "Guardar"
|
||||
users: "Usuários"
|
||||
addUser: "Adicionar usuário"
|
||||
favorite: "Favoritar"
|
||||
favorites: "Favoritar"
|
||||
unfavorite: "Remover dos favoritos"
|
||||
favorited: "Adicionado aos favoritos."
|
||||
alreadyFavorited: "Já adicionado aos favoritos."
|
||||
showMore: "Ver mais"
|
||||
youGotNewFollower: "Você tem um novo seguidor"
|
||||
followRequestAccepted: "Pedido de seguir aceito"
|
||||
@ -61,6 +67,7 @@ pinnedNotes: "Post fixado"
|
||||
smtpUser: "Nome de usuário"
|
||||
smtpPass: "Senha"
|
||||
user: "Usuários"
|
||||
searchByGoogle: "Pesquisar"
|
||||
_email:
|
||||
_follow:
|
||||
title: "Você tem um novo seguidor"
|
||||
|
@ -449,6 +449,56 @@ groupInvited: "Ai fost invitat într-un grup"
|
||||
aboutX: "Despre {x}"
|
||||
useOsNativeEmojis: "Folosește emojiuri native OS-ului"
|
||||
disableDrawer: "Nu folosi meniuri în stil sertar"
|
||||
youHaveNoGroups: "Nu ai niciun grup"
|
||||
joinOrCreateGroup: "Primește o invitație într-un grup sau creează unul nou."
|
||||
noHistory: "Nu există istoric"
|
||||
signinHistory: "Istoric autentificări"
|
||||
disableAnimatedMfm: "Dezactivează MFM cu animații"
|
||||
doing: "Se procesează..."
|
||||
category: "Categorie"
|
||||
tags: "Etichete"
|
||||
docSource: "Sursa acestui document"
|
||||
createAccount: "Creează un cont"
|
||||
existingAccount: "Cont existent"
|
||||
regenerate: "Regenerează"
|
||||
fontSize: "Mărimea fontului"
|
||||
noFollowRequests: "Nu ai nicio cerere de urmărire în așteptare"
|
||||
openImageInNewTab: "Deschide imaginile în taburi noi"
|
||||
dashboard: "Panou de control"
|
||||
local: "Local"
|
||||
remote: "Extern"
|
||||
total: "Total"
|
||||
weekOverWeekChanges: "Schimbări până săptămâna trecută"
|
||||
dayOverDayChanges: "Schimbări până ieri"
|
||||
appearance: "Aspect"
|
||||
clientSettings: "Setări client"
|
||||
accountSettings: "Setări cont"
|
||||
promotion: "Promovat"
|
||||
promote: "Promovează"
|
||||
numberOfDays: "Numărul zilelor"
|
||||
hideThisNote: "Ascunde această notă"
|
||||
showFeaturedNotesInTimeline: "Arată notele recomandate în cronologii"
|
||||
objectStorage: "Object Storage"
|
||||
useObjectStorage: "Folosește Object Storage"
|
||||
objectStorageBaseUrl: "URL de bază"
|
||||
objectStorageBaseUrlDesc: "URL-ul este folosit pentru referință. Specifică URL-ul CDN-ului sau Proxy-ului tău dacă folosești unul. Pentru S3 folosește 'https://<bucket>.s3.amazonaws.com' și pentru GCS sau servicii echivalente folosește 'https://storage.googleapis.com/<bucket>', etc."
|
||||
objectStorageBucket: "Bucket"
|
||||
objectStorageBucketDesc: "Te rog specifică numele bucket-ului furnizorului tău."
|
||||
objectStoragePrefix: "Prefix"
|
||||
objectStoragePrefixDesc: "Fișierele vor fi stocate sub directoare cu acest prefix."
|
||||
objectStorageEndpoint: "Endpoint"
|
||||
objectStorageEndpointDesc: "Lasă acest câmp gol dacă folosești AWS S3, dacă nu specifică endpoint-ul ca '<host>' sau '<host>:<port>', depinzând de ce serviciu folosești."
|
||||
objectStorageRegion: "Regiune"
|
||||
objectStorageRegionDesc: "Specifică o regiune precum 'xx-east-1'. Dacă serviciul tău nu face distincția între regiuni lasă acest câmp gol sau introdu 'us-east-1'."
|
||||
objectStorageUseSSL: "Folosește SSl"
|
||||
objectStorageUseSSLDesc: "Oprește această opțiune dacă nu vei folosi HTTPS pentru conexiunile API-ului"
|
||||
objectStorageUseProxy: "Conectează-te prin Proxy"
|
||||
objectStorageUseProxyDesc: "Oprește această opțiune dacă vei nu folosi un Proxy pentru conexiunile API-ului"
|
||||
objectStorageSetPublicRead: "Setează \"public-read\" pentru încărcare"
|
||||
serverLogs: "Loguri server"
|
||||
deleteAll: "Șterge tot"
|
||||
showFixedPostForm: "Arată caseta de postare în vârful cronologie"
|
||||
newNoteRecived: "Sunt note noi"
|
||||
sounds: "Sunete"
|
||||
listen: "Ascultă"
|
||||
none: "Nimic"
|
||||
@ -471,12 +521,55 @@ sort: "Sortează"
|
||||
ascendingOrder: "Crescător"
|
||||
descendingOrder: "Descrescător"
|
||||
scratchpad: "Scratchpad"
|
||||
scratchpadDescription: "Scratchpad-ul oferă un mediu de experimentare în AiScript. Poți scrie, executa și verifica rezultatele acestuia interacționând cu Misskey în el."
|
||||
output: "Ieșire"
|
||||
script: "Script"
|
||||
disablePagesScript: "Dezactivează AiScript în Pagini"
|
||||
updateRemoteUser: "Actualizează informațiile utilizatorului extern"
|
||||
deleteAllFiles: "Șterge toate fișierele"
|
||||
deleteAllFilesConfirm: "Ești sigur că vrei să ștergi toate fișierele?"
|
||||
removeAllFollowing: "Dezurmărește toți utilizatorii urmăriți"
|
||||
removeAllFollowingDescription: "Asta va dez-urmări toate conturile din {host}. Te rog execută asta numai dacă instanța, de ex., nu mai există."
|
||||
userSuspended: "Acest utilizator a fost suspendat."
|
||||
userSilenced: "Acest utilizator a fost setat silențios."
|
||||
yourAccountSuspendedTitle: "Acest cont a fost suspendat"
|
||||
yourAccountSuspendedDescription: "Acest cont a fost suspendat din cauza încălcării termenilor de serviciu al serverului sau ceva similar. Contactează administratorul dacă ai dori să afli un motiv mai detaliat. Te rog nu crea un cont nou."
|
||||
menu: "Meniu"
|
||||
divider: "Separator"
|
||||
addItem: "Adaugă element"
|
||||
relays: "Relee"
|
||||
addRelay: "Adaugă Releu"
|
||||
inboxUrl: "URL-ul inbox-ului"
|
||||
addedRelays: "Relee adăugate"
|
||||
serviceworkerInfo: "Trebuie să fie activat pentru notificări push."
|
||||
deletedNote: "Notă ștearsă"
|
||||
invisibleNote: "Note ascunse"
|
||||
enableInfiniteScroll: "Încarcă mai mult automat"
|
||||
visibility: "Vizibilitate"
|
||||
poll: "Sondaj"
|
||||
useCw: "Ascunde conținutul"
|
||||
enablePlayer: "Deschide player-ul video"
|
||||
disablePlayer: "Închide player-ul video"
|
||||
expandTweet: "Expandează tweet"
|
||||
themeEditor: "Editor de teme"
|
||||
description: "Descriere"
|
||||
describeFile: "Adaugă titrări"
|
||||
enterFileDescription: "Introdu titrările"
|
||||
author: "Autor"
|
||||
leaveConfirm: "Ai schimbări nesalvate. Vrei să renunți la ele?"
|
||||
manage: "Gestionare"
|
||||
plugins: "Pluginuri"
|
||||
deck: "Deck"
|
||||
undeck: "Părăsește Deck"
|
||||
useBlurEffectForModal: "Folosește efect de blur pentru modale"
|
||||
smtpHost: "Gazdă"
|
||||
smtpUser: "Nume de utilizator"
|
||||
smtpPass: "Parolă"
|
||||
clearCache: "Golește cache-ul"
|
||||
info: "Despre"
|
||||
user: "Utilizatori"
|
||||
administration: "Gestionare"
|
||||
searchByGoogle: "Caută"
|
||||
_email:
|
||||
_follow:
|
||||
title: "te-a urmărit"
|
||||
@ -486,9 +579,11 @@ _mfm:
|
||||
emoji: "Emoji personalizat"
|
||||
search: "Caută"
|
||||
_theme:
|
||||
description: "Descriere"
|
||||
keys:
|
||||
mention: "Mențiune"
|
||||
renote: "Re-notează"
|
||||
divider: "Separator"
|
||||
_sfx:
|
||||
note: "Note"
|
||||
notification: "Notificări"
|
||||
|
@ -815,6 +815,7 @@ leaveGroupConfirm: "Покинуть группу «{name}»?"
|
||||
useDrawerReactionPickerForMobile: "Выдвижная палитра на мобильном устройстве"
|
||||
welcomeBackWithName: "С возвращением, {name}!"
|
||||
clickToFinishEmailVerification: "Пожалуйста, нажмите [{ok}], чтобы завершить подтверждение адреса электронной почты."
|
||||
searchByGoogle: "Поиск"
|
||||
indefinitely: "вечно"
|
||||
_emailUnavailable:
|
||||
used: "Уже используется"
|
||||
|
@ -839,6 +839,8 @@ tenMinutes: "10 minút"
|
||||
oneHour: "1 hodina"
|
||||
oneDay: "1 deň"
|
||||
oneWeek: "1 týždeň"
|
||||
reflectMayTakeTime: "Zmeny môžu chvíľu trvať kým sa prejavia."
|
||||
failedToFetchAccountInformation: "Nepodarilo sa načítať informácie o účte."
|
||||
_emailUnavailable:
|
||||
used: "Táto emailová adresa sa už používa"
|
||||
format: "Formát emailovej adresy je nesprávny"
|
||||
|
@ -47,6 +47,7 @@ remove: "Sil"
|
||||
smtpUser: "Kullanıcı Adı"
|
||||
smtpPass: "Şifre"
|
||||
user: "Kullanıcı"
|
||||
searchByGoogle: "Arama"
|
||||
_mfm:
|
||||
search: "Arama"
|
||||
_sfx:
|
||||
|
@ -1,5 +1,6 @@
|
||||
---
|
||||
_lang_: "ياپونچە"
|
||||
search: "ئىزدەش"
|
||||
searchByGoogle: "ئىزدەش"
|
||||
_mfm:
|
||||
search: "ئىزدەش"
|
||||
|
@ -685,6 +685,7 @@ global: "Глобальна"
|
||||
sent: "Відправити"
|
||||
hashtags: "Хештеґ"
|
||||
hide: "Сховати"
|
||||
searchByGoogle: "Пошук"
|
||||
indefinitely: "Ніколи"
|
||||
_ad:
|
||||
back: "Назад"
|
||||
|
@ -8,12 +8,12 @@ notifications: "通知"
|
||||
username: "用户名"
|
||||
password: "密码"
|
||||
forgotPassword: "忘记密码"
|
||||
fetchingAsApObject: "联合查询"
|
||||
fetchingAsApObject: "在联邦宇宙查询中..."
|
||||
ok: "OK"
|
||||
gotIt: "我明白了"
|
||||
cancel: "取消"
|
||||
enterUsername: "输入用户名"
|
||||
renotedBy: "由 {user} 转推"
|
||||
renotedBy: "由 {user} 转贴"
|
||||
noNotes: "没有帖文"
|
||||
noNotifications: "无通知"
|
||||
instance: "实例"
|
||||
@ -69,7 +69,7 @@ exportRequested: "导出请求已提交,这可能需要花一些时间,导
|
||||
importRequested: "导入请求已提交,这可能需要花一点时间。"
|
||||
lists: "列表"
|
||||
noLists: "列表为空"
|
||||
note: "帖子"
|
||||
note: "发帖"
|
||||
notes: "帖子"
|
||||
following: "关注中"
|
||||
followers: "关注者"
|
||||
@ -85,7 +85,7 @@ serverIsDead: "服务器没有响应。 请稍等片刻,然后重试。"
|
||||
youShouldUpgradeClient: "请重新加载并使用新版本的客户端查看此页面。"
|
||||
enterListName: "输入列表名称"
|
||||
privacy: "隐私"
|
||||
makeFollowManuallyApprove: "关注者的关注请求需要批准"
|
||||
makeFollowManuallyApprove: "关注请求需要批准"
|
||||
defaultNoteVisibility: "默认可见性"
|
||||
follow: "关注"
|
||||
followRequest: "关注申请"
|
||||
@ -143,7 +143,7 @@ flagAsCat: "将这个账户设定为一只猫"
|
||||
flagAsCatDescription: "如果您想表明此帐户是一只猫,请打开此标志。"
|
||||
flagShowTimelineReplies: "在时间线上显示帖子的回复"
|
||||
flagShowTimelineRepliesDescription: "启用时,时间线除了显示用户的帖子外,还会显示其他用户对帖子的回复。"
|
||||
autoAcceptFollowed: "自动允许关注"
|
||||
autoAcceptFollowed: "自动允许关注者的关注"
|
||||
addAccount: "添加账户"
|
||||
loginFailed: "登录失败"
|
||||
showOnRemote: "转到所在实例显示"
|
||||
@ -162,7 +162,7 @@ recipient: "收件人"
|
||||
annotation: "注解"
|
||||
federation: "联合"
|
||||
instances: "实例"
|
||||
registeredAt: "初次观察"
|
||||
registeredAt: "初次观测"
|
||||
latestRequestSentAt: "上次发送的请求"
|
||||
latestRequestReceivedAt: "上次收到的请求"
|
||||
latestStatus: "最后状态"
|
||||
@ -254,7 +254,7 @@ agreeTo: "{0}人同意"
|
||||
tos: "服务条款"
|
||||
start: "开始"
|
||||
home: "首页"
|
||||
remoteUserCaution: "由于是远程用户,信息不完整。"
|
||||
remoteUserCaution: "由于此用户来自其它实例,显示的信息可能不完整。"
|
||||
activity: "活动"
|
||||
images: "图片"
|
||||
birthday: "生日"
|
||||
@ -372,7 +372,7 @@ recentlyUpdatedUsers: "最近投稿的用户"
|
||||
recentlyRegisteredUsers: "最近登录的用户"
|
||||
recentlyDiscoveredUsers: "最近发现的用户"
|
||||
exploreUsersCount: "有{count}个用户"
|
||||
exploreFediverse: "探索Fediverse"
|
||||
exploreFediverse: "探索联邦宇宙"
|
||||
popularTags: "热门标签"
|
||||
userList: "列表"
|
||||
about: "关于"
|
||||
@ -561,7 +561,7 @@ manage: "管理"
|
||||
plugins: "插件"
|
||||
deck: "Deck"
|
||||
undeck: "取消Deck"
|
||||
useBlurEffectForModal: "模态框使用模糊效果"
|
||||
useBlurEffectForModal: "对话框使用模糊效果"
|
||||
useFullReactionPicker: "使用全功能的回应工具栏"
|
||||
width: "宽度"
|
||||
height: "高度"
|
||||
@ -840,6 +840,8 @@ tenMinutes: "10分钟"
|
||||
oneHour: "1小时"
|
||||
oneDay: "1天"
|
||||
oneWeek: "1周"
|
||||
reflectMayTakeTime: "可能需要一些时间才能体现出效果。"
|
||||
failedToFetchAccountInformation: "获取账户信息失败"
|
||||
_emailUnavailable:
|
||||
used: "已经被使用过"
|
||||
format: "无效的格式"
|
||||
@ -904,7 +906,7 @@ _nsfw:
|
||||
_mfm:
|
||||
cheatSheet: "MFM代码速查表"
|
||||
intro: "MFM是一种在Misskey中的各个位置使用的专用标记语言。在这里您可以看到MFM中可用的语法列表。"
|
||||
dummy: "通过Misskey扩展Fediverse的世界"
|
||||
dummy: "通过Misskey扩展联邦宇宙的世界"
|
||||
mention: "提及"
|
||||
mentionDescription: "可以使用 @+用户名 来指示特定用户"
|
||||
hashtag: "话题标签"
|
||||
@ -967,7 +969,7 @@ _mfm:
|
||||
rotateDescription: "旋转指定的角度。"
|
||||
_instanceTicker:
|
||||
none: "不显示"
|
||||
remote: "仅显示远程用户的"
|
||||
remote: "仅远程用户"
|
||||
always: "始终显示"
|
||||
_serverDisconnectedBehavior:
|
||||
reload: "自动重载"
|
||||
@ -1051,7 +1053,7 @@ _theme:
|
||||
mention: "提及"
|
||||
mentionMe: "提及"
|
||||
renote: "转发"
|
||||
modalBg: "模态框背景"
|
||||
modalBg: "对话框背景"
|
||||
divider: "分割线"
|
||||
scrollbarHandle: "滚动条"
|
||||
scrollbarHandleHover: "滚动条(悬停)"
|
||||
@ -1238,7 +1240,7 @@ _visibility:
|
||||
publicDescription: "您的帖子将出现在全局时间线上"
|
||||
home: "首页"
|
||||
homeDescription: "仅发送至首页的时间线"
|
||||
followers: "关注者"
|
||||
followers: "仅关注者"
|
||||
followersDescription: "仅发送至关注者"
|
||||
specified: "指定用户"
|
||||
specifiedDescription: "仅发送至指定用户"
|
||||
|
@ -81,6 +81,8 @@ somethingHappened: "發生錯誤"
|
||||
retry: "重試"
|
||||
pageLoadError: "載入頁面失敗"
|
||||
pageLoadErrorDescription: "這通常是因為網路錯誤或是瀏覽器快取殘留的原因。請先清除瀏覽器快取,稍後再重試"
|
||||
serverIsDead: "伺服器沒有回應。請稍等片刻,然後重試。"
|
||||
youShouldUpgradeClient: "請重新載入以使用新版本的客戶端顯示此頁面"
|
||||
enterListName: "輸入清單名稱"
|
||||
privacy: "隱私"
|
||||
makeFollowManuallyApprove: "手動審核追隨請求"
|
||||
@ -104,6 +106,7 @@ clickToShow: "按一下以顯示"
|
||||
sensitive: "敏感內容"
|
||||
add: "新增"
|
||||
reaction: "情感"
|
||||
reactionSetting: "在選擇器中顯示反應"
|
||||
reactionSettingDescription2: "拖動以重新列序,點擊以刪除,按下 + 添加。"
|
||||
rememberNoteVisibility: "記住貼文可見性"
|
||||
attachCancel: "移除附件"
|
||||
@ -138,6 +141,7 @@ flagAsBot: "此使用者是機器人"
|
||||
flagAsBotDescription: "如果本帳戶是由程式控制,請啟用此選項。啟用後,會作為標示幫助其他開發者防止機器人之間產生無限互動的行為,並會調整Misskey內部系統將本帳戶識別為機器人"
|
||||
flagAsCat: "此使用者是貓"
|
||||
flagAsCatDescription: "如果想將本帳戶標示為一隻貓,請開啟此標示"
|
||||
flagShowTimelineReplies: "在時間軸上顯示貼文的回覆"
|
||||
autoAcceptFollowed: "自動追隨中使用者的追隨請求"
|
||||
addAccount: "添加帳戶"
|
||||
loginFailed: "登入失敗"
|
||||
@ -599,6 +603,9 @@ reportAbuse: "檢舉"
|
||||
reportAbuseOf: "檢舉{name}"
|
||||
fillAbuseReportDescription: "請填寫檢舉的詳細理由。可以的話,請附上針對的URL網址。"
|
||||
abuseReported: "回報已送出。感謝您的報告。"
|
||||
reporter: "檢舉者"
|
||||
reporteeOrigin: "檢舉來源"
|
||||
reporterOrigin: "檢舉者來源"
|
||||
send: "發送"
|
||||
abuseMarkAsResolved: "處理完畢"
|
||||
openInNewTab: "在新分頁中開啟"
|
||||
@ -734,6 +741,7 @@ postToGallery: "發佈到相簿"
|
||||
gallery: "相簿"
|
||||
recentPosts: "最新貼文"
|
||||
popularPosts: "熱門的貼文"
|
||||
shareWithNote: "在貼文中分享"
|
||||
ads: "廣告"
|
||||
expiration: "期限"
|
||||
memo: "備忘錄"
|
||||
@ -743,13 +751,35 @@ middle: "中"
|
||||
low: "低"
|
||||
emailNotConfiguredWarning: "沒有設定電子郵件地址"
|
||||
ratio: "%"
|
||||
previewNoteText: "預覽文本"
|
||||
customCss: "自定義 CSS"
|
||||
global: "公開"
|
||||
sent: "發送"
|
||||
received: "收取"
|
||||
searchResult: "搜尋結果"
|
||||
hashtags: "#tag"
|
||||
troubleshooting: "故障排除"
|
||||
useBlurEffect: "在 UI 上使用模糊效果"
|
||||
misskeyUpdated: "Misskey 更新完成!"
|
||||
translate: "翻譯"
|
||||
translatedFrom: "從 {x} 翻譯"
|
||||
accountDeletionInProgress: "正在刪除帳戶"
|
||||
pubSub: "Pub/Sub 帳戶"
|
||||
resolved: "已解決"
|
||||
unresolved: "未解決"
|
||||
breakFollow: "移除追蹤者"
|
||||
hide: "隱藏"
|
||||
leaveGroupConfirm: "確定離開「{name}」?"
|
||||
auto: "自動"
|
||||
searchByGoogle: "搜尋"
|
||||
indefinitely: "無期限"
|
||||
_ffVisibility:
|
||||
public: "發佈"
|
||||
private: "私密"
|
||||
_signup:
|
||||
almostThere: "即將完成"
|
||||
_accountDelete:
|
||||
inProgress: "正在刪除"
|
||||
_ad:
|
||||
back: "返回"
|
||||
reduceFrequencyOfThisAd: "降低此廣告的頻率 "
|
||||
|
15
package.json
15
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"version": "12.108.0",
|
||||
"version": "12.110.1",
|
||||
"codename": "indigo",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -13,8 +13,7 @@
|
||||
"start": "cd packages/backend && node --experimental-json-modules ./built/index.js",
|
||||
"start:test": "cd packages/backend && cross-env NODE_ENV=test node --experimental-json-modules ./built/index.js",
|
||||
"init": "npm run migrate",
|
||||
"ormconfig": "node ./packages/backend/ormconfig.js",
|
||||
"migrate": "cd packages/backend && npx typeorm migration:run",
|
||||
"migrate": "cd packages/backend && npx typeorm migration:run -d ormconfig.js",
|
||||
"migrateandstart": "npm run migrate && npm run start",
|
||||
"gulp": "gulp build",
|
||||
"watch": "npm run dev",
|
||||
@ -31,8 +30,6 @@
|
||||
"cleanall": "npm run clean-all"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/gulp": "4.0.9",
|
||||
"@types/gulp-rename": "2.0.1",
|
||||
"execa": "5.1.1",
|
||||
"gulp": "4.0.2",
|
||||
"gulp-cssnano": "2.1.3",
|
||||
@ -42,10 +39,12 @@
|
||||
"js-yaml": "4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/parser": "5.14.0",
|
||||
"@types/gulp": "4.0.9",
|
||||
"@types/gulp-rename": "2.0.1",
|
||||
"@typescript-eslint/parser": "5.18.0",
|
||||
"cross-env": "7.0.3",
|
||||
"cypress": "9.5.0",
|
||||
"cypress": "9.5.3",
|
||||
"start-server-and-test": "1.14.0",
|
||||
"typescript": "4.6.2"
|
||||
"typescript": "4.6.3"
|
||||
}
|
||||
}
|
||||
|
21
packages/backend/.eslintrc.cjs
Normal file
21
packages/backend/.eslintrc.cjs
Normal file
@ -0,0 +1,21 @@
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
project: ['./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'
|
||||
}
|
||||
],
|
||||
}]
|
||||
},
|
||||
};
|
@ -1,9 +0,0 @@
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
project: ['./tsconfig.json'],
|
||||
},
|
||||
extends: [
|
||||
'../shared/.eslintrc.js',
|
||||
],
|
||||
};
|
4
packages/backend/.vscode/settings.json
vendored
4
packages/backend/.vscode/settings.json
vendored
@ -2,5 +2,9 @@
|
||||
"typescript.tsdk": "node_modules\\typescript\\lib",
|
||||
"path-intellisense.mappings": {
|
||||
"@": "${workspaceRoot}/packages/backend/src/"
|
||||
},
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": true
|
||||
}
|
||||
}
|
||||
|
19
packages/backend/migration/1648548247382-webhook.js
Normal file
19
packages/backend/migration/1648548247382-webhook.js
Normal file
@ -0,0 +1,19 @@
|
||||
export class webhook1648548247382 {
|
||||
name = 'webhook1648548247382'
|
||||
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`CREATE TABLE "webhook" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "on" character varying(128) array NOT NULL DEFAULT '{}', "url" character varying(1024) NOT NULL, "secret" character varying(1024) NOT NULL, "active" boolean NOT NULL DEFAULT true, CONSTRAINT "PK_e6765510c2d078db49632b59020" PRIMARY KEY ("id")); COMMENT ON COLUMN "webhook"."createdAt" IS 'The created date of the Antenna.'; COMMENT ON COLUMN "webhook"."userId" IS 'The owner ID.'; COMMENT ON COLUMN "webhook"."name" IS 'The name of the Antenna.'`);
|
||||
await queryRunner.query(`CREATE INDEX "IDX_f272c8c8805969e6a6449c77b3" ON "webhook" ("userId") `);
|
||||
await queryRunner.query(`CREATE INDEX "IDX_8063a0586ed1dfbe86e982d961" ON "webhook" ("on") `);
|
||||
await queryRunner.query(`CREATE INDEX "IDX_5a056076f76b2efe08216ba655" ON "webhook" ("active") `);
|
||||
await queryRunner.query(`ALTER TABLE "webhook" ADD CONSTRAINT "FK_f272c8c8805969e6a6449c77b3c" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "webhook" DROP CONSTRAINT "FK_f272c8c8805969e6a6449c77b3c"`);
|
||||
await queryRunner.query(`DROP INDEX "public"."IDX_5a056076f76b2efe08216ba655"`);
|
||||
await queryRunner.query(`DROP INDEX "public"."IDX_8063a0586ed1dfbe86e982d961"`);
|
||||
await queryRunner.query(`DROP INDEX "public"."IDX_f272c8c8805969e6a6449c77b3"`);
|
||||
await queryRunner.query(`DROP TABLE "webhook"`);
|
||||
}
|
||||
}
|
14
packages/backend/migration/1648816172177-webhook-2.js
Normal file
14
packages/backend/migration/1648816172177-webhook-2.js
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
export class webhook21648816172177 {
|
||||
name = 'webhook21648816172177'
|
||||
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "webhook" ADD "latestSentAt" TIMESTAMP WITH TIME ZONE`);
|
||||
await queryRunner.query(`ALTER TABLE "webhook" ADD "latestStatus" integer`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "webhook" DROP COLUMN "latestStatus"`);
|
||||
await queryRunner.query(`ALTER TABLE "webhook" DROP COLUMN "latestSentAt"`);
|
||||
}
|
||||
}
|
89
packages/backend/migration/1651224615271-foreign-key.js
Normal file
89
packages/backend/migration/1651224615271-foreign-key.js
Normal file
@ -0,0 +1,89 @@
|
||||
export class foreignKeyReports1651224615271 {
|
||||
name = 'foreignKeyReports1651224615271'
|
||||
|
||||
async up(queryRunner) {
|
||||
await Promise.all([
|
||||
queryRunner.query(`ALTER INDEX "public"."IDX_seoignmeoprigmkpodgrjmkpormg" RENAME TO "IDX_c8cc87bd0f2f4487d17c651fbf"`),
|
||||
queryRunner.query(`DROP INDEX "public"."IDX_note_on_channelId_and_id_desc"`),
|
||||
|
||||
// remove unnecessary default null, see also down
|
||||
queryRunner.query(`ALTER TABLE "user" ALTER COLUMN "followersUri" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "session" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "appId" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "name" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "description" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "iconUrl" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "softwareName" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "softwareVersion" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "name" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "description" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "maintainerName" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "maintainerEmail" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "iconUrl" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "faviconUrl" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "themeColor" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "clip" ALTER COLUMN "description" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "note" ALTER COLUMN "channelId" DROP DEFAULT`),
|
||||
queryRunner.query(`ALTER TABLE "abuse_user_report" ALTER COLUMN "comment" DROP DEFAULT`),
|
||||
|
||||
queryRunner.query(`CREATE INDEX "IDX_315c779174fe8247ab324f036e" ON "drive_file" ("isLink")`),
|
||||
queryRunner.query(`CREATE INDEX "IDX_f22169eb10657bded6d875ac8f" ON "note" ("channelId")`),
|
||||
queryRunner.query(`CREATE INDEX "IDX_a9021cc2e1feb5f72d3db6e9f5" ON "abuse_user_report" ("targetUserId")`),
|
||||
|
||||
queryRunner.query(`DELETE FROM "abuse_user_report" WHERE "targetUserId" NOT IN (SELECT "id" FROM "user")`).then(() => {
|
||||
queryRunner.query(`ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_a9021cc2e1feb5f72d3db6e9f5f" FOREIGN KEY ("targetUserId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
||||
}),
|
||||
|
||||
queryRunner.query(`ALTER TABLE "poll" ADD CONSTRAINT "UQ_da851e06d0dfe2ef397d8b1bf1b" UNIQUE ("noteId")`),
|
||||
queryRunner.query(`ALTER TABLE "user_keypair" ADD CONSTRAINT "UQ_f4853eb41ab722fe05f81cedeb6" UNIQUE ("userId")`),
|
||||
queryRunner.query(`ALTER TABLE "user_profile" ADD CONSTRAINT "UQ_51cb79b5555effaf7d69ba1cff9" UNIQUE ("userId")`),
|
||||
queryRunner.query(`ALTER TABLE "user_publickey" ADD CONSTRAINT "UQ_10c146e4b39b443ede016f6736d" UNIQUE ("userId")`),
|
||||
queryRunner.query(`ALTER TABLE "promo_note" ADD CONSTRAINT "UQ_e263909ca4fe5d57f8d4230dd5c" UNIQUE ("noteId")`),
|
||||
|
||||
queryRunner.query(`ALTER TABLE "page" RENAME CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10" TO "FK_a9ca79ad939bf06066b81c9d3aa"`),
|
||||
|
||||
queryRunner.query(`ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum" ADD VALUE 'pollEnded' AFTER 'pollVote'`),
|
||||
]);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await Promise.all([
|
||||
// There is no ALTER TYPE REMOVE VALUE query, so the reverse operation is a bit more complex
|
||||
queryRunner.query(`UPDATE "user_profile" SET "mutingNotificationTypes" = array_remove("mutingNotificationTypes", 'pollEnded')`)
|
||||
.then(() =>
|
||||
queryRunner.query(`CREATE TYPE "public"."user_profile_mutingnotificationtypes_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`)
|
||||
).then(() =>
|
||||
queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" DROP DEFAULT`)
|
||||
).then(() =>
|
||||
queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" TYPE "public"."user_profile_mutingnotificationtypes_enum_old"[] USING "mutingNotificationTypes"::"text"::"public"."user_profile_mutingnotificationtypes_enum_old"[]`)
|
||||
).then(() =>
|
||||
queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" SET DEFAULT '{}'`)
|
||||
).then(() =>
|
||||
queryRunner.query(`DROP TYPE "public"."user_profile_mutingnotificationtypes_enum"`)
|
||||
).then(() =>
|
||||
queryRunner.query(`ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum_old" RENAME TO "user_profile_mutingnotificationtypes_enum"`)
|
||||
),
|
||||
|
||||
queryRunner.query(`ALTER TABLE "page" RENAME CONSTRAINT "FK_a9ca79ad939bf06066b81c9d3aa" TO "FK_3126dd7c502c9e4d7597ef7ef10"`),
|
||||
|
||||
queryRunner.query(`ALTER TABLE "promo_note" DROP CONSTRAINT "UQ_e263909ca4fe5d57f8d4230dd5c"`),
|
||||
queryRunner.query(`ALTER TABLE "user_publickey" DROP CONSTRAINT "UQ_10c146e4b39b443ede016f6736d"`),
|
||||
queryRunner.query(`ALTER TABLE "user_profile" DROP CONSTRAINT "UQ_51cb79b5555effaf7d69ba1cff9"`),
|
||||
queryRunner.query(`ALTER TABLE "user_keypair" DROP CONSTRAINT "UQ_f4853eb41ab722fe05f81cedeb6"`),
|
||||
queryRunner.query(`ALTER TABLE "poll" DROP CONSTRAINT "UQ_da851e06d0dfe2ef397d8b1bf1b"`),
|
||||
|
||||
queryRunner.query(`ALTER TABLE "abuse_user_report" ALTER COLUMN "comment" SET DEFAULT '{}'`),
|
||||
queryRunner.query(`ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_a9021cc2e1feb5f72d3db6e9f5f"`),
|
||||
|
||||
queryRunner.query(`DROP INDEX "public"."IDX_a9021cc2e1feb5f72d3db6e9f5"`),
|
||||
queryRunner.query(`DROP INDEX "public"."IDX_f22169eb10657bded6d875ac8f"`),
|
||||
queryRunner.query(`DROP INDEX "public"."IDX_315c779174fe8247ab324f036e"`),
|
||||
|
||||
/* DEFAULT's are not set again because if the column can be NULL, then DEFAULT NULL is not necessary.
|
||||
see also https://github.com/typeorm/typeorm/issues/7579#issuecomment-835423615 */
|
||||
|
||||
queryRunner.query(`CREATE INDEX "IDX_note_on_channelId_and_id_desc" ON "note" ("id", "channelId") `),
|
||||
queryRunner.query(`ALTER INDEX "public"."IDX_c8cc87bd0f2f4487d17c651fbf" RENAME TO "IDX_seoignmeoprigmkpodgrjmkpormg"`),
|
||||
]);
|
||||
}
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
import { DataSource } from 'typeorm';
|
||||
import config from './built/config/index.js';
|
||||
import { entities } from './built/db/postgre.js';
|
||||
|
||||
export default {
|
||||
export default new DataSource({
|
||||
type: 'postgres',
|
||||
host: config.db.host,
|
||||
port: config.db.port,
|
||||
@ -11,7 +12,4 @@ export default {
|
||||
extra: config.db.extra,
|
||||
entities: entities,
|
||||
migrations: ['migration/*.js'],
|
||||
cli: {
|
||||
migrationsDir: 'migration'
|
||||
}
|
||||
};
|
||||
});
|
||||
|
@ -3,10 +3,9 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"init": "npm run migrate",
|
||||
"build": "tsc -p tsconfig.json || echo done. && tsc-alias -p tsconfig.json",
|
||||
"watch": "node watch.mjs",
|
||||
"lint": "eslint --quiet src/**/*.ts",
|
||||
"lint": "eslint --quiet \"src/**/*.ts\"",
|
||||
"mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha",
|
||||
"test": "npm run mocha"
|
||||
},
|
||||
@ -15,71 +14,27 @@
|
||||
"lodash": "^4.17.21"
|
||||
},
|
||||
"dependencies": {
|
||||
"@discordapp/twemoji": "13.1.0",
|
||||
"@bull-board/koa": "3.10.4",
|
||||
"@discordapp/twemoji": "13.1.1",
|
||||
"@elastic/elasticsearch": "7.11.0",
|
||||
"@koa/cors": "3.1.0",
|
||||
"@koa/multer": "3.0.0",
|
||||
"@koa/router": "10.1.1",
|
||||
"@koa/router": "9.0.1",
|
||||
"@sinonjs/fake-timers": "9.1.1",
|
||||
"@syuilo/aiscript": "0.11.1",
|
||||
"@types/bcryptjs": "2.4.2",
|
||||
"@types/bull": "3.15.8",
|
||||
"@types/cbor": "6.0.0",
|
||||
"@types/escape-regexp": "0.0.1",
|
||||
"@types/is-url": "1.2.30",
|
||||
"@types/js-yaml": "4.0.5",
|
||||
"@types/jsdom": "16.2.14",
|
||||
"@types/jsonld": "1.5.6",
|
||||
"@types/koa": "2.13.4",
|
||||
"@types/koa-bodyparser": "4.3.6",
|
||||
"@types/koa-cors": "0.0.2",
|
||||
"@types/koa-favicon": "2.0.21",
|
||||
"@types/koa-logger": "3.1.2",
|
||||
"@types/koa-mount": "4.0.1",
|
||||
"@types/koa-send": "4.1.3",
|
||||
"@types/koa-views": "7.0.0",
|
||||
"@types/koa__cors": "3.1.1",
|
||||
"@types/koa__multer": "2.0.4",
|
||||
"@types/koa__router": "8.0.11",
|
||||
"@types/mocha": "9.1.0",
|
||||
"@types/node": "17.0.21",
|
||||
"@types/node-fetch": "3.0.3",
|
||||
"@types/nodemailer": "6.4.4",
|
||||
"@types/oauth": "0.9.1",
|
||||
"@types/parse5": "6.0.3",
|
||||
"@types/portscanner": "2.1.1",
|
||||
"@types/pug": "2.0.6",
|
||||
"@types/punycode": "2.1.0",
|
||||
"@types/qrcode": "1.4.2",
|
||||
"@types/random-seed": "0.3.3",
|
||||
"@types/ratelimiter": "3.4.3",
|
||||
"@types/redis": "4.0.11",
|
||||
"@types/rename": "1.0.4",
|
||||
"@types/sanitize-html": "2.6.2",
|
||||
"@types/sharp": "0.29.5",
|
||||
"@types/sinonjs__fake-timers": "8.1.1",
|
||||
"@types/speakeasy": "2.0.7",
|
||||
"@types/throttle-debounce": "2.1.0",
|
||||
"@types/tinycolor2": "1.4.3",
|
||||
"@types/tmp": "0.2.3",
|
||||
"@types/uuid": "8.3.4",
|
||||
"@types/web-push": "3.3.2",
|
||||
"@types/websocket": "1.0.5",
|
||||
"@types/ws": "8.5.2",
|
||||
"@typescript-eslint/eslint-plugin": "5.14.0",
|
||||
"@typescript-eslint/parser": "5.14.0",
|
||||
"@typescript-eslint/eslint-plugin": "5.20.0",
|
||||
"@typescript-eslint/parser": "5.20.0",
|
||||
"abort-controller": "3.0.0",
|
||||
"ajv": "8.10.0",
|
||||
"archiver": "5.3.0",
|
||||
"ajv": "8.11.0",
|
||||
"archiver": "5.3.1",
|
||||
"autobind-decorator": "2.4.0",
|
||||
"autwh": "0.1.0",
|
||||
"aws-sdk": "2.1079.0",
|
||||
"aws-sdk": "2.1120.0",
|
||||
"bcryptjs": "2.4.3",
|
||||
"blurhash": "1.1.5",
|
||||
"broadcast-channel": "4.10.0",
|
||||
"bull": "4.7.0",
|
||||
"broadcast-channel": "4.11.0",
|
||||
"bull": "4.8.2",
|
||||
"cacheable-lookup": "6.0.4",
|
||||
"cafy": "15.2.1",
|
||||
"cbor": "8.1.0",
|
||||
"chalk": "5.0.1",
|
||||
"chalk-template": "0.4.0",
|
||||
@ -89,22 +44,22 @@
|
||||
"date-fns": "2.28.0",
|
||||
"deep-email-validator": "0.1.21",
|
||||
"escape-regexp": "0.0.1",
|
||||
"eslint": "8.10.0",
|
||||
"eslint-plugin-import": "2.25.4",
|
||||
"eslint": "8.14.0",
|
||||
"eslint-plugin-import": "2.26.0",
|
||||
"feed": "4.2.2",
|
||||
"file-type": "17.1.1",
|
||||
"fluent-ffmpeg": "2.1.2",
|
||||
"got": "12.0.1",
|
||||
"got": "12.0.3",
|
||||
"hpagent": "0.1.2",
|
||||
"http-signature": "1.3.6",
|
||||
"ip-cidr": "3.0.4",
|
||||
"ip-cidr": "3.0.7",
|
||||
"is-svg": "4.3.2",
|
||||
"js-yaml": "4.1.0",
|
||||
"jsdom": "19.0.0",
|
||||
"json5": "2.2.0",
|
||||
"json5": "2.2.1",
|
||||
"json5-loader": "4.0.1",
|
||||
"jsonld": "5.2.0",
|
||||
"jsrsasign": "8.0.20",
|
||||
"jsrsasign": "10.5.19",
|
||||
"koa": "2.13.4",
|
||||
"koa-bodyparser": "4.3.0",
|
||||
"koa-favicon": "2.1.0",
|
||||
@ -115,14 +70,14 @@
|
||||
"koa-slow": "2.1.0",
|
||||
"koa-views": "7.0.2",
|
||||
"mfm-js": "0.21.0",
|
||||
"mime-types": "2.1.34",
|
||||
"mime-types": "2.1.35",
|
||||
"misskey-js": "0.0.14",
|
||||
"mocha": "9.2.1",
|
||||
"mocha": "9.2.2",
|
||||
"ms": "3.0.0-canary.1",
|
||||
"multer": "1.4.4",
|
||||
"nested-property": "4.0.0",
|
||||
"node-fetch": "3.2.2",
|
||||
"nodemailer": "6.7.2",
|
||||
"node-fetch": "3.2.3",
|
||||
"nodemailer": "6.7.3",
|
||||
"os-utils": "0.0.14",
|
||||
"parse5": "6.0.1",
|
||||
"pg": "8.7.3",
|
||||
@ -145,35 +100,80 @@
|
||||
"rndstr": "1.0.0",
|
||||
"s-age": "1.1.2",
|
||||
"sanitize-html": "2.7.0",
|
||||
"sharp": "0.30.2",
|
||||
"semver": "7.3.7",
|
||||
"sharp": "0.30.4",
|
||||
"speakeasy": "2.0.0",
|
||||
"strict-event-emitter-types": "2.0.0",
|
||||
"stringz": "2.1.0",
|
||||
"style-loader": "3.3.1",
|
||||
"summaly": "2.5.0",
|
||||
"syslog-pro": "1.0.0",
|
||||
"systeminformation": "5.11.6",
|
||||
"throttle-debounce": "3.0.1",
|
||||
"systeminformation": "5.11.14",
|
||||
"tinycolor2": "1.4.2",
|
||||
"tmp": "0.2.1",
|
||||
"ts-loader": "9.2.7",
|
||||
"ts-loader": "9.2.8",
|
||||
"ts-node": "10.7.0",
|
||||
"tsc-alias": "1.4.1",
|
||||
"tsconfig-paths": "3.13.0",
|
||||
"twemoji-parser": "13.1.0",
|
||||
"typeorm": "0.2.45",
|
||||
"typescript": "4.6.2",
|
||||
"tsconfig-paths": "3.14.1",
|
||||
"twemoji-parser": "14.0.0",
|
||||
"typeorm": "0.3.6",
|
||||
"typescript": "4.6.3",
|
||||
"ulid": "2.3.0",
|
||||
"unzipper": "0.10.11",
|
||||
"uuid": "8.3.2",
|
||||
"web-push": "3.4.5",
|
||||
"websocket": "1.0.34",
|
||||
"ws": "8.5.0",
|
||||
"xev": "2.0.1"
|
||||
"xev": "3.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@redocly/openapi-core": "1.0.0-beta.83",
|
||||
"@redocly/openapi-core": "1.0.0-beta.93",
|
||||
"@types/semver": "7.3.9",
|
||||
"@types/bcryptjs": "2.4.2",
|
||||
"@types/bull": "3.15.8",
|
||||
"@types/cbor": "6.0.0",
|
||||
"@types/escape-regexp": "0.0.1",
|
||||
"@types/fluent-ffmpeg": "2.1.20",
|
||||
"@types/is-url": "1.2.30",
|
||||
"@types/js-yaml": "4.0.5",
|
||||
"@types/jsdom": "16.2.14",
|
||||
"@types/jsonld": "1.5.6",
|
||||
"@types/jsrsasign": "10.2.1",
|
||||
"@types/koa": "2.13.4",
|
||||
"@types/koa-bodyparser": "4.3.7",
|
||||
"@types/koa-cors": "0.0.2",
|
||||
"@types/koa-favicon": "2.0.21",
|
||||
"@types/koa-logger": "3.1.2",
|
||||
"@types/koa-mount": "4.0.1",
|
||||
"@types/koa-send": "4.1.3",
|
||||
"@types/koa-views": "7.0.0",
|
||||
"@types/koa__cors": "3.1.1",
|
||||
"@types/koa__multer": "2.0.4",
|
||||
"@types/koa__router": "8.0.11",
|
||||
"@types/mocha": "9.1.1",
|
||||
"@types/node": "17.0.25",
|
||||
"@types/node-fetch": "3.0.3",
|
||||
"@types/nodemailer": "6.4.4",
|
||||
"@types/oauth": "0.9.1",
|
||||
"@types/parse5": "6.0.3",
|
||||
"@types/portscanner": "2.1.1",
|
||||
"@types/pug": "2.0.6",
|
||||
"@types/punycode": "2.1.0",
|
||||
"@types/qrcode": "1.4.2",
|
||||
"@types/random-seed": "0.3.3",
|
||||
"@types/ratelimiter": "3.4.3",
|
||||
"@types/redis": "4.0.11",
|
||||
"@types/rename": "1.0.4",
|
||||
"@types/sanitize-html": "2.6.2",
|
||||
"@types/sharp": "0.30.2",
|
||||
"@types/sinonjs__fake-timers": "8.1.2",
|
||||
"@types/speakeasy": "2.0.7",
|
||||
"@types/tinycolor2": "1.4.3",
|
||||
"@types/tmp": "0.2.3",
|
||||
"@types/uuid": "8.3.4",
|
||||
"@types/web-push": "3.3.2",
|
||||
"@types/websocket": "1.0.5",
|
||||
"@types/ws": "8.5.3",
|
||||
"cross-env": "7.0.3",
|
||||
"execa": "6.1.0"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
declare module 'http-signature' {
|
||||
import { IncomingMessage, ClientRequest } from 'http';
|
||||
import { IncomingMessage, ClientRequest } from 'node:http';
|
||||
|
||||
interface ISignature {
|
||||
keyId: string;
|
||||
|
800
packages/backend/src/@types/jsrsasign.d.ts
vendored
800
packages/backend/src/@types/jsrsasign.d.ts
vendored
@ -1,800 +0,0 @@
|
||||
// Attention: Partial Type Definition
|
||||
|
||||
declare module 'jsrsasign' {
|
||||
//// HELPER TYPES
|
||||
|
||||
/**
|
||||
* Attention: The value might be changed by the function.
|
||||
*/
|
||||
type Mutable<T> = T;
|
||||
|
||||
/**
|
||||
* Deprecated: The function might be deleted in future release.
|
||||
*/
|
||||
type Deprecated<T> = T;
|
||||
|
||||
//// COMMON TYPES
|
||||
|
||||
/**
|
||||
* byte number
|
||||
*/
|
||||
type ByteNumber = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255;
|
||||
|
||||
/**
|
||||
* hexadecimal string /[0-9A-F]/
|
||||
*/
|
||||
type HexString = string;
|
||||
|
||||
/**
|
||||
* binary string /[01]/
|
||||
*/
|
||||
type BinString = string;
|
||||
|
||||
/**
|
||||
* base64 string /[A-Za-z0-9+/]=+/
|
||||
*/
|
||||
type Base64String = string;
|
||||
|
||||
/**
|
||||
* base64 URL encoded string /[A-Za-z0-9_-]/
|
||||
*/
|
||||
type Base64URLString = string;
|
||||
|
||||
/**
|
||||
* time value (ex. "151231235959Z")
|
||||
*/
|
||||
type TimeValue = string;
|
||||
|
||||
/**
|
||||
* OID string (ex. '1.2.3.4.567')
|
||||
*/
|
||||
type OID = string;
|
||||
|
||||
/**
|
||||
* OID name
|
||||
*/
|
||||
type OIDName = string;
|
||||
|
||||
/**
|
||||
* PEM formatted string
|
||||
*/
|
||||
type PEM = string;
|
||||
|
||||
//// ASN1 TYPES
|
||||
|
||||
class ASN1Object {
|
||||
public isModified: boolean;
|
||||
|
||||
public hTLV: ASN1TLV;
|
||||
|
||||
public hT: ASN1T;
|
||||
|
||||
public hL: ASN1L;
|
||||
|
||||
public hV: ASN1V;
|
||||
|
||||
public getLengthHexFromValue(): HexString;
|
||||
|
||||
public getEncodedHex(): ASN1TLV;
|
||||
|
||||
public getValueHex(): ASN1V;
|
||||
|
||||
public getFreshValueHex(): ASN1V;
|
||||
}
|
||||
|
||||
class DERAbstractStructured extends ASN1Object {
|
||||
constructor(params?: Partial<Record<'array', ASN1Object[]>>);
|
||||
|
||||
public setByASN1ObjectArray(asn1ObjectArray: ASN1Object[]): void;
|
||||
|
||||
public appendASN1Object(asn1Object: ASN1Object): void;
|
||||
}
|
||||
|
||||
class DERSequence extends DERAbstractStructured {
|
||||
constructor(params?: Partial<Record<'array', ASN1Object[]>>);
|
||||
|
||||
public getFreshValueHex(): ASN1V;
|
||||
}
|
||||
|
||||
//// ASN1HEX TYPES
|
||||
|
||||
/**
|
||||
* ASN.1 DER encoded data (hexadecimal string)
|
||||
*/
|
||||
type ASN1S = HexString;
|
||||
|
||||
/**
|
||||
* index of something
|
||||
*/
|
||||
type Idx<T extends { [idx: string]: unknown } | { [idx: number]: unknown }> = ASN1S extends { [idx: string]: unknown } ? string : ASN1S extends { [idx: number]: unknown } ? number : never;
|
||||
|
||||
/**
|
||||
* byte length of something
|
||||
*/
|
||||
type ByteLength<T extends { length: unknown }> = T['length'];
|
||||
|
||||
/**
|
||||
* ASN.1 L(length) (hexadecimal string)
|
||||
*/
|
||||
type ASN1L = HexString;
|
||||
|
||||
/**
|
||||
* ASN.1 T(tag) (hexadecimal string)
|
||||
*/
|
||||
type ASN1T = HexString;
|
||||
|
||||
/**
|
||||
* ASN.1 V(value) (hexadecimal string)
|
||||
*/
|
||||
type ASN1V = HexString;
|
||||
|
||||
/**
|
||||
* ASN.1 TLV (hexadecimal string)
|
||||
*/
|
||||
type ASN1TLV = HexString;
|
||||
|
||||
/**
|
||||
* ASN.1 object string
|
||||
*/
|
||||
type ASN1ObjectString = string;
|
||||
|
||||
/**
|
||||
* nth
|
||||
*/
|
||||
type Nth = number;
|
||||
|
||||
/**
|
||||
* ASN.1 DER encoded OID value (hexadecimal string)
|
||||
*/
|
||||
type ASN1OIDV = HexString;
|
||||
|
||||
class ASN1HEX {
|
||||
public static getLblen(s: ASN1S, idx: Idx<ASN1S>): ByteLength<ASN1L>;
|
||||
|
||||
public static getL(s: ASN1S, idx: Idx<ASN1S>): ASN1L;
|
||||
|
||||
public static getVblen(s: ASN1S, idx: Idx<ASN1S>): ByteLength<ASN1V>;
|
||||
|
||||
public static getVidx(s: ASN1S, idx: Idx<ASN1S>): Idx<ASN1V>;
|
||||
|
||||
public static getV(s: ASN1S, idx: Idx<ASN1S>): ASN1V;
|
||||
|
||||
public static getTLV(s: ASN1S, idx: Idx<ASN1S>): ASN1TLV;
|
||||
|
||||
public static getNextSiblingIdx(s: ASN1S, idx: Idx<ASN1S>): Idx<ASN1ObjectString>;
|
||||
|
||||
public static getChildIdx(h: ASN1S, pos: Idx<ASN1S>): Idx<ASN1ObjectString>[];
|
||||
|
||||
public static getNthChildIdx(h: ASN1S, idx: Idx<ASN1S>, nth: Nth): Idx<ASN1ObjectString>;
|
||||
|
||||
public static getIdxbyList(h: ASN1S, currentIndex: Idx<ASN1ObjectString>, nthList: Mutable<Nth[]>, checkingTag?: string): Idx<Mutable<Nth[]>>;
|
||||
|
||||
public static getTLVbyList(h: ASN1S, currentIndex: Idx<ASN1ObjectString>, nthList: Mutable<Nth[]>, checkingTag?: string): ASN1TLV;
|
||||
|
||||
// eslint:disable-next-line:bool-param-default
|
||||
public static getVbyList(h: ASN1S, currentIndex: Idx<ASN1ObjectString>, nthList: Mutable<Nth[]>, checkingTag?: string, removeUnusedbits?: boolean): ASN1V;
|
||||
|
||||
public static hextooidstr(hex: ASN1OIDV): OID;
|
||||
|
||||
public static dump(hexOrObj: ASN1S | ASN1Object, flags?: Record<string, unknown>, idx?: Idx<ASN1S>, indent?: string): string;
|
||||
|
||||
public static isASN1HEX(hex: string): hex is HexString;
|
||||
|
||||
public static oidname(oidDotOrHex: OID | ASN1OIDV): OIDName;
|
||||
}
|
||||
|
||||
//// BIG INTEGER TYPES (PARTIAL)
|
||||
|
||||
class BigInteger {
|
||||
constructor(a: null);
|
||||
|
||||
constructor(a: number, b: SecureRandom);
|
||||
|
||||
constructor(a: number, b: number, c: SecureRandom);
|
||||
|
||||
constructor(a: unknown);
|
||||
|
||||
constructor(a: string, b: number);
|
||||
|
||||
public am(i: number, x: number, w: number, j: number, c: number, n: number): number;
|
||||
|
||||
public DB: number;
|
||||
|
||||
public DM: number;
|
||||
|
||||
public DV: number;
|
||||
|
||||
public FV: number;
|
||||
|
||||
public F1: number;
|
||||
|
||||
public F2: number;
|
||||
|
||||
protected copyTo(r: Mutable<BigInteger>): void;
|
||||
|
||||
protected fromInt(x: number): void;
|
||||
|
||||
protected fromString(s: string, b: number): void;
|
||||
|
||||
protected clamp(): void;
|
||||
|
||||
public toString(b: number): string;
|
||||
|
||||
public negate(): BigInteger;
|
||||
|
||||
public abs(): BigInteger;
|
||||
|
||||
public compareTo(a: BigInteger): number;
|
||||
|
||||
public bitLength(): number;
|
||||
|
||||
protected dlShiftTo(n: number, r: Mutable<BigInteger>): void;
|
||||
|
||||
protected drShiftTo(n: number, r: Mutable<BigInteger>): void;
|
||||
|
||||
protected lShiftTo(n: number, r: Mutable<BigInteger>): void;
|
||||
|
||||
protected rShiftTo(n: number, r: Mutable<BigInteger>): void;
|
||||
|
||||
protected subTo(a: BigInteger, r: Mutable<BigInteger>): void;
|
||||
|
||||
protected multiplyTo(a: BigInteger, r: Mutable<BigInteger>): void;
|
||||
|
||||
protected squareTo(r: Mutable<BigInteger>): void;
|
||||
|
||||
protected divRemTo(m: BigInteger, q: Mutable<BigInteger>, r: Mutable<BigInteger>): void;
|
||||
|
||||
public mod(a: BigInteger): BigInteger;
|
||||
|
||||
protected invDigit(): number;
|
||||
|
||||
protected isEven(): boolean;
|
||||
|
||||
protected exp(e: number, z: Classic | Montgomery): BigInteger;
|
||||
|
||||
public modPowInt(e: number, m: BigInteger): BigInteger;
|
||||
|
||||
public static ZERO: BigInteger;
|
||||
|
||||
public static ONE: BigInteger;
|
||||
}
|
||||
|
||||
class Classic {
|
||||
constructor(m: BigInteger);
|
||||
|
||||
public convert(x: BigInteger): BigInteger;
|
||||
|
||||
public revert(x: BigInteger): BigInteger;
|
||||
|
||||
public reduce(x: Mutable<BigInteger>): void;
|
||||
|
||||
public mulTo(x: BigInteger, r: Mutable<BigInteger>): void;
|
||||
|
||||
public sqrTo(x: BigInteger, y: BigInteger, r: Mutable<BigInteger>): void;
|
||||
}
|
||||
|
||||
class Montgomery {
|
||||
constructor(m: BigInteger);
|
||||
|
||||
public convert(x: BigInteger): BigInteger;
|
||||
|
||||
public revert(x: BigInteger): BigInteger;
|
||||
|
||||
public reduce(x: Mutable<BigInteger>): void;
|
||||
|
||||
public mulTo(x: BigInteger, r: Mutable<BigInteger>): void;
|
||||
|
||||
public sqrTo(x: BigInteger, y: BigInteger, r: Mutable<BigInteger>): void;
|
||||
}
|
||||
|
||||
//// KEYUTIL TYPES
|
||||
|
||||
type DecryptAES = (dataHex: HexString, keyHex: HexString, ivHex: HexString) => HexString;
|
||||
|
||||
type Decrypt3DES = (dataHex: HexString, keyHex: HexString, ivHex: HexString) => HexString;
|
||||
|
||||
type DecryptDES = (dataHex: HexString, keyHex: HexString, ivHex: HexString) => HexString;
|
||||
|
||||
type EncryptAES = (dataHex: HexString, keyHex: HexString, ivHex: HexString) => HexString;
|
||||
|
||||
type Encrypt3DES = (dataHex: HexString, keyHex: HexString, ivHex: HexString) => HexString;
|
||||
|
||||
type EncryptDES = (dataHex: HexString, keyHex: HexString, ivHex: HexString) => HexString;
|
||||
|
||||
type AlgList = {
|
||||
'AES-256-CBC': { 'proc': DecryptAES; 'eproc': EncryptAES; keylen: 32; ivlen: 16; };
|
||||
'AES-192-CBC': { 'proc': DecryptAES; 'eproc': EncryptAES; keylen: 24; ivlen: 16; };
|
||||
'AES-128-CBC': { 'proc': DecryptAES; 'eproc': EncryptAES; keylen: 16; ivlen: 16; };
|
||||
'DES-EDE3-CBC': { 'proc': Decrypt3DES; 'eproc': Encrypt3DES; keylen: 24; ivlen: 8; };
|
||||
'DES-CBC': { 'proc': DecryptDES; 'eproc': EncryptDES; keylen: 8; ivlen: 8; };
|
||||
};
|
||||
|
||||
type AlgName = keyof AlgList;
|
||||
|
||||
type PEMHeadAlgName = 'RSA' | 'EC' | 'DSA';
|
||||
|
||||
type GetKeyRSAParam = RSAKey | {
|
||||
n: BigInteger;
|
||||
e: number;
|
||||
} | Record<'n' | 'e', HexString> | Record<'n' | 'e', HexString> & Record<'d' | 'p' | 'q' | 'dp' | 'dq' | 'co', HexString | null> | {
|
||||
n: BigInteger;
|
||||
e: number;
|
||||
d: BigInteger;
|
||||
} | {
|
||||
kty: 'RSA';
|
||||
} & Record<'n' | 'e', Base64URLString> | {
|
||||
kty: 'RSA';
|
||||
} & Record<'n' | 'e' | 'd' | 'p' | 'q' | 'dp' | 'dq' | 'qi', Base64URLString> | {
|
||||
kty: 'RSA';
|
||||
} & Record<'n' | 'e' | 'd', Base64URLString>;
|
||||
|
||||
type GetKeyECDSAParam = KJUR.crypto.ECDSA | {
|
||||
curve: KJUR.crypto.CurveName;
|
||||
xy: HexString;
|
||||
} | {
|
||||
curve: KJUR.crypto.CurveName;
|
||||
d: HexString;
|
||||
} | {
|
||||
kty: 'EC';
|
||||
crv: KJUR.crypto.CurveName;
|
||||
x: Base64URLString;
|
||||
y: Base64URLString;
|
||||
} | {
|
||||
kty: 'EC';
|
||||
crv: KJUR.crypto.CurveName;
|
||||
x: Base64URLString;
|
||||
y: Base64URLString;
|
||||
d: Base64URLString;
|
||||
};
|
||||
|
||||
type GetKeyDSAParam = KJUR.crypto.DSA | Record<'p' | 'q' | 'g', BigInteger> & Record<'y', BigInteger | null> | Record<'p' | 'q' | 'g' | 'x', BigInteger> & Record<'y', BigInteger | null>;
|
||||
|
||||
type GetKeyParam = GetKeyRSAParam | GetKeyECDSAParam | GetKeyDSAParam | string;
|
||||
|
||||
class KEYUTIL {
|
||||
public version: '1.0.0';
|
||||
|
||||
public parsePKCS5PEM(sPKCS5PEM: PEM): Partial<Record<'type' | 's', string>> & (Record<'cipher' | 'ivsalt', string> | Record<'cipher' | 'ivsalt', undefined>);
|
||||
|
||||
public getKeyAndUnusedIvByPasscodeAndIvsalt(algName: AlgName, passcode: string, ivsaltHex: HexString): Record<'keyhex' | 'ivhex', HexString>;
|
||||
|
||||
public decryptKeyB64(privateKeyB64: Base64String, sharedKeyAlgName: AlgName, sharedKeyHex: HexString, ivsaltHex: HexString): Base64String;
|
||||
|
||||
public getDecryptedKeyHex(sEncryptedPEM: PEM, passcode: string): HexString;
|
||||
|
||||
public getEncryptedPKCS5PEMFromPrvKeyHex(pemHeadAlg: PEMHeadAlgName, hPrvKey: string, passcode: string, sharedKeyAlgName?: AlgName | null, ivsaltHex?: HexString | null): PEM;
|
||||
|
||||
public parseHexOfEncryptedPKCS8(sHEX: HexString): {
|
||||
ciphertext: ASN1V;
|
||||
encryptionSchemeAlg: 'TripleDES';
|
||||
encryptionSchemeIV: ASN1V;
|
||||
pbkdf2Salt: ASN1V;
|
||||
pbkdf2Iter: number;
|
||||
};
|
||||
|
||||
public getPBKDF2KeyHexFromParam(info: ReturnType<this['parseHexOfEncryptedPKCS8']>, passcode: string): HexString;
|
||||
|
||||
private _getPlainPKCS8HexFromEncryptedPKCS8PEM(pkcs8PEM: PEM, passcode: string): HexString;
|
||||
|
||||
public getKeyFromEncryptedPKCS8PEM(prvKeyHex: HexString): ReturnType<this['getKeyFromPlainPrivatePKCS8Hex']>;
|
||||
|
||||
public parsePlainPrivatePKCS8Hex(pkcs8PrvHex: HexString): {
|
||||
algparam: ASN1V | null;
|
||||
algoid: ASN1V;
|
||||
keyidx: Idx<ASN1V>;
|
||||
};
|
||||
|
||||
public getKeyFromPlainPrivatePKCS8PEM(prvKeyHex: HexString): ReturnType<this['getKeyFromPlainPrivatePKCS8Hex']>;
|
||||
|
||||
public getKeyFromPlainPrivatePKCS8Hex(prvKeyHex: HexString): RSAKey | KJUR.crypto.DSA | KJUR.crypto.ECDSA;
|
||||
|
||||
private _getKeyFromPublicPKCS8Hex(h: HexString): RSAKey | KJUR.crypto.DSA | KJUR.crypto.ECDSA;
|
||||
|
||||
public parsePublicRawRSAKeyHex(pubRawRSAHex: HexString): Record<'n' | 'e', ASN1V>;
|
||||
|
||||
public parsePublicPKCS8Hex(pkcs8PubHex: HexString): {
|
||||
algparam: ASN1V | Record<'p' | 'q' | 'g', ASN1V> | null;
|
||||
algoid: ASN1V;
|
||||
key: ASN1V;
|
||||
};
|
||||
|
||||
public static getKey(param: GetKeyRSAParam): RSAKey;
|
||||
|
||||
public static getKey(param: GetKeyECDSAParam): KJUR.crypto.ECDSA;
|
||||
|
||||
public static getKey(param: GetKeyDSAParam): KJUR.crypto.DSA;
|
||||
|
||||
public static getKey(param: string, passcode?: string, hextype?: string): RSAKey | KJUR.crypto.ECDSA | KJUR.crypto.DSA;
|
||||
|
||||
public static generateKeypair(alg: 'RSA', keylen: number): Record<'prvKeyObj' | 'pubKeyObj', RSAKey>;
|
||||
|
||||
public static generateKeypair(alg: 'EC', curve: KJUR.crypto.CurveName): Record<'prvKeyObj' | 'pubKeyObj', KJUR.crypto.ECDSA>;
|
||||
|
||||
public static getPEM(keyObjOrHex: RSAKey | KJUR.crypto.ECDSA | KJUR.crypto.DSA, formatType?: 'PKCS1PRV' | 'PKCS5PRV' | 'PKCS8PRV', passwd?: string, encAlg?: 'DES-CBC' | 'DES-EDE3-CBC' | 'AES-128-CBC' | 'AES-192-CBC' | 'AES-256-CBC', hexType?: string, ivsaltHex?: HexString): object; // To Do
|
||||
|
||||
public static getKeyFromCSRPEM(csrPEM: PEM): RSAKey | KJUR.crypto.ECDSA | KJUR.crypto.DSA;
|
||||
|
||||
public static getKeyFromCSRHex(csrHex: HexString): RSAKey | KJUR.crypto.ECDSA | KJUR.crypto.DSA;
|
||||
|
||||
public static parseCSRHex(csrHex: HexString): Record<'p8pubkeyhex', ASN1TLV>;
|
||||
|
||||
public static getJWKFromKey(keyObj: RSAKey): {
|
||||
kty: 'RSA';
|
||||
} & Record<'n' | 'e' | 'd' | 'p' | 'q' | 'dp' | 'dq' | 'qi', Base64URLString> | {
|
||||
kty: 'RSA';
|
||||
} & Record<'n' | 'e', Base64URLString>;
|
||||
|
||||
public static getJWKFromKey(keyObj: KJUR.crypto.ECDSA): {
|
||||
kty: 'EC';
|
||||
crv: KJUR.crypto.CurveName;
|
||||
x: Base64URLString;
|
||||
y: Base64URLString;
|
||||
d: Base64URLString;
|
||||
} | {
|
||||
kty: 'EC';
|
||||
crv: KJUR.crypto.CurveName;
|
||||
x: Base64URLString;
|
||||
y: Base64URLString;
|
||||
};
|
||||
}
|
||||
|
||||
//// KJUR NAMESPACE (PARTIAL)
|
||||
|
||||
namespace KJUR {
|
||||
namespace crypto {
|
||||
type CurveName = 'secp128r1' | 'secp160k1' | 'secp160r1' | 'secp192k1' | 'secp192r1' | 'secp224r1' | 'secp256k1' | 'secp256r1' | 'secp384r1' | 'secp521r1';
|
||||
|
||||
class DSA {
|
||||
public p: BigInteger | null;
|
||||
|
||||
public q: BigInteger | null;
|
||||
|
||||
public g: BigInteger | null;
|
||||
|
||||
public y: BigInteger | null;
|
||||
|
||||
public x: BigInteger | null;
|
||||
|
||||
public type: 'DSA';
|
||||
|
||||
public isPrivate: boolean;
|
||||
|
||||
public isPublic: boolean;
|
||||
|
||||
public setPrivate(p: BigInteger, q: BigInteger, g: BigInteger, y: BigInteger | null, x: BigInteger): void;
|
||||
|
||||
public setPrivateHex(hP: HexString, hQ: HexString, hG: HexString, hY: HexString | null, hX: HexString): void;
|
||||
|
||||
public setPublic(p: BigInteger, q: BigInteger, g: BigInteger, y: BigInteger): void;
|
||||
|
||||
public setPublicHex(hP: HexString, hQ: HexString, hG: HexString, hY: HexString): void;
|
||||
|
||||
public signWithMessageHash(sHashHex: HexString): HexString;
|
||||
|
||||
public verifyWithMessageHash(sHashHex: HexString, hSigVal: HexString): boolean;
|
||||
|
||||
public parseASN1Signature(hSigVal: HexString): [BigInteger, BigInteger];
|
||||
|
||||
public readPKCS5PrvKeyHex(h: HexString): void;
|
||||
|
||||
public readPKCS8PrvKeyHex(h: HexString): void;
|
||||
|
||||
public readPKCS8PubKeyHex(h: HexString): void;
|
||||
|
||||
public readCertPubKeyHex(h: HexString, nthPKI: number): void;
|
||||
}
|
||||
|
||||
class ECDSA {
|
||||
constructor(params?: {
|
||||
curve?: CurveName;
|
||||
prv?: HexString;
|
||||
pub?: HexString;
|
||||
});
|
||||
|
||||
public p: BigInteger | null;
|
||||
|
||||
public q: BigInteger | null;
|
||||
|
||||
public g: BigInteger | null;
|
||||
|
||||
public y: BigInteger | null;
|
||||
|
||||
public x: BigInteger | null;
|
||||
|
||||
public type: 'EC';
|
||||
|
||||
public isPrivate: boolean;
|
||||
|
||||
public isPublic: boolean;
|
||||
|
||||
public getBigRandom(limit: BigInteger): BigInteger;
|
||||
|
||||
public setNamedCurve(curveName: CurveName): void;
|
||||
|
||||
public setPrivateKeyHex(prvKeyHex: HexString): void;
|
||||
|
||||
public setPublicKeyHex(pubKeyHex: HexString): void;
|
||||
|
||||
public getPublicKeyXYHex(): Record<'x' | 'y', HexString>;
|
||||
|
||||
public getShortNISTPCurveName(): 'P-256' | 'P-384' | null;
|
||||
|
||||
public generateKeyPairHex(): Record<'ecprvhex' | 'ecpubhex', HexString>;
|
||||
|
||||
public signWithMessageHash(hashHex: HexString): HexString;
|
||||
|
||||
public signHex(hashHex: HexString, privHex: HexString): HexString;
|
||||
|
||||
public verifyWithMessageHash(sHashHex: HexString, hSigVal: HexString): boolean;
|
||||
|
||||
public parseASN1Signature(hSigVal: HexString): [BigInteger, BigInteger];
|
||||
|
||||
public readPKCS5PrvKeyHex(h: HexString): void;
|
||||
|
||||
public readPKCS8PrvKeyHex(h: HexString): void;
|
||||
|
||||
public readPKCS8PubKeyHex(h: HexString): void;
|
||||
|
||||
public readCertPubKeyHex(h: HexString, nthPKI: number): void;
|
||||
|
||||
public static parseSigHex(sigHex: HexString): Record<'r' | 's', BigInteger>;
|
||||
|
||||
public static parseSigHexInHexRS(sigHex: HexString): Record<'r' | 's', ASN1V>;
|
||||
|
||||
public static asn1SigToConcatSig(asn1Sig: HexString): HexString;
|
||||
|
||||
public static concatSigToASN1Sig(concatSig: HexString): ASN1TLV;
|
||||
|
||||
public static hexRSSigToASN1Sig(hR: HexString, hS: HexString): ASN1TLV;
|
||||
|
||||
public static biRSSigToASN1Sig(biR: BigInteger, biS: BigInteger): ASN1TLV;
|
||||
|
||||
public static getName(s: CurveName | HexString): 'secp256r1' | 'secp256k1' | 'secp384r1' | null;
|
||||
}
|
||||
|
||||
class Signature {
|
||||
constructor(params?: ({
|
||||
alg: string;
|
||||
prov?: string;
|
||||
} | {}) & ({
|
||||
psssaltlen: number;
|
||||
} | {}) & ({
|
||||
prvkeypem: PEM;
|
||||
prvkeypas?: never;
|
||||
} | {}));
|
||||
|
||||
private _setAlgNames(): void;
|
||||
|
||||
private _zeroPaddingOfSignature(hex: HexString, bitLength: number): HexString;
|
||||
|
||||
public setAlgAndProvider(alg: string, prov: string): void;
|
||||
|
||||
public init(key: GetKeyParam, pass?: string): void;
|
||||
|
||||
public updateString(str: string): void;
|
||||
|
||||
public updateHex(hex: HexString): void;
|
||||
|
||||
public sign(): HexString;
|
||||
|
||||
public signString(str: string): HexString;
|
||||
|
||||
public signHex(hex: HexString): HexString;
|
||||
|
||||
public verify(hSigVal: string): boolean | 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//// RSAKEY TYPES
|
||||
|
||||
class RSAKey {
|
||||
public n: BigInteger | null;
|
||||
|
||||
public e: number;
|
||||
|
||||
public d: BigInteger | null;
|
||||
|
||||
public p: BigInteger | null;
|
||||
|
||||
public q: BigInteger | null;
|
||||
|
||||
public dmp1: BigInteger | null;
|
||||
|
||||
public dmq1: BigInteger | null;
|
||||
|
||||
public coeff: BigInteger | null;
|
||||
|
||||
public type: 'RSA';
|
||||
|
||||
public isPrivate?: boolean;
|
||||
|
||||
public isPublic?: boolean;
|
||||
|
||||
//// RSA PUBLIC
|
||||
|
||||
protected doPublic(x: BigInteger): BigInteger;
|
||||
|
||||
public setPublic(N: BigInteger, E: number): void;
|
||||
|
||||
public setPublic(N: HexString, E: HexString): void;
|
||||
|
||||
public encrypt(text: string): HexString | null;
|
||||
|
||||
public encryptOAEP(text: string, hash?: string | ((s: string) => string), hashLen?: number): HexString | null;
|
||||
|
||||
//// RSA PRIVATE
|
||||
|
||||
protected doPrivate(x: BigInteger): BigInteger;
|
||||
|
||||
public setPrivate(N: BigInteger, E: number, D: BigInteger): void;
|
||||
|
||||
public setPrivate(N: HexString, E: HexString, D: HexString): void;
|
||||
|
||||
public setPrivateEx(N: HexString, E: HexString, D?: HexString | null, P?: HexString | null, Q?: HexString | null, DP?: HexString | null, DQ?: HexString | null, C?: HexString | null): void;
|
||||
|
||||
public generate(B: number, E: HexString): void;
|
||||
|
||||
public decrypt(ctext: HexString): string;
|
||||
|
||||
public decryptOAEP(ctext: HexString, hash?: string | ((s: string) => string), hashLen?: number): string | null;
|
||||
|
||||
//// RSA PEM
|
||||
|
||||
public getPosArrayOfChildrenFromHex(hPrivateKey: PEM): Idx<ASN1ObjectString>[];
|
||||
|
||||
public getHexValueArrayOfChildrenFromHex(hPrivateKey: PEM): Idx<ASN1ObjectString>[];
|
||||
|
||||
public readPrivateKeyFromPEMString(keyPEM: PEM): void;
|
||||
|
||||
public readPKCS5PrvKeyHex(h: HexString): void;
|
||||
|
||||
public readPKCS8PrvKeyHex(h: HexString): void;
|
||||
|
||||
public readPKCS5PubKeyHex(h: HexString): void;
|
||||
|
||||
public readPKCS8PubKeyHex(h: HexString): void;
|
||||
|
||||
public readCertPubKeyHex(h: HexString, nthPKI: Nth): void;
|
||||
|
||||
//// RSA SIGN
|
||||
|
||||
public sign(s: string, hashAlg: string): HexString;
|
||||
|
||||
public signWithMessageHash(sHashHex: HexString, hashAlg: string): HexString;
|
||||
|
||||
public signPSS(s: string, hashAlg: string, sLen: number): HexString;
|
||||
|
||||
public signWithMessageHashPSS(hHash: HexString, hashAlg: string, sLen: number): HexString;
|
||||
|
||||
public verify(sMsg: string, hSig: HexString): boolean | 0;
|
||||
|
||||
public verifyWithMessageHash(sHashHex: HexString, hSig: HexString): boolean | 0;
|
||||
|
||||
public verifyPSS(sMsg: string, hSig: HexString, hashAlg: string, sLen: number): boolean;
|
||||
|
||||
public verifyWithMessageHashPSS(hHash: HexString, hSig: HexString, hashAlg: string, sLen: number): boolean;
|
||||
|
||||
public static SALT_LEN_HLEN: -1;
|
||||
|
||||
public static SALT_LEN_MAX: -2;
|
||||
|
||||
public static SALT_LEN_RECOVER: -2;
|
||||
}
|
||||
|
||||
/// RNG TYPES
|
||||
class SecureRandom {
|
||||
public nextBytes(ba: Mutable<ByteNumber[]>): void;
|
||||
}
|
||||
|
||||
//// X509 TYPES
|
||||
|
||||
type ExtInfo = {
|
||||
critical: boolean;
|
||||
oid: OID;
|
||||
vidx: Idx<ASN1V>;
|
||||
};
|
||||
|
||||
type ExtAIAInfo = Record<'ocsp' | 'caissuer', string>;
|
||||
|
||||
type ExtCertificatePolicy = {
|
||||
id: OIDName;
|
||||
} & Partial<{
|
||||
cps: string;
|
||||
} | {
|
||||
unotice: string;
|
||||
}>;
|
||||
|
||||
class X509 {
|
||||
public hex: HexString | null;
|
||||
|
||||
public version: number;
|
||||
|
||||
public foffset: number;
|
||||
|
||||
public aExtInfo: null;
|
||||
|
||||
public getVersion(): number;
|
||||
|
||||
public getSerialNumberHex(): ASN1V;
|
||||
|
||||
public getSignatureAlgorithmField(): OIDName;
|
||||
|
||||
public getIssuerHex(): ASN1TLV;
|
||||
|
||||
public getIssuerString(): HexString;
|
||||
|
||||
public getSubjectHex(): ASN1TLV;
|
||||
|
||||
public getSubjectString(): HexString;
|
||||
|
||||
public getNotBefore(): TimeValue;
|
||||
|
||||
public getNotAfter(): TimeValue;
|
||||
|
||||
public getPublicKeyHex(): ASN1TLV;
|
||||
|
||||
public getPublicKeyIdx(): Idx<Mutable<Nth[]>>;
|
||||
|
||||
public getPublicKeyContentIdx(): Idx<Mutable<Nth[]>>;
|
||||
|
||||
public getPublicKey(): RSAKey | KJUR.crypto.ECDSA | KJUR.crypto.DSA;
|
||||
|
||||
public getSignatureAlgorithmName(): OIDName;
|
||||
|
||||
public getSignatureValueHex(): ASN1V;
|
||||
|
||||
public verifySignature(pubKey: GetKeyParam): boolean | 0;
|
||||
|
||||
public parseExt(): void;
|
||||
|
||||
public getExtInfo(oidOrName: OID | string): ExtInfo | undefined;
|
||||
|
||||
public getExtBasicConstraints(): ExtInfo | {} | {
|
||||
cA: true;
|
||||
pathLen?: number;
|
||||
};
|
||||
|
||||
public getExtKeyUsageBin(): BinString;
|
||||
|
||||
public getExtKeyUsageString(): string;
|
||||
|
||||
public getExtSubjectKeyIdentifier(): ASN1V | undefined;
|
||||
|
||||
public getExtAuthorityKeyIdentifier(): {
|
||||
kid: ASN1V;
|
||||
} | undefined;
|
||||
|
||||
public getExtExtKeyUsageName(): OIDName[] | undefined;
|
||||
|
||||
public getExtSubjectAltName(): Deprecated<string[]>;
|
||||
|
||||
public getExtSubjectAltName2(): ['MAIL' | 'DNS' | 'DN' | 'URI' | 'IP', string][] | undefined;
|
||||
|
||||
public getExtCRLDistributionPointsURI(): string[] | undefined;
|
||||
|
||||
public getExtAIAInfo(): ExtAIAInfo | undefined;
|
||||
|
||||
public getExtCertificatePolicies(): ExtCertificatePolicy[] | undefined;
|
||||
|
||||
public readCertPEM(sCertPEM: PEM): void;
|
||||
|
||||
public readCertHex(sCertHex: HexString): void;
|
||||
|
||||
public getInfo(): string;
|
||||
|
||||
public static hex2dn(hex: HexString, idx?: Idx<HexString>): string;
|
||||
|
||||
public static hex2rdn(hex: HexString, idx?: Idx<HexString>): string;
|
||||
|
||||
public static hex2attrTypeValue(hex: HexString, idx?: Idx<HexString>): string;
|
||||
|
||||
public static getPublicKeyFromCertPEM(sCertPEM: PEM): RSAKey | KJUR.crypto.ECDSA | KJUR.crypto.DSA;
|
||||
|
||||
public static getPublicKeyInfoPropOfCertPEM(sCertPEM: PEM): {
|
||||
algparam: ASN1V | null;
|
||||
leyhex: ASN1V;
|
||||
algoid: ASN1V;
|
||||
};
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import cluster from 'node:cluster';
|
||||
import chalk from 'chalk';
|
||||
import { default as Xev } from 'xev';
|
||||
import Xev from 'xev';
|
||||
|
||||
import Logger from '@/services/logger.js';
|
||||
import { envOption } from '../env.js';
|
||||
@ -12,7 +12,7 @@ import { workerMain } from './worker.js';
|
||||
|
||||
const logger = new Logger('core', 'cyan');
|
||||
const clusterLogger = logger.createSubLogger('cluster', 'orange', false);
|
||||
const ev = new Xev.default();
|
||||
const ev = new Xev();
|
||||
|
||||
/**
|
||||
* Init process
|
||||
|
@ -6,7 +6,7 @@ import cluster from 'node:cluster';
|
||||
import chalk from 'chalk';
|
||||
import chalkTemplate from 'chalk-template';
|
||||
import * as portscanner from 'portscanner';
|
||||
import { getConnection } from 'typeorm';
|
||||
import semver from 'semver';
|
||||
|
||||
import Logger from '@/services/logger.js';
|
||||
import loadConfig from '@/config/load.js';
|
||||
@ -14,7 +14,7 @@ import { Config } from '@/config/types.js';
|
||||
import { lessThan } from '@/prelude/array.js';
|
||||
import { envOption } from '../env.js';
|
||||
import { showMachineInfo } from '@/misc/show-machine-info.js';
|
||||
import { initDb } from '../db/postgre.js';
|
||||
import { db, initDb } from '../db/postgre.js';
|
||||
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
const _dirname = dirname(_filename);
|
||||
@ -88,10 +88,6 @@ export async function masterMain() {
|
||||
}
|
||||
}
|
||||
|
||||
const runningNodejsVersion = process.version.slice(1).split('.').map(x => parseInt(x, 10));
|
||||
const requiredNodejsVersion = [11, 7, 0];
|
||||
const satisfyNodejsVersion = !lessThan(runningNodejsVersion, requiredNodejsVersion);
|
||||
|
||||
function showEnvironment(): void {
|
||||
const env = process.env.NODE_ENV;
|
||||
const logger = bootLogger.createSubLogger('env');
|
||||
@ -108,10 +104,11 @@ function showEnvironment(): void {
|
||||
function showNodejsVersion(): void {
|
||||
const nodejsLogger = bootLogger.createSubLogger('nodejs');
|
||||
|
||||
nodejsLogger.info(`Version ${runningNodejsVersion.join('.')}`);
|
||||
nodejsLogger.info(`Version ${process.version} detected.`);
|
||||
|
||||
if (!satisfyNodejsVersion) {
|
||||
nodejsLogger.error(`Node.js version is less than ${requiredNodejsVersion.join('.')}. Please upgrade it.`, null, true);
|
||||
const minVersion = fs.readFileSync(`${_dirname}/../../../../.node-version`, 'utf-8').trim();
|
||||
if (semver.lt(process.version, minVersion)) {
|
||||
nodejsLogger.error(`At least Node.js ${minVersion} required!`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
@ -146,7 +143,7 @@ async function connectDb(): Promise<void> {
|
||||
try {
|
||||
dbLogger.info('Connecting...');
|
||||
await initDb();
|
||||
const v = await getConnection().query('SHOW server_version').then(x => x[0].server_version);
|
||||
const v = await db.query('SHOW server_version').then(x => x[0].server_version);
|
||||
dbLogger.succ(`Connected: v${v}`);
|
||||
} catch (e) {
|
||||
dbLogger.error('Cannot connect', null, true);
|
||||
|
@ -25,6 +25,7 @@ const path = process.env.NODE_ENV === 'test'
|
||||
|
||||
export default function load() {
|
||||
const meta = JSON.parse(fs.readFileSync(`${_dirname}/../../../../built/meta.json`, 'utf-8'));
|
||||
const clientManifest = JSON.parse(fs.readFileSync(`${_dirname}/../../../../built/_client_dist_/manifest.json`, 'utf-8'));
|
||||
const config = yaml.load(fs.readFileSync(path, 'utf-8')) as Source;
|
||||
|
||||
const mixin = {} as Mixin;
|
||||
@ -45,6 +46,7 @@ export default function load() {
|
||||
mixin.authUrl = `${mixin.scheme}://${mixin.host}/auth`;
|
||||
mixin.driveUrl = `${mixin.scheme}://${mixin.host}/files`;
|
||||
mixin.userAgent = `Misskey/${meta.version} (${config.url})`;
|
||||
mixin.clientEntry = clientManifest['src/init.ts'].file.replace(/^_client_dist_\//, '');
|
||||
|
||||
if (!config.redis.prefix) config.redis.prefix = mixin.host;
|
||||
|
||||
|
@ -80,6 +80,7 @@ export type Mixin = {
|
||||
authUrl: string;
|
||||
driveUrl: string;
|
||||
userAgent: string;
|
||||
clientEntry: string;
|
||||
};
|
||||
|
||||
export type Config = Source & Mixin;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { default as Xev } from 'xev';
|
||||
import Xev from 'xev';
|
||||
import { deliverQueue, inboxQueue } from '../queue/queues.js';
|
||||
|
||||
const ev = new Xev.default();
|
||||
const ev = new Xev();
|
||||
|
||||
const interval = 10000;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import si from 'systeminformation';
|
||||
import { default as Xev } from 'xev';
|
||||
import Xev from 'xev';
|
||||
import * as osUtils from 'os-utils';
|
||||
|
||||
const ev = new Xev.default();
|
||||
const ev = new Xev();
|
||||
|
||||
const interval = 2000;
|
||||
|
||||
|
@ -2,9 +2,10 @@
|
||||
import pg from 'pg';
|
||||
pg.types.setTypeParser(20, Number);
|
||||
|
||||
import { createConnection, Logger, getConnection } from 'typeorm';
|
||||
import { Logger, DataSource } from 'typeorm';
|
||||
import * as highlight from 'cli-highlight';
|
||||
import config from '@/config/index.js';
|
||||
import { envOption } from '../env.js';
|
||||
|
||||
import { dbLogger } from './logger.js';
|
||||
|
||||
@ -61,7 +62,6 @@ import { Antenna } from '@/models/entities/antenna.js';
|
||||
import { AntennaNote } from '@/models/entities/antenna-note.js';
|
||||
import { PromoNote } from '@/models/entities/promo-note.js';
|
||||
import { PromoRead } from '@/models/entities/promo-read.js';
|
||||
import { envOption } from '../env.js';
|
||||
import { Relay } from '@/models/entities/relay.js';
|
||||
import { MutedNote } from '@/models/entities/muted-note.js';
|
||||
import { Channel } from '@/models/entities/channel.js';
|
||||
@ -73,8 +73,9 @@ import { PasswordResetRequest } from '@/models/entities/password-reset-request.j
|
||||
import { UserPending } from '@/models/entities/user-pending.js';
|
||||
|
||||
import { entities as charts } from '@/services/chart/entities.js';
|
||||
import { Webhook } from '@/models/entities/webhook.js';
|
||||
|
||||
const sqlLogger = dbLogger.createSubLogger('sql', 'white', false);
|
||||
const sqlLogger = dbLogger.createSubLogger('sql', 'gray', false);
|
||||
|
||||
class MyCustomLogger implements Logger {
|
||||
private highlight(sql: string) {
|
||||
@ -84,9 +85,7 @@ class MyCustomLogger implements Logger {
|
||||
}
|
||||
|
||||
public logQuery(query: string, parameters?: any[]) {
|
||||
if (envOption.verbose) {
|
||||
sqlLogger.info(this.highlight(query));
|
||||
}
|
||||
sqlLogger.info(this.highlight(query).substring(0, 100));
|
||||
}
|
||||
|
||||
public logQueryError(error: string, query: string, parameters?: any[]) {
|
||||
@ -173,58 +172,59 @@ export const entities = [
|
||||
Ad,
|
||||
PasswordResetRequest,
|
||||
UserPending,
|
||||
Webhook,
|
||||
...charts,
|
||||
];
|
||||
|
||||
export function initDb(justBorrow = false, sync = false, forceRecreate = false) {
|
||||
if (!forceRecreate) {
|
||||
try {
|
||||
const conn = getConnection();
|
||||
return Promise.resolve(conn);
|
||||
} catch (e) {}
|
||||
}
|
||||
const log = process.env.NODE_ENV !== 'production';
|
||||
|
||||
const log = process.env.NODE_ENV !== 'production';
|
||||
|
||||
return createConnection({
|
||||
type: 'postgres',
|
||||
host: config.db.host,
|
||||
port: config.db.port,
|
||||
username: config.db.user,
|
||||
password: config.db.pass,
|
||||
database: config.db.db,
|
||||
extra: {
|
||||
statement_timeout: 1000 * 10,
|
||||
...config.db.extra,
|
||||
export const db = new DataSource({
|
||||
type: 'postgres',
|
||||
host: config.db.host,
|
||||
port: config.db.port,
|
||||
username: config.db.user,
|
||||
password: config.db.pass,
|
||||
database: config.db.db,
|
||||
extra: {
|
||||
statement_timeout: 1000 * 10,
|
||||
...config.db.extra,
|
||||
},
|
||||
synchronize: process.env.NODE_ENV === 'test',
|
||||
dropSchema: process.env.NODE_ENV === 'test',
|
||||
cache: !config.db.disableCache ? {
|
||||
type: 'redis',
|
||||
options: {
|
||||
host: config.redis.host,
|
||||
port: config.redis.port,
|
||||
password: config.redis.pass,
|
||||
prefix: `${config.redis.prefix}:query:`,
|
||||
db: config.redis.db || 0,
|
||||
},
|
||||
synchronize: process.env.NODE_ENV === 'test' || sync,
|
||||
dropSchema: process.env.NODE_ENV === 'test' && !justBorrow,
|
||||
cache: !config.db.disableCache ? {
|
||||
type: 'redis',
|
||||
options: {
|
||||
host: config.redis.host,
|
||||
port: config.redis.port,
|
||||
password: config.redis.pass,
|
||||
prefix: `${config.redis.prefix}:query:`,
|
||||
db: config.redis.db || 0,
|
||||
},
|
||||
} : false,
|
||||
logging: log,
|
||||
logger: log ? new MyCustomLogger() : undefined,
|
||||
entities: entities,
|
||||
});
|
||||
} : false,
|
||||
logging: log,
|
||||
logger: log ? new MyCustomLogger() : undefined,
|
||||
maxQueryExecutionTime: 300,
|
||||
entities: entities,
|
||||
migrations: ['../../migration/*.js'],
|
||||
});
|
||||
|
||||
export async function initDb() {
|
||||
if (db.isInitialized) {
|
||||
// nop
|
||||
} else {
|
||||
await db.connect();
|
||||
}
|
||||
}
|
||||
|
||||
export async function resetDb() {
|
||||
const reset = async () => {
|
||||
const conn = await getConnection();
|
||||
const tables = await conn.query(`SELECT relname AS "table"
|
||||
const tables = await db.query(`SELECT relname AS "table"
|
||||
FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
|
||||
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
|
||||
AND C.relkind = 'r'
|
||||
AND nspname !~ '^pg_toast';`);
|
||||
for (const table of tables) {
|
||||
await conn.query(`DELETE FROM "${table.table}" CASCADE`);
|
||||
await db.query(`DELETE FROM "${table.table}" CASCADE`);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
export class Cache<T> {
|
||||
private cache: Map<string | null, { date: number; value: T; }>;
|
||||
public cache: Map<string | null, { date: number; value: T; }>;
|
||||
private lifetime: number;
|
||||
|
||||
constructor(lifetime: Cache<never>['lifetime']) {
|
||||
@ -28,16 +28,52 @@ export class Cache<T> {
|
||||
this.cache.delete(key);
|
||||
}
|
||||
|
||||
public async fetch(key: string | null, fetcher: () => Promise<T>): Promise<T> {
|
||||
/**
|
||||
* キャッシュがあればそれを返し、無ければfetcherを呼び出して結果をキャッシュ&返します
|
||||
* optional: キャッシュが存在してもvalidatorでfalseを返すとキャッシュ無効扱いにします
|
||||
*/
|
||||
public async fetch(key: string | null, fetcher: () => Promise<T>, validator?: (cachedValue: T) => boolean): Promise<T> {
|
||||
const cachedValue = this.get(key);
|
||||
if (cachedValue !== undefined) {
|
||||
// Cache HIT
|
||||
return cachedValue;
|
||||
if (validator) {
|
||||
if (validator(cachedValue)) {
|
||||
// Cache HIT
|
||||
return cachedValue;
|
||||
}
|
||||
} else {
|
||||
// Cache HIT
|
||||
return cachedValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Cache MISS
|
||||
const value = await fetcher();
|
||||
this.set(key, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* キャッシュがあればそれを返し、無ければfetcherを呼び出して結果をキャッシュ&返します
|
||||
* optional: キャッシュが存在してもvalidatorでfalseを返すとキャッシュ無効扱いにします
|
||||
*/
|
||||
public async fetchMaybe(key: string | null, fetcher: () => Promise<T | undefined>, validator?: (cachedValue: T) => boolean): Promise<T | undefined> {
|
||||
const cachedValue = this.get(key);
|
||||
if (cachedValue !== undefined) {
|
||||
if (validator) {
|
||||
if (validator(cachedValue)) {
|
||||
// Cache HIT
|
||||
return cachedValue;
|
||||
}
|
||||
} else {
|
||||
// Cache HIT
|
||||
return cachedValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Cache MISS
|
||||
const value = await fetcher();
|
||||
if (value !== undefined) {
|
||||
this.set(key, value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
@ -1,33 +0,0 @@
|
||||
import { Context } from 'cafy';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export class ID<Maybe = string> extends Context<string | (Maybe extends {} ? string : Maybe)> {
|
||||
public readonly name = 'ID';
|
||||
|
||||
constructor(optional = false, nullable = false) {
|
||||
super(optional, nullable);
|
||||
|
||||
this.push((v: any) => {
|
||||
if (typeof v !== 'string') {
|
||||
return new Error('must-be-an-id');
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
public getType() {
|
||||
return super.getType('String');
|
||||
}
|
||||
|
||||
public makeOptional(): ID<undefined> {
|
||||
return new ID(true, false);
|
||||
}
|
||||
|
||||
public makeNullable(): ID<null> {
|
||||
return new ID(false, true);
|
||||
}
|
||||
|
||||
public makeOptionalNullable(): ID<undefined | null> {
|
||||
return new ID(true, true);
|
||||
}
|
||||
}
|
@ -42,7 +42,8 @@ async function getCaptchaResponse(url: string, secret: string, response: string)
|
||||
headers: {
|
||||
'User-Agent': config.userAgent,
|
||||
},
|
||||
timeout: 10 * 1000,
|
||||
// TODO
|
||||
//timeout: 10 * 1000,
|
||||
agent: getAgentByUrl,
|
||||
}).catch(e => {
|
||||
throw `${e.message || e}`;
|
||||
|
@ -1,17 +1,26 @@
|
||||
import { Antenna } from '@/models/entities/antenna.js';
|
||||
import { Note } from '@/models/entities/note.js';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
import { UserListJoinings, UserGroupJoinings } from '@/models/index.js';
|
||||
import { UserListJoinings, UserGroupJoinings, Blockings } from '@/models/index.js';
|
||||
import { getFullApAccount } from './convert-host.js';
|
||||
import * as Acct from '@/misc/acct.js';
|
||||
import { Packed } from './schema.js';
|
||||
import { Cache } from './cache.js';
|
||||
|
||||
const blockingCache = new Cache<User['id'][]>(1000 * 60 * 5);
|
||||
|
||||
// NOTE: フォローしているユーザーのノート、リストのユーザーのノート、グループのユーザーのノート指定はパフォーマンス上の理由で無効になっている
|
||||
|
||||
/**
|
||||
* noteUserFollowers / antennaUserFollowing はどちらか一方が指定されていればよい
|
||||
*/
|
||||
export async function checkHitAntenna(antenna: Antenna, note: (Note | Packed<'Note'>), noteUser: { username: string; host: string | null; }, noteUserFollowers?: User['id'][], antennaUserFollowing?: User['id'][]): Promise<boolean> {
|
||||
export async function checkHitAntenna(antenna: Antenna, note: (Note | Packed<'Note'>), noteUser: { id: User['id']; username: string; host: string | null; }, noteUserFollowers?: User['id'][], antennaUserFollowing?: User['id'][]): Promise<boolean> {
|
||||
if (note.visibility === 'specified') return false;
|
||||
|
||||
// アンテナ作成者がノート作成者にブロックされていたらスキップ
|
||||
const blockings = await blockingCache.fetch(noteUser.id, () => Blockings.findBy({ blockerId: noteUser.id }).then(res => res.map(x => x.blockeeId)));
|
||||
if (blockings.some(blocking => blocking === antenna.userId)) return false;
|
||||
|
||||
if (note.visibility === 'followers') {
|
||||
if (noteUserFollowers && !noteUserFollowers.includes(antenna.userId)) return false;
|
||||
if (antennaUserFollowing && !antennaUserFollowing.includes(note.userId)) return false;
|
||||
@ -23,15 +32,15 @@ export async function checkHitAntenna(antenna: Antenna, note: (Note | Packed<'No
|
||||
if (noteUserFollowers && !noteUserFollowers.includes(antenna.userId)) return false;
|
||||
if (antennaUserFollowing && !antennaUserFollowing.includes(note.userId)) return false;
|
||||
} else if (antenna.src === 'list') {
|
||||
const listUsers = (await UserListJoinings.find({
|
||||
const listUsers = (await UserListJoinings.findBy({
|
||||
userListId: antenna.userListId!,
|
||||
})).map(x => x.userId);
|
||||
|
||||
if (!listUsers.includes(note.userId)) return false;
|
||||
} else if (antenna.src === 'group') {
|
||||
const joining = await UserGroupJoinings.findOneOrFail(antenna.userGroupJoiningId!);
|
||||
const joining = await UserGroupJoinings.findOneByOrFail({ id: antenna.userGroupJoiningId! });
|
||||
|
||||
const groupUsers = (await UserGroupJoinings.find({
|
||||
const groupUsers = (await UserGroupJoinings.findBy({
|
||||
userGroupId: joining.userGroupId,
|
||||
})).map(x => x.userId);
|
||||
|
||||
|
@ -6,7 +6,7 @@ import { httpAgent, httpsAgent, StatusError } from './fetch.js';
|
||||
import config from '@/config/index.js';
|
||||
import chalk from 'chalk';
|
||||
import Logger from '@/services/logger.js';
|
||||
import * as IPCIDR from 'ip-cidr';
|
||||
import IPCIDR from 'ip-cidr';
|
||||
import PrivateIp from 'private-ip';
|
||||
|
||||
const pipeline = util.promisify(stream.pipeline);
|
||||
|
@ -1,19 +1,21 @@
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { Meta } from '@/models/entities/meta.js';
|
||||
import { getConnection } from 'typeorm';
|
||||
|
||||
let cache: Meta;
|
||||
|
||||
export async function fetchMeta(noCache = false): Promise<Meta> {
|
||||
if (!noCache && cache) return cache;
|
||||
|
||||
return await getConnection().transaction(async transactionalEntityManager => {
|
||||
return await db.transaction(async transactionalEntityManager => {
|
||||
// 過去のバグでレコードが複数出来てしまっている可能性があるので新しいIDを優先する
|
||||
const meta = await transactionalEntityManager.findOne(Meta, {
|
||||
const metas = await transactionalEntityManager.find(Meta, {
|
||||
order: {
|
||||
id: 'DESC',
|
||||
},
|
||||
});
|
||||
|
||||
const meta = metas[0];
|
||||
|
||||
if (meta) {
|
||||
cache = meta;
|
||||
return meta;
|
||||
|
@ -5,5 +5,5 @@ import { Users } from '@/models/index.js';
|
||||
export async function fetchProxyAccount(): Promise<ILocalUser | null> {
|
||||
const meta = await fetchMeta();
|
||||
if (meta.proxyAccountId == null) return null;
|
||||
return await Users.findOneOrFail(meta.proxyAccountId) as ILocalUser;
|
||||
return await Users.findOneByOrFail({ id: meta.proxyAccountId }) as ILocalUser;
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
import * as http from 'http';
|
||||
import * as https from 'https';
|
||||
import * as http from 'node:http';
|
||||
import * as https from 'node:https';
|
||||
import { URL } from 'node:url';
|
||||
import CacheableLookup from 'cacheable-lookup';
|
||||
import fetch from 'node-fetch';
|
||||
import { HttpProxyAgent, HttpsProxyAgent } from 'hpagent';
|
||||
import config from '@/config/index.js';
|
||||
import { URL } from 'node:url';
|
||||
|
||||
export async function getJson(url: string, accept = 'application/json, */*', timeout = 10000, headers?: Record<string, string>) {
|
||||
const res = await getResponse({
|
||||
@ -35,7 +35,7 @@ export async function getHtml(url: string, accept = 'text/html, */*', timeout =
|
||||
}
|
||||
|
||||
export async function getResponse(args: { url: string, method: string, body?: string, headers: Record<string, string>, timeout?: number, size?: number }) {
|
||||
const timeout = args?.timeout || 10 * 1000;
|
||||
const timeout = args.timeout || 10 * 1000;
|
||||
|
||||
const controller = new AbortController();
|
||||
setTimeout(() => {
|
||||
@ -47,7 +47,7 @@ export async function getResponse(args: { url: string, method: string, body?: st
|
||||
headers: args.headers,
|
||||
body: args.body,
|
||||
timeout,
|
||||
size: args?.size || 10 * 1024 * 1024,
|
||||
size: args.size || 10 * 1024 * 1024,
|
||||
agent: getAgentByUrl,
|
||||
signal: controller.signal,
|
||||
});
|
||||
@ -120,9 +120,9 @@ export const httpsAgent = config.proxy
|
||||
*/
|
||||
export function getAgentByUrl(url: URL, bypassProxy = false) {
|
||||
if (bypassProxy || (config.proxyBypassHosts || []).includes(url.hostname)) {
|
||||
return url.protocol == 'http:' ? _http : _https;
|
||||
return url.protocol === 'http:' ? _http : _https;
|
||||
} else {
|
||||
return url.protocol == 'http:' ? httpAgent : httpsAgent;
|
||||
return url.protocol === 'http:' ? httpAgent : httpsAgent;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ export const getNoteSummary = (note: Packed<'Note'>): string => {
|
||||
}
|
||||
|
||||
// ファイルが添付されているとき
|
||||
if ((note.files || []).length != 0) {
|
||||
if ((note.files || []).length !== 0) {
|
||||
summary += ` (📎${note.files!.length})`;
|
||||
}
|
||||
|
||||
|
@ -6,5 +6,5 @@ import { Cache } from './cache.js';
|
||||
const cache = new Cache<UserKeypair>(Infinity);
|
||||
|
||||
export async function getUserKeypair(userId: User['id']): Promise<UserKeypair> {
|
||||
return await cache.fetch(userId, () => UserKeypairs.findOneOrFail(userId));
|
||||
return await cache.fetch(userId, () => UserKeypairs.findOneByOrFail({ userId: userId }));
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { In } from 'typeorm';
|
||||
import { In, IsNull } from 'typeorm';
|
||||
import { Emojis } from '@/models/index.js';
|
||||
import { Emoji } from '@/models/entities/emoji.js';
|
||||
import { Note } from '@/models/entities/note.js';
|
||||
@ -52,9 +52,9 @@ export async function populateEmoji(emojiName: string, noteUserHost: string | nu
|
||||
const { name, host } = parseEmojiStr(emojiName, noteUserHost);
|
||||
if (name == null) return null;
|
||||
|
||||
const queryOrNull = async () => (await Emojis.findOne({
|
||||
const queryOrNull = async () => (await Emojis.findOneBy({
|
||||
name,
|
||||
host,
|
||||
host: host ?? IsNull(),
|
||||
})) || null;
|
||||
|
||||
const emoji = await cache.fetch(`${name} ${host}`, queryOrNull);
|
||||
@ -63,7 +63,7 @@ export async function populateEmoji(emojiName: string, noteUserHost: string | nu
|
||||
|
||||
const isLocal = emoji.host == null;
|
||||
const emojiUrl = emoji.publicUrl || emoji.originalUrl; // || emoji.originalUrl してるのは後方互換性のため
|
||||
const url = isLocal ? emojiUrl : `${config.url}/proxy/image.png?${query({ url: emojiUrl })}`;
|
||||
const url = isLocal ? emojiUrl : `${config.url}/proxy/${encodeURIComponent((new URL(emojiUrl)).pathname)}?${query({ url: emojiUrl })}`;
|
||||
|
||||
return {
|
||||
name: emojiName,
|
||||
@ -112,7 +112,7 @@ export async function prefetchEmojis(emojis: { name: string; host: string | null
|
||||
for (const host of hosts) {
|
||||
emojisQuery.push({
|
||||
name: In(notCachedEmojis.filter(e => e.host === host).map(e => e.name)),
|
||||
host: host,
|
||||
host: host ?? IsNull(),
|
||||
});
|
||||
}
|
||||
const _emojis = emojisQuery.length > 0 ? await Emojis.find({
|
||||
|
@ -3,6 +3,7 @@ import { emojiRegex } from './emoji-regex.js';
|
||||
import { fetchMeta } from './fetch-meta.js';
|
||||
import { Emojis } from '@/models/index.js';
|
||||
import { toPunyNullable } from './convert-host.js';
|
||||
import { IsNull } from 'typeorm';
|
||||
|
||||
const legacies: Record<string, string> = {
|
||||
'like': '👍',
|
||||
@ -74,8 +75,8 @@ export async function toDbReaction(reaction?: string | null, reacterHost?: strin
|
||||
const custom = reaction.match(/^:([\w+-]+)(?:@\.)?:$/);
|
||||
if (custom) {
|
||||
const name = custom[1];
|
||||
const emoji = await Emojis.findOne({
|
||||
host: reacterHost || null,
|
||||
const emoji = await Emojis.findOneBy({
|
||||
host: reacterHost ?? IsNull(),
|
||||
name,
|
||||
});
|
||||
|
||||
|
@ -89,7 +89,7 @@ export interface Schema extends OfSchema {
|
||||
readonly optional?: boolean;
|
||||
readonly items?: Schema;
|
||||
readonly properties?: Obj;
|
||||
readonly required?: ReadonlyArray<keyof NonNullable<this['properties']>>;
|
||||
readonly required?: ReadonlyArray<Extract<keyof NonNullable<this['properties']>, string>>;
|
||||
readonly description?: string;
|
||||
readonly example?: any;
|
||||
readonly format?: string;
|
||||
@ -98,6 +98,9 @@ export interface Schema extends OfSchema {
|
||||
readonly default?: (this['type'] extends TypeStringef ? StringDefToType<this['type']> : any) | null;
|
||||
readonly maxLength?: number;
|
||||
readonly minLength?: number;
|
||||
readonly maximum?: number;
|
||||
readonly minimum?: number;
|
||||
readonly pattern?: string;
|
||||
}
|
||||
|
||||
type RequiredPropertyNames<s extends Obj> = {
|
||||
@ -105,24 +108,26 @@ type RequiredPropertyNames<s extends Obj> = {
|
||||
// K is not optional
|
||||
s[K]['optional'] extends false ? K :
|
||||
// K has default value
|
||||
s[K]['default'] extends null | string | number | boolean | Record<string, unknown> ? K : never
|
||||
s[K]['default'] extends null | string | number | boolean | Record<string, unknown> ? K :
|
||||
never
|
||||
}[keyof s];
|
||||
|
||||
export interface Obj { [key: string]: Schema; }
|
||||
export type Obj = Record<string, Schema>;
|
||||
|
||||
// https://github.com/misskey-dev/misskey/issues/8535
|
||||
// To avoid excessive stack depth error,
|
||||
// deceive TypeScript with UnionToIntersection (or more precisely, `infer` expression within it).
|
||||
export type ObjType<s extends Obj, RequiredProps extends keyof s> =
|
||||
{ -readonly [P in keyof s]?: SchemaType<s[P]> } &
|
||||
{ -readonly [P in RequiredProps]: SchemaType<s[P]> } &
|
||||
{ -readonly [P in RequiredPropertyNames<s>]: SchemaType<s[P]> };
|
||||
UnionToIntersection<
|
||||
{ -readonly [R in RequiredPropertyNames<s>]-?: SchemaType<s[R]> } &
|
||||
{ -readonly [R in RequiredProps]-?: SchemaType<s[R]> } &
|
||||
{ -readonly [P in keyof s]?: SchemaType<s[P]> }
|
||||
>;
|
||||
|
||||
type NullOrUndefined<p extends Schema, T> =
|
||||
p['nullable'] extends true
|
||||
? p['optional'] extends true
|
||||
? (T | null | undefined)
|
||||
: (T | null)
|
||||
: p['optional'] extends true
|
||||
? (T | undefined)
|
||||
: T;
|
||||
| (p['nullable'] extends true ? null : never)
|
||||
| (p['optional'] extends true ? undefined : never)
|
||||
| T;
|
||||
|
||||
// https://stackoverflow.com/questions/54938141/typescript-convert-union-to-intersection
|
||||
// Get intersection from union
|
||||
@ -139,9 +144,9 @@ export type SchemaTypeDef<p extends Schema> =
|
||||
p['type'] extends 'number' ? number :
|
||||
p['type'] extends 'string' ? (
|
||||
p['enum'] extends readonly string[] ?
|
||||
p['enum'][number] :
|
||||
p['format'] extends 'date-time' ? string : // Dateにする??
|
||||
string
|
||||
p['enum'][number] :
|
||||
p['format'] extends 'date-time' ? string : // Dateにする??
|
||||
string
|
||||
) :
|
||||
p['type'] extends 'boolean' ? boolean :
|
||||
p['type'] extends 'object' ? (
|
||||
|
49
packages/backend/src/misc/webhook-cache.ts
Normal file
49
packages/backend/src/misc/webhook-cache.ts
Normal file
@ -0,0 +1,49 @@
|
||||
import { Webhooks } from '@/models/index.js';
|
||||
import { Webhook } from '@/models/entities/webhook.js';
|
||||
import { subsdcriber } from '../db/redis.js';
|
||||
|
||||
let webhooksFetched = false;
|
||||
let webhooks: Webhook[] = [];
|
||||
|
||||
export async function getActiveWebhooks() {
|
||||
if (!webhooksFetched) {
|
||||
webhooks = await Webhooks.findBy({
|
||||
active: true,
|
||||
});
|
||||
webhooksFetched = true;
|
||||
}
|
||||
|
||||
return webhooks;
|
||||
}
|
||||
|
||||
subsdcriber.on('message', async (_, data) => {
|
||||
const obj = JSON.parse(data);
|
||||
|
||||
if (obj.channel === 'internal') {
|
||||
const { type, body } = obj.message;
|
||||
switch (type) {
|
||||
case 'webhookCreated':
|
||||
if (body.active) {
|
||||
webhooks.push(body);
|
||||
}
|
||||
break;
|
||||
case 'webhookUpdated':
|
||||
if (body.active) {
|
||||
const i = webhooks.findIndex(a => a.id === body.id);
|
||||
if (i > -1) {
|
||||
webhooks[i] = body;
|
||||
} else {
|
||||
webhooks.push(body);
|
||||
}
|
||||
} else {
|
||||
webhooks = webhooks.filter(a => a.id !== body.id);
|
||||
}
|
||||
break;
|
||||
case 'webhookDeleted':
|
||||
webhooks = webhooks.filter(a => a.id !== body.id);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
@ -15,7 +15,6 @@ export class AccessToken {
|
||||
|
||||
@Column('timestamp with time zone', {
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public lastUsedAt: Date | null;
|
||||
|
||||
@ -29,7 +28,6 @@ export class AccessToken {
|
||||
@Column('varchar', {
|
||||
length: 128,
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public session: string | null;
|
||||
|
||||
@ -52,7 +50,6 @@ export class AccessToken {
|
||||
@Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public appId: App['id'] | null;
|
||||
|
||||
@ -65,21 +62,18 @@ export class AccessToken {
|
||||
@Column('varchar', {
|
||||
length: 128,
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public name: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public description: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public iconUrl: string | null;
|
||||
|
||||
|
@ -23,7 +23,7 @@ export class AuthSession {
|
||||
...id(),
|
||||
nullable: true,
|
||||
})
|
||||
public userId: User['id'];
|
||||
public userId: User['id'] | null;
|
||||
|
||||
@ManyToOne(type => User, {
|
||||
onDelete: 'CASCADE',
|
||||
|
@ -37,7 +37,7 @@ export class Clip {
|
||||
public isPublic: boolean;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 2048, nullable: true, default: null,
|
||||
length: 2048, nullable: true,
|
||||
comment: 'The description of the Clip.',
|
||||
})
|
||||
public description: string | null;
|
||||
|
@ -79,7 +79,6 @@ export class DriveFile {
|
||||
})
|
||||
public properties: { width?: number; height?: number; orientation?: number; avgColor?: string };
|
||||
|
||||
@Index()
|
||||
@Column('boolean')
|
||||
public storedInternal: boolean;
|
||||
|
||||
|
@ -36,6 +36,7 @@ export class Emoji {
|
||||
|
||||
@Column('varchar', {
|
||||
length: 512,
|
||||
default: '',
|
||||
})
|
||||
public publicUrl: string;
|
||||
|
||||
|
@ -107,53 +107,53 @@ export class Instance {
|
||||
public isSuspended: boolean;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
length: 64, nullable: true,
|
||||
comment: 'The software of the Instance.',
|
||||
})
|
||||
public softwareName: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
length: 64, nullable: true,
|
||||
})
|
||||
public softwareVersion: string | null;
|
||||
|
||||
@Column('boolean', {
|
||||
nullable: true, default: null,
|
||||
nullable: true,
|
||||
})
|
||||
public openRegistrations: boolean | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 256, nullable: true, default: null,
|
||||
length: 256, nullable: true,
|
||||
})
|
||||
public name: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 4096, nullable: true, default: null,
|
||||
length: 4096, nullable: true,
|
||||
})
|
||||
public description: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 128, nullable: true, default: null,
|
||||
length: 128, nullable: true,
|
||||
})
|
||||
public maintainerName: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 256, nullable: true, default: null,
|
||||
length: 256, nullable: true,
|
||||
})
|
||||
public maintainerEmail: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 256, nullable: true, default: null,
|
||||
length: 256, nullable: true,
|
||||
})
|
||||
public iconUrl: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 256, nullable: true, default: null,
|
||||
length: 256, nullable: true,
|
||||
})
|
||||
public faviconUrl: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
length: 64, nullable: true,
|
||||
})
|
||||
public themeColor: string | null;
|
||||
|
||||
|
@ -78,7 +78,7 @@ export class Meta {
|
||||
public blockedHosts: string[];
|
||||
|
||||
@Column('varchar', {
|
||||
length: 512, array: true, default: '{"/featured", "/channels", "/explore", "/pages", "/about-misskey"}',
|
||||
length: 512, array: true, default: '{/featured,/channels,/explore,/pages,/about-misskey}',
|
||||
})
|
||||
public pinnedPages: string[];
|
||||
|
||||
@ -346,14 +346,12 @@ export class Meta {
|
||||
|
||||
@Column('varchar', {
|
||||
length: 8192,
|
||||
default: null,
|
||||
nullable: true,
|
||||
})
|
||||
public defaultLightTheme: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 8192,
|
||||
default: null,
|
||||
nullable: true,
|
||||
})
|
||||
public defaultDarkTheme: string | null;
|
||||
|
@ -17,7 +17,6 @@ export class Muting {
|
||||
@Index()
|
||||
@Column('timestamp with time zone', {
|
||||
nullable: true,
|
||||
default: null,
|
||||
})
|
||||
public expiresAt: Date | null;
|
||||
|
||||
|
@ -53,8 +53,8 @@ export class Note {
|
||||
})
|
||||
public threadId: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 8192, nullable: true,
|
||||
@Column('text', {
|
||||
nullable: true,
|
||||
})
|
||||
public text: string | null;
|
||||
|
||||
@ -179,7 +179,7 @@ export class Note {
|
||||
@Index()
|
||||
@Column({
|
||||
...id(),
|
||||
nullable: true, default: null,
|
||||
nullable: true,
|
||||
comment: 'The ID of source channel.',
|
||||
})
|
||||
public channelId: Channel['id'] | null;
|
||||
|
@ -192,6 +192,7 @@ export class UserProfile {
|
||||
|
||||
@Column('jsonb', {
|
||||
default: [],
|
||||
comment: 'List of instances muted by the user.',
|
||||
})
|
||||
public mutedInstances: string[];
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from 'typeorm';
|
||||
import { DriveFile } from './drive-file.js';
|
||||
import { id } from '../id.js';
|
||||
import { DriveFile } from './drive-file.js';
|
||||
|
||||
@Entity()
|
||||
@Index(['usernameLower', 'host'], { unique: true })
|
||||
@ -207,7 +207,7 @@ export class User {
|
||||
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
comment: 'Whether to show users replying to other users in the timeline'
|
||||
comment: 'Whether to show users replying to other users in the timeline.',
|
||||
})
|
||||
public showTimelineReplies: boolean;
|
||||
|
||||
@ -234,3 +234,9 @@ export interface ILocalUser extends User {
|
||||
export interface IRemoteUser extends User {
|
||||
host: string;
|
||||
}
|
||||
|
||||
export type CacheableLocalUser = ILocalUser;
|
||||
|
||||
export type CacheableRemoteUser = IRemoteUser;
|
||||
|
||||
export type CacheableUser = CacheableLocalUser | CacheableRemoteUser;
|
||||
|
73
packages/backend/src/models/entities/webhook.ts
Normal file
73
packages/backend/src/models/entities/webhook.ts
Normal file
@ -0,0 +1,73 @@
|
||||
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
|
||||
import { User } from './user.js';
|
||||
import { id } from '../id.js';
|
||||
|
||||
export const webhookEventTypes = ['mention', 'unfollow', 'follow', 'followed', 'note', 'reply', 'renote', 'reaction'] as const;
|
||||
|
||||
@Entity()
|
||||
export class Webhook {
|
||||
@PrimaryColumn(id())
|
||||
public id: string;
|
||||
|
||||
@Column('timestamp with time zone', {
|
||||
comment: 'The created date of the Antenna.',
|
||||
})
|
||||
public createdAt: Date;
|
||||
|
||||
@Index()
|
||||
@Column({
|
||||
...id(),
|
||||
comment: 'The owner ID.',
|
||||
})
|
||||
public userId: User['id'];
|
||||
|
||||
@ManyToOne(type => User, {
|
||||
onDelete: 'CASCADE',
|
||||
})
|
||||
@JoinColumn()
|
||||
public user: User | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 128,
|
||||
comment: 'The name of the Antenna.',
|
||||
})
|
||||
public name: string;
|
||||
|
||||
@Index()
|
||||
@Column('varchar', {
|
||||
length: 128, array: true, default: '{}',
|
||||
})
|
||||
public on: (typeof webhookEventTypes)[number][];
|
||||
|
||||
@Column('varchar', {
|
||||
length: 1024,
|
||||
})
|
||||
public url: string;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 1024,
|
||||
})
|
||||
public secret: string;
|
||||
|
||||
@Index()
|
||||
@Column('boolean', {
|
||||
default: true,
|
||||
})
|
||||
public active: boolean;
|
||||
|
||||
/**
|
||||
* 直近のリクエスト送信日時
|
||||
*/
|
||||
@Column('timestamp with time zone', {
|
||||
nullable: true,
|
||||
})
|
||||
public latestSentAt: Date | null;
|
||||
|
||||
/**
|
||||
* 直近のリクエスト送信時のHTTPステータスコード
|
||||
*/
|
||||
@Column('integer', {
|
||||
nullable: true,
|
||||
})
|
||||
public latestStatus: number | null;
|
||||
}
|
@ -1,4 +1,6 @@
|
||||
import { getRepository, getCustomRepository } from 'typeorm';
|
||||
import { } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
|
||||
import { Announcement } from './entities/announcement.js';
|
||||
import { AnnouncementRead } from './entities/announcement-read.js';
|
||||
import { Instance } from './entities/instance.js';
|
||||
@ -62,66 +64,68 @@ import { Ad } from './entities/ad.js';
|
||||
import { PasswordResetRequest } from './entities/password-reset-request.js';
|
||||
import { UserPending } from './entities/user-pending.js';
|
||||
import { InstanceRepository } from './repositories/instance.js';
|
||||
import { Webhook } from './entities/webhook.js';
|
||||
|
||||
export const Announcements = getRepository(Announcement);
|
||||
export const AnnouncementReads = getRepository(AnnouncementRead);
|
||||
export const Apps = getCustomRepository(AppRepository);
|
||||
export const Notes = getCustomRepository(NoteRepository);
|
||||
export const NoteFavorites = getCustomRepository(NoteFavoriteRepository);
|
||||
export const NoteWatchings = getRepository(NoteWatching);
|
||||
export const NoteThreadMutings = getRepository(NoteThreadMuting);
|
||||
export const NoteReactions = getCustomRepository(NoteReactionRepository);
|
||||
export const NoteUnreads = getRepository(NoteUnread);
|
||||
export const Polls = getRepository(Poll);
|
||||
export const PollVotes = getRepository(PollVote);
|
||||
export const Users = getCustomRepository(UserRepository);
|
||||
export const UserProfiles = getRepository(UserProfile);
|
||||
export const UserKeypairs = getRepository(UserKeypair);
|
||||
export const UserPendings = getRepository(UserPending);
|
||||
export const AttestationChallenges = getRepository(AttestationChallenge);
|
||||
export const UserSecurityKeys = getRepository(UserSecurityKey);
|
||||
export const UserPublickeys = getRepository(UserPublickey);
|
||||
export const UserLists = getCustomRepository(UserListRepository);
|
||||
export const UserListJoinings = getRepository(UserListJoining);
|
||||
export const UserGroups = getCustomRepository(UserGroupRepository);
|
||||
export const UserGroupJoinings = getRepository(UserGroupJoining);
|
||||
export const UserGroupInvitations = getCustomRepository(UserGroupInvitationRepository);
|
||||
export const UserNotePinings = getRepository(UserNotePining);
|
||||
export const UsedUsernames = getRepository(UsedUsername);
|
||||
export const Followings = getCustomRepository(FollowingRepository);
|
||||
export const FollowRequests = getCustomRepository(FollowRequestRepository);
|
||||
export const Instances = getCustomRepository(InstanceRepository);
|
||||
export const Emojis = getCustomRepository(EmojiRepository);
|
||||
export const DriveFiles = getCustomRepository(DriveFileRepository);
|
||||
export const DriveFolders = getCustomRepository(DriveFolderRepository);
|
||||
export const Notifications = getCustomRepository(NotificationRepository);
|
||||
export const Metas = getRepository(Meta);
|
||||
export const Mutings = getCustomRepository(MutingRepository);
|
||||
export const Blockings = getCustomRepository(BlockingRepository);
|
||||
export const SwSubscriptions = getRepository(SwSubscription);
|
||||
export const Hashtags = getCustomRepository(HashtagRepository);
|
||||
export const AbuseUserReports = getCustomRepository(AbuseUserReportRepository);
|
||||
export const RegistrationTickets = getRepository(RegistrationTicket);
|
||||
export const AuthSessions = getCustomRepository(AuthSessionRepository);
|
||||
export const AccessTokens = getRepository(AccessToken);
|
||||
export const Signins = getCustomRepository(SigninRepository);
|
||||
export const MessagingMessages = getCustomRepository(MessagingMessageRepository);
|
||||
export const Pages = getCustomRepository(PageRepository);
|
||||
export const PageLikes = getCustomRepository(PageLikeRepository);
|
||||
export const GalleryPosts = getCustomRepository(GalleryPostRepository);
|
||||
export const GalleryLikes = getCustomRepository(GalleryLikeRepository);
|
||||
export const ModerationLogs = getCustomRepository(ModerationLogRepository);
|
||||
export const Clips = getCustomRepository(ClipRepository);
|
||||
export const ClipNotes = getRepository(ClipNote);
|
||||
export const Antennas = getCustomRepository(AntennaRepository);
|
||||
export const AntennaNotes = getRepository(AntennaNote);
|
||||
export const PromoNotes = getRepository(PromoNote);
|
||||
export const PromoReads = getRepository(PromoRead);
|
||||
export const Relays = getCustomRepository(RelayRepository);
|
||||
export const MutedNotes = getRepository(MutedNote);
|
||||
export const Channels = getCustomRepository(ChannelRepository);
|
||||
export const ChannelFollowings = getRepository(ChannelFollowing);
|
||||
export const ChannelNotePinings = getRepository(ChannelNotePining);
|
||||
export const RegistryItems = getRepository(RegistryItem);
|
||||
export const Ads = getRepository(Ad);
|
||||
export const PasswordResetRequests = getRepository(PasswordResetRequest);
|
||||
export const Announcements = db.getRepository(Announcement);
|
||||
export const AnnouncementReads = db.getRepository(AnnouncementRead);
|
||||
export const Apps = (AppRepository);
|
||||
export const Notes = (NoteRepository);
|
||||
export const NoteFavorites = (NoteFavoriteRepository);
|
||||
export const NoteWatchings = db.getRepository(NoteWatching);
|
||||
export const NoteThreadMutings = db.getRepository(NoteThreadMuting);
|
||||
export const NoteReactions = (NoteReactionRepository);
|
||||
export const NoteUnreads = db.getRepository(NoteUnread);
|
||||
export const Polls = db.getRepository(Poll);
|
||||
export const PollVotes = db.getRepository(PollVote);
|
||||
export const Users = (UserRepository);
|
||||
export const UserProfiles = db.getRepository(UserProfile);
|
||||
export const UserKeypairs = db.getRepository(UserKeypair);
|
||||
export const UserPendings = db.getRepository(UserPending);
|
||||
export const AttestationChallenges = db.getRepository(AttestationChallenge);
|
||||
export const UserSecurityKeys = db.getRepository(UserSecurityKey);
|
||||
export const UserPublickeys = db.getRepository(UserPublickey);
|
||||
export const UserLists = (UserListRepository);
|
||||
export const UserListJoinings = db.getRepository(UserListJoining);
|
||||
export const UserGroups = (UserGroupRepository);
|
||||
export const UserGroupJoinings = db.getRepository(UserGroupJoining);
|
||||
export const UserGroupInvitations = (UserGroupInvitationRepository);
|
||||
export const UserNotePinings = db.getRepository(UserNotePining);
|
||||
export const UsedUsernames = db.getRepository(UsedUsername);
|
||||
export const Followings = (FollowingRepository);
|
||||
export const FollowRequests = (FollowRequestRepository);
|
||||
export const Instances = (InstanceRepository);
|
||||
export const Emojis = (EmojiRepository);
|
||||
export const DriveFiles = (DriveFileRepository);
|
||||
export const DriveFolders = (DriveFolderRepository);
|
||||
export const Notifications = (NotificationRepository);
|
||||
export const Metas = db.getRepository(Meta);
|
||||
export const Mutings = (MutingRepository);
|
||||
export const Blockings = (BlockingRepository);
|
||||
export const SwSubscriptions = db.getRepository(SwSubscription);
|
||||
export const Hashtags = (HashtagRepository);
|
||||
export const AbuseUserReports = (AbuseUserReportRepository);
|
||||
export const RegistrationTickets = db.getRepository(RegistrationTicket);
|
||||
export const AuthSessions = (AuthSessionRepository);
|
||||
export const AccessTokens = db.getRepository(AccessToken);
|
||||
export const Signins = (SigninRepository);
|
||||
export const MessagingMessages = (MessagingMessageRepository);
|
||||
export const Pages = (PageRepository);
|
||||
export const PageLikes = (PageLikeRepository);
|
||||
export const GalleryPosts = (GalleryPostRepository);
|
||||
export const GalleryLikes = (GalleryLikeRepository);
|
||||
export const ModerationLogs = (ModerationLogRepository);
|
||||
export const Clips = (ClipRepository);
|
||||
export const ClipNotes = db.getRepository(ClipNote);
|
||||
export const Antennas = (AntennaRepository);
|
||||
export const AntennaNotes = db.getRepository(AntennaNote);
|
||||
export const PromoNotes = db.getRepository(PromoNote);
|
||||
export const PromoReads = db.getRepository(PromoRead);
|
||||
export const Relays = (RelayRepository);
|
||||
export const MutedNotes = db.getRepository(MutedNote);
|
||||
export const Channels = (ChannelRepository);
|
||||
export const ChannelFollowings = db.getRepository(ChannelFollowing);
|
||||
export const ChannelNotePinings = db.getRepository(ChannelNotePining);
|
||||
export const RegistryItems = db.getRepository(RegistryItem);
|
||||
export const Webhooks = db.getRepository(Webhook);
|
||||
export const Ads = db.getRepository(Ad);
|
||||
export const PasswordResetRequests = db.getRepository(PasswordResetRequest);
|
||||
|
@ -1,14 +1,13 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { Users } from '../index.js';
|
||||
import { AbuseUserReport } from '@/models/entities/abuse-user-report.js';
|
||||
import { awaitAll } from '@/prelude/await-all.js';
|
||||
|
||||
@EntityRepository(AbuseUserReport)
|
||||
export class AbuseUserReportRepository extends Repository<AbuseUserReport> {
|
||||
public async pack(
|
||||
export const AbuseUserReportRepository = db.getRepository(AbuseUserReport).extend({
|
||||
async pack(
|
||||
src: AbuseUserReport['id'] | AbuseUserReport,
|
||||
) {
|
||||
const report = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const report = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
return await awaitAll({
|
||||
id: report.id,
|
||||
@ -29,11 +28,11 @@ export class AbuseUserReportRepository extends Repository<AbuseUserReport> {
|
||||
}) : null,
|
||||
forwarded: report.forwarded,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
public packMany(
|
||||
packMany(
|
||||
reports: any[],
|
||||
) {
|
||||
return Promise.all(reports.map(x => this.pack(x)));
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,17 +1,16 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { Antenna } from '@/models/entities/antenna.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
import { AntennaNotes, UserGroupJoinings } from '../index.js';
|
||||
|
||||
@EntityRepository(Antenna)
|
||||
export class AntennaRepository extends Repository<Antenna> {
|
||||
public async pack(
|
||||
export const AntennaRepository = db.getRepository(Antenna).extend({
|
||||
async pack(
|
||||
src: Antenna['id'] | Antenna,
|
||||
): Promise<Packed<'Antenna'>> {
|
||||
const antenna = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const antenna = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
const hasUnreadNote = (await AntennaNotes.findOne({ antennaId: antenna.id, read: false })) != null;
|
||||
const userGroupJoining = antenna.userGroupJoiningId ? await UserGroupJoinings.findOne(antenna.userGroupJoiningId) : null;
|
||||
const hasUnreadNote = (await AntennaNotes.findOneBy({ antennaId: antenna.id, read: false })) != null;
|
||||
const userGroupJoining = antenna.userGroupJoiningId ? await UserGroupJoinings.findOneBy({ id: antenna.userGroupJoiningId }) : null;
|
||||
|
||||
return {
|
||||
id: antenna.id,
|
||||
@ -29,5 +28,5 @@ export class AntennaRepository extends Repository<Antenna> {
|
||||
withFile: antenna.withFile,
|
||||
hasUnreadNote,
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { App } from '@/models/entities/app.js';
|
||||
import { AccessTokens } from '../index.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
import { User } from '../entities/user.js';
|
||||
|
||||
@EntityRepository(App)
|
||||
export class AppRepository extends Repository<App> {
|
||||
public async pack(
|
||||
export const AppRepository = db.getRepository(App).extend({
|
||||
async pack(
|
||||
src: App['id'] | App,
|
||||
me?: { id: User['id'] } | null | undefined,
|
||||
options?: {
|
||||
@ -21,7 +20,7 @@ export class AppRepository extends Repository<App> {
|
||||
includeProfileImageIds: false,
|
||||
}, options);
|
||||
|
||||
const app = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const app = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
return {
|
||||
id: app.id,
|
||||
@ -30,11 +29,11 @@ export class AppRepository extends Repository<App> {
|
||||
permission: app.permission,
|
||||
...(opts.includeSecret ? { secret: app.secret } : {}),
|
||||
...(me ? {
|
||||
isAuthorized: await AccessTokens.count({
|
||||
isAuthorized: await AccessTokens.countBy({
|
||||
appId: app.id,
|
||||
userId: me.id,
|
||||
}).then(count => count > 0),
|
||||
} : {}),
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,21 +1,20 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { Apps } from '../index.js';
|
||||
import { AuthSession } from '@/models/entities/auth-session.js';
|
||||
import { awaitAll } from '@/prelude/await-all.js';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
|
||||
@EntityRepository(AuthSession)
|
||||
export class AuthSessionRepository extends Repository<AuthSession> {
|
||||
public async pack(
|
||||
export const AuthSessionRepository = db.getRepository(AuthSession).extend({
|
||||
async pack(
|
||||
src: AuthSession['id'] | AuthSession,
|
||||
me?: { id: User['id'] } | null | undefined
|
||||
) {
|
||||
const session = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const session = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
return await awaitAll({
|
||||
id: session.id,
|
||||
app: Apps.pack(session.appId, me),
|
||||
token: session.token,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,17 +1,16 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { Users } from '../index.js';
|
||||
import { Blocking } from '@/models/entities/blocking.js';
|
||||
import { awaitAll } from '@/prelude/await-all.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
|
||||
@EntityRepository(Blocking)
|
||||
export class BlockingRepository extends Repository<Blocking> {
|
||||
public async pack(
|
||||
export const BlockingRepository = db.getRepository(Blocking).extend({
|
||||
async pack(
|
||||
src: Blocking['id'] | Blocking,
|
||||
me?: { id: User['id'] } | null | undefined
|
||||
): Promise<Packed<'Blocking'>> {
|
||||
const blocking = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const blocking = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
return await awaitAll({
|
||||
id: blocking.id,
|
||||
@ -21,12 +20,12 @@ export class BlockingRepository extends Repository<Blocking> {
|
||||
detail: true,
|
||||
}),
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
public packMany(
|
||||
packMany(
|
||||
blockings: any[],
|
||||
me: { id: User['id'] }
|
||||
) {
|
||||
return Promise.all(blockings.map(x => this.pack(x, me)));
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,23 +1,22 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { Channel } from '@/models/entities/channel.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
import { DriveFiles, ChannelFollowings, NoteUnreads } from '../index.js';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
|
||||
@EntityRepository(Channel)
|
||||
export class ChannelRepository extends Repository<Channel> {
|
||||
public async pack(
|
||||
export const ChannelRepository = db.getRepository(Channel).extend({
|
||||
async pack(
|
||||
src: Channel['id'] | Channel,
|
||||
me?: { id: User['id'] } | null | undefined,
|
||||
): Promise<Packed<'Channel'>> {
|
||||
const channel = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const channel = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
const meId = me ? me.id : null;
|
||||
|
||||
const banner = channel.bannerId ? await DriveFiles.findOne(channel.bannerId) : null;
|
||||
const banner = channel.bannerId ? await DriveFiles.findOneBy({ id: channel.bannerId }) : null;
|
||||
|
||||
const hasUnreadNote = meId ? (await NoteUnreads.findOne({ noteChannelId: channel.id, userId: meId })) != null : undefined;
|
||||
const hasUnreadNote = meId ? (await NoteUnreads.findOneBy({ noteChannelId: channel.id, userId: meId })) != null : undefined;
|
||||
|
||||
const following = meId ? await ChannelFollowings.findOne({
|
||||
const following = meId ? await ChannelFollowings.findOneBy({
|
||||
followerId: meId,
|
||||
followeeId: channel.id,
|
||||
}) : null;
|
||||
@ -38,5 +37,5 @@ export class ChannelRepository extends Repository<Channel> {
|
||||
hasUnreadNote,
|
||||
} : {}),
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,15 +1,14 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { Clip } from '@/models/entities/clip.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
import { Users } from '../index.js';
|
||||
import { awaitAll } from '@/prelude/await-all.js';
|
||||
|
||||
@EntityRepository(Clip)
|
||||
export class ClipRepository extends Repository<Clip> {
|
||||
public async pack(
|
||||
export const ClipRepository = db.getRepository(Clip).extend({
|
||||
async pack(
|
||||
src: Clip['id'] | Clip,
|
||||
): Promise<Packed<'Clip'>> {
|
||||
const clip = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const clip = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
return await awaitAll({
|
||||
id: clip.id,
|
||||
@ -20,12 +19,12 @@ export class ClipRepository extends Repository<Clip> {
|
||||
description: clip.description,
|
||||
isPublic: clip.isPublic,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
public packMany(
|
||||
packMany(
|
||||
clips: Clip[],
|
||||
) {
|
||||
return Promise.all(clips.map(x => this.pack(x)));
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { DriveFile } from '@/models/entities/drive-file.js';
|
||||
import { Users, DriveFolders } from '../index.js';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
import { toPuny } from '@/misc/convert-host.js';
|
||||
import { awaitAll, Promiseable } from '@/prelude/await-all.js';
|
||||
@ -9,6 +8,7 @@ import config from '@/config/index.js';
|
||||
import { query, appendQuery } from '@/prelude/url.js';
|
||||
import { Meta } from '@/models/entities/meta.js';
|
||||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import { Users, DriveFolders } from '../index.js';
|
||||
|
||||
type PackOptions = {
|
||||
detail?: boolean,
|
||||
@ -16,9 +16,8 @@ type PackOptions = {
|
||||
withUser?: boolean,
|
||||
};
|
||||
|
||||
@EntityRepository(DriveFile)
|
||||
export class DriveFileRepository extends Repository<DriveFile> {
|
||||
public validateFileName(name: string): boolean {
|
||||
export const DriveFileRepository = db.getRepository(DriveFile).extend({
|
||||
validateFileName(name: string): boolean {
|
||||
return (
|
||||
(name.trim().length > 0) &&
|
||||
(name.length <= 200) &&
|
||||
@ -26,11 +25,11 @@ export class DriveFileRepository extends Repository<DriveFile> {
|
||||
(name.indexOf('/') === -1) &&
|
||||
(name.indexOf('..') === -1)
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
public getPublicProperties(file: DriveFile): DriveFile['properties'] {
|
||||
getPublicProperties(file: DriveFile): DriveFile['properties'] {
|
||||
if (file.properties.orientation != null) {
|
||||
const properties = JSON.parse(JSON.stringify(file.properties));
|
||||
const properties = structuredClone(file.properties);
|
||||
if (file.properties.orientation >= 5) {
|
||||
[properties.width, properties.height] = [properties.height, properties.width];
|
||||
}
|
||||
@ -39,9 +38,9 @@ export class DriveFileRepository extends Repository<DriveFile> {
|
||||
}
|
||||
|
||||
return file.properties;
|
||||
}
|
||||
},
|
||||
|
||||
public getPublicUrl(file: DriveFile, thumbnail = false): string | null {
|
||||
getPublicUrl(file: DriveFile, thumbnail = false): string | null {
|
||||
// リモートかつメディアプロキシ
|
||||
if (file.uri != null && file.userHost != null && config.mediaProxy != null) {
|
||||
return appendQuery(config.mediaProxy, query({
|
||||
@ -62,9 +61,9 @@ export class DriveFileRepository extends Repository<DriveFile> {
|
||||
const isImage = file.type && ['image/png', 'image/apng', 'image/gif', 'image/jpeg', 'image/webp', 'image/svg+xml'].includes(file.type);
|
||||
|
||||
return thumbnail ? (file.thumbnailUrl || (isImage ? (file.webpublicUrl || file.url) : null)) : (file.webpublicUrl || file.url);
|
||||
}
|
||||
},
|
||||
|
||||
public async calcDriveUsageOf(user: User['id'] | { id: User['id'] }): Promise<number> {
|
||||
async calcDriveUsageOf(user: User['id'] | { id: User['id'] }): Promise<number> {
|
||||
const id = typeof user === 'object' ? user.id : user;
|
||||
|
||||
const { sum } = await this
|
||||
@ -75,9 +74,9 @@ export class DriveFileRepository extends Repository<DriveFile> {
|
||||
.getRawOne();
|
||||
|
||||
return parseInt(sum, 10) || 0;
|
||||
}
|
||||
},
|
||||
|
||||
public async calcDriveUsageOfHost(host: string): Promise<number> {
|
||||
async calcDriveUsageOfHost(host: string): Promise<number> {
|
||||
const { sum } = await this
|
||||
.createQueryBuilder('file')
|
||||
.where('file.userHost = :host', { host: toPuny(host) })
|
||||
@ -86,9 +85,9 @@ export class DriveFileRepository extends Repository<DriveFile> {
|
||||
.getRawOne();
|
||||
|
||||
return parseInt(sum, 10) || 0;
|
||||
}
|
||||
},
|
||||
|
||||
public async calcDriveUsageOfLocal(): Promise<number> {
|
||||
async calcDriveUsageOfLocal(): Promise<number> {
|
||||
const { sum } = await this
|
||||
.createQueryBuilder('file')
|
||||
.where('file.userHost IS NULL')
|
||||
@ -97,9 +96,9 @@ export class DriveFileRepository extends Repository<DriveFile> {
|
||||
.getRawOne();
|
||||
|
||||
return parseInt(sum, 10) || 0;
|
||||
}
|
||||
},
|
||||
|
||||
public async calcDriveUsageOfRemote(): Promise<number> {
|
||||
async calcDriveUsageOfRemote(): Promise<number> {
|
||||
const { sum } = await this
|
||||
.createQueryBuilder('file')
|
||||
.where('file.userHost IS NOT NULL')
|
||||
@ -108,23 +107,18 @@ export class DriveFileRepository extends Repository<DriveFile> {
|
||||
.getRawOne();
|
||||
|
||||
return parseInt(sum, 10) || 0;
|
||||
}
|
||||
},
|
||||
|
||||
public async pack(src: DriveFile['id'], options?: PackOptions): Promise<Packed<'DriveFile'> | null>;
|
||||
public async pack(src: DriveFile, options?: PackOptions): Promise<Packed<'DriveFile'>>;
|
||||
public async pack(
|
||||
async pack(
|
||||
src: DriveFile['id'] | DriveFile,
|
||||
options?: PackOptions
|
||||
): Promise<Packed<'DriveFile'> | null> {
|
||||
options?: PackOptions,
|
||||
): Promise<Packed<'DriveFile'>> {
|
||||
const opts = Object.assign({
|
||||
detail: false,
|
||||
self: false,
|
||||
}, options);
|
||||
|
||||
const file = typeof src === 'object' ? src : await this.findOne(src);
|
||||
if (file == null) return null;
|
||||
|
||||
const meta = await fetchMeta();
|
||||
const file = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
return await awaitAll<Packed<'DriveFile'>>({
|
||||
id: file.id,
|
||||
@ -146,13 +140,47 @@ export class DriveFileRepository extends Repository<DriveFile> {
|
||||
userId: opts.withUser ? file.userId : null,
|
||||
user: (opts.withUser && file.userId) ? Users.pack(file.userId) : null,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
public async packMany(
|
||||
async packNullable(
|
||||
src: DriveFile['id'] | DriveFile,
|
||||
options?: PackOptions,
|
||||
): Promise<Packed<'DriveFile'> | null> {
|
||||
const opts = Object.assign({
|
||||
detail: false,
|
||||
self: false,
|
||||
}, options);
|
||||
|
||||
const file = typeof src === 'object' ? src : await this.findOneBy({ id: src });
|
||||
if (file == null) return null;
|
||||
|
||||
return await awaitAll<Packed<'DriveFile'>>({
|
||||
id: file.id,
|
||||
createdAt: file.createdAt.toISOString(),
|
||||
name: file.name,
|
||||
type: file.type,
|
||||
md5: file.md5,
|
||||
size: file.size,
|
||||
isSensitive: file.isSensitive,
|
||||
blurhash: file.blurhash,
|
||||
properties: opts.self ? file.properties : this.getPublicProperties(file),
|
||||
url: opts.self ? file.url : this.getPublicUrl(file, false),
|
||||
thumbnailUrl: this.getPublicUrl(file, true),
|
||||
comment: file.comment,
|
||||
folderId: file.folderId,
|
||||
folder: opts.detail && file.folderId ? DriveFolders.pack(file.folderId, {
|
||||
detail: true,
|
||||
}) : null,
|
||||
userId: opts.withUser ? file.userId : null,
|
||||
user: (opts.withUser && file.userId) ? Users.pack(file.userId) : null,
|
||||
});
|
||||
},
|
||||
|
||||
async packMany(
|
||||
files: (DriveFile['id'] | DriveFile)[],
|
||||
options?: PackOptions
|
||||
) {
|
||||
const items = await Promise.all(files.map(f => this.pack(f, options)));
|
||||
return items.filter(x => x != null);
|
||||
}
|
||||
}
|
||||
options?: PackOptions,
|
||||
): Promise<Packed<'DriveFile'>[]> {
|
||||
const items = await Promise.all(files.map(f => this.packNullable(f, options)));
|
||||
return items.filter((x): x is Packed<'DriveFile'> => x != null);
|
||||
},
|
||||
});
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { DriveFolders, DriveFiles } from '../index.js';
|
||||
import { DriveFolder } from '@/models/entities/drive-folder.js';
|
||||
import { awaitAll } from '@/prelude/await-all.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
|
||||
@EntityRepository(DriveFolder)
|
||||
export class DriveFolderRepository extends Repository<DriveFolder> {
|
||||
public async pack(
|
||||
export const DriveFolderRepository = db.getRepository(DriveFolder).extend({
|
||||
async pack(
|
||||
src: DriveFolder['id'] | DriveFolder,
|
||||
options?: {
|
||||
detail: boolean
|
||||
@ -16,7 +15,7 @@ export class DriveFolderRepository extends Repository<DriveFolder> {
|
||||
detail: false,
|
||||
}, options);
|
||||
|
||||
const folder = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const folder = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
return await awaitAll({
|
||||
id: folder.id,
|
||||
@ -25,10 +24,10 @@ export class DriveFolderRepository extends Repository<DriveFolder> {
|
||||
parentId: folder.parentId,
|
||||
|
||||
...(opts.detail ? {
|
||||
foldersCount: DriveFolders.count({
|
||||
foldersCount: DriveFolders.countBy({
|
||||
parentId: folder.id,
|
||||
}),
|
||||
filesCount: DriveFiles.count({
|
||||
filesCount: DriveFiles.countBy({
|
||||
folderId: folder.id,
|
||||
}),
|
||||
|
||||
@ -39,5 +38,5 @@ export class DriveFolderRepository extends Repository<DriveFolder> {
|
||||
} : {}),
|
||||
} : {}),
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,13 +1,12 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { Emoji } from '@/models/entities/emoji.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
|
||||
@EntityRepository(Emoji)
|
||||
export class EmojiRepository extends Repository<Emoji> {
|
||||
public async pack(
|
||||
export const EmojiRepository = db.getRepository(Emoji).extend({
|
||||
async pack(
|
||||
src: Emoji['id'] | Emoji,
|
||||
): Promise<Packed<'Emoji'>> {
|
||||
const emoji = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const emoji = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
return {
|
||||
id: emoji.id,
|
||||
@ -18,11 +17,11 @@ export class EmojiRepository extends Repository<Emoji> {
|
||||
// || emoji.originalUrl してるのは後方互換性のため
|
||||
url: emoji.publicUrl || emoji.originalUrl,
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
public packMany(
|
||||
packMany(
|
||||
emojis: any[],
|
||||
) {
|
||||
return Promise.all(emojis.map(x => this.pack(x)));
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,20 +1,19 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { FollowRequest } from '@/models/entities/follow-request.js';
|
||||
import { Users } from '../index.js';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
|
||||
@EntityRepository(FollowRequest)
|
||||
export class FollowRequestRepository extends Repository<FollowRequest> {
|
||||
public async pack(
|
||||
export const FollowRequestRepository = db.getRepository(FollowRequest).extend({
|
||||
async pack(
|
||||
src: FollowRequest['id'] | FollowRequest,
|
||||
me?: { id: User['id'] } | null | undefined
|
||||
) {
|
||||
const request = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const request = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
return {
|
||||
id: request.id,
|
||||
follower: await Users.pack(request.followerId, me),
|
||||
followee: await Users.pack(request.followeeId, me),
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { Users } from '../index.js';
|
||||
import { Following } from '@/models/entities/following.js';
|
||||
import { awaitAll } from '@/prelude/await-all.js';
|
||||
@ -29,25 +29,24 @@ type RemoteFolloweeFollowing = Following & {
|
||||
followeeSharedInbox: string;
|
||||
};
|
||||
|
||||
@EntityRepository(Following)
|
||||
export class FollowingRepository extends Repository<Following> {
|
||||
public isLocalFollower(following: Following): following is LocalFollowerFollowing {
|
||||
export const FollowingRepository = db.getRepository(Following).extend({
|
||||
isLocalFollower(following: Following): following is LocalFollowerFollowing {
|
||||
return following.followerHost == null;
|
||||
}
|
||||
},
|
||||
|
||||
public isRemoteFollower(following: Following): following is RemoteFollowerFollowing {
|
||||
isRemoteFollower(following: Following): following is RemoteFollowerFollowing {
|
||||
return following.followerHost != null;
|
||||
}
|
||||
},
|
||||
|
||||
public isLocalFollowee(following: Following): following is LocalFolloweeFollowing {
|
||||
isLocalFollowee(following: Following): following is LocalFolloweeFollowing {
|
||||
return following.followeeHost == null;
|
||||
}
|
||||
},
|
||||
|
||||
public isRemoteFollowee(following: Following): following is RemoteFolloweeFollowing {
|
||||
isRemoteFollowee(following: Following): following is RemoteFolloweeFollowing {
|
||||
return following.followeeHost != null;
|
||||
}
|
||||
},
|
||||
|
||||
public async pack(
|
||||
async pack(
|
||||
src: Following['id'] | Following,
|
||||
me?: { id: User['id'] } | null | undefined,
|
||||
opts?: {
|
||||
@ -55,7 +54,7 @@ export class FollowingRepository extends Repository<Following> {
|
||||
populateFollower?: boolean;
|
||||
}
|
||||
): Promise<Packed<'Following'>> {
|
||||
const following = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const following = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
if (opts == null) opts = {};
|
||||
|
||||
@ -71,9 +70,9 @@ export class FollowingRepository extends Repository<Following> {
|
||||
detail: true,
|
||||
}) : undefined,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
public packMany(
|
||||
packMany(
|
||||
followings: any[],
|
||||
me?: { id: User['id'] } | null | undefined,
|
||||
opts?: {
|
||||
@ -82,5 +81,5 @@ export class FollowingRepository extends Repository<Following> {
|
||||
}
|
||||
) {
|
||||
return Promise.all(followings.map(x => this.pack(x, me, opts)));
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,25 +1,24 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { GalleryLike } from '@/models/entities/gallery-like.js';
|
||||
import { GalleryPosts } from '../index.js';
|
||||
|
||||
@EntityRepository(GalleryLike)
|
||||
export class GalleryLikeRepository extends Repository<GalleryLike> {
|
||||
public async pack(
|
||||
export const GalleryLikeRepository = db.getRepository(GalleryLike).extend({
|
||||
async pack(
|
||||
src: GalleryLike['id'] | GalleryLike,
|
||||
me?: any
|
||||
) {
|
||||
const like = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const like = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
return {
|
||||
id: like.id,
|
||||
post: await GalleryPosts.pack(like.post || like.postId, me),
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
public packMany(
|
||||
packMany(
|
||||
likes: any[],
|
||||
me: any
|
||||
) {
|
||||
return Promise.all(likes.map(x => this.pack(x, me)));
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,18 +1,17 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { GalleryPost } from '@/models/entities/gallery-post.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
import { Users, DriveFiles, GalleryLikes } from '../index.js';
|
||||
import { awaitAll } from '@/prelude/await-all.js';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
|
||||
@EntityRepository(GalleryPost)
|
||||
export class GalleryPostRepository extends Repository<GalleryPost> {
|
||||
public async pack(
|
||||
export const GalleryPostRepository = db.getRepository(GalleryPost).extend({
|
||||
async pack(
|
||||
src: GalleryPost['id'] | GalleryPost,
|
||||
me?: { id: User['id'] } | null | undefined,
|
||||
): Promise<Packed<'GalleryPost'>> {
|
||||
const meId = me ? me.id : null;
|
||||
const post = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const post = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
return await awaitAll({
|
||||
id: post.id,
|
||||
@ -27,14 +26,14 @@ export class GalleryPostRepository extends Repository<GalleryPost> {
|
||||
tags: post.tags.length > 0 ? post.tags : undefined,
|
||||
isSensitive: post.isSensitive,
|
||||
likedCount: post.likedCount,
|
||||
isLiked: meId ? await GalleryLikes.findOne({ postId: post.id, userId: meId }).then(x => x != null) : undefined,
|
||||
isLiked: meId ? await GalleryLikes.findOneBy({ postId: post.id, userId: meId }).then(x => x != null) : undefined,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
public packMany(
|
||||
packMany(
|
||||
posts: GalleryPost[],
|
||||
me?: { id: User['id'] } | null | undefined,
|
||||
) {
|
||||
return Promise.all(posts.map(x => this.pack(x, me)));
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,10 +1,9 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { Hashtag } from '@/models/entities/hashtag.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
|
||||
@EntityRepository(Hashtag)
|
||||
export class HashtagRepository extends Repository<Hashtag> {
|
||||
public async pack(
|
||||
export const HashtagRepository = db.getRepository(Hashtag).extend({
|
||||
async pack(
|
||||
src: Hashtag,
|
||||
): Promise<Packed<'Hashtag'>> {
|
||||
return {
|
||||
@ -16,11 +15,11 @@ export class HashtagRepository extends Repository<Hashtag> {
|
||||
attachedLocalUsersCount: src.attachedLocalUsersCount,
|
||||
attachedRemoteUsersCount: src.attachedRemoteUsersCount,
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
public packMany(
|
||||
packMany(
|
||||
hashtags: Hashtag[],
|
||||
) {
|
||||
return Promise.all(hashtags.map(x => this.pack(x)));
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,10 +1,9 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { Instance } from '@/models/entities/instance.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
|
||||
@EntityRepository(Instance)
|
||||
export class InstanceRepository extends Repository<Instance> {
|
||||
public async pack(
|
||||
export const InstanceRepository = db.getRepository(Instance).extend({
|
||||
async pack(
|
||||
instance: Instance,
|
||||
): Promise<Packed<'FederationInstance'>> {
|
||||
return {
|
||||
@ -29,11 +28,11 @@ export class InstanceRepository extends Repository<Instance> {
|
||||
iconUrl: instance.iconUrl,
|
||||
infoUpdatedAt: instance.infoUpdatedAt ? instance.infoUpdatedAt.toISOString() : null,
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
public packMany(
|
||||
packMany(
|
||||
instances: Instance[],
|
||||
) {
|
||||
return Promise.all(instances.map(x => this.pack(x)));
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { MessagingMessage } from '@/models/entities/messaging-message.js';
|
||||
import { Users, DriveFiles, UserGroups } from '../index.js';
|
||||
import { Packed } from '@/misc/schema.js';
|
||||
import { User } from '@/models/entities/user.js';
|
||||
|
||||
@EntityRepository(MessagingMessage)
|
||||
export class MessagingMessageRepository extends Repository<MessagingMessage> {
|
||||
public async pack(
|
||||
export const MessagingMessageRepository = db.getRepository(MessagingMessage).extend({
|
||||
async pack(
|
||||
src: MessagingMessage['id'] | MessagingMessage,
|
||||
me?: { id: User['id'] } | null | undefined,
|
||||
options?: {
|
||||
@ -19,7 +18,7 @@ export class MessagingMessageRepository extends Repository<MessagingMessage> {
|
||||
populateGroup: true,
|
||||
};
|
||||
|
||||
const message = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const message = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
return {
|
||||
id: message.id,
|
||||
@ -36,5 +35,5 @@ export class MessagingMessageRepository extends Repository<MessagingMessage> {
|
||||
isRead: message.isRead,
|
||||
reads: message.reads,
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1,14 +1,13 @@
|
||||
import { EntityRepository, Repository } from 'typeorm';
|
||||
import { db } from '@/db/postgre.js';
|
||||
import { Users } from '../index.js';
|
||||
import { ModerationLog } from '@/models/entities/moderation-log.js';
|
||||
import { awaitAll } from '@/prelude/await-all.js';
|
||||
|
||||
@EntityRepository(ModerationLog)
|
||||
export class ModerationLogRepository extends Repository<ModerationLog> {
|
||||
public async pack(
|
||||
export const ModerationLogRepository = db.getRepository(ModerationLog).extend({
|
||||
async pack(
|
||||
src: ModerationLog['id'] | ModerationLog,
|
||||
) {
|
||||
const log = typeof src === 'object' ? src : await this.findOneOrFail(src);
|
||||
const log = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src });
|
||||
|
||||
return await awaitAll({
|
||||
id: log.id,
|
||||
@ -20,11 +19,11 @@ export class ModerationLogRepository extends Repository<ModerationLog> {
|
||||
detail: true,
|
||||
}),
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
public packMany(
|
||||
packMany(
|
||||
reports: any[],
|
||||
) {
|
||||
return Promise.all(reports.map(x => this.pack(x)));
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user