Compare commits
64 Commits
2024.2.0-b
...
2024.2.0-b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
eef46ed3c9 | ||
![]() |
e90dea4be9 | ||
![]() |
6a41afaaee | ||
![]() |
a6a91fec3a | ||
![]() |
9ac2c36d76 | ||
![]() |
e21cecefa1 | ||
![]() |
4535f9b41b | ||
![]() |
b62d9f3920 | ||
![]() |
fe7036a1a8 | ||
![]() |
cdac3988b5 | ||
![]() |
9753cce4aa | ||
![]() |
30f4023c36 | ||
![]() |
15727088be | ||
![]() |
b7270c6238 | ||
![]() |
bb330533c1 | ||
![]() |
5342692b1e | ||
![]() |
ef8eaf8e89 | ||
![]() |
4553d6426b | ||
![]() |
b33cfc2876 | ||
![]() |
4de14fb5cf | ||
![]() |
60156a40b2 | ||
![]() |
5719a929ad | ||
![]() |
2b6bf074c6 | ||
![]() |
37d87854c2 | ||
![]() |
d27b3525cd | ||
![]() |
7beb4ed131 | ||
![]() |
177c35e321 | ||
![]() |
ca9be872a8 | ||
![]() |
a97d4fa4ef | ||
![]() |
908e0f3b8b | ||
![]() |
b68446b289 | ||
![]() |
608e7c1546 | ||
![]() |
a3ba315dc6 | ||
![]() |
df5f14ca7a | ||
![]() |
d060bb44e1 | ||
![]() |
645f5e8633 | ||
![]() |
547be1973d | ||
![]() |
65557d5f27 | ||
![]() |
cc420c245f | ||
![]() |
443d1b2f5c | ||
![]() |
1f8d275094 | ||
![]() |
2efcb27043 | ||
![]() |
298bc34eaf | ||
![]() |
62f6f6af02 | ||
![]() |
e8ba0b3f54 | ||
![]() |
f48f7149f8 | ||
![]() |
d2ccce6366 | ||
![]() |
af2d81a990 | ||
![]() |
58ac8bc8e9 | ||
![]() |
2ee5507d06 | ||
![]() |
31a39776f5 | ||
![]() |
5e307e472d | ||
![]() |
e0ad066382 | ||
![]() |
99fe03bd4d | ||
![]() |
850d38414e | ||
![]() |
d380ed36de | ||
![]() |
5c8888d6a8 | ||
![]() |
4af3640bd3 | ||
![]() |
94e282b612 | ||
![]() |
259992c65f | ||
![]() |
67f6157d42 | ||
![]() |
0cfeb42786 | ||
![]() |
a431dde537 | ||
![]() |
4f95b8d9d2 |
@@ -160,14 +160,14 @@ id: 'aidx'
|
||||
# Job concurrency per worker
|
||||
#deliverJobConcurrency: 128
|
||||
#inboxJobConcurrency: 16
|
||||
#relashionshipJobConcurrency: 16
|
||||
# What's relashionshipJob?:
|
||||
#relationshipJobConcurrency: 16
|
||||
# What's relationshipJob?:
|
||||
# Follow, unfollow, block and unblock(ings) while following-imports, etc. or account migrations.
|
||||
|
||||
# Job rate limiter
|
||||
#deliverJobPerSec: 128
|
||||
#inboxJobPerSec: 32
|
||||
#relashionshipJobPerSec: 64
|
||||
#relationshipJobPerSec: 64
|
||||
|
||||
# Job attempts
|
||||
#deliverJobMaxAttempts: 12
|
||||
|
29
.github/workflows/check-misskey-js-autogen.yml
vendored
29
.github/workflows/check-misskey-js-autogen.yml
vendored
@@ -1,7 +1,7 @@
|
||||
name: Check Misskey JS autogen
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
pull_request_target:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
@@ -15,13 +15,14 @@ jobs:
|
||||
pull-requests: write
|
||||
|
||||
env:
|
||||
api_json_names: "api-base.json api-head.json"
|
||||
api_json_name: "api-head.json"
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
@@ -87,22 +88,27 @@ jobs:
|
||||
find . -mindepth 1 -maxdepth 1 -type f -name '*.zip' -exec unzip {} -d . ';'
|
||||
ls -la
|
||||
|
||||
- name: get head checksum
|
||||
run: |-
|
||||
checksum=$(realpath head_checksum)
|
||||
|
||||
cd packages/misskey-js/src
|
||||
find autogen -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
|
||||
cd ../../..
|
||||
|
||||
- name: build autogen
|
||||
run: |-
|
||||
for name in $(echo $api_json_names)
|
||||
do
|
||||
checksum=$(mktemp)
|
||||
mv $name packages/misskey-js/generator/api.json
|
||||
checksum=$(realpath ${api_json_name}_checksum)
|
||||
mv $api_json_name packages/misskey-js/generator/api.json
|
||||
|
||||
cd packages/misskey-js/generator
|
||||
pnpm run generate
|
||||
find built -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
|
||||
cd ../../..
|
||||
cp $checksum ${name}_checksum
|
||||
done
|
||||
cd built
|
||||
find autogen -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
|
||||
cd ../../../..
|
||||
|
||||
- name: check update for type definitions
|
||||
run: diff $(echo -n ${api_json_names} | awk -v RS=" " '{ printf "%s_checksum ", $0 }')
|
||||
run: diff head_checksum ${api_json_name}_checksum
|
||||
|
||||
- name: send message
|
||||
if: failure()
|
||||
@@ -125,3 +131,4 @@ jobs:
|
||||
comment_tag: check-misskey-js-autogen
|
||||
mode: delete
|
||||
message: "Thank you!"
|
||||
create_if_not_exists: false
|
||||
|
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@@ -92,4 +92,6 @@ jobs:
|
||||
- run: pnpm i --frozen-lockfile
|
||||
- run: pnpm --filter misskey-js run build
|
||||
if: ${{ matrix.workspace == 'backend' }}
|
||||
- run: pnpm --filter misskey-reversi run build:tsc
|
||||
if: ${{ matrix.workspace == 'backend' }}
|
||||
- run: pnpm --filter ${{ matrix.workspace }} run typecheck
|
||||
|
45
.github/workflows/on-release-created.yml
vendored
Normal file
45
.github/workflows/on-release-created.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: On Release Created (Publish misskey-js)
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish-misskey-js:
|
||||
name: Publish misskey-js
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20.10.0]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
run_install: false
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'pnpm'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- name: Publish package
|
||||
run: |
|
||||
corepack enable
|
||||
pnpm i --frozen-lockfile
|
||||
pnpm build
|
||||
pnpm --filter misskey-js publish --access public --no-git-checks --provenance
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
|
14
.github/workflows/test-misskey-js.yml
vendored
14
.github/workflows/test-misskey-js.yml
vendored
@@ -54,3 +54,17 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: ./packages/misskey-js/coverage/coverage-final.json
|
||||
|
||||
check-version:
|
||||
# ルートの package.json と packages/misskey-js/package.json のバージョンが一致しているかを確認する
|
||||
name: Check version
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
- name: Check version
|
||||
run: |
|
||||
if [ "$(jq -r '.version' package.json)" != "$(jq -r '.version' packages/misskey-js/package.json)" ]; then
|
||||
echo "Version mismatch!"
|
||||
exit 1
|
||||
fi
|
||||
|
@@ -45,11 +45,19 @@
|
||||
- Enhance: ノート作成画面のファイル添付メニューから直接ファイルを削除できるように
|
||||
- Enhance: MFMの属性でオートコンプリートが使用できるように #12735
|
||||
- Enhance: 絵文字編集ダイアログをモーダルではなくウィンドウで表示するように
|
||||
- Enhance: リモートのユーザーはメニューから直接リモートで表示できるように
|
||||
- Fix: ネイティブモードの絵文字がモノクロにならないように
|
||||
- Fix: v2023.12.0で追加された「モデレーターがユーザーのアイコンもしくはバナー画像を未設定状態にできる機能」が管理画面上で正しく表示されていない問題を修正
|
||||
- Fix: AiScriptの`readline`関数が不正な値を返すことがある問題のv2023.12.0時点での修正がPlay以外に適用されていないのを修正
|
||||
- Fix: v2023.12.1で追加された`$[clickable ...]`および`onClickEv`が正しく機能していないのを修正
|
||||
- Fix: Renoteのキーボードショートカットが機能していなかった問題を修正
|
||||
- Fix: 投稿フォームでアンケートの日時指定をした状態で再読み込みをすると期日が復元されない問題を修正
|
||||
- Fix: アンケートを設定したノートを「削除して編集」をするとアンケートの期日が引き継がれず、リセットされてしまう問題を修正
|
||||
- Fix: デッキのプロファイル作成時に名前を空にできる問題を修正
|
||||
- Fix: テーマ作成時に名称が空欄でも作成できてしまう問題を修正
|
||||
- Fix: プラグインで`Plugin:register_note_post_interruptor`を使用すると、ノートが投稿できなくなる問題を修正
|
||||
- Enhance: ページ遷移時にPlayerを閉じるように
|
||||
- Fix: iOSで大きな画像を変換してアップロードできない問題を修正
|
||||
|
||||
### Server
|
||||
- Enhance: 連合先のレートリミットに引っかかった際にリトライするようになりました
|
||||
@@ -62,6 +70,7 @@
|
||||
- Fix: `notes/create`で、`text`が空白文字のみで構成されていてかつリノート、ファイルまたは投票を含んでいるリクエストに対するレスポンスの`text`が`""`から`null`になるように変更
|
||||
- Fix: ipv4とipv6の両方が利用可能な環境でallowedPrivateNetworksが設定されていた場合プライベートipの検証ができていなかった問題を修正
|
||||
- Fix: properly handle cc followers
|
||||
- Fix: ジョブに関する設定の名前を修正 relashionshipJobPerSec -> relationshipJobPerSec
|
||||
|
||||
### Service Worker
|
||||
- Enhance: オフライン表示のデザインを改善・多言語対応
|
||||
|
@@ -161,11 +161,13 @@ describe('After user signed in', () => {
|
||||
});
|
||||
|
||||
it('successfully loads', () => {
|
||||
cy.get('[data-cy-user-setup-continue]').should('be.visible');
|
||||
// 表示に時間がかかるのでデフォルト秒数だとタイムアウトする
|
||||
cy.get('[data-cy-user-setup-continue]', { timeout: 12000 }).should('be.visible');
|
||||
});
|
||||
|
||||
it('account setup wizard', () => {
|
||||
cy.get('[data-cy-user-setup-continue]').click();
|
||||
// 表示に時間がかかるのでデフォルト秒数だとタイムアウトする
|
||||
cy.get('[data-cy-user-setup-continue]', { timeout: 12000 }).click();
|
||||
|
||||
cy.get('[data-cy-user-setup-user-name] input').type('ありす');
|
||||
cy.get('[data-cy-user-setup-user-description] textarea').type('ほげ');
|
||||
@@ -202,7 +204,8 @@ describe('After user setup', () => {
|
||||
cy.login('alice', 'alice1234');
|
||||
|
||||
// アカウント初期設定ウィザード
|
||||
cy.get('[data-cy-user-setup] [data-cy-modal-window-close]').click();
|
||||
// 表示に時間がかかるのでデフォルト秒数だとタイムアウトする
|
||||
cy.get('[data-cy-user-setup] [data-cy-modal-window-close]', { timeout: 12000 }).click();
|
||||
cy.get('[data-cy-modal-dialog-ok]').click();
|
||||
});
|
||||
|
||||
|
30
cypress/e2e/router.cy.js
Normal file
30
cypress/e2e/router.cy.js
Normal file
@@ -0,0 +1,30 @@
|
||||
describe('Router transition', () => {
|
||||
describe('Redirect', () => {
|
||||
// サーバの初期化。ルートのテストに関しては各describeごとに1度だけ実行で十分だと思う(使いまわした方が早い)
|
||||
before(() => {
|
||||
cy.resetState();
|
||||
|
||||
// インスタンス初期セットアップ
|
||||
cy.registerUser('admin', 'pass', true);
|
||||
|
||||
// ユーザー作成
|
||||
cy.registerUser('alice', 'alice1234');
|
||||
|
||||
cy.login('alice', 'alice1234');
|
||||
|
||||
// アカウント初期設定ウィザード
|
||||
// 表示に時間がかかるのでデフォルト秒数だとタイムアウトする
|
||||
cy.get('[data-cy-user-setup] [data-cy-modal-window-close]', { timeout: 12000 }).click();
|
||||
cy.wait(500);
|
||||
cy.get('[data-cy-modal-dialog-ok]').click();
|
||||
});
|
||||
|
||||
it('redirect to user profile', () => {
|
||||
// テストのためだけに用意されたリダイレクト用ルートに飛ぶ
|
||||
cy.visit('/redirect-test');
|
||||
|
||||
// プロフィールページのURLであることを確認する
|
||||
cy.url().should('include', '/@alice')
|
||||
});
|
||||
});
|
||||
});
|
@@ -1567,3 +1567,4 @@ _moderationLogTypes:
|
||||
createInvitation: "ولِّد دعوة"
|
||||
_reversi:
|
||||
total: "المجموع"
|
||||
|
||||
|
@@ -1346,3 +1346,4 @@ _moderationLogTypes:
|
||||
resetPassword: "পাসওয়ার্ড রিসেট করুন"
|
||||
_reversi:
|
||||
total: "মোট"
|
||||
|
||||
|
@@ -1276,3 +1276,4 @@ _moderationLogTypes:
|
||||
resetPassword: "Restableix la contrasenya"
|
||||
_reversi:
|
||||
total: "Total"
|
||||
|
||||
|
@@ -2022,3 +2022,4 @@ _moderationLogTypes:
|
||||
createInvitation: "Vygenerovat pozvánku"
|
||||
_reversi:
|
||||
total: "Celkem"
|
||||
|
||||
|
@@ -1,2 +1,3 @@
|
||||
---
|
||||
_lang_: "Dansk"
|
||||
|
||||
|
@@ -181,7 +181,7 @@ searchWith: "Suchen: {q}"
|
||||
youHaveNoLists: "Du hast keine Listen"
|
||||
followConfirm: "Möchtest du {name} wirklich folgen?"
|
||||
proxyAccount: "Proxy-Benutzerkonto"
|
||||
proxyAccountDescription: "Ein Proxy-Benutzerkonto ist ein Benutzerkonto, das sich für Nutzer unter bestimmten Konditionen wie ein Follower aus einer fremden Instanz verhält. Zum Beispiel wird die Aktivität eines Nutzers aus einer fremden Instanz nicht an diese Instanz übermittelt, falls es keinen Benutzer dieser Instanz gibt, der diesem Nutzer aus fremder Instanz folgt. In diesem Fall folgt stattdessen das Proxy-Benutzerkonto."
|
||||
proxyAccountDescription: "Ein Proxy-Konto ist ein Benutzerkonto, das unter bestimmten Bedingungen als Follower für Benutzer fremder Instanzen fungiert. Wenn zum Beispiel ein Benutzer einen Benutzer einer fremden Instanz zu einer Liste hinzufügt, werden die Aktivitäten des entfernten Benutzers nicht an die Instanz übermittelt, wenn kein lokaler Benutzer diesem Benutzer folgt; stattdessen folgt das Proxy-Konto."
|
||||
host: "Hostname"
|
||||
selectUser: "Benutzer auswählen"
|
||||
recipient: "Empfänger"
|
||||
@@ -1181,6 +1181,7 @@ _announcement:
|
||||
tooManyActiveAnnouncementDescription: "Zu viele aktive Ankündigungen können die Benutzerfreundlichkeit verschlechtern. Es wird empfohlen, veraltete Ankündigungen zu archivieren."
|
||||
readConfirmTitle: "Als gelesen markieren?"
|
||||
readConfirmText: "Dies markiert den Inhalt von \"{title}\" als gelesen."
|
||||
shouldNotBeUsedToPresentPermanentInfo: "Es wird empfohlen, Ankündigungen für aktuelle und zeitlich begrenzte Neuigkeiten zu nutzen, statt für Informationen, die langfristig relevant sind."
|
||||
dialogAnnouncementUxWarn: "Bei der Verwendung von mehr als zwei Meldungen im Dialog-Format wird um Vorsicht geboten, da dies negative Auswirkungen auf die UX haben kann."
|
||||
silence: "Keine Benachrichtigung"
|
||||
silenceDescription: "Wenn aktiviert, gibt diese Meldung keine Nachricht aus und muss nicht als \"gelesen\" markiert werden."
|
||||
@@ -1222,6 +1223,7 @@ _serverSettings:
|
||||
shortName: "Abkürzung"
|
||||
shortNameDescription: "Ein Kürzel für den Namen der Instanz, der angezeigt werden kann, falls der volle Instanzname lang ist."
|
||||
fanoutTimelineDescription: "Ist diese Option aktiviert, kann eine erhebliche Verbesserung im Abrufen von Chroniken und eine Reduzierung der Datenbankbelastung erzielt werden, im Gegenzug zu einer Steigerung in der Speichernutzung von Redis. Bei geringem Serverspeicher oder Serverinstabilität kann diese Option deaktiviert werden."
|
||||
fanoutTimelineDbFallback: "Auf die Datenbank zurückfallen"
|
||||
_accountMigration:
|
||||
moveFrom: "Von einem anderen Konto zu diesem migrieren"
|
||||
moveFromSub: "Alias für ein anderes Konto erstellen"
|
||||
@@ -1489,7 +1491,9 @@ _role:
|
||||
assignTarget: "Zuweisungsart"
|
||||
descriptionOfAssignTarget: "<b>Manuell</b> bedeutet, dass die Liste der Benutzer einer Rolle manuell verwaltet wird.\n<b>Konditional</b> bedeutet, dass die Liste der Benutzer einer Rolle durch eine Bedingung automatisch verwaltet wird."
|
||||
manual: "Manuell"
|
||||
manualRoles: "Manuelle Rollen"
|
||||
conditional: "Konditional"
|
||||
conditionalRoles: "Bedingte Rolle"
|
||||
condition: "Bedingung"
|
||||
isConditionalRole: "Dies ist eine konditionale Rolle."
|
||||
isPublic: "Öffentliche Rolle"
|
||||
@@ -1538,6 +1542,7 @@ _role:
|
||||
canHideAds: "Kann Werbung ausblenden"
|
||||
canSearchNotes: "Nutzung der Notizsuchfunktion"
|
||||
canUseTranslator: "Verwendung des Übersetzers"
|
||||
avatarDecorationLimit: "Maximale Anzahl an Profilbilddekorationen, die angebracht werden können"
|
||||
_condition:
|
||||
isLocal: "Lokaler Benutzer"
|
||||
isRemote: "Benutzer fremder Instanz"
|
||||
@@ -1566,6 +1571,7 @@ _emailUnavailable:
|
||||
disposable: "Wegwerf-Email-Adressen können nicht verwendet werden"
|
||||
mx: "Dieser Email-Server ist ungültig"
|
||||
smtp: "Dieser Email-Server antwortet nicht"
|
||||
banned: "Du kannst dich mit dieser E-Mail-Adresse nicht registrieren"
|
||||
_ffVisibility:
|
||||
public: "Öffentlich"
|
||||
followers: "Nur für Follower sichtbar"
|
||||
@@ -1894,6 +1900,7 @@ _widgets:
|
||||
_userList:
|
||||
chooseList: "Liste auswählen"
|
||||
clicker: "Klickzähler"
|
||||
birthdayFollowings: "Nutzer, die heute Geburtstag haben"
|
||||
_cw:
|
||||
hide: "Inhalt verbergen"
|
||||
show: "Inhalt anzeigen"
|
||||
@@ -2244,3 +2251,4 @@ _externalResourceInstaller:
|
||||
description: "Während der Installation des Farbschemas ist ein Problem aufgetreten. Bitte versuche es erneut. Detaillierte Fehlerinformationen können über die Javascript-Konsole abgerufen werden."
|
||||
_reversi:
|
||||
total: "Gesamt"
|
||||
|
||||
|
@@ -398,3 +398,4 @@ _moderationLogTypes:
|
||||
suspend: "Αποβολή"
|
||||
_reversi:
|
||||
total: "Σύνολο"
|
||||
|
||||
|
@@ -122,7 +122,11 @@ add: "Add"
|
||||
reaction: "Reactions"
|
||||
reactions: "Reactions"
|
||||
emojiPicker: "Emoji picker"
|
||||
pinnedEmojisForReactionSettingDescription: "Set the emojis which should be pinned and displayed immediately when reacting."
|
||||
pinnedEmojisSettingDescription: "Set the emojis to be pinned and displayed when viewing emoji picker"
|
||||
emojiPickerDisplay: "Emoji picker display"
|
||||
overwriteFromPinnedEmojisForReaction: "Override from reaction settings"
|
||||
overwriteFromPinnedEmojis: "Override from general settings"
|
||||
reactionSettingDescription2: "Drag to reorder, click to delete, press \"+\" to add."
|
||||
rememberNoteVisibility: "Remember note visibility settings"
|
||||
attachCancel: "Remove attachment"
|
||||
@@ -376,8 +380,11 @@ hcaptcha: "hCaptcha"
|
||||
enableHcaptcha: "Enable hCaptcha"
|
||||
hcaptchaSiteKey: "Site key"
|
||||
hcaptchaSecretKey: "Secret key"
|
||||
mcaptcha: "mCaptcha"
|
||||
enableMcaptcha: "Enable mCaptcha"
|
||||
mcaptchaSiteKey: "Site key"
|
||||
mcaptchaSecretKey: "Secret key"
|
||||
mcaptchaInstanceUrl: "mCaptcha instance URL"
|
||||
recaptcha: "reCAPTCHA"
|
||||
enableRecaptcha: "Enable reCAPTCHA"
|
||||
recaptchaSiteKey: "Site key"
|
||||
@@ -625,6 +632,7 @@ medium: "Medium"
|
||||
small: "Small"
|
||||
generateAccessToken: "Generate access token"
|
||||
permission: "Permissions"
|
||||
adminPermission: "Admin Permissions"
|
||||
enableAll: "Enable all"
|
||||
disableAll: "Disable all"
|
||||
tokenRequested: "Grant access to account"
|
||||
@@ -668,6 +676,7 @@ useGlobalSettingDesc: "If turned on, your account's notification settings will b
|
||||
other: "Other"
|
||||
regenerateLoginToken: "Regenerate login token"
|
||||
regenerateLoginTokenDescription: "Regenerates the token used internally during login. Normally this action is not necessary. If regenerated, all devices will be logged out."
|
||||
theKeywordWhenSearchingForCustomEmoji: "This is the keyword when searching for custom emojis."
|
||||
setMultipleBySeparatingWithSpace: "Separate multiple entries with spaces."
|
||||
fileIdOrUrl: "File ID or URL"
|
||||
behavior: "Behavior"
|
||||
@@ -1050,6 +1059,8 @@ limitWidthOfReaction: "Limits the maximum width of reactions and display them in
|
||||
noteIdOrUrl: "Note ID or URL"
|
||||
video: "Video"
|
||||
videos: "Videos"
|
||||
audio: "Audio"
|
||||
audioFiles: "Audio"
|
||||
dataSaver: "Data Saver"
|
||||
accountMigration: "Account Migration"
|
||||
accountMoved: "This user has moved to a new account:"
|
||||
@@ -1162,6 +1173,7 @@ tosAndPrivacyPolicy: "Terms of Service and Privacy Policy"
|
||||
avatarDecorations: "Avatar decorations"
|
||||
attach: "Attach"
|
||||
detach: "Remove"
|
||||
detachAll: "Remove All"
|
||||
angle: "Angle"
|
||||
flip: "Flip"
|
||||
showAvatarDecorations: "Show avatar decorations"
|
||||
@@ -1175,11 +1187,31 @@ cwNotationRequired: "If \"Hide content\" is enabled, a description must be provi
|
||||
doReaction: "Add reaction"
|
||||
code: "Code"
|
||||
reloadRequiredToApplySettings: "Reloading is required to apply the settings."
|
||||
remainingN: "Remaining: {n}"
|
||||
overwriteContentConfirm: "Are you sure you want to overwrite the current content?"
|
||||
seasonalScreenEffect: "Seasonal Screen Effect"
|
||||
decorate: "Decorate"
|
||||
addMfmFunction: "Add MFM"
|
||||
enableQuickAddMfmFunction: "Show advanced MFM picker"
|
||||
bubbleGame: "Bubble Game"
|
||||
sfx: "Sound Effects"
|
||||
soundWillBePlayed: "Sound will be played"
|
||||
showReplay: "View Replay"
|
||||
replay: "Replay"
|
||||
replaying: "Showing replay"
|
||||
ranking: "Ranking"
|
||||
lastNDays: "Last {n} days"
|
||||
backToTitle: "Go back to title"
|
||||
hemisphere: "Where are you located"
|
||||
withSensitive: "Include notes with sensitive files"
|
||||
userSaysSomethingSensitive: "Post by {name} contains sensitive content"
|
||||
enableHorizontalSwipe: "Swipe to switch tabs"
|
||||
_bubbleGame:
|
||||
howToPlay: "How to play"
|
||||
_howToPlay:
|
||||
section1: "Adjust the position and drop the object into the box."
|
||||
section2: "When two objects of the same type touch each other, they will change into a different object and you score points."
|
||||
section3: "The game is over when objects overflow from the box. Aim for a high score by fusing objects together while you avoid overflowing the box!"
|
||||
_announcement:
|
||||
forExistingUsers: "Existing users only"
|
||||
forExistingUsersDescription: "This announcement will only be shown to users existing at the point of publishment if enabled. If disabled, those newly signing up after it has been posted will also see it."
|
||||
@@ -1189,7 +1221,7 @@ _announcement:
|
||||
tooManyActiveAnnouncementDescription: "Having too many active announcements may worsen the user experience. Please consider archiving announcements that have become obsolete."
|
||||
readConfirmTitle: "Mark as read?"
|
||||
readConfirmText: "This will mark the contents of \"{title}\" as read."
|
||||
shouldNotBeUsedToPresentPermanentInfo: "As it may significantly impact the user experience for new users, it is recommended to use notifications in the flow information rather than stock information."
|
||||
shouldNotBeUsedToPresentPermanentInfo: "It's best to use announcements to publish fresh and time-bound information, not for information that will be relevant in the long term."
|
||||
dialogAnnouncementUxWarn: "Having two or more dialog-style notifications simultaneously can significantly impact the user experience, so please use them carefully."
|
||||
silence: "No notification"
|
||||
silenceDescription: "Turning this on will skip the notification of this announcement and the user won't need to read it."
|
||||
@@ -1552,8 +1584,11 @@ _achievements:
|
||||
description: "Tutorial completed"
|
||||
_bubbleGameExplodingHead:
|
||||
title: "🤯"
|
||||
description: "The biggest object in the bubble game"
|
||||
_bubbleGameDoubleExplodingHead:
|
||||
title: "Double🤯"
|
||||
description: "Two of the biggest objects in the bubble game at the same time"
|
||||
flavor: "You can fill a lunch box like this 🤯 🤯 a bit."
|
||||
_role:
|
||||
new: "New role"
|
||||
edit: "Edit role"
|
||||
@@ -1615,6 +1650,7 @@ _role:
|
||||
canHideAds: "Can hide ads"
|
||||
canSearchNotes: "Usage of note search"
|
||||
canUseTranslator: "Translator usage"
|
||||
avatarDecorationLimit: "Maximum number of avatar decorations that can be applied"
|
||||
_condition:
|
||||
isLocal: "Local user"
|
||||
isRemote: "Remote user"
|
||||
@@ -1643,6 +1679,7 @@ _emailUnavailable:
|
||||
disposable: "Disposable email addresses may not be used"
|
||||
mx: "This email server is invalid"
|
||||
smtp: "This email server is not responding"
|
||||
banned: "You cannot register with this email address"
|
||||
_ffVisibility:
|
||||
public: "Public"
|
||||
followers: "Visible to followers only"
|
||||
@@ -2051,6 +2088,7 @@ _profile:
|
||||
changeAvatar: "Change avatar"
|
||||
changeBanner: "Change banner"
|
||||
verifiedLinkDescription: "By entering an URL that contains a link to your profile here, an ownership verification icon can be displayed next to the field."
|
||||
avatarDecorationMax: "You can add up to {max} decorations."
|
||||
_exportOrImport:
|
||||
allNotes: "All notes"
|
||||
favoritedNotes: "Favorite notes"
|
||||
@@ -2344,13 +2382,63 @@ _externalResourceInstaller:
|
||||
_dataSaver:
|
||||
_media:
|
||||
title: "Loading Media"
|
||||
description: "Prevents images/videos from being loaded automatically. Hidden images/videos will be loaded when tapped."
|
||||
_avatar:
|
||||
title: "Avatar image"
|
||||
description: "Stop avatar image animation. Animated images can be larger in file size than normal images, potentially leading to further reductions in data traffic."
|
||||
_urlPreview:
|
||||
title: "URL preview thumbnails"
|
||||
description: "URL preview thumbnail images will no longer be loaded."
|
||||
_code:
|
||||
title: "Code highlighting"
|
||||
description: "If code highlighting notations are used in MFM, etc., they will not load until tapped. Syntax highlighting requires downloading the highlight definition files for each programming language. Therefore, disabling the automatic loading of these files is expected to reduce the amount of communication data."
|
||||
_hemisphere:
|
||||
N: "Northern Hemisphere"
|
||||
S: "Southern Hemisphere"
|
||||
caption: "Used in some client settings to determine season."
|
||||
_reversi:
|
||||
reversi: "Reversi"
|
||||
gameSettings: "Game settings"
|
||||
chooseBoard: "Choose a board"
|
||||
blackOrWhite: "Black/White"
|
||||
blackIs: "{name} is playing Black"
|
||||
rules: "Rules"
|
||||
thisGameIsStartedSoon: "The game will begin shortly"
|
||||
waitingForOther: "Waiting for opponent's turn"
|
||||
waitingForMe: "Waiting for your turn"
|
||||
waitingBoth: "Get ready"
|
||||
ready: "Ready"
|
||||
cancelReady: "Not ready"
|
||||
opponentTurn: "Opponent's turn"
|
||||
myTurn: "Your turn"
|
||||
turnOf: "It's {name}'s turn"
|
||||
pastTurnOf: "{name}'s turn"
|
||||
surrender: "Surrender"
|
||||
surrendered: "Surrendered"
|
||||
timeout: "Out of time"
|
||||
drawn: "Draw"
|
||||
won: "{name} wins"
|
||||
black: "Black"
|
||||
white: "White"
|
||||
total: "Total"
|
||||
turnCount: "Turn {count}"
|
||||
myGames: "My rounds"
|
||||
allGames: "All rounds"
|
||||
ended: "Ended"
|
||||
playing: "Currently playing"
|
||||
isLlotheo: "The one with fewer stones wins (Llotheo)"
|
||||
loopedMap: "Looping map"
|
||||
canPutEverywhere: "Tiles are placeable everywhere"
|
||||
timeLimitForEachTurn: "Time limit for turn"
|
||||
freeMatch: "Free Match"
|
||||
lookingForPlayer: "Finding opponent..."
|
||||
gameCanceled: "The game has been cancelled."
|
||||
shareToTlTheGameWhenStart: "Share Game to timeline when started"
|
||||
iStartedAGame: "The game has begun! #MisskeyReversi"
|
||||
opponentHasSettingsChanged: "The opponent has changed their settings."
|
||||
allowIrregularRules: "Irregular rules (completely free)"
|
||||
disallowIrregularRules: "No irregular rules"
|
||||
_offlineScreen:
|
||||
title: "Offline - cannot connect to the server"
|
||||
header: "Unable to connect to the server"
|
||||
|
||||
|
@@ -2428,3 +2428,4 @@ _dataSaver:
|
||||
description: "Si se usa resaltado de código en MFM, etc., no se cargará hasta pulsar en ello. El resaltado de sintaxis requiere la descarga de archivos de definición para cada lenguaje de programación. Debido a esto, al deshabilitar la carga automática de estos archivos reducirás el consumo de datos."
|
||||
_reversi:
|
||||
total: "Total"
|
||||
|
||||
|
@@ -2085,3 +2085,4 @@ _dataSaver:
|
||||
description: "Si la notation de mise en évidence du code est utilisée, par exemple dans la MFM, elle ne sera pas chargée tant qu'elle n'aura pas été tapée. La mise en évidence du code nécessite le chargement du fichier de définition de chaque langue à mettre en évidence, mais comme ces fichiers ne sont plus chargés automatiquement, on peut s'attendre à une réduction du trafic de données."
|
||||
_reversi:
|
||||
total: "Total"
|
||||
|
||||
|
@@ -3,3 +3,4 @@ _lang_: "japanski"
|
||||
ok: "OK"
|
||||
gotIt: "Razumijem"
|
||||
cancel: "otkazati"
|
||||
|
||||
|
@@ -16,3 +16,4 @@ _2fa:
|
||||
renewTOTPCancel: "Sispann"
|
||||
_widgets:
|
||||
profile: "pwofil"
|
||||
|
||||
|
@@ -102,3 +102,4 @@ _deck:
|
||||
_columns:
|
||||
notifications: "Értesítések"
|
||||
tl: "Idővonal"
|
||||
|
||||
|
@@ -2321,3 +2321,4 @@ _dataSaver:
|
||||
description: "Jika notasi penyorotan kode digunakan di MFM, dll. Fungsi tersebut tidak akan dimuat apabila tidak diketuk. Penyorotan sintaks membutuhkan pengunduhan berkas definisi penyorotan untuk setiap bahasa pemrograman. Oleh sebab itu, menonaktifkan pemuatan otomatis dari berkas ini dilakukan untuk mengurangi jumlah komunikasi data."
|
||||
_reversi:
|
||||
total: "Jumlah"
|
||||
|
||||
|
22
locales/index.d.ts
vendored
22
locales/index.d.ts
vendored
@@ -4894,7 +4894,7 @@ export interface Locale extends ILocale {
|
||||
*/
|
||||
"readConfirmText": ParameterizedString<"title">;
|
||||
/**
|
||||
* 特に新規ユーザーのUXを損ねる可能性が高いため、ストック情報ではなくフロー情報の掲示にお知らせを使用することを推奨します。
|
||||
* 特に新規ユーザーのUXを損ねる可能性が高いため、常時掲示するための情報ではなく、即時性が求められる情報の掲示のためにお知らせを使用することを推奨します。
|
||||
*/
|
||||
"shouldNotBeUsedToPresentPermanentInfo": string;
|
||||
/**
|
||||
@@ -9583,6 +9583,26 @@ export interface Locale extends ILocale {
|
||||
* 対局がキャンセルされました
|
||||
*/
|
||||
"gameCanceled": string;
|
||||
/**
|
||||
* 開始時に対局をタイムラインに投稿
|
||||
*/
|
||||
"shareToTlTheGameWhenStart": string;
|
||||
/**
|
||||
* 対局を開始しました! #MisskeyReversi
|
||||
*/
|
||||
"iStartedAGame": string;
|
||||
/**
|
||||
* 相手が設定を変更しました
|
||||
*/
|
||||
"opponentHasSettingsChanged": string;
|
||||
/**
|
||||
* 変則許可 (完全フリー)
|
||||
*/
|
||||
"allowIrregularRules": string;
|
||||
/**
|
||||
* 変則なし
|
||||
*/
|
||||
"disallowIrregularRules": string;
|
||||
};
|
||||
"_offlineScreen": {
|
||||
/**
|
||||
|
@@ -2356,3 +2356,4 @@ _dataSaver:
|
||||
description: "Impedire che il codice sorgente sia automaticamente evidenziato. Evidenziare il codice richiede il caricamento di un file per ogni linguaggio. Puoi evidenziare soltanto il codice che intendi leggere e ridurre il traffico inutilizzato."
|
||||
_reversi:
|
||||
total: "Totale"
|
||||
|
||||
|
@@ -1223,7 +1223,7 @@ _announcement:
|
||||
tooManyActiveAnnouncementDescription: "アクティブなお知らせが多いため、UXが低下する可能性があります。終了したお知らせはアーカイブすることを検討してください。"
|
||||
readConfirmTitle: "既読にしますか?"
|
||||
readConfirmText: "「{title}」の内容を読み、既読にします。"
|
||||
shouldNotBeUsedToPresentPermanentInfo: "特に新規ユーザーのUXを損ねる可能性が高いため、ストック情報ではなくフロー情報の掲示にお知らせを使用することを推奨します。"
|
||||
shouldNotBeUsedToPresentPermanentInfo: "特に新規ユーザーのUXを損ねる可能性が高いため、常時掲示するための情報ではなく、即時性が求められる情報の掲示のためにお知らせを使用することを推奨します。"
|
||||
dialogAnnouncementUxWarn: "ダイアログ形式のお知らせが同時に2つ以上ある場合、UXに悪影響を及ぼす可能性が非常に高いため、使用は慎重に行うことを推奨します。"
|
||||
silence: "非通知"
|
||||
silenceDescription: "オンにすると、このお知らせは通知されず、既読にする必要もなくなります。"
|
||||
@@ -2553,6 +2553,11 @@ _reversi:
|
||||
freeMatch: "フリーマッチ"
|
||||
lookingForPlayer: "対戦相手を探しています"
|
||||
gameCanceled: "対局がキャンセルされました"
|
||||
shareToTlTheGameWhenStart: "開始時に対局をタイムラインに投稿"
|
||||
iStartedAGame: "対局を開始しました! #MisskeyReversi"
|
||||
opponentHasSettingsChanged: "相手が設定を変更しました"
|
||||
allowIrregularRules: "変則許可 (完全フリー)"
|
||||
disallowIrregularRules: "変則なし"
|
||||
|
||||
_offlineScreen:
|
||||
title: "オフライン - サーバーに接続できません"
|
||||
|
@@ -380,8 +380,11 @@ hcaptcha: "hCaptcha(キャプチャ)"
|
||||
enableHcaptcha: "hCaptcha(キャプチャ)をつけとく"
|
||||
hcaptchaSiteKey: "サイトキー"
|
||||
hcaptchaSecretKey: "シークレットキー"
|
||||
mcaptcha: "mCaptcha"
|
||||
enableMcaptcha: "hCaptcha(キャプチャ)をつけとく"
|
||||
mcaptchaSiteKey: "サイトキー"
|
||||
mcaptchaSecretKey: "シークレットキー"
|
||||
mcaptchaInstanceUrl: "mCaptchaのインスタンスのURL"
|
||||
recaptcha: "reCAPTCHA"
|
||||
enableRecaptcha: "reCAPTCHA(リキャプチャ)を有効にする"
|
||||
recaptchaSiteKey: "サイトキー"
|
||||
@@ -629,6 +632,7 @@ medium: "中"
|
||||
small: "小"
|
||||
generateAccessToken: "アクセストークンの発行"
|
||||
permission: "権限"
|
||||
adminPermission: "管理者権限"
|
||||
enableAll: "全部使えるようにする"
|
||||
disableAll: "全部使えへんようにする"
|
||||
tokenRequested: "アカウントへのアクセス許してやったらどうや"
|
||||
@@ -1055,6 +1059,8 @@ limitWidthOfReaction: "ツッコミの最大横幅を制限して、ちっさく
|
||||
noteIdOrUrl: "ノートIDかURL"
|
||||
video: "動画"
|
||||
videos: "動画"
|
||||
audio: "音声"
|
||||
audioFiles: "音声"
|
||||
dataSaver: "データケチケチ"
|
||||
accountMigration: "アカウントのお引っ越し"
|
||||
accountMoved: "このユーザーはさらのアカウントに引っ越したで:"
|
||||
@@ -1187,7 +1193,25 @@ seasonalScreenEffect: "季節にあった画面の動き"
|
||||
decorate: "デコる"
|
||||
addMfmFunction: "装飾つける"
|
||||
enableQuickAddMfmFunction: "ややこしいMFMのピッカーを出す"
|
||||
bubbleGame: "バブルゲーム"
|
||||
sfx: "効果音"
|
||||
soundWillBePlayed: "サウンドが再生されるで"
|
||||
showReplay: "リプレイ見る"
|
||||
replay: "リプレイ"
|
||||
replaying: "リプレイ中"
|
||||
ranking: "ランキング"
|
||||
lastNDays: "直近{n}日"
|
||||
backToTitle: "タイトルへ"
|
||||
hemisphere: "住んでる地域"
|
||||
withSensitive: "センシティブなファイルを含むノートを表示"
|
||||
userSaysSomethingSensitive: "{name}のセンシティブなファイルを含む投稿"
|
||||
enableHorizontalSwipe: "スワイプしてタブを切り替える"
|
||||
_bubbleGame:
|
||||
howToPlay: "遊び方"
|
||||
_howToPlay:
|
||||
section1: "位置を調整してハコにモノを落とすで。"
|
||||
section2: "同じもんがくっついたら別のやつになって、スコアがもらえるで。"
|
||||
section3: "モノがハコからあふれたらゲームオーバーや。ハコからあふれんようにしながらモノを融合させてハイスコアを目指しいや!"
|
||||
_announcement:
|
||||
forExistingUsers: "もうおるユーザーのみ"
|
||||
forExistingUsersDescription: "オンにしたらこのお知らせができた時点でおる人らにだけお知らせが行くで。切ったらこの知らせが行ったあとにアカウント作った人にもちゃんとお知らせが行くで。"
|
||||
@@ -1558,6 +1582,13 @@ _achievements:
|
||||
_tutorialCompleted:
|
||||
title: "Misskeyひよっこ講座 修了証"
|
||||
description: "チュートリアル全部やった"
|
||||
_bubbleGameExplodingHead:
|
||||
title: "🤯"
|
||||
description: "バブルゲームで最も大きいモノを出した"
|
||||
_bubbleGameDoubleExplodingHead:
|
||||
title: "ダブル🤯"
|
||||
description: "バブルゲームで最も大きいモノを2つ同時に出した"
|
||||
flavor: "これくらいの おべんとばこに 🤯 🤯 ちょっとつめて"
|
||||
_role:
|
||||
new: "ロールの作成"
|
||||
edit: "ロールの編集"
|
||||
@@ -2002,9 +2033,9 @@ _auth:
|
||||
_antennaSources:
|
||||
all: "みんなのノート"
|
||||
homeTimeline: "フォローしとるユーザーのノート"
|
||||
users: "選らんだ一人か複数のユーザーのノート"
|
||||
users: "選んだ一人か複数のユーザーのノート"
|
||||
userList: "選んだリストのユーザーのノート"
|
||||
userBlacklist: "選んだ1人か複数のユーザーのノート"
|
||||
userBlacklist: "選んだ一人か複数のユーザーを除いた全てのノート"
|
||||
_weekday:
|
||||
sunday: "日曜日"
|
||||
monday: "月曜日"
|
||||
@@ -2410,5 +2441,53 @@ _dataSaver:
|
||||
_code:
|
||||
title: "コードハイライト"
|
||||
description: "MFMとかでコードハイライト記法が使われてるとき、タップするまで読み込まれへんくなるで。コードハイライトではハイライトする言語ごとにその決めてるファイルを読む必要はあんねんな。けどな、それは自動で読み込まれなくなるから、通信量を少なくできることができるねん。"
|
||||
_hemisphere:
|
||||
N: "北半球"
|
||||
S: "南半球"
|
||||
caption: "一部のクライアント設定で、季節を判定するのに使用するで。"
|
||||
_reversi:
|
||||
reversi: "リバーシ"
|
||||
gameSettings: "対局の設定"
|
||||
chooseBoard: "ボードを選択"
|
||||
blackOrWhite: "先行/後攻"
|
||||
blackIs: "{name}が黒(先行)"
|
||||
rules: "ルール"
|
||||
thisGameIsStartedSoon: "対局、そろそろ開始されるで。"
|
||||
waitingForOther: "相手の準備が完了するのを待ってんで。"
|
||||
waitingForMe: "あんさんの準備が完了すんのを待ってんで"
|
||||
waitingBoth: "準備してなー"
|
||||
ready: "準備完了"
|
||||
cancelReady: "準備を再開"
|
||||
opponentTurn: "相手のターンやで"
|
||||
myTurn: "あんさんのターンや"
|
||||
turnOf: "{name}のターンやで"
|
||||
pastTurnOf: "{name}のターン"
|
||||
surrender: "投了"
|
||||
surrendered: "投了により"
|
||||
timeout: "時間切れ"
|
||||
drawn: "引き分け"
|
||||
won: "{name}の勝ち"
|
||||
black: "黒"
|
||||
white: "白"
|
||||
total: "合計"
|
||||
turnCount: "{count}ターン目"
|
||||
myGames: "自分の対局"
|
||||
allGames: "みんなの対局"
|
||||
ended: "終了"
|
||||
playing: "対局中"
|
||||
isLlotheo: "石の少ない方が勝ち(ロセオ)"
|
||||
loopedMap: "ループマップ"
|
||||
canPutEverywhere: "どこでも置けるモード"
|
||||
timeLimitForEachTurn: "1ターンの時間制限"
|
||||
freeMatch: "フリーマッチ"
|
||||
lookingForPlayer: "対戦相手を探してるで"
|
||||
gameCanceled: "対局がキャンセルされたわ"
|
||||
shareToTlTheGameWhenStart: "初めの時に対局をタイムラインに投稿するで"
|
||||
iStartedAGame: "対局し始めたで! #MisskeyReversi"
|
||||
opponentHasSettingsChanged: "相手が設定変えたで"
|
||||
allowIrregularRules: "変則許可 (完全フリー)"
|
||||
disallowIrregularRules: "変則なし"
|
||||
_offlineScreen:
|
||||
title: "オフライン - サーバーに接続できひんで"
|
||||
header: "サーバーに接続できへんわ"
|
||||
|
||||
|
@@ -1,3 +1,4 @@
|
||||
---
|
||||
_lang_: "la .lojban."
|
||||
headlineMisskey: "lo se tcana noi jorne fi loi notci"
|
||||
|
||||
|
@@ -104,3 +104,4 @@ _deck:
|
||||
_columns:
|
||||
notifications: "Ilɣuyen"
|
||||
list: "Tibdarin"
|
||||
|
||||
|
@@ -84,3 +84,4 @@ _deck:
|
||||
notifications: "ಅಧಿಸೂಚನೆಗಳು"
|
||||
tl: "ಸಮಯಸಾಲು"
|
||||
mentions: "ಹೆಸರಿಸಿದ"
|
||||
|
||||
|
@@ -726,3 +726,4 @@ _moderationLogTypes:
|
||||
resolveAbuseReport: "신고 해겔하기"
|
||||
_reversi:
|
||||
total: "합계"
|
||||
|
||||
|
@@ -380,9 +380,11 @@ hcaptcha: "hCaptcha"
|
||||
enableHcaptcha: "hCaptcha 활성화"
|
||||
hcaptchaSiteKey: "사이트 키"
|
||||
hcaptchaSecretKey: "시크릿 키"
|
||||
mcaptcha: "mCaptcha"
|
||||
enableMcaptcha: "mCaptcha 활성화"
|
||||
mcaptchaSiteKey: "사이트 키"
|
||||
mcaptchaSecretKey: "시크릿 키"
|
||||
mcaptchaInstanceUrl: "mCaptcha 인스턴스 URL"
|
||||
recaptcha: "reCAPTCHA"
|
||||
enableRecaptcha: "reCAPTCHA 활성화"
|
||||
recaptchaSiteKey: "사이트 키"
|
||||
@@ -630,6 +632,7 @@ medium: "보통"
|
||||
small: "작게"
|
||||
generateAccessToken: "액세스 토큰 생성"
|
||||
permission: "권한"
|
||||
adminPermission: "관리자 권한"
|
||||
enableAll: "전체 선택"
|
||||
disableAll: "전체 해제"
|
||||
tokenRequested: "계정 접근 허용"
|
||||
@@ -673,6 +676,7 @@ useGlobalSettingDesc: "활성화하면 계정의 알림 설정이 적용됩니
|
||||
other: "기타"
|
||||
regenerateLoginToken: "로그인 토큰을 재생성"
|
||||
regenerateLoginTokenDescription: "로그인할 때 사용되는 내부 토큰을 재생성합니다. 일반적으로 이 작업을 실행할 필요는 없습니다. 이 기능을 사용하면 이 계정으로 로그인한 모든 기기에서 로그아웃됩니다."
|
||||
theKeywordWhenSearchingForCustomEmoji: "맞춤 이모티콘을 검색할 때 키워드가 됩니다."
|
||||
setMultipleBySeparatingWithSpace: "공백으로 구분하여 여러 개 설정할 수 있습니다."
|
||||
fileIdOrUrl: "파일 ID 또는 URL"
|
||||
behavior: "동작"
|
||||
@@ -1055,6 +1059,8 @@ limitWidthOfReaction: "리액션의 최대 폭을 제한하고 작게 표시하
|
||||
noteIdOrUrl: "노트 ID 및 URL"
|
||||
video: "동영상"
|
||||
videos: "동영상"
|
||||
audio: "소리"
|
||||
audioFiles: "소리"
|
||||
dataSaver: "데이터 절약 모드"
|
||||
accountMigration: "계정 이동"
|
||||
accountMoved: "이 사용자는 다음 계정으로 이사했습니다:"
|
||||
@@ -1187,10 +1193,25 @@ seasonalScreenEffect: "계절에 따른 효과 보이기"
|
||||
decorate: "장식하기"
|
||||
addMfmFunction: "장식 추가하기"
|
||||
enableQuickAddMfmFunction: "상급자용 MFM 선택기 표시하기"
|
||||
bubbleGame: "버블 게임"
|
||||
sfx: "효과음"
|
||||
soundWillBePlayed: "소리가 재생됩니다"
|
||||
showReplay: "리플레이 보기"
|
||||
replay: "리플레이"
|
||||
replaying: "리플레이 중"
|
||||
ranking: "랭킹"
|
||||
lastNDays: "최근 {n}일"
|
||||
backToTitle: "타이틀로 가기"
|
||||
hemisphere: "거주 지역"
|
||||
withSensitive: "민감한 파일이 포함된 노트 보기"
|
||||
userSaysSomethingSensitive: "{name}의 민감한 파일이 포함된 게시물"
|
||||
enableHorizontalSwipe: "스와이프하여 탭 전환"
|
||||
_bubbleGame:
|
||||
howToPlay: "설명"
|
||||
_howToPlay:
|
||||
section1: "위치를 조정하여 상자에 물건을 떨어뜨립니다."
|
||||
section2: "같은 종류의 물건이 붙으면 다른 물건으로 바뀌면서 점수를 얻게 됩니다."
|
||||
section3: "상자에서 물건이 넘치면 게임 오버입니다. 상자에서 물건이 넘치지 않도록 하면서 물건을 융합하여 높은 점수를 획득하세요!"
|
||||
_announcement:
|
||||
forExistingUsers: "기존 유저에게만 알림"
|
||||
forExistingUsersDescription: "활성화하면 이 공지사항을 게시한 시점에서 이미 가입한 유저에게만 표시합니다. 비활성화하면 게시 후에 가입한 유저에게도 표시합니다."
|
||||
@@ -1561,6 +1582,13 @@ _achievements:
|
||||
_tutorialCompleted:
|
||||
title: "Misskey 입문자 과정 수료증"
|
||||
description: "튜토리얼을 완료했습니다"
|
||||
_bubbleGameExplodingHead:
|
||||
title: "🤯"
|
||||
description: "버블 게임에서 가장 큰 물건을 내놓았다"
|
||||
_bubbleGameDoubleExplodingHead:
|
||||
title: "더블 🤯"
|
||||
description: "버블게임에서 가장 큰 물건 2개를 동시에 내놓았다."
|
||||
flavor: "이 정도만 도시락통에 🤯 🤯 조금만 더"
|
||||
_role:
|
||||
new: "새 역할 생성"
|
||||
edit: "역할 수정"
|
||||
@@ -2413,5 +2441,48 @@ _dataSaver:
|
||||
_code:
|
||||
title: "문자열 강조"
|
||||
description: "MFM 등으로 문자열 강조 기법을 사용할 때 누르기 전에는 불러오지 않습니다. 문자열 강조에서는 강조할 언어마다 그 정의 파일을 불러와야 하지만 이를 자동으로 불러오지 않으므로 데이터 사용량을 줄일 수 있습니다."
|
||||
_hemisphere:
|
||||
N: "북반구"
|
||||
S: "남반구"
|
||||
caption: "일부 클라이언트 설정에서 계절을 판단하기 위해 사용합니다."
|
||||
_reversi:
|
||||
reversi: "리버시"
|
||||
gameSettings: "대국 설정"
|
||||
chooseBoard: "보드 선택"
|
||||
blackOrWhite: "선공/후공"
|
||||
blackIs: "{name}님이 흑(선공)"
|
||||
rules: "규칙"
|
||||
thisGameIsStartedSoon: "대국이 곧 시작됩니다"
|
||||
waitingForOther: "상대방의 준비가 완료되기를 기다리고 있습니다."
|
||||
waitingForMe: "당신의 준비가 완료되기를 기다리고 있습니다."
|
||||
waitingBoth: "준비하세요"
|
||||
ready: "준비 완료"
|
||||
cancelReady: "준비 다시 시작"
|
||||
opponentTurn: "상대의 차례입니다"
|
||||
myTurn: "당신의 차례입니다"
|
||||
turnOf: "{name}의 차례입니다"
|
||||
pastTurnOf: "{name}의 차례"
|
||||
surrender: "기권"
|
||||
surrendered: "기권에 의해"
|
||||
timeout: "시간 초과"
|
||||
drawn: "무승부"
|
||||
won: "{name}의 승리"
|
||||
black: "흑"
|
||||
white: "백"
|
||||
total: "합계"
|
||||
turnCount: "{count}턴 째"
|
||||
myGames: "내 대국"
|
||||
allGames: "모두의 대국"
|
||||
ended: "종료"
|
||||
playing: "대국 중"
|
||||
isLlotheo: "돌이 적은 사람이 승리 (로세오)"
|
||||
loopedMap: "루프 지도"
|
||||
canPutEverywhere: "어디에도 둘 수 있는 모드"
|
||||
timeLimitForEachTurn: "1턴의 시간 제한"
|
||||
freeMatch: "프리매치"
|
||||
lookingForPlayer: "상대를 찾고 있습니다"
|
||||
gameCanceled: "대국이 취소되었습니다"
|
||||
_offlineScreen:
|
||||
title: "오프라인 - 서버에 접속할 수 없습니다"
|
||||
header: "서버에 접속할 수 없습니다"
|
||||
|
||||
|
@@ -466,3 +466,4 @@ _webhookSettings:
|
||||
name: "ຊື່"
|
||||
_moderationLogTypes:
|
||||
suspend: "ລະງັບ"
|
||||
|
||||
|
@@ -497,3 +497,4 @@ _webhookSettings:
|
||||
_moderationLogTypes:
|
||||
suspend: "Opschorten"
|
||||
resetPassword: "Wachtwoord terugzetten"
|
||||
|
||||
|
@@ -720,3 +720,4 @@ _webhookSettings:
|
||||
name: "Navn"
|
||||
_moderationLogTypes:
|
||||
suspend: "Suspender"
|
||||
|
||||
|
@@ -1399,3 +1399,4 @@ _moderationLogTypes:
|
||||
resetPassword: "Zresetuj hasło"
|
||||
_reversi:
|
||||
total: "Łącznie"
|
||||
|
||||
|
@@ -1500,3 +1500,4 @@ _moderationLogTypes:
|
||||
resetPassword: "Redefinir senha"
|
||||
_reversi:
|
||||
total: "Total"
|
||||
|
||||
|
@@ -729,3 +729,4 @@ _moderationLogTypes:
|
||||
resetPassword: "Resetează parola"
|
||||
_reversi:
|
||||
total: "Total"
|
||||
|
||||
|
@@ -1972,3 +1972,4 @@ _moderationLogTypes:
|
||||
resetPassword: "Сброс пароля:"
|
||||
_reversi:
|
||||
total: "Всего"
|
||||
|
||||
|
@@ -1 +1,2 @@
|
||||
---
|
||||
|
||||
|
@@ -1447,3 +1447,4 @@ _moderationLogTypes:
|
||||
resetPassword: "Resetovať heslo"
|
||||
_reversi:
|
||||
total: "Celkom"
|
||||
|
||||
|
@@ -576,3 +576,4 @@ _webhookSettings:
|
||||
_moderationLogTypes:
|
||||
suspend: "Suspendera"
|
||||
resetPassword: "Återställ Lösenord"
|
||||
|
||||
|
@@ -2440,3 +2440,4 @@ _dataSaver:
|
||||
description: "หากใช้สัญลักษณ์ไฮไลต์โค้ดใน MFM ฯลฯ สัญลักษณ์เหล่านั้นจะไม่โหลดจนกว่าจะแตะ การไฮไลต์ไวยากรณ์(syntax)จำเป็นต้องดาวน์โหลดไฟล์คำจำกัดความของไฮไลต์สำหรับแต่ละภาษา ดังนั้นการปิดใช้งานการโหลดไฟล์เหล่านี้โดยอัตโนมัติจึงคาดว่าจะช่วยลดปริมาณข้อมูลการสื่อสารได้"
|
||||
_reversi:
|
||||
total: "รวมทั้งหมด"
|
||||
|
||||
|
@@ -455,3 +455,4 @@ _deck:
|
||||
_moderationLogTypes:
|
||||
suspend: "askıya al"
|
||||
resetPassword: "Şifre sıfırlama"
|
||||
|
||||
|
@@ -17,3 +17,4 @@ _2fa:
|
||||
renewTOTPCancel: "ئۇنى توختىتىڭ"
|
||||
_widgets:
|
||||
profile: "profile"
|
||||
|
||||
|
@@ -1622,3 +1622,4 @@ _moderationLogTypes:
|
||||
resetPassword: "Скинути пароль"
|
||||
_reversi:
|
||||
total: "Всього"
|
||||
|
||||
|
@@ -1090,3 +1090,4 @@ _moderationLogTypes:
|
||||
resetPassword: "Parolni tiklash"
|
||||
_reversi:
|
||||
total: "Jami"
|
||||
|
||||
|
@@ -1852,3 +1852,4 @@ _moderationLogTypes:
|
||||
resetPassword: "Đặt lại mật khẩu"
|
||||
_reversi:
|
||||
total: "Tổng cộng"
|
||||
|
||||
|
@@ -1185,6 +1185,7 @@ useGroupedNotifications: "分组显示通知"
|
||||
signupPendingError: "确认电子邮件时出现错误。链接可能已过期。"
|
||||
cwNotationRequired: "在启用「隐藏内容」时必须输入注释"
|
||||
doReaction: "回应"
|
||||
code: "代码"
|
||||
reloadRequiredToApplySettings: "需要重新载入来使设置生效"
|
||||
remainingN: "剩余:{n}"
|
||||
overwriteContentConfirm: "将覆盖现有内容。确定吗?"
|
||||
@@ -1200,6 +1201,9 @@ replaying: "重播中"
|
||||
ranking: "排行榜"
|
||||
lastNDays: "最近 {n} 天"
|
||||
backToTitle: "返回标题"
|
||||
hemisphere: "居住地区"
|
||||
withSensitive: "显示包含敏感媒体的帖子"
|
||||
userSaysSomethingSensitive: "含 {name} 敏感文件的帖子"
|
||||
enableHorizontalSwipe: "滑动切换标签页"
|
||||
_bubbleGame:
|
||||
howToPlay: "游戏说明"
|
||||
@@ -2427,9 +2431,16 @@ _dataSaver:
|
||||
_code:
|
||||
title: "代码高亮"
|
||||
description: "如果使用了代码高亮标记,例如在 MFM 中,则在点击之前不会加载。 代码高亮要求加载每种高亮语言的定义文件,由于这些文件不再自动加载,因此有望减少数据传输量。"
|
||||
_hemisphere:
|
||||
N: "北半球"
|
||||
S: "南半球"
|
||||
caption: "在某些客户端设置中用来确定季节"
|
||||
_reversi:
|
||||
reversi: "黑白棋"
|
||||
rules: "规则"
|
||||
ready: "准备就绪"
|
||||
total: "总计"
|
||||
_offlineScreen:
|
||||
title: "离线——无法连接到服务器"
|
||||
header: "无法连接到服务器"
|
||||
|
||||
|
@@ -1202,6 +1202,9 @@ replaying: "重播中"
|
||||
ranking: "排行榜"
|
||||
lastNDays: "過去 {n} 天"
|
||||
backToTitle: "回到遊戲標題頁"
|
||||
hemisphere: "您居住的地區"
|
||||
withSensitive: "顯示包含敏感檔案的貼文"
|
||||
userSaysSomethingSensitive: "包含 {name} 敏感檔案的貼文"
|
||||
enableHorizontalSwipe: "滑動切換時間軸"
|
||||
_bubbleGame:
|
||||
howToPlay: "玩法說明"
|
||||
@@ -2438,5 +2441,53 @@ _dataSaver:
|
||||
_code:
|
||||
title: "程式碼突出顯示"
|
||||
description: "如果使用了 MFM 的程式碼突顯標記,則在點擊之前不會載入。程式碼突顯要求加載每種程式語言的突顯定義檔案,但由於這些檔案不再自動載入,因此有望減少資料流量。"
|
||||
_hemisphere:
|
||||
N: "北半球"
|
||||
S: "南半球"
|
||||
caption: "在某些客戶端的設定中,用於判斷季節。"
|
||||
_reversi:
|
||||
reversi: "黑白棋"
|
||||
gameSettings: "對弈設定"
|
||||
chooseBoard: "選擇棋盤"
|
||||
blackOrWhite: "先手/後手"
|
||||
blackIs: "{name} 為黑棋(先攻)"
|
||||
rules: "規則"
|
||||
thisGameIsStartedSoon: "對弈即將開始"
|
||||
waitingForOther: "等待對手準備就緒"
|
||||
waitingForMe: "等待您準備就緒"
|
||||
waitingBoth: "請準備"
|
||||
ready: "準備就緒"
|
||||
cancelReady: "重新準備"
|
||||
opponentTurn: "對手的回合"
|
||||
myTurn: "您的回合"
|
||||
turnOf: "{name} 的回合"
|
||||
pastTurnOf: "{name} 的回合"
|
||||
surrender: "認輸"
|
||||
surrendered: "對手認輸"
|
||||
timeout: "時間到"
|
||||
drawn: "平手"
|
||||
won: "{name} 獲勝"
|
||||
black: "黑"
|
||||
white: "白"
|
||||
total: "合計"
|
||||
turnCount: "{count} 回合"
|
||||
myGames: "我的對弈"
|
||||
allGames: "所有對弈"
|
||||
ended: "已結束"
|
||||
playing: "正在對弈"
|
||||
isLlotheo: "子較少的一方為勝(顛倒規則)"
|
||||
loopedMap: "循環棋盤"
|
||||
canPutEverywhere: "隨意置放模式"
|
||||
timeLimitForEachTurn: "每回合的時間限制"
|
||||
freeMatch: "自由對戰"
|
||||
lookingForPlayer: "正在搜尋對手"
|
||||
gameCanceled: "對弈已被取消"
|
||||
shareToTlTheGameWhenStart: "在遊戲開始時將對弈資訊發布到時間軸"
|
||||
iStartedAGame: "對弈開始了! #MisskeyReversi"
|
||||
opponentHasSettingsChanged: "對手更改了設定"
|
||||
allowIrregularRules: "允許異常規則(完全自由)"
|
||||
disallowIrregularRules: "不允許異常規則"
|
||||
_offlineScreen:
|
||||
title: "離線-無法連接伺服器"
|
||||
header: "無法連接伺服器"
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"version": "2024.2.0-beta.1",
|
||||
"version": "2024.2.0-beta.8",
|
||||
"codename": "nasubi",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -56,8 +56,8 @@
|
||||
"typescript": "5.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "6.19.0",
|
||||
"@typescript-eslint/parser": "6.19.0",
|
||||
"@typescript-eslint/eslint-plugin": "6.18.1",
|
||||
"@typescript-eslint/parser": "6.18.1",
|
||||
"cross-env": "7.0.3",
|
||||
"cypress": "13.6.3",
|
||||
"eslint": "8.56.0",
|
||||
|
16
packages/backend/migration/1706081514499-reversi-6.js
Normal file
16
packages/backend/migration/1706081514499-reversi-6.js
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export class Reversi61706081514499 {
|
||||
name = 'Reversi61706081514499'
|
||||
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "reversi_game" ADD "noIrregularRules" boolean NOT NULL DEFAULT false`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "reversi_game" DROP COLUMN "noIrregularRules"`);
|
||||
}
|
||||
}
|
@@ -8,7 +8,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node ./built/boot/entry.js",
|
||||
"start:test": "NODE_ENV=test node ./built/boot/entry.js",
|
||||
"start:test": "cross-env NODE_ENV=test node ./built/boot/entry.js",
|
||||
"migrate": "pnpm typeorm migration:run -d ormconfig.js",
|
||||
"revert": "pnpm typeorm migration:revert -d ormconfig.js",
|
||||
"check:connect": "node ./check_connect.js",
|
||||
@@ -31,7 +31,7 @@
|
||||
"test:e2e": "pnpm build && pnpm build:test && pnpm jest:e2e",
|
||||
"test-and-coverage": "pnpm jest-and-coverage",
|
||||
"test-and-coverage:e2e": "pnpm build && pnpm build:test && pnpm jest-and-coverage:e2e",
|
||||
"generate-api-json": "node ./generate_api_json.js"
|
||||
"generate-api-json": "pnpm build && node ./generate_api_json.js"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@swc/core-android-arm64": "1.3.11",
|
||||
@@ -67,9 +67,9 @@
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "3.412.0",
|
||||
"@aws-sdk/lib-storage": "3.412.0",
|
||||
"@bull-board/api": "5.10.2",
|
||||
"@bull-board/fastify": "5.10.2",
|
||||
"@bull-board/ui": "5.10.2",
|
||||
"@bull-board/api": "5.14.0",
|
||||
"@bull-board/fastify": "5.14.0",
|
||||
"@bull-board/ui": "5.14.0",
|
||||
"@discordapp/twemoji": "15.0.2",
|
||||
"@fastify/accepts": "4.3.0",
|
||||
"@fastify/cookie": "9.3.1",
|
||||
@@ -85,11 +85,11 @@
|
||||
"@nestjs/core": "10.2.10",
|
||||
"@nestjs/testing": "10.2.10",
|
||||
"@peertube/http-signature": "1.7.0",
|
||||
"@simplewebauthn/server": "9.0.0",
|
||||
"@simplewebauthn/server": "9.0.1",
|
||||
"@sinonjs/fake-timers": "11.2.2",
|
||||
"@smithy/node-http-handler": "2.1.10",
|
||||
"@swc/cli": "0.1.63",
|
||||
"@swc/core": "1.3.105",
|
||||
"@swc/core": "1.3.107",
|
||||
"@twemoji/parser": "15.0.0",
|
||||
"accepts": "1.3.8",
|
||||
"ajv": "8.12.0",
|
||||
@@ -98,7 +98,7 @@
|
||||
"bcryptjs": "2.4.3",
|
||||
"blurhash": "2.0.5",
|
||||
"body-parser": "1.20.2",
|
||||
"bullmq": "5.1.4",
|
||||
"bullmq": "5.1.5",
|
||||
"cacheable-lookup": "7.0.0",
|
||||
"cbor": "9.0.1",
|
||||
"chalk": "5.3.0",
|
||||
@@ -107,7 +107,6 @@
|
||||
"cli-highlight": "2.1.11",
|
||||
"color-convert": "2.0.1",
|
||||
"content-disposition": "0.5.4",
|
||||
"crc-32": "^1.2.2",
|
||||
"date-fns": "2.30.0",
|
||||
"deep-email-validator": "0.1.21",
|
||||
"fastify": "4.25.2",
|
||||
@@ -116,7 +115,7 @@
|
||||
"file-type": "19.0.0",
|
||||
"fluent-ffmpeg": "2.1.2",
|
||||
"form-data": "4.0.0",
|
||||
"got": "14.0.0",
|
||||
"got": "14.1.0",
|
||||
"happy-dom": "10.0.3",
|
||||
"hpagent": "1.2.0",
|
||||
"http-link-header": "1.1.1",
|
||||
@@ -148,7 +147,7 @@
|
||||
"otpauth": "9.2.2",
|
||||
"parse5": "7.1.2",
|
||||
"pg": "8.11.3",
|
||||
"pkce-challenge": "4.0.1",
|
||||
"pkce-challenge": "4.1.0",
|
||||
"probe-image-size": "7.2.3",
|
||||
"promise-limit": "2.7.0",
|
||||
"pug": "3.0.2",
|
||||
@@ -169,12 +168,12 @@
|
||||
"slacc": "0.0.10",
|
||||
"strict-event-emitter-types": "2.0.0",
|
||||
"stringz": "2.1.0",
|
||||
"systeminformation": "5.21.23",
|
||||
"systeminformation": "5.21.24",
|
||||
"tinycolor2": "1.6.0",
|
||||
"tmp": "0.2.1",
|
||||
"tsc-alias": "1.8.8",
|
||||
"tsconfig-paths": "4.2.0",
|
||||
"typeorm": "0.3.19",
|
||||
"typeorm": "0.3.20",
|
||||
"typescript": "5.3.3",
|
||||
"ulid": "2.3.0",
|
||||
"vary": "1.1.2",
|
||||
@@ -185,7 +184,7 @@
|
||||
"devDependencies": {
|
||||
"@jest/globals": "29.7.0",
|
||||
"@misskey-dev/eslint-plugin": "1.0.0",
|
||||
"@nestjs/platform-express": "10.3.0",
|
||||
"@nestjs/platform-express": "10.3.1",
|
||||
"@simplewebauthn/typescript-types": "8.3.4",
|
||||
"@swc/jest": "0.2.31",
|
||||
"@types/accepts": "1.3.7",
|
||||
@@ -204,13 +203,13 @@
|
||||
"@types/jsrsasign": "10.5.12",
|
||||
"@types/mime-types": "2.1.4",
|
||||
"@types/ms": "0.7.34",
|
||||
"@types/node": "20.11.5",
|
||||
"@types/node": "20.11.10",
|
||||
"@types/node-fetch": "3.0.3",
|
||||
"@types/nodemailer": "6.4.14",
|
||||
"@types/oauth": "0.9.4",
|
||||
"@types/oauth2orize": "1.11.3",
|
||||
"@types/oauth2orize-pkce": "0.1.2",
|
||||
"@types/pg": "8.10.9",
|
||||
"@types/pg": "8.11.0",
|
||||
"@types/pug": "2.0.10",
|
||||
"@types/punycode": "2.1.3",
|
||||
"@types/qrcode": "1.5.5",
|
||||
@@ -227,8 +226,8 @@
|
||||
"@types/vary": "1.1.3",
|
||||
"@types/web-push": "3.6.3",
|
||||
"@types/ws": "8.5.10",
|
||||
"@typescript-eslint/eslint-plugin": "6.19.0",
|
||||
"@typescript-eslint/parser": "6.19.0",
|
||||
"@typescript-eslint/eslint-plugin": "6.18.1",
|
||||
"@typescript-eslint/parser": "6.18.1",
|
||||
"aws-sdk-client-mock": "3.0.1",
|
||||
"cross-env": "7.0.3",
|
||||
"eslint": "8.56.0",
|
||||
|
@@ -74,10 +74,10 @@ type Source = {
|
||||
|
||||
deliverJobConcurrency?: number;
|
||||
inboxJobConcurrency?: number;
|
||||
relashionshipJobConcurrency?: number;
|
||||
relationshipJobConcurrency?: number;
|
||||
deliverJobPerSec?: number;
|
||||
inboxJobPerSec?: number;
|
||||
relashionshipJobPerSec?: number;
|
||||
relationshipJobPerSec?: number;
|
||||
deliverJobMaxAttempts?: number;
|
||||
inboxJobMaxAttempts?: number;
|
||||
|
||||
@@ -135,10 +135,10 @@ export type Config = {
|
||||
outgoingAddressFamily: 'ipv4' | 'ipv6' | 'dual' | undefined;
|
||||
deliverJobConcurrency: number | undefined;
|
||||
inboxJobConcurrency: number | undefined;
|
||||
relashionshipJobConcurrency: number | undefined;
|
||||
relationshipJobConcurrency: number | undefined;
|
||||
deliverJobPerSec: number | undefined;
|
||||
inboxJobPerSec: number | undefined;
|
||||
relashionshipJobPerSec: number | undefined;
|
||||
relationshipJobPerSec: number | undefined;
|
||||
deliverJobMaxAttempts: number | undefined;
|
||||
inboxJobMaxAttempts: number | undefined;
|
||||
proxyRemoteFiles: boolean | undefined;
|
||||
@@ -241,10 +241,10 @@ export function loadConfig(): Config {
|
||||
outgoingAddressFamily: config.outgoingAddressFamily,
|
||||
deliverJobConcurrency: config.deliverJobConcurrency,
|
||||
inboxJobConcurrency: config.inboxJobConcurrency,
|
||||
relashionshipJobConcurrency: config.relashionshipJobConcurrency,
|
||||
relationshipJobConcurrency: config.relationshipJobConcurrency,
|
||||
deliverJobPerSec: config.deliverJobPerSec,
|
||||
inboxJobPerSec: config.inboxJobPerSec,
|
||||
relashionshipJobPerSec: config.relashionshipJobPerSec,
|
||||
relationshipJobPerSec: config.relationshipJobPerSec,
|
||||
deliverJobMaxAttempts: config.deliverJobMaxAttempts,
|
||||
inboxJobMaxAttempts: config.inboxJobMaxAttempts,
|
||||
proxyRemoteFiles: config.proxyRemoteFiles,
|
||||
|
@@ -55,23 +55,29 @@ export class AntennaService implements OnApplicationShutdown {
|
||||
const { type, body } = obj.message as GlobalEvents['internal']['payload'];
|
||||
switch (type) {
|
||||
case 'antennaCreated':
|
||||
this.antennas.push({
|
||||
this.antennas.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
|
||||
...body,
|
||||
lastUsedAt: new Date(body.lastUsedAt),
|
||||
user: null, // joinなカラムは通常取ってこないので
|
||||
userList: null, // joinなカラムは通常取ってこないので
|
||||
});
|
||||
break;
|
||||
case 'antennaUpdated': {
|
||||
const idx = this.antennas.findIndex(a => a.id === body.id);
|
||||
if (idx >= 0) {
|
||||
this.antennas[idx] = {
|
||||
this.antennas[idx] = { // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
|
||||
...body,
|
||||
lastUsedAt: new Date(body.lastUsedAt),
|
||||
user: null, // joinなカラムは通常取ってこないので
|
||||
userList: null, // joinなカラムは通常取ってこないので
|
||||
};
|
||||
} else {
|
||||
// サーバ起動時にactiveじゃなかった場合、リストに持っていないので追加する必要あり
|
||||
this.antennas.push({
|
||||
this.antennas.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
|
||||
...body,
|
||||
lastUsedAt: new Date(body.lastUsedAt),
|
||||
user: null, // joinなカラムは通常取ってこないので
|
||||
userList: null, // joinなカラムは通常取ってこないので
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -54,9 +54,9 @@ export interface MainEventTypes {
|
||||
reply: Packed<'Note'>;
|
||||
renote: Packed<'Note'>;
|
||||
follow: Packed<'UserDetailedNotMe'>;
|
||||
followed: Packed<'User'>;
|
||||
unfollow: Packed<'User'>;
|
||||
meUpdated: Packed<'User'>;
|
||||
followed: Packed<'UserDetailed' | 'UserLite'>;
|
||||
unfollow: Packed<'UserDetailed'>;
|
||||
meUpdated: Packed<'UserDetailed'>;
|
||||
pageEvent: {
|
||||
pageId: MiPage['id'];
|
||||
event: string;
|
||||
|
@@ -51,7 +51,10 @@ export class MetaService implements OnApplicationShutdown {
|
||||
const { type, body } = obj.message as GlobalEvents['internal']['payload'];
|
||||
switch (type) {
|
||||
case 'metaUpdated': {
|
||||
this.cache = body;
|
||||
this.cache = { // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
|
||||
...body,
|
||||
proxyAccount: null, // joinなカラムは通常取ってこないので
|
||||
};
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@@ -5,10 +5,9 @@
|
||||
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import * as Redis from 'ioredis';
|
||||
import CRC32 from 'crc-32';
|
||||
import { ModuleRef } from '@nestjs/core';
|
||||
import * as Reversi from 'misskey-reversi';
|
||||
import { IsNull } from 'typeorm';
|
||||
import { IsNull, LessThan, MoreThan } from 'typeorm';
|
||||
import type {
|
||||
MiReversiGame,
|
||||
ReversiGamesRepository,
|
||||
@@ -25,7 +24,7 @@ import { Serialized } from '@/types.js';
|
||||
import { ReversiGameEntityService } from './entities/ReversiGameEntityService.js';
|
||||
import type { OnApplicationShutdown, OnModuleInit } from '@nestjs/common';
|
||||
|
||||
const MATCHING_TIMEOUT_MS = 1000 * 15; // 15sec
|
||||
const INVITATION_TIMEOUT_MS = 1000 * 20; // 20sec
|
||||
|
||||
@Injectable()
|
||||
export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||
@@ -86,60 +85,82 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||
map: game.map,
|
||||
bw: game.bw,
|
||||
crc32: game.crc32,
|
||||
noIrregularRules: game.noIrregularRules,
|
||||
} satisfies Partial<MiReversiGame>;
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async matchSpecificUser(me: MiUser, targetUser: MiUser): Promise<MiReversiGame | null> {
|
||||
public async matchSpecificUser(me: MiUser, targetUser: MiUser, multiple = false): Promise<MiReversiGame | null> {
|
||||
if (targetUser.id === me.id) {
|
||||
throw new Error('You cannot match yourself.');
|
||||
}
|
||||
|
||||
if (!multiple) {
|
||||
// 既にマッチしている対局が無いか探す(3分以内)
|
||||
const games = await this.reversiGamesRepository.find({
|
||||
where: [
|
||||
{ id: MoreThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user1Id: me.id, user2Id: targetUser.id, isStarted: false },
|
||||
{ id: MoreThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user1Id: targetUser.id, user2Id: me.id, isStarted: false },
|
||||
],
|
||||
relations: ['user1', 'user2'],
|
||||
order: { id: 'DESC' },
|
||||
});
|
||||
if (games.length > 0) {
|
||||
return games[0];
|
||||
}
|
||||
}
|
||||
|
||||
//#region 相手から既に招待されてないか確認
|
||||
const invitations = await this.redisClient.zrange(
|
||||
`reversi:matchSpecific:${me.id}`,
|
||||
Date.now() - MATCHING_TIMEOUT_MS,
|
||||
Date.now() - INVITATION_TIMEOUT_MS,
|
||||
'+inf',
|
||||
'BYSCORE');
|
||||
|
||||
if (invitations.includes(targetUser.id)) {
|
||||
await this.redisClient.zrem(`reversi:matchSpecific:${me.id}`, targetUser.id);
|
||||
|
||||
const game = await this.reversiGamesRepository.insert({
|
||||
id: this.idService.gen(),
|
||||
user1Id: targetUser.id,
|
||||
user2Id: me.id,
|
||||
user1Ready: false,
|
||||
user2Ready: false,
|
||||
isStarted: false,
|
||||
isEnded: false,
|
||||
logs: [],
|
||||
map: Reversi.maps.eighteight.data,
|
||||
bw: 'random',
|
||||
isLlotheo: false,
|
||||
}).then(x => this.reversiGamesRepository.findOneByOrFail(x.identifiers[0]));
|
||||
this.cacheGame(game);
|
||||
|
||||
const packed = await this.reversiGameEntityService.packDetail(game, { id: targetUser.id });
|
||||
this.globalEventService.publishReversiStream(targetUser.id, 'matched', { game: packed });
|
||||
|
||||
return game;
|
||||
} else {
|
||||
this.redisClient.zadd(`reversi:matchSpecific:${targetUser.id}`, Date.now(), me.id);
|
||||
|
||||
this.globalEventService.publishReversiStream(targetUser.id, 'invited', {
|
||||
user: await this.userEntityService.pack(me, targetUser),
|
||||
const game = await this.matched(targetUser.id, me.id, {
|
||||
noIrregularRules: false,
|
||||
});
|
||||
|
||||
return null;
|
||||
return game;
|
||||
}
|
||||
//#endregion
|
||||
|
||||
const redisPipeline = this.redisClient.pipeline();
|
||||
redisPipeline.zadd(`reversi:matchSpecific:${targetUser.id}`, Date.now(), me.id);
|
||||
redisPipeline.expire(`reversi:matchSpecific:${targetUser.id}`, 120, 'NX');
|
||||
await redisPipeline.exec();
|
||||
|
||||
this.globalEventService.publishReversiStream(targetUser.id, 'invited', {
|
||||
user: await this.userEntityService.pack(me, targetUser),
|
||||
});
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async matchAnyUser(me: MiUser): Promise<MiReversiGame | null> {
|
||||
public async matchAnyUser(me: MiUser, options: { noIrregularRules: boolean }, multiple = false): Promise<MiReversiGame | null> {
|
||||
if (!multiple) {
|
||||
// 既にマッチしている対局が無いか探す(3分以内)
|
||||
const games = await this.reversiGamesRepository.find({
|
||||
where: [
|
||||
{ id: MoreThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user1Id: me.id, isStarted: false },
|
||||
{ id: MoreThan(this.idService.gen(Date.now() - 1000 * 60 * 3)), user2Id: me.id, isStarted: false },
|
||||
],
|
||||
relations: ['user1', 'user2'],
|
||||
order: { id: 'DESC' },
|
||||
});
|
||||
if (games.length > 0) {
|
||||
return games[0];
|
||||
}
|
||||
}
|
||||
|
||||
//#region まず自分宛ての招待を探す
|
||||
const invitations = await this.redisClient.zrange(
|
||||
`reversi:matchSpecific:${me.id}`,
|
||||
Date.now() - MATCHING_TIMEOUT_MS,
|
||||
Date.now() - INVITATION_TIMEOUT_MS,
|
||||
'+inf',
|
||||
'BYSCORE');
|
||||
|
||||
@@ -147,23 +168,9 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||
const invitorId = invitations[Math.floor(Math.random() * invitations.length)];
|
||||
await this.redisClient.zrem(`reversi:matchSpecific:${me.id}`, invitorId);
|
||||
|
||||
const game = await this.reversiGamesRepository.insert({
|
||||
id: this.idService.gen(),
|
||||
user1Id: invitorId,
|
||||
user2Id: me.id,
|
||||
user1Ready: false,
|
||||
user2Ready: false,
|
||||
isStarted: false,
|
||||
isEnded: false,
|
||||
logs: [],
|
||||
map: Reversi.maps.eighteight.data,
|
||||
bw: 'random',
|
||||
isLlotheo: false,
|
||||
}).then(x => this.reversiGamesRepository.findOneByOrFail(x.identifiers[0]));
|
||||
this.cacheGame(game);
|
||||
|
||||
const packed = await this.reversiGameEntityService.packDetail(game, { id: invitorId });
|
||||
this.globalEventService.publishReversiStream(invitorId, 'matched', { game: packed });
|
||||
const game = await this.matched(invitorId, me.id, {
|
||||
noIrregularRules: false,
|
||||
});
|
||||
|
||||
return game;
|
||||
}
|
||||
@@ -171,39 +178,35 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||
|
||||
const matchings = await this.redisClient.zrange(
|
||||
'reversi:matchAny',
|
||||
Date.now() - MATCHING_TIMEOUT_MS,
|
||||
'+inf',
|
||||
'BYSCORE');
|
||||
0,
|
||||
2, // 自分自身のIDが入っている場合もあるので2つ取得
|
||||
'REV');
|
||||
|
||||
const userIds = matchings.filter(id => id !== me.id);
|
||||
const items = matchings.filter(id => !id.startsWith(me.id));
|
||||
|
||||
if (userIds.length > 0) {
|
||||
// pick random
|
||||
const matchedUserId = userIds[Math.floor(Math.random() * userIds.length)];
|
||||
if (items.length > 0) {
|
||||
const [matchedUserId, option] = items[0].split(':');
|
||||
|
||||
await this.redisClient.zrem('reversi:matchAny', me.id, matchedUserId);
|
||||
await this.redisClient.zrem('reversi:matchAny',
|
||||
me.id,
|
||||
matchedUserId,
|
||||
me.id + ':noIrregularRules',
|
||||
matchedUserId + ':noIrregularRules');
|
||||
|
||||
const game = await this.reversiGamesRepository.insert({
|
||||
id: this.idService.gen(),
|
||||
user1Id: matchedUserId,
|
||||
user2Id: me.id,
|
||||
user1Ready: false,
|
||||
user2Ready: false,
|
||||
isStarted: false,
|
||||
isEnded: false,
|
||||
logs: [],
|
||||
map: Reversi.maps.eighteight.data,
|
||||
bw: 'random',
|
||||
isLlotheo: false,
|
||||
}).then(x => this.reversiGamesRepository.findOneByOrFail(x.identifiers[0]));
|
||||
this.cacheGame(game);
|
||||
|
||||
const packed = await this.reversiGameEntityService.packDetail(game, { id: matchedUserId });
|
||||
this.globalEventService.publishReversiStream(matchedUserId, 'matched', { game: packed });
|
||||
const game = await this.matched(matchedUserId, me.id, {
|
||||
noIrregularRules: options.noIrregularRules || option === 'noIrregularRules',
|
||||
});
|
||||
|
||||
return game;
|
||||
} else {
|
||||
await this.redisClient.zadd('reversi:matchAny', Date.now(), me.id);
|
||||
const redisPipeline = this.redisClient.pipeline();
|
||||
if (options.noIrregularRules) {
|
||||
redisPipeline.zadd('reversi:matchAny', Date.now(), me.id + ':noIrregularRules');
|
||||
} else {
|
||||
redisPipeline.zadd('reversi:matchAny', Date.now(), me.id);
|
||||
}
|
||||
redisPipeline.expire('reversi:matchAny', 15, 'NX');
|
||||
await redisPipeline.exec();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -215,7 +218,15 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||
|
||||
@bindThis
|
||||
public async matchAnyUserCancel(user: MiUser) {
|
||||
await this.redisClient.zrem('reversi:matchAny', user.id);
|
||||
await this.redisClient.zrem('reversi:matchAny', user.id, user.id + ':noIrregularRules');
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async cleanOutdatedGames() {
|
||||
await this.reversiGamesRepository.delete({
|
||||
id: LessThan(this.idService.gen(Date.now() - 1000 * 60 * 10)),
|
||||
isStarted: false,
|
||||
});
|
||||
}
|
||||
|
||||
@bindThis
|
||||
@@ -268,6 +279,33 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||
}
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async matched(parentId: MiUser['id'], childId: MiUser['id'], options: { noIrregularRules: boolean; }): Promise<MiReversiGame> {
|
||||
const game = await this.reversiGamesRepository.insert({
|
||||
id: this.idService.gen(),
|
||||
user1Id: parentId,
|
||||
user2Id: childId,
|
||||
user1Ready: false,
|
||||
user2Ready: false,
|
||||
isStarted: false,
|
||||
isEnded: false,
|
||||
logs: [],
|
||||
map: Reversi.maps.eighteight.data,
|
||||
bw: 'random',
|
||||
isLlotheo: false,
|
||||
noIrregularRules: options.noIrregularRules,
|
||||
}).then(x => this.reversiGamesRepository.findOneOrFail({
|
||||
where: { id: x.identifiers[0].id },
|
||||
relations: ['user1', 'user2'],
|
||||
}));
|
||||
this.cacheGame(game);
|
||||
|
||||
const packed = await this.reversiGameEntityService.packDetail(game);
|
||||
this.globalEventService.publishReversiStream(parentId, 'matched', { game: packed });
|
||||
|
||||
return game;
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async startGame(game: MiReversiGame) {
|
||||
let bw: number;
|
||||
@@ -277,7 +315,13 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||
bw = parseInt(game.bw, 10);
|
||||
}
|
||||
|
||||
const crc32 = CRC32.str(JSON.stringify(game.logs)).toString();
|
||||
const engine = new Reversi.Game(game.map, {
|
||||
isLlotheo: game.isLlotheo,
|
||||
canPutEverywhere: game.canPutEverywhere,
|
||||
loopedBoard: game.loopedBoard,
|
||||
});
|
||||
|
||||
const crc32 = engine.calcCrc32().toString();
|
||||
|
||||
const updatedGame = await this.reversiGamesRepository.createQueryBuilder().update()
|
||||
.set({
|
||||
@@ -292,15 +336,12 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||
.returning('*')
|
||||
.execute()
|
||||
.then((response) => response.raw[0]);
|
||||
// キャッシュ効率化のためにユーザー情報は再利用
|
||||
updatedGame.user1 = game.user1;
|
||||
updatedGame.user2 = game.user2;
|
||||
this.cacheGame(updatedGame);
|
||||
|
||||
//#region 盤面に最初から石がないなどして始まった瞬間に勝敗が決定する場合があるのでその処理
|
||||
const engine = new Reversi.Game(updatedGame.map, {
|
||||
isLlotheo: updatedGame.isLlotheo,
|
||||
canPutEverywhere: updatedGame.canPutEverywhere,
|
||||
loopedBoard: updatedGame.loopedBoard,
|
||||
});
|
||||
|
||||
if (engine.isEnded) {
|
||||
let winnerId;
|
||||
if (engine.winner === true) {
|
||||
@@ -339,6 +380,9 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||
.returning('*')
|
||||
.execute()
|
||||
.then((response) => response.raw[0]);
|
||||
// キャッシュ効率化のためにユーザー情報は再利用
|
||||
updatedGame.user1 = game.user1;
|
||||
updatedGame.user2 = game.user2;
|
||||
this.cacheGame(updatedGame);
|
||||
|
||||
this.globalEventService.publishReversiGameStream(game.id, 'ended', {
|
||||
@@ -351,7 +395,7 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||
public async getInvitations(user: MiUser): Promise<MiUser['id'][]> {
|
||||
const invitations = await this.redisClient.zrange(
|
||||
`reversi:matchSpecific:${user.id}`,
|
||||
Date.now() - MATCHING_TIMEOUT_MS,
|
||||
Date.now() - INVITATION_TIMEOUT_MS,
|
||||
'+inf',
|
||||
'BYSCORE');
|
||||
return invitations;
|
||||
@@ -422,7 +466,7 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||
|
||||
const serializeLogs = Reversi.Serializer.serializeLogs(logs);
|
||||
|
||||
const crc32 = CRC32.str(JSON.stringify(serializeLogs)).toString();
|
||||
const crc32 = engine.calcCrc32().toString();
|
||||
|
||||
const updatedGame = {
|
||||
...game,
|
||||
@@ -508,14 +552,36 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||
public async get(id: MiReversiGame['id']): Promise<MiReversiGame | null> {
|
||||
const cached = await this.redisClient.get(`reversi:game:cache:${id}`);
|
||||
if (cached != null) {
|
||||
// TODO: この辺りのデシリアライズ処理をどこか別のサービスに切り出したい
|
||||
const parsed = JSON.parse(cached) as Serialized<MiReversiGame>;
|
||||
return {
|
||||
...parsed,
|
||||
startedAt: parsed.startedAt != null ? new Date(parsed.startedAt) : null,
|
||||
endedAt: parsed.endedAt != null ? new Date(parsed.endedAt) : null,
|
||||
user1: parsed.user1 != null ? {
|
||||
...parsed.user1,
|
||||
avatar: null,
|
||||
banner: null,
|
||||
updatedAt: parsed.user1.updatedAt != null ? new Date(parsed.user1.updatedAt) : null,
|
||||
lastActiveDate: parsed.user1.lastActiveDate != null ? new Date(parsed.user1.lastActiveDate) : null,
|
||||
lastFetchedAt: parsed.user1.lastFetchedAt != null ? new Date(parsed.user1.lastFetchedAt) : null,
|
||||
movedAt: parsed.user1.movedAt != null ? new Date(parsed.user1.movedAt) : null,
|
||||
} : null,
|
||||
user2: parsed.user2 != null ? {
|
||||
...parsed.user2,
|
||||
avatar: null,
|
||||
banner: null,
|
||||
updatedAt: parsed.user2.updatedAt != null ? new Date(parsed.user2.updatedAt) : null,
|
||||
lastActiveDate: parsed.user2.lastActiveDate != null ? new Date(parsed.user2.lastActiveDate) : null,
|
||||
lastFetchedAt: parsed.user2.lastFetchedAt != null ? new Date(parsed.user2.lastFetchedAt) : null,
|
||||
movedAt: parsed.user2.movedAt != null ? new Date(parsed.user2.movedAt) : null,
|
||||
} : null,
|
||||
};
|
||||
} else {
|
||||
const game = await this.reversiGamesRepository.findOneBy({ id });
|
||||
const game = await this.reversiGamesRepository.findOne({
|
||||
where: { id },
|
||||
relations: ['user1', 'user2'],
|
||||
});
|
||||
if (game == null) return null;
|
||||
|
||||
this.cacheGame(game);
|
||||
@@ -530,7 +596,7 @@ export class ReversiService implements OnApplicationShutdown, OnModuleInit {
|
||||
if (game == null) throw new Error('game not found');
|
||||
|
||||
if (crc32.toString() !== game.crc32) {
|
||||
return await this.reversiGameEntityService.packDetail(game);
|
||||
return game;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@@ -177,9 +177,11 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
|
||||
case 'userRoleAssigned': {
|
||||
const cached = this.roleAssignmentByUserIdCache.get(body.userId);
|
||||
if (cached) {
|
||||
cached.push({
|
||||
cached.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
|
||||
...body,
|
||||
expiresAt: body.expiresAt ? new Date(body.expiresAt) : null,
|
||||
user: null, // joinなカラムは通常取ってこないので
|
||||
role: null, // joinなカラムは通常取ってこないので
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
@@ -49,9 +49,10 @@ export class WebhookService implements OnApplicationShutdown {
|
||||
switch (type) {
|
||||
case 'webhookCreated':
|
||||
if (body.active) {
|
||||
this.webhooks.push({
|
||||
this.webhooks.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
|
||||
...body,
|
||||
latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null,
|
||||
user: null, // joinなカラムは通常取ってこないので
|
||||
});
|
||||
}
|
||||
break;
|
||||
@@ -59,14 +60,16 @@ export class WebhookService implements OnApplicationShutdown {
|
||||
if (body.active) {
|
||||
const i = this.webhooks.findIndex(a => a.id === body.id);
|
||||
if (i > -1) {
|
||||
this.webhooks[i] = {
|
||||
this.webhooks[i] = { // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
|
||||
...body,
|
||||
latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null,
|
||||
user: null, // joinなカラムは通常取ってこないので
|
||||
};
|
||||
} else {
|
||||
this.webhooks.push({
|
||||
this.webhooks.push({ // TODO: このあたりのデシリアライズ処理は各modelファイル内に関数としてexportしたい
|
||||
...body,
|
||||
latestSentAt: body.latestSentAt ? new Date(body.latestSentAt) : null,
|
||||
user: null, // joinなカラムは通常取ってこないので
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
@@ -94,6 +94,29 @@ type ToJsonSchema<S> = {
|
||||
};
|
||||
|
||||
export function getJsonSchema<S extends Schema>(schema: S): ToJsonSchema<Unflatten<ChartResult<S>>> {
|
||||
const unflatten = (str: string, parent: Record<string, any>) => {
|
||||
const keys = str.split('.');
|
||||
const key = keys.shift();
|
||||
const nextKey = keys[0];
|
||||
|
||||
if (key == null) return;
|
||||
|
||||
if (parent.properties[key] == null) {
|
||||
parent.properties[key] = nextKey ? {
|
||||
type: 'object',
|
||||
properties: {},
|
||||
required: [],
|
||||
} : {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'number',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
if (nextKey) unflatten(keys.join('.'), parent.properties[key] as Record<string, any>);
|
||||
};
|
||||
|
||||
const jsonSchema = {
|
||||
type: 'object',
|
||||
properties: {} as Record<string, unknown>,
|
||||
@@ -101,10 +124,7 @@ export function getJsonSchema<S extends Schema>(schema: S): ToJsonSchema<Unflatt
|
||||
};
|
||||
|
||||
for (const k in schema) {
|
||||
jsonSchema.properties[k] = {
|
||||
type: 'array',
|
||||
items: { type: 'number' },
|
||||
};
|
||||
unflatten(k, jsonSchema);
|
||||
}
|
||||
|
||||
return jsonSchema as ToJsonSchema<Unflatten<ChartResult<S>>>;
|
||||
|
@@ -164,7 +164,7 @@ export class NoteEntityService implements OnModuleInit {
|
||||
|
||||
return {
|
||||
multiple: poll.multiple,
|
||||
expiresAt: poll.expiresAt,
|
||||
expiresAt: poll.expiresAt?.toISOString() ?? null,
|
||||
choices,
|
||||
};
|
||||
}
|
||||
|
@@ -9,7 +9,6 @@ import type { ReversiGamesRepository } from '@/models/_.js';
|
||||
import { awaitAll } from '@/misc/prelude/await-all.js';
|
||||
import type { Packed } from '@/misc/json-schema.js';
|
||||
import type { } from '@/models/Blocking.js';
|
||||
import type { MiUser } from '@/models/User.js';
|
||||
import type { MiReversiGame } from '@/models/ReversiGame.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { IdService } from '@/core/IdService.js';
|
||||
@@ -29,10 +28,14 @@ export class ReversiGameEntityService {
|
||||
@bindThis
|
||||
public async packDetail(
|
||||
src: MiReversiGame['id'] | MiReversiGame,
|
||||
me?: { id: MiUser['id'] } | null | undefined,
|
||||
): Promise<Packed<'ReversiGameDetailed'>> {
|
||||
const game = typeof src === 'object' ? src : await this.reversiGamesRepository.findOneByOrFail({ id: src });
|
||||
|
||||
const users = await Promise.all([
|
||||
this.userEntityService.pack(game.user1 ?? game.user1Id),
|
||||
this.userEntityService.pack(game.user2 ?? game.user2Id),
|
||||
]);
|
||||
|
||||
return await awaitAll({
|
||||
id: game.id,
|
||||
createdAt: this.idService.parse(game.id).date.toISOString(),
|
||||
@@ -46,10 +49,10 @@ export class ReversiGameEntityService {
|
||||
user2Ready: game.user2Ready,
|
||||
user1Id: game.user1Id,
|
||||
user2Id: game.user2Id,
|
||||
user1: this.userEntityService.pack(game.user1Id, me),
|
||||
user2: this.userEntityService.pack(game.user2Id, me),
|
||||
user1: users[0],
|
||||
user2: users[1],
|
||||
winnerId: game.winnerId,
|
||||
winner: game.winnerId ? this.userEntityService.pack(game.winnerId, me) : null,
|
||||
winner: game.winnerId ? users.find(u => u.id === game.winnerId)! : null,
|
||||
surrenderedUserId: game.surrenderedUserId,
|
||||
timeoutUserId: game.timeoutUserId,
|
||||
black: game.black,
|
||||
@@ -58,6 +61,7 @@ export class ReversiGameEntityService {
|
||||
canPutEverywhere: game.canPutEverywhere,
|
||||
loopedBoard: game.loopedBoard,
|
||||
timeLimitForEachTurn: game.timeLimitForEachTurn,
|
||||
noIrregularRules: game.noIrregularRules,
|
||||
logs: game.logs,
|
||||
map: game.map,
|
||||
});
|
||||
@@ -66,18 +70,21 @@ export class ReversiGameEntityService {
|
||||
@bindThis
|
||||
public packDetailMany(
|
||||
xs: MiReversiGame[],
|
||||
me?: { id: MiUser['id'] } | null | undefined,
|
||||
) {
|
||||
return Promise.all(xs.map(x => this.packDetail(x, me)));
|
||||
return Promise.all(xs.map(x => this.packDetail(x)));
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async packLite(
|
||||
src: MiReversiGame['id'] | MiReversiGame,
|
||||
me?: { id: MiUser['id'] } | null | undefined,
|
||||
): Promise<Packed<'ReversiGameLite'>> {
|
||||
const game = typeof src === 'object' ? src : await this.reversiGamesRepository.findOneByOrFail({ id: src });
|
||||
|
||||
const users = await Promise.all([
|
||||
this.userEntityService.pack(game.user1 ?? game.user1Id),
|
||||
this.userEntityService.pack(game.user2 ?? game.user2Id),
|
||||
]);
|
||||
|
||||
return await awaitAll({
|
||||
id: game.id,
|
||||
createdAt: this.idService.parse(game.id).date.toISOString(),
|
||||
@@ -85,16 +92,12 @@ export class ReversiGameEntityService {
|
||||
endedAt: game.endedAt && game.endedAt.toISOString(),
|
||||
isStarted: game.isStarted,
|
||||
isEnded: game.isEnded,
|
||||
form1: game.form1,
|
||||
form2: game.form2,
|
||||
user1Ready: game.user1Ready,
|
||||
user2Ready: game.user2Ready,
|
||||
user1Id: game.user1Id,
|
||||
user2Id: game.user2Id,
|
||||
user1: this.userEntityService.pack(game.user1Id, me),
|
||||
user2: this.userEntityService.pack(game.user2Id, me),
|
||||
user1: users[0],
|
||||
user2: users[1],
|
||||
winnerId: game.winnerId,
|
||||
winner: game.winnerId ? this.userEntityService.pack(game.winnerId, me) : null,
|
||||
winner: game.winnerId ? users.find(u => u.id === game.winnerId)! : null,
|
||||
surrenderedUserId: game.surrenderedUserId,
|
||||
timeoutUserId: game.timeoutUserId,
|
||||
black: game.black,
|
||||
@@ -103,15 +106,15 @@ export class ReversiGameEntityService {
|
||||
canPutEverywhere: game.canPutEverywhere,
|
||||
loopedBoard: game.loopedBoard,
|
||||
timeLimitForEachTurn: game.timeLimitForEachTurn,
|
||||
noIrregularRules: game.noIrregularRules,
|
||||
});
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public packLiteMany(
|
||||
xs: MiReversiGame[],
|
||||
me?: { id: MiUser['id'] } | null | undefined,
|
||||
) {
|
||||
return Promise.all(xs.map(x => this.packLite(x, me)));
|
||||
return Promise.all(xs.map(x => this.packLite(x)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
// structredCloneが遅いため
|
||||
// SEE: http://var.blog.jp/archives/86038606.html
|
||||
|
||||
type Cloneable = string | number | boolean | null | { [key: string]: Cloneable } | Cloneable[];
|
||||
type Cloneable = string | number | boolean | null | undefined | { [key: string]: Cloneable } | Cloneable[];
|
||||
|
||||
export function deepClone<T extends Cloneable>(x: T): T {
|
||||
if (typeof x === 'object') {
|
||||
@@ -14,7 +14,7 @@ export function deepClone<T extends Cloneable>(x: T): T {
|
||||
if (Array.isArray(x)) return x.map(deepClone) as T;
|
||||
const obj = {} as Record<string, Cloneable>;
|
||||
for (const [k, v] of Object.entries(x)) {
|
||||
obj[k] = deepClone(v);
|
||||
obj[k] = v === undefined ? undefined : deepClone(v);
|
||||
}
|
||||
return obj as T;
|
||||
} else {
|
||||
|
@@ -25,7 +25,7 @@ import { packedBlockingSchema } from '@/models/json-schema/blocking.js';
|
||||
import { packedNoteReactionSchema } from '@/models/json-schema/note-reaction.js';
|
||||
import { packedHashtagSchema } from '@/models/json-schema/hashtag.js';
|
||||
import { packedInviteCodeSchema } from '@/models/json-schema/invite-code.js';
|
||||
import { packedPageSchema } from '@/models/json-schema/page.js';
|
||||
import { packedPageSchema, packedPageBlockSchema } from '@/models/json-schema/page.js';
|
||||
import { packedNoteFavoriteSchema } from '@/models/json-schema/note-favorite.js';
|
||||
import { packedChannelSchema } from '@/models/json-schema/channel.js';
|
||||
import { packedAntennaSchema } from '@/models/json-schema/antenna.js';
|
||||
@@ -37,7 +37,7 @@ import { packedEmojiDetailedSchema, packedEmojiSimpleSchema } from '@/models/jso
|
||||
import { packedFlashSchema } from '@/models/json-schema/flash.js';
|
||||
import { packedAnnouncementSchema } from '@/models/json-schema/announcement.js';
|
||||
import { packedSigninSchema } from '@/models/json-schema/signin.js';
|
||||
import { packedRoleLiteSchema, packedRoleSchema } from '@/models/json-schema/role.js';
|
||||
import { packedRoleLiteSchema, packedRoleSchema, packedRolePoliciesSchema } from '@/models/json-schema/role.js';
|
||||
import { packedAdSchema } from '@/models/json-schema/ad.js';
|
||||
import { packedReversiGameLiteSchema, packedReversiGameDetailedSchema } from '@/models/json-schema/reversi-game.js';
|
||||
|
||||
@@ -67,6 +67,7 @@ export const refs = {
|
||||
Hashtag: packedHashtagSchema,
|
||||
InviteCode: packedInviteCodeSchema,
|
||||
Page: packedPageSchema,
|
||||
PageBlock: packedPageBlockSchema,
|
||||
Channel: packedChannelSchema,
|
||||
QueueCount: packedQueueCountSchema,
|
||||
Antenna: packedAntennaSchema,
|
||||
@@ -79,12 +80,16 @@ export const refs = {
|
||||
Signin: packedSigninSchema,
|
||||
RoleLite: packedRoleLiteSchema,
|
||||
Role: packedRoleSchema,
|
||||
RolePolicies: packedRolePoliciesSchema,
|
||||
ReversiGameLite: packedReversiGameLiteSchema,
|
||||
ReversiGameDetailed: packedReversiGameDetailedSchema,
|
||||
};
|
||||
|
||||
export type Packed<x extends keyof typeof refs> = SchemaType<typeof refs[x]>;
|
||||
|
||||
export type KeyOf<x extends keyof typeof refs> = PropertiesToUnion<typeof refs[x]>;
|
||||
type PropertiesToUnion<p extends Schema> = p['properties'] extends NonNullable<Obj> ? keyof p['properties'] : never;
|
||||
|
||||
type TypeStringef = 'null' | 'boolean' | 'integer' | 'number' | 'string' | 'array' | 'object' | 'any';
|
||||
type StringDefToType<T extends TypeStringef> =
|
||||
T extends 'null' ? null :
|
||||
|
@@ -38,7 +38,7 @@ export class MiAnnouncement {
|
||||
length: 256, nullable: false,
|
||||
default: 'info',
|
||||
})
|
||||
public icon: string;
|
||||
public icon: 'info' | 'warning' | 'error' | 'success';
|
||||
|
||||
// normal ... お知らせページ掲載
|
||||
// banner ... お知らせページ掲載 + バナー表示
|
||||
@@ -47,7 +47,7 @@ export class MiAnnouncement {
|
||||
length: 256, nullable: false,
|
||||
default: 'normal',
|
||||
})
|
||||
public display: string;
|
||||
public display: 'normal' | 'banner' | 'dialog';
|
||||
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
|
@@ -106,6 +106,11 @@ export class MiReversiGame {
|
||||
})
|
||||
public bw: string;
|
||||
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
})
|
||||
public noIrregularRules: boolean;
|
||||
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
})
|
||||
|
@@ -37,10 +37,12 @@ export const packedAnnouncementSchema = {
|
||||
icon: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['info', 'warning', 'error', 'success'],
|
||||
},
|
||||
display: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['dialog', 'normal', 'banner'],
|
||||
},
|
||||
needConfirmationToRead: {
|
||||
type: 'boolean',
|
||||
|
@@ -69,6 +69,7 @@ export const packedNoteSchema = {
|
||||
visibility: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['public', 'home', 'followers', 'specified'],
|
||||
},
|
||||
mentions: {
|
||||
type: 'array',
|
||||
@@ -117,6 +118,48 @@ export const packedNoteSchema = {
|
||||
poll: {
|
||||
type: 'object',
|
||||
optional: true, nullable: true,
|
||||
properties: {
|
||||
expiresAt: {
|
||||
type: 'string',
|
||||
optional: true, nullable: true,
|
||||
format: 'date-time',
|
||||
},
|
||||
multiple: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
choices: {
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
properties: {
|
||||
isVoted: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
text: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
votes: {
|
||||
type: 'number',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
emojis: {
|
||||
type: 'object',
|
||||
optional: true, nullable: false,
|
||||
additionalProperties: {
|
||||
anyOf: [{
|
||||
type: 'string',
|
||||
}],
|
||||
},
|
||||
},
|
||||
channelId: {
|
||||
type: 'string',
|
||||
@@ -162,9 +205,23 @@ export const packedNoteSchema = {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
reactionEmojis: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
additionalProperties: {
|
||||
anyOf: [{
|
||||
type: 'string',
|
||||
}],
|
||||
},
|
||||
},
|
||||
reactions: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
additionalProperties: {
|
||||
anyOf: [{
|
||||
type: 'number',
|
||||
}],
|
||||
},
|
||||
},
|
||||
renoteCount: {
|
||||
type: 'number',
|
||||
@@ -196,7 +253,7 @@ export const packedNoteSchema = {
|
||||
},
|
||||
|
||||
myReaction: {
|
||||
type: 'object',
|
||||
type: 'string',
|
||||
optional: true, nullable: true,
|
||||
},
|
||||
},
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
import { notificationTypes } from '@/types.js';
|
||||
|
||||
export const packedNotificationSchema = {
|
||||
const baseSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {
|
||||
@@ -23,68 +23,368 @@ export const packedNotificationSchema = {
|
||||
optional: false, nullable: false,
|
||||
enum: [...notificationTypes, 'reaction:grouped', 'renote:grouped'],
|
||||
},
|
||||
user: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: true, nullable: true,
|
||||
},
|
||||
userId: {
|
||||
type: 'string',
|
||||
optional: true, nullable: true,
|
||||
format: 'id',
|
||||
},
|
||||
note: {
|
||||
type: 'object',
|
||||
ref: 'Note',
|
||||
optional: true, nullable: true,
|
||||
},
|
||||
reaction: {
|
||||
type: 'string',
|
||||
optional: true, nullable: true,
|
||||
},
|
||||
achievement: {
|
||||
type: 'string',
|
||||
optional: true, nullable: false,
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
optional: true, nullable: true,
|
||||
},
|
||||
header: {
|
||||
type: 'string',
|
||||
optional: true, nullable: true,
|
||||
},
|
||||
icon: {
|
||||
type: 'string',
|
||||
optional: true, nullable: true,
|
||||
},
|
||||
reactions: {
|
||||
type: 'array',
|
||||
optional: true, nullable: true,
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
user: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
reaction: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
required: ['user', 'reaction'],
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const packedNotificationSchema = {
|
||||
type: 'object',
|
||||
oneOf: [{
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['note'],
|
||||
},
|
||||
},
|
||||
users: {
|
||||
type: 'array',
|
||||
optional: true, nullable: true,
|
||||
items: {
|
||||
user: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
userId: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
format: 'id',
|
||||
},
|
||||
note: {
|
||||
type: 'object',
|
||||
ref: 'Note',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['mention'],
|
||||
},
|
||||
user: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
userId: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
format: 'id',
|
||||
},
|
||||
note: {
|
||||
type: 'object',
|
||||
ref: 'Note',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['reply'],
|
||||
},
|
||||
user: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
userId: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
format: 'id',
|
||||
},
|
||||
note: {
|
||||
type: 'object',
|
||||
ref: 'Note',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['renote'],
|
||||
},
|
||||
user: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
userId: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
format: 'id',
|
||||
},
|
||||
note: {
|
||||
type: 'object',
|
||||
ref: 'Note',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['quote'],
|
||||
},
|
||||
user: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
userId: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
format: 'id',
|
||||
},
|
||||
note: {
|
||||
type: 'object',
|
||||
ref: 'Note',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['reaction'],
|
||||
},
|
||||
user: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
userId: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
format: 'id',
|
||||
},
|
||||
note: {
|
||||
type: 'object',
|
||||
ref: 'Note',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
reaction: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['pollEnded'],
|
||||
},
|
||||
user: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
userId: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
format: 'id',
|
||||
},
|
||||
note: {
|
||||
type: 'object',
|
||||
ref: 'Note',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['follow'],
|
||||
},
|
||||
user: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
userId: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
format: 'id',
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['receiveFollowRequest'],
|
||||
},
|
||||
user: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
userId: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
format: 'id',
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['followRequestAccepted'],
|
||||
},
|
||||
user: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
userId: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
format: 'id',
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['roleAssigned'],
|
||||
},
|
||||
role: {
|
||||
type: 'object',
|
||||
ref: 'Role',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['achievementEarned'],
|
||||
},
|
||||
achievement: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['app'],
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
header: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
icon: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['reaction:grouped'],
|
||||
},
|
||||
note: {
|
||||
type: 'object',
|
||||
ref: 'Note',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
reactions: {
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
user: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
reaction: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
required: ['user', 'reaction'],
|
||||
},
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['renote:grouped'],
|
||||
},
|
||||
note: {
|
||||
type: 'object',
|
||||
ref: 'Note',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
users: {
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object',
|
||||
ref: 'UserLite',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}, {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...baseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['test'],
|
||||
},
|
||||
},
|
||||
}],
|
||||
} as const;
|
||||
|
@@ -3,6 +3,107 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
const blockBaseSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
const textBlockSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...blockBaseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['text'],
|
||||
},
|
||||
text: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
const sectionBlockSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...blockBaseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['section'],
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
children: {
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'PageBlock',
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
const imageBlockSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...blockBaseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['image'],
|
||||
},
|
||||
fileId: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
const noteBlockSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
...blockBaseSchema.properties,
|
||||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: ['note'],
|
||||
},
|
||||
detailed: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
note: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const packedPageBlockSchema = {
|
||||
type: 'object',
|
||||
oneOf: [
|
||||
textBlockSchema,
|
||||
sectionBlockSchema,
|
||||
imageBlockSchema,
|
||||
noteBlockSchema,
|
||||
],
|
||||
} as const;
|
||||
|
||||
export const packedPageSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
@@ -38,6 +139,7 @@ export const packedPageSchema = {
|
||||
items: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'PageBlock',
|
||||
},
|
||||
},
|
||||
variables: {
|
||||
|
@@ -34,22 +34,6 @@ export const packedReversiGameLiteSchema = {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
form1: {
|
||||
type: 'any',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
form2: {
|
||||
type: 'any',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
user1Ready: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
user2Ready: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
user1Id: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
@@ -98,6 +82,10 @@ export const packedReversiGameLiteSchema = {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
noIrregularRules: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
isLlotheo: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
@@ -149,11 +137,11 @@ export const packedReversiGameDetailedSchema = {
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
form1: {
|
||||
type: 'any',
|
||||
type: 'object',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
form2: {
|
||||
type: 'any',
|
||||
type: 'object',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
user1Ready: {
|
||||
@@ -212,6 +200,10 @@ export const packedReversiGameDetailedSchema = {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
noIrregularRules: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
isLlotheo: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
|
@@ -1,26 +1,103 @@
|
||||
const rolePolicyValue = {
|
||||
export const packedRolePoliciesSchema = {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
properties: {
|
||||
value: {
|
||||
oneOf: [
|
||||
{
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
{
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
],
|
||||
gtlAvailable: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
priority: {
|
||||
ltlAvailable: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
canPublicNote: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
canInvite: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
inviteLimit: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
useDefault: {
|
||||
inviteLimitCycle: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
inviteExpirationTime: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
canManageCustomEmojis: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
canManageAvatarDecorations: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
canSearchNotes: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
canUseTranslator: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
canHideAds: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
driveCapacityMb: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
alwaysMarkNsfw: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
pinLimit: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
antennaLimit: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
wordMuteLimit: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
webhookLimit: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
clipLimit: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
noteEachClipsLimit: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
userListLimit: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
userEachUserListsLimit: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
rateLimitFactor: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
avatarDecorationLimit: {
|
||||
type: 'integer',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
@@ -121,31 +198,28 @@ export const packedRoleSchema = {
|
||||
policies: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
properties: {
|
||||
pinLimit: rolePolicyValue,
|
||||
canInvite: rolePolicyValue,
|
||||
clipLimit: rolePolicyValue,
|
||||
canHideAds: rolePolicyValue,
|
||||
inviteLimit: rolePolicyValue,
|
||||
antennaLimit: rolePolicyValue,
|
||||
gtlAvailable: rolePolicyValue,
|
||||
ltlAvailable: rolePolicyValue,
|
||||
webhookLimit: rolePolicyValue,
|
||||
canPublicNote: rolePolicyValue,
|
||||
userListLimit: rolePolicyValue,
|
||||
wordMuteLimit: rolePolicyValue,
|
||||
alwaysMarkNsfw: rolePolicyValue,
|
||||
canSearchNotes: rolePolicyValue,
|
||||
driveCapacityMb: rolePolicyValue,
|
||||
rateLimitFactor: rolePolicyValue,
|
||||
inviteLimitCycle: rolePolicyValue,
|
||||
noteEachClipsLimit: rolePolicyValue,
|
||||
inviteExpirationTime: rolePolicyValue,
|
||||
canManageCustomEmojis: rolePolicyValue,
|
||||
userEachUserListsLimit: rolePolicyValue,
|
||||
canManageAvatarDecorations: rolePolicyValue,
|
||||
canUseTranslator: rolePolicyValue,
|
||||
avatarDecorationLimit: rolePolicyValue,
|
||||
additionalProperties: {
|
||||
anyOf: [{
|
||||
type: 'object',
|
||||
properties: {
|
||||
value: {
|
||||
oneOf: [
|
||||
{
|
||||
type: 'integer',
|
||||
},
|
||||
{
|
||||
type: 'boolean',
|
||||
},
|
||||
],
|
||||
},
|
||||
priority: {
|
||||
type: 'integer',
|
||||
},
|
||||
useDefault: {
|
||||
type: 'boolean',
|
||||
},
|
||||
},
|
||||
}],
|
||||
},
|
||||
},
|
||||
usersCount: {
|
||||
|
@@ -590,104 +590,7 @@ export const packedMeDetailedOnlySchema = {
|
||||
policies: {
|
||||
type: 'object',
|
||||
nullable: false, optional: false,
|
||||
properties: {
|
||||
gtlAvailable: {
|
||||
type: 'boolean',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
ltlAvailable: {
|
||||
type: 'boolean',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
canPublicNote: {
|
||||
type: 'boolean',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
canInvite: {
|
||||
type: 'boolean',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
inviteLimit: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
inviteLimitCycle: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
inviteExpirationTime: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
canManageCustomEmojis: {
|
||||
type: 'boolean',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
canManageAvatarDecorations: {
|
||||
type: 'boolean',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
canSearchNotes: {
|
||||
type: 'boolean',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
canUseTranslator: {
|
||||
type: 'boolean',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
canHideAds: {
|
||||
type: 'boolean',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
driveCapacityMb: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
alwaysMarkNsfw: {
|
||||
type: 'boolean',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
pinLimit: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
antennaLimit: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
wordMuteLimit: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
webhookLimit: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
clipLimit: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
noteEachClipsLimit: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
userListLimit: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
userEachUserListsLimit: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
rateLimitFactor: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
avatarDecorationLimit: {
|
||||
type: 'number',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
},
|
||||
ref: 'RolePolicies',
|
||||
},
|
||||
//#region secrets
|
||||
email: {
|
||||
|
@@ -283,9 +283,9 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
||||
}, {
|
||||
...baseQueueOptions(this.config, QUEUE.RELATIONSHIP),
|
||||
autorun: false,
|
||||
concurrency: this.config.relashionshipJobConcurrency ?? 16,
|
||||
concurrency: this.config.relationshipJobConcurrency ?? 16,
|
||||
limiter: {
|
||||
max: this.config.relashionshipJobPerSec ?? 64,
|
||||
max: this.config.relationshipJobPerSec ?? 64,
|
||||
duration: 1000,
|
||||
},
|
||||
});
|
||||
|
@@ -11,6 +11,7 @@ import type Logger from '@/logger.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { IdService } from '@/core/IdService.js';
|
||||
import type { Config } from '@/config.js';
|
||||
import { ReversiService } from '@/core/ReversiService.js';
|
||||
import { QueueLoggerService } from '../QueueLoggerService.js';
|
||||
import type * as Bull from 'bullmq';
|
||||
|
||||
@@ -32,6 +33,7 @@ export class CleanProcessorService {
|
||||
private roleAssignmentsRepository: RoleAssignmentsRepository,
|
||||
|
||||
private queueLoggerService: QueueLoggerService,
|
||||
private reversiService: ReversiService,
|
||||
private idService: IdService,
|
||||
) {
|
||||
this.logger = this.queueLoggerService.logger.createSubLogger('clean');
|
||||
@@ -65,6 +67,8 @@ export class CleanProcessorService {
|
||||
});
|
||||
}
|
||||
|
||||
this.reversiService.cleanOutdatedGames();
|
||||
|
||||
this.logger.succ('Cleaned.');
|
||||
}
|
||||
}
|
||||
|
@@ -372,6 +372,7 @@ import * as ep___reversi_match from './endpoints/reversi/match.js';
|
||||
import * as ep___reversi_invitations from './endpoints/reversi/invitations.js';
|
||||
import * as ep___reversi_showGame from './endpoints/reversi/show-game.js';
|
||||
import * as ep___reversi_surrender from './endpoints/reversi/surrender.js';
|
||||
import * as ep___reversi_verify from './endpoints/reversi/verify.js';
|
||||
import { GetterService } from './GetterService.js';
|
||||
import { ApiLoggerService } from './ApiLoggerService.js';
|
||||
import type { Provider } from '@nestjs/common';
|
||||
@@ -742,6 +743,7 @@ const $reversi_match: Provider = { provide: 'ep:reversi/match', useClass: ep___r
|
||||
const $reversi_invitations: Provider = { provide: 'ep:reversi/invitations', useClass: ep___reversi_invitations.default };
|
||||
const $reversi_showGame: Provider = { provide: 'ep:reversi/show-game', useClass: ep___reversi_showGame.default };
|
||||
const $reversi_surrender: Provider = { provide: 'ep:reversi/surrender', useClass: ep___reversi_surrender.default };
|
||||
const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep___reversi_verify.default };
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
@@ -1116,6 +1118,7 @@ const $reversi_surrender: Provider = { provide: 'ep:reversi/surrender', useClass
|
||||
$reversi_invitations,
|
||||
$reversi_showGame,
|
||||
$reversi_surrender,
|
||||
$reversi_verify,
|
||||
],
|
||||
exports: [
|
||||
$admin_meta,
|
||||
@@ -1481,6 +1484,7 @@ const $reversi_surrender: Provider = { provide: 'ep:reversi/surrender', useClass
|
||||
$reversi_invitations,
|
||||
$reversi_showGame,
|
||||
$reversi_surrender,
|
||||
$reversi_verify,
|
||||
],
|
||||
})
|
||||
export class EndpointsModule {}
|
||||
|
@@ -4,8 +4,7 @@
|
||||
*/
|
||||
|
||||
import { permissions } from 'misskey-js';
|
||||
import type { Schema } from '@/misc/json-schema.js';
|
||||
import { RolePolicies } from '@/core/RoleService.js';
|
||||
import type { KeyOf, Schema } from '@/misc/json-schema.js';
|
||||
|
||||
import * as ep___admin_meta from './endpoints/admin/meta.js';
|
||||
import * as ep___admin_abuseUserReports from './endpoints/admin/abuse-user-reports.js';
|
||||
@@ -373,6 +372,7 @@ import * as ep___reversi_match from './endpoints/reversi/match.js';
|
||||
import * as ep___reversi_invitations from './endpoints/reversi/invitations.js';
|
||||
import * as ep___reversi_showGame from './endpoints/reversi/show-game.js';
|
||||
import * as ep___reversi_surrender from './endpoints/reversi/surrender.js';
|
||||
import * as ep___reversi_verify from './endpoints/reversi/verify.js';
|
||||
|
||||
const eps = [
|
||||
['admin/meta', ep___admin_meta],
|
||||
@@ -741,6 +741,7 @@ const eps = [
|
||||
['reversi/invitations', ep___reversi_invitations],
|
||||
['reversi/show-game', ep___reversi_showGame],
|
||||
['reversi/surrender', ep___reversi_surrender],
|
||||
['reversi/verify', ep___reversi_verify],
|
||||
];
|
||||
|
||||
interface IEndpointMetaBase {
|
||||
@@ -774,7 +775,7 @@ interface IEndpointMetaBase {
|
||||
*/
|
||||
readonly requireAdmin?: boolean;
|
||||
|
||||
readonly requireRolePolicy?: keyof RolePolicies;
|
||||
readonly requireRolePolicy?: KeyOf<'RolePolicies'>;
|
||||
|
||||
/**
|
||||
* 引っ越し済みのユーザーによるリクエストを禁止するか
|
||||
|
@@ -303,6 +303,11 @@ export const meta = {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
policies: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'RolePolicies',
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
@@ -14,6 +14,32 @@ export const meta = {
|
||||
requireCredential: false,
|
||||
|
||||
res: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
createdAt: {
|
||||
type: 'string',
|
||||
format: 'date-time',
|
||||
},
|
||||
users: {
|
||||
type: 'number',
|
||||
},
|
||||
data: {
|
||||
type: 'object',
|
||||
additionalProperties: {
|
||||
anyOf: [{
|
||||
type: 'number',
|
||||
}],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: [
|
||||
'createdAt',
|
||||
'users',
|
||||
'data',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
allowGet: true,
|
||||
|
@@ -43,7 +43,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
const query = this.queryService.makePaginationQuery(this.reversiGamesRepository.createQueryBuilder('game'), ps.sinceId, ps.untilId)
|
||||
.andWhere('game.isStarted = TRUE');
|
||||
.innerJoinAndSelect('game.user1', 'user1')
|
||||
.innerJoinAndSelect('game.user2', 'user2');
|
||||
|
||||
if (ps.my && me) {
|
||||
query.andWhere(new Brackets(qb => {
|
||||
@@ -51,11 +52,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
.where('game.user1Id = :userId', { userId: me.id })
|
||||
.orWhere('game.user2Id = :userId', { userId: me.id });
|
||||
}));
|
||||
} else {
|
||||
query.andWhere('game.isStarted = TRUE');
|
||||
}
|
||||
|
||||
const games = await query.take(ps.limit).getMany();
|
||||
|
||||
return await this.reversiGameEntityService.packLiteMany(games, me);
|
||||
return await this.reversiGameEntityService.packLiteMany(games);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -37,6 +37,8 @@ export const paramDef = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
userId: { type: 'string', format: 'misskey:id', nullable: true },
|
||||
noIrregularRules: { type: 'boolean', default: false },
|
||||
multiple: { type: 'boolean', default: false },
|
||||
},
|
||||
required: [],
|
||||
} as const;
|
||||
@@ -56,11 +58,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
throw err;
|
||||
}) : null;
|
||||
|
||||
const game = target ? await this.reversiService.matchSpecificUser(me, target) : await this.reversiService.matchAnyUser(me);
|
||||
const game = target
|
||||
? await this.reversiService.matchSpecificUser(me, target, ps.multiple)
|
||||
: await this.reversiService.matchAnyUser(me, { noIrregularRules: ps.noIrregularRules }, ps.multiple);
|
||||
|
||||
if (game == null) return;
|
||||
|
||||
return await this.reversiGameEntityService.packDetail(game, me);
|
||||
return await this.reversiGameEntityService.packDetail(game);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
throw new ApiError(meta.errors.noSuchGame);
|
||||
}
|
||||
|
||||
return await this.reversiGameEntityService.packDetail(game, me);
|
||||
return await this.reversiGameEntityService.packDetail(game);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
64
packages/backend/src/server/api/endpoints/reversi/verify.ts
Normal file
64
packages/backend/src/server/api/endpoints/reversi/verify.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
import { ReversiService } from '@/core/ReversiService.js';
|
||||
import { ReversiGameEntityService } from '@/core/entities/ReversiGameEntityService.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
|
||||
export const meta = {
|
||||
errors: {
|
||||
noSuchGame: {
|
||||
message: 'No such game.',
|
||||
code: 'NO_SUCH_GAME',
|
||||
id: '8fb05624-b525-43dd-90f7-511852bdfeee',
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
properties: {
|
||||
desynced: { type: 'boolean' },
|
||||
game: {
|
||||
type: 'object',
|
||||
optional: true, nullable: true,
|
||||
ref: 'ReversiGameDetailed',
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
gameId: { type: 'string', format: 'misskey:id' },
|
||||
crc32: { type: 'string' },
|
||||
},
|
||||
required: ['gameId', 'crc32'],
|
||||
} as const;
|
||||
|
||||
@Injectable()
|
||||
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
|
||||
constructor(
|
||||
private reversiService: ReversiService,
|
||||
private reversiGameEntityService: ReversiGameEntityService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
const game = await this.reversiService.checkCrc(ps.gameId, ps.crc32);
|
||||
if (game) {
|
||||
return {
|
||||
desynced: true,
|
||||
game: await this.reversiGameEntityService.packDetail(game),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
desynced: false,
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import type { MiReversiGame, ReversiGamesRepository } from '@/models/_.js';
|
||||
import type { MiReversiGame } from '@/models/_.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { ReversiService } from '@/core/ReversiService.js';
|
||||
@@ -19,7 +19,6 @@ class ReversiGameChannel extends Channel {
|
||||
|
||||
constructor(
|
||||
private reversiService: ReversiService,
|
||||
private reversiGamesRepository: ReversiGamesRepository,
|
||||
private reversiGameEntityService: ReversiGameEntityService,
|
||||
|
||||
id: string,
|
||||
@@ -42,7 +41,6 @@ class ReversiGameChannel extends Channel {
|
||||
case 'updateSettings': this.updateSettings(body.key, body.value); break;
|
||||
case 'cancel': this.cancelGame(); break;
|
||||
case 'putStone': this.putStone(body.pos, body.id); break;
|
||||
case 'checkState': this.checkState(body.crc32); break;
|
||||
case 'claimTimeIsUp': this.claimTimeIsUp(); break;
|
||||
}
|
||||
}
|
||||
@@ -75,16 +73,6 @@ class ReversiGameChannel extends Channel {
|
||||
this.reversiService.putStoneToGame(this.gameId!, this.user, pos, id);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async checkState(crc32: string | number) {
|
||||
if (crc32 != null) return;
|
||||
|
||||
const game = await this.reversiService.checkCrc(this.gameId!, crc32);
|
||||
if (game) {
|
||||
this.send('rescue', game);
|
||||
}
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async claimTimeIsUp() {
|
||||
if (this.user == null) return;
|
||||
@@ -106,9 +94,6 @@ export class ReversiGameChannelService implements MiChannelService<false> {
|
||||
public readonly kind = ReversiGameChannel.kind;
|
||||
|
||||
constructor(
|
||||
@Inject(DI.reversiGamesRepository)
|
||||
private reversiGamesRepository: ReversiGamesRepository,
|
||||
|
||||
private reversiService: ReversiService,
|
||||
private reversiGameEntityService: ReversiGameEntityService,
|
||||
) {
|
||||
@@ -118,7 +103,6 @@ export class ReversiGameChannelService implements MiChannelService<false> {
|
||||
public create(id: string, connection: Channel['connection']): ReversiGameChannel {
|
||||
return new ReversiGameChannel(
|
||||
this.reversiService,
|
||||
this.reversiGamesRepository,
|
||||
this.reversiGameEntityService,
|
||||
id,
|
||||
connection,
|
||||
|
@@ -31,12 +31,13 @@ import { PageEntityService } from '@/core/entities/PageEntityService.js';
|
||||
import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js';
|
||||
import { ClipEntityService } from '@/core/entities/ClipEntityService.js';
|
||||
import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js';
|
||||
import type { ChannelsRepository, ClipsRepository, FlashsRepository, GalleryPostsRepository, MiMeta, NotesRepository, PagesRepository, UserProfilesRepository, UsersRepository } from '@/models/_.js';
|
||||
import type { ChannelsRepository, ClipsRepository, FlashsRepository, GalleryPostsRepository, MiMeta, NotesRepository, PagesRepository, ReversiGamesRepository, UserProfilesRepository, UsersRepository } from '@/models/_.js';
|
||||
import type Logger from '@/logger.js';
|
||||
import { deepClone } from '@/misc/clone.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { FlashEntityService } from '@/core/entities/FlashEntityService.js';
|
||||
import { RoleService } from '@/core/RoleService.js';
|
||||
import { ReversiGameEntityService } from '@/core/entities/ReversiGameEntityService.js';
|
||||
import { FeedService } from './FeedService.js';
|
||||
import { UrlPreviewService } from './UrlPreviewService.js';
|
||||
import { ClientLoggerService } from './ClientLoggerService.js';
|
||||
@@ -83,6 +84,9 @@ export class ClientServerService {
|
||||
@Inject(DI.flashsRepository)
|
||||
private flashsRepository: FlashsRepository,
|
||||
|
||||
@Inject(DI.reversiGamesRepository)
|
||||
private reversiGamesRepository: ReversiGamesRepository,
|
||||
|
||||
private flashEntityService: FlashEntityService,
|
||||
private userEntityService: UserEntityService,
|
||||
private noteEntityService: NoteEntityService,
|
||||
@@ -90,6 +94,7 @@ export class ClientServerService {
|
||||
private galleryPostEntityService: GalleryPostEntityService,
|
||||
private clipEntityService: ClipEntityService,
|
||||
private channelEntityService: ChannelEntityService,
|
||||
private reversiGameEntityService: ReversiGameEntityService,
|
||||
private metaService: MetaService,
|
||||
private urlPreviewService: UrlPreviewService,
|
||||
private feedService: FeedService,
|
||||
@@ -686,6 +691,25 @@ export class ClientServerService {
|
||||
return await renderBase(reply);
|
||||
}
|
||||
});
|
||||
|
||||
// Reversi game
|
||||
fastify.get<{ Params: { game: string; } }>('/reversi/g/:game', async (request, reply) => {
|
||||
const game = await this.reversiGamesRepository.findOneBy({
|
||||
id: request.params.game,
|
||||
});
|
||||
|
||||
if (game) {
|
||||
const _game = await this.reversiGameEntityService.packDetail(game);
|
||||
const meta = await this.metaService.fetch();
|
||||
reply.header('Cache-Control', 'public, max-age=3600');
|
||||
return await reply.view('reversi-game', {
|
||||
game: _game,
|
||||
...this.generateCommonPugData(meta),
|
||||
});
|
||||
} else {
|
||||
return await renderBase(reply);
|
||||
}
|
||||
});
|
||||
//#endregion
|
||||
|
||||
fastify.get('/_info_card_', async (request, reply) => {
|
||||
|
20
packages/backend/src/server/web/views/reversi-game.pug
Normal file
20
packages/backend/src/server/web/views/reversi-game.pug
Normal file
@@ -0,0 +1,20 @@
|
||||
extends ./base
|
||||
|
||||
block vars
|
||||
- const user1 = game.user1;
|
||||
- const user2 = game.user2;
|
||||
- const title = `${user1.username} vs ${user2.username}`;
|
||||
- const url = `${config.url}/reversi/g/${game.id}`;
|
||||
|
||||
block title
|
||||
= `${title} | ${instanceName}`
|
||||
|
||||
block desc
|
||||
meta(name='description' content='⚫⚪Misskey Reversi⚪⚫')
|
||||
|
||||
block og
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content='⚫⚪Misskey Reversi⚪⚫')
|
||||
meta(property='og:url' content= url)
|
||||
meta(property='twitter:card' content='summary')
|
@@ -277,7 +277,11 @@ export type Serialized<T> = {
|
||||
? (string | null)
|
||||
: T[K] extends Record<string, any>
|
||||
? Serialized<T[K]>
|
||||
: T[K];
|
||||
: T[K] extends (Record<string, any> | null)
|
||||
? (Serialized<T[K]> | null)
|
||||
: T[K] extends (Record<string, any> | undefined)
|
||||
? (Serialized<T[K]> | undefined)
|
||||
: T[K];
|
||||
};
|
||||
|
||||
export type FilterUnionByProperty<
|
||||
|
5
packages/frontend/@types/global.d.ts
vendored
5
packages/frontend/@types/global.d.ts
vendored
@@ -16,3 +16,8 @@ declare const _DATA_TRANSFER_DECK_COLUMN_: string;
|
||||
|
||||
// for dev-mode
|
||||
declare const _LANGS_FULL_: string[][];
|
||||
|
||||
// TagCanvas
|
||||
interface Window {
|
||||
TagCanvas: any;
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 181 KiB |
@@ -20,15 +20,15 @@
|
||||
"@discordapp/twemoji": "15.0.2",
|
||||
"@github/webauthn-json": "2.1.1",
|
||||
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
|
||||
"@misskey-dev/browser-image-resizer": "2.2.1-misskey.10",
|
||||
"@misskey-dev/browser-image-resizer": "2024.1.0",
|
||||
"@rollup/plugin-json": "6.1.0",
|
||||
"@rollup/plugin-replace": "5.0.5",
|
||||
"@rollup/pluginutils": "5.1.0",
|
||||
"@syuilo/aiscript": "0.17.0",
|
||||
"@tabler/icons-webfont": "2.44.0",
|
||||
"@twemoji/parser": "15.0.0",
|
||||
"@vitejs/plugin-vue": "5.0.2",
|
||||
"@vue/compiler-sfc": "3.4.3",
|
||||
"@vitejs/plugin-vue": "5.0.3",
|
||||
"@vue/compiler-sfc": "3.4.15",
|
||||
"aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.0.6",
|
||||
"astring": "1.8.6",
|
||||
"broadcast-channel": "7.0.0",
|
||||
@@ -39,9 +39,8 @@
|
||||
"chartjs-chart-matrix": "2.0.1",
|
||||
"chartjs-plugin-gradient": "0.6.1",
|
||||
"chartjs-plugin-zoom": "2.0.1",
|
||||
"chromatic": "10.3.1",
|
||||
"chromatic": "10.6.1",
|
||||
"compare-versions": "6.1.0",
|
||||
"crc-32": "^1.2.2",
|
||||
"cropperjs": "2.0.0-beta.4",
|
||||
"date-fns": "2.30.0",
|
||||
"escape-regexp": "0.0.1",
|
||||
@@ -53,9 +52,9 @@
|
||||
"json5": "2.2.3",
|
||||
"matter-js": "0.19.0",
|
||||
"mfm-js": "0.24.0",
|
||||
"misskey-bubble-game": "workspace:*",
|
||||
"misskey-js": "workspace:*",
|
||||
"misskey-reversi": "workspace:*",
|
||||
"misskey-bubble-game": "workspace:*",
|
||||
"photoswipe": "5.4.3",
|
||||
"punycode": "2.3.1",
|
||||
"rollup": "4.9.6",
|
||||
@@ -64,7 +63,7 @@
|
||||
"shiki": "0.14.7",
|
||||
"strict-event-emitter-types": "2.0.0",
|
||||
"textarea-caret": "3.1.0",
|
||||
"three": "0.160.0",
|
||||
"three": "0.160.1",
|
||||
"throttle-debounce": "5.0.0",
|
||||
"tinycolor2": "1.6.0",
|
||||
"tsc-alias": "1.8.8",
|
||||
@@ -77,8 +76,8 @@
|
||||
"vuedraggable": "next"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@misskey-dev/eslint-plugin": "^1.0.0",
|
||||
"@misskey-dev/summaly": "^5.0.3",
|
||||
"@misskey-dev/eslint-plugin": "1.0.0",
|
||||
"@misskey-dev/summaly": "5.0.3",
|
||||
"@storybook/addon-actions": "7.6.10",
|
||||
"@storybook/addon-essentials": "7.6.10",
|
||||
"@storybook/addon-interactions": "7.6.10",
|
||||
@@ -102,16 +101,16 @@
|
||||
"@types/estree": "1.0.5",
|
||||
"@types/matter-js": "0.19.6",
|
||||
"@types/micromatch": "4.0.6",
|
||||
"@types/node": "20.11.5",
|
||||
"@types/node": "20.11.10",
|
||||
"@types/punycode": "2.1.3",
|
||||
"@types/sanitize-html": "2.9.5",
|
||||
"@types/throttle-debounce": "5.0.2",
|
||||
"@types/tinycolor2": "1.4.6",
|
||||
"@types/uuid": "9.0.7",
|
||||
"@types/uuid": "9.0.8",
|
||||
"@types/ws": "8.5.10",
|
||||
"@typescript-eslint/eslint-plugin": "6.19.0",
|
||||
"@typescript-eslint/parser": "6.19.0",
|
||||
"@vitest/coverage-v8": "1.2.1",
|
||||
"@typescript-eslint/eslint-plugin": "6.18.1",
|
||||
"@typescript-eslint/parser": "6.18.1",
|
||||
"@vitest/coverage-v8": "0.34.6",
|
||||
"@vue/runtime-core": "3.4.15",
|
||||
"acorn": "8.11.3",
|
||||
"cross-env": "7.0.3",
|
||||
@@ -133,9 +132,9 @@
|
||||
"storybook": "7.6.10",
|
||||
"storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme",
|
||||
"vite-plugin-turbosnap": "1.0.3",
|
||||
"vitest": "1.2.1",
|
||||
"vitest": "0.34.6",
|
||||
"vitest-fetch-mock": "0.2.2",
|
||||
"vue-eslint-parser": "9.4.0",
|
||||
"vue-eslint-parser": "9.4.2",
|
||||
"vue-tsc": "1.8.27"
|
||||
}
|
||||
}
|
||||
|
@@ -39,7 +39,7 @@ import * as os from '@/os.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
const props = defineProps<{
|
||||
user: Misskey.entities.User;
|
||||
user: Misskey.entities.UserDetailed;
|
||||
initialComment?: string;
|
||||
}>();
|
||||
|
||||
|
@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="achievements" :class="$style.root">
|
||||
<div v-for="achievement in achievements" :key="achievement" :class="$style.achievement" class="_panel">
|
||||
<div v-for="achievement in achievements" :key="achievement.name" :class="$style.achievement" class="_panel">
|
||||
<div :class="$style.icon">
|
||||
<div
|
||||
:class="[$style.iconFrame, {
|
||||
|
@@ -49,7 +49,7 @@ async function ok() {
|
||||
if (confirm.canceled) return;
|
||||
}
|
||||
|
||||
modal.value.close();
|
||||
modal.value?.close();
|
||||
misskeyApi('i/read-announcement', { announcementId: props.announcement.id });
|
||||
updateAccount({
|
||||
unreadAnnouncements: $i!.unreadAnnouncements.filter(a => a.id !== props.announcement.id),
|
||||
@@ -57,7 +57,7 @@ async function ok() {
|
||||
}
|
||||
|
||||
function onBgClick() {
|
||||
rootEl.value.animate([{
|
||||
rootEl.value?.animate([{
|
||||
offset: 0,
|
||||
transform: 'scale(1)',
|
||||
}, {
|
||||
|
@@ -10,8 +10,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<MkAsUi v-if="!g(child).hidden" :component="g(child)" :components="props.components" :size="size"/>
|
||||
</template>
|
||||
</div>
|
||||
<span v-else-if="c.type === 'text'" :class="{ [$style.fontSerif]: c.font === 'serif', [$style.fontMonospace]: c.font === 'monospace' }" :style="{ fontSize: c.size ? `${c.size * 100}%` : null, fontWeight: c.bold ? 'bold' : null, color: c.color ?? null }">{{ c.text }}</span>
|
||||
<Mfm v-else-if="c.type === 'mfm'" :class="{ [$style.fontSerif]: c.font === 'serif', [$style.fontMonospace]: c.font === 'monospace' }" :style="{ fontSize: c.size ? `${c.size * 100}%` : null, fontWeight: c.bold ? 'bold' : null, color: c.color ?? null }" :text="c.text" @clickEv="c.onClickEv"/>
|
||||
<span v-else-if="c.type === 'text'" :class="{ [$style.fontSerif]: c.font === 'serif', [$style.fontMonospace]: c.font === 'monospace' }" :style="{ fontSize: c.size ? `${c.size * 100}%` : undefined, fontWeight: c.bold ? 'bold' : undefined, color: c.color }">{{ c.text }}</span>
|
||||
<Mfm v-else-if="c.type === 'mfm'" :class="{ [$style.fontSerif]: c.font === 'serif', [$style.fontMonospace]: c.font === 'monospace' }" :style="{ fontSize: c.size ? `${c.size * 100}%` : null, fontWeight: c.bold ? 'bold' : null, color: c.color ?? null }" :text="c.text ?? ''" @clickEv="c.onClickEv"/>
|
||||
<MkButton v-else-if="c.type === 'button'" :primary="c.primary" :rounded="c.rounded" :disabled="c.disabled" :small="size === 'small'" inline @click="c.onClick">{{ c.text }}</MkButton>
|
||||
<div v-else-if="c.type === 'buttons'" class="_buttons" :style="{ justifyContent: align }">
|
||||
<MkButton v-for="button in c.buttons" :primary="button.primary" :rounded="button.rounded" :disabled="button.disabled" inline :small="size === 'small'" @click="button.onClick">{{ button.text }}</MkButton>
|
||||
@@ -20,19 +20,19 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template v-if="c.label" #label>{{ c.label }}</template>
|
||||
<template v-if="c.caption" #caption>{{ c.caption }}</template>
|
||||
</MkSwitch>
|
||||
<MkTextarea v-else-if="c.type === 'textarea'" :modelValue="c.default" @update:modelValue="c.onInput">
|
||||
<MkTextarea v-else-if="c.type === 'textarea'" :modelValue="c.default ?? null" @update:modelValue="c.onInput">
|
||||
<template v-if="c.label" #label>{{ c.label }}</template>
|
||||
<template v-if="c.caption" #caption>{{ c.caption }}</template>
|
||||
</MkTextarea>
|
||||
<MkInput v-else-if="c.type === 'textInput'" :small="size === 'small'" :modelValue="c.default" @update:modelValue="c.onInput">
|
||||
<MkInput v-else-if="c.type === 'textInput'" :small="size === 'small'" :modelValue="c.default ?? null" @update:modelValue="c.onInput">
|
||||
<template v-if="c.label" #label>{{ c.label }}</template>
|
||||
<template v-if="c.caption" #caption>{{ c.caption }}</template>
|
||||
</MkInput>
|
||||
<MkInput v-else-if="c.type === 'numberInput'" :small="size === 'small'" :modelValue="c.default" type="number" @update:modelValue="c.onInput">
|
||||
<MkInput v-else-if="c.type === 'numberInput'" :small="size === 'small'" :modelValue="c.default ?? null" type="number" @update:modelValue="c.onInput">
|
||||
<template v-if="c.label" #label>{{ c.label }}</template>
|
||||
<template v-if="c.caption" #caption>{{ c.caption }}</template>
|
||||
</MkInput>
|
||||
<MkSelect v-else-if="c.type === 'select'" :small="size === 'small'" :modelValue="c.default" @update:modelValue="c.onChange">
|
||||
<MkSelect v-else-if="c.type === 'select'" :small="size === 'small'" :modelValue="c.default ?? null" @update:modelValue="c.onChange">
|
||||
<template v-if="c.label" #label>{{ c.label }}</template>
|
||||
<template v-if="c.caption" #caption>{{ c.caption }}</template>
|
||||
<option v-for="item in c.items" :key="item.value" :value="item.value">{{ item.text }}</option>
|
||||
@@ -42,8 +42,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<MkPostForm
|
||||
fixed
|
||||
:instant="true"
|
||||
:initialText="c.form.text"
|
||||
:initialCw="c.form.cw"
|
||||
:initialText="c.form?.text"
|
||||
:initialCw="c.form?.cw"
|
||||
/>
|
||||
</div>
|
||||
<MkFolder v-else-if="c.type === 'folder'" :defaultOpen="c.opened">
|
||||
@@ -52,7 +52,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<MkAsUi v-if="!g(child).hidden" :component="g(child)" :components="props.components" :size="size"/>
|
||||
</template>
|
||||
</MkFolder>
|
||||
<div v-else-if="c.type === 'container'" :class="[$style.container, { [$style.fontSerif]: c.font === 'serif', [$style.fontMonospace]: c.font === 'monospace' }]" :style="{ textAlign: c.align ?? null, backgroundColor: c.bgColor ?? null, color: c.fgColor ?? null, borderWidth: c.borderWidth ? `${c.borderWidth}px` : 0, borderColor: c.borderColor ?? 'var(--divider)', padding: c.padding ? `${c.padding}px` : 0, borderRadius: c.rounded ? '8px' : 0 }">
|
||||
<div v-else-if="c.type === 'container'" :class="[$style.container, { [$style.fontSerif]: c.font === 'serif', [$style.fontMonospace]: c.font === 'monospace' }]" :style="{ textAlign: c.align, backgroundColor: c.bgColor, color: c.fgColor, borderWidth: c.borderWidth ? `${c.borderWidth}px` : 0, borderColor: c.borderColor ?? 'var(--divider)', padding: c.padding ? `${c.padding}px` : 0, borderRadius: c.rounded ? '8px' : 0 }">
|
||||
<template v-for="child in c.children" :key="child">
|
||||
<MkAsUi v-if="!g(child).hidden" :component="g(child)" :components="props.components" :size="size" :align="c.align"/>
|
||||
</template>
|
||||
@@ -68,7 +68,7 @@ import MkInput from '@/components/MkInput.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import MkSelect from '@/components/MkSelect.vue';
|
||||
import { AsUiComponent } from '@/scripts/aiscript/ui.js';
|
||||
import { AsUiComponent, AsUiRoot, AsUiPostFormButton } from '@/scripts/aiscript/ui.js';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import MkPostForm from '@/components/MkPostForm.vue';
|
||||
|
||||
@@ -85,20 +85,32 @@ const props = withDefaults(defineProps<{
|
||||
const c = props.component;
|
||||
|
||||
function g(id) {
|
||||
return props.components.find(x => x.value.id === id).value;
|
||||
const v = props.components.find(x => x.value.id === id)?.value;
|
||||
if (v) return v;
|
||||
|
||||
return {
|
||||
id: 'dummy',
|
||||
type: 'root',
|
||||
children: [],
|
||||
} as AsUiRoot;
|
||||
}
|
||||
|
||||
const valueForSwitch = ref(c.default ?? false);
|
||||
const valueForSwitch = ref('default' in c && typeof c.default === 'boolean' ? c.default : false);
|
||||
|
||||
function onSwitchUpdate(v) {
|
||||
valueForSwitch.value = v;
|
||||
if (c.onChange) c.onChange(v);
|
||||
if ('onChange' in c && c.onChange) {
|
||||
c.onChange(v as never);
|
||||
}
|
||||
}
|
||||
|
||||
function openPostForm() {
|
||||
const form = (c as AsUiPostFormButton).form;
|
||||
if (!form) return;
|
||||
|
||||
os.post({
|
||||
initialText: c.form.text,
|
||||
initialCw: c.form.cw,
|
||||
initialText: form.text,
|
||||
initialCw: form.cw,
|
||||
instant: true,
|
||||
});
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<MkA
|
||||
v-else class="_button"
|
||||
:class="[$style.root, { [$style.inline]: inline, [$style.primary]: primary, [$style.gradate]: gradate, [$style.danger]: danger, [$style.rounded]: rounded, [$style.full]: full, [$style.small]: small, [$style.large]: large, [$style.transparent]: transparent, [$style.asLike]: asLike }]"
|
||||
:to="to"
|
||||
:to="to ?? '#'"
|
||||
@mousedown="onMousedown"
|
||||
>
|
||||
<div ref="ripples" :class="$style.ripples" :data-children-class="$style.ripple"></div>
|
||||
|
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<span v-if="!available">{{ i18n.ts.waiting }}<MkEllipsis/></span>
|
||||
<span v-if="!available">Loading<MkEllipsis/></span>
|
||||
<div v-if="props.provider == 'mcaptcha'">
|
||||
<div id="mcaptcha__widget-container" class="m-captcha-style"></div>
|
||||
<div ref="captchaEl"></div>
|
||||
@@ -17,7 +17,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<script lang="ts" setup>
|
||||
import { ref, shallowRef, computed, onMounted, onBeforeUnmount, watch, onUnmounted } from 'vue';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
// APIs provided by Captcha services
|
||||
export type Captcha = {
|
||||
|
@@ -21,13 +21,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { onMounted, ref, shallowRef, watch, PropType } from 'vue';
|
||||
import { Chart } from 'chart.js';
|
||||
import gradient from 'chartjs-plugin-gradient';
|
||||
import { misskeyApiGet } from '@/scripts/misskey-api.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
||||
import { chartVLine } from '@/scripts/chart-vline.js';
|
||||
import { alpha } from '@/scripts/color.js';
|
||||
import date from '@/filters/date.js';
|
||||
import bytes from '@/filters/bytes.js';
|
||||
import { initChart } from '@/scripts/init-chart.js';
|
||||
import { chartLegend } from '@/scripts/chart-legend.js';
|
||||
import MkChartLegend from '@/components/MkChartLegend.vue';
|
||||
@@ -95,7 +95,7 @@ const getColor = (i) => {
|
||||
};
|
||||
|
||||
const now = new Date();
|
||||
let chartInstance: Chart = null;
|
||||
let chartInstance: Chart | null = null;
|
||||
let chartData: {
|
||||
series: {
|
||||
name: string;
|
||||
@@ -108,9 +108,10 @@ let chartData: {
|
||||
y: number;
|
||||
}[];
|
||||
}[];
|
||||
} = null;
|
||||
bytes?: boolean;
|
||||
} | null = null;
|
||||
|
||||
const chartEl = shallowRef<HTMLCanvasElement>(null);
|
||||
const chartEl = shallowRef<HTMLCanvasElement | null>(null);
|
||||
const fetching = ref(true);
|
||||
|
||||
const getDate = (ago: number) => {
|
||||
@@ -132,6 +133,7 @@ const format = (arr) => {
|
||||
const { handler: externalTooltipHandler } = useChartTooltip();
|
||||
|
||||
const render = () => {
|
||||
if (chartData == null || chartEl.value == null) return;
|
||||
if (chartInstance) {
|
||||
chartInstance.destroy();
|
||||
}
|
||||
@@ -188,7 +190,6 @@ const render = () => {
|
||||
stacked: props.stacked,
|
||||
offset: false,
|
||||
time: {
|
||||
stepSize: 1,
|
||||
unit: props.span === 'day' ? 'month' : 'day',
|
||||
displayFormats: {
|
||||
day: 'M/d',
|
||||
@@ -198,6 +199,7 @@ const render = () => {
|
||||
grid: {
|
||||
},
|
||||
ticks: {
|
||||
stepSize: 1,
|
||||
display: props.detailed,
|
||||
maxRotation: 0,
|
||||
autoSkipPadding: 16,
|
||||
@@ -237,6 +239,9 @@ const render = () => {
|
||||
duration: 0,
|
||||
},
|
||||
external: externalTooltipHandler,
|
||||
callbacks: {
|
||||
label: (item) => chartData?.bytes ? bytes(item.parsed.y * 1000, 1) : item.parsed.y.toString(),
|
||||
},
|
||||
},
|
||||
zoom: props.detailed ? {
|
||||
pan: {
|
||||
@@ -265,10 +270,9 @@ const render = () => {
|
||||
},
|
||||
},
|
||||
} : undefined,
|
||||
gradient,
|
||||
},
|
||||
},
|
||||
plugins: [chartVLine(vLineColor), ...(props.detailed ? [chartLegend(legendEl.value)] : [])],
|
||||
plugins: [chartVLine(vLineColor), ...(props.detailed && legendEl.value ? [chartLegend(legendEl.value)] : [])],
|
||||
});
|
||||
};
|
||||
|
||||
@@ -566,7 +570,7 @@ const fetchDriveFilesChart = async (): Promise<typeof chartData> => {
|
||||
};
|
||||
|
||||
const fetchInstanceRequestsChart = async (): Promise<typeof chartData> => {
|
||||
const raw = await misskeyApiGet('charts/instance', { host: props.args.host, limit: props.limit, span: props.span });
|
||||
const raw = await misskeyApiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
||||
return {
|
||||
series: [{
|
||||
name: 'In',
|
||||
@@ -588,7 +592,7 @@ const fetchInstanceRequestsChart = async (): Promise<typeof chartData> => {
|
||||
};
|
||||
|
||||
const fetchInstanceUsersChart = async (total: boolean): Promise<typeof chartData> => {
|
||||
const raw = await misskeyApiGet('charts/instance', { host: props.args.host, limit: props.limit, span: props.span });
|
||||
const raw = await misskeyApiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
||||
return {
|
||||
series: [{
|
||||
name: 'Users',
|
||||
@@ -603,7 +607,7 @@ const fetchInstanceUsersChart = async (total: boolean): Promise<typeof chartData
|
||||
};
|
||||
|
||||
const fetchInstanceNotesChart = async (total: boolean): Promise<typeof chartData> => {
|
||||
const raw = await misskeyApiGet('charts/instance', { host: props.args.host, limit: props.limit, span: props.span });
|
||||
const raw = await misskeyApiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
||||
return {
|
||||
series: [{
|
||||
name: 'Notes',
|
||||
@@ -618,7 +622,7 @@ const fetchInstanceNotesChart = async (total: boolean): Promise<typeof chartData
|
||||
};
|
||||
|
||||
const fetchInstanceFfChart = async (total: boolean): Promise<typeof chartData> => {
|
||||
const raw = await misskeyApiGet('charts/instance', { host: props.args.host, limit: props.limit, span: props.span });
|
||||
const raw = await misskeyApiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
||||
return {
|
||||
series: [{
|
||||
name: 'Following',
|
||||
@@ -641,7 +645,7 @@ const fetchInstanceFfChart = async (total: boolean): Promise<typeof chartData> =
|
||||
};
|
||||
|
||||
const fetchInstanceDriveUsageChart = async (total: boolean): Promise<typeof chartData> => {
|
||||
const raw = await misskeyApiGet('charts/instance', { host: props.args.host, limit: props.limit, span: props.span });
|
||||
const raw = await misskeyApiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
||||
return {
|
||||
bytes: true,
|
||||
series: [{
|
||||
@@ -649,7 +653,7 @@ const fetchInstanceDriveUsageChart = async (total: boolean): Promise<typeof char
|
||||
type: 'area',
|
||||
color: '#008FFB',
|
||||
data: format(total
|
||||
? raw.drive.totalUsage
|
||||
? sum(raw.drive.incUsage)
|
||||
: sum(raw.drive.incUsage, negate(raw.drive.decUsage)),
|
||||
),
|
||||
}],
|
||||
@@ -657,7 +661,7 @@ const fetchInstanceDriveUsageChart = async (total: boolean): Promise<typeof char
|
||||
};
|
||||
|
||||
const fetchInstanceDriveFilesChart = async (total: boolean): Promise<typeof chartData> => {
|
||||
const raw = await misskeyApiGet('charts/instance', { host: props.args.host, limit: props.limit, span: props.span });
|
||||
const raw = await misskeyApiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
||||
return {
|
||||
series: [{
|
||||
name: 'Drive files',
|
||||
@@ -672,11 +676,11 @@ const fetchInstanceDriveFilesChart = async (total: boolean): Promise<typeof char
|
||||
};
|
||||
|
||||
const fetchPerUserNotesChart = async (): Promise<typeof chartData> => {
|
||||
const raw = await misskeyApiGet('charts/user/notes', { userId: props.args.user.id, limit: props.limit, span: props.span });
|
||||
const raw = await misskeyApiGet('charts/user/notes', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
||||
return {
|
||||
series: [...(props.args.withoutAll ? [] : [{
|
||||
series: [...(props.args?.withoutAll ? [] : [{
|
||||
name: 'All',
|
||||
type: 'line',
|
||||
type: 'line' as const,
|
||||
data: format(sum(raw.inc, negate(raw.dec))),
|
||||
color: '#888888',
|
||||
}]), {
|
||||
@@ -704,7 +708,7 @@ const fetchPerUserNotesChart = async (): Promise<typeof chartData> => {
|
||||
};
|
||||
|
||||
const fetchPerUserPvChart = async (): Promise<typeof chartData> => {
|
||||
const raw = await misskeyApiGet('charts/user/pv', { userId: props.args.user.id, limit: props.limit, span: props.span });
|
||||
const raw = await misskeyApiGet('charts/user/pv', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
||||
return {
|
||||
series: [{
|
||||
name: 'Unique PV (user)',
|
||||
@@ -731,7 +735,7 @@ const fetchPerUserPvChart = async (): Promise<typeof chartData> => {
|
||||
};
|
||||
|
||||
const fetchPerUserFollowingChart = async (): Promise<typeof chartData> => {
|
||||
const raw = await misskeyApiGet('charts/user/following', { userId: props.args.user.id, limit: props.limit, span: props.span });
|
||||
const raw = await misskeyApiGet('charts/user/following', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
||||
return {
|
||||
series: [{
|
||||
name: 'Local',
|
||||
@@ -746,7 +750,7 @@ const fetchPerUserFollowingChart = async (): Promise<typeof chartData> => {
|
||||
};
|
||||
|
||||
const fetchPerUserFollowersChart = async (): Promise<typeof chartData> => {
|
||||
const raw = await misskeyApiGet('charts/user/following', { userId: props.args.user.id, limit: props.limit, span: props.span });
|
||||
const raw = await misskeyApiGet('charts/user/following', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
||||
return {
|
||||
series: [{
|
||||
name: 'Local',
|
||||
@@ -761,8 +765,9 @@ const fetchPerUserFollowersChart = async (): Promise<typeof chartData> => {
|
||||
};
|
||||
|
||||
const fetchPerUserDriveChart = async (): Promise<typeof chartData> => {
|
||||
const raw = await misskeyApiGet('charts/user/drive', { userId: props.args.user.id, limit: props.limit, span: props.span });
|
||||
const raw = await misskeyApiGet('charts/user/drive', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
||||
return {
|
||||
bytes: true,
|
||||
series: [{
|
||||
name: 'Inc',
|
||||
type: 'area',
|
||||
@@ -806,6 +811,8 @@ const fetchAndRender = async () => {
|
||||
case 'per-user-following': return fetchPerUserFollowingChart();
|
||||
case 'per-user-followers': return fetchPerUserFollowersChart();
|
||||
case 'per-user-drive': return fetchPerUserDriveChart();
|
||||
|
||||
default: return null;
|
||||
}
|
||||
};
|
||||
fetching.value = true;
|
||||
|
@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template>
|
||||
<div :class="$style.root">
|
||||
<button v-for="item in items" class="_button item" :class="{ disabled: item.hidden }" @click="onClick(item)">
|
||||
<span class="box" :style="{ background: chart.config.type === 'line' ? item.strokeStyle?.toString() : item.fillStyle?.toString() }"></span>
|
||||
<span class="box" :style="{ background: type === 'line' ? item.strokeStyle?.toString() : item.fillStyle?.toString() }"></span>
|
||||
{{ item.text }}
|
||||
</button>
|
||||
</div>
|
||||
@@ -16,25 +16,23 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { shallowRef } from 'vue';
|
||||
import { Chart, LegendItem } from 'chart.js';
|
||||
|
||||
const props = defineProps({
|
||||
});
|
||||
|
||||
const chart = shallowRef<Chart>();
|
||||
const type = shallowRef<string>();
|
||||
const items = shallowRef<LegendItem[]>([]);
|
||||
|
||||
function update(_chart: Chart, _items: LegendItem[]) {
|
||||
chart.value = _chart,
|
||||
items.value = _items;
|
||||
if ('type' in _chart.config) type.value = _chart.config.type;
|
||||
}
|
||||
|
||||
function onClick(item: LegendItem) {
|
||||
if (chart.value == null) return;
|
||||
const { type } = chart.value.config;
|
||||
if (type === 'pie' || type === 'doughnut') {
|
||||
if (type.value === 'pie' || type.value === 'doughnut') {
|
||||
// Pie and doughnut charts only have a single dataset and visibility is per item
|
||||
chart.value.toggleDataVisibility(item.index);
|
||||
if (item.index) chart.value.toggleDataVisibility(item.index);
|
||||
} else {
|
||||
chart.value.setDatasetVisibility(item.datasetIndex, !chart.value.isDatasetVisible(item.datasetIndex));
|
||||
if (item.datasetIndex) chart.value.setDatasetVisibility(item.datasetIndex, !chart.value.isDatasetVisible(item.datasetIndex));
|
||||
}
|
||||
chart.value.update();
|
||||
}
|
||||
|
@@ -41,8 +41,8 @@ const { modelValue } = toRefs(props);
|
||||
const v = ref(modelValue.value);
|
||||
const inputEl = shallowRef<HTMLElement>();
|
||||
|
||||
const onInput = (ev: KeyboardEvent) => {
|
||||
emit('update:modelValue', v.value);
|
||||
const onInput = () => {
|
||||
emit('update:modelValue', v.value ?? '');
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -44,8 +44,8 @@ onMounted(() => {
|
||||
let left = props.ev.pageX + 1; // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1
|
||||
let top = props.ev.pageY + 1; // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1
|
||||
|
||||
const width = rootEl.value.offsetWidth;
|
||||
const height = rootEl.value.offsetHeight;
|
||||
const width = rootEl.value!.offsetWidth;
|
||||
const height = rootEl.value!.offsetHeight;
|
||||
|
||||
if (left + width - window.pageXOffset >= (window.innerWidth - SCROLLBAR_THICKNESS)) {
|
||||
left = (window.innerWidth - SCROLLBAR_THICKNESS) - width + window.pageXOffset;
|
||||
@@ -63,8 +63,10 @@ onMounted(() => {
|
||||
left = 0;
|
||||
}
|
||||
|
||||
rootEl.value.style.top = `${top}px`;
|
||||
rootEl.value.style.left = `${left}px`;
|
||||
if (rootEl.value) {
|
||||
rootEl.value.style.top = `${top}px`;
|
||||
rootEl.value.style.left = `${left}px`;
|
||||
}
|
||||
|
||||
document.body.addEventListener('mousedown', onMousedown);
|
||||
});
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user